@feedmepos/mf-connect 0.1.82-prod → 0.1.84-prod

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 (104) hide show
  1. package/dist/{Analytic-D850nvXy.js → Analytic---kwMsJh.js} +11 -11
  2. package/dist/{App-Dwp2SQFt.js → App-Dz1QFoj1.js} +7 -7
  3. package/dist/{Bin-t3dMVk18.js → Bin-CRYowBLt.js} +8 -8
  4. package/dist/Broadcast-C8_buAc0.js +265 -0
  5. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CFa7asTL.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CYY2JwZP.js} +6 -6
  6. package/dist/{Card-DueuT99c.js → Card-DePqhNID.js} +19 -19
  7. package/dist/{Collections-D50oEyeZ.js → Collections-RwrRqA0j.js} +8 -8
  8. package/dist/Credit-C8PUzFqm.js +259 -0
  9. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DysfUOSp.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-CgUd84nn.js} +245 -241
  10. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-L0-aFhRw.js → EffectSheet.vue_vue_type_style_index_0_lang-DnPaODeO.js} +6 -6
  11. package/dist/Experience-DhtTPHu-.js +258 -0
  12. package/dist/{FileSaver.min-DH3eS7yi.js → FileSaver.min-BWjfwA9o.js} +1 -1
  13. package/dist/Game-CYj7LBJv.js +329 -0
  14. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-BIKcbIag.js → ImageInput.vue_vue_type_script_setup_true_lang-CUltj6id.js} +1 -1
  15. package/dist/{Index-BucLJQqP.js → Index-D8AcIz6r.js} +10 -10
  16. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CIoZurPE.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CpUmN6FR.js} +1 -1
  17. package/dist/{MainLayout-DYGrSfgc.js → MainLayout-DkxA5idl.js} +1 -1
  18. package/dist/{Marketing-CsAIdNjF.js → Marketing-4h6RtJ9w.js} +6 -6
  19. package/dist/{Member-D4HF_VGN.js → Member-Mi1lEgxG.js} +11 -11
  20. package/dist/{MemberList-CPoA4ovd.js → MemberList-Cd7SXI7d.js} +27 -27
  21. package/dist/{MemberTransactions-AMv9NeIb.js → MemberTransactions-aM_CTN3-.js} +1 -1
  22. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DhhSwnK0.js → MessageInput.vue_vue_type_script_setup_true_lang-LkKXfpQ8.js} +9864 -9759
  23. package/dist/Mission-BbZXMfe2.js +333 -0
  24. package/dist/{Overview-ByO2p2Wx.js → Overview-tjz1RxkD.js} +19 -19
  25. package/dist/Point-DqSlh8lv.js +261 -0
  26. package/dist/Promotion-FNZOyKDM.js +390 -0
  27. package/dist/{Queue-BD29Mmbf.js → Queue-BGr-V2dv.js} +11 -11
  28. package/dist/{Record-CNLiN6YR.js → Record-YSp6Ra7G.js} +9 -9
  29. package/dist/{Reward-Ceo3M1yD.js → Reward-CfWeF_XY.js} +16 -16
  30. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CJWQEL9W.js → RewardGroup.vue_vue_type_script_setup_true_lang-BdT11T69.js} +12 -12
  31. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CWuWGs6r.js → RuleGroup.vue_vue_type_script_setup_true_lang-D7pC5cM-.js} +15 -15
  32. package/dist/{Segment-BOQUlP-m.js → Segment-B8kCEI6G.js} +25 -25
  33. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-BcXeiz0p.js → SelectItems.vue_vue_type_script_setup_true_lang-iK1tNyZN.js} +2 -2
  34. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-CJ--FC-i.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-Cd9_IVCK.js} +12 -12
  35. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-9emjG6Nc.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-CDNCuGzR.js} +4 -4
  36. package/dist/{Setting-CWapXD31.js → Setting-DRK1-tm8.js} +14 -14
  37. package/dist/{SettingAdvertisements-QEf2eyem.js → SettingAdvertisements-CPBFpIuM.js} +12 -12
  38. package/dist/{Store-Bfm2olbH.js → Store-CF55C7mv.js} +22 -22
  39. package/dist/{StoreRewards-DNDkyxxn.js → StoreRewards-hF8rcPIS.js} +15 -15
  40. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-zKLbY4Qb.js → StoreTransactions.vue_vue_type_script_setup_true_lang-BYugGARP.js} +20 -20
  41. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-D3-wIOQ7.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BSOpqCbD.js} +1 -1
  42. package/dist/{Tier-uC45o2AK.js → Tier-RKT4ClDE.js} +22 -22
  43. package/dist/{Title-zDjlDJCB.js → Title-vFFh4BdE.js} +20 -20
  44. package/dist/{Transaction-Bo9FEjMQ.js → Transaction-BHeWenhg.js} +2 -2
  45. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BR5F0bWS.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-iKbV9AAj.js} +6 -6
  46. package/dist/{Voucher-B7BTa4Vt.js → Voucher-C6ywMiLW.js} +162 -141
  47. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-CjrjJW7x.js → VoucherEditor.vue_vue_type_script_setup_true_lang-DHlpDIkL.js} +12 -12
  48. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DeAkLgaX.js → ZodTextField.vue_vue_type_script_setup_true_lang-BHhDgBiv.js} +2 -2
  49. package/dist/{app-CkUBXnib.js → app-P5wZqN7K.js} +961 -875
  50. package/dist/app.js +1 -1
  51. package/dist/{business-C8P05bjQ.js → business-B35Wh7fa.js} +1 -1
  52. package/dist/{campaign-DcLhSQVQ.js → campaign-CdGwiufg.js} +1 -1
  53. package/dist/{campaign-CyYAvl3p.js → campaign-CxeRf6Kf.js} +8 -8
  54. package/dist/{campaign.enum-h6B-mP82.js → campaign.enum-G61yFqyz.js} +1 -1
  55. package/dist/{campaign.fn-CStjDAoU.js → campaign.fn-DBGVgh7k.js} +128 -128
  56. package/dist/{collectible.enum-DT-wjl-a.js → collectible.enum-CmO4wF4e.js} +1 -1
  57. package/dist/{collection.fn-14o3RW2e.js → collection.fn-BZtvtGPA.js} +2 -2
  58. package/dist/{dto-Bv09Baex.js → dto-BmjMkp1Z.js} +4 -4
  59. package/dist/{effect-CF0s7QWQ.js → effect-eEYO0AvV.js} +1 -1
  60. package/dist/{email-addresses-B5qrHbxg.js → email-addresses-sloQNBJG.js} +2 -2
  61. package/dist/{export-B6nvdBmg.js → export-CmGCO7dx.js} +3 -3
  62. package/dist/{helper-B4-2ut7E.js → helper-CW7xMPjC.js} +1 -1
  63. package/dist/{index-D5xt8OjL.js → index-639mCQ6J.js} +1 -1
  64. package/dist/{index-CR8brl_k.js → index-B5KXKlhV.js} +1 -1
  65. package/dist/{index-DG_Ej3ec.js → index-B6dK27Ud.js} +3 -3
  66. package/dist/{index-B-y0UTZw.js → index-BD00XsAg.js} +6 -6
  67. package/dist/{index-DesSizn4.js → index-C7X2wMHZ.js} +3 -3
  68. package/dist/{index-BebGg-0n.js → index-CK4IRu1N.js} +1 -1
  69. package/dist/{index-Ct90ybe0.js → index-CLoMa41m.js} +1 -1
  70. package/dist/{index-DVb99_67.js → index-CmdjTQSX.js} +1 -1
  71. package/dist/{index-DzQjej5Y.js → index-CqtPReHP.js} +4 -4
  72. package/dist/{index-DIQ2MyWF.js → index-DCzBwaDb.js} +4 -4
  73. package/dist/{index-HhVIn4Bn.js → index-DF11MBlC.js} +1 -1
  74. package/dist/{index-DRX9TTMn.js → index-DzgPdiHK.js} +3 -3
  75. package/dist/{index-XDg25M5a.js → index-INxinXgP.js} +1 -1
  76. package/dist/{index.esm2017-1A2eV8x_.js → index.esm2017-CFPCtvwG.js} +1 -1
  77. package/dist/{loading-B0_BwPgo.js → loading-D77DfZBP.js} +1 -1
  78. package/dist/{lodash-DxIglhqk.js → lodash-B8BR1gR7.js} +1 -1
  79. package/dist/{membership-H_whlbUP.js → membership-B5p556SC.js} +3 -3
  80. package/dist/{money-DEE8QW6m.js → money-CRPmLrb_.js} +1 -1
  81. package/dist/{number-BmN5A4Cu.js → number-bJoTVZNO.js} +1 -1
  82. package/dist/objectid-DCHsjF9h.js +145 -0
  83. package/dist/{plugins-DTrOHd7d.js → plugins-DQdMt5nO.js} +3 -3
  84. package/dist/{reward-CsJhkkaT.js → reward-DeTD3TQ1.js} +1 -1
  85. package/dist/{rule-ByMxYH4c.js → rule-DSuuXRg3.js} +3 -3
  86. package/dist/{rule-builder-DwGwUlV1.js → rule-builder-D8rRlIOO.js} +1 -1
  87. package/dist/template-HTjC1_ed.js +236 -0
  88. package/dist/{timezone-Bpe-fhwZ.js → timezone-CWcYmamV.js} +2 -2
  89. package/dist/{trigger-CEprJYiD.js → trigger-BZa0mW7v.js} +5 -5
  90. package/dist/{usePagination-Du6qS5aj.js → usePagination-Abs8KbO-.js} +1 -1
  91. package/dist/{user-Be8HNWuo.js → user-B94fPQnM.js} +1 -1
  92. package/dist/{vue-i18n-fg0FtbNR.js → vue-i18n-D5HHFPRa.js} +296 -296
  93. package/dist/{xlsx-CSQJ3YWk.js → xlsx-BsqWVudt.js} +1 -1
  94. package/dist/{zod-BB7zZ5ec.js → zod-Bp867gMI.js} +1 -1
  95. package/package.json +1 -1
  96. package/dist/Broadcast-DORnkgZc.js +0 -232
  97. package/dist/Credit-CIWSRGuJ.js +0 -225
  98. package/dist/Experience-qABtjxNP.js +0 -224
  99. package/dist/Game-D67q1zKd.js +0 -299
  100. package/dist/Mission-CRinLn7e.js +0 -303
  101. package/dist/Point-4JqzbNgP.js +0 -227
  102. package/dist/Promotion-DlWVF6hF.js +0 -358
  103. package/dist/objectid-B8LZDZOt.js +0 -145
  104. package/dist/template-Bdwy6QXF.js +0 -188
