@feedmepos/mf-connect 0.0.29-prod → 0.0.30-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 (64) hide show
  1. package/dist/{Analytic-DJ-UTtiV.js → Analytic-CMw4c42B.js} +8 -8
  2. package/dist/{App-B-ij2-GO.js → App-DgQEvhoW.js} +5 -5
  3. package/dist/{Broadcast-DCLDNXe8.js → Broadcast-DZ0QPkD7.js} +7 -7
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DYOT7xYX.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DjbB5yP1.js} +8 -8
  5. package/dist/{Card-CG5G40Vp.js → Card-DLS4WEBw.js} +14 -14
  6. package/dist/{Collections-BK5OCFmV.js → Collections-CtAWEIcO.js} +137 -138
  7. package/dist/{Credit-DtWtjcY5.js → Credit-D7pQXqEt.js} +7 -7
  8. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-CHWjGCfK.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BXz2IKaK.js} +21 -21
  9. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CJhThJyI.js → EffectSheet.vue_vue_type_style_index_0_lang-Cw-KLvgf.js} +5 -5
  10. package/dist/{Experience-DiqXLTfZ.js → Experience-_UabVSY7.js} +7 -7
  11. package/dist/{Game-Ck07nRlj.js → Game-CHMBITlG.js} +7 -7
  12. package/dist/{Marketing-Dkc_dgEh.js → Marketing-BHv9eyo6.js} +4 -4
  13. package/dist/{Member-CBoWAo_L.js → Member-BkqNzcG3.js} +3 -3
  14. package/dist/{MemberList-DejEibQF.js → MemberList-FfxRRSLP.js} +76 -76
  15. package/dist/{MemberTransactions-CCU4kjLL.js → MemberTransactions-DvCtHUkt.js} +1 -1
  16. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CQVMVBFm.js → MessageInput.vue_vue_type_script_setup_true_lang-MaCtf4Xn.js} +2 -2
  17. package/dist/{Mission-DUsHF7uk.js → Mission-OrOKxoPz.js} +7 -7
  18. package/dist/{Point-Dmwmmrdy.js → Point-CTKv_6wI.js} +7 -7
  19. package/dist/{Promotion-BSNYSpyF.js → Promotion-D3pQZxX7.js} +8 -8
  20. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CAXCcGhs.js → RuleGroup.vue_vue_type_script_setup_true_lang-CE9TmOhA.js} +14 -14
  21. package/dist/Segment-DSX0DD-P.js +434 -0
  22. package/dist/{Setting-CMqzRvP-.js → Setting-CzxXS6LJ.js} +7 -7
  23. package/dist/{Store-JsTz1MrB.js → Store-BfiGvIid.js} +11 -11
  24. package/dist/{StoreRewards-CFllr09Q.js → StoreRewards-Bm39d1Cc.js} +10 -10
  25. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CHVFEK2H.js +890 -0
  26. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-CBX85H29.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DdtJ3kNK.js} +1 -1
  27. package/dist/{Tier-DhTWLoSx.js → Tier-BP44jWgR.js} +13 -13
  28. package/dist/{Title-XhAk7PNQ.js → Title-Ct8QWL2Q.js} +13 -13
  29. package/dist/{Transaction-ABXPecsn.js → Transaction-RP2dj85O.js} +1 -1
  30. package/dist/{Voucher-COTOv2Wq.js → Voucher-BQ6Kq-jX.js} +10 -10
  31. package/dist/{app-Tt2fDVO6.js → app-Bzct9xVo.js} +24 -24
  32. package/dist/{app-DEZUzYqn.js → app-DiKC7FId.js} +1 -1
  33. package/dist/app.js +1 -1
  34. package/dist/{business-fj0Ugyb2.js → business-iGcoCCSb.js} +1 -1
  35. package/dist/{campaign-Ci7cfZwO.js → campaign-DeEhf0-p.js} +2 -2
  36. package/dist/{collection.fn-BH_G6Px3.js → collection.fn-DV5EnxQc.js} +2 -2
  37. package/dist/{dto-Bo3TYJ9r.js → dto-D27dJqWy.js} +41 -41
  38. package/dist/{effect-C6exjgLM.js → effect-cdw61g2Y.js} +1 -1
  39. package/dist/{export-DWglS9JA.js → export-CLtQanYU.js} +3 -3
  40. package/dist/{helper-ClUCbFNC.js → helper-O1xiribY.js} +1 -1
  41. package/dist/{index-Bx6_rQs0.js → index-3_r2IGAF.js} +2 -2
  42. package/dist/{index-Cwv5Rfus.js → index-Bpb0PhDQ.js} +1 -1
  43. package/dist/{index-ovLB0H57.js → index-BzFp6WIZ.js} +1 -1
  44. package/dist/{index-BsejuiEk.js → index-C6kizPcL.js} +1 -1
  45. package/dist/{index-APrWjTds.js → index-C9iPmltA.js} +1 -1
  46. package/dist/{index-B63sWaxR.js → index-DG0RrwCN.js} +5 -5
  47. package/dist/{index-fjxLfwPv.js → index-DLxzqdlK.js} +3 -3
  48. package/dist/{index-DezrfzkP.js → index-DOMUfanW.js} +5 -5
  49. package/dist/{index-CdDf5vB8.js → index-PO2CtKXo.js} +1 -1
  50. package/dist/{index-CV8UD7h6.js → index-X-EzXcGs.js} +3 -3
  51. package/dist/{index-DsY6eQTm.js → index-dbSbwT_z.js} +1 -1
  52. package/dist/{index-B0h5tGCw.js → index-rOKsnWx1.js} +16 -14
  53. package/dist/{index.esm2017-C84qCgz0.js → index.esm2017-Dp0jAeUG.js} +1 -1
  54. package/dist/{loading-ZZmUDFSc.js → loading-C7oH4e0j.js} +4 -4
  55. package/dist/{membership-CFGK_1YX.js → membership-D0G_5G-y.js} +3 -3
  56. package/dist/{money-DlPkRzWe.js → money-B6MghTDE.js} +1 -1
  57. package/dist/{number-BiaTakcy.js → number-qKhyhzHd.js} +1 -1
  58. package/dist/{rule-C_TXLhDT.js → rule-BIAblb97.js} +2 -2
  59. package/dist/{rule-builder-Dqu1fPCV.js → rule-builder-JAqgqMza.js} +1 -1
  60. package/dist/{template-BSIh7r7g.js → template-0FGOnSoC.js} +4 -4
  61. package/dist/{xlsx-0lG2XrUi.js → xlsx-DD6vbwKN.js} +1 -1
  62. package/package.json +1 -1
  63. package/dist/Segment-C5bKCywo.js +0 -445
  64. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-DrbzXmHf.js +0 -818
