@feedmepos/mf-menu 0.23.2 → 0.23.3-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/{App-CtLAt0Pj.js → App-CnjUI7fG.js} +4 -4
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-Dt6JdqAP.js → ApplyProduct.vue_vue_type_script_setup_true_lang-DhOeWCP-.js} +2 -2
  3. package/dist/Catalog-D1AFR9Mj.js +635 -0
  4. package/dist/{Category-Cy1pAZi5.js → Category-RvOrSG6Q.js} +7 -7
  5. package/dist/{CookingGuide-D6CjH2B9.js → CookingGuide-BerhgXBx.js} +4 -4
  6. package/dist/{FormSection.vue_vue_type_script_setup_true_lang-DI5Ff58u.js → FormSection.vue_vue_type_script_setup_true_lang-BOZOuk1m.js} +2 -2
  7. package/dist/{Group-DI-sJopf.js → Group-CWevukSr.js} +3 -3
  8. package/dist/{Group-BcD81S_b.js → Group-vzgQF-0Z.js} +1 -1
  9. package/dist/{Group.vue_vue_type_script_setup_true_lang-Bdbz3lVM.js → Group.vue_vue_type_script_setup_true_lang-CJuMeiCX.js} +7 -7
  10. package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-CccX042y.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-Blv5bvM0.js} +2 -2
  11. package/dist/{Ingredient-Dd6CgY7R.js → Ingredient-78hpHg-b.js} +4 -4
  12. package/dist/{PrintRoute-Gu9ggGJl.js → PrintRoute-Dzt9vZvp.js} +4 -4
  13. package/dist/{Product-DwlqQqij.js → Product-C2FnSehT.js} +1 -1
  14. package/dist/{Product.vue_vue_type_script_setup_true_lang-qOPnfNju.js → Product.vue_vue_type_script_setup_true_lang-guqMOkiD.js} +11 -11
  15. package/dist/{Products-Ch7QPzim.js → Products-DpgKp97W.js} +8 -8
  16. package/dist/{Publish-DGkKxaGP.js → Publish-fnMMpQ7H.js} +3 -3
  17. package/dist/{Recipe-Dv1VBgCw.js → Recipe-B-j7-QnD.js} +5 -5
  18. package/dist/{Scheduler-DAQ6tM7V.js → Scheduler-BW-2lfgU.js} +3 -3
  19. package/dist/{SchedulerSelector.vue_vue_type_script_setup_true_lang-C6RS7nRM.js → SchedulerSelector.vue_vue_type_script_setup_true_lang-BQHWiwDS.js} +1 -1
  20. package/dist/{ServingSequence-DskZmjqq.js → ServingSequence-D8eZpPLg.js} +3 -3
  21. package/dist/{Setting-DY1YyBnT.js → Setting-BOt4__e1.js} +1 -1
  22. package/dist/{Setting.vue_vue_type_script_setup_true_lang-CbRS2tQy.js → Setting.vue_vue_type_script_setup_true_lang-CWA2rt6o.js} +4 -4
  23. package/dist/{Takeaway-B8_YdS_k.js → Takeaway-CIjMjgKx.js} +4 -4
  24. package/dist/{Takeaway-C6PK2aIw.js → Takeaway-SYsm7Cp_.js} +1 -1
  25. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-CB5jd8Ql.js → Takeaway.vue_vue_type_script_setup_true_lang-CoApNKg-.js} +5 -5
  26. package/dist/{TaxSetting-BmfoFZQw.js → TaxSetting-XnHpzkTI.js} +4 -4
  27. package/dist/{Unit-C-q56JN4.js → Unit-DH3pzNZH.js} +2 -2
  28. package/dist/{Variant-Be56RPbB.js → Variant-BhwGnbQE.js} +3 -3
  29. package/dist/{_id_-CkN0c8bi.js → _id_-DGhgPHqr.js} +7 -7
  30. package/dist/{app-C0Qjz2mB.js → app-Dq995l4S.js} +24 -22
  31. package/dist/{app-ClCHxUkg.js → app-DuYUgN5u.js} +1 -1
  32. package/dist/app.js +1 -1
  33. package/dist/assets/{linked-status-BOPtM1OH.js → linked-status-rkOvIS_h.js} +11 -11
  34. package/dist/assets/{validate-menu-BVwFA5hB.js → validate-menu-ByNFmW1w.js} +11 -11
  35. package/dist/{catalog-28fm4sSB.js → catalog-D_2n7SMn.js} +1 -1
  36. package/dist/{catalog-D9_qrmoa.js → catalog-NWEx_wEw.js} +7884 -7884
  37. package/dist/{category-Yo2fjEvd.js → category-CaTqoYcx.js} +1 -1
  38. package/dist/{currency-P9kA-zjm.js → currency-DZc9dV9Y.js} +1 -1
  39. package/dist/{index-CikbYB8y.js → index-BR7fDeTR.js} +4 -4
  40. package/dist/{index-C349SO0P.js → index-DXcMe0cE.js} +472 -472
  41. package/dist/{item-DanW75sm.js → item-DjcB8bx8.js} +1813 -1777
  42. package/dist/{lodash-Cjmzbb5Y.js → lodash-CLTRdhVr.js} +1 -1
  43. package/dist/{menu-Conzaa85.js → menu-Bn7QQV9T.js} +1 -1
  44. package/dist/{menu-CihLJQ-f.js → menu-DS9YkIAw.js} +6519 -6519
  45. package/dist/remy-Brqygf9M.js +37 -0
  46. package/dist/{scheduler-icgLBelj.js → scheduler-DRjFaArt.js} +4 -4
  47. package/dist/{takeaway-QhZKXBsd.js → takeaway-no516z37.js} +5 -5
  48. package/dist/{toExcel-CVBJFP8C.js → toExcel-DAYabTNa.js} +2 -2
  49. package/dist/{unit-wWFfmJwk.js → unit-U3sWE8pt.js} +2 -2
  50. package/package.json +3 -3
  51. package/dist/Catalog-B2maPhri.js +0 -589
  52. package/dist/remy-DVV8JZCf.js +0 -37
