@feedmepos/mf-connect 0.0.16-beta.10 → 0.0.16-beta.12

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 (85) hide show
  1. package/dist/{Analytic-BVk0jPDU.js → Analytic-DIc9BYb0.js} +32 -20
  2. package/dist/{App-BbAalq1k.js → App-BzzL9_Jw.js} +33 -27
  3. package/dist/Broadcast-dVPgK5QV.js +223 -0
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DiU3MnH0.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-TnEPvafD.js} +18 -11
  5. package/dist/{Card-B5in1RMa.js → Card-Bj2Yd2pr.js} +178 -158
  6. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +97 -0
  7. package/dist/Collections-Fkb_zzqZ.js +453 -0
  8. package/dist/{Credit-Bc9EzdsC.js → Credit-DHn9OkE8.js} +78 -69
  9. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-C1ZXQski.js +2788 -0
  10. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-D6mWny8y.js +344 -0
  11. package/dist/{Experience-CgKak5ik.js → Experience-DX3aJihS.js} +64 -55
  12. package/dist/{Game-QhfKqrN_.js → Game-CcVQvETd.js} +54 -45
  13. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +144 -0
  14. package/dist/JsonViewer-v8_C7l5N.js +87 -0
  15. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js +18737 -0
  16. package/dist/MainLayout-B1aJoR95.js +41 -0
  17. package/dist/{Marketing-CSx4N7UJ.js → Marketing-B9kykWEh.js} +79 -72
  18. package/dist/{Member-CY6WMD8D.js → Member-RoJSCSC5.js} +25 -22
  19. package/dist/{MemberList-8iRwm7Sz.js → MemberList-BUDxqMEK.js} +321 -307
  20. package/dist/{MemberTransactions-CknqkWO3.js → MemberTransactions-Bh_tT1Rp.js} +1 -1
  21. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-Cj3-JHOX.js +432 -0
  22. package/dist/{Mission-BTy1p7lU.js → Mission-DDvgCLy0.js} +50 -40
  23. package/dist/{Point-A6B_ggSy.js → Point-BbPkt4kF.js} +67 -58
  24. package/dist/Promotion-DEo-lxpX.js +221 -0
  25. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BGjeTeqS.js +1751 -0
  26. package/dist/{Segment-CFVXtyEj.js → Segment-DAcpZWIN.js} +145 -130
  27. package/dist/{Setting-Jmtw-_DV.js → Setting-CgXohUPt.js} +167 -154
  28. package/dist/{Store-DQypT-7e.js → Store-BVyHbQ8o.js} +504 -489
  29. package/dist/{StoreRewards-M-utm0iI.js → StoreRewards-sccMDbkj.js} +124 -108
  30. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-B60mQ5kq.js → StoreTransactions.vue_vue_type_script_setup_true_lang--sdQ_l8g.js} +131 -123
  31. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-CXlkvt2u.js +139 -0
  32. package/dist/{Tier-D1jymeLK.js → Tier--P27XXbB.js} +144 -125
  33. package/dist/{Title-DN9DIP2k.js → Title-B27S3SxD.js} +107 -90
  34. package/dist/{Transaction-BAJvAoU6.js → Transaction-CYTtwwHY.js} +2 -2
  35. package/dist/Voucher-BZ8PKgO5.js +488 -0
  36. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-CWt4tVdk.js +55 -0
  37. package/dist/_commonjsHelpers-BkfeUUK-.js +28 -0
  38. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  39. package/dist/app-CnKzqAcN.js +53428 -0
  40. package/dist/app-FfENBuoE.js +5381 -0
  41. package/dist/app-wDQR6dpb.js +39 -0
  42. package/dist/app.js +2 -1
  43. package/dist/business-CXyP9G7A.js +78 -0
  44. package/dist/campaign-0aM2KYOy.js +96 -0
  45. package/dist/campaign-CpzFl8Vr.js +4 -0
  46. package/dist/collection.fn-FicQhH1t.js +26 -0
  47. package/dist/dto-BiYLkVdL.js +1169 -0
  48. package/dist/effect-Cg-eNEjg.js +61 -0
  49. package/dist/{export-DjeNY5Pc.js → export-D7BuObOL.js} +19 -16
  50. package/dist/helper-DvD-D7c7.js +71 -0
  51. package/dist/index-B1Q0GAWp.js +95 -0
  52. package/dist/index-B4UZgSB-.js +28058 -0
  53. package/dist/index-B6c-fUij.js +203 -0
  54. package/dist/index-BP_5cfKa.js +38 -0
  55. package/dist/index-BRXg5Si1.js +2071 -0
  56. package/dist/index-BuDwICBJ.js +761 -0
  57. package/dist/index-CDMC-8iO.js +94 -0
  58. package/dist/index-CcZt3OrE.js +73 -0
  59. package/dist/index-CuvNtC_M.js +61 -0
  60. package/dist/index-DA-fzkRR.js +1737 -0
  61. package/dist/index-Dbd4WA4r.js +61 -0
  62. package/dist/index-Dkeb_9ER.js +8832 -0
  63. package/dist/index-DmdKoKk_.js +298 -0
  64. package/dist/index-G-88ujCM.js +3 -0
  65. package/dist/loading-uCNeZibp.js +32697 -0
  66. package/dist/lodash-B5I3zXaY.js +3678 -0
  67. package/dist/membership-DFRO9TyM.js +221 -0
  68. package/dist/moment-BWErdI6_.js +2578 -0
  69. package/dist/money-OtkT4Pzp.js +15 -0
  70. package/dist/number-Cg3NCouc.js +12 -0
  71. package/dist/object-qECH92oz.js +26 -0
  72. package/dist/objectId-dwaoBfJX.js +7 -0
  73. package/dist/rule-Ch2HRiGw.js +1973 -0
  74. package/dist/rule-builder-B_M9yvEe.js +89 -0
  75. package/dist/template-1o0LbOoJ.js +190 -0
  76. package/dist/usePagination-BeF5K3M7.js +223 -0
  77. package/dist/vue-i18n-AtGIa4qH.js +2365 -0
  78. package/dist/xlsx-pChq0adn.js +15491 -0
  79. package/dist/zod-W_PvIofQ.js +90 -0
  80. package/package.json +3 -3
  81. package/dist/Collections-CFCZ9YIG.js +0 -4
  82. package/dist/MainLayout-JbHzENFy.js +0 -4
  83. package/dist/app-BpzzygYP.js +0 -87765
  84. package/dist/money-DKGIIplY.js +0 -15
  85. package/dist/number-tPodRxTN.js +0 -12