@@ -1,22 +1,22 @@
1
1
  import { defineComponent as $, computed as I, resolveComponent as g, openBlock as n, createElementBlock as F, createElementVNode as C, createVNode as y, unref as e, createTextVNode as ee, toDisplayString as j, withCtx as M, onMounted as K, createBlock as h, createCommentVNode as A, ref as P, Fragment as Y, renderList as N, normalizeClass as L, watch as ie, resolveDynamicComponent as ae, onBeforeMount as ue, isRef as me, createSlots as de } from "vue";
2
- import { c as pe, C as ce, d as ye, e as ve, f as fe } from "./index-BsejuiEk.js";
3
- import { R as _, a as be } from "./rule-builder-Dqu1fPCV.js";
4
- import { a as ge, R, S as ke, C as H, W as Ve, T as ne, O as Ee } from "./rule-C_TXLhDT.js";
5
- import { p as Fe } from "./loading-ZZmUDFSc.js";
2
+ import { c as pe, C as ce, d as ye, e as ve, f as fe } from "./index-C6kizPcL.js";
3
+ import { R as _, a as be } from "./rule-builder-JAqgqMza.js";
4
+ import { a as ge, R, S as ke, C as H, W as Ve, T as ne, O as Ee } from "./rule-BIAblb97.js";
5
+ import { p as Fe } from "./loading-C7oH4e0j.js";
6
6
  import { useDialog as te, useDialogChild as se } from "@feedmepos/ui-library";
7
7
  import { h as J } from "./moment-BWErdI6_.js";
8
- import { z as Se } from "./app-Tt2fDVO6.js";
9
- import { u as z } from "./membership-CFGK_1YX.js";
10
- import { u as re } from "./business-fj0Ugyb2.js";
11
- import { _ as D } from "./index-DezrfzkP.js";
8
+ import { z as Se } from "./app-Bzct9xVo.js";
9
+ import { u as z } from "./membership-D0G_5G-y.js";
10
+ import { u as re } from "./business-iGcoCCSb.js";
11
+ import { _ as D } from "./index-DOMUfanW.js";
12
12
  import { c as le } from "./object-qECH92oz.js";
13
13
  import { Z } from "./ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js";
