@feedmepos/mf-connect 0.1.3-prod → 0.1.5-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 (87) hide show
  1. package/dist/Analytic-CC5xdRtS.js +423 -0
  2. package/dist/{App-DvtYt9h5.js → App-CFLVGljI.js} +276 -275
  3. package/dist/Broadcast-B5OnLTNo.js +223 -0
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DoH4RX_Y.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B6oleems.js} +8 -8
  5. package/dist/Card-Cw9Ts0qN.js +824 -0
  6. package/dist/{Collections-C5-k8WkG.js → Collections-CTEOsTLk.js} +4 -4
  7. package/dist/Credit-Bt2ntvn6.js +220 -0
  8. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DCbvlp5V.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BaOM6fUL.js} +918 -901
  9. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-Dxyv9AzJ.js +345 -0
  10. package/dist/Experience-CdiCyjUs.js +221 -0
  11. package/dist/Game-CD07hjmT.js +255 -0
  12. package/dist/Marketing-CodbC8LJ.js +316 -0
  13. package/dist/Member-Cr8ki7-7.js +69 -0
  14. package/dist/{MemberList-CMefeirT.js → MemberList-_-IwGMer.js} +75 -75
  15. package/dist/{MemberTransactions-B9oYdzjR.js → MemberTransactions-B3LWcATC.js} +1 -1
  16. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-B0T7ze7r.js → MessageInput.vue_vue_type_script_setup_true_lang-DF-PHN1Z.js} +2 -2
  17. package/dist/Mission-BqR_oPzu.js +261 -0
  18. package/dist/Point-wI_0oL5d.js +222 -0
  19. package/dist/Promotion-Dx6CD3_V.js +253 -0
  20. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-BGM1doWM.js → RuleGroup.vue_vue_type_script_setup_true_lang-DiaYx2vk.js} +15 -15
  21. package/dist/Segment-BzM2a7dM.js +565 -0
  22. package/dist/Setting-C8me75UN.js +1871 -0
  23. package/dist/Store-CT-y0pJ4.js +1530 -0
  24. package/dist/StoreRewards-l5qkiIy-.js +400 -0
  25. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-JumDBZLs.js → StoreTransactions.vue_vue_type_script_setup_true_lang-DNyeXIL6.js} +10 -10
  26. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BtBCggcN.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BYwjePth.js} +1 -1
  27. package/dist/{Tier-ms8r2E7c.js → Tier-gHTgMsQ3.js} +470 -445
  28. package/dist/{Title-BBKoBs46.js → Title-DQS7FHaO.js} +298 -282
  29. package/dist/Transaction-D7nTuNwj.js +39 -0
  30. package/dist/Voucher-Dr6IxBlt.js +490 -0
  31. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-Jh7OW6Wa.js +141 -0
  32. package/dist/{app-CGgrMOc_.js → app-BCgzIoKj.js} +1 -1
  33. package/dist/app-CbpXeslU.js +5639 -0
  34. package/dist/app.js +4 -3
  35. package/dist/{business-DeMUnCNX.js → business-DDhQna1e.js} +1 -1
  36. package/dist/{campaign-CBszI6An.js → campaign-CGa533e7.js} +2 -2
  37. package/dist/{collection.fn-D4Qgx1aW.js → collection.fn-CalTbTcW.js} +2 -2
  38. package/dist/dto-i36GeVm3.js +2770 -0
  39. package/dist/{effect-2p4_SGbQ.js → effect-DdEyoxWE.js} +1 -1
  40. package/dist/{email-addresses-Bc9od2gA.js → email-addresses-DJkhLbVW.js} +1 -1
  41. package/dist/{export-BK6FgeQO.js → export-g24Ga1Ru.js} +3 -3
  42. package/dist/{helper-DUkKW7uc.js → helper-BILtwZxJ.js} +1 -1
  43. package/dist/{index-Cvbyv9Hx.js → index-61n4HR_9.js} +1 -1
  44. package/dist/{index-AZ8cKg9n.js → index-BOwZO-JV.js} +1 -1
  45. package/dist/{index-M1SmasnI.js → index-BzskWtcd.js} +3 -3
  46. package/dist/{index-CTmiZrHu.js → index-CLA_3YPs.js} +1 -1
  47. package/dist/{index-B9f-K1No.js → index-Ca1erv2G.js} +2 -2
  48. package/dist/{index-BWWnWRpt.js → index-DgfFUabi.js} +2 -2
  49. package/dist/{index-Ci8tkzSn.js → index-GQ4JIFWE.js} +1 -1
  50. package/dist/{index-BFcrfL4W.js → index-ZcMWfKwl.js} +1 -1
  51. package/dist/{index-g4L04WYz.js → index-bkuptzmD.js} +91 -86
  52. package/dist/index-hp-LjMMQ.js +3 -0
  53. package/dist/{index-DRaETKbn.js → index-lYDskqcR.js} +258 -256
  54. package/dist/{index-D4HYMbSu.js → index-p3dozIB_.js} +3 -3
  55. package/dist/{index.esm2017-kvuav0Sd.js → index.esm2017-DeO7Sly1.js} +38 -38
  56. package/dist/{loading-MNCADfHc.js → loading-CqDGv2I6.js} +11 -11
  57. package/dist/{membership-CsbTF-DX.js → membership-aP_8YmFK.js} +3 -3
  58. package/dist/{money-Lo7kavmu.js → money-BmmtBTzl.js} +1 -1
  59. package/dist/{number-BviV2K5O.js → number-By8HkTkQ.js} +1 -1
  60. package/dist/{rule-DKrUrnrM.js → rule-CI2g3FmQ.js} +3 -3
  61. package/dist/{rule-builder-DjPniLk6.js → rule-builder-BCBsbe_y.js} +1 -1
  62. package/dist/{template-DteMEC9C.js → template-CRNz0-Qj.js} +4 -4
  63. package/dist/{usePagination-BKTq-UbV.js → usePagination-D4IC9efy.js} +1 -1
  64. package/dist/vue-i18n-0zlAmAlF.js +2365 -0
  65. package/package.json +7 -4
  66. package/dist/Analytic-DiPWt78u.js +0 -423
  67. package/dist/Broadcast-Dv4XcvBh.js +0 -216
  68. package/dist/Card-DDvwlZF0.js +0 -823
  69. package/dist/Credit-BDQIr_FJ.js +0 -214
  70. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-BQzgcn4V.js +0 -344
  71. package/dist/Experience-B9H3tOF0.js +0 -211
  72. package/dist/Game-cy3_ppLO.js +0 -250
  73. package/dist/Marketing-CWXV2n5F.js +0 -309
  74. package/dist/Member-DyTX22Zk.js +0 -92
  75. package/dist/Mission-DxSO3iES.js +0 -248
  76. package/dist/Point-C5UtlqkX.js +0 -220
  77. package/dist/Promotion-DhSGTj-R.js +0 -244
  78. package/dist/Segment-BzI6Ykxp.js +0 -564
  79. package/dist/Setting-SRUWwF9w.js +0 -1870
  80. package/dist/Store-CIrn_7Mh.js +0 -1533
  81. package/dist/StoreRewards-BYc0vgnr.js +0 -429
  82. package/dist/Transaction-IZL9-6fe.js +0 -36
  83. package/dist/Voucher-CIWulmcc.js +0 -485
  84. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js +0 -140
  85. package/dist/app-BQvluJk_.js +0 -2974
  86. package/dist/dto-Dtvg93Bz.js +0 -1145
  87. package/dist/index-UR1Lxi0C.js +0 -11
