@feedmepos/mf-connect 0.0.16-beta.1 → 0.0.16-beta.11

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 (95) hide show
  1. package/dist/{Analytic-C-zZmF5N.js → Analytic-Gq7PoNer.js} +368 -365
  2. package/dist/App-Cikl5jnp.js +177 -0
  3. package/dist/Broadcast-DU3JnBwZ.js +223 -0
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-VWLBlxy1.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D0I8IZIR.js} +20 -20
  5. package/dist/Card-hIeQ5XUH.js +825 -0
  6. package/dist/Collections-B1SC1rr7.js +453 -0
  7. package/dist/Credit-BgwI8DR3.js +216 -0
  8. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bz6TSmbW.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-D9VR3P2d.js} +1026 -1022
  9. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-AhWnHG02.js → EffectSheet.vue_vue_type_style_index_0_lang-DPgu45MD.js} +29 -29
  10. package/dist/Experience-C2Q-zqV6.js +221 -0
  11. package/dist/Game-DU2pZDGk.js +255 -0
  12. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +144 -0
  13. package/dist/JsonViewer-v8_C7l5N.js +87 -0
  14. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DykNOOFD.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js} +1 -1
  15. package/dist/{MainLayout-D0AoA1tk.js → MainLayout-B1aJoR95.js} +2 -2
  16. package/dist/Marketing-DWiTQp9I.js +316 -0
  17. package/dist/Member-BEXKBFry.js +69 -0
  18. package/dist/MemberList-DzMdajIf.js +1733 -0
  19. package/dist/MemberOverview-wL_ailso.js +58 -0
  20. package/dist/{MemberTransactions-CTAx5jIV.js → MemberTransactions-Bciankuu.js} +1 -1
  21. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-C-BtHxSc.js → MessageInput.vue_vue_type_script_setup_true_lang-DH25Hfk3.js} +46 -46
  22. package/dist/Mission-KzwRlaA5.js +259 -0
  23. package/dist/Point-CSKvZXHc.js +222 -0
  24. package/dist/Promotion-IiwPhx8p.js +221 -0
  25. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CrpJySSp.js → RuleGroup.vue_vue_type_script_setup_true_lang-4zIO3oCr.js} +545 -544
  26. package/dist/Segment-2Q0PonBb.js +447 -0
  27. package/dist/{Setting-Zrj5P_4m.js → Setting-Df5vVRt4.js} +600 -598
  28. package/dist/Store-C0WXCKs6.js +1503 -0
  29. package/dist/StoreRewards-eSSIO0nk.js +401 -0
  30. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-DS4APaHw.js → StoreTransactions.vue_vue_type_script_setup_true_lang-BjnCRKGX.js} +106 -108
  31. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-ZYjWlDJ1.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-b0xTcoEp.js} +1 -1
  32. package/dist/{Tier-DVWJyQ9S.js → Tier-v-1FkRU-.js} +464 -449
  33. package/dist/{Title-B5kX64vs.js → Title-CQ2JWqBW.js} +315 -299
  34. package/dist/Transaction-0OouN_6s.js +39 -0
  35. package/dist/Voucher-CL0cgogx.js +488 -0
  36. package/dist/_commonjsHelpers-BkfeUUK-.js +28 -0
  37. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  38. package/dist/app-Bd19eW7X.js +5381 -0
  39. package/dist/app-CfS25Z66.js +34797 -0
  40. package/dist/app-wDQR6dpb.js +39 -0
  41. package/dist/app.js +5 -3
  42. package/dist/business-dQh3AEot.js +78 -0
  43. package/dist/{campaign-BZJuknWK.js → campaign-BOl8AgKA.js} +12 -12
  44. package/dist/{collection.fn-DoCkZ6z4.js → collection.fn-B_YsXmrP.js} +2 -2
  45. package/dist/dto-B8NfyVPG.js +1169 -0
  46. package/dist/{effect-B8kmnKvY.js → effect-C2jCStXO.js} +1 -1
  47. package/dist/{export-Dm6LYnWo.js → export-BtZc3Yzh.js} +3 -3
  48. package/dist/{helper-DR4XK3nv.js → helper-8oGsrM56.js} +1 -1
  49. package/dist/{index-DcUrk07Q.js → index-6FkKY3q0.js} +3 -3
  50. package/dist/{index-Bu4_26qI.js → index-C7oeXRUl.js} +1 -1
  51. package/dist/{index-CuL5-ORK.js → index-CZKYIefW.js} +6 -7
  52. package/dist/{index-yxJMhfxj.js → index-C_0IFnwi.js} +5 -5
  53. package/dist/{index-BryrRq8O.js → index-DCixRRvz.js} +36 -30
  54. package/dist/{index-CkiYkbXb.js → index-DFgt4-VW.js} +1 -1
  55. package/dist/{index-CWf0mh3a.js → index-DYDhH9bi.js} +177 -168
  56. package/dist/{index-boor8e80.js → index-Di-kWSmf.js} +3 -3
  57. package/dist/{app-DkI7dYRN.js → index-Dn0jdj0o.js} +9665 -13024
  58. package/dist/index-DwKqFNF6.js +3 -0
  59. package/dist/{index-BobRgQrE.js → index-HoacsZDk.js} +2 -2
  60. package/dist/{index-BxkxVtgm.js → index-UTQHDUdW.js} +1 -1
  61. package/dist/{loading-BzV5acUX.js → loading-D_AN6p24.js} +6807 -6805
  62. package/dist/{lodash-mg4435Qq.js → lodash-B5I3zXaY.js} +1 -1
  63. package/dist/{membership-CqbsLHqx.js → membership-Ccrx9R6r.js} +3 -3
  64. package/dist/{money-DA_gtp3q.js → money-waD-f-Zz.js} +1 -1
  65. package/dist/{number-C388eyOu.js → number-CwTGGsh9.js} +1 -1
  66. package/dist/{rule-Clmr5y4j.js → rule-DJ07h3Gh.js} +2 -2
  67. package/dist/{rule-builder-BgqNbM-P.js → rule-builder-DJ-acvVD.js} +1 -1
  68. package/dist/style.css +1 -1
  69. package/dist/template-clxvNnbF.js +190 -0
  70. package/dist/{usePagination-o5fgsZwU.js → usePagination-BeF5K3M7.js} +86 -86
  71. package/dist/vue-i18n-BxwiXSkp.js +2365 -0
  72. package/dist/{xlsx-BRdh9e2p.js → xlsx-BB366cdN.js} +1945 -1945
  73. package/package.json +9 -5
  74. package/dist/Broadcast-X69Mtv3b.js +0 -216
  75. package/dist/Card-D0X3v1UF.js +0 -822
  76. package/dist/Collections-umR6Ehqf.js +0 -452
  77. package/dist/Credit-C1EWF7R0.js +0 -214
  78. package/dist/Experience-CqL8wyPm.js +0 -211
  79. package/dist/Game--kYe64EV.js +0 -250
  80. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-BjOJ3XSL.js +0 -144
  81. package/dist/Marketing-CTCQ5ZmZ.js +0 -308
  82. package/dist/Member-DCduX7zP.js +0 -91
  83. package/dist/MemberList-B0EkXZJu.js +0 -1729
  84. package/dist/MemberOverview-C2n9oJZh.js +0 -58
  85. package/dist/Mission-CVr9rS_D.js +0 -248
  86. package/dist/Point-BnZ6M74y.js +0 -220
  87. package/dist/Promotion-B0PUve5S.js +0 -218
  88. package/dist/Segment-B-XpkyM5.js +0 -445
  89. package/dist/Store-B2gywCt2.js +0 -1503
  90. package/dist/StoreRewards-D8410Q_-.js +0 -434
  91. package/dist/Transaction-CZBO4v4d.js +0 -36
  92. package/dist/Voucher-se-4JF9B.js +0 -481
  93. package/dist/app-B2ImSO3V.js +0 -53382
  94. package/dist/dto-BWpvRpK2.js +0 -1151
  95. package/dist/template-Dwp7heBA.js +0 -190