14
- import { x as he } from "./app-DEZUzYqn.js";
15
- import "./index-B0h5tGCw.js";
16
- import "./index-B63sWaxR.js";
17
- import "./index-fjxLfwPv.js";
18
- import "./index-Bx6_rQs0.js";
19
- import "./index-APrWjTds.js";
14
+ import { x as he } from "./app-DiKC7FId.js";
15
+ import "./index-rOKsnWx1.js";
16
+ import "./index-DG0RrwCN.js";
17
+ import "./index-DLxzqdlK.js";
18
+ import "./index-3_r2IGAF.js";
19
+ import "./index-C9iPmltA.js";
20
20
  const xe = { class: "flex items-center justify-between" }, Te = { class: "flex items-center gap-8 xs:flex-wrap" }, Ce = /* @__PURE__ */ C("div", { class: "h-[26px] border-l-2 rounded-md border-fm-color-neutral-gray-100" }, null, -1), Ue = { class: "text-fm-color-primary line-clamp-1 text-ellipsis" }, Re = /* @__PURE__ */ $({
21
21
  __name: "RuleEntry",
22
22
  props: {
@@ -0,0 +1,434 @@
1
+ import { defineComponent as A, onMounted as E, openBlock as c, createElementBlock as b, createElementVNode as o, toDisplayString as M, unref as e, createVNode as i, createCommentVNode as G, ref as I, computed as j, resolveComponent as p, createBlock as B, isRef as J, createSlots as W, withCtx as _, Fragment as P, onBeforeMount as K, renderList as Q, h as R } from "vue";
2
+ import { _ as X } from "./campaign-CpzFl8Vr.js";
3
+ import { F as U, p as ee, u as te } from "./loading-C7oH4e0j.js";
4
+ import { components as L } from "@feedmepos/ui-library";
5
+ import { u as H, _ as O } from "./usePagination-JoYaROkV.js";
6
+ import { _ as oe, Z as ne } from "./ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js";
7
+ import { a as ae } from "./index-DLxzqdlK.js";
8
+ import { u as se } from "./app-wDQR6dpb.js";
9
+ import { R as ie } from "./rule-builder-JAqgqMza.js";
10
+ import { _ as le } from "./RuleGroup.vue_vue_type_script_setup_true_lang-CE9TmOhA.js";
11
+ import { h as V } from "./moment-BWErdI6_.js";
12
+ import { s as C } from "./membership-D0G_5G-y.js";
13
+ import { o as re } from "./objectId-dwaoBfJX.js";
14
+ import { u as me } from "./business-iGcoCCSb.js";
15
+ const de = ae.extend({
16
+ _id: U.optional(),
17
+ business: U.optional()
18
+ }), ce = { class: "space-y-16 pr-12" }, ue = { class: "fm-typo-en-title-md-800" }, pe = { class: "flex space-x-8" }, ge = { class: "fm-typo-en-title-md-800 text-fm-color-primary" }, fe = { class: "text-fm-color-typo-secondary" }, _e = /* @__PURE__ */ o("div", null, "contacts in your segment", -1), ye = {
19
+ key: 0,
20
+ class: "w-full flex flex-col gap-16 items-center pt-16"
21
+ }, ve = /* @__PURE__ */ o("div", { class: "fm-typo-en-body-lg-600" }, "No data found", -1), he = /* @__PURE__ */ o("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " No data to show at the current moment. ", -1), Se = [
22
+ ve,
23
+ he
24
+ ], be = /* @__PURE__ */ A({
25
+ __name: "ReviewSegment",
26
+ props: {
27
+ title: {},
28
+ segment: {}
29
+ },
30
+ setup(D) {
31
+ const y = D, x = [
32
+ {
33
+ header: "Name",
34
+ accessorFn: (n) => n.name
35
+ },
36
+ {
37
+ header: "Id",
38
+ accessorFn: (n) => n._id
39
+ },
40
+ {
41
+ header: "Customer Since",
42
+ accessorFn: (n) => V(re(n._id.toString())).format("DD MMM YYYY")
43
+ },
44
+ {
45
+ header: "Phone",
46
+ accessorFn: (n) => n.phoneNumber
47
+ },
48
+ {
49
+ header: "Birthday",
50
+ accessorFn: (n) => V(n.birthday).format("DD MMM YYYY")
51
+ },
52
+ {
53
+ header: "Last Visit",
54
+ accessorFn: (n) => V(n.stats.lastVisit).format("DD MMM YYYY")
55
+ }
56
+ ], v = async (n) => y.segment._id ? await C.paginateSegmentUsers(y.segment._id, {
57
+ limit: r.value.pageSize,
58
+ skip: n.pageIndex ?? 0,
59
+ sortBy: "_id",
60
+ search: n.searchValue,
61
+ descending: !0
62
+ }) : { resources: [], meta: { totalResources: 0, totalPages: 0 } }, { tableMeta: r, rowData: m, onSort: d, debouncedFetchData: g, onSearch: a } = H(v);
63
+ return E(async () => {
64
+ await g();
65
+ }), (n, w) => (c(), b("div", ce, [
66
+ o("div", ue, M(y.title), 1),
67
+ o("div", pe, [
68
+ o("div", ge, M(n.segment.members.length), 1),
69
+ o("div", fe, [
70
+ _e,
71
+ o("div", null, "as of " + M(e(V)(n.segment.lastUpdated).format("DD MMM YYYY")), 1)
72
+ ])
73
+ ]),
74
+ i(O, {
75
+ loading: e(r).isLoading,
76
+ "row-data": e(m),
77
+ "row-count": e(r).totalRows,
78
+ "column-defs": x,
79
+ "page-size": e(r).pageSize,
80
+ "page-count": e(r).pageCount,
81
+ "page-index": e(r).pageIndex,
82
+ onSortChange: e(d),
83
+ onPageChange: w[0] || (w[0] = (F) => e(g)({ pageSize: F.pageSize, pageIndex: F.pageIndex }))
84
+ }, null, 8, ["loading", "row-data", "row-count", "page-size", "page-count", "page-index", "onSortChange"]),
85
+ e(m).length == 0 ? (c(), b("div", ye, Se)) : G("", !0)
86
+ ]));
87
+ }
88
+ }), xe = { class: "flex items-center gap-x-8" }, we = /* @__PURE__ */ o("div", null, "Review segment", -1), Fe = {
89
+ key: 0,
90
+ class: "space-y-16 pr-12"
91
+ }, Ce = /* @__PURE__ */ o("div", { class: "fm-typo-en-title-sm-800" }, "Segment Filter", -1), ke = { class: "flex items-center gap-8" }, Me = /* @__PURE__ */ A({
92
+ __name: "SegmentSheet",
93
+ emits: ["update:model-value"],
94
+ setup(D, { expose: y, emit: x }) {
95
+ const v = se(), r = I(!1), m = I(!1), d = {
96
+ name: "",
97
+ rule: ie.scaffoldGroup(),
98
+ members: []
99
+ }, g = de, a = I(d), n = j(() => {
100
+ const f = g.safeParse(a.value);
101
+ return f.success ? [] : f.error.errors;
102
+ });
103
+ function w(f) {
104
+ r.value = !0, m.value = !1, f ? a.value = { ...f } : a.value = { ...d };
105
+ }
106
+ function F() {
107
+ r.value = !1;
108
+ }
109
+ async function k() {
110
+ g.safeParse(a.value).success && (m.value = !0);
111
+ }
112
+ function Y() {
113
+ m.value = !1;
114
+ }
115
+ async function t() {
116
+ s("update:model-value", a.value);
117
+ }
118
+ E(async () => {
119
+ });
120
+ const s = x;
121
+ return y({
122
+ showSheet: w,
123
+ hideSheet: F
124
+ }), (f, l) => {
125
+ const h = p("FmButton"), z = p("FmSideSheet");
126
+ return c(), B(z, {
127
+ modelValue: e(r),
128
+ "onUpdate:modelValue": l[5] || (l[5] = (S) => J(r) ? r.value = S : null),
129
+ header: "Add segment",
130
+ "dismiss-away": "",
131
+ "close-button": !0,
132
+ "max-width": 1100
133
+ }, W({
134
+ "side-sheet-footer": _(() => [
135
+ o("div", ke, [
136
+ e(m) ? (c(), b(P, { key: 0 }, [
137
+ i(h, {
138
+ label: "Save Segment",
139
+ onClick: t,
140
+ loading: e(v).isLoading,
141
+ disabled: e(n).length > 0 || e(v).isLoading
142
+ }, null, 8, ["loading", "disabled"]),
143
+ i(h, {
144
+ label: "Cancel",
145
+ onClick: l[3] || (l[3] = (S) => Y()),
146
+ variant: "tertiary"
147
+ })
148
+ ], 64)) : (c(), b(P, { key: 1 }, [
149
+ i(h, {
150
+ label: "Review Segment",
151
+ disabled: e(n).length > 0 || e(v).isLoading,
152
+ onClick: k
153
+ }, null, 8, ["disabled"]),
154
+ i(h, {
155
+ label: "Cancel",
156
+ onClick: l[4] || (l[4] = (S) => F()),
157
+ variant: "tertiary"
158
+ })
159
+ ], 64))
160
+ ])
161
+ ]),
162
+ default: _(() => {
163
+ var S;
164
+ return [
165
+ e(m) ? (c(), B(be, {
166
+ key: 1,
167
+ title: e(a).name,
168
+ segment: e(a)
169
+ }, null, 8, ["title", "segment"])) : (c(), b("div", Fe, [
170
+ i(oe, {
171
+ modelValue: e(a).name,
172
+ "onUpdate:modelValue": l[1] || (l[1] = ($) => e(a).name = $),
173
+ label: "Segment title",
174
+ schema: e(ne).typeAtPath(e(g), "name")
175
+ }, null, 8, ["modelValue", "schema"]),
176
+ Ce,
177
+ i(le, {
178
+ "trigger-type": "MEMBERSHIP_JOINED",
179
+ includeOnly: "user",
180
+ "model-value": (S = e(a)) == null ? void 0 : S.rule,
181
+ "onUpdate:modelValue": l[2] || (l[2] = ($) => {
182
+ e(a).rule = $;
183
+ })
184
+ }, null, 8, ["model-value"])
185
+ ]))
186
+ ];
187
+ }),
188
+ _: 2
189
+ }, [
190
+ e(m) ? {
191
+ name: "side-sheet-header",
192
+ fn: _(() => [
193
+ o("div", xe, [
194
+ i(h, {
195
+ icon: "arrow_back",
196
+ variant: "tertiary",
197
+ onClick: l[0] || (l[0] = (S) => m.value = !1)
198
+ }),
199
+ we
200
+ ])
201
+ ]),
202
+ key: "0"
203
+ } : void 0
204
+ ]), 1032, ["modelValue"]);
205
+ };
206
+ }
207
+ }), $e = { class: "flex items-center" }, Re = /* @__PURE__ */ o("span", { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, " Segments ", -1), Ie = { class: "px-24 flex flex-col gap-y-16" }, Pe = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, Ve = { class: "fm-typo-en-body-md-600" }, Be = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, De = /* @__PURE__ */ o("img", {
208
+ src: X,
209
+ class: "aspect-square w-[150px]"
210
+ }, null, -1), Ye = /* @__PURE__ */ o("div", { class: "flex flex-col gap-16 text-center" }, [
211
+ /* @__PURE__ */ o("div", { class: "fm-typo-en-title-sm-800" }, "Create customer segments"),
212
+ /* @__PURE__ */ o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Segments allow you to categorize your customers based on various criteria, enabling targeted marketing and personalized experiences. ")
213
+ ], -1), We = /* @__PURE__ */ A({
214
+ __name: "Segment",
215
+ setup(D) {
216
+ const { minor: y } = te, x = me(), v = I(0), r = [
217
+ {
218
+ header: "Name",
219
+ accessorFn: (t) => t.name
220
+ },
221
+ {
222
+ header: "Total Customers in this Segment",
223
+ accessorFn: (t) => t.memberCount ?? 0
224
+ },
225
+ {
226
+ header: "% of customers",
227
+ accessorFn: (t) => ((t.memberCount ?? 0) * 100 / v.value).toFixed(2)
228
+ },
229
+ {
230
+ header: "Actions",
231
+ meta: {
232
+ maxWidth: "100px"
233
+ },
234
+ cell(t) {
235
+ return R("div", { class: "flex items-center justify-end" }, [
236
+ R(
237
+ L.FmMenu,
238
+ {
239
+ placement: "bottom-end",
240
+ onClick: (s) => {
241
+ s.stopPropagation();
242
+ }
243
+ },
244
+ {
245
+ "menu-button": () => R(L.FmButton, {
246
+ icon: "more_vert",
247
+ iconColor: "neutral-gray-400",
248
+ variant: "tertiary"
249
+ }),
250
+ default: () => [
251
+ R(
252
+ L.FmMenuItem,
253
+ {
254
+ onClick: async (s) => {
255
+ s.stopPropagation(), w(t.row.original);
256
+ }
257
+ },
258
+ {
259
+ label: R(
260
+ "div",
261
+ {
262
+ class: "text-fm-color-typo-error fm-typo-en-body-md-400"
263
+ },
264
+ "Remove"
265
+ )
266
+ }
267
+ )
268
+ ]
269
+ }
270
+ )
271
+ ]);
272
+ }
273
+ }
274
+ ], m = I(null), { tableMeta: d, rowData: g, debouncedFetchData: a } = H(
275
+ C.readAll
276
+ );
277
+ async function n() {
278
+ await y(
279
+ async () => {
280
+ await C.refreshSegments(), await a({ pageSize: 10, pageIndex: 0 });
281
+ },
282
+ { message: "Refreshing segmentations" }
283
+ );
284
+ }
285
+ async function w(t) {
286
+ await ee.remove(`Are you sure you want to remove ${t.name}?`) && await y(
287
+ async () => {
288
+ await C.delete(t._id), await a({ pageSize: 10, pageIndex: 0 });
289
+ },
290
+ {
291
+ message: `Removing ${t.name}`,
292
+ successMessage: `Removed ${t.name} successfully`
293
+ }
294
+ );
295
+ }
296
+ async function F(t) {
297
+ await y(
298
+ async () => {
299
+ var s;
300
+ if (t._id) {
301
+ const { members: f, _id: l, ...h } = t;
302
+ await C.update(t._id, h);
303
+ } else
304
+ await C.create(t);
305
+ await a({ pageSize: 10, pageIndex: 0 }), (s = m.value) == null || s.hideSheet();
306
+ },
307
+ {
308
+ message: "Saving segment",
309
+ successMessage: "Segment saved"
310
+ }
311
+ );
312
+ }
313
+ function k(t) {
314
+ var s;
315
+ (s = m.value) == null || s.showSheet(t);
316
+ }
317
+ const Y = j(() => x.isPremium ? [
318
+ {
319
+ label: "Refresh segments",
320
+ value: "refresh"
321
+ },
322
+ {
323
+ label: "Add segment",
324
+ value: "add",
325
+ isPrimary: !0,
326
+ prependIcon: "add"
327
+ }
328
+ ] : []);
329
+ return K(async () => {
330
+ const { meta: t } = await C.readAll({
331
+ limit: 1,
332
+ skip: 0,
333
+ sortBy: "_id",
334
+ search: d.value.searchValue,
335
+ descending: !1
336
+ });
337
+ v.value = t.totalResources ?? 0, await a({ pageSize: 10, pageIndex: 0 }), await x.readPremium();
338
+ }), (t, s) => {
339
+ const f = p("FmPill"), l = p("FmPageHead"), h = p("FmIcon"), z = p("FmMenuItem"), S = p("FmMenu"), $ = p("FmListItem"), T = p("FmList"), Z = p("FmButton"), q = p("FmCard");
340
+ return c(), b(P, null, [
341
+ i(l, {
342
+ title: "Segments",
343
+ actions: e(Y),
344
+ "onClick:action": s[0] || (s[0] = (u) => u === "add" ? k() : n())
345
+ }, {
346
+ title: _(() => [
347
+ o("div", $e, [
348
+ Re,
349
+ i(f, { variant: "premium" })
350
+ ])
351
+ ]),
352
+ _: 1
353
+ }, 8, ["actions"]),
354
+ o("div", Ie, [
355
+ e(g).length > 0 || e(d).searchValue || e(d).isLoading ? (c(), b(P, { key: 0 }, [
356
+ i(O, {
357
+ loading: e(d).isLoading,
358
+ "row-data": e(g),
359
+ "row-count": e(d).totalRows,
360
+ "column-defs": r,
361
+ "shrink-at": !1,
362
+ "page-count": e(d).pageCount,
363
+ "page-index": e(d).pageIndex,
364
+ "page-size": e(d).pageSize,
365
+ onRowClick: s[1] || (s[1] = (u) => {
366
+ k(u.original);
367
+ }),
368
+ onPageChange: e(a)
369
+ }, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onPageChange"]),
370
+ i(T, { class: "w-full hidden xs:block" }, {
371
+ default: _(() => [
372
+ (c(!0), b(P, null, Q(e(g), (u) => (c(), B($, {
373
+ key: u._id.toString(),
374
+ tag: "label",
375
+ onClick: (N) => k(u)
376
+ }, {
377
+ default: _(() => [
378
+ o("div", null, [
379
+ o("div", Pe, M((u.memberCount ?? 0).toLocaleString()) + " total customers ", 1),
380
+ o("div", Ve, M(u.name), 1),
381
+ o("div", Be, M(((u.memberCount ?? 0) * 100 / e(v)).toFixed(2)) + "% of customers ", 1)
382
+ ])
383
+ ]),
384
+ append: _(() => [
385
+ i(S, { "stop-click-propagation": !0 }, {
386
+ "menu-button": _(() => [
387
+ i(h, { name: "more_vert" })
388
+ ]),
389
+ default: _(() => [
390
+ i(z, {
391
+ class: "text-fm-color-typo-error fm-typo-en-body-md-400",
392
+ label: "Remove",
393
+ "onUpdate:modelValue": (N) => N && w(u)
394
+ }, null, 8, ["onUpdate:modelValue"])
395
+ ]),
396
+ _: 2
397
+ }, 1024)
398
+ ]),
399
+ _: 2
400
+ }, 1032, ["onClick"]))), 128))
401
+ ]),
402
+ _: 1
403
+ })
404
+ ], 64)) : (c(), B(q, {
405
+ key: 1,
406
+ variant: "outlined",
407
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
408
+ }, {
409
+ default: _(() => [
410
+ De,
411
+ Ye,
412
+ i(Z, {
413
+ variant: "primary",
414
+ label: "Create segment",
415
+ disabled: !e(x).isPremium,
416
+ icon: "add",
417
+ onClick: s[2] || (s[2] = (u) => k())
418
+ }, null, 8, ["disabled"])
419
+ ]),
420
+ _: 1
421
+ })),
422
+ i(Me, {
423
+ ref_key: "sheetRef",
424
+ ref: m,
425
+ "onUpdate:modelValue": F
426
+ }, null, 512)
427
+ ])
428
+ ], 64);
429
+ };
430
+ }
431
+ });
432
+ export {
433
+ We as default
434
+ };
@@ -1,15 +1,15 @@
1
1
  import { defineComponent as Re, ref as z, computed as ie, onMounted as De, resolveComponent as L, openBlock as V, createBlock as we, withCtx as G, createElementVNode as b, createVNode as M, unref as h, isRef as ke, createElementBlock as q, Fragment as fe, createTextVNode as Q, toDisplayString as k, renderList as Ie, createCommentVNode as Pe } from "vue";
2
2
  import { h as rt } from "./moment-BWErdI6_.js";
3
3
  import { useDialog as Ve } from "@feedmepos/ui-library";
4
- import { a as xe, u as it, p as st, f as K } from "./loading-ZZmUDFSc.js";
4
+ import { a as xe, u as it, p as st, f as K } from "./loading-C7oH4e0j.js";
5
5
  import { u as at } from "./app-wDQR6dpb.js";
6
- import { u as be, l as $e } from "./business-fj0Ugyb2.js";
7
- import { u as ze } from "./membership-CFGK_1YX.js";
8
- import { l as lt } from "./index-B63sWaxR.js";
6
+ import { u as be, l as $e } from "./business-iGcoCCSb.js";
7
+ import { u as ze } from "./membership-D0G_5G-y.js";
8
+ import { l as lt } from "./index-DG0RrwCN.js";
9
9
  import { _ as Ne } from "./ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js";
10
- import { _ as ct } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-CBX85H29.js";
11
- import { _ as ut } from "./MessageInput.vue_vue_type_script_setup_true_lang-CQVMVBFm.js";
12
- import { m as dt } from "./index-DsY6eQTm.js";
10
+ import { _ as ct } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-DdtJ3kNK.js";
11
+ import { _ as ut } from "./MessageInput.vue_vue_type_script_setup_true_lang-MaCtf4Xn.js";
12
+ import { m as dt } from "./index-dbSbwT_z.js";
13
13
  import { o as ft } from "./objectId-dwaoBfJX.js";
14
14
  import { a as gt } from "./object-qECH92oz.js";
15
15
  var Z = {}, mt = function() {
@@ -1,25 +1,25 @@
1
1
  import { defineComponent as G, computed as D, resolveComponent as _, openBlock as b, createBlock as B, withCtx as P, createElementVNode as v, createElementBlock as $, createVNode as s, createCommentVNode as j, toDisplayString as ne, unref as e, Fragment as L, renderList as ae, ref as A, isRef as se, reactive as Ae, onMounted as me, watch as he, toRaw as Ne, createTextVNode as oe, h as Oe } from "vue";
2
2
  import { _ as Ee } from "./tier-BJDhpH6X.js";
3
3
  import { useDialog as Re, useDialogChild as Ie, components as Me } from "@feedmepos/ui-library";
4
- import { c as R, e as ce, S as je } from "./index-CV8UD7h6.js";
5
- import { d as Q, a as Le, u as qe, p as pe, n as He, f as ye } from "./loading-ZZmUDFSc.js";
6
- import { u as xe, C as ie } from "./membership-CFGK_1YX.js";
4
+ import { c as R, e as ce, S as je } from "./index-X-EzXcGs.js";
5
+ import { d as Q, a as Le, u as qe, p as pe, n as He, f as ye } from "./loading-C7oH4e0j.js";
6
+ import { u as xe, C as ie } from "./membership-D0G_5G-y.js";
7
7
  import { a as Ke, c as ke } from "./object-qECH92oz.js";
8
8
  import { _ as le } from "./lodash-B5I3zXaY.js";
9
9
  import { Z as z, _ as X, g as K, a as W } from "./ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js";
10
- import { z as Y, R as We } from "./app-Tt2fDVO6.js";
11
- import { F as ze, a as Ye, b as Je, c as Ue } from "./index-Bx6_rQs0.js";
10
+ import { z as Y, R as We } from "./app-Bzct9xVo.js";
11
+ import { F as ze, a as Ye, b as Je, c as Ue } from "./index-3_r2IGAF.js";
12
12
  import { u as ve } from "./app-wDQR6dpb.js";
13
13
  import { J as _e } from "./JsonViewer-v8_C7l5N.js";
14
- import { _ as Ge } from "./index-BsejuiEk.js";
14
+ import { _ as Ge } from "./index-C6kizPcL.js";
15
15
  import { _ as Xe } from "./ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js";
16
16
  import { _ as Ze } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
17
- import { z as Qe, a as et } from "./money-DlPkRzWe.js";
18
- import { F as tt } from "./number-BiaTakcy.js";
19
- import { t as ot } from "./helper-ClUCbFNC.js";
20
- import "./index-CdDf5vB8.js";
17
+ import { z as Qe, a as et } from "./money-B6MghTDE.js";
18
+ import { F as tt } from "./number-qKhyhzHd.js";
19
+ import { t as ot } from "./helper-O1xiribY.js";
20
+ import "./index-PO2CtKXo.js";
21
21
  import { useRouter as at } from "vue-router";
22
- import { m as fe } from "./index-DsY6eQTm.js";
22
+ import { m as fe } from "./index-dbSbwT_z.js";
23
23
  function lt(f) {
24
24
  return Q.DineroFactory(f).toUnit();
25
25
  }
@@ -1,23 +1,23 @@
1
1
  import { defineComponent as q, ref as V, computed as N, onMounted as Y, resolveComponent as p, openBlock as u, createBlock as b, unref as e, isRef as W, withCtx as x, createElementVNode as l, createVNode as s, createElementBlock as O, createTextVNode as z, resolveDynamicComponent as H, toDisplayString as G, Fragment as j, createCommentVNode as U, h } from "vue";
2
2
  import { _ as J } from "./campaign-CpzFl8Vr.js";
3
3
  import { components as $ } from "@feedmepos/ui-library";
4
- import "./index-CdDf5vB8.js";
5
- import { u as Q, p as M, f as B } from "./loading-ZZmUDFSc.js";
6
- import { C, u as X } from "./membership-CFGK_1YX.js";
7
- import { F as ee } from "./index-BsejuiEk.js";
4
+ import "./index-PO2CtKXo.js";
5
+ import { u as Q, p as M, f as B } from "./loading-C7oH4e0j.js";
6
+ import { C, u as X } from "./membership-D0G_5G-y.js";
7
+ import { F as ee } from "./index-C6kizPcL.js";
8
8
  import { c as te } from "./object-qECH92oz.js";
9
9
  import { _ as oe } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
10
10
  import { u as K } from "./app-wDQR6dpb.js";
11
- import { u as ae } from "./business-fj0Ugyb2.js";
11
+ import { u as ae } from "./business-iGcoCCSb.js";
12
12
  import { useCoreStore as ne } from "@feedmepos/mf-common";
13
13
  import { _ as se, Z as g } from "./ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js";
14
14
  import { _ as le } from "./ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js";
15
- import { _ as re } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-CBX85H29.js";
16
- import { _ as ie, a as me } from "./EffectSheet.vue_vue_type_style_index_0_lang-CJhThJyI.js";
17
- import { i as de, t as ce } from "./helper-ClUCbFNC.js";
15
+ import { _ as re } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-DdtJ3kNK.js";
16
+ import { _ as ie, a as me } from "./EffectSheet.vue_vue_type_style_index_0_lang-Cw-KLvgf.js";
17
+ import { i as de, t as ce } from "./helper-O1xiribY.js";
18
18
  import { useRouter as ue } from "vue-router";
19
- import { m as D } from "./index-DsY6eQTm.js";
20
- import { R as k } from "./app-Tt2fDVO6.js";
19
+ import { m as D } from "./index-dbSbwT_z.js";
20
+ import { R as k } from "./app-Bzct9xVo.js";
21
21
  const pe = {
22
22
  key: 0,
23
23
  class: "flex flex-col space-y-16 pr-12"