@feedmepos/mf-connect 0.1.98-beta.9 → 0.1.99-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 (121) hide show
  1. package/dist/Analytic-CmlJa1WX.js +426 -0
  2. package/dist/{App-CwMrP0Q-.js → App-D0thRELq.js} +807 -673
  3. package/dist/{Bin-sSw4Gatd.js → Bin-DnkPcZdC.js} +8 -8
  4. package/dist/{Broadcast-DH2Fpb-O.js → Broadcast-o6nSQOsx.js} +17 -18
  5. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Cd47Mrej.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BPGzh4u8.js} +6 -5
  6. package/dist/{Card-D4YJZ_I8.js → Card-zjezSaRB.js} +19 -19
  7. package/dist/{Collections--8QcjuAp.js → Collections-48W_jFFS.js} +185 -197
  8. package/dist/{Credit-DgF3qd52.js → Credit-CYaCjNVK.js} +53 -54
  9. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-D3SnYlQ0.js +2223 -0
  10. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BgHApZqm.js → EffectSheet.vue_vue_type_style_index_0_lang-CbpKQj-r.js} +6 -6
  11. package/dist/{Experience-DxtkVeS9.js → Experience-HmfLlywu.js} +34 -35
  12. package/dist/{FileSaver.min-BtPuPAIo.js → FileSaver.min-cDraiw9g.js} +1 -1
  13. package/dist/{Game-CbcrkUBh.js → Game-DHLdDQRi.js} +15 -16
  14. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-CqoO7N7r.js → ImageInput.vue_vue_type_script_setup_true_lang-DZrmFruC.js} +1 -1
  15. package/dist/{Index-BzPX7mr1.js → Index-CMm5L1Ph.js} +10 -10
  16. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-mI-5po-a.js → LocationPicker.vue_vue_type_script_setup_true_lang-B6tGeGGC.js} +1 -1
  17. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DyP3ipwX.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CV4V9qlc.js} +1 -1
  18. package/dist/{MainLayout-gxkaZeZ-.js → MainLayout-iru8naVF.js} +1 -1
  19. package/dist/{Marketing-BlMjT0cP.js → Marketing-AP8z-pA0.js} +4 -4
  20. package/dist/{MarketingMaterialEdit-v0vGn3Lz.js → MarketingMaterialEdit-HYTdiTvs.js} +211 -214
  21. package/dist/{Member-BBUlAPqZ.js → Member-N_ks2GiW.js} +20 -20
  22. package/dist/{MemberList-DZJhULFD.js → MemberList-Cj8EfN0q.js} +51 -50
  23. package/dist/{MemberTransactions-CTBoDEg4.js → MemberTransactions-DUj4Fq6M.js} +1 -1
  24. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-nlYOP9gZ.js → MessageInput.vue_vue_type_script_setup_true_lang-ZD6_8BzX.js} +11 -11
  25. package/dist/{Mission-D_xjOnWO.js → Mission-DfZ0brqC.js} +34 -35
  26. package/dist/{Overview-C5-uSEJH.js → Overview-BnFPQbSg.js} +19 -19
  27. package/dist/Overview-kB_HApIc.js +969 -0
  28. package/dist/{Point-BmVyG_i-.js → Point-PsWJEEsn.js} +29 -30
  29. package/dist/{Promotion-BWmTkHyw.js → Promotion-BsNT1kOG.js} +105 -111
  30. package/dist/{Queue-Do2XlY5H.js → Queue-Cgw3PgEi.js} +43 -43
  31. package/dist/{Record-BIzUOikr.js → Record-DwzoIz3R.js} +10 -10
  32. package/dist/Review-kF2wLu5o.js +46 -0
  33. package/dist/ReviewFacebookCallback-B6RjqR5T.js +238 -0
  34. package/dist/ReviewGoogleCallback-DjLK1b4-.js +213 -0
  35. package/dist/{Reward-gCpIJIq9.js → Reward-C8O5U2NU.js} +17 -17
  36. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-Dkyz-W9m.js → RewardGroup.vue_vue_type_script_setup_true_lang-BqKABBF1.js} +12 -12
  37. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DvNyurCW.js +1888 -0
  38. package/dist/{Segment-CZrzY2st.js → Segment-BtmeNQnL.js} +78 -77
  39. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-B1qAMtkn.js → SelectItems.vue_vue_type_script_setup_true_lang-P4wy1bqG.js} +3 -3
  40. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-Dc36wzB0.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DQ93AOeI.js} +12 -12
  41. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-BtnF-BPt.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-B3P7Ob40.js} +4 -4
  42. package/dist/{Setting-JrI4ttI1.js → Setting-D1SQ6TKF.js} +248 -259
  43. package/dist/{SettingAdvertisements-iOOpEUlI.js → SettingAdvertisements-pUTX9uu3.js} +13 -13
  44. package/dist/Settings-Bbd3cMNH.js +228 -0
  45. package/dist/{Store-DbXKThJn.js → Store-Dgc-J8Q7.js} +24 -24
  46. package/dist/{StoreRewards-CfkwVw7d.js → StoreRewards-CJ090vEj.js} +16 -16
  47. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-B35vDFFq.js +1067 -0
  48. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-5Aazsvfa.js +142 -0
  49. package/dist/{Tier-BVrAqpWt.js → Tier-CKGyFDiY.js} +469 -544
  50. package/dist/{Title-DhumBh-S.js → Title-DXRex7t9.js} +92 -93
  51. package/dist/{Transaction-BQLge28p.js → Transaction-B1eC-Gln.js} +2 -2
  52. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CSPaj2uN.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-B2GABNUx.js} +6 -6
  53. package/dist/{Voucher-DeB4YhvL.js → Voucher-Omh_kYVH.js} +27 -28
  54. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-BjUFEIlS.js → VoucherEditor.vue_vue_type_script_setup_true_lang-DD2WD_Vt.js} +12 -12
  55. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BzrPUcC9.js → ZodTextField.vue_vue_type_script_setup_true_lang-CAtzo8zL.js} +2 -2
  56. package/dist/{app-BHIG18wW.js → app-D8i8XAyR.js} +1439 -1406
  57. package/dist/app.js +3 -4
  58. package/dist/{business-CCmy2VBj.js → business-6gZtKQ8L.js} +1 -1
  59. package/dist/{campaign-DiFdvcPE.js → campaign-DIgbywUy.js} +64 -114
  60. package/dist/{campaign-jofcGLi8.js → campaign-MPUFwgli.js} +7 -13
  61. package/dist/{campaign.enum-CBp5IeWz.js → campaign.enum-CSlbGhc-.js} +2 -3
  62. package/dist/{campaign.fn-BZ0Ivuwi.js → campaign.fn-BvxZt-0r.js} +65 -65
  63. package/dist/{collectible.enum-frp5wluZ.js → collectible.enum-20LKRFir.js} +1 -1
  64. package/dist/collection.fn-03oGQuF_.js +26 -0
  65. package/dist/dto-C5_Te4gk.js +216 -0
  66. package/dist/{effect-BegkMXTr.js → effect-CkurpNMu.js} +1 -1
  67. package/dist/{email-addresses-B0t3BKV6.js → email-addresses-CR8pgurp.js} +2 -2
  68. package/dist/{export-CGrchnsA.js → export-CfDeISbW.js} +3 -3
  69. package/dist/google-BQK68wbe.js +5 -0
  70. package/dist/{helper-CIYSBZvt.js → helper-BQYvN6FL.js} +1 -1
  71. package/dist/{index-Dg_OJTxE.js → index-6FvsyekG.js} +1 -1
  72. package/dist/index-ARC-NYFZ.js +55 -0
  73. package/dist/{index-Cv0pq7A_.js → index-C9j6OhgK.js} +302 -634
  74. package/dist/{index-BPh_k5rA.js → index-CH_QL_76.js} +3 -3
  75. package/dist/{index-DdAl4SK2.js → index-CJUzQG6t.js} +26 -17
  76. package/dist/{index-PmoP3mXP.js → index-Cv-DbZdw.js} +7 -7
  77. package/dist/{index-D4_JDL9j.js → index-D6wOnTAl.js} +3 -3
  78. package/dist/{index-CixwNfnv.js → index-D8vmbFE5.js} +1 -1
  79. package/dist/{index-DcE-11T-.js → index-DW7H-3z4.js} +1275 -1506
  80. package/dist/{index-C_6y8OES.js → index-Dcxjgr6s.js} +1 -1
  81. package/dist/{index-CF1RNy12.js → index-Dz130JVH.js} +1 -1
  82. package/dist/{index-BBgVfqVf.js → index-ERqXuFvQ.js} +1 -1
  83. package/dist/{index-C-2YkeBp.js → index-hTgJrZR8.js} +1968 -1996
  84. package/dist/{index.esm2017-QGfAIiCc.js → index.esm2017-DY9Lrb0O.js} +184 -184
  85. package/dist/{loading-Cql_LElt.js → loading-EnU7K0k3.js} +1 -1
  86. package/dist/{lodash-PMdIVUsY.js → lodash-Cr7KdLib.js} +1 -1
  87. package/dist/{membership-BHD1GQ45.js → membership-B1eIzQDB.js} +3 -3
  88. package/dist/{money-CASVly6f.js → money-DpUzzEJj.js} +1 -1
  89. package/dist/{number-dMI2x0jy.js → number-DAz9zOKI.js} +1 -1
  90. package/dist/object-qECH92oz.js +26 -0
  91. package/dist/objectid-LXOkMCkM.js +145 -0
  92. package/dist/{plugins-CnEVta3V.js → plugins-DJ13vaqz.js} +95 -94
  93. package/dist/{reward-vdrNMYrF.js → reward-Cmx_swM1.js} +1 -1
  94. package/dist/{rule-BLXUDFEw.js → rule-BCzySyr6.js} +487 -505
  95. package/dist/rule-builder-CDkWYBLG.js +102 -0
  96. package/dist/style.css +1 -1
  97. package/dist/template-DfnYZzoa.js +236 -0
  98. package/dist/{index-DzQCyuGA.js → timezone-Beb0XkZC.js} +20 -21
  99. package/dist/{trigger-Ccrh378a.js → trigger-BfQprjI-.js} +5 -5
  100. package/dist/{useMarketingMaterialActions-BQLBRa3G.js → useMarketingMaterialActions-CagN58AP.js} +3 -3
  101. package/dist/{usePagination-BjsffqjT.js → usePagination-XyeJR5ws.js} +1 -1
  102. package/dist/{user-B5jS1GLb.js → user-l2YG1VjD.js} +1 -1
  103. package/dist/{vue-i18n-CCjHlB6z.js → vue-i18n-DJXhpQga.js} +391 -391
  104. package/dist/{xlsx-DmBOvA2N.js → xlsx-DypdT1NW.js} +1 -1
  105. package/dist/{zod-DrYZ6KS4.js → zod-BM5P7Bti.js} +1 -1
  106. package/package.json +4 -8
  107. package/dist/AuditLogs-CAtlilma.js +0 -2013
  108. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bpr9KuHW.js +0 -3377
  109. package/dist/Grab-CDhmMNsL.js +0 -300
  110. package/dist/LoyaltyDashboard-BFjI3IWT.js +0 -1082
  111. package/dist/Review-D9cFDrhN.js +0 -1192
  112. package/dist/ReviewFacebookCallback-DbE8_6D3.js +0 -243
  113. package/dist/ReviewGoogleCallback-LMZgyopt.js +0 -208
  114. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BEqgU70M.js +0 -1911
  115. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CNC_jNgW.js +0 -1130
  116. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-BBlCR4pN.js +0 -7007
  117. package/dist/duplicateCampaign-CxuNftok.js +0 -51
  118. package/dist/index-Dc-I4Jr-.js +0 -67
  119. package/dist/object-BYyQ0PZp.js +0 -18
  120. package/dist/objectid-Db_4Ays3.js +0 -145
  121. package/dist/template-CRjkIq3e.js +0 -188
