@feedmepos/mf-connect 0.1.104-prod → 0.1.105-prod

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/dist/{App-B4UWz7ir.js → App-Bb5yBnOB.js} +10 -9
  2. package/dist/{Bin-D_eSutW-.js → Bin-DXIYjMm_.js} +8 -8
  3. package/dist/{Broadcast-DDQE_RLR.js → Broadcast-BpcvdGj_.js} +11 -11
  4. package/dist/CampaignAnalytic-BDqEZmHy.js +1830 -0
  5. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D2cTNgaS.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BBiIrN0a.js} +6 -6
  6. package/dist/{Card-CPozdg3m.js → Card-D2sggPws.js} +19 -19
  7. package/dist/{Collections-IrwF5bWH.js → Collections-BdZU2wR5.js} +9 -9
  8. package/dist/{Credit-BVXpy5tw.js → Credit-DeDCjtcp.js} +118 -93
  9. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-DEwMzs6L.js +53 -0
  10. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-CCe1rp0f.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-DbukUBK2.js} +815 -609
  11. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-DwP64fmL.js → EffectSheet.vue_vue_type_style_index_0_lang-BNOrfkpI.js} +12 -12
  12. package/dist/{Experience-BR1JXdH5.js → Experience-CT_3fZPR.js} +109 -84
  13. package/dist/{FileSaver.min-CX-3gU49.js → FileSaver.min-C3sYNQw3.js} +1 -1
  14. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-3bH-tZAm.js +138 -0
  15. package/dist/Game-C4v96zEu.js +355 -0
  16. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-q5fF5d7d.js → ImageInput.vue_vue_type_script_setup_true_lang-6PmRI47X.js} +1 -1
  17. package/dist/{Index--Xl_8CFP.js → Index-C5DRA08U.js} +10 -10
  18. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-C-xW5Tw8.js → LocationPicker.vue_vue_type_script_setup_true_lang-BXcpCtHI.js} +1 -1
  19. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DGVqQz1j.js → LottieAnimation.vue_vue_type_script_setup_true_lang-C8dm05l2.js} +1 -1
  20. package/dist/LoyaltyDashboard-BCPojLdm.js +2865 -0
  21. package/dist/{MainLayout-DB_Y2C3K.js → MainLayout-p92jJ4Mp.js} +3 -3
  22. package/dist/{Marketing-CjAGzfL7.js → Marketing-Z-TiSgs6.js} +4 -4
  23. package/dist/{MarketingMaterialEdit-BoF6kTOz.js → MarketingMaterialEdit-CS-hcbGU.js} +6 -6
  24. package/dist/{Member-DnypOK2I.js → Member-DwY0tXwr.js} +7 -7
  25. package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-DDSBw1sL.js +1286 -0
  26. package/dist/{MemberImportHistory-BJSyT6Ys.js → MemberImportHistory-BN85ZxpX.js} +8 -8
  27. package/dist/MemberList-DaIJCa_0.js +336 -0
  28. package/dist/{MemberTransactions-CbPxUrtd.js → MemberTransactions-DrgA6jX1.js} +1 -1
  29. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CVzfjs9D.js → MessageInput.vue_vue_type_script_setup_true_lang-rl8Sr_zl.js} +11 -11
  30. package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-lGB6WCj6.js +40 -0
  31. package/dist/Mission-BFBmJTjP.js +359 -0
  32. package/dist/{Overview-BW2_y1_7.js → Overview-DaZA6Oxr.js} +5 -5
  33. package/dist/{Overview-DZxRuA5F.js → Overview-DtiqH8iJ.js} +19 -19
  34. package/dist/Point-DeaTc_Gj.js +287 -0
  35. package/dist/Promotion-BBIylJxt.js +417 -0
  36. package/dist/{Queue-CSF9M_Lc.js → Queue-WsDiZkdN.js} +11 -11
  37. package/dist/{Record-B-HdI5A4.js → Record-CzD7sYYG.js} +10 -10
  38. package/dist/{Review-D6RQbcP6.js → Review-BkPHrt33.js} +2 -2
  39. package/dist/{ReviewFacebookCallback-CkULwhF-.js → ReviewFacebookCallback-Bu8j9CLF.js} +5 -5
  40. package/dist/{ReviewGoogleCallback-DgPEXV_R.js → ReviewGoogleCallback-Bh3R06MN.js} +5 -5
  41. package/dist/{Reward-CZvM6GQ9.js → Reward-BHe9y1VN.js} +17 -17
  42. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-C1y2_pHY.js → RewardGroup.vue_vue_type_script_setup_true_lang-DVNknaoM.js} +12 -12
  43. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-Cvo6a7Nw.js → RuleGroup.vue_vue_type_script_setup_true_lang-DAXfiO8F.js} +279 -286
  44. package/dist/{Segment-D2bXEF1U.js → Segment-CjaPWdMt.js} +24 -24
  45. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-Ytimazjg.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-srMHsTa6.js} +12 -12
  46. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-Bn1IWAd_.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-C5taZCvV.js} +4 -4
  47. package/dist/{Setting-DelduRrh.js → Setting-Dr_lawoc.js} +57 -57
  48. package/dist/{SettingAdvertisements-gTDg1C60.js → SettingAdvertisements-BXJd1btw.js} +13 -13
  49. package/dist/{Settings-VUEo9wwx.js → Settings-DPJq4qbw.js} +5 -5
  50. package/dist/{Store-CXQZirbg.js → Store-BNq7oK2B.js} +22 -22
  51. package/dist/{StoreRewards-BDuZPA8S.js → StoreRewards-WExx61kV.js} +16 -16
  52. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-C-yqZEn4.js → StoreTransactions.vue_vue_type_script_setup_true_lang-BaqyPTXc.js} +327 -386
  53. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BayrgH7m.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-CnCHFZL3.js} +2 -2
  54. package/dist/{Tier-DtPE4IJ5.js → Tier-BSLPHzsj.js} +102 -102
  55. package/dist/{Title-DNCnQeeR.js → Title-BQ_CVnIN.js} +22 -22
  56. package/dist/{Transaction-BkUaCGwl.js → Transaction-CvyyRq8P.js} +2 -2
  57. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-B7TY_AGp.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-ByHFu7ry.js} +6 -6
  58. package/dist/{Voucher-BBuB9tf8.js → Voucher-DQ-yXZAC.js} +143 -121
  59. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-Bu09bIut.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BB0n73WF.js} +115 -121
  60. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BSKpAMJL.js → ZodTextField.vue_vue_type_script_setup_true_lang-nnWYrHgL.js} +2 -2
  61. package/dist/{app-CSLQmdYA.js → app-BxM9Ghdm.js} +27795 -25657
  62. package/dist/app.js +1 -1
  63. package/dist/{business-okSb42At.js → business-nbLS8l9h.js} +1 -1
  64. package/dist/{campaign-V7nlCdxR.js → campaign-C_IR2u8a.js} +49 -48
  65. package/dist/{campaign-Ck9GwZdI.js → campaign-Ki9WAmYl.js} +2 -2
  66. package/dist/{campaign.enum-BQ5khvqI.js → campaign.enum-CtgtWycO.js} +1 -1
  67. package/dist/{campaign.fn-DMDpxVSZ.js → campaign.fn-CJOfTzI6.js} +32 -32
  68. package/dist/{collectible.enum-lKz3vTQM.js → collectible.enum-a5dfnH3M.js} +1 -1
  69. package/dist/{collection.fn-BH5cqMNy.js → collection.fn-Cc-luweq.js} +2 -2
  70. package/dist/{effect-pUpfqkCF.js → effect-D66eImId.js} +1 -1
  71. package/dist/{email-addresses-CzBv1fzv.js → email-addresses-DNHwCrI5.js} +2 -2
  72. package/dist/{export-Du7ZAv-8.js → export-Bp-Fwp-h.js} +3 -3
  73. package/dist/{helper-BpthZPU4.js → helper-BpHRMtgf.js} +1 -1
  74. package/dist/{index-DSltrIkA.js → index-B8cXkkGF.js} +1 -1
  75. package/dist/{timezone-DYWqfGTu.js → index-BPV5Dkjl.js} +105 -122
  76. package/dist/{index-D7PksEV2.js → index-BdqanLnJ.js} +675 -677
  77. package/dist/{index-CWAdNVKN.js → index-BnH5UiZx.js} +6 -6
  78. package/dist/{index-v8QQ-4ZP.js → index-C1Bp0PPS.js} +10 -10
  79. package/dist/{index-BhuD1NhH.js → index-CA5atWo4.js} +1 -1
  80. package/dist/{index-ZTYDfSkT.js → index-CZ-SWULS.js} +4 -5
  81. package/dist/{index-CGK1kSCt.js → index-DB13tnmJ.js} +3 -3
  82. package/dist/{index-C0JgU0Z2.js → index-DFLwgFnq.js} +1 -1
  83. package/dist/{index-DCp9k5BB.js → index-DVcOSnAP.js} +2 -2
  84. package/dist/{index-DNdHiAXR.js → index-Dj3FzUo_.js} +18 -2
  85. package/dist/{index-CN5Zoynf.js → index-DyllcNwd.js} +2 -2
  86. package/dist/{index-OaZRtKP_.js → index-JU7Ed3Ex.js} +5 -5
  87. package/dist/{index--6uUWSMc.js → index-Oeiw4Epg.js} +1 -1
  88. package/dist/{index-izVlVA8-.js → index-VzLsGqcm.js} +1 -1
  89. package/dist/{index-DPgGmpyL.js → index-nUrA9Q7e.js} +9 -9
  90. package/dist/{index.esm2017-mpnkyDRb.js → index.esm2017-32NtkXiv.js} +34 -34
  91. package/dist/{loading-BG3Pj6qz.js → loading-CLZ5IFPe.js} +1 -1
  92. package/dist/{lodash-BfDdt-c9.js → lodash-k98YPjFm.js} +1 -1
  93. package/dist/{member-import-BNFdZ3Df.js → member-import-CxNPNPh5.js} +1 -1
  94. package/dist/membership-CjqXHl0l.js +274 -0
  95. package/dist/{money-CRftC-F0.js → money-zJomyMyN.js} +1 -1
  96. package/dist/{number-z7YZyGFS.js → number-BfHmokvl.js} +1 -1
  97. package/dist/object-BYyQ0PZp.js +18 -0
  98. package/dist/{objectid-BKMqp_oR.js → objectid-g-s-CuBk.js} +6 -6
  99. package/dist/{plugins-CWeDGuzy.js → plugins-DNZv50xL.js} +87 -87
  100. package/dist/{reward-BVTKTGi6.js → reward-BefNUdd_.js} +1 -1
  101. package/dist/{rule-YhhCOals.js → rule-DkLIl8GM.js} +3 -3
  102. package/dist/{rule-builder-ae8A0qoi.js → rule-builder-BVyNMiE8.js} +1 -1
  103. package/dist/style.css +1 -1
  104. package/dist/{template-CQrM_0hz.js → template-BmSOVHcp.js} +7 -7
  105. package/dist/timezone-DoX-vj_6.js +20 -0
  106. package/dist/transaction.fn-D15eS4nB.js +64 -0
  107. package/dist/{trigger-Clo3vSjw.js → trigger-BhReH6kZ.js} +5 -5
  108. package/dist/{useMarketingMaterialActions-HyqIT94N.js → useMarketingMaterialActions-DdcVqSlV.js} +3 -3
  109. package/dist/{usePagination-CWRrkbFL.js → usePagination-rx2JFS-5.js} +1 -1
  110. package/dist/{user-MVk5s412.js → user-B4gZia2L.js} +1 -1
  111. package/dist/{vue-i18n-BN9KLJoz.js → vue-i18n-JLM70-gr.js} +201 -201
  112. package/dist/{xlsx-s0BxKsa_.js → xlsx-CuKZcLfT.js} +440 -440
  113. package/dist/{zod-H4l78-by.js → zod-ByE_90T4.js} +1 -1
  114. package/package.json +3 -4
  115. package/dist/Analytic-1rqyus1X.js +0 -428
  116. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
  117. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
  118. package/dist/Game-8nvdSkbi.js +0 -330
  119. package/dist/MemberList-Bf_XyoxW.js +0 -1602
  120. package/dist/Mission-DE4O6XM6.js +0 -334
  121. package/dist/Point-BMEe6duo.js +0 -262
  122. package/dist/Promotion-lamxp48U.js +0 -392
  123. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-BxOEEr9-.js +0 -181
  124. package/dist/dto-GksE6pni.js +0 -216
  125. package/dist/membership-tNeaKAeS.js +0 -255
  126. package/dist/object-qECH92oz.js +0 -26
