@feedmepos/mf-connect 0.1.37-prod → 0.1.38-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/Analytic-BjSfI2Ff.js +761 -0
  2. package/dist/{App-Bpo0XZSs.js → App-D11A2JY1.js} +364 -352
  3. package/dist/AuditLogs-DWCFYoRg.js +1887 -0
  4. package/dist/{Bin-ohZ2CZZR.js → Bin-9wV4Ah3M.js} +8 -8
  5. package/dist/{Broadcast-D5x0_-zC.js → Broadcast-I3BtSk8V.js} +40 -40
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CYb38NXA.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-XJqTXbKr.js} +18 -18
  7. package/dist/{Card-BM-Lrm5y.js → Card-CqALG5RM.js} +159 -159
  8. package/dist/{Collections-Cr4aoJer.js → Collections-rg3SzoUb.js} +103 -91
  9. package/dist/{Credit-DzDVFv4H.js → Credit-BNn1sYZv.js} +74 -74
  10. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js +58 -0
  11. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bs8o9n1V.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-PJ8q72XH.js} +491 -488
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-koqrPPqM.js → EffectSheet.vue_vue_type_style_index_0_lang-Sww7KNle.js} +91 -89
  13. package/dist/{Experience-CjaDdbvZ.js → Experience-D_Qm8SUj.js} +41 -41
  14. package/dist/{FilterChip.vue_vue_type_script_setup_true_lang-BrPLkFX8.js → FilterChip.vue_vue_type_script_setup_true_lang-d8rh38tD.js} +2 -6
  15. package/dist/{Game-BuiTygow.js → Game-CKXgXm6Q.js} +31 -31
  16. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +144 -0
  17. package/dist/{Index-CQGzUU-w.js → Index-D4DGfUHd.js} +10 -10
  18. package/dist/Marketing-Dn9A1vgH.js +20073 -0
  19. package/dist/Member-B55vWHDd.js +279 -0
  20. package/dist/MemberList-BWTG9Ohy.js +1606 -0
  21. package/dist/MemberOverview-wL_ailso.js +58 -0
  22. package/dist/{MemberTransactions-DzG1fY0c.js → MemberTransactions-CP5EI-W0.js} +1 -1
  23. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-D--_An-f.js +60279 -0
  24. package/dist/{Mission-BtypT2uF.js → Mission-CFvhROuB.js} +21 -21
  25. package/dist/{Overview-Be7bUtRO.js → Overview-4273yNwL.js} +335 -335
  26. package/dist/{Point-Bw4lnLqp.js → Point-B_-_C919.js} +41 -41
  27. package/dist/Promotion-D2S3COxk.js +289 -0
  28. package/dist/{Queue-CpPEVgn8.js → Queue-BmS1Oi-C.js} +52 -52
  29. package/dist/{Record-DQq4P69i.js → Record-DRBl0M8g.js} +9 -9
  30. package/dist/{Reward-DJH0eM8u.js → Reward-8056NmfK.js} +173 -173
  31. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-_kw_PR0h.js → RewardGroup.vue_vue_type_script_setup_true_lang-CJ_WC2gV.js} +11 -11
  32. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CRGep1RK.js → RuleGroup.vue_vue_type_script_setup_true_lang-DqNQl_nz.js} +635 -548
  33. package/dist/Segment-Bzq-pyhc.js +882 -0
  34. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-Dx6Ew9Z_.js → SelectItems.vue_vue_type_script_setup_true_lang-4nNkkklE.js} +2 -2
  35. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-B60_8Toi.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-Dnf2oxOG.js} +11 -11
  36. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-BCaJ3xKT.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BLYP-5U9.js} +3 -3
  37. package/dist/{Setting-GRIUo7vg.js → Setting-BrJfYoru.js} +432 -432
  38. package/dist/{Store-H0UDQpln.js → Store-Bpl_4yZW.js} +211 -211
  39. package/dist/StoreRewards-Cu7n7Pjz.js +423 -0
  40. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-T3Wo2maC.js +1029 -0
  41. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-D-jL1oGS.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-QucRaI08.js} +1 -1
  42. package/dist/{Tier-CJufQcIz.js → Tier-_LnXg3n6.js} +106 -106
  43. package/dist/{Title-BBMgGUld.js → Title-B7AGStvx.js} +133 -131
  44. package/dist/{Transaction-DsucPnfp.js → Transaction-Chxv6V7u.js} +2 -2
  45. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CwOcZEQX.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-CzXNmobp.js} +6 -6
  46. package/dist/{Voucher-BPvxKO_w.js → Voucher-C5z2kOq9.js} +153 -123
  47. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DdGMrk2C.js +419 -0
  48. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DMs4XKXM.js → ZodTextField.vue_vue_type_script_setup_true_lang-BlXzEWA6.js} +1 -1
  49. package/dist/{app-D3MT1deX.js → app-7cvPyHJ7.js} +164 -125
  50. package/dist/{app-Bo0JpadQ.js → app-BVojNX0w.js} +1 -1
  51. package/dist/app.js +4 -3
  52. package/dist/business-CmxV69wT.js +79 -0
  53. package/dist/{campaign-Z3l7BoMg.js → campaign-CT_cNJEL.js} +9 -9
  54. package/dist/{campaign-j1c3ou7l.js → campaign-Dq5C_no-.js} +5 -3
  55. package/dist/{campaign.enum-CVXPc5Pd.js → campaign.enum-dp7yHKzF.js} +1 -1
  56. package/dist/campaign.fn-BYZgKDN7.js +758 -0
  57. package/dist/{collectible.enum-CDSikBAy.js → collectible.enum-DxbB4DxT.js} +1 -1
  58. package/dist/{collection.fn-Bz38mGMa.js → collection.fn-CNZRdUgy.js} +2 -2
  59. package/dist/{dto-D648NN4s.js → dto-CT9zZbv9.js} +4 -4
  60. package/dist/{effect-DbMAmVSR.js → effect-FIlOEC4H.js} +1 -1
  61. package/dist/{email-addresses-KOVDrRiK.js → email-addresses-Ba7xImfX.js} +1 -1
  62. package/dist/{export-cTZf8Avd.js → export-uzjZFNF9.js} +3 -3
  63. package/dist/{helper-BYyfcLqw.js → helper-D4sAZde0.js} +1 -1
  64. package/dist/{index-BIaCtk8e.js → index-B9pl4zRZ.js} +192 -79
  65. package/dist/{index-B4MqsaBz.js → index-BI3m1Ehv.js} +3 -3
  66. package/dist/{index-E-0tTd0_.js → index-BXz54M1s.js} +1 -1
  67. package/dist/{index-BMl2KZts.js → index-BjU8LVUC.js} +11447 -10969
  68. package/dist/index-CH3z92VV.js +31 -0
  69. package/dist/{index-BTb8I_eB.js → index-CNJLP3D5.js} +1 -1
  70. package/dist/{index-BrKXRxe_.js → index-CONvJfKv.js} +1 -1
  71. package/dist/index-CS3Jmojj.js +32260 -0
  72. package/dist/{index-CTPMbFf5.js → index-CUfS9Kp1.js} +10 -9
  73. package/dist/index-CsaQJMAR.js +66 -0
  74. package/dist/{index-nF9iYTlh.js → index-CvBcve-r.js} +1 -1
  75. package/dist/index-CwsMG2cV.js +56 -0
  76. package/dist/{index-B3p0hmIV.js → index-D5rvMvzx.js} +1 -1
  77. package/dist/{index-CvoShC5J.js → index-DNxa8Rqx.js} +536 -461
  78. package/dist/{index-DPBHiqsJ.js → index-l2F5MnLF.js} +1 -1
  79. package/dist/{index.esm2017-DFYwde30.js → index.esm2017-ATcsD5N4.js} +127 -127
  80. package/dist/{loading-vUArhX_O.js → loading-BWGQSrCB.js} +1 -1
  81. package/dist/{membership-BHKv29yt.js → membership-Cc4OZ8-U.js} +3 -3
  82. package/dist/{money-Bl3_QRkE.js → money-D7p8nfun.js} +1 -1
  83. package/dist/{number-hh_S9w7k.js → number-CMJjC4qz.js} +1 -1
  84. package/dist/objectid-D5T27iny.js +145 -0
  85. package/dist/{plugins-CVes2wzE.js → plugins-eQis66QR.js} +2 -2
  86. package/dist/remy-vue-client-Cpppk9h-.js +1693 -0
  87. package/dist/{reward-ANZOdWzf.js → reward-DrnzbG20.js} +1 -1
  88. package/dist/{rule-BvFk5bQg.js → rule-CtRxkYXB.js} +3 -3
  89. package/dist/{rule-builder-BSN777PN.js → rule-builder-Di9RIYHF.js} +17 -17
  90. package/dist/style.css +1 -1
  91. package/dist/{template-Dh9lDLs_.js → template-C3UfY0v5.js} +64 -64
  92. package/dist/{trigger-C7THbt7R.js → trigger-C9U7Zgad.js} +7 -7
  93. package/dist/{usePagination-JoYaROkV.js → usePagination-BeF5K3M7.js} +85 -85
  94. package/dist/{user-DtNR9JY2.js → user-D7n9yYmO.js} +1 -1
  95. package/dist/{vue-i18n-BWyHnm4m.js → vue-i18n-Bz45zC04.js} +387 -387
  96. package/dist/{xlsx-7u9SB0oa.js → xlsx-D4S4qbcZ.js} +226 -226
  97. package/package.json +9 -3
  98. package/dist/Analytic-CavR2bzs.js +0 -427
  99. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js +0 -144
  100. package/dist/Marketing-BSspYuhg.js +0 -319
  101. package/dist/Member-B4S0UNGq.js +0 -287
  102. package/dist/MemberList-CfnUJ3mh.js +0 -1606
  103. package/dist/MemberOverview-C2n9oJZh.js +0 -58
  104. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-hZUWLTWj.js +0 -455
  105. package/dist/Promotion-Bg6x0rAh.js +0 -255
  106. package/dist/Segment-BLB4VWNJ.js +0 -882
  107. package/dist/StoreRewards--TNIFaCo.js +0 -423
  108. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CfB8tA5l.js +0 -995
  109. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-Bg-9YqLP.js +0 -419
  110. package/dist/business-DMALI7ZO.js +0 -78
  111. package/dist/campaign.fn-rsRhHYZP.js +0 -758
  112. package/dist/index-BsCGyJMY.js +0 -29566
  113. package/dist/index-CuvNtC_M.js +0 -61
  114. package/dist/index-DFKmjCG1.js +0 -44
  115. package/dist/index-Dbd4WA4r.js +0 -61
  116. package/dist/objectid-CEyMlMge.js +0 -145
