@ammarkhalidfarooq/dashboard-package 0.6.66 → 0.6.68

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
@@ -1472,7 +1472,7 @@ var getActiveFilterChips = function getActiveFilterChips(apiData) {
1472
1472
  return ["Status: Successful", "Country: United States, UAE", "Amount: $50 – $5,000"];
1473
1473
  };
1474
1474
  var buildReportData = function buildReportData() {
1475
- var _apiData$overviewStat, _overview$totalRevenu, _overview$netRevenue, _overview$totalDonati, _overview$overallAVGD, _overview$conversionR, _apiData$totalVisits, _growth$overallAVGDon, _growth$totalRevenue, _growth$netRevenue, _growth$totalDonation, _growth$overallAVGDon2, _apiData$medianGift, _apiData$topDecileGif, _apiData$roasCard, _apiData$roasCardPrev, _apiData$adSpend, _apiData$attributedRe, _growth$conversionRat, _refundsRaw$refundRat, _refundsRaw$refundRat2, _refundsRaw$refundCou, _apiData$overviewStat2, _growth$totalRevenue2;
1475
+ var _apiData$overviewStat, _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$medianGift, _apiData$topDecileGif, _apiData$roasCard, _apiData$roasCardPrev, _apiData$adSpend, _apiData$attributedRe, _growth$conversionRat, _refundsRaw$refundRat, _refundsRaw$refundRat2, _refundsRaw$refundCou, _apiData$overviewStat2, _growth$totalRevenue2;
1476
1476
  var apiData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1477
1477
  var dateName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "Last Period";
1478
1478
  var overview = (apiData === null || apiData === void 0 || (_apiData$overviewStat = apiData.overviewStats) === null || _apiData$overviewStat === void 0 ? void 0 : _apiData$overviewStat.overview) || {};
@@ -1488,8 +1488,6 @@ var buildReportData = function buildReportData() {
1488
1488
  var donorMixRaw = apiData === null || apiData === void 0 ? void 0 : apiData.donorPieChartData;
1489
1489
  var newDonors = 31;
1490
1490
  var returningDonors = 184;
1491
- var avgGift = avgDonation;
1492
- var donorMixPrev = Number((_growth$overallAVGDon = growth === null || growth === void 0 ? void 0 : growth.overallAVGDonations) !== null && _growth$overallAVGDon !== void 0 ? _growth$overallAVGDon : 8.4);
1493
1491
  if (Array.isArray(donorMixRaw)) {
1494
1492
  var nd = donorMixRaw.find(function (d) {
1495
1493
  return /new/i.test(d.type);
@@ -1499,15 +1497,12 @@ var buildReportData = function buildReportData() {
1499
1497
  }) || {};
1500
1498
  newDonors = nd.totalDonations || 0;
1501
1499
  returningDonors = rd.totalDonations || 0;
1502
- var totAmt = (nd.totalAmount || 0) + (rd.totalAmount || 0);
1503
- var totCnt = newDonors + returningDonors;
1504
- avgGift = totCnt > 0 ? totAmt / totCnt : avgDonation;
1505
1500
  } else if (donorMixRaw && _typeof(donorMixRaw) === "object") {
1506
1501
  newDonors = donorMixRaw.newDonors || 0;
1507
1502
  returningDonors = donorMixRaw.returningDonors || 0;
1508
- avgGift = donorMixRaw.avgGift || avgDonation;
1509
- donorMixPrev = donorMixRaw.donorMixPrev || donorMixPrev;
1510
1503
  }
1504
+ var avgGift = Number(((_overview$overallAVGD2 = overview === null || overview === void 0 ? void 0 : overview.overallAVGDonations) !== null && _overview$overallAVGD2 !== void 0 ? _overview$overallAVGD2 : 0).toFixed(2));
1505
+ var donorMixPrev = Number(((_growth$overallAVGDon = growth === null || growth === void 0 ? void 0 : growth.overallAVGDonations) !== null && _growth$overallAVGDon !== void 0 ? _growth$overallAVGDon : 0).toFixed(2));
1511
1506
  var totalMix = newDonors + returningDonors || 1;
1512
1507
  var newPct = Math.round(newDonors / totalMix * 100);
1513
1508
  var retPct = 100 - newPct;
@@ -2301,15 +2296,155 @@ var DonationTypePanel = function DonationTypePanel(_ref0) {
2301
2296
  })]
2302
2297
  });