@@ -1,303 +0,0 @@
1
- import { defineComponent as z, ref as x, computed as W, h as m, onMounted as G, resolveComponent as d, openBlock as u, createElementBlock as b, Fragment as C, createVNode as r, unref as t, createElementVNode as s, withCtx as v, renderList as J, createBlock as S, resolveDynamicComponent as Q, toDisplayString as f } from "vue";
2
- import { _ as X } from "./campaign-CpzFl8Vr.js";
3
- import { u as Y } from "./loading-B0_BwPgo.js";
4
- import { g as Z, a as B, b as P } from "./campaign-CyYAvl3p.js";
5
- import { a as ee, p as oe } from "./plugins-DTrOHd7d.js";
6
- import { u as te } from "./business-C8P05bjQ.js";
7
- import { u as ne, c as _ } from "./campaign-DcLhSQVQ.js";
8
- import { useDialog as ae, components as h } from "@feedmepos/ui-library";
9
- import { _ as se } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
10
- import { u as ie } from "./template-Bdwy6QXF.js";
11
- import { _ as re } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-DysfUOSp.js";
12
- import { s as ce } from "./index-CuvNtC_M.js";
13
- import { u as le } from "./vue-i18n-fg0FtbNR.js";
14
- import { _ as me } from "./SendCollectionSheet.vue_vue_type_script_setup_true_lang-CJ--FC-i.js";
15
- const de = { class: "px-24 flex flex-col gap-y-16" }, pe = { class: "flex items-center justify-between w-full" }, ue = { class: "flex gap-8 overflow-x-auto" }, fe = { class: "space-y-8" }, ge = { class: "flex w-full gap-4 items-center" }, ye = { class: "space-y-4" }, _e = { class: "fm-typo-en-body-lg-600" }, he = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, we = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, xe = { class: "flex flex-col gap-16 text-center" }, be = { class: "fm-typo-en-title-sm-800" }, Ce = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ue = /* @__PURE__ */ z({
16
- __name: "Mission",
17
- setup(ve) {
18
- const { t: n } = le(), K = {
19
- label: n("connect.program.common.actions.create", {
20
- type: n("connect.program.mission.title").toLowerCase()
21
- }),
22
- value: "create",
23
- isPrimary: !0,
24
- prependIcon: "add"
25
- }, F = ae(), R = ie("MISSION", F), A = te(), p = ne(), { global: N, minor: k } = Y, c = x({
26
- searchKey: "",
27
- location: []
28
- });
29
- function O(e) {
30
- const o = c.value.location;
31
- return !o || o.length === 0 || !e.targetLocation ? !0 : Array.isArray(o) ? o.some((i) => {
32
- var l;
33
- return (l = e == null ? void 0 : e.targetLocation) == null ? void 0 : l.includes(i);
34
- }) : e.targetLocation.includes(o);
35
- }
36
- const g = W(
37
- () => p.campaigns.mission.filter((e) => O(e))
38
- ), U = [
39
- {
40
- header: n("connect.program.common.table.title"),
41
- accessorKey: "name",
42
- // accessorFn: (v) => v.name,
43
- cell(e) {
44
- return m("div", { class: "flex items-center justify-between gap-4" }, [
45
- m("div", { class: "flex items-center" }, [
46
- m(
47
- h.FmTooltip,
48
- {
49
- content: e.row.original._id,
50
- onClick: (o) => {
51
- o.stopPropagation(), ee(e.row.original._id);
52
- }
53
- },
54
- [
55
- m(h.FmIcon, {
56
- name: "info",
57
- outline: !0,
58
- size: "sm"
59
- })
60
- ]
61
- )
62
- ]),
63
- m("div", { class: "flex-1" }, e.row.original.name)
64
- ]);
65
- }
66
- },
67
- {
68
- header: n("connect.campaign.mission.type"),
69
- accessorFn: (e) => ce(e.mission.type)
70
- //v.effect,
71
- },
72
- {
73
- header: n("connect.program.common.table.status"),
74
- accessorFn: (e) => Z(e),
75
- cell(e) {
76
- return B(e.row.original);
77
- }
78
- },
79
- {
80
- header: n("connect.program.common.table.summary"),
81
- accessorFn: (e) => P(e)
82
- //v.effect,
83
- },
84
- {
85
- header: n("connect.campaign.mission.received"),
86
- accessorFn: (e) => {
87
- var o;
88
- return ((o = e == null ? void 0 : e.pf_collectible) == null ? void 0 : o.currentReceive) ?? 0;
89
- }
90
- },
91
- {
92
- header: n("connect.program.common.table.actions"),
93
- cell(e) {
94
- return m("div", { class: "flex items-center gap-8" }, [
95
- m(h.FmButton, {
96
- variant: "tertiary",
97
- icon: "send",
98
- iconColor: "neutral-gray-400",
99
- onClick: (o) => {
100
- o.stopPropagation(), $(e.row.original);
101
- }
102
- }),
103
- m(h.FmButton, {
104
- variant: "tertiary",
105
- icon: "delete",
106
- iconColor: "neutral-gray-400",
107
- onClick: (o) => {
108
- o.stopPropagation(), V(e.row.original);
109
- }
110
- })
111
- ]);
112
- }
113
- }
114
- ], I = x(), L = x();
115
- async function V(e) {
116
- await oe.remove(
117
- n("connect.program.common.remove.confirm", { name: e.name })
118
- ) && await k(
119
- async () => {
120
- await _.delete(e._id), await p.read("MISSION");
121
- },
122
- {
123
- message: n("connect.program.common.remove.removing", { name: e.name }),
124
- successMessage: n("connect.program.common.remove.removed", {
125
- name: e.name
126
- })
127
- }
128
- );
129
- }
130
- async function y(e) {
131
- e ? await o() : R.open(async (i) => {
132
- await o(i);
133
- });
134
- async function o(i) {
135
- var l;
136
- (l = I.value) == null || l.showSheet(
137
- !0,
138
- "MISSION",
139
- e ? await _.readById(e._id) : void 0,
140
- i
141
- );
142
- }
143
- }
144
- async function T(e) {
145
- e.campaign._id && e.campaign.rewards.some((o) => o.type === "VOUCHER") && await new Promise((o) => {
146
- F.open({
147
- title: "Confirmation",
148
- message: "This will change all future vouchers? Would you like to update previous claimed vouchers expiry date and discount?",
149
- primaryActions: { text: "Update all", close: !0 },
150
- secondaryActions: { text: "Update future only", close: !0 }
151
- }).onPrimary(async () => {
152
- var i;
153
- e.updateCollections = !0, (i = window.top) == null || i.postMessage("updateAllVoucher", "*"), o();
154
- }).onSecondary(async () => {
155
- o();
156
- });
157
- }), await k(
158
- async () => {
159
- e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await p.read("MISSION");
160
- },
161
- {
162
- message: n(
163
- e.campaign._id ? "connect.program.common.update.updating" : "connect.program.common.update.creating",
164
- { type: "Mission" }
165
- ),
166
- successMessage: n("connect.program.common.update.success", {
167
- type: "Mission",
168
- action: e.campaign._id ? "updated" : "created"
169
- })
170
- }
171
- );
172
- }
173
- function $(e) {
174
- var o;
175
- (o = L.value) == null || o.showSheet({
176
- campaign: e
177
- });
178
- }
179
- return G(async () => {
180
- await N(async () => {
181
- await p.read("MISSION"), console.log(g);
182
- });
183
- }), (e, o) => {
184
- const i = d("FmPageHead"), l = d("FmSearch"), D = d("FmTable"), M = d("FmButton"), j = d("FmListItem"), E = d("FmList"), H = d("FmCard");
185
- return u(), b(C, null, [
186
- r(i, {
187
- title: t(n)("connect.campaign.mission.title"),
188
- actions: t(g).length > 0 ? [K] : [],
189
- "onClick:action": o[0] || (o[0] = () => y())
190
- }, null, 8, ["title", "actions"]),
191
- s("div", de, [
192
- r(l, {
193
- modelValue: t(c).searchKey,
194
- "onUpdate:modelValue": o[1] || (o[1] = (a) => t(c).searchKey = a),
195
- class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
196
- placeholder: t(n)("connect.program.common.search"),
197
- collapsible: ""
198
- }, null, 8, ["modelValue", "placeholder"]),
199
- t(p).campaigns.mission && t(p).campaigns.mission.length > 0 ? (u(), b(C, { key: 0 }, [
200
- s("div", pe, [
201
- s("div", ue, [
202
- r(se, {
203
- label: `${t(n)("connect.program.common.location")}: `,
204
- "right-icon": "keyboard_arrow_down",
205
- modelValue: t(c).location,
206
- "onUpdate:modelValue": o[2] || (o[2] = (a) => t(c).location = a),
207
- icon: "storefront",
208
- "show-item-label": !0,
209
- items: t(A).locationOptions
210
- }, null, 8, ["label", "modelValue", "items"])
211
- ]),
212
- r(l, {
213
- modelValue: t(c).searchKey,
214
- "onUpdate:modelValue": o[3] || (o[3] = (a) => t(c).searchKey = a),
215
- class: "xs:hidden sm:hidden",
216
- placeholder: "search",
217
- collapsible: ""
218
- }, null, 8, ["modelValue"])
219
- ]),
220
- r(D, {
221
- class: "xs:hidden sm:hidden",
222
- "row-data": t(g),
223
- "column-defs": U,
224
- "search-value": t(c).searchKey,
225
- "column-filter": [],
226
- onRowClick: o[4] || (o[4] = (a) => y(a.original)),
227
- "hide-footer": t(g).length < 10
228
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
229
- r(E, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
230
- default: v(() => [
231
- (u(!0), b(C, null, J(t(g).filter(
232
- (a) => a.name.toLowerCase().includes(t(c).searchKey.toLowerCase())
233
- ), (a) => (u(), S(j, {
234
- key: a._id.toString(),
235
- onClick: (w) => y(a),
236
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
237
- }, {
238
- default: v(() => {
239
- var w;
240
- return [
241
- s("div", fe, [
242
- s("div", ge, [
243
- (u(), S(Q(t(B)(a))))
244
- ]),
245
- s("div", ye, [
246
- s("div", _e, f(a.name), 1),
247
- s("div", he, f(t(P)(a)), 1)
248
- ]),
249
- s("div", we, f(t(n)("connect.campaign.mission.received")) + " : " + f(((w = a == null ? void 0 : a.pf_collectible) == null ? void 0 : w.currentReceive) ?? 0), 1)
250
- ]),
251
- r(M, {
252
- icon: "delete",
253
- "icon-color": "neutral-gray-400",
254
- variant: "tertiary",
255
- onClick: (q) => (q.stopPropagation(), V(a))
256
- }, null, 8, ["onClick"])
257
- ];
258
- }),
259
- _: 2
260
- }, 1032, ["onClick"]))), 128))
261
- ]),
262
- _: 1
263
- })
264
- ], 64)) : (u(), S(H, {
265
- key: 1,
266
- variant: "outlined",
267
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
268
- }, {
269
- default: v(() => [
270
- o[6] || (o[6] = s("img", {
271
- src: X,
272
- class: "aspect-square w-[150px]"
273
- }, null, -1)),
274
- s("div", xe, [
275
- s("div", be, f(t(n)("connect.campaign.mission.createProgram")), 1),
276
- s("div", Ce, f(t(n)("connect.campaign.mission.description")), 1)
277
- ]),
278
- r(M, {
279
- variant: "primary",
280
- label: t(n)("connect.campaign.mission.create"),
281
- icon: "add",
282
- onClick: o[5] || (o[5] = (a) => y())
283
- }, null, 8, ["label"])
284
- ]),
285
- _: 1
286
- })),
287
- r(re, {
288
- ref_key: "sheetRef",
289
- ref: I,
290
- "onSubmit:modelValue": T
291
- }, null, 512),
292
- r(me, {
293
- ref_key: "sendCollectionSheetRef",
294
- ref: L
295
- }, null, 512)
296
- ])
297
- ], 64);
298
- };
299
- }
300
- });
301
- export {
302
- Ue as default
303
- };
@@ -1,227 +0,0 @@
1
- import { defineComponent as j, ref as V, computed as E, h as M, onMounted as H, resolveComponent as l, openBlock as p, createElementBlock as w, Fragment as b, createVNode as i, unref as o, withCtx as y, createElementVNode as n, toDisplayString as u, renderList as q, createBlock as C, resolveDynamicComponent as z } from "vue";
2
- import { _ as G } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as J, components as Q } from "@feedmepos/ui-library";
4
- import { p as W } from "./plugins-DTrOHd7d.js";
5
- import { u as X } from "./loading-B0_BwPgo.js";
6
- import { u as Y } from "./business-C8P05bjQ.js";
7
- import { u as Z, c as _ } from "./campaign-DcLhSQVQ.js";
8
- import { g as ee, a as P, b as B } from "./campaign-CyYAvl3p.js";
9
- import { _ as te } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
10
- import { _ as oe } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-DysfUOSp.js";
11
- import { u as ae } from "./template-Bdwy6QXF.js";
12
- import { u as ne } from "./vue-i18n-fg0FtbNR.js";
13
- const se = { class: "flex items-center" }, ie = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, re = { class: "px-24 flex flex-col gap-y-16" }, le = { class: "flex items-center justify-between w-full" }, ce = { class: "flex gap-8 overflow-x-auto" }, me = { class: "space-y-8" }, de = { class: "flex w-full gap-4 items-center" }, pe = { class: "space-y-4" }, ue = { class: "fm-typo-en-body-lg-600" }, fe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ge = { class: "flex flex-col gap-16 text-center" }, ye = { class: "fm-typo-en-title-sm-800" }, _e = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ie = /* @__PURE__ */ j({
14
- __name: "Point",
15
- setup(he) {
16
- const { t: s } = ne(), I = {
17
- label: s("connect.program.common.actions.create", {
18
- type: s("connect.program.point.title").toLowerCase()
19
- }),
20
- value: "create",
21
- isPrimary: !0,
22
- prependIcon: "add"
23
- }, $ = ae("COIN", J()), h = Y(), d = Z(), { global: K, minor: x } = X, r = V({
24
- searchKey: "",
25
- location: []
26
- });
27
- function N(e) {
28
- const t = r.value.location;
29
- return !t || t.length === 0 || !e.targetLocation ? !0 : Array.isArray(t) ? t.some((c) => {
30
- var m;
31
- return (m = e == null ? void 0 : e.targetLocation) == null ? void 0 : m.includes(c);
32
- }) : e.targetLocation.includes(t);
33
- }
34
- const f = E(
35
- () => d.campaigns.point.filter((e) => N(e))
36
- ), O = [
37
- {
38
- header: s("connect.program.common.table.title"),
39
- accessorFn: (e) => e.name
40
- },
41
- {
42
- header: s("connect.program.common.table.status"),
43
- accessorFn: (e) => ee(e),
44
- cell(e) {
45
- return P(e.row.original);
46
- }
47
- },
48
- {
49
- header: s("connect.program.common.table.summary"),
50
- accessorFn: (e) => B(e)
51
- },
52
- {
53
- header: s("connect.program.common.table.actions"),
54
- cell(e) {
55
- return M(Q.FmButton, {
56
- variant: "tertiary",
57
- icon: "delete",
58
- iconColor: "neutral-gray-400",
59
- onClick: (t) => {
60
- t.stopPropagation(), F(e.row.original);
61
- }
62
- });
63
- }
64
- }
65
- ], v = V();
66
- async function F(e) {
67
- await W.remove(`Are you sure you want to remove ${e.name}?`) && await x(
68
- async () => {
69
- await _.delete(e._id), await d.read("COIN");
70
- },
71
- {
72
- message: `Removing ${e.name}`,
73
- successMessage: `Removed ${e.name} successfully`
74
- }
75
- );
76
- }
77
- async function g(e) {
78
- e ? await t() : $.open(async (c) => {
79
- await t(c);
80
- });
81
- async function t(c) {
82
- var m;
83
- (m = v.value) == null || m.showSheet(
84
- !0,
85
- "COIN",
86
- e ? await _.readById(e._id) : void 0,
87
- c
88
- );
89
- }
90
- }
91
- async function A(e) {
92
- await x(
93
- async () => {
94
- e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await d.read("COIN");
95
- },
96
- {
97
- message: `${e.campaign._id ? "Updating" : "Creating"} point program`,
98
- successMessage: `Point program ${e.campaign._id ? "updated" : "created"} successfully`
99
- }
100
- );
101
- }
102
- return H(async () => {
103
- await K(async () => {
104
- await d.read("COIN");
105
- });
106
- }), (e, t) => {
107
- const c = l("FmPill"), m = l("FmPageHead"), k = l("FmSearch"), R = l("FmTable"), L = l("FmButton"), U = l("FmListItem"), D = l("FmList"), T = l("FmCard");
108
- return p(), w(b, null, [
109
- i(m, {
110
- title: o(s)("connect.program.point.title"),
111
- actions: o(f).length > 0 && o(h).isPremium ? [I] : [],
112
- "onClick:action": t[0] || (t[0] = () => g())
113
- }, {
114
- title: y(() => [
115
- n("div", se, [
116
- n("span", ie, u(o(s)("connect.program.point.title")), 1),
117
- i(c, { variant: "premium" })
118
- ])
119
- ]),
120
- _: 1
121
- }, 8, ["title", "actions"]),
122
- n("div", re, [
123
- i(k, {
124
- modelValue: o(r).searchKey,
125
- "onUpdate:modelValue": t[1] || (t[1] = (a) => o(r).searchKey = a),
126
- class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
127
- placeholder: "search",
128
- collapsible: ""
129
- }, null, 8, ["modelValue"]),
130
- o(d).campaigns.point && o(d).campaigns.point.length > 0 ? (p(), w(b, { key: 0 }, [
131
- n("div", le, [
132
- n("div", ce, [
133
- i(te, {
134
- label: `${o(s)("connect.common.location")}: `,
135
- "right-icon": "keyboard_arrow_down",
136
- modelValue: o(r).location,
137
- "onUpdate:modelValue": t[2] || (t[2] = (a) => o(r).location = a),
138
- icon: "storefront",
139
- "show-item-label": !0,
140
- items: o(h).locationOptions
141
- }, null, 8, ["label", "modelValue", "items"])
142
- ]),
143
- i(k, {
144
- modelValue: o(r).searchKey,
145
- "onUpdate:modelValue": t[3] || (t[3] = (a) => o(r).searchKey = a),
146
- class: "xs:hidden sm:hidden",
147
- placeholder: "search",
148
- collapsible: ""
149
- }, null, 8, ["modelValue"])
150
- ]),
151
- i(R, {
152
- class: "xs:hidden sm:hidden",
153
- "row-data": o(f),
154
- "column-defs": O,
155
- "search-value": o(r).searchKey,
156
- "column-filter": [],
157
- onRowClick: t[4] || (t[4] = (a) => g(a.original)),
158
- "hide-footer": o(f).length < 10
159
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
160
- i(D, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
161
- default: y(() => [
162
- (p(!0), w(b, null, q(o(f).filter(
163
- (a) => a.name.toLowerCase().includes(o(r).searchKey.toLowerCase())
164
- ), (a) => (p(), C(U, {
165
- key: a._id.toString(),
166
- onClick: (S) => g(a),
167
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
168
- }, {
169
- default: y(() => [
170
- n("div", me, [
171
- n("div", de, [
172
- (p(), C(z(o(P)(a))))
173
- ]),
174
- n("div", pe, [
175
- n("div", ue, u(a.name), 1),
176
- n("div", fe, u(o(B)(a)), 1)
177
- ])
178
- ]),
179
- i(L, {
180
- icon: "delete",
181
- "icon-color": "neutral-gray-400",
182
- variant: "tertiary",
183
- onClick: (S) => (S.stopPropagation(), F(a))
184
- }, null, 8, ["onClick"])
185
- ]),
186
- _: 2
187
- }, 1032, ["onClick"]))), 128))
188
- ]),
189
- _: 1
190
- })
191
- ], 64)) : (p(), C(T, {
192
- key: 1,
193
- variant: "outlined",
194
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
195
- }, {
196
- default: y(() => [
197
- t[6] || (t[6] = n("img", {
198
- src: G,
199
- class: "aspect-square w-[150px]"
200
- }, null, -1)),
201
- n("div", ge, [
202
- n("div", ye, u(o(s)("connect.program.point.empty_state.title")), 1),
203
- n("div", _e, u(o(s)("connect.program.point.empty_state.description")), 1)
204
- ]),
205
- i(L, {
206
- variant: "primary",
207
- label: "Create point program",
208
- disabled: !o(h).isPremium,
209
- icon: "add",
210
- onClick: t[5] || (t[5] = (a) => g())
211
- }, null, 8, ["disabled"])
212
- ]),
213
- _: 1
214
- })),
215
- i(oe, {
216
- ref_key: "sheetRef",
217
- ref: v,
218
- "onSubmit:modelValue": A
219
- }, null, 512)
220
- ])
221
- ], 64);
222
- };
223
- }
224
- });
225
- export {
226
- Ie as default
227
- };