@feedmepos/mf-connect 0.1.0-beta.7 → 0.1.0-beta.71

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 (126) hide show
  1. package/dist/Analytic-CnF_WeRZ.js +427 -0
  2. package/dist/{App-DalxIjTu.js → App-DJwSTuRa.js} +445 -420
  3. package/dist/AuditLogs-RarW2PHL.js +1886 -0
  4. package/dist/Bin-BaixTvHW.js +166 -0
  5. package/dist/{Broadcast-uMAvsC--.js → Broadcast-8DEAMhyM.js} +56 -54
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-JxbENan8.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DPXoOupI.js} +6 -8
  7. package/dist/Card-DRwLZ-Mn.js +896 -0
  8. package/dist/Collections-WsPM9v03.js +459 -0
  9. package/dist/{Credit-QlnatflM.js → Credit-DMxRdTzt.js} +36 -34
  10. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +108 -0
  11. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js +58 -0
  12. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bcj6o4Xi.js +2181 -0
  13. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BE07lc4M.js → EffectSheet.vue_vue_type_style_index_0_lang-CuJ8curT.js} +49 -49
  14. package/dist/{Experience-Czy41ifp.js → Experience-B0BV4Tc_.js} +32 -30
  15. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-BrPLkFX8.js +118 -0
  16. package/dist/Game-Bu6kJJHx.js +278 -0
  17. package/dist/Index-CX-aPFQt.js +259 -0
  18. package/dist/Marketing-CiVFwl6S.js +20071 -0
  19. package/dist/Member-DZfTtt13.js +333 -0
  20. package/dist/MemberList-CscwsZnv.js +1598 -0
  21. package/dist/MemberTransactions-BWNs6bUm.js +45 -0
  22. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CtM73bcN.js → MessageInput.vue_vue_type_script_setup_true_lang-BrbRudIU.js} +134 -122
  23. package/dist/Mission-CyJ-9Qfl.js +296 -0
  24. package/dist/Overview-DLyt6VId.js +1078 -0
  25. package/dist/{Point-By6ogYy_.js → Point-Cc_0-RKm.js} +55 -53
  26. package/dist/Promotion-KqA8nev2.js +289 -0
  27. package/dist/Queue-i8--zps9.js +249 -0
  28. package/dist/Record-CLUO1JVc.js +340 -0
  29. package/dist/Reward-BEdUKQ3M.js +442 -0
  30. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-B9vnSbWj.js +150 -0
  31. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-B8zw1TmO.js +1727 -0
  32. package/dist/Segment-B8sYajZG.js +568 -0
  33. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-CmmI5Vwl.js +181 -0
  34. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-CIcXjbJG.js +186 -0
  35. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-DY3FMuIf.js +147 -0
  36. package/dist/Setting-DT8dRb2A.js +1931 -0
  37. package/dist/Store-BhsPWRkR.js +1841 -0
  38. package/dist/StoreRewards-Cx2WDZ3p.js +423 -0
  39. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Byb7GOoh.js +1028 -0
  40. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-nEdCD6la.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-Cb-FGTO9.js} +1 -1
  41. package/dist/{Tier-DvAs0-yx.js → Tier-kQy1vGwo.js} +327 -318
  42. package/dist/{Title-B_Trr39o.js → Title-DKv8FqpX.js} +224 -209
  43. package/dist/{Transaction-DCJw-b3H.js → Transaction-CSLllOgl.js} +2 -2
  44. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-CvpBdNBn.js +130 -0
  45. package/dist/Voucher-BP6fmSwu.js +354 -0
  46. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-CxQEg_HW.js +419 -0
  47. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DXkhu8e9.js → ZodTextField.vue_vue_type_script_setup_true_lang-aurdXO2X.js} +1 -1
  48. package/dist/app-B3qgrQOd.js +7079 -0
  49. package/dist/app-s3iL79De.js +33357 -0
  50. package/dist/app.js +1 -1
  51. package/dist/business-DG2w8U-i.js +79 -0
  52. package/dist/campaign-BP6Rz-AH.js +1810 -0
  53. package/dist/{campaign--0_yMbMV.js → campaign-WPRZ4BRF.js} +2 -2
  54. package/dist/campaign.enum-CoqrWNTZ.js +20 -0
  55. package/dist/campaign.fn-BRPigTOA.js +758 -0
  56. package/dist/collectible.enum-Dy4sxF43.js +19 -0
  57. package/dist/{collection.fn-3TwPe7aF.js → collection.fn-DGnLyYgV.js} +2 -2
  58. package/dist/dto-xZ9I6-Jr.js +214 -0
  59. package/dist/{effect-BeR0LK61.js → effect-C0XoYTus.js} +33 -16
  60. package/dist/email-addresses-CJ87c7W1.js +705 -0
  61. package/dist/{export-xeLLhqvh.js → export-qlV-AbEl.js} +5 -5
  62. package/dist/{helper-B5iqfKh8.js → helper-DzYe8aNx.js} +1 -1
  63. package/dist/{index-BOdtpNkP.js → index-4vdSri7m.js} +266 -173
  64. package/dist/{index-CU_d8jjU.js → index-BfSj7cUl.js} +1 -1
  65. package/dist/index-Bj0ULpXi.js +29556 -0
  66. package/dist/index-BnZ4yaMH.js +115 -0
  67. package/dist/index-Bo5DJXxs.js +54 -0
  68. package/dist/{index-Ct_wR519.js → index-BuvJH6SU.js} +24 -21
  69. package/dist/index-C2GEs8di.js +32 -0
  70. package/dist/{index-CyKZ-SsN.js → index-CJuOTcCE.js} +1 -1
  71. package/dist/index-CsaQJMAR.js +66 -0
  72. package/dist/{index-DP-dGMJC.js → index-DReysUPw.js} +2230 -871
  73. package/dist/{index-CAn5heDe.js → index-DgCjRb3o.js} +48 -4
  74. package/dist/index-IwITtvVu.js +56 -0
  75. package/dist/{index-Bh-uaaBG.js → index-n3wiQlbk.js} +1506 -1480
  76. package/dist/index-vh86FiIQ.js +10 -0
  77. package/dist/{index.esm2017-5jeDA5Zo.js → index.esm2017-CkJhTmme.js} +154 -154
  78. package/dist/loading-DwJdwl4G.js +71 -0
  79. package/dist/{membership-D0nqqWNZ.js → membership-DvPK3h8f.js} +54 -46
  80. package/dist/money-C_WIbr_x.js +15 -0
  81. package/dist/number-ZeVoGhzP.js +12 -0
  82. package/dist/objectid-8lkX6otO.js +145 -0
  83. package/dist/{loading-C-JDVajU.js → plugins-D20keyDW.js} +2990 -3062
  84. package/dist/remy-vue-client-Cpppk9h-.js +1693 -0
  85. package/dist/reward-CqnMEq_w.js +36 -0
  86. package/dist/{rule-Dn_GgBCe.js → rule-D7htGgWz.js} +185 -178
  87. package/dist/{rule-builder-BXt29Es4.js → rule-builder-BbJpYQ0n.js} +1 -1
  88. package/dist/style.css +1 -1
  89. package/dist/{template-D2Oi3dxP.js → template-BWQCVHm7.js} +5 -5
  90. package/dist/trigger-DMuv0_O7.js +144 -0
  91. package/dist/user-C_v2C0qN.js +54 -0
  92. package/dist/vue-i18n-N8_TEEd0.js +2365 -0
  93. package/dist/{xlsx-CCRCidY2.js → xlsx-CsPDNSTo.js} +1 -1
  94. package/package.json +11 -7
  95. package/dist/Analytic-BMpS6jWb.js +0 -622
  96. package/dist/Card-DV8-g69L.js +0 -825
  97. package/dist/Collections-DRafEHT1.js +0 -453
  98. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-TDoMehSB.js +0 -2813
  99. package/dist/Game-CD3zSitz.js +0 -255
  100. package/dist/Marketing-NNes8z6Q.js +0 -316
  101. package/dist/Member-CTqBgYuV.js +0 -69
  102. package/dist/MemberList-B99tS5ce.js +0 -1733
  103. package/dist/MemberTransactions-D1YCXPOg.js +0 -38
  104. package/dist/Mission-XbBVKBiE.js +0 -261
  105. package/dist/Promotion-DKcBr-RI.js +0 -247
  106. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-D1ESqEFO.js +0 -1753
  107. package/dist/Segment-B8cszL-F.js +0 -437
  108. package/dist/Setting-aZYABlMW.js +0 -1901
  109. package/dist/Store-Bx2tyJwe.js +0 -1511
  110. package/dist/StoreRewards-DTp9G6gw.js +0 -401
  111. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-B2W7ly5Z.js +0 -890
  112. package/dist/Voucher-jqv3ji90.js +0 -490
  113. package/dist/app-WlcUVbFb.js +0 -5764
  114. package/dist/app-_w0hjM7u.js +0 -53428
  115. package/dist/business-BC4-i1cU.js +0 -78
  116. package/dist/dto-Ns2dLn1B.js +0 -2770
  117. package/dist/index-BWb9vRCi.js +0 -29193
  118. package/dist/index-CpU9aqyW.js +0 -206
  119. package/dist/index-CqO_ZvtD.js +0 -99
  120. package/dist/index-CuvNtC_M.js +0 -61
  121. package/dist/index-DsNsA2uX.js +0 -298
  122. package/dist/index-WAMr3npT.js +0 -762
  123. package/dist/money-hdbrblud.js +0 -15
  124. package/dist/number-CRWGOZaW.js +0 -12
  125. package/dist/user-Bm4KttFq.js +0 -37
  126. package/dist/vue-i18n-Dud8fvmw.js +0 -2365