@@ -1,392 +0,0 @@
1
- import { defineComponent as E, ref as w, resolveComponent as d, openBlock as f, createBlock as S, unref as a, isRef as oe, withCtx as k, createElementVNode as r, createVNode as c, computed as te, h as I, onMounted as ne, createElementBlock as L, Fragment as B, renderList as ae, resolveDynamicComponent as se, toDisplayString as F } from "vue";
2
- import { _ as ie } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as re, components as $ } from "@feedmepos/ui-library";
4
- import { p as j } from "./plugins-CWeDGuzy.js";
5
- import { u as le } from "./loading-BG3Pj6qz.js";
6
- import { u as ce } from "./business-okSb42At.js";
7
- import { u as me } from "./campaign-Ck9GwZdI.js";
8
- import { u as ue } from "./vue-i18n-BN9KLJoz.js";
9
- import { g as de, a as D } from "./campaign-V7nlCdxR.js";
10
- import { u as pe, c as fe, p as ye } from "./template-CQrM_0hz.js";
11
- import { e as q } from "./effect-pUpfqkCF.js";
12
- import { c as K } from "./string-Gcy5IM_H.js";
13
- import { _ as ge } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-CCe1rp0f.js";
14
- import { c as y } from "./index-DNdHiAXR.js";
15
- import { _ as U } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
16
- const he = { class: "space-y-8" }, _e = /* @__PURE__ */ E({
17
- __name: "QueueSheet",
18
- emits: ["update:model-value"],
19
- setup(Q, { expose: n, emit: R }) {
20
- const p = w(!1), h = w([]);
21
- async function P() {
22
- p.value = !0;
23
- const i = await y.getPromotionQueue();
24
- console.log(i, "jobs"), h.value = i;
25
- }
26
- const v = [
27
- {
28
- header: "Started At",
29
- accessorFn: (i) => i.createdAt,
30
- enableSorting: !0
31
- },
32
- {
33
- header: "Campaigns",
34
- accessorFn: (i) => i.campaigns
35
- // cell(props) {
36
- // const r = props.row.original;
37
- // return h('div', {
38
- // innerHTML: r.campaigns.map((c: any) => c.name).join(', '),
39
- // });
40
- // },
41
- }
42
- ];
43
- return n({
44
- showSheet: P
45
- }), (i, u) => {
46
- const _ = d("FmTable"), T = d("FmSideSheet");
47
- return f(), S(T, {
48
- "max-width": 550,
49
- header: "Promotion Sync Queue",
50
- modelValue: a(p),
51
- "onUpdate:modelValue": [
52
- u[1] || (u[1] = (s) => oe(p) ? p.value = s : null),
53
- u[2] || (u[2] = (s) => p.value = s)
54
- ]
55
- }, {
56
- default: k(() => [
57
- r("div", he, [
58
- u[3] || (u[3] = r("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Promotion synchronizing to your restaurant(s) is queued here. Depending on the number of campaigns and restaurants, this process may take several minutes. No task displayed here means there are no pending promotions to sync. ", -1)),
59
- c(_, {
60
- modelValue: i.tableRef,
61
- "onUpdate:modelValue": u[0] || (u[0] = (s) => i.tableRef = s),
62
- "column-filter": i.jobFilters,
63
- "column-defs": v,
64
- "row-data": a(h),
65
- "hide-footer": a(h).length <= 10
66
- }, null, 8, ["modelValue", "column-filter", "row-data", "hide-footer"])
67
- ])
68
- ]),
69
- _: 1
70
- }, 8, ["modelValue"]);
71
- };
72
- }
73
- }), we = { class: "px-24 flex flex-col gap-y-16" }, ve = { class: "flex items-center justify-between w-full" }, be = { class: "flex gap-8 overflow-x-auto" }, Ce = { class: "space-y-8" }, xe = { class: "flex w-full gap-4 items-center" }, Fe = { class: "space-y-4" }, Se = { class: "fm-typo-en-body-lg-600" }, ke = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Pe = { class: "flex items-center gap-8" }, Te = { class: "flex flex-col gap-16 text-center" }, Ve = { class: "fm-typo-en-title-sm-800" }, Oe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, He = /* @__PURE__ */ E({
74
- __name: "Promotion",
75
- setup(Q) {
76
- const { t: n } = ue(), R = {
77
- label: n("connect.promotion.createCampaign"),
78
- value: "create",
79
- isPrimary: !0,
80
- prependIcon: "add"
81
- }, p = {
82
- label: "Force sync",
83
- value: "sync",
84
- isPrimary: !1,
85
- prependIcon: "refresh"
86
- }, h = {
87
- label: "Queue",
88
- value: "queue",
89
- isPrimary: !1,
90
- prependIcon: "work_history"
91
- }, P = pe("PROMOTION", re()), v = ce(), i = me(), { global: u, minor: _ } = le, T = [
92
- {
93
- label: "Bill promotion",
94
- value: "BILL"
95
- },
96
- {
97
- label: "Item promotion",
98
- value: "ITEM"
99
- }
100
- ], s = w({
101
- searchKey: "",
102
- location: [],
103
- effectType: []
104
- });
105
- function H(e) {
106
- const o = s.value.location;
107
- return !o || o.length === 0 || !e.targetLocation ? !0 : Array.isArray(o) ? o.some((m) => {
108
- var l;
109
- return (l = e == null ? void 0 : e.targetLocation) == null ? void 0 : l.includes(m);
110
- }) : e.targetLocation.includes(o);
111
- }
112
- function z(e) {
113
- var l, C;
114
- const o = s.value.effectType;
115
- if (!o || o.length === 0) return !0;
116
- const m = (C = (l = e.effect) == null ? void 0 : l.options) == null ? void 0 : C.target;
117
- return o.includes(m);
118
- }
119
- const g = te(
120
- () => i.campaigns.promotion.filter(
121
- (e) => H(e) && z(e)
122
- )
123
- ), G = [
124
- {
125
- header: n("connect.promotion.promotionTitle"),
126
- accessorFn: (e) => e.name
127
- },
128
- {
129
- header: n("connect.promotion.status"),
130
- accessorFn: (e) => de(e),
131
- cell(e) {
132
- return D(e.row.original);
133
- }
134
- },
135
- {
136
- header: n("connect.promotion.type"),
137
- accessorFn: (e) => `${K.title(e.effect.options.target)} promotion`
138
- },
139
- {
140
- header: n("connect.promotion.summary"),
141
- accessorFn: (e) => q(e.effect)
142
- },
143
- {
144
- header: n("connect.promotion.actions"),
145
- cell(e) {
146
- return I("div", { class: "flex items-center gap-8 justify-end" }, [
147
- I($.FmButton, {
148
- variant: "tertiary",
149
- icon: "content_copy",
150
- iconColor: "neutral-gray-400",
151
- onClick: async (o) => {
152
- o.stopPropagation(), await N(e.row.original);
153
- }
154
- }),
155
- I($.FmButton, {
156
- variant: "tertiary",
157
- icon: "delete",
158
- iconColor: "neutral-gray-400",
159
- onClick: (o) => {
160
- o.stopPropagation(), M(e.row.original);
161
- }
162
- })
163
- ]);
164
- }
165
- }
166
- ], V = w(), A = w();
167
- async function M(e) {
168
- await j.remove(
169
- n("connect.promotion.confirmRemove", { name: e.name })
170
- ) && await _(
171
- async () => {
172
- await y.delete(e._id), await i.read("PROMOTION");
173
- },
174
- {
175
- message: n("connect.promotion.removing", { name: e.name }),
176
- successMessage: n("connect.promotion.removedSuccessfully", {
177
- name: e.name
178
- })
179
- }
180
- );
181
- }
182
- async function b(e) {
183
- e ? await o() : P.open(async (m) => {
184
- await o(m);
185
- });
186
- async function o(m) {
187
- var l;
188
- (l = V.value) == null || l.showSheet(
189
- !0,
190
- "PROMOTION",
191
- e ? await y.readById(e._id) : void 0,
192
- m
193
- );
194
- }
195
- }
196
- async function N(e) {
197
- var l;
198
- if (!await fe(e.name))
199
- return;
200
- const o = await y.readById(e._id), m = ye(o);
201
- (l = V.value) == null || l.showSheet(
202
- !0,
203
- "PROMOTION",
204
- m,
205
- o.template
206
- );
207
- }
208
- async function J(e) {
209
- await _(
210
- async () => {
211
- e.campaign._id ? await y.update(e.campaign._id, e) : await y.create(e), await i.read("PROMOTION");
212
- },
213
- {
214
- message: n(
215
- e.campaign._id ? "connect.promotion.updating" : "connect.promotion.creating"
216
- ),
217
- successMessage: n(
218
- e.campaign._id ? "connect.promotion.updatedSuccessfully" : "connect.promotion.createdSuccessfully"
219
- )
220
- }
221
- );
222
- }
223
- async function W(e) {
224
- var o;
225
- switch (e) {
226
- case "create":
227
- b();
228
- break;
229
- case "sync":
230
- await j.confirm(
231
- "Are you sure you want to synchronize all promotions to POS?",
232
- "Force sync"
233
- ) && _(
234
- async () => {
235
- await y.syncAllPromotion();
236
- },
237
- {
238
- message: "Syncing promotions...",
239
- successMessage: "All promotions synced"
240
- }
241
- );
242
- break;
243
- case "queue":
244
- (o = A.value) == null || o.showSheet();
245
- break;
246
- }
247
- }
248
- return ne(async () => {
249
- await u(async () => {
250
- await v.readLocations(), await i.read("PROMOTION");
251
- });
252
- }), (e, o) => {
253
- const m = d("FmPageHead"), l = d("FmSearch"), C = d("FmTable"), X = d("FmChip"), O = d("FmButton"), Y = d("FmListItem"), Z = d("FmList"), ee = d("FmCard");
254
- return f(), L(B, null, [
255
- c(m, {
256
- title: a(n)("connect.promotion.title"),
257
- actions: a(g).length > 0 ? [R, p, h] : [],
258
- "onClick:action": W
259
- }, null, 8, ["title", "actions"]),
260
- r("div", we, [
261
- c(l, {
262
- modelValue: s.value.searchKey,
263
- "onUpdate:modelValue": o[0] || (o[0] = (t) => s.value.searchKey = t),
264
- class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
265
- placeholder: a(n)("connect.promotion.search"),
266
- collapsible: ""
267
- }, null, 8, ["modelValue", "placeholder"]),
268
- a(g) && a(g).length > 0 ? (f(), L(B, { key: 0 }, [
269
- r("div", ve, [
270
- r("div", be, [
271
- c(U, {
272
- label: `${a(n)("connect.common.location")}: `,
273
- "right-icon": "keyboard_arrow_down",
274
- modelValue: s.value.location,
275
- "onUpdate:modelValue": o[1] || (o[1] = (t) => s.value.location = t),
276
- icon: "storefront",
277
- "show-item-label": !0,
278
- items: a(v).locationOptions
279
- }, null, 8, ["label", "modelValue", "items"]),
280
- c(U, {
281
- label: "Type:",
282
- "right-icon": "keyboard_arrow_down",
283
- modelValue: s.value.effectType,
284
- "onUpdate:modelValue": o[2] || (o[2] = (t) => s.value.effectType = t),
285
- icon: "filter_list",
286
- "show-item-label": !0,
287
- items: T
288
- }, null, 8, ["modelValue"])
289
- ]),
290
- c(l, {
291
- modelValue: s.value.searchKey,
292
- "onUpdate:modelValue": o[3] || (o[3] = (t) => s.value.searchKey = t),
293
- class: "xs:hidden sm:hidden",
294
- placeholder: "search",
295
- collapsible: ""
296
- }, null, 8, ["modelValue"])
297
- ]),
298
- c(C, {
299
- class: "xs:hidden sm:hidden",
300
- "row-data": a(g),
301
- "column-defs": G,
302
- "search-value": s.value.searchKey,
303
- "column-filter": [],
304
- onRowClick: o[4] || (o[4] = (t) => b(t.original)),
305
- "hide-footer": a(g).length < 10
306
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
307
- c(Z, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
308
- default: k(() => [
309
- (f(!0), L(B, null, ae(a(g).filter(
310
- (t) => t.name.toLowerCase().includes(s.value.searchKey.toLowerCase())
311
- ), (t) => (f(), S(Y, {
312
- key: t._id.toString(),
313
- onClick: (x) => b(t),
314
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
315
- }, {
316
- default: k(() => [
317
- r("div", Ce, [
318
- r("div", xe, [
319
- (f(), S(se(a(D)(t)))),
320
- c(X, {
321
- class: "!text-fm-color-typo-info !bg-fm-color-system-info-100",
322
- compact: !0,
323
- label: `${a(K).title(t.effect.options.target)} promotion`
324
- }, null, 8, ["label"])
325
- ]),
326
- r("div", Fe, [
327
- r("div", Se, F(t.name), 1),
328
- r("div", ke, F(a(q)(t.effect)), 1)
329
- ])
330
- ]),
331
- r("div", Pe, [
332
- c(O, {
333
- icon: "content_copy",
334
- "icon-color": "neutral-gray-400",
335
- variant: "tertiary",
336
- onClick: async (x) => {
337
- x.stopPropagation(), await N(t);
338
- }
339
- }, null, 8, ["onClick"]),
340
- c(O, {
341
- icon: "delete",
342
- "icon-color": "neutral-gray-400",
343
- variant: "tertiary",
344
- onClick: (x) => (x.stopPropagation(), M(t))
345
- }, null, 8, ["onClick"])
346
- ])
347
- ]),
348
- _: 2
349
- }, 1032, ["onClick"]))), 128))
350
- ]),
351
- _: 1
352
- })
353
- ], 64)) : (f(), S(ee, {
354
- key: 1,
355
- variant: "outlined",
356
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
357
- }, {
358
- default: k(() => [
359
- o[6] || (o[6] = r("img", {
360
- src: ie,
361
- class: "aspect-square w-[150px]"
362
- }, null, -1)),
363
- r("div", Te, [
364
- r("div", Ve, F(a(n)("connect.promotion.createPromotionCampaign")), 1),
365
- r("div", Oe, F(a(n)("connect.promotion.description")), 1)
366
- ]),
367
- c(O, {
368
- variant: "primary",
369
- label: a(n)("connect.promotion.createPromotionCampaign"),
370
- icon: "add",
371
- onClick: o[5] || (o[5] = (t) => b())
372
- }, null, 8, ["label"])
373
- ]),
374
- _: 1
375
- }))
376
- ]),
377
- c(ge, {
378
- ref_key: "sheetRef",
379
- ref: V,
380
- "onSubmit:modelValue": J
381
- }, null, 512),
382
- c(_e, {
383
- ref_key: "queueSheetRef",
384
- ref: A
385
- }, null, 512)
386
- ], 64);
387
- };
388
- }
389
- });
390
- export {
391
- He as default
392
- };
@@ -1,181 +0,0 @@
1
- import { defineComponent as N, computed as f, ref as V, onMounted as H, resolveComponent as _, openBlock as c, createElementBlock as u, createVNode as i, withCtx as F, createElementVNode as p, toDisplayString as q, normalizeClass as A, Fragment as x, renderList as S, createCommentVNode as B } from "vue";
2
- import { F as D } from "./app-CSLQmdYA.js";
3
- import "./index-OaZRtKP_.js";
4
- import { c as E } from "./object-qECH92oz.js";
5
- const M = { class: "flex flex-col flex-nowrap" }, T = { class: "flex gap-16 items-center w-full" }, $ = { class: "flex grow items-center" }, z = { class: "grow text-fm-color-typo-secondary" }, K = { key: 0 }, J = { class: "px-16" }, X = /* @__PURE__ */ N({
6
- __name: "SelectItems",
7
- props: {
8
- initialValue: {
9
- type: Array,
10
- default: () => []
11
- },
12
- filterItems: {
13
- type: Function,
14
- default: void 0
15
- },
16
- onComplete: {
17
- type: Function,
18
- required: !0
19
- },
20
- maxHeight: {
21
- type: [String, Number],
22
- default: 380
23
- }
24
- },
25
- setup(j, { expose: O }) {
26
- const m = j, b = D(), w = f(() => b.menu.value || {
27
- _id: "",
28
- modules: {
29
- catalog: [],
30
- category: [],
31
- item: [],
32
- variant: [],
33
- group: [],
34
- takeaway: [],
35
- scheduler: [],
36
- printDepartment: [],
37
- recipe: [],
38
- sku: [],
39
- unit: [],
40
- cookingGuide: [],
41
- serveSequence: []
42
- }
43
- }), k = f(() => {
44
- const n = m.filterItems ?? ((t) => !!t.category);
45
- return w.value.modules.item.filter(n).reduce((t, l) => {
46
- const a = {
47
- id: l._id,
48
- category: l.category,
49
- name: (l.name2 || l.name).trim()
50
- };
51
- return t = [...t, a], t;
52
- }, []);
53
- }), C = f(() => {
54
- const n = w.value.modules.category.reduce((e, t) => (e[t._id] = {
55
- id: t._id,
56
- name: t.name,
57
- items: {}
58
- }, e), {});
59
- return k.value.reduce(
60
- (e, t) => {
61
- const l = t.category ?? "";
62
- return e[l].items = {
63
- ...e[l].items,
64
- [t.id]: t
65
- }, e;
66
- },
67
- {
68
- ...n,
69
- "": {
70
- id: "",
71
- name: "Addons",
72
- items: {}
73
- }
74
- }
75
- );
76
- }), v = f(() => {
77
- const n = y.value.toLowerCase();
78
- return n ? Object.entries(C.value).reduce((e, [t, l]) => {
79
- if (l.name.toLowerCase().includes(n))
80
- return e[t] = l, e;
81
- const a = Object.entries(l.items).reduce((d, [g, o]) => (o.name.toLowerCase().includes(n) && (d[g] = o), d), {});
82
- return Object.keys(a).length > 0 && (e[t] = { ...l, items: a }), e;
83
- }, {}) : C.value;
84
- }), s = V({}), y = V(""), G = f(() => Object.values(s.value).filter((n) => !!n).length);
85
- function I(n) {
86
- s.value = k.value.reduce((e, t) => (e[t.id] = n.includes(t.id), e), {});
87
- }
88
- H(async () => {
89
- await b.store.getMenu(), I(m.initialValue);
90
- });
91
- function h(n) {
92
- const e = Object.keys(v.value[n].items), t = e.filter((l) => s.value[l]);
93
- return t.length ? t.length === e.length ? !0 : null : !1;
94
- }
95
- function U(n) {
96
- const e = Object.keys(v.value[n].items), t = h(n), l = E(s.value);
97
- for (const a of e)
98
- l[a] = t !== !0;
99
- s.value = l;
100
- }
101
- function L(n) {
102
- s.value[n] = !s.value[n];
103
- }
104
- return O({
105
- onConfirm: () => {
106
- const n = Object.entries(s.value).filter(([, e]) => !!e).map(([e]) => e);
107
- m.onComplete(n);
108
- }
109
- }), (n, e) => {
110
- const t = _("fm-button"), l = _("FmTextField"), a = _("fm-list-item"), d = _("fm-checkbox"), g = _("fm-list");
111
- return c(), u("div", M, [
112
- i(a, {
113
- tag: "div",
114
- clickable: !1
115
- }, {
116
- default: F(() => [
117
- p("div", T, [
118
- p("div", $, [
119
- i(t, {
120
- icon: "sync",
121
- variant: "tertiary",
122
- onClick: e[0] || (e[0] = () => I([]))
123
- }),
124
- p("span", z, q(G.value) + " product(s) selected ", 1)
125
- ]),
126
- i(l, {
127
- modelValue: y.value,
128
- "onUpdate:modelValue": e[1] || (e[1] = (o) => y.value = o),
129
- placeholder: "Search",
130
- "leading-icon": { name: "search", color: "" },
131
- style: { width: "200px", "min-width": "200px" }
132
- }, null, 8, ["modelValue"])
133
- ])
134
- ]),
135
- _: 1
136
- }),
137
- i(g, {
138
- class: A(["grow overflow-y-auto", `max-h-${m.maxHeight ? `[${m.maxHeight}px]` : "full"}`])
139
- }, {
140
- default: F(() => [
141
- (c(!0), u(x, null, S(v.value, (o) => (c(), u(x, {
142
- key: o.id
143
- }, [
144
- Object.keys(o.items).length > 0 ? (c(), u("div", K, [
145
- p("div", J, [
146
- i(d, {
147
- "model-value": h(o.id) ?? !1,
148
- indeterminate: h(o.id) === null,
149
- label: o.name,
150
- value: "",
151
- name: "",
152
- sublabel: "",
153
- class: "w-full",
154
- "onUpdate:modelValue": () => U(o.id)
155
- }, null, 8, ["model-value", "indeterminate", "label", "onUpdate:modelValue"])
156
- ]),
157
- (c(!0), u(x, null, S(o.items, (r) => (c(), u("div", {
158
- key: r.id,
159
- class: "pl-48"
160
- }, [
161
- i(d, {
162
- "model-value": s.value[r.id],
163
- label: r.name,
164
- value: r.id,
165
- name: r.name,
166
- class: "w-full",
167
- "onUpdate:modelValue": () => L(r.id)
168
- }, null, 8, ["model-value", "label", "value", "name", "onUpdate:modelValue"])
169
- ]))), 128))
170
- ])) : B("", !0)
171
- ], 64))), 128))
172
- ]),
173
- _: 1
174
- }, 8, ["class"])
175
- ]);
176
- };
177
- }
178
- });
179
- export {
180
- X as _
181
- };