@feedmepos/mf-connect 0.1.98-beta.13 → 0.1.98-beta.15

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 (138) hide show
  1. package/package.json +1 -1
  2. package/dist/App-DQqZfak3.js +0 -4782
  3. package/dist/AuditLogs-C19m85wp.js +0 -2013
  4. package/dist/Bin-GjJ5Q2ae.js +0 -166
  5. package/dist/Broadcast-CVTBL0T0.js +0 -266
  6. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B6BYvVmq.js +0 -120
  7. package/dist/Card-DzYit3v6.js +0 -910
  8. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +0 -97
  9. package/dist/Collections-CaU7auvn.js +0 -540
  10. package/dist/Credit-B_eUMV0R.js +0 -260
  11. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +0 -128
  12. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
  13. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bgcm1S_g.js +0 -3377
  14. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-CZLoCJM4.js +0 -351
  15. package/dist/Experience-B7kxE07l.js +0 -259
  16. package/dist/FileSaver.min-BBvy4uPh.js +0 -74
  17. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
  18. package/dist/FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js +0 -52
  19. package/dist/Game-B98hcWvR.js +0 -330
  20. package/dist/Grab-RdxV7xhM.js +0 -300
  21. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-BBYekrJp.js +0 -145
  22. package/dist/Index-CvMVxCY5.js +0 -259
  23. package/dist/JsonViewer-v8_C7l5N.js +0 -87
  24. package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-D4-wjMg6.js +0 -48
  25. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-Jir8zY8e.js +0 -18737
  26. package/dist/LoyaltyDashboard-B1OzFT4q.js +0 -1082
  27. package/dist/MainLayout-De_edc-D.js +0 -41
  28. package/dist/Marketing-B7-To3XF.js +0 -235
  29. package/dist/MarketingMaterialEdit-DGONncxn.js +0 -1035
  30. package/dist/Member-DEGCrqnh.js +0 -280
  31. package/dist/MemberList-vKYbpLVu.js +0 -1601
  32. package/dist/MemberOverview-wL_ailso.js +0 -58
  33. package/dist/MemberTransactions-CGC3vYKC.js +0 -45
  34. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-BP9YtuPA.js +0 -60802
  35. package/dist/Mission-hxf_AIGL.js +0 -334
  36. package/dist/Overview-NvgUuMYp.js +0 -949
  37. package/dist/Overview-iRLMLoAo.js +0 -1079
  38. package/dist/Point-tkUTXOCe.js +0 -262
  39. package/dist/Promotion-DNUcMKJQ.js +0 -397
  40. package/dist/Queue-5XYiIuG8.js +0 -260
  41. package/dist/Record-B5aYp7eF.js +0 -342
  42. package/dist/Review-BqaHlzXV.js +0 -45
  43. package/dist/ReviewFacebookCallback-BqlFkSB7.js +0 -248
  44. package/dist/ReviewGoogleCallback-ssKL4jh4.js +0 -213
  45. package/dist/Reward-1xOMowTW.js +0 -442
  46. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-Db3FSfIc.js +0 -149
  47. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Cmrp2Tia.js +0 -1911
  48. package/dist/Segment-BMBwsUug.js +0 -1014
  49. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-DSfdei-h.js +0 -181
  50. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-BJVeGJ5J.js +0 -188
  51. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-OBZubKUy.js +0 -226
  52. package/dist/Setting-DWygYkHW.js +0 -2047
  53. package/dist/SettingAdvertisements-TYB1b7dB.js +0 -264
  54. package/dist/Settings-DynjmCPL.js +0 -220
  55. package/dist/Store-DRYkmigC.js +0 -1996
  56. package/dist/StoreRewards-DU8eWbXE.js +0 -540
  57. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BkqBjEFm.js +0 -1130
  58. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-l6KmXVBZ.js +0 -7007
  59. package/dist/Tier-4k8SxKtl.js +0 -969
  60. package/dist/Title-B9lWQ_jl.js +0 -566
  61. package/dist/Transaction-C38Yd0tf.js +0 -39
  62. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-D6tgpKpc.js +0 -130
  63. package/dist/Voucher-BQbqC7RV.js +0 -421
  64. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-erwpbvYi.js +0 -421
  65. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-Dt05b7fU.js +0 -56
  66. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  67. package/dist/app-BTm9mz0r.js +0 -59940
  68. package/dist/app-wDQR6dpb.js +0 -39
  69. package/dist/app.js +0 -7
  70. package/dist/business-B7GwHLce.js +0 -82
  71. package/dist/campaign-BCdKDHgz.js +0 -277
  72. package/dist/campaign-CpzFl8Vr.js +0 -4
  73. package/dist/campaign-DWlsbsKQ.js +0 -219
  74. package/dist/campaign.enum-BgK4maXz.js +0 -26
  75. package/dist/campaign.fn-DxnwGCB2.js +0 -776
  76. package/dist/collectible.enum-CdOSUDwG.js +0 -19
  77. package/dist/duplicateCampaign-BSHe0P-g.js +0 -51
  78. package/dist/effect-C7wkN_13.js +0 -89
  79. package/dist/email-addresses-DJycNI7L.js +0 -705
  80. package/dist/export-uIHWDxuh.js +0 -97
  81. package/dist/feedme.ico +0 -0
  82. package/dist/google-BQK68wbe.js +0 -5
  83. package/dist/helper-czpAhAIw.js +0 -86
  84. package/dist/index-5Sa4xS2m.js +0 -151
  85. package/dist/index-5WGEWCcI.js +0 -3
  86. package/dist/index-B2C7kc4z.js +0 -31
  87. package/dist/index-B5eb6_bi.js +0 -3678
  88. package/dist/index-B7nE1Pb2.js +0 -67
  89. package/dist/index-BFAHLexA.js +0 -32
  90. package/dist/index-BanxlNli.js +0 -8910
  91. package/dist/index-ByHoFriu.js +0 -85
  92. package/dist/index-Ca2bBJuR.js +0 -54
  93. package/dist/index-CuvNtC_M.js +0 -61
  94. package/dist/index-D-kYrDAi.js +0 -30289
  95. package/dist/index-D2gAYMIp.js +0 -28900
  96. package/dist/index-DWxmK2NJ.js +0 -61
  97. package/dist/index-U_rwkNKU.js +0 -2819
  98. package/dist/index-knizSLfz.js +0 -1157
  99. package/dist/index-vh86FiIQ.js +0 -10
  100. package/dist/index.esm2017-DFVkiPjd.js +0 -3069
  101. package/dist/loading-B3OgwEC8.js +0 -72
  102. package/dist/lodash-CiRTkvui.js +0 -3678
  103. package/dist/membership-s2VKnu_8.js +0 -255
  104. package/dist/moment-D7p2TMB-.js +0 -2583
  105. package/dist/money-DqxOXYd0.js +0 -15
  106. package/dist/number-Bt4sacaM.js +0 -12
  107. package/dist/object-BYyQ0PZp.js +0 -18
  108. package/dist/objectId-dwaoBfJX.js +0 -7
  109. package/dist/objectid-CxCupSWP.js +0 -145
  110. package/dist/plugins-CQ1JAqJB.js +0 -1788
  111. package/dist/reward-pjbal-XX.js +0 -36
  112. package/dist/rule-CzU2GAur.js +0 -1969
  113. package/dist/string-Gcy5IM_H.js +0 -32
  114. package/dist/style.css +0 -4
  115. package/dist/template-7yiMSL1f.js +0 -188
  116. package/dist/tier-BJDhpH6X.js +0 -4
  117. package/dist/tiers/tier=1.png +0 -0
  118. package/dist/tiers/tier=2.png +0 -0
  119. package/dist/tiers/tier=3.png +0 -0
  120. package/dist/tiers/tier=4.png +0 -0
  121. package/dist/titles/type=diamond.png +0 -0
  122. package/dist/titles/type=drinks.png +0 -0
  123. package/dist/titles/type=food.png +0 -0
  124. package/dist/titles/type=heart.png +0 -0
  125. package/dist/titles/type=medal.png +0 -0
  126. package/dist/titles/type=spend.png +0 -0
  127. package/dist/titles/type=thank-you.png +0 -0
  128. package/dist/titles/type=thumbs-up.png +0 -0
  129. package/dist/titles/type=years.png +0 -0
  130. package/dist/trigger-C5bqlYHn.js +0 -213
  131. package/dist/tslib.es6-BCqqvLQ_.js +0 -44
  132. package/dist/type_drinks-D6jnpvwV.js +0 -4
  133. package/dist/useMarketingMaterialActions-CW_QRtQb.js +0 -107
  134. package/dist/usePagination-D2pke4vy.js +0 -220
  135. package/dist/user-BcXrT_t5.js +0 -55
  136. package/dist/vue-i18n-CFNkj6JK.js +0 -2365
  137. package/dist/xlsx-DyVY5_Qx.js +0 -15491
  138. package/dist/zod-BD_8DRqQ.js +0 -91
