@feedmepos/mf-connect 0.1.98-beta.5 → 0.1.98-beta.51

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 (140) hide show
  1. package/dist/{App-D_4snNiy.js → App-JV2uNrvu.js} +812 -666
  2. package/dist/{AuditLogs-KQU1O9_9.js → AuditLogs-DIIFx72_.js} +12 -11
  3. package/dist/{Bin-gp_uuNrE.js → Bin-CZhEKQu2.js} +8 -8
  4. package/dist/{Broadcast-CbBaOlnn.js → Broadcast-BcZkno6J.js} +39 -36
  5. package/dist/CampaignAnalytic-CAia4i9S.js +1826 -0
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-2bro245w.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-L8SJYjBW.js} +7 -5
  7. package/dist/Card-TKD4-Xso.js +1060 -0
  8. package/dist/{Collections-CKeOHYZ4.js → Collections-VSwS8D6Q.js} +14 -13
  9. package/dist/Credit-CtHPSpAU.js +286 -0
  10. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bh2O4xdy.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-CbNDf9DU.js} +34 -30
  11. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BIdb46VQ.js → EffectSheet.vue_vue_type_style_index_0_lang-BPebL492.js} +6 -6
  12. package/dist/{Experience-B-c5SMns.js → Experience-CWBJSMlx.js} +112 -86
  13. package/dist/{FileSaver.min-DWnvGKCg.js → FileSaver.min-BfTmJkbD.js} +1 -1
  14. package/dist/Game-DI4seuZN.js +356 -0
  15. package/dist/GiftCardSetup-Eb4z-3Tw.js +662 -0
  16. package/dist/{Grab-BLC4GcgE.js → Grab-QA8iuTIt.js} +32 -31
  17. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-l2CmQ0nR.js → ImageInput.vue_vue_type_script_setup_true_lang-Kj2eGbhx.js} +1 -1
  18. package/dist/{Index-DmAG2skd.js → Index-q_mf4I2R.js} +10 -10
  19. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-UmynGH00.js → LocationPicker.vue_vue_type_script_setup_true_lang-D-zdplq1.js} +1 -1
  20. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-BThofu65.js → LottieAnimation.vue_vue_type_script_setup_true_lang-DuF9Zazb.js} +1 -1
  21. package/dist/LoyaltyDashboard-DqLObGpI.js +2218 -0
  22. package/dist/MainLayout-R50g2-Xa.js +143 -0
  23. package/dist/{Marketing-DmY25Ri9.js → Marketing-BF4Xdneq.js} +7 -6
  24. package/dist/{MarketingMaterialEdit-DP9pba44.js → MarketingMaterialEdit-C1jbUUjo.js} +15 -14
  25. package/dist/Member-DJjiYJtn.js +630 -0
  26. package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-BM9E0GyV.js +1287 -0
  27. package/dist/MemberImportHistory-Bkvm0Ez3.js +187 -0
  28. package/dist/MemberList-dKpMFozU.js +336 -0
  29. package/dist/{MemberTransactions-XRvUfeFB.js → MemberTransactions-Cekl-sXJ.js} +1 -1
  30. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-g7v3ZoUS.js → MessageInput.vue_vue_type_script_setup_true_lang-B0yGRUZI.js} +5434 -5279
  31. package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-Bg_0YlwG.js +38 -0
  32. package/dist/Mission-DdK_5_F3.js +360 -0
  33. package/dist/Overview-DERmPhum.js +1316 -0
  34. package/dist/{Overview-DgmVlUVi.js → Overview-DMicUAtO.js} +21 -20
  35. package/dist/Point-9nbs-bQj.js +288 -0
  36. package/dist/Promotion-1J4rNVbl.js +423 -0
  37. package/dist/{Queue-DxtykwmI.js → Queue-C5HpvpfO.js} +13 -12
  38. package/dist/{Record-fLCi2Oyh.js → Record-DPWTZIZG.js} +9 -9
  39. package/dist/Review-BILLtfEs.js +45 -0
  40. package/dist/ReviewFacebookCallback-X5ZRII8-.js +238 -0
  41. package/dist/ReviewGoogleCallback-CsFpRPMM.js +213 -0
  42. package/dist/{Reward-BbdiCAiO.js → Reward-BZf4HyXc.js} +35 -35
  43. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-Cfjtk46d.js → RewardGroup.vue_vue_type_script_setup_true_lang-c0K--Vka.js} +14 -13
  44. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CYEBeuQQ.js → RuleGroup.vue_vue_type_script_setup_true_lang-cP-U-lIJ.js} +17 -15
  45. package/dist/{Segment-EkGcR2jo.js → Segment-Bw2EFKGm.js} +31 -29
  46. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-DND48RGu.js → SelectItems.vue_vue_type_script_setup_true_lang-Cc-T78sP.js} +2 -2
  47. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-sbYDSAFK.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-BAxkvdal.js} +37 -36
  48. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-D8RmLtRC.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-DojnFmx5.js} +4 -4
  49. package/dist/{Setting-D3swsR6P.js → Setting-CcXr0dQ1.js} +14 -14
  50. package/dist/{SettingAdvertisements-BjhTK11W.js → SettingAdvertisements-CzuEpMOf.js} +12 -12
  51. package/dist/Settings-DiMD2NkY.js +230 -0
  52. package/dist/Store-dwl-jnTa.js +2615 -0
  53. package/dist/{StoreRewards-CyrWuwLi.js → StoreRewards-CWb9PKSE.js} +15 -15
  54. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-BUTYIDGo.js → StoreTransactions.vue_vue_type_script_setup_true_lang-CbtrHjJP.js} +400 -455
  55. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DJQ022R4.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-044yoW2U.js} +2 -2
  56. package/dist/{Tier-DrPqr8_e.js → Tier-DWvwkylY.js} +44 -41
  57. package/dist/{Title-CaZtz98p.js → Title-DlU9gF0K.js} +49 -46
  58. package/dist/Transaction-Bc93xnBU.js +45 -0
  59. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BsBqk0Rs.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DetYg0Bb.js} +6 -6
  60. package/dist/{Voucher-BZcr4D0y.js → Voucher-BW14GJbe.js} +156 -133
  61. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DXQF3LZK.js → VoucherEditor.vue_vue_type_script_setup_true_lang-DVLfWJi6.js} +12 -12
  62. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DI-tCQeb.js → ZodTextField.vue_vue_type_script_setup_true_lang-C4Vn9TNW.js} +2 -2
  63. package/dist/{app-B0vutEt5.js → app-CMP4JV-I.js} +7366 -6068
  64. package/dist/app.js +1 -1
  65. package/dist/{business-IZLJeLD-.js → business-KReNCbnK.js} +5 -5
  66. package/dist/{campaign-BPmgteCL.js → campaign-BRVpfKi1.js} +74 -96
  67. package/dist/campaign-DyuxGLq4.js +100 -0
  68. package/dist/{campaign.enum-BCdlLIt6.js → campaign.enum-BeZION80.js} +1 -1
  69. package/dist/{campaign.fn-BIFWlQvS.js → campaign.fn-2PEF3nkf.js} +92 -92
  70. package/dist/{collectible.enum-CiuAWn6_.js → collectible.enum-DYUFYht1.js} +1 -1
  71. package/dist/collection.fn-BID3ayar.js +26 -0
  72. package/dist/{duplicateCampaign-BouCkl9n.js → duplicateCampaign-C69iPr6Z.js} +2 -2
  73. package/dist/{effect-Cov_Xrar.js → effect-D1pc__Xy.js} +1 -1
  74. package/dist/{email-addresses-BiopO9xi.js → email-addresses-C9EZ-kvh.js} +2 -2
  75. package/dist/{export-DAPTBdHb.js → export-CosJDe69.js} +3 -3
  76. package/dist/google-C3S8u0mT.js +4 -0
  77. package/dist/{helper-ClFo4nAk.js → helper-D0fnLHuw.js} +1 -1
  78. package/dist/index-BCFh3XOm.js +896 -0
  79. package/dist/{index-BeK9AXvx.js → index-BDe4uGkM.js} +1 -1
  80. package/dist/index-BVsFibrm.js +53 -0
  81. package/dist/{index-k0hHOUBO.js → index-Bat7Iuv1.js} +579 -571
  82. package/dist/{index-N5t83KgP.js → index-BuoP8jTk.js} +1902 -2559
  83. package/dist/{index-k9DTOKkN.js → index-C-mhZhj-.js} +4 -1
  84. package/dist/{index-BZvvCPbP.js → index-C4IVNYKv.js} +5 -4
  85. package/dist/{index-CD_3hR1g.js → index-C8COBHo0.js} +1 -1
  86. package/dist/index-CeojsFkg.js +72 -0
  87. package/dist/{index-CmgQZKyo.js → index-CjS68_1M.js} +1 -1
  88. package/dist/{index-Bm5E2iD6.js → index-CtsuA8Yo.js} +14 -14
  89. package/dist/{index-DTSGYksR.js → index-DFXrFkyv.js} +281 -372
  90. package/dist/index-DRsMk331.js +51 -0
  91. package/dist/{index-pKdJ8574.js → index-DUg1krO0.js} +5 -5
  92. package/dist/{index-Kllafq_o.js → index-D_C0xupc.js} +105 -123
  93. package/dist/{index-C_AuIVay.js → index-HtrU57rF.js} +5 -5
  94. package/dist/index-mipq9GXC.js +151 -0
  95. package/dist/index-nweuFPTK.js +137 -0
  96. package/dist/{index.esm2017-ByFUnorr.js → index.esm2017-ArKRaPJJ.js} +164 -164
  97. package/dist/{loading-t4ygCIAa.js → loading-D_YeYrou.js} +1 -1
  98. package/dist/{lodash-DwGVChOs.js → lodash-BxQQlaBr.js} +1 -1
  99. package/dist/member-import-CAxFcEFz.js +187 -0
  100. package/dist/{membership-CMCTmRdh.js → membership-JcSqll6e.js} +3 -3
  101. package/dist/{money-MhQbdVIt.js → money-CE8VtExr.js} +1 -1
  102. package/dist/{number-klG94_wm.js → number-B1-SfLRP.js} +1 -1
  103. package/dist/objectid-CA1FNe-m.js +145 -0
  104. package/dist/{plugins-2py5EcqG.js → plugins-CnDONOZC.js} +3 -3
  105. package/dist/remy-Qz_pNsUS.js +13 -0
  106. package/dist/{reward-CE9z-Us7.js → reward-SXG2AxAb.js} +1 -1
  107. package/dist/{rule-BKNHxNrQ.js → rule-DoLHX3mM.js} +3 -3
  108. package/dist/rule-builder-dVImuRVj.js +126 -0
  109. package/dist/{template-C9yNa_0m.js → template-sTUnIE3A.js} +6 -6
  110. package/dist/timezone-B9h5PP8z.js +20 -0
  111. package/dist/transaction.fn-CkSLBsry.js +64 -0
  112. package/dist/{trigger-Dk0tAyDv.js → trigger-D6HMzMR1.js} +14 -14
  113. package/dist/useMarketingMaterialActions-D0W735D9.js +96 -0
  114. package/dist/{usePagination-cF1F_1NH.js → usePagination-TK7EqteI.js} +1 -1
  115. package/dist/{user-CNPPoxKh.js → user-l_0SFSlp.js} +1 -1
  116. package/dist/vue-i18n-CQAuV1i2.js +2365 -0
  117. package/dist/{xlsx-D3muGzk7.js → xlsx-BoOvRAl-.js} +1 -1
  118. package/dist/{zod-D72USJGr.js → zod-CDtseEbG.js} +1 -1
  119. package/package.json +5 -3
  120. package/dist/Card-P7MqKEDT.js +0 -910
  121. package/dist/Credit-Dp5P2k79.js +0 -260
  122. package/dist/Game-CNSbh93g.js +0 -330
  123. package/dist/LoyaltyDashboard-Go9ClMrp.js +0 -1082
  124. package/dist/MainLayout-Dyw9Qqvh.js +0 -41
  125. package/dist/Member-DKXzaqlL.js +0 -280
  126. package/dist/MemberList-BJ5nI3Nz.js +0 -1601
  127. package/dist/Mission-BvHArY3W.js +0 -334
  128. package/dist/Point-BR0R03i6.js +0 -262
  129. package/dist/Promotion-DofFeR2N.js +0 -397
  130. package/dist/Review-7tFJOnrt.js +0 -1076
  131. package/dist/ReviewFacebookCallback-yl0w_vF9.js +0 -243
  132. package/dist/ReviewGoogleCallback-Dn_aF2ZD.js +0 -208
  133. package/dist/Store-U1jysb7b.js +0 -1996
  134. package/dist/Transaction-Bj6bSo8R.js +0 -39
  135. package/dist/campaign-Cxp-DOCG.js +0 -219
  136. package/dist/index-BQ8XZk2Y.js +0 -85
  137. package/dist/index-KmCk2ksK.js +0 -52
  138. package/dist/objectid-C4ak1ctJ.js +0 -145
  139. package/dist/useMarketingMaterialActions-BiXkdMcs.js +0 -107
  140. package/dist/vue-i18n-Bk_KpCO_.js +0 -2365
