@feedmepos/mf-connect 0.1.98-beta.57 → 0.1.98-beta.59

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 (120) hide show
  1. package/dist/{App-BO2Eyrad.js → App-EPMWVhRl.js} +8 -8
  2. package/dist/{AuditLogs-CduIANMo.js → AuditLogs-DGfgg_B0.js} +11 -11
  3. package/dist/{Bin-QF11ntmi.js → Bin-CAoKk2Qu.js} +8 -8
  4. package/dist/{Broadcast-BTM4RQ69.js → Broadcast-DeaN6hHR.js} +11 -11
  5. package/dist/{CampaignAnalytic-ClDZaoE6.js → CampaignAnalytic-DVmErhEK.js} +510 -506
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-dZqVizdR.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BVdCt9UN.js} +6 -6
  7. package/dist/{Card-Q1UzqccH.js → Card-DEaJvF6q.js} +21 -21
  8. package/dist/{Collections-CJXgekb9.js → Collections-B_G2R-pT.js} +8 -8
  9. package/dist/{Credit--59mQFS2.js → Credit-Bxbo5feT.js} +12 -12
  10. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-DgX09eKJ.js → DateRangeChip.vue_vue_type_script_setup_true_lang-CbXXEb_b.js} +1 -1
  11. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-CHZ-Bb7m.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-CULi_DuX.js} +54 -55
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BDn3DDAD.js → EffectSheet.vue_vue_type_style_index_0_lang-CqTVK4kx.js} +12 -12
  13. package/dist/{Experience-Co4JhNR2.js → Experience-C5n7DOny.js} +12 -12
  14. package/dist/{FileSaver.min-5YaSibh7.js → FileSaver.min-CmvwRmjQ.js} +1 -1
  15. package/dist/{Game-Clajtl0A.js → Game-CV2kGDYk.js} +13 -13
  16. package/dist/{GiftCardSetup-D8aAX5Hg.js → GiftCardSetup-Du0JaAOY.js} +9 -9
  17. package/dist/{Grab-f9NlRetE.js → Grab-D-tMg9Xk.js} +9 -9
  18. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-D1IrKRz8.js → ImageInput.vue_vue_type_script_setup_true_lang-BzOJjs_7.js} +1 -1
  19. package/dist/{Index-DkfGmK1a.js → Index-FgWeYPvB.js} +10 -10
  20. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-DnXFpSbG.js → LocationPicker.vue_vue_type_script_setup_true_lang-DZAi88YS.js} +1 -1
  21. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DUvd2kQ3.js → LottieAnimation.vue_vue_type_script_setup_true_lang-BzWtxWET.js} +1 -1
  22. package/dist/{LoyaltyDashboard-Cv5WHOM5.js → LoyaltyDashboard-ovoxVpEh.js} +17 -17
  23. package/dist/{MainLayout-DPP0WH2J.js → MainLayout-DT2sd1UQ.js} +3 -3
  24. package/dist/{Marketing-DTzUSHMW.js → Marketing-B8eY1Mz8.js} +4 -4
  25. package/dist/{MarketingMaterialEdit-EQdRBYe_.js → MarketingMaterialEdit-9lMMK6wr.js} +6 -6
  26. package/dist/{Member-mmPtQpcJ.js → Member-BBQDC7qH.js} +7 -7
  27. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-CaykyGpo.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-BfqxFlWd.js} +23 -23
  28. package/dist/{MemberImportHistory-CosGWK6J.js → MemberImportHistory-2FCTkHkQ.js} +7 -7
  29. package/dist/{MemberList-B25FChyx.js → MemberList-BsxZ9Caq.js} +14 -14
  30. package/dist/{MemberTransactions-C1Iwr2PC.js → MemberTransactions-D1vVtuKx.js} +1 -1
  31. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-Dy76Hi7S.js → MessageInput.vue_vue_type_script_setup_true_lang-odhcQ_g1.js} +10 -10
  32. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-BjKY7d9t.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-ELm3_clS.js} +1 -1
  33. package/dist/{Mission-DBFYv752.js → Mission-C28mUqvH.js} +13 -13
  34. package/dist/{Overview-tQE2krzT.js → Overview-DeBS_7vN.js} +19 -19
  35. package/dist/{Overview-DkvQdk3p.js → Overview-DyogLHhx.js} +4 -4
  36. package/dist/{Point-DFGLdpqH.js → Point-Bv9593In.js} +12 -12
  37. package/dist/{Promotion-B0TPgTRJ.js → Promotion-BQfEbQkK.js} +13 -13
  38. package/dist/{Queue-Pai-jb9x.js → Queue-BsA_SIPG.js} +11 -11
  39. package/dist/{Record-BNOdMHa9.js → Record-CaNv-a5D.js} +9 -9
  40. package/dist/{Review-BUfQIAIP.js → Review-jKKOChip.js} +2 -2
  41. package/dist/{ReviewFacebookCallback-D6jfeakg.js → ReviewFacebookCallback-DRVDBPBQ.js} +5 -5
  42. package/dist/{ReviewGoogleCallback-Ctl8DNMj.js → ReviewGoogleCallback-BSUkwi1N.js} +5 -5
  43. package/dist/{Reward-Bfk-Yt4h.js → Reward-CLvkIAFR.js} +16 -16
  44. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-c48TxM6-.js → RewardGroup.vue_vue_type_script_setup_true_lang-C8We6wGX.js} +12 -12
  45. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-nJoAjC4P.js → RuleGroup.vue_vue_type_script_setup_true_lang-uYcE0jWt.js} +68 -75
  46. package/dist/{Segment-CzL0P-1e.js → Segment-DpRd1m-s.js} +24 -24
  47. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-DcMiX5P8.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-B8gyDyD2.js} +13 -13
  48. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-1ADUHq-4.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BhMPpjCt.js} +4 -4
  49. package/dist/{Setting-B8dkbZ7G.js → Setting-d3jG5J7g.js} +14 -14
  50. package/dist/{SettingAdvertisements-z-Nx97_Q.js → SettingAdvertisements-D7oRdpHs.js} +12 -12
  51. package/dist/{Settings-Bj7Sgsxv.js → Settings-CEZAzSFA.js} +5 -5
  52. package/dist/{Store-BibnCePN.js → Store-Df7Oj7Dr.js} +25 -25
  53. package/dist/{StoreRewards-s_1EUC35.js → StoreRewards-DEQWavMf.js} +15 -15
  54. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-WqQHMVgu.js → StoreTransactions.vue_vue_type_script_setup_true_lang-BwDMj8_l.js} +24 -24
  55. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-Dh3A-USI.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BSM-9-ni.js} +2 -2
  56. package/dist/{Tier-DSIHI9NJ.js → Tier-BsBHMN0i.js} +141 -144
  57. package/dist/{Title-Cl3K5L3e.js → Title-CUj_GhCA.js} +21 -21
  58. package/dist/{Transaction-CS0rtyng.js → Transaction-8Osuak54.js} +2 -2
  59. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-Z-8TTRPC.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BoZzhVxU.js} +6 -6
  60. package/dist/{Voucher-CR_w7fqQ.js → Voucher-B9TFCpE0.js} +14 -14
  61. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-WsAmkz61.js → VoucherEditor.vue_vue_type_script_setup_true_lang-DqwrIEBF.js} +115 -121
  62. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BBSyDPhQ.js → ZodTextField.vue_vue_type_script_setup_true_lang-BFqTGaiN.js} +2 -2
  63. package/dist/{app-xUS3J9z2.js → app-JaMrl1Q3.js} +24648 -24383
  64. package/dist/app.js +1 -1
  65. package/dist/{base.export-DK6-6AZL.js → base.export-C-XjeO_8.js} +2 -2
  66. package/dist/{business-DzXKekqM.js → business-qX066mkW.js} +1 -1
  67. package/dist/{campaign-BLRQqfj4.js → campaign-DAqkMrCh.js} +8 -8
  68. package/dist/{campaign-B6DZ0Vj0.js → campaign-DcxZvdiX.js} +2 -2
  69. package/dist/{campaign.enum-DGPxPvey.js → campaign.enum-qJ9W4VTb.js} +1 -1
  70. package/dist/{campaign.fn-DksaoBjs.js → campaign.fn-C_W3zAbu.js} +162 -162
  71. package/dist/{collectible.enum-J15b2Jl2.js → collectible.enum-cS4F2xlG.js} +1 -1
  72. package/dist/{collection.fn-CKReS8ra.js → collection.fn-BsC5X2cl.js} +2 -2
  73. package/dist/{currency-q6M_hk-7.js → currency-DS_9mv_r.js} +1 -1
  74. package/dist/{duplicateCampaign-CdvzdrHQ.js → duplicateCampaign-BLynLq03.js} +11 -11
  75. package/dist/{effect-CyAwjL7O.js → effect-eqhKpbLr.js} +1 -1
  76. package/dist/{email-addresses-BWcWQegr.js → email-addresses-w9Jhh9jb.js} +2 -2
  77. package/dist/{helper-DjKrL_4r.js → helper-DnJGcKGJ.js} +1 -1
  78. package/dist/{index-zbhhxeLU.js → index-3XuFPLyU.js} +7 -7
  79. package/dist/{index-BkqVgRzY.js → index-BUftE5lT.js} +1 -1
  80. package/dist/{index-CGtNEWtn.js → index-BfwzTOs6.js} +1 -1
  81. package/dist/{index-D9K94RyI.js → index-BjgdP3hm.js} +4 -5
  82. package/dist/{index-xgOeAWKf.js → index-Bou4dwLI.js} +1 -1
  83. package/dist/{index-DOLjFevA.js → index-BpAcxrzl.js} +1 -1
  84. package/dist/{index-DIjHN6qv.js → index-C2jIeb7J.js} +1 -1
  85. package/dist/{index-BRKM71-O.js → index-C3zKTv5Y.js} +3 -3
  86. package/dist/{index-DKZwHlaX.js → index-C7q0a9DM.js} +1 -1
  87. package/dist/{index-DunfF8Ht.js → index-C99Zc-Vi.js} +2 -2
  88. package/dist/{index-D4cliPZ8.js → index-CW90K2Di.js} +5 -5
  89. package/dist/{index-CuYqhHzD.js → index-CfL9lKtR.js} +2 -2
  90. package/dist/{index-DSqT-Q4v.js → index-DQu_MaSm.js} +1 -1
  91. package/dist/{index-gwKw1aNK.js → index-Db5_EuHB.js} +5 -5
  92. package/dist/{index-D1enMqka.js → index-DwvbwfkH.js} +3 -3
  93. package/dist/{index-DSpG12an.js → index-E53ZVbQF.js} +6 -6
  94. package/dist/{index-Cux9v7uP.js → index-iYcCV_pn.js} +3 -3
  95. package/dist/{index-B02qZDQl.js → index-vUdF4o96.js} +2 -2
  96. package/dist/{index.esm2017-BUXgQjc4.js → index.esm2017-fD_yn74v.js} +1 -1
  97. package/dist/{loading-JXWN1mlR.js → loading-D0ISq3i1.js} +1 -1
  98. package/dist/{lodash-BAs6aERf.js → lodash-DpkQx-iA.js} +1 -1
  99. package/dist/{member-import-C9T8InBc.js → member-import-BWHMGlEk.js} +1 -1
  100. package/dist/membership-DUGWL41O.js +274 -0
  101. package/dist/{money-JjwvMRyS.js → money-IiR3bJjv.js} +1 -1
  102. package/dist/{number-DN2HZqPg.js → number-DQj3ZaBn.js} +1 -1
  103. package/dist/{objectid-mKRbFu1z.js → objectid-0QTNkJtB.js} +7 -7
  104. package/dist/{plugins-BLbiKHAu.js → plugins-Dy6ENTEO.js} +3 -3
  105. package/dist/{reward-BxZGVpM2.js → reward-C44IabhB.js} +1 -1
  106. package/dist/{rule-CZafBeMP.js → rule-_e1tnZLU.js} +8 -8
  107. package/dist/style.css +1 -1
  108. package/dist/{template-C1a6vJYx.js → template-DTM6E2ym.js} +6 -6
  109. package/dist/{timezone-C6Gli671.js → timezone-DKvRUDVT.js} +1 -1
  110. package/dist/{transaction.fn-C4TR2679.js → transaction.fn-BOBilrwc.js} +1 -1
  111. package/dist/{trigger-CR-PIXPO.js → trigger-BOpVvQBM.js} +5 -5
  112. package/dist/{useMarketingMaterialActions-BgyP0DyO.js → useMarketingMaterialActions-B1TUZegb.js} +3 -3
  113. package/dist/{usePagination-CodnCuRS.js → usePagination-D2aiyXMK.js} +1 -1
  114. package/dist/{user-opdeV_ks.js → user-BgRV4fLO.js} +1 -1
  115. package/dist/{vue-i18n-CCRzsQae.js → vue-i18n-CA3hRpIg.js} +583 -583
  116. package/dist/{xlsx-UBnlo3Sn.js → xlsx-5tGMBewT.js} +440 -440
  117. package/dist/{zod-BEd8s7kE.js → zod-UhNNazW6.js} +1 -1
  118. package/package.json +3 -4
  119. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-DK2ZbMVT.js +0 -181
  120. package/dist/membership-CdIORwnn.js +0 -255
