@feedmepos/mf-connect 0.1.98-beta.7 → 0.1.98-beta.71

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.
Files changed (152) hide show
  1. package/dist/{App-BonFFUVJ.js → App-B-Onur9k.js} +812 -666
  2. package/dist/{AuditLogs-CaQisyMC.js → AuditLogs-BnEeKG1C.js} +14 -13
  3. package/dist/{Bin-Mu8gAiHw.js → Bin-BH9_nATR.js} +8 -8
  4. package/dist/Broadcast-Gt2ZLLpZ.js +302 -0
  5. package/dist/CampaignAnalytic-BT6zTgNk.js +1830 -0
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BoLZVrCU.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-nNLLEzii.js} +6 -5
  7. package/dist/Card-dD52oor7.js +1084 -0
  8. package/dist/{Collections-CByXxRW_.js → Collections-7bwYNl3M.js} +14 -13
  9. package/dist/Credit-qZdlqXqR.js +286 -0
  10. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-DeNn_k19.js +53 -0
  11. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-C09W9Qja.js +4213 -0
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BXsAX1Xa.js → EffectSheet.vue_vue_type_style_index_0_lang-Bz1HRBMa.js} +35 -35
  13. package/dist/{Experience-B7J-aqPK.js → Experience-CAaWgWXP.js} +112 -86
  14. package/dist/{FileSaver.min-D_F_MSZt.js → FileSaver.min-BpfY6VnX.js} +1 -1
  15. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-3bH-tZAm.js +138 -0
  16. package/dist/Game-fhrbFb_5.js +356 -0
  17. package/dist/GiftCardSetup-CTwmNKim.js +736 -0
  18. package/dist/{Grab-C45MmlD9.js → Grab-BnPfb92x.js} +33 -32
  19. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-CPPcB3PC.js → ImageInput.vue_vue_type_script_setup_true_lang-BySju1oT.js} +1 -1
  20. package/dist/{Index-vQ6uP49O.js → Index-DRwvmm_j.js} +10 -10
  21. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-Cj3hN3tg.js → LocationPicker.vue_vue_type_script_setup_true_lang-Ya4r9NNE.js} +1 -1
  22. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DU9eIein.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CDwtqqLQ.js} +1 -1
  23. package/dist/LoyaltyDashboard-8jn6SIWo.js +2865 -0
  24. package/dist/MainLayout-Bf42AcB1.js +143 -0
  25. package/dist/{Marketing-B6xMdQvW.js → Marketing-DruTMjiR.js} +7 -6
  26. package/dist/{MarketingMaterialEdit-0cZN4bek.js → MarketingMaterialEdit-moEHd_gP.js} +15 -14
  27. package/dist/Member-C9VTQqIm.js +654 -0
  28. package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-DEsVSWmv.js +1279 -0
  29. package/dist/MemberImportHistory-DZVwya9v.js +187 -0
  30. package/dist/MemberList-KusIfy1u.js +334 -0
  31. package/dist/{MemberTransactions-Bg-ziZy8.js → MemberTransactions-msyjdzlI.js} +1 -1
  32. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-jbDJkbZh.js → MessageInput.vue_vue_type_script_setup_true_lang-DbV-m3cC.js} +5928 -5644
  33. package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-1DYGpJnD.js +40 -0
  34. package/dist/Mission-CUUxpBUF.js +360 -0
  35. package/dist/{Overview-nsyJGSCq.js → Overview-C9jyKXHX.js} +21 -20
  36. package/dist/Overview-CYKoF8Hp.js +1316 -0
  37. package/dist/Point-CPpQ07yp.js +288 -0
  38. package/dist/Promotion-CJ95m9Qb.js +423 -0
  39. package/dist/{Queue-Dkipt6fw.js → Queue-CX39ILh_.js} +14 -13
  40. package/dist/{Record-BFqx6vM-.js → Record-6I0qyXB5.js} +9 -9
  41. package/dist/Review-DoWu2XNT.js +45 -0
  42. package/dist/ReviewFacebookCallback-Co-5TnI7.js +238 -0
  43. package/dist/ReviewGoogleCallback-Ca7ZuMcF.js +213 -0
  44. package/dist/{Reward-DjFEE7I_.js → Reward-Cx_N6qBJ.js} +35 -35
  45. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-BzZ6VH80.js → RewardGroup.vue_vue_type_script_setup_true_lang-Cn5Yp37p.js} +14 -13
  46. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-A9jQX4jt.js → RuleGroup.vue_vue_type_script_setup_true_lang-M0c67Dyl.js} +196 -186
  47. package/dist/{Segment-BAjdUfZ6.js → Segment-Bx0EW966.js} +275 -276
  48. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-CAQPFzRH.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-ahvrEUGa.js} +37 -36
  49. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-Gkz8jhES.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-C7zSfZdl.js} +4 -4
  50. package/dist/{Setting-BK7y0XC-.js → Setting-DzEK3dWj.js} +14 -14
  51. package/dist/{SettingAdvertisements-DfQ645xr.js → SettingAdvertisements-BNALbI88.js} +12 -12
  52. package/dist/Settings-Cw85-xzq.js +230 -0
  53. package/dist/Store-BSqW1gwf.js +2612 -0
  54. package/dist/{StoreRewards-usHKOGmB.js → StoreRewards-CJXnS8Qf.js} +15 -15
  55. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-C6tUwHEj.js +1329 -0
  56. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DrcWUZuR.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-iylphGuV.js} +2 -2
  57. package/dist/{Tier-BF3V430O.js → Tier-DfitNxp2.js} +2580 -754
  58. package/dist/{Title-DwPuqKfJ.js → Title-QCbtOvKB.js} +39 -37
  59. package/dist/Transaction-dOCzlidD.js +45 -0
  60. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-DToNRTJS.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Be5X1C-Y.js} +26 -26
  61. package/dist/{Voucher-DnhVIl_o.js → Voucher-BfoCDwjg.js} +156 -133
  62. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-Btb3UZCn.js → VoucherEditor.vue_vue_type_script_setup_true_lang-0EIYoZ0F.js} +118 -124
  63. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-EFUW9DMY.js → ZodTextField.vue_vue_type_script_setup_true_lang-UdStgKbX.js} +2 -2
  64. package/dist/{app-i3r-6ZVm.js → app-BxTElIm-.js} +45168 -37577
  65. package/dist/app.js +1 -1
  66. package/dist/base.export-BmUK8hMh.js +75 -0
  67. package/dist/{business-i0Gxk7gG.js → business-DjAiT8tR.js} +5 -5
  68. package/dist/campaign-DlR3KF9m.js +368 -0
  69. package/dist/campaign-tAmQNoq7.js +100 -0
  70. package/dist/{campaign.enum-CbUTfxek.js → campaign.enum-BjwEQd11.js} +1 -1
  71. package/dist/{campaign.fn-BjHSIDd1.js → campaign.fn-C6kWWIQx.js} +53 -53
  72. package/dist/{collectible.enum-DN7E_kHg.js → collectible.enum-BrtXpT9S.js} +1 -1
  73. package/dist/collection.fn-CDhfM3Eq.js +26 -0
  74. package/dist/currency-10nX5QnT.js +7 -0
  75. package/dist/{duplicateCampaign-DmdJQEIA.js → duplicateCampaign-6oMZOvfM.js} +11 -11
  76. package/dist/{effect-DM4AzeQl.js → effect-T4YzuTc5.js} +1 -1
  77. package/dist/{email-addresses-BlqVJhwZ.js → email-addresses-BjODnJMM.js} +209 -201
  78. package/dist/google-C3S8u0mT.js +4 -0
  79. package/dist/{helper-CkdISSVP.js → helper-BCl5r5yZ.js} +1 -1
  80. package/dist/{index-DgzNGQgE.js → index-B9ZMIUMa.js} +2083 -2559
  81. package/dist/{index-CB7ytKOE.js → index-BBsK7TUw.js} +1588 -1522
  82. package/dist/index-BQk6zTgf.js +32437 -0
  83. package/dist/index-Bd4clHfr.js +901 -0
  84. package/dist/index-BeVWchv7.js +14550 -0
  85. package/dist/index-Bht1Z11w.js +72 -0
  86. package/dist/{index-FD50UHqf.js → index-BiolIgqR.js} +105 -123
  87. package/dist/{index-Cl8t41Sk.js → index-BxU--5J5.js} +5 -5
  88. package/dist/index-Bz6oSli7.js +151 -0
  89. package/dist/index-C5IfNJUl.js +53 -0
  90. package/dist/{index-BWsj6lCJ.js → index-CRvUvCMA.js} +14 -14
  91. package/dist/{index-B6xi1soU.js → index-CnaQt4Pn.js} +1 -1
  92. package/dist/{index-4EtrCy_K.js → index-Ctja--IE.js} +4 -4
  93. package/dist/{index-D6qeYVNz.js → index-D8rGhchh.js} +1 -1
  94. package/dist/{index-BrboOmPq.js → index-DJdTDF9C.js} +347 -216
  95. package/dist/index-DXiJa8Cw.js +137 -0
  96. package/dist/{index-CxdLExX0.js → index-DeQKLilv.js} +24 -9
  97. package/dist/{index-vI-ndGu_.js → index-DhtKt4OL.js} +5 -5
  98. package/dist/{index.esm2017-BX5CyKoc.js → index.esm2017-CEOegJjn.js} +132 -132
  99. package/dist/{loading-DTKDhqew.js → loading-Dx4SCvZY.js} +1 -1
  100. package/dist/{lodash-CCPBsqhe.js → lodash-Dq8OKCKK.js} +1 -1
  101. package/dist/member-import-DX-jn2uk.js +187 -0
  102. package/dist/membership-CltAa-gH.js +274 -0
  103. package/dist/{money-wMK3QkZ5.js → money-DsaAjJTI.js} +1 -1
  104. package/dist/{number-DjKVlWn0.js → number-DmhHKYgY.js} +1 -1
  105. package/dist/objectid-BdNv-dZX.js +145 -0
  106. package/dist/{plugins-D25PaNJk.js → plugins-BFKVM3uC.js} +13 -12
  107. package/dist/remy-Qz_pNsUS.js +13 -0
  108. package/dist/{reward-E63jqJHm.js → reward--SjvIeyy.js} +1 -1
  109. package/dist/{rule-RVvPtAnk.js → rule-CAKdNobZ.js} +335 -275
  110. package/dist/style.css +1 -1
  111. package/dist/{template-zNxOQaqe.js → template-Cfxc5eM8.js} +6 -6
  112. package/dist/timezone-D2b-V5XD.js +20 -0
  113. package/dist/transaction.fn-B5mLY7bz.js +71 -0
  114. package/dist/{trigger-BXV02FhP.js → trigger-DvYcjRBZ.js} +17 -17
  115. package/dist/useMarketingMaterialActions-DtqnjMSt.js +96 -0
  116. package/dist/{usePagination-BPcPhEnp.js → usePagination-DKX24g31.js} +1 -1
  117. package/dist/{user-Bd8S7R5u.js → user-fWb1NxGO.js} +1 -1
  118. package/dist/vue-i18n-wJReAVJw.js +2365 -0
  119. package/dist/{xlsx-_tQC9Ezf.js → xlsx-Mthhu4JR.js} +440 -440
  120. package/dist/{zod-C1j2GLZP.js → zod-CVpVUgBZ.js} +1 -1
  121. package/package.json +10 -6
  122. package/dist/Broadcast-Cy-i-WOT.js +0 -266
  123. package/dist/Card-f2XOtWxp.js +0 -910
  124. package/dist/Credit-CcZF4aQS.js +0 -260
  125. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
  126. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-C7KZ8GMx.js +0 -3377
  127. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
  128. package/dist/Game-CUW7NeVG.js +0 -330
  129. package/dist/LoyaltyDashboard-GqyUwvXz.js +0 -1082
  130. package/dist/MainLayout-R5NxIBR-.js +0 -41
  131. package/dist/Member-CC5F6Bmz.js +0 -280
  132. package/dist/MemberList-Cq4zxopX.js +0 -1601
  133. package/dist/Mission-DcCZ6tAG.js +0 -334
  134. package/dist/Point-D1vLd5hL.js +0 -262
  135. package/dist/Promotion-Cv7MW5RJ.js +0 -397
  136. package/dist/Review-CKhakUMe.js +0 -1123
  137. package/dist/ReviewFacebookCallback-xgRpXQAg.js +0 -243
  138. package/dist/ReviewGoogleCallback-Cqi_43qi.js +0 -208
  139. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-DDqK4kV1.js +0 -181
  140. package/dist/Store-uTRQ6KbC.js +0 -1996
  141. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Bb2sTsuA.js +0 -1130
  142. package/dist/Transaction-CnTEfMGU.js +0 -39
  143. package/dist/campaign-CbMlARNI.js +0 -219
  144. package/dist/campaign-f7FT91GR.js +0 -277
  145. package/dist/export-DQR-0lmK.js +0 -97
  146. package/dist/index-COrXX9MR.js +0 -52
  147. package/dist/index-CWiaP-aV.js +0 -28900
  148. package/dist/index-jVfDVEtz.js +0 -85
  149. package/dist/membership-rifuatxU.js +0 -255
  150. package/dist/objectid-DjpWkCxH.js +0 -145
  151. package/dist/useMarketingMaterialActions-5TFNqZVo.js +0 -107
  152. package/dist/vue-i18n-CgMK-TaC.js +0 -2365
