@feedmepos/mf-connect 0.1.97-prod → 0.1.98-beta.2

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 (116) hide show
  1. package/dist/{App-DHAyGCKP.js → App-BWBeJksP.js} +118 -106
  2. package/dist/AuditLogs-CWVUX5o0.js +2013 -0
  3. package/dist/{Bin-BxyU2xtK.js → Bin-jXmZpGfg.js} +8 -8
  4. package/dist/{Broadcast-BJjehb02.js → Broadcast-C76pTADb.js} +18 -17
  5. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BCxP8rEW.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-9kfq8OXE.js} +5 -6
  6. package/dist/{Card-BYDuADCn.js → Card-qXn83BYu.js} +19 -19
  7. package/dist/{Collections-BlPEkNm8.js → Collections-DGXUQSbz.js} +197 -185
  8. package/dist/{Credit-D9Eqxv2E.js → Credit-CpmrPZx9.js} +18 -17
  9. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +58 -0
  10. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DAnw5TFZ.js +3377 -0
  11. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-hpNgkLOt.js → EffectSheet.vue_vue_type_style_index_0_lang-BCAotF0P.js} +6 -6
  12. package/dist/{Experience-DGumSpYK.js → Experience-CuOq7hd3.js} +35 -34
  13. package/dist/{FileSaver.min-D_TpPHp3.js → FileSaver.min-Cjv6SzrG.js} +1 -1
  14. package/dist/{Game-DDsYLdKu.js → Game-D0KfLD-b.js} +16 -15
  15. package/dist/Grab-L1h7bHD7.js +300 -0
  16. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-R00i7YNe.js → ImageInput.vue_vue_type_script_setup_true_lang-DMAaHxzm.js} +1 -1
  17. package/dist/{Index-DwRbFOsj.js → Index-DxwMHEV3.js} +10 -10
  18. package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-i9-B25xO.js +48 -0
  19. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-D_HOJBzW.js → LottieAnimation.vue_vue_type_script_setup_true_lang-D84v7zC_.js} +1 -1
  20. package/dist/LoyaltyDashboard-B5wg1EUC.js +1082 -0
  21. package/dist/{MainLayout-BEUAguIP.js → MainLayout-Cgi3Z3EM.js} +1 -1
  22. package/dist/{Marketing-WdhEZvmz.js → Marketing-Cl5OSBI1.js} +4 -4
  23. package/dist/{MarketingMaterialEdit-DUIkUA79.js → MarketingMaterialEdit-CzYTbdJd.js} +214 -211
  24. package/dist/{Member-jL3RMGsZ.js → Member-D29x5Cic.js} +20 -20
  25. package/dist/{MemberList-B1bdPK63.js → MemberList-DDPe6Ymr.js} +50 -51
  26. package/dist/{MemberTransactions-BNKJ0wtr.js → MemberTransactions-3mboVWAx.js} +1 -1
  27. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-Cvsz00_4.js → MessageInput.vue_vue_type_script_setup_true_lang-C2HlA9O8.js} +11 -11
  28. package/dist/{Mission-CoXzS7U6.js → Mission-CMPc4NLe.js} +35 -34
  29. package/dist/{Overview-B16wZUSV.js → Overview-sJ2kuP4U.js} +19 -19
  30. package/dist/{Point-CORBv0y2.js → Point-BBP4UEhf.js} +30 -29
  31. package/dist/{Promotion-DQ4WnFkH.js → Promotion-Bt0RLGsd.js} +111 -105
  32. package/dist/{Queue-BW97QEY2.js → Queue-CzVsoIDM.js} +43 -43
  33. package/dist/{Record-DZOhwf13.js → Record-CAoGgaxo.js} +10 -10
  34. package/dist/Review-CVBJlwGK.js +959 -0
  35. package/dist/ReviewFacebookCallback-RGWdxXYf.js +243 -0
  36. package/dist/ReviewGoogleCallback-L7_Jjbkx.js +208 -0
  37. package/dist/{Reward-Bi9mpuyH.js → Reward-CrpFlr0a.js} +17 -17
  38. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-Dtosx1wE.js → RewardGroup.vue_vue_type_script_setup_true_lang-DW-WFNI6.js} +12 -12
  39. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DlcsO8fk.js +1911 -0
  40. package/dist/{Segment-COhS8SPv.js → Segment-Cy-QwYQQ.js} +77 -78
  41. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-By_BQodK.js → SelectItems.vue_vue_type_script_setup_true_lang-ovvxxcrQ.js} +3 -3
  42. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-BoEnwoYd.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-D69bJtyd.js} +12 -12
  43. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-DonadRJT.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-DQyoPZ_6.js} +4 -4
  44. package/dist/{Setting-BNtYrzdN.js → Setting-DEQIJ4fY.js} +259 -248
  45. package/dist/{SettingAdvertisements-Cne8GikV.js → SettingAdvertisements-NuwjCPLN.js} +13 -13
  46. package/dist/{Store-iTgtmUVL.js → Store-Cw2J_ecA.js} +24 -24
  47. package/dist/{StoreRewards-DLawXBsl.js → StoreRewards-BK5rDAaK.js} +16 -16
  48. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-B3jwaYHX.js +1130 -0
  49. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-D_OdWctk.js +7007 -0
  50. package/dist/{Tier-BbZMbFSd.js → Tier-CwZ40RYc.js} +544 -469
  51. package/dist/{Title-Co5XWIJm.js → Title-DU7KmsK2.js} +93 -92
  52. package/dist/{Transaction-CoUbt5rr.js → Transaction-Uh5Ozt93.js} +2 -2
  53. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CzJpNT94.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BtnUNkcS.js} +6 -6
  54. package/dist/{Voucher-CXojttH0.js → Voucher-BF6ARaRe.js} +28 -27
  55. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-Bxkds9_4.js → VoucherEditor.vue_vue_type_script_setup_true_lang-C7msPJdi.js} +12 -12
  56. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-CHVqFzLm.js → ZodTextField.vue_vue_type_script_setup_true_lang-BrR2WA1K.js} +2 -2
  57. package/dist/{app-_LtKE4PZ.js → app-DlECkPwT.js} +3408 -2913
  58. package/dist/app.js +4 -3
  59. package/dist/{business-CchrWCX9.js → business-BSe9C-xG.js} +1 -1
  60. package/dist/{campaign-N2x2N6OP.js → campaign-BNS2RxKc.js} +114 -64
  61. package/dist/{campaign-D2RzC0L1.js → campaign-CXw3jpdr.js} +13 -7
  62. package/dist/{campaign.enum-DqJsu1At.js → campaign.enum-CnMa2Tia.js} +3 -2
  63. package/dist/{campaign.fn-Da4r_dvc.js → campaign.fn-CNOinW8t.js} +131 -131
  64. package/dist/{collectible.enum-CHheiKkA.js → collectible.enum-BIvEz79q.js} +1 -1
  65. package/dist/duplicateCampaign-Co2TdbrL.js +51 -0
  66. package/dist/{effect-DADvE7lZ.js → effect-Bt8PE3-M.js} +1 -1
  67. package/dist/{email-addresses-DzUHQuVs.js → email-addresses-Dh95ALqP.js} +2 -2
  68. package/dist/{export-uzECYleM.js → export-DIIgAwP7.js} +3 -3
  69. package/dist/{helper-DMsYRFIM.js → helper-8zEdQ9jm.js} +1 -1
  70. package/dist/{index-CEVpWmjC.js → index-0BNEvaYc.js} +7 -7
  71. package/dist/{index-r8TuEpzi.js → index-BAlFstx4.js} +1 -1
  72. package/dist/{index-C2h4SP0A.js → index-BP5qSDQw.js} +806 -205
  73. package/dist/{index-KYtKBtvK.js → index-Bqxe3Gbq.js} +3 -3
  74. package/dist/{index-CrPHsZg1.js → index-CWypTyOP.js} +1554 -1270
  75. package/dist/{index-DXl_Qtu-.js → index-CfxDirFl.js} +1 -1
  76. package/dist/{index-Bc-pgOn6.js → index-DDp0nMys.js} +1 -1
  77. package/dist/index-DW4-mTTG.js +52 -0
  78. package/dist/{timezone-B_KZGqyd.js → index-DdCPfF8x.js} +21 -20
  79. package/dist/index-IPOrNVQw.js +67 -0
  80. package/dist/{index-XJX8_Wlh.js → index-SsUBL4IR.js} +1 -1
  81. package/dist/{index-Ct1Qf7kH.js → index-VS1hWlhk.js} +1 -1
  82. package/dist/{index-B9RmImNP.js → index-ZKJoXi1-.js} +3 -3
  83. package/dist/{index-DQ6H1MEw.js → index-rwlkBKrS.js} +1996 -1968
  84. package/dist/{index.esm2017-D9jjiQqn.js → index.esm2017-CgR02aQB.js} +209 -209
  85. package/dist/{loading-DK8UdxtS.js → loading-CxY9qhzD.js} +1 -1
  86. package/dist/{lodash-CgcQgDO8.js → lodash-CELsN1M_.js} +1 -1
  87. package/dist/{membership-Cs4GzRnn.js → membership-BoQMuerb.js} +3 -3
  88. package/dist/{money-TgbWserQ.js → money-CH913hGN.js} +1 -1
  89. package/dist/{number-fLCh4B45.js → number-CO-WbLdr.js} +1 -1
  90. package/dist/object-BYyQ0PZp.js +18 -0
  91. package/dist/objectid-BM2Ygj-U.js +145 -0
  92. package/dist/{plugins-DYcrIMpx.js → plugins-YK45gSb1.js} +94 -95
  93. package/dist/{reward-uQ8Oz8Fd.js → reward-3aFPahH6.js} +1 -1
  94. package/dist/{rule-BcbgF0xS.js → rule-DC9my0Vg.js} +505 -487
  95. package/dist/style.css +1 -1
  96. package/dist/template-tDq12e1p.js +188 -0
  97. package/dist/{trigger-c-_77EFL.js → trigger-DoPHRgKt.js} +5 -5
  98. package/dist/{useMarketingMaterialActions-BCqwGe4e.js → useMarketingMaterialActions-CEd6ODsz.js} +3 -3
  99. package/dist/{usePagination-C3cT5BmC.js → usePagination-C8FUj5q_.js} +1 -1
  100. package/dist/{user-CRIo5MyA.js → user-Dhlhrnf8.js} +1 -1
  101. package/dist/{vue-i18n-BU_SuDqj.js → vue-i18n-B-92uhPn.js} +175 -175
  102. package/dist/{xlsx-Bw1AshOG.js → xlsx-Dmxne1eM.js} +166 -166
  103. package/dist/{zod-CzlTW8Al.js → zod-Dcdy9Dm3.js} +1 -1
  104. package/package.json +8 -4
  105. package/dist/Analytic-Ccb5IKBy.js +0 -426
  106. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bf8Rc-Eh.js +0 -2223
  107. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-CrvTdEPu.js +0 -1888
  108. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Cl8JEYjx.js +0 -1118
  109. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DEEz7iEu.js +0 -142
  110. package/dist/collection.fn-BqDPyvUe.js +0 -26
  111. package/dist/dto-CstKk_3g.js +0 -216
  112. package/dist/index-_KlH62Ed.js +0 -55
  113. package/dist/object-qECH92oz.js +0 -26
  114. package/dist/objectid-CVxLIQ5K.js +0 -145
  115. package/dist/rule-builder-CIkRKgap.js +0 -102
  116. package/dist/template-wZEVj8lZ.js +0 -236