@@ -1,24 +1,33 @@
1
- import { defineComponent as M, ref as V, computed as T, h as A, onMounted as E, resolveComponent as r, openBlock as d, createElementBlock as h, Fragment as w, createVNode as i, unref as t, withCtx as g, createElementVNode as n, toDisplayString as c, renderList as H, createBlock as b, resolveDynamicComponent as q } from "vue";
2
- import { u as z, M as G, b as J, h as Q, v as I, w as P, B as W, c as _, N as X, j as Y, y as Z, e as ee } from "./app-BpzzygYP.js";
3
- import { useDialog as te, components as oe } from "@feedmepos/ui-library";
4
- const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, se = { class: "px-24 flex flex-col gap-y-16" }, le = { class: "flex items-center justify-between w-full" }, ie = { class: "flex gap-8 overflow-x-auto" }, re = { class: "space-y-8" }, ce = { class: "flex w-full gap-4 items-center" }, me = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, de = { class: "space-y-4" }, pe = { class: "fm-typo-en-body-lg-600" }, ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ye = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fe = { class: "flex flex-col gap-16 text-center" }, ge = { class: "fm-typo-en-title-sm-800" }, _e = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, xe = /* @__PURE__ */ M({
1
+ import { defineComponent as j, ref as V, computed as A, h as E, onMounted as M, resolveComponent as l, openBlock as d, createElementBlock as h, Fragment as b, createVNode as r, unref as t, withCtx as g, createElementVNode as n, toDisplayString as c, renderList as H, createBlock as w, resolveDynamicComponent 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 { p as Q, u as W } from "./loading-uCNeZibp.js";
5
+ import { u as X } from "./business-CXyP9G7A.js";
6
+ import { u as Y } from "./campaign-0aM2KYOy.js";
7
+ import { g as I, b as P } from "./dto-BiYLkVdL.js";
8
+ import { _ as Z } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
9
+ import { _ as ee } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-C1ZXQski.js";
10
+ import { u as te } from "./template-1o0LbOoJ.js";
11
+ import { u as oe } from "./vue-i18n-AtGIa4qH.js";
12
+ import { c as _ } from "./index-CDMC-8iO.js";
13
+ const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, se = { class: "px-24 flex flex-col gap-y-16" }, ie = { class: "flex items-center justify-between w-full" }, re = { class: "flex gap-8 overflow-x-auto" }, le = { class: "space-y-8" }, ce = { class: "flex w-full gap-4 items-center" }, me = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, de = { class: "space-y-4" }, pe = { class: "fm-typo-en-body-lg-600" }, ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ye = { class: "flex flex-col gap-16 text-center" }, ge = { class: "fm-typo-en-title-sm-800" }, _e = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Be = /* @__PURE__ */ j({
5
14
  __name: "Point",
6
15
  setup(he) {
7
- const { t: s } = z(), B = {
16
+ const { t: s } = oe(), B = {
8
17
  label: s("connect.program.common.actions.create", {
9
18
  type: s("connect.program.point.title").toLowerCase()
10
19
  }),
11
20
  value: "create",
12
21
  isPrimary: !0,
13
22
  prependIcon: "add"
14
- }, $ = G("COIN", te()), v = J(), m = Q(), { global: N, minor: x } = ee, l = V({
23
+ }, $ = te("COIN", G()), x = X(), m = Y(), { global: K, minor: C } = W, i = V({
15
24
  searchKey: "",
16
25
  location: null
17
- }), u = T(
26
+ }), u = A(
18
27
  () => m.campaigns.point.filter(
19
- (e) => !l.value.location || !e.targetLocation || e.targetLocation.includes(l.value.location)
28
+ (e) => !i.value.location || !e.targetLocation || e.targetLocation.includes(i.value.location)
20
29
  )
21
- ), K = [
30
+ ), N = [
22
31
  {
23
32
  header: s("connect.program.common.table.title"),
24
33
  accessorFn: (e) => e.name
@@ -36,7 +45,7 @@ const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-60
36
45
  {
37
46
  header: s("connect.program.common.table.actions"),
38
47
  cell(e) {
39
- return A(oe.FmButton, {
48
+ return E(J.FmButton, {
40
49
  variant: "tertiary",
41
50
  icon: "delete",
42
51
  iconColor: "neutral-gray-400",
@@ -46,9 +55,9 @@ const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-60
46
55
  });
47
56
  }
48
57
  }
49
- ], C = V();
58
+ ], v = V();
50
59
  async function F(e) {
51
- await W.remove(`Are you sure you want to remove ${e.name}?`) && await x(
60
+ await Q.remove(`Are you sure you want to remove ${e.name}?`) && await C(
52
61
  async () => {
53
62
  await _.delete(e._id), await m.read("COIN");
54
63
  },
@@ -58,13 +67,13 @@ const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-60
58
67
  }
59
68
  );
60
69
  }
61
- async function y(e) {
70
+ async function f(e) {
62
71
  e ? await o() : $.open(async (p) => {
63
72
  await o(p);
64
73
  });
65
74
  async function o(p) {
66
- var f;
67
- (f = C.value) == null || f.showSheet(
75
+ var y;
76
+ (y = v.value) == null || y.showSheet(
68
77
  !0,
69
78
  "COIN",
70
79
  e ? await _.readById(e._id) : void 0,
@@ -73,7 +82,7 @@ const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-60
73
82
  }
74
83
  }
75
84
  async function R(e) {
76
- await x(
85
+ await C(
77
86
  async () => {
78
87
  e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await m.read("COIN");
79
88
  },
@@ -83,86 +92,86 @@ const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-60
83
92
  }
84
93
  );
85
94
  }
86
- return E(async () => {
87
- await N(async () => {
95
+ return M(async () => {
96
+ await K(async () => {
88
97
  await m.read("COIN");
89
98
  });
90
99
  }), (e, o) => {
91
- const p = r("FmPill"), f = r("FmPageHead"), k = r("FmSearch"), O = r("FmTable"), S = r("FmButton"), U = r("FmListItem"), j = r("FmList"), D = r("FmCard");
92
- return d(), h(w, null, [
93
- i(f, {
100
+ const p = l("FmPill"), y = l("FmPageHead"), k = l("FmSearch"), O = l("FmTable"), S = l("FmButton"), U = l("FmListItem"), D = l("FmList"), T = l("FmCard");
101
+ return d(), h(b, null, [
102
+ r(y, {
94
103
  title: t(s)("connect.program.point.title"),
95
104
  actions: t(u).length > 0 ? [B] : [],
96
- "onClick:action": o[0] || (o[0] = () => y())
105
+ "onClick:action": o[0] || (o[0] = () => f())
97
106
  }, {
98
107
  title: g(() => [
99
108
  n("div", ae, [
100
109
  n("span", ne, c(t(s)("connect.program.point.title")), 1),
101
- i(p, { variant: "premium" })
110
+ r(p, { variant: "premium" })
102
111
  ])
103
112
  ]),
104
113
  _: 1
105
114
  }, 8, ["title", "actions"]),
106
115
  n("div", se, [
107
- i(k, {
108
- modelValue: t(l).searchKey,
109
- "onUpdate:modelValue": o[1] || (o[1] = (a) => t(l).searchKey = a),
116
+ r(k, {
117
+ modelValue: t(i).searchKey,
118
+ "onUpdate:modelValue": o[1] || (o[1] = (a) => t(i).searchKey = a),
110
119
  class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
111
120
  placeholder: "search",
112
121
  collapsible: ""
113
122
  }, null, 8, ["modelValue"]),
114
- t(m).campaigns.point && t(m).campaigns.point.length > 0 ? (d(), h(w, { key: 0 }, [
115
- n("div", le, [
116
- n("div", ie, [
117
- i(X, {
118
- modelValue: t(l).location,
119
- "onUpdate:modelValue": o[2] || (o[2] = (a) => t(l).location = a),
123
+ t(m).campaigns.point && t(m).campaigns.point.length > 0 ? (d(), h(b, { key: 0 }, [
124
+ n("div", ie, [
125
+ n("div", re, [
126
+ r(Z, {
127
+ modelValue: t(i).location,
128
+ "onUpdate:modelValue": o[2] || (o[2] = (a) => t(i).location = a),
120
129
  label: "Location: ",
121
130
  "show-item-label": !0,
122
131
  icon: "storefront",
123
132
  placement: "bottom-start",
124
- items: t(v).locationItems
133
+ items: t(x).locationItems
125
134
  }, null, 8, ["modelValue", "items"])
126
135
  ]),
127
- i(k, {
128
- modelValue: t(l).searchKey,
129
- "onUpdate:modelValue": o[3] || (o[3] = (a) => t(l).searchKey = a),
136
+ r(k, {
137
+ modelValue: t(i).searchKey,
138
+ "onUpdate:modelValue": o[3] || (o[3] = (a) => t(i).searchKey = a),
130
139
  class: "xs:hidden",
131
140
  placeholder: "search",
132
141
  collapsible: ""
133
142
  }, null, 8, ["modelValue"])
134
143
  ]),
135
- i(O, {
144
+ r(O, {
136
145
  class: "xs:hidden",
137
146
  "row-data": t(u),
138
- "column-defs": K,
139
- "search-value": t(l).searchKey,
147
+ "column-defs": N,
148
+ "search-value": t(i).searchKey,
140
149
  "column-filter": [],
141
- onRowClick: o[4] || (o[4] = (a) => y(a.original)),
150
+ onRowClick: o[4] || (o[4] = (a) => f(a.original)),
142
151
  "hide-footer": t(u).length < 10
143
152
  }, null, 8, ["row-data", "search-value", "hide-footer"]),
144
- i(j, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
153
+ r(D, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
145
154
  default: g(() => [
146
- (d(!0), h(w, null, H(t(u).filter(
147
- (a) => a.name.toLowerCase().includes(t(l).searchKey.toLowerCase())
148
- ), (a) => (d(), b(U, {
155
+ (d(!0), h(b, null, H(t(u).filter(
156
+ (a) => a.name.toLowerCase().includes(t(i).searchKey.toLowerCase())
157
+ ), (a) => (d(), w(U, {
149
158
  key: a._id.toString(),
150
- onClick: (L) => y(a),
159
+ onClick: (L) => f(a),
151
160
  class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
152
161
  }, {
153
162
  default: g(() => [
154
- n("div", re, [
163
+ n("div", le, [
155
164
  n("div", ce, [
156
- (d(), b(q(t(I)(a)))),
165
+ (d(), w(q(t(I)(a)))),
157
166
  n("div", me, c(t(s)("program.point.used", { count: a.currentReceive ?? 0 })), 1)
158
167
  ]),
159
168
  n("div", de, [
160
169
  n("div", pe, c(a.name), 1),
161
170
  n("div", ue, c(t(P)(a)), 1)
162
171
  ]),
163
- n("div", ye, " Point received: " + c(a.currentReceive ?? 0), 1)
172
+ n("div", fe, " Point received: " + c(a.currentReceive ?? 0), 1)
164
173
  ]),
165
- i(S, {
174
+ r(S, {
166
175
  icon: "delete",
167
176
  "icon-color": "neutral-gray-400",
168
177
  variant: "tertiary",
@@ -174,33 +183,33 @@ const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-60
174
183
  ]),
175
184
  _: 1
176
185
  })
177
- ], 64)) : (d(), b(D, {
186
+ ], 64)) : (d(), w(T, {
178
187
  key: 1,
179
188
  variant: "outlined",
180
189
  class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
181
190
  }, {
182
191
  default: g(() => [
183
192
  o[6] || (o[6] = n("img", {
184
- src: Y,
193
+ src: z,
185
194
  class: "aspect-square w-[150px]"
186
195
  }, null, -1)),
187
- n("div", fe, [
196
+ n("div", ye, [
188
197
  n("div", ge, c(t(s)("connect.program.point.empty_state.title")), 1),
189
198
  n("div", _e, c(t(s)("connect.program.point.empty_state.description")), 1)
190
199
  ]),
191
- i(S, {
200
+ r(S, {
192
201
  variant: "primary",
193
202
  label: "Create point program",
194
- disabled: !t(v).isPremium,
203
+ disabled: !t(x).isPremium,
195
204
  icon: "add",
196
- onClick: o[5] || (o[5] = (a) => y())
205
+ onClick: o[5] || (o[5] = (a) => f())
197
206
  }, null, 8, ["disabled"])
198
207
  ]),
199
208
  _: 1
200
209
  })),
201
- i(Z, {
210
+ r(ee, {
202
211
  ref_key: "sheetRef",
203
- ref: C,
212
+ ref: v,
204
213
  "onSubmit:modelValue": R
205
214
  }, null, 512)
206
215
  ])
@@ -209,5 +218,5 @@ const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-60
209
218
  }
210
219
  });
211
220
  export {
212
- xe as default
221
+ Be as default
213
222
  };
@@ -0,0 +1,221 @@
1
+ import { defineComponent as j, ref as O, computed as E, h as A, onMounted as H, resolveComponent as r, openBlock as m, createElementBlock as _, Fragment as h, createVNode as l, unref as a, createElementVNode as s, withCtx as v, renderList as q, createBlock as w, resolveDynamicComponent as z, toDisplayString as y } from "vue";
2
+ import { _ as G } from "./campaign-CpzFl8Vr.js";
3
+ import { useDialog as J, components as Q } from "@feedmepos/ui-library";
4
+ import { c as P, p as W, u as X } from "./loading-uCNeZibp.js";
5
+ import { u as Y } from "./business-CXyP9G7A.js";
6
+ import { u as Z } from "./campaign-0aM2KYOy.js";
7
+ import { u as ee } from "./vue-i18n-AtGIa4qH.js";
8
+ import { g as V } from "./dto-BiYLkVdL.js";
9
+ import { e as I } from "./effect-Cg-eNEjg.js";
10
+ import { _ as oe } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
11
+ import { _ as te } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-C1ZXQski.js";
12
+ import { u as ne } from "./template-1o0LbOoJ.js";
13
+ import { c as g } from "./index-CDMC-8iO.js";
14
+ const ae = { class: "px-24 flex flex-col gap-y-16" }, se = { class: "flex items-center justify-between w-full" }, ie = { class: "flex gap-8 overflow-x-auto" }, le = { class: "space-y-8" }, re = { class: "flex w-full gap-4 items-center" }, ce = { class: "space-y-4" }, me = { class: "fm-typo-en-body-lg-600" }, pe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, de = { class: "flex flex-col gap-16 text-center" }, ue = { class: "fm-typo-en-title-sm-800" }, fe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ve = /* @__PURE__ */ j({
15
+ __name: "Promotion",
16
+ setup(ye) {
17
+ const { t: n } = ee(), L = {
18
+ label: n("connect.promotion.createCampaign"),
19
+ value: "create",
20
+ isPrimary: !0,
21
+ prependIcon: "add"
22
+ }, T = ne("PROMOTION", J()), x = Y(), u = Z(), { global: B, minor: b } = X, i = O({
23
+ searchKey: "",
24
+ location: null
25
+ }), c = E(
26
+ () => u.campaigns.promotion.filter(
27
+ (e) => !i.value.location || !e.targetLocation || e.targetLocation.includes(i.value.location)
28
+ )
29
+ ), R = [
30
+ {
31
+ header: n("connect.promotion.promotionTitle"),
32
+ accessorFn: (e) => e.name
33
+ },
34
+ {
35
+ header: n("connect.promotion.status"),
36
+ cell(e) {
37
+ return V(e.row.original);
38
+ }
39
+ },
40
+ {
41
+ header: n("connect.promotion.type"),
42
+ accessorFn: (e) => `${P.title(e.effect.options.target)} promotion`
43
+ },
44
+ {
45
+ header: n("connect.promotion.summary"),
46
+ accessorFn: (e) => I(e.effect)
47
+ },
48
+ {
49
+ header: n("connect.promotion.actions"),
50
+ cell(e) {
51
+ return A(Q.FmButton, {
52
+ variant: "tertiary",
53
+ icon: "delete",
54
+ iconColor: "neutral-gray-400",
55
+ onClick: (o) => {
56
+ o.stopPropagation(), F(e.row.original);
57
+ }
58
+ });
59
+ }
60
+ }
61
+ ], C = O();
62
+ async function F(e) {
63
+ await W.remove(n("promotion.confirmRemove", { name: e.name })) && await b(
64
+ async () => {
65
+ await g.delete(e._id), await u.read("PROMOTION");
66
+ },
67
+ {
68
+ message: n("promotion.removing", { name: e.name }),
69
+ successMessage: n("promotion.removedSuccessfully", { name: e.name })
70
+ }
71
+ );
72
+ }
73
+ async function f(e) {
74
+ e ? await o() : T.open(async (p) => {
75
+ await o(p);
76
+ });
77
+ async function o(p) {
78
+ var d;
79
+ (d = C.value) == null || d.showSheet(
80
+ !0,
81
+ "PROMOTION",
82
+ e ? await g.readById(e._id) : void 0,
83
+ p
84
+ );
85
+ }
86
+ }
87
+ async function M(e) {
88
+ await b(
89
+ async () => {
90
+ e.campaign._id ? await g.update(e.campaign._id, e) : await g.create(e), await u.read("PROMOTION");
91
+ },
92
+ {
93
+ message: n(e.campaign._id ? "promotion.updating" : "promotion.creating"),
94
+ successMessage: n(
95
+ e.campaign._id ? "promotion.updatedSuccessfully" : "promotion.createdSuccessfully"
96
+ )
97
+ }
98
+ );
99
+ }
100
+ return H(async () => {
101
+ await B(async () => {
102
+ await x.readLocations(), await u.read("PROMOTION");
103
+ });
104
+ }), (e, o) => {
105
+ const p = r("FmPageHead"), d = r("FmSearch"), K = r("FmTable"), N = r("FmChip"), k = r("FmButton"), $ = r("FmListItem"), D = r("FmList"), U = r("FmCard");
106
+ return m(), _(h, null, [
107
+ l(p, {
108
+ title: a(n)("connect.promotion.title"),
109
+ actions: a(c).length > 0 ? [L] : [],
110
+ "onClick:action": o[0] || (o[0] = (t) => f())
111
+ }, null, 8, ["title", "actions"]),
112
+ s("div", ae, [
113
+ l(d, {
114
+ modelValue: i.value.searchKey,
115
+ "onUpdate:modelValue": o[1] || (o[1] = (t) => i.value.searchKey = t),
116
+ class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
117
+ placeholder: a(n)("connect.promotion.search"),
118
+ collapsible: ""
119
+ }, null, 8, ["modelValue", "placeholder"]),
120
+ a(c) && a(c).length > 0 ? (m(), _(h, { key: 0 }, [
121
+ s("div", se, [
122
+ s("div", ie, [
123
+ l(oe, {
124
+ modelValue: i.value.location,
125
+ "onUpdate:modelValue": o[2] || (o[2] = (t) => i.value.location = t),
126
+ label: a(n)("connect.promotion.location"),
127
+ "show-item-label": !0,
128
+ icon: "storefront",
129
+ placement: "bottom-start",
130
+ items: a(x).locationItems
131
+ }, null, 8, ["modelValue", "label", "items"])
132
+ ]),
133
+ l(d, {
134
+ modelValue: i.value.searchKey,
135
+ "onUpdate:modelValue": o[3] || (o[3] = (t) => i.value.searchKey = t),
136
+ class: "xs:hidden",
137
+ placeholder: "search",
138
+ collapsible: ""
139
+ }, null, 8, ["modelValue"])
140
+ ]),
141
+ l(K, {
142
+ class: "xs:hidden",
143
+ "row-data": a(c),
144
+ "column-defs": R,
145
+ "search-value": i.value.searchKey,
146
+ "column-filter": [],
147
+ onRowClick: o[4] || (o[4] = (t) => f(t.original)),
148
+ "hide-footer": a(c).length < 10
149
+ }, null, 8, ["row-data", "search-value", "hide-footer"]),
150
+ l(D, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
151
+ default: v(() => [
152
+ (m(!0), _(h, null, q(a(c).filter(
153
+ (t) => t.name.toLowerCase().includes(i.value.searchKey.toLowerCase())
154
+ ), (t) => (m(), w($, {
155
+ key: t._id.toString(),
156
+ onClick: (S) => f(t),
157
+ class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
158
+ }, {
159
+ default: v(() => [
160
+ s("div", le, [
161
+ s("div", re, [
162
+ (m(), w(z(a(V)(t)))),
163
+ l(N, {
164
+ class: "!text-fm-color-typo-info !bg-fm-color-system-info-100",
165
+ compact: !0,
166
+ label: `${a(P).title(t.effect.options.target)} promotion`
167
+ }, null, 8, ["label"])
168
+ ]),
169
+ s("div", ce, [
170
+ s("div", me, y(t.name), 1),
171
+ s("div", pe, y(a(I)(t.effect)), 1)
172
+ ])
173
+ ]),
174
+ l(k, {
175
+ icon: "delete",
176
+ "icon-color": "neutral-gray-400",
177
+ variant: "tertiary",
178
+ onClick: (S) => (S.stopPropagation(), F(t))
179
+ }, null, 8, ["onClick"])
180
+ ]),
181
+ _: 2
182
+ }, 1032, ["onClick"]))), 128))
183
+ ]),
184
+ _: 1
185
+ })
186
+ ], 64)) : (m(), w(U, {
187
+ key: 1,
188
+ variant: "outlined",
189
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
190
+ }, {
191
+ default: v(() => [
192
+ o[6] || (o[6] = s("img", {
193
+ src: G,
194
+ class: "aspect-square w-[150px]"
195
+ }, null, -1)),
196
+ s("div", de, [
197
+ s("div", ue, y(a(n)("connect.promotion.createPromotionCampaign")), 1),
198
+ s("div", fe, y(a(n)("connect.promotion.description")), 1)
199
+ ]),
200
+ l(k, {
201
+ variant: "primary",
202
+ label: a(n)("connect.promotion.createPromotionCampaign"),
203
+ icon: "add",
204
+ onClick: o[5] || (o[5] = (t) => f())
205
+ }, null, 8, ["label"])
206
+ ]),
207
+ _: 1
208
+ }))
209
+ ]),
210
+ l(te, {
211
+ ref_key: "sheetRef",
212
+ ref: C,
213
+ "onSubmit:modelValue": M
214
+ }, null, 512)
215
+ ], 64);
216
+ };
217
+ }
218
+ });
219
+ export {
220
+ Ve as default
221
+ };