@@ -1,214 +0,0 @@
1
- import { defineComponent as U, ref as k, computed as A, onMounted as N, resolveComponent as i, openBlock as l, createElementBlock as f, Fragment as g, createVNode as r, unref as o, createElementVNode as s, withCtx as h, renderList as j, createBlock as C, resolveDynamicComponent as M, toDisplayString as y, createCommentVNode as H, h as q } from "vue";
2
- import { _ as z } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as G, components as J } from "@feedmepos/ui-library";
4
- import { u as O, p as Q } from "./loading-MNCADfHc.js";
5
- import { u as W } from "./business-DeMUnCNX.js";
6
- import { u as X } from "./campaign-CBszI6An.js";
7
- import { g as S, a as V } from "./dto-Dtvg93Bz.js";
8
- import { _ as Y } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
9
- import { _ as Z } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-DCbvlp5V.js";
10
- import { u as ee } from "./template-DteMEC9C.js";
11
- import { c as _ } from "./index-CTmiZrHu.js";
12
- const te = { class: "px-24 flex flex-col gap-y-16" }, oe = { class: "flex items-center justify-between w-full" }, ae = { class: "flex gap-8 overflow-x-auto" }, se = { class: "space-y-8" }, ne = { class: "flex w-full gap-4 items-center" }, re = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ie = { class: "space-y-4" }, le = { class: "fm-typo-en-body-lg-600" }, ce = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, me = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, de = { key: 0 }, ue = /* @__PURE__ */ s("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600" }, " No results found ", -1), pe = [
13
- ue
14
- ], fe = /* @__PURE__ */ s("img", {
15
- src: z,
16
- class: "aspect-square w-[150px]"
17
- }, null, -1), ye = /* @__PURE__ */ s("div", { class: "flex flex-col gap-16 text-center" }, [
18
- /* @__PURE__ */ s("div", { class: "fm-typo-en-title-sm-800" }, "Create your credit program"),
19
- /* @__PURE__ */ s("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Credits are virtual money that customers can use to pay for their purchases, similar to cash within your store. ")
20
- ], -1), Re = /* @__PURE__ */ U({
21
- __name: "Credit",
22
- setup(_e) {
23
- const R = {
24
- label: "Create program",
25
- value: "create",
26
- isPrimary: !0,
27
- prependIcon: "add"
28
- }, L = ee("CREDIT", G()), I = W(), c = X(), { global: B, minor: w } = O, n = k({
29
- searchKey: "",
30
- location: null
31
- }), m = A(
32
- () => c.campaigns.credit.filter(
33
- (e) => !n.value.location || !e.targetLocation || e.targetLocation.includes(n.value.location)
34
- )
35
- ), D = [
36
- {
37
- header: "Program title",
38
- accessorFn: (e) => e.name
39
- },
40
- {
41
- header: "Status",
42
- cell(e) {
43
- return S(e.row.original);
44
- }
45
- },
46
- {
47
- header: "Summary",
48
- accessorFn: (e) => V(e)
49
- //v.effect,
50
- },
51
- {
52
- header: "Actions",
53
- cell(e) {
54
- return q(J.FmButton, {
55
- variant: "tertiary",
56
- icon: "delete",
57
- iconColor: "neutral-gray-400",
58
- onClick: (a) => {
59
- a.stopPropagation(), x(e.row.original);
60
- }
61
- });
62
- }
63
- }
64
- ], v = k();
65
- async function x(e) {
66
- await Q.remove(`Are you sure you want to remove ${e.name}?`) && await w(
67
- async () => {
68
- await _.delete(e._id), await c.read("CREDIT");
69
- },
70
- {
71
- message: `Removing ${e.name}`,
72
- successMessage: `Removed ${e.name} successfully`
73
- }
74
- );
75
- }
76
- async function p(e) {
77
- e ? await a() : L.open(async (d) => {
78
- await a(d);
79
- });
80
- async function a(d) {
81
- var u;
82
- (u = v.value) == null || u.showSheet(
83
- !0,
84
- "CREDIT",
85
- e ? await _.readById(e._id) : void 0,
86
- d
87
- );
88
- }
89
- }
90
- async function T(e) {
91
- await w(
92
- async () => {
93
- e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await c.read("CREDIT");
94
- },
95
- {
96
- message: `${e.campaign._id ? "Updating" : "Creating"} credit program`,
97
- successMessage: `Credit program ${e.campaign._id ? "updated" : "created"} successfully`
98
- }
99
- );
100
- }
101
- return N(async () => {
102
- await B(async () => {
103
- await c.read("CREDIT");
104
- });
105
- }), (e, a) => {
106
- const d = i("FmPageHead"), u = i("FmSearch"), $ = i("FmTable"), b = i("FmButton"), E = i("FmListItem"), K = i("FmList"), P = i("FmCard");
107
- return l(), f(g, null, [
108
- r(d, {
109
- title: "Credit",
110
- actions: o(m).length > 0 ? [R] : [],
111
- "onClick:action": a[0] || (a[0] = () => p())
112
- }, null, 8, ["actions"]),
113
- s("div", te, [
114
- r(u, {
115
- modelValue: o(n).searchKey,
116
- "onUpdate:modelValue": a[1] || (a[1] = (t) => o(n).searchKey = t),
117
- class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
118
- placeholder: "search",
119
- collapsible: ""
120
- }, null, 8, ["modelValue"]),
121
- o(c).campaigns.credit && o(c).campaigns.credit.length > 0 ? (l(), f(g, { key: 0 }, [
122
- s("div", oe, [
123
- s("div", ae, [
124
- r(Y, {
125
- modelValue: o(n).location,
126
- "onUpdate:modelValue": a[2] || (a[2] = (t) => o(n).location = t),
127
- label: "Location: ",
128
- "show-item-label": !0,
129
- icon: "storefront",
130
- placement: "bottom-start",
131
- items: o(I).locationItems
132
- }, null, 8, ["modelValue", "items"])
133
- ]),
134
- r(u, {
135
- modelValue: o(n).searchKey,
136
- "onUpdate:modelValue": a[3] || (a[3] = (t) => o(n).searchKey = t),
137
- class: "xs:hidden",
138
- placeholder: "search",
139
- collapsible: ""
140
- }, null, 8, ["modelValue"])
141
- ]),
142
- r($, {
143
- class: "xs:hidden",
144
- "row-data": o(m),
145
- "column-defs": D,
146
- "search-value": o(n).searchKey,
147
- "column-filter": [],
148
- onRowClick: a[4] || (a[4] = (t) => p(t.original)),
149
- "hide-footer": o(m).length < 10
150
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
151
- r(K, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
152
- default: h(() => [
153
- (l(!0), f(g, null, j(o(m).filter(
154
- (t) => t.name.toLowerCase().includes(o(n).searchKey.toLowerCase())
155
- ), (t) => (l(), C(E, {
156
- key: t._id.toString(),
157
- onClick: (F) => p(t),
158
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
159
- }, {
160
- default: h(() => [
161
- s("div", se, [
162
- s("div", ne, [
163
- (l(), C(M(o(S)(t)))),
164
- s("div", re, y(t.currentReceive ?? 0) + " used ", 1)
165
- ]),
166
- s("div", ie, [
167
- s("div", le, y(t.name), 1),
168
- s("div", ce, y(o(V)(t)), 1)
169
- ]),
170
- s("div", me, " Credit received: " + y(t.currentReceive ?? 0), 1)
171
- ]),
172
- r(b, {
173
- icon: "delete",
174
- "icon-color": "neutral-gray-400",
175
- variant: "tertiary",
176
- onClick: (F) => (F.stopPropagation(), x(t))
177
- }, null, 8, ["onClick"])
178
- ]),
179
- _: 2
180
- }, 1032, ["onClick"]))), 128))
181
- ]),
182
- _: 1
183
- }),
184
- o(m).length == 0 ? (l(), f("div", de, pe)) : H("", !0)
185
- ], 64)) : (l(), C(P, {
186
- key: 1,
187
- variant: "outlined",
188
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
189
- }, {
190
- default: h(() => [
191
- fe,
192
- ye,
193
- r(b, {
194
- variant: "primary",
195
- label: "Create credit program",
196
- icon: "add",
197
- onClick: a[5] || (a[5] = (t) => p())
198
- })
199
- ]),
200
- _: 1
201
- })),
202
- r(Z, {
203
- ref_key: "sheetRef",
204
- ref: v,
205
- "onSubmit:modelValue": T
206
- }, null, 512)
207
- ])
208
- ], 64);
209
- };
210
- }
211
- });
212
- export {
213
- Re as default
214
- };
@@ -1,344 +0,0 @@
1
- import { defineComponent as O, ref as R, onMounted as J, computed as z, resolveComponent as y, openBlock as s, createElementBlock as x, renderSlot as K, toDisplayString as S, createCommentVNode as f, createBlock as p, unref as e, isRef as H, createVNode as b, normalizeClass as q, watch as Q, withCtx as F, resolveDynamicComponent as k, Fragment as W, createElementVNode as A, createTextVNode as X } from "vue";
2
- import { z as _ } from "./app-BQvluJk_.js";
3
- import { Z as d } from "./ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js";
4
- import { g as ee, h as te } from "./index-Cvbyv9Hx.js";
5
- import { s as C } from "./effect-2p4_SGbQ.js";
6
- import { p as le } from "./loading-MNCADfHc.js";
7
- import { I as oe } from "./app-CGgrMOc_.js";
8
- const ae = { class: "flex flex-col gap-8" }, ne = {
9
- key: 0,
10
- class: "fm-typo-en-body-lg-600"
11
- }, se = { key: 1 }, ie = {
12
- key: 2,
13
- class: "space-y-16"
14
- }, de = /* @__PURE__ */ O({
15
- __name: "ValidityInput",
16
- props: {
17
- label: {
18
- type: String
19
- },
20
- disabled: {
21
- type: Boolean,
22
- default: !1
23
- },
24
- type: {
25
- type: String,
26
- default: void 0
27
- },
28
- modelValue: {
29
- type: Object,
30
- required: !0
31
- },
32
- forCredit: {
33
- type: Boolean,
34
- default: !1
35
- },
36
- helperText: {
37
- type: String
38
- }
39
- },
40
- emits: ["update:model-value"],
41
- setup(t, { emit: h }) {
42
- var g, P;
43
- const n = t, c = h, a = [
44
- { label: "Date Range", value: "range" },
45
- { label: "Custom", value: "custom" }
46
- ], u = R(!1);
47
- J(() => {
48
- u.value = n.modelValue && Object.entries(n.modelValue).filter(
49
- ([r, i]) => r != "followFirstReceive" && i != null
50
- ).length > 0;
51
- });
52
- const l = R(
53
- n.type ? a.find((r) => r.value === n.type) : (g = n.modelValue) != null && g.validBefore || (P = n.modelValue) != null && P.validAfter ? a[0] : a[1]
54
- ), w = z(
55
- () => n.forCredit ? ee : te
56
- ), v = z(() => {
57
- const r = w.value.safeParse(n.modelValue);
58
- return r.success ? [] : r.error.errors;
59
- });
60
- function o(r) {
61
- c("update:model-value", r);
62
- }
63
- function U(r) {
64
- var i, D;
65
- if (r.value == "range")
66
- return o({
67
- followFirstReceive: (i = n.modelValue) == null ? void 0 : i.followFirstReceive,
68
- validAfter: void 0,
69
- validBefore: void 0
70
- });
71
- if (r.value == "custom")
72
- return u.value = !1, o({
73
- validForDay: (D = n.modelValue) == null ? void 0 : D.validForDay
74
- });
75
- }
76
- return (r, i) => {
77
- var T, I, E, M, $, j, N, L;
78
- const D = y("FmButtonGroup"), G = y("FmSimpleDateRangePicker"), Z = y("FmSwitch"), Y = y("FmStepperField"), B = y("FmHelperText");
79
- return s(), x("div", ae, [
80
- K(r.$slots, "label", {}, () => [
81
- t.label ? (s(), x("div", ne, S(t.label), 1)) : f("", !0)
82
- ]),
83
- t.type ? f("", !0) : (s(), p(D, {
84
- key: 0,
85
- modelValue: e(l),
86
- "onUpdate:modelValue": [
87
- i[0] || (i[0] = (m) => H(l) ? l.value = m : null),
88
- i[1] || (i[1] = (m) => U(m))
89
- ],
90
- items: a
91
- }, null, 8, ["modelValue"])),
92
- e(l).value === "range" ? (s(), x("div", se, [
93
- b(G, {
94
- "model-value": {
95
- startDate: (T = t.modelValue) != null && T.validAfter ? new Date((I = t.modelValue) == null ? void 0 : I.validAfter).toISOString() : null,
96
- endDate: (E = t.modelValue) != null && E.validAfter ? new Date(((M = t.modelValue) == null ? void 0 : M.validBefore) || "").toISOString() : null
97
- },
98
- "onUpdate:modelValue": i[2] || (i[2] = (m) => {
99
- var V;
100
- o({
101
- followFirstReceive: (V = n.modelValue) == null ? void 0 : V.followFirstReceive,
102
- validAfter: new Date(m.startDate).toISOString(),
103
- validBefore: new Date(m.endDate).toISOString()
104
- });
105
- })
106
- }, null, 8, ["model-value"])
107
- ])) : e(l).value === "custom" ? (s(), x("div", ie, [
108
- b(Z, {
109
- "model-value": e(u),
110
- label: "Expires",
111
- "label-placement": "right",
112
- "onUpdate:modelValue": i[3] || (i[3] = (m) => {
113
- var V;
114
- u.value = m, o({
115
- validForDay: m ? 1 : void 0,
116
- followFirstReceive: (V = n.modelValue) == null ? void 0 : V.followFirstReceive
117
- });
118
- })
119
- }, null, 8, ["model-value"]),
120
- e(u) ? (s(), p(Y, {
121
- key: 0,
122
- label: "After (days)",
123
- class: q([{
124
- "opacity-50 pointer-events-none": !e(u)
125
- }, "mt-[-4px]"]),
126
- "max-fraction-digits": 0,
127
- disabled: !e(u),
128
- "show-steppers": !1,
129
- max: 99999,
130
- "append-text": "day(s)",
131
- "model-value": (($ = n.modelValue) == null ? void 0 : $.validForDay) ?? null,
132
- "onUpdate:modelValue": i[4] || (i[4] = (m) => {
133
- var V;
134
- return o({
135
- validForDay: m == null ? void 0 : parseInt(m.toString()),
136
- followFirstReceive: (V = n.modelValue) == null ? void 0 : V.followFirstReceive
137
- });
138
- })
139
- }, null, 8, ["class", "disabled", "model-value"])) : f("", !0)
140
- ])) : f("", !0),
141
- ((j = n.modelValue) == null ? void 0 : j.followFirstReceive) === !0 && e(u) ? (s(), p(B, {
142
- key: 3,
143
- text: "Expiry follows the first receive"
144
- })) : f("", !0),
145
- b(B, {
146
- text: t.helperText || (((N = n.modelValue) == null ? void 0 : N.validForDay) === 0 ? "Expires on the same day" : e(d).helperText(e(v), "")),
147
- state: t.helperText ? "error" : ((L = n.modelValue) == null ? void 0 : L.validForDay) === 0 ? "warning" : e(d).helperState(e(v), "")
148
- }, null, 8, ["text", "state"])
149
- ]);
150
- };
151
- }
152
- }), re = { class: "space-y-8" }, he = /* @__PURE__ */ O({
153
- __name: "CollectibleOptionInput",
154
- props: {
155
- modelValue: {
156
- type: Object
157
- },
158
- noCampaign: {
159
- type: Boolean
160
- },
161
- schema: {
162
- type: Object,
163
- default: () => _.any()
164
- },
165
- isMission: {
166
- type: Boolean,
167
- default: !1
168
- }
169
- },
170
- emits: ["update:model-value"],
171
- setup(t, { emit: h }) {
172
- const n = t, c = h, a = R(n.modelValue ?? {});
173
- return Q(a, () => c("update:model-value", a.value)), (u, l) => {
174
- const w = y("FmSwitch"), v = y("FmStepperField");
175
- return s(), x("div", re, [
176
- t.isMission ? f("", !0) : (s(), p(w, {
177
- key: 0,
178
- label: "Enable Transfer",
179
- "label-placement": "right",
180
- modelValue: e(a).enableTransfer,
181
- "onUpdate:modelValue": l[0] || (l[0] = (o) => e(a).enableTransfer = o)
182
- }, null, 8, ["modelValue"])),
183
- t.noCampaign ? f("", !0) : (s(), x("div", {
184
- key: 1,
185
- class: q(["grid gap-16", t.isMission ? "" : "grid-cols-2"])
186
- }, [
187
- b(v, {
188
- modelValue: e(a).maxPerUser,
189
- "onUpdate:modelValue": l[1] || (l[1] = (o) => e(a).maxPerUser = o),
190
- "show-steppers": !1,
191
- rules: [e(d).ruleAtPath(t.schema, "maxPerUser")]
192
- }, {
193
- label: F(() => [
194
- (s(), p(k(
195
- e(d).toInputLabel(
196
- e(d).typeAtPath(t.schema, "maxPerUser"),
197
- "Max per user"
198
- )
199
- )))
200
- ]),
201
- _: 1
202
- }, 8, ["modelValue", "rules"]),
203
- t.isMission ? f("", !0) : (s(), p(v, {
204
- key: 0,
205
- modelValue: e(a).maxReceive,
206
- "onUpdate:modelValue": l[2] || (l[2] = (o) => e(a).maxReceive = o),
207
- "show-steppers": !1,
208
- rules: [e(d).ruleAtPath(t.schema, "maxReceive")]
209
- }, {
210
- label: F(() => [
211
- (s(), p(k(
212
- e(d).toInputLabel(
213
- e(d).typeAtPath(t.schema, "maxReceive"),
214
- "Max distribute"
215
- )
216
- )))
217
- ]),
218
- _: 1
219
- }, 8, ["modelValue", "rules"]))
220
- ], 2)),
221
- t.isMission ? f("", !0) : (s(), x(W, { key: 2 }, [
222
- b(v, {
223
- modelValue: e(a).maxUse,
224
- "onUpdate:modelValue": l[3] || (l[3] = (o) => e(a).maxUse = o),
225
- "append-text": "use(s)",
226
- "show-steppers": !1,
227
- rules: [e(d).ruleAtPath(t.schema, "maxUse")]
228
- }, {
229
- label: F(() => [
230
- (s(), p(k(
231
- e(d).toInputLabel(
232
- e(d).typeAtPath(t.schema, "maxUse"),
233
- "Usage count"
234
- )
235
- )))
236
- ]),
237
- _: 1
238
- }, 8, ["modelValue", "rules"]),
239
- e(a).maxUse && e(a).maxUse > 1 ? (s(), p(v, {
240
- key: 0,
241
- modelValue: e(a).cooldown,
242
- "onUpdate:modelValue": l[4] || (l[4] = (o) => e(a).cooldown = o),
243
- "append-text": "minute(s)",
244
- "show-steppers": !1,
245
- rules: [e(d).ruleAtPath(t.schema, "cooldown")]
246
- }, {
247
- label: F(() => [
248
- (s(), p(k(
249
- e(d).toInputLabel(
250
- e(d).typeAtPath(t.schema, "cooldown"),
251
- "Cooldown"
252
- )
253
- )))
254
- ]),
255
- _: 1
256
- }, 8, ["modelValue", "rules"])) : f("", !0),
257
- b(de, {
258
- modelValue: e(a).validityOption,
259
- "onUpdate:modelValue": l[5] || (l[5] = (o) => e(a).validityOption = o),
260
- label: "Validity option"
261
- }, null, 8, ["modelValue"])
262
- ], 64))
263
- ]);
264
- };
265
- }
266
- }), ue = { class: "space-y-8" }, me = /* @__PURE__ */ A("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Configure the discount you want to offer your customer. ", -1), pe = {
267
- key: 1,
268
- class: "border-1 rounded-md flex gap-16 items-center justify-between px-16 py-12"
269
- }, ce = { class: "fm-typo-en-body-lg-400" }, fe = { class: "text-fm-color-typo-secondary" }, ge = /* @__PURE__ */ O({
270
- __name: "EffectSheet",
271
- props: {
272
- modelValue: { type: Object },
273
- canSetAutoApply: {
274
- type: Boolean
275
- }
276
- },
277
- emits: ["update:model-value"],
278
- setup(t, { emit: h }) {
279
- const n = h, c = R(!1);
280
- async function a(u) {
281
- u.stopPropagation(), await le.remove("Are you sure you want to remove this effect?") && n("update:model-value", null);
282
- }
283
- return (u, l) => {
284
- const w = y("FmButton"), v = y("FmSideSheet");
285
- return s(), p(v, {
286
- "max-width": 550,
287
- header: "Apply discount",
288
- modelValue: e(c),
289
- "onUpdate:modelValue": [
290
- l[2] || (l[2] = (o) => H(c) ? c.value = o : null),
291
- l[3] || (l[3] = (o) => c.value = o)
292
- ]
293
- }, {
294
- "side-sheet-button": F(() => {
295
- var o, U, g;
296
- return [
297
- A("div", ue, [
298
- me,
299
- t.modelValue ? (s(), x("div", pe, [
300
- A("div", ce, [
301
- A("div", null, S((o = e(C)(t.modelValue)) == null ? void 0 : o.type), 1),
302
- A("div", fe, S((U = e(C)(t.modelValue)) == null ? void 0 : U.adjustment) + " with " + S((g = e(C)(t.modelValue)) == null ? void 0 : g.requirements), 1)
303
- ]),
304
- b(w, {
305
- icon: "delete",
306
- "icon-color": "neutral-gray-400",
307
- variant: "tertiary",
308
- onClick: a
309
- })
310
- ])) : (s(), p(w, {
311
- key: 0,
312
- label: "Apply discount",
313
- icon: "add",
314
- "icon-color": "primary",
315
- variant: "secondary",
316
- class: "border-fm-color-primary text-fm-color-primary"
317
- }))
318
- ])
319
- ];
320
- }),
321
- "side-sheet-footer": F(() => [
322
- X(S(void 0))
323
- ]),
324
- default: F(() => [
325
- b(e(oe), {
326
- class: "fm-effect-sheet",
327
- title: "",
328
- "can-set-auto-apply": t.canSetAutoApply,
329
- "disable-effects": t.canSetAutoApply ? ["PAYMENT"] : void 0,
330
- "initial-value": t.modelValue,
331
- onOnConfirm: l[0] || (l[0] = (o) => (n("update:model-value", o), c.value = !1)),
332
- onOnCancel: l[1] || (l[1] = (o) => c.value = !1)
333
- }, null, 8, ["can-set-auto-apply", "disable-effects", "initial-value"])
334
- ]),
335
- _: 1
336
- }, 8, ["modelValue"]);
337
- };
338
- }
339
- });
340
- export {
341
- ge as _,
342
- he as a,
343
- de as b
344
- };