@@ -1,589 +0,0 @@
1
- import { defineComponent as ue, ref as I, computed as $, resolveComponent as g, openBlock as m, createElementBlock as b, Fragment as V, renderSlot as ye, createVNode as u, unref as e, withCtx as p, createElementVNode as f, renderList as w, createBlock as F, createCommentVNode as z, createTextVNode as be, toDisplayString as k, h as q, withModifiers as Q, normalizeClass as ee } from "vue";
2
- import { useCoreStore as ce, useI18n as me } from "@feedmepos/mf-common";
3
- import { G as O, x as de, K as pe, A as fe, z as oe, B as xe, H as ae, J as ge, T as ne } from "./menu-CihLJQ-f.js";
4
- import { C as ke } from "./catalog-28fm4sSB.js";
5
- import { useRouter as Ce } from "vue-router";
6
- import { _ as he, R as se } from "./app-C0Qjz2mB.js";
7
- import { _ as Oe } from "./PageLayout.vue_vue_type_script_setup_true_lang-BJCuL4EK.js";
8
- import { useSnackbar as _e, components as le, FmButtonColorThemeVariant as W, FmButtonVariant as G, useDialog as Fe, useBreakpoints as Me } from "@feedmepos/ui-library";
9
- import { c as De } from "./check-C9mY6LiX.js";
10
- import { C as R, a as L, _ as re } from "./GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-CccX042y.js";
11
- import { _ as Ve } from "./FormSection.vue_vue_type_script_setup_true_lang-DI5Ff58u.js";
12
- import { _ as te } from "./FormItem.vue_vue_type_script_setup_true_lang-DKsxEK-8.js";
13
- import { _ as Se } from "./index.vue_vue_type_script_setup_true_lang-CGPDazqs.js";
14
- const Ae = { class: "space-y-32" }, Te = {
15
- key: 0,
16
- class: "pl-32 space-x-8"
17
- }, Ne = { class: "pl-[60px] space-y-16" }, Ue = { class: "space-x-16 flex items-center" }, Ee = { class: "flex-1 space-y-4" }, Re = { class: "fm-typo-en-body-lg-400" }, Le = { class: "fm-typo-en-body-md-400" }, $e = { class: "flex gap-8 items-center justify-start" }, we = /* @__PURE__ */ ue({
18
- __name: "Form",
19
- setup(ve, { expose: X }) {
20
- const _ = I(!1), A = I(!1), K = (c, s) => {
21
- De.isBoolean(c) ? _.value = c : _.value = !_.value, _.value && (r.value = R.fromCatalog(
22
- s ?? oe.generator.initMenuV4Catalog(),
23
- T.value
24
- ));
25
- }, T = $(() => D.version === O.F_MENU_VERSION.enum.v4), D = de(), P = ce(), d = pe(fe(_e())), r = I(
26
- R.fromCatalog(oe.generator.initMenuV4Catalog(), T.value)
27
- ), Z = $(() => D.catalogs.map((c) => c.name)), S = $({
28
- get: () => r.value.taxSetting,
29
- set: (c) => {
30
- r.value.taxSetting = c;
31
- }
32
- }), C = $(() => {
33
- var t, a;
34
- if (!P.currentCountry.value) return [];
35
- const c = ((t = r.value.taxSetting) == null ? void 0 : t.mode) === L.MANUAL ? ((a = r.value.taxSetting) == null ? void 0 : a.inclusive) ?? [] : [];
36
- return xe.Country.getCountry(P.currentCountry.value).taxSystems.map((o) => {
37
- const v = c.find((x) => x.systemCode === o.code);
38
- return {
39
- inclusive: (v == null ? void 0 : v.inclusive) || !1,
40
- systemCode: o.code
41
- };
42
- });
43
- });
44
- function Y(c) {
45
- const s = r.value.taxSetting, t = s.mode === L.AUTO ? R.manualTax(C.value) : ae(s);
46
- t.inclusive ?? (t.inclusive = []);
47
- const a = t.inclusive.findIndex((o) => o.systemCode === c.systemCode);
48
- a < 0 ? t.inclusive.push(c) : t.inclusive.splice(a, 1, c), S.value = t;
49
- }
50
- function j(c, s) {
51
- const t = ae(r.value);
52
- t.markupOptions && (t.markupOptions[c] = s, r.value = t);
53
- }
54
- function H(c) {
55
- const s = ae(r.value);
56
- s.markupOptions && (s.markupOptions.splice(c, 1), r.value = s);
57
- }
58
- async function J() {
59
- A.value = !0;
60
- const c = {
61
- ...r.value,
62
- ...R.toCatalog(r.value)
63
- };
64
- try {
65
- await d.updateMenu(
66
- {
67
- module: O.F_MENU_MODULE_V4_KEY.enum.catalog,
68
- operation: ge.F_OPERATION_TYPE.create,
69
- data: c
70
- },
71
- c.name
72
- ), _.value = !1;
73
- } finally {
74
- A.value = !1;
75
- }
76
- }
77
- const { t: i } = me();
78
- return X({ trigger: K }), (c, s) => {
79
- const t = g("fm-text-field"), a = g("fm-radio"), o = g("fm-radio-group"), v = g("fm-checkbox"), x = g("fm-switch"), N = g("fm-select"), M = g("fm-button"), U = g("fm-chip"), E = g("fm-card"), l = g("fm-side-sheet");
80
- return m(), b(V, null, [
81
- ye(c.$slots, "default", { trigger: K }),
82
- u(l, {
83
- modelValue: _.value,
84
- "onUpdate:modelValue": s[7] || (s[7] = (n) => _.value = n),
85
- "is-container": e(le).FmForm,
86
- "is-container-props": {
87
- onValidationSuccess: J,
88
- blameFormChildOnValidationFailed: !0
89
- },
90
- "max-width": 560
91
- }, {
92
- "side-sheet-footer": p(() => [
93
- f("div", $e, [
94
- u(M, {
95
- loading: A.value,
96
- label: e(i)("menu.common.actions.add"),
97
- size: "lg",
98
- type: "submit",
99
- variant: "primary"
100
- }, null, 8, ["loading", "label"]),
101
- u(M, {
102
- label: e(i)("menu.common.actions.cancel"),
103
- size: "lg",
104
- variant: "tertiary",
105
- onClick: s[6] || (s[6] = () => _.value = !1)
106
- }, null, 8, ["label"])
107
- ])
108
- ]),
109
- default: p(() => [
110
- f("div", Ae, [
111
- u(Ve, {
112
- title: e(i)("menu.catalog.detail")
113
- }, {
114
- default: p(() => [
115
- u(t, {
116
- modelValue: r.value.name,
117
- "onUpdate:modelValue": s[0] || (s[0] = (n) => r.value.name = n),
118
- rules: [
119
- (n) => !Z.value.includes(n.trim()) || e(i)("menu.catalog.validation.name_used"),
120
- (n) => !!n || e(i)("menu.catalog.validation.name_required")
121
- ],
122
- autofocus: "",
123
- label: e(i)("menu.catalog.form.name")
124
- }, null, 8, ["modelValue", "rules", "label"]),
125
- u(te, {
126
- label: e(i)("menu.catalog.form.tax.title")
127
- }, {
128
- default: p(() => {
129
- var n, h;
130
- return [
131
- u(o, {
132
- "model-value": (n = r.value.taxSetting) == null ? void 0 : n.mode,
133
- "onUpdate:modelValue": s[1] || (s[1] = (y) => {
134
- y === e(L).AUTO ? S.value = e(R).autoTax() : S.value = e(R).manualTax(C.value);
135
- })
136
- }, {
137
- default: p(() => [
138
- u(a, {
139
- value: e(L).AUTO,
140
- label: e(i)("menu.catalog.form.tax.auto.label"),
141
- sublabel: e(i)("menu.catalog.form.tax.auto.sublabel"),
142
- class: "pl-4"
143
- }, null, 8, ["value", "label", "sublabel"]),
144
- u(a, {
145
- value: e(L).MANUAL,
146
- label: e(i)("menu.catalog.form.tax.manual.label"),
147
- sublabel: e(i)("menu.catalog.form.tax.manual.sublabel")
148
- }, null, 8, ["value", "label", "sublabel"])
149
- ]),
150
- _: 1
151
- }, 8, ["model-value"]),
152
- ((h = r.value.taxSetting) == null ? void 0 : h.mode) === e(L).MANUAL ? (m(), b("div", Te, [
153
- (m(!0), b(V, null, w(C.value, (y) => (m(), F(v, {
154
- key: y.systemCode,
155
- "model-value": y.inclusive,
156
- value: !0,
157
- label: e(i)("menu.catalog.form.tax.inclusive", { code: y.systemCode }),
158
- "onUpdate:modelValue": (B) => {
159
- Y({
160
- ...y,
161
- inclusive: B
162
- });
163
- }
164
- }, null, 8, ["model-value", "label", "onUpdate:modelValue"]))), 128))
165
- ])) : z("", !0)
166
- ];
167
- }),
168
- _: 1
169
- }, 8, ["label"])
170
- ]),
171
- _: 1
172
- }, 8, ["title"]),
173
- T.value ? (m(), F(te, {
174
- key: 0,
175
- label: e(i)("menu.catalog.form.link.title")
176
- }, {
177
- default: p(() => [
178
- u(x, {
179
- "model-value": r.value.orderFrom && r.value.orderFrom !== e(O.F_ORDER_FROM).enum.NONE,
180
- label: e(i)("menu.catalog.form.link.auto_link.label"),
181
- "label-placement": "right",
182
- sublabel: e(i)("menu.catalog.form.link.auto_link.sublabel"),
183
- "onUpdate:modelValue": s[2] || (s[2] = (n) => r.value.orderFrom = n ? e(O.F_ORDER_FROM).enum.ALL : e(O.F_ORDER_FROM).enum.NONE)
184
- }, null, 8, ["model-value", "label", "sublabel"]),
185
- r.value.orderFrom !== e(O.F_ORDER_FROM).enum.NONE ? (m(), F(N, {
186
- key: 0,
187
- class: "ml-[60px]",
188
- items: [
189
- {
190
- label: e(i)("menu.catalog.form.link.options.all"),
191
- value: e(O.F_ORDER_FROM).enum.ALL
192
- },
193
- {
194
- label: e(i)("menu.catalog.form.link.options.pos_only"),
195
- value: e(O.F_ORDER_FROM).enum.POS_ONLY
196
- }
197
- ],
198
- "model-value": r.value.orderFrom,
199
- "onUpdate:modelValue": s[3] || (s[3] = (n) => r.value.orderFrom = n)
200
- }, null, 8, ["items", "model-value"])) : z("", !0)
201
- ]),
202
- _: 1
203
- }, 8, ["label"])) : z("", !0),
204
- T.value ? (m(), F(te, {
205
- key: 1,
206
- label: e(i)("menu.catalog.form.markup.title")
207
- }, {
208
- default: p(() => [
209
- u(x, {
210
- "model-value": !!r.value.markupOptions,
211
- label: e(i)("menu.catalog.form.markup.auto.label"),
212
- "label-placement": "right",
213
- sublabel: e(i)("menu.catalog.form.markup.auto.sublabel"),
214
- "onUpdate:modelValue": s[4] || (s[4] = (n) => r.value.markupOptions = n ? [] : null)
215
- }, null, 8, ["model-value", "label", "sublabel"]),
216
- f("div", Ne, [
217
- u(re, {
218
- categories: e(D).categories,
219
- items: e(D).items,
220
- action: "add",
221
- "onUpdate:modelValue": s[5] || (s[5] = (n) => n && (r.value.markupOptions = [...r.value.markupOptions ?? [], n]))
222
- }, {
223
- default: p(({ trigger: n }) => [
224
- u(M, {
225
- "text-color": e(W).ColorPrimary,
226
- "border-color": e(W).ColorPrimary,
227
- variant: e(G).Secondary,
228
- label: e(i)("menu.catalog.form.markup.add"),
229
- "prepend-icon": "add",
230
- onClick: n
231
- }, null, 8, ["text-color", "border-color", "variant", "label", "onClick"])
232
- ]),
233
- _: 1
234
- }, 8, ["categories", "items"]),
235
- (m(!0), b(V, null, w(r.value.markupOptions, (n, h) => (m(), F(re, {
236
- key: h,
237
- categories: e(D).categories,
238
- items: e(D).items,
239
- "model-value": n,
240
- action: "update",
241
- "onUpdate:modelValue": (y) => y && j(h, y)
242
- }, {
243
- default: p(({ trigger: y }) => [
244
- u(E, {
245
- id: JSON.stringify(n),
246
- class: "py-12 px-16 cursor-pointer",
247
- variant: "outlined",
248
- onClick: y
249
- }, {
250
- default: p(() => [
251
- f("div", Ue, [
252
- f("div", Ee, [
253
- u(U, { class: "text-fm-color-typo-info bg-fm-color-system-info-100 font-semibold" }, {
254
- default: p(() => [
255
- be(k(e(i)("menu.catalog.form.markup.percentage", { value: n.percentage })), 1)
256
- ]),
257
- _: 2
258
- }, 1024),
259
- f("p", Re, k(e(i)("menu.catalog.form.markup.config", { number: h + 1 })), 1),
260
- f("p", Le, k(n.includeItems ? e(i)("menu.catalog.form.markup.products", {
261
- count: n.includeItems.length
262
- }) : e(i)("menu.catalog.form.markup.all_items")), 1)
263
- ]),
264
- u(M, {
265
- variant: e(G).Tertiary,
266
- "prepend-icon": "delete",
267
- onClick: (B) => H(h)
268
- }, null, 8, ["variant", "onClick"])
269
- ])
270
- ]),
271
- _: 2
272
- }, 1032, ["id", "onClick"])
273
- ]),
274
- _: 2
275
- }, 1032, ["categories", "items", "model-value", "onUpdate:modelValue"]))), 128))
276
- ])
277
- ]),
278
- _: 1
279
- }, 8, ["label"])) : z("", !0)
280
- ])
281
- ]),
282
- _: 1
283
- }, 8, ["modelValue", "is-container", "is-container-props"])
284
- ], 64);
285
- };
286
- }
287
- }), ie = we, Ie = {
288
- key: 1,
289
- class: "flex flex-col overflow-scroll divide-y divide-fm-color-neutral-gray-100"
290
- }, Pe = ["onClick"], Be = {
291
- class: "flex-1 space-y-4"
292
- }, ze = {
293
- class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
294
- }, Ge = {
295
- class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
296
- }, Ke = {
297
- class: "fm-typo-en-body-lg-600"
298
- }, Ye = {
299
- class: "flex flex-row"
300
- }, je = {
301
- class: "fm-typo-en-title-md-600"
302
- }, He = {
303
- class: "space-y-24"
304
- }, Je = {
305
- class: "space-y-8 flex-1"
306
- }, qe = {
307
- class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
308
- }, Qe = {
309
- class: "fm-typo-cn-body-lg-600"
310
- }, We = {
311
- class: "space-y-8 flex-1"
312
- }, Xe = {
313
- class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
314
- }, Ze = "main", pa = /* @__PURE__ */ ue({
315
- __name: "Catalog",
316
- setup(ve) {
317
- const X = ce(), _ = de(), A = _e(), K = fe(A), T = Fe(), D = pe(K), P = Ce(), {
318
- t: d
319
- } = me();
320
- function r(t, a) {
321
- var N, M, U, E;
322
- const o = X.restaurants.value.find(({
323
- _id: l
324
- }) => l === a._id), v = [...a.linkedDeliveryCatalogs.map((l) => ({
325
- label: `Delivery (${l.name})`,
326
- selector: l.catalog
327
- })), {
328
- label: "Delivery (FoodPanda integration)",
329
- selector: (N = o == null ? void 0 : o.foodpandaDelivery) == null ? void 0 : N.catalogId
330
- }, {
331
- label: "Delivery (GrabFood integration)",
332
- selector: (M = o == null ? void 0 : o.grabfoodDelivery) == null ? void 0 : M.catalogId
333
- }, {
334
- label: "Delivery (ShopeeFood integration)",
335
- selector: (U = o == null ? void 0 : o.shopeefoodDelivery) == null ? void 0 : U.catalogId
336
- }];
337
- return [{
338
- label: "Dine-in",
339
- selector: a.catalogId
340
- }, {
341
- label: "Takeaway",
342
- selector: a.takeawayCatalog || a.catalogId
343
- }, {
344
- label: "Pickup",
345
- selector: a.pickupCatalog || null
346
- }, {
347
- label: "Additional",
348
- selector: a.additionalCatalogs
349
- }, {
350
- label: "Delivery (In house)",
351
- selector: a.inHouseDelivery
352
- }, {
353
- label: "Delivery (Feedme express)",
354
- selector: (E = o == null ? void 0 : o.feedmeDelivery) == null ? void 0 : E.catalogId
355
- }, ...ne(v, {
356
- selector: "label"
357
- })].filter((l) => t ? Array.isArray(l.selector) ? l.selector.includes(t) : l.selector === t : l.selector === null).map((l) => l.label);
358
- }
359
- function Z(t) {
360
- return _.state.restaurants.map((a) => ({
361
- name: a.name,
362
- usage: r(t, a)
363
- })).filter((a) => a.usage.length > 0);
364
- }
365
- const S = I(!1), C = $(() => [..._.catalogs.map((a) => ({
366
- id: a._id,
367
- name: a.name,
368
- taxes: a.inclusiveTaxes || null,
369
- doc: a,
370
- disableDelete: !1,
371
- defaultOrderFrom: a.defaultOrderFrom
372
- }))].map((a) => {
373
- var x;
374
- const o = Z(((x = a.doc) == null ? void 0 : x._id) || null), v = a.doc ? ke.getSellingItem(a.doc, _.state.menu) : _.state.menu.modules.item;
375
- return {
376
- ...a,
377
- taxMode: a.taxes ? "Manual" : "Automatic",
378
- autoLink: a.defaultOrderFrom !== O.F_ORDER_FROM.enum.NONE ? "Activated" : "Deactivated",
379
- restaurants: ne(o, {
380
- selector: "name"
381
- }),
382
- totalProducts: v.length,
383
- disableDelete: a.disableDelete
384
- };
385
- })), Y = (t) => {
386
- _.selectCatalog(t === Ze ? null : t), P.push({
387
- name: se.EDIT_CATALOG_PRODUCT,
388
- params: {
389
- id: t
390
- }
391
- });
392
- }, j = I(null);
393
- function H(t) {
394
- var a;
395
- (a = j.value) == null || a.trigger(null, {
396
- ...t.doc,
397
- name: `${t.name} copy`
398
- });
399
- }
400
- async function J(t) {
401
- const a = _.state.restaurants.filter((o) => [...o.additionalCatalogs, o.inHouseDelivery, ...o.linkedDeliveryCatalogs.map((v) => v.catalog), o.pickupCatalog, o.takeawayCatalog, o.catalogId].includes(t.id)).map((o) => o.name);
402
- a.length > 0 ? A.open({
403
- type: "error",
404
- message: d("menu.catalog.dialogs.remove.error", {
405
- restaurants: a
406
- })
407
- }) : T.open({
408
- title: d("menu.catalog.dialogs.remove.title"),
409
- message: d("menu.catalog.dialogs.remove.message", {
410
- name: t.name
411
- }),
412
- primaryActions: {
413
- text: d("menu.common.actions.remove"),
414
- close: !0,
415
- variant: G.Destructive
416
- },
417
- secondaryActions: {
418
- text: d("menu.common.actions.cancel"),
419
- close: !0
420
- }
421
- }).onPrimary(async () => {
422
- await D.updateMenu({
423
- module: O.F_MENU_MODULE_V4_KEY.enum.catalog,
424
- operation: ge.F_OPERATION_TYPE.delete,
425
- data: t.id
426
- }, t.name, !0), _.selectCatalog(null), await P.push({
427
- name: se.CATALOG
428
- });
429
- });
430
- }
431
- const i = I([{
432
- accessorKey: "name",
433
- header: () => d("menu.catalog.table.columns.title"),
434
- enableSorting: !1
435
- }, {
436
- accessorKey: "taxMode",
437
- header: () => d("menu.catalog.table.columns.tax_calculation"),
438
- enableSorting: !1
439
- }, {
440
- accessorKey: "autoLink",
441
- header: () => d("menu.catalog.table.columns.auto_link"),
442
- enableSorting: !1,
443
- cell: (t) => {
444
- const a = t.row.original;
445
- return q("div", {
446
- class: "flex justify-between"
447
- }, [a.autoLink]);
448
- }
449
- }, {
450
- id: "actions",
451
- size: 52,
452
- meta: {
453
- cellClass: "pl-16",
454
- headerContentClass: "-mx-16"
455
- },
456
- header: "",
457
- cell: (t) => {
458
- const a = t.row.original;
459
- return q("div", {
460
- class: "flex justify-end"
461
- }, [q(le.FmButton, {
462
- icon: "file_copy",
463
- disabled: !a.id,
464
- variant: "tertiary",
465
- textColor: "neutral-gray-400",
466
- onClick: Q(async () => {
467
- await H(a);
468
- }, ["stop", "prevent"])
469
- }), q(le.FmButton, {
470
- icon: "delete",
471
- disabled: !a.id,
472
- variant: "tertiary",
473
- textColor: "neutral-gray-400",
474
- onClick: Q(async () => {
475
- await J(a);
476
- }, ["stop", "prevent"])
477
- })]);
478
- }
479
- }]), c = Me(), s = $(() => c.breakpoints.value.xs);
480
- return (t, a) => {
481
- const o = g("fm-button"), v = g("FmTable"), x = g("FmButton"), N = g("fm-card-header"), M = g("fm-card-section"), U = g("fm-card"), E = g("fm-side-sheet");
482
- return m(), F(Oe, {
483
- heading: e(d)("menu.catalog.title")
484
- }, {
485
- "append-heading": p(() => [C.value.length > 0 ? (m(), F(e(ie), {
486
- key: 0,
487
- ref_key: "createCatalogManagerFormRef",
488
- ref: j
489
- }, {
490
- default: p(({
491
- trigger: l
492
- }) => [f("div", {
493
- class: ee([["xs:fixed xs:z-10 xs:bottom-[68px] xs:right-16"], "ml-auto xs:ml-0 flex flex-row gap-8"])
494
- }, [u(o, {
495
- label: e(d)("menu.catalog.actions.view_usage"),
496
- onClick: a[0] || (a[0] = (n) => S.value = !0),
497
- variant: "secondary"
498
- }, null, 8, ["label"]), u(o, {
499
- label: e(d)("menu.catalog.actions.add"),
500
- "prepend-icon": "add",
501
- onClick: l
502
- }, null, 8, ["label", "onClick"])])]),
503
- _: 1
504
- }, 512)) : z("", !0)]),
505
- default: p(() => [C.value.length === 0 ? (m(), F(e(Se), {
506
- key: 0,
507
- subtitle: e(d)("menu.catalog.empty.subtitle"),
508
- title: e(d)("menu.catalog.empty.title")
509
- }, {
510
- action: p(() => [u(e(ie), null, {
511
- default: p(({
512
- trigger: l
513
- }) => [u(o, {
514
- label: e(d)("menu.catalog.actions.add"),
515
- "prepend-icon": "add",
516
- onClick: l
517
- }, null, 8, ["label", "onClick"])]),
518
- _: 1
519
- })]),
520
- _: 1
521
- }, 8, ["subtitle", "title"])) : (m(), b(V, {
522
- key: 1
523
- }, [s.value ? (m(), b("div", Ie, [(m(!0), b(V, null, w(C.value, (l) => (m(), b("div", {
524
- key: l.id,
525
- class: "flex flex-row py-12 px-16 items-center",
526
- onClick: (n) => Y(l.id)
527
- }, [f("div", Be, [f("p", ze, " Tax calculation: " + k(l.taxMode), 1), f("p", Ge, " Auto link product: " + k(l.autoLink), 1), f("p", Ke, k(l.name), 1)]), f("div", Ye, [u(x, {
528
- "text-color": e(W).NeutralGray400,
529
- variant: e(G).Tertiary,
530
- "prepend-icon": "file_copy",
531
- onClick: Q((n) => H(l), ["stop"])
532
- }, null, 8, ["text-color", "variant", "onClick"]), u(x, {
533
- "text-color": e(W).NeutralGray400,
534
- variant: e(G).Tertiary,
535
- "prepend-icon": "delete",
536
- onClick: Q((n) => J(l), ["stop"])
537
- }, null, 8, ["text-color", "variant", "onClick"])])], 8, Pe))), 128))])) : (m(), F(he, {
538
- key: 0
539
- }, {
540
- default: p(() => [u(v, {
541
- "column-defs": i.value,
542
- "row-data": C.value,
543
- "page-size": C.value.length,
544
- "hide-footer": !0,
545
- "shrink-at": !1,
546
- onRowClick: a[1] || (a[1] = (l) => Y(l.original.id))
547
- }, null, 8, ["column-defs", "row-data", "page-size"])]),
548
- _: 1
549
- })), u(E, {
550
- modelValue: S.value,
551
- "onUpdate:modelValue": a[2] || (a[2] = (l) => S.value = l),
552
- "max-width": 560,
553
- "dismiss-away": ""
554
- }, {
555
- "side-sheet-header": p(() => [f("p", je, k(e(d)("menu.catalog.usage.title")), 1)]),
556
- default: p(() => [f("div", He, [(m(!0), b(V, null, w(C.value, (l, n) => (m(), F(U, {
557
- key: n,
558
- class: "relative",
559
- variant: "outlined"
560
- }, {
561
- default: p(() => [u(N, {
562
- subtitle: e(d)("menu.catalog.usage.tax_calculation") + `: ${l.taxMode} (${l.totalProducts} ${e(d)("menu.catalog.usage.products", {
563
- count: l.totalProducts
564
- })})`,
565
- title: l.name
566
- }, null, 8, ["subtitle", "title"]), u(M, {
567
- class: ee(["pt-8 space-y-12", "divide-y divide-fm-color-neutral-gray-100"])
568
- }, {
569
- default: p(() => [(m(!0), b(V, null, w(l.restaurants, (h, y) => (m(), b("div", {
570
- key: y,
571
- class: ee(["flex xs:flex-col", "space-x-24 xs:space-x-0", "xs:space-y-24", "pt-12 first:pt-0"])
572
- }, [f("div", Je, [f("p", qe, k(e(d)("menu.catalog.usage.restaurant")), 1), f("p", Qe, k(h.name), 1)]), f("div", We, [f("p", Xe, k(e(d)("menu.catalog.usage.usage")), 1), (m(!0), b(V, null, w(h.usage, (B) => (m(), b("p", {
573
- key: B,
574
- class: "fm-typo-cn-body-lg-600"
575
- }, k(B), 1))), 128))])]))), 128))]),
576
- _: 2
577
- }, 1024)]),
578
- _: 2
579
- }, 1024))), 128))])]),
580
- _: 1
581
- }, 8, ["modelValue"])], 64))]),
582
- _: 1
583
- }, 8, ["heading"]);
584
- };
585
- }
586
- });
587
- export {
588
- pa as default
589
- };
@@ -1,37 +0,0 @@
1
- import { I as u } from "./app-C0Qjz2mB.js";
2
- import { computed as f, ref as m } from "vue";
3
- import { u as l } from "./app-ClCHxUkg.js";
4
- var g = { mainBackend: "https://portal-v2.feedmeapi.com", menuBackend: "https://menu-v4.feedmeapi.com", remy: "https://remy.feedmeapi.com/v1", firebase: { apiKey: "AIzaSyA_isPR1-9bX7UmRiJIhsIRNNwdn6DdmW4", authDomain: "feedme-253402.firebaseapp.com", databaseURL: "https://feedme-253402.firebaseio.com", projectId: "feedme-253402", storageBucket: "image.feedme.cc", messagingSenderId: "128512026847", appId: "1:128512026847:web:7c5c8ab7e8b90502dc616a", measurementId: "G-LTKS7N2HQS" }, gtm: { id: "GTM-WR8XHXLH", serverUrl: "https://server-side-tagging-zzez732dna-as.a.run.app", env: "production", serverMeasurementId: "G-2MP52PC24R", debug: !1 } };
5
- let b;
6
- function S(t) {
7
- const p = l(), a = u(t), c = f(() => {
8
- var e, i, o;
9
- return ((o = (i = (e = p.publicSetting) == null ? void 0 : e.aiSettings) == null ? void 0 : i.remy) == null ? void 0 : o.enable) || !1;
10
- }), n = m(!1);
11
- function s(e) {
12
- n.value = e;
13
- }
14
- const r = m(null);
15
- function d(e) {
16
- r.value = e;
17
- }
18
- return {
19
- enable: c,
20
- isDialogOpened: n,
21
- toggleDialog: s,
22
- registerOnSelect: d,
23
- onSelect: r,
24
- ...a,
25
- closeSession: (e) => (s(!1), a.closeSession(e))
26
- };
27
- }
28
- function R(t) {
29
- b = S({
30
- token: t,
31
- url: g.remy || ""
32
- });
33
- }
34
- export {
35
- b as R,
36
- R as i
37
- };