@feedmepos/mf-connect 0.1.0-beta.67 → 0.1.0-beta.69

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 (89) hide show
  1. package/dist/{Analytic-knY-Fody.js → Analytic-CtKDttAH.js} +11 -11
  2. package/dist/{App-CaSjMnkY.js → App-hcK_F34g.js} +6 -6
  3. package/dist/{AuditLogs-DyJ0BWHt.js → AuditLogs-wrDkryzX.js} +8 -8
  4. package/dist/{Bin-D73Ky2O3.js → Bin-BYtj7ugN.js} +8 -8
  5. package/dist/{Broadcast-BRMyf2ZA.js → Broadcast-PzcoY_Mc.js} +9 -9
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D-0I_Pp2.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B8ikl5H3.js} +6 -6
  7. package/dist/{Card-BEgNn8SY.js → Card-jryLr70q.js} +15 -15
  8. package/dist/{Collections-C0KqBg5k.js → Collections-DUngeBBi.js} +5 -5
  9. package/dist/{Credit-D3Y1U0-i.js → Credit-DhAWh3lu.js} +9 -9
  10. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-BJ7AzlQk.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BY3LPgbL.js} +28 -28
  11. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-C9JgRiyA.js → EffectSheet.vue_vue_type_style_index_0_lang-DNKg3RSm.js} +6 -6
  12. package/dist/{Experience-B0LMRyXY.js → Experience-DAnT8SPU.js} +9 -9
  13. package/dist/{Game-Bz0eGUGe.js → Game-Q2mBNol1.js} +10 -10
  14. package/dist/{Index-DV7FO6TN.js → Index-CZEdZWQ8.js} +10 -10
  15. package/dist/{Marketing-xdKdn8qo.js → Marketing-3P8e8Sle.js} +6 -6
  16. package/dist/Member-Cs0-TJUl.js +331 -0
  17. package/dist/{MemberList-D1OLQAcR.js → MemberList-HGEJqYTS.js} +24 -24
  18. package/dist/{MemberTransactions-DO59eyLa.js → MemberTransactions-BEpqGzz9.js} +1 -1
  19. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-bBjpPoOo.js → MessageInput.vue_vue_type_script_setup_true_lang-HqQuEPdJ.js} +2 -2
  20. package/dist/{Mission-CZvAG4ev.js → Mission-z54HJs8G.js} +10 -10
  21. package/dist/{Overview-DMCKeCar.js → Overview-voUs4Xz3.js} +17 -17
  22. package/dist/{Point-BMyDzFyO.js → Point-BanLyZXZ.js} +9 -9
  23. package/dist/{Promotion-D1nOUTxD.js → Promotion-DjNWj4Y9.js} +10 -10
  24. package/dist/{Queue-CGl0yzB4.js → Queue-BJMq-grO.js} +9 -9
  25. package/dist/{Record-BGmigp0Z.js → Record-rzCSXT-0.js} +7 -7
  26. package/dist/{Reward-ZYXuU6-e.js → Reward-pd2SMm4n.js} +15 -15
  27. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-C02Mj9a0.js → RewardGroup.vue_vue_type_script_setup_true_lang-DjGG_zBM.js} +11 -11
  28. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DGS3_lis.js → RuleGroup.vue_vue_type_script_setup_true_lang-D5ED_y1Y.js} +12 -12
  29. package/dist/{Segment-BXxgrHVs.js → Segment-VNRLyu1n.js} +14 -14
  30. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-CSVXVt5K.js → SelectItems.vue_vue_type_script_setup_true_lang-DoLM2Ixg.js} +2 -2
  31. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-D9dpqYTQ.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-B6EVC8zl.js} +11 -11
  32. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-CM9312dS.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-DAtUBP_u.js} +3 -3
  33. package/dist/{Setting-B3HficZP.js → Setting-Bi5SqhFh.js} +10 -10
  34. package/dist/{Store-CWhmG8qW.js → Store-DYqMkBya.js} +145 -143
  35. package/dist/StoreRewards-DDh6tFnw.js +423 -0
  36. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-CTUT_564.js → StoreTransactions.vue_vue_type_script_setup_true_lang-CdMTtNRL.js} +18 -18
  37. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-B059fdPj.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DlVqo7IB.js} +1 -1
  38. package/dist/{Tier-qm79T_vU.js → Tier-Df6ZUXoc.js} +20 -20
  39. package/dist/{Title-DOWrRYW8.js → Title-B6UYeR3i.js} +79 -79
  40. package/dist/{Transaction-DW7bUI7j.js → Transaction-ClKP1eCm.js} +2 -2
  41. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-38On7ek-.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-fCayOH18.js} +6 -6
  42. package/dist/{Voucher-BJBXjxZV.js → Voucher-C-YVNYtU.js} +12 -12
  43. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DzdxjFhD.js → VoucherEditor.vue_vue_type_script_setup_true_lang-VVCGaHcx.js} +10 -10
  44. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-CJ_O28uk.js → ZodTextField.vue_vue_type_script_setup_true_lang-CqUp3I7R.js} +1 -1
  45. package/dist/{app-CHUmGvDF.js → app-BN1ZrLvU.js} +31 -31
  46. package/dist/{app-BLFTLZqS.js → app-Bt-dyEJF.js} +1 -1
  47. package/dist/app.js +1 -1
  48. package/dist/{business-Dl7vGxa1.js → business-CL91Ywkh.js} +1 -1
  49. package/dist/{campaign-DMIBFpmQ.js → campaign-B6iMYgPr.js} +9 -9
  50. package/dist/{campaign-XH_j4bGc.js → campaign-CQ3ZQixl.js} +2 -2
  51. package/dist/{campaign.enum-UniuuBvU.js → campaign.enum-CbdP5Zm4.js} +1 -1
  52. package/dist/{campaign.fn-CDC2Cia7.js → campaign.fn-OYYpBTQB.js} +139 -139
  53. package/dist/{collectible.enum-Dx_pgMB9.js → collectible.enum-D6T0m8zD.js} +1 -1
  54. package/dist/{collection.fn-D0nutrYu.js → collection.fn-E--2GvHD.js} +2 -2
  55. package/dist/{dto-BAPti0UX.js → dto-CKTbMtRC.js} +4 -4
  56. package/dist/{effect-By6CZhli.js → effect-Bk2L2HPg.js} +1 -1
  57. package/dist/{email-addresses-DPBu_l0s.js → email-addresses-r7t2A2tP.js} +1 -1
  58. package/dist/{export-C6IKCW8q.js → export-CmFgMuUR.js} +3 -3
  59. package/dist/{helper-KCTyvhjf.js → helper-vj5pZDpi.js} +1 -1
  60. package/dist/{index-BVcdkWyy.js → index-BLy86IYC.js} +3 -3
  61. package/dist/{index-DQxldvxq.js → index-BjRIP-Nf.js} +4 -4
  62. package/dist/{index-_Fw2-H-c.js → index-BlfYTvc8.js} +1 -1
  63. package/dist/{index-DxT_ZaWI.js → index-CXgzEful.js} +6 -6
  64. package/dist/{index-DDCO8cDG.js → index-C_lJF24R.js} +21 -16
  65. package/dist/{index-C-HL3cGP.js → index-CoNW9g8f.js} +1 -1
  66. package/dist/{index-VPs9NXB7.js → index-DIVlPQs7.js} +3 -3
  67. package/dist/{index-Sw_FxWmd.js → index-DZmeZIfy.js} +1 -1
  68. package/dist/{index-D8dh7Th8.js → index-DifkHZQf.js} +1 -1
  69. package/dist/{index-BHB9VPNm.js → index-ciFWj5wK.js} +1 -1
  70. package/dist/{index-e0vKYT8t.js → index-q4jjAzh7.js} +1 -1
  71. package/dist/{index-C9bN_nRJ.js → index-rqMNeQeS.js} +1 -1
  72. package/dist/{index.esm2017-CiHGwLIY.js → index.esm2017-Btke1H-0.js} +1 -1
  73. package/dist/{loading-CmczlXAc.js → loading-CljWGxj2.js} +1 -1
  74. package/dist/{membership-D-uWTsu-.js → membership-DW8fhsPU.js} +3 -3
  75. package/dist/{money-BhXbOy-4.js → money-CmLENFDU.js} +1 -1
  76. package/dist/{number-CT16ZbSb.js → number-D52xOK1O.js} +1 -1
  77. package/dist/{objectid-BGQHcha_.js → objectid-6vZuUhBs.js} +5 -5
  78. package/dist/{plugins-uP-mKUTQ.js → plugins-VQvfB0aC.js} +4 -4
  79. package/dist/{reward-D7tB215Q.js → reward-0mjbr3P3.js} +1 -1
  80. package/dist/{rule-LLXbjCSc.js → rule-B1CCR_k_.js} +3 -3
  81. package/dist/{rule-builder-yxSBBeW6.js → rule-builder-QA20EFeh.js} +1 -1
  82. package/dist/{template-BRXG9AbZ.js → template-DUSSMzTJ.js} +4 -4
  83. package/dist/{trigger-BQTtyAtM.js → trigger-rXCb0cno.js} +4 -4
  84. package/dist/{user-BzRp43jn.js → user-DsR11JGx.js} +1 -1
  85. package/dist/{vue-i18n-7zGNsm-H.js → vue-i18n-DuUlTtHn.js} +357 -357
  86. package/dist/{xlsx-mkBvYNNs.js → xlsx-DcXLCX66.js} +1 -1
  87. package/package.json +1 -1
  88. package/dist/Member-CGDUgKb7.js +0 -317
  89. package/dist/StoreRewards-6Cjh9q4d.js +0 -402
