@feedmepos/mf-connect 0.1.104-prod → 0.1.105-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 (126) hide show
  1. package/dist/{App-B4UWz7ir.js → App-Bb5yBnOB.js} +10 -9
  2. package/dist/{Bin-D_eSutW-.js → Bin-DXIYjMm_.js} +8 -8
  3. package/dist/{Broadcast-DDQE_RLR.js → Broadcast-BpcvdGj_.js} +11 -11
  4. package/dist/CampaignAnalytic-BDqEZmHy.js +1830 -0
  5. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D2cTNgaS.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BBiIrN0a.js} +6 -6
  6. package/dist/{Card-CPozdg3m.js → Card-D2sggPws.js} +19 -19
  7. package/dist/{Collections-IrwF5bWH.js → Collections-BdZU2wR5.js} +9 -9
  8. package/dist/{Credit-BVXpy5tw.js → Credit-DeDCjtcp.js} +118 -93
  9. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-DEwMzs6L.js +53 -0
  10. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-CCe1rp0f.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-DbukUBK2.js} +815 -609
  11. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-DwP64fmL.js → EffectSheet.vue_vue_type_style_index_0_lang-BNOrfkpI.js} +12 -12
  12. package/dist/{Experience-BR1JXdH5.js → Experience-CT_3fZPR.js} +109 -84
  13. package/dist/{FileSaver.min-CX-3gU49.js → FileSaver.min-C3sYNQw3.js} +1 -1
  14. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-3bH-tZAm.js +138 -0
  15. package/dist/Game-C4v96zEu.js +355 -0
  16. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-q5fF5d7d.js → ImageInput.vue_vue_type_script_setup_true_lang-6PmRI47X.js} +1 -1
  17. package/dist/{Index--Xl_8CFP.js → Index-C5DRA08U.js} +10 -10
  18. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-C-xW5Tw8.js → LocationPicker.vue_vue_type_script_setup_true_lang-BXcpCtHI.js} +1 -1
  19. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DGVqQz1j.js → LottieAnimation.vue_vue_type_script_setup_true_lang-C8dm05l2.js} +1 -1
  20. package/dist/LoyaltyDashboard-BCPojLdm.js +2865 -0
  21. package/dist/{MainLayout-DB_Y2C3K.js → MainLayout-p92jJ4Mp.js} +3 -3
  22. package/dist/{Marketing-CjAGzfL7.js → Marketing-Z-TiSgs6.js} +4 -4
  23. package/dist/{MarketingMaterialEdit-BoF6kTOz.js → MarketingMaterialEdit-CS-hcbGU.js} +6 -6
  24. package/dist/{Member-DnypOK2I.js → Member-DwY0tXwr.js} +7 -7
  25. package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-DDSBw1sL.js +1286 -0
  26. package/dist/{MemberImportHistory-BJSyT6Ys.js → MemberImportHistory-BN85ZxpX.js} +8 -8
  27. package/dist/MemberList-DaIJCa_0.js +336 -0
  28. package/dist/{MemberTransactions-CbPxUrtd.js → MemberTransactions-DrgA6jX1.js} +1 -1
  29. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CVzfjs9D.js → MessageInput.vue_vue_type_script_setup_true_lang-rl8Sr_zl.js} +11 -11
  30. package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-lGB6WCj6.js +40 -0
  31. package/dist/Mission-BFBmJTjP.js +359 -0
  32. package/dist/{Overview-BW2_y1_7.js → Overview-DaZA6Oxr.js} +5 -5
  33. package/dist/{Overview-DZxRuA5F.js → Overview-DtiqH8iJ.js} +19 -19
  34. package/dist/Point-DeaTc_Gj.js +287 -0
  35. package/dist/Promotion-BBIylJxt.js +417 -0
  36. package/dist/{Queue-CSF9M_Lc.js → Queue-WsDiZkdN.js} +11 -11
  37. package/dist/{Record-B-HdI5A4.js → Record-CzD7sYYG.js} +10 -10
  38. package/dist/{Review-D6RQbcP6.js → Review-BkPHrt33.js} +2 -2
  39. package/dist/{ReviewFacebookCallback-CkULwhF-.js → ReviewFacebookCallback-Bu8j9CLF.js} +5 -5
  40. package/dist/{ReviewGoogleCallback-DgPEXV_R.js → ReviewGoogleCallback-Bh3R06MN.js} +5 -5
  41. package/dist/{Reward-CZvM6GQ9.js → Reward-BHe9y1VN.js} +17 -17
  42. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-C1y2_pHY.js → RewardGroup.vue_vue_type_script_setup_true_lang-DVNknaoM.js} +12 -12
  43. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-Cvo6a7Nw.js → RuleGroup.vue_vue_type_script_setup_true_lang-DAXfiO8F.js} +279 -286
  44. package/dist/{Segment-D2bXEF1U.js → Segment-CjaPWdMt.js} +24 -24
  45. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-Ytimazjg.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-srMHsTa6.js} +12 -12
  46. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-Bn1IWAd_.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-C5taZCvV.js} +4 -4
  47. package/dist/{Setting-DelduRrh.js → Setting-Dr_lawoc.js} +57 -57
  48. package/dist/{SettingAdvertisements-gTDg1C60.js → SettingAdvertisements-BXJd1btw.js} +13 -13
  49. package/dist/{Settings-VUEo9wwx.js → Settings-DPJq4qbw.js} +5 -5
  50. package/dist/{Store-CXQZirbg.js → Store-BNq7oK2B.js} +22 -22
  51. package/dist/{StoreRewards-BDuZPA8S.js → StoreRewards-WExx61kV.js} +16 -16
  52. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-C-yqZEn4.js → StoreTransactions.vue_vue_type_script_setup_true_lang-BaqyPTXc.js} +327 -386
  53. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BayrgH7m.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-CnCHFZL3.js} +2 -2
  54. package/dist/{Tier-DtPE4IJ5.js → Tier-BSLPHzsj.js} +102 -102
  55. package/dist/{Title-DNCnQeeR.js → Title-BQ_CVnIN.js} +22 -22
  56. package/dist/{Transaction-BkUaCGwl.js → Transaction-CvyyRq8P.js} +2 -2
  57. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-B7TY_AGp.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-ByHFu7ry.js} +6 -6
  58. package/dist/{Voucher-BBuB9tf8.js → Voucher-DQ-yXZAC.js} +143 -121
  59. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-Bu09bIut.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BB0n73WF.js} +115 -121
  60. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BSKpAMJL.js → ZodTextField.vue_vue_type_script_setup_true_lang-nnWYrHgL.js} +2 -2
  61. package/dist/{app-CSLQmdYA.js → app-BxM9Ghdm.js} +27795 -25657
  62. package/dist/app.js +1 -1
  63. package/dist/{business-okSb42At.js → business-nbLS8l9h.js} +1 -1
  64. package/dist/{campaign-V7nlCdxR.js → campaign-C_IR2u8a.js} +49 -48
  65. package/dist/{campaign-Ck9GwZdI.js → campaign-Ki9WAmYl.js} +2 -2
  66. package/dist/{campaign.enum-BQ5khvqI.js → campaign.enum-CtgtWycO.js} +1 -1
  67. package/dist/{campaign.fn-DMDpxVSZ.js → campaign.fn-CJOfTzI6.js} +32 -32
  68. package/dist/{collectible.enum-lKz3vTQM.js → collectible.enum-a5dfnH3M.js} +1 -1
  69. package/dist/{collection.fn-BH5cqMNy.js → collection.fn-Cc-luweq.js} +2 -2
  70. package/dist/{effect-pUpfqkCF.js → effect-D66eImId.js} +1 -1
  71. package/dist/{email-addresses-CzBv1fzv.js → email-addresses-DNHwCrI5.js} +2 -2
  72. package/dist/{export-Du7ZAv-8.js → export-Bp-Fwp-h.js} +3 -3
  73. package/dist/{helper-BpthZPU4.js → helper-BpHRMtgf.js} +1 -1
  74. package/dist/{index-DSltrIkA.js → index-B8cXkkGF.js} +1 -1
  75. package/dist/{timezone-DYWqfGTu.js → index-BPV5Dkjl.js} +105 -122
  76. package/dist/{index-D7PksEV2.js → index-BdqanLnJ.js} +675 -677
  77. package/dist/{index-CWAdNVKN.js → index-BnH5UiZx.js} +6 -6
  78. package/dist/{index-v8QQ-4ZP.js → index-C1Bp0PPS.js} +10 -10
  79. package/dist/{index-BhuD1NhH.js → index-CA5atWo4.js} +1 -1
  80. package/dist/{index-ZTYDfSkT.js → index-CZ-SWULS.js} +4 -5
  81. package/dist/{index-CGK1kSCt.js → index-DB13tnmJ.js} +3 -3
  82. package/dist/{index-C0JgU0Z2.js → index-DFLwgFnq.js} +1 -1
  83. package/dist/{index-DCp9k5BB.js → index-DVcOSnAP.js} +2 -2
  84. package/dist/{index-DNdHiAXR.js → index-Dj3FzUo_.js} +18 -2
  85. package/dist/{index-CN5Zoynf.js → index-DyllcNwd.js} +2 -2
  86. package/dist/{index-OaZRtKP_.js → index-JU7Ed3Ex.js} +5 -5
  87. package/dist/{index--6uUWSMc.js → index-Oeiw4Epg.js} +1 -1
  88. package/dist/{index-izVlVA8-.js → index-VzLsGqcm.js} +1 -1
  89. package/dist/{index-DPgGmpyL.js → index-nUrA9Q7e.js} +9 -9
  90. package/dist/{index.esm2017-mpnkyDRb.js → index.esm2017-32NtkXiv.js} +34 -34
  91. package/dist/{loading-BG3Pj6qz.js → loading-CLZ5IFPe.js} +1 -1
  92. package/dist/{lodash-BfDdt-c9.js → lodash-k98YPjFm.js} +1 -1
  93. package/dist/{member-import-BNFdZ3Df.js → member-import-CxNPNPh5.js} +1 -1
  94. package/dist/membership-CjqXHl0l.js +274 -0
  95. package/dist/{money-CRftC-F0.js → money-zJomyMyN.js} +1 -1
  96. package/dist/{number-z7YZyGFS.js → number-BfHmokvl.js} +1 -1
  97. package/dist/object-BYyQ0PZp.js +18 -0
  98. package/dist/{objectid-BKMqp_oR.js → objectid-g-s-CuBk.js} +6 -6
  99. package/dist/{plugins-CWeDGuzy.js → plugins-DNZv50xL.js} +87 -87
  100. package/dist/{reward-BVTKTGi6.js → reward-BefNUdd_.js} +1 -1
  101. package/dist/{rule-YhhCOals.js → rule-DkLIl8GM.js} +3 -3
  102. package/dist/{rule-builder-ae8A0qoi.js → rule-builder-BVyNMiE8.js} +1 -1
  103. package/dist/style.css +1 -1
  104. package/dist/{template-CQrM_0hz.js → template-BmSOVHcp.js} +7 -7
  105. package/dist/timezone-DoX-vj_6.js +20 -0
  106. package/dist/transaction.fn-D15eS4nB.js +64 -0
  107. package/dist/{trigger-Clo3vSjw.js → trigger-BhReH6kZ.js} +5 -5
  108. package/dist/{useMarketingMaterialActions-HyqIT94N.js → useMarketingMaterialActions-DdcVqSlV.js} +3 -3
  109. package/dist/{usePagination-CWRrkbFL.js → usePagination-rx2JFS-5.js} +1 -1
  110. package/dist/{user-MVk5s412.js → user-B4gZia2L.js} +1 -1
  111. package/dist/{vue-i18n-BN9KLJoz.js → vue-i18n-JLM70-gr.js} +201 -201
  112. package/dist/{xlsx-s0BxKsa_.js → xlsx-CuKZcLfT.js} +440 -440
  113. package/dist/{zod-H4l78-by.js → zod-ByE_90T4.js} +1 -1
  114. package/package.json +3 -4
  115. package/dist/Analytic-1rqyus1X.js +0 -428
  116. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
  117. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
  118. package/dist/Game-8nvdSkbi.js +0 -330
  119. package/dist/MemberList-Bf_XyoxW.js +0 -1602
  120. package/dist/Mission-DE4O6XM6.js +0 -334
  121. package/dist/Point-BMEe6duo.js +0 -262
  122. package/dist/Promotion-lamxp48U.js +0 -392
  123. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-BxOEEr9-.js +0 -181
  124. package/dist/dto-GksE6pni.js +0 -216
  125. package/dist/membership-tNeaKAeS.js +0 -255
  126. package/dist/object-qECH92oz.js +0 -26