@@ -0,0 +1,1830 @@
1
+ import { defineComponent as z, computed as P, resolveComponent as S, openBlock as r, createBlock as x, withCtx as D, createElementBlock as d, createCommentVNode as v, createElementVNode as s, toDisplayString as u, normalizeClass as K, unref as o, Fragment as L, normalizeStyle as ye, createTextVNode as xe, renderList as ee, createVNode as $, ref as Q, onMounted as ke } from "vue";
2
+ import { u as he } from "./vue-i18n-wJReAVJw.js";
3
+ import { useCoreStore as we } from "@feedmepos/mf-common";
4
+ import { c as U } from "./index-Bz6oSli7.js";
5
+ import { u as Re } from "./loading-Dx4SCvZY.js";
6
+ import { s as Me, a as _e } from "./campaign-DlR3KF9m.js";
7
+ import { C as be } from "./timezone-D2b-V5XD.js";
8
+ import { h as Se } from "./moment-D7p2TMB-.js";
9
+ import { s as Ce } from "./index-CuvNtC_M.js";
10
+ import { T as Ie } from "./transaction.fn-B5mLY7bz.js";
11
+ import { _ as te } from "./MetricInfoTooltip.vue_vue_type_script_setup_true_lang-1DYGpJnD.js";
12
+ import { useRoute as $e, useRouter as Pe } from "vue-router";
13
+ const Oe = {
14
+ state: "populated",
15
+ reportRangeLabel: "Unavailable",
16
+ funnel: [],
17
+ cards: [],
18
+ trend: [],
19
+ breakdown: null,
20
+ outcomes: [],
21
+ metrics: []
22
+ }, De = {
23
+ state: "populated",
24
+ reportRangeLabel: "Unavailable",
25
+ funnel: [],
26
+ cards: [],
27
+ trend: [],
28
+ breakdown: {
29
+ dimension: "Outlet",
30
+ columns: [
31
+ "Applied members",
32
+ "Member bills",
33
+ "Non-member bills",
34
+ "Attributed bills",
35
+ "Exact sales",
36
+ "Promotion value used"
37
+ ],
38
+ rows: []
39
+ },
40
+ outcomes: [],
41
+ metrics: []
42
+ }, Le = {
43
+ state: "populated",
44
+ reportRangeLabel: "Unavailable",
45
+ funnel: [],
46
+ cards: [],
47
+ trend: [],
48
+ breakdown: null,
49
+ breakdowns: [],
50
+ outcomes: [],
51
+ metrics: []
52
+ }, Be = {
53
+ state: "populated",
54
+ reportRangeLabel: "Unavailable",
55
+ funnel: [],
56
+ cards: [],
57
+ trend: [],
58
+ breakdown: null,
59
+ breakdowns: [],
60
+ outcomes: [],
61
+ metrics: []
62
+ }, Ee = {
63
+ state: "populated",
64
+ reportRangeLabel: "Unavailable",
65
+ funnel: [],
66
+ cards: [],
67
+ trend: [],
68
+ breakdown: null,
69
+ breakdowns: [],
70
+ outcomes: [],
71
+ metrics: []
72
+ }, Ve = {
73
+ state: "populated",
74
+ reportRangeLabel: "Unavailable",
75
+ funnel: [],
76
+ cards: [],
77
+ trend: [],
78
+ breakdown: null,
79
+ breakdowns: [],
80
+ outcomes: [],
81
+ metrics: []
82
+ }, Te = {
83
+ state: "populated",
84
+ reportRangeLabel: "Unavailable",
85
+ funnel: [],
86
+ cards: [],
87
+ trend: [],
88
+ breakdown: null,
89
+ breakdowns: [],
90
+ outcomes: [],
91
+ metrics: []
92
+ }, Ne = {
93
+ VOUCHER: {
94
+ label: "Voucher",
95
+ icon: "confirmation_number",
96
+ objective: "Reactivation",
97
+ report: Oe
98
+ },
99
+ PROMOTION: {
100
+ label: "Promotion",
101
+ icon: "percent",
102
+ objective: "Purchase conversion",
103
+ report: De
104
+ },
105
+ MISSION: {
106
+ label: "Mission",
107
+ icon: "flag",
108
+ objective: "Member engagement",
109
+ report: Le
110
+ },
111
+ GAME: {
112
+ label: "Game",
113
+ icon: "sports_esports",
114
+ objective: "Member engagement",
115
+ report: Be
116
+ },
117
+ COIN: {
118
+ label: "Point",
119
+ icon: "stars",
120
+ objective: "Member engagement",
121
+ report: Ee
122
+ },
123
+ POINT: {
124
+ label: "Experience",
125
+ icon: "trending_up",
126
+ objective: "Member engagement",
127
+ report: Ve
128
+ },
129
+ CREDIT: {
130
+ label: "Credit",
131
+ icon: "account_balance_wallet",
132
+ objective: "Member engagement",
133
+ report: Te
134
+ }
135
+ };
136
+ function Ue(t) {
137
+ return Ne[t];
138
+ }
139
+ function _(t, l, e = l) {
140
+ const a = t ?? 0;
141
+ return `${a.toLocaleString()} ${a === 1 ? e : l}`;
142
+ }
143
+ function m(t) {
144
+ return (t ?? 0).toLocaleString();
145
+ }
146
+ function R(t) {
147
+ return t == null ? "—" : `RM ${t.toLocaleString("en-MY", {
148
+ minimumFractionDigits: 2,
149
+ maximumFractionDigits: 2
150
+ })}`;
151
+ }
152
+ function B(t, l) {
153
+ const e = l ?? 0;
154
+ return e ? Math.round((t ?? 0) / e * 1e3) / 10 : 0;
155
+ }
156
+ function N(t) {
157
+ const l = Se(t);
158
+ return l.isValid() ? l.format("D MMM YYYY") : t;
159
+ }
160
+ function Ae(t, l, e) {
161
+ var h;
162
+ const { metrics: a, scope: i } = l, b = a.rewardValueBasis === "FACE_VALUE", p = b ? "Redeemed Face Value" : "Reward Value Used", g = l.redemptionBreakdown ?? {
163
+ member: {
164
+ redeemedMembers: 0,
165
+ redeemedVouchers: 0,
166
+ voucherUses: 0,
167
+ completedBills: 0
168
+ },
169
+ guest: {
170
+ redeemedVouchers: 0,
171
+ voucherUses: 0,
172
+ completedBills: 0
173
+ }
174
+ }, { member: n, guest: k } = g, c = B(
175
+ n.redeemedMembers,
176
+ a.distributedMembers
177
+ ), C = B(
178
+ a.redeemedVouchers,
179
+ a.distributedVouchers
180
+ ), y = a.completedBills == null ? null : a.completedBills === 0 ? 0 : a.rewardValueUsed / a.completedBills, E = a.completedBills == null || a.exactSales == null ? null : a.completedBills === 0 ? 0 : a.exactSales / a.completedBills, M = B(
181
+ a.expiredUnusedVouchers,
182
+ a.distributedVouchers
183
+ );
184
+ return {
185
+ ...t,
186
+ reportRangeLabel: i.startDate && i.endDate ? `${N(i.startDate)} – ${N(i.endDate)}` : "Unavailable",
187
+ audienceLabel: void 0,
188
+ funnelHeadline: {
189
+ key: "voucherUtilization",
190
+ label: "Redemption rate",
191
+ value: `${C}%`,
192
+ helper: "Distinct redeemed vouchers divided by distributed vouchers"
193
+ },
194
+ funnelSummary: `${m(a.redeemedVouchers)} of ${m(
195
+ a.distributedVouchers
196
+ )} distributed vouchers redeemed. ${_(
197
+ n.voucherUses,
198
+ "member voucher uses",
199
+ "member voucher use"
200
+ )} and ${_(
201
+ k.voucherUses,
202
+ "guest voucher uses",
203
+ "guest voucher use"
204
+ )}.`,
205
+ funnelPrimaryLabel: "Member path",
206
+ funnel: [
207
+ {
208
+ key: "distributed",
209
+ label: "Distributed",
210
+ membersLabel: _(
211
+ a.distributedMembers,
212
+ "members",
213
+ "member"
214
+ ),
215
+ unitsLabel: _(
216
+ a.distributedVouchers,
217
+ "vouchers",
218
+ "voucher"
219
+ ),
220
+ valueLabel: R(a.distributedFixedValue),
221
+ helper: "Unique members who received at least one voucher"
222
+ },
223
+ {
224
+ key: "redeemed",
225
+ label: "Redeemed",
226
+ membersLabel: _(n.redeemedMembers, "members", "member"),
227
+ unitsLabel: _(
228
+ n.voucherUses,
229
+ "voucher uses",
230
+ "voucher use"
231
+ ),
232
+ ratePct: c,
233
+ rateLabel: `${c}% of distributed members`,
234
+ helper: "Distinct identified members who used the voucher"
235
+ },
236
+ {
237
+ key: "completedBills",
238
+ label: "Completed bills",
239
+ primaryLabel: n.completedBills == null ? "Unavailable" : _(
240
+ n.completedBills,
241
+ "completed bills",
242
+ "completed bill"
243
+ ),
244
+ helper: "Distinct completed bills where a member used this voucher"
245
+ }
246
+ ],
247
+ funnelSecondary: {
248
+ label: "Guest path",
249
+ stages: [
250
+ {
251
+ key: "guestRedeemed",
252
+ label: "Redeemed",
253
+ primaryLabel: _(
254
+ k.voucherUses,
255
+ "voucher uses",
256
+ "voucher use"
257
+ ),
258
+ unitsLabel: _(
259
+ k.redeemedVouchers,
260
+ "redeemed vouchers",
261
+ "redeemed voucher"
262
+ ),
263
+ helper: "Voucher uses by guests without a member account"
264
+ },
265
+ {
266
+ key: "guestCompletedBills",
267
+ label: "Completed bills",
268
+ primaryLabel: k.completedBills == null ? "Unavailable" : _(
269
+ k.completedBills,
270
+ "completed bills",
271
+ "completed bill"
272
+ ),
273
+ helper: "Distinct completed bills where a guest used this voucher"
274
+ }
275
+ ]
276
+ },
277
+ cards: [
278
+ {
279
+ key: "distributedMembers",
280
+ label: "Distributed Members",
281
+ value: (a.distributedMembers ?? 0).toLocaleString(),
282
+ sub: _(a.distributedVouchers, "vouchers")
283
+ },
284
+ {
285
+ key: "redemptionRate",
286
+ label: "Redemption Rate",
287
+ value: `${C}%`,
288
+ sub: "of distributed vouchers"
289
+ },
290
+ {
291
+ key: b ? "paymentVoucherUses" : "exactSales",
292
+ label: b ? "Payment Voucher Uses" : "Exact Sales",
293
+ value: b ? m(a.voucherUses) : R(a.exactSales),
294
+ sub: b ? "Recorded voucher redemptions" : a.completedBills == null ? "Bill attribution unavailable" : _(a.completedBills, "completed bills")
295
+ },
296
+ {
297
+ key: "rewardValueUsed",
298
+ label: p,
299
+ value: R(a.rewardValueUsed),
300
+ sub: b ? "Voucher uses × configured face value" : "voucher discount used"
301
+ },
302
+ {
303
+ key: "unusedVoucherValue",
304
+ label: "Unused Voucher Value",
305
+ value: R(a.unusedVoucherValue),
306
+ sub: "issued, not yet redeemed"
307
+ }
308
+ ],
309
+ trend: Ye(e),
310
+ breakdown: {
311
+ dimension: "Outlet",
312
+ columns: [
313
+ "Redeemed members",
314
+ "Voucher uses",
315
+ "Completed bills",
316
+ "Exact sales",
317
+ b ? "Redeemed face value" : "Reward value used"
318
+ ],
319
+ rows: l.performanceDetails.map((A) => {
320
+ var ae;
321
+ return {
322
+ name: A.restaurantName,
323
+ cells: [
324
+ A.redeemedMembers.toLocaleString(),
325
+ A.voucherUses.toLocaleString(),
326
+ ((ae = A.completedBills) == null ? void 0 : ae.toLocaleString()) ?? "—",
327
+ R(A.exactSales),
328
+ R(A.rewardValueUsed)
329
+ ]
330
+ };
331
+ })
332
+ },
333
+ outcomes: [
334
+ {
335
+ key: "exactSales",
336
+ label: "Exact Sales",
337
+ value: R(a.exactSales)
338
+ },
339
+ {
340
+ key: "attributedBills",
341
+ label: "Attributed Bills",
342
+ value: ((h = a.completedBills) == null ? void 0 : h.toLocaleString()) ?? "—"
343
+ },
344
+ {
345
+ key: "rewardValueUsed",
346
+ label: p,
347
+ value: R(a.rewardValueUsed)
348
+ },
349
+ {
350
+ key: "averageBillValue",
351
+ label: "Average Bill Value",
352
+ value: R(E)
353
+ }
354
+ ],
355
+ metrics: [
356
+ {
357
+ key: "memberRedemptionRate",
358
+ label: "Member Redemption Rate",
359
+ value: `${c}%`,
360
+ helper: "Redeemed members ÷ distributed members"
361
+ },
362
+ {
363
+ key: "voucherUtilizationRate",
364
+ label: "Voucher Utilization Rate",
365
+ value: `${C}%`,
366
+ helper: "Redeemed vouchers ÷ distributed vouchers"
367
+ },
368
+ {
369
+ key: "averageDiscountPerBill",
370
+ label: "Average Discount per Bill",
371
+ value: R(y),
372
+ helper: "Reward value used ÷ completed bills"
373
+ },
374
+ {
375
+ key: "averageBillValue",
376
+ label: "Average Bill Value",
377
+ value: R(E),
378
+ helper: "Exact sales ÷ completed bills"
379
+ },
380
+ {
381
+ key: "breakageRate",
382
+ label: "Breakage Rate to date",
383
+ value: `${M}%`,
384
+ helper: "Expired unused vouchers ÷ distributed vouchers"
385
+ }
386
+ ]
387
+ };
388
+ }
389
+ function Fe(t, l) {
390
+ const { metrics: e, scope: a } = l, i = B(
391
+ e.memberBills,
392
+ e.attributedBills
393
+ ), b = B(
394
+ e.nonMemberBills,
395
+ e.attributedBills
396
+ ), p = B(
397
+ e.memberSales,
398
+ e.exactSales
399
+ ), g = e.attributedBills ? e.promotionValueUsed / e.attributedBills : 0, n = e.attributedBills ? e.exactSales / e.attributedBills : 0;
400
+ return {
401
+ ...t,
402
+ reportRangeLabel: a.startDate && a.endDate ? `${N(a.startDate)} – ${N(a.endDate)}` : "Unavailable",
403
+ audienceLabel: void 0,
404
+ funnel: [],
405
+ cards: [],
406
+ trend: [],
407
+ applicationMix: {
408
+ memberBills: m(e.memberBills),
409
+ appliedMembers: m(e.appliedMembers),
410
+ nonMemberBills: m(e.nonMemberBills),
411
+ memberSales: R(e.memberSales),
412
+ nonMemberSales: R(e.nonMemberSales),
413
+ memberBillSharePct: i,
414
+ nonMemberBillSharePct: b,
415
+ memberSalesSharePct: p,
416
+ summary: `Members account for ${i}% of attributed bills and ${p}% of attributed sales.`
417
+ },
418
+ breakdown: {
419
+ dimension: "Outlet",
420
+ columns: [
421
+ "Applied members",
422
+ "Member bills",
423
+ "Non-member bills",
424
+ "Attributed bills",
425
+ "Exact sales",
426
+ "Promotion value used"
427
+ ],
428
+ rows: l.performanceDetails.map((k) => ({
429
+ name: k.restaurantName,
430
+ cells: [
431
+ m(k.appliedMembers),
432
+ m(k.memberBills),
433
+ m(k.nonMemberBills),
434
+ m(k.attributedBills),
435
+ R(k.exactSales),
436
+ R(k.promotionValueUsed)
437
+ ]
438
+ }))
439
+ },
440
+ outcomes: [
441
+ {
442
+ key: "exactSales",
443
+ label: "Exact Sales",
444
+ value: R(e.exactSales)
445
+ },
446
+ {
447
+ key: "attributedBills",
448
+ label: "Attributed Bills",
449
+ value: m(e.attributedBills)
450
+ },
451
+ {
452
+ key: "promotionValueUsed",
453
+ label: "Promotion Value Used",
454
+ value: R(e.promotionValueUsed)
455
+ },
456
+ {
457
+ key: "averageBillValue",
458
+ label: "Average Bill Value",
459
+ value: R(n)
460
+ }
461
+ ],
462
+ metrics: [
463
+ {
464
+ key: "memberApplicationShare",
465
+ label: "Member Application Share",
466
+ value: `${i}%`,
467
+ helper: "Member bills ÷ attributed bills"
468
+ },
469
+ {
470
+ key: "nonMemberApplicationShare",
471
+ label: "Non-member Application Share",
472
+ value: `${b}%`,
473
+ helper: "Non-member bills ÷ attributed bills"
474
+ },
475
+ {
476
+ key: "memberSalesShare",
477
+ label: "Member Sales Share",
478
+ value: `${p}%`,
479
+ helper: "Member sales ÷ exact sales"
480
+ },
481
+ {
482
+ key: "averageDiscountPerBill",
483
+ label: "Average Discount per Bill",
484
+ value: R(g),
485
+ helper: "Promotion value used ÷ attributed bills"
486
+ },
487
+ {
488
+ key: "averageBillValue",
489
+ label: "Average Bill Value",
490
+ value: R(n),
491
+ helper: "Exact sales ÷ attributed bills"
492
+ }
493
+ ]
494
+ };
495
+ }
496
+ function qe(t, l) {
497
+ const { metrics: e, scope: a } = l, i = e.participants ? e.stampsEarned / e.participants : 0, b = Math.max(
498
+ e.completionEvents - e.completedMembers,
499
+ 0
500
+ );
501
+ return {
502
+ ...t,
503
+ reportRangeLabel: a.startDate && a.endDate ? `${N(a.startDate)} – ${N(a.endDate)}` : "Unavailable",
504
+ funnel: [],
505
+ cards: [
506
+ {
507
+ key: "participants",
508
+ label: "Participants",
509
+ value: m(e.participants),
510
+ sub: "members receiving stamps",
511
+ helper: "Distinct members receiving at least one campaign Stamp"
512
+ },
513
+ {
514
+ key: "stampsEarned",
515
+ label: "Stamps Earned",
516
+ value: m(e.stampsEarned),
517
+ sub: "stamps"
518
+ },
519
+ {
520
+ key: "stampTransactions",
521
+ label: "Stamp Transactions",
522
+ value: m(e.stampTransactions),
523
+ sub: "transactions"
524
+ },
525
+ {
526
+ key: "completedMembers",
527
+ label: "Completed Members",
528
+ value: m(e.completedMembers),
529
+ sub: "completed at least once",
530
+ helper: "Distinct participants completing the Mission at least once"
531
+ },
532
+ {
533
+ key: "completionEvents",
534
+ label: "Completion Events",
535
+ value: m(e.completionEvents),
536
+ sub: "includes repeat completions",
537
+ helper: "All Mission target crossings, including repeat completions"
538
+ }
539
+ ],
540
+ trend: [],
541
+ breakdown: null,
542
+ breakdowns: [
543
+ {
544
+ title: "Reward performance",
545
+ emptyMessage: "No reward activity was recorded for this campaign.",
546
+ breakdown: {
547
+ dimension: "Reward",
548
+ columns: [
549
+ "Reward type",
550
+ "Recipients",
551
+ "Issue transactions",
552
+ "Quantity issued"
553
+ ],
554
+ rows: l.rewards.map((p) => ({
555
+ name: p.rewardName,
556
+ cells: [
557
+ p.rewardType,
558
+ m(p.recipients),
559
+ m(p.issuanceTransactions),
560
+ m(p.quantityIssued)
561
+ ]
562
+ }))
563
+ }
564
+ },
565
+ {
566
+ title: "Performance by outlet",
567
+ emptyMessage: "No outlet activity was recorded for this campaign.",
568
+ breakdown: {
569
+ dimension: "Outlet",
570
+ columns: ["Participants", "Stamps earned", "Completion events"],
571
+ rows: l.performanceDetails.map((p) => ({
572
+ name: p.restaurantName || "Unattributed / online",
573
+ cells: [
574
+ m(p.participants),
575
+ m(p.stampsEarned),
576
+ m(p.completionEvents)
577
+ ]
578
+ }))
579
+ }
580
+ }
581
+ ],
582
+ outcomes: [
583
+ {
584
+ key: "rewardRecipients",
585
+ label: "Reward Recipients",
586
+ value: m(e.rewardRecipients)
587
+ },
588
+ {
589
+ key: "rewardIssueTransactions",
590
+ label: "Reward Issue Transactions",
591
+ value: m(e.rewardIssueTransactions)
592
+ }
593
+ ],
594
+ metrics: [
595
+ {
596
+ key: "completionReach",
597
+ label: "Completion Reach",
598
+ value: `${B(e.completedMembers, e.participants)}%`,
599
+ helper: "Completed members ÷ participants"
600
+ },
601
+ {
602
+ key: "rewardReach",
603
+ label: "Reward Reach",
604
+ value: `${B(e.rewardRecipients, e.participants)}%`,
605
+ helper: "Reward recipients ÷ participants"
606
+ },
607
+ {
608
+ key: "averageStampsPerParticipant",
609
+ label: "Average Stamps per Participant",
610
+ value: i.toLocaleString("en-MY", {
611
+ maximumFractionDigits: 2
612
+ }),
613
+ helper: "Stamps earned ÷ participants"
614
+ },
615
+ {
616
+ key: "repeatCompletionEvents",
617
+ label: "Repeat Completion Events",
618
+ value: m(b),
619
+ helper: "Completion events beyond the first completion per member"
620
+ }
621
+ ]
622
+ };
623
+ }
624
+ function je(t, l) {
625
+ const { metrics: e, scope: a } = l, i = B(e.players, e.tokenRecipients), b = B(e.plays, e.tokensIssued), p = B(
626
+ e.rewardRecipients,
627
+ e.players
628
+ ), g = e.players ? e.plays / e.players : 0;
629
+ return {
630
+ ...t,
631
+ reportRangeLabel: a.startDate && a.endDate ? `${N(a.startDate)} – ${N(a.endDate)}` : "Unavailable",
632
+ audienceLabel: void 0,
633
+ funnel: [
634
+ {
635
+ key: "tokenRecipients",
636
+ label: "Token recipients",
637
+ membersLabel: _(e.tokenRecipients, "members"),
638
+ unitsLabel: _(e.tokensIssued, "tokens"),
639
+ extra: `${m(e.plays)} plays · ${b}% token utilization`,
640
+ helper: "Distinct members who received at least one game token"
641
+ },
642
+ {
643
+ key: "players",
644
+ label: "Players",
645
+ membersLabel: _(e.players, "members"),
646
+ unitsLabel: _(e.plays, "plays"),
647
+ ratePct: i,
648
+ rateLabel: `${i}% of token recipients`,
649
+ helper: "Distinct members who consumed at least one game token"
650
+ },
651
+ {
652
+ key: "rewardRecipients",
653
+ label: "Reward recipients",
654
+ membersLabel: _(e.rewardRecipients, "members"),
655
+ unitsLabel: _(
656
+ e.rewardIssueTransactions,
657
+ "reward issue transactions"
658
+ ),
659
+ ratePct: p,
660
+ rateLabel: `${p}% of players`,
661
+ helper: "Distinct players receiving at least one Reward Pool reward"
662
+ }
663
+ ],
664
+ cards: [
665
+ {
666
+ key: "tokenRecipients",
667
+ label: "Token Recipients",
668
+ value: m(e.tokenRecipients),
669
+ sub: "members"
670
+ },
671
+ {
672
+ key: "tokensIssued",
673
+ label: "Tokens Issued",
674
+ value: m(e.tokensIssued),
675
+ sub: "game tokens"
676
+ },
677
+ {
678
+ key: "players",
679
+ label: "Players",
680
+ value: m(e.players),
681
+ sub: "members"
682
+ },
683
+ {
684
+ key: "plays",
685
+ label: "Plays",
686
+ value: m(e.plays),
687
+ sub: "game plays"
688
+ }
689
+ ],
690
+ trend: [],
691
+ breakdown: null,
692
+ breakdowns: [
693
+ {
694
+ title: "Reward performance",
695
+ emptyMessage: "No reward activity was recorded for this campaign.",
696
+ breakdown: {
697
+ dimension: "Reward",
698
+ columns: [
699
+ "Reward type",
700
+ "Recipients",
701
+ "Issue transactions",
702
+ "Quantity issued"
703
+ ],
704
+ rows: l.rewards.map((n) => ({
705
+ name: n.rewardName || "Unnamed reward",
706
+ cells: [
707
+ n.rewardType,
708
+ m(n.recipients),
709
+ m(n.issuanceTransactions),
710
+ m(n.quantityIssued)
711
+ ]
712
+ }))
713
+ }
714
+ },
715
+ {
716
+ title: "Token distribution by outlet",
717
+ emptyMessage: "No token distribution activity was recorded for this campaign.",
718
+ breakdown: {
719
+ dimension: "Outlet",
720
+ columns: ["Recipients", "Tokens issued"],
721
+ rows: l.tokenDistributionDetails.map((n) => ({
722
+ name: n.restaurantName || "Unattributed / online",
723
+ cells: [
724
+ m(n.recipients),
725
+ m(n.tokensIssued)
726
+ ]
727
+ }))
728
+ }
729
+ }
730
+ ],
731
+ outcomes: [
732
+ {
733
+ key: "rewardRecipients",
734
+ label: "Reward Recipients",
735
+ value: m(e.rewardRecipients)
736
+ },
737
+ {
738
+ key: "rewardIssueTransactions",
739
+ label: "Reward Issue Transactions",
740
+ value: m(e.rewardIssueTransactions)
741
+ }
742
+ ],
743
+ metrics: [
744
+ {
745
+ key: "playerRate",
746
+ label: "Player Rate",
747
+ value: `${i}%`,
748
+ helper: "Players ÷ token recipients"
749
+ },
750
+ {
751
+ key: "tokenUtilizationRate",
752
+ label: "Token Utilization Rate",
753
+ value: `${b}%`,
754
+ helper: "Plays ÷ tokens issued"
755
+ },
756
+ {
757
+ key: "rewardRecipientRate",
758
+ label: "Reward Recipient Rate",
759
+ value: `${p}%`,
760
+ helper: "Reward recipients ÷ players"
761
+ },
762
+ {
763
+ key: "averagePlaysPerPlayer",
764
+ label: "Average Plays per Player",
765
+ value: g.toLocaleString("en-MY", {
766
+ maximumFractionDigits: 2
767
+ }),
768
+ helper: "Plays ÷ players"
769
+ }
770
+ ]
771
+ };
772
+ }
773
+ const ze = "Members can appear under more than one source, so total share may add to more than 100%.";
774
+ function W(t, l) {
775
+ return l ? R(t ?? 0) : m(t);
776
+ }
777
+ function Z(t, l) {
778
+ return t[l] ?? 0;
779
+ }
780
+ function re(t, l, e) {
781
+ const { metrics: a, scope: i } = l, b = a.recipients ? Z(a, e.quantityKey) / a.recipients : 0, p = a.issuanceTransactions ? Z(a, e.quantityKey) / a.issuanceTransactions : 0, g = [
782
+ "Recipients",
783
+ ...e.includeSourceRecipientShare ? ["Recipient share"] : [],
784
+ "Issuance transactions",
785
+ e.quantityLabel
786
+ ], n = l.sourceDetails.map((c) => ({
787
+ name: c.source ? Ce(Ie.getReason(c.source)) : "Unknown",
788
+ cells: [
789
+ m(c.recipients),
790
+ ...e.includeSourceRecipientShare ? [`${B(c.recipients, a.recipients)}%`] : [],
791
+ m(c.issuanceTransactions),
792
+ W(
793
+ Z(c, e.quantityKey),
794
+ e.currency
795
+ )
796
+ ]
797
+ })), k = [
798
+ {
799
+ key: "averagePerRecipient",
800
+ label: `Average ${e.quantityName} per Recipient`,
801
+ value: W(b, e.currency),
802
+ helper: `${e.quantityLabel} ÷ recipients`
803
+ },
804
+ {
805
+ key: "averagePerIssue",
806
+ label: `Average ${e.quantityName} per Issue`,
807
+ value: W(p, e.currency),
808
+ helper: `${e.quantityLabel} ÷ issuance transactions`
809
+ }
810
+ ];
811
+ return {
812
+ ...t,
813
+ reportRangeLabel: i.startDate && i.endDate ? `${N(i.startDate)} – ${N(i.endDate)}` : "Unavailable",
814
+ audienceLabel: void 0,
815
+ funnel: [],
816
+ cards: [
817
+ {
818
+ key: "recipients",
819
+ label: `${e.label} Recipients`,
820
+ value: m(a.recipients),
821
+ sub: "members",
822
+ helper: `Distinct members receiving ${e.quantityName.toLowerCase()}`
823
+ },
824
+ {
825
+ key: "issuanceTransactions",
826
+ label: "Issuance Transactions",
827
+ value: m(a.issuanceTransactions),
828
+ sub: "transactions",
829
+ helper: "Count of issuance transactions directly attributed to this campaign"
830
+ },
831
+ {
832
+ key: e.quantityKey,
833
+ label: e.quantityLabel.replace(/^./, (c) => c.toUpperCase()),
834
+ value: W(
835
+ Z(a, e.quantityKey),
836
+ e.currency
837
+ ),
838
+ sub: e.quantityUnit,
839
+ helper: `Total ${e.quantityName.toLowerCase()} issued through transactions directly attributed to this campaign`
840
+ }
841
+ ],
842
+ trend: [],
843
+ breakdown: null,
844
+ breakdowns: [
845
+ {
846
+ title: "Distribution by source",
847
+ emptyMessage: "No source activity was recorded for this campaign.",
848
+ ...e.includeSourceRecipientShare ? { note: ze } : {},
849
+ breakdown: {
850
+ dimension: "Source",
851
+ columns: g,
852
+ rows: n
853
+ }
854
+ },
855
+ {
856
+ title: "Performance by outlet",
857
+ emptyMessage: "No outlet activity was recorded for this campaign.",
858
+ breakdown: {
859
+ dimension: "Outlet",
860
+ columns: [
861
+ "Recipients",
862
+ "Issuance transactions",
863
+ e.quantityLabel
864
+ ],
865
+ rows: l.performanceDetails.map((c) => ({
866
+ name: c.restaurantName || "Unattributed / online",
867
+ cells: [
868
+ m(c.recipients),
869
+ m(c.issuanceTransactions),
870
+ W(
871
+ Z(c, e.quantityKey),
872
+ e.currency
873
+ )
874
+ ]
875
+ }))
876
+ }
877
+ }
878
+ ],
879
+ outcomes: [],
880
+ metrics: k
881
+ };
882
+ }
883
+ function Ge(t, l) {
884
+ return re(t, l, {
885
+ label: "Point",
886
+ quantityName: "Points",
887
+ quantityLabel: "Points issued",
888
+ quantityUnit: "points",
889
+ quantityKey: "pointsIssued",
890
+ currency: !1,
891
+ includeSourceRecipientShare: !0
892
+ });
893
+ }
894
+ function He(t, l) {
895
+ return re(t, l, {
896
+ label: "Experience",
897
+ quantityName: "Experience",
898
+ quantityLabel: "Experience issued",
899
+ quantityUnit: "experience",
900
+ quantityKey: "experienceIssued",
901
+ currency: !1,
902
+ includeSourceRecipientShare: !0
903
+ });
904
+ }
905
+ function Ke(t, l) {
906
+ return re(t, l, {
907
+ label: "Credit",
908
+ quantityName: "Credit",
909
+ quantityLabel: "Credit issued",
910
+ quantityUnit: "credit",
911
+ quantityKey: "creditIssued",
912
+ currency: !0,
913
+ includeSourceRecipientShare: !1
914
+ });
915
+ }
916
+ function Ye(t) {
917
+ if (!(t != null && t.categories.length)) return [];
918
+ const l = t.rewardValueBasis === "FACE_VALUE" ? "Redeemed face value" : "Reward value used", e = {
919
+ key: "members",
920
+ label: "Distributed members vs Redeemed members",
921
+ categories: t.categories,
922
+ series: [
923
+ { label: "Distributed members", values: t.distributedMembers },
924
+ { label: "Redeemed members", values: t.redeemedMembers }
925
+ ]
926
+ };
927
+ return t.distributedValue == null ? [e] : [
928
+ e,
929
+ {
930
+ key: "value",
931
+ label: t.rewardValueBasis === "FACE_VALUE" ? "Distributed voucher value vs Redeemed face value" : "Distributed voucher value vs Reward value used",
932
+ categories: t.categories,
933
+ series: [
934
+ {
935
+ label: "Distributed voucher value",
936
+ values: t.distributedValue
937
+ },
938
+ { label: l, values: t.rewardValueUsed }
939
+ ]
940
+ }
941
+ ];
942
+ }
943
+ function Qe(t) {
944
+ return [
945
+ {
946
+ header: t.dimension,
947
+ accessorFn: (l) => l.name
948
+ },
949
+ ...t.columns.map((l, e) => ({
950
+ header: l,
951
+ accessorFn: (a) => a.cells[e] ?? ""
952
+ }))
953
+ ];
954
+ }
955
+ const Xe = {
956
+ key: 0,
957
+ class: "flex items-center gap-8 mb-8"
958
+ }, Je = { class: "fm-typo-en-body-sm-600 text-fm-color-primary uppercase" }, We = { class: "flex items-center gap-12 mb-12 flex-wrap" }, Ze = { class: "fm-typo-en-title-lg-800 text-fm-color-typo-primary m-0" }, et = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary flex flex-wrap gap-x-16 gap-y-4" }, tt = {
959
+ key: 1,
960
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary mt-4"
961
+ }, at = /* @__PURE__ */ z({
962
+ __name: "CampaignAnalyticHeader",
963
+ props: {
964
+ campaignName: {},
965
+ datesLabel: {},
966
+ status: {},
967
+ mechanicLabel: {},
968
+ icon: {},
969
+ objective: {},
970
+ reportRangeLabel: {},
971
+ audienceLabel: {},
972
+ demo: { type: Boolean }
973
+ },
974
+ setup(t) {
975
+ const l = t, { t: e } = he(), a = P(() => l.status ? {
976
+ active: "text-fm-color-typo-success bg-fm-color-system-success-100",
977
+ upcoming: "text-fm-color-typo-info bg-fm-color-system-info-100",
978
+ expired: "text-fm-color-typo-error bg-fm-color-system-error-100"
979
+ }[l.status] : "");
980
+ return (i, b) => {
981
+ const p = S("FmIcon"), g = S("FmChip"), n = S("FmCard");
982
+ return r(), x(n, {
983
+ variant: "outlined",
984
+ class: "p-24"
985
+ }, {
986
+ default: D(() => [
987
+ t.mechanicLabel ? (r(), d("div", Xe, [
988
+ t.icon ? (r(), x(p, {
989
+ key: 0,
990
+ name: t.icon,
991
+ outline: "",
992
+ size: "sm",
993
+ class: "!text-fm-color-primary"
994
+ }, null, 8, ["name"])) : v("", !0),
995
+ s("span", Je, u(t.objective ? `${t.mechanicLabel} · ${t.objective}` : t.mechanicLabel), 1)
996
+ ])) : v("", !0),
997
+ s("div", We, [
998
+ s("h1", Ze, u(t.campaignName), 1),
999
+ t.status ? (r(), x(g, {
1000
+ key: 0,
1001
+ class: K(o(a)),
1002
+ label: o(e)(`connect.campaign.common.status.${t.status}`),
1003
+ compact: ""
1004
+ }, null, 8, ["class", "label"])) : v("", !0),
1005
+ t.demo ? (r(), x(g, {
1006
+ key: 1,
1007
+ class: "!text-fm-color-typo-warning !bg-fm-color-system-warning-100",
1008
+ compact: "",
1009
+ label: "Demo data"
1010
+ })) : v("", !0)
1011
+ ]),
1012
+ s("div", et, [
1013
+ s("span", null, u(t.datesLabel), 1),
1014
+ t.reportRangeLabel ? (r(), d(L, { key: 0 }, [
1015
+ b[0] || (b[0] = s("span", { class: "text-fm-color-typo-disabled" }, "·", -1)),
1016
+ s("span", null, "Reporting: " + u(t.reportRangeLabel), 1)
1017
+ ], 64)) : v("", !0)
1018
+ ]),
1019
+ t.audienceLabel ? (r(), d("div", tt, " Audience: " + u(t.audienceLabel), 1)) : v("", !0)
1020
+ ]),
1021
+ _: 1
1022
+ });
1023
+ };
1024
+ }
1025
+ }), st = { class: "grid grid-cols-2 xs:grid-cols-1 gap-16" }, rt = { class: "min-w-0" }, lt = { class: "fm-typo-en-title-sm-800 mt-8" }, nt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary mt-4" }, ot = { class: "min-w-0" }, it = { class: "fm-typo-en-title-sm-800 mt-8" }, ct = { class: "grid grid-cols-2 xs:grid-cols-1 gap-16 mt-16" }, mt = { class: "min-w-0" }, ut = { class: "fm-typo-en-title-sm-800 mt-8" }, dt = { class: "min-w-0" }, pt = { class: "fm-typo-en-title-sm-800 mt-8" }, yt = ["aria-label"], bt = { class: "flex h-12 overflow-hidden rounded-xxxl bg-fm-color-neutral-gray-100" }, vt = { class: "flex justify-between gap-16 mt-8 fm-typo-en-body-sm-400 text-fm-color-typo-tertiary" }, ft = { class: "mt-16 pt-12 border-t border-fm-color-neutral-gray-100 fm-typo-en-body-sm-400 text-fm-color-typo-tertiary" }, ht = /* @__PURE__ */ z({
1026
+ __name: "PromotionApplicationMix",
1027
+ props: {
1028
+ mix: {}
1029
+ },
1030
+ setup(t) {
1031
+ return (l, e) => {
1032
+ const a = S("FmCard");
1033
+ return r(), x(a, {
1034
+ variant: "outlined",
1035
+ class: "p-24"
1036
+ }, {
1037
+ default: D(() => [
1038
+ e[4] || (e[4] = s("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, " Customer mix ", -1)),
1039
+ e[5] || (e[5] = s("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary mt-4 mb-16" }, " Completed bills attributed to this promotion ", -1)),
1040
+ s("div", st, [
1041
+ s("div", rt, [
1042
+ e[0] || (e[0] = s("div", { class: "flex items-center gap-8" }, [
1043
+ s("div", { class: "w-8 h-8 rounded-sm bg-fm-color-primary" }),
1044
+ s("span", { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary" }, " Member bills ")
1045
+ ], -1)),
1046
+ s("div", lt, u(t.mix.memberBills), 1),
1047
+ s("div", nt, u(t.mix.appliedMembers) + " applied members ", 1)
1048
+ ]),
1049
+ s("div", ot, [
1050
+ e[1] || (e[1] = s("div", { class: "flex items-center gap-8" }, [
1051
+ s("div", { class: "w-8 h-8 rounded-sm bg-fm-color-neutral-gray-200" }),
1052
+ s("span", { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary" }, " Non-member bills ")
1053
+ ], -1)),
1054
+ s("div", it, u(t.mix.nonMemberBills), 1)
1055
+ ])
1056
+ ]),
1057
+ s("div", ct, [
1058
+ s("div", mt, [
1059
+ e[2] || (e[2] = s("div", { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary" }, " Member sales ", -1)),
1060
+ s("div", ut, u(t.mix.memberSales), 1)
1061
+ ]),
1062
+ s("div", dt, [
1063
+ e[3] || (e[3] = s("div", { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary" }, " Non-member sales ", -1)),
1064
+ s("div", pt, u(t.mix.nonMemberSales), 1)
1065
+ ])
1066
+ ]),
1067
+ s("div", {
1068
+ class: "mt-24",
1069
+ role: "img",
1070
+ "aria-label": t.mix.summary
1071
+ }, [
1072
+ s("div", bt, [
1073
+ s("div", {
1074
+ class: "h-full bg-fm-color-primary",
1075
+ style: ye({ width: t.mix.memberBillSharePct + "%" })
1076
+ }, null, 4),
1077
+ s("div", {
1078
+ class: "h-full bg-fm-color-neutral-gray-200",
1079
+ style: ye({ width: t.mix.nonMemberBillSharePct + "%" })
1080
+ }, null, 4)
1081
+ ]),
1082
+ s("div", vt, [
1083
+ s("span", null, "Members " + u(t.mix.memberBillSharePct) + "%", 1),
1084
+ s("span", null, "Non-members " + u(t.mix.nonMemberBillSharePct) + "%", 1)
1085
+ ])
1086
+ ], 8, yt),
1087
+ s("div", ft, u(t.mix.summary), 1)
1088
+ ]),
1089
+ _: 1
1090
+ });
1091
+ };
1092
+ }
1093
+ }), gt = {
1094
+ key: 0,
1095
+ class: "mt-16"
1096
+ }, xt = { class: "flex items-end gap-8" }, kt = { class: "fm-typo-en-title-lg-800 text-fm-color-typo-primary" }, wt = { class: "flex items-center gap-4 fm-typo-en-body-sm-600 text-fm-color-typo-secondary mb-4" }, Rt = {
1097
+ key: 0,
1098
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary mt-4"
1099
+ }, Mt = {
1100
+ key: 0,
1101
+ class: "flex xs:block"
1102
+ }, _t = {
1103
+ key: 0,
1104
+ class: "flex-1 min-w-0 xs:hidden"
1105
+ }, St = { class: "flex xs:flex-col items-stretch" }, Ct = {
1106
+ key: 0,
1107
+ class: "flex-1 min-w-0 xs:hidden"
1108
+ }, It = { class: "flex-1 min-w-0 px-16 xs:px-4 xs:py-12" }, $t = { class: "flex items-center gap-4" }, Pt = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-tertiary" }, Ot = {
1109
+ key: 0,
1110
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-disabled italic mt-8"
1111
+ }, Dt = { class: "fm-typo-en-title-sm-800 text-fm-color-typo-primary mt-8" }, Lt = {
1112
+ key: 0,
1113
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary"
1114
+ }, Bt = {
1115
+ key: 1,
1116
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary"
1117
+ }, Et = {
1118
+ key: 2,
1119
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary"
1120
+ }, Vt = {
1121
+ key: 3,
1122
+ class: "mt-8"
1123
+ }, Tt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary mt-4" }, Nt = {
1124
+ key: 0,
1125
+ class: "flex items-center justify-center px-4 xs:py-4"
1126
+ }, Ut = /* @__PURE__ */ z({
1127
+ __name: "CampaignFunnel",
1128
+ props: {
1129
+ stages: {},
1130
+ headline: {},
1131
+ summary: {},
1132
+ primaryLabel: {},
1133
+ secondaryLabel: {},
1134
+ secondaryStages: {}
1135
+ },
1136
+ setup(t) {
1137
+ const l = t, e = P(() => {
1138
+ var a;
1139
+ return [
1140
+ { label: l.primaryLabel, stages: l.stages, offset: !1 },
1141
+ ...(a = l.secondaryStages) != null && a.length ? [
1142
+ {
1143
+ label: l.secondaryLabel,
1144
+ stages: l.secondaryStages,
1145
+ offset: !0
1146
+ }
1147
+ ] : []
1148
+ ];
1149
+ });
1150
+ return (a, i) => {
1151
+ const b = S("FmProgressBar"), p = S("FmIcon"), g = S("FmCard");
1152
+ return r(), x(g, {
1153
+ variant: "outlined",
1154
+ class: "p-24"
1155
+ }, {
1156
+ default: D(() => [
1157
+ i[0] || (i[0] = s("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, " Campaign funnel ", -1)),
1158
+ i[1] || (i[1] = s("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary mt-4" }, " Campaign activity at each stage ", -1)),
1159
+ t.headline ? (r(), d("div", gt, [
1160
+ s("div", xt, [
1161
+ s("span", kt, u(t.headline.value), 1),
1162
+ s("span", wt, [
1163
+ xe(u(t.headline.label) + " ", 1),
1164
+ t.headline.helper ? (r(), x(te, {
1165
+ key: 0,
1166
+ description: t.headline.helper
1167
+ }, null, 8, ["description"])) : v("", !0)
1168
+ ])
1169
+ ]),
1170
+ t.summary ? (r(), d("div", Rt, u(t.summary), 1)) : v("", !0)
1171
+ ])) : v("", !0),
1172
+ (r(!0), d(L, null, ee(o(e), (n, k) => (r(), d("div", {
1173
+ key: n.label ?? k,
1174
+ class: K(["flex flex-col", k ? "mt-16 pt-16 border-t border-fm-color-neutral-gray-100" : "mt-16"])
1175
+ }, [
1176
+ n.label ? (r(), d("div", Mt, [
1177
+ n.offset ? (r(), d("div", _t)) : v("", !0),
1178
+ s("div", {
1179
+ class: K(["fm-typo-en-body-sm-600 text-fm-color-typo-secondary mb-8", n.offset ? "flex-[2]" : "flex-1"])
1180
+ }, u(n.label), 3)
1181
+ ])) : v("", !0),
1182
+ s("div", St, [
1183
+ n.offset ? (r(), d("div", Ct)) : v("", !0),
1184
+ (r(!0), d(L, null, ee(n.stages, (c, C) => (r(), d("div", {
1185
+ key: c.key,
1186
+ class: "flex xs:flex-col flex-1 min-w-0 items-stretch"
1187
+ }, [
1188
+ s("div", It, [
1189
+ s("div", $t, [
1190
+ s("span", Pt, u(c.label), 1),
1191
+ c.helper ? (r(), x(te, {
1192
+ key: 0,
1193
+ description: c.helper
1194
+ }, null, 8, ["description"])) : v("", !0)
1195
+ ]),
1196
+ c.notSupported ? (r(), d("div", Ot, u(c.helper), 1)) : (r(), d(L, { key: 1 }, [
1197
+ s("div", Dt, u(c.primaryLabel ?? c.membersLabel ?? "—"), 1),
1198
+ c.unitsLabel ? (r(), d("div", Lt, u(c.unitsLabel), 1)) : v("", !0),
1199
+ c.valueLabel ? (r(), d("div", Bt, u(c.valueLabel), 1)) : v("", !0),
1200
+ c.extra ? (r(), d("div", Et, u(c.extra), 1)) : v("", !0),
1201
+ c.ratePct !== void 0 ? (r(), d("div", Vt, [
1202
+ $(b, {
1203
+ value: c.ratePct,
1204
+ color: "primary",
1205
+ size: "sm"
1206
+ }, null, 8, ["value"]),
1207
+ s("div", Tt, u(c.rateLabel), 1)
1208
+ ])) : v("", !0)
1209
+ ], 64))
1210
+ ]),
1211
+ C < n.stages.length - 1 ? (r(), d("div", Nt, [
1212
+ $(p, {
1213
+ name: "chevron_right",
1214
+ size: "sm",
1215
+ class: "text-fm-color-neutral-gray-300 xs:rotate-90"
1216
+ })
1217
+ ])) : v("", !0)
1218
+ ]))), 128))
1219
+ ])
1220
+ ], 2))), 128))
1221
+ ]),
1222
+ _: 1
1223
+ });
1224
+ };
1225
+ }
1226
+ }), At = { class: "grid grid-cols-[repeat(auto-fit,minmax(200px,1fr))] xs:grid-cols-1 gap-16" }, Ft = { class: "flex items-center gap-8" }, qt = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary flex-1 min-w-0 truncate" }, jt = {
1227
+ key: 0,
1228
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary"
1229
+ }, se = /* @__PURE__ */ z({
1230
+ __name: "CampaignMetricCards",
1231
+ props: {
1232
+ cards: {}
1233
+ },
1234
+ setup(t) {
1235
+ return (l, e) => {
1236
+ const a = S("FmCard");
1237
+ return r(), d("section", At, [
1238
+ (r(!0), d(L, null, ee(t.cards, (i) => (r(), x(a, {
1239
+ key: i.key,
1240
+ variant: "outlined",
1241
+ class: "flex flex-col gap-4 p-16 min-w-0 overflow-hidden"
1242
+ }, {
1243
+ default: D(() => [
1244
+ s("div", Ft, [
1245
+ s("span", qt, u(i.label), 1),
1246
+ i.helper ? (r(), x(te, {
1247
+ key: 0,
1248
+ description: i.helper
1249
+ }, null, 8, ["description"])) : v("", !0)
1250
+ ]),
1251
+ s("div", {
1252
+ class: K([
1253
+ "fm-typo-en-title-sm-800 truncate",
1254
+ i.unavailable ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
1255
+ ])
1256
+ }, u(i.value), 3),
1257
+ i.sub ? (r(), d("div", jt, u(i.sub), 1)) : v("", !0)
1258
+ ]),
1259
+ _: 2
1260
+ }, 1024))), 128))
1261
+ ]);
1262
+ };
1263
+ }
1264
+ }), zt = { class: "flex items-center justify-between gap-12 flex-wrap mb-16 xs:flex-col xs:items-start" }, Gt = {
1265
+ key: 0,
1266
+ class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary mb-12"
1267
+ }, Ht = /* @__PURE__ */ z({
1268
+ __name: "CampaignTrendChart",
1269
+ props: {
1270
+ modes: {}
1271
+ },
1272
+ setup(t) {
1273
+ var k;
1274
+ const l = t, e = ["#FF7823", "#B2B3B6"], a = Q(((k = l.modes[0]) == null ? void 0 : k.key) ?? ""), i = P(
1275
+ () => l.modes.map((c) => ({ label: c.label, value: c.key }))
1276
+ ), b = P(
1277
+ () => i.value.find((c) => c.value === a.value) ?? null
1278
+ ), p = P(
1279
+ () => l.modes.find((c) => c.key === a.value) ?? l.modes[0]
1280
+ ), g = P(
1281
+ () => {
1282
+ var c;
1283
+ return (((c = p.value) == null ? void 0 : c.series) ?? []).map((C, y) => ({
1284
+ label: C.label,
1285
+ data: C.values,
1286
+ color: e[y] ?? e[e.length - 1],
1287
+ dash: y > 0
1288
+ }));
1289
+ }
1290
+ ), n = { display: !0 };
1291
+ return (c, C) => {
1292
+ const y = S("FmButtonGroup"), E = S("FmLineChart"), M = S("FmCard");
1293
+ return r(), x(M, {
1294
+ variant: "outlined",
1295
+ class: "p-24"
1296
+ }, {
1297
+ default: D(() => [
1298
+ s("div", zt, [
1299
+ C[1] || (C[1] = s("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, " Funnel trend ", -1)),
1300
+ t.modes.length > 1 ? (r(), x(y, {
1301
+ key: 0,
1302
+ items: o(i),
1303
+ "model-value": o(b),
1304
+ "onUpdate:modelValue": C[0] || (C[0] = (h) => a.value = h.value)
1305
+ }, null, 8, ["items", "model-value"])) : v("", !0)
1306
+ ]),
1307
+ o(p) ? (r(), d("div", Gt, u(o(p).label), 1)) : v("", !0),
1308
+ o(p) ? (r(), x(E, {
1309
+ key: 1,
1310
+ datasets: o(g),
1311
+ "x-axis": { categories: o(p).categories },
1312
+ "x-cfg": n,
1313
+ "y-cfg": n,
1314
+ legend: { display: !0 },
1315
+ height: "150px"
1316
+ }, null, 8, ["datasets", "x-axis"])) : v("", !0)
1317
+ ]),
1318
+ _: 1
1319
+ });
1320
+ };
1321
+ }
1322
+ }), Kt = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Yt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary mt-4" }, Qt = {
1323
+ key: 0,
1324
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary mt-4"
1325
+ }, Xt = {
1326
+ key: 1,
1327
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary mt-8"
1328
+ }, Jt = {
1329
+ key: 2,
1330
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary mt-8"
1331
+ }, ve = /* @__PURE__ */ z({
1332
+ __name: "CampaignBreakdownTable",
1333
+ props: {
1334
+ breakdown: {},
1335
+ title: { default: "Performance details" },
1336
+ emptyMessage: { default: "No outlet activity was recorded for this campaign." },
1337
+ note: {}
1338
+ },
1339
+ setup(t) {
1340
+ const l = t, e = P(
1341
+ () => l.breakdown ? Qe(l.breakdown) : []
1342
+ );
1343
+ return (a, i) => {
1344
+ const b = S("FmTable"), p = S("FmCard");
1345
+ return r(), x(p, {
1346
+ variant: "outlined",
1347
+ class: "p-24"
1348
+ }, {
1349
+ default: D(() => {
1350
+ var g;
1351
+ return [
1352
+ s("div", Kt, u(t.title), 1),
1353
+ (g = t.breakdown) != null && g.rows.length ? (r(), d(L, { key: 0 }, [
1354
+ s("div", Yt, " By " + u(t.breakdown.dimension), 1),
1355
+ t.note ? (r(), d("div", Qt, u(t.note), 1)) : v("", !0),
1356
+ $(b, {
1357
+ class: "mt-12",
1358
+ "row-data": t.breakdown.rows,
1359
+ "column-defs": o(e),
1360
+ "column-filter": [],
1361
+ "hide-footer": ""
1362
+ }, null, 8, ["row-data", "column-defs"])
1363
+ ], 64)) : t.breakdown ? (r(), d("div", Xt, u(t.emptyMessage), 1)) : (r(), d("div", Jt, " No breakdown dimension is available for this campaign. "))
1364
+ ];
1365
+ }),
1366
+ _: 1
1367
+ });
1368
+ };
1369
+ }
1370
+ }), Wt = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Zt = {
1371
+ key: 0,
1372
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary mt-4 mb-12"
1373
+ }, ea = {
1374
+ key: 0,
1375
+ class: "px-16 py-12 rounded-lg bg-fm-color-neutral-gray-100 min-w-0"
1376
+ }, ta = { class: "flex items-center gap-8" }, aa = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary flex-1 min-w-0 truncate" }, sa = {
1377
+ key: 1,
1378
+ class: "flex items-center justify-between gap-12 py-8 border-b border-fm-color-neutral-gray-100"
1379
+ }, ra = { class: "flex items-center gap-8 min-w-0" }, la = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary truncate" }, fe = /* @__PURE__ */ z({
1380
+ __name: "CampaignMetricList",
1381
+ props: {
1382
+ title: {},
1383
+ caption: {},
1384
+ items: {},
1385
+ variant: { default: "tile" }
1386
+ },
1387
+ setup(t) {
1388
+ return (l, e) => {
1389
+ const a = S("FmCard");
1390
+ return r(), x(a, {
1391
+ variant: "outlined",
1392
+ class: "p-24"
1393
+ }, {
1394
+ default: D(() => [
1395
+ s("div", Wt, u(t.title), 1),
1396
+ t.caption ? (r(), d("div", Zt, u(t.caption), 1)) : v("", !0),
1397
+ s("div", {
1398
+ class: K(["grid grid-cols-[repeat(auto-fit,minmax(220px,1fr))] xs:grid-cols-1", t.variant === "tile" ? "gap-16" : "gap-x-16"])
1399
+ }, [
1400
+ (r(!0), d(L, null, ee(t.items, (i) => (r(), d(L, {
1401
+ key: i.key
1402
+ }, [
1403
+ t.variant === "tile" ? (r(), d("div", ea, [
1404
+ s("div", ta, [
1405
+ s("span", aa, u(i.label), 1),
1406
+ i.helper ? (r(), x(te, {
1407
+ key: 0,
1408
+ description: i.helper
1409
+ }, null, 8, ["description"])) : v("", !0)
1410
+ ]),
1411
+ s("div", {
1412
+ class: K([
1413
+ "fm-typo-en-body-lg-600 mt-4 truncate",
1414
+ i.unavailable ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
1415
+ ])
1416
+ }, u(i.value), 3)
1417
+ ])) : (r(), d("div", sa, [
1418
+ s("div", ra, [
1419
+ s("span", la, u(i.label), 1),
1420
+ i.helper ? (r(), x(te, {
1421
+ key: 0,
1422
+ description: i.helper
1423
+ }, null, 8, ["description"])) : v("", !0)
1424
+ ]),
1425
+ s("span", {
1426
+ class: K([
1427
+ "fm-typo-en-body-md-600 whitespace-nowrap",
1428
+ i.unavailable ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
1429
+ ])
1430
+ }, u(i.value), 3)
1431
+ ]))
1432
+ ], 64))), 128))
1433
+ ], 2)
1434
+ ]),
1435
+ _: 1
1436
+ });
1437
+ };
1438
+ }
1439
+ }), na = { class: "flex items-center gap-8" }, oa = { class: "px-24 flex flex-col gap-16 pb-24" }, ia = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, ca = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, ma = {
1440
+ key: 0,
1441
+ class: "flex flex-col gap-12"
1442
+ }, ua = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, da = {
1443
+ key: 1,
1444
+ class: "flex flex-col gap-12"
1445
+ }, _a = /* @__PURE__ */ z({
1446
+ __name: "CampaignAnalytic",
1447
+ setup(t) {
1448
+ const { t: l } = he(), e = $e(), a = Pe(), { global: i, minor: b } = Re, p = we(), g = Q(), n = Q(), k = Q(), c = Q(!1), C = Q(!1), y = P(() => {
1449
+ var O;
1450
+ return (O = g.value) == null ? void 0 : O.campaign;
1451
+ }), E = P(
1452
+ () => y.value ? Ue(y.value.type) : void 0
1453
+ ), M = P(() => {
1454
+ var O;
1455
+ return (O = E.value) == null ? void 0 : O.report;
1456
+ }), h = P(() => {
1457
+ var O, w, G, H, V, T, F, I, f, q, j, X, J;
1458
+ return M.value && ((O = y.value) == null ? void 0 : O.type) === "COIN" ? Ge(
1459
+ M.value,
1460
+ ((w = n.value) == null ? void 0 : w.type) === "COIN" ? n.value : ie()
1461
+ ) : M.value && ((G = y.value) == null ? void 0 : G.type) === "POINT" ? He(
1462
+ M.value,
1463
+ ((H = n.value) == null ? void 0 : H.type) === "POINT" ? n.value : ce()
1464
+ ) : M.value && ((V = y.value) == null ? void 0 : V.type) === "CREDIT" ? Ke(
1465
+ M.value,
1466
+ ((T = n.value) == null ? void 0 : T.type) === "CREDIT" ? n.value : me()
1467
+ ) : M.value && ((F = y.value) == null ? void 0 : F.type) === "GAME" ? je(
1468
+ M.value,
1469
+ ((I = n.value) == null ? void 0 : I.type) === "GAME" ? n.value : oe()
1470
+ ) : M.value && ((f = y.value) == null ? void 0 : f.type) === "MISSION" ? qe(
1471
+ M.value,
1472
+ ((q = n.value) == null ? void 0 : q.type) === "MISSION" ? n.value : ne()
1473
+ ) : M.value && ((j = y.value) == null ? void 0 : j.type) === "PROMOTION" ? Fe(
1474
+ M.value,
1475
+ ((X = n.value) == null ? void 0 : X.type) === "PROMOTION" ? n.value : le()
1476
+ ) : M.value && ((J = n.value) == null ? void 0 : J.type) === "VOUCHER" ? Ae(
1477
+ M.value,
1478
+ n.value,
1479
+ k.value
1480
+ ) : M.value;
1481
+ }), A = P(
1482
+ () => y.value ? l(Me(y.value.timeframeOptions)) : ""
1483
+ ), ae = P(
1484
+ () => y.value && y.value.type !== "MEMBERSHIP" ? _e(y.value) : void 0
1485
+ );
1486
+ function ge() {
1487
+ return {
1488
+ type: "VOUCHER",
1489
+ scope: { startDate: "", endDate: "" },
1490
+ metrics: {
1491
+ distributedMembers: 0,
1492
+ distributedVouchers: 0,
1493
+ distributedFixedValue: null,
1494
+ redeemedMembers: 0,
1495
+ redeemedVouchers: 0,
1496
+ voucherUses: 0,
1497
+ expiredUnusedVouchers: 0,
1498
+ completedBills: 0,
1499
+ exactSales: 0,
1500
+ rewardValueUsed: 0,
1501
+ unusedVoucherValue: null
1502
+ },
1503
+ redemptionBreakdown: {
1504
+ member: {
1505
+ redeemedMembers: 0,
1506
+ redeemedVouchers: 0,
1507
+ voucherUses: 0,
1508
+ completedBills: 0
1509
+ },
1510
+ guest: {
1511
+ redeemedVouchers: 0,
1512
+ voucherUses: 0,
1513
+ completedBills: 0
1514
+ }
1515
+ },
1516
+ performanceDetails: []
1517
+ };
1518
+ }
1519
+ function le() {
1520
+ return {
1521
+ type: "PROMOTION",
1522
+ scope: { startDate: "", endDate: "" },
1523
+ metrics: {
1524
+ appliedMembers: 0,
1525
+ memberBills: 0,
1526
+ nonMemberBills: 0,
1527
+ attributedBills: 0,
1528
+ memberSales: 0,
1529
+ nonMemberSales: 0,
1530
+ exactSales: 0,
1531
+ promotionValueUsed: 0
1532
+ },
1533
+ performanceDetails: []
1534
+ };
1535
+ }
1536
+ function ne() {
1537
+ return {
1538
+ type: "MISSION",
1539
+ scope: { startDate: "", endDate: "" },
1540
+ metrics: {
1541
+ participants: 0,
1542
+ stampsEarned: 0,
1543
+ stampTransactions: 0,
1544
+ rewardRecipients: 0,
1545
+ rewardIssueTransactions: 0,
1546
+ completedMembers: 0,
1547
+ completionEvents: 0
1548
+ },
1549
+ rewards: [],
1550
+ performanceDetails: []
1551
+ };
1552
+ }
1553
+ function oe() {
1554
+ return {
1555
+ type: "GAME",
1556
+ scope: { startDate: "", endDate: "" },
1557
+ metrics: {
1558
+ tokenRecipients: 0,
1559
+ tokensIssued: 0,
1560
+ players: 0,
1561
+ plays: 0,
1562
+ rewardRecipients: 0,
1563
+ rewardIssueTransactions: 0
1564
+ },
1565
+ rewards: [],
1566
+ tokenDistributionDetails: []
1567
+ };
1568
+ }
1569
+ function ie() {
1570
+ return {
1571
+ type: "COIN",
1572
+ scope: { startDate: "", endDate: "" },
1573
+ metrics: {
1574
+ recipients: 0,
1575
+ issuanceTransactions: 0,
1576
+ pointsIssued: 0
1577
+ },
1578
+ sourceDetails: [],
1579
+ performanceDetails: []
1580
+ };
1581
+ }
1582
+ function ce() {
1583
+ return {
1584
+ type: "POINT",
1585
+ scope: { startDate: "", endDate: "" },
1586
+ metrics: {
1587
+ recipients: 0,
1588
+ issuanceTransactions: 0,
1589
+ experienceIssued: 0
1590
+ },
1591
+ sourceDetails: [],
1592
+ performanceDetails: []
1593
+ };
1594
+ }
1595
+ function me() {
1596
+ return {
1597
+ type: "CREDIT",
1598
+ scope: { startDate: "", endDate: "" },
1599
+ metrics: {
1600
+ recipients: 0,
1601
+ issuanceTransactions: 0,
1602
+ creditIssued: 0
1603
+ },
1604
+ sourceDetails: [],
1605
+ performanceDetails: []
1606
+ };
1607
+ }
1608
+ return ke(async () => {
1609
+ var O, w, G, H, V, T, F;
1610
+ try {
1611
+ await i(async () => {
1612
+ var q, j;
1613
+ g.value = await U.readById(e.params.id);
1614
+ const f = e.meta.campaignType;
1615
+ C.value = !!f && ((j = (q = g.value) == null ? void 0 : q.campaign) == null ? void 0 : j.type) !== f;
1616
+ });
1617
+ const I = {
1618
+ timezone: be[p.currentCountry.value || "MY"] ?? be.MY
1619
+ };
1620
+ ((O = g.value) == null ? void 0 : O.campaign.type) === "VOUCHER" ? (n.value = ge(), await Promise.all([
1621
+ b(
1622
+ () => U.readAnalyticsOverview(e.params.id, {
1623
+ ...I
1624
+ })
1625
+ ).then((f) => {
1626
+ f.type === "VOUCHER" && (n.value = f);
1627
+ }).catch(() => {
1628
+ }),
1629
+ b(
1630
+ () => U.readAnalyticsTrend(e.params.id, I)
1631
+ ).then((f) => k.value = f).catch(() => {
1632
+ })
1633
+ ])) : ((w = g.value) == null ? void 0 : w.campaign.type) === "PROMOTION" ? (n.value = le(), await b(
1634
+ () => U.readAnalyticsOverview(e.params.id, I)
1635
+ ).then((f) => {
1636
+ f.type === "PROMOTION" && (n.value = f);
1637
+ }).catch(() => {
1638
+ })) : ((G = g.value) == null ? void 0 : G.campaign.type) === "MISSION" ? (n.value = ne(), await b(
1639
+ () => U.readAnalyticsOverview(e.params.id, I)
1640
+ ).then((f) => {
1641
+ f.type === "MISSION" && (n.value = f);
1642
+ }).catch(() => {
1643
+ })) : ((H = g.value) == null ? void 0 : H.campaign.type) === "GAME" ? (n.value = oe(), await b(
1644
+ () => U.readAnalyticsOverview(e.params.id, I)
1645
+ ).then((f) => {
1646
+ f.type === "GAME" && (n.value = f);
1647
+ }).catch(() => {
1648
+ })) : ((V = g.value) == null ? void 0 : V.campaign.type) === "COIN" ? (n.value = ie(), await b(
1649
+ () => U.readAnalyticsOverview(e.params.id, I)
1650
+ ).then((f) => {
1651
+ f.type === "COIN" && (n.value = f);
1652
+ }).catch(() => {
1653
+ })) : ((T = g.value) == null ? void 0 : T.campaign.type) === "POINT" ? (n.value = ce(), await b(
1654
+ () => U.readAnalyticsOverview(e.params.id, I)
1655
+ ).then((f) => {
1656
+ f.type === "POINT" && (n.value = f);
1657
+ }).catch(() => {
1658
+ })) : ((F = g.value) == null ? void 0 : F.campaign.type) === "CREDIT" && (n.value = me(), await b(
1659
+ () => U.readAnalyticsOverview(e.params.id, I)
1660
+ ).then((f) => {
1661
+ f.type === "CREDIT" && (n.value = f);
1662
+ }).catch(() => {
1663
+ }));
1664
+ } catch {
1665
+ c.value = !0;
1666
+ }
1667
+ }), (O, w) => {
1668
+ var F, I, f, q, j, X, J, ue, de, pe;
1669
+ const G = S("FmPill"), H = S("FmPageHead"), V = S("FmIcon"), T = S("FmCard");
1670
+ return r(), d(L, null, [
1671
+ $(H, {
1672
+ title: "Campaign analytic",
1673
+ "back-button": !0,
1674
+ "onClick:back": w[0] || (w[0] = (Y) => o(a).back())
1675
+ }, {
1676
+ title: D(() => [
1677
+ s("div", na, [
1678
+ w[1] || (w[1] = s("span", { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2" }, " Campaign analytic ", -1)),
1679
+ $(G, { variant: "beta" })
1680
+ ])
1681
+ ]),
1682
+ _: 1
1683
+ }),
1684
+ s("div", oa, [
1685
+ o(c) ? (r(), x(T, {
1686
+ key: 0,
1687
+ variant: "outlined",
1688
+ class: "flex flex-col items-center justify-center text-center py-80 px-40 gap-8"
1689
+ }, {
1690
+ default: D(() => [
1691
+ $(V, {
1692
+ name: "error",
1693
+ outline: "",
1694
+ size: "lg",
1695
+ class: "text-fm-color-neutral-gray-300"
1696
+ }),
1697
+ w[2] || (w[2] = s("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, " Could not load this campaign ", -1)),
1698
+ w[3] || (w[3] = s("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, " The campaign may have been deleted, or the link is no longer valid. ", -1))
1699
+ ]),
1700
+ _: 1
1701
+ })) : o(y) ? (r(), d(L, { key: 1 }, [
1702
+ $(at, {
1703
+ "campaign-name": o(y).name,
1704
+ "dates-label": o(A),
1705
+ status: o(ae),
1706
+ "mechanic-label": (F = o(E)) == null ? void 0 : F.label,
1707
+ icon: (I = o(E)) == null ? void 0 : I.icon,
1708
+ objective: (f = o(E)) == null ? void 0 : f.objective,
1709
+ "report-range-label": (q = o(h)) == null ? void 0 : q.reportRangeLabel,
1710
+ "audience-label": (j = o(h)) == null ? void 0 : j.audienceLabel
1711
+ }, null, 8, ["campaign-name", "dates-label", "status", "mechanic-label", "icon", "objective", "report-range-label", "audience-label"]),
1712
+ o(C) ? (r(), x(T, {
1713
+ key: 0,
1714
+ variant: "outlined",
1715
+ class: "flex flex-col items-center justify-center text-center py-80 px-40 gap-8"
1716
+ }, {
1717
+ default: D(() => [
1718
+ $(V, {
1719
+ name: "wrong_location",
1720
+ outline: "",
1721
+ size: "lg",
1722
+ class: "text-fm-color-neutral-gray-300"
1723
+ }),
1724
+ w[4] || (w[4] = s("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, " This campaign does not belong here ", -1)),
1725
+ s("div", ia, " It is a " + u(o(y).type) + " campaign. Open it from its own campaign list to see the right report. ", 1)
1726
+ ]),
1727
+ _: 1
1728
+ })) : o(E) ? ((X = o(M)) == null ? void 0 : X.state) === "empty" ? (r(), x(T, {
1729
+ key: 2,
1730
+ variant: "outlined",
1731
+ class: "flex flex-col items-center justify-center text-center py-80 px-40 gap-8"
1732
+ }, {
1733
+ default: D(() => [
1734
+ $(V, {
1735
+ name: "inbox",
1736
+ outline: "",
1737
+ size: "lg",
1738
+ class: "text-fm-color-neutral-gray-300"
1739
+ }),
1740
+ w[6] || (w[6] = s("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, " Campaign activity has not started ", -1)),
1741
+ w[7] || (w[7] = s("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, " Performance data will appear after members enter the campaign. ", -1))
1742
+ ]),
1743
+ _: 1
1744
+ })) : o(h) ? (r(), d(L, { key: 3 }, [
1745
+ o(y).type === "COIN" || o(y).type === "POINT" || o(y).type === "CREDIT" ? (r(), d("section", ma, [
1746
+ s("div", null, [
1747
+ s("div", ua, u((J = o(E)) == null ? void 0 : J.label) + " distribution summary ", 1)
1748
+ ]),
1749
+ $(se, {
1750
+ cards: o(h).cards
1751
+ }, null, 8, ["cards"])
1752
+ ])) : v("", !0),
1753
+ o(y).type === "MISSION" ? (r(), d("section", da, [
1754
+ w[8] || (w[8] = s("div", null, [
1755
+ s("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, " Mission participation and completion "),
1756
+ s("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary mt-4" }, " Campaign-lifetime member activity and completion ")
1757
+ ], -1)),
1758
+ $(se, {
1759
+ cards: o(h).cards
1760
+ }, null, 8, ["cards"])
1761
+ ])) : v("", !0),
1762
+ o(h).applicationMix ? (r(), x(ht, {
1763
+ key: 2,
1764
+ mix: o(h).applicationMix
1765
+ }, null, 8, ["mix"])) : o(y).type !== "MISSION" && o(h).funnel.length ? (r(), x(Ut, {
1766
+ key: 3,
1767
+ stages: o(h).funnel,
1768
+ headline: o(h).funnelHeadline,
1769
+ summary: o(h).funnelSummary,
1770
+ "primary-label": o(h).funnelPrimaryLabel,
1771
+ "secondary-stages": (ue = o(h).funnelSecondary) == null ? void 0 : ue.stages,
1772
+ "secondary-label": (de = o(h).funnelSecondary) == null ? void 0 : de.label
1773
+ }, null, 8, ["stages", "headline", "summary", "primary-label", "secondary-stages", "secondary-label"])) : v("", !0),
1774
+ o(y).type !== "MISSION" && o(y).type !== "COIN" && o(y).type !== "POINT" && o(y).type !== "CREDIT" && o(h).cards.length ? (r(), x(se, {
1775
+ key: 4,
1776
+ cards: o(h).cards
1777
+ }, null, 8, ["cards"])) : v("", !0),
1778
+ o(h).trend.length ? (r(), x(Ht, {
1779
+ key: 5,
1780
+ modes: o(h).trend
1781
+ }, null, 8, ["modes"])) : v("", !0),
1782
+ (pe = o(h).breakdowns) != null && pe.length ? (r(!0), d(L, { key: 6 }, ee(o(h).breakdowns, (Y) => (r(), x(ve, {
1783
+ key: Y.title,
1784
+ breakdown: Y.breakdown,
1785
+ title: Y.title,
1786
+ "empty-message": Y.emptyMessage,
1787
+ note: Y.note
1788
+ }, null, 8, ["breakdown", "title", "empty-message", "note"]))), 128)) : (r(), x(ve, {
1789
+ key: 7,
1790
+ breakdown: o(h).breakdown
1791
+ }, null, 8, ["breakdown"])),
1792
+ o(h).outcomes.length ? (r(), x(fe, {
1793
+ key: 8,
1794
+ title: o(y).type === "MISSION" || o(y).type === "GAME" ? "Reward activity" : "Business outcome",
1795
+ caption: o(y).type === "MISSION" || o(y).type === "GAME" ? "Reward issuance attributed to this campaign" : "Financial and loyalty outcomes attributed to this campaign",
1796
+ items: o(h).outcomes,
1797
+ variant: "tile"
1798
+ }, null, 8, ["title", "caption", "items"])) : v("", !0),
1799
+ $(fe, {
1800
+ title: "Metric definitions",
1801
+ caption: "Hover a metric for its denominator and attribution method",
1802
+ items: o(h).metrics,
1803
+ variant: "row"
1804
+ }, null, 8, ["items"])
1805
+ ], 64)) : v("", !0) : (r(), x(T, {
1806
+ key: 1,
1807
+ variant: "outlined",
1808
+ class: "flex flex-col items-center justify-center text-center py-80 px-40 gap-8"
1809
+ }, {
1810
+ default: D(() => [
1811
+ $(V, {
1812
+ name: "query_stats",
1813
+ outline: "",
1814
+ size: "lg",
1815
+ class: "text-fm-color-neutral-gray-300"
1816
+ }),
1817
+ w[5] || (w[5] = s("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, " Analytic is not available for this campaign type ", -1)),
1818
+ s("div", ca, " Reporting has not been defined for " + u(o(y).type) + " campaigns yet. ", 1)
1819
+ ]),
1820
+ _: 1
1821
+ }))
1822
+ ], 64)) : v("", !0)
1823
+ ])
1824
+ ], 64);
1825
+ };
1826
+ }
1827
+ });
1828
+ export {
1829
+ _a as default
1830
+ };