@feedmepos/mf-connect 0.1.98-beta.3 → 0.1.98-beta.31

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 (123) hide show
  1. package/dist/{App-DEtGn29M.js → App-BhjPzSiY.js} +808 -665
  2. package/dist/{AuditLogs-Mrm0iq9P.js → AuditLogs-Ch6LolQM.js} +9 -9
  3. package/dist/{Bin-D9Pu0L6h.js → Bin-DN-id6dz.js} +8 -8
  4. package/dist/{Broadcast-BZDQtN8x.js → Broadcast-DW2DVP1Y.js} +39 -36
  5. package/dist/CampaignAnalytic-DT-nSIGr.js +1666 -0
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Bxlbz-JW.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-R-VzWmm8.js} +6 -5
  7. package/dist/{Card-BdMSuxr4.js → Card-BS6sPsHL.js} +18 -18
  8. package/dist/{Collections-D2IOFKrJ.js → Collections-BpdLOygl.js} +14 -13
  9. package/dist/Credit-iyO7xUul.js +286 -0
  10. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-jmfMQG79.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-q8PuaqGc.js} +34 -30
  11. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BYQDCpXN.js → EffectSheet.vue_vue_type_style_index_0_lang-C4RJCmCF.js} +6 -6
  12. package/dist/{Experience-Dm5TDsKH.js → Experience-Cc_lsAuN.js} +112 -86
  13. package/dist/{FileSaver.min-G6JMp965.js → FileSaver.min-DlK0mbcs.js} +1 -1
  14. package/dist/Game-N5oRxhfD.js +356 -0
  15. package/dist/{Grab-BXfBhrCM.js → Grab-C4JOX7S9.js} +32 -31
  16. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-C7EIMTui.js → ImageInput.vue_vue_type_script_setup_true_lang-ttCaGoaA.js} +1 -1
  17. package/dist/{Index-DfPPobH8.js → Index-BTPfwIiL.js} +10 -10
  18. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-Cpx1HMpd.js → LocationPicker.vue_vue_type_script_setup_true_lang-CsOOd9Vz.js} +1 -1
  19. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-Csse-q2U.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CECNBs_-.js} +1 -1
  20. package/dist/LoyaltyDashboard-qZRDd1VL.js +1345 -0
  21. package/dist/{MainLayout-DxAYEJg1.js → MainLayout-yONDAqXN.js} +1 -1
  22. package/dist/{Marketing-CPQQG8Y9.js → Marketing-CtxinaIp.js} +4 -4
  23. package/dist/{MarketingMaterialEdit-ssilnzNw.js → MarketingMaterialEdit-BbYHbOjZ.js} +6 -6
  24. package/dist/{Member-DmoUk3Dx.js → Member-BswZb-b-.js} +11 -11
  25. package/dist/{MemberList-Cm2BWPrW.js → MemberList-DclEAn1h.js} +36 -35
  26. package/dist/{MemberTransactions-Cxr87RMl.js → MemberTransactions-B4sc1Ahe.js} +1 -1
  27. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DpUg4Uwi.js → MessageInput.vue_vue_type_script_setup_true_lang-en_MLf2q.js} +5434 -5279
  28. package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-Bg_0YlwG.js +38 -0
  29. package/dist/Mission-B2_SB07l.js +360 -0
  30. package/dist/Overview-BETAx6sC.js +1104 -0
  31. package/dist/{Overview-CfigslHq.js → Overview-DJ8DB7p1.js} +18 -18
  32. package/dist/Point-I5sYY0AV.js +288 -0
  33. package/dist/Promotion-BZiOiGCt.js +423 -0
  34. package/dist/{Queue-B7kxDPZV.js → Queue-BirX_EC7.js} +12 -12
  35. package/dist/{Record-BGULqygn.js → Record-C0K6Ns45.js} +9 -9
  36. package/dist/Review-BoISkcF5.js +45 -0
  37. package/dist/ReviewFacebookCallback-DI_v42cz.js +238 -0
  38. package/dist/ReviewGoogleCallback-bWRrVgif.js +213 -0
  39. package/dist/{Reward-C0w5c1Th.js → Reward-Cq52vwUr.js} +16 -16
  40. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CspVlyRZ.js → RewardGroup.vue_vue_type_script_setup_true_lang-BW_TCNUF.js} +11 -11
  41. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-QYsK7vE4.js → RuleGroup.vue_vue_type_script_setup_true_lang-BB42pC95.js} +16 -15
  42. package/dist/{Segment-I_p06AoA.js → Segment-BmOC4d7i.js} +39 -37
  43. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-DV79EJm9.js → SelectItems.vue_vue_type_script_setup_true_lang-QClugajp.js} +2 -2
  44. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-CUwwzTTV.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-CaQdSfIF.js} +12 -12
  45. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-D2Nv32U5.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-W7APn7Cu.js} +4 -4
  46. package/dist/{Setting-DOMSAMUz.js → Setting-Dgt0LCbv.js} +40 -40
  47. package/dist/{SettingAdvertisements-IeGC6PHz.js → SettingAdvertisements-DAUdwr1p.js} +12 -12
  48. package/dist/Settings-gGFgpQbO.js +179 -0
  49. package/dist/{Store-DLzj0qGi.js → Store-IaZXjlU_.js} +21 -21
  50. package/dist/{StoreRewards-BPhAkGNl.js → StoreRewards-DnNuYefP.js} +15 -15
  51. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-DpcaOgdN.js → StoreTransactions.vue_vue_type_script_setup_true_lang-DTLHTyc_.js} +190 -187
  52. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DUdAxdEO.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-euqTCLNl.js} +2 -2
  53. package/dist/{Tier-7MveQA4f.js → Tier-DUZjJBxp.js} +36 -34
  54. package/dist/{Title-kyAzLGqm.js → Title-CoElyNyo.js} +39 -37
  55. package/dist/{Transaction-Chl3d3Ai.js → Transaction-eywJjImp.js} +2 -2
  56. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CZsaFtae.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DJ5_Kqpv.js} +6 -6
  57. package/dist/{Voucher-CxIPPul5.js → Voucher-CAiuvTfM.js} +156 -133
  58. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-BntA1IAx.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BDnbUGdG.js} +12 -12
  59. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-CiOmadge.js → ZodTextField.vue_vue_type_script_setup_true_lang-D5rXidZV.js} +2 -2
  60. package/dist/{app-5YllsPJi.js → app-DhDmESYL.js} +3356 -2864
  61. package/dist/app.js +1 -1
  62. package/dist/{business-C0zArPJj.js → business-GzfuJslR.js} +1 -1
  63. package/dist/campaign-D5fwJP6R.js +100 -0
  64. package/dist/{campaign-BHl5a5Z1.js → campaign-DFT642vU.js} +74 -96
  65. package/dist/{campaign.enum-CHWTkc9k.js → campaign.enum-Dx-Zo68Q.js} +1 -1
  66. package/dist/{campaign.fn-BtwnAETQ.js → campaign.fn-DkdIAZ7i.js} +115 -115
  67. package/dist/{collectible.enum-BvoISTK3.js → collectible.enum-Liy2wH3s.js} +1 -1
  68. package/dist/collection.fn-OGlCjGmW.js +26 -0
  69. package/dist/{duplicateCampaign-C27ikU2f.js → duplicateCampaign-iTVcbRn-.js} +2 -2
  70. package/dist/{effect-CARgKjhU.js → effect-CGAWPcrm.js} +1 -1
  71. package/dist/{email-addresses-CnTsfZHe.js → email-addresses-BE2S4Dj8.js} +2 -2
  72. package/dist/{export-CO8-3Ob9.js → export-D_fy-zua.js} +3 -3
  73. package/dist/google-C3S8u0mT.js +4 -0
  74. package/dist/{helper-C617AZcV.js → helper-C3C4SOin.js} +1 -1
  75. package/dist/{index-B0BE7PIS.js → index-BAApyOCS.js} +1 -1
  76. package/dist/{index-gPrU9b68.js → index-Be5nXR7v.js} +8027 -10766
  77. package/dist/{index-hKv7PcTR.js → index-Bh9_cs1A.js} +1 -1
  78. package/dist/{index-wL9aIsub.js → index-Bt33uSj8.js} +587 -578
  79. package/dist/{index-CtXx42Yb.js → index-C0miKj5V.js} +1 -1
  80. package/dist/index-C8cXXcLk.js +45 -0
  81. package/dist/{index-9AxeGyVh.js → index-CKAtCHMa.js} +272 -369
  82. package/dist/{index-DMvP3cOz.js → index-CWIwKELy.js} +184 -210
  83. package/dist/{index-DNf6qgpV.js → index-CXmuQ0jf.js} +2 -2
  84. package/dist/index-C_H8jFYf.js +2743 -0
  85. package/dist/{index-CFO8nwbC.js → index-CdH2ReVb.js} +8 -7
  86. package/dist/{index-Da8trM3D.js → index-CdZ_RusD.js} +1 -1
  87. package/dist/{index-CEJgFylS.js → index-CgRL0HwK.js} +26 -17
  88. package/dist/index-CsGEC4Aw.js +146 -0
  89. package/dist/{index-CMfyVF2h.js → index-D-btpqVA.js} +105 -123
  90. package/dist/{index-B2ZvboNZ.js → index-DTZ7EAcZ.js} +1 -1
  91. package/dist/{index-DIcwj1r2.js → index-QHOmMZSD.js} +1 -1
  92. package/dist/{index.esm2017-BFgbXDc8.js → index.esm2017-G5LoANQX.js} +105 -105
  93. package/dist/{loading-BxpiUNaf.js → loading-BPNkTxXT.js} +1 -1
  94. package/dist/{lodash-rPOvq9te.js → lodash-9ta4Nkqt.js} +1 -1
  95. package/dist/{membership-lfX5TNVQ.js → membership-BYkSHLOw.js} +3 -3
  96. package/dist/{money-CuUoYzPn.js → money-3C0zWUC8.js} +1 -1
  97. package/dist/{number-DMk8hvKt.js → number-d4dGkDp-.js} +1 -1
  98. package/dist/objectid-DnLDUQct.js +145 -0
  99. package/dist/{plugins-CyYjHO_X.js → plugins-DpkzBj4v.js} +3 -3
  100. package/dist/{reward-BxwaSc-X.js → reward-X01fpNlm.js} +1 -1
  101. package/dist/{rule-76SluGaP.js → rule-TAnVjqJf.js} +3 -3
  102. package/dist/rule-builder-BcmfLik_.js +126 -0
  103. package/dist/{template-ByceGw-A.js → template-Dw2oNW4d.js} +6 -6
  104. package/dist/timezone-Df1SYjKC.js +20 -0
  105. package/dist/{trigger-CxM5x3Sj.js → trigger-BPnDSdB4.js} +5 -5
  106. package/dist/{useMarketingMaterialActions-CHXVZ61f.js → useMarketingMaterialActions-CeoTwfgs.js} +3 -3
  107. package/dist/{usePagination-BKfoMHBB.js → usePagination-nnXuyQTt.js} +1 -1
  108. package/dist/{user-Cqjv0IpD.js → user-C0_0nUJU.js} +1 -1
  109. package/dist/{vue-i18n-Q-nKu_E3.js → vue-i18n-LQy4nXEW.js} +246 -246
  110. package/dist/{xlsx-D1LobU8O.js → xlsx-DZTNL-Ht.js} +1 -1
  111. package/dist/{zod-B5vUvKbD.js → zod-D-SNQ7Pu.js} +1 -1
  112. package/package.json +3 -3
  113. package/dist/Credit-BWyLeJpj.js +0 -260
  114. package/dist/Game-BB81nS7Y.js +0 -330
  115. package/dist/LoyaltyDashboard-BWC3rDDk.js +0 -1082
  116. package/dist/Mission-ChWPNxbI.js +0 -334
  117. package/dist/Point-Ko81Ny1q.js +0 -262
  118. package/dist/Promotion-CfyscRNN.js +0 -397
  119. package/dist/Review-C7Nx6a5t.js +0 -959
  120. package/dist/ReviewFacebookCallback-DKmL0TYZ.js +0 -243
  121. package/dist/ReviewGoogleCallback-C6iFFEfS.js +0 -208
  122. package/dist/campaign-C_49MeEc.js +0 -219
  123. package/dist/objectid-VPzb0Etb.js +0 -145