@@ -0,0 +1,144 @@
1
+ import { openBlock as l, createElementBlock as o, createElementVNode as i, defineComponent as C, ref as v, onMounted as $, resolveComponent as f, renderSlot as b, toDisplayString as r, createCommentVNode as x, normalizeStyle as R, unref as s, Fragment as h, createVNode as w, withCtx as g, createTextVNode as p, normalizeClass as V, createBlock as F } from "vue";
2
+ import { _ as z } from "./_plugin-vue_export-helper-CHgC5LLL.js";
3
+ const H = {}, N = { class: "animate-pulse flex space-x-4 bg-gray-300 dark:bg-gray-700 items-center justify-center rounded w-full h-full" };
4
+ function A(e, d) {
5
+ return l(), o("div", N, d[0] || (d[0] = [
6
+ i("svg", {
7
+ class: "dark:text-gray-600 h-10 text-gray-200 w-10",
8
+ "aria-hidden": "true",
9
+ xmlns: "http://www.w3.org/2000/svg",
10
+ fill: "currentColor",
11
+ viewBox: "0 0 20 18"
12
+ }, [
13
+ i("path", { d: "M18 0H2a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2Zm-5.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Zm4.376 10.481A1 1 0 0 1 16 15H4a1 1 0 0 1-.895-1.447l3.5-7A1 1 0 0 1 7.468 6a.965.965 0 0 1 .9.5l2.775 4.757 1.546-1.887a1 1 0 0 1 1.618.1l2.541 4a1 1 0 0 1 .028 1.011Z" })
14
+ ], -1)
15
+ ]));
16
+ }
17
+ const D = /* @__PURE__ */ z(H, [["render", A]]), I = { class: "max-w-full max-h-[400px] space-y-4" }, L = { key: 0 }, T = { class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400" }, U = {
18
+ key: 1,
19
+ class: "h-full w-full relative bg-fm-color-neutral-white p-12 border-2 border-dashed border-fm-color-neutral-gray-300 rounded-md flex flex-col items-center justify-center gap-8 hover:border-fm-color-neutral-gray-400"
20
+ }, Z = ["src"], _ = ["src"], E = { class: "absolute right-0 top-0" }, O = /* @__PURE__ */ C({
21
+ __name: "ImageInput",
22
+ props: {
23
+ required: {
24
+ type: Boolean,
25
+ default: () => !1
26
+ },
27
+ disabled: {
28
+ type: Boolean,
29
+ default: () => !1
30
+ },
31
+ thumbnail: {
32
+ type: String,
33
+ default: () => {
34
+ }
35
+ },
36
+ file: {
37
+ type: File,
38
+ default: () => {
39
+ }
40
+ },
41
+ label: {
42
+ type: String,
43
+ default: () => {
44
+ }
45
+ },
46
+ aspectRatio: {
47
+ type: String,
48
+ default: "2/3"
49
+ },
50
+ imageFit: {
51
+ type: String,
52
+ default: "contain"
53
+ },
54
+ accept: {
55
+ type: String,
56
+ default: ".png, .jpg, .jpeg, .webm"
57
+ },
58
+ recommendedSize: {
59
+ type: String,
60
+ default: "Recommended: 950px x 600px"
61
+ },
62
+ deleteButton: {
63
+ type: Boolean,
64
+ default: !0
65
+ }
66
+ },
67
+ emits: ["update:file"],
68
+ setup(e, { emit: d }) {
69
+ const c = e, a = v({
70
+ loading: !1,
71
+ imgsrc: c.thumbnail
72
+ }), m = v(!1), y = d;
73
+ async function u(t) {
74
+ return t == null ? (a.value.imgsrc = void 0, y("update:file", null)) : (m.value = !!t.type.startsWith("video/"), a.value.loading = !0, a.value.imgsrc = URL.createObjectURL(t), a.value.loading = !1, y("update:file", t));
75
+ }
76
+ return $(() => {
77
+ var t;
78
+ c.file && u(c.file), (t = c.thumbnail) != null && t.includes("mp4") && (m.value = !0);
79
+ }), (t, n) => {
80
+ const k = f("FmDropField"), S = f("FmHelperText"), B = f("FmButton");
81
+ return l(), o("div", I, [
82
+ b(t.$slots, "label", {}, () => [
83
+ e.label ? (l(), o("div", L, r(e.label), 1)) : x("", !0)
84
+ ]),
85
+ i("div", {
86
+ style: R({ "aspect-ratio": e.aspectRatio }),
87
+ class: "flex flex-col max-h-full max-w-full"
88
+ }, [
89
+ s(a).loading ? (l(), F(D, { key: 1 })) : (l(), o(h, { key: 0 }, [
90
+ s(a).imgsrc ? (l(), o("div", U, [
91
+ s(m) ? (l(), o("video", {
92
+ key: 1,
93
+ src: s(a).imgsrc || e.thumbnail,
94
+ class: "w-full h-full",
95
+ controls: ""
96
+ }, null, 8, _)) : (l(), o("img", {
97
+ key: 0,
98
+ class: V([`object-${e.imageFit}`, "w-full h-full"]),
99
+ src: s(a).imgsrc || e.thumbnail
100
+ }, null, 10, Z)),
101
+ i("div", E, [
102
+ b(t.$slots, "delete-button"),
103
+ e.deleteButton ? (l(), F(B, {
104
+ key: 0,
105
+ class: "!text-neutral-50 !bg-neutral-700",
106
+ icon: "delete",
107
+ variant: "tertiary",
108
+ disabled: e.disabled,
109
+ onClick: n[1] || (n[1] = (j) => u(null))
110
+ }, null, 8, ["disabled"])) : x("", !0)
111
+ ])
112
+ ])) : (l(), o(h, { key: 0 }, [
113
+ w(k, {
114
+ class: "flex-1 hihiha",
115
+ accept: e.accept,
116
+ disabled: e.disabled,
117
+ onFileUpload: u,
118
+ onFileRejected: n[0] || (n[0] = (j) => u(null))
119
+ }, {
120
+ label: g(() => n[2] || (n[2] = [
121
+ p(r(void 0))
122
+ ])),
123
+ "helper-text": g(() => n[3] || (n[3] = [
124
+ p(r(void 0))
125
+ ])),
126
+ "accept-text": g(() => [
127
+ i("div", T, [
128
+ i("div", null, "(" + r(e.recommendedSize) + ")", 1),
129
+ p(" Accepts " + r(e.accept), 1)
130
+ ])
131
+ ]),
132
+ _: 1
133
+ }, 8, ["accept", "disabled"]),
134
+ w(S, { text: "" })
135
+ ], 64))
136
+ ], 64))
137
+ ], 4)
138
+ ]);
139
+ };
140
+ }
141
+ });
142
+ export {
143
+ O as _
144
+ };
@@ -0,0 +1,87 @@
1
+ import { defineComponent as x, ref as k, resolveComponent as _, openBlock as n, createElementBlock as r, unref as t, createBlock as A, toDisplayString as i, createCommentVNode as u, Fragment as w, renderList as C, createVNode as g, normalizeClass as J } from "vue";
2
+ import { u as B } from "./app-wDQR6dpb.js";
3
+ import { _ as O } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
+ const V = { class: "flex justify-start" }, $ = {
5
+ key: 1,
6
+ class: "ml-0"
7
+ }, F = {
8
+ key: 2,
9
+ class: "text-red-600"
10
+ }, S = { key: 3 }, q = { key: 4 }, I = { key: 0 }, z = /* @__PURE__ */ x({
11
+ __name: "JsonNode",
12
+ props: {
13
+ node: {
14
+ type: Object,
15
+ required: !0
16
+ },
17
+ keyName: {
18
+ type: String,
19
+ required: !1,
20
+ default: ""
21
+ },
22
+ expanded: {
23
+ type: Boolean
24
+ }
25
+ },
26
+ setup(e) {
27
+ const s = e, c = typeof s.node == "object" && s.node !== null, y = c || Array.isArray(s.node), a = k(y && s.expanded || !1), d = k(), h = () => {
28
+ a.value = !a.value;
29
+ }, v = (o) => Array.isArray(o) ? `[Array(${o.length})]` : typeof o == "object" && o !== null ? `{${Object.keys(o).length ? "…" : ""}}` : "", m = (o) => typeof o == "string" ? `"${o}"` : String(o), p = typeof s.node == "function" && m(s.node) !== "function () { [native code] }" && !d.value;
30
+ return (o, l) => {
31
+ const b = _("FmIcon"), j = _("JsonNode", !0);
32
+ return n(), r("div", V, [
33
+ t(y) ? (n(), A(b, {
34
+ key: 0,
35
+ onClick: h,
36
+ class: "cursor-pointer mt-[2px]",
37
+ name: t(a) ? "arrow_drop_down" : "arrow_right",
38
+ size: "sm"
39
+ }, null, 8, ["name"])) : (n(), r("span", $)),
40
+ e.keyName || e.keyName == "0" ? (n(), r("span", F, i(e.keyName) + ": ", 1)) : u("", !0),
41
+ t(c) && !t(a) ? (n(), r("span", S, i(v(e.node)), 1)) : t(c) && t(a) ? (n(), r("div", q, [
42
+ (n(!0), r(w, null, C(e.node, (N, f) => (n(), r("div", { key: f }, [
43
+ g(j, {
44
+ node: N,
45
+ "key-name": f
46
+ }, null, 8, ["node", "key-name"])
47
+ ]))), 128)),
48
+ Object.keys(e.node || {}).length == 0 ? (n(), r("div", I, i(Array.isArray(e.node) ? "[]" : "{}"), 1)) : u("", !0)
49
+ ])) : (n(), r("span", {
50
+ key: 5,
51
+ class: J(["text-gray-800", {
52
+ "cursor-pointer text-blue-500": t(p) && !t(d)
53
+ }]),
54
+ onClick: l[0] || (l[0] = () => {
55
+ t(p) && typeof s.node == "function" && (d.value = s.node());
56
+ })
57
+ }, i(t(d) || m(e.node)), 3))
58
+ ]);
59
+ };
60
+ }
61
+ }), E = {
62
+ key: 0,
63
+ class: "json-viewer"
64
+ }, D = /* @__PURE__ */ x({
65
+ __name: "JsonViewer",
66
+ props: {
67
+ json: {
68
+ type: Object,
69
+ required: !0
70
+ },
71
+ expand: {
72
+ type: Boolean,
73
+ default: !1
74
+ }
75
+ },
76
+ setup(e) {
77
+ return (s, c) => t(B)().debugMode ? (n(), r("div", E, [
78
+ g(z, {
79
+ node: e.json,
80
+ expanded: e.expand
81
+ }, null, 8, ["node", "expanded"])
82
+ ])) : u("", !0);
83
+ }
84
+ }), R = /* @__PURE__ */ O(D, [["__scopeId", "data-v-d8502b13"]]);
85
+ export {
86
+ R as J
87
+ };
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, ref, watchEffect, computed, watch, openBlock, createElementBlock, normalizeStyle, onBeforeUnmount, resolveComponent, unref, createBlock } from "vue";
2
- import { j as commonjsGlobal, g as getDefaultExportFromCjs } from "./app-DkI7dYRN.js";
2
+ import { c as commonjsGlobal, g as getDefaultExportFromCjs } from "./_commonjsHelpers-BkfeUUK-.js";
3
3
  const v = "4.8.0", meta = {
4
4
  g: "LottieFiles AE ",
5
5
  a: "",
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as n, openBlock as o, createElementBlock as a, createVNode as c, unref as e, ref as m, resolveComponent as u, normalizeClass as _, createBlock as p, createCommentVNode as h, withDirectives as f, createElementVNode as d, vShow as w } from "vue";
2
- import { _ as v, S as x } from "./LottieAnimation.vue_vue_type_script_setup_true_lang-DykNOOFD.js";
3
- import { u as r } from "./app-DkI7dYRN.js";
2
+ import { _ as v, S as x } from "./LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js";
3
+ import { u as r } from "./app-wDQR6dpb.js";
4
4
  import { useRoute as g } from "vue-router";