@@ -1,255 +0,0 @@
1
- import { defineComponent as D, ref as A, computed as H, onMounted as N, resolveComponent as r, openBlock as d, createElementBlock as x, Fragment as b, createVNode as i, unref as o, withCtx as h, createElementVNode as n, toDisplayString as l, renderList as q, createBlock as v, resolveDynamicComponent as z, h as p } from "vue";
2
- import { _ as J } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as O, components as C } from "@feedmepos/ui-library";
4
- import { u as Q, a as W, p as X } from "./loading-C-JDVajU.js";
5
- import { u as Y } from "./business-BC4-i1cU.js";
6
- import { u as Z } from "./campaign--0_yMbMV.js";
7
- import { g as B, b as $ } from "./dto-Ns2dLn1B.js";
8
- import { _ as ee } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
9
- import { _ as te } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-TDoMehSB.js";
10
- import { u as oe } from "./template-D2Oi3dxP.js";
11
- import { u as ae } from "./vue-i18n-Dud8fvmw.js";
12
- import { c as w } from "./index-CqO_ZvtD.js";
13
- const ne = { class: "flex items-center" }, se = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, ie = { class: "px-24 flex flex-col gap-y-16" }, re = { class: "flex items-center justify-between w-full" }, le = { class: "flex gap-8 overflow-x-auto" }, ce = { class: "space-y-8" }, me = { class: "flex w-full gap-4 items-center" }, de = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, 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: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, 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__ */ D({
14
- __name: "Game",
15
- setup(we) {
16
- const { t: c } = ae(), E = {
17
- label: c("connect.program.common.actions.create", {
18
- type: c("connect.program.game.title").toLowerCase()
19
- }),
20
- value: "create",
21
- isPrimary: !0,
22
- prependIcon: "add"
23
- }, K = oe("GAME", O()), f = Y(), m = Z(), { global: M, minor: k } = Q, s = A({
24
- searchKey: "",
25
- location: null
26
- }), g = H(
27
- () => m.campaigns.token.filter(
28
- (e) => !s.value.location || !e.targetLocation || e.targetLocation.includes(s.value.location)
29
- )
30
- ), R = [
31
- {
32
- header: "Program title",
33
- accessorKey: "name",
34
- // accessorFn: (v) => v.name,
35
- cell(e) {
36
- return p("div", { class: "flex items-center justify-between gap-4" }, [
37
- p("div", { class: "flex items-center" }, [
38
- p(
39
- C.FmTooltip,
40
- {
41
- content: e.row.original._id,
42
- onClick: (t) => {
43
- t.stopPropagation(), W(e.row.original._id);
44
- }
45
- },
46
- [
47
- p(C.FmIcon, {
48
- name: "info",
49
- outline: !0,
50
- size: "sm"
51
- })
52
- ]
53
- )
54
- ]),
55
- p("div", { class: "flex-1" }, e.row.original.name)
56
- ]);
57
- }
58
- },
59
- {
60
- header: "Status",
61
- cell(e) {
62
- return B(e.row.original);
63
- }
64
- },
65
- {
66
- header: "Summary",
67
- accessorFn: (e) => $(e)
68
- //v.effect,
69
- },
70
- {
71
- header: "Token received",
72
- accessorFn: (e) => {
73
- var t;
74
- return ((t = e == null ? void 0 : e.pf_collectible) == null ? void 0 : t.currentReceive) ?? 0;
75
- }
76
- },
77
- {
78
- header: "Actions",
79
- cell(e) {
80
- return p(C.FmButton, {
81
- variant: "tertiary",
82
- icon: "delete",
83
- iconColor: "neutral-gray-400",
84
- onClick: (t) => {
85
- t.stopPropagation(), S(e.row.original);
86
- }
87
- });
88
- }
89
- }
90
- ], F = A();
91
- async function S(e) {
92
- await X.remove(`Are you sure you want to remove ${e.name}?`) && await k(
93
- async () => {
94
- await w.delete(e._id), await m.read("GAME");
95
- },
96
- {
97
- message: `Removing ${e.name}`,
98
- successMessage: `Removed ${e.name} successfully`
99
- }
100
- );
101
- }
102
- async function y(e) {
103
- e ? await t() : K.open(async (u) => {
104
- await t(u);
105
- });
106
- async function t(u) {
107
- var _;
108
- (_ = F.value) == null || _.showSheet(
109
- !0,
110
- "GAME",
111
- e ? await w.readById(e._id) : void 0,
112
- u
113
- );
114
- }
115
- }
116
- async function G(e) {
117
- await k(
118
- async () => {
119
- e.campaign._id ? await w.update(e.campaign._id, e) : await w.create(e), await m.read("GAME");
120
- },
121
- {
122
- message: `${e.campaign._id ? "Updating" : "Creating"} game program`,
123
- successMessage: `Game program ${e.campaign._id ? "updated" : "created"} successfully`
124
- }
125
- );
126
- }
127
- return N(async () => {
128
- await M(async () => {
129
- await m.read("GAME"), await f.readPremium();
130
- });
131
- }), (e, t) => {
132
- const u = r("FmPill"), _ = r("FmPageHead"), L = r("FmSearch"), I = r("FmTable"), P = r("FmButton"), T = r("FmListItem"), U = r("FmList"), j = r("FmCard");
133
- return d(), x(b, null, [
134
- i(_, {
135
- actions: o(g).length > 0 && o(f).isPremium ? [E] : [],
136
- "onClick:action": t[0] || (t[0] = () => y())
137
- }, {
138
- title: h(() => [
139
- n("div", ne, [
140
- n("span", se, l(o(c)("connect.program.game.title")), 1),
141
- i(u, { variant: "premium" })
142
- ])
143
- ]),
144
- _: 1
145
- }, 8, ["actions"]),
146
- n("div", ie, [
147
- i(L, {
148
- modelValue: o(s).searchKey,
149
- "onUpdate:modelValue": t[1] || (t[1] = (a) => o(s).searchKey = a),
150
- class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
151
- placeholder: "search",
152
- collapsible: ""
153
- }, null, 8, ["modelValue"]),
154
- o(m).campaigns.token && o(m).campaigns.token.length > 0 ? (d(), x(b, { key: 0 }, [
155
- n("div", re, [
156
- n("div", le, [
157
- i(ee, {
158
- modelValue: o(s).location,
159
- "onUpdate:modelValue": t[2] || (t[2] = (a) => o(s).location = a),
160
- label: "Location: ",
161
- "show-item-label": !0,
162
- icon: "storefront",
163
- placement: "bottom-start",
164
- items: o(f).locationItems
165
- }, null, 8, ["modelValue", "items"])
166
- ]),
167
- i(L, {
168
- modelValue: o(s).searchKey,
169
- "onUpdate:modelValue": t[3] || (t[3] = (a) => o(s).searchKey = a),
170
- class: "xs:hidden",
171
- placeholder: "search",
172
- collapsible: ""
173
- }, null, 8, ["modelValue"])
174
- ]),
175
- i(I, {
176
- class: "xs:hidden",
177
- "row-data": o(g),
178
- "column-defs": R,
179
- "search-value": o(s).searchKey,
180
- "column-filter": [],
181
- onRowClick: t[4] || (t[4] = (a) => y(a.original)),
182
- "hide-footer": o(g).length < 10
183
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
184
- i(U, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
185
- default: h(() => [
186
- (d(!0), x(b, null, q(o(g).filter(
187
- (a) => a.name.toLowerCase().includes(o(s).searchKey.toLowerCase())
188
- ), (a) => (d(), v(T, {
189
- key: a._id.toString(),
190
- onClick: (V) => y(a),
191
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
192
- }, {
193
- default: h(() => [
194
- n("div", ce, [
195
- n("div", me, [
196
- (d(), v(z(o(B)(a)))),
197
- n("div", de, l(a.currentReceive ?? 0) + " used ", 1)
198
- ]),
199
- n("div", pe, [
200
- n("div", ue, l(a.name), 1),
201
- n("div", fe, l(o($)(a)), 1)
202
- ]),
203
- n("div", ge, l(o(c)("program.game.token_received", {
204
- count: a.currentReceive ?? 0
205
- })), 1)
206
- ]),
207
- i(P, {
208
- icon: "delete",
209
- "icon-color": "neutral-gray-400",
210
- variant: "tertiary",
211
- onClick: (V) => (V.stopPropagation(), S(a))
212
- }, null, 8, ["onClick"])
213
- ]),
214
- _: 2
215
- }, 1032, ["onClick"]))), 128))
216
- ]),
217
- _: 1
218
- })
219
- ], 64)) : (d(), v(j, {
220
- key: 1,
221
- variant: "outlined",
222
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
223
- }, {
224
- default: h(() => [
225
- t[6] || (t[6] = n("img", {
226
- src: J,
227
- class: "aspect-square w-[150px]"
228
- }, null, -1)),
229
- n("div", ye, [
230
- n("div", _e, l(o(c)("connect.program.game.empty_state.title")), 1),
231
- n("div", he, l(o(c)("connect.program.game.empty_state.description")), 1)
232
- ]),
233
- i(P, {
234
- variant: "primary",
235
- label: "Create game program",
236
- icon: "add",
237
- disabled: !o(f).isPremium,
238
- onClick: t[5] || (t[5] = (a) => y())
239
- }, null, 8, ["disabled"])
240
- ]),
241
- _: 1
242
- })),
243
- i(te, {
244
- ref_key: "sheetRef",
245
- ref: F,
246
- "onSubmit:modelValue": G
247
- }, null, 512)
248
- ])
249
- ], 64);
250
- };
251
- }
252
- });
253
- export {
254
- $e as default
255
- };
@@ -1,316 +0,0 @@
1
- import { openBlock as m, createElementBlock as p, defineComponent as z, ref as S, onMounted as Y, computed as H, h as J, resolveComponent as c, Fragment as x, createVNode as i, unref as r, createElementVNode as s, withCtx as F, renderList as $, createBlock as B, toDisplayString as f, createCommentVNode as j } from "vue";
2
- import { _ as q } from "./campaign-CpzFl8Vr.js";
3
- import { components as G } from "@feedmepos/ui-library";
4
- import { p as X, u as Q } from "./loading-C-JDVajU.js";
5
- import { defineStore as W } from "pinia";
6
- import { F as C } from "./index-CU_d8jjU.js";
7
- import { useCoreStore as Z } from "@feedmepos/mf-common";
8
- import { g as y, S as ee, b as te } from "./index-BWb9vRCi.js";
9
- import { _ as ne } from "./_plugin-vue_export-helper-CHgC5LLL.js";
10
- import { u as ae } from "./campaign--0_yMbMV.js";
11
- import { h as oe } from "./moment-BWErdI6_.js";
12
- import { u as re } from "./vue-i18n-Dud8fvmw.js";
13
- var se = { authUrl: "https://portal-v2-dev.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "member.feedmedev.cc", crmUrl: "crm.feedmedev.cc", paymentPortalUrl: "https://portal.feedmedev.cc/payment/payout-account", marketingV1Portal: "https://marketing-v1.feedmedev.cc" };
14
- const h = () => {
15
- const o = ee.getBusinessId();
16
- if (!o) throw new Error("Invalid business ID");
17
- return te(`businesses/${o}/marketing-materials/`, {
18
- url: se.backendUrl,
19
- noIdRequired: !0
20
- });
21
- }, L = {
22
- async read() {
23
- return y(await h().get(""));
24
- },
25
- async createMarketing(o) {
26
- return y(await h().post("", o));
27
- },
28
- // add id
29
- async updateMarketing(o, t) {
30
- return y(
31
- await h().put(o, t)
32
- );
33
- },
34
- async deleteMarketing(o) {
35
- return y(await h().delete(o));
36
- }
37
- }, I = W("mf-connect-marketing", {
38
- state: () => {
39
- var o, t;
40
- return {
41
- marketing: [],
42
- defaultMarketing: {
43
- _id: void 0,
44
- business: ((t = (o = Z().currentBusiness) == null ? void 0 : o.value) == null ? void 0 : t._id) ?? "",
45
- name: "",
46
- campaign: null,
47
- keywords: "",
48
- image: "",
49
- headline: {
50
- content: "",
51
- key: void 0
52
- },
53
- assets: [
54
- {
55
- platform: C.enum.FACEBOOK,
56
- contents: [
57
- {
58
- type: "POST",
59
- size: {
60
- width: 1920,
61
- height: 1080
62
- },
63
- images: []
64
- },
65
- {
66
- type: "STORY",
67
- size: {
68
- width: 1080,
69
- height: 1920
70
- },
71
- images: []
72
- }
73
- ]
74
- },
75
- {
76
- platform: C.enum.INSTAGRAM,
77
- contents: [
78
- {
79
- type: "POST",
80
- size: {
81
- width: 1080,
82
- height: 1080
83
- },
84
- images: []
85
- },
86
- {
87
- type: "STORY",
88
- size: {
89
- width: 1080,
90
- height: 1920
91
- },
92
- images: []
93
- },
94
- {
95
- type: "REEL",
96
- size: {
97
- width: 1080,
98
- height: 1920
99
- },
100
- images: []
101
- }
102
- ]
103
- },
104
- {
105
- platform: C.enum.BRAND_APP,
106
- contents: [
107
- {
108
- type: "IMAGE",
109
- size: {
110
- width: 1080,
111
- height: 1920
112
- },
113
- images: []
114
- }
115
- ]
116
- }
117
- ],
118
- captions: [{ language: "en", content: "" }]
119
- }
120
- };
121
- },
122
- actions: {
123
- async readMarketingMaterial() {
124
- const o = await L.read();
125
- this.marketing = o;
126
- }
127
- },
128
- getters: {
129
- state(o) {
130
- return o;
131
- }
132
- }
133
- }), ie = {};
134
- function le(o, t) {
135
- return m(), p("div");
136
- }
137
- const ce = /* @__PURE__ */ ne(ie, [["render", le]]), me = { class: "px-24 flex flex-col gap-y-16" }, de = { class: "flex items-center justify-between w-full" }, pe = { class: "space-y-8" }, ue = { class: "fm-typo-en-body-lg-600" }, ge = { class: "fm-typo-en-body-lg-600" }, fe = { key: 0 }, ye = { class: "fm-typo-en-title-sm-800" }, he = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary w-4/6 text-center" }, Ve = /* @__PURE__ */ z({
138
- __name: "Marketing",
139
- setup(o) {
140
- const { t } = re(), O = {
141
- label: t("connect.marketing.create"),
142
- value: "create",
143
- isPrimary: !0,
144
- prependIcon: "add"
145
- }, k = S(!1), _ = I(), v = ae(), { global: N, minor: U } = Q;
146
- Y(async () => {
147
- await N(async () => {
148
- await v.read(), await _.readMarketingMaterial();
149
- });
150
- });
151
- const d = H(() => _.marketing.filter(
152
- (n) => n.name.includes(l.value.searchKey.toLowerCase())
153
- )), u = S(
154
- I().defaultMarketing
155
- ), D = [
156
- {
157
- header: t("connect.marketing.table.name"),
158
- accessorFn: (n) => n.name
159
- },
160
- {
161
- header: t("connect.marketing.table.campaign"),
162
- accessorFn: (n) => {
163
- var e;
164
- return n.campaign === null || n.campaign === void 0 ? "-" : (e = v.campaigns.all.find(
165
- (b) => b._id === n.campaign
166
- )) == null ? void 0 : e.name;
167
- }
168
- },
169
- {
170
- header: t("connect.marketing.table.createdDate"),
171
- accessorFn: (n) => {
172
- const e = new Date(
173
- parseInt(n._id.toString().substring(0, 8), 16) * 1e3
174
- );
175
- return oe(e).format("DD MMM YYYY");
176
- }
177
- },
178
- {
179
- header: t("connect.marketing.table.actions"),
180
- cell(n) {
181
- return J(G.FmButton, {
182
- variant: "tertiary",
183
- icon: "delete",
184
- iconColor: "neutral-gray-400",
185
- onClick: (e) => {
186
- e.stopPropagation(), V(n.row.original);
187
- }
188
- });
189
- }
190
- }
191
- ];
192
- async function V(n) {
193
- await X.remove(
194
- t("marketing.delete.confirm", { name: n.name })
195
- ) && await U(
196
- async () => {
197
- await L.deleteMarketing(n._id), await _.readMarketingMaterial();
198
- },
199
- {
200
- message: t("marketing.delete.removing", { name: n.name }),
201
- successMessage: t("marketing.delete.success", { name: n.name })
202
- }
203
- );
204
- }
205
- async function g(n) {
206
- n ? u.value = JSON.parse(JSON.stringify(n)) : u.value = JSON.parse(
207
- JSON.stringify(I().defaultMarketing)
208
- ), k.value = !0;
209
- }
210
- const l = S({
211
- searchKey: ""
212
- });
213
- return (n, e) => {
214
- const b = c("FmPageHead"), P = c("FmSearch"), E = c("FmTable"), T = c("FmButton"), K = c("FmListItem"), A = c("FmList"), R = c("FmCard");
215
- return m(), p(x, null, [
216
- i(b, {
217
- title: r(t)("connect.marketing.title"),
218
- class: "xs:hidden",
219
- actions: r(d).length > 0 ? [O] : [],
220
- "onClick:action": e[0] || (e[0] = () => g())
221
- }, null, 8, ["title", "actions"]),
222
- s("div", me, [
223
- i(P, {
224
- modelValue: l.value.searchKey,
225
- "onUpdate:modelValue": e[1] || (e[1] = (a) => l.value.searchKey = a),
226
- placeholder: r(t)("connect.marketing.search"),
227
- class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
228
- collapsible: ""
229
- }, null, 8, ["modelValue", "placeholder"]),
230
- i(ce, {
231
- modelValue: u.value,
232
- "onUpdate:modelValue": e[2] || (e[2] = (a) => u.value = a),
233
- "is-open": k.value,
234
- "onUpdate:isOpen": e[3] || (e[3] = (a) => k.value = a)
235
- }, null, 8, ["modelValue", "is-open"]),
236
- r(d).length > 0 ? (m(), p(x, { key: 0 }, [
237
- s("div", de, [
238
- i(P, {
239
- modelValue: l.value.searchKey,
240
- "onUpdate:modelValue": e[4] || (e[4] = (a) => l.value.searchKey = a),
241
- class: "xs:hidden",
242
- placeholder: r(t)("connect.marketing.search"),
243
- collapsible: ""
244
- }, null, 8, ["modelValue", "placeholder"])
245
- ]),
246
- i(E, {
247
- class: "xs:hidden",
248
- "row-data": r(d),
249
- "column-defs": D,
250
- "search-value": l.value.searchKey,
251
- "column-filter": [],
252
- onRowClick: e[5] || (e[5] = (a) => g(a.original)),
253
- "hide-footer": !0
254
- }, null, 8, ["row-data", "search-value"]),
255
- i(A, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
256
- default: F(() => [
257
- (m(!0), p(x, null, $(r(d).filter(
258
- (a) => a.name.toLowerCase().includes(l.value.searchKey.toLowerCase())
259
- ), (a) => (m(), B(K, {
260
- key: a._id.toString(),
261
- onClick: (w) => g(a),
262
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
263
- }, {
264
- default: F(() => {
265
- var w;
266
- return [
267
- s("div", pe, [
268
- s("div", ue, f(a.name), 1),
269
- s("div", ge, f(a.campaign === null || a.campaign === void 0 ? "-" : (w = r(v).campaigns.all.find(
270
- (M) => M._id === a.campaign
271
- )) == null ? void 0 : w.name), 1)
272
- ]),
273
- i(T, {
274
- icon: "delete",
275
- "icon-color": "neutral-gray-400",
276
- variant: "tertiary",
277
- onClick: (M) => (M.stopPropagation(), V(a))
278
- }, null, 8, ["onClick"])
279
- ];
280
- }),
281
- _: 2
282
- }, 1032, ["onClick"]))), 128))
283
- ]),
284
- _: 1
285
- }),
286
- r(d).length == 0 ? (m(), p("div", fe, e[7] || (e[7] = [
287
- s("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600" }, " No results found ", -1)
288
- ]))) : j("", !0)
289
- ], 64)) : (m(), B(R, {
290
- key: 1,
291
- variant: "outlined",
292
- class: "w-full justify-center items-center flex flex-col p-[24px] gap-[24px]"
293
- }, {
294
- default: F(() => [
295
- e[8] || (e[8] = s("img", {
296
- src: q,
297
- class: "w-[150px]"
298
- }, null, -1)),
299
- s("p", ye, f(r(t)("connect.marketing.emptyState.title")), 1),
300
- s("p", he, f(r(t)("connect.marketing.emptyState.description")), 1),
301
- i(T, {
302
- label: r(t)("connect.marketing.emptyState.action"),
303
- "prepend-icon": "add",
304
- onClick: e[6] || (e[6] = (a) => g())
305
- }, null, 8, ["label"])
306
- ]),
307
- _: 1
308
- }))
309
- ])
310
- ], 64);
311
- };
312
- }
313
- });
314
- export {
315
- Ve as default
316
- };
@@ -1,69 +0,0 @@
1
- import { defineComponent as f, computed as T, ref as d, watch as k, resolveComponent as s, openBlock as _, createElementBlock as B, Fragment as E, createVNode as b, unref as n, createElementVNode as y, createBlock as A, createCommentVNode as L } from "vue";
2
- import "./index-CyKZ-SsN.js";
3
- import { u as M } from "./vue-i18n-Dud8fvmw.js";
4
- import { useRouter as N } from "vue-router";
5
- import { m as Y } from "./index-Ct_wR519.js";
6
- import { R as i } from "./app-WlcUVbFb.js";
7
- const h = { class: "px-24 flex flex-col gap-y-16 pb-24" }, g = /* @__PURE__ */ f({
8
- __name: "Member",
9
- setup(w) {
10
- const e = N(), { t: p } = M(), o = [
11
- {
12
- label: p("connect.loyalty.member.tabs.member_list"),
13
- value: i["$connect-LOYALTY_MEMBER_LIST"],
14
- actions: []
15
- }
16
- ], r = T(() => {
17
- var a, c, m;
18
- return e.currentRoute.value.name != i["$connect-LOYALTY_MEMBER_TRANSACTIONS"] ? {
19
- title: u.value.label,
20
- actions: u.value.actions,
21
- description: void 0
22
- } : (u.value = o[1], {
23
- backButton: !0,
24
- title: p("connect.loyalty.member.title"),
25
- actions: [],
26
- description: `${(a = l.value) == null ? void 0 : a.name} (${(c = l.value) == null ? void 0 : c._id}) (${(m = l.value) == null ? void 0 : m.phoneNumber})`,
27
- onBackButton: async () => {
28
- await e.push({ name: i["$connect-LOYALTY_MEMBER_LIST"] });
29
- }
30
- });
31
- }), u = d(
32
- o.find((t) => t.value === e.currentRoute.value.name) ?? o[0]
33
- ), l = d();
34
- async function v(t) {
35
- await e.push({ name: t });
36
- }
37
- return k(
38
- () => e.currentRoute.value.name,
39
- async (t) => {
40
- u.value = o.find((c) => c.value === t) ?? o[0];
41
- const a = e.currentRoute.value.params.id;
42
- a && (l.value = await Y.readById(a)), await e.push({ name: t });
43
- }
44
- ), (t, a) => {
45
- const c = s("FmPageHead"), m = s("FmTabs"), R = s("RouterView");
46
- return _(), B(E, null, [
47
- b(c, {
48
- actions: n(r).actions,
49
- title: n(r).title,
50
- description: n(r).description,
51
- "back-button": n(r).backButton,
52
- "onClick:back": n(r).onBackButton
53
- }, null, 8, ["actions", "title", "description", "back-button", "onClick:back"]),
54
- y("div", h, [
55
- n(e).currentRoute.value.name != n(i)["$connect-LOYALTY_MEMBER_TRANSACTIONS"] ? (_(), A(m, {
56
- key: 0,
57
- "model-value": n(u).value,
58
- items: o,
59
- "onUpdate:modelValue": v
60
- }, null, 8, ["model-value"])) : L("", !0),
61
- b(R)
62
- ])
63
- ], 64);
64
- };
65
- }
66
- });
67
- export {
68
- g as default
69
- };