@@ -0,0 +1,426 @@
1
+ import { defineComponent as I, ref as y, watch as X, onMounted as T, resolveComponent as x, openBlock as d, createBlock as A, withCtx as P, createVNode as b, unref as t, createElementVNode as r, createElementBlock as k, Fragment as $, renderList as D, computed as G, toDisplayString as M, isRef as j, createSlots as Y, createCommentVNode as V, createTextVNode as ee, reactive as te, onBeforeMount as ae } from "vue";
2
+ import { _ as ne } from "./campaign-CpzFl8Vr.js";
3
+ import "./index-Cv-DbZdw.js";
4
+ import "./campaign-DIgbywUy.js";
5
+ import { useRouter as le } from "vue-router";
6
+ import { c as E, u as oe } from "./campaign-MPUFwgli.js";
7
+ import { _ as se } from "./ZodTextField.vue_vue_type_script_setup_true_lang-CAtzo8zL.js";
8
+ import { Z as ie } from "./zod-BM5P7Bti.js";
9
+ import { F as re } from "./dto-C5_Te4gk.js";
10
+ import { J as ue } from "./JsonViewer-v8_C7l5N.js";
11
+ import "./index-CH_QL_76.js";
12
+ import { useSnackbar as ce } from "@feedmepos/ui-library";
13
+ import { u as me } from "./app-wDQR6dpb.js";
14
+ import { u as de } from "./loading-EnU7K0k3.js";
15
+ import { C as pe } from "./campaign.fn-BvxZt-0r.js";
16
+ import { g as ve } from "./object-qECH92oz.js";
17
+ import { u as fe } from "./membership-B1eIzQDB.js";
18
+ import { u as ye } from "./vue-i18n-DJXhpQga.js";
19
+ const ge = { class: "ml-32 flex flex-col" }, _e = /* @__PURE__ */ I({
20
+ __name: "CampaignCard",
21
+ props: {
22
+ title: {},
23
+ items: {},
24
+ modelValue: {}
25
+ },
26
+ emits: ["update:model-value"],
27
+ setup(U, { emit: g }) {
28
+ const c = U, v = g, S = (o) => {
29
+ o ? p.value = c.items.map((a) => a.value) : p.value = [], i.value = o, v("update:model-value", p.value);
30
+ }, _ = (o) => {
31
+ p.value = o, i.value = o.length === c.items.length, v("update:model-value", o);
32
+ }, i = y(!1), p = y([]);
33
+ return X(
34
+ () => c.modelValue,
35
+ () => {
36
+ p.value = c.modelValue.filter(
37
+ (o) => c.items.find((a) => a.value === o)
38
+ );
39
+ }
40
+ ), T(() => {
41
+ p.value = c.modelValue.filter(
42
+ (o) => c.items.find((a) => a.value === o)
43
+ );
44
+ }), (o, a) => {
45
+ const h = x("FmCheckbox"), l = x("FmCard");
46
+ return d(), A(l, {
47
+ variant: "outlined",
48
+ class: "p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3"
49
+ }, {
50
+ default: P(() => [
51
+ b(h, {
52
+ "model-value": t(i),
53
+ value: "1",
54
+ label: c.title,
55
+ indeterminate: t(p).length > 0,
56
+ "onUpdate:modelValue": S
57
+ }, null, 8, ["model-value", "label", "indeterminate"]),
58
+ r("div", ge, [
59
+ (d(!0), k($, null, D(c.items, (n, u) => (d(), A(h, {
60
+ key: u,
61
+ "model-value": t(p),
62
+ label: n.label,
63
+ value: n.value,
64
+ "onUpdate:modelValue": _
65
+ }, null, 8, ["model-value", "label", "value"]))), 128))
66
+ ])
67
+ ]),
68
+ _: 1
69
+ });
70
+ };
71
+ }
72
+ }), he = { class: "space-y-16" }, be = { class: "flex items-center" }, xe = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary w-[300px]" }, Ce = { class: "space-y-[40px]" }, ke = /* @__PURE__ */ I({
73
+ __name: "LinkCampaign",
74
+ props: {
75
+ modelValue: {
76
+ type: Array,
77
+ required: !0
78
+ },
79
+ campaigns: {
80
+ type: Object,
81
+ required: !0
82
+ }
83
+ },
84
+ emits: ["update:model-value"],
85
+ setup(U, { emit: g }) {
86
+ const c = y(""), v = y([]), S = U, _ = g, i = G(() => Object.entries(S.campaigns).reduce((o, [a, h]) => {
87
+ const l = h.filter(
88
+ (n) => n.label.toLowerCase().includes(c.value.toLowerCase())
89
+ );
90
+ return l.length > 0 && (o[a] = l), o;
91
+ }, {}));
92
+ function p(o, a) {
93
+ v.value = v.value.filter(
94
+ (h) => !a.map((l) => l.value).includes(h)
95
+ ), v.value = [.../* @__PURE__ */ new Set([...v.value, ...o])], _("update:model-value", v.value);
96
+ }
97
+ return T(() => {
98
+ v.value = S.modelValue;
99
+ }), (o, a) => {
100
+ const h = x("FmTextField");
101
+ return d(), k($, null, [
102
+ b(ue, { json: U.campaigns }, null, 8, ["json"]),
103
+ r("div", he, [
104
+ r("div", be, [
105
+ r("div", xe, M(t(v).length) + " campaign(s) linked ", 1),
106
+ b(h, {
107
+ modelValue: t(c),
108
+ "onUpdate:modelValue": a[0] || (a[0] = (l) => j(c) ? c.value = l : null),
109
+ "prepend-icon": "search",
110
+ placeholder: "Search",
111
+ class: "w-full"
112
+ }, null, 8, ["modelValue"])
113
+ ]),
114
+ r("div", Ce, [
115
+ (d(!0), k($, null, D(t(i), (l, n) => (d(), A(_e, {
116
+ "model-value": t(v),
117
+ title: n,
118
+ items: l,
119
+ "onUpdate:modelValue": (u) => p(u, l)
120
+ }, null, 8, ["model-value", "title", "items", "onUpdate:modelValue"]))), 256))
121
+ ])
122
+ ])
123
+ ], 64);
124
+ };
125
+ }
126
+ }), Ve = { class: "flex items-center gap-x-8" }, Se = {
127
+ key: 0,
128
+ class: "space-y-16 pr-12"
129
+ }, we = { class: "flex items-center gap-x-16" }, Fe = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ae = { class: "mt-16" }, $e = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600 py-8 px-16 bg-gray-100" }, Ue = { class: "flex justify-between items-center py-8 px-16 border-b-1" }, Le = { class: "flex items-center gap-8" }, Pe = /* @__PURE__ */ I({
130
+ __name: "AnalyticSheet",
131
+ emits: ["success"],
132
+ setup(U, { expose: g, emit: c }) {
133
+ const v = c, S = me();
134
+ ce();
135
+ const _ = y(!1), i = y(!1), p = {
136
+ name: "",
137
+ campaigns: []
138
+ }, o = y(""), a = y({ ...p }), h = re.superRefine((s, e) => {
139
+ }), l = y([]), n = y(null), { global: u, minor: w } = de, L = G(() => {
140
+ const s = h.safeParse(a.value);
141
+ return s.success ? [] : s.error.errors;
142
+ });
143
+ function B(s) {
144
+ var e;
145
+ _.value = !0, s ? (n.value = { ...s }, a.value = { ...s, campaigns: (e = s.pf_campaigns) == null ? void 0 : e.map((m) => m._id) }) : (n.value = null, a.value = { ...p });
146
+ }
147
+ function F() {
148
+ _.value = !1, n.value = null;
149
+ }
150
+ function K() {
151
+ i.value = !0;
152
+ }
153
+ async function q() {
154
+ const s = await E.readAll({
155
+ limit: 1e3,
156
+ skip: 0,
157
+ sortBy: "_id",
158
+ search: "",
159
+ descending: !0
160
+ });
161
+ l.value = s.resources.filter(
162
+ (e) => !["MEMBERSHIP", "REWARD_POOL"].includes(e.type) && !["ISSUE_REWARD"].includes("event" in e ? e == null ? void 0 : e.event.type : "")
163
+ );
164
+ }
165
+ const N = G(() => {
166
+ const s = (m) => m.map((C) => ({
167
+ label: C.name,
168
+ value: C._id
169
+ }));
170
+ return ve(
171
+ l.value,
172
+ (m) => pe.formattedType(m.type),
173
+ s
174
+ );
175
+ }), J = G(() => Object.entries(N.value).reduce(
176
+ (s, [e, m]) => {
177
+ const C = m.filter((R) => {
178
+ var O, f;
179
+ return (f = (O = a.value) == null ? void 0 : O.campaigns) == null ? void 0 : f.includes(R.value);
180
+ }).filter(
181
+ (R) => R.label.toLowerCase().includes(o.value.toLowerCase())
182
+ );
183
+ return C.length > 0 && (s[e] = C), s;
184
+ },
185
+ {}
186
+ ));
187
+ function W(s) {
188
+ var m, C;
189
+ const e = (m = a.value.campaigns) == null ? void 0 : m.indexOf(s);
190
+ e != null && e > -1 && ((C = a.value.campaigns) == null || C.splice(e, 1));
191
+ }
192
+ async function Z() {
193
+ h.safeParse(a.value).success && await w(
194
+ async () => {
195
+ var e;
196
+ n.value ? await E.updateGroup(
197
+ (e = n.value) == null ? void 0 : e._id,
198
+ a.value
199
+ ) : await E.createGroup(a.value), v("success"), F();
200
+ },
201
+ {
202
+ message: "Saving group",
203
+ successMessage: "Group saved"
204
+ }
205
+ );
206
+ }
207
+ async function z() {
208
+ await w(
209
+ async () => {
210
+ var s;
211
+ await E.deleteGroup((s = n.value) == null ? void 0 : s._id), v("success"), F();
212
+ },
213
+ {
214
+ message: "Deleting group",
215
+ successMessage: "Group deleted"
216
+ }
217
+ );
218
+ }
219
+ return T(async () => {
220
+ await q();
221
+ }), g({
222
+ showSheet: B,
223
+ hideSheet: F
224
+ }), (s, e) => {
225
+ const m = x("FmButton"), C = x("FmTextField"), R = x("FmList"), O = x("FmSideSheet");
226
+ return d(), A(O, {
227
+ modelValue: t(_),
228
+ "onUpdate:modelValue": e[7] || (e[7] = (f) => j(_) ? _.value = f : null),
229
+ header: t(n) ? "Edit group" : "Add group",
230
+ "dismiss-away": "",
231
+ "close-button": !0,
232
+ "max-width": 550
233
+ }, Y({
234
+ "side-sheet-footer": P(() => [
235
+ r("div", Le, [
236
+ t(i) ? V("", !0) : (d(), k($, { key: 0 }, [
237
+ b(m, {
238
+ label: "Submit",
239
+ onClick: Z,
240
+ disabled: t(L).length > 0 || t(S).isLoading
241
+ }, null, 8, ["disabled"]),
242
+ b(m, {
243
+ label: "Cancel",
244
+ onClick: e[4] || (e[4] = (f) => F()),
245
+ variant: "tertiary"
246
+ }),
247
+ t(n) ? (d(), A(m, {
248
+ key: 0,
249
+ label: "Delete",
250
+ variant: "plain",
251
+ class: "ml-auto fm-color-system-error-300",
252
+ onClick: e[5] || (e[5] = (f) => z())
253
+ })) : V("", !0)
254
+ ], 64)),
255
+ t(i) ? (d(), A(m, {
256
+ key: 1,
257
+ label: "Confirm",
258
+ onClick: e[6] || (e[6] = (f) => i.value = !1)
259
+ })) : V("", !0)
260
+ ])
261
+ ]),
262
+ default: P(() => [
263
+ t(i) ? V("", !0) : (d(), k("div", Se, [
264
+ e[9] || (e[9] = r("div", { class: "fm-typo-en-title-sm-800" }, "Group detail", -1)),
265
+ b(se, {
266
+ modelValue: t(a).name,
267
+ "onUpdate:modelValue": e[1] || (e[1] = (f) => t(a).name = f),
268
+ label: "Name",
269
+ schema: t(ie).typeAtPath(t(h), "name")
270
+ }, null, 8, ["modelValue", "schema"]),
271
+ e[10] || (e[10] = r("div", { class: "fm-typo-en-title-sm-800" }, "Link campaign", -1)),
272
+ r("div", we, [
273
+ r("div", Fe, M(t(a).campaigns.length) + " campaign(s) linked ", 1),
274
+ b(C, {
275
+ modelValue: t(o),
276
+ "onUpdate:modelValue": e[2] || (e[2] = (f) => j(o) ? o.value = f : null),
277
+ "prepend-icon": "search",
278
+ placeholder: "Search",
279
+ class: "w-auto"
280
+ }, null, 8, ["modelValue"])
281
+ ]),
282
+ b(m, {
283
+ variant: "plain",
284
+ icon: "link",
285
+ label: "Link Campaign",
286
+ onClick: K
287
+ })
288
+ ])),
289
+ t(i) ? (d(), A(ke, {
290
+ key: 1,
291
+ modelValue: t(a).campaigns,
292
+ "onUpdate:modelValue": e[3] || (e[3] = (f) => t(a).campaigns = f),
293
+ campaigns: t(N)
294
+ }, null, 8, ["modelValue", "campaigns"])) : V("", !0),
295
+ r("div", Ae, [
296
+ t(i) ? V("", !0) : (d(!0), k($, { key: 0 }, D(t(J), (f, Q) => (d(), k("div", null, [
297
+ r("div", $e, M(Q), 1),
298
+ b(R, { separator: !0 }, {
299
+ default: P(() => [
300
+ (d(!0), k($, null, D(f, (H) => (d(), k("div", Ue, [
301
+ r("div", null, M(H.label), 1),
302
+ r("div", null, [
303
+ b(m, {
304
+ icon: "delete",
305
+ onClick: (Oe) => W(H.value),
306
+ variant: "tertiary"
307
+ }, null, 8, ["onClick"])
308
+ ])
309
+ ]))), 256))
310
+ ]),
311
+ _: 2
312
+ }, 1024)
313
+ ]))), 256))
314
+ ])
315
+ ]),
316
+ _: 2
317
+ }, [
318
+ t(i) ? {
319
+ name: "side-sheet-header",
320
+ fn: P(() => [
321
+ r("div", Ve, [
322
+ b(m, {
323
+ icon: "arrow_back",
324
+ variant: "tertiary",
325
+ onClick: e[0] || (e[0] = (f) => i.value = !1)
326
+ }),
327
+ e[8] || (e[8] = ee("Link campaign ", -1))
328
+ ])
329
+ ]),
330
+ key: "0"
331
+ } : void 0
332
+ ]), 1032, ["modelValue", "header"]);
333
+ };
334
+ }
335
+ }), Ge = { class: "px-24 flex flex-col gap-y-32 pb-24" }, Me = { class: "space-y-16" }, Be = { class: "flex items-center justify-end" }, Re = { class: "fm-typo-en-title-sm-800 text-center" }, Ee = { class: "fm-typo-body-en-md-400 text-center text-fm-color-typo-secondary" }, nt = /* @__PURE__ */ I({
336
+ __name: "Analytic",
337
+ setup(U) {
338
+ const { t: g } = ye(), c = {
339
+ label: g("connect.analytic.addGroup"),
340
+ value: "create",
341
+ isPrimary: !0,
342
+ prependIcon: "add"
343
+ }, v = oe(), S = y(), _ = y([]), i = y(""), p = te({
344
+ totalCampaign: 0,
345
+ totalProgram: 0,
346
+ totalMember: 0
347
+ }), o = y("1");
348
+ g("connect.analytic.summary.totalCampaign"), g("connect.analytic.summary.totalProgram"), g("connect.analytic.summary.totalMember");
349
+ function a(n) {
350
+ var u;
351
+ o.value = (/* @__PURE__ */ new Date()).toISOString(), (u = S.value) == null || u.showSheet(n);
352
+ }
353
+ async function h() {
354
+ await v.readGroups();
355
+ const n = await E.readAllGrouped({
356
+ limit: 100,
357
+ skip: 0,
358
+ sortBy: "_id",
359
+ search: "",
360
+ descending: !0
361
+ });
362
+ _.value = n.resources;
363
+ }
364
+ G(() => _.value.filter((n) => {
365
+ var u;
366
+ return n.name.includes(i.value) || ((u = n.pf_campaigns) == null ? void 0 : u.filter((w) => w.name.includes(i.value)).length);
367
+ }));
368
+ const l = fe();
369
+ return le(), y(!0), G(() => {
370
+ var n, u, w, L;
371
+ return !l.storeOption || !l.storeOption.company ? -1 : !l.payoutAccount || !l.payoutAccount.enable || l.payoutAccount.status != "APPROVED" ? 0 : (u = (n = l.store) == null ? void 0 : n.categories) != null && u.length ? (L = (w = l.store) == null ? void 0 : w.categories) != null && L.some(
372
+ (B) => B.bundles.some((F) => F.isFeedvibe)
373
+ ) ? 3 : 2 : 1;
374
+ }), ae(async () => {
375
+ await l.readMemberStore(), await l.readMembership(), await l.readPayoutAccount();
376
+ }), (n, u) => {
377
+ const w = x("FmPageHead"), L = x("FmSearch"), B = x("FmCard");
378
+ return x("FmButton"), x("FmIcon"), d(), k($, null, [
379
+ b(w, {
380
+ title: t(g)("connect.analytic.title"),
381
+ actions: t(_).length > 0 ? [c] : [],
382
+ "onClick:action": u[0] || (u[0] = (F) => a())
383
+ }, null, 8, ["title", "actions"]),
384
+ r("div", Ge, [
385
+ r("div", Me, [
386
+ r("div", Be, [
387
+ b(L, {
388
+ class: "xs:hidden",
389
+ modelValue: t(i),
390
+ "onUpdate:modelValue": u[1] || (u[1] = (F) => j(i) ? i.value = F : null),
391
+ placeholder: t(g)("connect.analytic.search"),
392
+ collapsible: ""
393
+ }, null, 8, ["modelValue", "placeholder"])
394
+ ]),
395
+ V("", !0)
396
+ ]),
397
+ V("", !0),
398
+ t(_).length ? V("", !0) : (d(), A(B, {
399
+ key: 1,
400
+ variant: "outlined",
401
+ class: "flex flex-col gap-y-24 items-center p-16"
402
+ }, {
403
+ default: P(() => [
404
+ u[7] || (u[7] = r("img", {
405
+ src: ne,
406
+ class: "w-[150px]"
407
+ }, null, -1)),
408
+ r("div", Re, M(t(g)("connect.analytic.maintenance.title")), 1),
409
+ r("div", Ee, M(t(g)("connect.analytic.maintenance.description")), 1)
410
+ ]),
411
+ _: 1
412
+ })),
413
+ V("", !0),
414
+ b(Pe, {
415
+ ref_key: "sheetRef",
416
+ ref: S,
417
+ onSuccess: h
418
+ }, null, 512)
419
+ ])
420
+ ], 64);
421
+ };
422
+ }
423
+ });
424
+ export {
425
+ nt as default
426
+ };