@feedmepos/mf-menu-portal 1.0.4-dev.1 → 1.0.4-dev.3

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 (58) hide show
  1. package/dist/{App-BZKKZoxc.js → App-nS46pByh.js} +3 -3
  2. package/dist/{BindingTable.vue_vue_type_script_setup_true_lang-CKMp3GaN.js → BindingTable.vue_vue_type_script_setup_true_lang-DnvN5R5w.js} +1 -1
  3. package/dist/{Catalog-CAHbtV4H.js → Catalog-B4RS8T29.js} +4 -4
  4. package/dist/{CatalogBinding-Bhf_B-HW.js → CatalogBinding-6_783kbu.js} +3 -3
  5. package/dist/{CatalogEditTabs.vue_vue_type_script_setup_true_lang-CFqyk2fz.js → CatalogEditTabs.vue_vue_type_script_setup_true_lang-BawCLY5-.js} +3 -3
  6. package/dist/CatalogEditor.vue_vue_type_script_setup_true_lang-BjP8ZXyb.js +784 -0
  7. package/dist/{CatalogLinkProductAction.vue_vue_type_script_setup_true_lang-CYMrCMo1.js → CatalogLinkProductAction.vue_vue_type_script_setup_true_lang-Diapahfp.js} +3 -3
  8. package/dist/{Category-BiIE6JWS.js → Category-CqneIGq4.js} +5 -5
  9. package/dist/{Category-n3cAs8IF.js → Category-DNQH1CI7.js} +2 -2
  10. package/dist/{CategoryList.vue_vue_type_script_setup_true_lang-BaecheDk.js → CategoryList.vue_vue_type_script_setup_true_lang-Bt_onPrP.js} +4 -4
  11. package/dist/{CookingGuide-DHi4QqBd.js → CookingGuide-DTAiFmEL.js} +4 -4
  12. package/dist/{Group-D5-wyI4V.js → Group-5xO2j3CL.js} +2 -2
  13. package/dist/{Group-DkKUYhoT.js → Group-DeUqUomY.js} +5 -5
  14. package/dist/{GroupList.vue_vue_type_script_setup_true_lang-C4MhLA7R.js → GroupList.vue_vue_type_script_setup_true_lang-Dgya_JLB.js} +5 -5
  15. package/dist/{Ingredient-CbJSvV6r.js → Ingredient-BlDW3TfZ.js} +3 -3
  16. package/dist/{LinkProductSideSheet.vue_vue_type_script_setup_true_lang-C2pNO1hF.js → LinkProductSideSheet.vue_vue_type_script_setup_true_lang-0tCpJlOf.js} +1 -1
  17. package/dist/{MenuSetting-DaQPBU74.js → MenuSetting-DdekHsQy.js} +3 -3
  18. package/dist/{OrderPacing-CSJ-ohx3.js → OrderPacing-Bb2n5wmI.js} +4 -4
  19. package/dist/{OrderPacingFields.vue_vue_type_script_setup_true_lang-DDr0P_hg.js → OrderPacingFields.vue_vue_type_script_setup_true_lang-C3SqQPSr.js} +1 -1
  20. package/dist/{Preview-D7WS3ftB.js → Preview-DGTw0POk.js} +1 -1
  21. package/dist/{PriceTierNotice.vue_vue_type_script_setup_true_lang-CH099Ogz.js → PriceTierNotice.vue_vue_type_script_setup_true_lang-DffhFv0Y.js} +1 -1
  22. package/dist/{PrintRoute-Ci5nFh5U.js → PrintRoute-CJB4gIP2.js} +3 -3
  23. package/dist/{Product-Cnai3PSK.js → Product-CsbcyIgD.js} +4 -4
  24. package/dist/{ProductEditorHost.vue_vue_type_script_setup_true_lang-CgG9Ooj-.js → ProductEditorHost.vue_vue_type_script_setup_true_lang--rBKdKV7.js} +2 -2
  25. package/dist/{ProductGroupCreateSheet.vue_vue_type_script_setup_true_lang-UeIB15M8.js → ProductGroupCreateSheet.vue_vue_type_script_setup_true_lang-J6LpJ5wT.js} +3 -3
  26. package/dist/{ProductImageEditorDialog.vue_vue_type_script_setup_true_lang-BYrFs09n.js → ProductImageEditorDialog.vue_vue_type_script_setup_true_lang-DtCzHjpN.js} +1 -1
  27. package/dist/{ProductInlineCreateHost.vue_vue_type_script_setup_true_lang-BHaNygs1.js → ProductInlineCreateHost.vue_vue_type_script_setup_true_lang-aDx01-WW.js} +1491 -1477
  28. package/dist/{ProductInternalTools-BDM2wNdr.js → ProductInternalTools-Ccd4dAmx.js} +2 -2
  29. package/dist/{ProductInventoryDialog-CQzpqhFQ.js → ProductInventoryDialog-DYcKdKHi.js} +1 -1
  30. package/dist/{ProductInventoryDialog.vue_vue_type_script_setup_true_lang-B12JBNSL.js → ProductInventoryDialog.vue_vue_type_script_setup_true_lang-DySFcCJz.js} +1 -1
  31. package/dist/{ProductList.vue_vue_type_script_setup_true_lang-bFpRJqAM.js → ProductList.vue_vue_type_script_setup_true_lang-DTLslTpK.js} +8 -8
  32. package/dist/{ProductVariantTranslationSheet.vue_vue_type_script_setup_true_lang-Chv4V2ps.js → ProductVariantTranslationSheet.vue_vue_type_script_setup_true_lang-Dw2xiPYX.js} +1 -1
  33. package/dist/{Products-BSRl9QqW.js → Products-phZwCZhU.js} +3 -3
  34. package/dist/{Publish-B0YeaFMZ.js → Publish-BeKIXu3z.js} +3 -3
  35. package/dist/{Recipe-CUFm5Gvj.js → Recipe-Fo4tBkBv.js} +3 -3
  36. package/dist/{Scheduler-D5ZSBFVY.js → Scheduler-C-A5m92O.js} +3 -3
  37. package/dist/{ServingSequence-DaNyijEL.js → ServingSequence-BrCwLSO7.js} +2 -2
  38. package/dist/{Setting-DbO5vVZf.js → Setting-C24V-lps.js} +6 -6
  39. package/dist/{Subcategory-HrK6lsAH.js → Subcategory-B0oZIKbw.js} +2 -2
  40. package/dist/{Takeaway-DZ2pXpc4.js → Takeaway-BFP2ohJn.js} +5 -5
  41. package/dist/{Takeaway-HmId8Qqp.js → Takeaway-DywX5BiX.js} +2 -2
  42. package/dist/{TakeawayList.vue_vue_type_script_setup_true_lang-BBWdi9Em.js → TakeawayList.vue_vue_type_script_setup_true_lang-B3QS7o1v.js} +3 -3
  43. package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DeAN-dVm.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-D7mhnrXx.js} +6 -6
  44. package/dist/{Unit-oze9Bah6.js → Unit-NhEwH-kr.js} +2 -2
  45. package/dist/{Variant-B9j4riC-.js → Variant-BBfWhH-s.js} +3 -3
  46. package/dist/{_id_-Bp2gkxXp.js → _id_-BooM3FX1.js} +3 -3
  47. package/dist/{app-A5dqYWsU.js → app-Bmgb8ACe.js} +65 -65
  48. package/dist/app.js +1 -1
  49. package/dist/apps/mf-menu/src/app.d.ts +20 -0
  50. package/dist/apps/mf-menu/src/components/PriceTier/LinkPriceTierSection.vue.d.ts +9 -0
  51. package/dist/apps/mf-menu/src/components/Product/ProductQuantityField.vue.d.ts +4 -0
  52. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  53. package/dist/assets/{menu-compute-BXVeOLK2.js → menu-compute-CG-fX5pi.js} +4 -4
  54. package/dist/assets/{validate-menu-rN3yrHun.js → validate-menu-BeGMWVns.js} +2 -2
  55. package/dist/{provide-Qt5LApQe.js → provide-CfF0FmUz.js} +44109 -43627
  56. package/dist/{useActionFeedback-CtMJLWBu.js → useActionFeedback-DyUCQl2x.js} +1 -1
  57. package/package.json +1 -1
  58. package/dist/CatalogEditor.vue_vue_type_script_setup_true_lang-DbSQyj5E.js +0 -484
