@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,224 +0,0 @@
1
- import { defineComponent as E, ref as S, computed as U, onMounted as j, resolveComponent as m, openBlock as p, createElementBlock as _, Fragment as h, createVNode as i, unref as o, createElementVNode as n, withCtx as x, renderList as M, createBlock as w, resolveDynamicComponent as H, toDisplayString as g, h as q } from "vue";
2
- import { _ as z } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as G, components as J } from "@feedmepos/ui-library";
4
- import { p as Q } from "./plugins-DTrOHd7d.js";
5
- import { u as W } from "./loading-B0_BwPgo.js";
6
- import { u as X } from "./business-C8P05bjQ.js";
7
- import { u as Y, c as y } from "./campaign-DcLhSQVQ.js";
8
- import { a as L, b as V, g as Z } from "./campaign-CyYAvl3p.js";
9
- import { u as ee } from "./vue-i18n-fg0FtbNR.js";
10
- import { _ as te } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
11
- import { _ as oe } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-DysfUOSp.js";
12
- import { u as ae } from "./template-Bdwy6QXF.js";
13
- const ne = { class: "px-24 flex flex-col gap-y-16" }, re = { class: "flex items-center justify-between w-full" }, se = { class: "flex gap-8 overflow-x-auto" }, ie = { class: "space-y-8" }, ce = { class: "flex w-full gap-4 items-center" }, le = { class: "space-y-4" }, me = { class: "fm-typo-en-body-lg-600" }, de = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, pe = { class: "flex flex-col gap-16 text-center" }, ue = { class: "fm-typo-en-title-sm-800" }, fe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ve = /* @__PURE__ */ E({
14
- __name: "Experience",
15
- setup(ge) {
16
- const { t: r } = ee(), P = {
17
- label: r("connect.program.common.actions.create", {
18
- type: r("connect.program.experience.title").toLowerCase()
19
- }),
20
- value: "create",
21
- isPrimary: !0,
22
- prependIcon: "add"
23
- }, B = ae("POINT", G()), I = X(), d = Y(), { global: T, minor: b } = W, s = S({
24
- searchKey: "",
25
- location: []
26
- });
27
- function $(e) {
28
- const t = s.value.location;
29
- return !t || t.length === 0 || !e.targetLocation ? !0 : Array.isArray(t) ? t.some((l) => {
30
- var c;
31
- return (c = e == null ? void 0 : e.targetLocation) == null ? void 0 : c.includes(l);
32
- }) : e.targetLocation.includes(t);
33
- }
34
- const u = U(
35
- () => d.campaigns.experience.filter((e) => $(e))
36
- ), K = [
37
- {
38
- header: "Program title",
39
- accessorFn: (e) => e.name
40
- },
41
- {
42
- header: "Status",
43
- accessorFn: (e) => Z(e),
44
- cell(e) {
45
- return L(e.row.original);
46
- }
47
- },
48
- {
49
- header: "Summary",
50
- accessorFn: (e) => V(e)
51
- //v.effect,
52
- },
53
- {
54
- header: "Actions",
55
- cell(e) {
56
- return q(J.FmButton, {
57
- variant: "tertiary",
58
- icon: "delete",
59
- iconColor: "neutral-gray-400",
60
- onClick: (t) => {
61
- t.stopPropagation(), v(e.row.original);
62
- }
63
- });
64
- }
65
- }
66
- ], C = S();
67
- async function v(e) {
68
- await Q.remove(`Are you sure you want to remove ${e.name}?`) && await b(
69
- async () => {
70
- await y.delete(e._id), await d.read("POINT");
71
- },
72
- {
73
- message: `Removing ${e.name}`,
74
- successMessage: `Removed ${e.name} successfully`
75
- }
76
- );
77
- }
78
- async function f(e) {
79
- e ? await t() : B.open(async (l) => {
80
- await t(l);
81
- });
82
- async function t(l) {
83
- var c;
84
- (c = C.value) == null || c.showSheet(
85
- !0,
86
- "POINT",
87
- e ? await y.readById(e._id) : void 0,
88
- l
89
- );
90
- }
91
- }
92
- async function N(e) {
93
- await b(
94
- async () => {
95
- e.campaign._id ? await y.update(e.campaign._id, e) : await y.create(e), await d.read("POINT");
96
- },
97
- {
98
- message: r("connect.program.common.update.updating", {
99
- type: r("connect.program.experience.title")
100
- }),
101
- successMessage: r("connect.program.common.update.success", {
102
- type: r("connect.program.experience.title"),
103
- action: e.campaign._id ? "updated" : "created"
104
- })
105
- }
106
- );
107
- }
108
- return j(async () => {
109
- await T(async () => {
110
- await d.read("POINT");
111
- });
112
- }), (e, t) => {
113
- const l = m("FmPageHead"), c = m("FmSearch"), A = m("FmTable"), F = m("FmButton"), O = m("FmListItem"), R = m("FmList"), D = m("FmCard");
114
- return p(), _(h, null, [
115
- i(l, {
116
- title: o(r)("connect.program.experience.title"),
117
- actions: o(u).length > 0 ? [P] : [],
118
- "onClick:action": t[0] || (t[0] = () => f())
119
- }, null, 8, ["title", "actions"]),
120
- n("div", ne, [
121
- i(c, {
122
- modelValue: o(s).searchKey,
123
- "onUpdate:modelValue": t[1] || (t[1] = (a) => o(s).searchKey = a),
124
- class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
125
- placeholder: o(r)("connect.program.common.search"),
126
- collapsible: ""
127
- }, null, 8, ["modelValue", "placeholder"]),
128
- o(d).campaigns.experience && o(d).campaigns.experience.length > 0 ? (p(), _(h, { key: 0 }, [
129
- n("div", re, [
130
- n("div", se, [
131
- i(te, {
132
- label: `${o(r)("connect.common.location")}: `,
133
- "right-icon": "keyboard_arrow_down",
134
- modelValue: o(s).location,
135
- "onUpdate:modelValue": t[2] || (t[2] = (a) => o(s).location = a),
136
- icon: "storefront",
137
- "show-item-label": !0,
138
- items: o(I).locationOptions
139
- }, null, 8, ["label", "modelValue", "items"])
140
- ]),
141
- i(c, {
142
- modelValue: o(s).searchKey,
143
- "onUpdate:modelValue": t[3] || (t[3] = (a) => o(s).searchKey = a),
144
- class: "xs:hidden sm:hidden",
145
- placeholder: "search",
146
- collapsible: ""
147
- }, null, 8, ["modelValue"])
148
- ]),
149
- i(A, {
150
- class: "xs:hidden sm:hidden",
151
- "row-data": o(u),
152
- "column-defs": K,
153
- "search-value": o(s).searchKey,
154
- "column-filter": [],
155
- onRowClick: t[4] || (t[4] = (a) => f(a.original)),
156
- "hide-footer": o(u).length < 10
157
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
158
- i(R, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
159
- default: x(() => [
160
- (p(!0), _(h, null, M(o(u).filter(
161
- (a) => a.name.toLowerCase().includes(o(s).searchKey.toLowerCase())
162
- ), (a) => (p(), w(O, {
163
- key: a._id.toString(),
164
- onClick: (k) => f(a),
165
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
166
- }, {
167
- default: x(() => [
168
- n("div", ie, [
169
- n("div", ce, [
170
- (p(), w(H(o(L)(a))))
171
- ]),
172
- n("div", le, [
173
- n("div", me, g(a.name), 1),
174
- n("div", de, g(o(V)(a)), 1)
175
- ])
176
- ]),
177
- i(F, {
178
- icon: "delete",
179
- "icon-color": "neutral-gray-400",
180
- variant: "tertiary",
181
- onClick: (k) => (k.stopPropagation(), v(a))
182
- }, null, 8, ["onClick"])
183
- ]),
184
- _: 2
185
- }, 1032, ["onClick"]))), 128))
186
- ]),
187
- _: 1
188
- })
189
- ], 64)) : (p(), w(D, {
190
- key: 1,
191
- variant: "outlined",
192
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
193
- }, {
194
- default: x(() => [
195
- t[6] || (t[6] = n("img", {
196
- src: z,
197
- class: "aspect-square w-[150px]"
198
- }, null, -1)),
199
- n("div", pe, [
200
- n("div", ue, g(o(r)("connect.program.experience.empty_state.title")), 1),
201
- n("div", fe, g(o(r)("connect.program.experience.empty_state.description")), 1)
202
- ]),
203
- i(F, {
204
- variant: "primary",
205
- label: "Create experience program",
206
- icon: "add",
207
- onClick: t[5] || (t[5] = (a) => f())
208
- })
209
- ]),
210
- _: 1
211
- })),
212
- i(oe, {
213
- ref_key: "sheetRef",
214
- ref: C,
215
- "onSubmit:modelValue": N
216
- }, null, 512)
217
- ])
218
- ], 64);
219
- };
220
- }
221
- });
222
- export {
223
- Ve as default
224
- };
@@ -1,299 +0,0 @@
1
- import { defineComponent as z, ref as k, computed as W, onMounted as J, resolveComponent as c, openBlock as f, createElementBlock as F, Fragment as S, createVNode as s, unref as o, withCtx as w, createElementVNode as n, toDisplayString as g, renderList as Q, createBlock as P, resolveDynamicComponent as X, h as m } from "vue";
2
- import { _ as Y } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as Z, components as x } from "@feedmepos/ui-library";
4
- import { a as ee, p as te } from "./plugins-DTrOHd7d.js";
5
- import { u as oe } from "./loading-B0_BwPgo.js";
6
- import { u as ae } from "./business-C8P05bjQ.js";
7
- import { u as ne, c as C } from "./campaign-DcLhSQVQ.js";
8
- import { a as E, b as K, g as se } from "./campaign-CyYAvl3p.js";
9
- import { _ as ie } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
10
- import { _ as re } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-DysfUOSp.js";
11
- import { u as le } from "./template-Bdwy6QXF.js";
12
- import { u as ce } from "./vue-i18n-fg0FtbNR.js";
13
- import { _ as me } from "./SendCollectionSheet.vue_vue_type_script_setup_true_lang-CJ--FC-i.js";
14
- const de = { class: "flex items-center" }, ue = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, pe = { class: "px-24 flex flex-col gap-y-16" }, fe = { class: "flex items-center justify-between w-full" }, ge = { class: "flex gap-8 overflow-x-auto" }, ye = { class: "space-y-8" }, _e = { class: "flex w-full gap-4 items-center" }, he = { class: "space-y-4" }, we = { class: "fm-typo-en-body-lg-600" }, xe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ce = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ve = { class: "flex flex-col gap-16 text-center" }, be = { class: "fm-typo-en-title-sm-800" }, ke = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Te = /* @__PURE__ */ z({
15
- __name: "Game",
16
- setup(Fe) {
17
- const { t: d } = ce(), M = {
18
- label: d("connect.program.common.actions.create", {
19
- type: d("connect.program.game.title").toLowerCase()
20
- }),
21
- value: "create",
22
- isPrimary: !0,
23
- prependIcon: "add"
24
- }, V = Z(), U = le("GAME", V), y = ae(), u = ne(), { global: G, minor: L } = oe, l = k({
25
- searchKey: "",
26
- location: []
27
- });
28
- function T(e) {
29
- const t = l.value.location;
30
- return !t || t.length === 0 || !e.targetLocation ? !0 : Array.isArray(t) ? t.some((i) => {
31
- var r;
32
- return (r = e == null ? void 0 : e.targetLocation) == null ? void 0 : r.includes(i);
33
- }) : e.targetLocation.includes(t);
34
- }
35
- const _ = W(
36
- () => u.campaigns.token.filter((e) => T(e))
37
- ), I = [
38
- {
39
- header: "Program title",
40
- accessorKey: "name",
41
- // accessorFn: (v) => v.name,
42
- cell(e) {
43
- return m("div", { class: "flex items-center justify-between gap-4" }, [
44
- m("div", { class: "flex items-center" }, [
45
- m(
46
- x.FmTooltip,
47
- {
48
- content: e.row.original._id,
49
- onClick: (t) => {
50
- t.stopPropagation(), ee(e.row.original._id);
51
- }
52
- },
53
- [
54
- m(x.FmIcon, {
55
- name: "info",
56
- outline: !0,
57
- size: "sm"
58
- })
59
- ]
60
- )
61
- ]),
62
- m("div", { class: "flex-1" }, e.row.original.name)
63
- ]);
64
- }
65
- },
66
- {
67
- header: "Status",
68
- accessorFn: (e) => se(e),
69
- cell(e) {
70
- return E(e.row.original);
71
- }
72
- },
73
- {
74
- header: "Summary",
75
- accessorFn: (e) => K(e)
76
- //v.effect,
77
- },
78
- {
79
- header: "Token received",
80
- accessorFn: (e) => {
81
- var t;
82
- return ((t = e == null ? void 0 : e.pf_collectible) == null ? void 0 : t.currentReceive) ?? 0;
83
- }
84
- },
85
- {
86
- header: "Actions",
87
- cell(e) {
88
- return m("div", { class: "flex items-center gap-8" }, [
89
- m(x.FmButton, {
90
- variant: "tertiary",
91
- icon: "send",
92
- iconColor: "neutral-gray-400",
93
- onClick: (t) => {
94
- t.stopPropagation(), j(e.row.original);
95
- }
96
- }),
97
- m(x.FmButton, {
98
- variant: "tertiary",
99
- icon: "delete",
100
- iconColor: "neutral-gray-400",
101
- onClick: (t) => {
102
- t.stopPropagation(), B(e.row.original);
103
- }
104
- })
105
- ]);
106
- }
107
- }
108
- ], A = k(), R = k();
109
- async function B(e) {
110
- await te.remove(`Are you sure you want to remove ${e.name}?`) && await L(
111
- async () => {
112
- await C.delete(e._id), await u.read("GAME");
113
- },
114
- {
115
- message: `Removing ${e.name}`,
116
- successMessage: `Removed ${e.name} successfully`
117
- }
118
- );
119
- }
120
- async function h(e) {
121
- e ? await t() : U.open(async (i) => {
122
- await t(i);
123
- });
124
- async function t(i) {
125
- var r;
126
- (r = A.value) == null || r.showSheet(
127
- !0,
128
- "GAME",
129
- e ? await C.readById(e._id) : void 0,
130
- i
131
- );
132
- }
133
- }
134
- async function D(e) {
135
- var t, i, r;
136
- e.campaign._id && ((r = (i = (t = e.campaign) == null ? void 0 : t.game) == null ? void 0 : i.rewards) != null && r.some(
137
- (p) => p.type === "VOUCHER"
138
- )) && await new Promise((p) => {
139
- V.open({
140
- title: "Confirmation",
141
- message: "This will change all future vouchers? Would you like to update previous claimed vouchers expiry date and discount?",
142
- primaryActions: { text: "Update all", close: !0 },
143
- secondaryActions: { text: "Update future only", close: !0 }
144
- }).onPrimary(async () => {
145
- e.updateCollections = !0, p();
146
- }).onSecondary(async () => {
147
- p();
148
- });
149
- }), await L(
150
- async () => {
151
- e.campaign._id ? await C.update(e.campaign._id, e) : await C.create(e), await u.read("GAME");
152
- },
153
- {
154
- message: `${e.campaign._id ? "Updating" : "Creating"} game program`,
155
- successMessage: `Game program ${e.campaign._id ? "updated" : "created"} successfully`
156
- }
157
- );
158
- }
159
- function j(e) {
160
- var t;
161
- (t = R.value) == null || t.showSheet({
162
- campaign: e
163
- });
164
- }
165
- return J(async () => {
166
- await G(async () => {
167
- await u.read("GAME"), await y.readPremium();
168
- });
169
- }), (e, t) => {
170
- const i = c("FmPill"), r = c("FmPageHead"), v = c("FmSearch"), p = c("FmTable"), $ = c("FmButton"), H = c("FmListItem"), N = c("FmList"), O = c("FmCard");
171
- return f(), F(S, null, [
172
- s(r, {
173
- actions: o(_).length > 0 && o(y).isPremium ? [M] : [],
174
- "onClick:action": t[0] || (t[0] = () => h())
175
- }, {
176
- title: w(() => [
177
- n("div", de, [
178
- n("span", ue, g(o(d)("connect.program.game.title")), 1),
179
- s(i, { variant: "premium" })
180
- ])
181
- ]),
182
- _: 1
183
- }, 8, ["actions"]),
184
- n("div", pe, [
185
- s(v, {
186
- modelValue: o(l).searchKey,
187
- "onUpdate:modelValue": t[1] || (t[1] = (a) => o(l).searchKey = a),
188
- class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
189
- placeholder: "search",
190
- collapsible: ""
191
- }, null, 8, ["modelValue"]),
192
- o(u).campaigns.token && o(u).campaigns.token.length > 0 ? (f(), F(S, { key: 0 }, [
193
- n("div", fe, [
194
- n("div", ge, [
195
- s(ie, {
196
- label: `${o(d)("connect.common.location")}: `,
197
- "right-icon": "keyboard_arrow_down",
198
- modelValue: o(l).location,
199
- "onUpdate:modelValue": t[2] || (t[2] = (a) => o(l).location = a),
200
- icon: "storefront",
201
- "show-item-label": !0,
202
- items: o(y).locationOptions
203
- }, null, 8, ["label", "modelValue", "items"])
204
- ]),
205
- s(v, {
206
- modelValue: o(l).searchKey,
207
- "onUpdate:modelValue": t[3] || (t[3] = (a) => o(l).searchKey = a),
208
- class: "xs:hidden sm:hidden",
209
- placeholder: "search",
210
- collapsible: ""
211
- }, null, 8, ["modelValue"])
212
- ]),
213
- s(p, {
214
- class: "xs:hidden sm:hidden",
215
- "row-data": o(_),
216
- "column-defs": I,
217
- "search-value": o(l).searchKey,
218
- "column-filter": [],
219
- onRowClick: t[4] || (t[4] = (a) => h(a.original)),
220
- "hide-footer": o(_).length < 10
221
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
222
- s(N, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
223
- default: w(() => [
224
- (f(!0), F(S, null, Q(o(_).filter(
225
- (a) => a.name.toLowerCase().includes(o(l).searchKey.toLowerCase())
226
- ), (a) => (f(), P(H, {
227
- key: a._id.toString(),
228
- onClick: (b) => h(a),
229
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
230
- }, {
231
- default: w(() => {
232
- var b;
233
- return [
234
- n("div", ye, [
235
- n("div", _e, [
236
- (f(), P(X(o(E)(a))))
237
- ]),
238
- n("div", he, [
239
- n("div", we, g(a.name), 1),
240
- n("div", xe, g(o(K)(a)), 1)
241
- ]),
242
- n("div", Ce, g(o(d)("connect.program.game.token_received", {
243
- count: ((b = e.pf_collectible) == null ? void 0 : b.currentReceive) ?? 0
244
- })), 1)
245
- ]),
246
- s($, {
247
- icon: "delete",
248
- "icon-color": "neutral-gray-400",
249
- variant: "tertiary",
250
- onClick: (q) => (q.stopPropagation(), B(a))
251
- }, null, 8, ["onClick"])
252
- ];
253
- }),
254
- _: 2
255
- }, 1032, ["onClick"]))), 128))
256
- ]),
257
- _: 1
258
- })
259
- ], 64)) : (f(), P(O, {
260
- key: 1,
261
- variant: "outlined",
262
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
263
- }, {
264
- default: w(() => [
265
- t[6] || (t[6] = n("img", {
266
- src: Y,
267
- class: "aspect-square w-[150px]"
268
- }, null, -1)),
269
- n("div", ve, [
270
- n("div", be, g(o(d)("connect.program.game.empty_state.title")), 1),
271
- n("div", ke, g(o(d)("connect.program.game.empty_state.description")), 1)
272
- ]),
273
- s($, {
274
- variant: "primary",
275
- label: "Create game program",
276
- icon: "add",
277
- disabled: !o(y).isPremium,
278
- onClick: t[5] || (t[5] = (a) => h())
279
- }, null, 8, ["disabled"])
280
- ]),
281
- _: 1
282
- })),
283
- s(re, {
284
- ref_key: "sheetRef",
285
- ref: A,
286
- "onSubmit:modelValue": D
287
- }, null, 512),
288
- s(me, {
289
- ref_key: "sendCollectionSheetRef",
290
- ref: R
291
- }, null, 512)
292
- ])
293
- ], 64);
294
- };
295
- }
296
- });
297
- export {
298
- Te as default
299
- };