@feedmepos/mf-connect 0.1.38-beta.61 → 0.1.38-beta.62

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 (107) hide show
  1. package/dist/{Analytic-CM7mh-iO.js → Analytic-Ktq94hC8.js} +14 -14
  2. package/dist/{App-CeCzzsDu.js → App-Daubz7oj.js} +7 -7
  3. package/dist/{AuditLogs-VWx8DFKA.js → AuditLogs-Bwoks-rM.js} +9 -9
  4. package/dist/{Bin-vUuol_I9.js → Bin-asHUb1BJ.js} +8 -8
  5. package/dist/Broadcast-BVB-Mjqq.js +267 -0
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CV-zhJ15.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CczwlN2n.js} +6 -6
  7. package/dist/{Card-CeIeGET1.js → Card-Bp4EJbgK.js} +17 -17
  8. package/dist/{Collections-CF_OcAL3.js → Collections-CyDN3QhT.js} +7 -7
  9. package/dist/Credit-DrwSgNh7.js +261 -0
  10. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-0DMFuBoG.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-n8_AVbJA.js} +203 -199
  11. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BZfchHlT.js → EffectSheet.vue_vue_type_style_index_0_lang-DnAOFGed.js} +6 -6
  12. package/dist/Experience-BBrZLaRM.js +260 -0
  13. package/dist/{FileSaver.min-lgg_oBvT.js → FileSaver.min-o8dgYPp0.js} +1 -1
  14. package/dist/Game-AxwzBRrJ.js +331 -0
  15. package/dist/{GenerateMaterial-B5A7mx2y.js → GenerateMaterial-BObD7Yrf.js} +6 -6
  16. package/dist/{Grab-BgiMqwvj.js → Grab-CiN-phhI.js} +9 -9
  17. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-DZ8DHrQ_.js → ImageInput.vue_vue_type_script_setup_true_lang-CgdcGP3N.js} +1 -1
  18. package/dist/{Index-B85ops8K.js → Index-CQXbQ7vK.js} +10 -10
  19. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-B5rIjxYd.js → LottieAnimation.vue_vue_type_script_setup_true_lang-D53NnPhs.js} +1 -1
  20. package/dist/{MainLayout-CXGVkD-W.js → MainLayout-COA3zuDN.js} +1 -1
  21. package/dist/{Marketing-Bnijl7lA.js → Marketing-_0bICW80.js} +4 -4
  22. package/dist/{MarketingMaterialEdit-BlUKwSoP.js → MarketingMaterialEdit-L1ab7aJG.js} +4 -4
  23. package/dist/{Member-sT853g51.js → Member-C9RRcxUA.js} +11 -11
  24. package/dist/{MemberList-DYT5_fSP.js → MemberList-CSe2F9QS.js} +25 -25
  25. package/dist/{MemberTransactions-Cqce5ebe.js → MemberTransactions-Da1Nfbi4.js} +1 -1
  26. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-Dq0Hswj8.js → MessageInput.vue_vue_type_script_setup_true_lang-DjYaXNTE.js} +8 -8
  27. package/dist/Mission-CTJANu6a.js +335 -0
  28. package/dist/{Overview-B0rwrHR1.js → Overview-CgrXFJ5H.js} +18 -18
  29. package/dist/Point-B4g37KPT.js +263 -0
  30. package/dist/Promotion-V0MoAX2t.js +397 -0
  31. package/dist/{Queue-SVqRUlD_.js → Queue-uUrzJCdY.js} +10 -10
  32. package/dist/{Record-BTjg4ihy.js → Record-BT-4kOS8.js} +9 -9
  33. package/dist/{Reward-DW58VMRO.js → Reward-Cqfur_b7.js} +16 -16
  34. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-s1RI55Rc.js → RewardGroup.vue_vue_type_script_setup_true_lang-CWFxdopa.js} +11 -11
  35. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-Os17lXBX.js → RuleGroup.vue_vue_type_script_setup_true_lang-C5BATPr7.js} +14 -14
  36. package/dist/{Segment-Dny8pxP1.js → Segment-DlzmOheV.js} +24 -24
  37. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-Czx7rqiq.js → SelectItems.vue_vue_type_script_setup_true_lang-Bur2bSCd.js} +2 -2
  38. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-EgVxUG_N.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-BqYZehIO.js} +12 -12
  39. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-CO0fgI3K.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-CXot-RF0.js} +4 -4
  40. package/dist/{Setting-CjcnxK34.js → Setting-CtIHp56x.js} +13 -13
  41. package/dist/{SettingAdvertisements-CIyDF4C8.js → SettingAdvertisements-nT78blMx.js} +11 -11
  42. package/dist/{Store-B8k5YVqU.js → Store-DA54GAU7.js} +20 -20
  43. package/dist/{StoreRewards-BW08rwpL.js → StoreRewards-BH_CG0_m.js} +14 -14
  44. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-BfFSfE2H.js → StoreTransactions.vue_vue_type_script_setup_true_lang-yX42EwdC.js} +19 -19
  45. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-CZkKjUNQ.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-CJSNkho6.js} +1 -1
  46. package/dist/{Tier-DKzu4tYw.js → Tier-Bv9Jc58B.js} +23 -23
  47. package/dist/{Title-BK-TXatJ.js → Title-BzhaAeWE.js} +20 -20
  48. package/dist/{Transaction-Duayg1jd.js → Transaction-D6l7eUto.js} +2 -2
  49. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BAR9h1TV.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BOlKr1u5.js} +6 -6
  50. package/dist/{Voucher-BEVAkNeJ.js → Voucher-c9rOPty1.js} +164 -142
  51. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DvFy9Z6X.js → VoucherEditor.vue_vue_type_script_setup_true_lang-gM2Q2SZj.js} +12 -12
  52. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-CU_Sx2PM.js → ZodTextField.vue_vue_type_script_setup_true_lang--cPeKAQK.js} +2 -2
  53. package/dist/{app-IvbII0ql.js → app-rrEjDuDH.js} +78 -48
  54. package/dist/app.js +1 -1
  55. package/dist/{business-BFIwFfkq.js → business-BtKxs_y6.js} +1 -1
  56. package/dist/{campaign-w9j4I4jn.js → campaign-Dp6iTHEz.js} +2 -2
  57. package/dist/{campaign-RuIwxc4y.js → campaign-rXQhZIDH.js} +8 -8
  58. package/dist/{campaign.enum-IHLsfdik.js → campaign.enum-Deak-UID.js} +1 -1
  59. package/dist/{campaign.fn-B_P1MkRV.js → campaign.fn-At50e4px.js} +32 -32
  60. package/dist/{collectible.enum-CUgSjO08.js → collectible.enum-BKAKCyYj.js} +1 -1
  61. package/dist/{collection.fn-CrfnNb41.js → collection.fn-DPhZ4J5s.js} +2 -2
  62. package/dist/{dto-jwO_sX9I.js → dto-Dr0nOU62.js} +4 -4
  63. package/dist/duplicateCampaign-5fhHX37P.js +35 -0
  64. package/dist/{effect--0g8PNyt.js → effect-CFMQ5REv.js} +1 -1
  65. package/dist/{email-addresses-HtsxvXw9.js → email-addresses-RpPqY7Ns.js} +2 -2
  66. package/dist/{export-CFEwMRmd.js → export-CYQVBcQQ.js} +2 -2
  67. package/dist/{helper-CCfb24PO.js → helper-NA1sBf5O.js} +1 -1
  68. package/dist/{index-CR3f3BXQ.js → index-B5ZaTTfd.js} +4 -4
  69. package/dist/{index-CppLPpqB.js → index-B7JPvTGD.js} +3 -3
  70. package/dist/{index-CkuPY85X.js → index-CA1VTtfl.js} +1 -1
  71. package/dist/{index-wzSeRJAd.js → index-CXj0NuF-.js} +1 -1
  72. package/dist/{index-Bflu4Rft.js → index-CfdrsgL1.js} +3 -3
  73. package/dist/{index-BR3UbZ0F.js → index-Cjz7ja8g.js} +1 -1
  74. package/dist/{index-DDYH-IEX.js → index-DQBsBSAl.js} +1 -1
  75. package/dist/{index-B-AMMFfT.js → index-De8KJ5ee.js} +4 -4
  76. package/dist/{index-DdZdHioZ.js → index-DgbKnxUQ.js} +6 -6
  77. package/dist/{index-BZEM0T2A.js → index-DoQbrp4H.js} +1 -1
  78. package/dist/{index-Dic_WcAL.js → index-Du1J2M6c.js} +1 -1
  79. package/dist/{index-CZPcwcUo.js → index-FB5JDcqo.js} +3 -3
  80. package/dist/{index-DpjYgKTN.js → index-ZDRZDJJ-.js} +1 -1
  81. package/dist/{index.esm2017-CUnjzfU-.js → index.esm2017-DWyiVIYc.js} +1 -1
  82. package/dist/{loading-CivgDw5C.js → loading-BsFOHhQ7.js} +2 -2
  83. package/dist/{lodash-BSbv_9TG.js → lodash-DYYviyoC.js} +1 -1
  84. package/dist/{membership-j2w1YUO-.js → membership-UU6e1zGd.js} +3 -3
  85. package/dist/{money-DL-x8hiT.js → money-CreQ4gmS.js} +1 -1
  86. package/dist/{number-D1yoFGEr.js → number-CVU6hHec.js} +1 -1
  87. package/dist/{objectid-CHab6j3r.js → objectid-C23E4-r1.js} +13 -13
  88. package/dist/{plugins-P-V4XWmW.js → plugins-DhptoQqr.js} +3 -3
  89. package/dist/{reward-BqMlBQRu.js → reward-CawSKEN7.js} +1 -1
  90. package/dist/{rule-CztsLdki.js → rule-DfoqRN4t.js} +3 -3
  91. package/dist/{rule-builder-DANv7Rmz.js → rule-builder-TeN72YwV.js} +1 -1
  92. package/dist/{template-Dbz3FhHK.js → template-CFKkBFuQ.js} +6 -6
  93. package/dist/{timezone-BgVqObBq.js → timezone-aMH10XL_.js} +2 -2
  94. package/dist/{trigger-CbriUibd.js → trigger-wauWh36i.js} +5 -5
  95. package/dist/{usePagination-DtNK7W0U.js → usePagination-CMQVYF13.js} +1 -1
  96. package/dist/{user-CVapqHfr.js → user-DaUp8rok.js} +1 -1
  97. package/dist/{vue-i18n-tpDAnnmD.js → vue-i18n-gi9JUtvo.js} +157 -157
  98. package/dist/{xlsx-EewcN2uY.js → xlsx-BNx9zr-c.js} +1 -1
  99. package/dist/{zod-D-wiCQRJ.js → zod-_ZFtblDD.js} +1 -1
  100. package/package.json +1 -1
  101. package/dist/Broadcast-6VXz4-IG.js +0 -233
  102. package/dist/Credit-BUqGOyp_.js +0 -226
  103. package/dist/Experience-BxiFH_uV.js +0 -225
  104. package/dist/Game-BzYW0LfY.js +0 -300
  105. package/dist/Mission-Q5_sGgrm.js +0 -304
  106. package/dist/Point-BGYFMvev.js +0 -228
  107. package/dist/Promotion-0acd63nA.js +0 -364
