@feedmepos/mf-connect 0.0.16-beta.10 → 0.0.16-beta.12

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 (85) hide show
  1. package/dist/{Analytic-BVk0jPDU.js → Analytic-DIc9BYb0.js} +32 -20
  2. package/dist/{App-BbAalq1k.js → App-BzzL9_Jw.js} +33 -27
  3. package/dist/Broadcast-dVPgK5QV.js +223 -0
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DiU3MnH0.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-TnEPvafD.js} +18 -11
  5. package/dist/{Card-B5in1RMa.js → Card-Bj2Yd2pr.js} +178 -158
  6. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +97 -0
  7. package/dist/Collections-Fkb_zzqZ.js +453 -0
  8. package/dist/{Credit-Bc9EzdsC.js → Credit-DHn9OkE8.js} +78 -69
  9. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-C1ZXQski.js +2788 -0
  10. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-D6mWny8y.js +344 -0
  11. package/dist/{Experience-CgKak5ik.js → Experience-DX3aJihS.js} +64 -55
  12. package/dist/{Game-QhfKqrN_.js → Game-CcVQvETd.js} +54 -45
  13. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +144 -0
  14. package/dist/JsonViewer-v8_C7l5N.js +87 -0
  15. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js +18737 -0
  16. package/dist/MainLayout-B1aJoR95.js +41 -0
  17. package/dist/{Marketing-CSx4N7UJ.js → Marketing-B9kykWEh.js} +79 -72
  18. package/dist/{Member-CY6WMD8D.js → Member-RoJSCSC5.js} +25 -22
  19. package/dist/{MemberList-8iRwm7Sz.js → MemberList-BUDxqMEK.js} +321 -307
  20. package/dist/{MemberTransactions-CknqkWO3.js → MemberTransactions-Bh_tT1Rp.js} +1 -1
  21. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-Cj3-JHOX.js +432 -0
  22. package/dist/{Mission-BTy1p7lU.js → Mission-DDvgCLy0.js} +50 -40
  23. package/dist/{Point-A6B_ggSy.js → Point-BbPkt4kF.js} +67 -58
  24. package/dist/Promotion-DEo-lxpX.js +221 -0
  25. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BGjeTeqS.js +1751 -0
  26. package/dist/{Segment-CFVXtyEj.js → Segment-DAcpZWIN.js} +145 -130
  27. package/dist/{Setting-Jmtw-_DV.js → Setting-CgXohUPt.js} +167 -154
  28. package/dist/{Store-DQypT-7e.js → Store-BVyHbQ8o.js} +504 -489
  29. package/dist/{StoreRewards-M-utm0iI.js → StoreRewards-sccMDbkj.js} +124 -108
  30. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-B60mQ5kq.js → StoreTransactions.vue_vue_type_script_setup_true_lang--sdQ_l8g.js} +131 -123
  31. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-CXlkvt2u.js +139 -0
  32. package/dist/{Tier-D1jymeLK.js → Tier--P27XXbB.js} +144 -125
  33. package/dist/{Title-DN9DIP2k.js → Title-B27S3SxD.js} +107 -90
  34. package/dist/{Transaction-BAJvAoU6.js → Transaction-CYTtwwHY.js} +2 -2
  35. package/dist/Voucher-BZ8PKgO5.js +488 -0
  36. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-CWt4tVdk.js +55 -0
  37. package/dist/_commonjsHelpers-BkfeUUK-.js +28 -0
  38. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  39. package/dist/app-CnKzqAcN.js +53428 -0
  40. package/dist/app-FfENBuoE.js +5381 -0
  41. package/dist/app-wDQR6dpb.js +39 -0
  42. package/dist/app.js +2 -1
  43. package/dist/business-CXyP9G7A.js +78 -0
  44. package/dist/campaign-0aM2KYOy.js +96 -0
  45. package/dist/campaign-CpzFl8Vr.js +4 -0
  46. package/dist/collection.fn-FicQhH1t.js +26 -0
  47. package/dist/dto-BiYLkVdL.js +1169 -0
  48. package/dist/effect-Cg-eNEjg.js +61 -0
  49. package/dist/{export-DjeNY5Pc.js → export-D7BuObOL.js} +19 -16
  50. package/dist/helper-DvD-D7c7.js +71 -0
  51. package/dist/index-B1Q0GAWp.js +95 -0
  52. package/dist/index-B4UZgSB-.js +28058 -0
  53. package/dist/index-B6c-fUij.js +203 -0
  54. package/dist/index-BP_5cfKa.js +38 -0
  55. package/dist/index-BRXg5Si1.js +2071 -0
  56. package/dist/index-BuDwICBJ.js +761 -0
  57. package/dist/index-CDMC-8iO.js +94 -0
  58. package/dist/index-CcZt3OrE.js +73 -0
  59. package/dist/index-CuvNtC_M.js +61 -0
  60. package/dist/index-DA-fzkRR.js +1737 -0
  61. package/dist/index-Dbd4WA4r.js +61 -0
  62. package/dist/index-Dkeb_9ER.js +8832 -0
  63. package/dist/index-DmdKoKk_.js +298 -0
  64. package/dist/index-G-88ujCM.js +3 -0
  65. package/dist/loading-uCNeZibp.js +32697 -0
  66. package/dist/lodash-B5I3zXaY.js +3678 -0
  67. package/dist/membership-DFRO9TyM.js +221 -0
  68. package/dist/moment-BWErdI6_.js +2578 -0
  69. package/dist/money-OtkT4Pzp.js +15 -0
  70. package/dist/number-Cg3NCouc.js +12 -0
  71. package/dist/object-qECH92oz.js +26 -0
  72. package/dist/objectId-dwaoBfJX.js +7 -0
  73. package/dist/rule-Ch2HRiGw.js +1973 -0
  74. package/dist/rule-builder-B_M9yvEe.js +89 -0
  75. package/dist/template-1o0LbOoJ.js +190 -0
  76. package/dist/usePagination-BeF5K3M7.js +223 -0
  77. package/dist/vue-i18n-AtGIa4qH.js +2365 -0
  78. package/dist/xlsx-pChq0adn.js +15491 -0
  79. package/dist/zod-W_PvIofQ.js +90 -0
  80. package/package.json +3 -3
  81. package/dist/Collections-CFCZ9YIG.js +0 -4
  82. package/dist/MainLayout-JbHzENFy.js +0 -4
  83. package/dist/app-BpzzygYP.js +0 -87765
  84. package/dist/money-DKGIIplY.js +0 -15
  85. package/dist/number-tPodRxTN.js +0 -12
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as i, ref as p, resolveComponent as _, openBlock as l, createElementBlock as d, createVNode as f, unref as e, createBlock as r, createCommentVNode as v } from "vue";
2
- import { _ as b, a as k } from "./StoreTransactions.vue_vue_type_script_setup_true_lang-B60mQ5kq.js";
2
+ import { _ as b, a as k } from "./StoreTransactions.vue_vue_type_script_setup_true_lang--sdQ_l8g.js";
3
3
  import { useRouter as x } from "vue-router";