@@ -1,540 +0,0 @@
1
- import { defineComponent as Z, ref as A, computed as q, onMounted as z, resolveComponent as F, openBlock as y, createBlock as E, unref as e, isRef as ee, withCtx as V, createElementVNode as s, createVNode as c, createElementBlock as D, createTextVNode as te, resolveDynamicComponent as N, toDisplayString as H, Fragment as W, createCommentVNode as P, h as C } from "vue";
2
- import { _ as oe } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as J, components as $ } from "@feedmepos/ui-library";
4
- import "./index-5WGEWCcI.js";
5
- import { u as ae } from "./loading-B3OgwEC8.js";
6
- import { C as Q, u as ne } from "./membership-s2VKnu_8.js";
7
- import { p as B, f as K } from "./plugins-CQ1JAqJB.js";
8
- import { useCoreStore as X } from "@feedmepos/mf-common";
9
- import { u as se } from "./vue-i18n-CFNkj6JK.js";
10
- import { F as ie } from "./index-BanxlNli.js";
11
- import { c as re } from "./object-BYyQ0PZp.js";
12
- import { u as Y } from "./app-wDQR6dpb.js";
13
- import { u as le } from "./business-B7GwHLce.js";
14
- import { Z as h } from "./zod-BD_8DRqQ.js";
15
- import { _ as de } from "./ZodTextField.vue_vue_type_script_setup_true_lang-Dt05b7fU.js";
16
- import { _ as ce } from "./ImageInput.vue_vue_type_script_setup_true_lang-BBYekrJp.js";
17
- import { _ as me } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-l6KmXVBZ.js";
18
- import { _ as pe, a as ue } from "./EffectSheet.vue_vue_type_style_index_0_lang-CZLoCJM4.js";
19
- import { i as fe, F as ye, h as j, t as we } from "./helper-czpAhAIw.js";
20
- import { useRouter as ge } from "vue-router";
21
- import { m as G } from "./index-5Sa4xS2m.js";
22
- import { R as L } from "./app-BTm9mz0r.js";
23
- function ve(w) {
24
- return !!(w != null && w.isAdmin) || !!(w != null && w.isStaff);
25
- }
26
- const be = {
27
- key: 0,
28
- class: "flex flex-col space-y-16 pr-12"
29
- }, Re = { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, _e = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary flex items-center justify-between" }, xe = { class: "flex items-center gap-8" }, Ce = /* @__PURE__ */ Z({
30
- __name: "EditRewardSheet",
31
- emits: ["update"],
32
- setup(w, { expose: i, emit: k }) {
33
- const U = k, u = le(), l = X(), g = A(!1), n = A(), S = A(), O = A(!1), v = ie, b = q(
34
- () => {
35
- var d;
36
- return Q[((d = n.value) == null ? void 0 : d.type) || "VOUCHER"];
37
- }
38
- ), R = q(() => {
39
- const d = v.safeParse(n.value);
40
- return d.success ? [] : d.error.errors;
41
- });
42
- function M() {
43
- const d = v.safeParse(n.value);
44
- if (d.success) {
45
- const a = { ...d.data };
46
- O.value && (a.capabilities = ye), U("update", a);
47
- }
48
- }
49
- function I(d, a, T = {
50
- isStoreReward: !1,
51
- type: "VOUCHER"
52
- }) {
53
- g.value = d, d && (S.value = void 0, O.value = T.isFeedvibe ?? !1, n.value = a || fe(T.type, {
54
- business: l.currentBusiness.value._id,
55
- noCampaign: T.isStoreReward == !0
56
- }));
57
- }
58
- return z(async () => {
59
- await u.readLocations();
60
- }), i({
61
- showSheet: I,
62
- data: n,
63
- rewardImage: S
64
- }), (d, a) => {
65
- const T = F("FmTextarea"), t = F("FmHelperText"), o = F("FmButton"), m = F("FmSideSheet");
66
- return y(), E(m, {
67
- "max-width": 560,
68
- modelValue: e(g),
69
- "onUpdate:modelValue": a[7] || (a[7] = (p) => ee(g) ? g.value = p : null),
70
- header: "Store setting"
71
- }, {
72
- "side-sheet-footer": V(() => [
73
- s("div", xe, [
74
- c(o, {
75
- label: "Submit",
76
- onClick: M,
77
- disabled: e(R).length > 0 || e(Y)().isLoading,
78
- loading: e(Y)().isLoading
79
- }, null, 8, ["disabled", "loading"]),
80
- c(o, {
81
- label: "Cancel",
82
- onClick: a[6] || (a[6] = (p) => I(!1)),
83
- variant: "tertiary"
84
- })
85
- ])
86
- ]),
87
- default: V(() => {
88
- var p, _, x;
89
- return [
90
- e(n) ? (y(), D("div", be, [
91
- s("div", Re, [
92
- a[8] || (a[8] = te(" Reward information ", -1)),
93
- (y(), E(N(e(b).chip())))
94
- ]),
95
- c(de, {
96
- modelValue: e(n).name,
97
- "onUpdate:modelValue": a[0] || (a[0] = (r) => e(n).name = r),
98
- label: `${e(b).name} name`,
99
- schema: e(h).typeAtPath(e(v), "name", [e(n).type])
100
- }, null, 8, ["modelValue", "label", "schema"]),
101
- c(T, {
102
- class: "!mb-[-16px]",
103
- modelValue: e(n).description,
104
- "onUpdate:modelValue": a[1] || (a[1] = (r) => e(n).description = r),
105
- rules: [e(h).ruleAtPath(e(v), "description", [e(n).type])]
106
- }, {
107
- label: V(() => [
108
- (y(), E(N(
109
- e(h).toInputLabel(
110
- e(h).typeAtPath(e(v), "description", [e(n).type]),
111
- `${e(b).name} description`
112
- )
113
- )))
114
- ]),
115
- _: 1
116
- }, 8, ["modelValue", "rules"]),
117
- s("div", _e, [
118
- s("div", null, H(e(b).name) + " description should not exceed 200 characters. ", 1),
119
- s("div", null, H(((p = e(n).description) == null ? void 0 : p.length) ?? 0) + "/200", 1)
120
- ]),
121
- c(ce, {
122
- class: "w-1/2 xs:w-2/3",
123
- "aspect-ratio": "16/9",
124
- file: e(S) ?? void 0,
125
- thumbnail: e(n).image ?? void 0,
126
- "onUpdate:file": a[2] || (a[2] = async (r) => {
127
- S.value = r, r || (e(n).image = null);
128
- })
129
- }, {
130
- label: V(() => [
131
- (y(), E(N(
132
- e(h).toInputLabel(
133
- e(h).typeAtPath(e(v), "image", [e(n).type]),
134
- `${e(b).name} image`
135
- )
136
- )))
137
- ]),
138
- _: 1
139
- }, 8, ["file", "thumbnail"]),
140
- e(n).type === "VOUCHER" ? (y(), D(W, { key: 0 }, [
141
- a[9] || (a[9] = s("div", { class: "fm-typo-en-title-sm-800" }, "Discount", -1)),
142
- c(pe, {
143
- "model-value": e(n).extras.effect,
144
- "onUpdate:modelValue": a[3] || (a[3] = (r) => {
145
- e(n).extras.effect = r;
146
- })
147
- }, null, 8, ["model-value"]),
148
- e(n).extras.effect == null ? (y(), E(t, {
149
- key: 0,
150
- class: "!mt-8",
151
- text: "Effect is required",
152
- state: "error"
153
- })) : P("", !0),
154
- a[10] || (a[10] = s("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, " Usage configuration ", -1)),
155
- c(ue, {
156
- "model-value": e(n).options,
157
- "no-campaign": e(n).noCampaign,
158
- "onUpdate:modelValue": a[4] || (a[4] = (r) => e(n).options = r),
159
- schema: e(h).typeAtPath(e(v), "options", ["VOUCHER"])
160
- }, null, 8, ["model-value", "no-campaign", "schema"])
161
- ], 64)) : P("", !0),
162
- a[11] || (a[11] = s("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Availability", -1)),
163
- e(n).type === "VOUCHER" ? (y(), E(me, {
164
- key: 1,
165
- "model-value": ((x = (_ = e(n).extras) == null ? void 0 : _.targetLocation) == null ? void 0 : x.map(String)) ?? null,
166
- type: "select",
167
- "onUpdate:modelValue": a[5] || (a[5] = (r) => {
168
- e(n).extras.targetLocation = r;
169
- }),
170
- rules: [
171
- e(h).ruleAtPath(e(v), "extras.targetLocation", ["VOUCHER"])
172
- ]
173
- }, null, 8, ["model-value", "rules"])) : P("", !0)
174
- ])) : P("", !0)
175
- ];
176
- }),
177
- _: 1
178
- }, 8, ["modelValue"]);
179
- };
180
- }
181
- }), Fe = { class: "flex flex-nowrap gap-x-2 grow h-full" }, Se = { class: "flex flex-col grow p-24" }, he = { class: "grow pb-16 pr-16 pt-6 w-full" }, Ee = { class: "gap-24 grid grid-cols-1 lg:grid-cols-2" }, Ve = /* @__PURE__ */ Z({
182
- __name: "RewardTypeDialog",
183
- props: {
184
- onOk: {
185
- type: Function,
186
- required: !0
187
- }
188
- },
189
- setup(w) {
190
- const i = J(), k = w;
191
- function U(u) {
192
- k.onOk(u), i.close();
193
- }
194
- return (u, l) => {
195
- const g = F("FmCard");
196
- return y(), E(g, { class: "max-w-6xl" }, {
197
- default: V(() => [
198
- s("div", Fe, [
199
- s("div", Se, [
200
- l[4] || (l[4] = s("div", { class: "space-y-4" }, [
201
- s("div", { class: "fm-typo-en-title-sm-800" }, "Store rewards"),
202
- s("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, " Select a reward type to get started. ")
203
- ], -1)),
204
- s("div", he, [
205
- s("div", Ee, [
206
- c(g, {
207
- variant: "outlined",
208
- class: "box-border cursor-pointer h-full p-16 scroll-p-4 space-y-8",
209
- onClick: l[0] || (l[0] = (n) => U("general"))
210
- }, {
211
- default: V(() => [...l[2] || (l[2] = [
212
- s("div", { class: "fm-typo-en-title-sm-800" }, "General Reward", -1),
213
- s("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " A standard voucher reward that can be freely edited and managed. ", -1)
214
- ])]),
215
- _: 1
216
- }),
217
- c(g, {
218
- variant: "outlined",
219
- class: "box-border cursor-pointer h-full p-16 scroll-p-4 space-y-8",
220
- onClick: l[1] || (l[1] = (n) => U("feedvibe"))
221
- }, {
222
- default: V(() => [...l[3] || (l[3] = [
223
- s("div", { class: "fm-typo-en-title-sm-800" }, "FeedVibe Reward", -1),
224
- s("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " A locked reward for FeedVibe bundles. Cannot be edited or deleted after creation. ", -1)
225
- ])]),
226
- _: 1
227
- })
228
- ])
229
- ])
230
- ])
231
- ])
232
- ]),
233
- _: 1
234
- });
235
- };
236
- }
237
- }), Oe = { class: "px-24 flex flex-col gap-y-16" }, Te = { class: "flex items-center justify-between w-full" }, ke = { class: "flex flex-col gap-16 text-center" }, Ue = { class: "fm-typo-en-title-sm-800" }, Ae = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ot = /* @__PURE__ */ Z({
238
- __name: "StoreRewards",
239
- setup(w) {
240
- const { t: i } = se(), k = J(), U = {
241
- label: i("connect.storeRewards.create"),
242
- value: "create",
243
- isPrimary: !0,
244
- prependIcon: "add"
245
- }, u = ne(), l = X(), { global: g, minor: n } = ae, S = ge(), O = A({
246
- searchKey: "",
247
- columnFilters: []
248
- }), v = [
249
- {
250
- header: i("connect.storeRewards.table.name"),
251
- accessorFn: (t) => t.name,
252
- cell(t) {
253
- const o = t.row.original, m = j(
254
- o.capabilities,
255
- "STORE_BUNDLE:FEEDVIBE",
256
- "selectable",
257
- !1
258
- );
259
- return C("div", { class: "flex items-center gap-8" }, [
260
- C("span", {}, o.name),
261
- ...m ? [
262
- C($.FmChip, {
263
- label: "Feedvibe",
264
- class: "text-fm-color-primary bg-fm-color-system-warning-100",
265
- compact: !0
266
- })
267
- ] : []
268
- ]);
269
- }
270
- },
271
- {
272
- id: "type",
273
- header: i("connect.storeRewards.table.type"),
274
- accessorFn: (t) => t.type,
275
- cell(t) {
276
- return Q[t.row.original.type].chip();
277
- }
278
- },
279
- {
280
- header: i("connect.storeRewards.table.validity"),
281
- accessorFn: (t) => we(
282
- "validityOption" in t.options ? t.options.validityOption || {} : {}
283
- )
284
- },
285
- {
286
- header: i("connect.storeRewards.table.used"),
287
- meta: {
288
- textAlign: "left"
289
- },
290
- accessorFn: (t) => t.currentReceive ?? 0
291
- },
292
- {
293
- header: i("connect.storeRewards.table.actions"),
294
- cell(t) {
295
- return C("div", { class: "flex items-center justify-end gap-4" }, [
296
- C(
297
- $.FmMenu,
298
- {
299
- placement: "bottom-end",
300
- onClick: (o) => {
301
- o.stopPropagation();
302
- }
303
- },
304
- {
305
- "menu-button": () => C($.FmButton, {
306
- icon: "more_vert",
307
- iconColor: "neutral-gray-400",
308
- variant: "tertiary"
309
- }),
310
- default: () => [
311
- C($.FmMenuItem, {
312
- label: "View collections",
313
- onClick: async (o) => {
314
- o.stopPropagation(), M(t.row.original._id);
315
- }
316
- }),
317
- ...j(
318
- t.row.original.capabilities,
319
- "STORE_BUNDLE:FEEDVIBE",
320
- "deletable"
321
- ) ? [
322
- C(
323
- $.FmMenuItem,
324
- {
325
- onClick: async (o) => {
326
- o.stopPropagation(), I(t.row.original);
327
- }
328
- },
329
- {
330
- label: C(
331
- "div",
332
- {
333
- class: "text-fm-color-typo-error fm-typo-en-body-md-400"
334
- },
335
- "Remove"
336
- )
337
- }
338
- )
339
- ] : []
340
- ]
341
- }
342
- )
343
- ]);
344
- }
345
- }
346
- ], b = q(
347
- () => u.bundleRewards.filter((t) => t.type == "VOUCHER")
348
- ), R = A();
349
- function M(t) {
350
- S.push({
351
- name: L["$connect-STORE_REWARD_COLLECTIONS"],
352
- params: { id: t }
353
- });
354
- }
355
- async function I(t) {
356
- if (t.type === "TITLE") {
357
- await B.confirm(
358
- i("connect.storeRewards.remove.message"),
359
- i("connect.storeRewards.remove.title"),
360
- i("connect.storeRewards.remove.action")
361
- ) && await S.push({ name: L["$connect-PROGRAM_TITLE"] });
362
- return;
363
- }
364
- await B.remove(
365
- i("connect.storeRewards.delete.confirm"),
366
- i("connect.storeRewards.delete.title")
367
- ) && await n(
368
- async () => {
369
- await G.deleteReward(t._id), await u.readMembership(), await u.readRewards();
370
- },
371
- {
372
- message: i("connect.storeRewards.delete.message"),
373
- successMessage: i("connect.storeRewards.delete.success")
374
- }
375
- );
376
- }
377
- function d() {
378
- return new Promise((t) => {
379
- k.open({
380
- title: "Create reward",
381
- dialogComponent: C(Ve, {
382
- onOk: (o) => {
383
- t(o);
384
- }
385
- })
386
- }).onClose(() => {
387
- t(null);
388
- });
389
- });
390
- }
391
- async function a(t) {
392
- var _, x, r;
393
- const o = t ? re(u.bundleRewards.find((f) => f._id === t)) : void 0, m = ve((_ = l.sessionUser.value) == null ? void 0 : _.role), p = !!o && !j(
394
- o.capabilities,
395
- "STORE_BUNDLE:FEEDVIBE",
396
- "editable"
397
- );
398
- if (p && !m) {
399
- await B.confirm(
400
- "This reward is managed by FeedVibe and cannot be edited.",
401
- "Cannot edit reward",
402
- "OK"
403
- );
404
- return;
405
- }
406
- if ((o == null ? void 0 : o.type) === "TITLE") {
407
- await B.confirm(
408
- "You cannot edit a title here, please edit it at the Program > Title section.",
409
- "Update reward",
410
- "Go to title section"
411
- ) && await S.push({ name: L["$connect-PROGRAM_TITLE"] });
412
- return;
413
- }
414
- if (!o) {
415
- const f = await d();
416
- if (!f) return;
417
- (x = R.value) == null || x.showSheet(!0, void 0, {
418
- isStoreReward: !0,
419
- type: "VOUCHER",
420
- isFeedvibe: f === "feedvibe"
421
- });
422
- return;
423
- }
424
- (r = R.value) == null || r.showSheet(!0, o, {
425
- isStoreReward: !0,
426
- type: "VOUCHER",
427
- // Preserve the FeedVibe lock when an admin edits a locked reward.
428
- isFeedvibe: p
429
- });
430
- }
431
- async function T(t) {
432
- let o = !1;
433
- t._id && t.type === "VOUCHER" && await new Promise((m) => {
434
- k.open({
435
- title: "Confirmation",
436
- message: i("connect.campaign.voucher.updateConfirm.message"),
437
- primaryActions: {
438
- text: i("connect.campaign.voucher.updateConfirm.updateAll"),
439
- close: !0
440
- },
441
- secondaryActions: {
442
- text: i("connect.campaign.voucher.updateConfirm.updateFuture"),
443
- close: !0
444
- }
445
- }).onPrimary(async () => {
446
- o = !0, m();
447
- }).onSecondary(async () => {
448
- m();
449
- });
450
- }), await n(
451
- async () => {
452
- var m, p, _, x;
453
- (m = R.value) != null && m.rewardImage && t.image ? await K.delete(t.image) : (p = R.value) != null && p.rewardImage && (t.image = await K.update(
454
- t.image || K.collectibleImagePath(
455
- void 0,
456
- R.value.rewardImage
457
- ),
458
- (_ = R.value) == null ? void 0 : _.rewardImage
459
- )), t._id ? await G.updateReward(t._id, {
460
- ...t,
461
- updateCollection: o
462
- }) : await G.createReward(t), await u.readRewards(), (x = R.value) == null || x.showSheet(!1);
463
- },
464
- {
465
- message: "Updating reward",
466
- successMessage: "Reward updated successfully"
467
- }
468
- );
469
- }
470
- return z(async () => {
471
- await g(async () => {
472
- await u.readMembership(), await u.readRewards();
473
- });
474
- }), (t, o) => {
475
- const m = F("FmPageHead"), p = F("FmSearch"), _ = F("FmTable"), x = F("FmButton"), r = F("FmCard");
476
- return y(), D(W, null, [
477
- c(m, {
478
- title: e(i)("connect.storeRewards.title"),
479
- description: e(i)("connect.storeRewards.description"),
480
- actions: [U],
481
- "back-button": !0,
482
- "onClick:action": o[0] || (o[0] = () => a()),
483
- "onClick:back": o[1] || (o[1] = () => e(S).push({ name: e(L)["$connect-STORE"] }))
484
- }, null, 8, ["title", "description", "actions"]),
485
- s("div", Oe, [
486
- e(b) && e(b).length > 0 ? (y(), D(W, { key: 0 }, [
487
- s("div", Te, [
488
- o[6] || (o[6] = s("div", { class: "flex gap-8" }, null, -1)),
489
- c(p, {
490
- modelValue: e(O).searchKey,
491
- "onUpdate:modelValue": o[2] || (o[2] = (f) => e(O).searchKey = f),
492
- class: "",
493
- placeholder: "search",
494
- collapsible: ""
495
- }, null, 8, ["modelValue"])
496
- ]),
497
- c(_, {
498
- "row-data": e(b),
499
- "column-defs": v,
500
- "search-value": e(O).searchKey,
501
- "column-filter": e(O).columnFilters,
502
- onRowClick: o[3] || (o[3] = (f) => a(f.original._id)),
503
- "hide-footer": e(b).length < 10
504
- }, null, 8, ["row-data", "search-value", "column-filter", "hide-footer"])
505
- ], 64)) : (y(), E(r, {
506
- key: 1,
507
- variant: "outlined",
508
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
509
- }, {
510
- default: V(() => [
511
- o[7] || (o[7] = s("img", {
512
- src: oe,
513
- class: "aspect-square w-[150px]"
514
- }, null, -1)),
515
- s("div", ke, [
516
- s("div", Ue, H(e(i)("connect.storeRewards.empty.title")), 1),
517
- s("div", Ae, H(e(i)("connect.storeRewards.empty.description")), 1)
518
- ]),
519
- c(x, {
520
- variant: "primary",
521
- label: e(i)("connect.storeRewards.empty.action"),
522
- onClick: o[4] || (o[4] = (f) => a()),
523
- icon: "add"
524
- }, null, 8, ["label"])
525
- ]),
526
- _: 1
527
- })),
528
- c(Ce, {
529
- ref_key: "rewardSheetRef",
530
- ref: R,
531
- onUpdate: o[5] || (o[5] = (f) => T(f))
532
- }, null, 512)
533
- ])
534
- ], 64);
535
- };
536
- }
537
- });
538
- export {
539
- ot as default
540
- };