2303
2298
  };
2304
- var KpiCard = function KpiCard(_ref1) {
2299
+ var AcceptanceRaisedPanel = function AcceptanceRaisedPanel(_ref1) {
2305
2300
  var title = _ref1.title,
2306
- value = _ref1.value,
2307
- trend = _ref1.trend,
2308
- detail = _ref1.detail,
2309
- _ref1$variant = _ref1.variant,
2310
- variant = _ref1$variant === void 0 ? "secondary" : _ref1$variant,
2311
- _ref1$trendPositiveWh = _ref1.trendPositiveWhenNegative,
2312
- trendPositiveWhenNegative = _ref1$trendPositiveWh === void 0 ? false : _ref1$trendPositiveWh;
2301
+ subtitle = _ref1.subtitle,
2302
+ _ref1$acceptanceRate = _ref1.acceptanceRate,
2303
+ acceptanceRate = _ref1$acceptanceRate === void 0 ? 0 : _ref1$acceptanceRate,
2304
+ _ref1$acceptanceGrowt = _ref1.acceptanceGrowth,
2305
+ acceptanceGrowth = _ref1$acceptanceGrowt === void 0 ? 0 : _ref1$acceptanceGrowt,
2306
+ _ref1$raised = _ref1.raised,
2307
+ raised = _ref1$raised === void 0 ? 0 : _ref1$raised,
2308
+ _ref1$raisedGrowth = _ref1.raisedGrowth,
2309
+ raisedGrowth = _ref1$raisedGrowth === void 0 ? 0 : _ref1$raisedGrowth,
2310
+ _ref1$primaryColor = _ref1.primaryColor,
2311
+ primaryColor = _ref1$primaryColor === void 0 ? "#6366F1" : _ref1$primaryColor,
2312
+ _ref1$secondaryColor = _ref1.secondaryColor,
2313
+ secondaryColor = _ref1$secondaryColor === void 0 ? "#88bfd290" : _ref1$secondaryColor;
2314
+ return /*#__PURE__*/jsx(Panel, {
2315
+ title: title,
2316
+ subtitle: subtitle,
2317
+ children: /*#__PURE__*/jsxs("div", {
2318
+ style: {
2319
+ display: "flex",
2320
+ flexDirection: "column",
2321
+ alignItems: "center"
2322
+ },
2323
+ children: [/*#__PURE__*/jsx(Donut, {
2324
+ segments: [{
2325
+ value: acceptanceRate,
2326
+ color: primaryColor
2327
+ }, {
2328
+ value: Math.max(0, 100 - acceptanceRate),
2329
+ color: "#E5E7EB"
2330
+ }],
2331
+ size: 88,
2332
+ centerVal: "".concat(formatNumber(acceptanceRate), "%"),
2333
+ centerLabel: "accepted"
2334
+ }), /*#__PURE__*/jsxs("div", {
2335
+ style: {
2336
+ width: "100%",
2337
+ marginTop: 6
2338
+ },
2339
+ children: [/*#__PURE__*/jsxs("div", {
2340
+ style: {
2341
+ display: "flex",
2342
+ justifyContent: "space-between",
2343
+ alignItems: "center",
2344
+ marginBottom: 5
2345
+ },
2346
+ children: [/*#__PURE__*/jsxs("div", {
2347
+ style: {
2348
+ display: "flex",
2349
+ alignItems: "center",
2350
+ gap: 5
2351
+ },
2352
+ children: [/*#__PURE__*/jsx("div", {
2353
+ style: {
2354
+ width: 8,
2355
+ height: 8,
2356
+ borderRadius: 2,
2357
+ background: primaryColor,
2358
+ flexShrink: 0
2359
+ }
2360
+ }), /*#__PURE__*/jsx("span", {
2361
+ style: {
2362
+ fontSize: 9.5,
2363
+ color: "#6B7280"
2364
+ },
2365
+ children: "Acceptance"
2366
+ })]
2367
+ }), /*#__PURE__*/jsxs("div", {
2368
+ style: {
2369
+ display: "flex",
2370
+ alignItems: "baseline",
2371
+ gap: 4
2372
+ },
2373
+ children: [/*#__PURE__*/jsxs("span", {
2374
+ style: {
2375
+ fontSize: 9.5,
2376
+ fontWeight: 700,
2377
+ color: "#111827"
2378
+ },
2379
+ children: [formatNumber(acceptanceRate), "%"]
2380
+ }), /*#__PURE__*/jsx(TrendText, {
2381
+ style: {
2382
+ fontSize: 9
2383
+ },
2384
+ children: formatArrowTrend(acceptanceGrowth)
2385
+ })]
2386
+ })]
2387
+ }), /*#__PURE__*/jsxs("div", {
2388
+ style: {
2389
+ display: "flex",
2390
+ justifyContent: "space-between",
2391
+ alignItems: "center"
2392
+ },
2393
+ children: [/*#__PURE__*/jsxs("div", {
2394
+ style: {
2395
+ display: "flex",
2396
+ alignItems: "center",
2397
+ gap: 5
2398
+ },
2399
+ children: [/*#__PURE__*/jsx("div", {
2400
+ style: {
2401
+ width: 8,
2402
+ height: 8,
2403
+ borderRadius: 2,
2404
+ background: secondaryColor,
2405
+ flexShrink: 0
2406
+ }
2407
+ }), /*#__PURE__*/jsx("span", {
2408
+ style: {
2409
+ fontSize: 9.5,
2410
+ color: "#6B7280"
2411
+ },
2412
+ children: "Raised"
2413
+ })]
2414
+ }), /*#__PURE__*/jsxs("div", {
2415
+ style: {
2416
+ display: "flex",
2417
+ alignItems: "baseline",
2418
+ gap: 4
2419
+ },
2420
+ children: [/*#__PURE__*/jsx("span", {
2421
+ style: {
2422
+ fontSize: 9.5,
2423
+ fontWeight: 700,
2424
+ color: "#111827"
2425
+ },
2426
+ children: d$(raised)
2427
+ }), /*#__PURE__*/jsx(TrendText, {
2428
+ style: {
2429
+ fontSize: 9
2430
+ },
2431
+ children: formatArrowTrend(raisedGrowth)
2432
+ })]
2433
+ })]
2434
+ })]
2435
+ })]
2436
+ })
2437
+ });
2438
+ };
2439
+ var KpiCard = function KpiCard(_ref10) {
2440
+ var title = _ref10.title,
2441
+ value = _ref10.value,
2442
+ trend = _ref10.trend,
2443
+ detail = _ref10.detail,
2444
+ _ref10$variant = _ref10.variant,
2445
+ variant = _ref10$variant === void 0 ? "secondary" : _ref10$variant,
2446
+ _ref10$trendPositiveW = _ref10.trendPositiveWhenNegative,
2447
+ trendPositiveWhenNegative = _ref10$trendPositiveW === void 0 ? false : _ref10$trendPositiveW;
2313
2448
  var displayTrend = withTrendArrow(trend);
2314
2449
  var isPrimary = variant === "primary";
2315
2450
  return /*#__PURE__*/jsxs("div", {
@@ -2360,46 +2495,6 @@ var KpiCard = function KpiCard(_ref1) {
2360
2495
  })]
2361
2496
  });