@@ -1,10 +1,10 @@
1
1
  import { defineComponent as B, ref as P, onMounted as Q, computed as q, resolveComponent as V, openBlock as d, createElementBlock as F, renderSlot as W, toDisplayString as b, createCommentVNode as f, createBlock as u, unref as e, isRef as G, createVNode as w, normalizeClass as Z, watch as X, withCtx as h, resolveDynamicComponent as R, Fragment as _, createElementVNode as C, createTextVNode as ee } from "vue";
2
- import { z as te, h as le } from "./app-IvbII0ql.js";
3
- import { Z as m } from "./zod-D-wiCQRJ.js";
4
- import { g as oe, f as ae } from "./index-Bflu4Rft.js";
5
- import { u as T } from "./vue-i18n-tpDAnnmD.js";
6
- import { s as O } from "./effect--0g8PNyt.js";
7
- import { p as ne } from "./plugins-P-V4XWmW.js";
2
+ import { z as te, h as le } from "./app-rrEjDuDH.js";
3
+ import { Z as m } from "./zod-_ZFtblDD.js";
4
+ import { g as oe, f as ae } from "./index-CfdrsgL1.js";
5
+ import { u as T } from "./vue-i18n-gi9JUtvo.js";
6
+ import { s as O } from "./effect-CFMQ5REv.js";
7
+ import { p as ne } from "./plugins-DhptoQqr.js";
8
8
  const ie = { class: "flex flex-col gap-8" }, de = {
9
9
  key: 0,
10
10
  class: "fm-typo-en-body-lg-600"
@@ -0,0 +1,260 @@
1
+ import { defineComponent as M, ref as P, computed as H, onMounted as q, resolveComponent as m, openBlock as d, createElementBlock as w, Fragment as C, createVNode as s, unref as o, createElementVNode as n, withCtx as v, renderList as z, createBlock as b, resolveDynamicComponent as G, toDisplayString as _, h as k } from "vue";
2
+ import { _ as J } from "./campaign-CpzFl8Vr.js";
3
+ import { useDialog as Q, components as B } from "@feedmepos/ui-library";
4
+ import { p as W } from "./plugins-DhptoQqr.js";
5
+ import { u as X } from "./loading-BsFOHhQ7.js";
6
+ import { u as Y } from "./business-BtKxs_y6.js";
7
+ import { u as Z } from "./campaign-Dp6iTHEz.js";
8
+ import { b as I, c as V, a as ee } from "./campaign-rXQhZIDH.js";
9
+ import { c as te, p as oe } from "./duplicateCampaign-5fhHX37P.js";
10
+ import { u as ae } from "./vue-i18n-gi9JUtvo.js";
11
+ import { _ as ne } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
12
+ import { _ as re } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-n8_AVbJA.js";
13
+ import { u as ie } from "./template-CFKkBFuQ.js";
14
+ import { c as u } from "./index-ZDRZDJJ-.js";
15
+ const se = { class: "px-24 flex flex-col gap-y-16" }, ce = { class: "flex items-center justify-between w-full" }, le = { class: "flex gap-8 overflow-x-auto" }, me = { class: "space-y-8" }, pe = { class: "flex w-full gap-4 items-center" }, de = { 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 items-center gap-8" }, ye = { class: "flex flex-col gap-16 text-center" }, _e = { class: "fm-typo-en-title-sm-800" }, he = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, $e = /* @__PURE__ */ M({
16
+ __name: "Experience",
17
+ setup(xe) {
18
+ const { t: r } = ae(), T = {
19
+ label: r("connect.program.common.actions.create", {
20
+ type: r("connect.program.experience.title").toLowerCase()
21
+ }),
22
+ value: "create",
23
+ isPrimary: !0,
24
+ prependIcon: "add"
25
+ }, N = ie("POINT", Q()), $ = Y(), p = Z(), { global: D, minor: F } = X, c = P({
26
+ searchKey: "",
27
+ location: []
28
+ });
29
+ function K(e) {
30
+ const t = c.value.location;
31
+ return !t || t.length === 0 || !e.targetLocation ? !0 : Array.isArray(t) ? t.some((l) => {
32
+ var i;
33
+ return (i = e == null ? void 0 : e.targetLocation) == null ? void 0 : i.includes(l);
34
+ }) : e.targetLocation.includes(t);
35
+ }
36
+ const f = H(
37
+ () => p.campaigns.experience.filter((e) => K(e))
38
+ ), O = [
39
+ {
40
+ header: "Program title",
41
+ accessorFn: (e) => e.name
42
+ },
43
+ {
44
+ header: "Status",
45
+ accessorFn: (e) => ee(e),
46
+ cell(e) {
47
+ return I(e.row.original);
48
+ }
49
+ },
50
+ {
51
+ header: "Summary",
52
+ accessorFn: (e) => V(e)
53
+ //v.effect,
54
+ },
55
+ {
56
+ header: "Actions",
57
+ cell(e) {
58
+ return k("div", { class: "flex items-center gap-8 justify-end" }, [
59
+ k(B.FmButton, {
60
+ variant: "tertiary",
61
+ icon: "content_copy",
62
+ iconColor: "neutral-gray-400",
63
+ onClick: async (t) => {
64
+ t.stopPropagation(), await L(e.row.original);
65
+ }
66
+ }),
67
+ k(B.FmButton, {
68
+ variant: "tertiary",
69
+ icon: "delete",
70
+ iconColor: "neutral-gray-400",
71
+ onClick: (t) => {
72
+ t.stopPropagation(), S(e.row.original);
73
+ }
74
+ })
75
+ ]);
76
+ }
77
+ }
78
+ ], h = P();
79
+ async function S(e) {
80
+ await W.remove(`Are you sure you want to remove ${e.name}?`) && await F(
81
+ async () => {
82
+ await u.delete(e._id), await p.read("POINT");
83
+ },
84
+ {
85
+ message: `Removing ${e.name}`,
86
+ successMessage: `Removed ${e.name} successfully`
87
+ }
88
+ );
89
+ }
90
+ async function g(e) {
91
+ e ? await t() : N.open(async (l) => {
92
+ await t(l);
93
+ });
94
+ async function t(l) {
95
+ var i;
96
+ (i = h.value) == null || i.showSheet(
97
+ !0,
98
+ "POINT",
99
+ e ? await u.readById(e._id) : void 0,
100
+ l
101
+ );
102
+ }
103
+ }
104
+ async function L(e) {
105
+ var i;
106
+ if (!await te(e.name))
107
+ return;
108
+ const t = await u.readById(e._id), l = oe(t, {
109
+ keepCollectible: !0
110
+ });
111
+ (i = h.value) == null || i.showSheet(
112
+ !0,
113
+ "POINT",
114
+ l,
115
+ t.template
116
+ );
117
+ }
118
+ async function A(e) {
119
+ await F(
120
+ async () => {
121
+ e.campaign._id ? await u.update(e.campaign._id, e) : await u.create(e), await p.read("POINT");
122
+ },
123
+ {
124
+ message: r("connect.program.common.update.updating", {
125
+ type: r("connect.program.experience.title")
126
+ }),
127
+ successMessage: r("connect.program.common.update.success", {
128
+ type: r("connect.program.experience.title"),
129
+ action: e.campaign._id ? "updated" : "created"
130
+ })
131
+ }
132
+ );
133
+ }
134
+ return q(async () => {
135
+ await D(async () => {
136
+ await p.read("POINT");
137
+ });
138
+ }), (e, t) => {
139
+ const l = m("FmPageHead"), i = m("FmSearch"), R = m("FmTable"), x = m("FmButton"), j = m("FmListItem"), E = m("FmList"), U = m("FmCard");
140
+ return d(), w(C, null, [
141
+ s(l, {
142
+ title: o(r)("connect.program.experience.title"),
143
+ actions: o(f).length > 0 ? [T] : [],
144
+ "onClick:action": t[0] || (t[0] = () => g())
145
+ }, null, 8, ["title", "actions"]),
146
+ n("div", se, [
147
+ s(i, {
148
+ modelValue: o(c).searchKey,
149
+ "onUpdate:modelValue": t[1] || (t[1] = (a) => o(c).searchKey = a),
150
+ class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
151
+ placeholder: o(r)("connect.program.common.search"),
152
+ collapsible: ""
153
+ }, null, 8, ["modelValue", "placeholder"]),
154
+ o(p).campaigns.experience && o(p).campaigns.experience.length > 0 ? (d(), w(C, { key: 0 }, [
155
+ n("div", ce, [
156
+ n("div", le, [
157
+ s(ne, {
158
+ label: `${o(r)("connect.common.location")}: `,
159
+ "right-icon": "keyboard_arrow_down",
160
+ modelValue: o(c).location,
161
+ "onUpdate:modelValue": t[2] || (t[2] = (a) => o(c).location = a),
162
+ icon: "storefront",
163
+ "show-item-label": !0,
164
+ items: o($).locationOptions
165
+ }, null, 8, ["label", "modelValue", "items"])
166
+ ]),
167
+ s(i, {
168
+ modelValue: o(c).searchKey,
169
+ "onUpdate:modelValue": t[3] || (t[3] = (a) => o(c).searchKey = a),
170
+ class: "xs:hidden sm:hidden",
171
+ placeholder: "search",
172
+ collapsible: ""
173
+ }, null, 8, ["modelValue"])
174
+ ]),
175
+ s(R, {
176
+ class: "xs:hidden sm:hidden",
177
+ "row-data": o(f),
178
+ "column-defs": O,
179
+ "search-value": o(c).searchKey,
180
+ "column-filter": [],
181
+ onRowClick: t[4] || (t[4] = (a) => g(a.original)),
182
+ "hide-footer": o(f).length < 10
183
+ }, null, 8, ["row-data", "search-value", "hide-footer"]),
184
+ s(E, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
185
+ default: v(() => [
186
+ (d(!0), w(C, null, z(o(f).filter(
187
+ (a) => a.name.toLowerCase().includes(o(c).searchKey.toLowerCase())
188
+ ), (a) => (d(), b(j, {
189
+ key: a._id.toString(),
190
+ onClick: (y) => g(a),
191
+ class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
192
+ }, {
193
+ default: v(() => [
194
+ n("div", me, [
195
+ n("div", pe, [
196
+ (d(), b(G(o(I)(a))))
197
+ ]),
198
+ n("div", de, [
199
+ n("div", ue, _(a.name), 1),
200
+ n("div", fe, _(o(V)(a)), 1)
201
+ ])
202
+ ]),
203
+ n("div", ge, [
204
+ s(x, {
205
+ icon: "content_copy",
206
+ "icon-color": "neutral-gray-400",
207
+ variant: "tertiary",
208
+ onClick: async (y) => {
209
+ y.stopPropagation(), await L(a);
210
+ }
211
+ }, null, 8, ["onClick"]),
212
+ s(x, {
213
+ icon: "delete",
214
+ "icon-color": "neutral-gray-400",
215
+ variant: "tertiary",
216
+ onClick: (y) => (y.stopPropagation(), S(a))
217
+ }, null, 8, ["onClick"])
218
+ ])
219
+ ]),
220
+ _: 2
221
+ }, 1032, ["onClick"]))), 128))
222
+ ]),
223
+ _: 1
224
+ })
225
+ ], 64)) : (d(), b(U, {
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: v(() => [
231
+ t[6] || (t[6] = n("img", {
232
+ src: J,
233
+ class: "aspect-square w-[150px]"
234
+ }, null, -1)),
235
+ n("div", ye, [
236
+ n("div", _e, _(o(r)("connect.program.experience.empty_state.title")), 1),
237
+ n("div", he, _(o(r)("connect.program.experience.empty_state.description")), 1)
238
+ ]),
239
+ s(x, {
240
+ variant: "primary",
241
+ label: "Create experience program",
242
+ icon: "add",
243
+ onClick: t[5] || (t[5] = (a) => g())
244
+ })
245
+ ]),
246
+ _: 1
247
+ })),
248
+ s(re, {
249
+ ref_key: "sheetRef",
250
+ ref: h,
251
+ "onSubmit:modelValue": A
252
+ }, null, 512)
253
+ ])
254
+ ], 64);
255
+ };
256
+ }
257
+ });
258
+ export {
259
+ $e as default
260
+ };
@@ -1,4 +1,4 @@
1
- import { c as s } from "./app-IvbII0ql.js";
1
+ import { c as s } from "./app-rrEjDuDH.js";
2
2
  var E = { exports: {} };
