@feedmepos/mf-menu 0.31.10-prod → 0.31.11-beta.1

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 (59) hide show
  1. package/dist/{App-BT1TFoYK.js → App-DjpjTtf9.js} +6 -6
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-CdblAni_.js → ApplyProduct.vue_vue_type_script_setup_true_lang-CzyuBhuB.js} +2 -2
  3. package/dist/{Catalog-BZ1vTBvo.js → Catalog-DyueiSOE.js} +5 -5
  4. package/dist/{Category-CKY7yTEE.js → Category-BLXOZPb3.js} +5 -5
  5. package/dist/{Category-CgPtntD6.js → Category-CKdYO3VF.js} +4 -4
  6. package/dist/{CookingGuide-aI9Vl3u3.js → CookingGuide-BS3RkGSk.js} +3 -3
  7. package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-DhgzR0nK.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-DA9L_N2q.js} +1 -1
  8. package/dist/{Group-RXdG0cCj.js → Group-CfXvwlMh.js} +1 -1
  9. package/dist/{Group-zsrgbAFX.js → Group-D6bsaOPs.js} +3 -3
  10. package/dist/{Group.vue_vue_type_script_setup_true_lang-krHMmK8E.js → Group.vue_vue_type_script_setup_true_lang-BZXXFaLD.js} +7 -7
  11. package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-kTIm9xhC.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BJjTwizA.js} +3 -3
  12. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-DNXzTmh2.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-CDM1sCGe.js} +1267 -1267
  13. package/dist/{Ingredient-C3VgBz5w.js → Ingredient-Bdoiuoof.js} +3 -3
  14. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-D4Rx4mRi.js → InventoryBinding.vue_vue_type_script_setup_true_lang-ByTF88jv.js} +2 -2
  15. package/dist/{LinkProductSideSheet-iMU1KvJX.js → LinkProductSideSheet-8NLHPTlx.js} +1 -1
  16. package/dist/{MenuSetting-Cy3sqhCM.js → MenuSetting-BVo1bZt6.js} +4 -4
  17. package/dist/{PrintRoute-BGCv9aJ1.js → PrintRoute-pUr-YxdH.js} +3 -3
  18. package/dist/{Product-B3g-oH8x.js → Product-CjSfO1gl.js} +1 -1
  19. package/dist/Product.vue_vue_type_script_setup_true_lang-DReaXqTg.js +1557 -0
  20. package/dist/{Products-DlVYzd53.js → Products-DSWEX-ij.js} +59 -59
  21. package/dist/{Publish-CeH-gl9b.js → Publish-BR7A0n7S.js} +3 -3
  22. package/dist/{Recipe-C1dUPLkk.js → Recipe-BinSrA0Q.js} +4 -4
  23. package/dist/{Scheduler-BLcfkRA1.js → Scheduler-bsR3LO8H.js} +3 -3
  24. package/dist/{ServingSequence-B0jNatHo.js → ServingSequence-BJlAW_1V.js} +3 -3
  25. package/dist/{Setting-QRszSbBR.js → Setting-XcqCBHOL.js} +4 -4
  26. package/dist/{Subcategory-CWHNmrQE.js → Subcategory-BDgPfJZA.js} +4 -4
  27. package/dist/{Takeaway-DRS6Vz-5.js → Takeaway-BCfMJfoi.js} +4 -4
  28. package/dist/{Takeaway-D7DmH15s.js → Takeaway-CsTGl6n5.js} +1 -1
  29. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-IWTTcs2f.js → Takeaway.vue_vue_type_script_setup_true_lang-BJUbTljE.js} +5 -5
  30. package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-BdWx5fdf.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-CF3AXC4l.js} +14 -14
  31. package/dist/{Unit-CIv-PqCt.js → Unit-lkjqKb5W.js} +2 -2
  32. package/dist/{Variant-DjGvYuzh.js → Variant-BeZ4BIn8.js} +3 -3
  33. package/dist/{_id_-DnVVmOCe.js → _id_-hlATDCsB.js} +9 -9
  34. package/dist/{app-B2RQcPjC.js → app-2Tw5RdT8.js} +1 -1
  35. package/dist/{app-Bg99M05B.js → app-BXBHiPQ7.js} +23 -23
  36. package/dist/app.js +1 -1
  37. package/dist/apps/mf-menu/src/helper/item.d.ts +3 -1
  38. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  39. package/dist/assets/{linked-status-Vp0TQYKf.js → linked-status-a56gAWtJ.js} +2 -2
  40. package/dist/assets/{override-menu-BHiYT11B.js → override-menu-CvaMxNc9.js} +2 -2
  41. package/dist/assets/{validate-menu-CduiPk11.js → validate-menu-CRjvqfSv.js} +2 -2
  42. package/dist/{catalog-Bm09LCrm.js → catalog-BM-O01IV.js} +1 -1
  43. package/dist/{catalogSetting-vPZUe0xY.js → catalogSetting-DOhVr93e.js} +1 -1
  44. package/dist/{category-CIMek6Dw.js → category-DI7rVP_A.js} +1 -1
  45. package/dist/{currency-DCJtEa6B.js → currency-CvEozH3g.js} +1 -1
  46. package/dist/{dayjs.min-m6NoqWj6.js → dayjs.min-CzFwvtdR.js} +1 -1
  47. package/dist/{index-BrCtR-Hd.js → index-BW9HstSe.js} +2 -2
  48. package/dist/{index-1JUdOzJ9.js → index-CtAZ0vuL.js} +1 -1
  49. package/dist/{index-Wik8mJjL.js → index-tfW-GKN1.js} +3 -3
  50. package/dist/{item-CYFoV9HF.js → item-SUbVYbe0.js} +932 -932
  51. package/dist/{menu-Tfvz3TZW.js → menu-B3kJ7du7.js} +3215 -3169
  52. package/dist/{menu-CllScy8p.js → menu-CcKfPthb.js} +1 -1
  53. package/dist/{priceTier-D15kaHnA.js → priceTier-DK9ob6lk.js} +1 -1
  54. package/dist/{scheduler-CDOBpsHB.js → scheduler-vfXhieiT.js} +3 -3
  55. package/dist/{subcategory-KC674Rqg.js → subcategory-D549uxxb.js} +63 -63
  56. package/dist/{toExcel-RNwSGsFf.js → toExcel-C7X2TLo4.js} +2 -2
  57. package/dist/{unit-CT1mqXgg.js → unit-Da9qanXG.js} +1 -1
  58. package/package.json +1 -1
  59. package/dist/Product.vue_vue_type_script_setup_true_lang-BSW-4pwk.js +0 -1582
