@feedmepos/mf-connect 0.1.38-beta.71 → 0.1.38-beta.72

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 (133) hide show
  1. package/package.json +1 -1
  2. package/dist/Analytic-BY0xqCru.js +0 -761
  3. package/dist/App-n6-XqhU7.js +0 -4638
  4. package/dist/AuditLogs-Dml3WjdH.js +0 -1991
  5. package/dist/Bin-DaPZyWm-.js +0 -166
  6. package/dist/Broadcast-hLmkBNne.js +0 -267
  7. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BahnNhzD.js +0 -121
  8. package/dist/Card-C_Fm3E0s.js +0 -909
  9. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +0 -97
  10. package/dist/Collections-DAUsUa0c.js +0 -540
  11. package/dist/Credit-DklbckuQ.js +0 -261
  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-vpnaCdLI.js +0 -3167
  15. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-e1ZWGrXS.js +0 -351
  16. package/dist/Experience-D3Ve8dCI.js +0 -260
  17. package/dist/FileSaver.min-Bg15HHd0.js +0 -74
  18. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
  19. package/dist/Game-BJzRdZNg.js +0 -331
  20. package/dist/GenerateMaterial-pDWgptXt.js +0 -589
  21. package/dist/Grab-B0D8SpcD.js +0 -301
  22. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-DkI3qMHv.js +0 -145
  23. package/dist/Index-ysSM8-pd.js +0 -259
  24. package/dist/JsonViewer-v8_C7l5N.js +0 -87
  25. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-C7bEzQ4b.js +0 -18737
  26. package/dist/MainLayout-Kt1Wiz87.js +0 -41
  27. package/dist/Marketing-CFS6ff03.js +0 -145
  28. package/dist/MarketingMaterialEdit-BDYr5Rlw.js +0 -746
  29. package/dist/Member-Dgb3QBKF.js +0 -280
  30. package/dist/MemberList-CfcQUvN8.js +0 -1605
  31. package/dist/MemberOverview-wL_ailso.js +0 -58
  32. package/dist/MemberTransactions-BVwGdpXo.js +0 -45
  33. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-Dj3h51yH.js +0 -60798
  34. package/dist/Mission-B9K8-Wrt.js +0 -335
  35. package/dist/Overview-DJgKxAvU.js +0 -1078
  36. package/dist/Point-lev1_Nit.js +0 -263
  37. package/dist/Promotion-De9e8yPj.js +0 -397
  38. package/dist/Queue-DH_F0Ekd.js +0 -259
  39. package/dist/Record-CH2AZqzF.js +0 -341
  40. package/dist/Reward-BUgOAjd4.js +0 -442
  41. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-KTaTLjjw.js +0 -149
  42. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-rs5kKp_v.js +0 -1912
  43. package/dist/Segment-DL6O--Aw.js +0 -881
  44. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-ZUGDMD5J.js +0 -181
  45. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-CIeyrheH.js +0 -188
  46. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-BAtXxIjO.js +0 -147
  47. package/dist/Setting-DOA80XlJ.js +0 -1999
  48. package/dist/SettingAdvertisements-Dl0eisXq.js +0 -263
  49. package/dist/Store-fni1Xblz.js +0 -1995
  50. package/dist/StoreRewards-CLMO-kNi.js +0 -534
  51. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BlBovyiT.js +0 -1034
  52. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-D-jYcuAa.js +0 -7005
  53. package/dist/Tier-B0_DiVNv.js +0 -969
  54. package/dist/Title-twptCzpk.js +0 -567
  55. package/dist/Transaction-CTX5I6gO.js +0 -39
  56. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-Bp-rIgz4.js +0 -130
  57. package/dist/Voucher-C7Kxmzjr.js +0 -422
  58. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-lZQTZUUU.js +0 -421
  59. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-BlBEFfgu.js +0 -56
  60. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  61. package/dist/app-D5GVWKxc.js +0 -59071
  62. package/dist/app-wDQR6dpb.js +0 -39
  63. package/dist/app.js +0 -7
  64. package/dist/business-BvNsRlY4.js +0 -82
  65. package/dist/campaign-CpzFl8Vr.js +0 -4
  66. package/dist/campaign-DRErhSfb.js +0 -100
  67. package/dist/campaign-MN_o01w6.js +0 -253
  68. package/dist/campaign.enum-BtfwwLCf.js +0 -26
  69. package/dist/campaign.fn-BgSGxLPo.js +0 -776
  70. package/dist/collectible.enum-CV2tpD2C.js +0 -19
  71. package/dist/collection.fn-BYjqObg7.js +0 -26
  72. package/dist/dto-CyhnIGn-.js +0 -222
  73. package/dist/duplicateCampaign-jOZ1UznM.js +0 -51
  74. package/dist/effect-NKfquhhR.js +0 -89
  75. package/dist/email-addresses-EmFJeFmB.js +0 -705
  76. package/dist/export-B70Bp6s8.js +0 -96
  77. package/dist/feedme.ico +0 -0
  78. package/dist/helper-DiSstsUa.js +0 -86
  79. package/dist/index-5FmmWAib.js +0 -30289
  80. package/dist/index-B09KKPb4.js +0 -3419
  81. package/dist/index-BgP5ZHK6.js +0 -31
  82. package/dist/index-C46EHygk.js +0 -3
  83. package/dist/index-CD7Ji4Nw.js +0 -56
  84. package/dist/index-CHXlBh7-.js +0 -32
  85. package/dist/index-Cr2243n7.js +0 -2423
  86. package/dist/index-CrDg9PFk.js +0 -8912
  87. package/dist/index-CuvNtC_M.js +0 -61
  88. package/dist/index-DK45XoFG.js +0 -54
  89. package/dist/index-Qg_bzaF2.js +0 -76
  90. package/dist/index-bAmlAkpk.js +0 -124
  91. package/dist/index-nTpkh7pU.js +0 -28897
  92. package/dist/index-tvZKdKVU.js +0 -36
  93. package/dist/index-vh86FiIQ.js +0 -10
  94. package/dist/index.esm2017-B8fYlj6l.js +0 -3069
  95. package/dist/loading-DVr3dbZ1.js +0 -215
  96. package/dist/lodash-BNr1VEn2.js +0 -3678
  97. package/dist/membership-LEuPDIbe.js +0 -235
  98. package/dist/moment-D7p2TMB-.js +0 -2583
  99. package/dist/money-CogUwiv6.js +0 -15
  100. package/dist/number-C5wGUTN5.js +0 -12
  101. package/dist/object-qECH92oz.js +0 -26
  102. package/dist/objectId-dwaoBfJX.js +0 -7
  103. package/dist/objectid-DbUENFHd.js +0 -145
  104. package/dist/plugins-BxKrsjEx.js +0 -1817
  105. package/dist/remy-D_Deb3ue.js +0 -13
  106. package/dist/reward-CM4Wx2zA.js +0 -36
  107. package/dist/rule-CMMr2GMg.js +0 -1969
  108. package/dist/rule-builder-D5QsmOxi.js +0 -102
  109. package/dist/style.css +0 -13
  110. package/dist/template-BDKqBasy.js +0 -188
  111. package/dist/tier-BJDhpH6X.js +0 -4
  112. package/dist/tiers/tier=1.png +0 -0
  113. package/dist/tiers/tier=2.png +0 -0
  114. package/dist/tiers/tier=3.png +0 -0
  115. package/dist/tiers/tier=4.png +0 -0
  116. package/dist/timezone-DuaWQsQ2.js +0 -1154
  117. package/dist/titles/type=diamond.png +0 -0
  118. package/dist/titles/type=drinks.png +0 -0
  119. package/dist/titles/type=food.png +0 -0
  120. package/dist/titles/type=heart.png +0 -0
  121. package/dist/titles/type=medal.png +0 -0
  122. package/dist/titles/type=spend.png +0 -0
  123. package/dist/titles/type=thank-you.png +0 -0
  124. package/dist/titles/type=thumbs-up.png +0 -0
  125. package/dist/titles/type=years.png +0 -0
  126. package/dist/trigger-IcyZcRow.js +0 -213
  127. package/dist/tslib.es6-BCqqvLQ_.js +0 -44
  128. package/dist/type_drinks-D6jnpvwV.js +0 -4
  129. package/dist/usePagination-D8OEDsCt.js +0 -223
  130. package/dist/user-u3blYzG2.js +0 -55
  131. package/dist/vue-i18n-DfD8ZY6j.js +0 -2365
  132. package/dist/xlsx-Bgf4_JHr.js +0 -15491
  133. package/dist/zod-9J33xiFS.js +0 -91
