@feedmepos/mf-inventory-portal 1.7.13-dev.2 → 1.7.13-dev.4
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-BSijqKPw.js → App-Cfp4CqzQ.js} +516 -511
- package/dist/{ApprovalView-C9nbCMC5.js → ApprovalView-DO91AQ5f.js} +9 -9
- package/dist/{BindingsDialog-CIlIgcfa.js → BindingsDialog-DUj0z6N7.js} +2 -2
- package/dist/{BindingsPicker-pRUviNe7.js → BindingsPicker-CD2J6-_Z.js} +2 -2
- package/dist/{BindingsTable-BrwSoh9J.js → BindingsTable-B2FEKZXU.js} +4 -4
- package/dist/{BulkReceiveRequestView-Cx5x-Tsa.js → BulkReceiveRequestView-ejHyukEp.js} +19 -19
- package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-CGS3UBUx.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-ashHOuZt.js} +6 -2
- package/dist/{ClosingDraftView-YjlL0i0S.js → ClosingDraftView-tIvrsfYH.js} +19 -19
- package/dist/{ClosingHistoryView--02WNZF2.js → ClosingHistoryView-BYVZ01Ma.js} +5 -5
- package/dist/{ClosingTemplateView-CTMF1NQQ.js → ClosingTemplateView-C-hL9uPv.js} +16 -16
- package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-DjM2oWgN.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-BffF8S_q.js} +1 -1
- package/dist/{DefaultView-DN6w70no.js → DefaultView-BLbtx0Ho.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-Bfd-NCHT.js → DeliveryOrderPrintPreview-BLQHL7aB.js} +2 -2
- package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-xjupYEKQ.js → EmailDialog.vue_vue_type_script_setup_true_lang-BnTAuutB.js} +23 -23
- package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-C7t5R-0v.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-Mxhn0b6c.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DtrW20bl.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-hrk0cTBX.js} +2 -2
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-ZBU9mXC4.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-hTQmIyaf.js} +2 -2
- package/dist/{FmMultiselectDialog-DpKcDzfp.js → FmMultiselectDialog-Bi6XlAAU.js} +2 -2
- package/dist/{FmMultiselectDialog-CxNoYf1n.js → FmMultiselectDialog-Bpi5rI0h.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-Dxae97NF.js → FmUnitInput.vue_vue_type_script_setup_true_lang-e55tnl4u.js} +6 -6
- package/dist/{ImportView-BA8E-oLg.js → ImportView-xPTzBekx.js} +6 -6
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-qBAv155s.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-tvmS42s_.js} +1 -1
- package/dist/{IngredientGroupView-CzgRa52_.js → IngredientGroupView-RFcqjF8T.js} +5 -5
- package/dist/{IngredientsView-Bt8mGeET.js → IngredientsView-CvWOgquN.js} +15 -15
- package/dist/{IntegrationExplorerView-PkF0XpRG.js → IntegrationExplorerView-CYNhsJSS.js} +4 -4
- package/dist/{IntegrationView-BNGiky5f.js → IntegrationView-ZtLokbu3.js} +2699 -2613
- package/dist/{InventoryBindingForm-QCWs73wU.js → InventoryBindingForm-DwiAIf5v.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-Bl0yDKtv.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-njDaQe10.js} +5 -5
- package/dist/{InventoryBindingSummary-miLXnmrc.js → InventoryBindingSummary-zim_Bp5_.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-TNp03i1H.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CfTgt5xW.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-CIOf5H67.js → PremiumBadge.vue_vue_type_script_setup_true_lang-LLtd1VvM.js} +1 -1
- package/dist/{ProductionView-d8f-XTID.js → ProductionView-BWn7RBEg.js} +7 -7
- package/dist/{PublishView-B1B55QOa.js → PublishView-DFXOi7Hx.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-DI54gO3s.js → PurchaseOrderPrintPreview-CG6kBQ26.js} +2 -2
- package/dist/{ReceiveRequestView-C_vB5LOP.js → ReceiveRequestView-DKMVMo7M.js} +14 -14
- package/dist/{RecipeView-BkqVizAz.js → RecipeView-cLLKlLmE.js} +17 -17
- package/dist/{SettingsView-DwGUiWkj.js → SettingsView-Cmf2ZOUL.js} +4 -4
- package/dist/{StockView-Bdd4HjMk.js → StockView-DTai8l8U.js} +21 -21
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-8UDEBJ-p.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BlKm7GLw.js} +1 -1
- package/dist/{SupplierView-Bi9fDNF3.js → SupplierView-CRAHOOLm.js} +12 -12
- package/dist/{SurchargeView-DdI0OLFh.js → SurchargeView-3XymEvcr.js} +6 -6
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-DVJV0dYo.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-DcXfQr_8.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CSEWsTkJ.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-qhJVHahS.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-CAu4NSLh.js → TransferDetails.vue_vue_type_script_setup_true_lang-CibsrZXw.js} +20 -20
- package/dist/{TransferTemplateView-DdOT6hrL.js → TransferTemplateView-ByhvK4Ua.js} +20 -20
- package/dist/{UnitCostHistoryView-E7JBqXP2.js → UnitCostHistoryView-DHHWNJYA.js} +4 -4
- package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-D8gfo1DU.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-bQu2KOI7.js} +4 -4
- package/dist/{UnitView-DFDMkJHv.js → UnitView-BZTS-Ahu.js} +7 -7
- package/dist/{WarehouseView-DBJja1Tw.js → WarehouseView-DVak1RPs.js} +6 -6
- package/dist/{WastageTemplateView-DzaV6Zle.js → WastageTemplateView-CUDL3HUD.js} +14 -14
- package/dist/{app-toEuMoMV.js → app-BUQUpe4c.js} +47 -15
- package/dist/app.d.ts +32 -0
- package/dist/app.js +1 -1
- package/dist/{closing-template-CcJQVWCU.js → closing-template-DzxDiEQB.js} +1 -1
- package/dist/cypress/component/ChangelogPanel.cy.d.ts +1 -0
- package/dist/cypress/support/component.d.ts +1 -2
- package/dist/{date2-rquXXVzp.js → date2-6jkfRNS_.js} +1 -1
- package/dist/{dayjs.min-BwlP8_1N.js → dayjs.min-ByRnXzrl.js} +1 -1
- package/dist/{decimal-CSLOrG_Q.js → decimal-CqWBdj8E.js} +2 -2
- package/dist/{defineDeepModel-BoZKf27y.js → defineDeepModel-CaT-4fiq.js} +1 -1
- package/dist/{duplicate-template-Ckuspndc.js → duplicate-template-Cyvx-WK7.js} +1 -1
- package/dist/{feature-DNIJu3FB.js → feature-FjXz4WXw.js} +2 -2
- package/dist/{format-time-from-id-Cgosa79e.js → format-time-from-id-cSri3OoO.js} +1 -1
- package/dist/{format-unit-display-Bu_Ze_6H.js → format-unit-display-DPbcT7Ff.js} +12 -12
- package/dist/{import-export.helper-DQwb3Iuf.js → import-export.helper-_yqcePYs.js} +6 -6
- package/dist/{index-BCwyc89p.js → index-CGvNoBid.js} +1 -1
- package/dist/{index-B--WhbA5.js → index-CyJVMHQW.js} +1 -1
- package/dist/{index--r4WLeS-.js → index-nSL5yxNn.js} +3 -3
- package/dist/{inventory-core-dart.default-jx8oUale.js → inventory-core-dart.default-DSYRPQNZ.js} +1 -1
- package/dist/{lz-string-DEHsn58W.js → lz-string-iyER1Klb.js} +1 -1
- package/dist/{netsuite-BENLdMp4.js → netsuite-BD8LVxaA.js} +2 -2
- package/dist/{number-DxduvWLO.js → number-C7CJ9ZfE.js} +3 -3
- package/dist/{predefined-templates-DDSXTn0q.js → predefined-templates-o-_pKVSM.js} +1 -1
- package/dist/{purchase-order-template-CsJnK7dz.js → purchase-order-template-BHS8T1VA.js} +1 -1
- package/dist/{recalculationUtils-Cu-LFi-1.js → recalculationUtils-BCByr_CU.js} +1 -1
- package/dist/{rules-DWWS5F7F.js → rules-wZo-8FZ0.js} +2 -2
- package/dist/{stock-DQsyKZ4i.js → stock-CnAjxV7P.js} +3 -3
- package/dist/{stock-tvtgtdga.js → stock-DwqEvWM5.js} +1 -1
- package/dist/{supplier-BB4dTVzb.js → supplier-DkqNwQmi.js} +2 -2
- package/dist/{surcharge-wuD7gkKa.js → surcharge-Csj1WYbH.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{uom-rules-CiW2Gkys.js → uom-rules-BI1CdWeS.js} +1 -1
- package/dist/{use-ingredient-select-dialog-BwdH6XBN.js → use-ingredient-select-dialog-5AqoZJDA.js} +2 -2
- package/dist/{use-inventory-binding-dialog-BZlZRAfK.js → use-inventory-binding-dialog-ChiyhiuP.js} +2 -2
- package/dist/{use-template-enabled-locations-Huf8DHpG.js → use-template-enabled-locations-BqXxegct.js} +2 -2
- package/dist/{use-transfer-locations-CrYrmxdq.js → use-transfer-locations-Ckj_diGt.js} +2 -2
- package/dist/{useHrmPermission-CB8c4mbe.js → useHrmPermission-USG_KRoq.js} +1 -1
- package/dist/{useNavigationMenu-E1ETfzWZ.js → useNavigationMenu-BhYf87KI.js} +2 -2
- package/dist/{useSseClient-ChSORQZV.js → useSseClient-BqoE-ir6.js} +1 -1
- package/dist/views/changelog/components/ChangelogFloatingButton.spec.d.ts +1 -0
- package/dist/views/changelog/composables/fab-position.d.ts +21 -0
- package/dist/{vue-i18n-DmV2_RK_.js → vue-i18n-DoKioQ81.js} +375 -375
- package/dist/{xlsx.util-CjXlUTn_.js → xlsx.util-BXjE2o-3.js} +2 -2
- package/package.json +4 -4
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { _ as
|
|
3
|
-
import { u as
|
|
1
|
+
import { ref as S, onUnmounted as ct, computed as C, defineComponent as ce, watch as q, onMounted as Fe, resolveComponent as H, createElementBlock as c, openBlock as i, createBlock as pe, createCommentVNode as E, unref as $, createVNode as D, createElementVNode as g, toDisplayString as _, Fragment as z, renderList as ne, withKeys as Me, normalizeClass as se, withModifiers as dt, withCtx as te, createTextVNode as re, h as ft, onBeforeUnmount as mt, nextTick as pt, Teleport as vt, normalizeStyle as gt, withDirectives as yt, vModelText as ht } from "vue";
|
|
2
|
+
import { _ as _t } from "./empty-placeholder-B0QU467o.js";
|
|
3
|
+
import { u as je, a as Ke, R as ue, d as xt, S as bt, b as wt } from "./app-BUQUpe4c.js";
|
|
4
4
|
import { useCoreStore as ge, useI18n as he } from "@feedmepos/mf-common";
|
|
5
|
-
import { useRouter as Ee, useRoute as
|
|
6
|
-
import { u as
|
|
7
|
-
import { u as Rt } from "./netsuite-
|
|
8
|
-
import { u as
|
|
9
|
-
import { useBreakpoints as
|
|
10
|
-
import { F as
|
|
11
|
-
import { i as
|
|
12
|
-
import { F as
|
|
13
|
-
import { t as
|
|
14
|
-
import { _ as
|
|
15
|
-
import { u as
|
|
16
|
-
import { u as
|
|
17
|
-
function
|
|
5
|
+
import { useRouter as Ee, useRoute as kt } from "vue-router";
|
|
6
|
+
import { u as St, a as $t, I as Lt } from "./feature-FjXz4WXw.js";
|
|
7
|
+
import { u as Rt } from "./netsuite-BD8LVxaA.js";
|
|
8
|
+
import { u as He } from "./useNavigationMenu-BhYf87KI.js";
|
|
9
|
+
import { useBreakpoints as Ct } from "@feedmepos/ui-library";
|
|
10
|
+
import { F as Pe } from "./FmAdminBadge-DlplQOHb.js";
|
|
11
|
+
import { i as Dt, _ as It } from "./FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-Mxhn0b6c.js";
|
|
12
|
+
import { F as Ft } from "./decimal-CqWBdj8E.js";
|
|
13
|
+
import { t as Et, a as Pt } from "./date2-6jkfRNS_.js";
|
|
14
|
+
import { _ as Nt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
15
|
+
import { u as Tt } from "./useTabStorage-BkIVScW_.js";
|
|
16
|
+
import { u as Vt } from "./googlemap-D9vA7GsS.js";
|
|
17
|
+
function Bt() {
|
|
18
18
|
return {
|
|
19
19
|
loadingHookInstalled: !1,
|
|
20
20
|
isLoading: !1
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
const me =
|
|
24
|
-
function
|
|
25
|
-
const
|
|
23
|
+
const me = S(Bt());
|
|
24
|
+
function Ut() {
|
|
25
|
+
const o = Ee();
|
|
26
26
|
if (!me.value.loadingHookInstalled) {
|
|
27
27
|
me.value.loadingHookInstalled = !0;
|
|
28
|
-
const e =
|
|
28
|
+
const e = o.beforeEach(() => {
|
|
29
29
|
me.value.isLoading = !0;
|
|
30
|
-
}), t =
|
|
30
|
+
}), t = o.afterEach(() => {
|
|
31
31
|
me.value.isLoading = !1;
|
|
32
32
|
});
|
|
33
|
-
|
|
33
|
+
ct(() => {
|
|
34
34
|
me.value.loadingHookInstalled = !1, e(), t();
|
|
35
35
|
});
|
|
36
36
|
}
|
|
@@ -40,23 +40,23 @@ function At() {
|
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
const { firstAccessibleRouteName:
|
|
45
|
-
return { hasAnyAccessibleInventoryRoute:
|
|
43
|
+
function At() {
|
|
44
|
+
const { firstAccessibleRouteName: o } = He();
|
|
45
|
+
return { hasAnyAccessibleInventoryRoute: C(() => o.value !== null) };
|
|
46
46
|
}
|
|
47
|
-
const
|
|
47
|
+
const Mt = {
|
|
48
48
|
key: 0,
|
|
49
49
|
class: "flex flex-col items-center w-full h-full gap-24"
|
|
50
|
-
},
|
|
50
|
+
}, Ot = {
|
|
51
51
|
key: 1,
|
|
52
52
|
class: "flex flex-col pt-[200px] gap-32 items-center"
|
|
53
|
-
},
|
|
53
|
+
}, zt = { class: "flex flex-col gap-12 items-center text-center px-24 max-w-[600px]" }, Gt = { class: "fm-typo-en-title-lg-600" }, jt = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, Kt = {
|
|
54
54
|
key: 2,
|
|
55
55
|
class: "flex flex-col pt-[200px] gap-32 items-center"
|
|
56
|
-
},
|
|
56
|
+
}, Ht = { class: "flex flex-col gap-12 items-center text-center px-24 max-w-[1000px]" }, Jt = { class: "fm-typo-en-title-lg-600" }, Yt = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, Xt = { class: "flex gap-16" }, Wt = { href: "https://feedme.ai/product/inventory/features?tab=plans_%26_prices" }, qt = { href: "https://feedme.ai/form" }, Zt = /* @__PURE__ */ ce({
|
|
57
57
|
__name: "InventoryView",
|
|
58
|
-
setup(
|
|
59
|
-
const e =
|
|
58
|
+
setup(o) {
|
|
59
|
+
const e = je(), t = Ke(), l = Rt(), s = ge(), a = Ee(), u = Ut(), r = St(), { t: v } = he(), { hasAnyAccessibleInventoryRoute: m } = At();
|
|
60
60
|
q(
|
|
61
61
|
[() => s.sessionUser.value, () => s.currentBusiness.value],
|
|
62
62
|
([O, I]) => {
|
|
@@ -68,61 +68,61 @@ const Ot = {
|
|
|
68
68
|
h(O, I);
|
|
69
69
|
});
|
|
70
70
|
function h(O, I) {
|
|
71
|
-
!O || !I ||
|
|
71
|
+
!O || !I || w();
|
|
72
72
|
}
|
|
73
|
-
async function
|
|
73
|
+
async function w() {
|
|
74
74
|
return await e.init(), await l.readSetting().catch((O) => {
|
|
75
75
|
console.error("[all] error on reading netsuite store", O);
|
|
76
76
|
}), await t.init();
|
|
77
77
|
}
|
|
78
|
-
const
|
|
79
|
-
() =>
|
|
80
|
-
var
|
|
78
|
+
const N = C(() => a.currentRoute.value.name === ue.TRANSFER_TEMPLATE ? r.enablePoTemplate : a.currentRoute.value.name === ue.INGREDIENT_GROUP ? r.enableIngredientGroup : !0), U = C(
|
|
79
|
+
() => a.currentRoute.value.matched.some((O) => {
|
|
80
|
+
var R;
|
|
81
81
|
const I = O.meta, Y = I == null ? void 0 : I.validationManifest;
|
|
82
|
-
return (((
|
|
82
|
+
return (((R = Y == null ? void 0 : Y.requiredCaslPermissions) == null ? void 0 : R.length) ?? 0) > 0;
|
|
83
83
|
})
|
|
84
|
-
), oe =
|
|
84
|
+
), oe = C(() => {
|
|
85
85
|
if (!s.sessionUser.value) return !1;
|
|
86
86
|
if (e._locations !== null && e.locations.length === 0) return !0;
|
|
87
87
|
if (!r.isLoaded) return !1;
|
|
88
|
-
const Y =
|
|
88
|
+
const Y = a.currentRoute.value.name === ue.LOADING;
|
|
89
89
|
return !m.value && (Y || U.value);
|
|
90
90
|
});
|
|
91
91
|
return (O, I) => {
|
|
92
|
-
const Y = H("FmSpacer"),
|
|
92
|
+
const Y = H("FmSpacer"), R = H("FmCircularProgress"), T = H("FmButton"), G = H("RouterView");
|
|
93
93
|
return i(), c("div", null, [
|
|
94
|
-
|
|
94
|
+
$(u).isLoading ? (i(), c("div", Mt, [
|
|
95
95
|
D(Y),
|
|
96
96
|
g("div", null, [
|
|
97
|
-
D(
|
|
97
|
+
D(R, { size: "xl" })
|
|
98
98
|
]),
|
|
99
99
|
I[0] || (I[0] = g("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading page...", -1)),
|
|
100
100
|
D(Y)
|
|
101
|
-
])) : oe.value ? (i(), c("div",
|
|
101
|
+
])) : oe.value ? (i(), c("div", Ot, [
|
|
102
102
|
I[1] || (I[1] = g("img", {
|
|
103
|
-
src:
|
|
103
|
+
src: _t,
|
|
104
104
|
alt: "No permission",
|
|
105
105
|
class: "w-[200px] h-[200px]"
|
|
106
106
|
}, null, -1)),
|
|
107
|
-
g("div",
|
|
108
|
-
g("div",
|
|
109
|
-
g("div",
|
|
107
|
+
g("div", zt, [
|
|
108
|
+
g("div", Gt, _($(v)("inventory.common.noPermission.title")), 1),
|
|
109
|
+
g("div", jt, _($(v)("inventory.common.noPermission.description")), 1)
|
|
110
110
|
])
|
|
111
|
-
])) :
|
|
112
|
-
g("div",
|
|
113
|
-
g("div",
|
|
114
|
-
g("div",
|
|
111
|
+
])) : N.value ? $(s).sessionUser.value ? (i(), pe(G, { key: 3 })) : E("", !0) : (i(), c("div", Kt, [
|
|
112
|
+
g("div", Ht, [
|
|
113
|
+
g("div", Jt, _($(v)("inventory.common.proPlan.title")), 1),
|
|
114
|
+
g("div", Yt, _($(v)("inventory.common.proPlan.subtitle")), 1)
|
|
115
115
|
]),
|
|
116
116
|
g("div", Xt, [
|
|
117
|
-
g("a",
|
|
117
|
+
g("a", Wt, [
|
|
118
118
|
D(T, {
|
|
119
|
-
label:
|
|
119
|
+
label: $(v)("inventory.common.proPlan.comparePlans"),
|
|
120
120
|
variant: "secondary"
|
|
121
121
|
}, null, 8, ["label"])
|
|
122
122
|
]),
|
|
123
|
-
g("a",
|
|
123
|
+
g("a", qt, [
|
|
124
124
|
D(T, {
|
|
125
|
-
label:
|
|
125
|
+
label: $(v)("inventory.common.proPlan.callUs"),
|
|
126
126
|
"prepend-icon": "call"
|
|
127
127
|
}, null, 8, ["label"])
|
|
128
128
|
])
|
|
@@ -131,7 +131,7 @@ const Ot = {
|
|
|
131
131
|
]);
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
|
-
}),
|
|
134
|
+
}), Re = {
|
|
135
135
|
// Template/PO item rows carry no id of their own — the embedded sku's _id is
|
|
136
136
|
// the element identity, and kit names the element from that object's name
|
|
137
137
|
// field, so an item change reads "Items › <sku name> › …" instead of a bare
|
|
@@ -164,19 +164,27 @@ const Ot = {
|
|
|
164
164
|
"customAttributes",
|
|
165
165
|
"default",
|
|
166
166
|
"defaultCost",
|
|
167
|
+
"defaultRemark",
|
|
168
|
+
"disabledMeasurements",
|
|
169
|
+
"groups",
|
|
167
170
|
"inventoryBindings",
|
|
168
171
|
"isInactive",
|
|
172
|
+
"items",
|
|
173
|
+
"locations",
|
|
169
174
|
"low",
|
|
170
175
|
"measurement",
|
|
171
176
|
"measurements",
|
|
172
177
|
"mid",
|
|
173
178
|
"name",
|
|
174
179
|
"operationalGroup",
|
|
180
|
+
"position",
|
|
175
181
|
"precision",
|
|
176
182
|
"priority",
|
|
177
183
|
"recipe",
|
|
184
|
+
"ref",
|
|
178
185
|
"rules",
|
|
179
186
|
"sku",
|
|
187
|
+
"skuId",
|
|
180
188
|
"thresholds",
|
|
181
189
|
"trackingMeasurement",
|
|
182
190
|
"type",
|
|
@@ -185,8 +193,8 @@ const Ot = {
|
|
|
185
193
|
"version"
|
|
186
194
|
]
|
|
187
195
|
}
|
|
188
|
-
},
|
|
189
|
-
...
|
|
196
|
+
}, Ce = {
|
|
197
|
+
...Re,
|
|
190
198
|
array_keys: {
|
|
191
199
|
measurements: "id",
|
|
192
200
|
"unit.measurements": "id",
|
|
@@ -196,21 +204,21 @@ const Ot = {
|
|
|
196
204
|
"contains.alternatives": "_id"
|
|
197
205
|
}
|
|
198
206
|
};
|
|
199
|
-
function
|
|
200
|
-
return
|
|
207
|
+
function Qt(o) {
|
|
208
|
+
return o instanceof bt && o.errorResponse.statusCode === 409;
|
|
201
209
|
}
|
|
202
|
-
const _e =
|
|
210
|
+
const _e = xt((o, e) => ({
|
|
203
211
|
/**
|
|
204
212
|
* Commits for one record. recordId is the changelog docId, `${dbName}/${id}`.
|
|
205
213
|
* The dbName scopes the (access-checked) backend route; only the bare id is
|
|
206
214
|
* sent — the backend rebuilds the docId server-side.
|
|
207
215
|
*/
|
|
208
|
-
async getRecordChangelog(t, l, s,
|
|
216
|
+
async getRecordChangelog(t, l, s, a) {
|
|
209
217
|
const u = t.indexOf("/");
|
|
210
218
|
if (u < 0) return [];
|
|
211
219
|
const r = t.slice(0, u), v = t.slice(u + 1), m = new URLSearchParams({ id: v });
|
|
212
|
-
l != null && m.set("limit", String(l)),
|
|
213
|
-
const h = `${
|
|
220
|
+
l != null && m.set("limit", String(l)), a && m.set("before", a), s && (m.set("explain", "1"), m.set("schema", JSON.stringify(s)));
|
|
221
|
+
const h = `${o.inventoryBackendUrl}/${r}/changelog?${m.toString()}`;
|
|
214
222
|
return await e.get(h);
|
|
215
223
|
},
|
|
216
224
|
/**
|
|
@@ -220,7 +228,7 @@ const _e = bt((a, e) => ({
|
|
|
220
228
|
*/
|
|
221
229
|
async listPurchaseOrders(t, l, s) {
|
|
222
230
|
if (!t) return [];
|
|
223
|
-
const
|
|
231
|
+
const a = new URLSearchParams({ start: l, end: s }), u = `${o.inventoryBackendUrl}/${t}/changelog/purchase-order?${a}`;
|
|
224
232
|
return await e.get(u);
|
|
225
233
|
},
|
|
226
234
|
/**
|
|
@@ -230,7 +238,7 @@ const _e = bt((a, e) => ({
|
|
|
230
238
|
*/
|
|
231
239
|
async listClosingDrafts(t, l, s) {
|
|
232
240
|
if (!t) return [];
|
|
233
|
-
const
|
|
241
|
+
const a = new URLSearchParams({ start: l, end: s }), u = `${o.inventoryBackendUrl}/${t}/changelog/closing-draft?${a}`;
|
|
234
242
|
return await e.get(u);
|
|
235
243
|
},
|
|
236
244
|
/**
|
|
@@ -240,9 +248,9 @@ const _e = bt((a, e) => ({
|
|
|
240
248
|
* write path — the backend passthrough for kit httpapi's GET /api/state.
|
|
241
249
|
*/
|
|
242
250
|
async getState(t, l, s) {
|
|
243
|
-
const
|
|
244
|
-
s &&
|
|
245
|
-
const u = `${
|
|
251
|
+
const a = new URLSearchParams({ id: l });
|
|
252
|
+
s && a.set("at", s);
|
|
253
|
+
const u = `${o.inventoryBackendUrl}/${t}/changelog/state?${a.toString()}`;
|
|
246
254
|
return await e.get(u);
|
|
247
255
|
},
|
|
248
256
|
/**
|
|
@@ -253,7 +261,7 @@ const _e = bt((a, e) => ({
|
|
|
253
261
|
*/
|
|
254
262
|
async listDomains(t) {
|
|
255
263
|
if (!t) return [];
|
|
256
|
-
const l = `${
|
|
264
|
+
const l = `${o.inventoryBackendUrl}/business_${t}/changelog/domains`;
|
|
257
265
|
return await e.get(l);
|
|
258
266
|
},
|
|
259
267
|
/**
|
|
@@ -263,7 +271,7 @@ const _e = bt((a, e) => ({
|
|
|
263
271
|
*/
|
|
264
272
|
async listDomainRecords(t, l) {
|
|
265
273
|
if (!t) return [];
|
|
266
|
-
const s = `${
|
|
274
|
+
const s = `${o.inventoryBackendUrl}/business_${t}/changelog/domain/${encodeURIComponent(l)}`;
|
|
267
275
|
return await e.get(s);
|
|
268
276
|
},
|
|
269
277
|
/**
|
|
@@ -273,58 +281,58 @@ const _e = bt((a, e) => ({
|
|
|
273
281
|
*/
|
|
274
282
|
async listInventory(t, l) {
|
|
275
283
|
if (!t) return [];
|
|
276
|
-
const s = `${
|
|
284
|
+
const s = `${o.inventoryBackendUrl}/business_${t}/changelog/inventory?module=${l}`;
|
|
277
285
|
return await e.get(s);
|
|
278
286
|
}
|
|
279
287
|
})), Se = 50;
|
|
280
|
-
function
|
|
281
|
-
const
|
|
282
|
-
let s = null,
|
|
288
|
+
function en() {
|
|
289
|
+
const o = _e(), e = S([]), t = S(!1), l = S(!1);
|
|
290
|
+
let s = null, a = 0;
|
|
283
291
|
async function u(v, m, h) {
|
|
284
|
-
const
|
|
292
|
+
const w = ++a;
|
|
285
293
|
if (s = null, l.value = !1, !v) {
|
|
286
294
|
e.value = [];
|
|
287
295
|
return;
|
|
288
296
|
}
|
|
289
297
|
t.value = !0;
|
|
290
298
|
try {
|
|
291
|
-
const
|
|
292
|
-
if (
|
|
293
|
-
e.value = U, m == null && (s = { recordId: v, explain: h }, l.value = U.length ===
|
|
294
|
-
} catch (
|
|
295
|
-
throw
|
|
299
|
+
const N = m ?? Se, U = await o.getRecordChangelog(v, N, h);
|
|
300
|
+
if (w !== a) return;
|
|
301
|
+
e.value = U, m == null && (s = { recordId: v, explain: h }, l.value = U.length === N);
|
|
302
|
+
} catch (N) {
|
|
303
|
+
throw w === a && (e.value = []), N;
|
|
296
304
|
} finally {
|
|
297
|
-
|
|
305
|
+
w === a && (t.value = !1);
|
|
298
306
|
}
|
|
299
307
|
}
|
|
300
308
|
async function r() {
|
|
301
309
|
const v = e.value[e.value.length - 1];
|
|
302
310
|
if (!s || !v || t.value || !l.value) return;
|
|
303
|
-
const m =
|
|
311
|
+
const m = a;
|
|
304
312
|
t.value = !0;
|
|
305
313
|
try {
|
|
306
|
-
const h = await
|
|
307
|
-
if (m !==
|
|
314
|
+
const h = await o.getRecordChangelog(s.recordId, Se, s.explain, v.id);
|
|
315
|
+
if (m !== a) return;
|
|
308
316
|
e.value = [...e.value, ...h], l.value = h.length === Se;
|
|
309
317
|
} finally {
|
|
310
|
-
m ===
|
|
318
|
+
m === a && (t.value = !1);
|
|
311
319
|
}
|
|
312
320
|
}
|
|
313
321
|
return { commits: e, isLoading: t, hasMore: l, load: u, loadMore: r };
|
|
314
322
|
}
|
|
315
|
-
const
|
|
316
|
-
function
|
|
317
|
-
return [...
|
|
323
|
+
const Je = 1e3;
|
|
324
|
+
function tn(o, e) {
|
|
325
|
+
return [...o, ...e].sort((t, l) => l.at.localeCompare(t.at));
|
|
318
326
|
}
|
|
319
|
-
function
|
|
320
|
-
const
|
|
327
|
+
function nn() {
|
|
328
|
+
const o = _e(), e = S([]);
|
|
321
329
|
async function t(l) {
|
|
322
330
|
if (e.value = [], !!l)
|
|
323
331
|
try {
|
|
324
|
-
e.value = await
|
|
332
|
+
e.value = await o.getRecordChangelog(
|
|
325
333
|
l,
|
|
326
|
-
|
|
327
|
-
|
|
334
|
+
Je,
|
|
335
|
+
Ce
|
|
328
336
|
);
|
|
329
337
|
} catch (s) {
|
|
330
338
|
console.error("changelog per-entity load failed", s);
|
|
@@ -332,10 +340,10 @@ function on() {
|
|
|
332
340
|
}
|
|
333
341
|
return { commits: e, load: t };
|
|
334
342
|
}
|
|
335
|
-
function
|
|
336
|
-
if (!
|
|
343
|
+
function Ye(o) {
|
|
344
|
+
if (!o) return null;
|
|
337
345
|
try {
|
|
338
|
-
const e = JSON.parse(
|
|
346
|
+
const e = JSON.parse(o);
|
|
339
347
|
return typeof (e == null ? void 0 : e.changelogLabelKey) == "string" && typeof (e == null ? void 0 : e.verb) == "string" ? {
|
|
340
348
|
labelKey: e.changelogLabelKey,
|
|
341
349
|
verb: e.verb,
|
|
@@ -345,215 +353,215 @@ function We(a) {
|
|
|
345
353
|
return null;
|
|
346
354
|
}
|
|
347
355
|
}
|
|
348
|
-
function Xe(
|
|
349
|
-
return
|
|
356
|
+
function Xe(o) {
|
|
357
|
+
return o.startsWith("inventory.changelog.");
|
|
350
358
|
}
|
|
351
|
-
const
|
|
352
|
-
function De(
|
|
353
|
-
const e =
|
|
354
|
-
return e === -1 ? { raw:
|
|
359
|
+
const We = "";
|
|
360
|
+
function De(o) {
|
|
361
|
+
const e = o.indexOf(We);
|
|
362
|
+
return e === -1 ? { raw: o, human: o } : { raw: o.slice(0, e), human: o.slice(e + 1) };
|
|
355
363
|
}
|
|
356
|
-
const
|
|
364
|
+
const on = [
|
|
357
365
|
"inventory.changelog.label.recipe",
|
|
358
366
|
"inventory.changelog.label.sku",
|
|
359
367
|
"inventory.changelog.label.unit"
|
|
360
|
-
],
|
|
361
|
-
function
|
|
362
|
-
const { human: e } = De(
|
|
368
|
+
], an = [...on, "Recipe", "Ingredient", "Unit"];
|
|
369
|
+
function sn(o) {
|
|
370
|
+
const { human: e } = De(o);
|
|
363
371
|
if (!e) return { type: "Document", name: "", field: [] };
|
|
364
372
|
const t = e.split(" › ");
|
|
365
|
-
return t.length >= 2 &&
|
|
373
|
+
return t.length >= 2 && an.includes(t[0]) ? { type: t[0], name: t[1], field: t.slice(2) } : { type: "Document", name: "", field: t };
|
|
366
374
|
}
|
|
367
375
|
const Oe = 800;
|
|
368
|
-
function
|
|
369
|
-
const l = ze(
|
|
376
|
+
function qe(o, e, t = 2) {
|
|
377
|
+
const l = ze(o), s = ze(e);
|
|
370
378
|
if (!l || !s) return null;
|
|
371
|
-
let
|
|
372
|
-
for (;
|
|
379
|
+
let a = 0;
|
|
380
|
+
for (; a < l.length && a < s.length && l[a] === s[a]; ) a++;
|
|
373
381
|
let u = 0;
|
|
374
|
-
for (; u < l.length -
|
|
382
|
+
for (; u < l.length - a && u < s.length - a && l[l.length - 1 - u] === s[s.length - 1 - u]; )
|
|
375
383
|
u++;
|
|
376
|
-
const r = l.slice(
|
|
384
|
+
const r = l.slice(a, l.length - u), v = s.slice(a, s.length - u);
|
|
377
385
|
if (r.length > Oe || v.length > Oe) return null;
|
|
378
386
|
const m = (h) => ({ type: "same", text: h });
|
|
379
|
-
return
|
|
380
|
-
[...l.slice(0,
|
|
387
|
+
return rn(
|
|
388
|
+
[...l.slice(0, a).map(m), ...ln(r, v), ...l.slice(l.length - u).map(m)],
|
|
381
389
|
t
|
|
382
390
|
);
|
|
383
391
|
}
|
|
384
|
-
function ze(
|
|
392
|
+
function ze(o) {
|
|
385
393
|
try {
|
|
386
|
-
const e = JSON.parse(
|
|
394
|
+
const e = JSON.parse(o);
|
|
387
395
|
return e === null || typeof e != "object" ? null : JSON.stringify(e, null, 2).split(`
|
|
388
396
|
`);
|
|
389
397
|
} catch {
|
|
390
398
|
return null;
|
|
391
399
|
}
|
|
392
400
|
}
|
|
393
|
-
function
|
|
394
|
-
const t =
|
|
401
|
+
function ln(o, e) {
|
|
402
|
+
const t = o.length, l = e.length, s = Array.from({ length: t + 1 }, () => new Uint32Array(l + 1));
|
|
395
403
|
for (let v = t - 1; v >= 0; v--)
|
|
396
404
|
for (let m = l - 1; m >= 0; m--)
|
|
397
|
-
s[v][m] =
|
|
398
|
-
const
|
|
405
|
+
s[v][m] = o[v] === e[m] ? s[v + 1][m + 1] + 1 : Math.max(s[v + 1][m], s[v][m + 1]);
|
|
406
|
+
const a = [];
|
|
399
407
|
let u = 0, r = 0;
|
|
400
408
|
for (; u < t && r < l; )
|
|
401
|
-
|
|
402
|
-
for (; u < t; )
|
|
403
|
-
for (; r < l; )
|
|
404
|
-
return
|
|
409
|
+
o[u] === e[r] ? (a.push({ type: "same", text: o[u] }), u++, r++) : s[u + 1][r] >= s[u][r + 1] ? (a.push({ type: "del", text: o[u] }), u++) : (a.push({ type: "add", text: e[r] }), r++);
|
|
410
|
+
for (; u < t; ) a.push({ type: "del", text: o[u++] });
|
|
411
|
+
for (; r < l; ) a.push({ type: "add", text: e[r++] });
|
|
412
|
+
return a;
|
|
405
413
|
}
|
|
406
|
-
function
|
|
407
|
-
const t =
|
|
408
|
-
|
|
409
|
-
if (
|
|
410
|
-
for (let r = Math.max(0, u - e); r <= Math.min(
|
|
414
|
+
function rn(o, e) {
|
|
415
|
+
const t = o.map(() => !1);
|
|
416
|
+
o.forEach((a, u) => {
|
|
417
|
+
if (a.type !== "same")
|
|
418
|
+
for (let r = Math.max(0, u - e); r <= Math.min(o.length - 1, u + e); r++)
|
|
411
419
|
t[r] = !0;
|
|
412
420
|
});
|
|
413
421
|
const l = [];
|
|
414
422
|
let s = !1;
|
|
415
|
-
return
|
|
416
|
-
t[u] ? (l.push(
|
|
423
|
+
return o.forEach((a, u) => {
|
|
424
|
+
t[u] ? (l.push(a), s = !1) : s || (l.push({ type: "skip", text: "⋯" }), s = !0);
|
|
417
425
|
}), l;
|
|
418
426
|
}
|
|
419
|
-
function
|
|
427
|
+
function un(o, e) {
|
|
420
428
|
let t;
|
|
421
429
|
try {
|
|
422
|
-
t = JSON.parse(
|
|
430
|
+
t = JSON.parse(o);
|
|
423
431
|
} catch {
|
|
424
|
-
return
|
|
432
|
+
return o;
|
|
425
433
|
}
|
|
426
434
|
return t === null ? "—" : typeof t == "number" ? t.toLocaleString() : typeof t == "boolean" ? e(t ? "inventory.changelog.yes" : "inventory.changelog.no") : String(t);
|
|
427
435
|
}
|
|
428
|
-
function Ie(
|
|
436
|
+
function Ie(o, e, t = 0, l) {
|
|
429
437
|
var m;
|
|
430
|
-
const s =
|
|
431
|
-
|
|
438
|
+
const s = o.label == null ? void 0 : Xe(o.label) ? e(o.label) : o.label, a = s != null || o.value != null || o.display != null, u = !((m = o.kids) != null && m.length), r = [];
|
|
439
|
+
a && r.push({
|
|
432
440
|
depth: t,
|
|
433
441
|
// A bare array index says nothing a reader needs — a leaf list entry
|
|
434
442
|
// shows just its value. Branch nodes keep the index as their header.
|
|
435
443
|
label: s != null && u && /^\d+$/.test(s) ? void 0 : s,
|
|
436
|
-
text: u ?
|
|
437
|
-
bookkeeping: !!
|
|
444
|
+
text: u ? cn(o, e, l) : void 0,
|
|
445
|
+
bookkeeping: !!o.bookkeeping
|
|
438
446
|
});
|
|
439
|
-
const v =
|
|
440
|
-
for (const h of
|
|
447
|
+
const v = a ? t + 1 : t;
|
|
448
|
+
for (const h of o.kids ?? [])
|
|
441
449
|
r.push(...Ie(h, e, v, l));
|
|
442
450
|
return r;
|
|
443
451
|
}
|
|
444
|
-
function
|
|
445
|
-
if (
|
|
446
|
-
const l =
|
|
447
|
-
return (t == null ? void 0 : t(l)) ??
|
|
452
|
+
function cn(o, e, t) {
|
|
453
|
+
if (o.value == null) return o.display || void 0;
|
|
454
|
+
const l = un(o.value, e);
|
|
455
|
+
return (t == null ? void 0 : t(l)) ?? o.display ?? l;
|
|
448
456
|
}
|
|
449
|
-
function $e(
|
|
450
|
-
return JSON.stringify(
|
|
457
|
+
function $e(o, e) {
|
|
458
|
+
return JSON.stringify(o, null, 2).split(`
|
|
451
459
|
`).map((t) => ({ type: e, text: t }));
|
|
452
460
|
}
|
|
453
|
-
function
|
|
454
|
-
const
|
|
455
|
-
async function s(
|
|
456
|
-
const u = e.get(
|
|
461
|
+
function dn() {
|
|
462
|
+
const o = _e(), e = /* @__PURE__ */ new Map(), t = S(!1), l = S(null);
|
|
463
|
+
async function s(a) {
|
|
464
|
+
const u = e.get(a.id);
|
|
457
465
|
if (u) {
|
|
458
466
|
l.value = u;
|
|
459
467
|
return;
|
|
460
468
|
}
|
|
461
469
|
t.value = !0;
|
|
462
470
|
try {
|
|
463
|
-
const r =
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
]), U = { diff:
|
|
471
|
+
const r = a.doc_id.indexOf("/"), v = a.doc_id.slice(0, r), m = a.doc_id.slice(r + 1), [h, w] = await Promise.all([
|
|
472
|
+
a.parent ? o.getState(v, m, a.parent) : Promise.resolve({}),
|
|
473
|
+
o.getState(v, m, a.id)
|
|
474
|
+
]), U = { diff: a.parent ? qe(JSON.stringify(h), JSON.stringify(w)) ?? [
|
|
467
475
|
...$e(h, "del"),
|
|
468
|
-
...$e(
|
|
469
|
-
] : $e(
|
|
470
|
-
e.set(
|
|
476
|
+
...$e(w, "add")
|
|
477
|
+
] : $e(w, "add"), conflict: !1 };
|
|
478
|
+
e.set(a.id, U), l.value = U;
|
|
471
479
|
} catch (r) {
|
|
472
|
-
if (!
|
|
480
|
+
if (!Qt(r))
|
|
473
481
|
throw l.value = null, r;
|
|
474
482
|
const v = { diff: null, conflict: !0 };
|
|
475
|
-
e.set(
|
|
483
|
+
e.set(a.id, v), l.value = v;
|
|
476
484
|
} finally {
|
|
477
485
|
t.value = !1;
|
|
478
486
|
}
|
|
479
487
|
}
|
|
480
488
|
return { isLoading: t, result: l, load: s };
|
|
481
489
|
}
|
|
482
|
-
const
|
|
490
|
+
const fn = {
|
|
483
491
|
key: 0,
|
|
484
492
|
class: "flex justify-center p-16"
|
|
485
|
-
},
|
|
493
|
+
}, mn = {
|
|
486
494
|
key: 1,
|
|
487
495
|
class: "p-16 text-center text-gray-500"
|
|
488
|
-
},
|
|
496
|
+
}, pn = {
|
|
489
497
|
key: 2,
|
|
490
498
|
class: "flex h-full min-h-0 gap-8"
|
|
491
|
-
},
|
|
499
|
+
}, vn = { class: "w-1/3 shrink-0 overflow-y-auto border-r border-gray-200 pr-4" }, gn = ["onClick", "onKeydown"], yn = { class: "fm-typo-en-body-md-600" }, hn = { class: "text-xs text-gray-500" }, _n = {
|
|
492
500
|
key: 0,
|
|
493
501
|
class: "flex-1 overflow-y-auto pl-4"
|
|
494
|
-
},
|
|
502
|
+
}, xn = { class: "mb-12 flex flex-col gap-2 border-b border-gray-200 pb-8" }, bn = { class: "flex flex-wrap items-center gap-8" }, wn = { class: "fm-typo-en-body-lg-600" }, kn = {
|
|
495
503
|
key: 0,
|
|
496
504
|
class: "rounded-full bg-gray-100 px-8 text-xs text-gray-500"
|
|
497
|
-
},
|
|
505
|
+
}, Sn = { class: "text-xs text-gray-500" }, $n = { class: "mb-12" }, Ln = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary pl-8" }, Rn = {
|
|
498
506
|
key: 0,
|
|
499
507
|
class: "mb-12"
|
|
500
|
-
},
|
|
508
|
+
}, Cn = {
|
|
501
509
|
key: 1,
|
|
502
510
|
class: "text-sm text-gray-400"
|
|
503
|
-
},
|
|
511
|
+
}, Dn = {
|
|
504
512
|
key: 2,
|
|
505
513
|
class: "w-full overflow-x-auto rounded border border-gray-200 py-4 font-mono text-xs"
|
|
506
|
-
},
|
|
514
|
+
}, In = {
|
|
507
515
|
key: 0,
|
|
508
516
|
class: "text-xs text-gray-400"
|
|
509
|
-
},
|
|
517
|
+
}, Fn = { class: "fm-typo-en-body-md-600" }, En = { class: "flex flex-col gap-6" }, Pn = {
|
|
510
518
|
key: 0,
|
|
511
519
|
class: "text-gray-700"
|
|
512
|
-
},
|
|
520
|
+
}, Nn = { class: "min-w-[120px] shrink-0 text-gray-500" }, Tn = {
|
|
513
521
|
key: 0,
|
|
514
522
|
class: "flex w-full flex-col gap-4"
|
|
515
|
-
},
|
|
523
|
+
}, Vn = {
|
|
516
524
|
key: 0,
|
|
517
525
|
class: "w-full overflow-x-auto rounded border border-gray-200 py-4 font-mono text-xs"
|
|
518
|
-
},
|
|
526
|
+
}, Bn = { key: 0 }, Un = { key: 1 }, An = {
|
|
519
527
|
key: 1,
|
|
520
528
|
class: "w-full overflow-x-auto rounded border border-gray-200 py-4 font-mono text-xs"
|
|
521
|
-
},
|
|
529
|
+
}, Mn = { key: 0 }, On = { key: 1 }, zn = {
|
|
522
530
|
key: 1,
|
|
523
531
|
class: "w-full overflow-x-auto rounded border border-gray-200 py-4 font-mono text-xs"
|
|
524
|
-
},
|
|
532
|
+
}, Gn = {
|
|
525
533
|
key: 2,
|
|
526
534
|
class: "flex w-full flex-wrap items-baseline gap-4"
|
|
527
|
-
},
|
|
535
|
+
}, jn = {
|
|
528
536
|
key: 0,
|
|
529
537
|
class: "rounded bg-red-50 px-4 text-red-700"
|
|
530
|
-
},
|
|
538
|
+
}, Kn = {
|
|
531
539
|
key: 1,
|
|
532
540
|
class: "text-gray-400"
|
|
533
|
-
},
|
|
541
|
+
}, Hn = {
|
|
534
542
|
key: 2,
|
|
535
543
|
class: "rounded bg-green-50 px-4 text-green-700"
|
|
536
|
-
},
|
|
544
|
+
}, Jn = {
|
|
537
545
|
key: 1,
|
|
538
546
|
class: "text-sm text-gray-500"
|
|
539
|
-
},
|
|
547
|
+
}, Yn = {
|
|
540
548
|
key: 2,
|
|
541
549
|
class: "mt-16 break-all border-t border-gray-200 pt-8 font-mono text-xs text-gray-400"
|
|
542
|
-
}, Xn = { key: 0 },
|
|
550
|
+
}, Xn = { key: 0 }, Wn = "capture baseline", qn = /* @__PURE__ */ ce({
|
|
543
551
|
__name: "ChangelogPanel",
|
|
544
552
|
props: {
|
|
545
553
|
commits: {},
|
|
546
554
|
isLoading: { type: Boolean },
|
|
547
555
|
resolveName: { type: Function }
|
|
548
556
|
},
|
|
549
|
-
setup(
|
|
550
|
-
const e =
|
|
557
|
+
setup(o) {
|
|
558
|
+
const e = o, { t } = he(), l = S(null), s = C(
|
|
551
559
|
() => e.commits.find((p) => p.id === l.value)
|
|
552
|
-
),
|
|
560
|
+
), a = /* @__PURE__ */ new Set(["updatedAt", "createdAt", "updatedBy", "createdBy", "_rev"]), u = C(() => {
|
|
553
561
|
var b;
|
|
554
562
|
return (((b = s.value) == null ? void 0 : b.changes) ?? []).filter((B) => {
|
|
555
563
|
const { raw: V } = De(B.path);
|
|
556
|
-
return V === "@payload" || B.from == null && B.to == null ? !1 : !V.split(".").some((
|
|
564
|
+
return V === "@payload" || B.from == null && B.to == null ? !1 : !V.split(".").some((X) => a.has(X));
|
|
557
565
|
});
|
|
558
566
|
});
|
|
559
567
|
q(
|
|
@@ -564,16 +572,16 @@ const mn = {
|
|
|
564
572
|
},
|
|
565
573
|
{ immediate: !0 }
|
|
566
574
|
);
|
|
567
|
-
const r =
|
|
575
|
+
const r = S(!1), { isLoading: v, result: m, load: h } = dn();
|
|
568
576
|
q([r, s], ([p, b]) => {
|
|
569
577
|
m.value = null, !(!p || !b) && h(b).catch((B) => {
|
|
570
578
|
console.error("changelog snapshot load failed", B), r.value = !1;
|
|
571
579
|
});
|
|
572
580
|
});
|
|
573
|
-
function
|
|
581
|
+
function w(p) {
|
|
574
582
|
return p ? p.slice(0, 8) : "";
|
|
575
583
|
}
|
|
576
|
-
function
|
|
584
|
+
function N(p) {
|
|
577
585
|
return p ? new Date(p).toLocaleString() : "";
|
|
578
586
|
}
|
|
579
587
|
function U(p) {
|
|
@@ -590,8 +598,8 @@ const mn = {
|
|
|
590
598
|
return (p.authors || []).join(", ") || t("inventory.changelog.unknownActor");
|
|
591
599
|
}
|
|
592
600
|
function O(p) {
|
|
593
|
-
if (p.message ===
|
|
594
|
-
const b =
|
|
601
|
+
if (p.message === Wn) return t("inventory.changelog.captureBaseline");
|
|
602
|
+
const b = Ye(p.message);
|
|
595
603
|
if (!b) return p.message || t("inventory.changelog.noMessage");
|
|
596
604
|
const B = I(b.labelKey);
|
|
597
605
|
return b.name ? t(`inventory.changelog.message.${b.verb}`, { module: B, name: b.name }) : t(`inventory.changelog.message.${b.verb}NoName`, { module: B });
|
|
@@ -600,8 +608,8 @@ const mn = {
|
|
|
600
608
|
return Xe(p) ? t(p) : p;
|
|
601
609
|
}
|
|
602
610
|
const Y = (p) => /[^a-zA-Z]/.test(p);
|
|
603
|
-
function
|
|
604
|
-
return p == null || b == null ? null :
|
|
611
|
+
function R(p, b) {
|
|
612
|
+
return p == null || b == null ? null : qe(p, b);
|
|
605
613
|
}
|
|
606
614
|
function T(p) {
|
|
607
615
|
if (!(!p.to_value && !p.from_value))
|
|
@@ -616,12 +624,12 @@ const mn = {
|
|
|
616
624
|
function j(p) {
|
|
617
625
|
return p.type === "skip" ? p.text : (p.type === "add" ? "+ " : p.type === "del" ? "- " : " ") + p.text;
|
|
618
626
|
}
|
|
619
|
-
const Q =
|
|
627
|
+
const Q = C(() => {
|
|
620
628
|
const p = /* @__PURE__ */ new Map(), b = [], B = (y, f) => {
|
|
621
629
|
let F = p.get(y);
|
|
622
630
|
return F || (F = f(), p.set(y, F), b.push(F)), F;
|
|
623
|
-
}, V = () => B("@doc", () => ({ header: "", lines: [] })),
|
|
624
|
-
var
|
|
631
|
+
}, V = () => B("@doc", () => ({ header: "", lines: [] })), X = (y, f) => {
|
|
632
|
+
var P;
|
|
625
633
|
if (y == null) return f;
|
|
626
634
|
let F;
|
|
627
635
|
try {
|
|
@@ -629,19 +637,19 @@ const mn = {
|
|
|
629
637
|
} catch {
|
|
630
638
|
F = y;
|
|
631
639
|
}
|
|
632
|
-
return (typeof F == "string" ? (
|
|
640
|
+
return (typeof F == "string" ? (P = e.resolveName) == null ? void 0 : P.call(e, F) : void 0) ?? f;
|
|
633
641
|
}, K = (y, f, F) => {
|
|
634
|
-
var
|
|
642
|
+
var P, J, Z, ee;
|
|
635
643
|
const x = T(f);
|
|
636
644
|
x ? y.lines.push({ label: F, ...x }) : f.from != null && f.to != null ? y.lines.push({
|
|
637
645
|
label: F,
|
|
638
646
|
from: f.from,
|
|
639
647
|
to: f.to,
|
|
640
|
-
diff:
|
|
641
|
-
fromDisplay:
|
|
642
|
-
toDisplay:
|
|
643
|
-
}) : f.to != null ? y.lines.push({ label: F, to: f.to, toDisplay:
|
|
644
|
-
},
|
|
648
|
+
diff: R(f.from, f.to),
|
|
649
|
+
fromDisplay: X(f.from, (P = f.display) == null ? void 0 : P.from),
|
|
650
|
+
toDisplay: X(f.to, (J = f.display) == null ? void 0 : J.to)
|
|
651
|
+
}) : f.to != null ? y.lines.push({ label: F, to: f.to, toDisplay: X(f.to, (Z = f.display) == null ? void 0 : Z.to) }) : y.lines.push({ label: F, from: f.from, fromDisplay: X(f.from, (ee = f.display) == null ? void 0 : ee.from) });
|
|
652
|
+
}, L = (y) => {
|
|
645
653
|
var F;
|
|
646
654
|
const f = y.element;
|
|
647
655
|
if (f) {
|
|
@@ -654,8 +662,8 @@ const mn = {
|
|
|
654
662
|
K(x, y, y.field.map(I).join(" › "));
|
|
655
663
|
else {
|
|
656
664
|
x.badge = y.to != null ? "added" : "removed";
|
|
657
|
-
const
|
|
658
|
-
|
|
665
|
+
const P = T(y);
|
|
666
|
+
P && x.lines.push(P);
|
|
659
667
|
}
|
|
660
668
|
return;
|
|
661
669
|
}
|
|
@@ -670,18 +678,18 @@ const mn = {
|
|
|
670
678
|
);
|
|
671
679
|
continue;
|
|
672
680
|
}
|
|
673
|
-
if (!y.path.includes(
|
|
674
|
-
|
|
681
|
+
if (!y.path.includes(We) && (y.field || y.element)) {
|
|
682
|
+
L(y);
|
|
675
683
|
continue;
|
|
676
684
|
}
|
|
677
|
-
const x = f ? f.split(".") : [],
|
|
678
|
-
if (J > 0 &&
|
|
679
|
-
const Z =
|
|
680
|
-
kind:
|
|
685
|
+
const x = f ? f.split(".") : [], P = F ? F.split(" › ") : [], J = x.findIndex((Z, ee) => ee > 0 && Y(Z));
|
|
686
|
+
if (J > 0 && P.length === x.length) {
|
|
687
|
+
const Z = P[J], ee = B(x.slice(0, J + 1).join("."), () => ({
|
|
688
|
+
kind: P.slice(0, J).map(I).join(" › "),
|
|
681
689
|
header: Z,
|
|
682
690
|
lines: []
|
|
683
|
-
})),
|
|
684
|
-
if (
|
|
691
|
+
})), ie = P.slice(J + 1).map(I).join(" › ");
|
|
692
|
+
if (ie) K(ee, y, ie);
|
|
685
693
|
else if (y.from != null && y.to != null) K(ee, y, Z);
|
|
686
694
|
else {
|
|
687
695
|
ee.badge = y.to != null ? "added" : "removed";
|
|
@@ -690,283 +698,283 @@ const mn = {
|
|
|
690
698
|
}
|
|
691
699
|
continue;
|
|
692
700
|
}
|
|
693
|
-
K(V(), y,
|
|
701
|
+
K(V(), y, P.map(I).join(" › "));
|
|
694
702
|
}
|
|
695
703
|
return b;
|
|
696
704
|
});
|
|
697
705
|
return (p, b) => {
|
|
698
|
-
var
|
|
706
|
+
var X, K;
|
|
699
707
|
const B = H("FmCircularProgress"), V = H("FmSwitch");
|
|
700
|
-
return p.isLoading ? (i(), c("div",
|
|
708
|
+
return p.isLoading ? (i(), c("div", fn, [
|
|
701
709
|
D(B)
|
|
702
|
-
])) : p.commits.length ? (i(), c("div",
|
|
703
|
-
g("ol",
|
|
704
|
-
(i(!0), c(z, null, ne(p.commits, (
|
|
705
|
-
key:
|
|
710
|
+
])) : p.commits.length ? (i(), c("div", pn, [
|
|
711
|
+
g("ol", vn, [
|
|
712
|
+
(i(!0), c(z, null, ne(p.commits, (L) => (i(), c("li", {
|
|
713
|
+
key: L.id,
|
|
706
714
|
role: "button",
|
|
707
715
|
tabindex: "0",
|
|
708
716
|
class: se([
|
|
709
717
|
"cursor-pointer border-l-2 py-8 pl-12",
|
|
710
|
-
|
|
718
|
+
L.id === l.value ? "border-fm-color-primary bg-fm-color-primary-50" : "border-gray-200 hover:bg-gray-50"
|
|
711
719
|
]),
|
|
712
|
-
onClick: (y) => l.value =
|
|
720
|
+
onClick: (y) => l.value = L.id,
|
|
713
721
|
onKeydown: [
|
|
714
|
-
Me((y) => l.value =
|
|
715
|
-
Me(
|
|
722
|
+
Me((y) => l.value = L.id, ["enter"]),
|
|
723
|
+
Me(dt((y) => l.value = L.id, ["prevent"]), ["space"])
|
|
716
724
|
]
|
|
717
725
|
}, [
|
|
718
|
-
g("div",
|
|
719
|
-
g("div",
|
|
720
|
-
], 42,
|
|
726
|
+
g("div", yn, _(O(L)), 1),
|
|
727
|
+
g("div", hn, _(oe(L)) + " · " + _(N(L.at)) + " · " + _(w(L.id)), 1)
|
|
728
|
+
], 42, gn))), 128))
|
|
721
729
|
]),
|
|
722
|
-
s.value ? (i(), c("div",
|
|
723
|
-
g("div",
|
|
724
|
-
g("div",
|
|
725
|
-
g("div",
|
|
726
|
-
s.value.parent ? E("", !0) : (i(), c("span",
|
|
730
|
+
s.value ? (i(), c("div", _n, [
|
|
731
|
+
g("div", xn, [
|
|
732
|
+
g("div", bn, [
|
|
733
|
+
g("div", wn, _(O(s.value)), 1),
|
|
734
|
+
s.value.parent ? E("", !0) : (i(), c("span", kn, _($(t)("inventory.changelog.rootCommit")), 1))
|
|
727
735
|
]),
|
|
728
|
-
g("div",
|
|
736
|
+
g("div", Sn, _(oe(s.value)) + " · " + _(N(s.value.at)), 1)
|
|
729
737
|
]),
|
|
730
|
-
g("div",
|
|
731
|
-
D(
|
|
738
|
+
g("div", $n, [
|
|
739
|
+
D(Pe, null, {
|
|
732
740
|
default: te(() => [
|
|
733
|
-
g("span",
|
|
741
|
+
g("span", Ln, _($(t)("inventory.changelog.dataDiff")), 1),
|
|
734
742
|
D(V, {
|
|
735
743
|
modelValue: r.value,
|
|
736
|
-
"onUpdate:modelValue": b[0] || (b[0] = (
|
|
744
|
+
"onUpdate:modelValue": b[0] || (b[0] = (L) => r.value = L)
|
|
737
745
|
}, null, 8, ["modelValue"])
|
|
738
746
|
]),
|
|
739
747
|
_: 1
|
|
740
748
|
})
|
|
741
749
|
]),
|
|
742
750
|
r.value ? (i(), c("div", Rn, [
|
|
743
|
-
|
|
744
|
-
(i(!0), c(z, null, ne(
|
|
751
|
+
$(v) ? (i(), pe(B, { key: 0 })) : (X = $(m)) != null && X.conflict ? (i(), c("div", Cn, _($(t)("inventory.changelog.snapshotUnavailable")), 1)) : (K = $(m)) != null && K.diff ? (i(), c("div", Dn, [
|
|
752
|
+
(i(!0), c(z, null, ne($(m).diff, (L, y) => (i(), c("div", {
|
|
745
753
|
key: y,
|
|
746
|
-
class: se(["whitespace-pre px-4", G(
|
|
747
|
-
}, _(j(
|
|
754
|
+
class: se(["whitespace-pre px-4", G(L.type)])
|
|
755
|
+
}, _(j(L)), 3))), 128))
|
|
748
756
|
])) : E("", !0)
|
|
749
757
|
])) : E("", !0),
|
|
750
|
-
(i(!0), c(z, null, ne(Q.value, (
|
|
758
|
+
(i(!0), c(z, null, ne(Q.value, (L, y) => (i(), c("div", {
|
|
751
759
|
key: y,
|
|
752
760
|
class: "mb-12 rounded-lg border border-gray-200 p-12"
|
|
753
761
|
}, [
|
|
754
|
-
|
|
762
|
+
L.kind || L.header || L.badge ? (i(), c("div", {
|
|
755
763
|
key: 0,
|
|
756
|
-
class: se(["flex flex-wrap items-baseline gap-8",
|
|
764
|
+
class: se(["flex flex-wrap items-baseline gap-8", L.lines.length ? "mb-8" : ""])
|
|
757
765
|
}, [
|
|
758
|
-
|
|
759
|
-
g("span",
|
|
760
|
-
|
|
766
|
+
L.kind ? (i(), c("span", In, _(L.kind), 1)) : E("", !0),
|
|
767
|
+
g("span", Fn, _(L.header), 1),
|
|
768
|
+
L.badge ? (i(), c("span", {
|
|
761
769
|
key: 1,
|
|
762
|
-
class: se(["rounded-full px-8 text-xs",
|
|
763
|
-
}, _(
|
|
770
|
+
class: se(["rounded-full px-8 text-xs", L.badge === "added" ? "bg-green-100 text-green-700" : "bg-red-100 text-red-700"])
|
|
771
|
+
}, _(L.badge === "added" ? $(t)("inventory.changelog.added") : $(t)("inventory.changelog.kind.removed")), 3)) : E("", !0)
|
|
764
772
|
], 2)) : E("", !0),
|
|
765
|
-
g("ul",
|
|
766
|
-
(i(!0), c(z, null, ne(
|
|
773
|
+
g("ul", En, [
|
|
774
|
+
(i(!0), c(z, null, ne(L.lines, (f, F) => (i(), c("li", {
|
|
767
775
|
key: F,
|
|
768
776
|
class: "flex flex-wrap items-baseline gap-8 text-sm"
|
|
769
777
|
}, [
|
|
770
778
|
f.text ? (i(), c("span", Pn, _(f.text), 1)) : (i(), c(z, { key: 1 }, [
|
|
771
|
-
g("span",
|
|
772
|
-
f.toTree || f.fromTree ? (i(), c("div",
|
|
773
|
-
f.fromTree ? (i(), c("div",
|
|
774
|
-
(i(!0), c(z, null, ne(f.fromTree, (x,
|
|
775
|
-
key:
|
|
779
|
+
g("span", Nn, _(f.label), 1),
|
|
780
|
+
f.toTree || f.fromTree ? (i(), c("div", Tn, [
|
|
781
|
+
f.fromTree ? (i(), c("div", Vn, [
|
|
782
|
+
(i(!0), c(z, null, ne(f.fromTree, (x, P) => (i(), c("div", {
|
|
783
|
+
key: P,
|
|
776
784
|
class: se(["flex items-baseline gap-4 px-4", x.bookkeeping ? "text-gray-400" : "text-red-700"])
|
|
777
785
|
}, [
|
|
778
786
|
(i(!0), c(z, null, ne(x.depth, (J) => (i(), c("span", {
|
|
779
787
|
key: J,
|
|
780
788
|
class: "inline-block w-16"
|
|
781
789
|
}))), 128)),
|
|
782
|
-
x.label ? (i(), c("span",
|
|
783
|
-
|
|
790
|
+
x.label ? (i(), c("span", Bn, [
|
|
791
|
+
re(_(x.label), 1),
|
|
784
792
|
x.text ? (i(), c(z, { key: 0 }, [
|
|
785
|
-
|
|
793
|
+
re(":")
|
|
786
794
|
], 64)) : E("", !0)
|
|
787
795
|
])) : E("", !0),
|
|
788
|
-
x.text ? (i(), c("span",
|
|
796
|
+
x.text ? (i(), c("span", Un, _(x.text), 1)) : E("", !0)
|
|
789
797
|
], 2))), 128))
|
|
790
798
|
])) : E("", !0),
|
|
791
|
-
f.toTree ? (i(), c("div",
|
|
792
|
-
(i(!0), c(z, null, ne(f.toTree, (x,
|
|
793
|
-
key:
|
|
799
|
+
f.toTree ? (i(), c("div", An, [
|
|
800
|
+
(i(!0), c(z, null, ne(f.toTree, (x, P) => (i(), c("div", {
|
|
801
|
+
key: P,
|
|
794
802
|
class: se(["flex items-baseline gap-4 px-4", x.bookkeeping ? "text-gray-400" : "text-green-700"])
|
|
795
803
|
}, [
|
|
796
804
|
(i(!0), c(z, null, ne(x.depth, (J) => (i(), c("span", {
|
|
797
805
|
key: J,
|
|
798
806
|
class: "inline-block w-16"
|
|
799
807
|
}))), 128)),
|
|
800
|
-
x.label ? (i(), c("span",
|
|
801
|
-
|
|
808
|
+
x.label ? (i(), c("span", Mn, [
|
|
809
|
+
re(_(x.label), 1),
|
|
802
810
|
x.text ? (i(), c(z, { key: 0 }, [
|
|
803
|
-
|
|
811
|
+
re(":")
|
|
804
812
|
], 64)) : E("", !0)
|
|
805
813
|
])) : E("", !0),
|
|
806
|
-
x.text ? (i(), c("span",
|
|
814
|
+
x.text ? (i(), c("span", On, _(x.text), 1)) : E("", !0)
|
|
807
815
|
], 2))), 128))
|
|
808
816
|
])) : E("", !0)
|
|
809
|
-
])) : f.diff ? (i(), c("div",
|
|
810
|
-
(i(!0), c(z, null, ne(f.diff, (x,
|
|
811
|
-
key:
|
|
817
|
+
])) : f.diff ? (i(), c("div", zn, [
|
|
818
|
+
(i(!0), c(z, null, ne(f.diff, (x, P) => (i(), c("div", {
|
|
819
|
+
key: P,
|
|
812
820
|
class: se(["whitespace-pre px-4", G(x.type)])
|
|
813
821
|
}, _(j(x)), 3))), 128))
|
|
814
|
-
])) : (i(), c("span",
|
|
815
|
-
f.from != null ? (i(), c("span",
|
|
816
|
-
f.from != null && f.to != null ? (i(), c("span",
|
|
817
|
-
f.to != null ? (i(), c("span",
|
|
822
|
+
])) : (i(), c("span", Gn, [
|
|
823
|
+
f.from != null ? (i(), c("span", jn, _(f.fromDisplay ?? U(f.from)), 1)) : E("", !0),
|
|
824
|
+
f.from != null && f.to != null ? (i(), c("span", Kn, "→")) : E("", !0),
|
|
825
|
+
f.to != null ? (i(), c("span", Hn, _(f.toDisplay ?? U(f.to)), 1)) : E("", !0)
|
|
818
826
|
]))
|
|
819
827
|
], 64))
|
|
820
828
|
]))), 128))
|
|
821
829
|
])
|
|
822
830
|
]))), 128)),
|
|
823
|
-
Q.value.length ? E("", !0) : (i(), c("div",
|
|
824
|
-
r.value ? (i(), c("div",
|
|
825
|
-
|
|
831
|
+
Q.value.length ? E("", !0) : (i(), c("div", Jn, _($(t)("inventory.changelog.empty")), 1)),
|
|
832
|
+
r.value ? (i(), c("div", Yn, [
|
|
833
|
+
re(_(s.value.id) + " ", 1),
|
|
826
834
|
s.value.parent ? (i(), c("span", Xn, "← " + _(s.value.parent), 1)) : E("", !0)
|
|
827
835
|
])) : E("", !0)
|
|
828
836
|
])) : E("", !0)
|
|
829
|
-
])) : (i(), c("div",
|
|
837
|
+
])) : (i(), c("div", mn, _($(t)("inventory.changelog.empty")), 1));
|
|
830
838
|
};
|
|
831
839
|
}
|
|
832
|
-
}),
|
|
840
|
+
}), Zn = { class: "flex flex-col gap-8" }, Qn = { class: "flex flex-wrap items-center gap-16" }, eo = { class: "fm-typo-en-heading-lg-600" }, to = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, no = { class: "flex h-full min-h-0 flex-col gap-12 p-16" }, oo = { class: "flex flex-wrap items-center gap-12" }, ao = { class: "flex shrink-0 items-center gap-8" }, so = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, lo = { class: "flex flex-wrap items-center gap-12" }, ro = {
|
|
833
841
|
key: 0,
|
|
834
842
|
class: "fm-typo-en-body-md-600"
|
|
835
|
-
},
|
|
843
|
+
}, io = { class: "fm-typo-en-heading-md-600" }, uo = {
|
|
836
844
|
key: 0,
|
|
837
845
|
class: "flex justify-center py-8"
|
|
838
|
-
}, Le = "inventory.changelog.label.",
|
|
846
|
+
}, Le = "inventory.changelog.label.", co = /* @__PURE__ */ ce({
|
|
839
847
|
__name: "ChangelogDialog",
|
|
840
848
|
props: {
|
|
841
849
|
modelValue: { type: Boolean }
|
|
842
850
|
},
|
|
843
851
|
emits: ["update:modelValue"],
|
|
844
|
-
setup(
|
|
845
|
-
const t =
|
|
852
|
+
setup(o, { emit: e }) {
|
|
853
|
+
const t = o, l = e, s = C({
|
|
846
854
|
get: () => t.modelValue,
|
|
847
855
|
set: (n) => l("update:modelValue", n)
|
|
848
|
-
}), { t:
|
|
849
|
-
function
|
|
856
|
+
}), { t: a } = he(), u = ge(), r = Ke(), v = je(), m = _e(), { breakpoints: h } = Ct(), w = C(() => h.value.xs || h.value.sm), N = C(() => w.value ? "98vw" : "72vw"), { commits: U, isLoading: oe, hasMore: O, load: I, loadMore: Y } = en();
|
|
857
|
+
function R() {
|
|
850
858
|
Y().catch((n) => console.error("changelog load more failed", n));
|
|
851
859
|
}
|
|
852
860
|
function T(n) {
|
|
853
861
|
return n ? new Date(n).toLocaleString() : "—";
|
|
854
862
|
}
|
|
855
863
|
function G(n) {
|
|
856
|
-
return [...n].sort((d,
|
|
864
|
+
return [...n].sort((d, k) => (k.lastUpdate ?? "").localeCompare(d.lastUpdate ?? ""));
|
|
857
865
|
}
|
|
858
|
-
function j(n, d,
|
|
859
|
-
I(n, d,
|
|
866
|
+
function j(n, d, k) {
|
|
867
|
+
I(n, d, k).catch((A) => console.error("changelog load failed", A));
|
|
860
868
|
}
|
|
861
|
-
const Q =
|
|
869
|
+
const Q = S([]);
|
|
862
870
|
async function p() {
|
|
863
871
|
var d;
|
|
864
872
|
const n = (d = u.currentBusiness.value) == null ? void 0 : d._id;
|
|
865
873
|
if (n)
|
|
866
874
|
try {
|
|
867
875
|
Q.value = await m.listDomains(n);
|
|
868
|
-
} catch (
|
|
869
|
-
console.error("changelog domain list load failed",
|
|
876
|
+
} catch (k) {
|
|
877
|
+
console.error("changelog domain list load failed", k), Q.value = [];
|
|
870
878
|
}
|
|
871
879
|
}
|
|
872
|
-
const b =
|
|
873
|
-
{ label:
|
|
874
|
-
{ label:
|
|
875
|
-
{ label:
|
|
876
|
-
...Q.value.map((n) => ({ label:
|
|
877
|
-
]), B =
|
|
880
|
+
const b = C(() => [
|
|
881
|
+
{ label: a("inventory.changelog.label.purchaseOrder"), value: "purchaseOrder" },
|
|
882
|
+
{ label: a("inventory.changelog.label.closingDraft"), value: "closingDraft" },
|
|
883
|
+
{ label: a("inventory.changelog.domainInventory"), value: "inventory" },
|
|
884
|
+
...Q.value.map((n) => ({ label: a(n.labelKey), value: n.domain }))
|
|
885
|
+
]), B = S(b.value[0]), V = C(() => {
|
|
878
886
|
var n;
|
|
879
887
|
return ((n = B.value) == null ? void 0 : n.value) ?? "purchaseOrder";
|
|
880
|
-
}),
|
|
888
|
+
}), X = C(
|
|
881
889
|
() => Q.value.some((n) => n.domain === V.value)
|
|
882
|
-
), K =
|
|
890
|
+
), K = S(!1), L = C(
|
|
883
891
|
() => ["sku", "recipe", "unit"].map((n) => ({
|
|
884
|
-
label:
|
|
892
|
+
label: a(Le + n),
|
|
885
893
|
value: n
|
|
886
894
|
}))
|
|
887
|
-
), y =
|
|
895
|
+
), y = S(L.value[0]), f = C(() => {
|
|
888
896
|
var n;
|
|
889
897
|
return ((n = y.value) == null ? void 0 : n.value) ?? "sku";
|
|
890
|
-
}), F =
|
|
891
|
-
var
|
|
892
|
-
const n = (
|
|
898
|
+
}), F = S(""), x = S(null), P = S(!1), J = C(() => {
|
|
899
|
+
var k;
|
|
900
|
+
const n = (k = u.currentBusiness.value) == null ? void 0 : k._id, d = r.inventory._id;
|
|
893
901
|
return n && d ? `business_${n}/${d}` : "";
|
|
894
|
-
}), Z =
|
|
902
|
+
}), Z = C(() => {
|
|
895
903
|
const n = /* @__PURE__ */ new Map(), d = r.inventory;
|
|
896
|
-
for (const
|
|
897
|
-
for (const A of
|
|
904
|
+
for (const k of [d.sku, d.recipe, d.unit, d.skuGroup])
|
|
905
|
+
for (const A of k ?? [])
|
|
898
906
|
A._id && A.name && n.set(A._id, A.name);
|
|
899
|
-
for (const
|
|
900
|
-
for (const A of
|
|
907
|
+
for (const k of d.unit ?? [])
|
|
908
|
+
for (const A of k.measurements ?? []) {
|
|
901
909
|
if (!A.id) continue;
|
|
902
|
-
const
|
|
903
|
-
if (!
|
|
904
|
-
const ae =
|
|
905
|
-
n.set(A.id, ae ? `${
|
|
910
|
+
const W = A.abbrev || A.name;
|
|
911
|
+
if (!W) continue;
|
|
912
|
+
const ae = Ft.toDouble(A.conversion);
|
|
913
|
+
n.set(A.id, ae ? `${W} (1 ${W} = ${ae} ${k.abbrev})` : W);
|
|
906
914
|
}
|
|
907
915
|
return n;
|
|
908
|
-
}), ee = (n) => Z.value.get(n),
|
|
909
|
-
async function
|
|
916
|
+
}), ee = (n) => Z.value.get(n), ie = S([]), de = S(!1);
|
|
917
|
+
async function Ne() {
|
|
910
918
|
var d;
|
|
911
919
|
const n = (d = u.currentBusiness.value) == null ? void 0 : d._id;
|
|
912
920
|
if (n) {
|
|
913
921
|
de.value = !0;
|
|
914
922
|
try {
|
|
915
|
-
|
|
923
|
+
ie.value = G(
|
|
916
924
|
await m.listInventory(n, f.value)
|
|
917
925
|
);
|
|
918
|
-
} catch (
|
|
919
|
-
console.error("changelog inventory list load failed",
|
|
926
|
+
} catch (k) {
|
|
927
|
+
console.error("changelog inventory list load failed", k), ie.value = [];
|
|
920
928
|
} finally {
|
|
921
929
|
de.value = !1;
|
|
922
930
|
}
|
|
923
931
|
}
|
|
924
932
|
}
|
|
925
|
-
const
|
|
926
|
-
() =>
|
|
927
|
-
),
|
|
928
|
-
{ accessorKey: "id", header: () =>
|
|
933
|
+
const Ze = C(
|
|
934
|
+
() => P.value ? ie.value : ie.value.filter((n) => !n.deleted)
|
|
935
|
+
), Qe = C(() => [
|
|
936
|
+
{ accessorKey: "id", header: () => a("inventory.closing.draft.table.id"), size: 320 },
|
|
929
937
|
{
|
|
930
938
|
id: "name",
|
|
931
|
-
header: () =>
|
|
939
|
+
header: () => a("inventory.common.name"),
|
|
932
940
|
accessorFn: (n) => n.name,
|
|
933
941
|
// Deleted records sit in the same list as live ones, so the row says which
|
|
934
942
|
// it is; nothing else distinguishes them.
|
|
935
|
-
cell: ({ row: n }) => n.original.deleted ?
|
|
943
|
+
cell: ({ row: n }) => n.original.deleted ? ft(
|
|
936
944
|
"span",
|
|
937
945
|
{ "data-deleted": "" },
|
|
938
|
-
`${n.original.name} (${
|
|
946
|
+
`${n.original.name} (${a("inventory.changelog.deleted")})`
|
|
939
947
|
) : n.original.name
|
|
940
948
|
},
|
|
941
949
|
{
|
|
942
950
|
id: "lastUpdate",
|
|
943
|
-
header: () =>
|
|
951
|
+
header: () => a("inventory.changelog.column.lastUpdate"),
|
|
944
952
|
size: 200,
|
|
945
953
|
// Raw ISO is the sort key — clicking the header on formatted dates would
|
|
946
954
|
// order them lexicographically by locale string. Formatted only to display.
|
|
947
955
|
accessorFn: (n) => n.lastUpdate ?? "",
|
|
948
956
|
cell: ({ getValue: n }) => T(n() || void 0)
|
|
949
957
|
}
|
|
950
|
-
]), { commits:
|
|
951
|
-
function
|
|
952
|
-
x.value = n, K.value = !0, j(J.value,
|
|
958
|
+
]), { commits: et, load: tt } = nn();
|
|
959
|
+
function nt(n) {
|
|
960
|
+
x.value = n, K.value = !0, j(J.value, Je, Ce), n.id && tt(`${J.value}/${f.value}/${n.id}`).catch(
|
|
953
961
|
(d) => console.error("changelog per-entity load failed", d)
|
|
954
962
|
);
|
|
955
963
|
}
|
|
956
|
-
function
|
|
957
|
-
const
|
|
958
|
-
return
|
|
959
|
-
const
|
|
960
|
-
return
|
|
964
|
+
function ot(n, d) {
|
|
965
|
+
const k = Ye(n.message);
|
|
966
|
+
return k && k.labelKey === Le + f.value && k.name === d.name ? !0 : (n.changes ?? []).some((A) => {
|
|
967
|
+
const W = sn(A.path);
|
|
968
|
+
return W.type === Le + f.value && W.name === d.name;
|
|
961
969
|
});
|
|
962
970
|
}
|
|
963
|
-
const
|
|
971
|
+
const at = C(() => {
|
|
964
972
|
const n = x.value;
|
|
965
973
|
if (!n) return [];
|
|
966
|
-
const d = U.value.filter((
|
|
967
|
-
return
|
|
968
|
-
}), xe =
|
|
969
|
-
async function
|
|
974
|
+
const d = U.value.filter((k) => ot(k, n));
|
|
975
|
+
return tn(d, et.value);
|
|
976
|
+
}), xe = S([]), be = S(!1), we = S(null);
|
|
977
|
+
async function st() {
|
|
970
978
|
var d;
|
|
971
979
|
const n = (d = u.currentBusiness.value) == null ? void 0 : d._id;
|
|
972
980
|
if (n) {
|
|
@@ -975,31 +983,31 @@ const mn = {
|
|
|
975
983
|
xe.value = G(
|
|
976
984
|
await m.listDomainRecords(n, V.value)
|
|
977
985
|
);
|
|
978
|
-
} catch (
|
|
979
|
-
console.error("changelog domain records load failed",
|
|
986
|
+
} catch (k) {
|
|
987
|
+
console.error("changelog domain records load failed", k), xe.value = [];
|
|
980
988
|
} finally {
|
|
981
989
|
be.value = !1;
|
|
982
990
|
}
|
|
983
991
|
}
|
|
984
992
|
}
|
|
985
|
-
function
|
|
986
|
-
var
|
|
987
|
-
const d = (
|
|
988
|
-
d && (we.value = n, K.value = !0, j(`business_${d}/${n.id}`, void 0,
|
|
993
|
+
function lt(n) {
|
|
994
|
+
var k;
|
|
995
|
+
const d = (k = u.currentBusiness.value) == null ? void 0 : k._id;
|
|
996
|
+
d && (we.value = n, K.value = !0, j(`business_${d}/${n.id}`, void 0, Re));
|
|
989
997
|
}
|
|
990
|
-
const ve =
|
|
998
|
+
const ve = S(Dt()), ye = S([]), ke = S(!1), fe = S(null), Te = C(() => {
|
|
991
999
|
const n = v._currentLocation;
|
|
992
1000
|
return n ? `${n.name} (${n.doc.profile.code ?? "--"})` : "";
|
|
993
|
-
}), Ve =
|
|
994
|
-
{ accessorKey: "id", header: () =>
|
|
1001
|
+
}), Ve = C(() => [
|
|
1002
|
+
{ accessorKey: "id", header: () => a("inventory.closing.draft.table.id"), size: 320 },
|
|
995
1003
|
{
|
|
996
1004
|
accessorKey: "name",
|
|
997
|
-
header: () => V.value === "purchaseOrder" ?
|
|
1005
|
+
header: () => V.value === "purchaseOrder" ? a("inventory.changelog.column.seq") : a("inventory.common.name"),
|
|
998
1006
|
size: 240
|
|
999
1007
|
},
|
|
1000
1008
|
{
|
|
1001
1009
|
id: "lastUpdate",
|
|
1002
|
-
header: () =>
|
|
1010
|
+
header: () => a("inventory.changelog.column.lastUpdate"),
|
|
1003
1011
|
size: 200,
|
|
1004
1012
|
// Raw ISO is the sort key; see the note on the inventory table.
|
|
1005
1013
|
accessorFn: (n) => n.lastUpdate ?? "",
|
|
@@ -1010,33 +1018,33 @@ const mn = {
|
|
|
1010
1018
|
var A;
|
|
1011
1019
|
const n = (A = v._currentLocation) == null ? void 0 : A.dbName;
|
|
1012
1020
|
if (!n) return;
|
|
1013
|
-
const d =
|
|
1021
|
+
const d = Et(new Date(ve.value.startDate)).toISOString(), k = Pt(new Date(ve.value.endDate)).toISOString();
|
|
1014
1022
|
ke.value = !0;
|
|
1015
1023
|
try {
|
|
1016
1024
|
ye.value = G(
|
|
1017
|
-
V.value === "purchaseOrder" ? await m.listPurchaseOrders(n, d,
|
|
1025
|
+
V.value === "purchaseOrder" ? await m.listPurchaseOrders(n, d, k) : await m.listClosingDrafts(n, d, k)
|
|
1018
1026
|
);
|
|
1019
|
-
} catch (
|
|
1020
|
-
console.error("changelog location list load failed",
|
|
1027
|
+
} catch (W) {
|
|
1028
|
+
console.error("changelog location list load failed", W), ye.value = [];
|
|
1021
1029
|
} finally {
|
|
1022
1030
|
ke.value = !1;
|
|
1023
1031
|
}
|
|
1024
|
-
fe.value && !ye.value.find((
|
|
1032
|
+
fe.value && !ye.value.find((W) => {
|
|
1025
1033
|
var ae;
|
|
1026
|
-
return
|
|
1034
|
+
return W.id === ((ae = fe.value) == null ? void 0 : ae.id);
|
|
1027
1035
|
}) && (fe.value = null, j(""));
|
|
1028
1036
|
}
|
|
1029
|
-
function
|
|
1030
|
-
fe.value = n, K.value = !0, j(`${v.currentLocationDBName}/${n.id}`, void 0,
|
|
1037
|
+
function rt(n) {
|
|
1038
|
+
fe.value = n, K.value = !0, j(`${v.currentLocationDBName}/${n.id}`, void 0, Re);
|
|
1031
1039
|
}
|
|
1032
|
-
const
|
|
1033
|
-
var n, d,
|
|
1034
|
-
return V.value === "inventory" ? ((n = x.value) == null ? void 0 : n.name) ?? "" :
|
|
1040
|
+
const it = C(() => {
|
|
1041
|
+
var n, d, k;
|
|
1042
|
+
return V.value === "inventory" ? ((n = x.value) == null ? void 0 : n.name) ?? "" : X.value ? ((d = we.value) == null ? void 0 : d.name) ?? "" : ((k = fe.value) == null ? void 0 : k.name) ?? "";
|
|
1035
1043
|
});
|
|
1036
1044
|
function Ue() {
|
|
1037
|
-
K.value = !1, V.value === "inventory" ? (x.value = null,
|
|
1045
|
+
K.value = !1, V.value === "inventory" ? (x.value = null, P.value = !1, j(""), Ne().catch(
|
|
1038
1046
|
(n) => console.error("changelog inventory list failed", n)
|
|
1039
|
-
)) :
|
|
1047
|
+
)) : X.value ? (we.value = null, j(""), st().catch(
|
|
1040
1048
|
(n) => console.error("changelog domain records failed", n)
|
|
1041
1049
|
)) : (fe.value = null, j(""), Be().catch((n) => console.error("changelog location list failed", n)));
|
|
1042
1050
|
}
|
|
@@ -1045,18 +1053,18 @@ const mn = {
|
|
|
1045
1053
|
}), q(V, () => {
|
|
1046
1054
|
s.value && Ue();
|
|
1047
1055
|
}), q(ve, () => {
|
|
1048
|
-
s.value && V.value !== "inventory" && !
|
|
1049
|
-
}), q(
|
|
1056
|
+
s.value && V.value !== "inventory" && !X.value && Be().catch((n) => console.error("changelog location list failed", n));
|
|
1057
|
+
}), q(P, (n) => {
|
|
1050
1058
|
var d;
|
|
1051
1059
|
!n && ((d = x.value) != null && d.deleted) && (x.value = null, K.value = !1);
|
|
1052
1060
|
}), q(f, () => {
|
|
1053
|
-
x.value = null, K.value = !1, s.value && V.value === "inventory" &&
|
|
1061
|
+
x.value = null, K.value = !1, s.value && V.value === "inventory" && Ne().catch(
|
|
1054
1062
|
(n) => console.error("changelog inventory list failed", n)
|
|
1055
1063
|
);
|
|
1056
1064
|
}), q(J, (n) => {
|
|
1057
|
-
x.value = null, s.value && V.value === "inventory" && j(n, void 0,
|
|
1065
|
+
x.value = null, s.value && V.value === "inventory" && j(n, void 0, Ce);
|
|
1058
1066
|
}), (n, d) => {
|
|
1059
|
-
const
|
|
1067
|
+
const k = H("FmButtonGroup"), A = H("FmSearch"), W = H("FmSwitch"), ae = H("FmTable"), Ae = H("FmDialog"), ut = H("FmButton");
|
|
1060
1068
|
return i(), c(z, null, [
|
|
1061
1069
|
D(Ae, {
|
|
1062
1070
|
modelValue: s.value,
|
|
@@ -1069,65 +1077,65 @@ const mn = {
|
|
|
1069
1077
|
"content-class": "!p-0 h-[86vh]"
|
|
1070
1078
|
}, {
|
|
1071
1079
|
"dialog-header": te(() => [
|
|
1072
|
-
g("div",
|
|
1073
|
-
g("div",
|
|
1074
|
-
g("div",
|
|
1075
|
-
D(
|
|
1080
|
+
g("div", Zn, [
|
|
1081
|
+
g("div", Qn, [
|
|
1082
|
+
g("div", eo, _($(a)("inventory.changelog.title")), 1),
|
|
1083
|
+
D(k, {
|
|
1076
1084
|
modelValue: B.value,
|
|
1077
1085
|
"onUpdate:modelValue": d[0] || (d[0] = (M) => B.value = M),
|
|
1078
1086
|
items: b.value
|
|
1079
1087
|
}, null, 8, ["modelValue", "items"])
|
|
1080
1088
|
]),
|
|
1081
|
-
g("div",
|
|
1089
|
+
g("div", to, _($(a)("inventory.changelog.scopeDescription")), 1)
|
|
1082
1090
|
])
|
|
1083
1091
|
]),
|
|
1084
1092
|
default: te(() => [
|
|
1085
|
-
g("div",
|
|
1093
|
+
g("div", no, [
|
|
1086
1094
|
V.value === "inventory" ? (i(), c(z, { key: 0 }, [
|
|
1087
|
-
g("div",
|
|
1088
|
-
D(
|
|
1095
|
+
g("div", oo, [
|
|
1096
|
+
D(k, {
|
|
1089
1097
|
modelValue: y.value,
|
|
1090
1098
|
"onUpdate:modelValue": d[1] || (d[1] = (M) => y.value = M),
|
|
1091
|
-
items:
|
|
1099
|
+
items: L.value
|
|
1092
1100
|
}, null, 8, ["modelValue", "items"]),
|
|
1093
1101
|
D(A, {
|
|
1094
1102
|
modelValue: F.value,
|
|
1095
1103
|
"onUpdate:modelValue": d[2] || (d[2] = (M) => F.value = M),
|
|
1096
1104
|
class: "flex-1",
|
|
1097
|
-
placeholder:
|
|
1105
|
+
placeholder: $(a)("inventory.changelog.searchInventory")
|
|
1098
1106
|
}, null, 8, ["modelValue", "placeholder"]),
|
|
1099
|
-
g("div",
|
|
1100
|
-
g("span",
|
|
1101
|
-
D(
|
|
1102
|
-
modelValue:
|
|
1103
|
-
"onUpdate:modelValue": d[3] || (d[3] = (M) =>
|
|
1107
|
+
g("div", ao, [
|
|
1108
|
+
g("span", so, _($(a)("inventory.changelog.includeDeleted")), 1),
|
|
1109
|
+
D(W, {
|
|
1110
|
+
modelValue: P.value,
|
|
1111
|
+
"onUpdate:modelValue": d[3] || (d[3] = (M) => P.value = M)
|
|
1104
1112
|
}, null, 8, ["modelValue"])
|
|
1105
1113
|
])
|
|
1106
1114
|
]),
|
|
1107
1115
|
D(ae, {
|
|
1108
1116
|
class: "min-h-0 flex-1",
|
|
1109
|
-
"row-data":
|
|
1110
|
-
"column-defs":
|
|
1117
|
+
"row-data": Ze.value,
|
|
1118
|
+
"column-defs": Qe.value,
|
|
1111
1119
|
"search-value": F.value,
|
|
1112
1120
|
loading: de.value,
|
|
1113
1121
|
"page-size": 20,
|
|
1114
|
-
onRowClick: d[4] || (d[4] = (M) =>
|
|
1122
|
+
onRowClick: d[4] || (d[4] = (M) => nt(M.original))
|
|
1115
1123
|
}, null, 8, ["row-data", "column-defs", "search-value", "loading"])
|
|
1116
|
-
], 64)) :
|
|
1124
|
+
], 64)) : X.value ? (i(), pe(ae, {
|
|
1117
1125
|
key: 1,
|
|
1118
1126
|
class: "min-h-0 flex-1",
|
|
1119
1127
|
"row-data": xe.value,
|
|
1120
1128
|
"column-defs": Ve.value,
|
|
1121
1129
|
loading: be.value,
|
|
1122
1130
|
"page-size": 20,
|
|
1123
|
-
onRowClick: d[5] || (d[5] = (M) =>
|
|
1131
|
+
onRowClick: d[5] || (d[5] = (M) => lt(M.original))
|
|
1124
1132
|
}, null, 8, ["row-data", "column-defs", "loading"])) : (i(), c(z, { key: 2 }, [
|
|
1125
|
-
g("div",
|
|
1126
|
-
D(
|
|
1133
|
+
g("div", lo, [
|
|
1134
|
+
D(It, {
|
|
1127
1135
|
modelValue: ve.value,
|
|
1128
1136
|
"onUpdate:modelValue": d[6] || (d[6] = (M) => ve.value = M)
|
|
1129
1137
|
}, null, 8, ["modelValue"]),
|
|
1130
|
-
Te.value ? (i(), c("span",
|
|
1138
|
+
Te.value ? (i(), c("span", ro, _(Te.value), 1)) : E("", !0)
|
|
1131
1139
|
]),
|
|
1132
1140
|
D(ae, {
|
|
1133
1141
|
class: "min-h-0 flex-1",
|
|
@@ -1135,7 +1143,7 @@ const mn = {
|
|
|
1135
1143
|
"column-defs": Ve.value,
|
|
1136
1144
|
loading: ke.value,
|
|
1137
1145
|
"page-size": 20,
|
|
1138
|
-
onRowClick: d[7] || (d[7] = (M) =>
|
|
1146
|
+
onRowClick: d[7] || (d[7] = (M) => rt(M.original))
|
|
1139
1147
|
}, null, 8, ["row-data", "column-defs", "loading"])
|
|
1140
1148
|
], 64))
|
|
1141
1149
|
])
|
|
@@ -1147,25 +1155,25 @@ const mn = {
|
|
|
1147
1155
|
"onUpdate:modelValue": d[9] || (d[9] = (M) => K.value = M),
|
|
1148
1156
|
"close-button": "",
|
|
1149
1157
|
"dismiss-away": "",
|
|
1150
|
-
"min-width":
|
|
1151
|
-
"max-width":
|
|
1158
|
+
"min-width": N.value,
|
|
1159
|
+
"max-width": N.value,
|
|
1152
1160
|
"max-height": "86vh"
|
|
1153
1161
|
}, {
|
|
1154
1162
|
"dialog-header": te(() => [
|
|
1155
|
-
g("div",
|
|
1163
|
+
g("div", io, _(it.value), 1)
|
|
1156
1164
|
]),
|
|
1157
1165
|
default: te(() => [
|
|
1158
|
-
D(
|
|
1159
|
-
commits: V.value === "inventory" ?
|
|
1160
|
-
"is-loading":
|
|
1166
|
+
D(qn, {
|
|
1167
|
+
commits: V.value === "inventory" ? at.value : $(U),
|
|
1168
|
+
"is-loading": $(oe),
|
|
1161
1169
|
"resolve-name": ee
|
|
1162
1170
|
}, null, 8, ["commits", "is-loading"]),
|
|
1163
|
-
V.value !== "inventory" &&
|
|
1164
|
-
D(
|
|
1165
|
-
label:
|
|
1171
|
+
V.value !== "inventory" && $(O) ? (i(), c("div", uo, [
|
|
1172
|
+
D(ut, {
|
|
1173
|
+
label: $(a)("inventory.changelog.loadMore"),
|
|
1166
1174
|
variant: "secondary",
|
|
1167
|
-
disabled:
|
|
1168
|
-
onClick:
|
|
1175
|
+
disabled: $(oe),
|
|
1176
|
+
onClick: R
|
|
1169
1177
|
}, null, 8, ["label", "disabled"])
|
|
1170
1178
|
])) : E("", !0)
|
|
1171
1179
|
]),
|
|
@@ -1174,85 +1182,82 @@ const mn = {
|
|
|
1174
1182
|
], 64);
|
|
1175
1183
|
};
|
|
1176
1184
|
}
|
|
1177
|
-
}),
|
|
1185
|
+
}), fo = /* @__PURE__ */ Nt(co, [["__scopeId", "data-v-ae9bd171"]]), le = 8;
|
|
1186
|
+
function mo(o, e) {
|
|
1187
|
+
return { x: le, y: Math.max(le, e - o - le) };
|
|
1188
|
+
}
|
|
1189
|
+
const po = ["title"], Ge = 48, vo = 8, go = /* @__PURE__ */ ce({
|
|
1178
1190
|
__name: "ChangelogFloatingButton",
|
|
1179
|
-
setup(
|
|
1180
|
-
const { t: e } = he(), t = ge(), l =
|
|
1181
|
-
var
|
|
1182
|
-
return !!((
|
|
1183
|
-
}), s =
|
|
1191
|
+
setup(o) {
|
|
1192
|
+
const { t: e } = he(), t = ge(), l = C(() => {
|
|
1193
|
+
var R;
|
|
1194
|
+
return !!((R = t.sessionUser.value) != null && R.role.isAdmin);
|
|
1195
|
+
}), s = S(!1), a = S(null);
|
|
1184
1196
|
function u() {
|
|
1185
|
-
var
|
|
1197
|
+
var R, T;
|
|
1186
1198
|
return {
|
|
1187
|
-
width: ((
|
|
1188
|
-
height: ((T =
|
|
1199
|
+
width: ((R = a.value) == null ? void 0 : R.offsetWidth) ?? Ge,
|
|
1200
|
+
height: ((T = a.value) == null ? void 0 : T.offsetHeight) ?? Ge
|
|
1189
1201
|
};
|
|
1190
1202
|
}
|
|
1191
|
-
const r =
|
|
1192
|
-
function v(
|
|
1193
|
-
return Math.min(Math.max(
|
|
1203
|
+
const r = S({ x: 0, y: 0 });
|
|
1204
|
+
function v(R, T, G) {
|
|
1205
|
+
return Math.min(Math.max(R, T), G);
|
|
1194
1206
|
}
|
|
1195
1207
|
function m() {
|
|
1196
|
-
const { width:
|
|
1208
|
+
const { width: R, height: T } = u(), G = Math.max(le, window.innerWidth - R - le - vo), j = Math.max(le, window.innerHeight - T - le), Q = r.value.x + R / 2;
|
|
1197
1209
|
r.value = {
|
|
1198
|
-
x: Q < window.innerWidth / 2 ?
|
|
1199
|
-
y: v(r.value.y,
|
|
1210
|
+
x: Q < window.innerWidth / 2 ? le : G,
|
|
1211
|
+
y: v(r.value.y, le, j)
|
|
1200
1212
|
};
|
|
1201
1213
|
}
|
|
1202
1214
|
function h() {
|
|
1203
|
-
|
|
1204
|
-
r.value = {
|
|
1205
|
-
x: window.innerWidth - S - ie - je,
|
|
1206
|
-
y: Math.round(window.innerHeight / 2)
|
|
1207
|
-
};
|
|
1215
|
+
r.value = mo(u().height, window.innerHeight);
|
|
1208
1216
|
}
|
|
1209
1217
|
Fe(() => {
|
|
1210
1218
|
h(), window.addEventListener("resize", m), window.addEventListener("orientationchange", m);
|
|
1211
|
-
}),
|
|
1219
|
+
}), mt(() => {
|
|
1212
1220
|
window.removeEventListener("resize", m), window.removeEventListener("orientationchange", m);
|
|
1213
|
-
}), q(l, async (
|
|
1214
|
-
|
|
1221
|
+
}), q(l, async (R) => {
|
|
1222
|
+
R && (await pt(), h());
|
|
1215
1223
|
});
|
|
1216
|
-
const
|
|
1217
|
-
let
|
|
1218
|
-
function oe(
|
|
1219
|
-
|
|
1224
|
+
const w = S(!1);
|
|
1225
|
+
let N = null, U = !1;
|
|
1226
|
+
function oe(R) {
|
|
1227
|
+
N = { x: R.clientX, y: R.clientY, px: r.value.x, py: r.value.y }, w.value = !0, U = !1, R.currentTarget.setPointerCapture(R.pointerId);
|
|
1220
1228
|
}
|
|
1221
|
-
function O(
|
|
1222
|
-
if (!
|
|
1223
|
-
const T =
|
|
1229
|
+
function O(R) {
|
|
1230
|
+
if (!N) return;
|
|
1231
|
+
const T = R.clientX - N.x, G = R.clientY - N.y;
|
|
1224
1232
|
Math.abs(T) + Math.abs(G) > 3 && (U = !0);
|
|
1225
1233
|
const { width: j, height: Q } = u();
|
|
1226
1234
|
r.value = {
|
|
1227
|
-
x: v(
|
|
1228
|
-
y: v(
|
|
1235
|
+
x: v(N.px + T, 0, window.innerWidth - j),
|
|
1236
|
+
y: v(N.py + G, 0, window.innerHeight - Q)
|
|
1229
1237
|
};
|
|
1230
1238
|
}
|
|
1231
1239
|
function I() {
|
|
1232
|
-
|
|
1240
|
+
N = null, w.value = !1, m();
|
|
1233
1241
|
}
|
|
1234
1242
|
function Y() {
|
|
1235
|
-
|
|
1243
|
+
N && (I(), U || (s.value = !0));
|
|
1236
1244
|
}
|
|
1237
|
-
return (
|
|
1245
|
+
return (R, T) => {
|
|
1238
1246
|
const G = H("FmIcon");
|
|
1239
|
-
return i(), pe(
|
|
1247
|
+
return i(), pe(vt, { to: "body" }, [
|
|
1240
1248
|
l.value ? (i(), c(z, { key: 0 }, [
|
|
1241
1249
|
g("div", {
|
|
1242
1250
|
ref_key: "wrapperRef",
|
|
1243
|
-
ref:
|
|
1244
|
-
class: se([
|
|
1245
|
-
|
|
1246
|
-
k.value ? "cursor-grabbing" : "cursor-grab transition-[left,top] duration-200 ease-out"
|
|
1247
|
-
]),
|
|
1248
|
-
style: yt({ left: `${r.value.x}px`, top: `${r.value.y}px` })
|
|
1251
|
+
ref: a,
|
|
1252
|
+
class: se(["fixed z-50 cursor-grab touch-none", w.value ? "" : "transition-[left,top] duration-200 ease-out"]),
|
|
1253
|
+
style: gt({ left: `${r.value.x}px`, top: `${r.value.y}px` })
|
|
1249
1254
|
}, [
|
|
1250
|
-
D(
|
|
1255
|
+
D(Pe, null, {
|
|
1251
1256
|
default: te(() => [
|
|
1252
1257
|
g("button", {
|
|
1253
1258
|
type: "button",
|
|
1254
|
-
title:
|
|
1255
|
-
class: "fm-typo-en-body-sm-600 flex h-48 items-center gap-8 whitespace-nowrap rounded-full border border-gray-200 bg-white px-16 shadow-lg hover:bg-gray-50",
|
|
1259
|
+
title: $(e)("inventory.changelog.title"),
|
|
1260
|
+
class: se(["fm-typo-en-body-sm-600 flex h-48 items-center gap-8 whitespace-nowrap rounded-full border border-gray-200 bg-white px-16 shadow-lg hover:bg-gray-50", w.value ? "cursor-grabbing" : "cursor-grab"]),
|
|
1256
1261
|
onPointerdown: oe,
|
|
1257
1262
|
onPointermove: O,
|
|
1258
1263
|
onPointerup: Y,
|
|
@@ -1263,13 +1268,13 @@ const mn = {
|
|
|
1263
1268
|
size: "md",
|
|
1264
1269
|
outline: ""
|
|
1265
1270
|
}),
|
|
1266
|
-
g("span", null, _(
|
|
1267
|
-
],
|
|
1271
|
+
g("span", null, _($(e)("inventory.changelog.fabLabel")), 1)
|
|
1272
|
+
], 42, po)
|
|
1268
1273
|
]),
|
|
1269
1274
|
_: 1
|
|
1270
1275
|
})
|
|
1271
1276
|
], 6),
|
|
1272
|
-
D(
|
|
1277
|
+
D(fo, {
|
|
1273
1278
|
modelValue: s.value,
|
|
1274
1279
|
"onUpdate:modelValue": T[0] || (T[0] = (j) => s.value = j)
|
|
1275
1280
|
}, null, 8, ["modelValue"])
|
|
@@ -1277,34 +1282,34 @@ const mn = {
|
|
|
1277
1282
|
]);
|
|
1278
1283
|
};
|
|
1279
1284
|
}
|
|
1280
|
-
}),
|
|
1285
|
+
}), yo = { class: "flex items-center gap-2" }, ho = { class: "text-xs text-gray-400 font-normal" }, _o = { class: "flex flex-col gap-3" }, xo = { class: "max-h-[480px] flex flex-col gap-1" }, bo = { class: "font-mono text-xs text-gray-700 break-all min-w-0" }, wo = {
|
|
1281
1286
|
key: 0,
|
|
1282
1287
|
class: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 px-2 py-0.5 rounded-full"
|
|
1283
|
-
},
|
|
1288
|
+
}, ko = {
|
|
1284
1289
|
key: 1,
|
|
1285
1290
|
class: "inline-flex items-center gap-1 text-xs font-medium text-red-700 bg-red-50 px-2 py-0.5 rounded-full"
|
|
1286
|
-
},
|
|
1291
|
+
}, So = {
|
|
1287
1292
|
key: 2,
|
|
1288
1293
|
class: "inline-flex items-center gap-1 text-xs font-medium text-gray-500 bg-gray-100 px-2 py-0.5 rounded-full"
|
|
1289
|
-
},
|
|
1294
|
+
}, $o = {
|
|
1290
1295
|
key: 0,
|
|
1291
1296
|
class: "text-center text-sm text-gray-400 py-4"
|
|
1292
|
-
},
|
|
1297
|
+
}, Lo = /* @__PURE__ */ ce({
|
|
1293
1298
|
__name: "FmFeatureFlagDialog",
|
|
1294
|
-
setup(
|
|
1295
|
-
const e =
|
|
1296
|
-
const { getFlagValue: u } =
|
|
1297
|
-
return Object.values(
|
|
1299
|
+
setup(o) {
|
|
1300
|
+
const e = S(!1), t = S(""), l = C(() => {
|
|
1301
|
+
const { getFlagValue: u } = $t();
|
|
1302
|
+
return Object.values(Lt).map((r) => {
|
|
1298
1303
|
const v = u(r, (m) => m === "true");
|
|
1299
1304
|
return {
|
|
1300
1305
|
name: r,
|
|
1301
1306
|
enabled: v
|
|
1302
1307
|
};
|
|
1303
1308
|
});
|
|
1304
|
-
}), s =
|
|
1309
|
+
}), s = C(() => {
|
|
1305
1310
|
const u = t.value.toLowerCase();
|
|
1306
1311
|
return u ? l.value.filter((r) => r.name.toLowerCase().includes(u)) : l.value;
|
|
1307
|
-
}),
|
|
1312
|
+
}), a = C(() => {
|
|
1308
1313
|
const u = l.value.filter((m) => m.enabled === !0).length, r = l.value.filter((m) => m.enabled === !1).length, v = l.value.filter((m) => m.enabled === null).length;
|
|
1309
1314
|
return { enabled: u, disabled: r, unknown: v, total: l.value.length };
|
|
1310
1315
|
});
|
|
@@ -1312,11 +1317,11 @@ const mn = {
|
|
|
1312
1317
|
const v = H("FmButton"), m = H("FmSpacer"), h = H("FmDialog");
|
|
1313
1318
|
return i(), pe(h, {
|
|
1314
1319
|
modelValue: e.value,
|
|
1315
|
-
"onUpdate:modelValue": r[2] || (r[2] = (
|
|
1320
|
+
"onUpdate:modelValue": r[2] || (r[2] = (w) => e.value = w),
|
|
1316
1321
|
overlay: !0
|
|
1317
1322
|
}, {
|
|
1318
1323
|
"dialog-button": te(() => [
|
|
1319
|
-
D(
|
|
1324
|
+
D(Pe, null, {
|
|
1320
1325
|
default: te(() => [
|
|
1321
1326
|
D(v, {
|
|
1322
1327
|
variant: "secondary",
|
|
@@ -1327,9 +1332,9 @@ const mn = {
|
|
|
1327
1332
|
})
|
|
1328
1333
|
]),
|
|
1329
1334
|
"dialog-header": te(() => [
|
|
1330
|
-
g("div",
|
|
1335
|
+
g("div", yo, [
|
|
1331
1336
|
r[3] || (r[3] = g("span", null, "Feature Flags", -1)),
|
|
1332
|
-
g("span",
|
|
1337
|
+
g("span", ho, _(a.value.enabled) + " enabled · " + _(a.value.disabled) + " disabled · " + _(a.value.unknown) + " unknown ", 1)
|
|
1333
1338
|
])
|
|
1334
1339
|
]),
|
|
1335
1340
|
"dialog-footer": te(() => [
|
|
@@ -1339,37 +1344,37 @@ const mn = {
|
|
|
1339
1344
|
label: "Close",
|
|
1340
1345
|
size: "md",
|
|
1341
1346
|
variant: "primary",
|
|
1342
|
-
onClick: r[1] || (r[1] = (
|
|
1347
|
+
onClick: r[1] || (r[1] = (w) => e.value = !1)
|
|
1343
1348
|
})
|
|
1344
1349
|
]),
|
|
1345
1350
|
default: te(() => [
|
|
1346
|
-
g("div",
|
|
1347
|
-
|
|
1348
|
-
"onUpdate:modelValue": r[0] || (r[0] = (
|
|
1351
|
+
g("div", _o, [
|
|
1352
|
+
yt(g("input", {
|
|
1353
|
+
"onUpdate:modelValue": r[0] || (r[0] = (w) => t.value = w),
|
|
1349
1354
|
type: "text",
|
|
1350
1355
|
placeholder: "Search flags...",
|
|
1351
1356
|
class: "w-full px-3 py-2 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500"
|
|
1352
1357
|
}, null, 512), [
|
|
1353
|
-
[
|
|
1358
|
+
[ht, t.value]
|
|
1354
1359
|
]),
|
|
1355
|
-
g("div",
|
|
1356
|
-
(i(!0), c(z, null, ne(s.value, (
|
|
1357
|
-
key:
|
|
1360
|
+
g("div", xo, [
|
|
1361
|
+
(i(!0), c(z, null, ne(s.value, (w) => (i(), c("div", {
|
|
1362
|
+
key: w.name,
|
|
1358
1363
|
class: "flex items-start justify-between gap-2 px-3 py-2 rounded-md hover:bg-gray-50 text-sm"
|
|
1359
1364
|
}, [
|
|
1360
|
-
g("span",
|
|
1361
|
-
|
|
1365
|
+
g("span", bo, _(w.name), 1),
|
|
1366
|
+
w.enabled === !0 ? (i(), c("span", wo, r[4] || (r[4] = [
|
|
1362
1367
|
g("span", { class: "w-1.5 h-1.5 rounded-full bg-green-500" }, null, -1),
|
|
1363
|
-
|
|
1364
|
-
]))) :
|
|
1368
|
+
re(" Enabled ")
|
|
1369
|
+
]))) : w.enabled === !1 ? (i(), c("span", ko, r[5] || (r[5] = [
|
|
1365
1370
|
g("span", { class: "w-1.5 h-1.5 rounded-full bg-red-500" }, null, -1),
|
|
1366
|
-
|
|
1367
|
-
]))) : (i(), c("span",
|
|
1371
|
+
re(" Disabled ")
|
|
1372
|
+
]))) : (i(), c("span", So, r[6] || (r[6] = [
|
|
1368
1373
|
g("span", { class: "w-1.5 h-1.5 rounded-full bg-gray-400" }, null, -1),
|
|
1369
|
-
|
|
1374
|
+
re(" Unknown ")
|
|
1370
1375
|
])))
|
|
1371
1376
|
]))), 128)),
|
|
1372
|
-
s.value.length === 0 ? (i(), c("div",
|
|
1377
|
+
s.value.length === 0 ? (i(), c("div", $o, ' No flags matching "' + _(t.value) + '" ', 1)) : E("", !0)
|
|
1373
1378
|
])
|
|
1374
1379
|
])
|
|
1375
1380
|
]),
|
|
@@ -1377,14 +1382,14 @@ const mn = {
|
|
|
1377
1382
|
}, 8, ["modelValue"]);
|
|
1378
1383
|
};
|
|
1379
1384
|
}
|
|
1380
|
-
}),
|
|
1385
|
+
}), Ro = { class: "h-full flex flex-col overflow-auto py-16 gap-2" }, Co = /* @__PURE__ */ ce({
|
|
1381
1386
|
__name: "NavigationTab",
|
|
1382
|
-
setup(
|
|
1383
|
-
const e =
|
|
1384
|
-
q([() => l.currentBusiness.value, () => e.name], ([h,
|
|
1385
|
-
(h == null ? void 0 : h.menuVersion) === "v3" && (
|
|
1387
|
+
setup(o) {
|
|
1388
|
+
const e = kt(), t = Ee(), l = ge(), s = Tt(), { menuItems: a } = He();
|
|
1389
|
+
q([() => l.currentBusiness.value, () => e.name], ([h, w]) => {
|
|
1390
|
+
(h == null ? void 0 : h.menuVersion) === "v3" && (w === ue.INGREDIENTS || w === ue.RECIPE || w === ue.UNIT) && t.push({ name: ue.STOCK });
|
|
1386
1391
|
});
|
|
1387
|
-
const u =
|
|
1392
|
+
const u = C({
|
|
1388
1393
|
get() {
|
|
1389
1394
|
if (e.name)
|
|
1390
1395
|
return String(e.name);
|
|
@@ -1392,12 +1397,12 @@ const mn = {
|
|
|
1392
1397
|
set(h) {
|
|
1393
1398
|
h && t.push({ name: h });
|
|
1394
1399
|
}
|
|
1395
|
-
}), r =
|
|
1400
|
+
}), r = C(
|
|
1396
1401
|
() => {
|
|
1397
1402
|
var h;
|
|
1398
1403
|
return `NavigationTab.${(h = l.currentBusiness.value) == null ? void 0 : h._id}`;
|
|
1399
1404
|
}
|
|
1400
|
-
), v =
|
|
1405
|
+
), v = S(!1), m = C({
|
|
1401
1406
|
get() {
|
|
1402
1407
|
return v.value;
|
|
1403
1408
|
},
|
|
@@ -1409,32 +1414,32 @@ const mn = {
|
|
|
1409
1414
|
v.value = !1, setTimeout(() => {
|
|
1410
1415
|
m.value = !s.getItem(r.value);
|
|
1411
1416
|
}, 2e3);
|
|
1412
|
-
}), (h,
|
|
1413
|
-
const
|
|
1414
|
-
return i(), c("div",
|
|
1415
|
-
D(
|
|
1416
|
-
D(
|
|
1417
|
+
}), (h, w) => {
|
|
1418
|
+
const N = H("FmCollapsibleTabs");
|
|
1419
|
+
return i(), c("div", Ro, [
|
|
1420
|
+
D(Lo),
|
|
1421
|
+
D(N, {
|
|
1417
1422
|
modelValue: u.value,
|
|
1418
|
-
"onUpdate:modelValue":
|
|
1419
|
-
items:
|
|
1423
|
+
"onUpdate:modelValue": w[0] || (w[0] = (U) => u.value = U),
|
|
1424
|
+
items: $(a)
|
|
1420
1425
|
}, null, 8, ["modelValue", "items"])
|
|
1421
1426
|
]);
|
|
1422
1427
|
};
|
|
1423
1428
|
}
|
|
1424
1429
|
});
|
|
1425
1430
|
typeof Promise.withResolvers > "u" && (Promise.withResolvers = () => {
|
|
1426
|
-
let
|
|
1431
|
+
let o, e;
|
|
1427
1432
|
return { promise: new Promise((l, s) => {
|
|
1428
|
-
|
|
1429
|
-
}), resolve:
|
|
1433
|
+
o = l, e = s;
|
|
1434
|
+
}), resolve: o, reject: e };
|
|
1430
1435
|
});
|
|
1431
|
-
typeof Promise.prototype.delayed > "u" && (Promise.prototype.delayed = async function(
|
|
1432
|
-
return await new Promise((e) => setTimeout(e,
|
|
1436
|
+
typeof Promise.prototype.delayed > "u" && (Promise.prototype.delayed = async function(o) {
|
|
1437
|
+
return await new Promise((e) => setTimeout(e, o)), Promise.resolve(this);
|
|
1433
1438
|
});
|
|
1434
|
-
const
|
|
1439
|
+
const Ko = /* @__PURE__ */ ce({
|
|
1435
1440
|
__name: "App",
|
|
1436
|
-
setup(
|
|
1437
|
-
const e = ge(), t =
|
|
1441
|
+
setup(o) {
|
|
1442
|
+
const e = ge(), t = Vt(), l = wt(), s = window.location.href.includes("print-preview");
|
|
1438
1443
|
Fe(() => {
|
|
1439
1444
|
if (window.location.href.includes("print-preview")) {
|
|
1440
1445
|
e.setEmbedded(!0), document.body.classList.add("print-mode");
|
|
@@ -1444,9 +1449,9 @@ const jo = /* @__PURE__ */ ce({
|
|
|
1444
1449
|
console.error("Google map cannot be loaded");
|
|
1445
1450
|
});
|
|
1446
1451
|
}), q([() => e.currentCountry.value], () => {
|
|
1447
|
-
|
|
1452
|
+
a();
|
|
1448
1453
|
});
|
|
1449
|
-
async function
|
|
1454
|
+
async function a() {
|
|
1450
1455
|
var u;
|
|
1451
1456
|
try {
|
|
1452
1457
|
await e.readBusinesses(), e.currentBusiness.value = (u = e.businesses.value) == null ? void 0 : u.find((r) => r);
|
|
@@ -1455,11 +1460,11 @@ const jo = /* @__PURE__ */ ce({
|
|
|
1455
1460
|
}
|
|
1456
1461
|
}
|
|
1457
1462
|
return (u, r) => (i(), c(z, null, [
|
|
1458
|
-
D(
|
|
1459
|
-
|
|
1463
|
+
D(Zt),
|
|
1464
|
+
$(s) ? E("", !0) : (i(), pe(go, { key: 0 }))
|
|
1460
1465
|
], 64));
|
|
1461
1466
|
}
|
|
1462
1467
|
});
|
|
1463
1468
|
export {
|
|
1464
|
-
|
|
1469
|
+
Ko as default
|
|
1465
1470
|
};
|