@feedmepos/mf-connect 0.1.98-beta.39 → 0.1.98-beta.40

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