@@ -1,1078 +0,0 @@
1
- import { defineComponent as q, resolveComponent as w, openBlock as C, createElementBlock as B, Fragment as Y, createVNode as c, withCtx as V, createElementVNode as a, toDisplayString as O, unref as r, renderSlot as ve, ref as F, computed as G, watch as ie, createBlock as j, isRef as J, resolveDynamicComponent as ne, renderList as re, normalizeClass as de, createTextVNode as ce, createCommentVNode as z, h as te, onMounted as _e } from "vue";
2
- import { _ as ge } from "./campaign-CpzFl8Vr.js";
3
- import { u as Z } from "./vue-i18n-DfD8ZY6j.js";
4
- import { u as ue } from "./loading-DVr3dbZ1.js";
5
- import { c as we, p as K } from "./plugins-BxKrsjEx.js";
6
- import { J as X } from "./JsonViewer-v8_C7l5N.js";
7
- import { Z as N } from "./zod-9J33xiFS.js";
8
- import { u as W } from "./app-wDQR6dpb.js";
9
- import { u as Q, _ as ye } from "./RewardGroup.vue_vue_type_script_setup_true_lang-KTaTLjjw.js";
10
- import { u as me } from "./reward-CM4Wx2zA.js";
11
- import { a as be, b as xe } from "./index-Cr2243n7.js";
12
- import { l as le, c as se } from "./index-B09KKPb4.js";
13
- import "./index-CrDg9PFk.js";
14
- import "./index-5FmmWAib.js";
15
- import "./index-DK45XoFG.js";
16
- import { C as fe } from "./membership-LEuPDIbe.js";
17
- import { t as ee } from "./helper-DiSstsUa.js";
18
- import { c as H } from "./object-qECH92oz.js";
19
- import { useDialog as Ce, components as oe } from "@feedmepos/ui-library";
20
- import { _ as Re } from "./ZodTextField.vue_vue_type_script_setup_true_lang-BlBEFfgu.js";
21
- import { a as Se, _ as Fe, b as ke } from "./trigger-IcyZcRow.js";
22
- import { O as $e } from "./objectid-DbUENFHd.js";
23
- import { r as pe } from "./index-CHXlBh7-.js";
24
- import { u as Pe } from "./business-BvNsRlY4.js";
25
- const Ve = { class: "flex items-center justify-between flex-1 xs:hidden" }, Ie = { class: "flex items-center gap-x-24 h-[80px] p-8 flex-1" }, Te = { class: "flex-1" }, Ue = { class: "flex items-center gap-8" }, Ae = { class: "fm-typo-en-title-sm-800" }, Le = { class: "flex gap-8 items-center" }, Ee = { class: "space-y-4 hidden xs:!block border-b border-fm-color-neutral-gray-100 px-16 flex-1 pb-24" }, Be = { class: "flex items-center justify-between" }, Oe = { class: "flex items-center gap-x-24 h-[80px] p-8 flex-1" }, je = { class: "flex-1 space-y-4" }, De = { class: "fm-typo-en-body-lg-600" }, Ge = /* @__PURE__ */ q({
26
- __name: "ReferralRewadGroupCard",
27
- props: {
28
- rewardGroup: {
29
- type: Object,
30
- required: !0
31
- },
32
- level: {
33
- type: Number,
34
- required: !0
35
- }
36
- },
37
- emits: ["edit", "addCount", "remove"],
38
- setup(k, { emit: l }) {
39
- const { t: I } = Z(), p = l;
40
- return (g, f) => {
41
- const s = w("FmButton"), u = w("FmListItem");
42
- return C(), B(Y, null, [
43
- c(u, {
44
- onClick: f[4] || (f[4] = (m) => p("edit", k.level)),
45
- class: "!p-0"
46
- }, {
47
- default: V(() => [
48
- a("div", Ve, [
49
- a("div", Ie, [
50
- a("div", Te, [
51
- a("div", Ue, [
52
- a("div", Ae, O(k.rewardGroup.name), 1)
53
- ])
54
- ])
55
- ]),
56
- a("div", Le, [
57
- c(s, {
58
- variant: "secondary",
59
- label: r(I)("connect.referral.reward.add_count"),
60
- icon: "add",
61
- onClick: f[0] || (f[0] = (m) => {
62
- m.stopPropagation(), p("addCount", k.level);
63
- })
64
- }, null, 8, ["label"]),
65
- c(s, {
66
- icon: "delete",
67
- onClick: f[1] || (f[1] = (m) => {
68
- m.stopPropagation(), p("remove", k.level);
69
- }),
70
- variant: "tertiary"
71
- })
72
- ])
73
- ]),
74
- a("div", Ee, [
75
- a("div", Be, [
76
- a("div", Oe, [
77
- a("div", je, [
78
- a("div", null, [
79
- a("div", De, O(k.rewardGroup.name), 1)
80
- ])
81
- ])
82
- ]),
83
- c(s, {
84
- variant: "tertiary",
85
- icon: "delete",
86
- onClick: f[2] || (f[2] = (m) => (m.stopPropagation(), p("remove", k.level)))
87
- })
88
- ]),
89
- c(s, {
90
- class: "w-full",
91
- variant: "secondary",
92
- label: "Add count",
93
- disabled: !0,
94
- icon: "add",
95
- onClick: f[3] || (f[3] = (m) => (m.stopPropagation(), p("addCount", k.level)))
96
- })
97
- ])
98
- ]),
99
- _: 1
100
- }),
101
- ve(g.$slots, "default")
102
- ], 64);
103
- };
104
- }
105
- }), Me = { class: "flex flex-col space-y-16 pr-12" }, Ne = { class: "flex gap-16 items-center" }, He = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ze = { class: "fm-typo-en-title-sm-800" }, Ye = { class: "flex items-center gap-8" }, qe = /* @__PURE__ */ q({
106
- __name: "EditReferralCountSheet",
107
- emits: ["update"],
108
- setup(k, { expose: l, emit: I }) {
109
- const { t: p } = Z(), g = I, f = F(!1), s = F({}), u = F(-1), m = F(-1), R = Q(), A = be.superRefine((e, t) => {
110
- var $, U, P, x, v, E, ae;
111
- const d = m.value == -1 ? ((P = (U = ($ = R.referralProgram) == null ? void 0 : $.reward[u.value]) == null ? void 0 : U.rewards) == null ? void 0 : P.length) || 0 : m.value, _ = (v = (x = R.referralProgram) == null ? void 0 : x.reward[u.value]) == null ? void 0 : v.rewards[d - 1], b = (ae = (E = R.referralProgram) == null ? void 0 : E.reward[u.value]) == null ? void 0 : ae.rewards[d + 1];
112
- _ && e.threshold.from < _.threshold.from + 1 && t.addIssue({
113
- code: "custom",
114
- message: `The min referral must be at least ${_.threshold.from + 1}`,
115
- path: ["option"]
116
- }), b && e.threshold.to && b.threshold.to && e.threshold.to > b.threshold.to - 1 && t.addIssue({
117
- code: "custom",
118
- message: `The max referral must be at most ${b.threshold.to - 2}`,
119
- path: ["option"]
120
- });
121
- }), T = G(() => {
122
- const e = A.safeParse(s.value);
123
- return e.success ? [] : e.error.errors;
124
- });
125
- function M() {
126
- const e = A.safeParse(s.value);
127
- e.success && g("update", {
128
- groupIndex: u.value,
129
- countIndex: m.value,
130
- referralCount: e.data
131
- });
132
- }
133
- async function D(e, t) {
134
- var d, _, b, $, U, P;
135
- if (f.value = e, e && typeof (t == null ? void 0 : t.countIndex) == "number" && t.countIndex >= 0)
136
- u.value = t.groupIndex, m.value = t.countIndex, s.value = H(
137
- (d = R.referralProgram) == null ? void 0 : d.reward[t.groupIndex].rewards[t.countIndex]
138
- );
139
- else {
140
- u.value = t.groupIndex, m.value = -1;
141
- const x = m.value == -1 ? (($ = (b = (_ = R.referralProgram) == null ? void 0 : _.reward[u.value]) == null ? void 0 : b.rewards) == null ? void 0 : $.length) || 0 : m.value, v = (P = (U = R.referralProgram) == null ? void 0 : U.reward[u.value]) == null ? void 0 : P.rewards[x - 1];
142
- s.value = {
143
- threshold: {
144
- from: v != null && v.threshold ? v != null && v.threshold.to ? v.threshold.to + 1 : (v == null ? void 0 : v.threshold.from) + 1 : 1,
145
- to: null
146
- },
147
- rewards: []
148
- };
149
- }
150
- h.value = [], h.value = i.value.map(
151
- (x) => s.value.rewards.includes(x.id)
152
- );
153
- }
154
- function L() {
155
- f.value = !1;
156
- }
157
- const y = [
158
- {
159
- header: "Reward title",
160
- accessorFn: (e) => e.name,
161
- enableSorting: !0
162
- },
163
- {
164
- id: "type",
165
- header: "Reward type",
166
- cell(e) {
167
- return fe[e.row.original.collectibleConfig.type].chip();
168
- }
169
- },
170
- {
171
- header: "Description",
172
- accessorFn: (e) => e.description,
173
- cell(e) {
174
- const t = e.row.original;
175
- if (t.collectible.type == "VOUCHER" || t.selectedReward == null)
176
- return t.description;
177
- }
178
- }
179
- ], n = me(), o = F([]), i = G(() => n.rewards.map((e) => {
180
- let t = "No expiry";
181
- switch (e.option.type) {
182
- case "VOUCHER":
183
- t = `${e.option.collectibleConfig.options.maxUse} use(s), ${ee(e.option.collectibleConfig.options.validityOption || {})}`;
184
- break;
185
- case "LOYALTY":
186
- t = `${e.option.earningOption.amount}, ${ee(e.option.validityOption || {})}`;
187
- break;
188
- }
189
- return {
190
- id: e._id,
191
- name: e.name,
192
- collectible: e.option,
193
- collectibleConfig: e.collectibleConfig,
194
- description: t
195
- };
196
- }));
197
- G(() => []);
198
- function S() {
199
- const e = i.value;
200
- for (let t = 0; t < e.length; t++) {
201
- const d = e[t], _ = h.value[t];
202
- _ && !s.value.rewards.includes(d.id) && s.value.rewards.push(d.id), !_ && s.value.rewards.includes(d.id) && (s.value.rewards = s.value.rewards.filter(
203
- (b) => b != d.id
204
- ));
205
- }
206
- }
207
- const h = F({});
208
- return ie(h, S, { deep: !0 }), l({
209
- showSheet: D,
210
- hideSheet: L,
211
- data: s
212
- }), (e, t) => {
213
- const d = w("FmStepperField"), _ = w("FmHelperText"), b = w("FmTable"), $ = w("FmButton"), U = w("FmSideSheet");
214
- return C(), j(U, {
215
- "max-width": 1e3,
216
- modelValue: r(f),
217
- "onUpdate:modelValue": t[4] || (t[4] = (P) => J(f) ? f.value = P : null),
218
- header: `${r(m) == -1 ? r(p)("connect.referral.editReferralCountSheet.add") : r(p)("connect.referral.editReferralCountSheet.edit")}`
219
- }, {
220
- "side-sheet-footer": V(() => [
221
- a("div", Ye, [
222
- c($, {
223
- label: r(p)("connect.editTierSheet.submit"),
224
- onClick: M,
225
- disabled: r(T).length > 0 || r(W)().isLoading,
226
- loading: r(W)().isLoading
227
- }, null, 8, ["label", "disabled", "loading"]),
228
- c($, {
229
- label: r(p)("connect.editTierSheet.cancel"),
230
- onClick: t[3] || (t[3] = (P) => L()),
231
- variant: "tertiary"
232
- }, null, 8, ["label"])
233
- ])
234
- ]),
235
- default: V(() => [
236
- c(X, { json: r(s) }, null, 8, ["json"]),
237
- c(X, { json: r(T) }, null, 8, ["json"]),
238
- a("div", Me, [
239
- a("div", null, [
240
- a("div", Ne, [
241
- c(d, {
242
- modelValue: r(s).threshold.from,
243
- "onUpdate:modelValue": t[0] || (t[0] = (P) => r(s).threshold.from = P),
244
- "show-steppers": !1,
245
- rules: [r(N).ruleAtPath(r(A), "threshold.from")]
246
- }, {
247
- label: V(() => [
248
- (C(), j(ne(
249
- r(N).toInputLabel(
250
- r(N).typeAtPath(r(A), "threshold.from"),
251
- r(p)(
252
- "connect.referral.editReferralCountSheet.min_referral_count"
253
- )
254
- )
255
- )))
256
- ]),
257
- _: 1
258
- }, 8, ["modelValue", "rules"]),
259
- c(d, {
260
- modelValue: r(s).threshold.to,
261
- "onUpdate:modelValue": t[1] || (t[1] = (P) => r(s).threshold.to = P),
262
- "show-steppers": !1,
263
- rules: [r(N).ruleAtPath(r(A), "threshold.to")]
264
- }, {
265
- label: V(() => [
266
- (C(), j(ne(
267
- r(N).toInputLabel(
268
- r(N).typeAtPath(r(A), "threshold.to"),
269
- r(p)(
270
- "connect.referral.editReferralCountSheet.max_referral_count"
271
- )
272
- )
273
- )))
274
- ]),
275
- _: 1
276
- }, 8, ["modelValue", "rules"])
277
- ]),
278
- c(_, {
279
- text: r(N).helperText(r(T), "threshold"),
280
- state: r(N).helperState(r(T), "threshold")
281
- }, null, 8, ["text", "state"]),
282
- a("div", He, O(r(p)(
283
- "connect.referral.editReferralCountSheet.max_referral_count_description"
284
- )), 1)
285
- ]),
286
- a("div", ze, O(r(p)("connect.referral.editReferralCountSheet.referrer_reward")), 1),
287
- c(b, {
288
- modelValue: r(h),
289
- "onUpdate:modelValue": t[2] || (t[2] = (P) => J(h) ? h.value = P : null),
290
- selection: "multiple",
291
- "column-filter": r(o),
292
- "column-defs": y,
293
- "row-data": r(i),
294
- "page-size": 10
295
- }, null, 8, ["modelValue", "column-filter", "row-data"])
296
- ])
297
- ]),
298
- _: 1
299
- }, 8, ["modelValue", "header"]);
300
- };
301
- }
302
- }), Ke = { class: "space-y-16" }, Je = { class: "grid grid-cols-3 gap-16" }, We = { class: "fm-typo-en-title-sm-800" }, Ze = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Qe = /* @__PURE__ */ q({
303
- __name: "CriteriaTriggerInput",
304
- props: {
305
- modelValue: {
306
- type: String
307
- },
308
- disabled: {
309
- type: Boolean,
310
- default: !1
311
- }
312
- },
313
- emits: ["update:model-value"],
314
- setup(k, { emit: l }) {
315
- const I = k, p = l, g = G(() => [
316
- le.enum.BILL_COMPLETED,
317
- le.enum.FEEDBACK
318
- ].map((f) => Se[f]));
319
- return (f, s) => {
320
- const u = w("FmCard");
321
- return C(), B("div", Ke, [
322
- s[0] || (s[0] = a("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Define the conditions that must be met to activate a reward. ", -1)),
323
- a("div", Je, [
324
- (C(!0), B(Y, null, re(r(g), (m) => (C(), j(u, {
325
- key: m.name,
326
- variant: "outlined",
327
- disabled: I.disabled,
328
- class: de(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
329
- "col-span-3": r(g).length == 1,
330
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": k.modelValue == m.value,
331
- "hover:bg-fm-color-opacity-sm": k.modelValue != m.value
332
- }]),
333
- onClick: () => {
334
- I.modelValue != m.value && !I.disabled && p("update:model-value", m.value);
335
- }
336
- }, {
337
- default: V(() => [
338
- a("div", We, O(m.name), 1),
339
- a("div", Ze, O(m.description), 1)
340
- ]),
341
- _: 2
342
- }, 1032, ["disabled", "class", "onClick"]))), 128))
343
- ])
344
- ]);
345
- };
346
- }
347
- }), Xe = { class: "flex items-center gap-x-8" }, er = { class: "flex flex-col space-y-16 pr-12" }, rr = {
348
- key: 0,
349
- class: "space-y-16"
350
- }, tr = {
351
- key: 1,
352
- class: "space-y-16"
353
- }, or = { class: "flex items-center gap-8" }, ar = /* @__PURE__ */ q({
354
- __name: "EditCriteriaSheet",
355
- emits: ["update"],
356
- setup(k, { expose: l, emit: I }) {
357
- const { t: p } = Z(), g = I, f = F(!1), s = F(-1), u = F({}), m = Q(), R = xe.superRefine((y, n) => {
358
- y.name.length >= 50 && n.addIssue({
359
- code: "custom",
360
- message: "Name must be less than 50 characters"
361
- }), y.name.length < 1 && n.addIssue({
362
- code: "custom",
363
- message: "Name is required"
364
- });
365
- }), A = G(() => {
366
- const y = R.safeParse(u.value);
367
- return y.success ? [] : y.error.errors;
368
- });
369
- function T(y, n) {
370
- var o;
371
- f.value = y, y && typeof n == "number" && n >= 0 ? (s.value = n, u.value = H(
372
- (o = m.referralProgram) == null ? void 0 : o.criteria[n]
373
- )) : (s.value = -1, u.value = {
374
- _id: new $e().toString(),
375
- name: "",
376
- type: "AUTO",
377
- event: { type: "BILL_COMPLETED" }
378
- });
379
- }
380
- function M() {
381
- f.value = !1;
382
- }
383
- function D() {
384
- const y = R.safeParse(u.value);
385
- y.success && g("update", s.value, y.data);
386
- }
387
- function L(y) {
388
- u.value.type = y, y == "AUTO" ? u.value.event = { type: "BILL_COMPLETED" } : u.value.event = void 0;
389
- }
390
- return l({
391
- showSheet: T,
392
- hideSheet: M,
393
- data: u
394
- }), (y, n) => {
395
- const o = w("FmButton"), i = w("FmRadio"), S = w("FmRadioGroup"), h = w("FmSideSheet");
396
- return C(), j(h, {
397
- "max-width": 768,
398
- modelValue: r(f),
399
- "onUpdate:modelValue": n[6] || (n[6] = (e) => J(f) ? f.value = e : null)
400
- }, {
401
- "side-sheet-header": V(() => [
402
- a("div", Xe, [
403
- c(o, {
404
- icon: "arrow_back",
405
- variant: "tertiary",
406
- onClick: n[0] || (n[0] = (e) => T(!1))
407
- }),
408
- n[7] || (n[7] = ce("Add Criteria ", -1))
409
- ])
410
- ]),
411
- "side-sheet-footer": V(() => [
412
- a("div", or, [
413
- c(o, {
414
- label: r(p)("connect.editTierSheet.submit"),
415
- onClick: D,
416
- disabled: r(A).length > 0 || r(W)().isLoading,
417
- loading: r(W)().isLoading
418
- }, null, 8, ["label", "disabled", "loading"]),
419
- c(o, {
420
- label: r(p)("connect.editTierSheet.cancel"),
421
- onClick: n[5] || (n[5] = (e) => T(!1)),
422
- variant: "tertiary"
423
- }, null, 8, ["label"])
424
- ])
425
- ]),
426
- default: V(() => [
427
- c(X, { json: r(u) }, null, 8, ["json"]),
428
- a("div", er, [
429
- n[12] || (n[12] = a("div", { class: "fm-typo-en-title-sm-600" }, "Program Criteria", -1)),
430
- c(Re, {
431
- modelValue: r(u).name,
432
- "onUpdate:modelValue": n[1] || (n[1] = (e) => r(u).name = e),
433
- label: r(p)("connect.referral.editReferralTierSheet.name"),
434
- schema: r(N).typeAtPath(r(R), "name")
435
- }, null, 8, ["modelValue", "label", "schema"]),
436
- n[13] || (n[13] = a("div", { class: "fm-typo-en-title-sm-600" }, "Configuration", -1)),
437
- c(S, {
438
- "model-value": r(u).type,
439
- label: "Verify status",
440
- "onUpdate:modelValue": L
441
- }, {
442
- default: V(() => [
443
- c(i, {
444
- value: "AUTO",
445
- label: "Auto",
446
- sublabel: "Verify based on rule configuration"
447
- }),
448
- c(i, {
449
- value: "MANUAL",
450
- label: "Manual",
451
- sublabel: "Verify based on manual inspection"
452
- })
453
- ]),
454
- _: 1
455
- }, 8, ["model-value"]),
456
- r(u).type == "AUTO" ? (C(), B(Y, { key: 0 }, [
457
- n[10] || (n[10] = a("div", { class: "fm-typo-en-title-sm-600" }, "Trigger", -1)),
458
- n[11] || (n[11] = a("div", null, " Select trigger what referee need to complete in order for referral to earn reward ", -1)),
459
- c(Qe, {
460
- "model-value": r(u).event.type,
461
- "onUpdate:modelValue": n[2] || (n[2] = (e) => r(u).event.type = e)
462
- }, null, 8, ["model-value"]),
463
- r(u).event.type == r(se).enum.BILL_COMPLETED ? (C(), B("div", rr, [
464
- n[8] || (n[8] = a("div", { class: "fm-typo-en-title-sm-600" }, "Spending Criteria", -1)),
465
- c(Fe, {
466
- "model-value": r(u).event.rule,
467
- "onUpdate:modelValue": n[3] || (n[3] = (e) => r(u).event.rule = e)
468
- }, null, 8, ["model-value"])
469
- ])) : z("", !0),
470
- r(u).event.type == r(se).enum.FEEDBACK ? (C(), B("div", tr, [
471
- n[9] || (n[9] = a("div", { class: "fm-typo-en-title-sm-600" }, "Feedback Criteria", -1)),
472
- c(ke, {
473
- "model-value": r(u).event.rule,
474
- "onUpdate:modelValue": n[4] || (n[4] = (e) => r(u).event.rule = e)
475
- }, null, 8, ["model-value"])
476
- ])) : z("", !0)
477
- ], 64)) : z("", !0)
478
- ])
479
- ]),
480
- _: 1
481
- }, 8, ["modelValue"]);
482
- };
483
- }
484
- });
485
- function he() {
486
- const k = F(!1), l = Ce();
487
- return {
488
- confirmUpdateReferralRecord: async () => {
489
- await new Promise((p) => {
490
- l.open({
491
- title: "Confirmation",
492
- message: "This will change all referral settings? Would you like to update previous referral record?",
493
- primaryActions: { text: "Update all", close: !0 },
494
- secondaryActions: { text: "Update future only", close: !0 }
495
- }).onPrimary(async () => {
496
- k.value = !0, p();
497
- }).onSecondary(async () => {
498
- k.value = !1, p();
499
- });
500
- });
501
- },
502
- updateReferralRecord: k
503
- };
504
- }
505
- const nr = { class: "flex flex-col space-y-16 mt-24" }, lr = { class: "flex justify-between items-center" }, sr = /* @__PURE__ */ q({
506
- __name: "ManageCriteriaSheet",
507
- setup(k, { expose: l }) {
508
- const { t: I } = Z(), { minor: p } = ue, { confirmUpdateReferralRecord: g, updateReferralRecord: f } = he(), s = F(!1), u = F({}), m = Q(), R = F(
509
- null
510
- ), A = G(() => {
511
- var o;
512
- return (o = m.referralProgram) == null ? void 0 : o.criteria;
513
- });
514
- async function T(o) {
515
- await g(), await p(async () => {
516
- await pe.update({
517
- ...o,
518
- updateReferralRecord: f.value
519
- }), await m.readReferralProgram();
520
- });
521
- }
522
- async function M(o, i) {
523
- var e, t;
524
- const S = o == -1 ? ((e = m.referralProgram) == null ? void 0 : e.criteria.length) || 0 : o, h = H(m.referralProgram);
525
- h.criteria[S] = i, await T(h), (t = R.value) == null || t.showSheet(!1);
526
- }
527
- async function D(o) {
528
- var h, e;
529
- if (!await K.remove(
530
- "Are you sure to remove criteria",
531
- "Remove criteria",
532
- I("connect.prompt.confirm"),
533
- I("connect.prompt.cancel")
534
- ))
535
- return;
536
- const i = o == -1 ? ((h = m.referralProgram) == null ? void 0 : h.criteria.length) || 0 : o, S = H(m.referralProgram);
537
- S.criteria.splice(i, 1), await T(S), (e = R.value) == null || e.showSheet(!1);
538
- }
539
- const L = [
540
- {
541
- header: "Criteria title",
542
- accessorFn: (o) => o.name
543
- },
544
- {
545
- header: "Validity method",
546
- cell(o) {
547
- return te(oe.FmChip, {
548
- label: we.title(o.row.original.type),
549
- variant: "plain"
550
- });
551
- }
552
- },
553
- {
554
- header: "Actions",
555
- cell(o) {
556
- return [
557
- te(oe.FmButton, {
558
- variant: "tertiary",
559
- icon: "delete",
560
- iconColor: "neutral-gray-400",
561
- onClick: (i) => {
562
- i.stopPropagation(), D(o.row.index);
563
- }
564
- })
565
- ];
566
- }
567
- }
568
- ];
569
- function y(o) {
570
- s.value = o;
571
- }
572
- function n() {
573
- s.value = !1;
574
- }
575
- return l({
576
- showSheet: y,
577
- hideSheet: n,
578
- data: u
579
- }), (o, i) => {
580
- const S = w("FmButton"), h = w("FmTable"), e = w("FmSideSheet");
581
- return C(), B(Y, null, [
582
- c(e, {
583
- "max-width": 768,
584
- modelValue: r(s),
585
- "onUpdate:modelValue": i[2] || (i[2] = (t) => J(s) ? s.value = t : null),
586
- header: "Manage Criteria"
587
- }, {
588
- default: V(() => [
589
- a("div", nr, [
590
- a("div", lr, [
591
- i[3] || (i[3] = a("div", null, [
592
- a("div", { class: "fm-typo-en-title-sm-600" }, "Program Criteria"),
593
- a("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Set participation rules to start your referral program ")
594
- ], -1)),
595
- c(S, {
596
- label: "Add Criteria",
597
- icon: "add",
598
- variant: "secondary",
599
- onClick: i[0] || (i[0] = (t) => {
600
- var d;
601
- return (d = r(R)) == null ? void 0 : d.showSheet(!0);
602
- })
603
- })
604
- ]),
605
- c(h, {
606
- "row-data": r(A),
607
- "hide-footer": !0,
608
- "page-size": 100,
609
- "shrink-at": !1,
610
- "column-defs": L,
611
- onRowClick: i[1] || (i[1] = (t) => {
612
- var d;
613
- return (d = r(R)) == null ? void 0 : d.showSheet(!0, t.index);
614
- })
615
- }, null, 8, ["row-data"])
616
- ])
617
- ]),
618
- _: 1
619
- }, 8, ["modelValue"]),
620
- c(ar, {
621
- ref_key: "editCriteriaSheetRef",
622
- ref: R,
623
- onUpdate: M
624
- }, null, 512)
625
- ], 64);
626
- };
627
- }
628
- }), ir = { class: "flex flex-col space-y-16 pr-12" }, dr = { class: "fm-typo-en-title-sm-800" }, cr = { class: "flex items-center gap-8" }, ur = /* @__PURE__ */ q({
629
- __name: "EditRefereeRewardSheet",
630
- emits: ["update"],
631
- setup(k, { expose: l, emit: I }) {
632
- const { t: p } = Z(), g = I, f = F(!1), s = F([]), u = Q();
633
- function m() {
634
- g("update", s.value);
635
- }
636
- async function R(o) {
637
- var i, S;
638
- f.value = o, s.value = ((S = (i = u.referralProgram) == null ? void 0 : i.refereeReward) == null ? void 0 : S.map((h) => h.toString())) || [], n.value = L.value.map((h) => s.value.includes(h.id));
639
- }
640
- function A() {
641
- f.value = !1;
642
- }
643
- const T = [
644
- {
645
- header: "Reward title",
646
- accessorFn: (o) => o.name,
647
- enableSorting: !0
648
- },
649
- {
650
- id: "type",
651
- header: "Reward type",
652
- cell(o) {
653
- return fe[o.row.original.collectibleConfig.type].chip();
654
- }
655
- },
656
- {
657
- header: "Description",
658
- accessorFn: (o) => o.description,
659
- cell(o) {
660
- const i = o.row.original;
661
- if (i.collectible.type == "VOUCHER" || i.selectedReward == null)
662
- return i.description;
663
- }
664
- }
665
- ], M = me(), D = F([]), L = G(() => M.rewards.map((o) => {
666
- let i = "No expiry";
667
- switch (o.option.type) {
668
- case "VOUCHER":
669
- i = `${o.option.collectibleConfig.options.maxUse} use(s), ${ee(o.option.collectibleConfig.options.validityOption || {})}`;
670
- break;
671
- case "LOYALTY":
672
- i = `${o.option.earningOption.amount}, ${ee(o.option.validityOption || {})}`;
673
- break;
674
- }
675
- return {
676
- id: o._id,
677
- name: o.name,
678
- collectible: o.option,
679
- collectibleConfig: o.collectibleConfig,
680
- description: i
681
- };
682
- }));
683
- G(() => []);
684
- function y() {
685
- const o = L.value;
686
- for (let i = 0; i < o.length; i++) {
687
- const S = o[i], h = n.value[i];
688
- h && !s.value.includes(S.id) && s.value.push(S.id), !h && s.value.includes(S.id) && (s.value = s.value.filter((e) => e != S.id));
689
- }
690
- }
691
- const n = F({});
692
- return ie(n, y, { deep: !0 }), l({
693
- showSheet: R,
694
- hideSheet: A,
695
- data: s
696
- }), (o, i) => {
697
- const S = w("FmTable"), h = w("FmButton"), e = w("FmSideSheet");
698
- return C(), j(e, {
699
- "max-width": 1e3,
700
- modelValue: r(f),
701
- "onUpdate:modelValue": i[2] || (i[2] = (t) => J(f) ? f.value = t : null),
702
- header: "Referee reward"
703
- }, {
704
- "side-sheet-footer": V(() => [
705
- a("div", cr, [
706
- c(h, {
707
- label: r(p)("connect.common.save"),
708
- onClick: m,
709
- disabled: r(W)().isLoading,
710
- loading: r(W)().isLoading
711
- }, null, 8, ["label", "disabled", "loading"]),
712
- c(h, {
713
- label: r(p)("connect.common.cancel"),
714
- onClick: i[1] || (i[1] = (t) => A()),
715
- variant: "tertiary"
716
- }, null, 8, ["label"])
717
- ])
718
- ]),
719
- default: V(() => [
720
- c(X, { json: r(s) }, null, 8, ["json"]),
721
- a("div", ir, [
722
- a("div", dr, O(r(p)("connect.referral.refereeRewardSheet.referee_reward")), 1),
723
- c(S, {
724
- modelValue: r(n),
725
- "onUpdate:modelValue": i[0] || (i[0] = (t) => J(n) ? n.value = t : null),
726
- selection: "multiple",
727
- "column-filter": r(D),
728
- "column-defs": T,
729
- "row-data": r(L),
730
- "page-size": 10
731
- }, null, 8, ["modelValue", "column-filter", "row-data"])
732
- ])
733
- ]),
734
- _: 1
735
- }, 8, ["modelValue"]);
736
- };
737
- }
738
- }), mr = { class: "fm-typo-en-title-sm-600" }, fr = { class: "grid grid-cols-4 xs:grid-cols-1 gap-4 divide-x xs:divide-x-0" }, pr = { class: "flex gap-x-8" }, hr = { class: "fm-typo-body-lg-600 flex items-center gap-x-4" }, vr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _r = { class: "mb-40" }, gr = {
739
- key: 0,
740
- class: "flex flex-col items-center justify-center gap-y-16 p-24"
741
- }, wr = { class: "flex flex-col gap-16 text-center" }, yr = { class: "fm-typo-en-title-sm-800" }, br = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Yr = /* @__PURE__ */ q({
742
- __name: "Overview",
743
- setup(k) {
744
- const { t: l } = Z(), { minor: I } = ue, p = Pe(), g = Q(), { confirmUpdateReferralRecord: f, updateReferralRecord: s } = he(), u = G(() => {
745
- var e;
746
- return ((e = g.referralProgram) == null ? void 0 : e.reward) ?? [];
747
- }), m = F(null);
748
- F(null);
749
- const R = F(null), A = F(null), T = F(null), M = G(() => {
750
- var e, t, d, _;
751
- return [
752
- {
753
- label: "connect.referral.how_it_works.generate_link",
754
- sublabel: l("connect.referral.how_it_works.generate_link_for_member"),
755
- icon: "offline_share"
756
- },
757
- {
758
- label: "connect.referral.how_it_works.referee_join_reward",
759
- sublabel: `${((t = (e = g.referralProgram) == null ? void 0 : e.pf_refereeReward) == null ? void 0 : t.length) || 0} ${l("connect.referral.how_it_works.reward")}`,
760
- action: l("connect.referral.actions.manage_reward"),
761
- onClick: () => {
762
- var b;
763
- return (b = T.value) == null ? void 0 : b.showSheet(!0);
764
- },
765
- helperText: l(
766
- "connect.referral.how_it_works.referee_join_reward_description"
767
- ),
768
- icon: "group_add"
769
- },
770
- {
771
- label: "connect.referral.how_it_works.referee_meet_criteria",
772
- sublabel: `${(d = g.referralProgram) == null ? void 0 : d.criteria.length} ${l("connect.referral.how_it_works.criteria")}`,
773
- action: l("connect.referral.actions.manage_criteria"),
774
- onClick: () => {
775
- var b;
776
- return (b = A.value) == null ? void 0 : b.showSheet(!0);
777
- },
778
- icon: "checklist_rtl"
779
- },
780
- {
781
- label: "connect.referral.how_it_works.referer_get_reward",
782
- sublabel: `${(_ = g.referralProgram) == null ? void 0 : _.reward.length} ${l("connect.referral.how_it_works.reward_tier")}`,
783
- helperText: l("connect.referral.how_it_works.referral_tier_description"),
784
- icon: "featured_seasonal_and_gifts"
785
- }
786
- ];
787
- });
788
- function D(e) {
789
- var t;
790
- (t = m.value) == null || t.onManageRewardGroup(e);
791
- }
792
- function L(e) {
793
- var t;
794
- (t = R.value) == null || t.showSheet(!0, {
795
- groupIndex: e.groupIndex,
796
- countIndex: e.countIndex
797
- });
798
- }
799
- async function y(e) {
800
- var P, x, v, E;
801
- const t = e.countIndex == -1 ? ((x = (P = g.referralProgram) == null ? void 0 : P.reward[e.groupIndex]) == null ? void 0 : x.rewards.length) || 0 : e.countIndex || 0, d = e.referralCount, _ = H(
802
- g.referralProgram
803
- ), b = _.reward[e.groupIndex];
804
- b.rewards[t] = e.referralCount;
805
- const $ = b.rewards[t - 1], U = b.rewards[t + 1];
806
- if ($ && $.threshold.to != d.threshold.from - 1) {
807
- if (!await K.confirm(
808
- l(
809
- "connect.referral.referral_count.update.range_discontinuous.previous",
810
- {
811
- name: $.threshold.from,
812
- from: $.threshold.from ?? 0,
813
- to: $.threshold.to ?? 1 / 0,
814
- newTo: d.threshold.from - 1
815
- }
816
- ),
817
- l("connect.referral.referral_count.title"),
818
- l("connect.referral.referral_count.remove.next_range")
819
- ))
820
- return;
821
- $.threshold.to = d.threshold.from - 1;
822
- }
823
- if (U && U.threshold.from - 1 != d.threshold.to) {
824
- if (!await K.confirm(
825
- l("connect.program.tier.update.range_discontinuous.next", {
826
- name: U.threshold.from,
827
- from: U.threshold.from ?? 0,
828
- to: U.threshold.to ?? 1 / 0,
829
- newFrom: d.threshold.to ?? 1
830
- }),
831
- l("connect.program.tier.title"),
832
- l("connect.program.tier.remove.next_range"),
833
- l("connect.prompt.cancel")
834
- ))
835
- return;
836
- U.threshold.from = (d.threshold.to ?? 0) + 1;
837
- }
838
- !U && !((v = d.threshold) != null && v.to) && (d.threshold.to = void 0), await o(_), (E = R.value) == null || E.hideSheet();
839
- }
840
- async function n(e) {
841
- var d;
842
- const t = H(g.referralProgram);
843
- t.refereeReward = e, await o(t), (d = T.value) == null || d.hideSheet();
844
- }
845
- async function o(e) {
846
- await f(), await I(
847
- async () => {
848
- await pe.update({
849
- ...e,
850
- updateReferralRecord: s.value
851
- }), await g.readReferralProgram();
852
- },
853
- {
854
- message: "Updating referral program",
855
- successMessage: "Referral program updated successfully"
856
- }
857
- );
858
- }
859
- async function i(e) {
860
- if (!await K.remove(
861
- l("connect.referral.reward.confirm_remove_referral_tier"),
862
- l("connect.referral.reward.remove_referral_tier"),
863
- l("connect.prompt.confirm"),
864
- l("connect.prompt.cancel")
865
- ))
866
- return;
867
- const t = H(g.referralProgram);
868
- t.reward.splice(e, 1), await o(t);
869
- }
870
- async function S(e, t) {
871
- if (!await K.remove(
872
- l("connect.referral.reward.confirm_remove_referral_count"),
873
- l("connect.referral.reward.remove_referral_count"),
874
- l("connect.prompt.confirm"),
875
- l("connect.prompt.cancel")
876
- ))
877
- return;
878
- const d = H(g.referralProgram), _ = d.reward[e].rewards[t + 1];
879
- if (_) {
880
- if (!await K.confirm(
881
- l("connect.referral.referral_count.update.range_discontinuous.next", {
882
- from: _.threshold.from ?? 0,
883
- to: _.threshold.to ?? 1 / 0,
884
- newFrom: d.reward[e].rewards[t].threshold.from
885
- }),
886
- l("connect.referral.referral_count.remove.title"),
887
- l("connect.referral.referral_count.remove.next_range"),
888
- l("connect.prompt.cancel")
889
- ))
890
- return;
891
- _.threshold.from = d.reward[e].rewards[t].threshold.from;
892
- }
893
- d.reward[e].rewards.splice(t, 1), await o(d);
894
- }
895
- const h = [
896
- {
897
- header: l("connect.referral.reward.table.count"),
898
- accessorFn: (e) => e.threshold.from == e.threshold.to ? `${e.threshold.from}` : e.threshold.to ? `${e.threshold.from} - ${e.threshold.to ?? "∞"}` : `${e.threshold.from}+`
899
- },
900
- {
901
- header: l("connect.referral.reward.table.reward"),
902
- accessorKey: "type",
903
- accessorFn: (e) => {
904
- var t;
905
- return `${((t = e.pf_reward) == null ? void 0 : t.length) || 0} reward(s)`;
906
- }
907
- },
908
- {
909
- id: "actions",
910
- meta: {
911
- textAlign: "right"
912
- },
913
- cell(e) {
914
- return te(oe.FmButton, {
915
- variant: "tertiary",
916
- icon: "delete",
917
- iconColor: "neutral-gray-400",
918
- class: "ml-auto",
919
- onClick: (t) => {
920
- t.stopPropagation(), console.log(e.row), S(e.row.original.groupIndex, e.row.index);
921
- }
922
- });
923
- }
924
- }
925
- ];
926
- return _e(async () => {
927
- await g.readReferralProgram();
928
- }), (e, t) => {
929
- const d = w("FmCard"), _ = w("FmIcon"), b = w("FmTooltip"), $ = w("FmButton"), U = w("FmTable"), P = w("FmList");
930
- return C(), B(Y, null, [
931
- z("", !0),
932
- c(d, {
933
- variant: "outlined",
934
- class: "flex flex-col gap-16 p-16"
935
- }, {
936
- default: V(() => [
937
- a("div", mr, O(r(l)("connect.referral.how_it_works.title")), 1),
938
- a("div", fr, [
939
- (C(!0), B(Y, null, re(r(M), (x, v) => (C(), B("div", {
940
- key: v,
941
- class: de(["px-8", { "xs:!border-r": v % 2 == 0 }])
942
- }, [
943
- a("div", pr, [
944
- c(_, {
945
- name: x.icon,
946
- color: "primary",
947
- class: "bg-fm-color-system-warning-100 p-8 fm-corner-radius-md max-h-40 max-w-40"
948
- }, null, 8, ["name"]),
949
- a("div", null, [
950
- a("div", hr, [
951
- ce(O(r(l)(x.label)) + " ", 1),
952
- x.helperText ? (C(), j(b, {
953
- key: 0,
954
- content: x.helperText
955
- }, {
956
- default: V(() => [
957
- c(_, {
958
- name: "help",
959
- size: "sm",
960
- outline: !0
961
- })
962
- ]),
963
- _: 1
964
- }, 8, ["content"])) : z("", !0)
965
- ]),
966
- a("div", vr, O(x.sublabel), 1),
967
- x.action ? (C(), j($, {
968
- key: 0,
969
- variant: "plain",
970
- label: x.action,
971
- disabled: !r(p).isPremium,
972
- class: "fm-typo-en-body-md-400 !p-0",
973
- onClick: x.onClick
974
- }, null, 8, ["label", "disabled", "onClick"])) : z("", !0)
975
- ])
976
- ])
977
- ], 2))), 128))
978
- ])
979
- ]),
980
- _: 1
981
- }),
982
- r(u) && r(u).length > 0 ? (C(), j(d, {
983
- key: 1,
984
- variant: "outlined",
985
- class: "flex flex-col gap-16 p-16"
986
- }, {
987
- default: V(() => [
988
- c(P, { separator: !0 }, {
989
- default: V(() => [
990
- (C(!0), B(Y, null, re(r(u), (x, v) => (C(), j(Ge, {
991
- key: v,
992
- "reward-group": x,
993
- level: v,
994
- onEdit: (E) => D(v),
995
- onRemove: (E) => i(v),
996
- onAddCount: t[0] || (t[0] = (E) => {
997
- L({ groupIndex: E, countIndex: -1 });
998
- })
999
- }, {
1000
- default: V(() => [
1001
- a("div", _r, [
1002
- c(U, {
1003
- "row-data": x.rewards.map((E) => ({ ...E, groupIndex: v })),
1004
- "column-defs": h,
1005
- "hide-footer": !0,
1006
- "page-size": 50,
1007
- onRowClick: (E) => L({ groupIndex: v, countIndex: E.index })
1008
- }, null, 8, ["row-data", "onRowClick"])
1009
- ]),
1010
- x.rewards.length ? z("", !0) : (C(), B("div", gr, [
1011
- t[3] || (t[3] = a("div", { class: "flex flex-col gap-16 text-center" }, [
1012
- a("div", { class: "fm-typo-en-title-sm-800" }, "Create progressive reward"),
1013
- a("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Add referral count to configure progression reward to the referral program ")
1014
- ], -1)),
1015
- c($, {
1016
- variant: "secondary",
1017
- label: "Add count",
1018
- icon: "add",
1019
- onClick: (E) => L({ groupIndex: v, countIndex: -1 })
1020
- }, null, 8, ["onClick"])
1021
- ]))
1022
- ]),
1023
- _: 2
1024
- }, 1032, ["reward-group", "level", "onEdit", "onRemove"]))), 128))
1025
- ]),
1026
- _: 1
1027
- })
1028
- ]),
1029
- _: 1
1030
- })) : (C(), j(d, {
1031
- key: 2,
1032
- variant: "outlined",
1033
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
1034
- }, {
1035
- default: V(() => [
1036
- t[4] || (t[4] = a("img", {
1037
- src: ge,
1038
- class: "aspect-square w-[150px]"
1039
- }, null, -1)),
1040
- a("div", wr, [
1041
- a("div", yr, O(r(l)("connect.referral.referral_tier_title")), 1),
1042
- a("div", br, O(r(l)("connect.referral.referral_tier_description")), 1)
1043
- ]),
1044
- c($, {
1045
- variant: "primary",
1046
- label: r(l)("connect.referral.add_referral_tier"),
1047
- icon: "add",
1048
- disabled: !r(p).isPremium,
1049
- onClick: t[1] || (t[1] = (x) => D(-1))
1050
- }, null, 8, ["label", "disabled"])
1051
- ]),
1052
- _: 1
1053
- })),
1054
- c(ye, {
1055
- ref_key: "rewardGroupRef",
1056
- ref: m
1057
- }, null, 512),
1058
- c(qe, {
1059
- ref_key: "editReferralCountSheetRef",
1060
- ref: R,
1061
- onUpdate: y
1062
- }, null, 512),
1063
- c(sr, {
1064
- ref_key: "manageCriteriaSheetRef",
1065
- ref: A
1066
- }, null, 512),
1067
- c(ur, {
1068
- ref_key: "editRefereeRewardSheetRef",
1069
- ref: T,
1070
- onUpdate: n
1071
- }, null, 512)
1072
- ], 64);
1073
- };
1074
- }
1075
- });
1076
- export {
1077
- Yr as default
1078
- };