@@ -1,216 +0,0 @@
1
- import { F as o, z as t } from "./index-OaZRtKP_.js";
2
- import { u as h, a as r, v as _ } from "./index-D7PksEV2.js";
3
- import { F as u } from "./index-DPgGmpyL.js";
4
- import { i as I, R as d } from "./rule-builder-ae8A0qoi.js";
5
- function N(n, e) {
6
- var p, l;
7
- if (!n) return;
8
- const a = n.campaign;
9
- if (!a) return;
10
- const i = a.event.rule;
11
- if (!i || !I(i)) {
12
- e.addIssue({
13
- code: "custom",
14
- path: ["campaign", "event", "rule"],
15
- params: {
16
- i18n: "connectZodCustom:campaign.rule_required",
17
- type: a.event.type
18
- }
19
- });
20
- return;
21
- }
22
- switch (a.type) {
23
- case "MISSION": {
24
- a.earningOption.amount > a.mission.end && e.addIssue({
25
- code: "custom",
26
- path: ["campaign", "earningOption"],
27
- params: {
28
- i18n: "connectZodCustom:campaign.earning_amount_exceed",
29
- max: a.mission.end
30
- }
31
- });
32
- break;
33
- }
34
- case "CREDIT": {
35
- const c = (p = a.config) == null ? void 0 : p.validityOption;
36
- (!c || ["validForDay", "validBefore"].every((g) => c[g] == null)) && e.addIssue({
37
- code: "custom",
38
- path: ["campaign", "config", "validityOption"],
39
- params: {
40
- i18n: "connectZodCustom:campaign.credit_validity_required"
41
- }
42
- });
43
- }
44
- }
45
- switch (a.event.type) {
46
- case "BILL_COMPLETED":
47
- a.type === "MISSION" && a.rewards.length && (a.rewards.forEach((c, m) => {
48
- (c.threshold < 0 || c.threshold > a.mission.end) && e.addIssue({
49
- code: "custom",
50
- path: ["campaign", "rewards", m, "threshold"],
51
- params: {
52
- i18n: "connectZodCustom:campaign.reward_threshold_range"
53
- }
54
- });
55
- }), (l = a.config) != null && l.validityOption.followFirstReceive || e.addIssue({
56
- code: "custom",
57
- path: ["campaign", "config", "validityOption"],
58
- params: {
59
- i18n: "connectZodCustom:campaign.mission_first_receive"
60
- }
61
- }));
62
- break;
63
- case "SCHEDULE": {
64
- if (!i.rules.g_schedule) {
65
- e.addIssue({
66
- code: "custom",
67
- path: ["campaign", "event", "rule"],
68
- params: {
69
- i18n: "connectZodCustom:campaign.schedule_period_required"
70
- },
71
- fatal: !0
72
- });
73
- return;
74
- }
75
- const c = d.getRules(
76
- i.rules.g_schedule
77
- ), m = [
78
- {
79
- property: "trigger.date",
80
- operator: ["_isOnDate", "_rrule"]
81
- },
82
- {
83
- property: "trigger.time",
84
- operator: ["_isOnTime"]
85
- }
86
- ];
87
- m.length == c.length && m.every((O) => c.some((C) => {
88
- const f = d.simplify(C);
89
- return f.property === O.property && O.operator.includes(f.operator);
90
- })) || e.addIssue({
91
- code: "custom",
92
- path: ["campaign", "event", "rule"],
93
- params: {
94
- i18n: "connectZodCustom:campaign.active_period_invalid"
95
- }
96
- });
97
- break;
98
- }
99
- default: {
100
- "earningOption" in a && a.earningOption.type != "FIXED" && e.addIssue({
101
- code: "custom",
102
- path: ["campaign", "earningOption"],
103
- params: {
104
- i18n: "connectZodCustom:campaign.fixed_earning_required"
105
- }
106
- });
107
- break;
108
- }
109
- }
110
- }
111
- function D(n) {
112
- var a;
113
- if (n.campaign.type === "VOUCHER" && "configs" in n) {
114
- const i = n.configs;
115
- i.extras.targetLocation = n.campaign.targetLocation;
116
- const p = Math.max(
117
- n.campaign.earningOption.amount,
118
- i.options.maxUse ?? 1
119
- );
120
- n.campaign.earningOption.amount = p, i.options.maxUse = p, n.campaign.earningOption = {
121
- type: "FIXED",
122
- amount: 1
123
- };
124
- }
125
- if (n.campaign.type == "MISSION" && "configs" in n) {
126
- const i = n.configs;
127
- i.options.validityOption = (a = n.campaign.config) == null ? void 0 : a.validityOption;
128
- }
129
- const e = n.campaign.event;
130
- return e.type != "BILL_COMPLETED" && e.rule && I(e.rule) && (e.rule = d.removeEntry(e.rule, "g_bill"), n.campaign.event = e), n;
131
- }
132
- function s(n) {
133
- const e = _.optionsMap.get(n).extend({
134
- _id: o.optional(),
135
- collectible: t.string().nullish()
136
- });
137
- switch (n) {
138
- case "VOUCHER":
139
- return t.object({
140
- campaign: e,
141
- templateId: o,
142
- configs: u,
143
- updateCollections: t.boolean().optional(),
144
- code: t.string().optional()
145
- });
146
- case "PROMOTION":
147
- return t.object({
148
- campaign: e,
149
- templateId: o
150
- });
151
- case "POINT":
152
- return t.object({
153
- campaign: e,
154
- templateId: o
155
- });
156
- case "CREDIT":
157
- return t.object({
158
- campaign: e,
159
- templateId: o
160
- });
161
- case "BROADCAST":
162
- return t.object({
163
- campaign: e,
164
- templateId: o
165
- });
166
- case "COIN":
167
- return t.object({
168
- campaign: e,
169
- templateId: o
170
- });
171
- case "REWARD_POOL":
172
- return t.object({
173
- campaign: e,
174
- templateId: o,
175
- updateCollections: t.boolean().optional()
176
- });
177
- case "GAME":
178
- return t.object({
179
- campaign: e,
180
- configs: u,
181
- templateId: o,
182
- updateCollections: t.boolean().optional()
183
- });
184
- case "MISSION":
185
- return t.object({
186
- campaign: e,
187
- configs: u,
188
- templateId: o,
189
- updateCollections: t.boolean().optional()
190
- });
191
- default:
192
- throw new Error("Not implemented");
193
- }
194
- }
195
- const T = h.extend({
196
- _id: o.optional(),
197
- name: t.string().min(1).max(300),
198
- business: o.optional(),
199
- campaigns: t.array(o).optional()
200
- }), A = {
201
- [r.enum.VOUCHER]: s("VOUCHER"),
202
- [r.enum.PROMOTION]: s("PROMOTION"),
203
- [r.enum.POINT]: s("POINT"),
204
- [r.enum.CREDIT]: s("CREDIT"),
205
- [r.enum.BROADCAST]: s("BROADCAST"),
206
- [r.enum.COIN]: s("COIN"),
207
- [r.enum.REWARD_POOL]: s("REWARD_POOL"),
208
- [r.enum.GAME]: s("GAME"),
209
- [r.enum.MISSION]: s("MISSION")
210
- };
211
- export {
212
- A as C,
213
- T as F,
214
- D as a,
215
- N as c
216
- };
@@ -1,255 +0,0 @@
1
- import { components as B } from "@feedmepos/ui-library";
2
- import { F as i } from "./collectible.enum-lKz3vTQM.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-ZTYDfSkT.js";
6
- import { g as o, u as V } from "./index-CN5Zoynf.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
- };
@@ -1,26 +0,0 @@
1
- function f(r) {
2
- if (Array.isArray(r))
3
- return r.map((t) => f(t));
4
- if (typeof r == "object" && r !== null) {
5
- const t = {};
6
- for (const n in r)
7
- r.hasOwnProperty(n) && !n.startsWith("pf_") && (t[n] = f(r[n]));
8
- return t;
9
- }
10
- return r;
11
- }
12
- function i(r) {
13
- return JSON.parse(JSON.stringify(r));
14
- }
15
- function a(r, t, n) {
16
- const s = r.reduce((e, c) => {
17
- const u = t(c);
18
- return e[u] || (e[u] = []), e[u].push(c), e;
19
- }, {});
20
- return n ? Object.keys(s).reduce((e, c) => (e[c] = n(s[c]), e), {}) : s;
21
- }
22
- export {
23
- f as a,
24
- i as c,
25
- a as g
26
- };