@@ -1,260 +0,0 @@
1
- import { defineComponent as H, ref as L, computed as q, h as w, onMounted as O, resolveComponent as m, openBlock as d, createElementBlock as _, Fragment as v, createVNode as i, unref as o, createElementVNode as n, withCtx as b, renderList as z, createBlock as x, resolveDynamicComponent as G, toDisplayString as D, createCommentVNode as J } from "vue";
2
- import { _ as Q } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as W, components as V } from "@feedmepos/ui-library";
4
- import { p as X } from "./plugins-2py5EcqG.js";
5
- import { u as Y } from "./loading-t4ygCIAa.js";
6
- import { u as Z } from "./business-IZLJeLD-.js";
7
- import { u as ee, c as f } from "./campaign-Cxp-DOCG.js";
8
- import { a as te, b as B, c as I } from "./campaign-BPmgteCL.js";
9
- import { c as oe, p as ae } from "./duplicateCampaign-BouCkl9n.js";
10
- import { u as ne } from "./vue-i18n-Bk_KpCO_.js";
11
- import { _ as re } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
12
- import { _ as se } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bh2O4xdy.js";
13
- import { u as ie } from "./template-C9yNa_0m.js";
14
- const ce = { class: "px-24 flex flex-col gap-y-16" }, le = { class: "flex items-center justify-between w-full" }, me = { class: "flex gap-8 overflow-x-auto" }, de = { class: "space-y-8" }, pe = { class: "flex w-full gap-4 items-center" }, ue = { class: "space-y-4" }, fe = { class: "fm-typo-en-body-lg-600" }, ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ye = { class: "flex items-center gap-8" }, _e = { key: 0 }, Te = /* @__PURE__ */ H({
15
- __name: "Credit",
16
- setup(Ce) {
17
- const { t: r } = ne(), T = {
18
- label: r("connect.program.common.actions.create", {
19
- type: r("connect.program.credit.title").toLowerCase()
20
- }),
21
- value: "create",
22
- isPrimary: !0,
23
- prependIcon: "add"
24
- }, E = ie("CREDIT", W()), R = Z(), p = ee(), { global: K, minor: k } = Y, c = L({
25
- searchKey: "",
26
- location: []
27
- });
28
- function P(e) {
29
- const t = c.value.location;
30
- return !t || t.length === 0 || !e.targetLocation ? !0 : Array.isArray(t) ? t.some((l) => {
31
- var s;
32
- return (s = e == null ? void 0 : e.targetLocation) == null ? void 0 : s.includes(l);
33
- }) : e.targetLocation.includes(t);
34
- }
35
- const u = q(
36
- () => p.campaigns.credit.filter((e) => P(e))
37
- ), $ = [
38
- {
39
- header: r("connect.program.common.table.title"),
40
- accessorFn: (e) => e.name
41
- },
42
- {
43
- header: r("connect.program.common.table.status"),
44
- accessorFn: (e) => te(e),
45
- cell(e) {
46
- return B(e.row.original);
47
- }
48
- },
49
- {
50
- header: r("connect.program.common.table.summary"),
51
- accessorFn: (e) => I(e)
52
- },
53
- {
54
- header: r("connect.program.common.table.actions"),
55
- cell(e) {
56
- return w("div", { class: "flex items-center gap-8 justify-end" }, [
57
- w(V.FmButton, {
58
- variant: "tertiary",
59
- icon: "content_copy",
60
- iconColor: "neutral-gray-400",
61
- onClick: async (t) => {
62
- t.stopPropagation(), await S(e.row.original);
63
- }
64
- }),
65
- w(V.FmButton, {
66
- variant: "tertiary",
67
- icon: "delete",
68
- iconColor: "neutral-gray-400",
69
- onClick: (t) => {
70
- t.stopPropagation(), F(e.row.original);
71
- }
72
- })
73
- ]);
74
- }
75
- }
76
- ], C = L();
77
- async function F(e) {
78
- await X.remove(
79
- r("connect.program.common.remove.confirm", { name: e.name })
80
- ) && await k(
81
- async () => {
82
- await f.delete(e._id), await p.read("CREDIT");
83
- },
84
- {
85
- message: r("connect.program.common.remove.removing", { name: e.name }),
86
- successMessage: r("connect.program.common.remove.removed", {
87
- name: e.name
88
- })
89
- }
90
- );
91
- }
92
- async function g(e) {
93
- e ? await t() : E.open(async (l) => {
94
- await t(l);
95
- });
96
- async function t(l) {
97
- var s;
98
- (s = C.value) == null || s.showSheet(
99
- !0,
100
- "CREDIT",
101
- e ? await f.readById(e._id) : void 0,
102
- l
103
- );
104
- }
105
- }
106
- async function S(e) {
107
- var s;
108
- if (!await oe(e.name))
109
- return;
110
- const t = await f.readById(e._id), l = ae(t, {
111
- keepCollectible: !0
112
- });
113
- (s = C.value) == null || s.showSheet(
114
- !0,
115
- "CREDIT",
116
- l,
117
- t.template
118
- );
119
- }
120
- async function U(e) {
121
- await k(
122
- async () => {
123
- e.campaign._id ? await f.update(e.campaign._id, e) : await f.create(e), await p.read("CREDIT");
124
- },
125
- {
126
- message: `${e.campaign._id ? "Updating" : "Creating"} credit program`,
127
- successMessage: `Credit program ${e.campaign._id ? "updated" : "created"} successfully`
128
- }
129
- );
130
- }
131
- return O(async () => {
132
- await K(async () => {
133
- await p.read("CREDIT");
134
- });
135
- }), (e, t) => {
136
- const l = m("FmPageHead"), s = m("FmSearch"), j = m("FmTable"), h = m("FmButton"), A = m("FmListItem"), N = m("FmList"), M = m("FmCard");
137
- return d(), _(v, null, [
138
- i(l, {
139
- title: o(r)("connect.program.credit.title"),
140
- actions: o(u).length > 0 ? [T] : [],
141
- "onClick:action": t[0] || (t[0] = () => g())
142
- }, null, 8, ["title", "actions"]),
143
- n("div", ce, [
144
- i(s, {
145
- modelValue: o(c).searchKey,
146
- "onUpdate:modelValue": t[1] || (t[1] = (a) => o(c).searchKey = a),
147
- class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
148
- placeholder: "search",
149
- collapsible: ""
150
- }, null, 8, ["modelValue"]),
151
- o(p).campaigns.credit && o(p).campaigns.credit.length > 0 ? (d(), _(v, { key: 0 }, [
152
- n("div", le, [
153
- n("div", me, [
154
- i(re, {
155
- label: `${o(r)("connect.common.location")}: `,
156
- "right-icon": "keyboard_arrow_down",
157
- modelValue: o(c).location,
158
- "onUpdate:modelValue": t[2] || (t[2] = (a) => o(c).location = a),
159
- icon: "storefront",
160
- "show-item-label": !0,
161
- items: o(R).locationOptions
162
- }, null, 8, ["label", "modelValue", "items"])
163
- ]),
164
- i(s, {
165
- modelValue: o(c).searchKey,
166
- "onUpdate:modelValue": t[3] || (t[3] = (a) => o(c).searchKey = a),
167
- class: "xs:hidden sm:hidden",
168
- placeholder: "search",
169
- collapsible: ""
170
- }, null, 8, ["modelValue"])
171
- ]),
172
- i(j, {
173
- class: "xs:hidden sm:hidden",
174
- "row-data": o(u),
175
- "column-defs": $,
176
- "search-value": o(c).searchKey,
177
- "column-filter": [],
178
- onRowClick: t[4] || (t[4] = (a) => g(a.original)),
179
- "hide-footer": o(u).length < 10
180
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
181
- i(N, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
182
- default: b(() => [
183
- (d(!0), _(v, null, z(o(u).filter(
184
- (a) => a.name.toLowerCase().includes(o(c).searchKey.toLowerCase())
185
- ), (a) => (d(), x(A, {
186
- key: a._id.toString(),
187
- onClick: (y) => g(a),
188
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
189
- }, {
190
- default: b(() => [
191
- n("div", de, [
192
- n("div", pe, [
193
- (d(), x(G(o(B)(a))))
194
- ]),
195
- n("div", ue, [
196
- n("div", fe, D(a.name), 1),
197
- n("div", ge, D(o(I)(a)), 1)
198
- ])
199
- ]),
200
- n("div", ye, [
201
- i(h, {
202
- icon: "content_copy",
203
- "icon-color": "neutral-gray-400",
204
- variant: "tertiary",
205
- onClick: async (y) => {
206
- y.stopPropagation(), await S(a);
207
- }
208
- }, null, 8, ["onClick"]),
209
- i(h, {
210
- icon: "delete",
211
- "icon-color": "neutral-gray-400",
212
- variant: "tertiary",
213
- onClick: (y) => (y.stopPropagation(), F(a))
214
- }, null, 8, ["onClick"])
215
- ])
216
- ]),
217
- _: 2
218
- }, 1032, ["onClick"]))), 128))
219
- ]),
220
- _: 1
221
- }),
222
- o(u).length == 0 ? (d(), _("div", _e, [...t[6] || (t[6] = [
223
- n("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600" }, " No results found ", -1)
224
- ])])) : J("", !0)
225
- ], 64)) : (d(), x(M, {
226
- key: 1,
227
- variant: "outlined",
228
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
229
- }, {
230
- default: b(() => [
231
- t[7] || (t[7] = n("img", {
232
- src: Q,
233
- class: "aspect-square w-[150px]"
234
- }, null, -1)),
235
- t[8] || (t[8] = n("div", { class: "flex flex-col gap-16 text-center" }, [
236
- n("div", { class: "fm-typo-en-title-sm-800" }, "Create your credit program"),
237
- n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Credits are virtual money that customers can use to pay for their purchases, similar to cash within your store. ")
238
- ], -1)),
239
- i(h, {
240
- variant: "primary",
241
- label: "Create credit program",
242
- icon: "add",
243
- onClick: t[5] || (t[5] = (a) => g())
244
- })
245
- ]),
246
- _: 1
247
- })),
248
- i(se, {
249
- ref_key: "sheetRef",
250
- ref: C,
251
- "onSubmit:modelValue": U
252
- }, null, 512)
253
- ])
254
- ], 64);
255
- };
256
- }
257
- });
258
- export {
259
- Te as default
260
- };
@@ -1,330 +0,0 @@
1
- import { defineComponent as W, ref as P, computed as J, onMounted as Q, resolveComponent as m, openBlock as f, createElementBlock as V, Fragment as A, createVNode as r, unref as o, withCtx as x, createElementVNode as n, toDisplayString as g, renderList as X, createBlock as L, resolveDynamicComponent as Y, h as c } from "vue";
2
- import { _ as Z } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as ee, components as y } from "@feedmepos/ui-library";
4
- import { c as te, p as oe } from "./plugins-2py5EcqG.js";
5
- import { u as ae } from "./loading-t4ygCIAa.js";
6
- import { u as ne } from "./business-IZLJeLD-.js";
7
- import { u as ie, c as _ } from "./campaign-Cxp-DOCG.js";
8
- import { b as D, c as G, a as se } from "./campaign-BPmgteCL.js";
9
- import { c as re, p as le } from "./duplicateCampaign-BouCkl9n.js";
10
- import { _ as ce } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
11
- import { _ as me } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bh2O4xdy.js";
12
- import { u as de } from "./template-C9yNa_0m.js";
13
- import { u as ue } from "./vue-i18n-Bk_KpCO_.js";
14
- import { _ as pe } from "./SendCollectionSheet.vue_vue_type_script_setup_true_lang-sbYDSAFK.js";
15
- const fe = { class: "flex items-center" }, ge = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, ye = { class: "px-24 flex flex-col gap-y-16" }, _e = { class: "flex items-center justify-between w-full" }, he = { class: "flex gap-8 overflow-x-auto" }, we = { class: "space-y-8" }, Ce = { class: "flex w-full gap-4 items-center" }, xe = { class: "space-y-4" }, ve = { class: "fm-typo-en-body-lg-600" }, be = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ke = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Fe = { class: "flex items-center gap-8" }, Se = { class: "flex flex-col gap-16 text-center" }, Pe = { class: "fm-typo-en-title-sm-800" }, Ve = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ne = /* @__PURE__ */ W({
16
- __name: "Game",
17
- setup(Ae) {
18
- const { t: d } = ue(), K = {
19
- label: d("connect.program.common.actions.create", {
20
- type: d("connect.program.game.title").toLowerCase()
21
- }),
22
- value: "create",
23
- isPrimary: !0,
24
- prependIcon: "add"
25
- }, B = ee(), U = de("GAME", B), h = ne(), u = ie(), { global: I, minor: R } = ae, l = P({
26
- searchKey: "",
27
- location: []
28
- });
29
- function T(e) {
30
- const t = l.value.location;
31
- return !t || t.length === 0 || !e.targetLocation ? !0 : Array.isArray(t) ? t.some((s) => {
32
- var i;
33
- return (i = e == null ? void 0 : e.targetLocation) == null ? void 0 : i.includes(s);
34
- }) : e.targetLocation.includes(t);
35
- }
36
- const w = J(
37
- () => u.campaigns.token.filter((e) => T(e))
38
- ), j = [
39
- {
40
- header: "Program title",
41
- accessorKey: "name",
42
- // accessorFn: (v) => v.name,
43
- cell(e) {
44
- return c("div", { class: "flex items-center justify-between gap-4" }, [
45
- c("div", { class: "flex items-center" }, [
46
- c(
47
- y.FmTooltip,
48
- {
49
- content: e.row.original._id,
50
- onClick: (t) => {
51
- t.stopPropagation(), te(e.row.original._id);
52
- }
53
- },
54
- [
55
- c(y.FmIcon, {
56
- name: "info",
57
- outline: !0,
58
- size: "sm"
59
- })
60
- ]
61
- )
62
- ]),
63
- c("div", { class: "flex-1" }, e.row.original.name)
64
- ]);
65
- }
66
- },
67
- {
68
- header: "Status",
69
- accessorFn: (e) => se(e),
70
- cell(e) {
71
- return D(e.row.original);
72
- }
73
- },
74
- {
75
- header: "Summary",
76
- accessorFn: (e) => G(e)
77
- //v.effect,
78
- },
79
- {
80
- header: "Token received",
81
- accessorFn: (e) => {
82
- var t;
83
- return ((t = e == null ? void 0 : e.pf_collectible) == null ? void 0 : t.currentReceive) ?? 0;
84
- }
85
- },
86
- {
87
- header: "Actions",
88
- cell(e) {
89
- return c("div", { class: "flex items-center gap-8" }, [
90
- c(y.FmButton, {
91
- variant: "tertiary",
92
- icon: "content_copy",
93
- iconColor: "neutral-gray-400",
94
- onClick: async (t) => {
95
- t.stopPropagation(), await M(e.row.original);
96
- }
97
- }),
98
- c(y.FmButton, {
99
- variant: "tertiary",
100
- icon: "send",
101
- iconColor: "neutral-gray-400",
102
- onClick: (t) => {
103
- t.stopPropagation(), N(e.row.original);
104
- }
105
- }),
106
- c(y.FmButton, {
107
- variant: "tertiary",
108
- icon: "delete",
109
- iconColor: "neutral-gray-400",
110
- onClick: (t) => {
111
- t.stopPropagation(), E(e.row.original);
112
- }
113
- })
114
- ]);
115
- }
116
- }
117
- ], v = P(), $ = P();
118
- async function E(e) {
119
- await oe.remove(`Are you sure you want to remove ${e.name}?`) && await R(
120
- async () => {
121
- await _.delete(e._id), await u.read("GAME");
122
- },
123
- {
124
- message: `Removing ${e.name}`,
125
- successMessage: `Removed ${e.name} successfully`
126
- }
127
- );
128
- }
129
- async function C(e) {
130
- e ? await t() : U.open(async (s) => {
131
- await t(s);
132
- });
133
- async function t(s) {
134
- var i;
135
- (i = v.value) == null || i.showSheet(
136
- !0,
137
- "GAME",
138
- e ? await _.readById(e._id) : void 0,
139
- s
140
- );
141
- }
142
- }
143
- async function M(e) {
144
- var i;
145
- if (!await re(e.name))
146
- return;
147
- const t = await _.readById(e._id), s = le(t);
148
- (i = v.value) == null || i.showSheet(
149
- !0,
150
- "GAME",
151
- s,
152
- t.template
153
- );
154
- }
155
- async function H(e) {
156
- var t, s, i;
157
- e.campaign._id && ((i = (s = (t = e.campaign) == null ? void 0 : t.game) == null ? void 0 : s.rewards) != null && i.some(
158
- (p) => p.type === "VOUCHER"
159
- )) && await new Promise((p) => {
160
- B.open({
161
- title: "Confirmation",
162
- message: "This will change all future vouchers? Would you like to update previous claimed vouchers expiry date and discount?",
163
- primaryActions: { text: "Update all", close: !0 },
164
- secondaryActions: { text: "Update future only", close: !0 }
165
- }).onPrimary(async () => {
166
- e.updateCollections = !0, p();
167
- }).onSecondary(async () => {
168
- p();
169
- });
170
- }), await R(
171
- async () => {
172
- e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await u.read("GAME");
173
- },
174
- {
175
- message: `${e.campaign._id ? "Updating" : "Creating"} game program`,
176
- successMessage: `Game program ${e.campaign._id ? "updated" : "created"} successfully`
177
- }
178
- );
179
- }
180
- function N(e) {
181
- var t;
182
- (t = $.value) == null || t.showSheet({
183
- campaign: e
184
- });
185
- }
186
- return Q(async () => {
187
- await I(async () => {
188
- await u.read("GAME"), await h.readPremium();
189
- });
190
- }), (e, t) => {
191
- const s = m("FmPill"), i = m("FmPageHead"), b = m("FmSearch"), p = m("FmTable"), k = m("FmButton"), O = m("FmListItem"), q = m("FmList"), z = m("FmCard");
192
- return f(), V(A, null, [
193
- r(i, {
194
- actions: o(w).length > 0 && o(h).isPremium ? [K] : [],
195
- "onClick:action": t[0] || (t[0] = () => C())
196
- }, {
197
- title: x(() => [
198
- n("div", fe, [
199
- n("span", ge, g(o(d)("connect.program.game.title")), 1),
200
- r(s, { variant: "premium" })
201
- ])
202
- ]),
203
- _: 1
204
- }, 8, ["actions"]),
205
- n("div", ye, [
206
- r(b, {
207
- modelValue: o(l).searchKey,
208
- "onUpdate:modelValue": t[1] || (t[1] = (a) => o(l).searchKey = a),
209
- class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
210
- placeholder: "search",
211
- collapsible: ""
212
- }, null, 8, ["modelValue"]),
213
- o(u).campaigns.token && o(u).campaigns.token.length > 0 ? (f(), V(A, { key: 0 }, [
214
- n("div", _e, [
215
- n("div", he, [
216
- r(ce, {
217
- label: `${o(d)("connect.common.location")}: `,
218
- "right-icon": "keyboard_arrow_down",
219
- modelValue: o(l).location,
220
- "onUpdate:modelValue": t[2] || (t[2] = (a) => o(l).location = a),
221
- icon: "storefront",
222
- "show-item-label": !0,
223
- items: o(h).locationOptions
224
- }, null, 8, ["label", "modelValue", "items"])
225
- ]),
226
- r(b, {
227
- modelValue: o(l).searchKey,
228
- "onUpdate:modelValue": t[3] || (t[3] = (a) => o(l).searchKey = a),
229
- class: "xs:hidden sm:hidden",
230
- placeholder: "search",
231
- collapsible: ""
232
- }, null, 8, ["modelValue"])
233
- ]),
234
- r(p, {
235
- class: "xs:hidden sm:hidden",
236
- "row-data": o(w),
237
- "column-defs": j,
238
- "search-value": o(l).searchKey,
239
- "column-filter": [],
240
- onRowClick: t[4] || (t[4] = (a) => C(a.original)),
241
- "hide-footer": o(w).length < 10
242
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
243
- r(q, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
244
- default: x(() => [
245
- (f(!0), V(A, null, X(o(w).filter(
246
- (a) => a.name.toLowerCase().includes(o(l).searchKey.toLowerCase())
247
- ), (a) => (f(), L(O, {
248
- key: a._id.toString(),
249
- onClick: (F) => C(a),
250
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
251
- }, {
252
- default: x(() => {
253
- var F;
254
- return [
255
- n("div", we, [
256
- n("div", Ce, [
257
- (f(), L(Y(o(D)(a))))
258
- ]),
259
- n("div", xe, [
260
- n("div", ve, g(a.name), 1),
261
- n("div", be, g(o(G)(a)), 1)
262
- ]),
263
- n("div", ke, g(o(d)("connect.program.game.token_received", {
264
- count: ((F = a.pf_collectible) == null ? void 0 : F.currentReceive) ?? 0
265
- })), 1)
266
- ]),
267
- n("div", Fe, [
268
- r(k, {
269
- icon: "content_copy",
270
- "icon-color": "neutral-gray-400",
271
- variant: "tertiary",
272
- onClick: async (S) => {
273
- S.stopPropagation(), await M(a);
274
- }
275
- }, null, 8, ["onClick"]),
276
- r(k, {
277
- icon: "delete",
278
- "icon-color": "neutral-gray-400",
279
- variant: "tertiary",
280
- onClick: (S) => (S.stopPropagation(), E(a))
281
- }, null, 8, ["onClick"])
282
- ])
283
- ];
284
- }),
285
- _: 2
286
- }, 1032, ["onClick"]))), 128))
287
- ]),
288
- _: 1
289
- })
290
- ], 64)) : (f(), L(z, {
291
- key: 1,
292
- variant: "outlined",
293
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
294
- }, {
295
- default: x(() => [
296
- t[6] || (t[6] = n("img", {
297
- src: Z,
298
- class: "aspect-square w-[150px]"
299
- }, null, -1)),
300
- n("div", Se, [
301
- n("div", Pe, g(o(d)("connect.program.game.empty_state.title")), 1),
302
- n("div", Ve, g(o(d)("connect.program.game.empty_state.description")), 1)
303
- ]),
304
- r(k, {
305
- variant: "primary",
306
- label: "Create game program",
307
- icon: "add",
308
- disabled: !o(h).isPremium,
309
- onClick: t[5] || (t[5] = (a) => C())
310
- }, null, 8, ["disabled"])
311
- ]),
312
- _: 1
313
- })),
314
- r(me, {
315
- ref_key: "sheetRef",
316
- ref: v,
317
- "onSubmit:modelValue": H
318
- }, null, 512),
319
- r(pe, {
320
- ref_key: "sendCollectionSheetRef",
321
- ref: $
322
- }, null, 512)
323
- ])
324
- ], 64);
325
- };
326
- }
327
- });
328
- export {
329
- Ne as default
330
- };