3
3
  (function(h, j) {
4
4
  (function(p, i) {
@@ -0,0 +1,331 @@
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 { a as te, p as oe } from "./plugins-DhptoQqr.js";
5
+ import { u as ae } from "./loading-BsFOHhQ7.js";
6
+ import { u as ne } from "./business-BtKxs_y6.js";
7
+ import { u as ie } from "./campaign-Dp6iTHEz.js";
8
+ import { b as D, c as G, a as se } from "./campaign-rXQhZIDH.js";
9
+ import { c as re, p as le } from "./duplicateCampaign-5fhHX37P.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-n8_AVbJA.js";
12
+ import { u as de } from "./template-CFKkBFuQ.js";
13
+ import { u as ue } from "./vue-i18n-gi9JUtvo.js";
14
+ import { _ as pe } from "./SendCollectionSheet.vue_vue_type_script_setup_true_lang-BqYZehIO.js";
15
+ import { c as _ } from "./index-ZDRZDJJ-.js";
16
+ 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" }, Oe = /* @__PURE__ */ W({
17
+ __name: "Game",
18
+ setup(Ae) {
19
+ const { t: d } = ue(), K = {
20
+ label: d("connect.program.common.actions.create", {
21
+ type: d("connect.program.game.title").toLowerCase()
22
+ }),
23
+ value: "create",
24
+ isPrimary: !0,
25
+ prependIcon: "add"
26
+ }, B = ee(), U = de("GAME", B), h = ne(), u = ie(), { global: I, minor: R } = ae, l = P({
27
+ searchKey: "",
28
+ location: []
29
+ });
30
+ function T(e) {
31
+ const t = l.value.location;
32
+ return !t || t.length === 0 || !e.targetLocation ? !0 : Array.isArray(t) ? t.some((s) => {
33
+ var i;
34
+ return (i = e == null ? void 0 : e.targetLocation) == null ? void 0 : i.includes(s);
35
+ }) : e.targetLocation.includes(t);
36
+ }
37
+ const w = J(
38
+ () => u.campaigns.token.filter((e) => T(e))
39
+ ), j = [
40
+ {
41
+ header: "Program title",
42
+ accessorKey: "name",
43
+ // accessorFn: (v) => v.name,
44
+ cell(e) {
45
+ return c("div", { class: "flex items-center justify-between gap-4" }, [
46
+ c("div", { class: "flex items-center" }, [
47
+ c(
48
+ y.FmTooltip,
49
+ {
50
+ content: e.row.original._id,
51
+ onClick: (t) => {
52
+ t.stopPropagation(), te(e.row.original._id);
53
+ }
54
+ },
55
+ [
56
+ c(y.FmIcon, {
57
+ name: "info",
58
+ outline: !0,
59
+ size: "sm"
60
+ })
61
+ ]
62
+ )
63
+ ]),
64
+ c("div", { class: "flex-1" }, e.row.original.name)
65
+ ]);
66
+ }
67
+ },
68
+ {
69
+ header: "Status",
70
+ accessorFn: (e) => se(e),
71
+ cell(e) {
72
+ return D(e.row.original);
73
+ }
74
+ },
75
+ {
76
+ header: "Summary",
77
+ accessorFn: (e) => G(e)
78
+ //v.effect,
79
+ },
80
+ {
81
+ header: "Token received",
82
+ accessorFn: (e) => {
83
+ var t;
84
+ return ((t = e == null ? void 0 : e.pf_collectible) == null ? void 0 : t.currentReceive) ?? 0;
85
+ }
86
+ },
87
+ {
88
+ header: "Actions",
89
+ cell(e) {
90
+ return c("div", { class: "flex items-center gap-8" }, [
91
+ c(y.FmButton, {
92
+ variant: "tertiary",
93
+ icon: "content_copy",
94
+ iconColor: "neutral-gray-400",
95
+ onClick: async (t) => {
96
+ t.stopPropagation(), await M(e.row.original);
97
+ }
98
+ }),
99
+ c(y.FmButton, {
100
+ variant: "tertiary",
101
+ icon: "send",
102
+ iconColor: "neutral-gray-400",
103
+ onClick: (t) => {
104
+ t.stopPropagation(), N(e.row.original);
105
+ }
106
+ }),
107
+ c(y.FmButton, {
108
+ variant: "tertiary",
109
+ icon: "delete",
110
+ iconColor: "neutral-gray-400",
111
+ onClick: (t) => {
112
+ t.stopPropagation(), E(e.row.original);
113
+ }
114
+ })
115
+ ]);
116
+ }
117
+ }
118
+ ], v = P(), $ = P();
119
+ async function E(e) {
120
+ await oe.remove(`Are you sure you want to remove ${e.name}?`) && await R(
121
+ async () => {
122
+ await _.delete(e._id), await u.read("GAME");
123
+ },
124
+ {
125
+ message: `Removing ${e.name}`,
126
+ successMessage: `Removed ${e.name} successfully`
127
+ }
128
+ );
129
+ }
130
+ async function C(e) {
131
+ e ? await t() : U.open(async (s) => {
132
+ await t(s);
133
+ });
134
+ async function t(s) {
135
+ var i;
136
+ (i = v.value) == null || i.showSheet(
137
+ !0,
138
+ "GAME",
139
+ e ? await _.readById(e._id) : void 0,
140
+ s
141
+ );
142
+ }
143
+ }
144
+ async function M(e) {
145
+ var i;
146
+ if (!await re(e.name))
147
+ return;
148
+ const t = await _.readById(e._id), s = le(t);
149
+ (i = v.value) == null || i.showSheet(
150
+ !0,
151
+ "GAME",
152
+ s,
153
+ t.template
154
+ );
155
+ }
156
+ async function H(e) {
157
+ var t, s, i;
158
+ e.campaign._id && ((i = (s = (t = e.campaign) == null ? void 0 : t.game) == null ? void 0 : s.rewards) != null && i.some(
159
+ (p) => p.type === "VOUCHER"
160
+ )) && await new Promise((p) => {
161
+ B.open({
162
+ title: "Confirmation",
163
+ message: "This will change all future vouchers? Would you like to update previous claimed vouchers expiry date and discount?",
164
+ primaryActions: { text: "Update all", close: !0 },
165
+ secondaryActions: { text: "Update future only", close: !0 }
166
+ }).onPrimary(async () => {
167
+ e.updateCollections = !0, p();
168
+ }).onSecondary(async () => {
169
+ p();
170
+ });
171
+ }), await R(
172
+ async () => {
173
+ e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await u.read("GAME");
174
+ },
175
+ {
176
+ message: `${e.campaign._id ? "Updating" : "Creating"} game program`,
177
+ successMessage: `Game program ${e.campaign._id ? "updated" : "created"} successfully`
178
+ }
179
+ );
180
+ }
181
+ function N(e) {
182
+ var t;
183
+ (t = $.value) == null || t.showSheet({
184
+ campaign: e
185
+ });
186
+ }
187
+ return Q(async () => {
188
+ await I(async () => {
189
+ await u.read("GAME"), await h.readPremium();
190
+ });
191
+ }), (e, t) => {
192
+ 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");
193
+ return f(), V(A, null, [
194
+ r(i, {
195
+ actions: o(w).length > 0 && o(h).isPremium ? [K] : [],
196
+ "onClick:action": t[0] || (t[0] = () => C())
197
+ }, {
198
+ title: x(() => [
199
+ n("div", fe, [
200
+ n("span", ge, g(o(d)("connect.program.game.title")), 1),
201
+ r(s, { variant: "premium" })
202
+ ])
203
+ ]),
204
+ _: 1
205
+ }, 8, ["actions"]),
206
+ n("div", ye, [
207
+ r(b, {
208
+ modelValue: o(l).searchKey,
209
+ "onUpdate:modelValue": t[1] || (t[1] = (a) => o(l).searchKey = a),
210
+ class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
211
+ placeholder: "search",
212
+ collapsible: ""
213
+ }, null, 8, ["modelValue"]),
214
+ o(u).campaigns.token && o(u).campaigns.token.length > 0 ? (f(), V(A, { key: 0 }, [
215
+ n("div", _e, [
216
+ n("div", he, [
217
+ r(ce, {
218
+ label: `${o(d)("connect.common.location")}: `,
219
+ "right-icon": "keyboard_arrow_down",
220
+ modelValue: o(l).location,
221
+ "onUpdate:modelValue": t[2] || (t[2] = (a) => o(l).location = a),
222
+ icon: "storefront",
223
+ "show-item-label": !0,
224
+ items: o(h).locationOptions
225
+ }, null, 8, ["label", "modelValue", "items"])
226
+ ]),
227
+ r(b, {
228
+ modelValue: o(l).searchKey,
229
+ "onUpdate:modelValue": t[3] || (t[3] = (a) => o(l).searchKey = a),
230
+ class: "xs:hidden sm:hidden",
231
+ placeholder: "search",
232
+ collapsible: ""
233
+ }, null, 8, ["modelValue"])
234
+ ]),
235
+ r(p, {
236
+ class: "xs:hidden sm:hidden",
237
+ "row-data": o(w),
238
+ "column-defs": j,
239
+ "search-value": o(l).searchKey,
240
+ "column-filter": [],
241
+ onRowClick: t[4] || (t[4] = (a) => C(a.original)),
242
+ "hide-footer": o(w).length < 10
243
+ }, null, 8, ["row-data", "search-value", "hide-footer"]),
244
+ r(q, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
245
+ default: x(() => [
246
+ (f(!0), V(A, null, X(o(w).filter(
247
+ (a) => a.name.toLowerCase().includes(o(l).searchKey.toLowerCase())
248
+ ), (a) => (f(), L(O, {
249
+ key: a._id.toString(),
250
+ onClick: (F) => C(a),
251
+ class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
252
+ }, {
253
+ default: x(() => {
254
+ var F;
255
+ return [
256
+ n("div", we, [
257
+ n("div", Ce, [
258
+ (f(), L(Y(o(D)(a))))
259
+ ]),
260
+ n("div", xe, [
261
+ n("div", ve, g(a.name), 1),
262
+ n("div", be, g(o(G)(a)), 1)
263
+ ]),
264
+ n("div", ke, g(o(d)("connect.program.game.token_received", {
265
+ count: ((F = a.pf_collectible) == null ? void 0 : F.currentReceive) ?? 0
266
+ })), 1)
267
+ ]),
268
+ n("div", Fe, [
269
+ r(k, {
270
+ icon: "content_copy",
271
+ "icon-color": "neutral-gray-400",
272
+ variant: "tertiary",
273
+ onClick: async (S) => {
274
+ S.stopPropagation(), await M(a);
275
+ }
276
+ }, null, 8, ["onClick"]),
277
+ r(k, {
278
+ icon: "delete",
279
+ "icon-color": "neutral-gray-400",
280
+ variant: "tertiary",
281
+ onClick: (S) => (S.stopPropagation(), E(a))
282
+ }, null, 8, ["onClick"])
283
+ ])
284
+ ];
285
+ }),
286
+ _: 2
287
+ }, 1032, ["onClick"]))), 128))
288
+ ]),
289
+ _: 1
290
+ })
291
+ ], 64)) : (f(), L(z, {
292
+ key: 1,
293
+ variant: "outlined",
294
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
295
+ }, {
296
+ default: x(() => [
297
+ t[6] || (t[6] = n("img", {
298
+ src: Z,
299
+ class: "aspect-square w-[150px]"
300
+ }, null, -1)),
301
+ n("div", Se, [
302
+ n("div", Pe, g(o(d)("connect.program.game.empty_state.title")), 1),
303
+ n("div", Ve, g(o(d)("connect.program.game.empty_state.description")), 1)
304
+ ]),
305
+ r(k, {
306
+ variant: "primary",
307
+ label: "Create game program",
308
+ icon: "add",
309
+ disabled: !o(h).isPremium,
310
+ onClick: t[5] || (t[5] = (a) => C())
311
+ }, null, 8, ["disabled"])
312
+ ]),
313
+ _: 1
314
+ })),
315
+ r(me, {
316
+ ref_key: "sheetRef",
317
+ ref: v,
318
+ "onSubmit:modelValue": H
319
+ }, null, 512),
320
+ r(pe, {
321
+ ref_key: "sendCollectionSheetRef",
322
+ ref: $
323
+ }, null, 512)
324
+ ])
325
+ ], 64);
326
+ };
327
+ }
328
+ });
329
+ export {
330
+ Oe as default
331
+ };