@@ -0,0 +1,784 @@
1
+ import { defineComponent as oe, computed as S, resolveComponent as g, openBlock as s, createBlock as F, unref as e, withCtx as d, createVNode as o, createElementBlock as k, withModifiers as I, createCommentVNode as y, Fragment as D, renderList as j, createElementVNode as C, withDirectives as ce, toDisplayString as U, ref as pe, watch as be, resolveDynamicComponent as ve, mergeProps as H, createSlots as _e, createTextVNode as J, normalizeClass as fe } from "vue";
2
+ import { RouterLink as ge } from "vue-router";
3
+ import { useI18n as te } from "@feedmepos/mf-common";
4
+ import { components as x, FmButtonColorThemeVariant as G } from "@feedmepos/ui-library";
5
+ import { _ as ke } from "./FormSection.vue_vue_type_script_setup_true_lang-pY-_msnM.js";
6
+ import { _ as L } from "./FormItem.vue_vue_type_script_setup_true_lang-C2S6QCyR.js";
7
+ import { _ as ye } from "./PageLayout.vue_vue_type_script_setup_true_lang-B3szUH39.js";
8
+ import { _ as Fe } from "./LinkProductSideSheet.vue_vue_type_script_setup_true_lang-0tCpJlOf.js";
9
+ import { _ as Ce } from "./CatalogLinkProductAction.vue_vue_type_script_setup_true_lang-Diapahfp.js";
10
+ import { _ as we } from "./SubItemTaxWarning.vue_vue_type_script_setup_true_lang-BUyK6Jaa.js";
11
+ import { b as ue, r as he, u as ee } from "./provide-CfF0FmUz.js";
12
+ import { r as Ve, a as le } from "./ruleValueKey-BF52PuHb.js";
13
+ import { _ as Te } from "./CatalogEditTabs.vue_vue_type_script_setup_true_lang-BawCLY5-.js";
14
+ import { u as $e } from "./useActionFeedback-DyUCQl2x.js";
15
+ import { u as ae } from "./useEditorValidation-Ctef5Bxt.js";
16
+ import { R as Ue } from "./app-Bmgb8ACe.js";
17
+ const Se = { class: "flex flex-col gap-16" }, Re = { class: "flex w-full justify-between gap-16" }, Pe = {
18
+ key: 0,
19
+ class: "flex w-full [&>*]:w-full"
20
+ }, Me = { class: "break-all fm-typo-en-body-lg-400 line-clamp-1" }, De = {
21
+ key: 0,
22
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
23
+ }, Le = { class: "flex justify-end" }, Oe = /* @__PURE__ */ oe({
24
+ __name: "LinkPriceTierSection",
25
+ props: {
26
+ view: {},
27
+ editor: {},
28
+ issueFor: { type: Function }
29
+ },
30
+ setup(W) {
31
+ const T = W, { t: r } = te(), A = ue(), l = {
32
+ mounted: (u, n) => {
33
+ var c;
34
+ (c = u.querySelector("input")) == null || c.setAttribute("aria-label", n.value);
35
+ },
36
+ updated: (u, n) => {
37
+ var c;
38
+ (c = u.querySelector("input")) == null || c.setAttribute("aria-label", n.value);
39
+ }
40
+ }, E = [
41
+ { value: "in", label: "menu.rule_groups.condition_view.operator.in" },
42
+ {
43
+ value: "notIn",
44
+ label: "menu.rule_groups.condition_view.operator.not_in"
45
+ },
46
+ {
47
+ value: "startsWith",
48
+ label: "menu.rule_groups.condition_view.operator.starts_with"
49
+ }
50
+ ], q = S(
51
+ () => E.map((u) => ({ label: r(u.label), value: u.value }))
52
+ ), R = S(
53
+ () => T.view.options.map((u) => ({ label: u, value: u }))
54
+ ), P = S(
55
+ () => T.view.attributeOptions.map((u) => ({
56
+ label: r(u.label, u.labelParams ?? {}),
57
+ value: u.key
58
+ }))
59
+ );
60
+ function z(u) {
61
+ var n;
62
+ return (((n = T.view.attributeOptions.find((c) => c.key === u.attribute)) == null ? void 0 : n.values) ?? []).map((c) => ({
63
+ label: c.label,
64
+ // FmSelect needs a primitive; a value travels as its key.
65
+ value: le(c.value)
66
+ }));
67
+ }
68
+ function a(u) {
69
+ const n = T.view.attributeOptions.find(
70
+ (c) => c.key === u.attribute
71
+ );
72
+ return u.values.map(
73
+ (c) => {
74
+ var h;
75
+ return ((h = n == null ? void 0 : n.values.find((N) => N.value === c)) == null ? void 0 : h.label) ?? String(c);
76
+ }
77
+ ).join(r("menu.link_product.rules.value_separator"));
78
+ }
79
+ function O(u) {
80
+ const n = T.issueFor(u);
81
+ return n ? [A(n)] : [];
82
+ }
83
+ function $(u) {
84
+ return r("menu.link_product.rules.rule_number", { index: u + 1 });
85
+ }
86
+ function V(u, n, c) {
87
+ return r("menu.common.labels.a11y_labelled_name", {
88
+ label: r(c),
89
+ name: `${$(u)} ${r(
90
+ "menu.link_product.rules.condition_number",
91
+ { index: n + 1 }
92
+ )}`
93
+ });
94
+ }
95
+ function M(u, n, c) {
96
+ T.editor.setPriceTierRuleCondition(u, n, c);
97
+ }
98
+ return (u, n) => {
99
+ const c = g("FmRadio"), h = g("FmSelect"), N = g("FmTextField"), B = g("FmButton"), t = g("FmCard"), m = g("FmRadioGroup");
100
+ return s(), F(L, {
101
+ label: e(r)("menu.price_tier.link_price_tier")
102
+ }, {
103
+ default: d(() => [
104
+ o(m, {
105
+ "model-value": u.view.mode,
106
+ "onUpdate:modelValue": n[4] || (n[4] = (b) => u.editor.setPriceTierMode(b))
107
+ }, {
108
+ default: d(() => [
109
+ o(c, {
110
+ value: "groups",
111
+ label: e(r)("menu.price_tier.link_price_group"),
112
+ sublabel: e(r)("menu.price_tier.link_price_group_description")
113
+ }, null, 8, ["label", "sublabel"]),
114
+ u.view.mode === "groups" ? (s(), k("div", {
115
+ key: 0,
116
+ class: "pl-32",
117
+ onClick: n[1] || (n[1] = I(() => {
118
+ }, ["prevent"]))
119
+ }, [
120
+ o(h, {
121
+ "model-value": [...u.view.selected],
122
+ items: R.value,
123
+ multiselect: "",
124
+ "keep-selection-order": "",
125
+ placeholder: e(r)("menu.rule_groups.condition_view.select_item"),
126
+ "aria-label": e(r)("menu.price_tier.price_group"),
127
+ "onUpdate:modelValue": n[0] || (n[0] = (b) => u.editor.setPriceTiers(b))
128
+ }, null, 8, ["model-value", "items", "placeholder", "aria-label"])
129
+ ])) : y("", !0),
130
+ o(c, {
131
+ value: "rules",
132
+ label: e(r)("menu.price_tier.price_group_rule"),
133
+ sublabel: e(r)("menu.price_tier.price_group_rule_description")
134
+ }, null, 8, ["label", "sublabel"]),
135
+ u.view.mode === "rules" ? (s(), k("div", {
136
+ key: 1,
137
+ class: "pl-32 space-y-16",
138
+ onClick: n[3] || (n[3] = I(() => {
139
+ }, ["prevent"]))
140
+ }, [
141
+ (s(!0), k(D, null, j(u.view.rules, (b, p) => (s(), F(t, {
142
+ key: b.id,
143
+ class: "p-16 space-y-16",
144
+ variant: "outlined",
145
+ role: "group",
146
+ "aria-label": $(p)
147
+ }, {
148
+ default: d(() => [
149
+ o(h, {
150
+ label: e(r)("menu.price_tier.price_group"),
151
+ "label-mark": "required",
152
+ "model-value": b.priceTier,
153
+ items: R.value,
154
+ placeholder: e(r)("menu.rule_groups.condition_view.select_item"),
155
+ "aria-label": e(r)("menu.common.labels.a11y_labelled_name", {
156
+ label: e(r)("menu.price_tier.price_group"),
157
+ name: $(p)
158
+ }),
159
+ "error-messages": O(`priceTierRules.${p}.priceTier`),
160
+ "onUpdate:modelValue": (v) => u.editor.setPriceTierRuleTier(p, v)
161
+ }, null, 8, ["label", "model-value", "items", "placeholder", "aria-label", "error-messages", "onUpdate:modelValue"]),
162
+ o(L, {
163
+ label: e(r)("menu.price_tier.restaurant_filter")
164
+ }, {
165
+ default: d(() => [
166
+ C("div", Se, [
167
+ (s(!0), k(D, null, j(b.conditions, (v, f) => (s(), k("div", {
168
+ key: f,
169
+ class: "flex justify-between gap-8"
170
+ }, [
171
+ C("div", Re, [
172
+ o(h, {
173
+ class: "flex w-full",
174
+ "model-value": v.attribute,
175
+ items: P.value,
176
+ placeholder: e(r)("menu.rule_groups.condition_view.select_item"),
177
+ "aria-label": V(
178
+ p,
179
+ f,
180
+ "menu.menu_setting.rule_groups.condition.attribute"
181
+ ),
182
+ "onUpdate:modelValue": (w) => M(p, f, {
183
+ attribute: w,
184
+ values: []
185
+ })
186
+ }, null, 8, ["model-value", "items", "placeholder", "aria-label", "onUpdate:modelValue"]),
187
+ o(h, {
188
+ class: "flex w-full",
189
+ "model-value": v.operator,
190
+ items: q.value,
191
+ placeholder: e(r)("menu.rule_groups.condition_view.select_item"),
192
+ "aria-label": V(
193
+ p,
194
+ f,
195
+ "menu.menu_setting.rule_groups.condition.operator"
196
+ ),
197
+ "error-messages": O(
198
+ `priceTierRules.${p}.conditions.${f}.operator`
199
+ ),
200
+ "onUpdate:modelValue": (w) => M(p, f, { operator: w })
201
+ }, null, 8, ["model-value", "items", "placeholder", "aria-label", "error-messages", "onUpdate:modelValue"]),
202
+ e(he)(v.operator) === "text" ? ce((s(), k("div", Pe, [
203
+ o(N, {
204
+ "model-value": String(v.values[0] ?? ""),
205
+ placeholder: e(r)("menu.menu_setting.rule_groups.condition.value"),
206
+ "error-messages": O(
207
+ `priceTierRules.${p}.conditions.${f}.values`
208
+ ),
209
+ "onUpdate:modelValue": (w) => M(p, f, {
210
+ values: w === "" || w == null ? [] : [String(w)]
211
+ })
212
+ }, null, 8, ["model-value", "placeholder", "error-messages", "onUpdate:modelValue"])
213
+ ])), [
214
+ [
215
+ l,
216
+ V(
217
+ p,
218
+ f,
219
+ "menu.menu_setting.rule_groups.condition.value"
220
+ )
221
+ ]
222
+ ]) : (s(), F(h, {
223
+ key: 1,
224
+ class: "flex w-full",
225
+ "model-value": v.values.map(e(le)),
226
+ items: z(v),
227
+ multiselect: "",
228
+ "hide-chips": "",
229
+ placeholder: e(r)("menu.rule_groups.condition_view.select_item"),
230
+ "aria-label": V(
231
+ p,
232
+ f,
233
+ "menu.menu_setting.rule_groups.condition.value"
234
+ ),
235
+ "error-messages": O(
236
+ `priceTierRules.${p}.conditions.${f}.values`
237
+ ),
238
+ "onUpdate:modelValue": (w) => M(p, f, {
239
+ values: w.map(e(Ve))
240
+ })
241
+ }, {
242
+ default: d(() => [
243
+ C("div", Me, U(a(v)), 1)
244
+ ]),
245
+ _: 2
246
+ }, 1032, ["model-value", "items", "placeholder", "aria-label", "error-messages", "onUpdate:modelValue"]))
247
+ ]),
248
+ o(B, {
249
+ variant: "tertiary",
250
+ "prepend-icon": "close",
251
+ "aria-label": V(
252
+ p,
253
+ f,
254
+ "menu.menu_setting.rule_groups.remove_condition"
255
+ ),
256
+ onClick: (w) => u.editor.removePriceTierRuleCondition(p, f)
257
+ }, null, 8, ["aria-label", "onClick"])
258
+ ]))), 128)),
259
+ b.hasUnshownConditions ? (s(), k("p", De, U(e(r)("menu.price_tier.unshown_conditions")), 1)) : y("", !0),
260
+ C("div", null, [
261
+ o(B, {
262
+ variant: "plain",
263
+ "prepend-icon": "add",
264
+ label: e(r)("menu.rule_groups.condition_view.add_condition"),
265
+ "aria-label": e(r)("menu.common.labels.a11y_labelled_name", {
266
+ label: e(r)("menu.rule_groups.condition_view.add_condition"),
267
+ name: $(p)
268
+ }),
269
+ onClick: (v) => u.editor.addPriceTierRuleCondition(p)
270
+ }, null, 8, ["label", "aria-label", "onClick"])
271
+ ])
272
+ ])
273
+ ]),
274
+ _: 2
275
+ }, 1032, ["label"]),
276
+ C("div", Le, [
277
+ o(B, {
278
+ variant: "tertiary",
279
+ "prepend-icon": "delete",
280
+ "aria-label": e(r)("menu.common.labels.a11y_labelled_name", {
281
+ label: e(r)("menu.common.actions.delete"),
282
+ name: $(p)
283
+ }),
284
+ onClick: (v) => u.editor.removePriceTierRule(p)
285
+ }, null, 8, ["aria-label", "onClick"])
286
+ ])
287
+ ]),
288
+ _: 2
289
+ }, 1032, ["aria-label"]))), 128)),
290
+ C("div", null, [
291
+ o(B, {
292
+ label: e(r)("menu.link_product.rules.add_rule"),
293
+ onClick: n[2] || (n[2] = (b) => u.editor.addPriceTierRule())
294
+ }, null, 8, ["label"])
295
+ ])
296
+ ])) : y("", !0)
297
+ ]),
298
+ _: 1
299
+ }, 8, ["model-value"])
300
+ ]),
301
+ _: 1
302
+ }, 8, ["label"]);
303
+ };
304
+ }
305
+ }), Be = {
306
+ key: 1,
307
+ role: "alert"
308
+ }, Ae = {
309
+ key: 2,
310
+ class: "max-w-[752px] pt-16 space-y-32"
311
+ }, Ee = {
312
+ key: 0,
313
+ class: "pl-32 space-x-8"
314
+ }, Ne = { class: "space-y-16" }, je = { class: "space-y-16" }, ze = { class: "pl-[60px] space-y-16" }, Ge = { class: "space-x-16 flex items-center" }, Ie = { class: "flex-1 space-y-4" }, We = { class: "fm-typo-en-body-md-400" }, qe = {
315
+ key: 3,
316
+ class: "max-w-[752px] pt-40 flex justify-end"
317
+ }, Ke = { class: "flex gap-8 items-center justify-start" }, Ye = {
318
+ key: 0,
319
+ class: "space-y-16"
320
+ }, He = {
321
+ key: 1,
322
+ class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
323
+ }, dl = /* @__PURE__ */ oe({
324
+ __name: "CatalogEditor",
325
+ props: {
326
+ sdk: {},
327
+ editor: {},
328
+ picker: {},
329
+ page: { type: Boolean }
330
+ },
331
+ emits: ["close"],
332
+ setup(W, { emit: T }) {
333
+ const r = W, A = T, { t: l } = te(), E = ue(), { run: q } = $e(), R = ae(() => r.editor), P = ee(r.editor), z = ee(r.picker), a = S(
334
+ () => P.value.status === "ready" ? P.value.value : null
335
+ );
336
+ function O(t) {
337
+ var m;
338
+ return (m = a.value) != null && m.priceTier ? R.issue(a.value.priceTier.fieldIssues, t) : null;
339
+ }
340
+ const $ = S(
341
+ () => a.value ? R.issue(a.value.fieldIssues, "name") ?? a.value.nameIssue : null
342
+ ), V = ae(() => {
343
+ var m;
344
+ const t = (m = a.value) == null ? void 0 : m.markupDraft;
345
+ return t ? t.index ?? "new" : null;
346
+ }), M = S(
347
+ () => {
348
+ var t;
349
+ return (t = a.value) != null && t.markupDraft ? V.issue(a.value.markupFieldIssues, "percentage") ?? a.value.markupDraft.issue : null;
350
+ }
351
+ ), u = S(
352
+ () => z.value.status === "ready" ? z.value.value : null
353
+ ), n = pe(!1), c = S({
354
+ get: () => {
355
+ var t;
356
+ return !!((t = a.value) != null && t.markupDraft);
357
+ },
358
+ set: (t) => {
359
+ t || r.editor.cancelMarkup();
360
+ }
361
+ });
362
+ be(
363
+ () => P.value.status,
364
+ (t) => {
365
+ (t === "error" || t === "unavailable") && (n.value = !1);
366
+ }
367
+ );
368
+ async function h() {
369
+ (await q(
370
+ () => R.submit(() => r.editor.submit()),
371
+ {
372
+ showLoading: () => {
373
+ var m;
374
+ return ((m = a.value) == null ? void 0 : m.status) === "submitting";
375
+ },
376
+ successMessage: (m) => l("menu.catalog.saved", { name: m.name })
377
+ }
378
+ )).kind === "success" && A("close");
379
+ }
380
+ function N() {
381
+ V.submit(async () => r.editor.saveMarkup());
382
+ }
383
+ function B(t) {
384
+ r.editor.setMarkupProducts(t), n.value = !1;
385
+ }
386
+ return (t, m) => {
387
+ var Q, X, Z;
388
+ const b = g("FmButton"), p = g("FmTextField"), v = g("FmRadio"), f = g("FmRadioGroup"), w = g("FmCheckbox"), K = g("FmSwitch"), re = g("FmSelect"), ne = g("FmChip"), ie = g("FmCard"), se = g("FmIcon"), me = g("FmStepperField"), de = g("FmDialog");
389
+ return s(), k(D, null, [
390
+ (s(), F(ve(t.page ? ye : "FmSideSheet"), H(
391
+ t.page ? { heading: ((Q = a.value) == null ? void 0 : Q.name) ?? "" } : {
392
+ modelValue: !0,
393
+ isContainer: e(x).FmForm,
394
+ isContainerProps: {
395
+ onValidationSuccess: h,
396
+ blameFormChildOnValidationFailed: !0
397
+ },
398
+ maxWidth: 560
399
+ },
400
+ {
401
+ "onUpdate:modelValue": m[2] || (m[2] = (i) => !i && A("close"))
402
+ }
403
+ ), _e({
404
+ "side-sheet-footer": d(() => {
405
+ var i;
406
+ return [
407
+ C("div", Ke, [
408
+ o(b, {
409
+ loading: ((i = a.value) == null ? void 0 : i.status) === "submitting",
410
+ disabled: !a.value || a.value.submit.state !== "allowed",
411
+ label: e(l)("menu.common.actions.add"),
412
+ size: "lg",
413
+ type: "submit",
414
+ variant: "primary"
415
+ }, null, 8, ["loading", "disabled", "label"]),
416
+ o(b, {
417
+ label: e(l)("menu.common.actions.cancel"),
418
+ size: "lg",
419
+ variant: "tertiary",
420
+ onClick: m[1] || (m[1] = (_) => A("close"))
421
+ }, null, 8, ["label"])
422
+ ])
423
+ ];
424
+ }),
425
+ default: d(() => [
426
+ t.page ? (s(), F(Te, { key: 0 })) : y("", !0),
427
+ e(P).status === "error" ? (s(), k("p", Be, U(e(E)(e(P).error.message)), 1)) : y("", !0),
428
+ a.value ? (s(), k("div", Ae, [
429
+ o(ke, {
430
+ title: e(l)("menu.catalog.detail")
431
+ }, {
432
+ default: d(() => [
433
+ o(p, H({
434
+ "model-value": a.value.name,
435
+ autofocus: "",
436
+ label: e(l)("menu.catalog.form.name"),
437
+ "error-messages": $.value ? [e(E)($.value)] : []
438
+ }, e(R).field("name", t.editor.setName)), null, 16, ["model-value", "label", "error-messages"]),
439
+ o(L, {
440
+ class: "pt-8",
441
+ label: e(l)("menu.catalog.form.tax.title")
442
+ }, {
443
+ default: d(() => [
444
+ o(f, {
445
+ "model-value": a.value.taxMode,
446
+ "onUpdate:modelValue": t.editor.setTaxMode
447
+ }, {
448
+ default: d(() => [
449
+ o(v, {
450
+ value: "automatic",
451
+ label: e(l)("menu.catalog.form.tax.auto.label"),
452
+ sublabel: e(l)("menu.catalog.form.tax.auto.sublabel")
453
+ }, null, 8, ["label", "sublabel"]),
454
+ o(v, {
455
+ value: "manual",
456
+ label: e(l)("menu.catalog.form.tax.manual.label"),
457
+ sublabel: e(l)("menu.catalog.form.tax.manual.sublabel")
458
+ }, null, 8, ["label", "sublabel"])
459
+ ]),
460
+ _: 1
461
+ }, 8, ["model-value", "onUpdate:modelValue"]),
462
+ a.value.taxMode === "manual" ? (s(), k("div", Ee, [
463
+ (s(!0), k(D, null, j(a.value.taxes, (i) => (s(), F(w, {
464
+ key: i.systemCode,
465
+ "model-value": i.inclusive,
466
+ value: !0,
467
+ label: e(l)("menu.catalog.form.tax.inclusive", { code: i.systemCode }),
468
+ "onUpdate:modelValue": (_) => t.editor.setTaxInclusive(i.systemCode, _)
469
+ }, null, 8, ["model-value", "label", "onUpdate:modelValue"]))), 128))
470
+ ])) : y("", !0)
471
+ ]),
472
+ _: 1
473
+ }, 8, ["label"]),
474
+ a.value.subItemTax ? (s(), F(L, {
475
+ key: 0,
476
+ label: e(l)("menu.menu_setting.sub_item_tax.title")
477
+ }, {
478
+ default: d(() => [
479
+ C("div", Ne, [
480
+ o(f, {
481
+ "model-value": a.value.subItemTax.choice,
482
+ "onUpdate:modelValue": t.editor.setSubItemTaxChoice
483
+ }, {
484
+ default: d(() => [
485
+ o(v, {
486
+ value: "inherit",
487
+ label: e(l)("menu.catalog.form.sub_item_tax.inherit.label"),
488
+ sublabel: e(l)(
489
+ a.value.subItemTax.inherited === "own" ? "menu.catalog.form.sub_item_tax.inherit.current_own" : "menu.catalog.form.sub_item_tax.inherit.current_parent"
490
+ )
491
+ }, null, 8, ["label", "sublabel"]),
492
+ o(v, {
493
+ value: "parent",
494
+ label: e(l)("menu.catalog.form.sub_item_tax.parent.label"),
495
+ sublabel: e(l)("menu.catalog.form.sub_item_tax.parent.sublabel")
496
+ }, null, 8, ["label", "sublabel"]),
497
+ o(v, {
498
+ value: "own",
499
+ label: e(l)("menu.catalog.form.sub_item_tax.own.label"),
500
+ sublabel: e(l)("menu.catalog.form.sub_item_tax.own.sublabel")
501
+ }, null, 8, ["label", "sublabel"])
502
+ ]),
503
+ _: 1
504
+ }, 8, ["model-value", "onUpdate:modelValue"]),
505
+ a.value.subItemTax.resolved === "own" ? (s(), F(we, { key: 0 })) : y("", !0)
506
+ ])
507
+ ]),
508
+ _: 1
509
+ }, 8, ["label"])) : y("", !0),
510
+ a.value.statutoryChargeWaivers.length > 0 ? (s(), F(L, {
511
+ key: 1,
512
+ label: e(l)("menu.catalog.form.statutory_charges.title")
513
+ }, {
514
+ default: d(() => [
515
+ C("div", je, [
516
+ (s(!0), k(D, null, j(a.value.statutoryChargeWaivers, (i) => (s(), F(K, {
517
+ key: i.code,
518
+ "model-value": i.waived,
519
+ label: e(l)("menu.catalog.form.statutory_charges.waive", {
520
+ name: i.name
521
+ }),
522
+ sublabel: e(l)("menu.catalog.form.statutory_charges.sublabel"),
523
+ "label-placement": "right",
524
+ "onUpdate:modelValue": (_) => t.editor.setStatutoryChargeWaived(i.code, _)
525
+ }, null, 8, ["model-value", "label", "sublabel", "onUpdate:modelValue"]))), 128))
526
+ ])
527
+ ]),
528
+ _: 1
529
+ }, 8, ["label"])) : y("", !0)
530
+ ]),
531
+ _: 1
532
+ }, 8, ["title"]),
533
+ a.value.advanced.state === "allowed" ? (s(), k(D, { key: 0 }, [
534
+ o(L, {
535
+ label: e(l)("menu.catalog.form.link.title")
536
+ }, {
537
+ default: d(() => [
538
+ o(K, {
539
+ "model-value": a.value.autoLink,
540
+ label: e(l)("menu.catalog.form.link.auto_link.label"),
541
+ sublabel: e(l)("menu.catalog.form.link.auto_link.sublabel"),
542
+ "label-placement": "right",
543
+ "onUpdate:modelValue": t.editor.setAutoLink
544
+ }, null, 8, ["model-value", "label", "sublabel", "onUpdate:modelValue"]),
545
+ a.value.autoLink ? (s(), F(re, {
546
+ key: 0,
547
+ class: "ml-[60px]",
548
+ "aria-label": e(l)("menu.catalog.form.link.title"),
549
+ "model-value": a.value.orderFrom,
550
+ items: [
551
+ { label: e(l)("menu.catalog.form.link.options.all"), value: "ALL" },
552
+ {
553
+ label: e(l)("menu.catalog.form.link.options.pos_only"),
554
+ value: "POS_ONLY"
555
+ }
556
+ ],
557
+ "onUpdate:modelValue": t.editor.setOrderFrom
558
+ }, null, 8, ["aria-label", "model-value", "items", "onUpdate:modelValue"])) : y("", !0)
559
+ ]),
560
+ _: 1
561
+ }, 8, ["label"]),
562
+ o(L, {
563
+ label: e(l)("menu.catalog.form.markup.title")
564
+ }, {
565
+ default: d(() => [
566
+ o(K, {
567
+ "model-value": a.value.markupEnabled,
568
+ label: e(l)("menu.catalog.form.markup.auto.label"),
569
+ sublabel: e(l)("menu.catalog.form.markup.auto.sublabel"),
570
+ "label-placement": "right",
571
+ "onUpdate:modelValue": t.editor.setMarkupEnabled
572
+ }, null, 8, ["model-value", "label", "sublabel", "onUpdate:modelValue"]),
573
+ C("div", ze, [
574
+ o(b, {
575
+ variant: "secondary",
576
+ "text-color": e(G).ColorPrimary,
577
+ "border-color": e(G).ColorPrimary,
578
+ label: e(l)("menu.catalog.form.markup.add"),
579
+ "prepend-icon": "add",
580
+ onClick: m[0] || (m[0] = (i) => t.editor.beginMarkup())
581
+ }, null, 8, ["text-color", "border-color", "label"]),
582
+ (s(!0), k(D, null, j(a.value.markups, (i, _) => (s(), F(ie, {
583
+ key: _,
584
+ class: "py-12 px-16 cursor-pointer",
585
+ role: "row",
586
+ variant: "outlined",
587
+ onClick: (Y) => t.editor.beginMarkup(_)
588
+ }, {
589
+ default: d(() => [
590
+ C("div", Ge, [
591
+ C("div", Ie, [
592
+ o(ne, { class: "text-fm-color-typo-info bg-fm-color-system-info-100 font-semibold" }, {
593
+ default: d(() => [
594
+ J(U(e(l)("menu.catalog.form.markup.percentage", {
595
+ value: i.percentage
596
+ })), 1)
597
+ ]),
598
+ _: 2
599
+ }, 1024),
600
+ o(b, {
601
+ class: "fm-typo-en-body-lg-400",
602
+ onClick: I((Y) => t.editor.beginMarkup(_), ["stop"])
603
+ }, {
604
+ default: d(() => [
605
+ J(U(e(l)("menu.catalog.form.markup.config", {
606
+ number: _ + 1
607
+ })), 1)
608
+ ]),
609
+ _: 2
610
+ }, 1032, ["onClick"]),
611
+ C("p", We, U(i.productCount === null ? e(l)("menu.catalog.form.markup.all_items") : e(l)("menu.catalog.form.markup.products", {
612
+ count: i.productCount
613
+ })), 1)
614
+ ]),
615
+ o(b, {
616
+ variant: "tertiary",
617
+ "prepend-icon": "delete",
618
+ "aria-label": e(l)("menu.catalog.remove_markup"),
619
+ onClick: I((Y) => t.editor.removeMarkup(_), ["stop"])
620
+ }, null, 8, ["aria-label", "onClick"])
621
+ ])
622
+ ]),
623
+ _: 2
624
+ }, 1032, ["onClick"]))), 128))
625
+ ])
626
+ ]),
627
+ _: 1
628
+ }, 8, ["label"])
629
+ ], 64)) : y("", !0),
630
+ a.value.priceTier ? (s(), F(Oe, {
631
+ key: 1,
632
+ view: a.value.priceTier,
633
+ editor: t.editor,
634
+ "issue-for": O
635
+ }, null, 8, ["view", "editor"])) : y("", !0)
636
+ ])) : y("", !0),
637
+ t.page && a.value ? (s(), k("div", qe, [
638
+ o(b, {
639
+ loading: a.value.status === "submitting",
640
+ disabled: a.value.submit.state !== "allowed",
641
+ label: e(l)("menu.common.actions.save"),
642
+ size: "lg",
643
+ variant: "primary",
644
+ onClick: h
645
+ }, null, 8, ["loading", "disabled", "label"])
646
+ ])) : y("", !0)
647
+ ]),
648
+ _: 2
649
+ }, [
650
+ t.page ? {
651
+ name: "prepend-heading",
652
+ fn: d(() => [
653
+ o(e(ge), {
654
+ to: { name: e(Ue).CATALOG },
655
+ class: "mr-8",
656
+ title: e(l)("menu.catalog.edit.back")
657
+ }, {
658
+ default: d(() => [
659
+ o(b, {
660
+ "aria-label": e(l)("menu.catalog.edit.back"),
661
+ "prepend-icon": "arrow_back",
662
+ variant: "tertiary"
663
+ }, null, 8, ["aria-label"])
664
+ ]),
665
+ _: 1
666
+ }, 8, ["to", "title"])
667
+ ]),
668
+ key: "0"
669
+ } : void 0,
670
+ t.page ? {
671
+ name: "append-heading",
672
+ fn: d(() => [
673
+ o(Ce, { sdk: t.sdk }, null, 8, ["sdk"])
674
+ ]),
675
+ key: "1"
676
+ } : void 0
677
+ ]), 1040)),
678
+ o(de, {
679
+ modelValue: c.value,
680
+ "onUpdate:modelValue": m[6] || (m[6] = (i) => c.value = i),
681
+ "is-component": e(x).FmForm,
682
+ "is-component-props": { onValidationSuccess: N }
683
+ }, {
684
+ "dialog-header": d(() => {
685
+ var i, _;
686
+ return [
687
+ J(U(((_ = (i = a.value) == null ? void 0 : i.markupDraft) == null ? void 0 : _.index) === null ? e(l)("menu.markup.dialog.title.add") : e(l)("menu.markup.dialog.title.update")), 1)
688
+ ];
689
+ }),
690
+ "dialog-footer": d(() => {
691
+ var i, _;
692
+ return [
693
+ o(b, {
694
+ class: "sm:w-full xs:w-full ml-auto",
695
+ label: e(l)("menu.common.actions.cancel"),
696
+ variant: "tertiary",
697
+ onClick: m[5] || (m[5] = (Y) => t.editor.cancelMarkup())
698
+ }, null, 8, ["label"]),
699
+ o(b, {
700
+ label: ((_ = (i = a.value) == null ? void 0 : i.markupDraft) == null ? void 0 : _.index) === null ? e(l)("menu.common.actions.add") : e(l)("menu.common.actions.update"),
701
+ class: "sm:w-full xs:w-full",
702
+ size: "md",
703
+ type: "submit",
704
+ variant: "primary"
705
+ }, null, 8, ["label"])
706
+ ];
707
+ }),
708
+ default: d(() => {
709
+ var i;
710
+ return [
711
+ (i = a.value) != null && i.markupDraft ? (s(), k("div", Ye, [
712
+ o(me, H(
713
+ {
714
+ "model-value": a.value.markupDraft.percentage,
715
+ decimal: 0,
716
+ max: 100,
717
+ min: 0,
718
+ label: e(l)("menu.markup.dialog.fields.percentage.label"),
719
+ placeholder: e(l)("menu.markup.dialog.fields.percentage.placeholder"),
720
+ "error-messages": M.value ? [e(E)(M.value)] : []
721
+ },
722
+ e(V).field("percentage", t.editor.setMarkupPercentage)
723
+ ), {
724
+ prepend: d(() => [
725
+ o(se, { name: "percent" })
726
+ ]),
727
+ _: 1
728
+ }, 16, ["model-value", "label", "placeholder", "error-messages"]),
729
+ o(f, {
730
+ "model-value": a.value.markupDraft.productIds === null ? "all" : "custom",
731
+ class: "space-y-8",
732
+ "onUpdate:modelValue": m[3] || (m[3] = (_) => t.editor.setMarkupProducts(_ === "all" ? null : []))
733
+ }, {
734
+ default: d(() => [
735
+ o(v, {
736
+ value: "all",
737
+ "aria-label": e(l)("menu.markup.dialog.options.all"),
738
+ label: e(l)("menu.markup.dialog.options.all")
739
+ }, null, 8, ["aria-label", "label"]),
740
+ o(v, {
741
+ value: "custom",
742
+ "aria-label": e(l)("menu.markup.dialog.options.custom"),
743
+ label: e(l)("menu.markup.dialog.options.custom")
744
+ }, null, 8, ["aria-label", "label"])
745
+ ]),
746
+ _: 1
747
+ }, 8, ["model-value"]),
748
+ C("div", {
749
+ class: fe(["ml-32 mt-16 space-y-8", { "pb-8": a.value.markupDraft.productIds !== null }])
750
+ }, [
751
+ a.value.markupDraft.productIds !== null ? (s(), F(b, {
752
+ key: 0,
753
+ variant: "secondary",
754
+ "text-color": e(G).ColorPrimary,
755
+ "border-color": e(G).ColorPrimary,
756
+ "aria-label": e(l)("menu.markup.dialog.products.link"),
757
+ label: e(l)("menu.markup.dialog.products.link"),
758
+ "prepend-icon": "link",
759
+ onClick: m[4] || (m[4] = (_) => n.value = !0)
760
+ }, null, 8, ["text-color", "border-color", "aria-label", "label"])) : y("", !0),
761
+ a.value.markupDraft.productCount ? (s(), k("p", He, U(e(l)("menu.markup.dialog.products.count", {
762
+ count: a.value.markupDraft.productCount
763
+ })), 1)) : y("", !0)
764
+ ], 2)
765
+ ])) : y("", !0)
766
+ ];
767
+ }),
768
+ _: 1
769
+ }, 8, ["modelValue", "is-component", "is-component-props"]),
770
+ o(Fe, {
771
+ modelValue: n.value,
772
+ "onUpdate:modelValue": m[7] || (m[7] = (i) => n.value = i),
773
+ catalogue: u.value,
774
+ "selected-product-ids": ((Z = (X = a.value) == null ? void 0 : X.markupDraft) == null ? void 0 : Z.productIds) ?? [],
775
+ title: e(l)("menu.markup.dialog.products.link"),
776
+ onSubmit: B
777
+ }, null, 8, ["modelValue", "catalogue", "selected-product-ids", "title"])
778
+ ], 64);
779
+ };
780
+ }
781
+ });
782
+ export {
783
+ dl as _
784
+ };