4
4
  const C = { class: "flex flex-col gap-y-32 pb-24" }, N = /* @__PURE__ */ i({
5
5
  __name: "MemberTransactions",
@@ -0,0 +1,432 @@
1
+ import { defineComponent as M, shallowRef as R, openBlock as p, createElementBlock as _, normalizeStyle as O, ref as V, resolveComponent as g, createBlock as E, unref as s, isRef as N, withCtx as x, createVNode as h, createElementVNode as v, createCommentVNode as B, withDirectives as D, vShow as A, computed as q, onMounted as J, Fragment as U, createTextVNode as P, toDisplayString as z, renderList as G } from "vue";
2
+ import { p as K } from "./loading-uCNeZibp.js";
3
+ import { r as W } from "./index-BuDwICBJ.js";
4
+ import { _ as Z } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
+ import { _ as Q, S as X } from "./LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js";
6
+ import { c as Y } from "./object-qECH92oz.js";
7
+ const ee = {
8
+ "user.name": {
9
+ name: "User name"
10
+ },
11
+ "user.birthday": {
12
+ name: "Birthday"
13
+ },
14
+ "user.joinAt": {
15
+ name: "Join at"
16
+ },
17
+ "user.expiringVouchers.days7": {
18
+ name: "Expiring vouchers in 7 days"
19
+ },
20
+ "user.expiringVouchers.days30": {
21
+ name: "Expiring vouchers in 30 days"
22
+ },
23
+ "user.expiringVouchers.days90": {
24
+ name: "Expiring vouchers in 90 days"
25
+ },
26
+ "user.tier": {
27
+ name: "User tier"
28
+ },
29
+ "user.point": {
30
+ name: "User experience"
31
+ },
32
+ "transaction.amount": {
33
+ name: "Reward amount"
34
+ },
35
+ "collectible.name": {
36
+ name: "Reward name"
37
+ }
38
+ }, te = "https://editor.unlayer.com/embed.js?2", T = [];
39
+ let H = !1;
40
+ const ne = (e) => {
41
+ const n = document.querySelectorAll("script");
42
+ let a = !1;
43
+ return n.forEach((u) => {
44
+ u.src.includes(e) && (a = !0);
45
+ }), a;
46
+ }, ae = (e) => {
47
+ T.push(e);
48
+ }, L = () => {
49
+ if (H) {
50
+ let e;
51
+ for (; e = T.shift(); )
52
+ e();
53
+ }
54
+ }, ie = (e, n = te) => {
55
+ if (ae(e), ne(n))
56
+ L();
57
+ else {
58
+ const a = document.createElement("script");
59
+ a.setAttribute("src", n), a.onload = () => {
60
+ H = !0, L();
61
+ }, document.head.appendChild(a);
62
+ }
63
+ };
64
+ let oe = 0;
65
+ const le = M({
66
+ name: "EmailEditor",
67
+ props: {
68
+ editorId: String,
69
+ minHeight: {
70
+ type: String,
71
+ default: "500px"
72
+ },
73
+ options: Object,
74
+ scriptUrl: String,
75
+ /**
76
+ * @Deprecated Props: Use `options.appearance` instead
77
+ */
78
+ appearance: Object,
79
+ /**
80
+ * @Deprecated Props: Use `options.locale` instead
81
+ */
82
+ locale: String,
83
+ /**
84
+ * @Deprecated Props: Use `options.projectId` instead
85
+ */
86
+ projectId: Number,
87
+ /**
88
+ * @Deprecated Props: Use `options.tools` instead
89
+ */
90
+ tools: Object
91
+ },
92
+ computed: {
93
+ id() {
94
+ return this.editorId || `editor-${++oe}`;
95
+ }
96
+ },
97
+ setup() {
98
+ return {
99
+ editor: R(null)
100
+ // Makes editor available to the template
101
+ };
102
+ },
103
+ mounted() {
104
+ this.$emit("load"), ie(this.loadEditor.bind(this), this.scriptUrl);
105
+ },
106
+ methods: {
107
+ loadEditor() {
108
+ const e = this.options || {};
109
+ this.appearance && (e.appearance = this.appearance), this.locale && (e.locale = this.locale), this.projectId && (e.projectId = this.projectId), this.tools && (e.tools = this.tools), this.editor = unlayer.createEditor({
110
+ ...e,
111
+ id: this.id
112
+ }), this.editor.addEventListener("editor:ready", () => {
113
+ this.$emit("ready");
114
+ });
115
+ },
116
+ /**
117
+ * @deprecated This method will be removed in the next major release. Use `editor.exportHtml` instead.
118
+ */
119
+ exportHtml(e) {
120
+ var n;
121
+ (n = this.editor) == null || n.exportHtml(e);
122
+ },
123
+ /**
124
+ * @deprecated This method will be removed in the next major release. Use `editor.loadDesign` instead.
125
+ */
126
+ loadDesign(e) {
127
+ var n;
128
+ (n = this.editor) == null || n.loadDesign(e);
129
+ },
130
+ /**
131
+ * @deprecated This method will be removed in the next major release. Use `editor.saveDesign` instead.
132
+ */
133
+ saveDesign(e) {
134
+ var n;
135
+ (n = this.editor) == null || n.saveDesign(e);
136
+ }
137
+ }
138
+ }), se = ["id"];
139
+ function re(e, n, a, u, y, r) {
140
+ return p(), _("div", {
141
+ id: e.id,
142
+ class: "unlayer-editor",
143
+ style: O({ minHeight: e.minHeight })
144
+ }, null, 12, se);
145
+ }
146
+ const de = /* @__PURE__ */ Z(le, [["render", re], ["__scopeId", "data-v-a9a2bb94"]]), ue = { class: "h-full flex flex-col" }, ce = { class: "flex items-center gap-8" }, me = /* @__PURE__ */ M({
147
+ __name: "EmailEditorSheet",
148
+ props: {
149
+ design: {
150
+ type: Object,
151
+ required: !1
152
+ },
153
+ title: {
154
+ type: String,
155
+ required: !1
156
+ }
157
+ },
158
+ emits: ["update:design"],
159
+ setup(e, { expose: n, emit: a }) {
160
+ const u = V(!1), y = V(null), r = V(!1), b = e, f = V({
161
+ html: "",
162
+ design: b.design,
163
+ title: b.title || ""
164
+ });
165
+ function o(l) {
166
+ u.value = l;
167
+ }
168
+ const t = a;
169
+ function m() {
170
+ y.value && (y.value.exportHtml((l) => {
171
+ f.value = {
172
+ html: l.html,
173
+ design: l.design,
174
+ title: f.value.title
175
+ }, t("update:design", f.value);
176
+ }), o(!1));
177
+ }
178
+ return n({
179
+ showSheet: o
180
+ }), (l, i) => {
181
+ const S = g("FmButton"), j = g("FmTextField"), w = g("FmSideSheet");
182
+ return p(), E(w, {
183
+ modelValue: s(u),
184
+ "onUpdate:modelValue": i[4] || (i[4] = (d) => N(u) ? u.value = d : null),
185
+ header: "Email editor",
186
+ "max-width": 1280
187
+ }, {
188
+ "side-sheet-button": x(() => [
189
+ h(S, {
190
+ label: "Edit email",
191
+ variant: "tertiary",
192
+ icon: "edit"
193
+ })
194
+ ]),
195
+ default: x(() => [
196
+ v("div", ue, [
197
+ s(r) ? B("", !0) : (p(), E(Q, {
198
+ key: 0,
199
+ class: "flex-1",
200
+ json: s(X),
201
+ width: 100,
202
+ height: 100
203
+ }, null, 8, ["json"])),
204
+ D(h(j, {
205
+ label: "Email title",
206
+ modelValue: s(f).title,
207
+ "onUpdate:modelValue": i[0] || (i[0] = (d) => s(f).title = d)
208
+ }, null, 8, ["modelValue"]), [
209
+ [A, s(r)]
210
+ ]),
211
+ D(h(de, {
212
+ class: "flex-1",
213
+ ref_key: "editorRef",
214
+ ref: y,
215
+ onLoad: i[1] || (i[1] = (d) => r.value = !1),
216
+ onReady: i[2] || (i[2] = () => {
217
+ var d;
218
+ r.value = !0, b.design && ((d = s(y)) == null || d.loadDesign(s(Y)(b.design)));
219
+ })
220
+ }, null, 512), [
221
+ [A, s(r)]
222
+ ])
223
+ ])
224
+ ]),
225
+ "side-sheet-footer": x(() => [
226
+ v("div", ce, [
227
+ h(S, {
228
+ variant: "primary",
229
+ label: "Confirm",
230
+ onClick: m
231
+ }),
232
+ h(S, {
233
+ variant: "tertiary",
234
+ label: "Cancel",
235
+ onClick: i[3] || (i[3] = (d) => o(!1))
236
+ })
237
+ ])
238
+ ]),
239
+ _: 1
240
+ }, 8, ["modelValue"]);
241
+ };
242
+ }
243
+ }), pe = { class: "space-y-4" }, he = { class: "flex items-center gap-8 justify-between" }, fe = { class: "relative" }, ge = { class: "absolute bottom-[24px] right-[4px]" }, we = /* @__PURE__ */ M({
244
+ __name: "MessageInput",
245
+ props: {
246
+ allowEmail: {
247
+ type: Boolean,
248
+ default: !1
249
+ },
250
+ modelValue: {
251
+ type: Object
252
+ },
253
+ triggerType: {
254
+ type: String,
255
+ default: () => "SCHEDULE"
256
+ },
257
+ helperText: {
258
+ type: String
259
+ },
260
+ helperState: {
261
+ type: String
262
+ },
263
+ variables: {
264
+ type: Object,
265
+ default: () => [
266
+ "user.name",
267
+ "user.birthday",
268
+ "user.joinAt",
269
+ "user.expiringVouchers.days7",
270
+ "user.expiringVouchers.days30",
271
+ "user.expiringVouchers.days90",
272
+ "user.tier",
273
+ "user.point",
274
+ "transaction.amount",
275
+ "collectible.name"
276
+ ]
277
+ },
278
+ placeholder: {
279
+ type: String
280
+ }
281
+ },
282
+ emits: ["update:model-value"],
283
+ setup(e, { emit: n }) {
284
+ const a = e, u = n;
285
+ function y() {
286
+ var m;
287
+ const o = {
288
+ user: {
289
+ name: "John Doe",
290
+ tier: 1,
291
+ point: 1283,
292
+ birthday: (/* @__PURE__ */ new Date("2000-10-02T16:00:00.000Z")).toLocaleDateString(),
293
+ joinAt: (/* @__PURE__ */ new Date("2024-06-14")).toLocaleDateString(),
294
+ expiringVouchers: { days7: 3, days30: 5, days90: 5 }
295
+ },
296
+ transaction: {
297
+ amount: 3
298
+ },
299
+ collectible: {
300
+ name: "RM10 Voucher"
301
+ }
302
+ }, t = W(
303
+ ((m = a.modelValue) == null ? void 0 : m.content) ?? "",
304
+ o
305
+ );
306
+ K.confirm(t, "Preview message", "OK");
307
+ }
308
+ function r(o, t = "SMS") {
309
+ u("update:model-value", {
310
+ channel: t,
311
+ content: t == "SMS" ? o : o.html,
312
+ design: t == "EMAIL" ? o.design : void 0,
313
+ language: "en",
314
+ title: t == "EMAIL" ? o.title : void 0,
315
+ variables: a.variables
316
+ });
317
+ }
318
+ const b = V(a.helperState || "none"), f = q(() => {
319
+ var m;
320
+ const o = ((m = a.modelValue) == null ? void 0 : m.content.replace(/{{([^}]+)}}/g, (l, i) => {
321
+ switch (i) {
322
+ case "user.name":
323
+ return "1234567890";
324
+ case "user.tier":
325
+ return "1";
326
+ case "user.point":
327
+ return "1000";
328
+ case "user.birthday":
329
+ return "01/01/2024";
330
+ case "user.joinAt":
331
+ return "01/01/2024";
332
+ case "user.expiringVouchers.days7":
333
+ case "user.expiringVouchers.days30":
334
+ case "user.expiringVouchers.days90":
335
+ return "5";
336
+ case "transaction.amount":
337
+ return "100";
338
+ case "collectible.name":
339
+ return "Voucher";
340
+ default:
341
+ return "...";
342
+ }
343
+ })) || "";
344
+ let t = 0;
345
+ for (let l = 0; l < o.length; l++) {
346
+ const i = o.charAt(l);
347
+ /[\u4e00-\u9fff\u3040-\u30ff\u3400-\u4dbf]/.test(i) || /[{}\\~\[\]|\^€]/.test(i) ? t += 2 : t += 1;
348
+ }
349
+ return `Character used: ${t} ≈ ${Math.ceil(t / 160)} SMS (Every 160 characters will be sent as 1 SMS)`;
350
+ });
351
+ return J(() => {
352
+ u("update:model-value", {
353
+ ...a.modelValue,
354
+ variables: a.variables
355
+ }), a.modelValue || r("");
356
+ }), (o, t) => {
357
+ var w, d, F, $, k;
358
+ const m = g("FmButtonGroup"), l = g("FmButton"), i = g("FmTextarea"), S = g("FmMenuItem"), j = g("FmMenu");
359
+ return p(), _("div", pe, [
360
+ e.allowEmail ? (p(), E(m, {
361
+ key: 0,
362
+ items: [{ label: "SMS" }, { label: "EMAIL" }],
363
+ "model-value": { label: (w = e.modelValue) == null ? void 0 : w.channel },
364
+ "onUpdate:modelValue": t[0] || (t[0] = (c) => r("", c.label))
365
+ }, null, 8, ["model-value"])) : B("", !0),
366
+ ((d = e.modelValue) == null ? void 0 : d.channel) == "EMAIL" ? (p(), E(me, {
367
+ key: 1,
368
+ design: (F = e.modelValue) == null ? void 0 : F.design,
369
+ title: (($ = e.modelValue) == null ? void 0 : $.title) || void 0,
370
+ "onUpdate:design": t[1] || (t[1] = (c) => {
371
+ r(c, "EMAIL");
372
+ })
373
+ }, null, 8, ["design", "title"])) : (p(), _(U, { key: 2 }, [
374
+ v("div", he, [
375
+ t[2] || (t[2] = v("div", { class: "fm-typo-en-body-lg-400" }, "Add message", -1)),
376
+ h(l, {
377
+ icon: "visibility",
378
+ label: "Preview message",
379
+ variant: "plain",
380
+ onClick: y
381
+ })
382
+ ]),
383
+ v("div", fe, [
384
+ h(i, {
385
+ "model-value": (k = e.modelValue) == null ? void 0 : k.content,
386
+ "onUpdate:modelValue": r,
387
+ "show-word-count": !0,
388
+ placeholder: e.placeholder,
389
+ "helper-state": s(b) || "none",
390
+ "helper-text": s(f)
391
+ }, {
392
+ "helper-text": x(() => [
393
+ P(z(s(f)), 1)
394
+ ]),
395
+ _: 1
396
+ }, 8, ["model-value", "placeholder", "helper-state", "helper-text"]),
397
+ v("div", ge, [
398
+ h(j, { placement: "left-end" }, {
399
+ "menu-button": x(() => [
400
+ h(l, {
401
+ icon: "add",
402
+ variant: "tertiary",
403
+ size: "md"
404
+ })
405
+ ]),
406
+ default: x(() => [
407
+ (p(!0), _(U, null, G(e.variables.filter(
408
+ (c) => e.triggerType == "SCHEDULE" ? !c.startsWith("transaction.") : !0
409
+ ), (c) => {
410
+ var C;
411
+ return p(), E(S, {
412
+ key: c,
413
+ label: ((C = s(ee)[c]) == null ? void 0 : C.name) || c,
414
+ onClick: (ye) => {
415
+ var I;
416
+ return r(((I = e.modelValue) == null ? void 0 : I.content) + `{{${c}}}`);
417
+ }
418
+ }, null, 8, ["label", "onClick"]);
419
+ }), 128))
420
+ ]),
421
+ _: 1
422
+ })
423
+ ])
424
+ ])
425
+ ], 64))
426
+ ]);
427
+ };
428
+ }
429
+ });
430
+ export {
431
+ we as _
432
+ };
@@ -1,24 +1,34 @@
1
- import { defineComponent as $, ref as L, computed as E, h as m, onMounted as A, resolveComponent as r, openBlock as d, createElementBlock as h, Fragment as w, createVNode as c, unref as t, createElementVNode as s, withCtx as b, renderList as H, createBlock as x, resolveDynamicComponent as q, toDisplayString as p } from "vue";
2
- import { u as z, M as G, b as J, h as Q, O as W, P as X, v as M, w as V, B as Y, c as _, N as Z, j as ee, y as oe, e as te } from "./app-BpzzygYP.js";
3
- import { useDialog as ne, components as v } from "@feedmepos/ui-library";
4
- const ae = { class: "px-24 flex flex-col gap-y-16" }, se = { class: "flex items-center justify-between w-full" }, ie = { class: "flex gap-8 overflow-x-auto" }, ce = { class: "space-y-8" }, re = { class: "flex w-full gap-4 items-center" }, le = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, me = { class: "space-y-4" }, de = { class: "fm-typo-en-body-lg-600" }, pe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ge = { class: "flex flex-col gap-16 text-center" }, ye = { class: "fm-typo-en-title-sm-800" }, fe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, xe = /* @__PURE__ */ $({
1
+ import { defineComponent as $, ref as L, computed as E, h as m, onMounted as A, resolveComponent as c, openBlock as d, createElementBlock as h, Fragment as w, createVNode as r, unref as t, createElementVNode as s, withCtx as b, renderList as H, createBlock as x, resolveDynamicComponent as q, toDisplayString as p } from "vue";
2
+ import { _ as z } from "./campaign-CpzFl8Vr.js";
3
+ import { useDialog as G, components as v } from "@feedmepos/ui-library";
4
+ import { a as J, p as Q, u as W } from "./loading-uCNeZibp.js";
5
+ import { u as X } from "./business-CXyP9G7A.js";
6
+ import { u as Y } from "./campaign-0aM2KYOy.js";
7
+ import { g as V, b as M } from "./dto-BiYLkVdL.js";
8
+ import { _ as Z } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
9
+ import { _ as ee } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-C1ZXQski.js";
10
+ import { u as oe } from "./template-1o0LbOoJ.js";
11
+ import { s as te } from "./index-CuvNtC_M.js";
12
+ import { u as ne } from "./vue-i18n-AtGIa4qH.js";
13
+ import { c as _ } from "./index-CDMC-8iO.js";
14
+ const ae = { class: "px-24 flex flex-col gap-y-16" }, se = { class: "flex items-center justify-between w-full" }, ie = { class: "flex gap-8 overflow-x-auto" }, re = { class: "space-y-8" }, ce = { class: "flex w-full gap-4 items-center" }, le = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, me = { class: "space-y-4" }, de = { class: "fm-typo-en-body-lg-600" }, pe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ge = { class: "flex flex-col gap-16 text-center" }, fe = { class: "fm-typo-en-title-sm-800" }, ye = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Be = /* @__PURE__ */ $({
5
15
  __name: "Mission",
6
16
  setup(_e) {
7
- const { t: n } = z(), B = {
17
+ const { t: n } = ne(), B = {
8
18
  label: n("connect.program.common.actions.create", {
9
19
  type: n("connect.program.mission.title").toLowerCase()
10
20
  }),
11
21
  value: "create",
12
22
  isPrimary: !0,
13
23
  prependIcon: "add"
14
- }, K = G("MISSION", ne()), N = J(), l = Q(), { global: P, minor: C } = te, i = L({
24
+ }, K = oe("MISSION", G()), N = X(), l = Y(), { global: P, minor: C } = W, i = L({
15
25
  searchKey: "",
16
26
  location: null
17
27
  }), u = E(
18
28
  () => l.campaigns.mission.filter(
19
29
  (e) => !i.value.location || !e.targetLocation || e.targetLocation.includes(i.value.location)
20
30
  )
21
- ), O = [
31
+ ), R = [
22
32
  {
23
33
  header: n("connect.program.common.table.title"),
24
34
  accessorKey: "name",
@@ -31,7 +41,7 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, se = { class: "flex items-
31
41
  {
32
42
  content: e.row.original._id,
33
43
  onClick: (o) => {
34
- o.stopPropagation(), W(e.row.original._id);
44
+ o.stopPropagation(), J(e.row.original._id);
35
45
  }
36
46
  },
37
47
  [
@@ -49,18 +59,18 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, se = { class: "flex items-
49
59
  },
50
60
  {
51
61
  header: n("connect.campaign.mission.type"),
52
- accessorFn: (e) => X(e.mission.type)
62
+ accessorFn: (e) => te(e.mission.type)
53
63
  //v.effect,
54
64
  },
55
65
  {
56
66
  header: n("connect.program.common.table.status"),
57
67
  cell(e) {
58
- return M(e.row.original);
68
+ return V(e.row.original);
59
69
  }
60
70
  },
61
71
  {
62
72
  header: n("connect.program.common.table.summary"),
63
- accessorFn: (e) => V(e)
73
+ accessorFn: (e) => M(e)
64
74
  //v.effect,
65
75
  },
66
76
  {
@@ -85,7 +95,7 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, se = { class: "flex items-
85
95
  }
86
96
  ], S = L();
87
97
  async function F(e) {
88
- await Y.remove(n("program.common.remove.confirm", { name: e.name })) && await C(
98
+ await Q.remove(n("program.common.remove.confirm", { name: e.name })) && await C(
89
99
  async () => {
90
100
  await _.delete(e._id), await l.read("MISSION");
91
101
  },
@@ -95,13 +105,13 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, se = { class: "flex items-
95
105
  }
96
106
  );
97
107
  }
98
- async function f(e) {
108
+ async function y(e) {
99
109
  e ? await o() : K.open(async (g) => {
100
110
  await o(g);
101
111
  });
102
112
  async function o(g) {
103
- var y;
104
- (y = S.value) == null || y.showSheet(
113
+ var f;
114
+ (f = S.value) == null || f.showSheet(
105
115
  !0,
106
116
  "MISSION",
107
117
  e ? await _.readById(e._id) : void 0,
@@ -109,7 +119,7 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, se = { class: "flex items-
109
119
  );
110
120
  }
111
121
  }
112
- async function R(e) {
122
+ async function T(e) {
113
123
  await C(
114
124
  async () => {
115
125
  e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await l.read("MISSION");
@@ -131,15 +141,15 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, se = { class: "flex items-
131
141
  await l.read("MISSION"), console.log(u);
132
142
  });
133
143
  }), (e, o) => {
134
- const g = r("FmPageHead"), y = r("FmSearch"), T = r("FmTable"), k = r("FmButton"), j = r("FmListItem"), D = r("FmList"), U = r("FmCard");
144
+ const g = c("FmPageHead"), f = c("FmSearch"), O = c("FmTable"), k = c("FmButton"), j = c("FmListItem"), D = c("FmList"), U = c("FmCard");
135
145
  return d(), h(w, null, [
136
- c(g, {
146
+ r(g, {
137
147
  title: t(n)("connect.campaign.mission.title"),
138
148
  actions: t(u).length > 0 ? [B] : [],
139
- "onClick:action": o[0] || (o[0] = () => f())
149
+ "onClick:action": o[0] || (o[0] = () => y())
140
150
  }, null, 8, ["title", "actions"]),
141
151
  s("div", ae, [
142
- c(y, {
152
+ r(f, {
143
153
  modelValue: t(i).searchKey,
144
154
  "onUpdate:modelValue": o[1] || (o[1] = (a) => t(i).searchKey = a),
145
155
  class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
@@ -149,7 +159,7 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, se = { class: "flex items-
149
159
  t(l).campaigns.mission && t(l).campaigns.mission.length > 0 ? (d(), h(w, { key: 0 }, [
150
160
  s("div", se, [
151
161
  s("div", ie, [
152
- c(Z, {
162
+ r(Z, {
153
163
  modelValue: t(i).location,
154
164
  "onUpdate:modelValue": o[2] || (o[2] = (a) => t(i).location = a),
155
165
  label: t(n)("connect.program.common.location"),
@@ -159,7 +169,7 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, se = { class: "flex items-
159
169
  items: t(N).locationItems
160
170
  }, null, 8, ["modelValue", "label", "items"])
161
171
  ]),
162
- c(y, {
172
+ r(f, {
163
173
  modelValue: t(i).searchKey,
164
174
  "onUpdate:modelValue": o[3] || (o[3] = (a) => t(i).searchKey = a),
165
175
  class: "xs:hidden",
@@ -167,37 +177,37 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, se = { class: "flex items-
167
177
  collapsible: ""
168
178
  }, null, 8, ["modelValue"])
169
179
  ]),
170
- c(T, {
180
+ r(O, {
171
181
  class: "xs:hidden",
172
182
  "row-data": t(u),
173
- "column-defs": O,
183
+ "column-defs": R,
174
184
  "search-value": t(i).searchKey,
175
185
  "column-filter": [],
176
- onRowClick: o[4] || (o[4] = (a) => f(a.original)),
186
+ onRowClick: o[4] || (o[4] = (a) => y(a.original)),
177
187
  "hide-footer": t(u).length < 10
178
188
  }, null, 8, ["row-data", "search-value", "hide-footer"]),
179
- c(D, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
189
+ r(D, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
180
190
  default: b(() => [
181
191
  (d(!0), h(w, null, H(t(u).filter(
182
192
  (a) => a.name.toLowerCase().includes(t(i).searchKey.toLowerCase())
183
193
  ), (a) => (d(), x(j, {
184
194
  key: a._id.toString(),
185
- onClick: (I) => f(a),
195
+ onClick: (I) => y(a),
186
196
  class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
187
197
  }, {
188
198
  default: b(() => [
189
- s("div", ce, [
190
- s("div", re, [
191
- (d(), x(q(t(M)(a)))),
199
+ s("div", re, [
200
+ s("div", ce, [
201
+ (d(), x(q(t(V)(a)))),
192
202
  s("div", le, p(a.currentReceive ?? 0) + " used ", 1)
193
203
  ]),
194
204
  s("div", me, [
195
205
  s("div", de, p(a.name), 1),
196
- s("div", pe, p(t(V)(a)), 1)
206
+ s("div", pe, p(t(M)(a)), 1)
197
207
  ]),
198
208
  s("div", ue, " Token received: " + p(a.currentReceive ?? 0), 1)
199
209
  ]),
200
- c(k, {
210
+ r(k, {
201
211
  icon: "delete",
202
212
  "icon-color": "neutral-gray-400",
203
213
  variant: "tertiary",
@@ -216,28 +226,28 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, se = { class: "flex items-
216
226
  }, {
217
227
  default: b(() => [
218
228
  o[6] || (o[6] = s("img", {
219
- src: ee,
229
+ src: z,
220
230
  class: "aspect-square w-[150px]"
221
231
  }, null, -1)),
222
232
  s("div", ge, [
223
- s("div", ye, p(t(n)("connect.campaign.mission.createProgram")), 1),
224
- s("div", fe, p(t(n)("connect.campaign.mission.description")), 1)
233
+ s("div", fe, p(t(n)("connect.campaign.mission.createProgram")), 1),
234
+ s("div", ye, p(t(n)("connect.campaign.mission.description")), 1)
225
235
  ]),
226
- c(k, {
236
+ r(k, {
227
237
  variant: "primary",
228
238
  label: t(n)("connect.program.common.actions.create", {
229
239
  type: t(n)("connect.program.mission.title").toLowerCase()
230
240
  }),
231
241
  icon: "add",
232
- onClick: o[5] || (o[5] = (a) => f())
242
+ onClick: o[5] || (o[5] = (a) => y())
233
243
  }, null, 8, ["label"])
234
244
  ]),
235
245
  _: 1
236
246
  })),
237
- c(oe, {
247
+ r(ee, {
238
248
  ref_key: "sheetRef",
239
249
  ref: S,
240
- "onSubmit:modelValue": R
250
+ "onSubmit:modelValue": T
241
251
  }, null, 512)
242
252
  ])
243
253
  ], 64);
@@ -245,5 +255,5 @@ const ae = { class: "px-24 flex flex-col gap-y-16" }, se = { class: "flex items-
245
255
  }
246
256
  });
247
257
  export {
248
- xe as default
258
+ Be as default
249
259
  };