@@ -0,0 +1,1666 @@
1
+ import { defineComponent as j, computed as P, resolveComponent as _, openBlock as n, createBlock as h, withCtx as $, createElementBlock as v, createCommentVNode as g, createElementVNode as a, toDisplayString as u, normalizeClass as W, unref as l, Fragment as E, normalizeStyle as me, renderList as ee, createVNode as I, ref as H, onMounted as ge } from "vue";
2
+ import { u as ye } from "./vue-i18n-LQy4nXEW.js";
3
+ import { useCoreStore as he } from "@feedmepos/mf-common";
4
+ import { c as V } from "./index-CsGEC4Aw.js";
5
+ import { u as xe } from "./loading-BPNkTxXT.js";
6
+ import { s as ke, a as we } from "./campaign-DFT642vU.js";
7
+ import { C as ue } from "./timezone-Df1SYjKC.js";
8
+ import { h as Re } from "./moment-D7p2TMB-.js";
9
+ import { _ as Z } from "./MetricInfoTooltip.vue_vue_type_script_setup_true_lang-Bg_0YlwG.js";
10
+ import { useRoute as Me, useRouter as _e } from "vue-router";
11
+ const Se = {
12
+ state: "populated",
13
+ reportRangeLabel: "Unavailable",
14
+ funnel: [],
15
+ cards: [],
16
+ trend: [],
17
+ breakdown: null,
18
+ outcomes: [],
19
+ metrics: []
20
+ }, Ie = {
21
+ state: "populated",
22
+ reportRangeLabel: "Unavailable",
23
+ funnel: [],
24
+ cards: [],
25
+ trend: [],
26
+ breakdown: {
27
+ dimension: "Outlet",
28
+ columns: [
29
+ "Applied members",
30
+ "Member bills",
31
+ "Non-member bills",
32
+ "Attributed bills",
33
+ "Exact sales",
34
+ "Promotion value used"
35
+ ],
36
+ rows: []
37
+ },
38
+ outcomes: [],
39
+ metrics: []
40
+ }, Ce = {
41
+ state: "populated",
42
+ reportRangeLabel: "Unavailable",
43
+ funnel: [],
44
+ cards: [],
45
+ trend: [],
46
+ breakdown: null,
47
+ breakdowns: [],
48
+ outcomes: [],
49
+ metrics: []
50
+ }, Oe = {
51
+ state: "populated",
52
+ reportRangeLabel: "Unavailable",
53
+ funnel: [],
54
+ cards: [],
55
+ trend: [],
56
+ breakdown: null,
57
+ breakdowns: [],
58
+ outcomes: [],
59
+ metrics: []
60
+ }, Pe = {
61
+ state: "populated",
62
+ reportRangeLabel: "Unavailable",
63
+ funnel: [],
64
+ cards: [],
65
+ trend: [],
66
+ breakdown: null,
67
+ breakdowns: [],
68
+ outcomes: [],
69
+ metrics: []
70
+ }, $e = {
71
+ state: "populated",
72
+ reportRangeLabel: "Unavailable",
73
+ funnel: [],
74
+ cards: [],
75
+ trend: [],
76
+ breakdown: null,
77
+ breakdowns: [],
78
+ outcomes: [],
79
+ metrics: []
80
+ }, De = {
81
+ state: "populated",
82
+ reportRangeLabel: "Unavailable",
83
+ funnel: [],
84
+ cards: [],
85
+ trend: [],
86
+ breakdown: null,
87
+ breakdowns: [],
88
+ outcomes: [],
89
+ metrics: []
90
+ }, Ee = {
91
+ VOUCHER: {
92
+ label: "Voucher",
93
+ icon: "confirmation_number",
94
+ objective: "Reactivation",
95
+ report: Se
96
+ },
97
+ PROMOTION: {
98
+ label: "Promotion",
99
+ icon: "percent",
100
+ objective: "Purchase conversion",
101
+ report: Ie
102
+ },
103
+ MISSION: {
104
+ label: "Mission",
105
+ icon: "flag",
106
+ objective: "Member engagement",
107
+ report: Ce
108
+ },
109
+ GAME: {
110
+ label: "Game",
111
+ icon: "sports_esports",
112
+ objective: "Member engagement",
113
+ report: Oe
114
+ },
115
+ COIN: {
116
+ label: "Point",
117
+ icon: "stars",
118
+ objective: "Member engagement",
119
+ report: Pe
120
+ },
121
+ POINT: {
122
+ label: "Experience",
123
+ icon: "trending_up",
124
+ objective: "Member engagement",
125
+ report: $e
126
+ },
127
+ CREDIT: {
128
+ label: "Credit",
129
+ icon: "account_balance_wallet",
130
+ objective: "Member engagement",
131
+ report: De
132
+ }
133
+ };
134
+ function Le(t) {
135
+ return Ee[t];
136
+ }
137
+ function C(t, r) {
138
+ return `${(t ?? 0).toLocaleString()} ${r}`;
139
+ }
140
+ function m(t) {
141
+ return (t ?? 0).toLocaleString();
142
+ }
143
+ function w(t) {
144
+ return t == null ? "—" : `RM ${t.toLocaleString("en-MY", {
145
+ minimumFractionDigits: 2,
146
+ maximumFractionDigits: 2
147
+ })}`;
148
+ }
149
+ function D(t, r) {
150
+ const e = r ?? 0;
151
+ return e ? Math.round((t ?? 0) / e * 1e3) / 10 : 0;
152
+ }
153
+ function N(t) {
154
+ const r = Re(t);
155
+ return r.isValid() ? r.format("D MMM YYYY") : t;
156
+ }
157
+ function Te(t, r, e) {
158
+ const { metrics: s, scope: c } = r, y = D(
159
+ s.redeemedMembers,
160
+ s.distributedMembers
161
+ ), i = D(
162
+ s.redeemedVouchers,
163
+ s.distributedVouchers
164
+ ), f = s.completedBills === 0 ? 0 : s.rewardValueUsed / s.completedBills, o = s.completedBills === 0 ? 0 : s.exactSales / s.completedBills, R = D(
165
+ s.expiredUnusedVouchers,
166
+ s.distributedVouchers
167
+ );
168
+ return {
169
+ ...t,
170
+ reportRangeLabel: c.startDate && c.endDate ? `${N(c.startDate)} – ${N(c.endDate)}` : "Unavailable",
171
+ audienceLabel: void 0,
172
+ funnel: [
173
+ {
174
+ key: "distributed",
175
+ label: "Distributed",
176
+ membersLabel: C(s.distributedMembers, "members"),
177
+ unitsLabel: C(s.distributedVouchers, "vouchers"),
178
+ valueLabel: w(s.distributedFixedValue),
179
+ helper: "Unique members who received at least one voucher"
180
+ },
181
+ {
182
+ key: "redeemed",
183
+ label: "Redeemed",
184
+ membersLabel: C(s.redeemedMembers, "members"),
185
+ unitsLabel: C(s.voucherUses, "voucher uses"),
186
+ ratePct: y,
187
+ rateLabel: `${y}% of distributed members`,
188
+ helper: "Distinct identified members who used the voucher"
189
+ },
190
+ {
191
+ key: "completedBills",
192
+ label: "Completed bills",
193
+ primaryLabel: C(s.completedBills, "completed bills"),
194
+ extra: "Includes direct guest voucher use",
195
+ helper: "Distinct completed bills where this voucher was used"
196
+ }
197
+ ],
198
+ cards: [
199
+ {
200
+ key: "distributedMembers",
201
+ label: "Distributed Members",
202
+ value: (s.distributedMembers ?? 0).toLocaleString(),
203
+ sub: C(s.distributedVouchers, "vouchers")
204
+ },
205
+ {
206
+ key: "redemptionRate",
207
+ label: "Redemption Rate",
208
+ value: `${y}%`,
209
+ sub: "of distributed members"
210
+ },
211
+ {
212
+ key: "exactSales",
213
+ label: "Exact Sales",
214
+ value: w(s.exactSales),
215
+ sub: C(s.completedBills, "completed bills")
216
+ },
217
+ {
218
+ key: "rewardValueUsed",
219
+ label: "Reward Value Used",
220
+ value: w(s.rewardValueUsed),
221
+ sub: "voucher discount used"
222
+ },
223
+ {
224
+ key: "unusedVoucherValue",
225
+ label: "Unused Voucher Value",
226
+ value: w(s.unusedVoucherValue),
227
+ sub: "issued, not yet redeemed"
228
+ }
229
+ ],
230
+ trend: qe(e),
231
+ breakdown: {
232
+ dimension: "Outlet",
233
+ columns: [
234
+ "Redeemed members",
235
+ "Voucher uses",
236
+ "Completed bills",
237
+ "Exact sales",
238
+ "Reward value used"
239
+ ],
240
+ rows: r.performanceDetails.map((p) => ({
241
+ name: p.restaurantName,
242
+ cells: [
243
+ p.redeemedMembers.toLocaleString(),
244
+ p.voucherUses.toLocaleString(),
245
+ p.completedBills.toLocaleString(),
246
+ w(p.exactSales),
247
+ w(p.rewardValueUsed)
248
+ ]
249
+ }))
250
+ },
251
+ outcomes: [
252
+ {
253
+ key: "exactSales",
254
+ label: "Exact Sales",
255
+ value: w(s.exactSales)
256
+ },
257
+ {
258
+ key: "attributedBills",
259
+ label: "Attributed Bills",
260
+ value: s.completedBills.toLocaleString()
261
+ },
262
+ {
263
+ key: "rewardValueUsed",
264
+ label: "Reward Value Used",
265
+ value: w(s.rewardValueUsed)
266
+ },
267
+ {
268
+ key: "averageBillValue",
269
+ label: "Average Bill Value",
270
+ value: w(o)
271
+ }
272
+ ],
273
+ metrics: [
274
+ {
275
+ key: "memberRedemptionRate",
276
+ label: "Member Redemption Rate",
277
+ value: `${y}%`,
278
+ helper: "Redeemed members ÷ distributed members"
279
+ },
280
+ {
281
+ key: "voucherUtilizationRate",
282
+ label: "Voucher Utilization Rate",
283
+ value: `${i}%`,
284
+ helper: "Redeemed vouchers ÷ distributed vouchers"
285
+ },
286
+ {
287
+ key: "averageDiscountPerBill",
288
+ label: "Average Discount per Bill",
289
+ value: w(f),
290
+ helper: "Reward value used ÷ completed bills"
291
+ },
292
+ {
293
+ key: "averageBillValue",
294
+ label: "Average Bill Value",
295
+ value: w(o),
296
+ helper: "Exact sales ÷ completed bills"
297
+ },
298
+ {
299
+ key: "breakageRate",
300
+ label: "Breakage Rate to date",
301
+ value: `${R}%`,
302
+ helper: "Expired unused vouchers ÷ distributed vouchers"
303
+ }
304
+ ]
305
+ };
306
+ }
307
+ function Be(t, r) {
308
+ const { metrics: e, scope: s } = r, c = D(
309
+ e.memberBills,
310
+ e.attributedBills
311
+ ), y = D(
312
+ e.nonMemberBills,
313
+ e.attributedBills
314
+ ), i = D(
315
+ e.memberSales,
316
+ e.exactSales
317
+ ), f = e.attributedBills ? e.promotionValueUsed / e.attributedBills : 0, o = e.attributedBills ? e.exactSales / e.attributedBills : 0;
318
+ return {
319
+ ...t,
320
+ reportRangeLabel: s.startDate && s.endDate ? `${N(s.startDate)} – ${N(s.endDate)}` : "Unavailable",
321
+ audienceLabel: void 0,
322
+ funnel: [],
323
+ cards: [],
324
+ trend: [],
325
+ applicationMix: {
326
+ memberBills: m(e.memberBills),
327
+ appliedMembers: m(e.appliedMembers),
328
+ nonMemberBills: m(e.nonMemberBills),
329
+ memberSales: w(e.memberSales),
330
+ nonMemberSales: w(e.nonMemberSales),
331
+ memberBillSharePct: c,
332
+ nonMemberBillSharePct: y,
333
+ memberSalesSharePct: i,
334
+ summary: `Members account for ${c}% of attributed bills and ${i}% of attributed sales.`
335
+ },
336
+ breakdown: {
337
+ dimension: "Outlet",
338
+ columns: [
339
+ "Applied members",
340
+ "Member bills",
341
+ "Non-member bills",
342
+ "Attributed bills",
343
+ "Exact sales",
344
+ "Promotion value used"
345
+ ],
346
+ rows: r.performanceDetails.map((R) => ({
347
+ name: R.restaurantName,
348
+ cells: [
349
+ m(R.appliedMembers),
350
+ m(R.memberBills),
351
+ m(R.nonMemberBills),
352
+ m(R.attributedBills),
353
+ w(R.exactSales),
354
+ w(R.promotionValueUsed)
355
+ ]
356
+ }))
357
+ },
358
+ outcomes: [
359
+ {
360
+ key: "exactSales",
361
+ label: "Exact Sales",
362
+ value: w(e.exactSales)
363
+ },
364
+ {
365
+ key: "attributedBills",
366
+ label: "Attributed Bills",
367
+ value: m(e.attributedBills)
368
+ },
369
+ {
370
+ key: "promotionValueUsed",
371
+ label: "Promotion Value Used",
372
+ value: w(e.promotionValueUsed)
373
+ },
374
+ {
375
+ key: "averageBillValue",
376
+ label: "Average Bill Value",
377
+ value: w(o)
378
+ }
379
+ ],
380
+ metrics: [
381
+ {
382
+ key: "memberApplicationShare",
383
+ label: "Member Application Share",
384
+ value: `${c}%`,
385
+ helper: "Member bills ÷ attributed bills"
386
+ },
387
+ {
388
+ key: "nonMemberApplicationShare",
389
+ label: "Non-member Application Share",
390
+ value: `${y}%`,
391
+ helper: "Non-member bills ÷ attributed bills"
392
+ },
393
+ {
394
+ key: "memberSalesShare",
395
+ label: "Member Sales Share",
396
+ value: `${i}%`,
397
+ helper: "Member sales ÷ exact sales"
398
+ },
399
+ {
400
+ key: "averageDiscountPerBill",
401
+ label: "Average Discount per Bill",
402
+ value: w(f),
403
+ helper: "Promotion value used ÷ attributed bills"
404
+ },
405
+ {
406
+ key: "averageBillValue",
407
+ label: "Average Bill Value",
408
+ value: w(o),
409
+ helper: "Exact sales ÷ attributed bills"
410
+ }
411
+ ]
412
+ };
413
+ }
414
+ function Ne(t, r) {
415
+ const { metrics: e, scope: s } = r, c = e.participants ? e.stampsEarned / e.participants : 0, y = Math.max(
416
+ e.completionEvents - e.completedMembers,
417
+ 0
418
+ );
419
+ return {
420
+ ...t,
421
+ reportRangeLabel: s.startDate && s.endDate ? `${N(s.startDate)} – ${N(s.endDate)}` : "Unavailable",
422
+ funnel: [],
423
+ cards: [
424
+ {
425
+ key: "participants",
426
+ label: "Participants",
427
+ value: m(e.participants),
428
+ sub: "members receiving stamps",
429
+ helper: "Distinct members receiving at least one campaign Stamp"
430
+ },
431
+ {
432
+ key: "stampsEarned",
433
+ label: "Stamps Earned",
434
+ value: m(e.stampsEarned),
435
+ sub: "stamps"
436
+ },
437
+ {
438
+ key: "stampTransactions",
439
+ label: "Stamp Transactions",
440
+ value: m(e.stampTransactions),
441
+ sub: "transactions"
442
+ },
443
+ {
444
+ key: "completedMembers",
445
+ label: "Completed Members",
446
+ value: m(e.completedMembers),
447
+ sub: "completed at least once",
448
+ helper: "Distinct participants completing the Mission at least once"
449
+ },
450
+ {
451
+ key: "completionEvents",
452
+ label: "Completion Events",
453
+ value: m(e.completionEvents),
454
+ sub: "includes repeat completions",
455
+ helper: "All Mission target crossings, including repeat completions"
456
+ }
457
+ ],
458
+ trend: [],
459
+ breakdown: null,
460
+ breakdowns: [
461
+ {
462
+ title: "Reward performance",
463
+ emptyMessage: "No reward activity was recorded for this campaign.",
464
+ breakdown: {
465
+ dimension: "Reward",
466
+ columns: [
467
+ "Reward type",
468
+ "Recipients",
469
+ "Issue transactions",
470
+ "Quantity issued"
471
+ ],
472
+ rows: r.rewards.map((i) => ({
473
+ name: i.rewardName,
474
+ cells: [
475
+ i.rewardType,
476
+ m(i.recipients),
477
+ m(i.issuanceTransactions),
478
+ m(i.quantityIssued)
479
+ ]
480
+ }))
481
+ }
482
+ },
483
+ {
484
+ title: "Performance by outlet",
485
+ emptyMessage: "No outlet activity was recorded for this campaign.",
486
+ breakdown: {
487
+ dimension: "Outlet",
488
+ columns: ["Participants", "Stamps earned", "Completion events"],
489
+ rows: r.performanceDetails.map((i) => ({
490
+ name: i.restaurantName || "Unattributed / online",
491
+ cells: [
492
+ m(i.participants),
493
+ m(i.stampsEarned),
494
+ m(i.completionEvents)
495
+ ]
496
+ }))
497
+ }
498
+ }
499
+ ],
500
+ outcomes: [
501
+ {
502
+ key: "rewardRecipients",
503
+ label: "Reward Recipients",
504
+ value: m(e.rewardRecipients)
505
+ },
506
+ {
507
+ key: "rewardIssueTransactions",
508
+ label: "Reward Issue Transactions",
509
+ value: m(e.rewardIssueTransactions)
510
+ }
511
+ ],
512
+ metrics: [
513
+ {
514
+ key: "completionReach",
515
+ label: "Completion Reach",
516
+ value: `${D(e.completedMembers, e.participants)}%`,
517
+ helper: "Completed members ÷ participants"
518
+ },
519
+ {
520
+ key: "rewardReach",
521
+ label: "Reward Reach",
522
+ value: `${D(e.rewardRecipients, e.participants)}%`,
523
+ helper: "Reward recipients ÷ participants"
524
+ },
525
+ {
526
+ key: "averageStampsPerParticipant",
527
+ label: "Average Stamps per Participant",
528
+ value: c.toLocaleString("en-MY", {
529
+ maximumFractionDigits: 2
530
+ }),
531
+ helper: "Stamps earned ÷ participants"
532
+ },
533
+ {
534
+ key: "repeatCompletionEvents",
535
+ label: "Repeat Completion Events",
536
+ value: m(y),
537
+ helper: "Completion events beyond the first completion per member"
538
+ }
539
+ ]
540
+ };
541
+ }
542
+ function Ve(t, r) {
543
+ const { metrics: e, scope: s } = r, c = D(e.players, e.tokenRecipients), y = D(e.plays, e.tokensIssued), i = D(
544
+ e.rewardRecipients,
545
+ e.players
546
+ ), f = e.players ? e.plays / e.players : 0;
547
+ return {
548
+ ...t,
549
+ reportRangeLabel: s.startDate && s.endDate ? `${N(s.startDate)} – ${N(s.endDate)}` : "Unavailable",
550
+ audienceLabel: void 0,
551
+ funnel: [
552
+ {
553
+ key: "tokenRecipients",
554
+ label: "Token recipients",
555
+ membersLabel: C(e.tokenRecipients, "members"),
556
+ unitsLabel: C(e.tokensIssued, "tokens"),
557
+ extra: `${m(e.plays)} plays · ${y}% token utilization`,
558
+ helper: "Distinct members who received at least one game token"
559
+ },
560
+ {
561
+ key: "players",
562
+ label: "Players",
563
+ membersLabel: C(e.players, "members"),
564
+ unitsLabel: C(e.plays, "plays"),
565
+ ratePct: c,
566
+ rateLabel: `${c}% of token recipients`,
567
+ helper: "Distinct members who consumed at least one game token"
568
+ },
569
+ {
570
+ key: "rewardRecipients",
571
+ label: "Reward recipients",
572
+ membersLabel: C(e.rewardRecipients, "members"),
573
+ unitsLabel: C(
574
+ e.rewardIssueTransactions,
575
+ "reward issue transactions"
576
+ ),
577
+ ratePct: i,
578
+ rateLabel: `${i}% of players`,
579
+ helper: "Distinct players receiving at least one Reward Pool reward"
580
+ }
581
+ ],
582
+ cards: [
583
+ {
584
+ key: "tokenRecipients",
585
+ label: "Token Recipients",
586
+ value: m(e.tokenRecipients),
587
+ sub: "members"
588
+ },
589
+ {
590
+ key: "tokensIssued",
591
+ label: "Tokens Issued",
592
+ value: m(e.tokensIssued),
593
+ sub: "game tokens"
594
+ },
595
+ {
596
+ key: "players",
597
+ label: "Players",
598
+ value: m(e.players),
599
+ sub: "members"
600
+ },
601
+ {
602
+ key: "plays",
603
+ label: "Plays",
604
+ value: m(e.plays),
605
+ sub: "game plays"
606
+ }
607
+ ],
608
+ trend: [],
609
+ breakdown: null,
610
+ breakdowns: [
611
+ {
612
+ title: "Reward performance",
613
+ emptyMessage: "No reward activity was recorded for this campaign.",
614
+ breakdown: {
615
+ dimension: "Reward",
616
+ columns: [
617
+ "Reward type",
618
+ "Recipients",
619
+ "Issue transactions",
620
+ "Quantity issued"
621
+ ],
622
+ rows: r.rewards.map((o) => ({
623
+ name: o.rewardName || "Unnamed reward",
624
+ cells: [
625
+ o.rewardType,
626
+ m(o.recipients),
627
+ m(o.issuanceTransactions),
628
+ m(o.quantityIssued)
629
+ ]
630
+ }))
631
+ }
632
+ },
633
+ {
634
+ title: "Token distribution by outlet",
635
+ emptyMessage: "No token distribution activity was recorded for this campaign.",
636
+ breakdown: {
637
+ dimension: "Outlet",
638
+ columns: ["Recipients", "Tokens issued"],
639
+ rows: r.tokenDistributionDetails.map((o) => ({
640
+ name: o.restaurantName || "Unattributed / online",
641
+ cells: [
642
+ m(o.recipients),
643
+ m(o.tokensIssued)
644
+ ]
645
+ }))
646
+ }
647
+ }
648
+ ],
649
+ outcomes: [
650
+ {
651
+ key: "rewardRecipients",
652
+ label: "Reward Recipients",
653
+ value: m(e.rewardRecipients)
654
+ },
655
+ {
656
+ key: "rewardIssueTransactions",
657
+ label: "Reward Issue Transactions",
658
+ value: m(e.rewardIssueTransactions)
659
+ }
660
+ ],
661
+ metrics: [
662
+ {
663
+ key: "playerRate",
664
+ label: "Player Rate",
665
+ value: `${c}%`,
666
+ helper: "Players ÷ token recipients"
667
+ },
668
+ {
669
+ key: "tokenUtilizationRate",
670
+ label: "Token Utilization Rate",
671
+ value: `${y}%`,
672
+ helper: "Plays ÷ tokens issued"
673
+ },
674
+ {
675
+ key: "rewardRecipientRate",
676
+ label: "Reward Recipient Rate",
677
+ value: `${i}%`,
678
+ helper: "Reward recipients ÷ players"
679
+ },
680
+ {
681
+ key: "averagePlaysPerPlayer",
682
+ label: "Average Plays per Player",
683
+ value: f.toLocaleString("en-MY", {
684
+ maximumFractionDigits: 2
685
+ }),
686
+ helper: "Plays ÷ players"
687
+ }
688
+ ]
689
+ };
690
+ }
691
+ function X(t, r) {
692
+ return r ? w(t ?? 0) : m(t);
693
+ }
694
+ function J(t, r) {
695
+ return t[r] ?? 0;
696
+ }
697
+ function ae(t, r, e) {
698
+ const { metrics: s, scope: c } = r, y = s.recipients ? J(s, e.quantityKey) / s.recipients : 0, i = s.issuanceTransactions ? J(s, e.quantityKey) / s.issuanceTransactions : 0, f = [
699
+ "Recipients",
700
+ ...e.includeSourceRecipientShare ? ["Recipient share"] : [],
701
+ "Issuance transactions",
702
+ e.quantityLabel
703
+ ], o = r.sourceDetails.map((p) => ({
704
+ name: p.source || "Unknown",
705
+ cells: [
706
+ m(p.recipients),
707
+ ...e.includeSourceRecipientShare ? [`${D(p.recipients, s.recipients)}%`] : [],
708
+ m(p.issuanceTransactions),
709
+ X(
710
+ J(p, e.quantityKey),
711
+ e.currency
712
+ )
713
+ ]
714
+ })), R = [
715
+ {
716
+ key: "averagePerRecipient",
717
+ label: `Average ${e.quantityName} per Recipient`,
718
+ value: X(y, e.currency),
719
+ helper: `${e.quantityLabel} ÷ recipients`
720
+ },
721
+ {
722
+ key: "averagePerIssue",
723
+ label: `Average ${e.quantityName} per Issue`,
724
+ value: X(i, e.currency),
725
+ helper: `${e.quantityLabel} ÷ issuance transactions`
726
+ }
727
+ ];
728
+ return e.includeSourceRecipientShare && R.push({
729
+ key: "recipientShareBySource",
730
+ label: "Recipient Share by Source",
731
+ value: "See source breakdown",
732
+ helper: "Source recipients ÷ total recipients"
733
+ }), {
734
+ ...t,
735
+ reportRangeLabel: c.startDate && c.endDate ? `${N(c.startDate)} – ${N(c.endDate)}` : "Unavailable",
736
+ audienceLabel: void 0,
737
+ funnel: [],
738
+ cards: [
739
+ {
740
+ key: "recipients",
741
+ label: `${e.label} Recipients`,
742
+ value: m(s.recipients),
743
+ sub: "members",
744
+ helper: `Distinct members receiving ${e.quantityName.toLowerCase()}`
745
+ },
746
+ {
747
+ key: "issuanceTransactions",
748
+ label: "Issuance Transactions",
749
+ value: m(s.issuanceTransactions),
750
+ sub: "transactions"
751
+ },
752
+ {
753
+ key: e.quantityKey,
754
+ label: e.quantityLabel.replace(/^./, (p) => p.toUpperCase()),
755
+ value: X(
756
+ J(s, e.quantityKey),
757
+ e.currency
758
+ ),
759
+ sub: e.quantityUnit
760
+ }
761
+ ],
762
+ trend: [],
763
+ breakdown: null,
764
+ breakdowns: [
765
+ {
766
+ title: "Distribution by source",
767
+ emptyMessage: "No source activity was recorded for this campaign.",
768
+ breakdown: {
769
+ dimension: "Source",
770
+ columns: f,
771
+ rows: o
772
+ }
773
+ },
774
+ {
775
+ title: "Performance by outlet",
776
+ emptyMessage: "No outlet activity was recorded for this campaign.",
777
+ breakdown: {
778
+ dimension: "Outlet",
779
+ columns: [
780
+ "Recipients",
781
+ "Issuance transactions",
782
+ e.quantityLabel
783
+ ],
784
+ rows: r.performanceDetails.map((p) => ({
785
+ name: p.restaurantName || "Unattributed / online",
786
+ cells: [
787
+ m(p.recipients),
788
+ m(p.issuanceTransactions),
789
+ X(
790
+ J(p, e.quantityKey),
791
+ e.currency
792
+ )
793
+ ]
794
+ }))
795
+ }
796
+ }
797
+ ],
798
+ outcomes: [],
799
+ metrics: R
800
+ };
801
+ }
802
+ function Ue(t, r) {
803
+ return ae(t, r, {
804
+ label: "Point",
805
+ quantityName: "Points",
806
+ quantityLabel: "Points issued",
807
+ quantityUnit: "points",
808
+ quantityKey: "pointsIssued",
809
+ currency: !1,
810
+ includeSourceRecipientShare: !0
811
+ });
812
+ }
813
+ function Fe(t, r) {
814
+ return ae(t, r, {
815
+ label: "Experience",
816
+ quantityName: "Experience",
817
+ quantityLabel: "Experience issued",
818
+ quantityUnit: "experience",
819
+ quantityKey: "experienceIssued",
820
+ currency: !1,
821
+ includeSourceRecipientShare: !0
822
+ });
823
+ }
824
+ function Ae(t, r) {
825
+ return ae(t, r, {
826
+ label: "Credit",
827
+ quantityName: "Credit",
828
+ quantityLabel: "Credit issued",
829
+ quantityUnit: "credit",
830
+ quantityKey: "creditIssued",
831
+ currency: !0,
832
+ includeSourceRecipientShare: !1
833
+ });
834
+ }
835
+ function qe(t) {
836
+ if (!(t != null && t.categories.length)) return [];
837
+ const r = {
838
+ key: "members",
839
+ label: "Distributed members vs Redeemed members",
840
+ categories: t.categories,
841
+ series: [
842
+ { label: "Distributed members", values: t.distributedMembers },
843
+ { label: "Redeemed members", values: t.redeemedMembers }
844
+ ]
845
+ };
846
+ return t.distributedValue == null ? [r] : [
847
+ r,
848
+ {
849
+ key: "value",
850
+ label: "Distributed voucher value vs Reward value used",
851
+ categories: t.categories,
852
+ series: [
853
+ {
854
+ label: "Distributed voucher value",
855
+ values: t.distributedValue
856
+ },
857
+ { label: "Reward value used", values: t.rewardValueUsed }
858
+ ]
859
+ }
860
+ ];
861
+ }
862
+ function je(t) {
863
+ return [
864
+ {
865
+ header: t.dimension,
866
+ accessorFn: (r) => r.name
867
+ },
868
+ ...t.columns.map((r, e) => ({
869
+ header: r,
870
+ accessorFn: (s) => s.cells[e] ?? ""
871
+ }))
872
+ ];
873
+ }
874
+ const ze = {
875
+ key: 0,
876
+ class: "flex items-center gap-8 mb-8"
877
+ }, Ge = { class: "fm-typo-en-body-sm-600 text-fm-color-primary uppercase" }, He = { class: "flex items-center gap-12 mb-12 flex-wrap" }, Ke = { class: "fm-typo-en-title-lg-800 text-fm-color-typo-primary m-0" }, Ye = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary flex flex-wrap gap-x-16 gap-y-4" }, Qe = {
878
+ key: 1,
879
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary mt-4"
880
+ }, Xe = /* @__PURE__ */ j({
881
+ __name: "CampaignAnalyticHeader",
882
+ props: {
883
+ campaignName: {},
884
+ datesLabel: {},
885
+ status: {},
886
+ mechanicLabel: {},
887
+ icon: {},
888
+ objective: {},
889
+ reportRangeLabel: {},
890
+ audienceLabel: {},
891
+ demo: { type: Boolean }
892
+ },
893
+ setup(t) {
894
+ const r = t, { t: e } = ye(), s = P(() => r.status ? {
895
+ active: "text-fm-color-typo-success bg-fm-color-system-success-100",
896
+ upcoming: "text-fm-color-typo-info bg-fm-color-system-info-100",
897
+ expired: "text-fm-color-typo-error bg-fm-color-system-error-100"
898
+ }[r.status] : "");
899
+ return (c, y) => {
900
+ const i = _("FmIcon"), f = _("FmChip"), o = _("FmCard");
901
+ return n(), h(o, {
902
+ variant: "outlined",
903
+ class: "p-24"
904
+ }, {
905
+ default: $(() => [
906
+ t.mechanicLabel ? (n(), v("div", ze, [
907
+ t.icon ? (n(), h(i, {
908
+ key: 0,
909
+ name: t.icon,
910
+ outline: "",
911
+ size: "sm",
912
+ class: "!text-fm-color-primary"
913
+ }, null, 8, ["name"])) : g("", !0),
914
+ a("span", Ge, u(t.objective ? `${t.mechanicLabel} · ${t.objective}` : t.mechanicLabel), 1)
915
+ ])) : g("", !0),
916
+ a("div", He, [
917
+ a("h1", Ke, u(t.campaignName), 1),
918
+ t.status ? (n(), h(f, {
919
+ key: 0,
920
+ class: W(l(s)),
921
+ label: l(e)(`connect.campaign.common.status.${t.status}`),
922
+ compact: ""
923
+ }, null, 8, ["class", "label"])) : g("", !0),
924
+ t.demo ? (n(), h(f, {
925
+ key: 1,
926
+ class: "!text-fm-color-typo-warning !bg-fm-color-system-warning-100",
927
+ compact: "",
928
+ label: "Demo data"
929
+ })) : g("", !0)
930
+ ]),
931
+ a("div", Ye, [
932
+ a("span", null, u(t.datesLabel), 1),
933
+ t.reportRangeLabel ? (n(), v(E, { key: 0 }, [
934
+ y[0] || (y[0] = a("span", { class: "text-fm-color-typo-disabled" }, "·", -1)),
935
+ a("span", null, "Reporting: " + u(t.reportRangeLabel), 1)
936
+ ], 64)) : g("", !0)
937
+ ]),
938
+ t.audienceLabel ? (n(), v("div", Qe, " Audience: " + u(t.audienceLabel), 1)) : g("", !0)
939
+ ]),
940
+ _: 1
941
+ });
942
+ };
943
+ }
944
+ }), Je = { class: "grid grid-cols-2 xs:grid-cols-1 gap-16" }, We = { class: "min-w-0" }, Ze = { class: "fm-typo-en-title-sm-800 mt-8" }, et = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary mt-4" }, tt = { class: "min-w-0" }, at = { class: "fm-typo-en-title-sm-800 mt-8" }, st = { class: "grid grid-cols-2 xs:grid-cols-1 gap-16 mt-16" }, rt = { class: "min-w-0" }, lt = { class: "fm-typo-en-title-sm-800 mt-8" }, nt = { class: "min-w-0" }, it = { class: "fm-typo-en-title-sm-800 mt-8" }, ot = ["aria-label"], ct = { class: "flex h-12 overflow-hidden rounded-xxxl bg-fm-color-neutral-gray-100" }, mt = { class: "flex justify-between gap-16 mt-8 fm-typo-en-body-sm-400 text-fm-color-typo-tertiary" }, ut = { class: "mt-16 pt-12 border-t border-fm-color-neutral-gray-100 fm-typo-en-body-sm-400 text-fm-color-typo-tertiary" }, dt = /* @__PURE__ */ j({
945
+ __name: "PromotionApplicationMix",
946
+ props: {
947
+ mix: {}
948
+ },
949
+ setup(t) {
950
+ return (r, e) => {
951
+ const s = _("FmCard");
952
+ return n(), h(s, {
953
+ variant: "outlined",
954
+ class: "p-24"
955
+ }, {
956
+ default: $(() => [
957
+ e[4] || (e[4] = a("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, " Customer mix ", -1)),
958
+ e[5] || (e[5] = a("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary mt-4 mb-16" }, " Completed bills attributed to this promotion ", -1)),
959
+ a("div", Je, [
960
+ a("div", We, [
961
+ e[0] || (e[0] = a("div", { class: "flex items-center gap-8" }, [
962
+ a("div", { class: "w-8 h-8 rounded-sm bg-fm-color-primary" }),
963
+ a("span", { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary" }, " Member bills ")
964
+ ], -1)),
965
+ a("div", Ze, u(t.mix.memberBills), 1),
966
+ a("div", et, u(t.mix.appliedMembers) + " applied members ", 1)
967
+ ]),
968
+ a("div", tt, [
969
+ e[1] || (e[1] = a("div", { class: "flex items-center gap-8" }, [
970
+ a("div", { class: "w-8 h-8 rounded-sm bg-fm-color-neutral-gray-200" }),
971
+ a("span", { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary" }, " Non-member bills ")
972
+ ], -1)),
973
+ a("div", at, u(t.mix.nonMemberBills), 1)
974
+ ])
975
+ ]),
976
+ a("div", st, [
977
+ a("div", rt, [
978
+ e[2] || (e[2] = a("div", { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary" }, " Member sales ", -1)),
979
+ a("div", lt, u(t.mix.memberSales), 1)
980
+ ]),
981
+ a("div", nt, [
982
+ e[3] || (e[3] = a("div", { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary" }, " Non-member sales ", -1)),
983
+ a("div", it, u(t.mix.nonMemberSales), 1)
984
+ ])
985
+ ]),
986
+ a("div", {
987
+ class: "mt-24",
988
+ role: "img",
989
+ "aria-label": t.mix.summary
990
+ }, [
991
+ a("div", ct, [
992
+ a("div", {
993
+ class: "h-full bg-fm-color-primary",
994
+ style: me({ width: t.mix.memberBillSharePct + "%" })
995
+ }, null, 4),
996
+ a("div", {
997
+ class: "h-full bg-fm-color-neutral-gray-200",
998
+ style: me({ width: t.mix.nonMemberBillSharePct + "%" })
999
+ }, null, 4)
1000
+ ]),
1001
+ a("div", mt, [
1002
+ a("span", null, "Members " + u(t.mix.memberBillSharePct) + "%", 1),
1003
+ a("span", null, "Non-members " + u(t.mix.nonMemberBillSharePct) + "%", 1)
1004
+ ])
1005
+ ], 8, ot),
1006
+ a("div", ut, u(t.mix.summary), 1)
1007
+ ]),
1008
+ _: 1
1009
+ });
1010
+ };
1011
+ }
1012
+ }), pt = { class: "flex xs:flex-col items-stretch" }, yt = { class: "flex-1 min-w-0 px-16 xs:px-4 xs:py-12" }, bt = { class: "flex items-center gap-4" }, vt = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-tertiary" }, ft = {
1013
+ key: 0,
1014
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-disabled italic mt-8"
1015
+ }, gt = { class: "fm-typo-en-title-sm-800 text-fm-color-typo-primary mt-8" }, ht = {
1016
+ key: 0,
1017
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary"
1018
+ }, xt = {
1019
+ key: 1,
1020
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary"
1021
+ }, kt = {
1022
+ key: 2,
1023
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary"
1024
+ }, wt = {
1025
+ key: 3,
1026
+ class: "mt-8"
1027
+ }, Rt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary mt-4" }, Mt = {
1028
+ key: 0,
1029
+ class: "flex items-center justify-center px-4 xs:py-4"
1030
+ }, _t = /* @__PURE__ */ j({
1031
+ __name: "CampaignFunnel",
1032
+ props: {
1033
+ stages: {}
1034
+ },
1035
+ setup(t) {
1036
+ return (r, e) => {
1037
+ const s = _("FmProgressBar"), c = _("FmIcon"), y = _("FmCard");
1038
+ return n(), h(y, {
1039
+ variant: "outlined",
1040
+ class: "p-24"
1041
+ }, {
1042
+ default: $(() => [
1043
+ e[0] || (e[0] = a("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, " Campaign funnel ", -1)),
1044
+ e[1] || (e[1] = a("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary mt-4 mb-16" }, " Campaign activity at each stage ", -1)),
1045
+ a("div", pt, [
1046
+ (n(!0), v(E, null, ee(t.stages, (i, f) => (n(), v("div", {
1047
+ key: i.key,
1048
+ class: "flex xs:flex-col flex-1 min-w-0 items-stretch"
1049
+ }, [
1050
+ a("div", yt, [
1051
+ a("div", bt, [
1052
+ a("span", vt, u(i.label), 1),
1053
+ i.helper ? (n(), h(Z, {
1054
+ key: 0,
1055
+ description: i.helper
1056
+ }, null, 8, ["description"])) : g("", !0)
1057
+ ]),
1058
+ i.notSupported ? (n(), v("div", ft, u(i.helper), 1)) : (n(), v(E, { key: 1 }, [
1059
+ a("div", gt, u(i.primaryLabel ?? i.membersLabel ?? "—"), 1),
1060
+ i.unitsLabel ? (n(), v("div", ht, u(i.unitsLabel), 1)) : g("", !0),
1061
+ i.valueLabel ? (n(), v("div", xt, u(i.valueLabel), 1)) : g("", !0),
1062
+ i.extra ? (n(), v("div", kt, u(i.extra), 1)) : g("", !0),
1063
+ i.ratePct !== void 0 ? (n(), v("div", wt, [
1064
+ I(s, {
1065
+ value: i.ratePct,
1066
+ color: "primary",
1067
+ size: "sm"
1068
+ }, null, 8, ["value"]),
1069
+ a("div", Rt, u(i.rateLabel), 1)
1070
+ ])) : g("", !0)
1071
+ ], 64))
1072
+ ]),
1073
+ f < t.stages.length - 1 ? (n(), v("div", Mt, [
1074
+ I(c, {
1075
+ name: "chevron_right",
1076
+ size: "sm",
1077
+ class: "text-fm-color-neutral-gray-300 xs:rotate-90"
1078
+ })
1079
+ ])) : g("", !0)
1080
+ ]))), 128))
1081
+ ])
1082
+ ]),
1083
+ _: 1
1084
+ });
1085
+ };
1086
+ }
1087
+ }), St = { class: "grid grid-cols-[repeat(auto-fit,minmax(200px,1fr))] xs:grid-cols-1 gap-16" }, It = { class: "flex items-center gap-8" }, Ct = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary flex-1 min-w-0 truncate" }, Ot = {
1088
+ key: 0,
1089
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary"
1090
+ }, te = /* @__PURE__ */ j({
1091
+ __name: "CampaignMetricCards",
1092
+ props: {
1093
+ cards: {}
1094
+ },
1095
+ setup(t) {
1096
+ return (r, e) => {
1097
+ const s = _("FmCard");
1098
+ return n(), v("section", St, [
1099
+ (n(!0), v(E, null, ee(t.cards, (c) => (n(), h(s, {
1100
+ key: c.key,
1101
+ variant: "outlined",
1102
+ class: "flex flex-col gap-4 p-16 min-w-0 overflow-hidden"
1103
+ }, {
1104
+ default: $(() => [
1105
+ a("div", It, [
1106
+ a("span", Ct, u(c.label), 1),
1107
+ c.helper ? (n(), h(Z, {
1108
+ key: 0,
1109
+ description: c.helper
1110
+ }, null, 8, ["description"])) : g("", !0)
1111
+ ]),
1112
+ a("div", {
1113
+ class: W([
1114
+ "fm-typo-en-title-sm-800 truncate",
1115
+ c.unavailable ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
1116
+ ])
1117
+ }, u(c.value), 3),
1118
+ c.sub ? (n(), v("div", Ot, u(c.sub), 1)) : g("", !0)
1119
+ ]),
1120
+ _: 2
1121
+ }, 1024))), 128))
1122
+ ]);
1123
+ };
1124
+ }
1125
+ }), Pt = { class: "flex items-center justify-between gap-12 flex-wrap mb-16 xs:flex-col xs:items-start" }, $t = {
1126
+ key: 0,
1127
+ class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary mb-12"
1128
+ }, Dt = /* @__PURE__ */ j({
1129
+ __name: "CampaignTrendChart",
1130
+ props: {
1131
+ modes: {}
1132
+ },
1133
+ setup(t) {
1134
+ var R;
1135
+ const r = t, e = ["#FF7823", "#B2B3B6"], s = H(((R = r.modes[0]) == null ? void 0 : R.key) ?? ""), c = P(
1136
+ () => r.modes.map((p) => ({ label: p.label, value: p.key }))
1137
+ ), y = P(
1138
+ () => c.value.find((p) => p.value === s.value) ?? null
1139
+ ), i = P(
1140
+ () => r.modes.find((p) => p.key === s.value) ?? r.modes[0]
1141
+ ), f = P(
1142
+ () => {
1143
+ var p;
1144
+ return (((p = i.value) == null ? void 0 : p.series) ?? []).map((L, d) => ({
1145
+ label: L.label,
1146
+ data: L.values,
1147
+ color: e[d] ?? e[e.length - 1],
1148
+ dash: d > 0
1149
+ }));
1150
+ }
1151
+ ), o = { display: !0 };
1152
+ return (p, L) => {
1153
+ const d = _("FmButtonGroup"), U = _("FmLineChart"), M = _("FmCard");
1154
+ return n(), h(M, {
1155
+ variant: "outlined",
1156
+ class: "p-24"
1157
+ }, {
1158
+ default: $(() => [
1159
+ a("div", Pt, [
1160
+ L[1] || (L[1] = a("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, " Funnel trend ", -1)),
1161
+ t.modes.length > 1 ? (n(), h(d, {
1162
+ key: 0,
1163
+ items: l(c),
1164
+ "model-value": l(y),
1165
+ "onUpdate:modelValue": L[0] || (L[0] = (k) => s.value = k.value)
1166
+ }, null, 8, ["items", "model-value"])) : g("", !0)
1167
+ ]),
1168
+ l(i) ? (n(), v("div", $t, u(l(i).label), 1)) : g("", !0),
1169
+ l(i) ? (n(), h(U, {
1170
+ key: 1,
1171
+ datasets: l(f),
1172
+ "x-axis": { categories: l(i).categories },
1173
+ "x-cfg": o,
1174
+ "y-cfg": o,
1175
+ legend: { display: !0 },
1176
+ height: "150px"
1177
+ }, null, 8, ["datasets", "x-axis"])) : g("", !0)
1178
+ ]),
1179
+ _: 1
1180
+ });
1181
+ };
1182
+ }
1183
+ }), Et = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Lt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary mt-4 mb-12" }, Tt = {
1184
+ key: 1,
1185
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary mt-8"
1186
+ }, Bt = {
1187
+ key: 2,
1188
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary mt-8"
1189
+ }, de = /* @__PURE__ */ j({
1190
+ __name: "CampaignBreakdownTable",
1191
+ props: {
1192
+ breakdown: {},
1193
+ title: { default: "Performance details" },
1194
+ emptyMessage: { default: "No outlet activity was recorded for this campaign." }
1195
+ },
1196
+ setup(t) {
1197
+ const r = t, e = P(
1198
+ () => r.breakdown ? je(r.breakdown) : []
1199
+ );
1200
+ return (s, c) => {
1201
+ const y = _("FmTable"), i = _("FmCard");
1202
+ return n(), h(i, {
1203
+ variant: "outlined",
1204
+ class: "p-24"
1205
+ }, {
1206
+ default: $(() => {
1207
+ var f;
1208
+ return [
1209
+ a("div", Et, u(t.title), 1),
1210
+ (f = t.breakdown) != null && f.rows.length ? (n(), v(E, { key: 0 }, [
1211
+ a("div", Lt, " By " + u(t.breakdown.dimension), 1),
1212
+ I(y, {
1213
+ "row-data": t.breakdown.rows,
1214
+ "column-defs": l(e),
1215
+ "column-filter": [],
1216
+ "hide-footer": ""
1217
+ }, null, 8, ["row-data", "column-defs"])
1218
+ ], 64)) : t.breakdown ? (n(), v("div", Tt, u(t.emptyMessage), 1)) : (n(), v("div", Bt, " No breakdown dimension is available for this campaign. "))
1219
+ ];
1220
+ }),
1221
+ _: 1
1222
+ });
1223
+ };
1224
+ }
1225
+ }), Nt = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Vt = {
1226
+ key: 0,
1227
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary mt-4 mb-12"
1228
+ }, Ut = {
1229
+ key: 0,
1230
+ class: "px-16 py-12 rounded-lg bg-fm-color-neutral-gray-100 min-w-0"
1231
+ }, Ft = { class: "flex items-center gap-8" }, At = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary flex-1 min-w-0 truncate" }, qt = {
1232
+ key: 1,
1233
+ class: "flex items-center justify-between gap-12 py-8 border-b border-fm-color-neutral-gray-100"
1234
+ }, jt = { class: "flex items-center gap-8 min-w-0" }, zt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary truncate" }, pe = /* @__PURE__ */ j({
1235
+ __name: "CampaignMetricList",
1236
+ props: {
1237
+ title: {},
1238
+ caption: {},
1239
+ items: {},
1240
+ variant: { default: "tile" }
1241
+ },
1242
+ setup(t) {
1243
+ return (r, e) => {
1244
+ const s = _("FmCard");
1245
+ return n(), h(s, {
1246
+ variant: "outlined",
1247
+ class: "p-24"
1248
+ }, {
1249
+ default: $(() => [
1250
+ a("div", Nt, u(t.title), 1),
1251
+ t.caption ? (n(), v("div", Vt, u(t.caption), 1)) : g("", !0),
1252
+ a("div", {
1253
+ class: W(["grid grid-cols-[repeat(auto-fit,minmax(220px,1fr))] xs:grid-cols-1", t.variant === "tile" ? "gap-16" : "gap-x-16"])
1254
+ }, [
1255
+ (n(!0), v(E, null, ee(t.items, (c) => (n(), v(E, {
1256
+ key: c.key
1257
+ }, [
1258
+ t.variant === "tile" ? (n(), v("div", Ut, [
1259
+ a("div", Ft, [
1260
+ a("span", At, u(c.label), 1),
1261
+ c.helper ? (n(), h(Z, {
1262
+ key: 0,
1263
+ description: c.helper
1264
+ }, null, 8, ["description"])) : g("", !0)
1265
+ ]),
1266
+ a("div", {
1267
+ class: W([
1268
+ "fm-typo-en-body-lg-600 mt-4 truncate",
1269
+ c.unavailable ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
1270
+ ])
1271
+ }, u(c.value), 3)
1272
+ ])) : (n(), v("div", qt, [
1273
+ a("div", jt, [
1274
+ a("span", zt, u(c.label), 1),
1275
+ c.helper ? (n(), h(Z, {
1276
+ key: 0,
1277
+ description: c.helper
1278
+ }, null, 8, ["description"])) : g("", !0)
1279
+ ]),
1280
+ a("span", {
1281
+ class: W([
1282
+ "fm-typo-en-body-md-600 whitespace-nowrap",
1283
+ c.unavailable ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
1284
+ ])
1285
+ }, u(c.value), 3)
1286
+ ]))
1287
+ ], 64))), 128))
1288
+ ], 2)
1289
+ ]),
1290
+ _: 1
1291
+ });
1292
+ };
1293
+ }
1294
+ }), Gt = { class: "flex items-center gap-8" }, Ht = { class: "px-24 flex flex-col gap-16 pb-24" }, Kt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, Yt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, Qt = {
1295
+ key: 0,
1296
+ class: "flex flex-col gap-12"
1297
+ }, Xt = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Jt = {
1298
+ key: 1,
1299
+ class: "flex flex-col gap-12"
1300
+ }, oa = /* @__PURE__ */ j({
1301
+ __name: "CampaignAnalytic",
1302
+ setup(t) {
1303
+ const { t: r } = ye(), e = Me(), s = _e(), { global: c, minor: y } = xe, i = he(), f = H(), o = H(), R = H(), p = H(!1), L = H(!1), d = P(() => {
1304
+ var O;
1305
+ return (O = f.value) == null ? void 0 : O.campaign;
1306
+ }), U = P(
1307
+ () => d.value ? Le(d.value.type) : void 0
1308
+ ), M = P(() => {
1309
+ var O;
1310
+ return (O = U.value) == null ? void 0 : O.report;
1311
+ }), k = P(() => {
1312
+ var O, x, z, G, T, B, F, S, b, A, q, K, Y;
1313
+ return M.value && ((O = d.value) == null ? void 0 : O.type) === "COIN" ? Ue(
1314
+ M.value,
1315
+ ((x = o.value) == null ? void 0 : x.type) === "COIN" ? o.value : ne()
1316
+ ) : M.value && ((z = d.value) == null ? void 0 : z.type) === "POINT" ? Fe(
1317
+ M.value,
1318
+ ((G = o.value) == null ? void 0 : G.type) === "POINT" ? o.value : ie()
1319
+ ) : M.value && ((T = d.value) == null ? void 0 : T.type) === "CREDIT" ? Ae(
1320
+ M.value,
1321
+ ((B = o.value) == null ? void 0 : B.type) === "CREDIT" ? o.value : oe()
1322
+ ) : M.value && ((F = d.value) == null ? void 0 : F.type) === "GAME" ? Ve(
1323
+ M.value,
1324
+ ((S = o.value) == null ? void 0 : S.type) === "GAME" ? o.value : le()
1325
+ ) : M.value && ((b = d.value) == null ? void 0 : b.type) === "MISSION" ? Ne(
1326
+ M.value,
1327
+ ((A = o.value) == null ? void 0 : A.type) === "MISSION" ? o.value : re()
1328
+ ) : M.value && ((q = d.value) == null ? void 0 : q.type) === "PROMOTION" ? Be(
1329
+ M.value,
1330
+ ((K = o.value) == null ? void 0 : K.type) === "PROMOTION" ? o.value : se()
1331
+ ) : M.value && ((Y = o.value) == null ? void 0 : Y.type) === "VOUCHER" ? Te(
1332
+ M.value,
1333
+ o.value,
1334
+ R.value
1335
+ ) : M.value;
1336
+ }), be = P(
1337
+ () => d.value ? r(ke(d.value.timeframeOptions)) : ""
1338
+ ), ve = P(
1339
+ () => d.value && d.value.type !== "MEMBERSHIP" ? we(d.value) : void 0
1340
+ );
1341
+ function fe() {
1342
+ return {
1343
+ type: "VOUCHER",
1344
+ scope: { startDate: "", endDate: "" },
1345
+ metrics: {
1346
+ distributedMembers: 0,
1347
+ distributedVouchers: 0,
1348
+ distributedFixedValue: null,
1349
+ redeemedMembers: 0,
1350
+ redeemedVouchers: 0,
1351
+ voucherUses: 0,
1352
+ expiredUnusedVouchers: 0,
1353
+ completedBills: 0,
1354
+ exactSales: 0,
1355
+ rewardValueUsed: 0,
1356
+ unusedVoucherValue: null
1357
+ },
1358
+ performanceDetails: []
1359
+ };
1360
+ }
1361
+ function se() {
1362
+ return {
1363
+ type: "PROMOTION",
1364
+ scope: { startDate: "", endDate: "" },
1365
+ metrics: {
1366
+ appliedMembers: 0,
1367
+ memberBills: 0,
1368
+ nonMemberBills: 0,
1369
+ attributedBills: 0,
1370
+ memberSales: 0,
1371
+ nonMemberSales: 0,
1372
+ exactSales: 0,
1373
+ promotionValueUsed: 0
1374
+ },
1375
+ performanceDetails: []
1376
+ };
1377
+ }
1378
+ function re() {
1379
+ return {
1380
+ type: "MISSION",
1381
+ scope: { startDate: "", endDate: "" },
1382
+ metrics: {
1383
+ participants: 0,
1384
+ stampsEarned: 0,
1385
+ stampTransactions: 0,
1386
+ rewardRecipients: 0,
1387
+ rewardIssueTransactions: 0,
1388
+ completedMembers: 0,
1389
+ completionEvents: 0
1390
+ },
1391
+ rewards: [],
1392
+ performanceDetails: []
1393
+ };
1394
+ }
1395
+ function le() {
1396
+ return {
1397
+ type: "GAME",
1398
+ scope: { startDate: "", endDate: "" },
1399
+ metrics: {
1400
+ tokenRecipients: 0,
1401
+ tokensIssued: 0,
1402
+ players: 0,
1403
+ plays: 0,
1404
+ rewardRecipients: 0,
1405
+ rewardIssueTransactions: 0
1406
+ },
1407
+ rewards: [],
1408
+ tokenDistributionDetails: []
1409
+ };
1410
+ }
1411
+ function ne() {
1412
+ return {
1413
+ type: "COIN",
1414
+ scope: { startDate: "", endDate: "" },
1415
+ metrics: {
1416
+ recipients: 0,
1417
+ issuanceTransactions: 0,
1418
+ pointsIssued: 0
1419
+ },
1420
+ sourceDetails: [],
1421
+ performanceDetails: []
1422
+ };
1423
+ }
1424
+ function ie() {
1425
+ return {
1426
+ type: "POINT",
1427
+ scope: { startDate: "", endDate: "" },
1428
+ metrics: {
1429
+ recipients: 0,
1430
+ issuanceTransactions: 0,
1431
+ experienceIssued: 0
1432
+ },
1433
+ sourceDetails: [],
1434
+ performanceDetails: []
1435
+ };
1436
+ }
1437
+ function oe() {
1438
+ return {
1439
+ type: "CREDIT",
1440
+ scope: { startDate: "", endDate: "" },
1441
+ metrics: {
1442
+ recipients: 0,
1443
+ issuanceTransactions: 0,
1444
+ creditIssued: 0
1445
+ },
1446
+ sourceDetails: [],
1447
+ performanceDetails: []
1448
+ };
1449
+ }
1450
+ return ge(async () => {
1451
+ var O, x, z, G, T, B, F;
1452
+ try {
1453
+ await c(async () => {
1454
+ var A, q;
1455
+ f.value = await V.readById(e.params.id);
1456
+ const b = e.meta.campaignType;
1457
+ L.value = !!b && ((q = (A = f.value) == null ? void 0 : A.campaign) == null ? void 0 : q.type) !== b;
1458
+ });
1459
+ const S = {
1460
+ timezone: ue[i.currentCountry.value || "MY"] ?? ue.MY
1461
+ };
1462
+ ((O = f.value) == null ? void 0 : O.campaign.type) === "VOUCHER" ? (o.value = fe(), await Promise.all([
1463
+ y(
1464
+ () => V.readAnalyticsOverview(e.params.id, {
1465
+ ...S
1466
+ })
1467
+ ).then((b) => {
1468
+ b.type === "VOUCHER" && (o.value = b);
1469
+ }).catch(() => {
1470
+ }),
1471
+ y(
1472
+ () => V.readAnalyticsTrend(e.params.id, S)
1473
+ ).then((b) => R.value = b).catch(() => {
1474
+ })
1475
+ ])) : ((x = f.value) == null ? void 0 : x.campaign.type) === "PROMOTION" ? (o.value = se(), await y(
1476
+ () => V.readAnalyticsOverview(e.params.id, S)
1477
+ ).then((b) => {
1478
+ b.type === "PROMOTION" && (o.value = b);
1479
+ }).catch(() => {
1480
+ })) : ((z = f.value) == null ? void 0 : z.campaign.type) === "MISSION" ? (o.value = re(), await y(
1481
+ () => V.readAnalyticsOverview(e.params.id, S)
1482
+ ).then((b) => {
1483
+ b.type === "MISSION" && (o.value = b);
1484
+ }).catch(() => {
1485
+ })) : ((G = f.value) == null ? void 0 : G.campaign.type) === "GAME" ? (o.value = le(), await y(
1486
+ () => V.readAnalyticsOverview(e.params.id, S)
1487
+ ).then((b) => {
1488
+ b.type === "GAME" && (o.value = b);
1489
+ }).catch(() => {
1490
+ })) : ((T = f.value) == null ? void 0 : T.campaign.type) === "COIN" ? (o.value = ne(), await y(
1491
+ () => V.readAnalyticsOverview(e.params.id, S)
1492
+ ).then((b) => {
1493
+ b.type === "COIN" && (o.value = b);
1494
+ }).catch(() => {
1495
+ })) : ((B = f.value) == null ? void 0 : B.campaign.type) === "POINT" ? (o.value = ie(), await y(
1496
+ () => V.readAnalyticsOverview(e.params.id, S)
1497
+ ).then((b) => {
1498
+ b.type === "POINT" && (o.value = b);
1499
+ }).catch(() => {
1500
+ })) : ((F = f.value) == null ? void 0 : F.campaign.type) === "CREDIT" && (o.value = oe(), await y(
1501
+ () => V.readAnalyticsOverview(e.params.id, S)
1502
+ ).then((b) => {
1503
+ b.type === "CREDIT" && (o.value = b);
1504
+ }).catch(() => {
1505
+ }));
1506
+ } catch {
1507
+ p.value = !0;
1508
+ }
1509
+ }), (O, x) => {
1510
+ var F, S, b, A, q, K, Y, ce;
1511
+ const z = _("FmPill"), G = _("FmPageHead"), T = _("FmIcon"), B = _("FmCard");
1512
+ return n(), v(E, null, [
1513
+ I(G, {
1514
+ title: "Campaign analytic",
1515
+ "back-button": !0,
1516
+ "onClick:back": x[0] || (x[0] = (Q) => l(s).back())
1517
+ }, {
1518
+ title: $(() => [
1519
+ a("div", Gt, [
1520
+ x[1] || (x[1] = a("span", { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2" }, " Campaign analytic ", -1)),
1521
+ I(z, { variant: "beta" })
1522
+ ])
1523
+ ]),
1524
+ _: 1
1525
+ }),
1526
+ a("div", Ht, [
1527
+ l(p) ? (n(), h(B, {
1528
+ key: 0,
1529
+ variant: "outlined",
1530
+ class: "flex flex-col items-center justify-center text-center py-80 px-40 gap-8"
1531
+ }, {
1532
+ default: $(() => [
1533
+ I(T, {
1534
+ name: "error",
1535
+ outline: "",
1536
+ size: "lg",
1537
+ class: "text-fm-color-neutral-gray-300"
1538
+ }),
1539
+ x[2] || (x[2] = a("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, " Could not load this campaign ", -1)),
1540
+ x[3] || (x[3] = a("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))
1541
+ ]),
1542
+ _: 1
1543
+ })) : l(d) ? (n(), v(E, { key: 1 }, [
1544
+ I(Xe, {
1545
+ "campaign-name": l(d).name,
1546
+ "dates-label": l(be),
1547
+ status: l(ve),
1548
+ "mechanic-label": (F = l(U)) == null ? void 0 : F.label,
1549
+ icon: (S = l(U)) == null ? void 0 : S.icon,
1550
+ objective: (b = l(U)) == null ? void 0 : b.objective,
1551
+ "report-range-label": (A = l(k)) == null ? void 0 : A.reportRangeLabel,
1552
+ "audience-label": (q = l(k)) == null ? void 0 : q.audienceLabel
1553
+ }, null, 8, ["campaign-name", "dates-label", "status", "mechanic-label", "icon", "objective", "report-range-label", "audience-label"]),
1554
+ l(L) ? (n(), h(B, {
1555
+ key: 0,
1556
+ variant: "outlined",
1557
+ class: "flex flex-col items-center justify-center text-center py-80 px-40 gap-8"
1558
+ }, {
1559
+ default: $(() => [
1560
+ I(T, {
1561
+ name: "wrong_location",
1562
+ outline: "",
1563
+ size: "lg",
1564
+ class: "text-fm-color-neutral-gray-300"
1565
+ }),
1566
+ x[4] || (x[4] = a("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, " This campaign does not belong here ", -1)),
1567
+ a("div", Kt, " It is a " + u(l(d).type) + " campaign. Open it from its own campaign list to see the right report. ", 1)
1568
+ ]),
1569
+ _: 1
1570
+ })) : l(U) ? ((K = l(M)) == null ? void 0 : K.state) === "empty" ? (n(), h(B, {
1571
+ key: 2,
1572
+ variant: "outlined",
1573
+ class: "flex flex-col items-center justify-center text-center py-80 px-40 gap-8"
1574
+ }, {
1575
+ default: $(() => [
1576
+ I(T, {
1577
+ name: "inbox",
1578
+ outline: "",
1579
+ size: "lg",
1580
+ class: "text-fm-color-neutral-gray-300"
1581
+ }),
1582
+ x[6] || (x[6] = a("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, " Campaign activity has not started ", -1)),
1583
+ x[7] || (x[7] = a("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, " Performance data will appear after members enter the campaign. ", -1))
1584
+ ]),
1585
+ _: 1
1586
+ })) : l(k) ? (n(), v(E, { key: 3 }, [
1587
+ l(d).type === "COIN" || l(d).type === "POINT" || l(d).type === "CREDIT" ? (n(), v("section", Qt, [
1588
+ a("div", null, [
1589
+ a("div", Xt, u((Y = l(U)) == null ? void 0 : Y.label) + " distribution summary ", 1)
1590
+ ]),
1591
+ I(te, {
1592
+ cards: l(k).cards
1593
+ }, null, 8, ["cards"])
1594
+ ])) : g("", !0),
1595
+ l(d).type === "MISSION" ? (n(), v("section", Jt, [
1596
+ x[8] || (x[8] = a("div", null, [
1597
+ a("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, " Mission participation and completion "),
1598
+ a("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary mt-4" }, " Campaign-lifetime member activity and completion ")
1599
+ ], -1)),
1600
+ I(te, {
1601
+ cards: l(k).cards
1602
+ }, null, 8, ["cards"])
1603
+ ])) : g("", !0),
1604
+ l(k).applicationMix ? (n(), h(dt, {
1605
+ key: 2,
1606
+ mix: l(k).applicationMix
1607
+ }, null, 8, ["mix"])) : l(d).type !== "MISSION" && l(k).funnel.length ? (n(), h(_t, {
1608
+ key: 3,
1609
+ stages: l(k).funnel
1610
+ }, null, 8, ["stages"])) : g("", !0),
1611
+ l(d).type !== "MISSION" && l(d).type !== "COIN" && l(d).type !== "POINT" && l(d).type !== "CREDIT" && l(k).cards.length ? (n(), h(te, {
1612
+ key: 4,
1613
+ cards: l(k).cards
1614
+ }, null, 8, ["cards"])) : g("", !0),
1615
+ l(k).trend.length ? (n(), h(Dt, {
1616
+ key: 5,
1617
+ modes: l(k).trend
1618
+ }, null, 8, ["modes"])) : g("", !0),
1619
+ (ce = l(k).breakdowns) != null && ce.length ? (n(!0), v(E, { key: 6 }, ee(l(k).breakdowns, (Q) => (n(), h(de, {
1620
+ key: Q.title,
1621
+ breakdown: Q.breakdown,
1622
+ title: Q.title,
1623
+ "empty-message": Q.emptyMessage
1624
+ }, null, 8, ["breakdown", "title", "empty-message"]))), 128)) : (n(), h(de, {
1625
+ key: 7,
1626
+ breakdown: l(k).breakdown
1627
+ }, null, 8, ["breakdown"])),
1628
+ l(k).outcomes.length ? (n(), h(pe, {
1629
+ key: 8,
1630
+ title: l(d).type === "MISSION" || l(d).type === "GAME" ? "Reward activity" : "Business outcome",
1631
+ caption: l(d).type === "MISSION" || l(d).type === "GAME" ? "Reward issuance attributed to this campaign" : "Financial and loyalty outcomes attributed to this campaign",
1632
+ items: l(k).outcomes,
1633
+ variant: "tile"
1634
+ }, null, 8, ["title", "caption", "items"])) : g("", !0),
1635
+ I(pe, {
1636
+ title: "Metric definitions",
1637
+ caption: "Hover a metric for its denominator and attribution method",
1638
+ items: l(k).metrics,
1639
+ variant: "row"
1640
+ }, null, 8, ["items"])
1641
+ ], 64)) : g("", !0) : (n(), h(B, {
1642
+ key: 1,
1643
+ variant: "outlined",
1644
+ class: "flex flex-col items-center justify-center text-center py-80 px-40 gap-8"
1645
+ }, {
1646
+ default: $(() => [
1647
+ I(T, {
1648
+ name: "query_stats",
1649
+ outline: "",
1650
+ size: "lg",
1651
+ class: "text-fm-color-neutral-gray-300"
1652
+ }),
1653
+ x[5] || (x[5] = a("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, " Analytic is not available for this campaign type ", -1)),
1654
+ a("div", Yt, " Reporting has not been defined for " + u(l(d).type) + " campaigns yet. ", 1)
1655
+ ]),
1656
+ _: 1
1657
+ }))
1658
+ ], 64)) : g("", !0)
1659
+ ])
1660
+ ], 64);
1661
+ };
1662
+ }
1663
+ });
1664
+ export {
1665
+ oa as default
1666
+ };