@ammarkhalidfarooq/dashboard-package 0.6.92 → 0.6.94

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
@@ -1533,7 +1533,7 @@ var getActiveFilterChips = function getActiveFilterChips(apiData) {
1533
1533
  return s.trim();
1534
1534
  }).filter(Boolean);
1535
1535
  }
1536
- return ["Status: Successful", "Country: United States, UAE", "Amount: $50 – $5,000"];
1536
+ return [];
1537
1537
  };
1538
1538
  var buildReportData = function buildReportData() {
1539
1539
  var _apiData$overviewStat2, _overview$totalRevenu, _overview$netRevenue, _overview$totalDonati, _overview$overallAVGD, _overview$conversionR, _apiData$totalVisits, _overview$overallAVGD2, _growth$overallAVGDon, _growth$totalRevenue, _growth$netRevenue, _growth$totalDonation, _growth$overallAVGDon2, _apiData$roasCard, _apiData$roasCardPrev, _apiData$adSpend, _apiData$attributedRe, _growth$conversionRat, _apiData$overviewStat3, _growth$totalRevenue2;
@@ -1543,13 +1543,13 @@ var buildReportData = function buildReportData() {
1543
1543
  var refundsRaw = (apiData === null || apiData === void 0 ? void 0 : apiData.refundAndChargeBacks) || {};
1544
1544
  var refunds = parseRefundsChargebacks(refundsRaw);
1545
1545
  var avgDonationDetail = parseAvgDonationDetail(apiData);
1546
- var totalRaised = Number((_overview$totalRevenu = overview === null || overview === void 0 ? void 0 : overview.totalRevenue) !== null && _overview$totalRevenu !== void 0 ? _overview$totalRevenu : 240938);
1547
- var netRaised = Number((_overview$netRevenue = overview === null || overview === void 0 ? void 0 : overview.netRevenue) !== null && _overview$netRevenue !== void 0 ? _overview$netRevenue : 222300);
1548
- var totalDonors = Number((_overview$totalDonati = overview === null || overview === void 0 ? void 0 : overview.totalDonations) !== null && _overview$totalDonati !== void 0 ? _overview$totalDonati : 215);
1549
- var avgDonation = Number((_overview$overallAVGD = overview === null || overview === void 0 ? void 0 : overview.overallAVGDonations) !== null && _overview$overallAVGD !== void 0 ? _overview$overallAVGD : 130.58);
1550
- var convRate = Number((_overview$conversionR = overview === null || overview === void 0 ? void 0 : overview.conversionRate) !== null && _overview$conversionR !== void 0 ? _overview$conversionR : 1.7);
1551
- var totalVisits = Number((_apiData$totalVisits = apiData === null || apiData === void 0 ? void 0 : apiData.totalVisits) !== null && _apiData$totalVisits !== void 0 ? _apiData$totalVisits : 12438);
1552
- var passThrough = totalRaised > 0 ? "".concat((netRaised / totalRaised * 100).toFixed(1), "% pass-through") : "92.3% pass-through";
1546
+ var totalRaised = Number((_overview$totalRevenu = overview === null || overview === void 0 ? void 0 : overview.totalRevenue) !== null && _overview$totalRevenu !== void 0 ? _overview$totalRevenu : 0);
1547
+ var netRaised = Number((_overview$netRevenue = overview === null || overview === void 0 ? void 0 : overview.netRevenue) !== null && _overview$netRevenue !== void 0 ? _overview$netRevenue : 0);
1548
+ var totalDonors = Number((_overview$totalDonati = overview === null || overview === void 0 ? void 0 : overview.totalDonations) !== null && _overview$totalDonati !== void 0 ? _overview$totalDonati : 0);
1549
+ var avgDonation = Number((_overview$overallAVGD = overview === null || overview === void 0 ? void 0 : overview.overallAVGDonations) !== null && _overview$overallAVGD !== void 0 ? _overview$overallAVGD : 0);
1550
+ var convRate = Number((_overview$conversionR = overview === null || overview === void 0 ? void 0 : overview.conversionRate) !== null && _overview$conversionR !== void 0 ? _overview$conversionR : 0);
1551
+ var totalVisits = Number((_apiData$totalVisits = apiData === null || apiData === void 0 ? void 0 : apiData.totalVisits) !== null && _apiData$totalVisits !== void 0 ? _apiData$totalVisits : 0);
1552
+ var passThrough = totalRaised > 0 ? "".concat((netRaised / totalRaised * 100).toFixed(1), "% pass-through") : "0% pass-through";
1553
1553
  var donorMixRaw = apiData === null || apiData === void 0 ? void 0 : apiData.donorPieChartData;
1554
1554
  var newDonors = 0;
1555
1555
  var returningDonors = 0;
@@ -1573,18 +1573,18 @@ var buildReportData = function buildReportData() {
1573
1573
  var retPct = totalMix > 0 ? 100 - newPct : 0;
1574
1574
  var hero = {
1575
1575
  value: "$".concat(formatNumber(totalRaised)),
1576
- trend: "".concat(formatTrend((_growth$totalRevenue = growth === null || growth === void 0 ? void 0 : growth.totalRevenue) !== null && _growth$totalRevenue !== void 0 ? _growth$totalRevenue : 18), " vs pp"),
1576
+ trend: "".concat(formatTrend((_growth$totalRevenue = growth === null || growth === void 0 ? void 0 : growth.totalRevenue) !== null && _growth$totalRevenue !== void 0 ? _growth$totalRevenue : 0), " vs pp"),
1577
1577
  detail: "".concat(passThrough, " - ").concat(formatNumber(totalDonors), " donors - $").concat(formatNumber(Number(avgDonation).toFixed(2)), " avg - ").concat(formatNumber(totalVisits), " visits")
1578
1578
  };
1579
1579
  var metrics = [{
1580
1580
  title: "Net Raised",
1581
1581
  value: "$".concat(formatNumber(netRaised)),
1582
- trend: formatTrend((_growth$netRevenue = growth === null || growth === void 0 ? void 0 : growth.netRevenue) !== null && _growth$netRevenue !== void 0 ? _growth$netRevenue : 17.4),
1582
+ trend: formatTrend((_growth$netRevenue = growth === null || growth === void 0 ? void 0 : growth.netRevenue) !== null && _growth$netRevenue !== void 0 ? _growth$netRevenue : 0),
1583
1583
  detail: passThrough
1584
1584
  }, {
1585
1585
  title: "Total Donors",
1586
1586
  value: formatNumber(totalDonors),
1587
- trend: formatTrend((_growth$totalDonation = growth === null || growth === void 0 ? void 0 : growth.totalDonations) !== null && _growth$totalDonation !== void 0 ? _growth$totalDonation : 16.8),
1587
+ trend: formatTrend((_growth$totalDonation = growth === null || growth === void 0 ? void 0 : growth.totalDonations) !== null && _growth$totalDonation !== void 0 ? _growth$totalDonation : 0),
1588
1588
  detail: "".concat(formatNumber(newDonors), " new - ").concat(formatNumber(returningDonors), " returning")
1589
1589
  }, {
1590
1590
  title: "Avg Donation",
@@ -1599,7 +1599,7 @@ var buildReportData = function buildReportData() {
1599
1599
  }, {
1600
1600
  title: "Conversion",
1601
1601
  value: "".concat(formatNumber(convRate), "%"),
1602
- trend: formatTrend((_growth$conversionRat = growth === null || growth === void 0 ? void 0 : growth.conversionRate) !== null && _growth$conversionRat !== void 0 ? _growth$conversionRat : 0.21, "pp"),
1602
+ trend: formatTrend((_growth$conversionRat = growth === null || growth === void 0 ? void 0 : growth.conversionRate) !== null && _growth$conversionRat !== void 0 ? _growth$conversionRat : 0, "pp"),
1603
1603
  detail: "".concat(formatNumber(totalDonors), " from ").concat(formatNumber(totalVisits), " visits")
1604
1604
  }, {
1605
1605
  title: "Refund Rate",
@@ -1614,7 +1614,7 @@ var buildReportData = function buildReportData() {
1614
1614
  label: "Total revenue trend",
1615
1615
  subtitle: "Last 30 days - daily aggregation",
1616
1616
  value: "$".concat(formatNumber(totalRaised)),
1617
- trend: "".concat(formatTrend((_growth$totalRevenue2 = growth === null || growth === void 0 ? void 0 : growth.totalRevenue) !== null && _growth$totalRevenue2 !== void 0 ? _growth$totalRevenue2 : 18), " vs pp"),
1617
+ trend: "".concat(formatTrend((_growth$totalRevenue2 = growth === null || growth === void 0 ? void 0 : growth.totalRevenue) !== null && _growth$totalRevenue2 !== void 0 ? _growth$totalRevenue2 : 0), " vs pp"),
1618
1618
  hideControls: true,
1619
1619
  stacked: true,
1620
1620
  colors: ["#6366F1", "#10B981", "#06B6D4"],
@@ -1647,60 +1647,21 @@ var buildReportData = function buildReportData() {
1647
1647
  categories: categories
1648
1648
  });
1649
1649
  } else {
1650
- var _categories = (apiData === null || apiData === void 0 ? void 0 : apiData.categories) || ["Apr 5", "Apr 11", "Apr 17", "Apr 23", "Apr 29", "May 4"];
1651
- var base = (apiData === null || apiData === void 0 ? void 0 : apiData.revenueData) || [3000, 4500, 5200, 5800, 6200, 7100, 8500, 9200, 9500];
1652
1650
  mainChart = _objectSpread2(_objectSpread2({}, mainChart), {}, {
1653
1651
  series: [{
1654
1652
  name: "Paid Ads",
1655
- data: base.map(function (v) {
1656
- return v * 0.55;
1657
- })
1653
+ data: []
1658
1654
  }, {
1659
1655
  name: "Organic",
1660
- data: base.map(function (v) {
1661
- return v * 0.28;
1662
- })
1656
+ data: []
1663
1657
  }, {
1664
1658
  name: "Email",
1665
- data: base.map(function (v) {
1666
- return v * 0.17;
1667
- })
1659
+ data: []
1668
1660
  }],
1669
- categories: _categories
1661
+ categories: (apiData === null || apiData === void 0 ? void 0 : apiData.categories) || []
1670
1662
  });
1671
1663
  }
1672
- var sampleCampaigns = [{
1673
- title: "Orphan sponsorship — Yemen",
1674
- collectedAmount: 78400,
1675
- usdTargetAmount: 100000,
1676
- uniqueDonationsCount: 82,
1677
- status: "Active"
1678
- }, {
1679
- title: "Emergency food — Gaza",
1680
- collectedAmount: 62100,
1681
- usdTargetAmount: 75000,
1682
- uniqueDonationsCount: 61,
1683
- status: "Active"
1684
- }, {
1685
- title: "Masjid build — Somalia",
1686
- collectedAmount: 38200,
1687
- usdTargetAmount: 83000,
1688
- uniqueDonationsCount: 34,
1689
- status: "Slow"
1690
- }, {
1691
- title: "Water wells — Pakistan",
1692
- collectedAmount: 29800,
1693
- usdTargetAmount: 30000,
1694
- uniqueDonationsCount: 28,
1695
- status: "Closing"
1696
- }, {
1697
- title: "Ramadan packs — Egypt",
1698
- collectedAmount: 18400,
1699
- usdTargetAmount: 23500,
1700
- uniqueDonationsCount: 10,
1701
- status: "Active"
1702
- }];
1703
- var campaignSource = ((apiData === null || apiData === void 0 ? void 0 : apiData.activeCampaigns) || []).length ? apiData.activeCampaigns : sampleCampaigns;
1664
+ var campaignSource = (apiData === null || apiData === void 0 ? void 0 : apiData.activeCampaigns) || [];
1704
1665
  var activeCampaigns = campaignSource.map(function (campaign) {
1705
1666
  return {
1706
1667
  id: campaign.campaignName ? campaign.campaignName.split(" ").filter(Boolean).map(function (w) {
@@ -1747,18 +1708,19 @@ var W = 794;
1747
1708
  var MIN_H = 1123;
1748
1709
  var MX = 32; // horizontal margin
1749
1710
  var THEME = {
1750
- pageBg: "#F8FAFC",
1711
+ pageBg: "#F9FAFB",
1751
1712
  panelBg: "#FFFFFF",
1752
- panelBorder: "#DDE3EA",
1753
- kpiBgPrimary: "#EEF2FF",
1713
+ panelBorder: "#E5E7EB",
1714
+ brand: "#6366F1",
1754
1715
  kpiBorderPrimary: "#C7D2FE",
1755
- kpiBgSecondary: "#F8FAFF",
1756
- kpiBorderSecondary: "#DDE3EA",
1757
1716
  tableHeadBg: "#EEF2FF",
1758
1717
  tableAltBg: "#F8FAFF",
1759
- muted: "#94A3B8",
1760
- text: "#111827"
1718
+ muted: "#9CA3AF",
1719
+ text: "#111827",
1720
+ trendUpBg: "#D1FAE5",
1721
+ trendUpText: "#059669"
1761
1722
  };
1723
+ var BULLET = " · ";
1762
1724
 
1763
1725
  // ─── Number helpers ───────────────────────────────────────────────────────────
1764
1726
  var d$ = function d$(v) {
@@ -1771,7 +1733,7 @@ var kpiPct = function kpiPct(v) {
1771
1733
  return "".concat(formatNumber(Number(v !== null && v !== void 0 ? v : 0).toFixed(2)), "%");
1772
1734
  };
1773
1735
  var kpiRoas = function kpiRoas(v) {
1774
- return "".concat(formatNumber(Number(v !== null && v !== void 0 ? v : 0).toFixed(2)), "\xD7");
1736
+ return "".concat(Number(v !== null && v !== void 0 ? v : 0).toFixed(1), "\xD7");
1775
1737
  };
1776
1738
  var d$Compact = function d$Compact(v) {
1777
1739
  var n = Number(v !== null && v !== void 0 ? v : 0);
@@ -1783,11 +1745,6 @@ var pct = function pct(v) {
1783
1745
  var dp = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
1784
1746
  return "".concat(Number(v !== null && v !== void 0 ? v : 0).toFixed(dp), "%");
1785
1747
  };
1786
- var signed = function signed(v) {
1787
- var suffix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "%";
1788
- var n = Number(v !== null && v !== void 0 ? v : 0);
1789
- return "".concat(n >= 0 ? "+" : "").concat(n.toFixed(2)).concat(suffix);
1790
- };
1791
1748
  var TREND_UP = "#0B8F61";
1792
1749
  var TREND_DOWN = "#ef4444";
1793
1750
  var resolveTrendColor = function resolveTrendColor(trendText) {
@@ -2595,70 +2552,302 @@ var AcceptanceRaisedPanel = function AcceptanceRaisedPanel(_ref10) {
2595
2552
  })
2596
2553
  });
2597
2554
  };
2598
- var KpiCard = function KpiCard(_ref11) {
2599
- var title = _ref11.title,
2600
- value = _ref11.value,
2601
- trend = _ref11.trend,
2602
- detail = _ref11.detail,
2603
- _ref11$variant = _ref11.variant,
2604
- variant = _ref11$variant === void 0 ? "secondary" : _ref11$variant,
2605
- _ref11$trendPositiveW = _ref11.trendPositiveWhenNegative,
2606
- trendPositiveWhenNegative = _ref11$trendPositiveW === void 0 ? false : _ref11$trendPositiveW;
2607
- var displayTrend = withTrendArrow(trend);
2608
- var isPrimary = variant === "primary";
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"
2595
+ },
2596
+ children: [/*#__PURE__*/jsxs("div", {
2597
+ children: [/*#__PURE__*/jsx("div", {
2598
+ style: {
2599
+ fontSize: 22,
2600
+ fontWeight: 700,
2601
+ color: THEME.brand,
2602
+ letterSpacing: "-0.3px",
2603
+ lineHeight: 1.1
2604
+ },
2605
+ children: "Madinah"
2606
+ }), /*#__PURE__*/jsx("div", {
2607
+ style: {
2608
+ fontSize: 9,
2609
+ fontWeight: 600,
2610
+ letterSpacing: "1.2px",
2611
+ color: THEME.muted,
2612
+ textTransform: "uppercase",
2613
+ marginTop: 3
2614
+ },
2615
+ children: "Performance Report"
2616
+ })]
2617
+ }), /*#__PURE__*/jsxs("div", {
2618
+ style: {
2619
+ textAlign: "right"
2620
+ },
2621
+ children: [/*#__PURE__*/jsx("div", {
2622
+ style: {
2623
+ fontSize: 11,
2624
+ color: "#6B7280",
2625
+ lineHeight: 1.2
2626
+ },
2627
+ children: "Dashboard overview \u2014 Overall"
2628
+ }), /*#__PURE__*/jsx("div", {
2629
+ style: {
2630
+ fontSize: 18,
2631
+ fontWeight: 700,
2632
+ color: THEME.text,
2633
+ marginTop: 4,
2634
+ lineHeight: 1.15
2635
+ },
2636
+ children: dateLabel
2637
+ }), /*#__PURE__*/jsxs("div", {
2638
+ style: {
2639
+ fontSize: 9,
2640
+ color: THEME.muted,
2641
+ marginTop: 3,
2642
+ lineHeight: 1.35
2643
+ },
2644
+ children: [windowLabel, BULLET, "Generated ", generatedLabel]
2645
+ })]
2646
+ })]
2647
+ })
2648
+ });
2649
+ };
2650
+ var ActiveFiltersBar = function ActiveFiltersBar(_ref14) {
2651
+ var _ref14$pills = _ref14.pills,
2652
+ pills = _ref14$pills === void 0 ? [] : _ref14$pills;
2653
+ if (!pills.length) return null;
2609
2654
  return /*#__PURE__*/jsxs("div", {
2610
2655
  style: {
2611
- border: "1px solid ".concat(isPrimary ? THEME.kpiBorderPrimary : THEME.kpiBorderSecondary),
2612
- borderRadius: 8,
2613
- padding: "10px 12px 9px",
2614
- background: isPrimary ? THEME.kpiBgPrimary : THEME.kpiBgSecondary,
2615
- width: "100%",
2616
- minWidth: 0,
2617
- boxSizing: "border-box",
2618
2656
  display: "flex",
2619
- flexDirection: "column",
2620
- gap: 2
2657
+ alignItems: "center",
2658
+ flexWrap: "wrap",
2659
+ gap: 8,
2660
+ background: "#EEF2FF",
2661
+ borderRadius: 10,
2662
+ padding: "10px 14px",
2663
+ marginTop: 18
2621
2664
  },
2622
- children: [/*#__PURE__*/jsx("div", {
2665
+ children: [/*#__PURE__*/jsx("span", {
2623
2666
  style: {
2624
2667
  fontSize: 8,
2625
2668
  fontWeight: 700,
2626
- letterSpacing: "0.7px",
2627
- color: "#64748B"
2669
+ letterSpacing: "0.8px",
2670
+ color: THEME.muted,
2671
+ textTransform: "uppercase",
2672
+ flexShrink: 0
2628
2673
  },
2629
- children: title
2674
+ children: "Active Filters"
2675
+ }), pills.map(function (pill, i) {
2676
+ return /*#__PURE__*/jsx("span", {
2677
+ style: {
2678
+ display: "inline-flex",
2679
+ alignItems: "center",
2680
+ background: "#FFFFFF",
2681
+ border: "1px solid ".concat(THEME.kpiBorderPrimary),
2682
+ borderRadius: 100,
2683
+ padding: "4px 11px",
2684
+ fontSize: 9,
2685
+ fontWeight: 500,
2686
+ color: THEME.brand,
2687
+ lineHeight: 1.3
2688
+ },
2689
+ children: pill
2690
+ }, i);
2691
+ })]
2692
+ });
2693
+ };
2694
+ var HeroRaisedCard = function HeroRaisedCard(_ref15) {
2695
+ var value = _ref15.value,
2696
+ trend = _ref15.trend,
2697
+ detail = _ref15.detail;
2698
+ return /*#__PURE__*/jsxs("div", {
2699
+ style: {
2700
+ display: "flex",
2701
+ background: "#FFFFFF",
2702
+ border: "1px solid ".concat(THEME.panelBorder),
2703
+ borderRadius: 12,
2704
+ overflow: "hidden",
2705
+ boxSizing: "border-box"
2706
+ },
2707
+ children: [/*#__PURE__*/jsx("div", {
2708
+ style: {
2709
+ width: 5,
2710
+ flexShrink: 0,
2711
+ background: THEME.brand
2712
+ }
2713
+ }), /*#__PURE__*/jsxs("div", {
2714
+ style: {
2715
+ flex: 1,
2716
+ padding: "16px 18px 14px"
2717
+ },
2718
+ children: [/*#__PURE__*/jsx("div", {
2719
+ style: {
2720
+ fontSize: 9,
2721
+ fontWeight: 700,
2722
+ letterSpacing: "0.8px",
2723
+ color: THEME.brand,
2724
+ textTransform: "uppercase"
2725
+ },
2726
+ children: "Total Raised"
2727
+ }), /*#__PURE__*/jsxs("div", {
2728
+ style: {
2729
+ display: "flex",
2730
+ alignItems: "center",
2731
+ gap: 10,
2732
+ marginTop: 6,
2733
+ flexWrap: "wrap"
2734
+ },
2735
+ children: [/*#__PURE__*/jsx("span", {
2736
+ style: {
2737
+ fontSize: 28,
2738
+ fontWeight: 700,
2739
+ color: THEME.text,
2740
+ lineHeight: 1.05,
2741
+ letterSpacing: "-0.5px"
2742
+ },
2743
+ children: value
2744
+ }), trend && /*#__PURE__*/jsx(TrendPill$1, {
2745
+ positive: isTrendPositive(trend),
2746
+ children: trend
2747
+ })]
2748
+ }), detail && /*#__PURE__*/jsx("div", {
2749
+ style: {
2750
+ fontSize: 9,
2751
+ color: THEME.muted,
2752
+ marginTop: 8,
2753
+ lineHeight: 1.4
2754
+ },
2755
+ children: detail
2756
+ })]
2757
+ })]
2758
+ });
2759
+ };
2760
+ var MetricGridCard = function MetricGridCard(_ref16) {
2761
+ var title = _ref16.title,
2762
+ value = _ref16.value,
2763
+ trend = _ref16.trend,
2764
+ detail = _ref16.detail,
2765
+ _ref16$trendPositiveW = _ref16.trendPositiveWhenNegative,
2766
+ trendPositiveWhenNegative = _ref16$trendPositiveW === void 0 ? false : _ref16$trendPositiveW;
2767
+ return /*#__PURE__*/jsxs("div", {
2768
+ style: {
2769
+ position: "relative",
2770
+ background: "#FFFFFF",
2771
+ border: "1px solid ".concat(THEME.panelBorder),
2772
+ borderRadius: 12,
2773
+ padding: "12px 14px 11px",
2774
+ boxSizing: "border-box",
2775
+ minWidth: 0
2776
+ },
2777
+ children: [/*#__PURE__*/jsxs("div", {
2778
+ style: {
2779
+ display: "flex",
2780
+ justifyContent: "space-between",
2781
+ alignItems: "flex-start",
2782
+ gap: 6
2783
+ },
2784
+ children: [/*#__PURE__*/jsx("div", {
2785
+ style: {
2786
+ fontSize: 8,
2787
+ fontWeight: 700,
2788
+ letterSpacing: "0.7px",
2789
+ color: THEME.muted,
2790
+ textTransform: "uppercase",
2791
+ lineHeight: 1.2
2792
+ },
2793
+ children: title
2794
+ }), trend && /*#__PURE__*/jsx(TrendPill$1, {
2795
+ positive: isTrendPositive(trend, trendPositiveWhenNegative),
2796
+ children: trend
2797
+ })]
2630
2798
  }), /*#__PURE__*/jsx("div", {
2631
2799
  style: {
2632
- fontSize: 17,
2633
- fontWeight: 800,
2800
+ fontSize: 20,
2801
+ fontWeight: 700,
2634
2802
  color: THEME.text,
2635
2803
  lineHeight: 1.1,
2636
- marginTop: 2
2804
+ marginTop: 10
2637
2805
  },
2638
2806
  children: value
2639
- }), /*#__PURE__*/jsx("div", {
2640
- style: {
2641
- fontSize: 10.5,
2642
- fontWeight: 600,
2643
- color: resolveTrendColor(displayTrend, trendPositiveWhenNegative)
2644
- },
2645
- children: displayTrend
2646
- }), /*#__PURE__*/jsx("div", {
2807
+ }), detail && /*#__PURE__*/jsx("div", {
2647
2808
  style: {
2648
2809
  fontSize: 8.5,
2649
2810
  color: THEME.muted,
2650
- lineHeight: 1.4
2811
+ marginTop: 5,
2812
+ lineHeight: 1.35
2651
2813
  },
2652
2814
  children: detail
2653
2815
  })]
2654
2816
  });
2655
2817
  };
2656
- var PageHeader = function PageHeader(_ref12) {
2657
- var dateLabel = _ref12.dateLabel,
2658
- generatedLabel = _ref12.generatedLabel,
2659
- activeFilters = _ref12.activeFilters,
2660
- page = _ref12.page,
2661
- windowLabel = _ref12.windowLabel;
2818
+ var PageOneFooter = function PageOneFooter(_ref17) {
2819
+ var generatedBy = _ref17.generatedBy,
2820
+ generatedLabel = _ref17.generatedLabel;
2821
+ return /*#__PURE__*/jsx("div", {
2822
+ style: {
2823
+ padding: "14px ".concat(MX, "px 28px"),
2824
+ borderTop: "1px solid ".concat(THEME.panelBorder),
2825
+ marginTop: "auto",
2826
+ flexShrink: 0
2827
+ },
2828
+ children: /*#__PURE__*/jsxs("div", {
2829
+ style: {
2830
+ display: "flex",
2831
+ justifyContent: "space-between",
2832
+ alignItems: "center",
2833
+ fontSize: 8,
2834
+ color: THEME.muted,
2835
+ lineHeight: 1.4
2836
+ },
2837
+ children: [/*#__PURE__*/jsxs("span", {
2838
+ children: ["Confidential", BULLET, "Generated by ", generatedBy, BULLET, generatedLabel]
2839
+ }), /*#__PURE__*/jsxs("span", {
2840
+ children: ["Page 1 of 2", BULLET, "madinah.com"]
2841
+ })]
2842
+ })
2843
+ });
2844
+ };
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;
2662
2851
  return /*#__PURE__*/jsxs("div", {
2663
2852
  style: {
2664
2853
  padding: "22px ".concat(MX, "px 12px"),
@@ -2764,10 +2953,10 @@ var PageHeader = function PageHeader(_ref12) {
2764
2953
  })]
2765
2954
  });
2766
2955
  };
2767
- var PageFooter = function PageFooter(_ref13) {
2768
- var generatedBy = _ref13.generatedBy,
2769
- generatedLabel = _ref13.generatedLabel,
2770
- page = _ref13.page;
2956
+ var PageFooter = function PageFooter(_ref19) {
2957
+ var generatedBy = _ref19.generatedBy,
2958
+ generatedLabel = _ref19.generatedLabel,
2959
+ page = _ref19.page;
2771
2960
  return /*#__PURE__*/jsx("div", {
2772
2961
  style: {
2773
2962
  padding: "9px ".concat(MX, "px 54px"),
@@ -2794,32 +2983,33 @@ var PageFooter = function PageFooter(_ref13) {
2794
2983
  };
2795
2984
 
2796
2985
  // ─── Main component ───────────────────────────────────────────────────────────
2797
- var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref14, ref) {
2798
- var _apiData$overviewStat, _overview$totalRevenu, _overview$netRevenue, _overview$overallAVGD, _overview$conversionR, _apiData$totalVisits, _apiData$trafficSourc, _apiData$trafficSourc2, _apiData$trafficSourc3, _metricByTitle$NetRa, _metricByTitle$Total, _metricByTitle$Total2, _metricByTitle$Total3, _metricByTitle$AvgDo, _growth$overallAVGDon, _metricByTitle$AvgDo2, _apiData$roasCard, _metricByTitle$ROAS, _apiData$roasCardPrev, _metricByTitle$ROAS2, _apiData$adSpend, _apiData$attributedRe, _metricByTitle$Conver, _metricByTitle$Conver2, _metricByTitle$Refund, _metricByTitle$Refund2, _metricByTitle$Refund3, _mainChart$stacked, _ob$growthPercentage, _ob$peakDay, _up$acceptanceGrowth, _up$raisedGrowth, _dn$acceptanceGrowth, _dn$raisedGrowth, _refCard$growthPercen;
2799
- var _ref14$name = _ref14.name,
2800
- name = _ref14$name === void 0 ? "" : _ref14$name,
2801
- _ref14$apiData = _ref14.apiData,
2802
- apiData = _ref14$apiData === void 0 ? {} : _ref14$apiData,
2803
- _ref14$dateName = _ref14.dateName,
2804
- dateName = _ref14$dateName === void 0 ? "Last Period" : _ref14$dateName,
2805
- _ref14$numberOfDays = _ref14.numberOfDays,
2806
- numberOfDays = _ref14$numberOfDays === void 0 ? 30 : _ref14$numberOfDays,
2807
- _ref14$activeFilters = _ref14.activeFilters,
2808
- activeFilters = _ref14$activeFilters === void 0 ? [] : _ref14$activeFilters;
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, _avgDonationDetail$me, _avgDonationDetail$to, _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;
2809
2998
  var now = new Date();
2810
2999
  var daysLabel = "".concat(numberOfDays, " day").concat(numberOfDays === 1 ? "" : "s");
2811
3000
  var windowLabel = "".concat(numberOfDays, "-day window");
2812
- var estOptions = {
2813
- timeZone: "America/New_York"
3001
+ var gmtOptions = {
3002
+ timeZone: "UTC"
2814
3003
  };
2815
3004
  var generatedLabel = now.toLocaleDateString("en-US", _objectSpread2({
2816
3005
  month: "short",
2817
3006
  day: "numeric",
2818
3007
  year: "numeric"
2819
- }, estOptions)) + " - " + now.toLocaleTimeString("en-US", _objectSpread2({
3008
+ }, gmtOptions)) + BULLET + now.toLocaleTimeString("en-US", _objectSpread2({
2820
3009
  hour: "2-digit",
2821
- minute: "2-digit"
2822
- }, estOptions)) + " EST";
3010
+ minute: "2-digit",
3011
+ hour12: false
3012
+ }, gmtOptions)) + " GMT";
2823
3013
  var dateLabel = dateName;
2824
3014
  var _normalizeFiltersText = function normalizeFiltersText(filtersInput) {
2825
3015
  if (typeof filtersInput === "string") {
@@ -2857,21 +3047,46 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref14, ref) {
2857
3047
  return "";
2858
3048
  };
2859
3049
  var formattedActiveFilters = _normalizeFiltersText(activeFilters);
3050
+ var parseFilterPills = function parseFilterPills(filtersInput) {
3051
+ if (Array.isArray(filtersInput)) {
3052
+ var fromObjects = filtersInput.filter(function (item) {
3053
+ return item && _typeof(item) === "object" && item.value !== undefined && item.value !== null && "".concat(item.value).trim();
3054
+ }).map(function (item) {
3055
+ return "".concat(item.label || item.id || "Filter", ": ").concat(item.value);
3056
+ });
3057
+ if (fromObjects.length) return fromObjects;
3058
+ var fromStrings = filtersInput.map(function (item) {
3059
+ return typeof item === "string" ? item.trim() : "";
3060
+ }).filter(Boolean);
3061
+ if (fromStrings.length) return fromStrings;
3062
+ }
3063
+ if (typeof filtersInput === "string" && filtersInput.trim()) {
3064
+ var str = filtersInput.trim();
3065
+ if (str.includes("·")) return str.split("·").map(function (s) {
3066
+ return s.trim();
3067
+ }).filter(Boolean);
3068
+ if (str.includes("|")) return str.split("|").map(function (s) {
3069
+ return s.trim();
3070
+ }).filter(Boolean);
3071
+ return [str];
3072
+ }
3073
+ return [];
3074
+ };
3075
+ var filterPills = parseFilterPills(activeFilters);
2860
3076
  var report = buildReportData(apiData, dateName);
2861
- var hero = report.hero,
2862
- metrics = report.metrics,
3077
+ var metrics = report.metrics,
2863
3078
  mainChart = report.mainChart,
2864
3079
  growth = report.growth,
2865
3080
  totalDonors = report.totalDonors,
2866
3081
  donorMix = report.donorMix,
2867
3082
  activeCampaigns = report.activeCampaigns;
2868
3083
  var overview = (apiData === null || apiData === void 0 || (_apiData$overviewStat = apiData.overviewStats) === null || _apiData$overviewStat === void 0 ? void 0 : _apiData$overviewStat.overview) || {};
2869
- var totalRaised = Number((_overview$totalRevenu = overview === null || overview === void 0 ? void 0 : overview.totalRevenue) !== null && _overview$totalRevenu !== void 0 ? _overview$totalRevenu : 240938);
2870
- var netRaised = Number((_overview$netRevenue = overview === null || overview === void 0 ? void 0 : overview.netRevenue) !== null && _overview$netRevenue !== void 0 ? _overview$netRevenue : 222300);
2871
- var avgDonation = Number((_overview$overallAVGD = overview === null || overview === void 0 ? void 0 : overview.overallAVGDonations) !== null && _overview$overallAVGD !== void 0 ? _overview$overallAVGD : 130.58);
2872
- var convRate = Number((_overview$conversionR = overview === null || overview === void 0 ? void 0 : overview.conversionRate) !== null && _overview$conversionR !== void 0 ? _overview$conversionR : 1.7);
2873
- var totalVisits = Number((_apiData$totalVisits = apiData === null || apiData === void 0 ? void 0 : apiData.totalVisits) !== null && _apiData$totalVisits !== void 0 ? _apiData$totalVisits : 12438);
2874
- var passThrough = totalRaised > 0 ? "".concat((netRaised / totalRaised * 100).toFixed(1), "% pass-through") : "92.3% pass-through";
3084
+ var totalRaised = Number((_overview$totalRevenu = overview === null || overview === void 0 ? void 0 : overview.totalRevenue) !== null && _overview$totalRevenu !== void 0 ? _overview$totalRevenu : 0);
3085
+ var netRaised = Number((_overview$netRevenue = overview === null || overview === void 0 ? void 0 : overview.netRevenue) !== null && _overview$netRevenue !== void 0 ? _overview$netRevenue : 0);
3086
+ var avgDonation = Number((_overview$overallAVGD = overview === null || overview === void 0 ? void 0 : overview.overallAVGDonations) !== null && _overview$overallAVGD !== void 0 ? _overview$overallAVGD : 0);
3087
+ var convRate = Number((_overview$conversionR = overview === null || overview === void 0 ? void 0 : overview.conversionRate) !== null && _overview$conversionR !== void 0 ? _overview$conversionR : 0);
3088
+ var totalVisits = Number((_apiData$totalVisits = apiData === null || apiData === void 0 ? void 0 : apiData.totalVisits) !== null && _apiData$totalVisits !== void 0 ? _apiData$totalVisits : 0);
3089
+ var passThrough = totalRaised > 0 ? "".concat((netRaised / totalRaised * 100).toFixed(1), "% pass-through") : "0% pass-through";
2875
3090
  var avgDonationDetail = parseAvgDonationDetail(apiData);
2876
3091
  var refunds = parseRefundsChargebacks(apiData === null || apiData === void 0 ? void 0 : apiData.refundAndChargeBacks);
2877
3092
  var refundRate = refunds.refundRate,
@@ -2891,7 +3106,7 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref14, ref) {
2891
3106
  var geoList = report.donorGeographyList;
2892
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 : [];
2893
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);
2894
- var revSeries = (mainChart.series || []).length ? mainChart.series : [{
3109
+ var revSeries = mainChart.series || [{
2895
3110
  name: "Paid Ads",
2896
3111
  data: []
2897
3112
  }, {
@@ -2902,42 +3117,6 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref14, ref) {
2902
3117
  data: []
2903
3118
  }];
2904
3119
  var revCats = mainChart.categories || [];
2905
- ((apiData === null || apiData === void 0 ? void 0 : apiData.activeCampaigns) || []).length ? apiData.activeCampaigns : [{
2906
- title: "Orphan sponsorship — Yemen",
2907
- collectedAmount: 78400,
2908
- usdTargetAmount: 100000,
2909
- uniqueDonationsCount: 82,
2910
- averageDonation: 956,
2911
- status: "Active"
2912
- }, {
2913
- title: "Emergency food — Gaza",
2914
- collectedAmount: 62100,
2915
- usdTargetAmount: 75000,
2916
- uniqueDonationsCount: 61,
2917
- averageDonation: 1018,
2918
- status: "Active"
2919
- }, {
2920
- title: "Masjid build — Somalia",
2921
- collectedAmount: 38200,
2922
- usdTargetAmount: 83000,
2923
- uniqueDonationsCount: 34,
2924
- averageDonation: 1124,
2925
- status: "Slow"
2926
- }, {
2927
- title: "Water wells — Pakistan",
2928
- collectedAmount: 29800,
2929
- usdTargetAmount: 30000,
2930
- uniqueDonationsCount: 28,
2931
- averageDonation: 1064,
2932
- status: "Closing"
2933
- }, {
2934
- title: "Ramadan packs — Egypt",
2935
- collectedAmount: 18400,
2936
- usdTargetAmount: 23500,
2937
- uniqueDonationsCount: 10,
2938
- averageDonation: 1940,
2939
- status: "Active"
2940
- }];
2941
3120
  var ob = (apiData === null || apiData === void 0 ? void 0 : apiData.orderBumpDetails) || {};
2942
3121
  var obData = ((ob === null || ob === void 0 ? void 0 : ob.chart) || []).map(function (i) {
2943
3122
  return Number(i.revenue || 0);
@@ -2966,13 +3145,16 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref14, ref) {
2966
3145
  label: "Email",
2967
3146
  color: C.cyan
2968
3147
  }];
2969
- var revenueTrendText = mainChart.trend || "";
2970
- var revenueTrendColor = getTrendColor(revenueTrendText, {
2971
- up: "#054835ff",
2972
- down: "#EF4444"
2973
- });
2974
- var revenueTrendBadgeBg = revenueTrendColor === "#EF4444" ? "#fee2e2" : "#8df3be9a";
2975
- var revenueTrendArrow = getTrendArrow(revenueTrendText);
3148
+ var revenueTrendText = "".concat(formatTrend((_growth$totalRevenue = growth === null || growth === void 0 ? void 0 : growth.totalRevenue) !== null && _growth$totalRevenue !== void 0 ? _growth$totalRevenue : 0), " vs last month");
3149
+ var heroTrendText = revenueTrendText;
3150
+ var heroDetailText = [passThrough, "".concat(formatNumber(totalDonors), " donors"), "$".concat(formatNumber(Number(avgDonation).toFixed(2)), " avg"), "".concat(formatNumber(totalVisits), " visits")].join(BULLET);
3151
+ var formatMetricDetail = function formatMetricDetail(detail) {
3152
+ return String(detail !== null && detail !== void 0 ? detail : "").replace(/\s-\s/g, BULLET);
3153
+ };
3154
+ var formatRoasTrend = function formatRoasTrend(trend) {
3155
+ return String(trend !== null && trend !== void 0 ? trend : "").replace(/x$/, "×");
3156
+ };
3157
+ var avgDonationDetailText = formatMetricDetail(((_metricByTitle$AvgDo = metricByTitle["Avg Donation"]) === null || _metricByTitle$AvgDo === void 0 ? void 0 : _metricByTitle$AvgDo.detail) || avgDonationDetail.detail || "Median $".concat(formatNumber((_avgDonationDetail$me = avgDonationDetail.median) !== null && _avgDonationDetail$me !== void 0 ? _avgDonationDetail$me : 0), " \xB7 top decile $").concat(formatNumber((_avgDonationDetail$to = avgDonationDetail.topDecile) !== null && _avgDonationDetail$to !== void 0 ? _avgDonationDetail$to : 0)));
2976
3158
  var headerProps = {
2977
3159
  dateLabel: dateLabel,
2978
3160
  generatedLabel: generatedLabel,
@@ -2995,189 +3177,187 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref14, ref) {
2995
3177
  background: THEME.pageBg,
2996
3178
  display: "flex",
2997
3179
  flexDirection: "column",
2998
- fontFamily: "'Helvetica Neue', Helvetica, Arial, sans-serif",
3180
+ fontFamily: "'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif",
2999
3181
  boxSizing: "border-box"
3000
3182
  },
3001
- children: [/*#__PURE__*/jsx(PageHeader, _objectSpread2(_objectSpread2({}, headerProps), {}, {
3002
- page: 1
3003
- })), /*#__PURE__*/jsxs("div", {
3183
+ children: [/*#__PURE__*/jsx(PageOneHeader, {
3184
+ dateLabel: dateLabel,
3185
+ generatedLabel: generatedLabel,
3186
+ windowLabel: windowLabel
3187
+ }), /*#__PURE__*/jsxs("div", {
3004
3188
  style: {
3005
3189
  flex: 1,
3006
- padding: "12px ".concat(MX, "px 10px"),
3190
+ padding: "0 ".concat(MX, "px 0"),
3007
3191
  display: "flex",
3008
- flexDirection: "column",
3009
- gap: 10
3192
+ flexDirection: "column"
3010
3193
  },
3011
- children: [/*#__PURE__*/jsx(KpiCard, {
3012
- title: "Total Raised",
3013
- value: kpi$(totalRaised),
3014
- trend: hero.trend,
3015
- detail: hero.detail,
3016
- variant: "primary"
3017
- }), /*#__PURE__*/jsxs("div", {
3018
- style: {
3019
- display: "grid",
3020
- gridTemplateColumns: "repeat(3, 1fr)",
3021
- gap: 7
3022
- },
3023
- children: [/*#__PURE__*/jsx(KpiCard, {
3024
- title: "Net Raised",
3025
- value: kpi$(netRaised),
3026
- trend: ((_metricByTitle$NetRa = metricByTitle["Net Raised"]) === null || _metricByTitle$NetRa === void 0 ? void 0 : _metricByTitle$NetRa.trend) || signed((growth === null || growth === void 0 ? void 0 : growth.netRevenue) || 17.4),
3027
- detail: passThrough
3028
- }), /*#__PURE__*/jsx(KpiCard, {
3029
- title: "Total Donors",
3030
- value: ((_metricByTitle$Total = metricByTitle["Total Donors"]) === null || _metricByTitle$Total === void 0 ? void 0 : _metricByTitle$Total.value) || "".concat(formatNumber(totalDonors)),
3031
- trend: ((_metricByTitle$Total2 = metricByTitle["Total Donors"]) === null || _metricByTitle$Total2 === void 0 ? void 0 : _metricByTitle$Total2.trend) || signed((growth === null || growth === void 0 ? void 0 : growth.totalDonations) || 16.8),
3032
- detail: ((_metricByTitle$Total3 = metricByTitle["Total Donors"]) === null || _metricByTitle$Total3 === void 0 ? void 0 : _metricByTitle$Total3.detail) || "".concat(formatNumber(newDonors), " new - ").concat(formatNumber(returningDonors), " returning")
3033
- }), /*#__PURE__*/jsx(KpiCard, {
3034
- title: "Avg Donation",
3035
- value: kpi$(avgDonation),
3036
- trend: ((_metricByTitle$AvgDo = metricByTitle["Avg Donation"]) === null || _metricByTitle$AvgDo === void 0 ? void 0 : _metricByTitle$AvgDo.trend) || signed((_growth$overallAVGDon = growth === null || growth === void 0 ? void 0 : growth.overallAVGDonations) !== null && _growth$overallAVGDon !== void 0 ? _growth$overallAVGDon : 0),
3037
- detail: ((_metricByTitle$AvgDo2 = metricByTitle["Avg Donation"]) === null || _metricByTitle$AvgDo2 === void 0 ? void 0 : _metricByTitle$AvgDo2.detail) || avgDonationDetail.detail
3038
- })]
3194
+ children: [/*#__PURE__*/jsx(ActiveFiltersBar, {
3195
+ pills: filterPills
3039
3196
  }), /*#__PURE__*/jsxs("div", {
3040
3197
  style: {
3041
- display: "grid",
3042
- gridTemplateColumns: "repeat(3, 1fr)",
3043
- gap: 7
3044
- },
3045
- children: [/*#__PURE__*/jsx(KpiCard, {
3046
- title: "ROAS",
3047
- value: kpiRoas((_apiData$roasCard = apiData === null || apiData === void 0 ? void 0 : apiData.roasCard) !== null && _apiData$roasCard !== void 0 ? _apiData$roasCard : 0),
3048
- trend: ((_metricByTitle$ROAS = metricByTitle.ROAS) === null || _metricByTitle$ROAS === void 0 ? void 0 : _metricByTitle$ROAS.trend) || signed((_apiData$roasCardPrev = apiData === null || apiData === void 0 ? void 0 : apiData.roasCardPrev) !== null && _apiData$roasCardPrev !== void 0 ? _apiData$roasCardPrev : 0, "×"),
3049
- detail: ((_metricByTitle$ROAS2 = metricByTitle.ROAS) === null || _metricByTitle$ROAS2 === void 0 ? void 0 : _metricByTitle$ROAS2.detail) || "".concat(d$((_apiData$adSpend = apiData === null || apiData === void 0 ? void 0 : apiData.adSpend) !== null && _apiData$adSpend !== void 0 ? _apiData$adSpend : 0), " spend - ").concat(d$((_apiData$attributedRe = apiData === null || apiData === void 0 ? void 0 : apiData.attributedRevenue) !== null && _apiData$attributedRe !== void 0 ? _apiData$attributedRe : 0), " attrib.")
3050
- }), /*#__PURE__*/jsx(KpiCard, {
3051
- title: "Conversion",
3052
- value: kpiPct(convRate),
3053
- trend: ((_metricByTitle$Conver = metricByTitle.Conversion) === null || _metricByTitle$Conver === void 0 ? void 0 : _metricByTitle$Conver.trend) || signed((growth === null || growth === void 0 ? void 0 : growth.conversionRate) || 0.21, "pp"),
3054
- detail: ((_metricByTitle$Conver2 = metricByTitle.Conversion) === null || _metricByTitle$Conver2 === void 0 ? void 0 : _metricByTitle$Conver2.detail) || "".concat(formatNumber(totalDonors), " from ").concat(formatNumber(totalVisits), " visits")
3055
- }), /*#__PURE__*/jsx(KpiCard, {
3056
- title: "Refund Rate",
3057
- value: pct(refundRate, 2),
3058
- trend: ((_metricByTitle$Refund = metricByTitle["Refund Rate"]) === null || _metricByTitle$Refund === void 0 ? void 0 : _metricByTitle$Refund.trend) || signed(growthPercentage),
3059
- detail: ((_metricByTitle$Refund2 = metricByTitle["Refund Rate"]) === null || _metricByTitle$Refund2 === void 0 ? void 0 : _metricByTitle$Refund2.detail) || "".concat(formatNumber(totalRefunds), " refunds this period"),
3060
- trendPositiveWhenNegative: (_metricByTitle$Refund3 = metricByTitle["Refund Rate"]) === null || _metricByTitle$Refund3 === void 0 ? void 0 : _metricByTitle$Refund3.trendPositiveWhenNegative
3061
- })]
3062
- }), /*#__PURE__*/jsxs("div", {
3063
- style: {
3064
- border: "1px solid #E5E7EB",
3065
- borderRadius: 8,
3066
- background: "#fff",
3067
- padding: "12px 14px 10px",
3198
+ display: "flex",
3199
+ flexDirection: "column",
3200
+ gap: 10,
3201
+ marginTop: 14,
3068
3202
  flex: 1
3069
3203
  },
3070
- children: [/*#__PURE__*/jsxs("div", {
3204
+ children: [/*#__PURE__*/jsx(HeroRaisedCard, {
3205
+ value: kpi$(totalRaised),
3206
+ trend: heroTrendText,
3207
+ detail: heroDetailText
3208
+ }), /*#__PURE__*/jsxs("div", {
3071
3209
  style: {
3072
- display: "flex",
3073
- justifyContent: "space-between",
3074
- alignItems: "flex-start",
3075
- marginBottom: 8
3210
+ display: "grid",
3211
+ gridTemplateColumns: "repeat(3, 1fr)",
3212
+ gap: 10
3213
+ },
3214
+ children: [/*#__PURE__*/jsx(MetricGridCard, {
3215
+ title: "Net Raised",
3216
+ value: d$Compact(netRaised),
3217
+ trend: ((_metricByTitle$NetRa = metricByTitle["Net Raised"]) === null || _metricByTitle$NetRa === void 0 ? void 0 : _metricByTitle$NetRa.trend) || formatTrend((_growth$netRevenue = growth === null || growth === void 0 ? void 0 : growth.netRevenue) !== null && _growth$netRevenue !== void 0 ? _growth$netRevenue : 0),
3218
+ detail: passThrough
3219
+ }), /*#__PURE__*/jsx(MetricGridCard, {
3220
+ title: "Total Donors",
3221
+ value: ((_metricByTitle$Total = metricByTitle["Total Donors"]) === null || _metricByTitle$Total === void 0 ? void 0 : _metricByTitle$Total.value) || "".concat(formatNumber(totalDonors)),
3222
+ trend: ((_metricByTitle$Total2 = metricByTitle["Total Donors"]) === null || _metricByTitle$Total2 === void 0 ? void 0 : _metricByTitle$Total2.trend) || formatTrend((_growth$totalDonation = growth === null || growth === void 0 ? void 0 : growth.totalDonations) !== null && _growth$totalDonation !== void 0 ? _growth$totalDonation : 0),
3223
+ detail: formatMetricDetail(((_metricByTitle$Total3 = metricByTitle["Total Donors"]) === null || _metricByTitle$Total3 === void 0 ? void 0 : _metricByTitle$Total3.detail) || "".concat(formatNumber(newDonors), " new \xB7 ").concat(formatNumber(returningDonors), " returning"))
3224
+ }), /*#__PURE__*/jsx(MetricGridCard, {
3225
+ title: "Avg Donation",
3226
+ value: kpi$(avgDonation),
3227
+ trend: ((_metricByTitle$AvgDo2 = metricByTitle["Avg Donation"]) === null || _metricByTitle$AvgDo2 === void 0 ? void 0 : _metricByTitle$AvgDo2.trend) || formatTrend((_growth$overallAVGDon = growth === null || growth === void 0 ? void 0 : growth.overallAVGDonations) !== null && _growth$overallAVGDon !== void 0 ? _growth$overallAVGDon : 0),
3228
+ detail: avgDonationDetailText
3229
+ })]
3230
+ }), /*#__PURE__*/jsxs("div", {
3231
+ style: {
3232
+ display: "grid",
3233
+ gridTemplateColumns: "repeat(3, 1fr)",
3234
+ gap: 10
3235
+ },
3236
+ children: [/*#__PURE__*/jsx(MetricGridCard, {
3237
+ title: "ROAS",
3238
+ value: kpiRoas((_apiData$roasCard = apiData === null || apiData === void 0 ? void 0 : apiData.roasCard) !== null && _apiData$roasCard !== void 0 ? _apiData$roasCard : 0),
3239
+ trend: formatRoasTrend(((_metricByTitle$ROAS = metricByTitle.ROAS) === null || _metricByTitle$ROAS === void 0 ? void 0 : _metricByTitle$ROAS.trend) || formatTrend((_apiData$roasCardPrev = apiData === null || apiData === void 0 ? void 0 : apiData.roasCardPrev) !== null && _apiData$roasCardPrev !== void 0 ? _apiData$roasCardPrev : 0, "x")),
3240
+ detail: formatMetricDetail(((_metricByTitle$ROAS2 = metricByTitle.ROAS) === null || _metricByTitle$ROAS2 === void 0 ? void 0 : _metricByTitle$ROAS2.detail) || "".concat(d$Compact((_apiData$adSpend = apiData === null || apiData === void 0 ? void 0 : apiData.adSpend) !== null && _apiData$adSpend !== void 0 ? _apiData$adSpend : 0), " spend \xB7 ").concat(d$Compact((_apiData$attributedRe = apiData === null || apiData === void 0 ? void 0 : apiData.attributedRevenue) !== null && _apiData$attributedRe !== void 0 ? _apiData$attributedRe : 0), " attrib."))
3241
+ }), /*#__PURE__*/jsx(MetricGridCard, {
3242
+ title: "Conversion",
3243
+ value: kpiPct(convRate),
3244
+ trend: ((_metricByTitle$Conver = metricByTitle.Conversion) === null || _metricByTitle$Conver === void 0 ? void 0 : _metricByTitle$Conver.trend) || formatTrend((_growth$conversionRat = growth === null || growth === void 0 ? void 0 : growth.conversionRate) !== null && _growth$conversionRat !== void 0 ? _growth$conversionRat : 0, "pp"),
3245
+ detail: formatMetricDetail(((_metricByTitle$Conver2 = metricByTitle.Conversion) === null || _metricByTitle$Conver2 === void 0 ? void 0 : _metricByTitle$Conver2.detail) || "".concat(formatNumber(totalDonors), " from ").concat(formatNumber(totalVisits), " visits"))
3246
+ }), /*#__PURE__*/jsx(MetricGridCard, {
3247
+ title: "Refund Rate",
3248
+ value: pct(refundRate, 2),
3249
+ trend: ((_metricByTitle$Refund = metricByTitle["Refund Rate"]) === null || _metricByTitle$Refund === void 0 ? void 0 : _metricByTitle$Refund.trend) || formatTrend((_refunds$growthPercen = refunds.growthPercentage) !== null && _refunds$growthPercen !== void 0 ? _refunds$growthPercen : 0, "pp"),
3250
+ detail: formatMetricDetail(((_metricByTitle$Refund2 = metricByTitle["Refund Rate"]) === null || _metricByTitle$Refund2 === void 0 ? void 0 : _metricByTitle$Refund2.detail) || "".concat(formatNumber(totalRefunds), " refunds this period")),
3251
+ trendPositiveWhenNegative: true
3252
+ })]
3253
+ }), /*#__PURE__*/jsxs("div", {
3254
+ style: {
3255
+ border: "1px solid ".concat(THEME.panelBorder),
3256
+ borderRadius: 12,
3257
+ background: "#fff",
3258
+ padding: "14px 16px 12px",
3259
+ flex: 1
3076
3260
  },
3077
3261
  children: [/*#__PURE__*/jsxs("div", {
3078
- children: [/*#__PURE__*/jsx("div", {
3079
- style: {
3080
- fontSize: 13,
3081
- fontWeight: 700,
3082
- color: "#111827",
3083
- lineHeight: 1.15
3084
- },
3085
- children: "Total revenue trend"
3086
- }), /*#__PURE__*/jsxs("div", {
3087
- style: {
3088
- fontSize: 9.5,
3089
- color: "rgba(0, 0, 0, 0.4)",
3090
- marginTop: 2,
3091
- lineHeight: 1.15
3092
- },
3093
- children: ["Last ", daysLabel, " - daily aggregation"]
3094
- }), /*#__PURE__*/jsxs("div", {
3095
- style: {
3096
- display: "flex",
3097
- alignItems: "center",
3098
- gap: 6,
3099
- marginTop: 8
3100
- },
3101
- children: [/*#__PURE__*/jsx("span", {
3262
+ style: {
3263
+ display: "flex",
3264
+ justifyContent: "space-between",
3265
+ alignItems: "flex-start",
3266
+ marginBottom: 6
3267
+ },
3268
+ children: [/*#__PURE__*/jsxs("div", {
3269
+ children: [/*#__PURE__*/jsx("div", {
3102
3270
  style: {
3103
- fontSize: 22,
3271
+ fontSize: 13,
3104
3272
  fontWeight: 700,
3105
- color: "#111827"
3273
+ color: THEME.text,
3274
+ lineHeight: 1.15
3106
3275
  },
3107
- children: kpi$(totalRaised)
3108
- }), revenueTrendText && /*#__PURE__*/jsxs("span", {
3276
+ children: "Total revenue trend"
3277
+ }), /*#__PURE__*/jsxs("div", {
3109
3278
  style: {
3110
- display: "inline-flex",
3111
- alignItems: "center",
3112
- gap: 3,
3113
- background: revenueTrendBadgeBg,
3114
- color: revenueTrendColor,
3115
- padding: "2px 8px",
3116
- borderRadius: 100,
3117
- fontSize: 9.5,
3118
- fontWeight: 600
3279
+ fontSize: 9,
3280
+ color: THEME.muted,
3281
+ marginTop: 3,
3282
+ lineHeight: 1.15
3119
3283
  },
3120
- children: [revenueTrendArrow && /*#__PURE__*/jsx("span", {
3121
- children: revenueTrendArrow
3122
- }), revenueTrendText]
3123
- })]
3124
- })]
3125
- }), revSeries.length > 0 && /*#__PURE__*/jsx("div", {
3126
- style: {
3127
- display: "flex",
3128
- gap: 10,
3129
- alignItems: "center",
3130
- flexShrink: 0,
3131
- paddingTop: 2
3132
- },
3133
- children: revenueLegend.map(function (leg) {
3134
- return /*#__PURE__*/jsxs("div", {
3284
+ children: ["Last ", daysLabel, BULLET, "daily aggregation"]
3285
+ }), /*#__PURE__*/jsxs("div", {
3135
3286
  style: {
3136
3287
  display: "flex",
3137
3288
  alignItems: "center",
3138
- gap: 4
3289
+ gap: 8,
3290
+ marginTop: 10
3139
3291
  },
3140
- children: [/*#__PURE__*/jsx("div", {
3292
+ children: [/*#__PURE__*/jsx("span", {
3141
3293
  style: {
3142
- width: 8,
3143
- height: 8,
3144
- borderRadius: "50%",
3145
- background: leg.color,
3146
- flexShrink: 0
3147
- }
3148
- }), /*#__PURE__*/jsx("span", {
3149
- style: {
3150
- fontSize: 9.5,
3151
- color: "rgba(0, 0, 0, 0.6)",
3152
- fontWeight: 500
3294
+ fontSize: 22,
3295
+ fontWeight: 700,
3296
+ color: THEME.text,
3297
+ letterSpacing: "-0.3px"
3153
3298
  },
3154
- children: leg.label
3299
+ children: kpi$(totalRaised)
3300
+ }), revenueTrendText && /*#__PURE__*/jsx(TrendPill$1, {
3301
+ positive: isTrendPositive(revenueTrendText),
3302
+ children: revenueTrendText
3155
3303
  })]
3156
- }, leg.label);
3304
+ })]
3305
+ }), revSeries.length > 0 && /*#__PURE__*/jsx("div", {
3306
+ style: {
3307
+ display: "flex",
3308
+ gap: 12,
3309
+ alignItems: "center",
3310
+ flexShrink: 0,
3311
+ paddingTop: 2
3312
+ },
3313
+ children: revenueLegend.map(function (leg) {
3314
+ return /*#__PURE__*/jsxs("div", {
3315
+ style: {
3316
+ display: "flex",
3317
+ alignItems: "center",
3318
+ gap: 5
3319
+ },
3320
+ children: [/*#__PURE__*/jsx("div", {
3321
+ style: {
3322
+ width: 7,
3323
+ height: 7,
3324
+ borderRadius: "50%",
3325
+ background: leg.color,
3326
+ flexShrink: 0
3327
+ }
3328
+ }), /*#__PURE__*/jsx("span", {
3329
+ style: {
3330
+ fontSize: 9,
3331
+ color: "#6B7280",
3332
+ fontWeight: 500
3333
+ },
3334
+ children: leg.label
3335
+ })]
3336
+ }, leg.label);
3337
+ })
3338
+ })]
3339
+ }), /*#__PURE__*/jsx("div", {
3340
+ style: {
3341
+ width: "100%",
3342
+ minHeight: 280
3343
+ },
3344
+ children: /*#__PURE__*/jsx(RevenueChart, {
3345
+ id: "pdf-total-revenue-trend",
3346
+ metric: "Revenue",
3347
+ series: revSeries,
3348
+ categories: revCats,
3349
+ height: 280,
3350
+ stacked: (_mainChart$stacked = mainChart.stacked) !== null && _mainChart$stacked !== void 0 ? _mainChart$stacked : true,
3351
+ type: "area",
3352
+ colors: mainChart.colors || ["#6366F1", "#10B981", "#06B6D4"],
3353
+ showLegend: false
3157
3354
  })
3158
3355
  })]
3159
- }), /*#__PURE__*/jsx("div", {
3160
- style: {
3161
- width: "100%",
3162
- minHeight: 300
3163
- },
3164
- children: /*#__PURE__*/jsx(RevenueChart, {
3165
- id: "pdf-total-revenue-trend",
3166
- metric: "Revenue",
3167
- series: revSeries,
3168
- categories: revCats,
3169
- height: 300,
3170
- stacked: (_mainChart$stacked = mainChart.stacked) !== null && _mainChart$stacked !== void 0 ? _mainChart$stacked : true,
3171
- type: "area",
3172
- colors: mainChart.colors || ["#6366F1", "#10B981", "#06B6D4"],
3173
- showLegend: false
3174
- })
3175
3356
  })]
3176
3357
  })]
3177
- }), /*#__PURE__*/jsx(PageFooter, {
3358
+ }), /*#__PURE__*/jsx(PageOneFooter, {
3178
3359
  generatedBy: name,
3179
- generatedLabel: generatedLabel,
3180
- page: 1
3360
+ generatedLabel: generatedLabel
3181
3361
  })]
3182
3362
  }), /*#__PURE__*/jsxs("div", {
3183
3363
  "data-export-page": "2",
@@ -3483,7 +3663,7 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref14, ref) {
3483
3663
  })
3484
3664
  })
3485
3665
  }), /*#__PURE__*/jsx(Sparkline, {
3486
- data: obData.length ? obData : [0, 1],
3666
+ data: obData.length ? obData : [0, 0],
3487
3667
  color: C.indigo,
3488
3668
  width: 110,
3489
3669
  height: 34
@@ -3495,10 +3675,10 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref14, ref) {
3495
3675
  display: "flex",
3496
3676
  gap: 12
3497
3677
  },
3498
- 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 (_ref15) {
3499
- var _ref16 = _slicedToArray(_ref15, 2),
3500
- l = _ref16[0],
3501
- v = _ref16[1];
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];
3502
3682
  return /*#__PURE__*/jsxs("div", {
3503
3683
  children: [/*#__PURE__*/jsx("div", {
3504
3684
  style: {
@@ -3559,7 +3739,7 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref14, ref) {
3559
3739
  })
3560
3740
  })
3561
3741
  }), /*#__PURE__*/jsx(Sparkline, {
3562
- data: refData.length ? refData : [0, 1],
3742
+ data: refData.length ? refData : [0, 0],
3563
3743
  color: C.emerald,
3564
3744
  width: 110,
3565
3745
  height: 34
@@ -3571,10 +3751,10 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref14, ref) {
3571
3751
  display: "flex",
3572
3752
  gap: 12
3573
3753
  },
3574
- 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 (_ref17) {
3575
- var _ref18 = _slicedToArray(_ref17, 2),
3576
- l = _ref18[0],
3577
- v = _ref18[1];
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];
3578
3758
  return /*#__PURE__*/jsxs("div", {
3579
3759
  children: [/*#__PURE__*/jsx("div", {
3580
3760
  style: {