@@ -1,4 +1,4 @@
1
- import { i as Z } from "./plugins-BLbiKHAu.js";
1
+ import { i as Z } from "./plugins-Dy6ENTEO.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.98-beta.57",
3
+ "version": "0.1.98-beta.59",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -19,10 +19,9 @@
19
19
  "@ckeditor/ckeditor5-vue": "^7.3.0",
20
20
  "@feedmepos/custom-attributes": "0.0.1-rc.4",
21
21
  "@feedmepos/core": "2.15.21",
22
- "@feedmepos/menu": "1.0.34",
23
22
  "@feedmepos/hrm-permission": "1.0.14",
24
- "@feedmepos/mf-common": "1.29.23",
25
- "@feedmepos/mf-core-ui": "1.0.26",
23
+ "@feedmepos/mf-common": "1.29.31",
24
+ "@feedmepos/mf-core-ui": "1.0.29",
26
25
  "@feedmepos/ui-library": "1.10.13",
27
26
  "@feedmepos/mf-remy-panel": "0.15.0",
28
27
  "@feedmepos/remy-vue-client": "0.2.0-beta.14",
@@ -1,181 +0,0 @@
1
- import { defineComponent as N, computed as f, ref as V, onMounted as H, resolveComponent as _, openBlock as c, createElementBlock as u, createVNode as i, withCtx as F, createElementVNode as p, toDisplayString as q, normalizeClass as A, Fragment as x, renderList as S, createCommentVNode as B } from "vue";
2
- import { F as D } from "./app-xUS3J9z2.js";
3
- import "./index-Cux9v7uP.js";
4
- import { c as E } from "./object-BYyQ0PZp.js";
5
- const M = { class: "flex flex-col flex-nowrap" }, T = { class: "flex gap-16 items-center w-full" }, $ = { class: "flex grow items-center" }, z = { class: "grow text-fm-color-typo-secondary" }, K = { key: 0 }, J = { class: "px-16" }, X = /* @__PURE__ */ N({
6
- __name: "SelectItems",
7
- props: {
8
- initialValue: {
9
- type: Array,
10
- default: () => []
11
- },
12
- filterItems: {
13
- type: Function,
14
- default: void 0
15
- },
16
- onComplete: {
17
- type: Function,
18
- required: !0
19
- },
20
- maxHeight: {
21
- type: [String, Number],
22
- default: 380
23
- }
24
- },
25
- setup(j, { expose: O }) {
26
- const m = j, b = D(), w = f(() => b.menu.value || {
27
- _id: "",
28
- modules: {
29
- catalog: [],
30
- category: [],
31
- item: [],
32
- variant: [],
33
- group: [],
34
- takeaway: [],
35
- scheduler: [],
36
- printDepartment: [],
37
- recipe: [],
38
- sku: [],
39
- unit: [],
40
- cookingGuide: [],
41
- serveSequence: []
42
- }
43
- }), k = f(() => {
44
- const n = m.filterItems ?? ((t) => !!t.category);
45
- return w.value.modules.item.filter(n).reduce((t, l) => {
46
- const a = {
47
- id: l._id,
48
- category: l.category,
49
- name: (l.name2 || l.name).trim()
50
- };
51
- return t = [...t, a], t;
52
- }, []);
53
- }), C = f(() => {
54
- const n = w.value.modules.category.reduce((e, t) => (e[t._id] = {
55
- id: t._id,
56
- name: t.name,
57
- items: {}
58
- }, e), {});
59
- return k.value.reduce(
60
- (e, t) => {
61
- const l = t.category ?? "";
62
- return e[l].items = {
63
- ...e[l].items,
64
- [t.id]: t
65
- }, e;
66
- },
67
- {
68
- ...n,
69
- "": {
70
- id: "",
71
- name: "Addons",
72
- items: {}
73
- }
74
- }
75
- );
76
- }), v = f(() => {
77
- const n = y.value.toLowerCase();
78
- return n ? Object.entries(C.value).reduce((e, [t, l]) => {
79
- if (l.name.toLowerCase().includes(n))
80
- return e[t] = l, e;
81
- const a = Object.entries(l.items).reduce((d, [g, o]) => (o.name.toLowerCase().includes(n) && (d[g] = o), d), {});
82
- return Object.keys(a).length > 0 && (e[t] = { ...l, items: a }), e;
83
- }, {}) : C.value;
84
- }), s = V({}), y = V(""), G = f(() => Object.values(s.value).filter((n) => !!n).length);
85
- function I(n) {
86
- s.value = k.value.reduce((e, t) => (e[t.id] = n.includes(t.id), e), {});
87
- }
88
- H(async () => {
89
- await b.store.getMenu(), I(m.initialValue);
90
- });
91
- function h(n) {
92
- const e = Object.keys(v.value[n].items), t = e.filter((l) => s.value[l]);
93
- return t.length ? t.length === e.length ? !0 : null : !1;
94
- }
95
- function U(n) {
96
- const e = Object.keys(v.value[n].items), t = h(n), l = E(s.value);
97
- for (const a of e)
98
- l[a] = t !== !0;
99
- s.value = l;
100
- }
101
- function L(n) {
102
- s.value[n] = !s.value[n];
103
- }
104
- return O({
105
- onConfirm: () => {
106
- const n = Object.entries(s.value).filter(([, e]) => !!e).map(([e]) => e);
107
- m.onComplete(n);
108
- }
109
- }), (n, e) => {
110
- const t = _("fm-button"), l = _("FmTextField"), a = _("fm-list-item"), d = _("fm-checkbox"), g = _("fm-list");
111
- return c(), u("div", M, [
112
- i(a, {
113
- tag: "div",
114
- clickable: !1
115
- }, {
116
- default: F(() => [
117
- p("div", T, [
118
- p("div", $, [
119
- i(t, {
120
- icon: "sync",
121
- variant: "tertiary",
122
- onClick: e[0] || (e[0] = () => I([]))
123
- }),
124
- p("span", z, q(G.value) + " product(s) selected ", 1)
125
- ]),
126
- i(l, {
127
- modelValue: y.value,
128
- "onUpdate:modelValue": e[1] || (e[1] = (o) => y.value = o),
129
- placeholder: "Search",
130
- "leading-icon": { name: "search", color: "" },
131
- style: { width: "200px", "min-width": "200px" }
132
- }, null, 8, ["modelValue"])
133
- ])
134
- ]),
135
- _: 1
136
- }),
137
- i(g, {
138
- class: A(["grow overflow-y-auto", `max-h-${m.maxHeight ? `[${m.maxHeight}px]` : "full"}`])
139
- }, {
140
- default: F(() => [
141
- (c(!0), u(x, null, S(v.value, (o) => (c(), u(x, {
142
- key: o.id
143
- }, [
144
- Object.keys(o.items).length > 0 ? (c(), u("div", K, [
145
- p("div", J, [
146
- i(d, {
147
- "model-value": h(o.id) ?? !1,
148
- indeterminate: h(o.id) === null,
149
- label: o.name,
150
- value: "",
151
- name: "",
152
- sublabel: "",
153
- class: "w-full",
154
- "onUpdate:modelValue": () => U(o.id)
155
- }, null, 8, ["model-value", "indeterminate", "label", "onUpdate:modelValue"])
156
- ]),
157
- (c(!0), u(x, null, S(o.items, (r) => (c(), u("div", {
158
- key: r.id,
159
- class: "pl-48"
160
- }, [
161
- i(d, {
162
- "model-value": s.value[r.id],
163
- label: r.name,
164
- value: r.id,
165
- name: r.name,
166
- class: "w-full",
167
- "onUpdate:modelValue": () => L(r.id)
168
- }, null, 8, ["model-value", "label", "value", "name", "onUpdate:modelValue"])
169
- ]))), 128))
170
- ])) : B("", !0)
171
- ], 64))), 128))
172
- ]),
173
- _: 1
174
- }, 8, ["class"])
175
- ]);
176
- };
177
- }
178
- });
179
- export {
180
- X as _
181
- };
@@ -1,255 +0,0 @@
1
- import { components as B } from "@feedmepos/ui-library";
2
- import { F as i } from "./collectible.enum-J15b2Jl2.js";
3
- import { h as f, ref as n } from "vue";
4
- import { defineStore as U } from "pinia";
5
- import { m as p } from "./index-D9K94RyI.js";
6
- import { g as o, u as V } from "./index-CuYqhHzD.js";
7
- function m(t) {
8
- return f(
9
- "div",
10
- {
11
- class: `${t.chipClass} gap-4 h-[22px] inline-flex items-center justify-center min-w-min px-8 rounded-md`
12
- },
13
- [
14
- f(B.FmIcon, { size: "sm", name: t.icon, outline: !0 }),
15
- f("span", { class: "fm-typo-en-body-md-600" }, t.name)
16
- ]
17
- );
18
- }
19
- const k = {
20
- [i.enum.VOUCHER]: {
21
- chipClass: "!text-fm-color-secondary-halite !bg-[#fff0f6]",
22
- icon: "sell",
23
- name: "Voucher",
24
- chip() {
25
- return m(this);
26
- }
27
- },
28
- [i.enum.CREDIT]: {
29
- chipClass: "!text-fm-color-secondary-plum !bg-[#f2ebfe]",
30
- icon: "local_activity",
31
- name: "Credit",
32
- chip() {
33
- return m(this);
34
- }
35
- },
36
- [i.enum.POINT]: {
37
- chipClass: "!text-fm-color-secondary-cocoa !bg-[#fff9e6]",
38
- icon: "award_star",
39
- name: "Experience",
40
- chip() {
41
- return m(this);
42
- }
43
- },
44
- [i.enum.COIN]: {
45
- chipClass: "!text-fm-color-system-success-400 !bg-fm-color-system-success-100",
46
- icon: "monetization_on",
47
- name: "Point",
48
- chip() {
49
- return m(this);
50
- }
51
- },
52
- // TODO: add color for this
53
- [i.enum.TIER]: {
54
- chipClass: "!text-fm-color-secondary-cocoa !bg-[#fff9e6]",
55
- icon: "leaderboard",
56
- name: "Tier",
57
- chip() {
58
- return m(this);
59
- }
60
- },
61
- // TODO: add color for this
62
- [i.enum.TITLE]: {
63
- chipClass: "!text-fm-color-secondary-cocoa !bg-[#fff9e6]",
64
- icon: "id_card",
65
- name: "Title",
66
- chip() {
67
- return m(this);
68
- }
69
- },
70
- [i.enum.GAME]: {
71
- chipClass: "!text-fm-color-secondary-mint !bg-fm-color-system-success-100",
72
- icon: "database",
73
- name: "Token",
74
- chip() {
75
- return m(this);
76
- }
77
- },
78
- // TODO: confirm color
79
- [i.enum.STAMP]: {
80
- chipClass: "!text-fm-color-secondary-mint !bg-fm-color-system-success-100",
81
- icon: "database",
82
- name: "Stamp",
83
- chip() {
84
- return m(this);
85
- }
86
- },
87
- [i.enum.REFERRAL]: {
88
- chipClass: "!text-fm-color-secondary-mint !bg-fm-color-system-success-100",
89
- icon: "database",
90
- name: "Successful Referral",
91
- chip() {
92
- return m(this);
93
- }
94
- }
95
- }, c = () => V("segments"), D = {
96
- async readAll(t) {
97
- const a = o(
98
- await c().get("", { params: t })
99
- );
100
- return {
101
- meta: a.meta,
102
- resources: a.resources
103
- };
104
- },
105
- async readById(t) {
106
- return o(await c().get(t));
107
- },
108
- async refreshSegments() {
109
- return o(
110
- await c().get(
111
- "refresh"
112
- )
113
- );
114
- },
115
- async refreshSegment(t) {
116
- return o(
117
- await c().get(
118
- `refresh/${t}`
119
- )
120
- );
121
- },
122
- async refreshStatus() {
123
- return o(
124
- await c().get(
125
- "refresh/status"
126
- )
127
- );
128
- },
129
- async startDefaultSegments() {
130
- return o(
131
- await c().post(
132
- "default-segments/start"
133
- )
134
- );
135
- },
136
- async paginateSegmentUsers(t, a) {
137
- const l = o(
138
- await c().get(`/${t}/users`, {
139
- params: a
140
- })
141
- );
142
- return {
143
- meta: l.meta,
144
- resources: l.resources
145
- };
146
- },
147
- async create(t) {
148
- return o(await c().post("", t));
149
- },
150
- async update(t, a) {
151
- return o(await c().put(t, a));
152
- },
153
- async delete(t) {
154
- return o(await c().delete(t));
155
- },
156
- async createStatic(t) {
157
- return o(await c().post("static", t));
158
- },
159
- async updateStatic(t, a) {
160
- return o(await c().put(`static/${t}`, a));
161
- }
162
- }, q = U("mf-connect-membership", () => {
163
- var R, x;
164
- const t = n(null), a = n(null), l = n(null), u = n([]), d = n([]), y = n(null), h = n([]), g = n(), b = n(((R = t.value) == null ? void 0 : R.tiers) ?? []), v = n(((x = t.value) == null ? void 0 : x.pf_title) ?? []), w = n([]), C = n({ raw: [], items: [] }), T = n([]), A = async () => {
165
- const e = await p.read();
166
- t.value = e, y.value = e, b.value = e.tiers, v.value = e.pf_title ?? [], S(), E();
167
- }, I = async () => {
168
- const e = await p.readPayoutAccount();
169
- l.value = Array.isArray(e) && e.length == 0 ? null : e;
170
- }, _ = async () => {
171
- const e = await p.readStore();
172
- a.value = e, M(), P();
173
- }, O = async () => {
174
- const e = await p.readRewards();
175
- u.value = e, S(), E();
176
- }, L = async () => {
177
- const e = await D.readAll({
178
- skip: 0,
179
- sortBy: "_id",
180
- limit: 1e3
181
- });
182
- d.value = e.resources, F();
183
- }, M = () => {
184
- var e;
185
- h.value = (((e = a.value) == null ? void 0 : e.categories) ?? []).map((r) => ({
186
- ...r,
187
- bundles: r.bundles.sort(
188
- (s, $) => s.name.localeCompare($.name, "en", { numeric: !0 })
189
- )
190
- })).sort((r, s) => r.name.localeCompare(s.name, "en", { numeric: !0 }));
191
- }, P = () => {
192
- var e, r, s;
193
- g.value = {
194
- company: (e = a.value) == null ? void 0 : e.company,
195
- inclusiveTaxes: ((r = a.value) == null ? void 0 : r.inclusiveTaxes) ?? [],
196
- stripe: (s = a.value) == null ? void 0 : s.stripe
197
- };
198
- }, S = () => {
199
- var e;
200
- w.value = [
201
- ...u.value.filter((r) => r.type == "VOUCHER" && r.noCampaign),
202
- ...((e = t.value) == null ? void 0 : e.pf_title) ?? []
203
- ];
204
- }, E = () => {
205
- var r;
206
- const e = [
207
- ...u.value.filter(
208
- (s) => !["VOUCHER", "TIER", "GAME", "TITLE", "STAMP", "REFERRAL"].includes(s.type)
209
- ).map((s) => ({ ...s, name: k[s.type].name })),
210
- ...((r = t.value) == null ? void 0 : r.pf_title) ?? []
211
- ];
212
- C.value = {
213
- raw: e,
214
- items: e.map((s) => ({
215
- label: `${s.type === "TITLE" ? "[Title] " : ""}${s.name}`,
216
- value: s._id,
217
- raw: s
218
- }))
219
- };
220
- }, F = () => {
221
- T.value = d.value.map((e) => ({
222
- label: e.name,
223
- value: e._id,
224
- raw: e
225
- }));
226
- };
227
- return {
228
- // State
229
- membership: t,
230
- store: a,
231
- collectibles: u,
232
- segments: d,
233
- payoutAccount: l,
234
- // Actions
235
- readMembership: A,
236
- readPayoutAccount: I,
237
- readMemberStore: _,
238
- readRewards: O,
239
- readSegments: L,
240
- // Getters
241
- membershipInfo: y,
242
- sortedStoreCategories: h,
243
- storeOption: g,
244
- sortedTiers: b,
245
- sortedTitles: v,
246
- bundleRewards: w,
247
- loyaltyRewards: C,
248
- segmentOptions: T
249
- };
250
- });
251
- export {
252
- k as C,
253
- D as s,
254
- q as u
255
- };