@@ -1,402 +0,0 @@
1
- import { defineComponent as G, ref as F, computed as j, onMounted as q, resolveComponent as g, openBlock as d, createBlock as b, unref as e, isRef as Y, withCtx as S, createElementVNode as s, createVNode as c, createElementBlock as O, createTextVNode as z, resolveDynamicComponent as M, toDisplayString as $, Fragment as D, createCommentVNode as U, h } from "vue";
2
- import { _ as J } from "./campaign-CpzFl8Vr.js";
3
- import { components as k } from "@feedmepos/ui-library";
4
- import "./index-_Fw2-H-c.js";
5
- import { u as Q } from "./loading-CmczlXAc.js";
6
- import { C as Z, u as X } from "./membership-D-uWTsu-.js";
7
- import { p as H, f as B } from "./plugins-uP-mKUTQ.js";
8
- import { u as ee } from "./vue-i18n-7zGNsm-H.js";
9
- import { F as te } from "./index-DDCO8cDG.js";
10
- import { c as oe } from "./object-qECH92oz.js";
11
- import { u as K } from "./app-wDQR6dpb.js";
12
- import { u as ae } from "./business-Dl7vGxa1.js";
13
- import { useCoreStore as ne } from "@feedmepos/mf-common";
14
- import { Z as v } from "./zod-Bg2FbC-D.js";
15
- import { _ as se } from "./ZodTextField.vue_vue_type_script_setup_true_lang-CJ_O28uk.js";
16
- import { _ as re } from "./ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js";
17
- import { _ as ie } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-B059fdPj.js";
18
- import { _ as le, a as me } from "./EffectSheet.vue_vue_type_style_index_0_lang-C9JgRiyA.js";
19
- import { i as ce, t as de } from "./helper-KCTyvhjf.js";
20
- import { useRouter as pe } from "vue-router";
21
- import { m as N } from "./index-C-HL3cGP.js";
22
- import { R as T } from "./app-CHUmGvDF.js";
23
- const ue = {
24
- key: 0,
25
- class: "flex flex-col space-y-16 pr-12"
26
- }, fe = { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, ye = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary flex items-center justify-between" }, we = { class: "flex items-center gap-8" }, ge = /* @__PURE__ */ G({
27
- __name: "EditRewardSheet",
28
- emits: ["update"],
29
- setup(W, { expose: n, emit: P }) {
30
- const u = P, I = ae(), V = ne(), f = F(!1), a = F(), _ = F(), i = te, l = j(
31
- () => {
32
- var r;
33
- return Z[((r = a.value) == null ? void 0 : r.type) || "VOUCHER"];
34
- }
35
- ), A = j(() => {
36
- const r = i.safeParse(a.value);
37
- return r.success ? [] : r.error.errors;
38
- });
39
- function L() {
40
- const r = i.safeParse(a.value);
41
- r.success && u("update", r.data);
42
- }
43
- function x(r, t, o = {
44
- isStoreReward: !1,
45
- type: "VOUCHER"
46
- }) {
47
- f.value = r, r && (_.value = void 0, a.value = t || ce(o.type, {
48
- business: V.currentBusiness.value._id,
49
- noCampaign: o.isStoreReward == !0
50
- }));
51
- }
52
- return q(async () => {
53
- await I.readLocations();
54
- }), n({
55
- showSheet: x,
56
- data: a,
57
- rewardImage: _
58
- }), (r, t) => {
59
- const o = g("FmTextarea"), y = g("FmHelperText"), p = g("FmButton"), C = g("FmSideSheet");
60
- return d(), b(C, {
61
- "max-width": 560,
62
- modelValue: e(f),
63
- "onUpdate:modelValue": t[7] || (t[7] = (R) => Y(f) ? f.value = R : null),
64
- header: "Store setting"
65
- }, {
66
- "side-sheet-footer": S(() => [
67
- s("div", we, [
68
- c(p, {
69
- label: "Submit",
70
- onClick: L,
71
- disabled: e(A).length > 0 || e(K)().isLoading,
72
- loading: e(K)().isLoading
73
- }, null, 8, ["disabled", "loading"]),
74
- c(p, {
75
- label: "Cancel",
76
- onClick: t[6] || (t[6] = (R) => x(!1)),
77
- variant: "tertiary"
78
- })
79
- ])
80
- ]),
81
- default: S(() => {
82
- var R, E, w;
83
- return [
84
- e(a) ? (d(), O("div", ue, [
85
- s("div", fe, [
86
- t[8] || (t[8] = z(" Reward information ")),
87
- (d(), b(M(e(l).chip())))
88
- ]),
89
- c(se, {
90
- modelValue: e(a).name,
91
- "onUpdate:modelValue": t[0] || (t[0] = (m) => e(a).name = m),
92
- label: `${e(l).name} name`,
93
- schema: e(v).typeAtPath(e(i), "name", [e(a).type])
94
- }, null, 8, ["modelValue", "label", "schema"]),
95
- c(o, {
96
- class: "!mb-[-16px]",
97
- modelValue: e(a).description,
98
- "onUpdate:modelValue": t[1] || (t[1] = (m) => e(a).description = m),
99
- rules: [e(v).ruleAtPath(e(i), "description", [e(a).type])]
100
- }, {
101
- label: S(() => [
102
- (d(), b(M(
103
- e(v).toInputLabel(
104
- e(v).typeAtPath(e(i), "description", [e(a).type]),
105
- `${e(l).name} description`
106
- )
107
- )))
108
- ]),
109
- _: 1
110
- }, 8, ["modelValue", "rules"]),
111
- s("div", ye, [
112
- s("div", null, $(e(l).name) + " description should not exceed 200 characters. ", 1),
113
- s("div", null, $(((R = e(a).description) == null ? void 0 : R.length) ?? 0) + "/200", 1)
114
- ]),
115
- c(re, {
116
- class: "w-1/2 xs:w-2/3",
117
- "aspect-ratio": "16/9",
118
- file: e(_) ?? void 0,
119
- thumbnail: e(a).image ?? void 0,
120
- "onUpdate:file": t[2] || (t[2] = async (m) => {
121
- _.value = m, m || (e(a).image = null);
122
- })
123
- }, {
124
- label: S(() => [
125
- (d(), b(M(
126
- e(v).toInputLabel(
127
- e(v).typeAtPath(e(i), "image", [e(a).type]),
128
- `${e(l).name} image`
129
- )
130
- )))
131
- ]),
132
- _: 1
133
- }, 8, ["file", "thumbnail"]),
134
- e(a).type === "VOUCHER" ? (d(), O(D, { key: 0 }, [
135
- t[9] || (t[9] = s("div", { class: "fm-typo-en-title-sm-800" }, "Discount", -1)),
136
- c(le, {
137
- "model-value": e(a).extras.effect,
138
- "onUpdate:modelValue": t[3] || (t[3] = (m) => {
139
- e(a).extras.effect = m;
140
- })
141
- }, null, 8, ["model-value"]),
142
- e(a).extras.effect == null ? (d(), b(y, {
143
- key: 0,
144
- class: "!mt-8",
145
- text: "Effect is required",
146
- state: "error"
147
- })) : U("", !0),
148
- t[10] || (t[10] = s("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, " Usage configuration ", -1)),
149
- c(me, {
150
- "model-value": e(a).options,
151
- "no-campaign": e(a).noCampaign,
152
- "onUpdate:modelValue": t[4] || (t[4] = (m) => e(a).options = m),
153
- schema: e(v).typeAtPath(e(i), "options", ["VOUCHER"])
154
- }, null, 8, ["model-value", "no-campaign", "schema"])
155
- ], 64)) : U("", !0),
156
- t[11] || (t[11] = s("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Availability", -1)),
157
- e(a).type === "VOUCHER" ? (d(), b(ie, {
158
- key: 1,
159
- "model-value": ((w = (E = e(a).extras) == null ? void 0 : E.targetLocation) == null ? void 0 : w.map(String)) ?? null,
160
- type: "select",
161
- "onUpdate:modelValue": t[5] || (t[5] = (m) => {
162
- e(a).extras.targetLocation = m;
163
- }),
164
- rules: [
165
- e(v).ruleAtPath(e(i), "extras.targetLocation", ["VOUCHER"])
166
- ]
167
- }, null, 8, ["model-value", "rules"])) : U("", !0)
168
- ])) : U("", !0)
169
- ];
170
- }),
171
- _: 1
172
- }, 8, ["modelValue"]);
173
- };
174
- }
175
- }), ve = { class: "px-24 flex flex-col gap-y-16" }, Re = { class: "flex items-center justify-between w-full" }, be = { class: "flex flex-col gap-16 text-center" }, _e = { class: "fm-typo-en-title-sm-800" }, xe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ge = /* @__PURE__ */ G({
176
- __name: "StoreRewards",
177
- setup(W) {
178
- const { t: n } = ee(), P = {
179
- label: n("connect.storeRewards.create"),
180
- value: "create",
181
- isPrimary: !0,
182
- prependIcon: "add"
183
- }, u = X(), { global: I, minor: V } = Q, f = pe(), a = F({
184
- searchKey: "",
185
- columnFilters: []
186
- }), _ = [
187
- {
188
- header: n("connect.storeRewards.table.name"),
189
- accessorFn: (t) => t.name
190
- },
191
- {
192
- id: "type",
193
- header: n("connect.storeRewards.table.type"),
194
- accessorFn: (t) => t.type,
195
- cell(t) {
196
- return Z[t.row.original.type].chip();
197
- }
198
- },
199
- {
200
- header: n("connect.storeRewards.table.validity"),
201
- accessorFn: (t) => de(
202
- "validityOption" in t.options ? t.options.validityOption || {} : {}
203
- )
204
- },
205
- {
206
- header: n("connect.storeRewards.table.used"),
207
- meta: {
208
- textAlign: "left"
209
- },
210
- accessorFn: (t) => t.currentReceive ?? 0
211
- },
212
- {
213
- header: n("connect.storeRewards.table.actions"),
214
- cell(t) {
215
- return h("div", { class: "flex items-center justify-end gap-4" }, [
216
- h(
217
- k.FmMenu,
218
- {
219
- placement: "bottom-end",
220
- onClick: (o) => {
221
- o.stopPropagation();
222
- }
223
- },
224
- {
225
- "menu-button": () => h(k.FmButton, {
226
- icon: "more_vert",
227
- iconColor: "neutral-gray-400",
228
- variant: "tertiary"
229
- }),
230
- default: () => [
231
- h(k.FmMenuItem, {
232
- label: "View collections",
233
- onClick: async (o) => {
234
- o.stopPropagation(), A(t.row.original._id);
235
- }
236
- }),
237
- // h(components.FmMenuItem, {
238
- // label: 'View transactions',
239
- // onClick: async (event: Event) => {
240
- // event.stopPropagation();
241
- // onViewTransactions(props.row.original._id as string);
242
- // },
243
- // }),
244
- h(
245
- k.FmMenuItem,
246
- {
247
- onClick: async (o) => {
248
- o.stopPropagation(), L(t.row.original);
249
- }
250
- },
251
- {
252
- label: h(
253
- "div",
254
- {
255
- class: "text-fm-color-typo-error fm-typo-en-body-md-400"
256
- },
257
- "Remove"
258
- )
259
- }
260
- )
261
- ]
262
- }
263
- )
264
- ]);
265
- }
266
- }
267
- ], i = j(
268
- () => u.bundleRewards.filter((t) => t.type == "VOUCHER")
269
- ), l = F();
270
- function A(t) {
271
- f.push({
272
- name: T["$connect-STORE_REWARD_COLLECTIONS"],
273
- params: { id: t }
274
- });
275
- }
276
- async function L(t) {
277
- if (t.type === "TITLE") {
278
- await H.confirm(
279
- n("connect.storeRewards.remove.message"),
280
- n("connect.storeRewards.remove.title"),
281
- n("connect.storeRewards.remove.action")
282
- ) && await f.push({ name: T["$connect-PROGRAM_TITLE"] });
283
- return;
284
- }
285
- await H.remove(
286
- n("connect.storeRewards.delete.confirm"),
287
- n("connect.storeRewards.delete.title")
288
- ) && await V(
289
- async () => {
290
- await N.deleteReward(t._id), await u.readMembership(), await u.readRewards();
291
- },
292
- {
293
- message: n("connect.storeRewards.delete.message"),
294
- successMessage: n("connect.storeRewards.delete.success")
295
- }
296
- );
297
- }
298
- async function x(t) {
299
- var y;
300
- const o = t ? oe(u.bundleRewards.find((p) => p._id === t)) : void 0;
301
- if ((o == null ? void 0 : o.type) === "TITLE") {
302
- await H.confirm(
303
- "You cannot edit a title here, please edit it at the Program > Title section.",
304
- "Update reward",
305
- "Go to title section"
306
- ) && await f.push({ name: T["$connect-PROGRAM_TITLE"] });
307
- return;
308
- }
309
- (y = l.value) == null || y.showSheet(!0, o, {
310
- isStoreReward: !0,
311
- type: "VOUCHER"
312
- });
313
- }
314
- async function r(t) {
315
- await V(
316
- async () => {
317
- var o, y, p, C;
318
- (o = l.value) != null && o.rewardImage && t.image ? await B.delete(t.image) : (y = l.value) != null && y.rewardImage && (t.image = await B.update(
319
- t.image || B.collectibleImagePath(
320
- void 0,
321
- l.value.rewardImage
322
- ),
323
- (p = l.value) == null ? void 0 : p.rewardImage
324
- )), t._id ? await N.updateReward(t._id, t) : await N.createReward(t), await u.readRewards(), (C = l.value) == null || C.showSheet(!1);
325
- },
326
- {
327
- message: "Updating reward",
328
- successMessage: "Reward updated successfully"
329
- }
330
- );
331
- }
332
- return q(async () => {
333
- await I(async () => {
334
- await u.readMembership(), await u.readRewards();
335
- });
336
- }), (t, o) => {
337
- const y = g("FmPageHead"), p = g("FmSearch"), C = g("FmTable"), R = g("FmButton"), E = g("FmCard");
338
- return d(), O(D, null, [
339
- c(y, {
340
- title: e(n)("connect.storeRewards.title"),
341
- description: e(n)("connect.storeRewards.description"),
342
- actions: [P],
343
- "back-button": !0,
344
- "onClick:action": o[0] || (o[0] = () => x()),
345
- "onClick:back": o[1] || (o[1] = () => e(f).push({ name: e(T)["$connect-STORE"] }))
346
- }, null, 8, ["title", "description", "actions"]),
347
- s("div", ve, [
348
- e(i) && e(i).length > 0 ? (d(), O(D, { key: 0 }, [
349
- s("div", Re, [
350
- o[6] || (o[6] = s("div", { class: "flex gap-8" }, null, -1)),
351
- c(p, {
352
- modelValue: e(a).searchKey,
353
- "onUpdate:modelValue": o[2] || (o[2] = (w) => e(a).searchKey = w),
354
- class: "",
355
- placeholder: "search",
356
- collapsible: ""
357
- }, null, 8, ["modelValue"])
358
- ]),
359
- c(C, {
360
- "row-data": e(i),
361
- "column-defs": _,
362
- "search-value": e(a).searchKey,
363
- "column-filter": e(a).columnFilters,
364
- onRowClick: o[3] || (o[3] = (w) => x(w.original._id)),
365
- "hide-footer": e(i).length < 10
366
- }, null, 8, ["row-data", "search-value", "column-filter", "hide-footer"])
367
- ], 64)) : (d(), b(E, {
368
- key: 1,
369
- variant: "outlined",
370
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
371
- }, {
372
- default: S(() => [
373
- o[7] || (o[7] = s("img", {
374
- src: J,
375
- class: "aspect-square w-[150px]"
376
- }, null, -1)),
377
- s("div", be, [
378
- s("div", _e, $(e(n)("connect.storeRewards.empty.title")), 1),
379
- s("div", xe, $(e(n)("connect.storeRewards.empty.description")), 1)
380
- ]),
381
- c(R, {
382
- variant: "primary",
383
- label: e(n)("connect.storeRewards.empty.action"),
384
- onClick: o[4] || (o[4] = (w) => x()),
385
- icon: "add"
386
- }, null, 8, ["label"])
387
- ]),
388
- _: 1
389
- })),
390
- c(ge, {
391
- ref_key: "rewardSheetRef",
392
- ref: l,
393
- onUpdate: o[5] || (o[5] = (w) => r(w))
394
- }, null, 512)
395
- ])
396
- ], 64);
397
- };
398
- }
399
- });
400
- export {
401
- Ge as default
402
- };