@@ -1,419 +0,0 @@
1
- import { defineComponent as U, ref as k, resolveComponent as p, openBlock as d, createBlock as h, withCtx as f, renderSlot as q, createVNode as s, createTextVNode as E, toDisplayString as F, createElementVNode as a, computed as N, createElementBlock as O, Fragment as S, renderList as z, unref as e, normalizeClass as J, createCommentVNode as R, resolveDynamicComponent as H } from "vue";
2
- import { c as X } from "./index-BMl2KZts.js";
3
- import { e as K, F as Q } from "./index-CTPMbFf5.js";
4
- import { C as W } from "./membership-BHKv29yt.js";
5
- import { Z as g } from "./zod-Bg2FbC-D.js";
6
- import { _ as Y } from "./SelectItems.vue_vue_type_script_setup_true_lang-Dx6Ew9Z_.js";
7
- import { u as ee } from "./business-DMALI7ZO.js";
8
- import { useCoreStore as te } from "@feedmepos/mf-common";
9
- import { _ as oe } from "./ZodTextField.vue_vue_type_script_setup_true_lang-DMs4XKXM.js";
10
- import { _ as le } from "./ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js";
11
- import { _ as ae, a as ne } from "./EffectSheet.vue_vue_type_style_index_0_lang-koqrPPqM.js";
12
- import { _ as se } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-D-jL1oGS.js";
13
- import { u as me } from "./vue-i18n-BWyHnm4m.js";
14
- import { i as re } from "./helper-BYyfcLqw.js";
15
- const ie = { class: "flex justify-end gap-8 w-full" }, ue = /* @__PURE__ */ U({
16
- __name: "MenuSheet",
17
- props: {
18
- modelValue: {},
19
- filterItems: { type: Function }
20
- },
21
- emits: ["confirm"],
22
- setup(l, { emit: $ }) {
23
- const C = k(), n = k(!1);
24
- function o() {
25
- var r;
26
- (r = C.value) == null || r.onConfirm();
27
- }
28
- const y = $;
29
- return (r, x) => {
30
- const i = p("FmField"), v = p("FmButton"), I = p("FmSideSheet");
31
- return d(), h(I, {
32
- modelValue: n.value,
33
- "onUpdate:modelValue": x[1] || (x[1] = (b) => n.value = b),
34
- title: "Select Items",
35
- "close-button": !1,
36
- "dismiss-away": !0,
37
- "max-width": 560
38
- }, {
39
- "side-sheet-button": f(() => [
40
- q(r.$slots, "side-sheet-button", {}, () => [
41
- s(i, { class: "text-fm-color-typo-tertiary cursor-pointer" }, {
42
- default: f(() => [
43
- E(F(r.modelValue.length) + " item(s) selected ", 1)
44
- ]),
45
- _: 1
46
- })
47
- ])
48
- ]),
49
- "side-sheet-footer": f(() => [
50
- a("div", ie, [
51
- s(v, {
52
- variant: "tertiary",
53
- onClick: x[0] || (x[0] = (b) => n.value = !1),
54
- label: "Cancel"
55
- }),
56
- s(v, {
57
- variant: "primary",
58
- onClick: o,
59
- label: "Confirm"
60
- })
61
- ])
62
- ]),
63
- default: f(() => [
64
- s(Y, {
65
- class: "h-full",
66
- "max-height": 0,
67
- ref_key: "selectItemRef",
68
- ref: C,
69
- "initial-value": r.modelValue,
70
- "filter-items": r.filterItems,
71
- "on-complete": (b) => {
72
- y("confirm", b), n.value = !1;
73
- }
74
- }, null, 8, ["initial-value", "filter-items", "on-complete"])
75
- ]),
76
- _: 3
77
- }, 8, ["modelValue"]);
78
- };
79
- }
80
- }), de = { class: "space-y-24" }, ce = { class: "grid grid-cols-2 gap-16" }, pe = { class: "fm-typo-en-title-sm-800" }, fe = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, ye = { class: "space-y-16" }, ve = /* @__PURE__ */ a("div", { class: "fm-typo-en-body-lg-600" }, "Spending type", -1), be = /* @__PURE__ */ a("div", { class: "fm-typo-en-body-lg-400" }, "Amount spent", -1), ge = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, xe = {
81
- key: 0,
82
- class: "xs:!block flex gap-16 items-center pt-8"
83
- }, Ve = /* @__PURE__ */ a("div", { class: "xs:py-4 text-center" }, "for every", -1), he = { class: "fm-typo-en-body-lg-400" }, _e = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Fe = {
84
- key: 0,
85
- class: "pt-8 space-y-8"
86
- }, Ce = { class: "flex items-center gap-16 xs:block xs:space-y-8 w-fit" }, Ie = { class: "xs:!block flex gap-16 items-center" }, Oe = /* @__PURE__ */ a("div", { class: "xs:py-4 text-center" }, "for every", -1), Ze = /* @__PURE__ */ U({
87
- __name: "EarningOptionInput",
88
- props: {
89
- modelValue: {
90
- type: Object
91
- },
92
- extras: {
93
- type: Object
94
- },
95
- fixedType: {
96
- type: Boolean
97
- },
98
- errorText: {
99
- type: String
100
- }
101
- },
102
- emits: ["update:model-value"],
103
- setup(l, { emit: $ }) {
104
- var I, b, P;
105
- const C = ee(), n = l, o = $, y = [
106
- {
107
- label: "Based on spending",
108
- sublabel: "Customers earn rewards based on how much they spend.",
109
- value: "PROPORTIONAL"
110
- },
111
- {
112
- label: "Fixed amount",
113
- sublabel: "Customers earn a set amount of rewards for specific actions.",
114
- value: "FIXED"
115
- }
116
- ].filter((c) => {
117
- var t, _;
118
- return n.fixedType || ((_ = (t = n.extras) == null ? void 0 : t.campaign) == null ? void 0 : _.event.type) != "BILL_COMPLETED" ? c.value == "FIXED" : !0;
119
- }), r = N(() => {
120
- var t, _;
121
- const c = n.extras && "configs" in n.extras ? n.extras.configs.type : (t = n.extras) == null ? void 0 : t.campaign.type;
122
- return (((_ = W[c]) == null ? void 0 : _.name) || "reward").toLowerCase();
123
- }), x = N(() => {
124
- const c = K.safeParse(n.modelValue);
125
- return c.success ? [] : c.error.errors;
126
- });
127
- function i(c) {
128
- var t;
129
- c != ((t = n.modelValue) == null ? void 0 : t.type) && o(
130
- "update:model-value",
131
- c === "FIXED" ? {
132
- type: "FIXED",
133
- amount: 1
134
- } : {
135
- type: "PROPORTIONAL",
136
- amount: 1,
137
- every: 1
138
- }
139
- );
140
- }
141
- const v = k(
142
- ((I = n.modelValue) == null ? void 0 : I.type) === "PROPORTIONAL" && !!((P = (b = n.modelValue) == null ? void 0 : b.property) != null && P.length) || !1
143
- );
144
- return (c, t) => {
145
- var L, B, D;
146
- const _ = p("FmCard"), T = p("FmStepperField"), A = p("FmRadio"), j = p("FmPill"), G = p("FmButton"), M = p("FmRadioGroup"), Z = p("FmHelperText");
147
- return d(), O("div", de, [
148
- a("div", ce, [
149
- (d(!0), O(S, null, z(e(y), (m) => {
150
- var V, u;
151
- return d(), h(_, {
152
- variant: "outlined",
153
- class: J(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-2", {
154
- "col-span-2": e(y).length == 1,
155
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((V = l.modelValue) == null ? void 0 : V.type) === m.value,
156
- "hover:bg-fm-color-opacity-sm": ((u = l.modelValue) == null ? void 0 : u.type) != m.value
157
- }]),
158
- onClick: (w) => i(m.value),
159
- key: m.value
160
- }, {
161
- default: f(() => [
162
- a("div", pe, F(m.label), 1),
163
- a("div", fe, F(m.sublabel), 1)
164
- ]),
165
- _: 2
166
- }, 1032, ["class", "onClick"]);
167
- }), 128))
168
- ]),
169
- a("div", ye, [
170
- ((L = l.modelValue) == null ? void 0 : L.type) === "FIXED" ? (d(), h(T, {
171
- key: 0,
172
- label: `Receive ${e(r)}(s)`,
173
- class: "flex-1",
174
- "model-value": ((B = l.modelValue) == null ? void 0 : B.amount) ?? null,
175
- "onUpdate:modelValue": t[0] || (t[0] = (m) => o("update:model-value", {
176
- ...l.modelValue ?? { type: "FIXED" },
177
- amount: m
178
- }))
179
- }, null, 8, ["label", "model-value"])) : ((D = l.modelValue) == null ? void 0 : D.type) === "PROPORTIONAL" ? (d(), O(S, { key: 1 }, [
180
- ve,
181
- s(M, {
182
- "model-value": e(v),
183
- "onUpdate:modelValue": t[6] || (t[6] = (m) => {
184
- e(v) != m && (o("update:model-value", {
185
- ...l.modelValue ?? {
186
- type: "PROPORTIONAL",
187
- amount: 1,
188
- every: 1
189
- },
190
- property: m ? [] : void 0,
191
- every: 1
192
- }), v.value = m);
193
- })
194
- }, {
195
- default: f(() => [
196
- s(A, {
197
- label: "Amount spent",
198
- sublabel: `Receive ${e(r)} by amount spent`,
199
- value: !1
200
- }, {
201
- label: f(() => {
202
- var m, V;
203
- return [
204
- be,
205
- a("div", ge, " Receive " + F(e(r)) + " by amount spent ", 1),
206
- e(v) ? R("", !0) : (d(), O("div", xe, [
207
- s(T, {
208
- label: `Receive ${e(r)}(s)`,
209
- inputmode: "decimal",
210
- class: "flex-1",
211
- "model-value": ((m = l.modelValue) == null ? void 0 : m.amount) ?? null,
212
- "onUpdate:modelValue": t[1] || (t[1] = (u) => o("update:model-value", {
213
- ...l.modelValue ?? { type: "FIXED" },
214
- amount: u
215
- }))
216
- }, null, 8, ["label", "model-value"]),
217
- Ve,
218
- s(T, {
219
- label: `Amount spend (${e(X.Config).getCountry().currency.symbol})`,
220
- class: "flex-1",
221
- inputmode: "decimal",
222
- "model-value": ((V = l.modelValue) == null ? void 0 : V.every) ?? null,
223
- "onUpdate:modelValue": t[2] || (t[2] = (u) => o("update:model-value", {
224
- ...l.modelValue,
225
- every: u
226
- }))
227
- }, {
228
- prepend: f(() => [
229
- E(F(e(X.Config).getCountry().currency.symbol), 1)
230
- ]),
231
- _: 1
232
- }, 8, ["label", "model-value"])
233
- ]))
234
- ];
235
- }),
236
- _: 1
237
- }, 8, ["sublabel"]),
238
- s(A, {
239
- label: "Product bought",
240
- sublabel: `Receive ${e(r)} by product bought`,
241
- value: !0,
242
- disabled: !e(C).isPremium
243
- }, {
244
- label: f(() => {
245
- var m, V;
246
- return [
247
- a("div", he, [
248
- E(" Product bought "),
249
- s(j, { variant: "premium" })
250
- ]),
251
- a("div", _e, " Receive " + F(e(r)) + " by product bought ", 1),
252
- e(v) ? (d(), O("div", Fe, [
253
- a("div", Ce, [
254
- s(ue, {
255
- "model-value": n.modelValue.property || [],
256
- onConfirm: t[3] || (t[3] = (u) => o("update:model-value", {
257
- ...l.modelValue,
258
- property: u
259
- }))
260
- }, {
261
- "side-sheet-button": f(() => {
262
- var u, w;
263
- return [
264
- s(G, {
265
- label: (u = n.modelValue.property) != null && u.length ? `${(w = n.modelValue.property) == null ? void 0 : w.length} product(s) selected` : "Select product",
266
- icon: "link",
267
- variant: "secondary"
268
- }, null, 8, ["label"])
269
- ];
270
- }),
271
- _: 1
272
- }, 8, ["model-value"])
273
- ]),
274
- a("div", Ie, [
275
- s(T, {
276
- inputmode: "decimal",
277
- label: `Receive ${e(r)}(s)`,
278
- class: "flex-1",
279
- "model-value": ((m = l.modelValue) == null ? void 0 : m.amount) ?? null,
280
- "onUpdate:modelValue": t[4] || (t[4] = (u) => o("update:model-value", {
281
- ...l.modelValue ?? { type: "FIXED" },
282
- amount: u
283
- }))
284
- }, null, 8, ["label", "model-value"]),
285
- Oe,
286
- s(T, {
287
- label: "Item purchased",
288
- class: "flex-1",
289
- "model-value": ((V = l.modelValue) == null ? void 0 : V.every) ?? null,
290
- inputmode: "numeric",
291
- "max-fraction-digits": 0,
292
- "onUpdate:modelValue": t[5] || (t[5] = (u) => o("update:model-value", {
293
- ...l.modelValue,
294
- every: u
295
- }))
296
- }, null, 8, ["model-value"])
297
- ])
298
- ])) : R("", !0)
299
- ];
300
- }),
301
- _: 1
302
- }, 8, ["sublabel", "disabled"])
303
- ]),
304
- _: 1
305
- }, 8, ["model-value"])
306
- ], 64)) : R("", !0)
307
- ]),
308
- l.errorText || e(x).length > 0 ? (d(), h(Z, {
309
- key: 0,
310
- class: "!mt-4",
311
- text: l.errorText || e(g).helperText(e(x), ""),
312
- state: "error"
313
- }, null, 8, ["text"])) : R("", !0)
314
- ]);
315
- };
316
- }
317
- }), Re = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary flex items-center justify-between" }, $e = /* @__PURE__ */ a("div", null, "Voucher description should not exceed 200 characters.", -1), Pe = /* @__PURE__ */ a("div", { class: "fm-typo-en-title-sm-800" }, "Discount", -1), Te = /* @__PURE__ */ a("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Usage configuration", -1), ke = /* @__PURE__ */ a("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Availability", -1), qe = /* @__PURE__ */ U({
318
- __name: "VoucherEditor",
319
- props: {
320
- modelValue: {
321
- type: Object
322
- },
323
- rewardImage: {
324
- type: Object
325
- }
326
- },
327
- emits: ["update:model-value", "update:reward-image"],
328
- setup(l, { emit: $ }) {
329
- const { t: C } = me(), o = k(
330
- l.modelValue ?? re("VOUCHER", {
331
- business: te().currentBusiness.value._id,
332
- name: ""
333
- })
334
- ), y = Q, r = $;
335
- return (x, i) => {
336
- var b, P, c;
337
- const v = p("FmTextarea"), I = p("FmHelperText");
338
- return d(), O(S, null, [
339
- s(oe, {
340
- modelValue: e(o).name,
341
- "onUpdate:modelValue": i[0] || (i[0] = (t) => e(o).name = t),
342
- label: "Voucher name",
343
- schema: e(g).typeAtPath(e(y), "name", [e(o).type])
344
- }, null, 8, ["modelValue", "schema"]),
345
- s(v, {
346
- class: "!mb-[-16px]",
347
- modelValue: e(o).description,
348
- "onUpdate:modelValue": i[1] || (i[1] = (t) => e(o).description = t),
349
- rules: [e(g).ruleAtPath(e(y), "description", [e(o).type])]
350
- }, {
351
- label: f(() => [
352
- (d(), h(H(
353
- e(g).toInputLabel(
354
- e(g).typeAtPath(e(y), "description", [e(o).type]),
355
- "Voucher description"
356
- )
357
- )))
358
- ]),
359
- _: 1
360
- }, 8, ["modelValue", "rules"]),
361
- a("div", Re, [
362
- $e,
363
- a("div", null, F(((b = e(o).description) == null ? void 0 : b.length) ?? 0) + "/200", 1)
364
- ]),
365
- s(le, {
366
- class: "w-1/2 xs:w-2/3",
367
- "aspect-ratio": "16/9",
368
- file: l.rewardImage ?? void 0,
369
- thumbnail: e(o).image ?? void 0,
370
- "onUpdate:file": i[2] || (i[2] = async (t) => {
371
- r("update:reward-image", t), t || (e(o).image = null);
372
- })
373
- }, {
374
- label: f(() => [
375
- (d(), h(H(
376
- e(g).toInputLabel(
377
- e(g).typeAtPath(e(y), "image", [e(o).type]),
378
- "Voucher image"
379
- )
380
- )))
381
- ]),
382
- _: 1
383
- }, 8, ["file", "thumbnail"]),
384
- Pe,
385
- s(ae, {
386
- "model-value": e(o).extras.effect,
387
- "onUpdate:modelValue": i[3] || (i[3] = (t) => e(o).extras.effect = t)
388
- }, null, 8, ["model-value"]),
389
- e(o).extras.effect == null ? (d(), h(I, {
390
- key: 0,
391
- class: "!mt-8",
392
- text: e(C)("connect.campaign.common.effect_required"),
393
- state: "error"
394
- }, null, 8, ["text"])) : R("", !0),
395
- Te,
396
- s(ne, {
397
- "model-value": e(o).options,
398
- "no-campaign": e(o).noCampaign,
399
- "onUpdate:modelValue": i[4] || (i[4] = (t) => e(o).options = t),
400
- schema: e(g).typeAtPath(e(y), "options", ["VOUCHER"])
401
- }, null, 8, ["model-value", "no-campaign", "schema"]),
402
- ke,
403
- e(o).type === "VOUCHER" ? (d(), h(se, {
404
- key: 1,
405
- "model-value": ((c = (P = e(o).extras) == null ? void 0 : P.targetLocation) == null ? void 0 : c.map(String)) ?? null,
406
- type: "select",
407
- "onUpdate:modelValue": i[5] || (i[5] = (t) => {
408
- e(o).extras.targetLocation = t;
409
- }),
410
- rules: [e(g).ruleAtPath(e(y), "extras.targetLocation")]
411
- }, null, 8, ["model-value", "rules"])) : R("", !0)
412
- ], 64);
413
- };
414
- }
415
- });
416
- export {
417
- Ze as _,
418
- qe as a
419
- };
@@ -1,78 +0,0 @@
1
- import { ref as i, computed as f } from "vue";
2
- import { defineStore as g } from "pinia";
3
- import { useCoreStore as w } from "@feedmepos/mf-common";
4
- import { a as y, g as r, A as I, S as b, b as S } from "./index-BMl2KZts.js";
5
- const D = {
6
- async readSettings(e) {
7
- try {
8
- return r(await y(`marketing-v2/${e}/setting`).get(""));
9
- } catch (n) {
10
- if (console.error(JSON.stringify(n)), n instanceof I)
11
- return {
12
- _id: e,
13
- business: e,
14
- apiVersion: "v1"
15
- };
16
- throw n;
17
- }
18
- }
19
- }, o = () => {
20
- const e = b.getBusinessId();
21
- if (!e) throw new Error("Invalid business ID");
22
- return S(`businesses/${e}/location`, {
23
- noIdRequired: !0
24
- });
25
- }, u = {
26
- async read() {
27
- return r(await o().get(""));
28
- },
29
- async readDevices() {
30
- return r(await o().get("devices"));
31
- },
32
- async unregisterDevice(e) {
33
- await r(await o().delete(`devices/${e}`));
34
- },
35
- async getOtp(e) {
36
- return r(await o().post(`${e}/otp`));
37
- }
38
- }, h = g("mf-connect-business", () => {
39
- const e = i("v2"), n = i(!1), a = i([]), c = i([]);
40
- async function l() {
41
- const t = w().currentBusiness.value, s = await D.readSettings(t == null ? void 0 : t.id);
42
- return n.value = s && "business" in s && s.premium == !0, e.value = (s == null ? void 0 : s.apiVersion) || "v1", n.value;
43
- }
44
- async function v() {
45
- return a.value = await u.read(), a.value;
46
- }
47
- async function d() {
48
- return c.value = await u.readDevices(), c.value;
49
- }
50
- function p(t) {
51
- return a.value.find((s) => s._id === t);
52
- }
53
- const m = f(() => [
54
- { label: "All", value: null },
55
- ...a.value.map((t) => ({
56
- label: t.name,
57
- value: t._id
58
- }))
59
- ]);
60
- return {
61
- // state
62
- version: e,
63
- isPremium: n,
64
- locations: a,
65
- locationDevices: c,
66
- // actions
67
- readPremium: l,
68
- readLocations: v,
69
- readLocationDevices: d,
70
- locationById: p,
71
- // getters
72
- locationItems: m
73
- };
74
- });
75
- export {
76
- u as l,
77
- h as u
78
- };