@@ -1,4 +1,4 @@
1
- import { i as Z } from "./plugins-DYcrIMpx.js";
1
+ import { i as Z } from "./plugins-YK45gSb1.js";
2
2
  import { h as f } from "vue";
3
3
  function u(e, o) {
4
4
  return e.path.join(".") === o;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-connect",
3
- "version": "0.1.97-prod",
3
+ "version": "0.1.98-beta.2",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -17,15 +17,18 @@
17
17
  "dependencies": {
18
18
  "@ckeditor/ckeditor5-build-classic": "^44.3.0",
19
19
  "@ckeditor/ckeditor5-vue": "^7.3.0",
20
+ "@feedmepos/custom-attributes": "0.0.1-rc.4",
20
21
  "@feedmepos/core": "2.15.21",
21
22
  "@feedmepos/menu": "1.0.34",
22
23
  "@feedmepos/hrm-permission": "1.0.14",
23
24
  "@feedmepos/mf-common": "1.29.23",
24
- "@feedmepos/mf-core-ui": "1.0.25",
25
- "@feedmepos/ui-library": "1.10.4",
25
+ "@feedmepos/ui-library": "1.10.8",
26
26
  "@feedmepos/mf-remy-panel": "0.15.0",
27
+ "@feedmepos/remy-vue-client": "0.2.0-beta.14",
28
+ "@feedmepos/mf-core-ui": "1.0.25",
27
29
  "@tailwindcss/typography": "^0.5.16",
28
30
  "@types/qrcode": "^1.5.5",
31
+ "@vueuse/core": "^14.1.0",
29
32
  "axios": "^1.7.2",
30
33
  "bson-objectid": "^2.0.4",
31
34
  "change-case": "^5.4.4",
@@ -34,7 +37,7 @@
34
37
  "dayjs": "^1.11.12",
35
38
  "dotenv": "^16.4.5",
36
39
  "email-addresses": "^5.0.0",
37
- "fabric": "^6.4.2",
40
+ "fabric": "^5.5.1",
38
41
  "file-saver": "^2.0.5",
39
42
  "firebase": "^10.12.4",
40
43
  "i18next": "24.2.1",
@@ -44,6 +47,7 @@
44
47
  "pinia": "^2.1.7",
45
48
  "qrcode": "^1.5.3",
46
49
  "rrule": "^2.8.1",
50
+ "ua-parser-js": "^2.0.3",
47
51
  "unplugin-auto-import": "^0.17.8",
48
52
  "uuid": "^10.0.0",
49
53
  "vite-plugin-vue-devtools": "^7.6.4",
@@ -1,426 +0,0 @@
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-CEVpWmjC.js";
4
- import "./campaign-N2x2N6OP.js";
5
- import { useRouter as le } from "vue-router";
6
- import { c as E, u as oe } from "./campaign-D2RzC0L1.js";
7
- import { _ as se } from "./ZodTextField.vue_vue_type_script_setup_true_lang-CHVqFzLm.js";
8
- import { Z as ie } from "./zod-CzlTW8Al.js";
9
- import { F as re } from "./dto-CstKk_3g.js";
10
- import { J as ue } from "./JsonViewer-v8_C7l5N.js";
11
- import "./index-KYtKBtvK.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-DK8UdxtS.js";
15
- import { C as pe } from "./campaign.fn-Da4r_dvc.js";
16
- import { g as ve } from "./object-qECH92oz.js";
17
- import { u as fe } from "./membership-Cs4GzRnn.js";
18
- import { u as ye } from "./vue-i18n-BU_SuDqj.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
- };