@feedmepos/mf-menu 0.23.6-prod.1 → 0.23.6-prod.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{App-B-J4PsOY.js → App-VnLndxaz.js} +3 -3
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-C8Gnu2UR.js → ApplyProduct.vue_vue_type_script_setup_true_lang-BBmQn2Ix.js} +2 -2
- package/dist/{Catalog-BCcHJ4Ef.js → Catalog-COnN5KtQ.js} +5 -5
- package/dist/{Category-BTiUT3vi.js → Category-DaAXe15N.js} +5 -5
- package/dist/{CookingGuide-C6o7M6Ql.js → CookingGuide-BbJbiTO2.js} +4 -4
- package/dist/{Group-BCkG8U0V.js → Group-3wb1U1pU.js} +1 -1
- package/dist/{Group-GjF-2XxI.js → Group-DKZ2cuFU.js} +3 -3
- package/dist/{Group.vue_vue_type_script_setup_true_lang-bDdWhZss.js → Group.vue_vue_type_script_setup_true_lang-Dq_WALgs.js} +7 -7
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-D_yRONQX.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-CbLn_7Ph.js} +2 -2
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-B8uuhFGh.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-BSzadh9N.js} +6 -6
- package/dist/{Ingredient-U62tgLaJ.js → Ingredient-jLs1PFf0.js} +4 -4
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-CZU9Wm_w.js → InventoryBinding.vue_vue_type_script_setup_true_lang-DzVJwqKR.js} +2 -2
- package/dist/{LinkProductSideSheet-B1qHXx0B.js → LinkProductSideSheet-CFpnwqge.js} +2 -2
- package/dist/{MenuSetting-DC-2apfc.js → MenuSetting-Czoh5m35.js} +25 -25
- package/dist/{PrintRoute-ippZmCjL.js → PrintRoute-C5AeMQNS.js} +4 -4
- package/dist/{Product-wndOb1_r.js → Product-D4LH0W6i.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-B_4l9HKb.js → Product.vue_vue_type_script_setup_true_lang-CuXxSZQO.js} +10 -10
- package/dist/{Products-DuMGzt3z.js → Products-5ayrzoc6.js} +8 -8
- package/dist/{Publish-CxBNF61Z.js → Publish-BEDKLENF.js} +3 -3
- package/dist/{Recipe-434UidlI.js → Recipe-CqoDkcD3.js} +5 -5
- package/dist/{Scheduler-CbR4lLML.js → Scheduler--L69-FAR.js} +3 -3
- package/dist/{SchedulerSelector.vue_vue_type_script_setup_true_lang-BHiyAywp.js → SchedulerSelector.vue_vue_type_script_setup_true_lang-F4JhU6oo.js} +1 -1
- package/dist/{ServingSequence-B03yXJ8p.js → ServingSequence-C40U2fJ1.js} +3 -3
- package/dist/{Setting-fYISBxop.js → Setting-Dv8J5sZ1.js} +4 -4
- package/dist/{Takeaway-BMXOThgq.js → Takeaway-BCL3vICy.js} +4 -4
- package/dist/{Takeaway-GUvBdZzM.js → Takeaway-DSgsfuRe.js} +1 -1
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-CqyVHo0v.js → Takeaway.vue_vue_type_script_setup_true_lang-DMj4zGOL.js} +5 -5
- package/dist/{Unit-BuLuLB2A.js → Unit-C85BIr4v.js} +2 -2
- package/dist/{Variant-DzkhawBh.js → Variant-CUVDnRXx.js} +3 -3
- package/dist/{_id_-CiQdbqak.js → _id_-CgMdX6uK.js} +7 -7
- package/dist/{app-D4dcDFEb.js → app-Csk3crLh.js} +1 -1
- package/dist/{app-ETKzh12L.js → app-DyQ2FebM.js} +21 -21
- package/dist/app.js +1 -1
- package/dist/assets/{linked-status-BKk3OqZT.js → linked-status-CuDKKXQw.js} +3 -3
- package/dist/assets/{override-menu-U5CKh-Ct.js → override-menu-DcOjhAMV.js} +3 -3
- package/dist/assets/{validate-menu-CzjyBYqT.js → validate-menu-Rm1BK8Qg.js} +3 -3
- package/dist/{catalog-DIni6vw_.js → catalog-CGFzMBNc.js} +1 -1
- package/dist/{catalogSetting-DwGEZe5Q.js → catalogSetting-CYrTVY3G.js} +1 -1
- package/dist/{currency-Dc4a-4eY.js → currency-qJ7mlgUz.js} +1 -1
- package/dist/{discardConfirm-B6SWGBp1.js → discardConfirm-CVJNDIJA.js} +1 -1
- package/dist/{index-Ce5pRokj.js → index-B8jJbeMV.js} +3 -3
- package/dist/{index-CBKmoIW0.js → index-BE-iOSmz.js} +4 -4
- package/dist/{item-Dr3YkBOR.js → item-DG-PFeAg.js} +533 -533
- package/dist/{menu-DRUvwFPM.js → menu-C118swQu.js} +1 -1
- package/dist/{menu-Cs3cJ7Yz.js → menu-izRdD6Z4.js} +173 -173
- package/dist/{remy-DMGrLL1K.js → remy-BUK0FKVB.js} +2 -2
- package/dist/{scheduler-BNcmN4HK.js → scheduler-CS-ywewi.js} +4 -4
- package/dist/{toExcel-rjcTCa0h.js → toExcel-DzECgsJA.js} +2 -2
- package/dist/{unit-mP636szK.js → unit-DuP5lSLa.js} +2 -2
- package/package.json +1 -1
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { defineStore as Pi } from "pinia";
|
|
2
|
-
import { openBlock as O, createElementBlock as
|
|
3
|
-
import { G as B, J as pe, Y as Rn, a0 as xn, a1 as
|
|
2
|
+
import { openBlock as O, createElementBlock as J, createElementVNode as P, defineComponent as ue, resolveComponent as G, toDisplayString as de, createVNode as w, Fragment as ke, renderList as Ye, createBlock as Y, h as he, ref as Q, computed as F, watch as Re, unref as p, renderSlot as ve, withCtx as L, createCommentVNode as te, Transition as bn, resolveDynamicComponent as St, withDirectives as Je, vShow as At, mergeProps as Ti, withModifiers as Rt, createTextVNode as Ct, normalizeClass as Le, onMounted as ut, resolveDirective as Nt, nextTick as Ui, onBeforeUnmount as yn, normalizeProps as _n, guardReactiveProps as wn, normalizeStyle as Sn, getCurrentInstance as Cn, render as An } from "vue";
|
|
3
|
+
import { G as B, J as pe, Y as Rn, a0 as xn, a1 as Mn, H as ne, z as Se, B as Ae, a2 as Vi, u as fe, a3 as $i, a4 as bi, A as He, K as Xe, U as kn, a5 as On, V as Et, W as zn, a6 as yi, a7 as En } from "./menu-izRdD6Z4.js";
|
|
4
4
|
import { useI18n as me, useCoreStore as Zt, CustomAttributesForm as Fn } from "@feedmepos/mf-common";
|
|
5
|
-
import { useDialog as Be, useDialogChild as
|
|
6
|
-
import { C as Ue } from "./catalog-
|
|
7
|
-
import { u as
|
|
8
|
-
import { p as
|
|
5
|
+
import { useDialog as Be, useDialogChild as Qt, useSnackbar as Ie, components as xe, FmButtonColorThemeVariant as je, FmButtonVariant as qe, useBreakpoints as Ni } from "@feedmepos/ui-library";
|
|
6
|
+
import { C as Ue } from "./catalog-CGFzMBNc.js";
|
|
7
|
+
import { u as Dn, c as In } from "./search-7ZYHUW7s.js";
|
|
8
|
+
import { p as Jt, u as Pn } from "./app-DyQ2FebM.js";
|
|
9
9
|
import { _ as _i, a as Li } from "./tooltip-DpokWKto.js";
|
|
10
10
|
import { _ as st } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
11
11
|
import { _ as Ke, a as Tn } from "./FormSection.vue_vue_type_script_setup_true_lang-BWJUD8NZ.js";
|
|
12
12
|
import { s as Lt, F as Un } from "./object-DNBFWMt7.js";
|
|
13
|
-
import { l as $e, u as Bi } from "./discardConfirm-
|
|
14
|
-
import { R as Ne } from "./remy-
|
|
13
|
+
import { l as $e, u as Bi } from "./discardConfirm-CVJNDIJA.js";
|
|
14
|
+
import { R as Ne } from "./remy-BUK0FKVB.js";
|
|
15
15
|
import { _ as nt } from "./FormItem.vue_vue_type_script_setup_true_lang-DKsxEK-8.js";
|
|
16
|
-
import { _ as it, l as Bt, T as Vn } from "./index-
|
|
16
|
+
import { _ as it, l as Bt, T as Vn } from "./index-BE-iOSmz.js";
|
|
17
17
|
import { useInventoryStore as Ki, InventoryBindingForm as $n, InventoryBindingSummary as Nn } from "@feedmepos/mf-inventory-portal";
|
|
18
18
|
import { c as pt } from "./check-C9mY6LiX.js";
|
|
19
|
-
import { L as Ln } from "./LinkProductSideSheet-
|
|
20
|
-
import { f as mt } from "./currency-
|
|
19
|
+
import { L as Ln } from "./LinkProductSideSheet-CFpnwqge.js";
|
|
20
|
+
import { f as mt } from "./currency-qJ7mlgUz.js";
|
|
21
21
|
import { c as Bn } from "./string-DpfFixWH.js";
|
|
22
22
|
import { V as Gi } from "./vuedraggable-WU01qJgi.js";
|
|
23
|
-
import { _ as Kn } from "./ApplyProduct.vue_vue_type_script_setup_true_lang-
|
|
24
|
-
import { V as wi } from "./index-
|
|
23
|
+
import { _ as Kn } from "./ApplyProduct.vue_vue_type_script_setup_true_lang-BBmQn2Ix.js";
|
|
24
|
+
import { V as wi } from "./index-B8jJbeMV.js";
|
|
25
25
|
class _t {
|
|
26
26
|
constructor(i, t, n, a) {
|
|
27
27
|
this.scheduler = i, this.menuStore = t, this.updateMenu = n, this.dialog = a;
|
|
@@ -222,7 +222,7 @@ class _t {
|
|
|
222
222
|
const i = xn(
|
|
223
223
|
this.menuStore.variants,
|
|
224
224
|
this.menuStore.categories,
|
|
225
|
-
|
|
225
|
+
Mn(this.menuStore.state.menu.modules.item, (a) => a.code || a.name)
|
|
226
226
|
), t = new Set(
|
|
227
227
|
this.menuStore.currentCatalog ? Ue.getItemAvailable(this.menuStore.currentCatalog) : this.menuStore.state.menu.modules.item.map((a) => a._id)
|
|
228
228
|
);
|
|
@@ -367,14 +367,14 @@ class Wi {
|
|
|
367
367
|
const n = this.getFallbackPrices(i), a = this.menuStore.state.menu.modules.item, o = this.menuStore.state.menu.modules.group, r = this.menuStore.items;
|
|
368
368
|
function l(s, u) {
|
|
369
369
|
const c = s.items.reduce((h, m) => {
|
|
370
|
-
var
|
|
370
|
+
var I, k, y, g;
|
|
371
371
|
const b = a.find((C) => m._id === C._id);
|
|
372
372
|
if (!b && t) return h;
|
|
373
373
|
const v = m.combinationKey ? {
|
|
374
|
-
...(
|
|
374
|
+
...(I = b == null ? void 0 : b.variant) == null ? void 0 : I.variantCombinations.find(
|
|
375
375
|
(C) => C.combinationKey === m.combinationKey
|
|
376
376
|
),
|
|
377
|
-
name: Vi(fe().variants, ((
|
|
377
|
+
name: Vi(fe().variants, ((k = b == null ? void 0 : b.variant) == null ? void 0 : k.variantGroupIds) || [])[m.combinationKey]
|
|
378
378
|
} : b, f = (y = o.find((C) => C._id === s._id)) == null ? void 0 : y.items.find((C) => C._id === m._id && C.combinationKey === m.combinationKey), S = !t && !m.combinationKey, z = (g = u.find(
|
|
379
379
|
(C) => C._id == m._id && C.combinationKey == m.combinationKey
|
|
380
380
|
)) == null ? void 0 : g.price, E = m.name ?? (f == null ? void 0 : f.name) ?? (v == null ? void 0 : v.name) ?? "", j = {
|
|
@@ -479,7 +479,7 @@ class Wi {
|
|
|
479
479
|
}
|
|
480
480
|
const jn = {};
|
|
481
481
|
function Wn(e, i) {
|
|
482
|
-
return O(),
|
|
482
|
+
return O(), J("div", null, i[0] || (i[0] = [
|
|
483
483
|
P("div", { class: "h-px w-full bg-fm-color-neutral-gray-100" }, null, -1)
|
|
484
484
|
]));
|
|
485
485
|
}
|
|
@@ -510,10 +510,10 @@ const Yn = /* @__PURE__ */ st(jn, [["render", Wn]]), Hn = {
|
|
|
510
510
|
}
|
|
511
511
|
return (a, o) => {
|
|
512
512
|
const r = G("FmButton");
|
|
513
|
-
return i.variant === "full" ? (O(),
|
|
513
|
+
return i.variant === "full" ? (O(), J("div", Hn, [
|
|
514
514
|
P("div", Xn, de(a.title), 1),
|
|
515
515
|
w(Yn),
|
|
516
|
-
(O(!0),
|
|
516
|
+
(O(!0), J(ke, null, Ye(a.items, (l) => (O(), Y(_i, {
|
|
517
517
|
key: l.name,
|
|
518
518
|
name: l.name,
|
|
519
519
|
value: l.value || "--"
|
|
@@ -526,14 +526,14 @@ const Yn = /* @__PURE__ */ st(jn, [["render", Wn]]), Hn = {
|
|
|
526
526
|
}));
|
|
527
527
|
};
|
|
528
528
|
}
|
|
529
|
-
}), qn = { class: "space-y-24 p-16 border-fm-color-neutral-gray-200 fm-corner-radius-lg border" }, Zn = { class: "space-y-4" },
|
|
529
|
+
}), qn = { class: "space-y-24 p-16 border-fm-color-neutral-gray-200 fm-corner-radius-lg border" }, Zn = { class: "space-y-4" }, Qn = { class: "fm-typo-en-title-sm-600" }, Jn = { class: "text-fm-color-typo-secondary" }, eo = { class: "flex gap-16" }, to = { class: "flex-1" }, io = { class: "flex-1" }, no = /* @__PURE__ */ ue({
|
|
530
530
|
__name: "CatalogSchedulerSelector",
|
|
531
531
|
props: {
|
|
532
532
|
linkedStatus: {}
|
|
533
533
|
},
|
|
534
534
|
emits: ["update:catalogAndScheduler"],
|
|
535
535
|
setup(e, { emit: i }) {
|
|
536
|
-
const t = e, n = i, { t: a } = me(), o = fe(), r =
|
|
536
|
+
const t = e, n = i, { t: a } = me(), o = fe(), r = Q(o.state.currentCatalogId || null), l = F(() => {
|
|
537
537
|
const h = Object.keys(t.linkedStatus.catalogs).map((m) => {
|
|
538
538
|
var b;
|
|
539
539
|
return {
|
|
@@ -548,7 +548,7 @@ const Yn = /* @__PURE__ */ st(jn, [["render", Wn]]), Hn = {
|
|
|
548
548
|
},
|
|
549
549
|
...h
|
|
550
550
|
];
|
|
551
|
-
}), s =
|
|
551
|
+
}), s = Q(o.state.currentSchedulerId || null), u = () => r.value ? t.linkedStatus.catalogs[r.value].schedulers : t.linkedStatus.schedulers, c = F(() => {
|
|
552
552
|
const m = u().map((b) => {
|
|
553
553
|
var v;
|
|
554
554
|
return {
|
|
@@ -577,10 +577,10 @@ const Yn = /* @__PURE__ */ st(jn, [["render", Wn]]), Hn = {
|
|
|
577
577
|
}
|
|
578
578
|
), (h, m) => {
|
|
579
579
|
const b = G("FmSelect");
|
|
580
|
-
return O(),
|
|
580
|
+
return O(), J("div", qn, [
|
|
581
581
|
P("div", Zn, [
|
|
582
|
-
P("div",
|
|
583
|
-
P("div",
|
|
582
|
+
P("div", Qn, de(p(a)("menu.catalog_scheduler.title")), 1),
|
|
583
|
+
P("div", Jn, de(p(a)("menu.catalog_scheduler.subtitle")), 1)
|
|
584
584
|
]),
|
|
585
585
|
P("div", eo, [
|
|
586
586
|
P("div", to, [
|
|
@@ -628,7 +628,7 @@ const Yn = /* @__PURE__ */ st(jn, [["render", Wn]]), Hn = {
|
|
|
628
628
|
P("div", oo, [
|
|
629
629
|
P("div", ao, [
|
|
630
630
|
P("p", ro, de(n.title), 1),
|
|
631
|
-
n.description ? (O(),
|
|
631
|
+
n.description ? (O(), J("p", so, de(n.description), 1)) : te("", !0)
|
|
632
632
|
]),
|
|
633
633
|
w(o, {
|
|
634
634
|
"model-value": n.toggle,
|
|
@@ -637,7 +637,7 @@ const Yn = /* @__PURE__ */ st(jn, [["render", Wn]]), Hn = {
|
|
|
637
637
|
]),
|
|
638
638
|
w(bn, { name: "expand" }, {
|
|
639
639
|
default: L(() => [
|
|
640
|
-
n.toggle ? (O(),
|
|
640
|
+
n.toggle ? (O(), J("div", lo, [
|
|
641
641
|
ve(n.$slots, "default", {}, void 0, !0)
|
|
642
642
|
])) : te("", !0)
|
|
643
643
|
]),
|
|
@@ -648,7 +648,7 @@ const Yn = /* @__PURE__ */ st(jn, [["render", Wn]]), Hn = {
|
|
|
648
648
|
}));
|
|
649
649
|
};
|
|
650
650
|
}
|
|
651
|
-
}), Ze = /* @__PURE__ */ st(uo, [["__scopeId", "data-v-e920f110"]]), co = "/assets/linked-status-
|
|
651
|
+
}), Ze = /* @__PURE__ */ st(uo, [["__scopeId", "data-v-e920f110"]]), co = "/assets/linked-status-CuDKKXQw.js", mo = "/assets/override-menu-DcOjhAMV.js";
|
|
652
652
|
function ho(e) {
|
|
653
653
|
var n;
|
|
654
654
|
const i = ne(e), t = (n = i.variant) == null ? void 0 : n.variantCombinations;
|
|
@@ -839,11 +839,11 @@ async function bo(e, i) {
|
|
|
839
839
|
);
|
|
840
840
|
return Ft.set(t, n), n;
|
|
841
841
|
}
|
|
842
|
-
const
|
|
842
|
+
const Dt = /* @__PURE__ */ new Map();
|
|
843
843
|
async function yo(e, i, t) {
|
|
844
844
|
const n = `${e._id}-${e.updatedAt}-${i || "null"}-${t || "null"}`;
|
|
845
|
-
if (
|
|
846
|
-
return
|
|
845
|
+
if (Dt.has(n))
|
|
846
|
+
return Dt.get(n);
|
|
847
847
|
const a = await $i(
|
|
848
848
|
mo,
|
|
849
849
|
JSON.stringify({
|
|
@@ -852,7 +852,7 @@ async function yo(e, i, t) {
|
|
|
852
852
|
schedulerIds: t ? [t] : void 0
|
|
853
853
|
})
|
|
854
854
|
);
|
|
855
|
-
return
|
|
855
|
+
return Dt.set(n, a), a;
|
|
856
856
|
}
|
|
857
857
|
async function Bs(e, i, t) {
|
|
858
858
|
var r, l;
|
|
@@ -888,7 +888,7 @@ const _o = Pi("menu-edit-state", {
|
|
|
888
888
|
})
|
|
889
889
|
}), wo = {}, So = { class: "pl-32" };
|
|
890
890
|
function Co(e, i) {
|
|
891
|
-
return O(),
|
|
891
|
+
return O(), J("div", So, [
|
|
892
892
|
ve(e.$slots, "default")
|
|
893
893
|
]);
|
|
894
894
|
}
|
|
@@ -936,27 +936,27 @@ function xo(e, i) {
|
|
|
936
936
|
}
|
|
937
937
|
function et(e) {
|
|
938
938
|
return function(i) {
|
|
939
|
-
if (Array.isArray(i)) return
|
|
939
|
+
if (Array.isArray(i)) return It(i);
|
|
940
940
|
}(e) || function(i) {
|
|
941
941
|
if (typeof Symbol < "u" && i[Symbol.iterator] != null || i["@@iterator"] != null) return Array.from(i);
|
|
942
942
|
}(e) || function(i, t) {
|
|
943
943
|
if (i) {
|
|
944
|
-
if (typeof i == "string") return
|
|
944
|
+
if (typeof i == "string") return It(i, t);
|
|
945
945
|
var n = Object.prototype.toString.call(i).slice(8, -1);
|
|
946
946
|
if (n === "Object" && i.constructor && (n = i.constructor.name), n === "Map" || n === "Set") return Array.from(i);
|
|
947
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return
|
|
947
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return It(i, t);
|
|
948
948
|
}
|
|
949
949
|
}(e) || function() {
|
|
950
950
|
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
951
951
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
952
952
|
}();
|
|
953
953
|
}
|
|
954
|
-
function
|
|
954
|
+
function It(e, i) {
|
|
955
955
|
(i == null || i > e.length) && (i = e.length);
|
|
956
956
|
for (var t = 0, n = new Array(i); t < i; t++) n[t] = e[t];
|
|
957
957
|
return n;
|
|
958
958
|
}
|
|
959
|
-
var Ai,
|
|
959
|
+
var Ai, Mo, ft, ge = (Ai = function(e) {
|
|
960
960
|
/*!
|
|
961
961
|
Copyright (c) 2018 Jed Watson.
|
|
962
962
|
Licensed under the MIT License (MIT), see
|
|
@@ -983,7 +983,7 @@ var Ai, ko, ft, ge = (Ai = function(e) {
|
|
|
983
983
|
}
|
|
984
984
|
e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
|
|
985
985
|
})();
|
|
986
|
-
}, Ai(ft = { path:
|
|
986
|
+
}, Ai(ft = { path: Mo, exports: {}, require: function(e, i) {
|
|
987
987
|
return function() {
|
|
988
988
|
throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
|
|
989
989
|
}(i == null && ft.path);
|
|
@@ -1082,7 +1082,7 @@ function Zi(e, i) {
|
|
|
1082
1082
|
}
|
|
1083
1083
|
var dt = function(e, i) {
|
|
1084
1084
|
e === void 0 && (e = {}), i === void 0 && (i = {}), this.type = "manipulateImage", this.move = e, this.scale = i;
|
|
1085
|
-
},
|
|
1085
|
+
}, ko = function(e, i) {
|
|
1086
1086
|
i === void 0 && (i = {}), this.type = "resize", this.directions = e, this.params = i;
|
|
1087
1087
|
}, ti = function(e) {
|
|
1088
1088
|
this.type = "move", this.directions = e;
|
|
@@ -1152,7 +1152,7 @@ ii.render = function(e, i, t, n, a, o) {
|
|
|
1152
1152
|
return o.onMouseLeave && o.onMouseLeave.apply(o, arguments);
|
|
1153
1153
|
}) }, [ve(e.$slots, "default")], 34);
|
|
1154
1154
|
};
|
|
1155
|
-
var Pt = Ee("vue-handler-wrapper"),
|
|
1155
|
+
var Pt = Ee("vue-handler-wrapper"), Qi = { name: "HandlerWrapper", components: { DraggableElement: ii }, props: { horizontalPosition: { type: String }, verticalPosition: { type: String }, disabled: { type: Boolean, default: !1 } }, computed: { classes: function() {
|
|
1156
1156
|
var e;
|
|
1157
1157
|
if (this.horizontalPosition || this.verticalPosition) {
|
|
1158
1158
|
var i, t = Hi(this.horizontalPosition, this.verticalPosition);
|
|
@@ -1160,7 +1160,7 @@ var Pt = Ee("vue-handler-wrapper"), Ji = { name: "HandlerWrapper", components: {
|
|
|
1160
1160
|
} else e = Pt({ disabled: this.disabled });
|
|
1161
1161
|
return { root: e, draggable: Pt("draggable") };
|
|
1162
1162
|
} }, emits: ["leave", "enter", "drag", "drag-end"] };
|
|
1163
|
-
|
|
1163
|
+
Qi.render = function(e, i, t, n, a, o) {
|
|
1164
1164
|
var r = G("DraggableElement");
|
|
1165
1165
|
return O(), Y("div", { class: o.classes.root }, [w(r, { class: o.classes.draggable, onDrag: i[1] || (i[1] = function(l) {
|
|
1166
1166
|
return e.$emit("drag", l);
|
|
@@ -1174,11 +1174,11 @@ Ji.render = function(e, i, t, n, a, o) {
|
|
|
1174
1174
|
return [ve(e.$slots, "default")];
|
|
1175
1175
|
}), _: 3 }, 8, ["class"])], 2);
|
|
1176
1176
|
};
|
|
1177
|
-
var zo = Ee("vue-line-wrapper"),
|
|
1177
|
+
var zo = Ee("vue-line-wrapper"), Ji = { name: "LineWrapper", components: { DraggableElement: ii }, props: { position: { type: String, required: !0 }, disabled: { type: Boolean, default: !1 } }, computed: { classname: function() {
|
|
1178
1178
|
var e;
|
|
1179
1179
|
return zo((Oe(e = {}, this.position, !0), Oe(e, "disabled", this.disabled), e));
|
|
1180
1180
|
} }, emits: ["leave", "enter", "drag", "drag-end"] };
|
|
1181
|
-
|
|
1181
|
+
Ji.render = function(e, i, t, n, a, o) {
|
|
1182
1182
|
var r = G("DraggableElement");
|
|
1183
1183
|
return O(), Y(r, { class: o.classname, onDrag: i[1] || (i[1] = function(l) {
|
|
1184
1184
|
return e.$emit("drag", l);
|
|
@@ -1192,8 +1192,8 @@ Qi.render = function(e, i, t, n, a, o) {
|
|
|
1192
1192
|
return [ve(e.$slots, "default")];
|
|
1193
1193
|
}), _: 3 }, 8, ["class"]);
|
|
1194
1194
|
};
|
|
1195
|
-
var
|
|
1196
|
-
function
|
|
1195
|
+
var De = ["left", "right", "top", "bottom"], Eo = ["left", "right"], Fo = ["top", "bottom"], Do = ["left", "top"], Io = ["fill-area", "fit-area", "stencil", "none"], Mi = { left: 0, top: 0, width: 0, height: 0 };
|
|
1196
|
+
function ki(e, i, t) {
|
|
1197
1197
|
return !(t = t || ["width", "height", "left", "top"]).some(function(n) {
|
|
1198
1198
|
return e[n] !== i[n];
|
|
1199
1199
|
});
|
|
@@ -1209,7 +1209,7 @@ function _e(e) {
|
|
|
1209
1209
|
}
|
|
1210
1210
|
function ht(e, i) {
|
|
1211
1211
|
var t = { left: 0, top: 0, right: 0, bottom: 0 };
|
|
1212
|
-
return
|
|
1212
|
+
return De.forEach(function(n) {
|
|
1213
1213
|
var a = i[n], o = Pe(e)[n];
|
|
1214
1214
|
t[n] = a !== void 0 && o !== void 0 ? n === "left" || n === "top" ? Math.max(0, a - o) : Math.max(0, o - a) : 0;
|
|
1215
1215
|
}), t;
|
|
@@ -1217,10 +1217,10 @@ function ht(e, i) {
|
|
|
1217
1217
|
function Fe(e, i) {
|
|
1218
1218
|
return { left: e.left - i.left, top: e.top - i.top, width: e.width + i.left + i.right, height: e.height + i.top + i.bottom };
|
|
1219
1219
|
}
|
|
1220
|
-
function
|
|
1220
|
+
function Mt(e) {
|
|
1221
1221
|
return { left: -e.left, top: -e.top };
|
|
1222
1222
|
}
|
|
1223
|
-
function
|
|
1223
|
+
function Me(e, i) {
|
|
1224
1224
|
return X(X({}, e), { left: e.left + i.left, top: e.top + i.top });
|
|
1225
1225
|
}
|
|
1226
1226
|
function ze(e, i, t, n) {
|
|
@@ -1259,14 +1259,14 @@ function We(e, i) {
|
|
|
1259
1259
|
var t = i * Math.PI / 180;
|
|
1260
1260
|
return { left: e.left * Math.cos(t) - e.top * Math.sin(t), top: e.left * Math.sin(t) + e.top * Math.cos(t) };
|
|
1261
1261
|
}
|
|
1262
|
-
function
|
|
1262
|
+
function kt(e, i) {
|
|
1263
1263
|
var t = ht(we(e, i), i);
|
|
1264
1264
|
return t.left + t.right + t.top + t.bottom ? t.left + t.right > t.top + t.bottom ? Math.min((e.width + t.left + t.right) / e.width, at(e, i)) : Math.min((e.height + t.top + t.bottom) / e.height, at(e, i)) : 1;
|
|
1265
1265
|
}
|
|
1266
1266
|
function we(e, i, t) {
|
|
1267
1267
|
t === void 0 && (t = !1);
|
|
1268
1268
|
var n = rt(e, i);
|
|
1269
|
-
return
|
|
1269
|
+
return Me(e, t ? Mt(n) : n);
|
|
1270
1270
|
}
|
|
1271
1271
|
function Yt(e) {
|
|
1272
1272
|
return { width: e.right !== void 0 && e.left !== void 0 ? e.right - e.left : 1 / 0, height: e.bottom !== void 0 && e.top !== void 0 ? e.bottom - e.top : 1 / 0 };
|
|
@@ -1277,7 +1277,7 @@ function Po(e, i) {
|
|
|
1277
1277
|
function nn(e, i, t) {
|
|
1278
1278
|
t === void 0 && (t = !0);
|
|
1279
1279
|
var n = {};
|
|
1280
|
-
return
|
|
1280
|
+
return De.forEach(function(a) {
|
|
1281
1281
|
var o = e[a], r = i[a];
|
|
1282
1282
|
o !== void 0 && r !== void 0 ? n[a] = a === "left" || a === "top" ? t ? Math.max(o, r) : Math.min(o, r) : t ? Math.min(o, r) : Math.max(o, r) : r !== void 0 ? n[a] = r : o !== void 0 && (n[a] = o);
|
|
1283
1283
|
}), n;
|
|
@@ -1307,8 +1307,8 @@ function Ve(e) {
|
|
|
1307
1307
|
return s && { width: s.width, height: s.height };
|
|
1308
1308
|
}
|
|
1309
1309
|
function Ht(e) {
|
|
1310
|
-
var i = e.event, t = e.coordinates, n = e.positionRestrictions, a = n === void 0 ? {} : n, o =
|
|
1311
|
-
return
|
|
1310
|
+
var i = e.event, t = e.coordinates, n = e.positionRestrictions, a = n === void 0 ? {} : n, o = Me(t, i.directions);
|
|
1311
|
+
return Me(o, rt(o, a));
|
|
1312
1312
|
}
|
|
1313
1313
|
function To(e) {
|
|
1314
1314
|
var i = e.coordinates, t = e.transform, n = e.imageSize, a = e.sizeRestrictions, o = e.positionRestrictions, r = e.aspectRatio, l = e.visibleArea, s = function(c, d) {
|
|
@@ -1330,8 +1330,8 @@ function Uo(e) {
|
|
|
1330
1330
|
e.stencilReference;
|
|
1331
1331
|
var s, u, c, d = X({}, n), h = X({}, a), m = X({}, o);
|
|
1332
1332
|
s = ae(m), u = ae(d), c === void 0 && (c = 1e-3), (s === 0 || u === 0 ? Math.abs(u - s) < c : Math.abs(u / s) < 1 + c && Math.abs(u / s) > 1 - c) || (d = X(X({}, d), Ve({ sizeRestrictions: r, width: d.width, height: d.height, aspectRatio: { minimum: ae(m), maximum: ae(m) } })));
|
|
1333
|
-
var b =
|
|
1334
|
-
return b !== 1 && (h = ze(h, b), d = ze(d, b)), h = we(h =
|
|
1333
|
+
var b = kt(h = ze(h, d.width * t.width / (h.width * m.width)), i({ visibleArea: h, type: "resize" }));
|
|
1334
|
+
return b !== 1 && (h = ze(h, b), d = ze(d, b)), h = we(h = Me(h, ot(_e(d), _e(h))), i({ visibleArea: h, type: "move" })), { coordinates: d = we(d, Ot(Pe(h), l)), visibleArea: h };
|
|
1335
1335
|
}
|
|
1336
1336
|
function Vo(e) {
|
|
1337
1337
|
var i = e.event, t = e.getAreaRestrictions, n = e.boundaries, a = e.coordinates, o = e.visibleArea;
|
|
@@ -1342,8 +1342,8 @@ function Vo(e) {
|
|
|
1342
1342
|
if (a && o && i.type !== "manipulateImage") {
|
|
1343
1343
|
var u = { width: 0, height: 0 };
|
|
1344
1344
|
s.width, n.width, ae(n) > ae(l) ? (u.height = 0.8 * n.height, u.width = u.height * ae(l)) : (u.width = 0.8 * n.width, u.height = u.width * ae(l));
|
|
1345
|
-
var c =
|
|
1346
|
-
s = ze(s, c), c !== 1 && (u.height /= c, u.width /= c), s = we(s =
|
|
1345
|
+
var c = kt(s = ze(s, l.width * n.width / (s.width * u.width)), t({ visibleArea: s, type: "resize" }));
|
|
1346
|
+
s = ze(s, c), c !== 1 && (u.height /= c, u.width /= c), s = we(s = Me(s, ot(_e(l), _e(s))), t({ visibleArea: s, type: "move" })), l = we(l, Ot(Pe(s), r));
|
|
1347
1347
|
}
|
|
1348
1348
|
return { coordinates: l, visibleArea: s };
|
|
1349
1349
|
}
|
|
@@ -1351,7 +1351,7 @@ function $o(e) {
|
|
|
1351
1351
|
var i = e.event, t = e.coordinates, n = e.visibleArea, a = e.getAreaRestrictions, o = X({}, n), r = X({}, t);
|
|
1352
1352
|
if (i.type === "setCoordinates") {
|
|
1353
1353
|
var l = Math.max(0, r.width - o.width), s = Math.max(0, r.height - o.height);
|
|
1354
|
-
l > s ? o = ze(o, Math.min(r.width / o.width, at(o, a({ visibleArea: o, type: "resize" })))) : s > l && (o = ze(o, Math.min(r.height / o.height, at(o, a({ visibleArea: o, type: "resize" }))))), o = we(o =
|
|
1354
|
+
l > s ? o = ze(o, Math.min(r.width / o.width, at(o, a({ visibleArea: o, type: "resize" })))) : s > l && (o = ze(o, Math.min(r.height / o.height, at(o, a({ visibleArea: o, type: "resize" }))))), o = we(o = Me(o, Mt(rt(r, Pe(o)))), a({ visibleArea: o, type: "move" }));
|
|
1355
1355
|
}
|
|
1356
1356
|
return { visibleArea: o, coordinates: r };
|
|
1357
1357
|
}
|
|
@@ -1381,21 +1381,21 @@ function vt(e, i) {
|
|
|
1381
1381
|
}
|
|
1382
1382
|
function Go(e) {
|
|
1383
1383
|
var i = e.event, t = e.coordinates, n = e.visibleArea, a = e.sizeRestrictions, o = e.getAreaRestrictions, r = e.positionRestrictions, l = e.adjustStencil, s = i.scale, u = i.move, c = X({}, n), d = X({}, t), h = 1, m = 1, b = s.factor && Math.abs(s.factor - 1) > 1e-3;
|
|
1384
|
-
c =
|
|
1384
|
+
c = Me(c, { left: u.left || 0, top: u.top || 0 });
|
|
1385
1385
|
var v = { stencil: { minimum: Math.max(a.minWidth ? a.minWidth / d.width : 0, a.minHeight ? a.minHeight / d.height : 0), maximum: Math.min(a.maxWidth ? a.maxWidth / d.width : 1 / 0, a.maxHeight ? a.maxHeight / d.height : 1 / 0, at(d, r)) }, area: { maximum: at(c, o({ visibleArea: c, type: "resize" })) } };
|
|
1386
1386
|
s.factor && b && (s.factor < 1 ? (m = Math.max(s.factor, v.stencil.minimum)) > 1 && (m = 1) : s.factor > 1 && (m = Math.min(s.factor, Math.min(v.area.maximum, v.stencil.maximum))) < 1 && (m = 1)), m && (c = ze(c, m, s.center));
|
|
1387
1387
|
var f = t.left - n.left, S = n.width + n.left - (t.width + t.left), z = t.top - n.top, E = n.height + n.top - (t.height + t.top);
|
|
1388
|
-
return c = we(c =
|
|
1388
|
+
return c = we(c = Me(c, rt(c, { left: r.left !== void 0 ? r.left - f * m : void 0, top: r.top !== void 0 ? r.top - z * m : void 0, bottom: r.bottom !== void 0 ? r.bottom + E * m : void 0, right: r.right !== void 0 ? r.right + S * m : void 0 })), o({ visibleArea: c, type: "move" })), d.width = d.width * m, d.height = d.height * m, d.left = c.left + f * m, d.top = c.top + z * m, d = we(d, Ot(Pe(c), r)), s.factor && b && l && (s.factor > 1 ? h = Math.min(v.area.maximum, s.factor) / m : s.factor < 1 && (h = Math.max(d.height / c.height, d.width / c.width, s.factor / m)), h !== 1 && (c = Me(c = we(c = ze(c, h, s.factor > 1 ? s.center : _e(d)), o({ visibleArea: c, type: "move" })), Mt(rt(d, Pe(c)))))), { coordinates: d, visibleArea: c };
|
|
1389
1389
|
}
|
|
1390
1390
|
function jo(e) {
|
|
1391
1391
|
var i = e.aspectRatio, t = e.getAreaRestrictions, n = e.coordinates, a = e.visibleArea, o = e.sizeRestrictions, r = e.positionRestrictions, l = e.imageSize, s = e.previousImageSize, u = e.angle, c = X({}, n), d = X({}, a), h = We(_e(X({ left: 0, top: 0 }, s)), u);
|
|
1392
|
-
return (c = X(X({}, Ve({ sizeRestrictions: o, aspectRatio: i, width: c.width, height: c.height })), We(_e(c), u))).left -= h.left - l.width / 2 + c.width / 2, c.top -= h.top - l.height / 2 + c.height / 2, d = ze(d,
|
|
1392
|
+
return (c = X(X({}, Ve({ sizeRestrictions: o, aspectRatio: i, width: c.width, height: c.height })), We(_e(c), u))).left -= h.left - l.width / 2 + c.width / 2, c.top -= h.top - l.height / 2 + c.height / 2, d = ze(d, kt(d, t({ visibleArea: d, type: "resize" }))), { coordinates: c = we(c, r), visibleArea: d = we(d = Me(d, ot(_e(c), _e(n))), t({ visibleArea: d, type: "move" })) };
|
|
1393
1393
|
}
|
|
1394
1394
|
function Wo(e) {
|
|
1395
1395
|
var i = e.flip, t = e.previousFlip, n = e.rotate, a = e.getAreaRestrictions, o = e.coordinates, r = e.visibleArea, l = e.imageSize, s = X({}, o), u = X({}, r), c = t.horizontal !== i.horizontal, d = t.vertical !== i.vertical;
|
|
1396
1396
|
if (c || d) {
|
|
1397
1397
|
var h = We({ left: l.width / 2, top: l.height / 2 }, -n), m = We(_e(s), -n), b = We({ left: c ? h.left - (m.left - h.left) : m.left, top: d ? h.top - (m.top - h.top) : m.top }, n);
|
|
1398
|
-
s =
|
|
1398
|
+
s = Me(s, ot(b, _e(s))), m = We(_e(u), -n), u = we(u = Me(u, ot(b = We({ left: c ? h.left - (m.left - h.left) : m.left, top: d ? h.top - (m.top - h.top) : m.top }, n), _e(u))), a({ visibleArea: u, type: "move" }));
|
|
1399
1399
|
}
|
|
1400
1400
|
return { coordinates: s, visibleArea: u };
|
|
1401
1401
|
}
|
|
@@ -1405,22 +1405,22 @@ function Ei(e) {
|
|
|
1405
1405
|
var d = ht(Fe(t, s), a);
|
|
1406
1406
|
l && (d.left && d.left > 0 && d.right === 0 ? (s.right += d.left, s.left -= d.left) : d.right && d.right > 0 && d.left === 0 && (s.left += d.right, s.right -= d.right), d.top && d.top > 0 && d.bottom === 0 ? (s.bottom += d.top, s.top -= d.top) : d.bottom && d.bottom > 0 && d.top === 0 && (s.top += d.bottom, s.bottom -= d.bottom), d = ht(Fe(t, s), a));
|
|
1407
1407
|
var h = { width: 1 / 0, height: 1 / 0, left: 1 / 0, right: 1 / 0, top: 1 / 0, bottom: 1 / 0 };
|
|
1408
|
-
if (
|
|
1408
|
+
if (De.forEach(function(v) {
|
|
1409
1409
|
var f = d[v];
|
|
1410
1410
|
f && s[v] && (h[v] = Math.max(0, 1 - f / s[v]));
|
|
1411
1411
|
}), r) {
|
|
1412
|
-
var m = Math.min.apply(null,
|
|
1412
|
+
var m = Math.min.apply(null, De.map(function(v) {
|
|
1413
1413
|
return h[v];
|
|
1414
1414
|
}));
|
|
1415
|
-
m !== 1 / 0 &&
|
|
1415
|
+
m !== 1 / 0 && De.forEach(function(v) {
|
|
1416
1416
|
s[v] *= m;
|
|
1417
1417
|
});
|
|
1418
|
-
} else
|
|
1418
|
+
} else De.forEach(function(v) {
|
|
1419
1419
|
h[v] !== 1 / 0 && (s[v] *= h[v]);
|
|
1420
1420
|
});
|
|
1421
1421
|
if (u = Fe(t, s).width, c = Fe(t, s).height, s.right + s.left && (u > o.maxWidth ? h.width = (o.maxWidth - t.width) / (s.right + s.left) : u < o.minWidth && (h.width = (o.minWidth - t.width) / (s.right + s.left))), s.bottom + s.top && (c > o.maxHeight ? h.height = (o.maxHeight - t.height) / (s.bottom + s.top) : c < o.minHeight && (h.height = (o.minHeight - t.height) / (s.bottom + s.top))), r) {
|
|
1422
1422
|
var b = Math.min(h.width, h.height);
|
|
1423
|
-
b !== 1 / 0 &&
|
|
1423
|
+
b !== 1 / 0 && De.forEach(function(v) {
|
|
1424
1424
|
s[v] *= b;
|
|
1425
1425
|
});
|
|
1426
1426
|
} else h.width !== 1 / 0 && Eo.forEach(function(v) {
|
|
@@ -1433,7 +1433,7 @@ function Ei(e) {
|
|
|
1433
1433
|
function bt(e, i, t) {
|
|
1434
1434
|
return i == 0 && t == 0 ? e / 2 : i == 0 ? 0 : t == 0 ? e : e * Math.abs(i / (i + t));
|
|
1435
1435
|
}
|
|
1436
|
-
var Yo = Ee("vue-simple-handler"), Ho = Ee("vue-simple-handler-wrapper"), ni = { name: "SimpleHandler", components: { HandlerWrapper:
|
|
1436
|
+
var Yo = Ee("vue-simple-handler"), Ho = Ee("vue-simple-handler-wrapper"), ni = { name: "SimpleHandler", components: { HandlerWrapper: Qi }, props: { defaultClass: { type: String }, hoverClass: { type: String }, wrapperClass: { type: String }, horizontalPosition: { type: String }, verticalPosition: { type: String }, disabled: { type: Boolean, default: !1 } }, data: function() {
|
|
1437
1437
|
return { hover: !1 };
|
|
1438
1438
|
}, computed: { classes: function() {
|
|
1439
1439
|
var e, i = (Oe(e = {}, this.horizontalPosition, !!this.horizontalPosition), Oe(e, this.verticalPosition, !!this.verticalPosition), Oe(e, "".concat(this.horizontalPosition, "-").concat(this.verticalPosition), !!(this.verticalPosition && this.horizontalPosition)), Oe(e, "hover", this.hover), e);
|
|
@@ -1453,7 +1453,7 @@ ni.render = function(e, i, t, n, a, o) {
|
|
|
1453
1453
|
return [w("div", { class: o.classes.default }, null, 2)];
|
|
1454
1454
|
}), _: 1 }, 8, ["class", "vertical-position", "horizontal-position", "disabled", "onDrag", "onDragEnd", "onEnter", "onLeave"]);
|
|
1455
1455
|
};
|
|
1456
|
-
var Xo = Ee("vue-simple-line"), qo = Ee("vue-simple-line-wrapper"), oi = { name: "SimpleLine", components: { LineWrapper:
|
|
1456
|
+
var Xo = Ee("vue-simple-line"), qo = Ee("vue-simple-line-wrapper"), oi = { name: "SimpleLine", components: { LineWrapper: Ji }, props: { defaultClass: { type: String }, hoverClass: { type: String }, wrapperClass: { type: String }, position: { type: String }, disabled: { type: Boolean, default: !1 } }, data: function() {
|
|
1457
1457
|
return { hover: !1 };
|
|
1458
1458
|
}, computed: { classes: function() {
|
|
1459
1459
|
return { root: ge(Xo(Oe({}, this.position, !0)), this.defaultClass, this.hover && this.hoverClass), wrapper: ge(qo(Oe({}, this.position, !0)), this.wrapperClass) };
|
|
@@ -1472,7 +1472,7 @@ oi.render = function(e, i, t, n, a, o) {
|
|
|
1472
1472
|
return [w("div", { class: o.classes.root }, null, 2)];
|
|
1473
1473
|
}), _: 1 }, 8, ["class", "position", "disabled", "onDrag", "onDragEnd", "onEnter", "onLeave"]);
|
|
1474
1474
|
};
|
|
1475
|
-
var Ut = Ee("vue-bounding-box"), Zo = ["east", "west", null],
|
|
1475
|
+
var Ut = Ee("vue-bounding-box"), Zo = ["east", "west", null], Qo = ["south", "north", null], on = { name: "BoundingBox", props: { width: { type: Number }, height: { type: Number }, transitions: { type: Object }, handlers: { type: Object, default: function() {
|
|
1476
1476
|
return { eastNorth: !0, north: !0, westNorth: !0, west: !0, westSouth: !0, south: !0, eastSouth: !0, east: !0 };
|
|
1477
1477
|
} }, handlersComponent: { type: [Object, String], default: function() {
|
|
1478
1478
|
return ni;
|
|
@@ -1491,7 +1491,7 @@ var Ut = Ee("vue-bounding-box"), Zo = ["east", "west", null], Jo = ["south", "no
|
|
|
1491
1491
|
} }, resizable: { type: Boolean, default: !0 } }, data: function() {
|
|
1492
1492
|
var e = [];
|
|
1493
1493
|
return Zo.forEach(function(i) {
|
|
1494
|
-
|
|
1494
|
+
Qo.forEach(function(t) {
|
|
1495
1495
|
if (i !== t) {
|
|
1496
1496
|
var n = Hi(i, t), a = n.name, o = n.classname;
|
|
1497
1497
|
e.push({ name: a, classname: o, verticalDirection: t, horizontalDirection: i });
|
|
@@ -1531,16 +1531,16 @@ var Ut = Ee("vue-bounding-box"), Zo = ["east", "west", null], Jo = ["south", "no
|
|
|
1531
1531
|
this.$emit("resize-end");
|
|
1532
1532
|
}, onHandlerDrag: function(e, i, t) {
|
|
1533
1533
|
var n, a = e.shift(), o = a.left, r = a.top, l = { left: 0, right: 0, top: 0, bottom: 0 };
|
|
1534
|
-
i === "west" ? l.left -= o : i === "east" && (l.right += o), t === "north" ? l.top -= r : t === "south" && (l.bottom += r), !t && i ? n = "width" : t && !i && (n = "height"), this.resizable && this.$emit("resize", new
|
|
1534
|
+
i === "west" ? l.left -= o : i === "east" && (l.right += o), t === "north" ? l.top -= r : t === "south" && (l.bottom += r), !t && i ? n = "width" : t && !i && (n = "height"), this.resizable && this.$emit("resize", new ko(l, { allowedDirections: { left: i === "west" || !i, right: i === "east" || !i, bottom: t === "south" || !t, top: t === "north" || !t }, preserveAspectRatio: e.nativeEvent && e.nativeEvent.shiftKey, respectDirection: n }));
|
|
1535
1535
|
} }, emits: ["resize", "resize-end"] };
|
|
1536
1536
|
on.render = function(e, i, t, n, a, o) {
|
|
1537
|
-
return O(), Y("div", { ref: "box", class: o.classes.root, style: o.style }, [ve(e.$slots, "default"), w("div", null, [(O(!0), Y(
|
|
1537
|
+
return O(), Y("div", { ref: "box", class: o.classes.root, style: o.style }, [ve(e.$slots, "default"), w("div", null, [(O(!0), Y(ke, null, Ye(o.lineNodes, function(r) {
|
|
1538
1538
|
return O(), Y(St(r.component), { key: r.name, "default-class": r.class, "hover-class": r.hoverClass, "wrapper-class": r.wrapperClass, position: r.name, disabled: r.disabled, onDrag: function(l) {
|
|
1539
1539
|
return o.onHandlerDrag(l, r.horizontalDirection, r.verticalDirection);
|
|
1540
1540
|
}, onDragEnd: i[1] || (i[1] = function(l) {
|
|
1541
1541
|
return o.onEnd();
|
|
1542
1542
|
}) }, null, 8, ["default-class", "hover-class", "wrapper-class", "position", "disabled", "onDrag"]);
|
|
1543
|
-
}), 128))]), (O(!0), Y(
|
|
1543
|
+
}), 128))]), (O(!0), Y(ke, null, Ye(o.handlerNodes, function(r) {
|
|
1544
1544
|
return O(), Y("div", { key: r.name, style: r.wrapperStyle, class: r.wrapperClass }, [(O(), Y(St(r.component), { "default-class": r.class, "hover-class": r.hoverClass, "wrapper-class": r.wrapperClass, "horizontal-position": r.horizontalDirection, "vertical-position": r.verticalDirection, disabled: r.disabled, onDrag: function(l) {
|
|
1545
1545
|
return o.onHandlerDrag(l, r.horizontalDirection, r.verticalDirection);
|
|
1546
1546
|
}, onDragEnd: i[2] || (i[2] = function(l) {
|
|
@@ -1548,8 +1548,8 @@ on.render = function(e, i, t, n, a, o) {
|
|
|
1548
1548
|
}) }, null, 8, ["default-class", "hover-class", "wrapper-class", "horizontal-position", "vertical-position", "disabled", "onDrag"]))], 6);
|
|
1549
1549
|
}), 128))], 6);
|
|
1550
1550
|
};
|
|
1551
|
-
var
|
|
1552
|
-
return { default:
|
|
1551
|
+
var Jo = Ee("vue-draggable-area"), an = { name: "DraggableArea", props: { movable: { type: Boolean, default: !0 }, activationDistance: { type: Number, default: 20 } }, computed: { classnames: function() {
|
|
1552
|
+
return { default: Jo() };
|
|
1553
1553
|
} }, beforeMount: function() {
|
|
1554
1554
|
window.addEventListener("mouseup", this.onMouseUp, { passive: !1 }), window.addEventListener("mousemove", this.onMouseMove, { passive: !1 }), window.addEventListener("touchmove", this.onTouchMove, { passive: !1 }), window.addEventListener("touchend", this.onTouchEnd, { passive: !1 });
|
|
1555
1555
|
}, beforeUnmount: function() {
|
|
@@ -1794,7 +1794,7 @@ var yt = Ee("vue-preview"), ln = { props: { coordinates: { type: Object }, trans
|
|
|
1794
1794
|
e && e.complete && this.refreshImage(), this.refresh();
|
|
1795
1795
|
} } };
|
|
1796
1796
|
ln.render = function(e, i, t, n, a, o) {
|
|
1797
|
-
return O(), Y("div", { ref: "root", class: o.classes.root, style: o.style }, [w("div", { ref: "wrapper", class: o.classes.wrapper, style: o.wrapperStyle }, [
|
|
1797
|
+
return O(), Y("div", { ref: "root", class: o.classes.root, style: o.style }, [w("div", { ref: "wrapper", class: o.classes.wrapper, style: o.wrapperStyle }, [Je(w("img", { ref: "image", src: t.image && t.image.src, class: o.classes.image, style: o.imageStyle }, null, 14, ["src"]), [[At, t.image && t.image.src]])], 6)], 6);
|
|
1798
1798
|
};
|
|
1799
1799
|
var un = { components: { Preview: ln }, inheritAttrs: !1 };
|
|
1800
1800
|
un.render = function(e, i, t, n, a, o) {
|
|
@@ -1846,12 +1846,12 @@ var ia = ["transitions"], Te = Ee("vue-advanced-cropper"), dn = { name: "Cropper
|
|
|
1846
1846
|
} }, stencilProps: { type: Object, default: function() {
|
|
1847
1847
|
return {};
|
|
1848
1848
|
} }, autoZoom: { type: Boolean, default: !1 }, imageClass: { type: String }, boundariesClass: { type: String }, backgroundClass: { type: String }, foregroundClass: { type: String }, minWidth: { type: [Number, String] }, minHeight: { type: [Number, String] }, maxWidth: { type: [Number, String] }, maxHeight: { type: [Number, String] }, debounce: { type: [Boolean, Number], default: 500 }, transitions: { type: Boolean, default: !0 }, checkOrientation: { type: Boolean, default: !0 }, canvas: { type: [Object, Boolean], default: !0 }, crossOrigin: { type: [Boolean, String], default: void 0 }, transitionTime: { type: Number, default: 300 }, imageRestriction: { type: String, default: "fit-area", validator: function(e) {
|
|
1849
|
-
return
|
|
1849
|
+
return Io.indexOf(e) !== -1;
|
|
1850
1850
|
} }, roundResult: { type: Boolean, default: !0 }, defaultSize: { type: [Function, Object] }, defaultPosition: { type: [Function, Object] }, defaultVisibleArea: { type: [Function, Object] }, defaultTransforms: { type: [Function, Object] }, defaultBoundaries: { type: [Function, String], validator: function(e) {
|
|
1851
1851
|
return !(typeof e == "string" && e !== "fill" && e !== "fit");
|
|
1852
1852
|
} }, priority: { type: String, default: "coordinates" }, stencilSize: { type: [Object, Function] }, resizeImage: { type: [Boolean, Object], default: !0 }, moveImage: { type: [Boolean, Object], default: !0 }, autoZoomAlgorithm: { type: Function }, resizeAlgorithm: { type: Function, default: function(e) {
|
|
1853
1853
|
var i = e.event, t = e.coordinates, n = e.aspectRatio, a = e.positionRestrictions, o = e.sizeRestrictions, r = X(X({}, t), { right: t.left + t.width, bottom: t.top + t.height }), l = i.params || {}, s = X({}, i.directions), u = l.allowedDirections || { left: !0, right: !0, bottom: !0, top: !0 };
|
|
1854
|
-
o.widthFrozen && (s.left = 0, s.right = 0), o.heightFrozen && (s.top = 0, s.bottom = 0),
|
|
1854
|
+
o.widthFrozen && (s.left = 0, s.right = 0), o.heightFrozen && (s.top = 0, s.bottom = 0), De.forEach(function(j) {
|
|
1855
1855
|
u[j] || (s[j] = 0);
|
|
1856
1856
|
});
|
|
1857
1857
|
var c = Fe(r, s = Ei({ coordinates: r, directions: s, sizeRestrictions: o, positionRestrictions: a })).width, d = Fe(r, s).height, h = l.preserveRatio ? ae(r) : Tt(c / d, n);
|
|
@@ -1872,7 +1872,7 @@ var ia = ["transitions"], Te = Ee("vue-advanced-cropper"), dn = { name: "Cropper
|
|
|
1872
1872
|
}
|
|
1873
1873
|
s = Ei({ directions: s, coordinates: r, sizeRestrictions: o, positionRestrictions: a, preserveRatio: !0, compensate: l.compensate });
|
|
1874
1874
|
}
|
|
1875
|
-
return c = Fe(r, s).width, d = Fe(r, s).height, (h = l.preserveRatio ? ae(r) : Tt(c / d, n)) && Math.abs(h - c / d) > 1e-3 &&
|
|
1875
|
+
return c = Fe(r, s).width, d = Fe(r, s).height, (h = l.preserveRatio ? ae(r) : Tt(c / d, n)) && Math.abs(h - c / d) > 1e-3 && De.forEach(function(j) {
|
|
1876
1876
|
u[j] || (s[j] = 0);
|
|
1877
1877
|
}), Ht({ event: new ti({ left: -s.left, top: -s.top }), coordinates: { width: t.width + s.right + s.left, height: t.height + s.top + s.bottom, left: t.left, top: t.top }, positionRestrictions: a });
|
|
1878
1878
|
} }, moveAlgorithm: { type: Function, default: Ht }, initStretcher: { type: Function, default: function(e) {
|
|
@@ -1880,12 +1880,12 @@ var ia = ["transitions"], Te = Ee("vue-advanced-cropper"), dn = { name: "Cropper
|
|
|
1880
1880
|
i.style.width = t.width + "px", i.style.height = i.clientWidth / n + "px", i.style.width = i.clientWidth + "px";
|
|
1881
1881
|
} }, fitCoordinates: { type: Function, default: function(e) {
|
|
1882
1882
|
var i = e.visibleArea, t = e.coordinates, n = e.aspectRatio, a = e.sizeRestrictions, o = e.positionRestrictions, r = X(X({}, t), Ve({ width: t.width, height: t.height, aspectRatio: n, sizeRestrictions: { maxWidth: i.width, maxHeight: i.height, minHeight: Math.min(i.height, a.minHeight), minWidth: Math.min(i.width, a.minWidth) } }));
|
|
1883
|
-
return r = we(r =
|
|
1883
|
+
return r = we(r = Me(r, ot(_e(t), _e(r))), Ot(Pe(i), o));
|
|
1884
1884
|
} }, fitVisibleArea: { type: Function, default: function(e) {
|
|
1885
1885
|
var i = e.visibleArea, t = e.boundaries, n = e.getAreaRestrictions, a = e.coordinates, o = X({}, i);
|
|
1886
1886
|
o.height = o.width / ae(t), o.top += (i.height - o.height) / 2, (a.height - o.height > 0 || a.width - o.width > 0) && (o = ze(o, Math.max(a.height / o.height, a.width / o.width)));
|
|
1887
|
-
var r =
|
|
1888
|
-
return o.width < a.width && (r.left = 0), o.height < a.height && (r.top = 0), o = we(o =
|
|
1887
|
+
var r = Mt(rt(a, Pe(o = ze(o, kt(o, n({ visibleArea: o, type: "resize" }))))));
|
|
1888
|
+
return o.width < a.width && (r.left = 0), o.height < a.height && (r.top = 0), o = we(o = Me(o, r), n({ visibleArea: o, type: "move" }));
|
|
1889
1889
|
} }, areaRestrictionsAlgorithm: { type: Function, default: function(e) {
|
|
1890
1890
|
var i = e.visibleArea, t = e.boundaries, n = e.imageSize, a = e.imageRestriction, o = e.type, r = {};
|
|
1891
1891
|
return a === "fill-area" ? r = { left: 0, top: 0, right: n.width, bottom: n.height } : a === "fit-area" && (ae(t) > ae(n) ? (r = { top: 0, bottom: n.height }, i && o === "move" && (i.width > n.width ? (r.left = -(i.width - n.width) / 2, r.right = n.width - r.left) : (r.left = 0, r.right = n.width))) : (r = { left: 0, right: n.width }, i && o === "move" && (i.height > n.height ? (r.top = -(i.height - n.height) / 2, r.bottom = n.height - r.top) : (r.top = 0, r.bottom = n.height)))), r;
|
|
@@ -1895,7 +1895,7 @@ var ia = ["transitions"], Te = Ee("vue-advanced-cropper"), dn = { name: "Cropper
|
|
|
1895
1895
|
var i = e.imageSize, t = {};
|
|
1896
1896
|
return e.imageRestriction !== "none" && (t = { left: 0, top: 0, right: i.width, bottom: i.height }), t;
|
|
1897
1897
|
} } }, data: function() {
|
|
1898
|
-
return { transitionsActive: !1, imageLoaded: !1, imageAttributes: { width: null, height: null, crossOrigin: null, src: null }, defaultImageTransforms: { rotate: 0, flip: { horizontal: !1, vertical: !1 } }, appliedImageTransforms: { rotate: 0, flip: { horizontal: !1, vertical: !1 } }, boundaries: { width: 0, height: 0 }, visibleArea: null, coordinates: oe({},
|
|
1898
|
+
return { transitionsActive: !1, imageLoaded: !1, imageAttributes: { width: null, height: null, crossOrigin: null, src: null }, defaultImageTransforms: { rotate: 0, flip: { horizontal: !1, vertical: !1 } }, appliedImageTransforms: { rotate: 0, flip: { horizontal: !1, vertical: !1 } }, boundaries: { width: 0, height: 0 }, visibleArea: null, coordinates: oe({}, Mi) };
|
|
1899
1899
|
}, computed: { image: function() {
|
|
1900
1900
|
return { src: this.imageAttributes.src, width: this.imageAttributes.width, height: this.imageAttributes.height, transforms: this.imageTransforms };
|
|
1901
1901
|
}, imageTransforms: function() {
|
|
@@ -2020,7 +2020,7 @@ var ia = ["transitions"], Te = Ee("vue-advanced-cropper"), dn = { name: "Cropper
|
|
|
2020
2020
|
var a = this.autoZoomAlgorithm;
|
|
2021
2021
|
a || (a = this.stencilSize ? Uo : this.autoZoom ? Vo : $o);
|
|
2022
2022
|
var o = a({ event: { type: e, params: n }, visibleArea: i, coordinates: t, boundaries: this.boundaries, aspectRatio: this.getAspectRatio(), positionRestrictions: this.positionRestrictions, getAreaRestrictions: this.getAreaRestrictions, sizeRestrictions: this.sizeRestrictions, stencilSize: this.getStencilSize() });
|
|
2023
|
-
return oe(oe({}, o), {}, { changed: !
|
|
2023
|
+
return oe(oe({}, o), {}, { changed: !ki(o.visibleArea, i) || !ki(o.coordinates, t) });
|
|
2024
2024
|
}, runAutoZoom: function(e) {
|
|
2025
2025
|
var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = i.transitions, n = t !== void 0 && t, a = xo(i, ia), o = this.processAutoZoom(e, this.visibleArea, this.coordinates, a), r = o.visibleArea, l = o.coordinates, s = o.changed;
|
|
2026
2026
|
n && s && this.enableTransitions(), this.visibleArea = r, this.coordinates = l, n && s && this.debouncedDisableTransitions();
|
|
@@ -2030,13 +2030,13 @@ var ia = ["transitions"], Te = Ee("vue-advanced-cropper"), dn = { name: "Cropper
|
|
|
2030
2030
|
if (t.type === "manipulateImage") return X(X({}, t), { move: { left: t.move && t.move.left ? a * t.move.left : 0, top: t.move && t.move.top ? a * t.move.top : 0 }, scale: { factor: t.scale && t.scale.factor ? t.scale.factor : 1, center: t.scale && t.scale.center ? { left: t.scale.center.left * a + n.left, top: t.scale.center.top * a + n.top } : null } });
|
|
2031
2031
|
if (t.type === "resize") {
|
|
2032
2032
|
var o = X(X({}, t), { directions: X({}, t.directions) });
|
|
2033
|
-
return
|
|
2033
|
+
return De.forEach(function(l) {
|
|
2034
2034
|
o.directions[l] *= a;
|
|
2035
2035
|
}), o;
|
|
2036
2036
|
}
|
|
2037
2037
|
if (t.type === "move") {
|
|
2038
2038
|
var r = X(X({}, t), { directions: X({}, t.directions) });
|
|
2039
|
-
return
|
|
2039
|
+
return Do.forEach(function(l) {
|
|
2040
2040
|
r.directions[l] *= a;
|
|
2041
2041
|
}), r;
|
|
2042
2042
|
}
|
|
@@ -2247,7 +2247,7 @@ var ia = ["transitions"], Te = Ee("vue-advanced-cropper"), dn = { name: "Cropper
|
|
|
2247
2247
|
}, getPublicProperties: function() {
|
|
2248
2248
|
return { coefficient: this.coefficient, visibleArea: this.visibleArea, coordinates: this.coordinates, boundaries: this.boundaries, sizeRestrictions: this.sizeRestrictions, positionRestrictions: this.positionRestrictions, aspectRatio: this.getAspectRatio(), imageRestriction: this.imageRestriction };
|
|
2249
2249
|
}, defaultCoordinates: function() {
|
|
2250
|
-
return oe({},
|
|
2250
|
+
return oe({}, Mi);
|
|
2251
2251
|
}, flip: function(e, i) {
|
|
2252
2252
|
var t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, n = t.transitions, a = n === void 0 || n;
|
|
2253
2253
|
if (!this.transitionsActive) {
|
|
@@ -2268,7 +2268,7 @@ var ia = ["transitions"], Te = Ee("vue-advanced-cropper"), dn = { name: "Cropper
|
|
|
2268
2268
|
dn.render = function(e, i, t, n, a, o) {
|
|
2269
2269
|
return O(), Y("div", { ref: "cropper", class: o.classes.cropper }, [w("div", { ref: "stretcher", class: o.classes.stretcher }, null, 2), w("div", { class: o.classes.boundaries, style: o.boundariesStyle }, [(O(), Y(St(t.backgroundWrapperComponent), { class: o.classes.cropperWrapper, "wheel-resize": o.settings.resizeImage.wheel, "touch-resize": o.settings.resizeImage.touch, "touch-move": o.settings.moveImage.touch, "mouse-move": o.settings.moveImage.mouse, onMove: o.onManipulateImage, onResize: o.onManipulateImage }, { default: L(function() {
|
|
2270
2270
|
return [w("div", { class: o.classes.background, style: o.boundariesStyle }, null, 6), w("div", { class: o.classes.imageWrapper }, [w("img", { ref: "image", crossorigin: a.imageAttributes.crossOrigin, src: a.imageAttributes.src, class: o.classes.image, style: o.imageStyle, onMousedown: i[1] || (i[1] = Rt(function() {
|
|
2271
|
-
}, ["prevent"])) }, null, 46, ["crossorigin", "src"])], 2), w("div", { class: o.classes.foreground, style: o.boundariesStyle }, null, 6),
|
|
2271
|
+
}, ["prevent"])) }, null, 46, ["crossorigin", "src"])], 2), w("div", { class: o.classes.foreground, style: o.boundariesStyle }, null, 6), Je((O(), Y(St(t.stencilComponent), Ti({ ref: "stencil", image: o.image, coordinates: a.coordinates, "stencil-coordinates": o.stencilCoordinates, transitions: o.transitionsOptions }, t.stencilProps, { onResize: o.onResize, onResizeEnd: o.onResizeEnd, onMove: o.onMove, onMoveEnd: o.onMoveEnd }), null, 16, ["image", "coordinates", "stencil-coordinates", "transitions", "onResize", "onResizeEnd", "onMove", "onMoveEnd"])), [[At, a.imageLoaded]]), t.canvas ? (O(), Y("canvas", na, null, 512)) : te("", !0), t.canvas ? (O(), Y("canvas", oa, null, 512)) : te("", !0)];
|
|
2272
2272
|
}), _: 1 }, 8, ["class", "wheel-resize", "touch-resize", "touch-move", "mouse-move", "onMove", "onResize"]))], 6)], 2);
|
|
2273
2273
|
};
|
|
2274
2274
|
const aa = {
|
|
@@ -2291,7 +2291,7 @@ const aa = {
|
|
|
2291
2291
|
},
|
|
2292
2292
|
emits: ["update:model-value", "reset:model-value"],
|
|
2293
2293
|
setup(e, { emit: i }) {
|
|
2294
|
-
const t = e, { t: n } = me(), a = i, o = F(() => t.modelValue ? URL.createObjectURL(t.modelValue) : ""), r =
|
|
2294
|
+
const t = e, { t: n } = me(), a = i, o = F(() => t.modelValue ? URL.createObjectURL(t.modelValue) : ""), r = Q();
|
|
2295
2295
|
function l(b, v) {
|
|
2296
2296
|
const S = 2e3 / b;
|
|
2297
2297
|
return {
|
|
@@ -2304,10 +2304,10 @@ const aa = {
|
|
|
2304
2304
|
const { width: v, height: f } = b, S = 16 / 9, z = v / f;
|
|
2305
2305
|
let E = v, j = f;
|
|
2306
2306
|
z > S ? j = E / S : E = j * S;
|
|
2307
|
-
const
|
|
2308
|
-
return C.fillStyle = "white", C.fillRect(0, 0,
|
|
2307
|
+
const I = l(E, j), k = Ro(I.width, I.height), y = E > v ? (E - v) / 2 * I.ratio : 0, g = j > f ? (j - f) / 2 * I.ratio : 0, C = k.getContext("2d");
|
|
2308
|
+
return C.fillStyle = "white", C.fillRect(0, 0, I.width, I.height), C.drawImage(b, 0, 0, E, j, y, g, I.width, I.height), k.toDataURL();
|
|
2309
2309
|
}
|
|
2310
|
-
const u =
|
|
2310
|
+
const u = Q(!1);
|
|
2311
2311
|
async function c([b]) {
|
|
2312
2312
|
if (!b) return;
|
|
2313
2313
|
u.value = !0;
|
|
@@ -2335,7 +2335,7 @@ const aa = {
|
|
|
2335
2335
|
}
|
|
2336
2336
|
return (b, v) => {
|
|
2337
2337
|
const f = G("fm-icon"), S = G("fm-drop-field");
|
|
2338
|
-
return r.value || o.value ? (O(),
|
|
2338
|
+
return r.value || o.value ? (O(), J("div", aa, [
|
|
2339
2339
|
P("p", ra, [
|
|
2340
2340
|
Ct(de(p(n)("menu.common.labels.product_image")) + " ", 1),
|
|
2341
2341
|
P("span", sa, de(p(n)("menu.common.labels.optional")), 1)
|
|
@@ -2469,7 +2469,7 @@ const aa = {
|
|
|
2469
2469
|
});
|
|
2470
2470
|
return (u, c) => {
|
|
2471
2471
|
const d = G("fm-select");
|
|
2472
|
-
return O(),
|
|
2472
|
+
return O(), J("div", null, [
|
|
2473
2473
|
w(d, {
|
|
2474
2474
|
disabled: e.disable,
|
|
2475
2475
|
items: r.value,
|
|
@@ -2490,7 +2490,7 @@ const aa = {
|
|
|
2490
2490
|
fill: "none"
|
|
2491
2491
|
};
|
|
2492
2492
|
function ga(e, i) {
|
|
2493
|
-
return O(),
|
|
2493
|
+
return O(), J("svg", fa, i[0] || (i[0] = [
|
|
2494
2494
|
P("path", {
|
|
2495
2495
|
fill: "#1C1C1E",
|
|
2496
2496
|
d: "M7.6 7.6c.57-.658.9-2.1.9-2.1s.314 1.374.857 2c.572.66 2.143 1 2.143 1s-1.57.198-2.143.857C8.814 9.984 8.5 11.5 8.5 11.5s-.18-1.311-.75-1.91C7.149 8.962 5.5 8.5 5.5 8.5s1.5-.207 2.1-.9M12.2 12.2C13.342 10.885 14 8 14 8s.627 2.747 1.714 4C16.86 13.32 20 14 20 14s-3.141.395-4.286 1.714C14.627 16.967 14 20 14 20s-.358-2.622-1.5-3.818C11.298 14.922 8 14 8 14s2.998-.415 4.2-1.8"
|
|
@@ -2511,7 +2511,7 @@ const va = { render: ga }, ba = {
|
|
|
2511
2511
|
fill: "none"
|
|
2512
2512
|
};
|
|
2513
2513
|
function ya(e, i) {
|
|
2514
|
-
return O(),
|
|
2514
|
+
return O(), J("svg", ba, i[0] || (i[0] = [
|
|
2515
2515
|
P("g", {
|
|
2516
2516
|
stroke: "#1C1C1E",
|
|
2517
2517
|
"stroke-linecap": "round",
|
|
@@ -2531,7 +2531,7 @@ const _a = { render: ya }, mn = /* @__PURE__ */ ue({
|
|
|
2531
2531
|
setup(e) {
|
|
2532
2532
|
return (i, t) => {
|
|
2533
2533
|
var n;
|
|
2534
|
-
return (n = p(Ne)) != null && n.enable.value ? (O(),
|
|
2534
|
+
return (n = p(Ne)) != null && n.enable.value ? (O(), J("button", {
|
|
2535
2535
|
key: 0,
|
|
2536
2536
|
class: Le([!i.pureStyling && "bg-fm-color-neutral-gray-100 rounded-lg p-[6px]"]),
|
|
2537
2537
|
type: "button",
|
|
@@ -2542,7 +2542,7 @@ const _a = { render: ya }, mn = /* @__PURE__ */ ue({
|
|
|
2542
2542
|
], 2)) : te("", !0);
|
|
2543
2543
|
};
|
|
2544
2544
|
}
|
|
2545
|
-
}),
|
|
2545
|
+
}), Di = /* @__PURE__ */ ue({
|
|
2546
2546
|
__name: "AddCategoryDialogContentComponent",
|
|
2547
2547
|
props: {
|
|
2548
2548
|
initialValue: {}
|
|
@@ -2555,7 +2555,7 @@ const _a = { render: ya }, mn = /* @__PURE__ */ ue({
|
|
|
2555
2555
|
n.value = r ?? "";
|
|
2556
2556
|
}
|
|
2557
2557
|
);
|
|
2558
|
-
const n =
|
|
2558
|
+
const n = Q(i.initialValue), { emitData: a, emitAction: o } = Qt();
|
|
2559
2559
|
return Re(
|
|
2560
2560
|
n,
|
|
2561
2561
|
(r) => {
|
|
@@ -2589,10 +2589,10 @@ const _a = { render: ya }, mn = /* @__PURE__ */ ue({
|
|
|
2589
2589
|
}) => {
|
|
2590
2590
|
const { t } = me();
|
|
2591
2591
|
function n() {
|
|
2592
|
-
const { updateMenu: l } = i, s =
|
|
2592
|
+
const { updateMenu: l } = i, s = Q(!1);
|
|
2593
2593
|
e.open({
|
|
2594
2594
|
title: t("menu.category.manager.dialog.add.title"),
|
|
2595
|
-
contentComponent:
|
|
2595
|
+
contentComponent: Di,
|
|
2596
2596
|
primaryActions: {
|
|
2597
2597
|
text: t("menu.category.manager.dialog.add.action"),
|
|
2598
2598
|
close: !1,
|
|
@@ -2625,7 +2625,7 @@ const _a = { render: ya }, mn = /* @__PURE__ */ ue({
|
|
|
2625
2625
|
const { updateMenu: s } = i;
|
|
2626
2626
|
e.open({
|
|
2627
2627
|
title: t("menu.category.manager.dialog.update.title"),
|
|
2628
|
-
contentComponent:
|
|
2628
|
+
contentComponent: Di,
|
|
2629
2629
|
contentComponentProps: {
|
|
2630
2630
|
initialValue: l.name
|
|
2631
2631
|
},
|
|
@@ -2701,9 +2701,9 @@ const Ca = {
|
|
|
2701
2701
|
class: /* @__PURE__ */ Le(["flex space-x-16", "xs:flex-col xs:space-x-0 xs:space-y-16"])
|
|
2702
2702
|
}, xa = {
|
|
2703
2703
|
class: "w-[160px] xs:w-full"
|
|
2704
|
-
}, ka = {
|
|
2705
|
-
class: "flex-1"
|
|
2706
2704
|
}, Ma = {
|
|
2705
|
+
class: "flex-1"
|
|
2706
|
+
}, ka = {
|
|
2707
2707
|
class: "relative"
|
|
2708
2708
|
}, Oa = {
|
|
2709
2709
|
class: "fm-typo-en-body-lg-600"
|
|
@@ -2713,14 +2713,14 @@ const Ca = {
|
|
|
2713
2713
|
class: "flex flex-col gap-16"
|
|
2714
2714
|
}, Fa = {
|
|
2715
2715
|
class: "space-y-8"
|
|
2716
|
-
},
|
|
2716
|
+
}, Da = {
|
|
2717
2717
|
key: 0,
|
|
2718
2718
|
class: "flex items-center gap-8"
|
|
2719
2719
|
};
|
|
2720
|
-
var
|
|
2720
|
+
var Qe = /* @__PURE__ */ function(e) {
|
|
2721
2721
|
return e.ADD_ON = "ADD_ON", e.PRODUCT = "PRODUCT", e;
|
|
2722
|
-
}(
|
|
2723
|
-
const
|
|
2722
|
+
}(Qe || {});
|
|
2723
|
+
const Ia = /* @__PURE__ */ ue({
|
|
2724
2724
|
__name: "ProductDetail",
|
|
2725
2725
|
props: {
|
|
2726
2726
|
isOverride: {
|
|
@@ -2740,23 +2740,23 @@ const Da = /* @__PURE__ */ ue({
|
|
|
2740
2740
|
setup(e, {
|
|
2741
2741
|
emit: i
|
|
2742
2742
|
}) {
|
|
2743
|
-
const t = e, n = fe(), a = Be(), o =
|
|
2743
|
+
const t = e, n = fe(), a = Be(), o = Ie(), r = He(o), l = Xe(r), s = Sa({
|
|
2744
2744
|
dialog: a,
|
|
2745
2745
|
menuLoader: l
|
|
2746
2746
|
}), {
|
|
2747
2747
|
checkMenuIsLoading: u
|
|
2748
|
-
} = Xe(He(
|
|
2749
|
-
const
|
|
2748
|
+
} = Xe(He(Ie())), c = i, d = F(() => n.rules.item), h = F(() => n.categorizedItems), m = F(() => {
|
|
2749
|
+
const k = h.value.map((y) => ({
|
|
2750
2750
|
label: y.name,
|
|
2751
2751
|
value: y.id
|
|
2752
2752
|
}));
|
|
2753
|
-
return t.isAddon ?
|
|
2754
|
-
}), b = F(() => d.value.addon), v = F(() => !m.value.find((
|
|
2755
|
-
var
|
|
2756
|
-
return t.isAddon ? null :
|
|
2753
|
+
return t.isAddon ? k : k.filter((y) => !!y.value);
|
|
2754
|
+
}), b = F(() => d.value.addon), v = F(() => !m.value.find((k) => !!k.value)), f = () => {
|
|
2755
|
+
var k;
|
|
2756
|
+
return t.isAddon ? null : Je(w(xe.FmSelect, {
|
|
2757
2757
|
disabled: !d.value.category || t.isAddon || u(),
|
|
2758
2758
|
items: m.value,
|
|
2759
|
-
modelValue: t.form.category ?? ((
|
|
2759
|
+
modelValue: t.form.category ?? ((k = t.fallback) == null ? void 0 : k.category),
|
|
2760
2760
|
shiftMenu: !0,
|
|
2761
2761
|
"onUpdate:model-value": (y) => c("update:form", "category", y)
|
|
2762
2762
|
}, {
|
|
@@ -2774,21 +2774,21 @@ const Da = /* @__PURE__ */ ue({
|
|
|
2774
2774
|
}), [[Nt("if"), !t.isAddon]]);
|
|
2775
2775
|
};
|
|
2776
2776
|
ut(() => {
|
|
2777
|
-
!v.value && t.form.category === void 0 && t.isCreate && z(
|
|
2777
|
+
!v.value && t.form.category === void 0 && t.isCreate && z(Qe.PRODUCT);
|
|
2778
2778
|
});
|
|
2779
2779
|
const S = F(() => {
|
|
2780
2780
|
var y;
|
|
2781
|
-
const
|
|
2782
|
-
return
|
|
2781
|
+
const k = t.form.name || ((y = t.fallback) == null ? void 0 : y.name);
|
|
2782
|
+
return k ? n.items.filter((g) => !!g.category && g._id !== t.form._id && g.name === k).length : 0;
|
|
2783
2783
|
});
|
|
2784
|
-
function z(
|
|
2784
|
+
function z(k) {
|
|
2785
2785
|
var g, C, x;
|
|
2786
|
-
const y =
|
|
2787
|
-
c("update:form", "category", t.isOverride ? y ? "" : ((g = t.fallback) == null ? void 0 : g.category) ?? ((C = m.value.find((
|
|
2786
|
+
const y = k == Qe.ADD_ON;
|
|
2787
|
+
c("update:form", "category", t.isOverride ? y ? "" : ((g = t.fallback) == null ? void 0 : g.category) ?? ((C = m.value.find((M) => !!M.value)) == null ? void 0 : C.value) : y ? null : (x = m.value.find((M) => !!M.value)) == null ? void 0 : x.value);
|
|
2788
2788
|
}
|
|
2789
|
-
const E =
|
|
2789
|
+
const E = Q(!1);
|
|
2790
2790
|
async function j() {
|
|
2791
|
-
var
|
|
2791
|
+
var k, y, g;
|
|
2792
2792
|
if (!t.form.name) {
|
|
2793
2793
|
const C = document.getElementById("product-name");
|
|
2794
2794
|
if (C) {
|
|
@@ -2799,10 +2799,10 @@ const Da = /* @__PURE__ */ ue({
|
|
|
2799
2799
|
}
|
|
2800
2800
|
if (!E.value)
|
|
2801
2801
|
try {
|
|
2802
|
-
E.value = !0,
|
|
2802
|
+
E.value = !0, Jt({
|
|
2803
2803
|
event: "menu_catalog_item_general_remy_suggest_description"
|
|
2804
2804
|
}), Ne.toggleDialog(!0);
|
|
2805
|
-
const C = await ((y = (
|
|
2805
|
+
const C = await ((y = (k = Ne).getItemDescription) == null ? void 0 : y.call(k, {
|
|
2806
2806
|
name: t.form.name || ""
|
|
2807
2807
|
}, !0)), x = (g = C == null ? void 0 : C.data) == null ? void 0 : g.value;
|
|
2808
2808
|
typeof x == "string" && c("update:form", "description", x);
|
|
@@ -2811,88 +2811,88 @@ const Da = /* @__PURE__ */ ue({
|
|
|
2811
2811
|
}
|
|
2812
2812
|
}
|
|
2813
2813
|
const {
|
|
2814
|
-
t:
|
|
2814
|
+
t: I
|
|
2815
2815
|
} = me();
|
|
2816
|
-
return (
|
|
2817
|
-
const g = G("fm-text-field"), C = G("fm-textarea"), x = G("fm-radio"),
|
|
2816
|
+
return (k, y) => {
|
|
2817
|
+
const g = G("fm-text-field"), C = G("fm-textarea"), x = G("fm-radio"), M = G("FmSnackbar"), R = G("FmButton"), _ = G("fm-radio-group"), A = G("FmFormGroup"), U = Nt("tooltip");
|
|
2818
2818
|
return O(), Y(Ke, {
|
|
2819
|
-
title: p(
|
|
2819
|
+
title: p(I)("menu.product.form.detail.title")
|
|
2820
2820
|
}, {
|
|
2821
2821
|
default: L(() => {
|
|
2822
2822
|
var V, N;
|
|
2823
2823
|
return [P("div", Ca, [P("div", Aa, [P("div", Ra, [P("div", xa, [w(g, {
|
|
2824
|
-
"model-value":
|
|
2825
|
-
placeholder: ((V =
|
|
2826
|
-
label: p(
|
|
2827
|
-
"onUpdate:modelValue": y[0] || (y[0] = (q) => c("update:form", "code", p(hn)(q,
|
|
2828
|
-
}, null, 8, ["model-value", "placeholder", "label"])]), P("div",
|
|
2824
|
+
"model-value": k.form.code,
|
|
2825
|
+
placeholder: ((V = k.fallback) == null ? void 0 : V.code) || p(I)("menu.product.form.detail.fields.code.placeholder"),
|
|
2826
|
+
label: p(I)("menu.product.form.detail.fields.code.label"),
|
|
2827
|
+
"onUpdate:modelValue": y[0] || (y[0] = (q) => c("update:form", "code", p(hn)(q, k.isOverride)))
|
|
2828
|
+
}, null, 8, ["model-value", "placeholder", "label"])]), P("div", Ma, [w(g, {
|
|
2829
2829
|
id: "product-name",
|
|
2830
2830
|
disabled: !d.value.name,
|
|
2831
|
-
"helper-text": S.value > 0 ? p(
|
|
2831
|
+
"helper-text": S.value > 0 ? p(I)("menu.product.form.detail.fields.name.duplicate_warning", {
|
|
2832
2832
|
count: S.value
|
|
2833
2833
|
}) : void 0,
|
|
2834
|
-
"model-value":
|
|
2835
|
-
placeholder: (N =
|
|
2836
|
-
rules: d.value.name ? [(q) => !!q || p(
|
|
2834
|
+
"model-value": k.form.name,
|
|
2835
|
+
placeholder: (N = k.fallback) == null ? void 0 : N.name,
|
|
2836
|
+
rules: d.value.name ? [(q) => !!q || p(I)("menu.product.form.detail.fields.name.required")] : void 0,
|
|
2837
2837
|
"label-mark": "required",
|
|
2838
2838
|
autofocus: "",
|
|
2839
|
-
label: p(
|
|
2839
|
+
label: p(I)("menu.product.form.detail.fields.name.label"),
|
|
2840
2840
|
"onUpdate:modelValue": y[1] || (y[1] = (q) => c("update:form", "name", q))
|
|
2841
|
-
}, null, 8, ["disabled", "helper-text", "model-value", "placeholder", "rules", "label"])])]), P("div",
|
|
2841
|
+
}, null, 8, ["disabled", "helper-text", "model-value", "placeholder", "rules", "label"])])]), P("div", ka, [w(C, {
|
|
2842
2842
|
disabled: !d.value.description,
|
|
2843
|
-
"model-value":
|
|
2844
|
-
placeholder: p(
|
|
2843
|
+
"model-value": k.form.description,
|
|
2844
|
+
placeholder: p(I)("menu.product.form.detail.fields.description.placeholder"),
|
|
2845
2845
|
"onUpdate:modelValue": y[2] || (y[2] = (q) => c("update:form", "description", q.trim())),
|
|
2846
2846
|
class: "description"
|
|
2847
2847
|
}, {
|
|
2848
|
-
label: L(() => [P("p", Oa, [Ct(de(p(
|
|
2848
|
+
label: L(() => [P("p", Oa, [Ct(de(p(I)("menu.product.form.detail.fields.description.label")) + " ", 1), P("span", za, de(p(I)("menu.product.form.detail.fields.description.optional")), 1)])]),
|
|
2849
2849
|
_: 1
|
|
2850
|
-
}, 8, ["disabled", "model-value", "placeholder"]),
|
|
2850
|
+
}, 8, ["disabled", "model-value", "placeholder"]), Je(w(mn, {
|
|
2851
2851
|
class: "absolute top-32 right-4 cursor-pointer",
|
|
2852
2852
|
onClick: j
|
|
2853
2853
|
}, null, 512), [[U, p(Li)("Suggest description")]])])]), w(pa, {
|
|
2854
2854
|
disabled: !d.value.thumbnail,
|
|
2855
|
-
"model-value":
|
|
2855
|
+
"model-value": k.thumbnail,
|
|
2856
2856
|
"onUpdate:modelValue": y[3] || (y[3] = (q) => c("update:thumbnail", q)),
|
|
2857
2857
|
"onReset:modelValue": y[4] || (y[4] = (q) => c("reset:thumbnail"))
|
|
2858
2858
|
}, null, 8, ["disabled", "model-value"])]), w(nt, {
|
|
2859
|
-
label: p(
|
|
2859
|
+
label: p(I)("menu.product.form.detail.category.label")
|
|
2860
2860
|
}, {
|
|
2861
2861
|
default: L(() => [b.value ? (O(), Y(_, {
|
|
2862
2862
|
key: 0,
|
|
2863
2863
|
disabled: !d.value.category,
|
|
2864
|
-
"model-value":
|
|
2864
|
+
"model-value": k.isAddon ? Qe.ADD_ON : Qe.PRODUCT,
|
|
2865
2865
|
"onUpdate:modelValue": y[5] || (y[5] = (q) => z(q))
|
|
2866
2866
|
}, {
|
|
2867
2867
|
default: L(() => [P("div", Ea, [P("div", Fa, [w(x, {
|
|
2868
2868
|
disabled: v.value,
|
|
2869
|
-
value:
|
|
2870
|
-
label: p(
|
|
2871
|
-
sublabel: p(
|
|
2869
|
+
value: Qe.PRODUCT,
|
|
2870
|
+
label: p(I)("menu.product.form.detail.category.options.product.label"),
|
|
2871
|
+
sublabel: p(I)("menu.product.form.detail.category.options.product.sublabel")
|
|
2872
2872
|
}, null, 8, ["disabled", "value", "label", "sublabel"]), w(Ao, null, {
|
|
2873
2873
|
default: L(() => [p(n).isV4 ? (O(), Y(f, {
|
|
2874
2874
|
key: 0
|
|
2875
2875
|
})) : te("", !0)]),
|
|
2876
2876
|
_: 1
|
|
2877
|
-
})]), v.value ? (O(),
|
|
2878
|
-
title: p(
|
|
2877
|
+
})]), v.value ? (O(), J("div", Da, [w(M, {
|
|
2878
|
+
title: p(I)("menu.product.form.detail.category.add_first"),
|
|
2879
2879
|
variant: "info"
|
|
2880
2880
|
}, null, 8, ["title"]), w(R, {
|
|
2881
|
-
label: p(
|
|
2881
|
+
label: p(I)("menu.common.actions.add"),
|
|
2882
2882
|
"prepend-icon": "add",
|
|
2883
2883
|
variant: "secondary",
|
|
2884
2884
|
onClick: p(s).create
|
|
2885
2885
|
}, null, 8, ["label", "onClick"])])) : te("", !0), w(x, {
|
|
2886
|
-
value:
|
|
2887
|
-
label: p(
|
|
2888
|
-
sublabel: p(
|
|
2886
|
+
value: Qe.ADD_ON,
|
|
2887
|
+
label: p(I)("menu.product.form.detail.category.options.addon.label"),
|
|
2888
|
+
sublabel: p(I)("menu.product.form.detail.category.options.addon.sublabel")
|
|
2889
2889
|
}, null, 8, ["value", "label", "sublabel"])])]),
|
|
2890
2890
|
_: 1
|
|
2891
2891
|
}, 8, ["disabled", "model-value"])) : te("", !0), p(n).isV4 ? te("", !0) : (O(), Y(A, {
|
|
2892
2892
|
key: 1,
|
|
2893
|
-
modelValue:
|
|
2894
|
-
"onUpdate:modelValue": y[6] || (y[6] = (q) =>
|
|
2895
|
-
rules: [(q) => !q && !
|
|
2893
|
+
modelValue: k.form.category,
|
|
2894
|
+
"onUpdate:modelValue": y[6] || (y[6] = (q) => k.form.category = q),
|
|
2895
|
+
rules: [(q) => !q && !k.isOverride ? "Category is required" : !0]
|
|
2896
2896
|
}, {
|
|
2897
2897
|
default: L(() => [w(f)]),
|
|
2898
2898
|
_: 1
|
|
@@ -2900,11 +2900,11 @@ const Da = /* @__PURE__ */ ue({
|
|
|
2900
2900
|
_: 1
|
|
2901
2901
|
}, 8, ["label"]), w(ai, {
|
|
2902
2902
|
disabled: !d.value.orderFrom,
|
|
2903
|
-
"model-value":
|
|
2903
|
+
"model-value": k.form.orderFrom,
|
|
2904
2904
|
"order-from-none": d.value.orderFromNone,
|
|
2905
2905
|
required: d.value.orderFrom,
|
|
2906
|
-
"default-label": p(
|
|
2907
|
-
label: p(
|
|
2906
|
+
"default-label": p(I)("menu.product.form.detail.order_from.default"),
|
|
2907
|
+
label: p(I)("menu.product.form.detail.order_from.label"),
|
|
2908
2908
|
"onUpdate:modelValue": y[7] || (y[7] = (q) => q && c("update:form", "orderFrom", q))
|
|
2909
2909
|
}, null, 8, ["disabled", "model-value", "order-from-none", "required", "default-label", "label"])];
|
|
2910
2910
|
}),
|
|
@@ -2912,9 +2912,9 @@ const Da = /* @__PURE__ */ ue({
|
|
|
2912
2912
|
}, 8, ["title"]);
|
|
2913
2913
|
};
|
|
2914
2914
|
}
|
|
2915
|
-
}), Pa = /* @__PURE__ */ st(
|
|
2915
|
+
}), Pa = /* @__PURE__ */ st(Ia, [["__scopeId", "data-v-eea0bb17"]]), Ta = {}, Ua = { class: "overflow-x-auto" }, Va = { class: "xs:w-[600px]" };
|
|
2916
2916
|
function $a(e, i) {
|
|
2917
|
-
return O(),
|
|
2917
|
+
return O(), J("div", Ua, [
|
|
2918
2918
|
P("div", Va, [
|
|
2919
2919
|
ve(e.$slots, "default")
|
|
2920
2920
|
])
|
|
@@ -2948,7 +2948,7 @@ const pn = /* @__PURE__ */ st(Ta, [["render", $a]]), Na = /* @__PURE__ */ ue({
|
|
|
2948
2948
|
items: {},
|
|
2949
2949
|
position: i.groups.length - 1,
|
|
2950
2950
|
itemsLinked: []
|
|
2951
|
-
}), r =
|
|
2951
|
+
}), r = Q(o()), { t: l } = me();
|
|
2952
2952
|
return (s, u) => t.value.create ? (O(), Y(p(sr), {
|
|
2953
2953
|
key: 0,
|
|
2954
2954
|
"categorized-items": p(i).categorizedItems,
|
|
@@ -2969,7 +2969,7 @@ const pn = /* @__PURE__ */ st(Ta, [["render", $a]]), Na = /* @__PURE__ */ ue({
|
|
|
2969
2969
|
}
|
|
2970
2970
|
}), La = {}, Ba = { class: "flex gap-16" };
|
|
2971
2971
|
function Ka(e, i) {
|
|
2972
|
-
return O(),
|
|
2972
|
+
return O(), J("div", Ba, [
|
|
2973
2973
|
ve(e.$slots, "default")
|
|
2974
2974
|
]);
|
|
2975
2975
|
}
|
|
@@ -2984,9 +2984,9 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
2984
2984
|
},
|
|
2985
2985
|
emits: ["update:inventory"],
|
|
2986
2986
|
setup(e, { expose: i, emit: t }) {
|
|
2987
|
-
const n = e, a =
|
|
2987
|
+
const n = e, a = Q(!1), o = (m) => {
|
|
2988
2988
|
pt.isBoolean(m) ? a.value = m : a.value = !a.value;
|
|
2989
|
-
}, r =
|
|
2989
|
+
}, r = Q([]), l = t, s = Bi(
|
|
2990
2990
|
() => !$e.isEqual(r.value, n.initialValue),
|
|
2991
2991
|
() => {
|
|
2992
2992
|
a.value = !1;
|
|
@@ -3007,7 +3007,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3007
3007
|
const { t: d } = me(), h = Ki();
|
|
3008
3008
|
return (m, b) => {
|
|
3009
3009
|
const v = G("fm-text-field"), f = G("fm-card"), S = G("fm-button"), z = G("fm-side-sheet");
|
|
3010
|
-
return O(),
|
|
3010
|
+
return O(), J(ke, null, [
|
|
3011
3011
|
ve(m.$slots, "default", { trigger: o }),
|
|
3012
3012
|
w(z, {
|
|
3013
3013
|
id: "inventory-form",
|
|
@@ -3073,9 +3073,9 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3073
3073
|
key: 1
|
|
3074
3074
|
}, Za = {
|
|
3075
3075
|
class: "xs:overflow-x-scroll"
|
|
3076
|
-
},
|
|
3076
|
+
}, Qa = {
|
|
3077
3077
|
class: "xs:min-w-[640px]"
|
|
3078
|
-
},
|
|
3078
|
+
}, Ja = /* @__PURE__ */ ue({
|
|
3079
3079
|
__name: "OptionTable",
|
|
3080
3080
|
props: {
|
|
3081
3081
|
config: {},
|
|
@@ -3089,39 +3089,39 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3089
3089
|
setup(e, {
|
|
3090
3090
|
emit: i
|
|
3091
3091
|
}) {
|
|
3092
|
-
const t = e, n = i, a =
|
|
3093
|
-
_id:
|
|
3092
|
+
const t = e, n = i, a = Ie(), o = Zt(), r = fe(), l = F(() => Ae.Country.getCountry(o.currentCountry.value)), s = Q(!1), u = F(() => t.config.isV4 || t.group.type === B.F_ADDON_GROUP_TYPE.enum.PRODUCT), c = F(() => u.value), d = F(() => u.value), h = F(() => Object.values(t.group.items).flatMap((D) => [{
|
|
3093
|
+
_id: D._id,
|
|
3094
3094
|
combinationKey: void 0
|
|
3095
|
-
}, ...(
|
|
3095
|
+
}, ...(D.items ?? []).map((T) => ({
|
|
3096
3096
|
_id: T._id,
|
|
3097
3097
|
combinationKey: T.combinationKey
|
|
3098
3098
|
}))])), {
|
|
3099
3099
|
searchKey: m,
|
|
3100
3100
|
filter: b
|
|
3101
|
-
} =
|
|
3102
|
-
const
|
|
3103
|
-
return Object.fromEntries(
|
|
3104
|
-
}), f = (
|
|
3101
|
+
} = Dn(), v = F(() => {
|
|
3102
|
+
const D = Object.entries(t.group.items).filter(([, T]) => b([T.code || "", T.name || T.fallbackName, z(T.price ?? T.fallbackPrice), E(T.orderFrom || T.fallbackOrder), ...(T.items || []).map((K) => [K.code || "", K.name || K.fallbackName, z(K.price ?? K.fallbackPrice), E(K.orderFrom || K.fallbackOrder)].join(""))]));
|
|
3103
|
+
return Object.fromEntries(D);
|
|
3104
|
+
}), f = (D) => ({
|
|
3105
3105
|
...t.config,
|
|
3106
|
-
isDefault: t.config.isDefault(
|
|
3107
|
-
link: t.config.link(
|
|
3108
|
-
name: t.config.name(
|
|
3109
|
-
orderFrom: t.config.orderFrom(
|
|
3110
|
-
}), S = F(() => t.config.isItemGroup), z = (
|
|
3106
|
+
isDefault: t.config.isDefault(D),
|
|
3107
|
+
link: t.config.link(D),
|
|
3108
|
+
name: t.config.name(D),
|
|
3109
|
+
orderFrom: t.config.orderFrom(D)
|
|
3110
|
+
}), S = F(() => t.config.isItemGroup), z = (D) => D ? mt(D, !1) : "", E = (D) => {
|
|
3111
3111
|
var T;
|
|
3112
|
-
return
|
|
3113
|
-
}, j = F(() => Object.values(v.value)),
|
|
3114
|
-
t:
|
|
3115
|
-
} = me(), y =
|
|
3112
|
+
return D == null ? "" : (T = kn()[D]) == null ? void 0 : T.label;
|
|
3113
|
+
}, j = F(() => Object.values(v.value)), I = Q({}), {
|
|
3114
|
+
t: k
|
|
3115
|
+
} = me(), y = Q([{
|
|
3116
3116
|
accessorKey: "isDefault",
|
|
3117
|
-
header: () =>
|
|
3117
|
+
header: () => k("menu.group.option.is_default"),
|
|
3118
3118
|
enableSorting: !1,
|
|
3119
3119
|
size: 75,
|
|
3120
|
-
cell: (
|
|
3120
|
+
cell: (D) => {
|
|
3121
3121
|
var ee, ie;
|
|
3122
|
-
if ((ie = (ee =
|
|
3122
|
+
if ((ie = (ee = D.row.original) == null ? void 0 : ee.items) != null && ie.length)
|
|
3123
3123
|
return null;
|
|
3124
|
-
const T =
|
|
3124
|
+
const T = D.row.depth > 0, K = D.row.original, Z = !!D.getValue();
|
|
3125
3125
|
return w(xe.FmCheckbox, {
|
|
3126
3126
|
value: "default",
|
|
3127
3127
|
modelValue: Z,
|
|
@@ -3129,9 +3129,9 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3129
3129
|
"onUpdate:modelValue": (le) => {
|
|
3130
3130
|
var ye;
|
|
3131
3131
|
if (T) {
|
|
3132
|
-
const Ge = (ye =
|
|
3132
|
+
const Ge = (ye = D.row.getParentRow()) == null ? void 0 : ye.original;
|
|
3133
3133
|
if (!Ge) return;
|
|
3134
|
-
|
|
3134
|
+
M(Ge._id, K.combinationKey ?? "", "isDefault", le);
|
|
3135
3135
|
} else
|
|
3136
3136
|
x(K._id, "isDefault", le);
|
|
3137
3137
|
}
|
|
@@ -3139,11 +3139,11 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3139
3139
|
}
|
|
3140
3140
|
}, {
|
|
3141
3141
|
accessorKey: "code",
|
|
3142
|
-
header: () =>
|
|
3142
|
+
header: () => k("menu.group.option.code"),
|
|
3143
3143
|
enableSorting: !1,
|
|
3144
3144
|
size: 100,
|
|
3145
|
-
cell: (
|
|
3146
|
-
const T =
|
|
3145
|
+
cell: (D) => {
|
|
3146
|
+
const T = D.getValue();
|
|
3147
3147
|
return w(xe.FmTooltip, {
|
|
3148
3148
|
class: "flex",
|
|
3149
3149
|
content: T,
|
|
@@ -3156,21 +3156,21 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3156
3156
|
}
|
|
3157
3157
|
}, {
|
|
3158
3158
|
accessorKey: "name",
|
|
3159
|
-
header: () =>
|
|
3159
|
+
header: () => k("menu.group.option.product_title"),
|
|
3160
3160
|
enableSorting: !1,
|
|
3161
|
-
cell: (
|
|
3162
|
-
const T =
|
|
3161
|
+
cell: (D) => {
|
|
3162
|
+
const T = D.getValue(), K = D.row.original, Z = D.row.depth > 0, ee = K.combinationKey ? Yi(K.combinationKey, fe().variants) : null;
|
|
3163
3163
|
return he("div", he(xe.FmTextField, {
|
|
3164
3164
|
modelValue: T,
|
|
3165
3165
|
placeholder: ee ?? "",
|
|
3166
3166
|
disabled: !f(K.combinationKey).name,
|
|
3167
|
-
rules: ee ? void 0 : [(ie) => ie.length > 0 ||
|
|
3167
|
+
rules: ee ? void 0 : [(ie) => ie.length > 0 || k("menu.group.option.product_title_required")],
|
|
3168
3168
|
"onUpdate:modelValue": (ie) => {
|
|
3169
3169
|
var le;
|
|
3170
3170
|
if (Z) {
|
|
3171
|
-
const ye = (le =
|
|
3171
|
+
const ye = (le = D.row.getParentRow()) == null ? void 0 : le.original;
|
|
3172
3172
|
if (!ye) return;
|
|
3173
|
-
|
|
3173
|
+
M(ye._id, K.combinationKey ?? "", "name", ie);
|
|
3174
3174
|
} else
|
|
3175
3175
|
x(K._id, "name", ie);
|
|
3176
3176
|
},
|
|
@@ -3178,10 +3178,10 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3178
3178
|
}, {
|
|
3179
3179
|
append: () => {
|
|
3180
3180
|
var ie, le;
|
|
3181
|
-
return (le = (ie =
|
|
3181
|
+
return (le = (ie = D.row.original) == null ? void 0 : ie.items) != null && le.length ? he(xe.FmIcon, {
|
|
3182
3182
|
name: "keyboard_arrow_up",
|
|
3183
|
-
onClick:
|
|
3184
|
-
class: ["cursor-pointer", "transition-transform",
|
|
3183
|
+
onClick: D.row.getToggleExpandedHandler(),
|
|
3184
|
+
class: ["cursor-pointer", "transition-transform", D.row.getIsExpanded() ? "transform rotate-180" : ""],
|
|
3185
3185
|
color: f(K.combinationKey).name ? void 0 : je.NeutralGray200
|
|
3186
3186
|
}) : void 0;
|
|
3187
3187
|
}
|
|
@@ -3191,14 +3191,14 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3191
3191
|
accessorKey: "price",
|
|
3192
3192
|
enableSorting: !1,
|
|
3193
3193
|
header: () => {
|
|
3194
|
-
var
|
|
3195
|
-
return
|
|
3196
|
-
symbol: (
|
|
3194
|
+
var D;
|
|
3195
|
+
return k("menu.group.option.price", {
|
|
3196
|
+
symbol: (D = l.value) == null ? void 0 : D.currency.symbol
|
|
3197
3197
|
});
|
|
3198
3198
|
},
|
|
3199
3199
|
size: 100,
|
|
3200
|
-
cell: (
|
|
3201
|
-
const T =
|
|
3200
|
+
cell: (D) => {
|
|
3201
|
+
const T = D.getValue(), K = D.row.original, Z = K.fallbackPrice, ee = D.row.depth > 0;
|
|
3202
3202
|
return he(it, {
|
|
3203
3203
|
placeholder: Z ? mt(Z) : void 0,
|
|
3204
3204
|
modelValue: T,
|
|
@@ -3208,9 +3208,9 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3208
3208
|
"onUpdate:modelValue": (ie) => {
|
|
3209
3209
|
var le;
|
|
3210
3210
|
if (ee) {
|
|
3211
|
-
const ye = (le =
|
|
3211
|
+
const ye = (le = D.row.getParentRow()) == null ? void 0 : le.original;
|
|
3212
3212
|
if (!ye) return;
|
|
3213
|
-
|
|
3213
|
+
M(
|
|
3214
3214
|
ye._id,
|
|
3215
3215
|
K.combinationKey ?? "",
|
|
3216
3216
|
// @ts-ignore
|
|
@@ -3226,11 +3226,11 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3226
3226
|
}
|
|
3227
3227
|
}, {
|
|
3228
3228
|
accessorKey: "orderFrom",
|
|
3229
|
-
header: () =>
|
|
3229
|
+
header: () => k("menu.common.labels.order_from"),
|
|
3230
3230
|
size: 100,
|
|
3231
3231
|
enableSorting: !1,
|
|
3232
|
-
cell: (
|
|
3233
|
-
const T =
|
|
3232
|
+
cell: (D) => {
|
|
3233
|
+
const T = D.getValue(), K = D.row.original, Z = K.fallbackOrder, ee = D.row.depth > 0;
|
|
3234
3234
|
return he(ai, {
|
|
3235
3235
|
modelValue: T,
|
|
3236
3236
|
fallback: Z,
|
|
@@ -3240,9 +3240,9 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3240
3240
|
"onUpdate:modelValue": (ie) => {
|
|
3241
3241
|
var le;
|
|
3242
3242
|
if (ee) {
|
|
3243
|
-
const ye = (le =
|
|
3243
|
+
const ye = (le = D.row.getParentRow()) == null ? void 0 : le.original;
|
|
3244
3244
|
if (!ye) return;
|
|
3245
|
-
|
|
3245
|
+
M(
|
|
3246
3246
|
ye._id,
|
|
3247
3247
|
K.combinationKey ?? "",
|
|
3248
3248
|
// @ts-ignore
|
|
@@ -3264,8 +3264,8 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3264
3264
|
enableSorting: !1,
|
|
3265
3265
|
// size: rules.value.inventory && rules.value.link ? 80 : 40,
|
|
3266
3266
|
size: 80,
|
|
3267
|
-
cell: (
|
|
3268
|
-
const T =
|
|
3267
|
+
cell: (D) => {
|
|
3268
|
+
const T = D.row.original, K = D.row.depth > 0;
|
|
3269
3269
|
return w("div", {
|
|
3270
3270
|
class: "flex items-center justify-end"
|
|
3271
3271
|
}, [f(T.combinationKey).inventory && w(qt, {
|
|
@@ -3276,9 +3276,9 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3276
3276
|
"onUpdate:inventory": (Z) => {
|
|
3277
3277
|
var ee;
|
|
3278
3278
|
if (K) {
|
|
3279
|
-
const ie = (ee =
|
|
3279
|
+
const ie = (ee = D.row.getParentRow()) == null ? void 0 : ee.original;
|
|
3280
3280
|
if (!ie) return;
|
|
3281
|
-
|
|
3281
|
+
M(
|
|
3282
3282
|
ie._id,
|
|
3283
3283
|
T.combinationKey ?? "",
|
|
3284
3284
|
// @ts-ignore
|
|
@@ -3313,11 +3313,11 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3313
3313
|
onClick: () => {
|
|
3314
3314
|
var Z, ee;
|
|
3315
3315
|
if (K) {
|
|
3316
|
-
const ie = (Z =
|
|
3316
|
+
const ie = (Z = D.row.getParentRow()) == null ? void 0 : Z.original;
|
|
3317
3317
|
if (!ie) return;
|
|
3318
3318
|
if ((((ee = t.group.items[ie._id].items) == null ? void 0 : ee.length) || 0) <= 1) {
|
|
3319
3319
|
a.open({
|
|
3320
|
-
title:
|
|
3320
|
+
title: k("menu.group.option.should_link_at_least_one_variant", {
|
|
3321
3321
|
name: ie.name
|
|
3322
3322
|
}),
|
|
3323
3323
|
type: "error"
|
|
@@ -3338,13 +3338,13 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3338
3338
|
action: f(null).inventory || f(null).link
|
|
3339
3339
|
}));
|
|
3340
3340
|
async function C() {
|
|
3341
|
-
const
|
|
3341
|
+
const D = (/* @__PURE__ */ new Date()).toISOString();
|
|
3342
3342
|
n("update:group", {
|
|
3343
3343
|
...t.group,
|
|
3344
3344
|
items: {
|
|
3345
3345
|
...t.group.items,
|
|
3346
|
-
[
|
|
3347
|
-
_id:
|
|
3346
|
+
[D]: {
|
|
3347
|
+
_id: D,
|
|
3348
3348
|
name: "",
|
|
3349
3349
|
inventoryBindings: [],
|
|
3350
3350
|
price: Ae.Dinero.zero().toObject(),
|
|
@@ -3355,8 +3355,8 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3355
3355
|
}
|
|
3356
3356
|
});
|
|
3357
3357
|
}
|
|
3358
|
-
function x(
|
|
3359
|
-
const Z = t.group.items[
|
|
3358
|
+
function x(D, T, K) {
|
|
3359
|
+
const Z = t.group.items[D];
|
|
3360
3360
|
if (!Z) return;
|
|
3361
3361
|
const ee = {
|
|
3362
3362
|
...Z
|
|
@@ -3365,46 +3365,46 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3365
3365
|
...t.group,
|
|
3366
3366
|
items: {
|
|
3367
3367
|
...t.group.items,
|
|
3368
|
-
[
|
|
3368
|
+
[D]: ee
|
|
3369
3369
|
}
|
|
3370
3370
|
});
|
|
3371
3371
|
}
|
|
3372
|
-
function
|
|
3372
|
+
function M(D, T, K, Z) {
|
|
3373
3373
|
var ye, Ge;
|
|
3374
|
-
const ee = ne(t.group), ie = (ye = ee.items[
|
|
3374
|
+
const ee = ne(t.group), ie = (ye = ee.items[D].items) == null ? void 0 : ye.findIndex((lt) => lt.combinationKey === T);
|
|
3375
3375
|
if (!pt.isSet(ie)) return;
|
|
3376
|
-
let le = (Ge = ee.items[
|
|
3376
|
+
let le = (Ge = ee.items[D].items) == null ? void 0 : Ge[ie];
|
|
3377
3377
|
le && (le = {
|
|
3378
3378
|
...le,
|
|
3379
3379
|
[K]: Z
|
|
3380
|
-
}, ee.items[
|
|
3380
|
+
}, ee.items[D].items[ie] = le, n("update:group", ee));
|
|
3381
3381
|
}
|
|
3382
|
-
function R(
|
|
3382
|
+
function R(D) {
|
|
3383
3383
|
const T = ne(t.group);
|
|
3384
|
-
delete T.items[
|
|
3384
|
+
delete T.items[D], n("update:group", T);
|
|
3385
3385
|
}
|
|
3386
|
-
function _(
|
|
3387
|
-
const K = ne(t.group), Z = K.items[
|
|
3388
|
-
Z && (Z.items = (Z.items || []).filter((ee) => ee.combinationKey !== T), K.items[
|
|
3386
|
+
function _(D, T) {
|
|
3387
|
+
const K = ne(t.group), Z = K.items[D];
|
|
3388
|
+
Z && (Z.items = (Z.items || []).filter((ee) => ee.combinationKey !== T), K.items[D] = Z, n("update:group", K));
|
|
3389
3389
|
}
|
|
3390
|
-
const A = F(() => t.categorizedItems.flatMap((
|
|
3390
|
+
const A = F(() => t.categorizedItems.flatMap((D) => D.items).reduce((D, T) => {
|
|
3391
3391
|
var K;
|
|
3392
|
-
return
|
|
3392
|
+
return D[T._id] = {
|
|
3393
3393
|
price: T.price,
|
|
3394
3394
|
variants: On(((K = T.variant) == null ? void 0 : K.variantCombinations) || [], "combinationKey")
|
|
3395
|
-
},
|
|
3396
|
-
}, {})), U = (
|
|
3395
|
+
}, D;
|
|
3396
|
+
}, {})), U = (D) => {
|
|
3397
3397
|
var ee, ie;
|
|
3398
|
-
const K = r.state.menu.modules.item.find((le) => le._id ===
|
|
3399
|
-
...(ee = K == null ? void 0 : K.variant) == null ? void 0 : ee.variantCombinations.find((le) => le.combinationKey ===
|
|
3400
|
-
name: Vi(fe().variants, ((ie = K == null ? void 0 : K.variant) == null ? void 0 : ie.variantGroupIds) || [])[
|
|
3398
|
+
const K = r.state.menu.modules.item.find((le) => le._id === D._id), Z = D.combinationKey ? {
|
|
3399
|
+
...(ee = K == null ? void 0 : K.variant) == null ? void 0 : ee.variantCombinations.find((le) => le.combinationKey === D.combinationKey),
|
|
3400
|
+
name: Vi(fe().variants, ((ie = K == null ? void 0 : K.variant) == null ? void 0 : ie.variantGroupIds) || [])[D.combinationKey]
|
|
3401
3401
|
} : K;
|
|
3402
3402
|
return Z == null ? void 0 : Z.name;
|
|
3403
|
-
}, V = async (
|
|
3403
|
+
}, V = async (D) => {
|
|
3404
3404
|
let T = ei(t.group);
|
|
3405
3405
|
T = {
|
|
3406
3406
|
...T,
|
|
3407
|
-
items:
|
|
3407
|
+
items: D.map((K) => {
|
|
3408
3408
|
const Z = T.items.find((ie) => ie._id == K._id && ie.combinationKey == K.combinationKey), ee = A.value[K._id];
|
|
3409
3409
|
return Z || {
|
|
3410
3410
|
...K,
|
|
@@ -3414,28 +3414,28 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3414
3414
|
};
|
|
3415
3415
|
})
|
|
3416
3416
|
}, n("update:unmap-group", T);
|
|
3417
|
-
}, N = (
|
|
3418
|
-
function q(
|
|
3417
|
+
}, N = (D) => D.items;
|
|
3418
|
+
function q(D) {
|
|
3419
3419
|
const T = ne(t.group);
|
|
3420
|
-
T.items =
|
|
3420
|
+
T.items = D.reduce((K, Z) => ({
|
|
3421
3421
|
...K,
|
|
3422
3422
|
[Z._id]: Z
|
|
3423
3423
|
}), {}), n("update:group", T);
|
|
3424
3424
|
}
|
|
3425
3425
|
const re = Ni(), Ce = F(() => re.breakpoints.value.xs);
|
|
3426
|
-
return (
|
|
3426
|
+
return (D, T) => {
|
|
3427
3427
|
const K = G("fm-button"), Z = G("fm-table");
|
|
3428
3428
|
return O(), Y(Ke, {
|
|
3429
|
-
title: p(
|
|
3429
|
+
title: p(k)("menu.group.option.title")
|
|
3430
3430
|
}, {
|
|
3431
|
-
"append-title": L(() => [
|
|
3431
|
+
"append-title": L(() => [D.config.link() ? (O(), J(ke, {
|
|
3432
3432
|
key: 0
|
|
3433
|
-
}, [c.value ? (O(),
|
|
3434
|
-
"categorized-items":
|
|
3433
|
+
}, [c.value ? (O(), J("div", Xa, [w(Ln, {
|
|
3434
|
+
"categorized-items": D.categorizedItems,
|
|
3435
3435
|
"initial-value": h.value,
|
|
3436
|
-
"show-variant":
|
|
3436
|
+
"show-variant": D.config.bindToVariant,
|
|
3437
3437
|
"select-variant": "",
|
|
3438
|
-
title: p(
|
|
3438
|
+
title: p(k)("menu.group.option.link_products"),
|
|
3439
3439
|
onSubmit: V
|
|
3440
3440
|
}, {
|
|
3441
3441
|
default: L(({
|
|
@@ -3444,31 +3444,31 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3444
3444
|
"text-color": p(je).ColorPrimary,
|
|
3445
3445
|
"border-color": p(je).ColorPrimary,
|
|
3446
3446
|
variant: "secondary",
|
|
3447
|
-
label: p(
|
|
3447
|
+
label: p(k)("menu.group.option.link_products"),
|
|
3448
3448
|
"prepend-icon": "link",
|
|
3449
3449
|
onClick: ee
|
|
3450
3450
|
}, null, 8, ["text-color", "border-color", "label", "onClick"])]),
|
|
3451
3451
|
_: 1
|
|
3452
|
-
}, 8, ["categorized-items", "initial-value", "show-variant", "title"])])) : (O(),
|
|
3452
|
+
}, 8, ["categorized-items", "initial-value", "show-variant", "title"])])) : (O(), J("div", qa, [w(K, {
|
|
3453
3453
|
"text-color": p(je).ColorPrimary,
|
|
3454
3454
|
"border-color": p(je).ColorPrimary,
|
|
3455
3455
|
variant: "secondary",
|
|
3456
|
-
label: p(
|
|
3456
|
+
label: p(k)("menu.group.option.add_option"),
|
|
3457
3457
|
"prepend-icon": "add",
|
|
3458
3458
|
onClick: C
|
|
3459
3459
|
}, null, 8, ["text-color", "border-color", "label"])]))], 64)) : te("", !0)]),
|
|
3460
|
-
default: L(() => [P("div", Za, [P("div",
|
|
3460
|
+
default: L(() => [P("div", Za, [P("div", Qa, [w(Z, {
|
|
3461
3461
|
"column-defs": y.value,
|
|
3462
3462
|
"column-visibility": g.value,
|
|
3463
3463
|
draggable: !Ce.value && f(null).name,
|
|
3464
|
-
"expanded-state": s.value ? {} :
|
|
3464
|
+
"expanded-state": s.value ? {} : I.value,
|
|
3465
3465
|
"get-sub-row": N,
|
|
3466
3466
|
"page-size": 999,
|
|
3467
3467
|
"row-data": j.value,
|
|
3468
3468
|
"search-value": p(m),
|
|
3469
3469
|
"shrink-at": !1,
|
|
3470
3470
|
"hide-footer": "",
|
|
3471
|
-
"onUpdate:expandedState": T[0] || (T[0] = (ee) =>
|
|
3471
|
+
"onUpdate:expandedState": T[0] || (T[0] = (ee) => I.value = ee),
|
|
3472
3472
|
onDndChanged: T[1] || (T[1] = (ee) => q(ee)),
|
|
3473
3473
|
"onUpdate:dragging": T[2] || (T[2] = (ee) => s.value = ee)
|
|
3474
3474
|
}, null, 8, ["column-defs", "column-visibility", "draggable", "expanded-state", "row-data", "search-value"])])])]),
|
|
@@ -3492,7 +3492,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3492
3492
|
emits: ["update:group", "submit:group", "status:show"],
|
|
3493
3493
|
setup(e, { expose: i, emit: t }) {
|
|
3494
3494
|
let n = e;
|
|
3495
|
-
const a = t, o = fe(), r = Be(), l = Xe(He(
|
|
3495
|
+
const a = t, o = fe(), r = Be(), l = Xe(He(Ie())), s = Q(!1), u = Q(!1), c = (y) => {
|
|
3496
3496
|
pt.isBoolean(y) ? u.value = y : u.value = !u.value;
|
|
3497
3497
|
}, d = F(() => n.config(n.group)), h = F(() => [
|
|
3498
3498
|
{
|
|
@@ -3548,15 +3548,15 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3548
3548
|
return g;
|
|
3549
3549
|
}
|
|
3550
3550
|
function S(y) {
|
|
3551
|
-
return f(y) <= y.max ||
|
|
3551
|
+
return f(y) <= y.max || k("menu.common.validation.max_default_items", { max: y.max });
|
|
3552
3552
|
}
|
|
3553
|
-
const z =
|
|
3553
|
+
const z = Q($e.clone(n.group)), E = Bi(
|
|
3554
3554
|
() => !$e.isEqual(n.group, z.value),
|
|
3555
3555
|
() => {
|
|
3556
3556
|
u.value = !1;
|
|
3557
3557
|
}
|
|
3558
|
-
), j = F(() => n.action === "add" ?
|
|
3559
|
-
async function
|
|
3558
|
+
), j = F(() => n.action === "add" ? k("common.add") : k("common.update"));
|
|
3559
|
+
async function I() {
|
|
3560
3560
|
if (n.action === "add") {
|
|
3561
3561
|
const { group: y, linkItems: g } = ji(n.group), C = {
|
|
3562
3562
|
module: B.F_MENU_MODULE_V4_KEY.enum.group,
|
|
@@ -3583,10 +3583,10 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3583
3583
|
trigger: c,
|
|
3584
3584
|
show: u
|
|
3585
3585
|
});
|
|
3586
|
-
const { t:
|
|
3586
|
+
const { t: k } = me();
|
|
3587
3587
|
return (y, g) => {
|
|
3588
|
-
const C = G("fm-text-field"), x = G("fm-stepper-field"),
|
|
3589
|
-
return O(),
|
|
3588
|
+
const C = G("fm-text-field"), x = G("fm-stepper-field"), M = G("FmFormGroup"), R = G("fm-radio"), _ = G("fm-radio-group"), A = G("fm-switch"), U = G("fm-button"), V = G("fm-side-sheet");
|
|
3589
|
+
return O(), J(ke, null, [
|
|
3590
3590
|
ve(y.$slots, "default", { trigger: c }),
|
|
3591
3591
|
w(V, {
|
|
3592
3592
|
id: "group-form",
|
|
@@ -3594,7 +3594,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3594
3594
|
"onUpdate:modelValue": g[8] || (g[8] = (N) => u.value = N),
|
|
3595
3595
|
"is-container": p(xe).FmForm,
|
|
3596
3596
|
"is-container-props": {
|
|
3597
|
-
onValidationSuccess:
|
|
3597
|
+
onValidationSuccess: I,
|
|
3598
3598
|
blameFormChildOnValidationFailed: !0
|
|
3599
3599
|
},
|
|
3600
3600
|
"max-width": 720,
|
|
@@ -3613,7 +3613,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3613
3613
|
variant: "primary"
|
|
3614
3614
|
}, null, 8, ["label", "loading"]),
|
|
3615
3615
|
w(U, {
|
|
3616
|
-
label: p(
|
|
3616
|
+
label: p(k)("menu.common.actions.cancel"),
|
|
3617
3617
|
size: "lg",
|
|
3618
3618
|
variant: "tertiary",
|
|
3619
3619
|
onClick: g[7] || (g[7] = () => u.value = !1)
|
|
@@ -3621,7 +3621,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3621
3621
|
])
|
|
3622
3622
|
]),
|
|
3623
3623
|
default: L(() => [
|
|
3624
|
-
y.group ? (O(),
|
|
3624
|
+
y.group ? (O(), J("div", tr, [
|
|
3625
3625
|
ve(y.$slots, "variant-section"),
|
|
3626
3626
|
w(Tn, null, {
|
|
3627
3627
|
default: L(() => [
|
|
@@ -3631,15 +3631,15 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3631
3631
|
"onUpdate:modelValue": g[0] || (g[0] = (N) => y.group.name = N),
|
|
3632
3632
|
disabled: !d.value.link(),
|
|
3633
3633
|
rules: [
|
|
3634
|
-
(N) => !!N || p(
|
|
3634
|
+
(N) => !!N || p(k)("menu.common.validation.required", { field: p(k)("menu.common.labels.group_name") })
|
|
3635
3635
|
],
|
|
3636
3636
|
autofocus: "",
|
|
3637
|
-
label: p(
|
|
3637
|
+
label: p(k)("menu.common.labels.group_name")
|
|
3638
3638
|
}, null, 8, ["modelValue", "disabled", "rules", "label"])
|
|
3639
3639
|
]),
|
|
3640
|
-
w(
|
|
3640
|
+
w(M, {
|
|
3641
3641
|
"model-value": y.group,
|
|
3642
|
-
rules: [() => y.group.min <= y.group.max || p(
|
|
3642
|
+
rules: [() => y.group.min <= y.group.max || p(k)("menu.common.validation.min_max")]
|
|
3643
3643
|
}, {
|
|
3644
3644
|
default: L(() => [
|
|
3645
3645
|
w(Ga, null, {
|
|
@@ -3650,7 +3650,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3650
3650
|
disabled: !d.value.link(),
|
|
3651
3651
|
min: 0,
|
|
3652
3652
|
class: "flex-1",
|
|
3653
|
-
label: p(
|
|
3653
|
+
label: p(k)("menu.common.labels.min_select")
|
|
3654
3654
|
}, null, 8, ["modelValue", "disabled", "label"]),
|
|
3655
3655
|
w(x, {
|
|
3656
3656
|
modelValue: y.group.max,
|
|
@@ -3658,7 +3658,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3658
3658
|
disabled: !d.value.link(),
|
|
3659
3659
|
min: y.group.min,
|
|
3660
3660
|
class: "flex-1",
|
|
3661
|
-
label: p(
|
|
3661
|
+
label: p(k)("menu.common.labels.max_select")
|
|
3662
3662
|
}, null, 8, ["modelValue", "disabled", "min", "label"])
|
|
3663
3663
|
]),
|
|
3664
3664
|
_: 1
|
|
@@ -3668,7 +3668,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3668
3668
|
}, 8, ["model-value", "rules"]),
|
|
3669
3669
|
d.value.type ? (O(), Y(nt, {
|
|
3670
3670
|
key: 0,
|
|
3671
|
-
label: p(
|
|
3671
|
+
label: p(k)("menu.common.labels.group_type")
|
|
3672
3672
|
}, {
|
|
3673
3673
|
default: L(() => [
|
|
3674
3674
|
w(_, {
|
|
@@ -3677,9 +3677,9 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3677
3677
|
"onUpdate:modelValue": g[3] || (g[3] = (N) => b(N))
|
|
3678
3678
|
}, {
|
|
3679
3679
|
default: L(() => [
|
|
3680
|
-
(O(!0),
|
|
3680
|
+
(O(!0), J(ke, null, Ye(h.value, (N) => (O(), Y(R, {
|
|
3681
3681
|
key: N.value,
|
|
3682
|
-
label: p(
|
|
3682
|
+
label: p(k)(`menu.group.types.${N.label.toLowerCase()}`),
|
|
3683
3683
|
value: N.value
|
|
3684
3684
|
}, null, 8, ["label", "value"]))), 128))
|
|
3685
3685
|
]),
|
|
@@ -3689,16 +3689,16 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3689
3689
|
_: 1
|
|
3690
3690
|
}, 8, ["label"])) : te("", !0),
|
|
3691
3691
|
w(nt, {
|
|
3692
|
-
label: p(
|
|
3692
|
+
label: p(k)("menu.common.labels.configuration")
|
|
3693
3693
|
}, {
|
|
3694
3694
|
default: L(() => [
|
|
3695
3695
|
w(A, {
|
|
3696
3696
|
modelValue: y.group.stackable,
|
|
3697
3697
|
"onUpdate:modelValue": g[4] || (g[4] = (N) => y.group.stackable = N),
|
|
3698
3698
|
disabled: !d.value.link(),
|
|
3699
|
-
label: p(
|
|
3699
|
+
label: p(k)("menu.common.labels.stackable"),
|
|
3700
3700
|
"label-placement": "right",
|
|
3701
|
-
sublabel: p(
|
|
3701
|
+
sublabel: p(k)("menu.common.labels.stackable_sublabel")
|
|
3702
3702
|
}, null, 8, ["modelValue", "disabled", "label", "sublabel"])
|
|
3703
3703
|
]),
|
|
3704
3704
|
_: 1
|
|
@@ -3706,17 +3706,17 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3706
3706
|
]),
|
|
3707
3707
|
_: 1
|
|
3708
3708
|
}),
|
|
3709
|
-
w(
|
|
3709
|
+
w(M, {
|
|
3710
3710
|
tag: "div",
|
|
3711
3711
|
modelValue: y.group,
|
|
3712
3712
|
rules: [S],
|
|
3713
|
-
"helper-text": p(
|
|
3713
|
+
"helper-text": p(k)("menu.common.validation.default_items_tip", {
|
|
3714
3714
|
count: f(y.group),
|
|
3715
3715
|
max: y.group.max
|
|
3716
3716
|
})
|
|
3717
3717
|
}, {
|
|
3718
3718
|
default: L(() => [
|
|
3719
|
-
w(
|
|
3719
|
+
w(Ja, {
|
|
3720
3720
|
"allow-refund-inventory": y.allowRefundInventory ?? !1,
|
|
3721
3721
|
"categorized-items": y.categorizedItems,
|
|
3722
3722
|
config: d.value,
|
|
@@ -3743,28 +3743,28 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3743
3743
|
},
|
|
3744
3744
|
emits: ["update:combinations"],
|
|
3745
3745
|
setup(e, { expose: i, emit: t }) {
|
|
3746
|
-
var j,
|
|
3747
|
-
const n = e, a = t, o = fe(), r = Be(), l = Xe(He(
|
|
3748
|
-
() => s.value.findIndex((
|
|
3746
|
+
var j, I;
|
|
3747
|
+
const n = e, a = t, o = fe(), r = Be(), l = Xe(He(Ie())), s = Q([]), u = Q(n.combinations[0].combinationKey || ""), c = F(
|
|
3748
|
+
() => s.value.findIndex((k) => k.combinationKey == u.value)
|
|
3749
3749
|
), d = F(
|
|
3750
|
-
() => n.combinations.map((
|
|
3751
|
-
label: n.fullCombinations[
|
|
3752
|
-
value:
|
|
3750
|
+
() => n.combinations.map((k) => ({
|
|
3751
|
+
label: n.fullCombinations[k.combinationKey || ""],
|
|
3752
|
+
value: k.combinationKey || ""
|
|
3753
3753
|
}))
|
|
3754
3754
|
), h = F(() => {
|
|
3755
|
-
var
|
|
3755
|
+
var M, R;
|
|
3756
3756
|
if (!S.value) return null;
|
|
3757
|
-
const
|
|
3757
|
+
const k = ((R = (M = s.value[c.value]) == null ? void 0 : M.groups) == null ? void 0 : R.find(
|
|
3758
3758
|
(_) => _._id === n.groupId
|
|
3759
3759
|
)) || {
|
|
3760
3760
|
_id: n.groupId,
|
|
3761
3761
|
groupKey: ""
|
|
3762
|
-
}, g = o.state.menu.modules.group.find((_) => _._id === n.groupId), C = Object.entries({ ...
|
|
3762
|
+
}, g = o.state.menu.modules.group.find((_) => _._id === n.groupId), C = Object.entries({ ...k, items: void 0 }).filter(([, _]) => !!_), x = {
|
|
3763
3763
|
...g,
|
|
3764
3764
|
...Object.fromEntries(C),
|
|
3765
3765
|
items: g.items.map((_) => {
|
|
3766
3766
|
var U;
|
|
3767
|
-
const A = (U =
|
|
3767
|
+
const A = (U = k.items) == null ? void 0 : U.find(
|
|
3768
3768
|
(V) => V._id == _._id && V.combinationKey == _.combinationKey
|
|
3769
3769
|
);
|
|
3770
3770
|
return {
|
|
@@ -3777,22 +3777,22 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3777
3777
|
};
|
|
3778
3778
|
return new Wi(o, l.updateMenu, r).mapGroups([x], !0)[0];
|
|
3779
3779
|
});
|
|
3780
|
-
function m(
|
|
3781
|
-
var x,
|
|
3780
|
+
function m(k) {
|
|
3781
|
+
var x, M;
|
|
3782
3782
|
const y = (x = s.value[c.value].groups) == null ? void 0 : x.findIndex(
|
|
3783
3783
|
(R) => R._id === n.groupId
|
|
3784
|
-
), g = ne(s.value), C = { ...ei(
|
|
3784
|
+
), g = ne(s.value), C = { ...ei(k), _id: n.groupId, groupKey: "" };
|
|
3785
3785
|
(y ?? -1) < 0 ? g[c.value] = {
|
|
3786
3786
|
...g[c.value],
|
|
3787
|
-
groups: [...((
|
|
3787
|
+
groups: [...((M = g[c.value]) == null ? void 0 : M.groups) || [], C]
|
|
3788
3788
|
} : g[c.value].groups[y] = C, s.value = g;
|
|
3789
3789
|
}
|
|
3790
|
-
function b(
|
|
3790
|
+
function b(k) {
|
|
3791
3791
|
const y = d.value.length;
|
|
3792
3792
|
let g = c.value;
|
|
3793
|
-
|
|
3793
|
+
k === "left" ? g = g === 0 ? y - 1 : g - 1 : g = g === y - 1 ? 0 : g + 1, u.value = d.value[g].value;
|
|
3794
3794
|
}
|
|
3795
|
-
function v(
|
|
3795
|
+
function v(k) {
|
|
3796
3796
|
return {
|
|
3797
3797
|
isV4: o.version === B.F_MENU_VERSION.enum.v4,
|
|
3798
3798
|
isDefault: (y) => !1,
|
|
@@ -3812,20 +3812,20 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3812
3812
|
function f() {
|
|
3813
3813
|
a("update:combinations", s.value);
|
|
3814
3814
|
}
|
|
3815
|
-
const S =
|
|
3815
|
+
const S = Q(!1);
|
|
3816
3816
|
Re(
|
|
3817
3817
|
() => S.value,
|
|
3818
|
-
(
|
|
3819
|
-
|
|
3818
|
+
(k) => {
|
|
3819
|
+
k && (s.value = ne(n.combinations), u.value = n.combinations[0].combinationKey || "");
|
|
3820
3820
|
}
|
|
3821
3821
|
);
|
|
3822
|
-
const z =
|
|
3822
|
+
const z = Q();
|
|
3823
3823
|
i({
|
|
3824
3824
|
show: (j = z.value) == null ? void 0 : j.show,
|
|
3825
|
-
trigger: (
|
|
3825
|
+
trigger: (I = z.value) == null ? void 0 : I.trigger
|
|
3826
3826
|
});
|
|
3827
3827
|
const { t: E } = me();
|
|
3828
|
-
return (
|
|
3828
|
+
return (k, y) => {
|
|
3829
3829
|
const g = G("fm-select"), C = G("fm-button"), x = G("fm-card");
|
|
3830
3830
|
return O(), Y(fn, {
|
|
3831
3831
|
ref_key: "sheet",
|
|
@@ -3836,12 +3836,12 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3836
3836
|
group: h.value,
|
|
3837
3837
|
action: "update",
|
|
3838
3838
|
title: p(E)("menu.group.update"),
|
|
3839
|
-
"onUpdate:group": y[3] || (y[3] = (
|
|
3840
|
-
"onSubmit:group": y[4] || (y[4] = (
|
|
3841
|
-
"onStatus:show": y[5] || (y[5] = (
|
|
3839
|
+
"onUpdate:group": y[3] || (y[3] = (M) => m(M)),
|
|
3840
|
+
"onSubmit:group": y[4] || (y[4] = (M) => f()),
|
|
3841
|
+
"onStatus:show": y[5] || (y[5] = (M) => S.value = M)
|
|
3842
3842
|
}, {
|
|
3843
|
-
default: L(({ trigger:
|
|
3844
|
-
ve(
|
|
3843
|
+
default: L(({ trigger: M }) => [
|
|
3844
|
+
ve(k.$slots, "default", { trigger: M })
|
|
3845
3845
|
]),
|
|
3846
3846
|
"variant-section": L(() => [
|
|
3847
3847
|
u.value ? (O(), Y(x, {
|
|
@@ -3854,7 +3854,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3854
3854
|
P("div", or, [
|
|
3855
3855
|
w(g, {
|
|
3856
3856
|
modelValue: u.value,
|
|
3857
|
-
"onUpdate:modelValue": y[0] || (y[0] = (
|
|
3857
|
+
"onUpdate:modelValue": y[0] || (y[0] = (M) => u.value = M),
|
|
3858
3858
|
items: d.value,
|
|
3859
3859
|
class: "flex-1"
|
|
3860
3860
|
}, null, 8, ["modelValue", "items"]),
|
|
@@ -3863,13 +3863,13 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3863
3863
|
variant: p(qe).Tertiary,
|
|
3864
3864
|
"prepend-icon": "keyboard_arrow_left",
|
|
3865
3865
|
size: "lg",
|
|
3866
|
-
onClick: y[1] || (y[1] = (
|
|
3866
|
+
onClick: y[1] || (y[1] = (M) => b("left"))
|
|
3867
3867
|
}, null, 8, ["variant"]),
|
|
3868
3868
|
w(C, {
|
|
3869
3869
|
variant: p(qe).Tertiary,
|
|
3870
3870
|
"prepend-icon": "keyboard_arrow_right",
|
|
3871
3871
|
size: "lg",
|
|
3872
|
-
onClick: y[2] || (y[2] = (
|
|
3872
|
+
onClick: y[2] || (y[2] = (M) => b("right"))
|
|
3873
3873
|
}, null, 8, ["variant"])
|
|
3874
3874
|
])
|
|
3875
3875
|
])
|
|
@@ -3881,7 +3881,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3881
3881
|
}, 8, ["categorized-items", "group", "title"]);
|
|
3882
3882
|
};
|
|
3883
3883
|
}
|
|
3884
|
-
}), sr = fn,
|
|
3884
|
+
}), sr = fn, Ii = Na, lr = rr, ur = {
|
|
3885
3885
|
key: 0,
|
|
3886
3886
|
class: "flex flex-col space-y-16 h-[440px]"
|
|
3887
3887
|
}, cr = { class: "flex-1 flex-shrink space-y-8 min-h-0 overflow-y-scroll p-8" }, dr = { class: "flex justify-between pb-16" }, mr = { class: "flex gap-8" }, hr = {
|
|
@@ -3893,9 +3893,9 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3893
3893
|
groupIds: {}
|
|
3894
3894
|
},
|
|
3895
3895
|
setup(e) {
|
|
3896
|
-
const i = e, t = Be(), { emitData: n, emitAction: a } =
|
|
3896
|
+
const i = e, t = Be(), { emitData: n, emitAction: a } = Qt(), o = fe(), r = F(() => o.rules.group), l = F(() => o.groups);
|
|
3897
3897
|
function s(z) {
|
|
3898
|
-
return ne(z ?? []).sort((j,
|
|
3898
|
+
return ne(z ?? []).sort((j, I) => j.position - I.position);
|
|
3899
3899
|
}
|
|
3900
3900
|
const u = F(() => s(l.value).reduce((z, E) => (z[E._id] = {
|
|
3901
3901
|
name: E.name,
|
|
@@ -3906,18 +3906,18 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3906
3906
|
value: z
|
|
3907
3907
|
}))
|
|
3908
3908
|
]), d = F(() => !!o.state.currentCatalogId || !!o.state.currentSchedulerId), h = F(() => {
|
|
3909
|
-
const z = !o.state.currentSchedulerId, E = o.rules.group.type, j = o.version == B.F_MENU_VERSION.enum.v3,
|
|
3909
|
+
const z = !o.state.currentSchedulerId, E = o.rules.group.type, j = o.version == B.F_MENU_VERSION.enum.v3, I = o.rules.item.orderFromActiveOnly, k = o.rules.item.bindToVariant;
|
|
3910
3910
|
return function(g) {
|
|
3911
3911
|
return {
|
|
3912
|
-
link: (C) => !d.value && (!C ||
|
|
3912
|
+
link: (C) => !d.value && (!C || k),
|
|
3913
3913
|
name: (C) => !d.value && !C,
|
|
3914
3914
|
type: E && !g._id && !d.value,
|
|
3915
3915
|
price: g.type != B.F_ADDON_GROUP_TYPE.enum.DYNAMIC,
|
|
3916
3916
|
inventory: z ? j ? !d.value && g.type == B.F_ADDON_GROUP_TYPE.enum.NORMAL : !d.value : !1,
|
|
3917
3917
|
orderFrom: (C) => z ? j ? g.type == B.F_ADDON_GROUP_TYPE.enum.DYNAMIC ? d.value : !!d.value == !C : d.value : !1,
|
|
3918
|
-
orderFromActiveOnly:
|
|
3918
|
+
orderFromActiveOnly: I,
|
|
3919
3919
|
showOrderFrom: z ? j ? d.value ? !0 : g.type == B.F_ADDON_GROUP_TYPE.enum.PRODUCT : d.value : !1,
|
|
3920
|
-
bindToVariant:
|
|
3920
|
+
bindToVariant: k,
|
|
3921
3921
|
isOverride: d.value,
|
|
3922
3922
|
isItemGroup: !1,
|
|
3923
3923
|
isV4: !j
|
|
@@ -3929,12 +3929,12 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3929
3929
|
items: {},
|
|
3930
3930
|
position: o.groups.length - 1,
|
|
3931
3931
|
itemsLinked: []
|
|
3932
|
-
})), b =
|
|
3932
|
+
})), b = Q(ne(i.groupIds || [])), v = Q(""), { t: f } = me(), S = () => {
|
|
3933
3933
|
n(b.value), a("primary"), t.close();
|
|
3934
3934
|
};
|
|
3935
3935
|
return (z, E) => {
|
|
3936
|
-
const j = G("FmSearch"),
|
|
3937
|
-
return c.value.length > 0 ? (O(),
|
|
3936
|
+
const j = G("FmSearch"), I = G("FmCheckbox"), k = G("FmButton");
|
|
3937
|
+
return c.value.length > 0 ? (O(), J("div", ur, [
|
|
3938
3938
|
P("div", null, [
|
|
3939
3939
|
w(j, {
|
|
3940
3940
|
autofocus: "",
|
|
@@ -3945,10 +3945,10 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3945
3945
|
]),
|
|
3946
3946
|
P("div", cr, [
|
|
3947
3947
|
P("div", null, [
|
|
3948
|
-
(O(!0),
|
|
3948
|
+
(O(!0), J(ke, null, Ye(c.value, (y) => (O(), J("div", {
|
|
3949
3949
|
key: y.value
|
|
3950
3950
|
}, [
|
|
3951
|
-
|
|
3951
|
+
Je(w(I, {
|
|
3952
3952
|
modelValue: b.value,
|
|
3953
3953
|
"onUpdate:modelValue": [
|
|
3954
3954
|
E[1] || (E[1] = (g) => b.value = g),
|
|
@@ -3963,9 +3963,9 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3963
3963
|
])
|
|
3964
3964
|
]),
|
|
3965
3965
|
P("div", dr, [
|
|
3966
|
-
w(p(
|
|
3966
|
+
w(p(Ii), null, {
|
|
3967
3967
|
default: L(({ trigger: y }) => [
|
|
3968
|
-
w(
|
|
3968
|
+
w(k, {
|
|
3969
3969
|
label: p(f)("menu.common.actions.add_group"),
|
|
3970
3970
|
variant: "tertiary",
|
|
3971
3971
|
"text-color": "primary",
|
|
@@ -3975,23 +3975,23 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3975
3975
|
_: 1
|
|
3976
3976
|
}),
|
|
3977
3977
|
P("div", mr, [
|
|
3978
|
-
w(
|
|
3978
|
+
w(k, {
|
|
3979
3979
|
label: p(f)("menu.common.actions.cancel"),
|
|
3980
3980
|
variant: "tertiary",
|
|
3981
3981
|
onClick: E[3] || (E[3] = (y) => p(t).close())
|
|
3982
3982
|
}, null, 8, ["label"]),
|
|
3983
|
-
w(
|
|
3983
|
+
w(k, {
|
|
3984
3984
|
label: p(f)("menu.common.actions.confirm"),
|
|
3985
3985
|
onClick: E[4] || (E[4] = (y) => S())
|
|
3986
3986
|
}, null, 8, ["label"])
|
|
3987
3987
|
])
|
|
3988
3988
|
])
|
|
3989
|
-
])) : (O(),
|
|
3989
|
+
])) : (O(), J("div", hr, [
|
|
3990
3990
|
P("div", pr, [
|
|
3991
3991
|
P("p", fr, de(p(f)("menu.common.empty.no_group.title")), 1),
|
|
3992
3992
|
P("p", gr, de(p(f)("menu.common.empty.no_group.subtitle")), 1)
|
|
3993
3993
|
]),
|
|
3994
|
-
w(p(
|
|
3994
|
+
w(p(Ii), {
|
|
3995
3995
|
"categorized-items": p(o).categorizedItems,
|
|
3996
3996
|
config: h.value,
|
|
3997
3997
|
group: m.value,
|
|
@@ -3999,7 +3999,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3999
3999
|
title: p(f)("menu.group.add")
|
|
4000
4000
|
}, {
|
|
4001
4001
|
default: L(({ trigger: y }) => [
|
|
4002
|
-
w(
|
|
4002
|
+
w(k, {
|
|
4003
4003
|
label: p(f)("menu.common.actions.add_group"),
|
|
4004
4004
|
icon: "add",
|
|
4005
4005
|
onClick: (g) => y()
|
|
@@ -4030,7 +4030,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4030
4030
|
const t = e, n = fe(), a = ri(), o = Be(), {
|
|
4031
4031
|
t: r
|
|
4032
4032
|
} = me(), l = i, s = F(() => n.rules.group), u = F(() => n.rules.item), c = F(() => n.groups);
|
|
4033
|
-
Xe(He(
|
|
4033
|
+
Xe(He(Ie())), Q(!1);
|
|
4034
4034
|
function d(R, _) {
|
|
4035
4035
|
return ne(_ ?? []).map((U) => {
|
|
4036
4036
|
const V = R.find((N) => N._id === U._id);
|
|
@@ -4135,13 +4135,13 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4135
4135
|
variant: "tertiary",
|
|
4136
4136
|
textColor: "neutral-gray-400",
|
|
4137
4137
|
onClick: Rt(async () => {
|
|
4138
|
-
|
|
4138
|
+
I(_);
|
|
4139
4139
|
}, ["stop", "prevent"])
|
|
4140
4140
|
}), he(lr, {
|
|
4141
4141
|
combinations: y.value ?? [],
|
|
4142
4142
|
fullCombinations: t.fullCombinations,
|
|
4143
4143
|
groupId: _,
|
|
4144
|
-
"onUpdate:combinations":
|
|
4144
|
+
"onUpdate:combinations": M
|
|
4145
4145
|
}, {
|
|
4146
4146
|
default: ({
|
|
4147
4147
|
trigger: A
|
|
@@ -4182,7 +4182,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4182
4182
|
groups: _
|
|
4183
4183
|
}));
|
|
4184
4184
|
}
|
|
4185
|
-
function
|
|
4185
|
+
function I(R) {
|
|
4186
4186
|
var A;
|
|
4187
4187
|
const _ = ((A = t.form.groups) == null ? void 0 : A.filter((U) => U._id !== R)) || [];
|
|
4188
4188
|
l("replace:form", a.initDynamicGroupItem({
|
|
@@ -4190,12 +4190,12 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4190
4190
|
groups: _
|
|
4191
4191
|
}));
|
|
4192
4192
|
}
|
|
4193
|
-
const
|
|
4193
|
+
const k = F(() => {
|
|
4194
4194
|
var R;
|
|
4195
4195
|
return !!((R = t.form.variant) != null && R.variantGroupIds.length);
|
|
4196
4196
|
}), y = F(() => {
|
|
4197
4197
|
var R;
|
|
4198
|
-
return
|
|
4198
|
+
return k.value ? (R = t.form.variant) == null ? void 0 : R.variantCombinations : [{
|
|
4199
4199
|
_id: t.form._id,
|
|
4200
4200
|
combinationKey: "",
|
|
4201
4201
|
groups: t.form.groups || []
|
|
@@ -4247,9 +4247,9 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4247
4247
|
const x = (R) => {
|
|
4248
4248
|
var _;
|
|
4249
4249
|
return (_ = f.value.find((A) => A.value === R)) == null ? void 0 : _.label;
|
|
4250
|
-
},
|
|
4250
|
+
}, M = (R) => {
|
|
4251
4251
|
var _;
|
|
4252
|
-
|
|
4252
|
+
k.value ? l("update:form", "variant", {
|
|
4253
4253
|
variantGroupIds: ((_ = t.form.variant) == null ? void 0 : _.variantGroupIds) || [],
|
|
4254
4254
|
variantCombinations: R
|
|
4255
4255
|
}) : l("update:form", "groups", R[0].groups || []);
|
|
@@ -4332,17 +4332,17 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4332
4332
|
return s(n.form.inventoryBindings || [], ((v = n.form.variant) == null ? void 0 : v.variantCombinations) || [], u.value, o.variants);
|
|
4333
4333
|
});
|
|
4334
4334
|
function d(v, f) {
|
|
4335
|
-
var j,
|
|
4335
|
+
var j, I;
|
|
4336
4336
|
let S = $e.clone(n.form);
|
|
4337
4337
|
const z = S.variant;
|
|
4338
4338
|
if ((((j = z == null ? void 0 : z.variantCombinations) == null ? void 0 : j.length) ?? 0) > 0 && z) {
|
|
4339
|
-
const
|
|
4340
|
-
if (
|
|
4339
|
+
const k = z.variantCombinations.findIndex((g) => g.combinationKey === v);
|
|
4340
|
+
if (k < 0) return;
|
|
4341
4341
|
const y = $e.clone(z.variantCombinations);
|
|
4342
|
-
y[
|
|
4342
|
+
y[k].inventoryBindings = f, S = {
|
|
4343
4343
|
...S,
|
|
4344
4344
|
variant: {
|
|
4345
|
-
variantGroupIds: ((
|
|
4345
|
+
variantGroupIds: ((I = S.variant) == null ? void 0 : I.variantGroupIds) || [],
|
|
4346
4346
|
variantCombinations: y
|
|
4347
4347
|
}
|
|
4348
4348
|
};
|
|
@@ -4353,7 +4353,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4353
4353
|
};
|
|
4354
4354
|
a("replace:form", S);
|
|
4355
4355
|
}
|
|
4356
|
-
|
|
4356
|
+
Q([{
|
|
4357
4357
|
accessorKey: "name",
|
|
4358
4358
|
header: () => u.value || t("menu.inventory.columns.product_name"),
|
|
4359
4359
|
enableSorting: !1
|
|
@@ -4406,7 +4406,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4406
4406
|
})]) : null;
|
|
4407
4407
|
}
|
|
4408
4408
|
}]);
|
|
4409
|
-
const h =
|
|
4409
|
+
const h = Q([]);
|
|
4410
4410
|
async function m({
|
|
4411
4411
|
_id: v
|
|
4412
4412
|
}) {
|
|
@@ -4420,7 +4420,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4420
4420
|
title: p(t)("menu.inventory.title"),
|
|
4421
4421
|
subTitle: p(t)("menu.inventory.subtitle")
|
|
4422
4422
|
}, {
|
|
4423
|
-
default: L(() => [P("div", yr, [P("div", _r, [(O(!0),
|
|
4423
|
+
default: L(() => [P("div", yr, [P("div", _r, [(O(!0), J(ke, null, Ye(c.value, (S) => (O(), Y(p(qt), {
|
|
4424
4424
|
ref_for: !0,
|
|
4425
4425
|
ref_key: "inventoryManagerForms",
|
|
4426
4426
|
ref: h,
|
|
@@ -4445,7 +4445,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4445
4445
|
}, Cr = { class: "space-y-16" }, Ar = { class: "space-y-8" }, Rr = {
|
|
4446
4446
|
key: 0,
|
|
4447
4447
|
class: "pl-32 pb-4 space-x-16 flex items-center"
|
|
4448
|
-
}, xr = { class: "fm-typo-en-body-lg-400" },
|
|
4448
|
+
}, xr = { class: "fm-typo-en-body-lg-400" }, Mr = { class: "w-[258px]" }, kr = { class: "w-[117px]" }, Or = {
|
|
4449
4449
|
key: 0,
|
|
4450
4450
|
class: "space-y-8"
|
|
4451
4451
|
}, zr = {
|
|
@@ -4454,7 +4454,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4454
4454
|
}, Er = { class: "w-[258px] xs:w-full" }, Fr = {
|
|
4455
4455
|
key: 1,
|
|
4456
4456
|
class: "space-y-8"
|
|
4457
|
-
},
|
|
4457
|
+
}, Dr = { class: "pl-32 pb-4 flex space-x-16" }, Ir = { class: "w-[258px] xs:w-full" }, Pr = /* @__PURE__ */ ue({
|
|
4458
4458
|
__name: "ProductPrice",
|
|
4459
4459
|
props: {
|
|
4460
4460
|
isOverride: { type: Boolean },
|
|
@@ -4492,9 +4492,9 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4492
4492
|
}
|
|
4493
4493
|
}
|
|
4494
4494
|
}
|
|
4495
|
-
const b =
|
|
4495
|
+
const b = Q(!1);
|
|
4496
4496
|
async function v() {
|
|
4497
|
-
var S, z, E, j,
|
|
4497
|
+
var S, z, E, j, I, k, y, g;
|
|
4498
4498
|
if (!(t.form.name || "")) {
|
|
4499
4499
|
const C = document.getElementById("product-name");
|
|
4500
4500
|
if (C) {
|
|
@@ -4505,7 +4505,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4505
4505
|
}
|
|
4506
4506
|
if (!b.value)
|
|
4507
4507
|
try {
|
|
4508
|
-
b.value = !0,
|
|
4508
|
+
b.value = !0, Jt({ event: "menu_catalog_item_price_remy_suggest_pricing" }), Ne.toggleDialog(!0), Ne.registerOnSelect((C) => {
|
|
4509
4509
|
typeof C == "number" && r(
|
|
4510
4510
|
"update:form",
|
|
4511
4511
|
"price",
|
|
@@ -4518,7 +4518,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4518
4518
|
{
|
|
4519
4519
|
name: t.form.name || "",
|
|
4520
4520
|
lat: (E = (z = (S = n.currentRestaurant) == null ? void 0 : S.value) == null ? void 0 : z.profile.address.coordinates) == null ? void 0 : E[1],
|
|
4521
|
-
lon: (
|
|
4521
|
+
lon: (k = (I = (j = n.currentRestaurant) == null ? void 0 : j.value) == null ? void 0 : I.profile.address.coordinates) == null ? void 0 : k[0]
|
|
4522
4522
|
},
|
|
4523
4523
|
!0
|
|
4524
4524
|
));
|
|
@@ -4527,18 +4527,18 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4527
4527
|
}
|
|
4528
4528
|
}
|
|
4529
4529
|
return (f, S) => {
|
|
4530
|
-
const z = G("fm-select"), E = G("fm-checkbox"), j = G("fm-text-field"),
|
|
4530
|
+
const z = G("fm-select"), E = G("fm-checkbox"), j = G("fm-text-field"), I = Nt("tooltip");
|
|
4531
4531
|
return O(), Y(Ke, {
|
|
4532
4532
|
title: p(o)("menu.product.form.price.title")
|
|
4533
4533
|
}, {
|
|
4534
4534
|
default: L(() => {
|
|
4535
|
-
var
|
|
4535
|
+
var k;
|
|
4536
4536
|
return [
|
|
4537
4537
|
P("div", Sr, [
|
|
4538
4538
|
w(it, {
|
|
4539
4539
|
min: 0,
|
|
4540
4540
|
"model-value": f.form.price || null,
|
|
4541
|
-
placeholder: (
|
|
4541
|
+
placeholder: (k = f.fallback) != null && k.price ? p(mt)(f.fallback.price, !1) : void 0,
|
|
4542
4542
|
rules: [
|
|
4543
4543
|
l.value.price ? (y) => !!y || p(o)("menu.product.form.price.fields.selling_price.required") : void 0
|
|
4544
4544
|
].filter(p(pt).isSet),
|
|
@@ -4548,11 +4548,11 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4548
4548
|
"onUpdate:modelValue": S[0] || (S[0] = (y) => y && r("update:form", "price", y))
|
|
4549
4549
|
}, {
|
|
4550
4550
|
append: L(() => [
|
|
4551
|
-
|
|
4551
|
+
Je(w(mn, {
|
|
4552
4552
|
"pure-styling": "",
|
|
4553
4553
|
onClick: v
|
|
4554
4554
|
}, null, 512), [
|
|
4555
|
-
[
|
|
4555
|
+
[I, p(Li)("Suggest pricing")]
|
|
4556
4556
|
])
|
|
4557
4557
|
]),
|
|
4558
4558
|
_: 1
|
|
@@ -4594,9 +4594,9 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4594
4594
|
sublabel: p(o)("menu.product.form.price.settings.sell_by_unit.sublabel"),
|
|
4595
4595
|
"onUpdate:modelValue": u
|
|
4596
4596
|
}, null, 8, ["disabled", "model-value", "value", "label", "sublabel"]),
|
|
4597
|
-
s.value ? (O(),
|
|
4597
|
+
s.value ? (O(), J("div", Rr, [
|
|
4598
4598
|
P("p", xr, de(p(o)("menu.product.form.price.settings.sell_by_unit.per_unit.label")), 1),
|
|
4599
|
-
P("div",
|
|
4599
|
+
P("div", Mr, [
|
|
4600
4600
|
w(j, {
|
|
4601
4601
|
disabled: !l.value.unit,
|
|
4602
4602
|
"model-value": f.form.perXUnit || null,
|
|
@@ -4611,7 +4611,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4611
4611
|
"onUpdate:modelValue": h
|
|
4612
4612
|
}, null, 8, ["disabled", "model-value", "rules", "placeholder"])
|
|
4613
4613
|
]),
|
|
4614
|
-
P("div",
|
|
4614
|
+
P("div", kr, [
|
|
4615
4615
|
w(j, {
|
|
4616
4616
|
"model-value": f.form.unit || null,
|
|
4617
4617
|
rules: [
|
|
@@ -4623,14 +4623,14 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4623
4623
|
])
|
|
4624
4624
|
])) : te("", !0)
|
|
4625
4625
|
]),
|
|
4626
|
-
l.value.costing ? (O(),
|
|
4626
|
+
l.value.costing ? (O(), J("div", Or, [
|
|
4627
4627
|
w(E, {
|
|
4628
4628
|
"model-value": !!f.form.costing,
|
|
4629
4629
|
value: !!f.form.costing,
|
|
4630
4630
|
label: p(o)("menu.product.form.price.settings.track_costing.label"),
|
|
4631
4631
|
"onUpdate:modelValue": S[4] || (S[4] = (g) => r("update:form", "costing", g ? p(Ae.Dinero).zero().toObject() : void 0))
|
|
4632
4632
|
}, null, 8, ["model-value", "value", "label"]),
|
|
4633
|
-
f.form.costing ? (O(),
|
|
4633
|
+
f.form.costing ? (O(), J("div", zr, [
|
|
4634
4634
|
P("div", Er, [
|
|
4635
4635
|
w(it, {
|
|
4636
4636
|
class: "w-full",
|
|
@@ -4643,7 +4643,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4643
4643
|
])
|
|
4644
4644
|
])) : te("", !0)
|
|
4645
4645
|
])) : te("", !0),
|
|
4646
|
-
l.value.minPrice ? (O(),
|
|
4646
|
+
l.value.minPrice ? (O(), J("div", Fr, [
|
|
4647
4647
|
w(E, {
|
|
4648
4648
|
disabled: !l.value.minPrice,
|
|
4649
4649
|
"model-value": !!f.form.minPrice,
|
|
@@ -4651,8 +4651,8 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4651
4651
|
label: p(o)("menu.product.form.price.settings.min_price.label"),
|
|
4652
4652
|
"onUpdate:modelValue": S[6] || (S[6] = (g) => r("update:form", "minPrice", g ? p(Ae.Dinero).zero().toObject() : void 0))
|
|
4653
4653
|
}, null, 8, ["disabled", "model-value", "value", "label"]),
|
|
4654
|
-
P("div",
|
|
4655
|
-
P("div",
|
|
4654
|
+
P("div", Dr, [
|
|
4655
|
+
P("div", Ir, [
|
|
4656
4656
|
f.form.minPrice ? (O(), Y(it, {
|
|
4657
4657
|
key: 0,
|
|
4658
4658
|
max: p(Ae.Dinero).fromFdoDinero(f.form.price).toUnit(),
|
|
@@ -4683,13 +4683,13 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4683
4683
|
applyProduct: { type: Boolean }
|
|
4684
4684
|
},
|
|
4685
4685
|
setup(e) {
|
|
4686
|
-
const { t: i } = me(), t = e, n = Xe(He(
|
|
4686
|
+
const { t: i } = me(), t = e, n = Xe(He(Ie())), a = F(
|
|
4687
4687
|
() => t.initialValue ? i("menu.print_dept.update") : i("menu.print_dept.add")
|
|
4688
4688
|
), o = F(
|
|
4689
4689
|
() => t.initialValue ? i("menu.common.actions.update") : i("menu.common.actions.add")
|
|
4690
|
-
), r =
|
|
4690
|
+
), r = Q(
|
|
4691
4691
|
t.initialValue ? ne(t.initialValue) : { ...Se.generator.initMenuV4PrintDepartment(), usedBy: [] }
|
|
4692
|
-
), l =
|
|
4692
|
+
), l = Q(!1), s = Q(!1), u = (d) => {
|
|
4693
4693
|
pt.isBoolean(d) ? s.value = d : s.value = !s.value;
|
|
4694
4694
|
};
|
|
4695
4695
|
async function c() {
|
|
@@ -4725,7 +4725,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4725
4725
|
}
|
|
4726
4726
|
), (d, h) => {
|
|
4727
4727
|
const m = G("fm-text-field"), b = G("fm-button"), v = G("fm-side-sheet");
|
|
4728
|
-
return O(),
|
|
4728
|
+
return O(), J(ke, null, [
|
|
4729
4729
|
ve(d.$slots, "default", { trigger: u }),
|
|
4730
4730
|
w(v, {
|
|
4731
4731
|
id: "variant-form",
|
|
@@ -4841,9 +4841,9 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4841
4841
|
});
|
|
4842
4842
|
}
|
|
4843
4843
|
function v(S, z) {
|
|
4844
|
-
var j,
|
|
4845
|
-
let E = [...((
|
|
4846
|
-
z && !E.includes(S) ? E = [...E, S] : z || (E = E.filter((
|
|
4844
|
+
var j, I;
|
|
4845
|
+
let E = [...((I = (j = t.form) == null ? void 0 : j.print) == null ? void 0 : I.department) ?? []];
|
|
4846
|
+
z && !E.includes(S) ? E = [...E, S] : z || (E = E.filter((k) => k !== S)), o("update:form", "print", {
|
|
4847
4847
|
...r(),
|
|
4848
4848
|
...t.form.print,
|
|
4849
4849
|
department: E
|
|
@@ -4865,7 +4865,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4865
4865
|
() => s.value.length,
|
|
4866
4866
|
() => v(s.value[s.value.length - 1]._id, !0)
|
|
4867
4867
|
), (S, z) => {
|
|
4868
|
-
const E = G("fm-switch"), j = G("fm-radio"),
|
|
4868
|
+
const E = G("fm-switch"), j = G("fm-radio"), I = G("fm-radio-group"), k = G("fm-button"), y = G("fm-checkbox");
|
|
4869
4869
|
return O(), Y(Ke, {
|
|
4870
4870
|
title: p(a)("menu.product.form.print.title")
|
|
4871
4871
|
}, {
|
|
@@ -4890,14 +4890,14 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4890
4890
|
}),
|
|
4891
4891
|
_: 1
|
|
4892
4892
|
}, 8, ["label"])) : te("", !0),
|
|
4893
|
-
w(
|
|
4893
|
+
w(I, {
|
|
4894
4894
|
label: p(a)("menu.product.form.print.kds.label"),
|
|
4895
4895
|
"model-value": ((g = S.form.print) == null ? void 0 : g.sequential) ?? !1,
|
|
4896
4896
|
"onUpdate:modelValue": z[1] || (z[1] = (C) => m(C))
|
|
4897
4897
|
}, {
|
|
4898
4898
|
default: L(() => [
|
|
4899
4899
|
P("div", Lr, [
|
|
4900
|
-
(O(!0),
|
|
4900
|
+
(O(!0), J(ke, null, Ye(f.value, (C, x) => (O(), Y(j, {
|
|
4901
4901
|
key: x,
|
|
4902
4902
|
label: C.label,
|
|
4903
4903
|
sublabel: C.description,
|
|
@@ -4920,13 +4920,13 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4920
4920
|
class: "space-y-16"
|
|
4921
4921
|
}, {
|
|
4922
4922
|
item: L(({ element: C }) => {
|
|
4923
|
-
var x,
|
|
4923
|
+
var x, M, R, _, A;
|
|
4924
4924
|
return [
|
|
4925
4925
|
P("div", Br, [
|
|
4926
4926
|
P("div", Kr, [
|
|
4927
|
-
u.value ? (O(), Y(
|
|
4927
|
+
u.value ? (O(), Y(k, {
|
|
4928
4928
|
key: 0,
|
|
4929
|
-
disabled: !((
|
|
4929
|
+
disabled: !((M = (x = t.form.print) == null ? void 0 : x.department) != null && M.includes(C)),
|
|
4930
4930
|
class: "handle",
|
|
4931
4931
|
"prepend-icon": "drag_handle",
|
|
4932
4932
|
variant: "tertiary",
|
|
@@ -4951,7 +4951,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4951
4951
|
w(p(Nr), { "apply-product": !1 }, {
|
|
4952
4952
|
default: L(({ trigger: C }) => [
|
|
4953
4953
|
P("div", Gr, [
|
|
4954
|
-
w(
|
|
4954
|
+
w(k, {
|
|
4955
4955
|
variant: p(qe).Secondary,
|
|
4956
4956
|
label: p(a)("menu.product.form.print.routes.add"),
|
|
4957
4957
|
"prepend-icon": "add",
|
|
@@ -4987,7 +4987,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4987
4987
|
setup(e, {
|
|
4988
4988
|
emit: i
|
|
4989
4989
|
}) {
|
|
4990
|
-
const t = e, n = fe(), a = F(() => n.rules.item), o = Xe(He(
|
|
4990
|
+
const t = e, n = fe(), a = F(() => n.rules.item), o = Xe(He(Ie())), {
|
|
4991
4991
|
t: r
|
|
4992
4992
|
} = me(), l = i, s = F(() => {
|
|
4993
4993
|
var b, v;
|
|
@@ -5024,7 +5024,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5024
5024
|
}, ...n.takeaways.map((b) => ({
|
|
5025
5025
|
label: b.name,
|
|
5026
5026
|
value: b._id
|
|
5027
|
-
}))]), m =
|
|
5027
|
+
}))]), m = Q([{
|
|
5028
5028
|
accessorKey: "name",
|
|
5029
5029
|
enableSorting: !1,
|
|
5030
5030
|
header: () => s.value ? r("menu.product.form.takeaway.columns.variant") : r("menu.product.form.takeaway.columns.product")
|
|
@@ -5095,22 +5095,22 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5095
5095
|
}, Hr = { class: "flex-1 flex-shrink space-y-8 min-h-0 overflow-y-scroll p-8" }, Xr = { class: "flex justify-between pb-16" }, qr = { class: "flex gap-8" }, Zr = {
|
|
5096
5096
|
key: 1,
|
|
5097
5097
|
class: "flex flex-col items-center space-y-16"
|
|
5098
|
-
},
|
|
5098
|
+
}, Qr = { class: "flex flex-col items-center space-y-4 w-full" }, Jr = { class: "fm-typo-en-title-sm-600" }, es = { class: "text-fm-color-typo-secondary" }, ts = /* @__PURE__ */ ue({
|
|
5099
5099
|
__name: "SelectVariantDialog",
|
|
5100
5100
|
props: {
|
|
5101
5101
|
selectedVariants: {}
|
|
5102
5102
|
},
|
|
5103
5103
|
setup(e) {
|
|
5104
|
-
const i = Be(), { emitData: t, emitAction: n } =
|
|
5104
|
+
const i = Be(), { emitData: t, emitAction: n } = Qt(), a = fe(), { t: o } = me(), r = e, l = F(() => a.variants.map((d) => ({
|
|
5105
5105
|
label: d.name,
|
|
5106
5106
|
value: d._id,
|
|
5107
5107
|
disabled: !1
|
|
5108
|
-
}))), s =
|
|
5108
|
+
}))), s = Q(ne(r.selectedVariants)), u = Q(""), c = () => {
|
|
5109
5109
|
t(s.value), n("primary"), i.close();
|
|
5110
5110
|
};
|
|
5111
5111
|
return (d, h) => {
|
|
5112
5112
|
const m = G("FmSearch"), b = G("FmCheckbox"), v = G("FmButton");
|
|
5113
|
-
return l.value.length > 0 ? (O(),
|
|
5113
|
+
return l.value.length > 0 ? (O(), J("div", Yr, [
|
|
5114
5114
|
P("div", null, [
|
|
5115
5115
|
w(m, {
|
|
5116
5116
|
autofocus: "",
|
|
@@ -5121,10 +5121,10 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5121
5121
|
]),
|
|
5122
5122
|
P("div", Hr, [
|
|
5123
5123
|
P("div", null, [
|
|
5124
|
-
(O(!0),
|
|
5124
|
+
(O(!0), J(ke, null, Ye(l.value, (f) => (O(), J("div", {
|
|
5125
5125
|
key: f.value
|
|
5126
5126
|
}, [
|
|
5127
|
-
|
|
5127
|
+
Je(w(b, {
|
|
5128
5128
|
modelValue: s.value,
|
|
5129
5129
|
"onUpdate:modelValue": [
|
|
5130
5130
|
h[1] || (h[1] = (S) => s.value = S),
|
|
@@ -5163,9 +5163,9 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5163
5163
|
}, null, 8, ["label"])
|
|
5164
5164
|
])
|
|
5165
5165
|
])
|
|
5166
|
-
])) : (O(),
|
|
5167
|
-
P("div",
|
|
5168
|
-
P("p",
|
|
5166
|
+
])) : (O(), J("div", Zr, [
|
|
5167
|
+
P("div", Qr, [
|
|
5168
|
+
P("p", Jr, de(p(o)("menu.common.empty.no_variant.title")), 1),
|
|
5169
5169
|
P("p", es, de(p(o)("menu.common.empty.no_variant.subtitle")), 1)
|
|
5170
5170
|
]),
|
|
5171
5171
|
w(p(wi), null, {
|
|
@@ -5206,18 +5206,18 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5206
5206
|
setup(e, {
|
|
5207
5207
|
emit: i
|
|
5208
5208
|
}) {
|
|
5209
|
-
const t = e, n = fe(), a = ri(), o =
|
|
5209
|
+
const t = e, n = fe(), a = ri(), o = Ie(), r = Be(), {
|
|
5210
5210
|
t: l
|
|
5211
5211
|
} = me(), s = F(() => n.rules.item), u = F(() => s.value.minPrice && !!t.form.minPrice), c = F(() => !n.state.currentCatalogId), d = F(() => n.variants.reduce((g, C) => (g[C._id] = C, g), {}));
|
|
5212
|
-
|
|
5212
|
+
Q(!1);
|
|
5213
5213
|
const h = i;
|
|
5214
5214
|
function m(g) {
|
|
5215
5215
|
const C = $e.clone(t.form);
|
|
5216
5216
|
for (const {
|
|
5217
5217
|
key: x,
|
|
5218
|
-
value:
|
|
5218
|
+
value: M
|
|
5219
5219
|
} of g)
|
|
5220
|
-
C[x] =
|
|
5220
|
+
C[x] = M;
|
|
5221
5221
|
h("replace:form", C);
|
|
5222
5222
|
}
|
|
5223
5223
|
F(() => n.variants.map((g) => ({
|
|
@@ -5233,8 +5233,8 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5233
5233
|
price: C == null ? void 0 : C.price,
|
|
5234
5234
|
inventoryBindings: (C == null ? void 0 : C.inventoryBindings) || t.form.inventoryBindings,
|
|
5235
5235
|
takeawayUsed: (C == null ? void 0 : C.takeawayUsed) || t.form.takeawayUsed,
|
|
5236
|
-
groups: (C == null ? void 0 : C.groups) || ((x = t.form.groups) == null ? void 0 : x.map((
|
|
5237
|
-
...
|
|
5236
|
+
groups: (C == null ? void 0 : C.groups) || ((x = t.form.groups) == null ? void 0 : x.map((M) => ({
|
|
5237
|
+
...M,
|
|
5238
5238
|
groupKey: ""
|
|
5239
5239
|
})))
|
|
5240
5240
|
};
|
|
@@ -5262,17 +5262,17 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5262
5262
|
var C;
|
|
5263
5263
|
return (((C = t.form.variant) == null ? void 0 : C.variantCombinations) || []).map((x) => {
|
|
5264
5264
|
var R, _;
|
|
5265
|
-
const
|
|
5265
|
+
const M = (_ = (R = t.fallback) == null ? void 0 : R.variant) == null ? void 0 : _.variantCombinations.find(({
|
|
5266
5266
|
combinationKey: A
|
|
5267
5267
|
}) => A === x.combinationKey);
|
|
5268
5268
|
return {
|
|
5269
5269
|
...x,
|
|
5270
5270
|
fallback: {
|
|
5271
|
-
...
|
|
5271
|
+
...M,
|
|
5272
5272
|
_id: x._id,
|
|
5273
5273
|
combinationKey: x.combinationKey,
|
|
5274
|
-
price: c.value ? t.form.price ?? (
|
|
5275
|
-
minPrice: t.form.minPrice ?? (
|
|
5274
|
+
price: c.value ? t.form.price ?? (M == null ? void 0 : M.price) : x.price ?? (M == null ? void 0 : M.price),
|
|
5275
|
+
minPrice: t.form.minPrice ?? (M == null ? void 0 : M.minPrice)
|
|
5276
5276
|
}
|
|
5277
5277
|
};
|
|
5278
5278
|
});
|
|
@@ -5280,7 +5280,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5280
5280
|
function E(g, C = (x) => x) {
|
|
5281
5281
|
var R;
|
|
5282
5282
|
const x = g.filter((_) => !!_);
|
|
5283
|
-
let
|
|
5283
|
+
let M;
|
|
5284
5284
|
if (x.length) {
|
|
5285
5285
|
const _ = x.map((U) => n.variants.find((V) => V._id === U)), A = Se.fullVariantCombination(_).map(({
|
|
5286
5286
|
combinationKey: U
|
|
@@ -5299,7 +5299,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5299
5299
|
});
|
|
5300
5300
|
return;
|
|
5301
5301
|
}
|
|
5302
|
-
|
|
5302
|
+
M = {
|
|
5303
5303
|
...t.form,
|
|
5304
5304
|
variant: {
|
|
5305
5305
|
variantGroupIds: x,
|
|
@@ -5316,22 +5316,22 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5316
5316
|
}, {
|
|
5317
5317
|
key: "takeawayUsed",
|
|
5318
5318
|
value: A.length === 1 ? A[0] : null
|
|
5319
|
-
}]),
|
|
5319
|
+
}]), M = {
|
|
5320
5320
|
...t.form,
|
|
5321
5321
|
variant: void 0,
|
|
5322
5322
|
takeawayUsed: A.length === 1 ? A[0] : null
|
|
5323
5323
|
};
|
|
5324
5324
|
}
|
|
5325
|
-
h("replace:form", a.initDynamicGroupItem(
|
|
5325
|
+
h("replace:form", a.initDynamicGroupItem(M));
|
|
5326
5326
|
}
|
|
5327
5327
|
async function j(g, C, x) {
|
|
5328
|
-
const
|
|
5329
|
-
|
|
5328
|
+
const M = $e.clone(t.form);
|
|
5329
|
+
M.variant.variantCombinations[g][C] = x, m([{
|
|
5330
5330
|
key: "variant",
|
|
5331
|
-
value:
|
|
5331
|
+
value: M.variant
|
|
5332
5332
|
}]);
|
|
5333
5333
|
}
|
|
5334
|
-
const
|
|
5334
|
+
const I = F(() => [{
|
|
5335
5335
|
accessorKey: "combinationKey",
|
|
5336
5336
|
header: () => l("menu.product.form.variant.columns.variant"),
|
|
5337
5337
|
enableSorting: !1,
|
|
@@ -5357,10 +5357,10 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5357
5357
|
enableSorting: !1,
|
|
5358
5358
|
cell: (g) => {
|
|
5359
5359
|
var R, _;
|
|
5360
|
-
const C = g.getValue(),
|
|
5360
|
+
const C = g.getValue(), M = (R = g.row.original.fallback) == null ? void 0 : R.orderFrom;
|
|
5361
5361
|
return he(ai, {
|
|
5362
5362
|
modelValue: C ?? null,
|
|
5363
|
-
fallback: t.form.orderFrom ??
|
|
5363
|
+
fallback: t.form.orderFrom ?? M ?? ((_ = t.fallback) == null ? void 0 : _.orderFrom),
|
|
5364
5364
|
disable: !s.value.orderFrom,
|
|
5365
5365
|
required: s.value.orderFrom && s.value.orderFromActiveOnly,
|
|
5366
5366
|
editActiveOnly: s.value.orderFromActiveOnly || !1,
|
|
@@ -5407,7 +5407,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5407
5407
|
showCurrency: !1
|
|
5408
5408
|
});
|
|
5409
5409
|
}
|
|
5410
|
-
}]),
|
|
5410
|
+
}]), k = F(() => ({
|
|
5411
5411
|
minPrice: u.value
|
|
5412
5412
|
}));
|
|
5413
5413
|
function y(g) {
|
|
@@ -5416,7 +5416,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5416
5416
|
}) : !0;
|
|
5417
5417
|
}
|
|
5418
5418
|
return (g, C) => {
|
|
5419
|
-
const x = G("fm-button"),
|
|
5419
|
+
const x = G("fm-button"), M = G("fm-icon"), R = G("FmFormGroup"), _ = G("fm-table");
|
|
5420
5420
|
return O(), Y(Ke, {
|
|
5421
5421
|
title: p(l)("menu.product.form.variant.title"),
|
|
5422
5422
|
"sub-title": p(l)("menu.product.form.variant.subtitle")
|
|
@@ -5452,7 +5452,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5452
5452
|
variant: p(qe).Tertiary,
|
|
5453
5453
|
class: "handle",
|
|
5454
5454
|
"prepend-icon": "drag_handle"
|
|
5455
|
-
}, null, 8, ["variant"]), P("div", os, [P("p", as, de((N = d.value[V]) == null ? void 0 : N.name), 1), w(
|
|
5455
|
+
}, null, 8, ["variant"]), P("div", os, [P("p", as, de((N = d.value[V]) == null ? void 0 : N.name), 1), w(M, {
|
|
5456
5456
|
class: "cursor-pointer",
|
|
5457
5457
|
name: "close",
|
|
5458
5458
|
onClick: Rt((q) => {
|
|
@@ -5469,8 +5469,8 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5469
5469
|
default: L(() => [z.value.length ? (O(), Y(_, {
|
|
5470
5470
|
key: 0,
|
|
5471
5471
|
class: "w-full",
|
|
5472
|
-
"column-defs":
|
|
5473
|
-
"column-visibility":
|
|
5472
|
+
"column-defs": I.value,
|
|
5473
|
+
"column-visibility": k.value,
|
|
5474
5474
|
"page-size": z.value.length ?? 0,
|
|
5475
5475
|
"row-data": z.value ?? [],
|
|
5476
5476
|
"hide-footer": "",
|
|
@@ -5524,7 +5524,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5524
5524
|
ut(async () => {
|
|
5525
5525
|
t.autoShow && (await u(100), d());
|
|
5526
5526
|
});
|
|
5527
|
-
const c =
|
|
5527
|
+
const c = Q(!1);
|
|
5528
5528
|
Re(
|
|
5529
5529
|
() => c.value,
|
|
5530
5530
|
async (W) => {
|
|
@@ -5533,12 +5533,12 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5533
5533
|
);
|
|
5534
5534
|
const d = () => {
|
|
5535
5535
|
c.value = !c.value;
|
|
5536
|
-
}, h =
|
|
5536
|
+
}, h = Q(), m = Q(
|
|
5537
5537
|
t.initialForm ? ne(t.initialForm) : {
|
|
5538
5538
|
...Se.generator.initMenuV4Item(),
|
|
5539
5539
|
category: t.categoryId
|
|
5540
5540
|
}
|
|
5541
|
-
), b =
|
|
5541
|
+
), b = Q(null);
|
|
5542
5542
|
Re(
|
|
5543
5543
|
() => t.initialForm,
|
|
5544
5544
|
async () => {
|
|
@@ -5561,7 +5561,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5561
5561
|
}, S = F(() => {
|
|
5562
5562
|
var W;
|
|
5563
5563
|
return a.mapVariant((W = m.value.variant) == null ? void 0 : W.variantGroupIds);
|
|
5564
|
-
}), z =
|
|
5564
|
+
}), z = Q(null);
|
|
5565
5565
|
Re(
|
|
5566
5566
|
() => m.value.thumbnail,
|
|
5567
5567
|
async (W) => {
|
|
@@ -5583,7 +5583,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5583
5583
|
};
|
|
5584
5584
|
async function j() {
|
|
5585
5585
|
var W, $;
|
|
5586
|
-
h.value = m.value._id &&
|
|
5586
|
+
h.value = m.value._id && I.value ? (await vo(
|
|
5587
5587
|
a.mergedMenu,
|
|
5588
5588
|
[m.value],
|
|
5589
5589
|
a.state.menu,
|
|
@@ -5591,12 +5591,12 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5591
5591
|
($ = a.currentScheduler) == null ? void 0 : $._id
|
|
5592
5592
|
))[0] : void 0;
|
|
5593
5593
|
}
|
|
5594
|
-
const
|
|
5594
|
+
const I = F(
|
|
5595
5595
|
() => !!a.currentCatalog || !!a.state.currentSchedulerId
|
|
5596
|
-
),
|
|
5596
|
+
), k = F(() => {
|
|
5597
5597
|
var W;
|
|
5598
|
-
return
|
|
5599
|
-
}), y = F(() => o.itemAttributeSettings.value.length > 0 && !
|
|
5598
|
+
return I.value ? m.value.category == "" || m.value.category == null && ((W = h.value) == null ? void 0 : W.category) == null : a.version === B.F_MENU_VERSION.enum.v4 && m.value.category == null;
|
|
5599
|
+
}), y = F(() => o.itemAttributeSettings.value.length > 0 && !I.value);
|
|
5600
5600
|
function g() {
|
|
5601
5601
|
var ce;
|
|
5602
5602
|
const W = a.getSelectedTax(
|
|
@@ -5653,7 +5653,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5653
5653
|
}
|
|
5654
5654
|
]
|
|
5655
5655
|
};
|
|
5656
|
-
}),
|
|
5656
|
+
}), M = Q(
|
|
5657
5657
|
m.value.category != null || !!m.value.code || !!m.value.orderFrom
|
|
5658
5658
|
);
|
|
5659
5659
|
function R(W) {
|
|
@@ -5672,7 +5672,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5672
5672
|
for (const [ce, H] of Object.entries($.customAttributes || {}))
|
|
5673
5673
|
typeof H == "string" && H && !((se = W[ce]) != null && se.includes(H)) && (W[ce] = [...W[ce] || [], H]);
|
|
5674
5674
|
}), W;
|
|
5675
|
-
}), A =
|
|
5675
|
+
}), A = Q(!!m.value.price || !!m.value.minPrice || !!m.value.costing);
|
|
5676
5676
|
function U(W) {
|
|
5677
5677
|
W || (m.value = {
|
|
5678
5678
|
...m.value,
|
|
@@ -5681,7 +5681,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5681
5681
|
price: void 0
|
|
5682
5682
|
});
|
|
5683
5683
|
}
|
|
5684
|
-
const V =
|
|
5684
|
+
const V = Q(
|
|
5685
5685
|
(((li = m.value.variant) == null ? void 0 : li.variantCombinations) || []).some(
|
|
5686
5686
|
(W) => !!W.price || !!W.orderFrom || !!W.code
|
|
5687
5687
|
)
|
|
@@ -5701,7 +5701,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5701
5701
|
}
|
|
5702
5702
|
});
|
|
5703
5703
|
}
|
|
5704
|
-
const q =
|
|
5704
|
+
const q = Q(
|
|
5705
5705
|
!!m.value.inventoryBindings || (((ui = m.value.variant) == null ? void 0 : ui.variantCombinations) || []).some((W) => !!W.inventoryBindings) || !1
|
|
5706
5706
|
);
|
|
5707
5707
|
function re(W) {
|
|
@@ -5718,10 +5718,10 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5718
5718
|
} : void 0
|
|
5719
5719
|
});
|
|
5720
5720
|
}
|
|
5721
|
-
const Ce =
|
|
5721
|
+
const Ce = Q(
|
|
5722
5722
|
m.value.takeawayUsed != null || (((ci = m.value.variant) == null ? void 0 : ci.variantCombinations) || []).some((W) => W.takeawayUsed != null) || !1
|
|
5723
5723
|
);
|
|
5724
|
-
function
|
|
5724
|
+
function D(W) {
|
|
5725
5725
|
var $, se;
|
|
5726
5726
|
W || (m.value = {
|
|
5727
5727
|
...m.value,
|
|
@@ -5735,11 +5735,11 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5735
5735
|
}
|
|
5736
5736
|
});
|
|
5737
5737
|
}
|
|
5738
|
-
const T =
|
|
5738
|
+
const T = Q(!!m.value.print);
|
|
5739
5739
|
function K(W) {
|
|
5740
5740
|
W || (m.value = { ...m.value, print: void 0 });
|
|
5741
5741
|
}
|
|
5742
|
-
const Z =
|
|
5742
|
+
const Z = Q(
|
|
5743
5743
|
!!((di = m.value.groups) != null && di.length) != null || (((mi = m.value.variant) == null ? void 0 : mi.variantCombinations) || []).some((W) => {
|
|
5744
5744
|
var $;
|
|
5745
5745
|
return !!(($ = W.groups) != null && $.length);
|
|
@@ -5778,7 +5778,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5778
5778
|
userId: ((W = o.sessionUser.value) == null ? void 0 : W.id) || "",
|
|
5779
5779
|
businessId: ($ = o.currentBusiness.value) == null ? void 0 : $.id,
|
|
5780
5780
|
input: m.value
|
|
5781
|
-
}),
|
|
5781
|
+
}), Jt(
|
|
5782
5782
|
{
|
|
5783
5783
|
event: "menu_catalog_item_dialog_open",
|
|
5784
5784
|
item: JSON.stringify(m.value)
|
|
@@ -5803,8 +5803,8 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5803
5803
|
ie.isUpdatingItem = !1, a.selectCatalog(ie.storedCatalogId), a.selectScheduler(ie.storedSchedulerId);
|
|
5804
5804
|
}
|
|
5805
5805
|
function ye() {
|
|
5806
|
-
|
|
5807
|
-
[
|
|
5806
|
+
I.value && [
|
|
5807
|
+
[M.value, R],
|
|
5808
5808
|
[A.value, U]
|
|
5809
5809
|
].forEach(([$, se]) => {
|
|
5810
5810
|
$ || se(!1);
|
|
@@ -5815,8 +5815,8 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5815
5815
|
}
|
|
5816
5816
|
const { isAtMost: lt } = Ni();
|
|
5817
5817
|
F(() => lt("sm"));
|
|
5818
|
-
const si =
|
|
5819
|
-
return (W, $) => (O(),
|
|
5818
|
+
const si = Q(null), vn = Pn(si);
|
|
5819
|
+
return (W, $) => (O(), J(ke, null, [
|
|
5820
5820
|
ve(W.$slots, "trigger", _n(wn({
|
|
5821
5821
|
trigger: d
|
|
5822
5822
|
}))),
|
|
@@ -5869,12 +5869,12 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5869
5869
|
"onUpdate:catalogAndScheduler": f
|
|
5870
5870
|
}, null, 8, ["linked-status"])) : te("", !0),
|
|
5871
5871
|
w(Ze, {
|
|
5872
|
-
toggle:
|
|
5872
|
+
toggle: M.value,
|
|
5873
5873
|
"onUpdate:toggle": [
|
|
5874
|
-
$[1] || ($[1] = (H) =>
|
|
5874
|
+
$[1] || ($[1] = (H) => M.value = H),
|
|
5875
5875
|
$[2] || ($[2] = (H) => R(H))
|
|
5876
5876
|
],
|
|
5877
|
-
disabled: !
|
|
5877
|
+
disabled: !I.value,
|
|
5878
5878
|
description: p(r)("menu.product.form.sections.general.description"),
|
|
5879
5879
|
title: p(r)("menu.product.form.sections.general.title")
|
|
5880
5880
|
}, {
|
|
@@ -5882,8 +5882,8 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5882
5882
|
w(Pa, {
|
|
5883
5883
|
fallback: h.value,
|
|
5884
5884
|
form: m.value,
|
|
5885
|
-
"is-addon":
|
|
5886
|
-
"is-override":
|
|
5885
|
+
"is-addon": k.value,
|
|
5886
|
+
"is-override": I.value,
|
|
5887
5887
|
"is-create": t.action === "add",
|
|
5888
5888
|
thumbnail: z.value,
|
|
5889
5889
|
"onUpdate:form": E,
|
|
@@ -5893,7 +5893,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5893
5893
|
]),
|
|
5894
5894
|
_: 1
|
|
5895
5895
|
}, 8, ["toggle", "disabled", "description", "title"]),
|
|
5896
|
-
|
|
5896
|
+
I.value ? te("", !0) : (O(), J("div", ls)),
|
|
5897
5897
|
y.value ? (O(), Y(Ke, {
|
|
5898
5898
|
key: 2,
|
|
5899
5899
|
title: p(r)("menu.product.form.sections.tagging.title"),
|
|
@@ -5909,15 +5909,15 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5909
5909
|
]),
|
|
5910
5910
|
_: 1
|
|
5911
5911
|
}, 8, ["title", "sub-title"])) : te("", !0),
|
|
5912
|
-
y.value ? (O(),
|
|
5913
|
-
|
|
5912
|
+
y.value ? (O(), J("div", us)) : te("", !0),
|
|
5913
|
+
I.value ? te("", !0) : (O(), J("div", cs)),
|
|
5914
5914
|
w(Ze, {
|
|
5915
5915
|
toggle: A.value,
|
|
5916
5916
|
"onUpdate:toggle": [
|
|
5917
5917
|
$[4] || ($[4] = (H) => A.value = H),
|
|
5918
5918
|
$[5] || ($[5] = (H) => U(H))
|
|
5919
5919
|
],
|
|
5920
|
-
disabled: !
|
|
5920
|
+
disabled: !I.value,
|
|
5921
5921
|
description: p(r)("menu.product.form.sections.price.description"),
|
|
5922
5922
|
title: p(r)("menu.product.form.sections.price.title")
|
|
5923
5923
|
}, {
|
|
@@ -5925,14 +5925,14 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5925
5925
|
w(Pr, {
|
|
5926
5926
|
fallback: h.value,
|
|
5927
5927
|
form: m.value,
|
|
5928
|
-
"is-addon":
|
|
5929
|
-
"is-override":
|
|
5928
|
+
"is-addon": k.value,
|
|
5929
|
+
"is-override": I.value,
|
|
5930
5930
|
"onUpdate:form": E
|
|
5931
5931
|
}, null, 8, ["fallback", "form", "is-addon", "is-override"])
|
|
5932
5932
|
]),
|
|
5933
5933
|
_: 1
|
|
5934
5934
|
}, 8, ["toggle", "disabled", "description", "title"]),
|
|
5935
|
-
s.value.print && !
|
|
5935
|
+
s.value.print && !I.value ? (O(), J("div", ds)) : te("", !0),
|
|
5936
5936
|
s.value.print ? (O(), Y(Ze, {
|
|
5937
5937
|
key: 6,
|
|
5938
5938
|
toggle: T.value,
|
|
@@ -5949,22 +5949,22 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5949
5949
|
fallback: h.value,
|
|
5950
5950
|
form: m.value,
|
|
5951
5951
|
"full-combinations": S.value,
|
|
5952
|
-
"is-addon":
|
|
5953
|
-
"is-override":
|
|
5952
|
+
"is-addon": k.value,
|
|
5953
|
+
"is-override": I.value,
|
|
5954
5954
|
"onUpdate:form": E,
|
|
5955
5955
|
"onReplace:form": $[6] || ($[6] = (H) => m.value = H)
|
|
5956
5956
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
5957
5957
|
]),
|
|
5958
5958
|
_: 1
|
|
5959
5959
|
}, 8, ["toggle"])) : te("", !0),
|
|
5960
|
-
|
|
5960
|
+
I.value ? te("", !0) : (O(), J("div", ms)),
|
|
5961
5961
|
w(Ze, {
|
|
5962
5962
|
toggle: V.value,
|
|
5963
5963
|
"onUpdate:toggle": [
|
|
5964
5964
|
$[10] || ($[10] = (H) => V.value = H),
|
|
5965
5965
|
$[11] || ($[11] = (H) => N(H))
|
|
5966
5966
|
],
|
|
5967
|
-
disabled: !
|
|
5967
|
+
disabled: !I.value,
|
|
5968
5968
|
description: p(r)("menu.product.form.sections.variant.description"),
|
|
5969
5969
|
title: p(r)("menu.product.form.sections.variant.title")
|
|
5970
5970
|
}, {
|
|
@@ -5973,15 +5973,15 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5973
5973
|
fallback: h.value,
|
|
5974
5974
|
form: m.value,
|
|
5975
5975
|
"full-combinations": S.value,
|
|
5976
|
-
"is-addon":
|
|
5977
|
-
"is-override":
|
|
5976
|
+
"is-addon": k.value,
|
|
5977
|
+
"is-override": I.value,
|
|
5978
5978
|
"onUpdate:form": E,
|
|
5979
5979
|
"onReplace:form": $[9] || ($[9] = (H) => m.value = H)
|
|
5980
5980
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
5981
5981
|
]),
|
|
5982
5982
|
_: 1
|
|
5983
5983
|
}, 8, ["toggle", "disabled", "description", "title"]),
|
|
5984
|
-
s.value.group && !
|
|
5984
|
+
s.value.group && !I.value ? (O(), J("div", hs)) : te("", !0),
|
|
5985
5985
|
s.value.group ? (O(), Y(Ze, {
|
|
5986
5986
|
key: 9,
|
|
5987
5987
|
toggle: Z.value,
|
|
@@ -5989,7 +5989,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5989
5989
|
$[13] || ($[13] = (H) => Z.value = H),
|
|
5990
5990
|
$[14] || ($[14] = (H) => ee(H))
|
|
5991
5991
|
],
|
|
5992
|
-
disabled: !
|
|
5992
|
+
disabled: !I.value,
|
|
5993
5993
|
description: "Use a different group setting",
|
|
5994
5994
|
title: "Update group"
|
|
5995
5995
|
}, {
|
|
@@ -5998,15 +5998,15 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5998
5998
|
fallback: h.value,
|
|
5999
5999
|
form: m.value,
|
|
6000
6000
|
"full-combinations": S.value,
|
|
6001
|
-
"is-addon":
|
|
6002
|
-
"is-override":
|
|
6001
|
+
"is-addon": k.value,
|
|
6002
|
+
"is-override": I.value,
|
|
6003
6003
|
"onUpdate:form": E,
|
|
6004
6004
|
"onReplace:form": $[12] || ($[12] = (H) => m.value = H)
|
|
6005
6005
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
6006
6006
|
]),
|
|
6007
6007
|
_: 1
|
|
6008
6008
|
}, 8, ["toggle", "disabled"])) : te("", !0),
|
|
6009
|
-
s.value.inventory && !
|
|
6009
|
+
s.value.inventory && !I.value ? (O(), J("div", ps)) : te("", !0),
|
|
6010
6010
|
s.value.inventory ? (O(), Y(Ze, {
|
|
6011
6011
|
key: 11,
|
|
6012
6012
|
toggle: q.value,
|
|
@@ -6014,7 +6014,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
6014
6014
|
$[16] || ($[16] = (H) => q.value = H),
|
|
6015
6015
|
$[17] || ($[17] = (H) => re(H))
|
|
6016
6016
|
],
|
|
6017
|
-
disabled: !
|
|
6017
|
+
disabled: !I.value,
|
|
6018
6018
|
description: p(r)("menu.product.form.sections.inventory.description"),
|
|
6019
6019
|
title: p(r)("menu.product.form.sections.inventory.title")
|
|
6020
6020
|
}, {
|
|
@@ -6023,23 +6023,23 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
6023
6023
|
fallback: h.value,
|
|
6024
6024
|
form: m.value,
|
|
6025
6025
|
"full-combinations": S.value,
|
|
6026
|
-
"is-addon":
|
|
6027
|
-
"is-override":
|
|
6026
|
+
"is-addon": k.value,
|
|
6027
|
+
"is-override": I.value,
|
|
6028
6028
|
"onUpdate:form": E,
|
|
6029
6029
|
"onReplace:form": $[15] || ($[15] = (H) => m.value = H)
|
|
6030
6030
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
6031
6031
|
]),
|
|
6032
6032
|
_: 1
|
|
6033
6033
|
}, 8, ["toggle", "disabled", "description", "title"])) : te("", !0),
|
|
6034
|
-
s.value.takeaway(m.value.category ?? ((se = h.value) == null ? void 0 : se.category)) && !
|
|
6034
|
+
s.value.takeaway(m.value.category ?? ((se = h.value) == null ? void 0 : se.category)) && !I.value ? (O(), J("div", fs)) : te("", !0),
|
|
6035
6035
|
s.value.takeaway(m.value.category ?? ((ce = h.value) == null ? void 0 : ce.category)) ? (O(), Y(Ze, {
|
|
6036
6036
|
key: 13,
|
|
6037
6037
|
toggle: Ce.value,
|
|
6038
6038
|
"onUpdate:toggle": [
|
|
6039
6039
|
$[19] || ($[19] = (H) => Ce.value = H),
|
|
6040
|
-
$[20] || ($[20] = (H) =>
|
|
6040
|
+
$[20] || ($[20] = (H) => D(H))
|
|
6041
6041
|
],
|
|
6042
|
-
disabled: !
|
|
6042
|
+
disabled: !I.value,
|
|
6043
6043
|
description: p(r)("menu.product.form.sections.takeaway.description"),
|
|
6044
6044
|
title: p(r)("menu.product.form.sections.takeaway.title")
|
|
6045
6045
|
}, {
|
|
@@ -6048,8 +6048,8 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
6048
6048
|
fallback: h.value,
|
|
6049
6049
|
form: m.value,
|
|
6050
6050
|
"full-combinations": S.value,
|
|
6051
|
-
"is-addon":
|
|
6052
|
-
"is-override":
|
|
6051
|
+
"is-addon": k.value,
|
|
6052
|
+
"is-override": I.value,
|
|
6053
6053
|
"onUpdate:form": E,
|
|
6054
6054
|
"onReplace:form": $[18] || ($[18] = (H) => m.value = H)
|
|
6055
6055
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
@@ -6111,24 +6111,24 @@ function gn(e, i) {
|
|
|
6111
6111
|
return { ...i, groups: a(i.groups || []) };
|
|
6112
6112
|
}
|
|
6113
6113
|
const ri = Pi("item-manager", () => {
|
|
6114
|
-
const e = fe(), i =
|
|
6114
|
+
const e = fe(), i = Ie(), t = Be(), n = He(i), a = Xe(n), o = Cn(), { t: r } = me(), l = (x) => {
|
|
6115
6115
|
if (!o) throw new Error("No current instance found");
|
|
6116
|
-
const { container:
|
|
6116
|
+
const { container: M } = In(vs, o, {
|
|
6117
6117
|
...x,
|
|
6118
6118
|
autoShow: !0,
|
|
6119
6119
|
"onUpdate:show": async (R) => {
|
|
6120
|
-
R || (An(null,
|
|
6120
|
+
R || (An(null, M), M.remove());
|
|
6121
6121
|
}
|
|
6122
6122
|
});
|
|
6123
6123
|
};
|
|
6124
6124
|
function s(x) {
|
|
6125
6125
|
var _;
|
|
6126
|
-
const
|
|
6127
|
-
return delete
|
|
6126
|
+
const M = ne(x), R = (_ = M.variant) == null ? void 0 : _.variantCombinations;
|
|
6127
|
+
return delete M.variant, delete M.thumbnail, [M, ...R || []];
|
|
6128
6128
|
}
|
|
6129
|
-
function u(x,
|
|
6130
|
-
const A = ne(
|
|
6131
|
-
function
|
|
6129
|
+
function u(x, M, R, _) {
|
|
6130
|
+
const A = ne(M), U = R ? A.modules.catalog.find((T) => T._id === R) : null, V = _ ? A.modules.scheduler.find((T) => T._id === _) : null, N = U ? ne(U) : void 0, q = R ? A.modules.catalog.filter((T) => T._id !== R) : [], re = V ? ne(V) : void 0, Ce = x.reduce((T, K) => (T[K._id] = s(K), T), {});
|
|
6131
|
+
function D(T = []) {
|
|
6132
6132
|
const K = x.map((Z) => Z._id);
|
|
6133
6133
|
return [
|
|
6134
6134
|
...T.filter((Z) => !K.includes(Z._id)),
|
|
@@ -6140,7 +6140,7 @@ const ri = Pi("item-manager", () => {
|
|
|
6140
6140
|
[_]: {
|
|
6141
6141
|
...N.override.scheduler[_],
|
|
6142
6142
|
_id: _,
|
|
6143
|
-
items:
|
|
6143
|
+
items: D(re == null ? void 0 : re.items).map((T) => ({
|
|
6144
6144
|
...T,
|
|
6145
6145
|
orderFrom: B.F_ORDER_FROM.enum.ALL
|
|
6146
6146
|
}))
|
|
@@ -6148,7 +6148,7 @@ const ri = Pi("item-manager", () => {
|
|
|
6148
6148
|
}, A.modules.catalog = [...q, N], A) : N ? (N.override.items = {
|
|
6149
6149
|
...N.override.items,
|
|
6150
6150
|
...Ce
|
|
6151
|
-
}, A.modules.catalog = [...q, N], A) : re ? (re.items =
|
|
6151
|
+
}, A.modules.catalog = [...q, N], A) : re ? (re.items = D(re.items), A.modules.scheduler = [
|
|
6152
6152
|
...A.modules.scheduler.filter((T) => T._id !== _),
|
|
6153
6153
|
re
|
|
6154
6154
|
], A) : {
|
|
@@ -6164,31 +6164,31 @@ const ri = Pi("item-manager", () => {
|
|
|
6164
6164
|
};
|
|
6165
6165
|
}
|
|
6166
6166
|
function c(x) {
|
|
6167
|
-
const { saveMenuWithThumbnail:
|
|
6167
|
+
const { saveMenuWithThumbnail: M } = a;
|
|
6168
6168
|
l({
|
|
6169
6169
|
action: "add",
|
|
6170
6170
|
categoryId: x,
|
|
6171
6171
|
"onSubmit:form": async (R, _) => {
|
|
6172
6172
|
R.inventoryBindings ?? (R.inventoryBindings = []), R.inventoryBindings.length === 0 && (R.inventoryBindings = null);
|
|
6173
6173
|
const A = yi();
|
|
6174
|
-
await
|
|
6174
|
+
await M(R, pe.F_OPERATION_TYPE.create, A, _);
|
|
6175
6175
|
}
|
|
6176
6176
|
});
|
|
6177
6177
|
}
|
|
6178
|
-
function d(x,
|
|
6178
|
+
function d(x, M) {
|
|
6179
6179
|
var _;
|
|
6180
6180
|
return {
|
|
6181
|
-
...
|
|
6181
|
+
...M.find((A) => !A.combinationKey),
|
|
6182
6182
|
variant: {
|
|
6183
6183
|
...x.variant,
|
|
6184
|
-
variantCombinations: (_ = x.variant) == null ? void 0 : _.variantCombinations.map((A) =>
|
|
6184
|
+
variantCombinations: (_ = x.variant) == null ? void 0 : _.variantCombinations.map((A) => M.find((V) => V.combinationKey === A.combinationKey) || { _id: x._id, combinationKey: A.combinationKey })
|
|
6185
6185
|
},
|
|
6186
6186
|
_id: x._id
|
|
6187
6187
|
};
|
|
6188
6188
|
}
|
|
6189
|
-
async function h(x,
|
|
6189
|
+
async function h(x, M, R) {
|
|
6190
6190
|
l({
|
|
6191
|
-
initialForm: d(x,
|
|
6191
|
+
initialForm: d(x, M || []),
|
|
6192
6192
|
action: "update",
|
|
6193
6193
|
"onSubmit:form": async (_) => {
|
|
6194
6194
|
_.inventoryBindings ?? (_.inventoryBindings = []), _.inventoryBindings.length === 0 && (_.inventoryBindings = null), await R(
|
|
@@ -6204,55 +6204,55 @@ const ri = Pi("item-manager", () => {
|
|
|
6204
6204
|
}
|
|
6205
6205
|
async function m(x) {
|
|
6206
6206
|
var U;
|
|
6207
|
-
const
|
|
6207
|
+
const M = e.currentCatalog, R = e.state.currentSchedulerId, _ = M.override.scheduler[R] ?? {
|
|
6208
6208
|
_id: R
|
|
6209
6209
|
}, A = (U = _ == null ? void 0 : _.items) == null ? void 0 : U.filter((V) => V._id === x._id);
|
|
6210
6210
|
await h(x, A, async (V) => {
|
|
6211
6211
|
const N = V.modules.catalog.find(
|
|
6212
|
-
(q) => q._id ===
|
|
6212
|
+
(q) => q._id === M._id
|
|
6213
6213
|
);
|
|
6214
6214
|
await new Ue(N, e, a.updateMenu, t).update();
|
|
6215
6215
|
});
|
|
6216
6216
|
}
|
|
6217
6217
|
async function b(x) {
|
|
6218
|
-
const
|
|
6219
|
-
await h(x,
|
|
6218
|
+
const M = e.currentCatalog;
|
|
6219
|
+
await h(x, M.override.items[x._id], async (R) => {
|
|
6220
6220
|
const _ = R.modules.catalog.find(
|
|
6221
|
-
(A) => A._id ===
|
|
6221
|
+
(A) => A._id === M._id
|
|
6222
6222
|
);
|
|
6223
6223
|
await new Ue(_, e, a.updateMenu, t).update();
|
|
6224
6224
|
});
|
|
6225
6225
|
}
|
|
6226
6226
|
async function v(x) {
|
|
6227
|
-
const
|
|
6227
|
+
const M = e.schedulers.find(
|
|
6228
6228
|
(_) => _._id === e.state.currentSchedulerId
|
|
6229
|
-
), R =
|
|
6229
|
+
), R = M.items.filter((_) => _._id === x._id);
|
|
6230
6230
|
await h(x, R, async (_) => {
|
|
6231
6231
|
const A = _.modules.scheduler.find(
|
|
6232
|
-
(U) => U._id ===
|
|
6232
|
+
(U) => U._id === M._id
|
|
6233
6233
|
);
|
|
6234
6234
|
await new _t(A, e, a.updateMenu, t).update();
|
|
6235
6235
|
});
|
|
6236
6236
|
}
|
|
6237
6237
|
async function f(x) {
|
|
6238
6238
|
var A, U;
|
|
6239
|
-
const
|
|
6239
|
+
const M = e.state.currentSchedulerId, R = ne(e.currentCatalog), _ = (U = ((A = R.override.scheduler[M]) == null ? void 0 : A.items) || []) == null ? void 0 : U.reduce((V, N) => {
|
|
6240
6240
|
if (N.combinationKey) return [...V, N];
|
|
6241
6241
|
const q = x.find((re) => re._id === N._id);
|
|
6242
6242
|
return q ? [...V, { ...N, price: q.price }] : [...V, N];
|
|
6243
6243
|
}, []);
|
|
6244
6244
|
R.override.scheduler = {
|
|
6245
6245
|
...R.override.scheduler,
|
|
6246
|
-
[
|
|
6247
|
-
...R.override.scheduler[
|
|
6248
|
-
_id:
|
|
6246
|
+
[M]: {
|
|
6247
|
+
...R.override.scheduler[M],
|
|
6248
|
+
_id: M,
|
|
6249
6249
|
items: _
|
|
6250
6250
|
}
|
|
6251
6251
|
}, await new Ue(R, e, a.updateMenu, t).update();
|
|
6252
6252
|
}
|
|
6253
6253
|
async function S(x) {
|
|
6254
6254
|
var A;
|
|
6255
|
-
const
|
|
6255
|
+
const M = ne(e.currentCatalog), R = (A = Object.entries(M.override.items)) == null ? void 0 : A.reduce(
|
|
6256
6256
|
(U, [V, N]) => {
|
|
6257
6257
|
const q = x.find((Ce) => Ce._id === V);
|
|
6258
6258
|
if (!q)
|
|
@@ -6273,9 +6273,9 @@ const ri = Pi("item-manager", () => {
|
|
|
6273
6273
|
), { updateMenu: _ } = a;
|
|
6274
6274
|
await new Ue(
|
|
6275
6275
|
{
|
|
6276
|
-
...
|
|
6276
|
+
...M,
|
|
6277
6277
|
override: {
|
|
6278
|
-
...
|
|
6278
|
+
...M.override,
|
|
6279
6279
|
items: R
|
|
6280
6280
|
}
|
|
6281
6281
|
},
|
|
@@ -6285,14 +6285,14 @@ const ri = Pi("item-manager", () => {
|
|
|
6285
6285
|
).update();
|
|
6286
6286
|
}
|
|
6287
6287
|
async function z(x) {
|
|
6288
|
-
const
|
|
6288
|
+
const M = ne(e.currentScheduler), R = M.items.reduce((_, A) => {
|
|
6289
6289
|
if (A.combinationKey) return [..._, A];
|
|
6290
6290
|
const U = x.find((V) => V._id === A._id);
|
|
6291
6291
|
return U ? [..._, { ...A, price: U.price }] : [..._, A];
|
|
6292
6292
|
}, []);
|
|
6293
6293
|
await new _t(
|
|
6294
6294
|
{
|
|
6295
|
-
...
|
|
6295
|
+
...M,
|
|
6296
6296
|
items: R
|
|
6297
6297
|
},
|
|
6298
6298
|
e,
|
|
@@ -6301,7 +6301,7 @@ const ri = Pi("item-manager", () => {
|
|
|
6301
6301
|
).update();
|
|
6302
6302
|
}
|
|
6303
6303
|
async function E(x) {
|
|
6304
|
-
const
|
|
6304
|
+
const M = x.reduce((_, A) => {
|
|
6305
6305
|
const U = e.items.find((V) => V._id === A._id);
|
|
6306
6306
|
return U && _.push({
|
|
6307
6307
|
...U,
|
|
@@ -6314,37 +6314,37 @@ const ri = Pi("item-manager", () => {
|
|
|
6314
6314
|
}), _;
|
|
6315
6315
|
}, []), { updateMenu: R } = a;
|
|
6316
6316
|
await R(
|
|
6317
|
-
|
|
6317
|
+
M.map((_) => ({
|
|
6318
6318
|
module: B.F_MENU_MODULE_V4_KEY.enum.item,
|
|
6319
6319
|
operation: pe.F_OPERATION_TYPE.update,
|
|
6320
6320
|
data: _
|
|
6321
6321
|
})),
|
|
6322
|
-
`${
|
|
6322
|
+
`${M.length} products`
|
|
6323
6323
|
);
|
|
6324
6324
|
}
|
|
6325
6325
|
function j(x) {
|
|
6326
|
-
const { saveMenuWithThumbnail:
|
|
6326
|
+
const { saveMenuWithThumbnail: M } = a;
|
|
6327
6327
|
l({
|
|
6328
6328
|
initialForm: x,
|
|
6329
6329
|
action: "update",
|
|
6330
6330
|
"onSubmit:form": async (R, _) => {
|
|
6331
6331
|
const A = yi(x._id);
|
|
6332
|
-
R.inventoryBindings ?? (R.inventoryBindings = []), R.inventoryBindings.length === 0 && (R.inventoryBindings = null), await
|
|
6332
|
+
R.inventoryBindings ?? (R.inventoryBindings = []), R.inventoryBindings.length === 0 && (R.inventoryBindings = null), await M(R, pe.F_OPERATION_TYPE.update, A, _);
|
|
6333
6333
|
}
|
|
6334
6334
|
});
|
|
6335
6335
|
}
|
|
6336
|
-
async function
|
|
6337
|
-
const
|
|
6338
|
-
e.currentCatalog ? e.state.currentSchedulerId ? await m(
|
|
6336
|
+
async function I(x) {
|
|
6337
|
+
const M = e.state.menu.modules.item.find((R) => R._id === x);
|
|
6338
|
+
e.currentCatalog ? e.state.currentSchedulerId ? await m(M) : await b(M) : e.state.currentSchedulerId ? await v(M) : j(M);
|
|
6339
6339
|
}
|
|
6340
|
-
async function
|
|
6340
|
+
async function k(x) {
|
|
6341
6341
|
e.currentCatalog ? e.currentScheduler ? await f(x) : await S(x) : (
|
|
6342
6342
|
// If Main
|
|
6343
6343
|
e.currentScheduler ? await z(x) : await E(x)
|
|
6344
6344
|
);
|
|
6345
6345
|
}
|
|
6346
6346
|
function y(x) {
|
|
6347
|
-
const { updateMenu:
|
|
6347
|
+
const { updateMenu: M } = a, R = x.length > 1 ? `${x.length} products` : x[0].name;
|
|
6348
6348
|
t.open({
|
|
6349
6349
|
title: r("menu.common.dialog.remove.product.title"),
|
|
6350
6350
|
message: r("menu.common.dialog.remove.product.message", { name: R }),
|
|
@@ -6358,7 +6358,7 @@ const ri = Pi("item-manager", () => {
|
|
|
6358
6358
|
close: !0
|
|
6359
6359
|
}
|
|
6360
6360
|
}).onPrimary(async () => {
|
|
6361
|
-
await
|
|
6361
|
+
await M(
|
|
6362
6362
|
x.map(({ _id: _ }) => ({
|
|
6363
6363
|
module: B.F_MENU_MODULE_V4_KEY.enum.item,
|
|
6364
6364
|
operation: pe.F_OPERATION_TYPE.delete,
|
|
@@ -6381,16 +6381,16 @@ const ri = Pi("item-manager", () => {
|
|
|
6381
6381
|
e,
|
|
6382
6382
|
a.updateMenu,
|
|
6383
6383
|
t
|
|
6384
|
-
).unlinkProduct(x.map((
|
|
6384
|
+
).unlinkProduct(x.map((M) => M._id)) : e.currentCatalog ? await new Ue(
|
|
6385
6385
|
e.currentCatalog,
|
|
6386
6386
|
e,
|
|
6387
6387
|
a.updateMenu,
|
|
6388
6388
|
t
|
|
6389
|
-
).unlinkProduct(x.map((
|
|
6389
|
+
).unlinkProduct(x.map((M) => M._id)) : y(x);
|
|
6390
6390
|
}
|
|
6391
6391
|
async function C(x) {
|
|
6392
|
-
const { updateMenu:
|
|
6393
|
-
await
|
|
6392
|
+
const { updateMenu: M } = a;
|
|
6393
|
+
await M(
|
|
6394
6394
|
{
|
|
6395
6395
|
module: B.F_MENU_MODULE_V4_KEY.enum.item,
|
|
6396
6396
|
operation: pe.F_OPERATION_TYPE.rearrange,
|
|
@@ -6402,14 +6402,14 @@ const ri = Pi("item-manager", () => {
|
|
|
6402
6402
|
return {
|
|
6403
6403
|
initDynamicGroupItem: (x) => gn(e, x),
|
|
6404
6404
|
create: c,
|
|
6405
|
-
update:
|
|
6406
|
-
updateMany:
|
|
6405
|
+
update: I,
|
|
6406
|
+
updateMany: k,
|
|
6407
6407
|
deleteItem: g,
|
|
6408
6408
|
rearrange: C
|
|
6409
6409
|
};
|
|
6410
6410
|
});
|
|
6411
6411
|
export {
|
|
6412
|
-
|
|
6412
|
+
Ii as A,
|
|
6413
6413
|
Wi as M,
|
|
6414
6414
|
_t as S,
|
|
6415
6415
|
fn as _,
|