@@ -1,1582 +0,0 @@
1
- import { ref as V, computed as x, defineComponent as B, resolveComponent as K, createBlock as I, openBlock as v, withCtx as $, createElementVNode as f, createVNode as d, unref as n, createElementBlock as k, Fragment as ie, renderList as Fe, createCommentVNode as D, normalizeClass as ce, toDisplayString as R, withModifiers as ve, mergeModels as Xe, useModel as et, renderSlot as _e, watch as se, createTextVNode as tt, watchEffect as lt, nextTick as Oe, resolveDynamicComponent as at, onMounted as ot, h as W, normalizeStyle as xt } from "vue";
2
- import { u as $e, T as ke, z as ue, J as ze, G as nt, Q as rt, K as ge, W as Ct, aa as wt, ab as Me, R as kt, ac as Le } from "./menu-Tfvz3TZW.js";
3
- import "./vuedraggable-CK8z7qA8.js";
4
- import { useI18n as Te, useCoreStore as Ke } from "@feedmepos/mf-common";
5
- import { useBreakpoints as Ne, components as Z, useSnackbar as st, useDialog as ut, FmButtonColorThemeVariant as q, FmButtonVariant as J } from "@feedmepos/ui-library";
6
- import { u as Ve } from "./menu-CllScy8p.js";
7
- import { _ as be } from "./index.vue_vue_type_script_setup_true_lang-BgqsTzLI.js";
8
- import { L as We } from "./LinkProductSideSheet-iMU1KvJX.js";
9
- import { _ as De, h as qe, a as St, b as Qe } from "./CustomAttributeChip.vue_vue_type_script_setup_true_lang-DhgzR0nK.js";
10
- import { u as it } from "./category-CIMek6Dw.js";
11
- import { f as Ft, o as Vt, b as It, m as $t } from "./subcategory-KC674Rqg.js";
12
- import { r as Tt, _ as Pt, a as At, u as Mt } from "./ImportProductDialog.vue_vue_type_script_setup_true_lang-DNXzTmh2.js";
13
- import { u as ct, C as Ot } from "./item-CYFoV9HF.js";
14
- import { F as zt } from "./index-1JUdOzJ9.js";
15
- import { _ as Re, u as Dt } from "./app-Bg99M05B.js";
16
- import { _ as Se } from "./TextChip.vue_vue_type_script_setup_true_lang-8frWuZFL.js";
17
- import { _ as Ut } from "./index-Wik8mJjL.js";
18
- import { _ as Ue } from "./Thumbnail.vue_vue_type_script_setup_true_lang-DzQ8_6Bi.js";
19
- import { c as Kt } from "./check-C9mY6LiX.js";
20
- import { f as Nt } from "./currency-DCJtEa6B.js";
21
- import { w as Rt } from "./tooltip-B5BiPMx9.js";
22
- import { r as Bt } from "./index-Ce4v8o7D.js";
23
- function jt(C, o) {
24
- const s = V(!0), m = x(() => {
25
- var u, b;
26
- return !s.value && (!o.value || ((u = o.value) == null ? void 0 : u.length) === ((b = C.value) == null ? void 0 : b.length));
27
- }), t = x(() => {
28
- var u, b, p, _;
29
- return !!((u = o.value) != null && u.length && ((b = o.value) == null ? void 0 : b.length) > 0 && ((p = o.value) == null ? void 0 : p.length) < ((_ = C.value) == null ? void 0 : _.length));
30
- });
31
- return { allCleared: s, allSelected: m, indeterminate: t, toggleAll: () => {
32
- o.value = void 0, s.value = !s.value;
33
- }, toggleOption: (u) => {
34
- var p, _, g;
35
- let b;
36
- o.value === void 0 && s.value ? b = [u] : o.value === void 0 && !s.value ? b = (p = C.value.map((w) => w.value)) == null ? void 0 : p.filter((w) => w !== u) : (_ = o.value) != null && _.includes(u) ? b = (g = o.value) == null ? void 0 : g.filter((w) => w !== u) : b = [...o.value || [], u], b.length === 0 ? (o.value = void 0, s.value = !0) : b.length === C.value.length ? (o.value = void 0, s.value = !1) : o.value = b;
37
- } };
38
- }
39
- const Et = { class: "inline-flex items-center" }, Gt = {
40
- key: 0,
41
- class: /* @__PURE__ */ ce([
42
- "fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap",
43
- "text-fm-color-neutral-gray-400"
44
- ])
45
- }, Lt = { class: "p-4" }, Wt = { class: "flex-1 overflow-y-auto min-h-0" }, He = /* @__PURE__ */ B({
46
- __name: "CategorySelector",
47
- emits: ["toggleAttributeFilter"],
48
- setup(C, { emit: o }) {
49
- const s = o, m = $e(), { categories: t, selectedCategories: r } = Ve(), l = x(() => m.state.currentCategoryIds), u = x(
50
- () => t.value.map((T) => ({ label: T.name, value: T.id }))
51
- ), b = x(() => u.value.filter(
52
- (T) => T.label.toLowerCase().includes(g.value.toLowerCase())
53
- )), { t: p } = Te(), _ = x(() => {
54
- var T, N, X;
55
- return t.value.length === ((T = r.value) == null ? void 0 : T.length) ? p("menu.category.selector.all") : ((N = r.value) == null ? void 0 : N.length) === 1 ? r.value[0].name : `${(X = r.value) == null ? void 0 : X.length}`;
56
- }), g = V(""), w = x({
57
- get: () => l.value,
58
- set: (T) => {
59
- m.selectCategory(T);
60
- }
61
- }), { allSelected: te, toggleAll: H, toggleOption: le, indeterminate: L } = jt(
62
- u,
63
- w
64
- ), ae = Ke(), S = x(() => ae.itemAttributeSettings.value.length > 0);
65
- function oe() {
66
- s("toggleAttributeFilter");
67
- }
68
- return (T, N) => {
69
- const X = K("FmIcon"), ye = K("FmChip"), Y = K("FmSearch"), de = K("FmMenuItem"), j = K("FmMenu");
70
- return v(), I(j, {
71
- "close-on-click": !1,
72
- width: 220
73
- }, {
74
- "menu-button": $(() => [
75
- f("div", Et, [
76
- d(ye, null, {
77
- default: $(() => [
78
- _.value ? (v(), k("div", Gt, R(n(p)("menu.category.selector.title", { label: _.value })), 1)) : D("", !0),
79
- d(X, {
80
- color: "neutral-gray-400",
81
- name: "expand_more",
82
- size: "sm"
83
- }),
84
- S.value ? (v(), k("div", {
85
- key: 1,
86
- class: "pl-8 flex items-center justify-center border-l border-fm-color-neutral-gray-200",
87
- onClick: ve(oe, ["stop"])
88
- }, [
89
- d(X, {
90
- name: "filter_alt",
91
- outline: "",
92
- color: "neutral-gray-400",
93
- size: "sm",
94
- onClick: N[0] || (N[0] = ve(() => {
95
- }, ["prevent"]))
96
- })
97
- ])) : D("", !0)
98
- ]),
99
- _: 1
100
- })
101
- ])
102
- ]),
103
- default: $(() => [
104
- f("div", Lt, [
105
- d(Y, {
106
- autofocus: "",
107
- modelValue: g.value,
108
- "onUpdate:modelValue": N[1] || (N[1] = (P) => g.value = P),
109
- placeholder: n(p)("menu.common.actions.search")
110
- }, null, 8, ["modelValue", "placeholder"])
111
- ]),
112
- f("div", Wt, [
113
- d(de, {
114
- label: "All",
115
- "has-checkbox": "",
116
- "model-value": n(te),
117
- indeterminate: n(L),
118
- onClick: n(H)
119
- }, null, 8, ["model-value", "indeterminate", "onClick"]),
120
- (v(!0), k(ie, null, Fe(b.value, (P) => {
121
- var M;
122
- return v(), I(de, {
123
- key: P.value || "",
124
- label: P.label,
125
- "has-checkbox": "",
126
- "model-value": n(te) || ((M = w.value) == null ? void 0 : M.includes(P.value)),
127
- onClick: (A) => n(le)(P.value)
128
- }, null, 8, ["label", "model-value", "onClick"]);
129
- }), 128))
130
- ])
131
- ]),
132
- _: 1
133
- });
134
- };
135
- }
136
- });
137
- function qt() {
138
- const C = navigator.userAgent.toLowerCase();
139
- return /safari/.test(C) && !/chrome/.test(C);
140
- }
141
- const Qt = { class: "flex flex-wrap gap-8" }, Ht = { class: "py-12 px-16 space-y-12" }, Yt = { class: "fm-typo-en-body-md-600 text-fm-color-neutral-gray-600" }, Jt = { class: "flex flex-wrap gap-8" }, Zt = {
142
- key: 0,
143
- class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
144
- }, Xt = { key: 0 }, el = {
145
- key: 1,
146
- class: "inline-block w-8"
147
- }, tl = { key: 0 }, ll = { key: 1 }, Ye = /* @__PURE__ */ B({
148
- __name: "CategoriesChip",
149
- props: {
150
- categories: { default: () => [] },
151
- ellipsis: { type: Boolean, default: !0 }
152
- },
153
- setup(C) {
154
- const o = C, { t: s } = Te(), m = Ne(), t = x(() => m.breakpoints.value.xs), r = x(() => o.ellipsis ? t.value ? 1 : 2 : 1 / 0), l = x(() => o.categories.length <= r.value ? o.categories : o.categories.slice(0, r.value)), u = V(!0), b = x(() => {
155
- if (u.value) {
156
- const _ = l.value.join(", ");
157
- return _.length > 20 ? _.slice(0, 20) + "..." : _;
158
- }
159
- return o.categories.join(", ");
160
- });
161
- return (p, _) => {
162
- const g = K("FmTooltip");
163
- return t.value ? (v(), k(ie, { key: 1 }, [
164
- p.categories.length > 0 ? (v(), k("p", Zt, [
165
- f("span", null, R(n(s)("menu.product.table.columns.category")) + ": ", 1),
166
- f("span", null, R(b.value), 1),
167
- u.value ? (v(), k("span", el)) : (v(), k("br", Xt)),
168
- p.categories.length > r.value ? (v(), k("span", {
169
- key: 2,
170
- class: "fm-typo-en-body-md-400 text-fm-color-primary cursor-pointer",
171
- onClick: _[0] || (_[0] = ve((w) => u.value = !u.value, ["stop", "prevent"]))
172
- }, [
173
- u.value ? (v(), k("span", tl, R(n(s)("menu.product.table.category.expand", { count: p.categories.length - r.value })), 1)) : (v(), k("span", ll, R(n(s)("menu.product.table.category.collapse")), 1))
174
- ])) : D("", !0)
175
- ])) : D("", !0)
176
- ], 64)) : (v(), I(g, {
177
- key: 0,
178
- class: "flex",
179
- variant: "rich",
180
- placement: "top",
181
- "z-index": 50
182
- }, {
183
- content: $(() => [
184
- f("div", Ht, [
185
- f("p", Yt, R(n(s)("menu.product.table.category.all")), 1),
186
- f("div", Jt, [
187
- (v(!0), k(ie, null, Fe(o.categories, (w) => (v(), I(Se, {
188
- key: w,
189
- label: w,
190
- variant: "neutral"
191
- }, null, 8, ["label"]))), 128))
192
- ])
193
- ])
194
- ]),
195
- default: $(() => [
196
- f("div", Qt, [
197
- (v(!0), k(ie, null, Fe(l.value, (w) => (v(), I(Se, {
198
- key: w,
199
- label: w,
200
- variant: "neutral"
201
- }, null, 8, ["label"]))), 128)),
202
- p.categories.length > r.value ? (v(), I(Se, {
203
- key: 0,
204
- label: "...",
205
- variant: "neutral"
206
- })) : D("", !0)
207
- ])
208
- ]),
209
- _: 1
210
- }));
211
- };
212
- }
213
- }), al = /* @__PURE__ */ B({
214
- __name: "ProductSearcher",
215
- props: /* @__PURE__ */ Xe({
216
- label: {},
217
- helperText: {},
218
- menu: {}
219
- }, {
220
- modelValue: { required: !0 },
221
- modelModifiers: {}
222
- }),
223
- emits: ["update:modelValue"],
224
- setup(C) {
225
- const o = C, s = et(C, "modelValue"), m = x(() => o.menu.modules.item.map((t) => ({
226
- label: t.code ? `${t.code} ${t.name}` : t.name,
227
- value: t._id
228
- })));
229
- return (t, r) => {
230
- const l = K("FmSelect");
231
- return v(), I(l, {
232
- modelValue: s.value,
233
- "onUpdate:modelValue": r[0] || (r[0] = (u) => s.value = u),
234
- items: m.value,
235
- searchable: !0,
236
- "search-target": "label",
237
- placeholder: "Search by product name or code",
238
- label: t.label,
239
- "helper-text": t.helperText
240
- }, null, 8, ["modelValue", "items", "label", "helper-text"]);
241
- };
242
- }
243
- }), ol = { class: "flex" }, nl = { class: "w-[260px] space-y-16 h-full" }, rl = { class: "flex items-center gap-4 px-8" }, sl = { class: "fm-typo-en-title-sm-600" }, ul = {
244
- key: 0,
245
- class: "bg-fm-color-neutral-gray-100 rounded-md px-8 py-4"
246
- }, il = { class: "fm-typo-en-body-md-600" }, cl = { class: "flex-1" }, dt = /* @__PURE__ */ B({
247
- __name: "ViewLayout",
248
- props: /* @__PURE__ */ Xe({
249
- title: {},
250
- titleBadge: {},
251
- items: {}
252
- }, {
253
- modelValue: { required: !0 },
254
- modelModifiers: {}
255
- }),
256
- emits: ["update:modelValue"],
257
- setup(C) {
258
- const o = et(C, "modelValue");
259
- return (s, m) => {
260
- const t = K("FmCollapsibleTabs");
261
- return v(), k("div", ol, [
262
- f("div", nl, [
263
- f("div", rl, [
264
- f("p", sl, R(s.title), 1),
265
- s.titleBadge !== void 0 ? (v(), k("div", ul, [
266
- f("p", il, R(s.titleBadge), 1)
267
- ])) : D("", !0)
268
- ]),
269
- d(Re, null, {
270
- default: $(() => [
271
- d(t, {
272
- modelValue: o.value,
273
- "onUpdate:modelValue": m[0] || (m[0] = (r) => o.value = r),
274
- items: s.items
275
- }, null, 8, ["modelValue", "items"])
276
- ]),
277
- _: 1
278
- })
279
- ]),
280
- m[1] || (m[1] = f("div", { class: "w-[1px] min-h-full ml-4 mr-12 bg-fm-color-neutral-gray-100 self-stretch" }, null, -1)),
281
- f("div", cl, [
282
- _e(s.$slots, "default")
283
- ])
284
- ]);
285
- };
286
- }
287
- }), Ie = /* @__PURE__ */ B({
288
- __name: "OrderFromChip",
289
- props: {
290
- orderFrom: {}
291
- },
292
- setup(C) {
293
- const o = C, s = ke();
294
- return (m, t) => {
295
- var r, l;
296
- return v(), I(Se, {
297
- label: ((r = n(s)[o.orderFrom]) == null ? void 0 : r.label) || o.orderFrom,
298
- variant: (l = n(s)[o.orderFrom]) == null ? void 0 : l.variant
299
- }, null, 8, ["label", "variant"]);
300
- };
301
- }
302
- }), dl = /* @__PURE__ */ B({
303
- __name: "GroupViewTable",
304
- props: {
305
- data: {}
306
- },
307
- setup(C) {
308
- const o = C, s = [{
309
- accessorKey: "code",
310
- header: () => "Code",
311
- enableSorting: !1,
312
- cell: ({
313
- row: l
314
- }) => {
315
- const u = l.original;
316
- return u.subRows ? d("div", {
317
- class: "flex items-center gap-2 fm-typo-en-body-md-600 text-fm-color-typo-secondary"
318
- }, [d(Z.FmButton, {
319
- icon: "keyboard_arrow_up",
320
- variant: "tertiary",
321
- class: ["cursor-pointer", "transition-transform", l.getIsExpanded() ? "transform rotate-180" : ""],
322
- onClick: l.getToggleExpandedHandler()
323
- }, null), tt("Found in group: "), u.groupName]) : u.code;
324
- },
325
- meta: {
326
- colspan: (l) => l.original.subRows ? 5 : 1
327
- }
328
- }, {
329
- accessorKey: "productName",
330
- header: () => "Product name",
331
- enableSorting: !1,
332
- meta: {
333
- colspan: (l) => l.original.subRows ? 0 : 1
334
- }
335
- }, {
336
- accessorKey: "variant",
337
- header: () => "Variant",
338
- enableSorting: !1,
339
- meta: {
340
- colspan: (l) => l.original.subRows ? 0 : 1
341
- }
342
- }, {
343
- accessorKey: "price",
344
- header: () => "Price",
345
- enableSorting: !1,
346
- meta: {
347
- colspan: (l) => l.original.subRows ? 0 : 1
348
- }
349
- }, {
350
- accessorKey: "orderFrom",
351
- header: () => "Order from",
352
- enableSorting: !1,
353
- cell: (l) => {
354
- const u = l.row.original;
355
- return d(Ie, {
356
- orderFrom: u.orderFrom ?? ""
357
- }, null);
358
- },
359
- meta: {
360
- colspan: (l) => l.original.subRows ? 0 : 1
361
- }
362
- }], m = V({}), t = (l) => l.subRows;
363
- function r() {
364
- m.value = Object.fromEntries(o.data.map((l, u) => [u, !0]));
365
- }
366
- return se(() => o.data, () => {
367
- r();
368
- }), (l, u) => {
369
- const b = K("FmTable");
370
- return v(), I(Re, null, {
371
- default: $(() => [d(b, {
372
- "column-defs": s,
373
- "row-data": l.data,
374
- "hide-footer": !0,
375
- "page-size": 1e6,
376
- "get-sub-row": t,
377
- "expanded-state": m.value,
378
- "shrink-at": !1,
379
- "onUpdate:expandedState": u[0] || (u[0] = (p) => m.value = p)
380
- }, null, 8, ["row-data", "expanded-state"])]),
381
- _: 1
382
- });
383
- };
384
- }
385
- }), ml = /* @__PURE__ */ B({
386
- __name: "GroupView",
387
- props: {
388
- itemId: {},
389
- menu: {}
390
- },
391
- setup(C) {
392
- const o = C, s = V(""), m = x(() => t.value.reduce((p, _) => p + (typeof _.badge == "number" ? _.badge ?? 1 : 0), 0)), t = V([]), r = x(() => {
393
- const p = t.value.find((g) => g.value === s.value);
394
- return ((p == null ? void 0 : p.itemInGroup) || []).map((g) => ({
395
- groupName: g.group.name,
396
- subRows: g.items.map((w) => ({
397
- // @ts-ignore
398
- code: w.code || w.fallbackCode,
399
- productName: w.combinationKey ? "" : w.name ?? "",
400
- price: w.price ? ue.Dinero.fromFdoDinero(w.price).toFormat() : "--",
401
- orderFrom: w.orderFrom ?? void 0,
402
- variant: w.combinationKey ? w.name ?? "" : void 0
403
- }))
404
- }));
405
- });
406
- function l() {
407
- return [{
408
- label: "Master product",
409
- value: "",
410
- catalogId: null,
411
- data: [],
412
- disabled: !1,
413
- badge: void 0,
414
- itemInGroup: []
415
- }, ...o.menu.modules.catalog.map((_) => ({
416
- label: _.name,
417
- value: _._id,
418
- catalogId: _._id,
419
- data: [],
420
- disabled: !1,
421
- badge: void 0,
422
- itemInGroup: []
423
- }))];
424
- }
425
- x(() => t.value.find((p) => p.value === s.value));
426
- async function u(p) {
427
- const _ = t.value.find((g) => g.catalogId === p);
428
- if (_) {
429
- _.badge = () => d(Z.FmCircularProgress, {
430
- size: "md"
431
- }, null);
432
- const g = await Ft(ze(o.menu), p, o.itemId);
433
- _.badge = g.length, _.disabled = g.length <= 0, _.itemInGroup = g;
434
- }
435
- }
436
- function b() {
437
- t.value = l(), t.value.forEach((p) => {
438
- u(p.catalogId);
439
- });
440
- }
441
- return se([() => o.menu, () => o.itemId], () => {
442
- o.menu && o.itemId && b();
443
- }, {
444
- immediate: !0
445
- }), (p, _) => (v(), I(dt, {
446
- modelValue: s.value,
447
- "onUpdate:modelValue": _[0] || (_[0] = (g) => s.value = g),
448
- items: t.value,
449
- title: "Catalog",
450
- "title-badge": m.value
451
- }, {
452
- default: $(() => [d(dl, {
453
- data: r.value
454
- }, null, 8, ["data"])]),
455
- _: 1
456
- }, 8, ["modelValue", "items", "title-badge"]));
457
- }
458
- }), pl = {
459
- class: "scroll-x-auto"
460
- }, vl = /* @__PURE__ */ B({
461
- __name: "ProductViewTable",
462
- props: {
463
- itemId: {},
464
- menu: {},
465
- catalogId: {},
466
- schedulerIds: {}
467
- },
468
- setup(C) {
469
- const o = C, s = [{
470
- accessorKey: "scheduler",
471
- header: () => "Scheduler",
472
- enableSorting: !1,
473
- cell: (r) => {
474
- const l = r.row.original, u = l.loading ? d(Z.FmCircularProgress, {
475
- size: "md"
476
- }, null) : null;
477
- return d("div", {
478
- class: "flex items-center gap-2"
479
- }, [l.scheduler, u]);
480
- }
481
- }, {
482
- accessorKey: "code",
483
- header: () => "Code",
484
- enableSorting: !1
485
- }, {
486
- accessorKey: "productName",
487
- header: () => "Product name",
488
- enableSorting: !1
489
- }, {
490
- accessorKey: "price",
491
- header: () => "Price",
492
- enableSorting: !1
493
- }, {
494
- accessorKey: "orderFrom",
495
- header: () => "Order from",
496
- cell: (r) => {
497
- const l = r.row.original;
498
- return d(Ie, {
499
- orderFrom: l.orderFrom
500
- }, null);
501
- },
502
- enableSorting: !1
503
- }], m = V([]);
504
- function t(r, l) {
505
- return {
506
- loading: !0,
507
- schedulerId: r,
508
- scheduler: l,
509
- code: "--",
510
- productName: "--",
511
- price: "--",
512
- orderFrom: "--"
513
- };
514
- }
515
- return se([() => o.menu, () => o.catalogId, () => o.schedulerIds], async () => {
516
- m.value = [t(null, "All day"), ...o.schedulerIds.map((r) => {
517
- var l;
518
- return t(r, ((l = o.menu.modules.scheduler.find((u) => u._id === r)) == null ? void 0 : l.name) || "Unknown");
519
- })], m.value.forEach(async (r) => {
520
- const u = (await Vt(ze(o.menu), o.catalogId, r.schedulerId)).modules.item.find((p) => p._id === o.itemId), b = m.value.findIndex((p) => p.schedulerId === r.schedulerId);
521
- if (u) {
522
- const p = ze(m.value);
523
- p[b].loading = !1, p[b].code = u.code || "--", p[b].productName = u.name || "--", p[b].price = ue.Dinero.fromFdoDinero(u.price).toFormat(), p[b].orderFrom = u.orderFrom || "--", m.value = p;
524
- }
525
- });
526
- }), (r, l) => {
527
- const u = K("FmTable");
528
- return v(), I(Re, null, {
529
- default: $(() => [f("div", pl, [d(u, {
530
- class: "min-w-[800px]",
531
- "column-defs": s,
532
- "row-data": m.value,
533
- "hide-footer": !0,
534
- "page-size": m.value.length,
535
- "shrink-at": !1
536
- }, null, 8, ["row-data", "page-size"])])]),
537
- _: 1
538
- });
539
- };
540
- }
541
- }), fl = /* @__PURE__ */ B({
542
- __name: "ProductView",
543
- props: {
544
- itemId: {},
545
- menu: {}
546
- },
547
- setup(C) {
548
- const o = C, s = V(null);
549
- lt(async () => {
550
- s.value = await It(o.menu, o.itemId), await Oe(), m.value = t.value[0].value;
551
- });
552
- const m = V(""), t = x(() => {
553
- var b, p;
554
- const l = {
555
- label: "Master product",
556
- value: "",
557
- catalogId: null,
558
- badge: (((b = s.value) == null ? void 0 : b.schedulers.length) || 0) + 1,
559
- schedulerIds: (p = s.value) == null ? void 0 : p.schedulers
560
- };
561
- if (!s.value)
562
- return [l];
563
- const u = o.menu.modules.catalog.map((_) => {
564
- const g = s.value.catalogs[_._id];
565
- return {
566
- label: _.name,
567
- value: _._id,
568
- disabled: !g,
569
- catalogId: _._id,
570
- badge: g ? ((g == null ? void 0 : g.schedulers.length) || 0) + 1 : 0,
571
- schedulerIds: g == null ? void 0 : g.schedulers
572
- };
573
- });
574
- return [l, ...u];
575
- }), r = x(() => t.value.find((l) => l.value === m.value));
576
- return (l, u) => (v(), I(dt, {
577
- modelValue: m.value,
578
- "onUpdate:modelValue": u[0] || (u[0] = (b) => m.value = b),
579
- items: t.value,
580
- title: "Catalog",
581
- "title-badge": t.value.filter((b) => !b.disabled).length
582
- }, {
583
- default: $(() => {
584
- var b, p;
585
- return [
586
- d(vl, {
587
- menu: l.menu,
588
- "item-id": l.itemId,
589
- "catalog-id": ((b = r.value) == null ? void 0 : b.catalogId) || null,
590
- "scheduler-ids": ((p = r.value) == null ? void 0 : p.schedulerIds) || []
591
- }, null, 8, ["menu", "item-id", "catalog-id", "scheduler-ids"])
592
- ];
593
- }),
594
- _: 1
595
- }, 8, ["modelValue", "items", "title-badge"]));
596
- }
597
- }), gl = { class: "flex items-center gap-8" }, bl = { class: "space-y-4" }, _l = { class: "fm-typo-en-title-md-600" }, yl = { key: 0 }, hl = { class: "text-fm-color-typo-secondary" }, xl = {
598
- key: 0,
599
- class: "text-fm-color-typo-secondary"
600
- }, Cl = { class: "flex items-center gap-4" }, wl = /* @__PURE__ */ B({
601
- __name: "ProductBaseInfo",
602
- props: {
603
- itemId: {},
604
- menu: {}
605
- },
606
- setup(C) {
607
- const o = C, s = x(() => o.menu.modules.item.find((t) => t._id === o.itemId)), m = x(() => {
608
- var t;
609
- return ue.Dinero.fromFdoDinero((t = s.value) == null ? void 0 : t.price).toFormat(!0);
610
- });
611
- return (t, r) => {
612
- var l, u, b, p, _, g, w;
613
- return v(), k("div", gl, [
614
- d(Ue, {
615
- alt: ((l = s.value) == null ? void 0 : l.name) ?? null,
616
- size: 72,
617
- src: (u = s.value) == null ? void 0 : u.thumbnail,
618
- crossorigin: !1
619
- }, null, 8, ["alt", "src"]),
620
- f("div", bl, [
621
- f("p", _l, [
622
- (b = s.value) != null && b.code ? (v(), k("span", yl, R((p = s.value) == null ? void 0 : p.code) + ", ", 1)) : D("", !0),
623
- f("span", null, R((_ = s.value) == null ? void 0 : _.name), 1)
624
- ]),
625
- f("p", hl, "Base price: " + R(m.value), 1),
626
- (g = s.value) != null && g.customAttributes ? (v(), k("div", xl, [
627
- f("div", Cl, [
628
- r[0] || (r[0] = f("span", null, "Tagging:", -1)),
629
- d(De, {
630
- ellipsis: !1,
631
- "custom-attributes": (w = s.value) == null ? void 0 : w.customAttributes
632
- }, null, 8, ["custom-attributes"])
633
- ])
634
- ])) : D("", !0)
635
- ])
636
- ]);
637
- };
638
- }
639
- }), kl = { class: "space-y-16" }, Sl = /* @__PURE__ */ B({
640
- __name: "ProductViewer",
641
- props: {
642
- itemId: {},
643
- menu: {}
644
- },
645
- setup(C) {
646
- const o = V("product"), s = x(() => [
647
- {
648
- value: "product",
649
- label: "Product",
650
- component: fl
651
- },
652
- {
653
- value: "group",
654
- label: "Group",
655
- component: ml
656
- }
657
- ]);
658
- return (m, t) => {
659
- var l;
660
- const r = K("FmTabs");
661
- return v(), k("div", kl, [
662
- d(wl, {
663
- "item-id": m.itemId,
664
- menu: m.menu
665
- }, null, 8, ["item-id", "menu"]),
666
- f("div", null, [
667
- d(r, {
668
- modelValue: o.value,
669
- "onUpdate:modelValue": t[0] || (t[0] = (u) => o.value = u),
670
- items: s.value
671
- }, null, 8, ["modelValue", "items"])
672
- ]),
673
- f("div", null, [
674
- (v(), I(at((l = s.value.find((u) => u.value === o.value)) == null ? void 0 : l.component), {
675
- "item-id": m.itemId,
676
- menu: m.menu
677
- }, null, 8, ["item-id", "menu"]))
678
- ])
679
- ]);
680
- };
681
- }
682
- }), Fl = { class: "space-y-24" }, Vl = { key: 0 }, Il = /* @__PURE__ */ B({
683
- __name: "ProductOverview",
684
- props: {
685
- itemId: {},
686
- showSearch: { type: Boolean, default: !1 }
687
- },
688
- setup(C) {
689
- const o = C, s = $e(), m = V(null);
690
- return ot(() => {
691
- m.value = o.itemId;
692
- }), (t, r) => (v(), k("div", Fl, [
693
- t.showSearch ? (v(), k("div", Vl, [
694
- d(al, {
695
- modelValue: m.value,
696
- "onUpdate:modelValue": r[0] || (r[0] = (l) => m.value = l),
697
- class: "w-1/2",
698
- label: "Search and compare prices",
699
- "helper-text": "Quickly find products and view their prices across different catalogs and schedules.",
700
- menu: n(s).state.menu
701
- }, null, 8, ["modelValue", "menu"])
702
- ])) : D("", !0),
703
- f("div", null, [
704
- m.value ? (v(), I(Sl, {
705
- key: 0,
706
- "item-id": m.value,
707
- menu: n(s).state.menu
708
- }, null, 8, ["item-id", "menu"])) : D("", !0)
709
- ])
710
- ]));
711
- }
712
- }), $l = /* @__PURE__ */ B({
713
- __name: "OverviewSheet",
714
- setup(C) {
715
- const o = V(null), s = V(!1);
716
- function m(t) {
717
- s.value = !s.value, t && (o.value = t);
718
- }
719
- return (t, r) => {
720
- const l = K("FmSideSheet");
721
- return v(), k(ie, null, [
722
- _e(t.$slots, "default", { trigger: m }),
723
- d(l, {
724
- id: "product-overview",
725
- modelValue: s.value,
726
- "onUpdate:modelValue": r[0] || (r[0] = (u) => s.value = u),
727
- "max-width": 1200,
728
- "dismiss-away": ""
729
- }, {
730
- "side-sheet-header": $(() => r[1] || (r[1] = [
731
- f("p", { class: "fm-typo-en-title-md-600" }, "Product Overview", -1)
732
- ])),
733
- default: $(() => [
734
- f("div", null, [
735
- s.value && o.value ? (v(), I(Il, {
736
- key: 0,
737
- "item-id": o.value
738
- }, null, 8, ["item-id"])) : D("", !0)
739
- ])
740
- ]),
741
- _: 1
742
- }, 8, ["modelValue"])
743
- ], 64);
744
- };
745
- }
746
- });
747
- var Tl = Tt();
748
- const Je = /* @__PURE__ */ B({
749
- __name: "ImportButton",
750
- setup(C) {
751
- const o = V(!1);
752
- function s() {
753
- o.value = !o.value;
754
- }
755
- const m = Ke();
756
- return ot(() => {
757
- const t = m.currentCountry.value;
758
- if (t)
759
- try {
760
- Tl.setCountryConfig(t);
761
- } catch (r) {
762
- console.log("Unable to set country config", r);
763
- }
764
- }), (t, r) => (v(), k(ie, null, [
765
- d(Pt, {
766
- modelValue: o.value,
767
- "onUpdate:modelValue": r[0] || (r[0] = (l) => o.value = l)
768
- }, null, 8, ["modelValue"]),
769
- _e(t.$slots, "default", { trigger: s })
770
- ], 64));
771
- }
772
- }), Ze = (C) => d("div", {
773
- class: "flex flex-1 justify-end"
774
- }, [d("span", null, [C, tt(" ")])]), Pl = {
775
- class: "flex justify-between items-center space-x-8"
776
- }, Al = {
777
- class: "flex space-x-8"
778
- }, Ml = {
779
- class: "w-[320px]"
780
- }, Ol = {
781
- key: 0
782
- }, zl = {
783
- key: 1,
784
- class: /* @__PURE__ */ ce(["flex-1 flex flex-col", "divide-y divide-fm-color-neutral-gray-100", "overflow-hidden"])
785
- }, Dl = {
786
- key: 0,
787
- class: "flex items-center p-4"
788
- }, Ul = {
789
- class: /* @__PURE__ */ ce(["mr-8", "fm-typo-en-body-md-400"])
790
- }, Kl = {
791
- key: 1,
792
- class: "px-16 py-4 space-x-8 flex justify-end"
793
- }, Nl = {
794
- key: 2
795
- }, Rl = {
796
- class: "flex space-x-8"
797
- }, Bl = {
798
- key: 1,
799
- class: "pt-8 flex flex-col flex-1 overflow-hidden"
800
- }, jl = {
801
- class: "space-y-8 pb-8"
802
- }, El = {
803
- class: "w-full px-8"
804
- }, Gl = {
805
- class: "flex space-x-8 px-8"
806
- }, Ll = {
807
- key: 0,
808
- class: "px-8"
809
- }, Wl = {
810
- key: 0,
811
- class: /* @__PURE__ */ ce(["flex flex-col flex-1", "overflow-scroll", "divide-y divide-fm-color-neutral-gray-100", "pb-64"])
812
- }, ql = ["onClick"], Ql = {
813
- class: "min-w-0 flex flex-1 items-center justify-start space-x-16"
814
- }, Hl = {
815
- class: "flex-1 min-w-0"
816
- }, Yl = {
817
- class: "flex justify-between items-center gap-8 pb-4"
818
- }, Jl = {
819
- class: "flex-1 min-w-0 fm-typo-en-body-lg-600 line-clamp-2"
820
- }, Zl = {
821
- class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
822
- }, Xl = {
823
- class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
824
- }, ea = {
825
- class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
826
- }, ta = {
827
- key: 1
828
- }, la = {
829
- class: "flex space-x-8"
830
- }, aa = /* @__PURE__ */ B({
831
- __name: "ProductTable",
832
- props: {
833
- modelValue: {},
834
- originalValue: {},
835
- isCalculating: {
836
- type: Boolean
837
- }
838
- },
839
- emits: ["update:model-value", "reset:model-value", "update:editing", "update:search-key"],
840
- setup(C, {
841
- expose: o,
842
- emit: s
843
- }) {
844
- const m = C, {
845
- t
846
- } = Te(), r = Ke(), l = $e(), u = st(), b = ut(), p = nt(u), _ = rt(p);
847
- it({
848
- dialog: b,
849
- menuLoader: _
850
- });
851
- const g = ct();
852
- x(() => !l.state.currentSchedulerId);
853
- const w = r.currentCountry, te = x(() => w.value ? ue.Country.getCountry(w.value) : null), H = x(() => l.rules.item);
854
- x(() => le.value.length === 1 && le.value[0].id === null);
855
- const {
856
- selectedCategories: le
857
- } = Ve(), L = x(() => {
858
- const e = ge.flatten(le.value.map((a) => a.items));
859
- return ge.uniqBy(e, (a) => a._id);
860
- }), ae = s, S = V(!1);
861
- se(() => S.value, (e) => {
862
- ae("update:editing", e);
863
- });
864
- const oe = (e) => {
865
- Kt.isBoolean(e) ? S.value = e : S.value = !S.value;
866
- }, T = V(!1), N = V(null);
867
- async function X() {
868
- T.value = !T.value, T.value && (await Oe(), N.value && N.value.toggleProperty(!0));
869
- }
870
- o({
871
- toggleAttributeFilter: X
872
- });
873
- const Y = V({
874
- logic: "AND",
875
- rules: []
876
- });
877
- function de(e) {
878
- const a = L.value.map((i) => {
879
- var h;
880
- return (h = i.customAttributes) == null ? void 0 : h[e];
881
- }).filter((i) => typeof i == "string" && !!i);
882
- return [...new Set(a)];
883
- }
884
- const j = x(() => r.itemAttributeSettings.value.map((e) => {
885
- const a = de(e.key);
886
- return {
887
- ...e,
888
- values: a
889
- };
890
- })), P = V(""), M = Bt(P, 300), A = x(() => {
891
- const e = (c) => {
892
- var h;
893
- return !M.value || !M.value.trim() ? !0 : [c.code, c.name, je(c), ...Me(O.value, c), (h = ke()[c.orderFrom]) == null ? void 0 : h.label, Object.values(c.customAttributes ?? {}).join(" ")].join(" ").toLowerCase().includes(M.value.toLowerCase());
894
- }, a = (c) => !c.customAttributes && !Y.value.rules.length ? !0 : St(c.customAttributes ?? {}, Y.value);
895
- return L.value.filter((c) => e(c) && a(c));
896
- }), {
897
- categories: O
898
- } = Ve(), Q = x(() => l.categories.map((e) => ({
899
- label: e.name,
900
- value: e._id || null
901
- }))), G = (e, a, c) => {
902
- let i = ge.clone(m.modelValue);
903
- const h = i[e];
904
- h && (typeof a == "object" && a !== null ? i[e] = {
905
- ...h,
906
- ...a
907
- } : i[e] = {
908
- ...h,
909
- [a]: c
910
- }, ae("update:model-value", i));
911
- }, U = ge.debounce(G, 300), z = (e) => (a) => !!a || t("menu.product.table.validation.name_required", {
912
- field: e
913
- }), ne = (e) => e >= 0 || t("menu.product.table.validation.price_min"), E = [z("Name")], me = () => [(e) => ne(typeof e == "number" ? e : Number(e) ?? 0)], he = ke(), xe = x(() => Ct.setCoreStore(r).taxSetting()), fe = x(() => [{
914
- accessorKey: "thumbnail",
915
- header: "",
916
- size: 110,
917
- meta: {
918
- cellClass: "px-0",
919
- headerContentClass: "px-0"
920
- },
921
- cell: (e) => {
922
- var a, c;
923
- return W(Ue, {
924
- src: e.getValue(),
925
- alt: (c = (a = e == null ? void 0 : e.row) == null ? void 0 : a.original) == null ? void 0 : c.name,
926
- className: "my-8 mx-12",
927
- size: 72,
928
- crossorigin: !1
929
- });
930
- },
931
- enableSorting: !1
932
- }, {
933
- accessorKey: "code",
934
- header: () => t("menu.product.table.columns.code"),
935
- enableSorting: !1,
936
- size: 100,
937
- cell: (e) => {
938
- const a = e.row.original, c = e.getValue() || "--";
939
- if (!S.value) return d("span", {
940
- class: "break-all"
941
- }, [c]);
942
- const i = Ae(a._id);
943
- return W(Z.FmTextField, {
944
- disabled: !H.value.code,
945
- modelValue: i == null ? void 0 : i.code,
946
- placeholder: m.modelValue[a._id].fallbackCode,
947
- "onUpdate:modelValue": (h) => {
948
- U(a._id, "code", h);
949
- }
950
- });
951
- }
952
- }, {
953
- accessorKey: "name",
954
- header: () => t("menu.product.table.columns.name"),
955
- enableSorting: !1,
956
- size: 200,
957
- cell: (e) => {
958
- const a = e.row.original, c = e.getValue();
959
- return S.value ? W(Z.FmTextField, {
960
- disabled: !H.value.name,
961
- modelValue: a.name,
962
- "onUpdate:modelValue": (i) => {
963
- U(a._id, "name", i);
964
- },
965
- rules: E,
966
- placeholder: a.fallbackName
967
- }) : c;
968
- }
969
- }, {
970
- accessorKey: "price",
971
- header: () => {
972
- var e;
973
- return Ze(t("menu.product.table.columns.price", {
974
- currency: (e = te.value) == null ? void 0 : e.currency.symbol
975
- }));
976
- },
977
- enableSorting: !1,
978
- size: 140,
979
- meta: {
980
- textAlign: "right"
981
- },
982
- cell: (e) => {
983
- var h;
984
- const a = e.getValue();
985
- if (!S.value) return ue.Dinero.fromFdoDinero(a).toFormat();
986
- const c = m.modelValue[e.row.original._id], i = c.fallbackPrice;
987
- return W(Ut, {
988
- min: 0,
989
- disabled: !c.editPrice,
990
- // @ts-ignore
991
- placeholder: i ? Nt(i, !1) : void 0,
992
- modelValue: (h = Ae(c._id)) == null ? void 0 : h.price,
993
- // @ts-ignore
994
- "onUpdate:modelValue": (F) => {
995
- G(c._id, "price", F);
996
- },
997
- rules: me()
998
- });
999
- }
1000
- }, {
1001
- accessorKey: "taxes",
1002
- header: () => Ze(xe.value.systemCode),
1003
- size: S.value ? 120 : 80,
1004
- enableSorting: !1,
1005
- meta: {
1006
- textAlign: "right"
1007
- },
1008
- cell: (e) => {
1009
- const a = e.getValue(), c = e.row.original, i = l.taxSetting.countryTaxOptions, h = l.getSelectedTax(a, c.fallbackTaxes, l.taxSetting.countryTaxOptions), F = i.find((ee) => ee.value === h);
1010
- if (!S.value)
1011
- return `${F != null && F.meta.rate ? wt(F.meta.rate) : 0}%`;
1012
- const y = l.getSelectedTax(a, c.fallbackTaxes, l.taxSetting.countryTaxOptions);
1013
- return W(Z.FmSelect, {
1014
- disabled: !H.value.tax,
1015
- items: l.taxSetting.countryTaxOptions,
1016
- modelValue: y,
1017
- "onUpdate:modelValue": async (ee) => {
1018
- const we = l.decodeTax(ee);
1019
- U(c._id, "taxes", [we]);
1020
- }
1021
- });
1022
- }
1023
- }, {
1024
- accessorKey: "category",
1025
- header: () => t("menu.product.table.columns.category"),
1026
- enableSorting: !1,
1027
- size: 140,
1028
- cell: (e) => {
1029
- const a = e.row.original;
1030
- if (!S.value)
1031
- return W(Ye, {
1032
- categories: Me(O.value, a)
1033
- });
1034
- const c = kt(a), i = (c == null ? void 0 : c.map((F) => F._id)) ?? [], h = c == null ? void 0 : c.reduce((F, y) => (F[y._id] = y, F), {});
1035
- return W(Ot, {
1036
- shouldShowChips: !1,
1037
- shouldShowSelectedItemsWithinPlaceholder: !0,
1038
- modelValue: i.length > 0 ? i : [null],
1039
- items: Q.value,
1040
- disabled: !!(l.state.currentCatalogId || l.state.currentSchedulerId),
1041
- "onUpdate:modelValue": async (F) => {
1042
- const [y, ...ee] = F;
1043
- U(a._id, {
1044
- category: y,
1045
- additionalCategories: ee.map((we) => {
1046
- const Ge = h == null ? void 0 : h[we];
1047
- return Ge || {
1048
- _id: we,
1049
- position: null
1050
- };
1051
- })
1052
- });
1053
- }
1054
- });
1055
- }
1056
- }, {
1057
- id: "tagging",
1058
- accessorKey: "tagging",
1059
- header: () => t("menu.product.table.columns.tagging"),
1060
- enableSorting: !1,
1061
- size: 140,
1062
- cell: (e) => {
1063
- const a = e.row.original;
1064
- return W(De, {
1065
- customAttributes: a.customAttributes
1066
- });
1067
- }
1068
- }, {
1069
- accessorKey: "orderFrom",
1070
- header: () => t("menu.product.table.columns.order_from"),
1071
- enableSorting: !0,
1072
- sortingFn: (e, a) => {
1073
- const [c, i] = [e, a].map((h) => he[h.original.orderFrom].sortingIndex);
1074
- return c - i;
1075
- },
1076
- size: 140,
1077
- cell: (e) => {
1078
- const a = e.getValue(), c = e.row.original;
1079
- return S.value ? W(Z.FmSelect, {
1080
- disabled: !H.value.orderFrom,
1081
- items: Object.values(ke()),
1082
- modelValue: a,
1083
- "onUpdate:modelValue": async (i) => {
1084
- G(c._id, "orderFrom", i);
1085
- }
1086
- }) : W(Ie, {
1087
- orderFrom: a
1088
- });
1089
- }
1090
- }, {
1091
- id: "actions",
1092
- size: 100,
1093
- meta: {
1094
- cellClass: "pl-16",
1095
- headerClass: "py-4",
1096
- textAlign: "right"
1097
- },
1098
- header: () => W("div", {
1099
- class: "w-full px-4 flex justify-end"
1100
- }, [Rt(W(Z.FmButton, {
1101
- variant: J.Tertiary,
1102
- textColor: q.NeutralGray400,
1103
- prependIcon: "edit",
1104
- class: "flex justify-end",
1105
- onClick: oe,
1106
- type: "button"
1107
- }), "Bulk edit")]),
1108
- cell: (e) => {
1109
- const a = e.row.original;
1110
- return d("div", {
1111
- class: "px-4 flex justify-end"
1112
- }, [d($l, null, {
1113
- default: ({
1114
- trigger: c
1115
- }) => d(Z.FmButton, {
1116
- icon: "overview",
1117
- variant: "tertiary",
1118
- textColor: q.NeutralGray400,
1119
- onClick: ve(() => {
1120
- c(a._id);
1121
- }, ["stop", "prevent"])
1122
- }, null)
1123
- }), d(Z.FmButton, {
1124
- icon: "delete",
1125
- variant: "tertiary",
1126
- textColor: q.NeutralGray400,
1127
- onClick: ve(async () => {
1128
- await g.deleteItem([{
1129
- _id: a._id,
1130
- name: a.name,
1131
- thumbnail: a.thumbnail
1132
- }]);
1133
- }, ["stop", "prevent"])
1134
- }, null)]);
1135
- }
1136
- }]);
1137
- l.taxSetting.systemCode || fe.value.splice(4, 1);
1138
- const pe = V({}), re = V([]);
1139
- se([() => pe.value, () => A.value], (e) => {
1140
- let a = [];
1141
- Object.keys(e[0]).forEach((c) => {
1142
- const i = e[0][c], h = A.value[parseInt(c)];
1143
- h && (i ? a.push(h) : re.value = a.filter((F) => F !== h));
1144
- }), re.value = a;
1145
- }), se(() => L.value, () => {
1146
- pe.value = {}, re.value = [];
1147
- }), se(() => S.value, () => {
1148
- pe.value = {}, re.value = [];
1149
- });
1150
- const mt = () => {
1151
- pe.value = {};
1152
- };
1153
- async function Be() {
1154
- await Oe();
1155
- const e = () => !!l.currentCatalog || !!l.state.currentSchedulerId, a = (i) => i === "" || i === null ? e() ? "" : null : i, c = Object.values(m.modelValue).filter((i) => {
1156
- const h = Object.values(m.originalValue).find((F) => F._id === i._id);
1157
- return Le(h, i);
1158
- }).map((i) => ({
1159
- _id: i._id,
1160
- name: i.name,
1161
- code: i.code,
1162
- price: i.price,
1163
- orderFrom: i.orderFrom ?? null,
1164
- taxes: i.taxes,
1165
- category: a(i.category || null),
1166
- additionalCategories: i.additionalCategories
1167
- }));
1168
- await g.updateMany(c), oe(!1);
1169
- }
1170
- const pt = async () => {
1171
- await g.deleteItem(re.value.map((e) => ({
1172
- _id: e._id,
1173
- name: e.name,
1174
- thumbnail: e.thumbnail
1175
- })));
1176
- }, Ce = () => {
1177
- ae("reset:model-value");
1178
- }, Pe = () => {
1179
- Object.entries(m.modelValue).some(([a, c]) => Le(c, m.originalValue[a])) ? b.open({
1180
- title: "You have unsaved changes!",
1181
- message: "Are you sure you want to discard? You will lose all the changes if discard edit.",
1182
- primaryActions: {
1183
- text: "Discard",
1184
- close: !0,
1185
- variant: J.Destructive
1186
- },
1187
- secondaryActions: {
1188
- text: "Cancel",
1189
- close: !0
1190
- }
1191
- }).onPrimary(() => {
1192
- Ce(), oe(!1);
1193
- }) : (oe(!1), Ce());
1194
- }, vt = x(() => {
1195
- var e, a;
1196
- return {
1197
- thumbnail: !S.value,
1198
- actions: !S.value,
1199
- tagging: !S.value && ((a = (e = r.itemAttributeSettings) == null ? void 0 : e.value) == null ? void 0 : a.length) > 0
1200
- };
1201
- }), ft = (e) => {
1202
- g.update(e._id);
1203
- };
1204
- async function gt(e) {
1205
- await g.update(e.original._id);
1206
- }
1207
- function je(e) {
1208
- var F;
1209
- const a = e.price ?? // TODO: fix type error
1210
- // @ts-ignore
1211
- e.fallbackPrice ?? ue.Dinero.fromNumber({
1212
- number: 0
1213
- }).toObject(), c = e.taxes;
1214
- l.taxSetting.countryTaxOptions;
1215
- const i = ue.Dinero.fromFdoDinero(a).toFormat(), h = (F = te.value) == null ? void 0 : F.currency.symbol;
1216
- return l.getSelectedTax(
1217
- c,
1218
- // TODO: fix type error
1219
- // @ts-ignore
1220
- e.fallbackTaxes,
1221
- l.taxSetting.countryTaxOptions
1222
- ), `${h == null ? void 0 : h.toUpperCase()}${i}`;
1223
- }
1224
- function Ae(e) {
1225
- var i;
1226
- const a = l.currentCatalog, c = l.state.currentSchedulerId;
1227
- if (a && c) {
1228
- const h = a.override.scheduler[c] ?? {}, F = (i = h == null ? void 0 : h.items) == null ? void 0 : i.filter((y) => y._id === e);
1229
- return F == null ? void 0 : F[0];
1230
- } else return a ? a.override.items[e][0] : c ? l.schedulers.find((y) => y._id === c).items.filter((y) => y._id === e)[0] : L.value.find((h) => h._id === e);
1231
- }
1232
- const bt = Ne(), _t = x(() => bt.breakpoints.value.xs), Ee = V(null), yt = Dt(Ee, T), ht = x(() => {
1233
- var a;
1234
- return {
1235
- height: `calc(100vh - ${((a = yt.value) == null ? void 0 : a.top) + 24}px)`
1236
- };
1237
- });
1238
- return qt(), (e, a) => {
1239
- const c = K("fm-search"), i = K("fm-button"), h = K("fm-table"), F = K("fm-form");
1240
- return _t.value ? (v(), k("div", Bl, [f("div", jl, [f("div", El, [d(c, {
1241
- "model-value": P.value,
1242
- "onUpdate:modelValue": a[5] || (a[5] = (y) => P.value = y),
1243
- autofocus: "",
1244
- placeholder: n(t)("menu.product.table.search.placeholder")
1245
- }, null, 8, ["model-value", "placeholder"])]), a[8] || (a[8] = f("div", {
1246
- class: "w-full h-[1px] bg-fm-color-neutral-gray-100"
1247
- }, null, -1)), f("div", Gl, [_e(e.$slots, "filter")]), T.value ? (v(), k("div", Ll, [d(n(qe), {
1248
- ref_key: "attributeFilterRef",
1249
- ref: N,
1250
- attributes: j.value,
1251
- modelValue: Y.value,
1252
- "onUpdate:modelValue": a[6] || (a[6] = (y) => Y.value = y)
1253
- }, null, 8, ["attributes", "modelValue"])])) : D("", !0)]), L.value.length ? (v(), k("div", Wl, [(v(!0), k(ie, null, Fe(A.value, (y) => {
1254
- var ee;
1255
- return v(), k("div", {
1256
- key: y._id,
1257
- class: "max-w-full py-12 px-16 space-x-16 flex items-center",
1258
- onClick: () => ft(y)
1259
- }, [f("div", Ql, [d(Ue, {
1260
- alt: y.name,
1261
- size: 72,
1262
- src: y.thumbnail
1263
- }, null, 8, ["alt", "src"]), f("div", Hl, [f("div", Yl, [f("p", Jl, R(y.name), 1), d(Ie, {
1264
- "order-from": y.orderFrom
1265
- }, null, 8, ["order-from"])]), f("p", Zl, R(je(y)), 1), f("p", Xl, R(n(t)("menu.product.table.columns.code")) + ": " + R(((ee = Ae(y._id)) == null ? void 0 : ee.code) || "--"), 1), f("p", ea, [d(Ye, {
1266
- categories: n(Me)(n(O), y)
1267
- }, null, 8, ["categories"])]), d(De, {
1268
- "custom-attributes": y.customAttributes
1269
- }, null, 8, ["custom-attributes"])])]), d(i, {
1270
- "text-color": n(q).NeutralGray400,
1271
- variant: n(J).Tertiary,
1272
- "prepend-icon": "delete",
1273
- onClick: ve(() => n(g).deleteItem([{
1274
- _id: y._id,
1275
- name: y.name,
1276
- thumbnail: y.thumbnail
1277
- }]), ["stop"])
1278
- }, null, 8, ["text-color", "variant", "onClick"])], 8, ql);
1279
- }), 128))])) : (v(), k("div", ta, [d(be, {
1280
- subtitle: n(t)("menu.product.table.empty.subtitle"),
1281
- title: n(t)("menu.product.table.empty.title")
1282
- }, {
1283
- action: $(() => [f("div", la, [d(i, {
1284
- variant: n(J).Primary,
1285
- label: n(t)("menu.product.table.empty.actions.add"),
1286
- "prepend-icon": "add",
1287
- onClick: a[7] || (a[7] = (y) => n(g).create(null))
1288
- }, null, 8, ["variant", "label"]), d(Je, null, {
1289
- default: $(({
1290
- trigger: y
1291
- }) => [d(i, {
1292
- "bg-color": n(q).NeutralGray100,
1293
- "text-color": n(q).NeutralGray400,
1294
- variant: n(J).Primary,
1295
- label: n(t)("menu.product.table.empty.actions.import"),
1296
- "prepend-icon": "download",
1297
- onClick: y
1298
- }, null, 8, ["bg-color", "text-color", "variant", "label", "onClick"])]),
1299
- _: 1
1300
- })])]),
1301
- _: 1
1302
- }, 8, ["subtitle", "title"])]))])) : (v(), I(F, {
1303
- key: 0,
1304
- "blame-form-child-on-validation-failed": "",
1305
- class: "flex flex-col flex-1 space-y-8 overflow-hidden",
1306
- onValidationSuccess: Be
1307
- }, {
1308
- default: $(() => [f("div", Pl, [f("div", Al, [_e(e.$slots, "filter")]), f("div", Ml, [d(c, {
1309
- "model-value": P.value,
1310
- "onUpdate:modelValue": a[0] || (a[0] = (y) => P.value = y),
1311
- autofocus: "",
1312
- placeholder: n(t)("menu.product.table.search.placeholder")
1313
- }, null, 8, ["model-value", "placeholder"])])]), T.value ? (v(), k("div", Ol, [d(n(qe), {
1314
- ref_key: "attributeFilterRef",
1315
- ref: N,
1316
- attributes: j.value,
1317
- modelValue: Y.value,
1318
- "onUpdate:modelValue": a[1] || (a[1] = (y) => Y.value = y)
1319
- }, null, 8, ["attributes", "modelValue"])])) : D("", !0), L.value.length ? (v(), k("div", zl, [re.value.length && !S.value ? (v(), k("div", Dl, [f("p", Ul, R(n(t)("menu.product.table.selection.count", {
1320
- count: re.value.length
1321
- })), 1), d(i, {
1322
- label: n(t)("menu.product.table.selection.actions.deselect_all"),
1323
- type: "button",
1324
- variant: "plain",
1325
- onClick: mt
1326
- }, null, 8, ["label"]), d(i, {
1327
- "border-color": n(q).SystemError300,
1328
- "text-color": n(q).SystemError300,
1329
- class: "ml-auto",
1330
- label: n(t)("menu.product.table.selection.actions.remove"),
1331
- "prepend-icon": "delete",
1332
- variant: "secondary",
1333
- onClick: pt
1334
- }, null, 8, ["border-color", "text-color", "label"])])) : D("", !0), S.value ? (v(), k("div", Kl, [d(i, {
1335
- variant: n(J).Tertiary,
1336
- label: n(t)("menu.product.table.bulk_edit.actions.reset_all"),
1337
- onClick: Ce
1338
- }, null, 8, ["variant", "label"]), d(i, {
1339
- variant: n(J).Tertiary,
1340
- label: n(t)("menu.common.actions.cancel"),
1341
- onClick: Pe
1342
- }, null, 8, ["variant", "label"]), d(i, {
1343
- borderColor: n(q).ColorPrimary,
1344
- textColor: n(q).ColorPrimary,
1345
- variant: n(J).Secondary,
1346
- label: n(t)("menu.product.table.bulk_edit.actions.save"),
1347
- type: "submit"
1348
- }, null, 8, ["borderColor", "textColor", "variant", "label"])])) : D("", !0), f("div", {
1349
- ref_key: "tableWrapper",
1350
- ref: Ee
1351
- }, [(v(), I(at(S.value ? zt : "div"), {
1352
- ref: "fullWrapper",
1353
- title: S.value ? n(t)("menu.product.table.bulk_edit.title") : "",
1354
- show: S.value,
1355
- "primary-action": {
1356
- label: n(t)("menu.product.table.bulk_edit.actions.save")
1357
- },
1358
- "secondary-actions": [{
1359
- label: n(t)("menu.product.table.bulk_edit.actions.reset_all"),
1360
- click: Ce
1361
- }, {
1362
- label: n(t)("menu.common.actions.cancel"),
1363
- click: Pe
1364
- }],
1365
- class: "overflow-x-scroll",
1366
- style: xt(ht.value),
1367
- onOnPrimary: Be,
1368
- onOnCancel: Pe
1369
- }, {
1370
- default: $(() => [d(h, {
1371
- class: ce({
1372
- "min-w-[1100px]": !0,
1373
- "mt-24": S.value
1374
- }),
1375
- modelValue: pe.value,
1376
- "onUpdate:modelValue": a[2] || (a[2] = (y) => pe.value = y),
1377
- "column-defs": fe.value,
1378
- "column-visibility": vt.value,
1379
- loading: e.isCalculating,
1380
- "page-size": A.value.length,
1381
- "row-data": A.value,
1382
- "shrink-at": !1,
1383
- selection: S.value ? void 0 : "multiple",
1384
- virtual: !0,
1385
- "virtual-row-height": S.value ? 48 : 91,
1386
- "hide-footer": "",
1387
- "pin-header-row": "",
1388
- onRowClick: a[3] || (a[3] = (y) => S.value ? void 0 : gt(y))
1389
- }, null, 8, ["class", "modelValue", "column-defs", "column-visibility", "loading", "page-size", "row-data", "selection", "virtual-row-height"])]),
1390
- _: 1
1391
- }, 40, ["title", "show", "primary-action", "secondary-actions", "style"]))], 512)])) : (v(), k("div", Nl, [d(be, {
1392
- subtitle: n(t)("menu.product.table.empty.subtitle"),
1393
- title: n(t)("menu.product.table.empty.title")
1394
- }, {
1395
- action: $(() => [f("div", Rl, [d(i, {
1396
- variant: n(J).Primary,
1397
- label: n(t)("menu.product.table.empty.actions.add"),
1398
- "prepend-icon": "add",
1399
- onClick: a[4] || (a[4] = (y) => n(g).create(null))
1400
- }, null, 8, ["variant", "label"]), d(Je, null, {
1401
- default: $(({
1402
- trigger: y
1403
- }) => [d(i, {
1404
- "bg-color": n(q).NeutralGray100,
1405
- "text-color": n(q).NeutralGray400,
1406
- variant: n(J).Primary,
1407
- label: n(t)("menu.product.table.empty.actions.import"),
1408
- "prepend-icon": "download",
1409
- onClick: y
1410
- }, null, 8, ["bg-color", "text-color", "variant", "label", "onClick"])]),
1411
- _: 1
1412
- })])]),
1413
- _: 1
1414
- }, 8, ["subtitle", "title"])]))]),
1415
- _: 3
1416
- }));
1417
- };
1418
- }
1419
- }), oa = {
1420
- key: 0,
1421
- class: /* @__PURE__ */ ce(["flex flex-col", "flex-1", "overflow-hidden"])
1422
- }, na = {
1423
- class: /* @__PURE__ */ ce(["pt-16 xs:pt-0", "flex xs:flex-col", "flex-1", "w-full", "overflow-hidden"])
1424
- }, ra = { class: "flex flex-col flex-1 overflow-hidden" }, sa = {
1425
- key: 1,
1426
- class: "pt-16 xs:pt-8 space-y-24"
1427
- }, ua = { class: "flex items-center gap-8 px-16" }, Pa = /* @__PURE__ */ B({
1428
- __name: "Product",
1429
- setup(C) {
1430
- const o = ut(), s = st(), m = nt(s), t = rt(m);
1431
- it({
1432
- dialog: o,
1433
- menuLoader: t
1434
- });
1435
- const r = $e(), l = x(() => r.rules.item), u = At(), b = ct(), p = Mt(), _ = x(() => !r.state.currentCatalogId), g = x(() => r.rules.item), w = x(() => !r.state.currentSchedulerId), te = V(!1), H = V(!1), le = x(() => {
1436
- var M, A, O, Q;
1437
- if (_.value && w.value) return;
1438
- if (w.value) {
1439
- const G = (M = r.currentCatalog) == null ? void 0 : M.override.items;
1440
- return G ? Object.entries(G).reduce((U, [z, ne]) => {
1441
- const E = ne.find((me) => !me.combinationKey);
1442
- return E && (U[z] = E), U;
1443
- }, {}) : {};
1444
- }
1445
- return ((_.value ? (A = r.currentScheduler) == null ? void 0 : A.items : (Q = (O = r.currentCatalog) == null ? void 0 : O.override.scheduler[r.state.currentSchedulerId]) == null ? void 0 : Q.items) ?? []).reduce((G, U) => (U.combinationKey || (G[U._id] = U), G), {});
1446
- }), L = V({}), ae = V({}), S = async () => {
1447
- var Q, G;
1448
- H.value = !0;
1449
- const P = !!le.value, M = ge.flatten(T.value.map((U) => U.items)), A = P && te.value ? await $t(
1450
- r.mergedMenu,
1451
- M,
1452
- r.state.menu,
1453
- (Q = r.currentCatalog) == null ? void 0 : Q._id,
1454
- (G = r.currentScheduler) == null ? void 0 : G._id,
1455
- !1
1456
- ) : void 0, O = M.reduce((U, z, ne) => {
1457
- var me, he, xe, fe;
1458
- const E = (me = le.value) == null ? void 0 : me[z._id];
1459
- return U[z._id] = {
1460
- _id: z._id,
1461
- name: z.name,
1462
- code: P ? E == null ? void 0 : E.code : z == null ? void 0 : z.code,
1463
- category: z.category,
1464
- additionalCategories: z.additionalCategories,
1465
- price: P && g.value.editPrice ? E == null ? void 0 : E.price : z.price,
1466
- orderFrom: P ? E == null ? void 0 : E.orderFrom : z.orderFrom,
1467
- taxes: P ? null : z.taxes,
1468
- thumbnail: z.thumbnail,
1469
- fallbackPrice: (he = A == null ? void 0 : A[ne]) == null ? void 0 : he.price,
1470
- fallbackName: P ? z.name : void 0,
1471
- fallbackCode: (xe = A == null ? void 0 : A[ne]) == null ? void 0 : xe.code,
1472
- fallbackOrder: (fe = A == null ? void 0 : A[ne]) == null ? void 0 : fe.orderFrom,
1473
- fallbackTaxes: P ? z.taxes : null
1474
- }, U;
1475
- }, {});
1476
- L.value = O, ae.value = { ...O }, H.value = !1;
1477
- }, { categories: oe, selectedCategories: T } = Ve(), N = V(null);
1478
- function X() {
1479
- N.value && N.value.toggleAttributeFilter();
1480
- }
1481
- lt(async () => {
1482
- T.value && await S();
1483
- });
1484
- function ye() {
1485
- b.create(null);
1486
- }
1487
- const Y = () => {
1488
- T.value && S();
1489
- }, de = Ne();
1490
- x(() => de.breakpoints.value.xs);
1491
- const { t: j } = Te();
1492
- return (P, M) => {
1493
- const A = K("fm-button");
1494
- return n(oe).length ? (v(), k("div", oa, [
1495
- f("div", na, [
1496
- f("div", ra, [
1497
- n(T) ? (v(), I(aa, {
1498
- key: 0,
1499
- ref_key: "productTableRef",
1500
- ref: N,
1501
- "is-calculating": H.value,
1502
- "model-value": L.value,
1503
- "original-value": ae.value,
1504
- "onUpdate:modelValue": M[0] || (M[0] = (O) => L.value = O),
1505
- "onReset:modelValue": Y,
1506
- "onUpdate:editing": M[1] || (M[1] = (O) => te.value = O)
1507
- }, {
1508
- filter: $(() => [
1509
- d(He, { onToggleAttributeFilter: X }),
1510
- g.value.multiScheduler ? (v(), I(Qe, { key: 0 })) : D("", !0)
1511
- ]),
1512
- _: 1
1513
- }, 8, ["is-calculating", "model-value", "original-value"])) : D("", !0)
1514
- ])
1515
- ])
1516
- ])) : (v(), k("div", sa, [
1517
- f("div", ua, [
1518
- d(He),
1519
- g.value.multiScheduler ? (v(), I(Qe, { key: 0 })) : D("", !0)
1520
- ]),
1521
- l.value.create ? (v(), I(be, {
1522
- key: 0,
1523
- action: {
1524
- text: n(j)("menu.product.empty.with_create.action"),
1525
- callback: ye
1526
- },
1527
- subtitle: n(j)("menu.product.empty.with_create.subtitle"),
1528
- title: n(j)("menu.product.empty.with_create.title")
1529
- }, null, 8, ["action", "subtitle", "title"])) : w.value ? (v(), I(be, {
1530
- key: 1,
1531
- subtitle: n(j)("menu.product.empty.no_scheduler.subtitle"),
1532
- title: n(j)("menu.product.empty.no_scheduler.title")
1533
- }, {
1534
- action: $(() => [
1535
- d(We, {
1536
- "categorized-items": n(p).linkableItems.value,
1537
- "initial-value": n(p).currentItems.value,
1538
- "show-variant": !1,
1539
- onSubmit: M[2] || (M[2] = (O) => n(p).applyProduct(O.map((Q) => Q._id)))
1540
- }, {
1541
- default: $(({ trigger: O }) => [
1542
- d(A, {
1543
- label: n(j)("menu.common.actions.link_product"),
1544
- "prepend-icon": "link",
1545
- onClick: O
1546
- }, null, 8, ["label", "onClick"])
1547
- ]),
1548
- _: 1
1549
- }, 8, ["categorized-items", "initial-value"])
1550
- ]),
1551
- _: 1
1552
- }, 8, ["subtitle", "title"])) : (v(), I(be, {
1553
- key: 2,
1554
- subtitle: n(j)("menu.product.empty.with_scheduler.subtitle"),
1555
- title: n(j)("menu.product.empty.with_scheduler.title")
1556
- }, {
1557
- action: $(() => [
1558
- d(We, {
1559
- "categorized-items": n(u).linkableItems.value,
1560
- "initial-value": n(u).currentItems.value,
1561
- "show-variant": !1,
1562
- onSubmit: M[3] || (M[3] = (O) => n(u).applyProduct(O.map((Q) => Q._id)))
1563
- }, {
1564
- default: $(({ trigger: O }) => [
1565
- d(A, {
1566
- label: n(j)("menu.common.actions.apply_product"),
1567
- onClick: O
1568
- }, null, 8, ["label", "onClick"])
1569
- ]),
1570
- _: 1
1571
- }, 8, ["categorized-items", "initial-value"])
1572
- ]),
1573
- _: 1
1574
- }, 8, ["subtitle", "title"]))
1575
- ]));
1576
- };
1577
- }
1578
- });
1579
- export {
1580
- Je as _,
1581
- Pa as a
1582
- };