5
5
  const S = { class: "bg-white w-full flex min-h-[calc(100svh-56px)] items-center" }, V = /* @__PURE__ */ n({
6
6
  __name: "Splash",
@@ -0,0 +1,316 @@
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-D_AN6p24.js";
5
+ import { defineStore as W } from "pinia";
6
+ import { F as C } from "./index-DFgt4-VW.js";
7
+ import { useCoreStore as Z } from "@feedmepos/mf-common";
8
+ import { g as y, S as ee, b as te } from "./index-Dn0jdj0o.js";
9
+ import { _ as ne } from "./_plugin-vue_export-helper-CHgC5LLL.js";
10
+ import { u as ae } from "./campaign-BOl8AgKA.js";
11
+ import { h as oe } from "./moment-BWErdI6_.js";
12
+ import { u as re } from "./vue-i18n-BxwiXSkp.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
+ };
@@ -0,0 +1,69 @@
1
+ import { defineComponent as f, computed as T, ref as p, watch as k, resolveComponent as m, openBlock as d, createElementBlock as B, Fragment as E, createVNode as _, unref as n, createElementVNode as y, createBlock as A, createCommentVNode as L } from "vue";
2
+ import "./index-DwKqFNF6.js";
3
+ import { u as M } from "./vue-i18n-BxwiXSkp.js";
4
+ import { useRouter as N } from "vue-router";
5
+ import { m as Y } from "./index-6FkKY3q0.js";
6
+ import { R as u } from "./app-Bd19eW7X.js";
7
+ const w = { class: "px-24 flex flex-col gap-y-16 pb-24" }, x = /* @__PURE__ */ f({
8
+ __name: "Member",
9
+ setup(C) {
10
+ const e = N(), { t: s } = M(), o = [
11
+ {
12
+ label: s("connect.loyalty.member.tabs.member_list"),
13
+ value: u["$connect-LOYALTY_MEMBER_LIST"],
14
+ actions: []
15
+ }
16
+ ], c = T(() => {
17
+ var a;
18
+ return e.currentRoute.value.name != u["$connect-LOYALTY_MEMBER_TRANSACTIONS"] ? {
19
+ title: r.value.label,
20
+ actions: r.value.actions,
21
+ description: void 0
22
+ } : (r.value = o[1], {
23
+ backButton: !0,
24
+ title: s("connect.loyalty.member.title"),
25
+ actions: [],
26
+ description: (a = i.value) == null ? void 0 : a.name,
27
+ onBackButton: async () => {
28
+ await e.push({ name: u["$connect-LOYALTY_MEMBER_LIST"] });
29
+ }
30
+ });
31
+ }), r = p(
32
+ o.find((t) => t.value === e.currentRoute.value.name) ?? o[0]
33
+ ), i = p();
34
+ async function b(t) {
35
+ await e.push({ name: t });
36
+ }
37
+ return k(
38
+ () => e.currentRoute.value.name,
39
+ async (t) => {
40
+ r.value = o.find((l) => l.value === t) ?? o[0];
41
+ const a = e.currentRoute.value.params.id;
42
+ a && (i.value = await Y.readById(a)), await e.push({ name: t });
43
+ }
44
+ ), (t, a) => {
45
+ const l = m("FmPageHead"), v = m("FmTabs"), R = m("RouterView");
46
+ return d(), B(E, null, [
47
+ _(l, {
48
+ actions: n(c).actions,
49
+ title: n(c).title,
50
+ description: n(c).description,
51
+ "back-button": n(c).backButton,
52
+ "onClick:back": n(c).onBackButton
53
+ }, null, 8, ["actions", "title", "description", "back-button", "onClick:back"]),
54
+ y("div", w, [
55
+ n(e).currentRoute.value.name != n(u)["$connect-LOYALTY_MEMBER_TRANSACTIONS"] ? (d(), A(v, {
56
+ key: 0,
57
+ "model-value": n(r).value,
58
+ items: o,
59
+ "onUpdate:modelValue": b
60
+ }, null, 8, ["model-value"])) : L("", !0),
61
+ _(R)
62
+ ])
63
+ ], 64);
64
+ };
65
+ }
66
+ });
67
+ export {
68
+ x as default
69
+ };