2362
2497
  };
2363
- var StatPair = function StatPair(_ref10) {
2364
- var label = _ref10.label,
2365
- val = _ref10.val,
2366
- trend = _ref10.trend;
2367
- var displayTrend = withTrendArrow(trend);
2368
- return /*#__PURE__*/jsxs("div", {
2369
- style: {
2370
- marginBottom: 6
2371
- },
2372
- children: [/*#__PURE__*/jsx("div", {
2373
- style: {
2374
- fontSize: 8.5,
2375
- color: THEME.muted,
2376
- marginBottom: 1
2377
- },
2378
- children: label
2379
- }), /*#__PURE__*/jsxs("div", {
2380
- style: {
2381
- display: "flex",
2382
- alignItems: "baseline",
2383
- gap: 4
2384
- },
2385
- children: [/*#__PURE__*/jsx("span", {
2386
- style: {
2387
- fontSize: 13,
2388
- fontWeight: 700,
2389
- color: "#111827"
2390
- },
2391
- children: val
2392
- }), trend && /*#__PURE__*/jsx("span", {
2393
- style: {
2394
- fontSize: 9.5,
2395
- fontWeight: 600,
2396
- color: resolveTrendColor(displayTrend)
2397
- },
2398
- children: displayTrend
2399
- })]
2400
- })]
2401
- });
2402
- };
2403
2498
  var PageHeader = function PageHeader(_ref11) {
2404
2499
  var dateLabel = _ref11.dateLabel,
2405
2500
  generatedLabel = _ref11.generatedLabel,
@@ -2534,7 +2629,7 @@ var PageFooter = function PageFooter(_ref12) {
2534
2629
 
2535
2630
  // ─── Main component ───────────────────────────────────────────────────────────
2536
2631
  var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref13, ref) {
2537
- var _apiData$overviewStat, _overview$totalRevenu, _overview$netRevenue, _overview$overallAVGD, _overview$conversionR, _apiData$totalVisits, _refundsRaw$refundRat, _refundsRaw$chargebac, _apiData$trafficSourc2, _metricByTitle$NetRa, _metricByTitle$Total, _metricByTitle$Total2, _metricByTitle$Total3, _metricByTitle$AvgDo, _metricByTitle$AvgDo2, _apiData$medianGift, _apiData$topDecileGif, _apiData$roasCard, _metricByTitle$ROAS, _apiData$roasCardPrev, _metricByTitle$ROAS2, _apiData$adSpend, _apiData$attributedRe, _metricByTitle$Conver, _metricByTitle$Conver2, _metricByTitle$Refund, _metricByTitle$Refund2, _refundsRaw$refundCou, _metricByTitle$Refund3, _mainChart$stacked, _ref16, _refundsRaw$refundRat2, _ob$growthPercentage, _ob$peakDay, _refCard$growthPercen;
2632
+ var _apiData$overviewStat, _overview$totalRevenu, _overview$netRevenue, _overview$overallAVGD, _overview$conversionR, _apiData$totalVisits, _refundsRaw$refundRat, _refundsRaw$chargebac, _apiData$trafficSourc2, _metricByTitle$NetRa, _metricByTitle$Total, _metricByTitle$Total2, _metricByTitle$Total3, _metricByTitle$AvgDo, _metricByTitle$AvgDo2, _apiData$medianGift, _apiData$topDecileGif, _apiData$roasCard, _metricByTitle$ROAS, _apiData$roasCardPrev, _metricByTitle$ROAS2, _apiData$adSpend, _apiData$attributedRe, _metricByTitle$Conver, _metricByTitle$Conver2, _metricByTitle$Refund, _metricByTitle$Refund2, _refundsRaw$refundCou, _metricByTitle$Refund3, _mainChart$stacked, _refundsRaw$refundRat2, _ob$growthPercentage, _ob$peakDay, _up$acceptanceGrowth, _up$raisedGrowth, _dn$acceptanceGrowth, _dn$raisedGrowth, _refCard$growthPercen;
2538
2633
  var _ref13$apiData = _ref13.apiData,
2539
2634
  apiData = _ref13$apiData === void 0 ? {} : _ref13$apiData,
2540
2635
  _ref13$dateName = _ref13.dateName,
@@ -2941,8 +3036,8 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref13, ref) {
2941
3036
  children: /*#__PURE__*/jsxs("div", {
2942
3037
  style: {
2943
3038
  display: "flex",
2944
- alignItems: "center",
2945
- gap: 10
3039
+ flexDirection: "column",
3040
+ alignItems: "center"
2946
3041
  },
2947
3042
  children: [/*#__PURE__*/jsx(Donut, {
2948
3043
  segments: [{
@@ -2952,82 +3047,114 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref13, ref) {
2952
3047
  value: returningDonors,
2953
3048
  color: C.emerald
2954
3049
  }],
2955
- size: 82,
3050
+ size: 88,
2956
3051
  centerVal: "".concat(formatNumber(totalMix)),
2957
3052
  centerLabel: "donors"
2958
3053
  }), /*#__PURE__*/jsxs("div", {
2959
3054
  style: {
2960
- flex: 1
3055
+ width: "100%",
3056
+ marginTop: 6
2961
3057
  },
2962
3058
  children: [/*#__PURE__*/jsxs("div", {
2963
3059
  style: {
2964
3060
  display: "flex",
3061
+ justifyContent: "space-between",
2965
3062
  alignItems: "center",
2966
- gap: 6,
2967
3063
  marginBottom: 5
2968
3064
  },
2969
- children: [/*#__PURE__*/jsx("div", {
3065
+ children: [/*#__PURE__*/jsxs("div", {
2970
3066
  style: {
2971
- width: 8,
2972
- height: 8,
2973
- borderRadius: "50%",
2974
- background: C.indigo,
2975
- flexShrink: 0
2976
- }
3067
+ display: "flex",
3068
+ alignItems: "center",
3069
+ gap: 5
3070
+ },
3071
+ children: [/*#__PURE__*/jsx("div", {
3072
+ style: {
3073
+ width: 8,
3074
+ height: 8,
3075
+ borderRadius: 2,
3076
+ background: C.indigo,
3077
+ flexShrink: 0
3078
+ }
3079
+ }), /*#__PURE__*/jsx("span", {
3080
+ style: {
3081
+ fontSize: 9.5,
3082
+ color: "#6B7280"
3083
+ },
3084
+ children: "New donors"
3085
+ })]
2977
3086
  }), /*#__PURE__*/jsxs("span", {
2978
3087
  style: {
2979
3088
  fontSize: 9.5,
2980
- color: "#374151"
3089
+ fontWeight: 700,
3090
+ color: "#111827"
2981
3091
  },
2982
- children: ["New donors ", formatNumber(newDonors), " \xB7 ", newPct, "%"]
3092
+ children: [formatNumber(newDonors), " \xB7 ", newPct, "%"]
2983
3093
  })]
2984
3094
  }), /*#__PURE__*/jsxs("div", {
2985
3095
  style: {
2986
3096
  display: "flex",
3097
+ justifyContent: "space-between",
2987
3098
  alignItems: "center",
2988
- gap: 6,
2989
- marginBottom: 7
3099
+ marginBottom: 8
2990
3100
  },
2991
- children: [/*#__PURE__*/jsx("div", {
3101
+ children: [/*#__PURE__*/jsxs("div", {
2992
3102
  style: {
2993
- width: 8,
2994
- height: 8,
2995
- borderRadius: "50%",
2996
- background: C.emerald,
2997
- flexShrink: 0
2998
- }
3103
+ display: "flex",
3104
+ alignItems: "center",
3105
+ gap: 5
3106
+ },
3107
+ children: [/*#__PURE__*/jsx("div", {
3108
+ style: {
3109
+ width: 8,
3110
+ height: 8,
3111
+ borderRadius: 2,
3112
+ background: C.emerald,
3113
+ flexShrink: 0
3114
+ }
3115
+ }), /*#__PURE__*/jsx("span", {
3116
+ style: {
3117
+ fontSize: 9.5,
3118
+ color: "#6B7280"
3119
+ },
3120
+ children: "Returning"
3121
+ })]
2999
3122
  }), /*#__PURE__*/jsxs("span", {
3000
3123
  style: {
3001
3124
  fontSize: 9.5,
3002
- color: "#374151"
3125
+ fontWeight: 700,
3126
+ color: "#111827"
3003
3127
  },
3004
- children: ["Returning ", formatNumber(returningDonors), " \xB7 ", retPct, "%"]
3128
+ children: [formatNumber(returningDonors), " \xB7 ", retPct, "%"]
3005
3129
  })]
3006
3130
  }), /*#__PURE__*/jsx(Divider, {
3007
3131
  mb: 6
3008
3132
  }), /*#__PURE__*/jsx("div", {
3009
3133
  style: {
3010
- fontSize: 14,
3011
- fontWeight: 800,
3012
- color: "#111827"
3134
+ fontSize: 9.5,
3135
+ color: "#9CA3AF",
3136
+ marginBottom: 2
3013
3137
  },
3014
- children: kpi$(mixAvgGift)
3138
+ children: "Avg gift"
3015
3139
  }), /*#__PURE__*/jsx("div", {
3016
3140
  style: {
3017
- fontSize: 8.5,
3018
- color: "#9CA3AF"
3141
+ fontSize: 14,
3142
+ fontWeight: 800,
3143
+ color: "#111827",
3144
+ marginBottom: 2
3019
3145
  },
3020
- children: "Avg gift"
3146
+ children: d$(mixAvgGift)
3021
3147
  }), /*#__PURE__*/jsx("div", {
3022
3148
  style: {
3023
- fontSize: 9,
3024
- marginTop: 1
3149
+ fontSize: 9
3025
3150
  },
3026
3151
  children: /*#__PURE__*/jsx(TrendText, {
3027
3152
  style: {
3028
3153
  fontSize: 9
3029
3154
  },
3030
- children: "".concat(Number((_ref16 = donorMixPrev !== null && donorMixPrev !== void 0 ? donorMixPrev : growth === null || growth === void 0 ? void 0 : growth.overallAVGDonations) !== null && _ref16 !== void 0 ? _ref16 : 0).toFixed(2), "% vs pp")
3155
+ children: formatArrowTrend(donorMixPrev, {
3156
+ label: "vs last month"
3157
+ })
3031
3158
  })
3032
3159
  })]
3033
3160
  })]
@@ -3198,10 +3325,10 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref13, ref) {
3198
3325
  display: "flex",
3199
3326
  gap: 12
3200
3327
  },
3201
- 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 (_ref17) {
3202
- var _ref18 = _slicedToArray(_ref17, 2),
3203
- l = _ref18[0],
3204
- v = _ref18[1];
3328
+ 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 (_ref16) {
3329
+ var _ref17 = _slicedToArray(_ref16, 2),
3330
+ l = _ref17[0],
3331
+ v = _ref17[1];
3205
3332
  return /*#__PURE__*/jsxs("div", {
3206
3333
  children: [/*#__PURE__*/jsx("div", {
3207
3334
  style: {
@@ -3221,76 +3348,22 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref13, ref) {
3221
3348
  }, l);
3222
3349
  })
3223
3350
  })]
3224
- }), /*#__PURE__*/jsx(Panel, {
3351
+ }), /*#__PURE__*/jsx(AcceptanceRaisedPanel, {
3225
3352
  title: "Upsell",
3226
3353
  subtitle: "Acceptance & raised",
3227
- children: /*#__PURE__*/jsxs("div", {
3228
- style: {
3229
- display: "flex",
3230
- alignItems: "center",
3231
- gap: 12
3232
- },
3233
- children: [/*#__PURE__*/jsx(Donut, {
3234
- segments: [{
3235
- value: (up === null || up === void 0 ? void 0 : up.acceptanceRate) || 0,
3236
- color: C.indigo
3237
- }, {
3238
- value: Math.max(0, 100 - ((up === null || up === void 0 ? void 0 : up.acceptanceRate) || 0)),
3239
- color: "#E5E7EB"
3240
- }],
3241
- size: 76,
3242
- centerVal: "".concat(formatNumber((up === null || up === void 0 ? void 0 : up.acceptanceRate) || 0), "%"),
3243
- centerLabel: "accepted"
3244
- }), /*#__PURE__*/jsxs("div", {
3245
- style: {
3246
- flex: 1
3247
- },
3248
- children: [/*#__PURE__*/jsx(StatPair, {
3249
- label: "Acceptance",
3250
- val: pct((up === null || up === void 0 ? void 0 : up.acceptanceRate) || 0, 1),
3251
- trend: formatArrowTrend(up === null || up === void 0 ? void 0 : up.acceptanceGrowth)
3252
- }), /*#__PURE__*/jsx(StatPair, {
3253
- label: "Raised",
3254
- val: d$((up === null || up === void 0 ? void 0 : up.raised) || 0),
3255
- trend: formatArrowTrend(up === null || up === void 0 ? void 0 : up.raisedGrowth)
3256
- })]
3257
- })]
3258
- })
3259
- }), /*#__PURE__*/jsx(Panel, {
3354
+ acceptanceRate: (up === null || up === void 0 ? void 0 : up.acceptanceRate) || 0,
3355
+ acceptanceGrowth: (_up$acceptanceGrowth = up === null || up === void 0 ? void 0 : up.acceptanceGrowth) !== null && _up$acceptanceGrowth !== void 0 ? _up$acceptanceGrowth : 0,
3356
+ raised: (up === null || up === void 0 ? void 0 : up.raised) || 0,
3357
+ raisedGrowth: (_up$raisedGrowth = up === null || up === void 0 ? void 0 : up.raisedGrowth) !== null && _up$raisedGrowth !== void 0 ? _up$raisedGrowth : 0,
3358
+ primaryColor: C.indigo
3359
+ }), /*#__PURE__*/jsx(AcceptanceRaisedPanel, {
3260
3360
  title: "Downsell",
3261
3361
  subtitle: "Acceptance & raised",
3262
- children: /*#__PURE__*/jsxs("div", {
3263
- style: {
3264
- display: "flex",
3265
- alignItems: "center",
3266
- gap: 12
3267
- },
3268
- children: [/*#__PURE__*/jsx(Donut, {
3269
- segments: [{
3270
- value: (dn === null || dn === void 0 ? void 0 : dn.acceptanceRate) || 0,
3271
- color: C.cyan
3272
- }, {
3273
- value: Math.max(0, 100 - ((dn === null || dn === void 0 ? void 0 : dn.acceptanceRate) || 0)),
3274
- color: "#E5E7EB"
3275
- }],
3276
- size: 76,
3277
- centerVal: "".concat(formatNumber((dn === null || dn === void 0 ? void 0 : dn.acceptanceRate) || 0), "%"),
3278
- centerLabel: "accepted"
3279
- }), /*#__PURE__*/jsxs("div", {
3280
- style: {
3281
- flex: 1
3282
- },
3283
- children: [/*#__PURE__*/jsx(StatPair, {
3284
- label: "Acceptance",
3285
- val: pct((dn === null || dn === void 0 ? void 0 : dn.acceptanceRate) || 0, 1),
3286
- trend: formatArrowTrend(dn === null || dn === void 0 ? void 0 : dn.acceptanceGrowth)
3287
- }), /*#__PURE__*/jsx(StatPair, {
3288
- label: "Raised",
3289
- val: d$((dn === null || dn === void 0 ? void 0 : dn.raised) || 0),
3290
- trend: formatArrowTrend(dn === null || dn === void 0 ? void 0 : dn.raisedGrowth)
3291
- })]
3292
- })]
3293
- })
3362
+ acceptanceRate: (dn === null || dn === void 0 ? void 0 : dn.acceptanceRate) || 0,
3363
+ acceptanceGrowth: (_dn$acceptanceGrowth = dn === null || dn === void 0 ? void 0 : dn.acceptanceGrowth) !== null && _dn$acceptanceGrowth !== void 0 ? _dn$acceptanceGrowth : 0,
3364
+ raised: (dn === null || dn === void 0 ? void 0 : dn.raised) || 0,
3365
+ raisedGrowth: (_dn$raisedGrowth = dn === null || dn === void 0 ? void 0 : dn.raisedGrowth) !== null && _dn$raisedGrowth !== void 0 ? _dn$raisedGrowth : 0,
3366
+ primaryColor: C.cyan
3294
3367
  }), /*#__PURE__*/jsxs(Panel, {
3295
3368
  title: "Referrals",
3296
3369
  subtitle: "Revenue trend \xB7 last ".concat(daysLabel),
@@ -3328,10 +3401,10 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref13, ref) {
3328
3401
  display: "flex",
3329
3402
  gap: 12
3330
3403
  },
3331
- 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 (_ref19) {
3332
- var _ref20 = _slicedToArray(_ref19, 2),
3333
- l = _ref20[0],
3334
- v = _ref20[1];
3404
+ 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 (_ref18) {
3405
+ var _ref19 = _slicedToArray(_ref18, 2),
3406
+ l = _ref19[0],
3407
+ v = _ref19[1];
3335
3408
  return /*#__PURE__*/jsxs("div", {
3336
3409
  children: [/*#__PURE__*/jsx("div", {
3337
3410
  style: {