@feedmepos/mf-inventory-portal 1.8.1 → 1.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{App-BPhAFsnf.js → App-dPmHx6yu.js} +500 -499
- package/dist/{ApprovalView-DuJIX7ux.js → ApprovalView-DgtYa5fe.js} +9 -9
- package/dist/{BindingsDialog-BiNopu6T.js → BindingsDialog-BDxnEduy.js} +2 -2
- package/dist/{BindingsPicker-C2GUK3np.js → BindingsPicker-CU4L71lq.js} +2 -2
- package/dist/{BindingsTable-DlPl5o1h.js → BindingsTable-CIgv0rsF.js} +4 -4
- package/dist/{BulkReceiveRequestPage-YtqUSPUN.js → BulkReceiveRequestPage-6dF9r-mz.js} +21 -21
- package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-CAKGP0N3.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-DdhFwF_6.js} +1 -1
- package/dist/{ClosingDraftView-C0XEpqat.js → ClosingDraftView-B7SnGjGQ.js} +19 -19
- package/dist/{ClosingHistoryView-C2Bl2vnF.js → ClosingHistoryView-CvnkFqgN.js} +7 -7
- package/dist/{ClosingTemplateView-DAXyH1l9.js → ClosingTemplateView-Ci4q3Eok.js} +18 -18
- package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-sP8-Pw8r.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-D4cDxN4Q.js} +1 -1
- package/dist/{DefaultView-QUjOTT9z.js → DefaultView-M_bM_S8P.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-CNO7dng4.js → DeliveryOrderPrintPreview-C8Wwriji.js} +2 -2
- package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-MiLvwxSQ.js → EmailDialog.vue_vue_type_script_setup_true_lang-icB0dmIu.js} +23 -23
- package/dist/{FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-Bo7xjTer.js → FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-BlBO823W.js} +1 -1
- package/dist/{FeatureCapabilityGate-CQrRBMcC.js → FeatureCapabilityGate-DLf5LdXz.js} +2 -2
- package/dist/{FeaturePageGate.vue_vue_type_script_setup_true_lang-CIKrUrln.js → FeaturePageGate.vue_vue_type_script_setup_true_lang-BmkxjjKw.js} +1 -1
- package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-DfCQ8SNd.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-BbKcW3S_.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BTeJz4Mm.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BCAV7Im3.js} +2 -2
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DiwH0vnm.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-_vGS-Cr4.js} +28 -24
- package/dist/{FmMultiselectDialog-BZvKKnBB.js → FmMultiselectDialog-CsN4Ii6h.js} +2 -2
- package/dist/{FmMultiselectDialog-Dne8GSe8.js → FmMultiselectDialog-DeDs-TIr.js} +2 -2
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-D1-MLyJi.js → FmUnitInput.vue_vue_type_script_setup_true_lang-f1NlYq6J.js} +5 -5
- package/dist/{ImportView-Dr-2cv9N.js → ImportView-CX4_wi57.js} +7 -7
- package/dist/{IngredientsView-BnaNrWb7.js → IngredientsView-DoNd32Ib.js} +15 -15
- package/dist/{IntegrationExplorerView-Bjflxeha.js → IntegrationExplorerView-BTdmAin2.js} +6 -6
- package/dist/{IntegrationPlatformView-fO7R9fGT.js → IntegrationPlatformView-DKXQMng3.js} +2 -2
- package/dist/{IntegrationView-CxpmB0o2.js → IntegrationView-ORNTg24P.js} +3049 -3032
- package/dist/{InventoryBindingForm-DbgvnZ9I.js → InventoryBindingForm-x2LSXl9d.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-3stkPlAW.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-ChS4qHky.js} +4 -4
- package/dist/{InventoryBindingSummary-BrIFW5dO.js → InventoryBindingSummary-fmTmxL2I.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BAVjiZbm.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DWtQm-Wt.js} +2 -2
- package/dist/{ProductionRunDetailPage-DhImFq9B.js → ProductionRunDetailPage-CZUf9YLY.js} +4 -4
- package/dist/{ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-CCUBGX4K.js → ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-B8gRymyO.js} +8 -8
- package/dist/{ProductionRunPage-D9SaErg3.js → ProductionRunPage-Bp0Wnkg0.js} +4 -4
- package/dist/PublishView-CuXkWOeY.js +282 -0
- package/dist/{PurchaseOrderPrintPreview-CvplcGNv.js → PurchaseOrderPrintPreview-UasE6Fqr.js} +2 -2
- package/dist/{ReceiveRequestView-DAN7eOH5.js → ReceiveRequestView-QoBax953.js} +13 -13
- package/dist/{RecipeView-CgJcpA_f.js → RecipeView-BNpt7mbz.js} +16 -16
- package/dist/{SettingsView-I1XEa1NJ.js → SettingsView-CWCHOfEp.js} +7 -7
- package/dist/{StockView-C2tK0oPv.js → StockView-BYhMoXqP.js} +21 -21
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DSz37GY_.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DK360rT4.js} +1 -1
- package/dist/{SupplierView-C69gOB_i.js → SupplierView-pKEJiboE.js} +13 -13
- package/dist/{SurchargeView-DfDtR1jP.js → SurchargeView-muI0OHV3.js} +7 -7
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-CWD44FiP.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-Bp6i0ciG.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-5RLeEfkg.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-DM5BKMB_.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-Dzlex2fK.js → TransferDetails.vue_vue_type_script_setup_true_lang-CNSfZLiT.js} +21 -21
- package/dist/{TransferTemplateView-Dc892CSr.js → TransferTemplateView-DZuCe50F.js} +19 -19
- package/dist/{UnitCostHistoryView-DkuDLBSq.js → UnitCostHistoryView-BuZUjek3.js} +4 -4
- package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-3Iyv5v10.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-BFznmzuq.js} +4 -4
- package/dist/{UnitView-CakqjGDe.js → UnitView-C1tgtn8C.js} +7 -7
- package/dist/{WarehouseView-AUPuNwRA.js → WarehouseView-B2K-eE4X.js} +8 -8
- package/dist/{WastageTemplateView-1kxcX31h.js → WastageTemplateView-BwrSszU4.js} +15 -15
- package/dist/api/inventory.d.ts +22 -91
- package/dist/{app-tiHt7P8o.js → app-B9scy5at.js} +1971 -1999
- package/dist/app.js +1 -1
- package/dist/{bulk-edit-simulation.helper-D490leZh.js → bulk-edit-simulation.helper-WjS-_pe-.js} +2 -2
- package/dist/{closing-template-CAahWrPo.js → closing-template-BTzPwPC9.js} +1 -1
- package/dist/components/FmInventoryTableToolbar.vue.d.ts +7 -0
- package/dist/{date2-CKKZ3b1E.js → date2-D7Le3_bn.js} +1 -1
- package/dist/{dayjs.min-CXmScEL-.js → dayjs.min-D6kI4XKV.js} +1 -1
- package/dist/{decimal-CE8yRxZg.js → decimal-BgcHXtEW.js} +2 -2
- package/dist/{defineDeepModel-BRZrUePH.js → defineDeepModel-1Dyqqhij.js} +1 -1
- package/dist/{duplicate-template-DGrH04lc.js → duplicate-template-BwbInaPK.js} +1 -1
- package/dist/{feature-BuUIX2LY.js → feature-Bq8EXhKG.js} +2 -2
- package/dist/{format-time-from-id-BQOfGm26.js → format-time-from-id-Cvflm51N.js} +1 -1
- package/dist/{format-unit-display-BuBfy3bb.js → format-unit-display-Bg7Ff76p.js} +12 -12
- package/dist/{id-to-date-B_aPAdeF.js → id-to-date-DAY1m6PQ.js} +1 -1
- package/dist/{import-export.helper-DPqodvrw.js → import-export.helper-0PY9JJKl.js} +5 -5
- package/dist/{index-EgLlcZ4g.js → index-7umhUG8Q.js} +3 -3
- package/dist/{index-yTHfPUVq.js → index-BK3t_4us.js} +1 -1
- package/dist/{index-CBkSXbQw.js → index-BYyRelZz.js} +1 -1
- package/dist/{lz-string-Dgq0u7oK.js → lz-string-CK3kC4Eb.js} +1 -1
- package/dist/{netsuite-BgB1tjJx.js → netsuite-Cqoa7t4H.js} +2 -2
- package/dist/{netsuite-explorer-BMtIwGyi.js → netsuite-explorer-D96IbnhU.js} +1 -1
- package/dist/{predefined-templates-BiuP4m7R.js → predefined-templates-B9c2s33F.js} +1 -1
- package/dist/publish-versions-JlA3KSXU.js +87 -0
- package/dist/{purchase-order-template-D5Z0bPLL.js → purchase-order-template-BFrjEkhb.js} +1 -1
- package/dist/{recalculationUtils-BitV6W_8.js → recalculationUtils-anW9vYxT.js} +1 -1
- package/dist/{row-action.enum-CTNl1V0l.js → row-action.enum-BDYmiPNT.js} +1 -1
- package/dist/{rules-BpG29H9Z.js → rules-BRjC9u5h.js} +3 -3
- package/dist/{stock-DNV9xfbE.js → stock-DusWqnp5.js} +1 -1
- package/dist/{stock-DTzUuxKl.js → stock-RwhIoJMM.js} +2 -2
- package/dist/stores/location.d.ts +0 -289
- package/dist/stores/publish-versions.d.ts +19 -0
- package/dist/stores/publish-versions.spec.d.ts +1 -0
- package/dist/{supplier-8uMx5fFa.js → supplier-0dQn8fQ8.js} +2 -2
- package/dist/{surcharge-D0c44dor.js → surcharge-i2ndhTQn.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{uom-rules-BErW6UQ4.js → uom-rules-CJfwzrbF.js} +1 -1
- package/dist/{use-ingredient-select-dialog-CZTe4ayv.js → use-ingredient-select-dialog-CnUVZRMN.js} +2 -2
- package/dist/{use-inventory-binding-dialog-D_N7K7pw.js → use-inventory-binding-dialog-3c697f9B.js} +2 -2
- package/dist/{use-template-enabled-locations-C1xNZr4V.js → use-template-enabled-locations-DsR1qSPK.js} +2 -2
- package/dist/{use-transfer-locations-BlSNA3qv.js → use-transfer-locations-Cqd4RYpk.js} +2 -2
- package/dist/{useHrmPermission-Bd1_Ia_U.js → useHrmPermission-COaQXmjc.js} +1 -1
- package/dist/{useNavigationMenu-DXrUeRX9.js → useNavigationMenu-CfNedojJ.js} +85 -65
- package/dist/{useSseClient-Di0ywAz-.js → useSseClient-7I7QwRxw.js} +1 -1
- package/dist/views/publish/PublishView.spec.d.ts +1 -0
- package/dist/{vue-C029rfpt.js → vue-BUGlBKP5.js} +2 -2
- package/dist/{vue-i18n-Bg7KOfUG.js → vue-i18n-DMio3L-b.js} +331 -331
- package/dist/{xlsx.util-BQrh6imS.js → xlsx.util-BUw39hzN.js} +2 -2
- package/package.json +5 -4
- package/dist/PublishView-CmqorDCm.js +0 -213
|
@@ -1,31 +1,32 @@
|
|
|
1
|
-
import { ref as
|
|
1
|
+
import { ref as k, onUnmounted as mt, computed as V, defineComponent as ue, watch as q, onMounted as Ie, resolveComponent as Y, createElementBlock as m, openBlock as i, createBlock as ie, createCommentVNode as E, unref as R, createVNode as I, createElementVNode as S, toDisplayString as w, Fragment as H, renderList as oe, withKeys as Me, normalizeClass as ae, withModifiers as pt, withCtx as le, createTextVNode as ve, h as vt, onBeforeUnmount as gt, nextTick as yt, Teleport as ht, normalizeStyle as _t, mergeModels as Ue, useModel as bt } from "vue";
|
|
2
2
|
import { _ as xt } from "./empty-placeholder-B0QU467o.js";
|
|
3
3
|
import { _ as wt } from "./PremiumUpgradePage.vue_vue_type_script_setup_true_lang-DGAxPOEh.js";
|
|
4
|
-
import { u as He, a as Je, R as me, d as kt, S as St, b as $t } from "./app-
|
|
4
|
+
import { u as He, a as Je, R as me, d as kt, S as St, b as $t } from "./app-B9scy5at.js";
|
|
5
5
|
import { useCoreStore as ge, useI18n as he } from "@feedmepos/mf-common";
|
|
6
6
|
import { useRouter as Ne, useRoute as Ct } from "vue-router";
|
|
7
|
-
import { u as Lt } from "./feature-
|
|
8
|
-
import { u as Rt } from "./netsuite-
|
|
9
|
-
import { u as
|
|
10
|
-
import {
|
|
7
|
+
import { u as Lt } from "./feature-Bq8EXhKG.js";
|
|
8
|
+
import { u as Rt } from "./netsuite-Cqoa7t4H.js";
|
|
9
|
+
import { u as Dt } from "./publish-versions-JlA3KSXU.js";
|
|
10
|
+
import { u as Ye, n as Vt, e as It } from "./useNavigationMenu-CfNedojJ.js";
|
|
11
|
+
import { useBreakpoints as Nt } from "@feedmepos/ui-library";
|
|
11
12
|
import { F as We } from "./FmAdminBadge-DlplQOHb.js";
|
|
12
|
-
import { i as
|
|
13
|
-
import { F as
|
|
14
|
-
import { t as
|
|
15
|
-
import { _ as
|
|
16
|
-
import { u as
|
|
17
|
-
import { _ as
|
|
18
|
-
import { D as
|
|
19
|
-
import { u as
|
|
20
|
-
import { u as
|
|
21
|
-
function
|
|
13
|
+
import { i as Et, _ as Tt } from "./FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-BbKcW3S_.js";
|
|
14
|
+
import { F as Pt } from "./decimal-BgcHXtEW.js";
|
|
15
|
+
import { t as Bt, a as Ft } from "./date2-D7Le3_bn.js";
|
|
16
|
+
import { _ as At } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
17
|
+
import { u as Mt } from "./useTabStorage-BkIVScW_.js";
|
|
18
|
+
import { _ as Ut } from "./PlanUpgradeDialog.vue_vue_type_script_setup_true_lang-0F-yOcPC.js";
|
|
19
|
+
import { D as Ot } from "./FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-BlBO823W.js";
|
|
20
|
+
import { u as Kt, g as Oe } from "./vue-BUGlBKP5.js";
|
|
21
|
+
import { u as zt } from "./googlemap-D9vA7GsS.js";
|
|
22
|
+
function jt() {
|
|
22
23
|
return {
|
|
23
24
|
loadingHookInstalled: !1,
|
|
24
25
|
isLoading: !1
|
|
25
26
|
};
|
|
26
27
|
}
|
|
27
|
-
const fe =
|
|
28
|
-
function
|
|
28
|
+
const fe = k(jt());
|
|
29
|
+
function Gt() {
|
|
29
30
|
const o = Ne();
|
|
30
31
|
if (!fe.value.loadingHookInstalled) {
|
|
31
32
|
fe.value.loadingHookInstalled = !0;
|
|
@@ -44,72 +45,72 @@ function jt() {
|
|
|
44
45
|
}
|
|
45
46
|
};
|
|
46
47
|
}
|
|
47
|
-
function
|
|
48
|
+
function Ht() {
|
|
48
49
|
const { firstAccessibleRouteName: o } = Ye();
|
|
49
50
|
return { hasAnyAccessibleInventoryRoute: V(() => o.value !== null) };
|
|
50
51
|
}
|
|
51
|
-
const
|
|
52
|
+
const Jt = {
|
|
52
53
|
key: 0,
|
|
53
54
|
class: "flex flex-col items-center w-full h-full gap-24"
|
|
54
|
-
},
|
|
55
|
+
}, Yt = {
|
|
55
56
|
key: 1,
|
|
56
57
|
class: "flex flex-col pt-[200px] gap-32 items-center"
|
|
57
|
-
},
|
|
58
|
+
}, Wt = { class: "flex flex-col gap-12 items-center text-center px-24 max-w-[600px]" }, Xt = { class: "fm-typo-en-title-lg-600" }, qt = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, Zt = /* @__PURE__ */ ue({
|
|
58
59
|
__name: "InventoryView",
|
|
59
60
|
setup(o) {
|
|
60
|
-
const e = He(), t = Je(),
|
|
61
|
-
|
|
62
|
-
[() =>
|
|
63
|
-
([
|
|
64
|
-
|
|
61
|
+
const e = He(), t = Je(), s = Rt(), l = Dt(), a = ge(), r = Ne(), u = Gt(), v = Lt(), { t: p } = he(), { hasAnyAccessibleInventoryRoute: L } = Ht();
|
|
62
|
+
q(
|
|
63
|
+
[() => a.sessionUser.value, () => a.currentBusiness.value],
|
|
64
|
+
([D, B]) => {
|
|
65
|
+
F(D, B);
|
|
65
66
|
}
|
|
66
67
|
), Ie(async () => {
|
|
67
|
-
await
|
|
68
|
-
const
|
|
69
|
-
|
|
68
|
+
await v.init(), await a.readBusinesses();
|
|
69
|
+
const D = a.sessionUser.value, B = a.currentBusiness.value;
|
|
70
|
+
F(D, B);
|
|
70
71
|
});
|
|
71
|
-
function
|
|
72
|
-
!
|
|
72
|
+
function F(D, B) {
|
|
73
|
+
!D || !B || A();
|
|
73
74
|
}
|
|
74
|
-
async function
|
|
75
|
-
return await e.init(), await
|
|
76
|
-
console.error("[all] error on reading netsuite store",
|
|
75
|
+
async function A() {
|
|
76
|
+
return await e.init(), l.loadAll().catch(console.error), await s.readSetting().catch((D) => {
|
|
77
|
+
console.error("[all] error on reading netsuite store", D);
|
|
77
78
|
}), await t.init();
|
|
78
79
|
}
|
|
79
|
-
const
|
|
80
|
-
() =>
|
|
81
|
-
var
|
|
82
|
-
const
|
|
83
|
-
return (((
|
|
80
|
+
const K = V(() => r.currentRoute.value.name === me.TRANSFER_TEMPLATE ? v.enablePoTemplate : !0), Z = V(
|
|
81
|
+
() => r.currentRoute.value.matched.some((D) => {
|
|
82
|
+
var y;
|
|
83
|
+
const B = D.meta, b = B == null ? void 0 : B.validationManifest;
|
|
84
|
+
return (((y = b == null ? void 0 : b.requiredCaslPermissions) == null ? void 0 : y.length) ?? 0) > 0;
|
|
84
85
|
})
|
|
85
|
-
),
|
|
86
|
-
if (!
|
|
86
|
+
), te = V(() => {
|
|
87
|
+
if (!a.sessionUser.value) return !1;
|
|
87
88
|
if (e._locations !== null && e.locations.length === 0) return !0;
|
|
88
|
-
if (!
|
|
89
|
-
const
|
|
90
|
-
return !
|
|
89
|
+
if (!v.isLoaded) return !1;
|
|
90
|
+
const b = r.currentRoute.value.name === me.LOADING;
|
|
91
|
+
return !L.value && (b || Z.value);
|
|
91
92
|
});
|
|
92
|
-
return (
|
|
93
|
-
const
|
|
93
|
+
return (D, B) => {
|
|
94
|
+
const b = Y("FmSpacer"), y = Y("FmCircularProgress"), x = Y("RouterView");
|
|
94
95
|
return i(), m("div", null, [
|
|
95
|
-
|
|
96
|
-
I(
|
|
97
|
-
|
|
98
|
-
I(
|
|
96
|
+
R(u).isLoading ? (i(), m("div", Jt, [
|
|
97
|
+
I(b),
|
|
98
|
+
S("div", null, [
|
|
99
|
+
I(y, { size: "xl" })
|
|
99
100
|
]),
|
|
100
|
-
|
|
101
|
-
I(
|
|
102
|
-
])) :
|
|
103
|
-
|
|
101
|
+
B[0] || (B[0] = S("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading page...", -1)),
|
|
102
|
+
I(b)
|
|
103
|
+
])) : te.value ? (i(), m("div", Yt, [
|
|
104
|
+
B[1] || (B[1] = S("img", {
|
|
104
105
|
src: xt,
|
|
105
106
|
alt: "No permission",
|
|
106
107
|
class: "w-[200px] h-[200px]"
|
|
107
108
|
}, null, -1)),
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
S("div", Wt, [
|
|
110
|
+
S("div", Xt, w(R(p)("inventory.common.noPermission.title")), 1),
|
|
111
|
+
S("div", qt, w(R(p)("inventory.common.noPermission.description")), 1)
|
|
111
112
|
])
|
|
112
|
-
])) :
|
|
113
|
+
])) : K.value ? R(a).sessionUser.value ? (i(), ie(x, { key: 3 })) : E("", !0) : (i(), ie(wt, { key: 2 }))
|
|
113
114
|
]);
|
|
114
115
|
};
|
|
115
116
|
}
|
|
@@ -186,7 +187,7 @@ const Ht = {
|
|
|
186
187
|
"contains.alternatives": "_id"
|
|
187
188
|
}
|
|
188
189
|
};
|
|
189
|
-
function
|
|
190
|
+
function Qt(o) {
|
|
190
191
|
return o instanceof St && o.errorResponse.statusCode === 409;
|
|
191
192
|
}
|
|
192
193
|
const _e = kt((o, e) => ({
|
|
@@ -195,11 +196,11 @@ const _e = kt((o, e) => ({
|
|
|
195
196
|
* The dbName scopes the (access-checked) backend route; only the bare id is
|
|
196
197
|
* sent — the backend rebuilds the docId server-side.
|
|
197
198
|
*/
|
|
198
|
-
async getRecordChangelog(t,
|
|
199
|
+
async getRecordChangelog(t, s, l, a) {
|
|
199
200
|
const r = t.indexOf("/");
|
|
200
201
|
if (r < 0) return [];
|
|
201
202
|
const u = t.slice(0, r), v = t.slice(r + 1), p = new URLSearchParams({ id: v });
|
|
202
|
-
|
|
203
|
+
s != null && p.set("limit", String(s)), a && p.set("before", a), l && (p.set("explain", "1"), p.set("schema", JSON.stringify(l)));
|
|
203
204
|
const L = `${o.inventoryBackendUrl}/${u}/changelog?${p.toString()}`;
|
|
204
205
|
return await e.get(L);
|
|
205
206
|
},
|
|
@@ -208,9 +209,9 @@ const _e = kt((o, e) => ({
|
|
|
208
209
|
* backend joins the orders to their newest commit, so no ids travel and the
|
|
209
210
|
* browser makes one request instead of list-then-ask-for-timestamps.
|
|
210
211
|
*/
|
|
211
|
-
async listPurchaseOrders(t,
|
|
212
|
+
async listPurchaseOrders(t, s, l) {
|
|
212
213
|
if (!t) return [];
|
|
213
|
-
const a = new URLSearchParams({ start:
|
|
214
|
+
const a = new URLSearchParams({ start: s, end: l }), r = `${o.inventoryBackendUrl}/${t}/changelog/purchase-order?${a}`;
|
|
214
215
|
return await e.get(r);
|
|
215
216
|
},
|
|
216
217
|
/**
|
|
@@ -218,9 +219,9 @@ const _e = kt((o, e) => ({
|
|
|
218
219
|
* Closing groups come back as rows of their own — their submit/approve/
|
|
219
220
|
* reject is recorded against the group document, not its parent.
|
|
220
221
|
*/
|
|
221
|
-
async listClosingDrafts(t,
|
|
222
|
+
async listClosingDrafts(t, s, l) {
|
|
222
223
|
if (!t) return [];
|
|
223
|
-
const a = new URLSearchParams({ start:
|
|
224
|
+
const a = new URLSearchParams({ start: s, end: l }), r = `${o.inventoryBackendUrl}/${t}/changelog/closing-draft?${a}`;
|
|
224
225
|
return await e.get(r);
|
|
225
226
|
},
|
|
226
227
|
/**
|
|
@@ -229,9 +230,9 @@ const _e = kt((o, e) => ({
|
|
|
229
230
|
* 409 (see isStateConflict) when the record's history predates the kit
|
|
230
231
|
* write path — the backend passthrough for kit httpapi's GET /api/state.
|
|
231
232
|
*/
|
|
232
|
-
async getState(t,
|
|
233
|
-
const a = new URLSearchParams({ id:
|
|
234
|
-
|
|
233
|
+
async getState(t, s, l) {
|
|
234
|
+
const a = new URLSearchParams({ id: s });
|
|
235
|
+
l && a.set("at", l);
|
|
235
236
|
const r = `${o.inventoryBackendUrl}/${t}/changelog/state?${a.toString()}`;
|
|
236
237
|
return await e.get(r);
|
|
237
238
|
},
|
|
@@ -243,87 +244,87 @@ const _e = kt((o, e) => ({
|
|
|
243
244
|
*/
|
|
244
245
|
async listDomains(t) {
|
|
245
246
|
if (!t) return [];
|
|
246
|
-
const
|
|
247
|
-
return await e.get(
|
|
247
|
+
const s = `${o.inventoryBackendUrl}/business_${t}/changelog/domains`;
|
|
248
|
+
return await e.get(s);
|
|
248
249
|
},
|
|
249
250
|
/**
|
|
250
251
|
* One generic domain's records, each with when it last changed. Business-
|
|
251
252
|
* scoped: the generic domains are configuration documents of the business
|
|
252
253
|
* db, not of a location.
|
|
253
254
|
*/
|
|
254
|
-
async listDomainRecords(t,
|
|
255
|
+
async listDomainRecords(t, s) {
|
|
255
256
|
if (!t) return [];
|
|
256
|
-
const
|
|
257
|
-
return await e.get(
|
|
257
|
+
const l = `${o.inventoryBackendUrl}/business_${t}/changelog/domain/${encodeURIComponent(s)}`;
|
|
258
|
+
return await e.get(l);
|
|
258
259
|
},
|
|
259
260
|
/**
|
|
260
261
|
* One inventory module's records, each with when it last changed. Business-
|
|
261
262
|
* scoped, so the db is `business_<id>` — the same prefixed name the record's
|
|
262
263
|
* own changelog docId carries.
|
|
263
264
|
*/
|
|
264
|
-
async listInventory(t,
|
|
265
|
+
async listInventory(t, s) {
|
|
265
266
|
if (!t) return [];
|
|
266
|
-
const
|
|
267
|
-
return await e.get(
|
|
267
|
+
const l = `${o.inventoryBackendUrl}/business_${t}/changelog/inventory?module=${s}`;
|
|
268
|
+
return await e.get(l);
|
|
268
269
|
}
|
|
269
270
|
})), Se = 50;
|
|
270
|
-
function
|
|
271
|
-
const o = _e(), e =
|
|
272
|
-
let
|
|
271
|
+
function en() {
|
|
272
|
+
const o = _e(), e = k([]), t = k(!1), s = k(!1);
|
|
273
|
+
let l = null, a = 0;
|
|
273
274
|
async function r(v, p, L) {
|
|
274
275
|
const F = ++a;
|
|
275
|
-
if (
|
|
276
|
+
if (l = null, s.value = !1, !v) {
|
|
276
277
|
e.value = [];
|
|
277
278
|
return;
|
|
278
279
|
}
|
|
279
280
|
t.value = !0;
|
|
280
281
|
try {
|
|
281
|
-
const
|
|
282
|
+
const A = p ?? Se, K = await o.getRecordChangelog(v, A, L);
|
|
282
283
|
if (F !== a) return;
|
|
283
|
-
e.value = K, p == null && (
|
|
284
|
-
} catch (
|
|
285
|
-
throw F === a && (e.value = []),
|
|
284
|
+
e.value = K, p == null && (l = { recordId: v, explain: L }, s.value = K.length === A);
|
|
285
|
+
} catch (A) {
|
|
286
|
+
throw F === a && (e.value = []), A;
|
|
286
287
|
} finally {
|
|
287
288
|
F === a && (t.value = !1);
|
|
288
289
|
}
|
|
289
290
|
}
|
|
290
291
|
async function u() {
|
|
291
292
|
const v = e.value[e.value.length - 1];
|
|
292
|
-
if (!
|
|
293
|
+
if (!l || !v || t.value || !s.value) return;
|
|
293
294
|
const p = a;
|
|
294
295
|
t.value = !0;
|
|
295
296
|
try {
|
|
296
|
-
const L = await o.getRecordChangelog(
|
|
297
|
+
const L = await o.getRecordChangelog(l.recordId, Se, l.explain, v.id);
|
|
297
298
|
if (p !== a) return;
|
|
298
|
-
e.value = [...e.value, ...L],
|
|
299
|
+
e.value = [...e.value, ...L], s.value = L.length === Se;
|
|
299
300
|
} finally {
|
|
300
301
|
p === a && (t.value = !1);
|
|
301
302
|
}
|
|
302
303
|
}
|
|
303
|
-
return { commits: e, isLoading: t, hasMore:
|
|
304
|
+
return { commits: e, isLoading: t, hasMore: s, load: r, loadMore: u };
|
|
304
305
|
}
|
|
305
306
|
const Xe = 1e3;
|
|
306
307
|
function Ke(o) {
|
|
307
308
|
const e = /^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2})(?:\.(\d+))?/.exec(o);
|
|
308
309
|
return e ? `${e[1]}.${(e[2] ?? "").padEnd(9, "0").slice(0, 9)}` : o;
|
|
309
310
|
}
|
|
310
|
-
function
|
|
311
|
+
function tn(o, e) {
|
|
311
312
|
return [...o, ...e].sort(
|
|
312
|
-
(t,
|
|
313
|
+
(t, s) => Ke(s.at).localeCompare(Ke(t.at)) || s.id.localeCompare(t.id)
|
|
313
314
|
);
|
|
314
315
|
}
|
|
315
|
-
function
|
|
316
|
-
const o = _e(), e =
|
|
317
|
-
async function t(
|
|
318
|
-
if (e.value = [], !!
|
|
316
|
+
function nn() {
|
|
317
|
+
const o = _e(), e = k([]);
|
|
318
|
+
async function t(s) {
|
|
319
|
+
if (e.value = [], !!s)
|
|
319
320
|
try {
|
|
320
321
|
e.value = await o.getRecordChangelog(
|
|
321
|
-
|
|
322
|
+
s,
|
|
322
323
|
Xe,
|
|
323
324
|
Re
|
|
324
325
|
);
|
|
325
|
-
} catch (
|
|
326
|
-
console.error("changelog per-entity load failed",
|
|
326
|
+
} catch (l) {
|
|
327
|
+
console.error("changelog per-entity load failed", l);
|
|
327
328
|
}
|
|
328
329
|
}
|
|
329
330
|
return { commits: e, load: t };
|
|
@@ -349,31 +350,31 @@ function De(o) {
|
|
|
349
350
|
const e = o.indexOf(Qe);
|
|
350
351
|
return e === -1 ? { raw: o, human: o } : { raw: o.slice(0, e), human: o.slice(e + 1) };
|
|
351
352
|
}
|
|
352
|
-
const
|
|
353
|
+
const on = [
|
|
353
354
|
"inventory.changelog.label.recipe",
|
|
354
355
|
"inventory.changelog.label.sku",
|
|
355
356
|
"inventory.changelog.label.unit"
|
|
356
|
-
],
|
|
357
|
-
function
|
|
357
|
+
], an = [...on, "Recipe", "Ingredient", "Unit"];
|
|
358
|
+
function sn(o) {
|
|
358
359
|
const { human: e } = De(o);
|
|
359
360
|
if (!e) return { type: "Document", name: "", field: [] };
|
|
360
361
|
const t = e.split(" › ");
|
|
361
|
-
return t.length >= 2 &&
|
|
362
|
+
return t.length >= 2 && an.includes(t[0]) ? { type: t[0], name: t[1], field: t.slice(2) } : { type: "Document", name: "", field: t };
|
|
362
363
|
}
|
|
363
364
|
const ze = 800;
|
|
364
365
|
function et(o, e, t = 2) {
|
|
365
|
-
const
|
|
366
|
-
if (!
|
|
366
|
+
const s = je(o), l = je(e);
|
|
367
|
+
if (!s || !l) return null;
|
|
367
368
|
let a = 0;
|
|
368
|
-
for (; a <
|
|
369
|
+
for (; a < s.length && a < l.length && s[a] === l[a]; ) a++;
|
|
369
370
|
let r = 0;
|
|
370
|
-
for (; r <
|
|
371
|
+
for (; r < s.length - a && r < l.length - a && s[s.length - 1 - r] === l[l.length - 1 - r]; )
|
|
371
372
|
r++;
|
|
372
|
-
const u =
|
|
373
|
+
const u = s.slice(a, s.length - r), v = l.slice(a, l.length - r);
|
|
373
374
|
if (u.length > ze || v.length > ze) return null;
|
|
374
375
|
const p = (L) => ({ type: "same", text: L });
|
|
375
|
-
return
|
|
376
|
-
[...
|
|
376
|
+
return rn(
|
|
377
|
+
[...s.slice(0, a).map(p), ...ln(u, v), ...s.slice(s.length - r).map(p)],
|
|
377
378
|
t
|
|
378
379
|
);
|
|
379
380
|
}
|
|
@@ -386,33 +387,33 @@ function je(o) {
|
|
|
386
387
|
return null;
|
|
387
388
|
}
|
|
388
389
|
}
|
|
389
|
-
function
|
|
390
|
-
const t = o.length,
|
|
390
|
+
function ln(o, e) {
|
|
391
|
+
const t = o.length, s = e.length, l = Array.from({ length: t + 1 }, () => new Uint32Array(s + 1));
|
|
391
392
|
for (let v = t - 1; v >= 0; v--)
|
|
392
|
-
for (let p =
|
|
393
|
-
|
|
393
|
+
for (let p = s - 1; p >= 0; p--)
|
|
394
|
+
l[v][p] = o[v] === e[p] ? l[v + 1][p + 1] + 1 : Math.max(l[v + 1][p], l[v][p + 1]);
|
|
394
395
|
const a = [];
|
|
395
396
|
let r = 0, u = 0;
|
|
396
|
-
for (; r < t && u <
|
|
397
|
-
o[r] === e[u] ? (a.push({ type: "same", text: o[r] }), r++, u++) :
|
|
397
|
+
for (; r < t && u < s; )
|
|
398
|
+
o[r] === e[u] ? (a.push({ type: "same", text: o[r] }), r++, u++) : l[r + 1][u] >= l[r][u + 1] ? (a.push({ type: "del", text: o[r] }), r++) : (a.push({ type: "add", text: e[u] }), u++);
|
|
398
399
|
for (; r < t; ) a.push({ type: "del", text: o[r++] });
|
|
399
|
-
for (; u <
|
|
400
|
+
for (; u < s; ) a.push({ type: "add", text: e[u++] });
|
|
400
401
|
return a;
|
|
401
402
|
}
|
|
402
|
-
function
|
|
403
|
+
function rn(o, e) {
|
|
403
404
|
const t = o.map(() => !1);
|
|
404
405
|
o.forEach((a, r) => {
|
|
405
406
|
if (a.type !== "same")
|
|
406
407
|
for (let u = Math.max(0, r - e); u <= Math.min(o.length - 1, r + e); u++)
|
|
407
408
|
t[u] = !0;
|
|
408
409
|
});
|
|
409
|
-
const
|
|
410
|
-
let
|
|
410
|
+
const s = [];
|
|
411
|
+
let l = !1;
|
|
411
412
|
return o.forEach((a, r) => {
|
|
412
|
-
t[r] ? (
|
|
413
|
-
}),
|
|
413
|
+
t[r] ? (s.push(a), l = !1) : l || (s.push({ type: "skip", text: "⋯" }), l = !0);
|
|
414
|
+
}), s;
|
|
414
415
|
}
|
|
415
|
-
function
|
|
416
|
+
function un(o, e) {
|
|
416
417
|
let t;
|
|
417
418
|
try {
|
|
418
419
|
t = JSON.parse(o);
|
|
@@ -421,37 +422,37 @@ function rn(o, e) {
|
|
|
421
422
|
}
|
|
422
423
|
return t === null ? "—" : typeof t == "number" ? t.toLocaleString() : typeof t == "boolean" ? e(t ? "inventory.changelog.yes" : "inventory.changelog.no") : String(t);
|
|
423
424
|
}
|
|
424
|
-
function Ve(o, e, t = 0,
|
|
425
|
+
function Ve(o, e, t = 0, s) {
|
|
425
426
|
var p;
|
|
426
|
-
const
|
|
427
|
+
const l = o.label == null ? void 0 : Ze(o.label) ? e(o.label) : o.label, a = l != null || o.value != null || o.display != null, r = !((p = o.kids) != null && p.length), u = [];
|
|
427
428
|
a && u.push({
|
|
428
429
|
depth: t,
|
|
429
430
|
// A bare array index says nothing a reader needs — a leaf list entry
|
|
430
431
|
// shows just its value. Branch nodes keep the index as their header.
|
|
431
|
-
label:
|
|
432
|
-
text: r ?
|
|
432
|
+
label: l != null && r && /^\d+$/.test(l) ? void 0 : l,
|
|
433
|
+
text: r ? cn(o, e, s) : void 0,
|
|
433
434
|
bookkeeping: !!o.bookkeeping
|
|
434
435
|
});
|
|
435
436
|
const v = a ? t + 1 : t;
|
|
436
437
|
for (const L of o.kids ?? [])
|
|
437
|
-
u.push(...Ve(L, e, v,
|
|
438
|
+
u.push(...Ve(L, e, v, s));
|
|
438
439
|
return u;
|
|
439
440
|
}
|
|
440
|
-
function
|
|
441
|
+
function cn(o, e, t) {
|
|
441
442
|
if (o.value == null) return o.display || void 0;
|
|
442
|
-
const
|
|
443
|
-
return (t == null ? void 0 : t(
|
|
443
|
+
const s = un(o.value, e);
|
|
444
|
+
return (t == null ? void 0 : t(s)) ?? o.display ?? s;
|
|
444
445
|
}
|
|
445
446
|
function $e(o, e) {
|
|
446
447
|
return JSON.stringify(o, null, 2).split(`
|
|
447
448
|
`).map((t) => ({ type: e, text: t }));
|
|
448
449
|
}
|
|
449
|
-
function
|
|
450
|
-
const o = _e(), e = /* @__PURE__ */ new Map(), t =
|
|
451
|
-
async function
|
|
450
|
+
function dn() {
|
|
451
|
+
const o = _e(), e = /* @__PURE__ */ new Map(), t = k(!1), s = k(null);
|
|
452
|
+
async function l(a) {
|
|
452
453
|
const r = e.get(a.id);
|
|
453
454
|
if (r) {
|
|
454
|
-
|
|
455
|
+
s.value = r;
|
|
455
456
|
return;
|
|
456
457
|
}
|
|
457
458
|
t.value = !0;
|
|
@@ -463,79 +464,79 @@ function cn() {
|
|
|
463
464
|
...$e(L, "del"),
|
|
464
465
|
...$e(F, "add")
|
|
465
466
|
] : $e(F, "add"), conflict: !1 };
|
|
466
|
-
e.set(a.id, K),
|
|
467
|
+
e.set(a.id, K), s.value = K;
|
|
467
468
|
} catch (u) {
|
|
468
|
-
if (!
|
|
469
|
-
throw
|
|
469
|
+
if (!Qt(u))
|
|
470
|
+
throw s.value = null, u;
|
|
470
471
|
const v = { diff: null, conflict: !0 };
|
|
471
|
-
e.set(a.id, v),
|
|
472
|
+
e.set(a.id, v), s.value = v;
|
|
472
473
|
} finally {
|
|
473
474
|
t.value = !1;
|
|
474
475
|
}
|
|
475
476
|
}
|
|
476
|
-
return { isLoading: t, result:
|
|
477
|
+
return { isLoading: t, result: s, load: l };
|
|
477
478
|
}
|
|
478
|
-
const
|
|
479
|
+
const fn = {
|
|
479
480
|
key: 0,
|
|
480
481
|
class: "flex justify-center p-16"
|
|
481
|
-
},
|
|
482
|
+
}, mn = {
|
|
482
483
|
key: 1,
|
|
483
484
|
class: "p-16 text-center text-gray-500"
|
|
484
|
-
},
|
|
485
|
+
}, pn = {
|
|
485
486
|
key: 2,
|
|
486
487
|
class: "flex h-full min-h-0 gap-8"
|
|
487
|
-
},
|
|
488
|
+
}, 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 = {
|
|
488
489
|
key: 0,
|
|
489
490
|
class: "flex-1 overflow-y-auto pl-4"
|
|
490
|
-
},
|
|
491
|
+
}, bn = { class: "mb-12 flex flex-col gap-2 border-b border-gray-200 pb-8" }, xn = { class: "flex flex-wrap items-center gap-8" }, wn = { class: "fm-typo-en-body-lg-600" }, kn = {
|
|
491
492
|
key: 0,
|
|
492
493
|
class: "rounded-full bg-gray-100 px-8 text-xs text-gray-500"
|
|
493
|
-
},
|
|
494
|
+
}, Sn = { class: "text-xs text-gray-500" }, $n = { class: "mb-12" }, Cn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary pl-8" }, Ln = {
|
|
494
495
|
key: 0,
|
|
495
496
|
class: "mb-12"
|
|
496
|
-
},
|
|
497
|
+
}, Rn = {
|
|
497
498
|
key: 1,
|
|
498
499
|
class: "text-sm text-gray-400"
|
|
499
|
-
},
|
|
500
|
+
}, Dn = {
|
|
500
501
|
key: 2,
|
|
501
502
|
class: "w-full overflow-x-auto rounded border border-gray-200 py-4 font-mono text-xs"
|
|
502
|
-
},
|
|
503
|
+
}, Vn = {
|
|
503
504
|
key: 0,
|
|
504
505
|
class: "text-xs text-gray-400"
|
|
505
|
-
},
|
|
506
|
+
}, In = { class: "fm-typo-en-body-md-600" }, Nn = { class: "flex flex-col gap-6" }, En = {
|
|
506
507
|
key: 0,
|
|
507
508
|
class: "text-gray-700"
|
|
508
|
-
},
|
|
509
|
+
}, Tn = { class: "min-w-[120px] shrink-0 text-gray-500" }, Pn = {
|
|
509
510
|
key: 0,
|
|
510
511
|
class: "flex w-full flex-col gap-4"
|
|
511
|
-
},
|
|
512
|
+
}, Bn = {
|
|
512
513
|
key: 0,
|
|
513
514
|
class: "w-full overflow-x-auto rounded border border-gray-200 py-4 font-mono text-xs"
|
|
514
|
-
},
|
|
515
|
+
}, Fn = { key: 0 }, An = { key: 1 }, Mn = {
|
|
515
516
|
key: 1,
|
|
516
517
|
class: "w-full overflow-x-auto rounded border border-gray-200 py-4 font-mono text-xs"
|
|
517
|
-
},
|
|
518
|
+
}, Un = { key: 0 }, On = { key: 1 }, Kn = {
|
|
518
519
|
key: 1,
|
|
519
520
|
class: "w-full overflow-x-auto rounded border border-gray-200 py-4 font-mono text-xs"
|
|
520
|
-
},
|
|
521
|
+
}, zn = {
|
|
521
522
|
key: 2,
|
|
522
523
|
class: "flex w-full flex-wrap items-baseline gap-4"
|
|
523
|
-
},
|
|
524
|
+
}, jn = {
|
|
524
525
|
key: 0,
|
|
525
526
|
class: "rounded bg-red-50 px-4 text-red-700"
|
|
526
|
-
},
|
|
527
|
+
}, Gn = {
|
|
527
528
|
key: 1,
|
|
528
529
|
class: "text-gray-400"
|
|
529
|
-
},
|
|
530
|
+
}, Hn = {
|
|
530
531
|
key: 2,
|
|
531
532
|
class: "rounded bg-green-50 px-4 text-green-700"
|
|
532
|
-
},
|
|
533
|
+
}, Jn = {
|
|
533
534
|
key: 1,
|
|
534
535
|
class: "text-sm text-gray-500"
|
|
535
|
-
},
|
|
536
|
+
}, Yn = {
|
|
536
537
|
key: 2,
|
|
537
538
|
class: "mt-16 break-all border-t border-gray-200 pt-8 font-mono text-xs text-gray-400"
|
|
538
|
-
},
|
|
539
|
+
}, Wn = { key: 0 }, Xn = "capture baseline", qn = /* @__PURE__ */ ue({
|
|
539
540
|
__name: "ChangelogPanel",
|
|
540
541
|
props: {
|
|
541
542
|
commits: {},
|
|
@@ -543,33 +544,33 @@ const dn = {
|
|
|
543
544
|
resolveName: { type: Function }
|
|
544
545
|
},
|
|
545
546
|
setup(o) {
|
|
546
|
-
const e = o, { t } = he(),
|
|
547
|
-
() => e.commits.find((d) => d.id ===
|
|
547
|
+
const e = o, { t } = he(), s = k(null), l = V(
|
|
548
|
+
() => e.commits.find((d) => d.id === s.value)
|
|
548
549
|
), a = /* @__PURE__ */ new Set(["updatedAt", "createdAt", "updatedBy", "createdBy", "_rev"]), r = V(() => {
|
|
549
550
|
var h;
|
|
550
|
-
return (((h =
|
|
551
|
-
const { raw:
|
|
552
|
-
return
|
|
551
|
+
return (((h = l.value) == null ? void 0 : h.changes) ?? []).filter((U) => {
|
|
552
|
+
const { raw: M } = De(U.path);
|
|
553
|
+
return M === "@payload" || U.from == null && U.to == null ? !1 : !M.split(".").some((W) => a.has(W));
|
|
553
554
|
});
|
|
554
555
|
});
|
|
555
|
-
|
|
556
|
+
q(
|
|
556
557
|
() => e.commits,
|
|
557
558
|
(d) => {
|
|
558
559
|
var h;
|
|
559
|
-
d.find((
|
|
560
|
+
d.find((U) => U.id === s.value) || (s.value = ((h = d[0]) == null ? void 0 : h.id) ?? null);
|
|
560
561
|
},
|
|
561
562
|
{ immediate: !0 }
|
|
562
563
|
);
|
|
563
|
-
const u =
|
|
564
|
-
|
|
565
|
-
p.value = null, !(!d || !h) && L(h).catch((
|
|
566
|
-
console.error("changelog snapshot load failed",
|
|
564
|
+
const u = k(!1), { isLoading: v, result: p, load: L } = dn();
|
|
565
|
+
q([u, l], ([d, h]) => {
|
|
566
|
+
p.value = null, !(!d || !h) && L(h).catch((U) => {
|
|
567
|
+
console.error("changelog snapshot load failed", U), u.value = !1;
|
|
567
568
|
});
|
|
568
569
|
});
|
|
569
570
|
function F(d) {
|
|
570
571
|
return d ? d.slice(0, 8) : "";
|
|
571
572
|
}
|
|
572
|
-
function
|
|
573
|
+
function A(d) {
|
|
573
574
|
return d ? new Date(d).toLocaleString() : "";
|
|
574
575
|
}
|
|
575
576
|
function K(d) {
|
|
@@ -582,21 +583,21 @@ const dn = {
|
|
|
582
583
|
}
|
|
583
584
|
return h === null ? "—" : typeof h == "string" ? h : typeof h == "number" ? h.toLocaleString() : typeof h == "boolean" ? t(h ? "inventory.changelog.yes" : "inventory.changelog.no") : JSON.stringify(h, null, 2);
|
|
584
585
|
}
|
|
585
|
-
function
|
|
586
|
+
function Z(d) {
|
|
586
587
|
return (d.authors || []).join(", ") || t("inventory.changelog.unknownActor");
|
|
587
588
|
}
|
|
588
|
-
function
|
|
589
|
-
if (d.message ===
|
|
589
|
+
function te(d) {
|
|
590
|
+
if (d.message === Xn) return t("inventory.changelog.captureBaseline");
|
|
590
591
|
const h = qe(d.message);
|
|
591
592
|
if (!h) return d.message || t("inventory.changelog.noMessage");
|
|
592
|
-
const
|
|
593
|
-
return h.name ? t(`inventory.changelog.message.${h.verb}`, { module:
|
|
593
|
+
const U = D(h.labelKey);
|
|
594
|
+
return h.name ? t(`inventory.changelog.message.${h.verb}`, { module: U, name: h.name }) : t(`inventory.changelog.message.${h.verb}NoName`, { module: U });
|
|
594
595
|
}
|
|
595
|
-
function
|
|
596
|
+
function D(d) {
|
|
596
597
|
return Ze(d) ? t(d) : d;
|
|
597
598
|
}
|
|
598
|
-
const
|
|
599
|
-
function
|
|
599
|
+
const B = (d) => /[^a-zA-Z]/.test(d);
|
|
600
|
+
function b(d, h) {
|
|
600
601
|
return d == null || h == null ? null : et(d, h);
|
|
601
602
|
}
|
|
602
603
|
function y(d) {
|
|
@@ -606,17 +607,17 @@ const dn = {
|
|
|
606
607
|
fromTree: d.from_value ? Ve(d.from_value, t, 0, e.resolveName) : void 0
|
|
607
608
|
};
|
|
608
609
|
}
|
|
609
|
-
function
|
|
610
|
+
function x(d) {
|
|
610
611
|
return d === "add" ? "bg-green-50 text-green-700" : d === "del" ? "bg-red-50 text-red-700" : d === "skip" ? "text-gray-400" : "text-gray-600";
|
|
611
612
|
}
|
|
612
613
|
function T(d) {
|
|
613
614
|
return d.type === "skip" ? d.text : (d.type === "add" ? "+ " : d.type === "del" ? "- " : " ") + d.text;
|
|
614
615
|
}
|
|
615
616
|
const O = V(() => {
|
|
616
|
-
const d = /* @__PURE__ */ new Map(), h = [],
|
|
617
|
+
const d = /* @__PURE__ */ new Map(), h = [], U = (g, f) => {
|
|
617
618
|
let N = d.get(g);
|
|
618
619
|
return N || (N = f(), d.set(g, N), h.push(N)), N;
|
|
619
|
-
},
|
|
620
|
+
}, M = () => U("@doc", () => ({ header: "", lines: [] })), W = (g, f) => {
|
|
620
621
|
var P;
|
|
621
622
|
if (g == null) return f;
|
|
622
623
|
let N;
|
|
@@ -626,28 +627,28 @@ const dn = {
|
|
|
626
627
|
N = g;
|
|
627
628
|
}
|
|
628
629
|
return (typeof N == "string" ? (P = e.resolveName) == null ? void 0 : P.call(e, N) : void 0) ?? f;
|
|
629
|
-
},
|
|
630
|
-
var P,
|
|
630
|
+
}, G = (g, f, N) => {
|
|
631
|
+
var P, J, Q, ee;
|
|
631
632
|
const _ = y(f);
|
|
632
633
|
_ ? g.lines.push({ label: N, ..._ }) : f.from != null && f.to != null ? g.lines.push({
|
|
633
634
|
label: N,
|
|
634
635
|
from: f.from,
|
|
635
636
|
to: f.to,
|
|
636
|
-
diff:
|
|
637
|
-
fromDisplay:
|
|
638
|
-
toDisplay:
|
|
639
|
-
}) : f.to != null ? g.lines.push({ label: N, to: f.to, toDisplay:
|
|
640
|
-
},
|
|
637
|
+
diff: b(f.from, f.to),
|
|
638
|
+
fromDisplay: W(f.from, (P = f.display) == null ? void 0 : P.from),
|
|
639
|
+
toDisplay: W(f.to, (J = f.display) == null ? void 0 : J.to)
|
|
640
|
+
}) : f.to != null ? g.lines.push({ label: N, to: f.to, toDisplay: W(f.to, (Q = f.display) == null ? void 0 : Q.to) }) : g.lines.push({ label: N, from: f.from, fromDisplay: W(f.from, (ee = f.display) == null ? void 0 : ee.from) });
|
|
641
|
+
}, C = (g) => {
|
|
641
642
|
var N;
|
|
642
643
|
const f = g.element;
|
|
643
644
|
if (f) {
|
|
644
|
-
const _ =
|
|
645
|
-
kind: (f.trail ?? []).map(
|
|
645
|
+
const _ = U(`kit:${(f.trail ?? []).join(".")}:${f.id ?? ""}`, () => ({
|
|
646
|
+
kind: (f.trail ?? []).map(D).join(" › "),
|
|
646
647
|
header: f.name || f.id || "",
|
|
647
648
|
lines: []
|
|
648
649
|
}));
|
|
649
650
|
if ((N = g.field) != null && N.length)
|
|
650
|
-
|
|
651
|
+
G(_, g, g.field.map(D).join(" › "));
|
|
651
652
|
else {
|
|
652
653
|
_.badge = g.to != null ? "added" : "removed";
|
|
653
654
|
const P = y(g);
|
|
@@ -655,214 +656,214 @@ const dn = {
|
|
|
655
656
|
}
|
|
656
657
|
return;
|
|
657
658
|
}
|
|
658
|
-
|
|
659
|
+
G(M(), g, (g.field ?? []).map(D).join(" › "));
|
|
659
660
|
};
|
|
660
661
|
for (const g of r.value) {
|
|
661
662
|
const { raw: f, human: N } = De(g.path);
|
|
662
663
|
if (g.kind === "create" && !f) {
|
|
663
|
-
const
|
|
664
|
-
|
|
665
|
-
|
|
664
|
+
const Q = y(g);
|
|
665
|
+
M().lines.push(
|
|
666
|
+
Q ? { label: t("inventory.changelog.kind.created"), ...Q } : { text: t("inventory.changelog.kind.created") }
|
|
666
667
|
);
|
|
667
668
|
continue;
|
|
668
669
|
}
|
|
669
670
|
if (!g.path.includes(Qe) && (g.field || g.element)) {
|
|
670
|
-
|
|
671
|
+
C(g);
|
|
671
672
|
continue;
|
|
672
673
|
}
|
|
673
|
-
const _ = f ? f.split(".") : [], P = N ? N.split(" › ") : [],
|
|
674
|
-
if (
|
|
675
|
-
const
|
|
676
|
-
kind: P.slice(0,
|
|
677
|
-
header:
|
|
674
|
+
const _ = f ? f.split(".") : [], P = N ? N.split(" › ") : [], J = _.findIndex((Q, ee) => ee > 0 && B(Q));
|
|
675
|
+
if (J > 0 && P.length === _.length) {
|
|
676
|
+
const Q = P[J], ee = U(_.slice(0, J + 1).join("."), () => ({
|
|
677
|
+
kind: P.slice(0, J).map(D).join(" › "),
|
|
678
|
+
header: Q,
|
|
678
679
|
lines: []
|
|
679
|
-
})), re = P.slice(
|
|
680
|
-
if (re)
|
|
681
|
-
else if (g.from != null && g.to != null)
|
|
680
|
+
})), re = P.slice(J + 1).map(D).join(" › ");
|
|
681
|
+
if (re) G(ee, g, re);
|
|
682
|
+
else if (g.from != null && g.to != null) G(ee, g, Q);
|
|
682
683
|
else {
|
|
683
|
-
|
|
684
|
+
ee.badge = g.to != null ? "added" : "removed";
|
|
684
685
|
const ce = y(g);
|
|
685
|
-
ce &&
|
|
686
|
+
ce && ee.lines.push(ce);
|
|
686
687
|
}
|
|
687
688
|
continue;
|
|
688
689
|
}
|
|
689
|
-
|
|
690
|
+
G(M(), g, P.map(D).join(" › "));
|
|
690
691
|
}
|
|
691
692
|
return h;
|
|
692
693
|
});
|
|
693
694
|
return (d, h) => {
|
|
694
|
-
var
|
|
695
|
-
const
|
|
696
|
-
return d.isLoading ? (i(), m("div",
|
|
697
|
-
I(
|
|
698
|
-
])) : d.commits.length ? (i(), m("div",
|
|
699
|
-
|
|
700
|
-
(i(!0), m(
|
|
701
|
-
key:
|
|
695
|
+
var W, G;
|
|
696
|
+
const U = Y("FmCircularProgress"), M = Y("FmSwitch");
|
|
697
|
+
return d.isLoading ? (i(), m("div", fn, [
|
|
698
|
+
I(U)
|
|
699
|
+
])) : d.commits.length ? (i(), m("div", pn, [
|
|
700
|
+
S("ol", vn, [
|
|
701
|
+
(i(!0), m(H, null, oe(d.commits, (C) => (i(), m("li", {
|
|
702
|
+
key: C.id,
|
|
702
703
|
role: "button",
|
|
703
704
|
tabindex: "0",
|
|
704
705
|
class: ae([
|
|
705
706
|
"cursor-pointer border-l-2 py-8 pl-12",
|
|
706
|
-
|
|
707
|
+
C.id === s.value ? "border-fm-color-primary bg-fm-color-primary-50" : "border-gray-200 hover:bg-gray-50"
|
|
707
708
|
]),
|
|
708
|
-
onClick: (g) =>
|
|
709
|
+
onClick: (g) => s.value = C.id,
|
|
709
710
|
onKeydown: [
|
|
710
|
-
Me((g) =>
|
|
711
|
-
Me(pt((g) =>
|
|
711
|
+
Me((g) => s.value = C.id, ["enter"]),
|
|
712
|
+
Me(pt((g) => s.value = C.id, ["prevent"]), ["space"])
|
|
712
713
|
]
|
|
713
714
|
}, [
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
], 42,
|
|
715
|
+
S("div", yn, w(te(C)), 1),
|
|
716
|
+
S("div", hn, w(Z(C)) + " · " + w(A(C.at)) + " · " + w(F(C.id)), 1)
|
|
717
|
+
], 42, gn))), 128))
|
|
717
718
|
]),
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
719
|
+
l.value ? (i(), m("div", _n, [
|
|
720
|
+
S("div", bn, [
|
|
721
|
+
S("div", xn, [
|
|
722
|
+
S("div", wn, w(te(l.value)), 1),
|
|
723
|
+
l.value.parent ? E("", !0) : (i(), m("span", kn, w(R(t)("inventory.changelog.rootCommit")), 1))
|
|
723
724
|
]),
|
|
724
|
-
|
|
725
|
+
S("div", Sn, w(Z(l.value)) + " · " + w(A(l.value.at)), 1)
|
|
725
726
|
]),
|
|
726
|
-
|
|
727
|
+
S("div", $n, [
|
|
727
728
|
I(We, null, {
|
|
728
729
|
default: le(() => [
|
|
729
|
-
|
|
730
|
-
I(
|
|
730
|
+
S("span", Cn, w(R(t)("inventory.changelog.dataDiff")), 1),
|
|
731
|
+
I(M, {
|
|
731
732
|
modelValue: u.value,
|
|
732
|
-
"onUpdate:modelValue": h[0] || (h[0] = (
|
|
733
|
+
"onUpdate:modelValue": h[0] || (h[0] = (C) => u.value = C)
|
|
733
734
|
}, null, 8, ["modelValue"])
|
|
734
735
|
]),
|
|
735
736
|
_: 1
|
|
736
737
|
})
|
|
737
738
|
]),
|
|
738
|
-
u.value ? (i(), m("div",
|
|
739
|
-
|
|
740
|
-
(i(!0), m(
|
|
739
|
+
u.value ? (i(), m("div", Ln, [
|
|
740
|
+
R(v) ? (i(), ie(U, { key: 0 })) : (W = R(p)) != null && W.conflict ? (i(), m("div", Rn, w(R(t)("inventory.changelog.snapshotUnavailable")), 1)) : (G = R(p)) != null && G.diff ? (i(), m("div", Dn, [
|
|
741
|
+
(i(!0), m(H, null, oe(R(p).diff, (C, g) => (i(), m("div", {
|
|
741
742
|
key: g,
|
|
742
|
-
class: ae(["whitespace-pre px-4",
|
|
743
|
-
},
|
|
743
|
+
class: ae(["whitespace-pre px-4", x(C.type)])
|
|
744
|
+
}, w(T(C)), 3))), 128))
|
|
744
745
|
])) : E("", !0)
|
|
745
746
|
])) : E("", !0),
|
|
746
|
-
(i(!0), m(
|
|
747
|
+
(i(!0), m(H, null, oe(O.value, (C, g) => (i(), m("div", {
|
|
747
748
|
key: g,
|
|
748
749
|
class: "mb-12 rounded-lg border border-gray-200 p-12"
|
|
749
750
|
}, [
|
|
750
|
-
|
|
751
|
+
C.kind || C.header || C.badge ? (i(), m("div", {
|
|
751
752
|
key: 0,
|
|
752
|
-
class: ae(["flex flex-wrap items-baseline gap-8",
|
|
753
|
+
class: ae(["flex flex-wrap items-baseline gap-8", C.lines.length ? "mb-8" : ""])
|
|
753
754
|
}, [
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
755
|
+
C.kind ? (i(), m("span", Vn, w(C.kind), 1)) : E("", !0),
|
|
756
|
+
S("span", In, w(C.header), 1),
|
|
757
|
+
C.badge ? (i(), m("span", {
|
|
757
758
|
key: 1,
|
|
758
|
-
class: ae(["rounded-full px-8 text-xs",
|
|
759
|
-
},
|
|
759
|
+
class: ae(["rounded-full px-8 text-xs", C.badge === "added" ? "bg-green-100 text-green-700" : "bg-red-100 text-red-700"])
|
|
760
|
+
}, w(C.badge === "added" ? R(t)("inventory.changelog.added") : R(t)("inventory.changelog.kind.removed")), 3)) : E("", !0)
|
|
760
761
|
], 2)) : E("", !0),
|
|
761
|
-
|
|
762
|
-
(i(!0), m(
|
|
762
|
+
S("ul", Nn, [
|
|
763
|
+
(i(!0), m(H, null, oe(C.lines, (f, N) => (i(), m("li", {
|
|
763
764
|
key: N,
|
|
764
765
|
class: "flex flex-wrap items-baseline gap-8 text-sm"
|
|
765
766
|
}, [
|
|
766
|
-
f.text ? (i(), m("span",
|
|
767
|
-
|
|
768
|
-
f.toTree || f.fromTree ? (i(), m("div",
|
|
769
|
-
f.fromTree ? (i(), m("div",
|
|
770
|
-
(i(!0), m(
|
|
767
|
+
f.text ? (i(), m("span", En, w(f.text), 1)) : (i(), m(H, { key: 1 }, [
|
|
768
|
+
S("span", Tn, w(f.label), 1),
|
|
769
|
+
f.toTree || f.fromTree ? (i(), m("div", Pn, [
|
|
770
|
+
f.fromTree ? (i(), m("div", Bn, [
|
|
771
|
+
(i(!0), m(H, null, oe(f.fromTree, (_, P) => (i(), m("div", {
|
|
771
772
|
key: P,
|
|
772
773
|
class: ae(["flex items-baseline gap-4 px-4", _.bookkeeping ? "text-gray-400" : "text-red-700"])
|
|
773
774
|
}, [
|
|
774
|
-
(i(!0), m(
|
|
775
|
-
key:
|
|
775
|
+
(i(!0), m(H, null, oe(_.depth, (J) => (i(), m("span", {
|
|
776
|
+
key: J,
|
|
776
777
|
class: "inline-block w-16"
|
|
777
778
|
}))), 128)),
|
|
778
|
-
_.label ? (i(), m("span",
|
|
779
|
-
ve(
|
|
780
|
-
_.text ? (i(), m(
|
|
779
|
+
_.label ? (i(), m("span", Fn, [
|
|
780
|
+
ve(w(_.label), 1),
|
|
781
|
+
_.text ? (i(), m(H, { key: 0 }, [
|
|
781
782
|
ve(":")
|
|
782
783
|
], 64)) : E("", !0)
|
|
783
784
|
])) : E("", !0),
|
|
784
|
-
_.text ? (i(), m("span",
|
|
785
|
+
_.text ? (i(), m("span", An, w(_.text), 1)) : E("", !0)
|
|
785
786
|
], 2))), 128))
|
|
786
787
|
])) : E("", !0),
|
|
787
|
-
f.toTree ? (i(), m("div",
|
|
788
|
-
(i(!0), m(
|
|
788
|
+
f.toTree ? (i(), m("div", Mn, [
|
|
789
|
+
(i(!0), m(H, null, oe(f.toTree, (_, P) => (i(), m("div", {
|
|
789
790
|
key: P,
|
|
790
791
|
class: ae(["flex items-baseline gap-4 px-4", _.bookkeeping ? "text-gray-400" : "text-green-700"])
|
|
791
792
|
}, [
|
|
792
|
-
(i(!0), m(
|
|
793
|
-
key:
|
|
793
|
+
(i(!0), m(H, null, oe(_.depth, (J) => (i(), m("span", {
|
|
794
|
+
key: J,
|
|
794
795
|
class: "inline-block w-16"
|
|
795
796
|
}))), 128)),
|
|
796
|
-
_.label ? (i(), m("span",
|
|
797
|
-
ve(
|
|
798
|
-
_.text ? (i(), m(
|
|
797
|
+
_.label ? (i(), m("span", Un, [
|
|
798
|
+
ve(w(_.label), 1),
|
|
799
|
+
_.text ? (i(), m(H, { key: 0 }, [
|
|
799
800
|
ve(":")
|
|
800
801
|
], 64)) : E("", !0)
|
|
801
802
|
])) : E("", !0),
|
|
802
|
-
_.text ? (i(), m("span",
|
|
803
|
+
_.text ? (i(), m("span", On, w(_.text), 1)) : E("", !0)
|
|
803
804
|
], 2))), 128))
|
|
804
805
|
])) : E("", !0)
|
|
805
|
-
])) : f.diff ? (i(), m("div",
|
|
806
|
-
(i(!0), m(
|
|
806
|
+
])) : f.diff ? (i(), m("div", Kn, [
|
|
807
|
+
(i(!0), m(H, null, oe(f.diff, (_, P) => (i(), m("div", {
|
|
807
808
|
key: P,
|
|
808
|
-
class: ae(["whitespace-pre px-4",
|
|
809
|
-
},
|
|
810
|
-
])) : (i(), m("span",
|
|
811
|
-
f.from != null ? (i(), m("span",
|
|
812
|
-
f.from != null && f.to != null ? (i(), m("span",
|
|
813
|
-
f.to != null ? (i(), m("span",
|
|
809
|
+
class: ae(["whitespace-pre px-4", x(_.type)])
|
|
810
|
+
}, w(T(_)), 3))), 128))
|
|
811
|
+
])) : (i(), m("span", zn, [
|
|
812
|
+
f.from != null ? (i(), m("span", jn, w(f.fromDisplay ?? K(f.from)), 1)) : E("", !0),
|
|
813
|
+
f.from != null && f.to != null ? (i(), m("span", Gn, "→")) : E("", !0),
|
|
814
|
+
f.to != null ? (i(), m("span", Hn, w(f.toDisplay ?? K(f.to)), 1)) : E("", !0)
|
|
814
815
|
]))
|
|
815
816
|
], 64))
|
|
816
817
|
]))), 128))
|
|
817
818
|
])
|
|
818
819
|
]))), 128)),
|
|
819
|
-
O.value.length ? E("", !0) : (i(), m("div",
|
|
820
|
-
u.value ? (i(), m("div",
|
|
821
|
-
ve(
|
|
822
|
-
|
|
820
|
+
O.value.length ? E("", !0) : (i(), m("div", Jn, w(R(t)("inventory.changelog.empty")), 1)),
|
|
821
|
+
u.value ? (i(), m("div", Yn, [
|
|
822
|
+
ve(w(l.value.id) + " ", 1),
|
|
823
|
+
l.value.parent ? (i(), m("span", Wn, "← " + w(l.value.parent), 1)) : E("", !0)
|
|
823
824
|
])) : E("", !0)
|
|
824
825
|
])) : E("", !0)
|
|
825
|
-
])) : (i(), m("div",
|
|
826
|
+
])) : (i(), m("div", mn, w(R(t)("inventory.changelog.empty")), 1));
|
|
826
827
|
};
|
|
827
828
|
}
|
|
828
|
-
}),
|
|
829
|
+
}), 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 = {
|
|
829
830
|
key: 0,
|
|
830
831
|
class: "fm-typo-en-body-md-600"
|
|
831
|
-
},
|
|
832
|
+
}, io = { class: "fm-typo-en-heading-md-600" }, uo = {
|
|
832
833
|
key: 0,
|
|
833
834
|
class: "flex justify-center py-8"
|
|
834
|
-
}, Ce = "inventory.changelog.label.",
|
|
835
|
+
}, Ce = "inventory.changelog.label.", co = /* @__PURE__ */ ue({
|
|
835
836
|
__name: "ChangelogDialog",
|
|
836
837
|
props: {
|
|
837
838
|
modelValue: { type: Boolean }
|
|
838
839
|
},
|
|
839
840
|
emits: ["update:modelValue"],
|
|
840
841
|
setup(o, { emit: e }) {
|
|
841
|
-
const t = o,
|
|
842
|
+
const t = o, s = e, l = V({
|
|
842
843
|
get: () => t.modelValue,
|
|
843
|
-
set: (n) =>
|
|
844
|
-
}), { t: a } = he(), r = ge(), u = Je(), v = He(), p = _e(), { breakpoints: L } =
|
|
845
|
-
function
|
|
846
|
-
|
|
844
|
+
set: (n) => s("update:modelValue", n)
|
|
845
|
+
}), { t: a } = he(), r = ge(), u = Je(), v = He(), p = _e(), { breakpoints: L } = Nt(), F = V(() => L.value.xs || L.value.sm), A = V(() => F.value ? "98vw" : "72vw"), { commits: K, isLoading: Z, hasMore: te, load: D, loadMore: B } = en();
|
|
846
|
+
function b() {
|
|
847
|
+
B().catch((n) => console.error("changelog load more failed", n));
|
|
847
848
|
}
|
|
848
849
|
function y(n) {
|
|
849
850
|
return n ? new Date(n).toLocaleString() : "—";
|
|
850
851
|
}
|
|
851
|
-
function
|
|
852
|
-
return [...n].sort((c,
|
|
852
|
+
function x(n) {
|
|
853
|
+
return [...n].sort((c, $) => ($.lastUpdate ?? "").localeCompare(c.lastUpdate ?? ""));
|
|
853
854
|
}
|
|
854
|
-
function T(n, c,
|
|
855
|
-
|
|
855
|
+
function T(n, c, $) {
|
|
856
|
+
D(n, c, $).catch((z) => console.error("changelog load failed", z));
|
|
856
857
|
}
|
|
857
|
-
const O =
|
|
858
|
+
const O = k([]);
|
|
858
859
|
async function d() {
|
|
859
860
|
var c;
|
|
860
861
|
const n = (c = r.currentBusiness.value) == null ? void 0 : c._id;
|
|
861
862
|
if (n)
|
|
862
863
|
try {
|
|
863
864
|
O.value = await p.listDomains(n);
|
|
864
|
-
} catch (
|
|
865
|
-
console.error("changelog domain list load failed",
|
|
865
|
+
} catch ($) {
|
|
866
|
+
console.error("changelog domain list load failed", $), O.value = [];
|
|
866
867
|
}
|
|
867
868
|
}
|
|
868
869
|
const h = V(() => [
|
|
@@ -870,49 +871,49 @@ const dn = {
|
|
|
870
871
|
{ label: a("inventory.changelog.label.closingDraft"), value: "closingDraft" },
|
|
871
872
|
{ label: a("inventory.changelog.domainInventory"), value: "inventory" },
|
|
872
873
|
...O.value.map((n) => ({ label: a(n.labelKey), value: n.domain }))
|
|
873
|
-
]),
|
|
874
|
+
]), U = k(h.value[0]), M = V(() => {
|
|
874
875
|
var n;
|
|
875
|
-
return ((n =
|
|
876
|
-
}),
|
|
877
|
-
() => O.value.some((n) => n.domain ===
|
|
878
|
-
),
|
|
876
|
+
return ((n = U.value) == null ? void 0 : n.value) ?? "purchaseOrder";
|
|
877
|
+
}), W = V(
|
|
878
|
+
() => O.value.some((n) => n.domain === M.value)
|
|
879
|
+
), G = k(!1), C = V(
|
|
879
880
|
() => ["sku", "recipe", "unit"].map((n) => ({
|
|
880
881
|
label: a(Ce + n),
|
|
881
882
|
value: n
|
|
882
883
|
}))
|
|
883
|
-
), g =
|
|
884
|
+
), g = k(C.value[0]), f = V(() => {
|
|
884
885
|
var n;
|
|
885
886
|
return ((n = g.value) == null ? void 0 : n.value) ?? "sku";
|
|
886
|
-
}), N =
|
|
887
|
-
var
|
|
888
|
-
const n = (
|
|
887
|
+
}), N = k(""), _ = k(null), P = k(!1), J = V(() => {
|
|
888
|
+
var $;
|
|
889
|
+
const n = ($ = r.currentBusiness.value) == null ? void 0 : $._id, c = u.inventory._id;
|
|
889
890
|
return n && c ? `business_${n}/${c}` : "";
|
|
890
|
-
}),
|
|
891
|
+
}), Q = V(() => {
|
|
891
892
|
const n = /* @__PURE__ */ new Map(), c = u.inventory;
|
|
892
|
-
for (const
|
|
893
|
-
for (const z of
|
|
893
|
+
for (const $ of [c.sku, c.recipe, c.unit])
|
|
894
|
+
for (const z of $ ?? [])
|
|
894
895
|
z._id && z.name && n.set(z._id, z.name);
|
|
895
|
-
for (const
|
|
896
|
-
for (const z of
|
|
896
|
+
for (const $ of c.unit ?? [])
|
|
897
|
+
for (const z of $.measurements ?? []) {
|
|
897
898
|
if (!z.id) continue;
|
|
898
|
-
const
|
|
899
|
-
if (!
|
|
900
|
-
const ne =
|
|
901
|
-
n.set(z.id, ne ? `${
|
|
899
|
+
const X = z.abbrev || z.name;
|
|
900
|
+
if (!X) continue;
|
|
901
|
+
const ne = Pt.toDouble(z.conversion);
|
|
902
|
+
n.set(z.id, ne ? `${X} (1 ${X} = ${ne} ${$.abbrev})` : X);
|
|
902
903
|
}
|
|
903
904
|
return n;
|
|
904
|
-
}),
|
|
905
|
+
}), ee = (n) => Q.value.get(n), re = k([]), ce = k(!1);
|
|
905
906
|
async function Ee() {
|
|
906
907
|
var c;
|
|
907
908
|
const n = (c = r.currentBusiness.value) == null ? void 0 : c._id;
|
|
908
909
|
if (n) {
|
|
909
910
|
ce.value = !0;
|
|
910
911
|
try {
|
|
911
|
-
re.value =
|
|
912
|
+
re.value = x(
|
|
912
913
|
await p.listInventory(n, f.value)
|
|
913
914
|
);
|
|
914
|
-
} catch (
|
|
915
|
-
console.error("changelog inventory list load failed",
|
|
915
|
+
} catch ($) {
|
|
916
|
+
console.error("changelog inventory list load failed", $), re.value = [];
|
|
916
917
|
} finally {
|
|
917
918
|
ce.value = !1;
|
|
918
919
|
}
|
|
@@ -943,54 +944,54 @@ const dn = {
|
|
|
943
944
|
accessorFn: (n) => n.lastUpdate ?? "",
|
|
944
945
|
cell: ({ getValue: n }) => y(n() || void 0)
|
|
945
946
|
}
|
|
946
|
-
]), { commits: ot, load: at } =
|
|
947
|
+
]), { commits: ot, load: at } = nn();
|
|
947
948
|
function st(n) {
|
|
948
|
-
_.value = n,
|
|
949
|
+
_.value = n, G.value = !0, T(J.value, Xe, Re), n.id && at(`${J.value}/${f.value}/${n.id}`).catch(
|
|
949
950
|
(c) => console.error("changelog per-entity load failed", c)
|
|
950
951
|
);
|
|
951
952
|
}
|
|
952
953
|
function lt(n, c) {
|
|
953
|
-
const
|
|
954
|
-
return
|
|
955
|
-
const
|
|
956
|
-
return
|
|
954
|
+
const $ = qe(n.message);
|
|
955
|
+
return $ && $.labelKey === Ce + f.value && $.name === c.name ? !0 : (n.changes ?? []).some((z) => {
|
|
956
|
+
const X = sn(z.path);
|
|
957
|
+
return X.type === Ce + f.value && X.name === c.name;
|
|
957
958
|
});
|
|
958
959
|
}
|
|
959
960
|
const rt = V(() => {
|
|
960
961
|
const n = _.value;
|
|
961
962
|
if (!n) return [];
|
|
962
|
-
const c = K.value.filter((
|
|
963
|
-
return
|
|
964
|
-
}), be =
|
|
963
|
+
const c = K.value.filter(($) => lt($, n));
|
|
964
|
+
return tn(c, ot.value);
|
|
965
|
+
}), be = k([]), xe = k(!1), we = k(null);
|
|
965
966
|
async function it() {
|
|
966
967
|
var c;
|
|
967
968
|
const n = (c = r.currentBusiness.value) == null ? void 0 : c._id;
|
|
968
969
|
if (n) {
|
|
969
970
|
xe.value = !0;
|
|
970
971
|
try {
|
|
971
|
-
be.value =
|
|
972
|
-
await p.listDomainRecords(n,
|
|
972
|
+
be.value = x(
|
|
973
|
+
await p.listDomainRecords(n, M.value)
|
|
973
974
|
);
|
|
974
|
-
} catch (
|
|
975
|
-
console.error("changelog domain records load failed",
|
|
975
|
+
} catch ($) {
|
|
976
|
+
console.error("changelog domain records load failed", $), be.value = [];
|
|
976
977
|
} finally {
|
|
977
978
|
xe.value = !1;
|
|
978
979
|
}
|
|
979
980
|
}
|
|
980
981
|
}
|
|
981
982
|
function ut(n) {
|
|
982
|
-
var
|
|
983
|
-
const c = (
|
|
984
|
-
c && (we.value = n,
|
|
983
|
+
var $;
|
|
984
|
+
const c = ($ = r.currentBusiness.value) == null ? void 0 : $._id;
|
|
985
|
+
c && (we.value = n, G.value = !0, T(`business_${c}/${n.id}`, void 0, Le));
|
|
985
986
|
}
|
|
986
|
-
const pe =
|
|
987
|
+
const pe = k(Et()), ye = k([]), ke = k(!1), de = k(null), Te = V(() => {
|
|
987
988
|
const n = v._currentLocation;
|
|
988
989
|
return n ? `${n.name} (${n.doc.profile.code ?? "--"})` : "";
|
|
989
990
|
}), Pe = V(() => [
|
|
990
991
|
{ accessorKey: "id", header: () => a("inventory.closing.draft.table.id"), size: 320 },
|
|
991
992
|
{
|
|
992
993
|
accessorKey: "name",
|
|
993
|
-
header: () =>
|
|
994
|
+
header: () => M.value === "purchaseOrder" ? a("inventory.changelog.column.seq") : a("inventory.common.name"),
|
|
994
995
|
size: 240
|
|
995
996
|
},
|
|
996
997
|
{
|
|
@@ -1006,57 +1007,57 @@ const dn = {
|
|
|
1006
1007
|
var z;
|
|
1007
1008
|
const n = (z = v._currentLocation) == null ? void 0 : z.dbName;
|
|
1008
1009
|
if (!n) return;
|
|
1009
|
-
const c =
|
|
1010
|
+
const c = Bt(new Date(pe.value.startDate)).toISOString(), $ = Ft(new Date(pe.value.endDate)).toISOString();
|
|
1010
1011
|
ke.value = !0;
|
|
1011
1012
|
try {
|
|
1012
|
-
ye.value =
|
|
1013
|
-
|
|
1013
|
+
ye.value = x(
|
|
1014
|
+
M.value === "purchaseOrder" ? await p.listPurchaseOrders(n, c, $) : await p.listClosingDrafts(n, c, $)
|
|
1014
1015
|
);
|
|
1015
|
-
} catch (
|
|
1016
|
-
console.error("changelog location list load failed",
|
|
1016
|
+
} catch (X) {
|
|
1017
|
+
console.error("changelog location list load failed", X), ye.value = [];
|
|
1017
1018
|
} finally {
|
|
1018
1019
|
ke.value = !1;
|
|
1019
1020
|
}
|
|
1020
|
-
de.value && !ye.value.find((
|
|
1021
|
+
de.value && !ye.value.find((X) => {
|
|
1021
1022
|
var ne;
|
|
1022
|
-
return
|
|
1023
|
+
return X.id === ((ne = de.value) == null ? void 0 : ne.id);
|
|
1023
1024
|
}) && (de.value = null, T(""));
|
|
1024
1025
|
}
|
|
1025
1026
|
function ct(n) {
|
|
1026
|
-
de.value = n,
|
|
1027
|
+
de.value = n, G.value = !0, T(`${v.currentLocationDBName}/${n.id}`, void 0, Le);
|
|
1027
1028
|
}
|
|
1028
1029
|
const dt = V(() => {
|
|
1029
|
-
var n, c,
|
|
1030
|
-
return
|
|
1030
|
+
var n, c, $;
|
|
1031
|
+
return M.value === "inventory" ? ((n = _.value) == null ? void 0 : n.name) ?? "" : W.value ? ((c = we.value) == null ? void 0 : c.name) ?? "" : (($ = de.value) == null ? void 0 : $.name) ?? "";
|
|
1031
1032
|
});
|
|
1032
1033
|
function Fe() {
|
|
1033
|
-
|
|
1034
|
+
G.value = !1, M.value === "inventory" ? (_.value = null, P.value = !1, T(""), Ee().catch(
|
|
1034
1035
|
(n) => console.error("changelog inventory list failed", n)
|
|
1035
|
-
)) :
|
|
1036
|
+
)) : W.value ? (we.value = null, T(""), it().catch(
|
|
1036
1037
|
(n) => console.error("changelog domain records failed", n)
|
|
1037
1038
|
)) : (de.value = null, T(""), Be().catch((n) => console.error("changelog location list failed", n)));
|
|
1038
1039
|
}
|
|
1039
|
-
return
|
|
1040
|
+
return q(l, (n) => {
|
|
1040
1041
|
n && (d().catch((c) => console.error("changelog domain list failed", c)), Fe());
|
|
1041
|
-
}),
|
|
1042
|
-
|
|
1043
|
-
}),
|
|
1044
|
-
|
|
1045
|
-
}),
|
|
1042
|
+
}), q(M, () => {
|
|
1043
|
+
l.value && Fe();
|
|
1044
|
+
}), q(pe, () => {
|
|
1045
|
+
l.value && M.value !== "inventory" && !W.value && Be().catch((n) => console.error("changelog location list failed", n));
|
|
1046
|
+
}), q(P, (n) => {
|
|
1046
1047
|
var c;
|
|
1047
|
-
!n && ((c = _.value) != null && c.deleted) && (_.value = null,
|
|
1048
|
-
}),
|
|
1049
|
-
_.value = null,
|
|
1048
|
+
!n && ((c = _.value) != null && c.deleted) && (_.value = null, G.value = !1);
|
|
1049
|
+
}), q(f, () => {
|
|
1050
|
+
_.value = null, G.value = !1, l.value && M.value === "inventory" && Ee().catch(
|
|
1050
1051
|
(n) => console.error("changelog inventory list failed", n)
|
|
1051
1052
|
);
|
|
1052
|
-
}),
|
|
1053
|
-
_.value = null,
|
|
1053
|
+
}), q(J, (n) => {
|
|
1054
|
+
_.value = null, l.value && M.value === "inventory" && T(n, void 0, Re);
|
|
1054
1055
|
}), (n, c) => {
|
|
1055
|
-
const
|
|
1056
|
-
return i(), m(
|
|
1056
|
+
const $ = Y("FmButtonGroup"), z = Y("FmSearch"), X = Y("FmSwitch"), ne = Y("FmTable"), Ae = Y("FmDialog"), ft = Y("FmButton");
|
|
1057
|
+
return i(), m(H, null, [
|
|
1057
1058
|
I(Ae, {
|
|
1058
|
-
modelValue:
|
|
1059
|
-
"onUpdate:modelValue": c[8] || (c[8] = (j) =>
|
|
1059
|
+
modelValue: l.value,
|
|
1060
|
+
"onUpdate:modelValue": c[8] || (c[8] = (j) => l.value = j),
|
|
1060
1061
|
"close-button": "",
|
|
1061
1062
|
"dismiss-away": "",
|
|
1062
1063
|
"min-width": "98vw",
|
|
@@ -1065,36 +1066,36 @@ const dn = {
|
|
|
1065
1066
|
"content-class": "!p-0 h-[86vh]"
|
|
1066
1067
|
}, {
|
|
1067
1068
|
"dialog-header": le(() => [
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
I(
|
|
1072
|
-
modelValue:
|
|
1073
|
-
"onUpdate:modelValue": c[0] || (c[0] = (j) =>
|
|
1069
|
+
S("div", Zn, [
|
|
1070
|
+
S("div", Qn, [
|
|
1071
|
+
S("div", eo, w(R(a)("inventory.changelog.title")), 1),
|
|
1072
|
+
I($, {
|
|
1073
|
+
modelValue: U.value,
|
|
1074
|
+
"onUpdate:modelValue": c[0] || (c[0] = (j) => U.value = j),
|
|
1074
1075
|
items: h.value
|
|
1075
1076
|
}, null, 8, ["modelValue", "items"])
|
|
1076
1077
|
]),
|
|
1077
|
-
|
|
1078
|
+
S("div", to, w(R(a)("inventory.changelog.scopeDescription")), 1)
|
|
1078
1079
|
])
|
|
1079
1080
|
]),
|
|
1080
1081
|
default: le(() => [
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
I(
|
|
1082
|
+
S("div", no, [
|
|
1083
|
+
M.value === "inventory" ? (i(), m(H, { key: 0 }, [
|
|
1084
|
+
S("div", oo, [
|
|
1085
|
+
I($, {
|
|
1085
1086
|
modelValue: g.value,
|
|
1086
1087
|
"onUpdate:modelValue": c[1] || (c[1] = (j) => g.value = j),
|
|
1087
|
-
items:
|
|
1088
|
+
items: C.value
|
|
1088
1089
|
}, null, 8, ["modelValue", "items"]),
|
|
1089
1090
|
I(z, {
|
|
1090
1091
|
modelValue: N.value,
|
|
1091
1092
|
"onUpdate:modelValue": c[2] || (c[2] = (j) => N.value = j),
|
|
1092
1093
|
class: "flex-1",
|
|
1093
|
-
placeholder:
|
|
1094
|
+
placeholder: R(a)("inventory.changelog.searchInventory")
|
|
1094
1095
|
}, null, 8, ["modelValue", "placeholder"]),
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
I(
|
|
1096
|
+
S("div", ao, [
|
|
1097
|
+
S("span", so, w(R(a)("inventory.changelog.includeDeleted")), 1),
|
|
1098
|
+
I(X, {
|
|
1098
1099
|
modelValue: P.value,
|
|
1099
1100
|
"onUpdate:modelValue": c[3] || (c[3] = (j) => P.value = j)
|
|
1100
1101
|
}, null, 8, ["modelValue"])
|
|
@@ -1109,7 +1110,7 @@ const dn = {
|
|
|
1109
1110
|
"page-size": 20,
|
|
1110
1111
|
onRowClick: c[4] || (c[4] = (j) => st(j.original))
|
|
1111
1112
|
}, null, 8, ["row-data", "column-defs", "search-value", "loading"])
|
|
1112
|
-
], 64)) :
|
|
1113
|
+
], 64)) : W.value ? (i(), ie(ne, {
|
|
1113
1114
|
key: 1,
|
|
1114
1115
|
class: "min-h-0 flex-1",
|
|
1115
1116
|
"row-data": be.value,
|
|
@@ -1117,13 +1118,13 @@ const dn = {
|
|
|
1117
1118
|
loading: xe.value,
|
|
1118
1119
|
"page-size": 20,
|
|
1119
1120
|
onRowClick: c[5] || (c[5] = (j) => ut(j.original))
|
|
1120
|
-
}, null, 8, ["row-data", "column-defs", "loading"])) : (i(), m(
|
|
1121
|
-
|
|
1122
|
-
I(
|
|
1121
|
+
}, null, 8, ["row-data", "column-defs", "loading"])) : (i(), m(H, { key: 2 }, [
|
|
1122
|
+
S("div", lo, [
|
|
1123
|
+
I(Tt, {
|
|
1123
1124
|
modelValue: pe.value,
|
|
1124
1125
|
"onUpdate:modelValue": c[6] || (c[6] = (j) => pe.value = j)
|
|
1125
1126
|
}, null, 8, ["modelValue"]),
|
|
1126
|
-
Te.value ? (i(), m("span",
|
|
1127
|
+
Te.value ? (i(), m("span", ro, w(Te.value), 1)) : E("", !0)
|
|
1127
1128
|
]),
|
|
1128
1129
|
I(ne, {
|
|
1129
1130
|
class: "min-h-0 flex-1",
|
|
@@ -1139,29 +1140,29 @@ const dn = {
|
|
|
1139
1140
|
_: 1
|
|
1140
1141
|
}, 8, ["modelValue"]),
|
|
1141
1142
|
I(Ae, {
|
|
1142
|
-
modelValue:
|
|
1143
|
-
"onUpdate:modelValue": c[9] || (c[9] = (j) =>
|
|
1143
|
+
modelValue: G.value,
|
|
1144
|
+
"onUpdate:modelValue": c[9] || (c[9] = (j) => G.value = j),
|
|
1144
1145
|
"close-button": "",
|
|
1145
1146
|
"dismiss-away": "",
|
|
1146
|
-
"min-width":
|
|
1147
|
-
"max-width":
|
|
1147
|
+
"min-width": A.value,
|
|
1148
|
+
"max-width": A.value,
|
|
1148
1149
|
"max-height": "86vh"
|
|
1149
1150
|
}, {
|
|
1150
1151
|
"dialog-header": le(() => [
|
|
1151
|
-
|
|
1152
|
+
S("div", io, w(dt.value), 1)
|
|
1152
1153
|
]),
|
|
1153
1154
|
default: le(() => [
|
|
1154
|
-
I(
|
|
1155
|
-
commits:
|
|
1156
|
-
"is-loading":
|
|
1157
|
-
"resolve-name":
|
|
1155
|
+
I(qn, {
|
|
1156
|
+
commits: M.value === "inventory" ? rt.value : R(K),
|
|
1157
|
+
"is-loading": R(Z),
|
|
1158
|
+
"resolve-name": ee
|
|
1158
1159
|
}, null, 8, ["commits", "is-loading"]),
|
|
1159
|
-
|
|
1160
|
+
M.value !== "inventory" && R(te) ? (i(), m("div", uo, [
|
|
1160
1161
|
I(ft, {
|
|
1161
|
-
label:
|
|
1162
|
+
label: R(a)("inventory.changelog.loadMore"),
|
|
1162
1163
|
variant: "secondary",
|
|
1163
|
-
disabled:
|
|
1164
|
-
onClick:
|
|
1164
|
+
disabled: R(Z),
|
|
1165
|
+
onClick: b
|
|
1165
1166
|
}, null, 8, ["label", "disabled"])
|
|
1166
1167
|
])) : E("", !0)
|
|
1167
1168
|
]),
|
|
@@ -1170,71 +1171,71 @@ const dn = {
|
|
|
1170
1171
|
], 64);
|
|
1171
1172
|
};
|
|
1172
1173
|
}
|
|
1173
|
-
}),
|
|
1174
|
-
function
|
|
1174
|
+
}), fo = /* @__PURE__ */ At(co, [["__scopeId", "data-v-07c5a952"]]), se = 8;
|
|
1175
|
+
function mo(o, e) {
|
|
1175
1176
|
return { x: se, y: Math.max(se, e - o - se) };
|
|
1176
1177
|
}
|
|
1177
|
-
const
|
|
1178
|
+
const po = ["title"], Ge = 48, vo = 8, go = /* @__PURE__ */ ue({
|
|
1178
1179
|
__name: "ChangelogFloatingButton",
|
|
1179
1180
|
setup(o) {
|
|
1180
|
-
const { t: e } = he(), t = ge(),
|
|
1181
|
-
var
|
|
1182
|
-
return !!((
|
|
1183
|
-
}),
|
|
1181
|
+
const { t: e } = he(), t = ge(), s = V(() => {
|
|
1182
|
+
var b;
|
|
1183
|
+
return !!((b = t.sessionUser.value) != null && b.role.isAdmin);
|
|
1184
|
+
}), l = k(!1), a = k(null);
|
|
1184
1185
|
function r() {
|
|
1185
|
-
var
|
|
1186
|
+
var b, y;
|
|
1186
1187
|
return {
|
|
1187
|
-
width: ((
|
|
1188
|
+
width: ((b = a.value) == null ? void 0 : b.offsetWidth) ?? Ge,
|
|
1188
1189
|
height: ((y = a.value) == null ? void 0 : y.offsetHeight) ?? Ge
|
|
1189
1190
|
};
|
|
1190
1191
|
}
|
|
1191
|
-
const u =
|
|
1192
|
-
function v(
|
|
1193
|
-
return Math.min(Math.max(
|
|
1192
|
+
const u = k({ x: 0, y: 0 });
|
|
1193
|
+
function v(b, y, x) {
|
|
1194
|
+
return Math.min(Math.max(b, y), x);
|
|
1194
1195
|
}
|
|
1195
1196
|
function p() {
|
|
1196
|
-
const { width:
|
|
1197
|
+
const { width: b, height: y } = r(), x = Math.max(se, window.innerWidth - b - se - vo), T = Math.max(se, window.innerHeight - y - se), O = u.value.x + b / 2;
|
|
1197
1198
|
u.value = {
|
|
1198
|
-
x: O < window.innerWidth / 2 ? se :
|
|
1199
|
+
x: O < window.innerWidth / 2 ? se : x,
|
|
1199
1200
|
y: v(u.value.y, se, T)
|
|
1200
1201
|
};
|
|
1201
1202
|
}
|
|
1202
1203
|
function L() {
|
|
1203
|
-
u.value =
|
|
1204
|
+
u.value = mo(r().height, window.innerHeight);
|
|
1204
1205
|
}
|
|
1205
1206
|
Ie(() => {
|
|
1206
1207
|
L(), window.addEventListener("resize", p), window.addEventListener("orientationchange", p);
|
|
1207
1208
|
}), gt(() => {
|
|
1208
1209
|
window.removeEventListener("resize", p), window.removeEventListener("orientationchange", p);
|
|
1209
|
-
}),
|
|
1210
|
-
|
|
1210
|
+
}), q(s, async (b) => {
|
|
1211
|
+
b && (await yt(), L());
|
|
1211
1212
|
});
|
|
1212
|
-
const F =
|
|
1213
|
-
let
|
|
1214
|
-
function
|
|
1215
|
-
|
|
1213
|
+
const F = k(!1);
|
|
1214
|
+
let A = null, K = !1;
|
|
1215
|
+
function Z(b) {
|
|
1216
|
+
A = { x: b.clientX, y: b.clientY, px: u.value.x, py: u.value.y }, F.value = !0, K = !1, b.currentTarget.setPointerCapture(b.pointerId);
|
|
1216
1217
|
}
|
|
1217
|
-
function
|
|
1218
|
-
if (!
|
|
1219
|
-
const y =
|
|
1220
|
-
Math.abs(y) + Math.abs(
|
|
1218
|
+
function te(b) {
|
|
1219
|
+
if (!A) return;
|
|
1220
|
+
const y = b.clientX - A.x, x = b.clientY - A.y;
|
|
1221
|
+
Math.abs(y) + Math.abs(x) > 3 && (K = !0);
|
|
1221
1222
|
const { width: T, height: O } = r();
|
|
1222
1223
|
u.value = {
|
|
1223
|
-
x: v(
|
|
1224
|
-
y: v(
|
|
1224
|
+
x: v(A.px + y, 0, window.innerWidth - T),
|
|
1225
|
+
y: v(A.py + x, 0, window.innerHeight - O)
|
|
1225
1226
|
};
|
|
1226
1227
|
}
|
|
1227
|
-
function
|
|
1228
|
-
|
|
1228
|
+
function D() {
|
|
1229
|
+
A = null, F.value = !1, p();
|
|
1229
1230
|
}
|
|
1230
|
-
function
|
|
1231
|
-
|
|
1231
|
+
function B() {
|
|
1232
|
+
A && (D(), K || (l.value = !0));
|
|
1232
1233
|
}
|
|
1233
|
-
return (
|
|
1234
|
-
const
|
|
1234
|
+
return (b, y) => {
|
|
1235
|
+
const x = Y("FmIcon");
|
|
1235
1236
|
return i(), ie(ht, { to: "body" }, [
|
|
1236
|
-
|
|
1237
|
-
|
|
1237
|
+
s.value ? (i(), m(H, { key: 0 }, [
|
|
1238
|
+
S("div", {
|
|
1238
1239
|
ref_key: "wrapperRef",
|
|
1239
1240
|
ref: a,
|
|
1240
1241
|
class: ae(["fixed z-50 cursor-grab touch-none", F.value ? "" : "transition-[left,top] duration-200 ease-out"]),
|
|
@@ -1242,35 +1243,35 @@ const mo = ["title"], Ge = 48, po = 8, vo = /* @__PURE__ */ ue({
|
|
|
1242
1243
|
}, [
|
|
1243
1244
|
I(We, null, {
|
|
1244
1245
|
default: le(() => [
|
|
1245
|
-
|
|
1246
|
+
S("button", {
|
|
1246
1247
|
type: "button",
|
|
1247
|
-
title:
|
|
1248
|
+
title: R(e)("inventory.changelog.title"),
|
|
1248
1249
|
class: ae(["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", F.value ? "cursor-grabbing" : "cursor-grab"]),
|
|
1249
|
-
onPointerdown:
|
|
1250
|
-
onPointermove:
|
|
1251
|
-
onPointerup:
|
|
1252
|
-
onPointercancel:
|
|
1250
|
+
onPointerdown: Z,
|
|
1251
|
+
onPointermove: te,
|
|
1252
|
+
onPointerup: B,
|
|
1253
|
+
onPointercancel: D
|
|
1253
1254
|
}, [
|
|
1254
|
-
I(
|
|
1255
|
+
I(x, {
|
|
1255
1256
|
name: "history",
|
|
1256
1257
|
size: "md",
|
|
1257
1258
|
outline: ""
|
|
1258
1259
|
}),
|
|
1259
|
-
|
|
1260
|
-
], 42,
|
|
1260
|
+
S("span", null, w(R(e)("inventory.changelog.fabLabel")), 1)
|
|
1261
|
+
], 42, po)
|
|
1261
1262
|
]),
|
|
1262
1263
|
_: 1
|
|
1263
1264
|
})
|
|
1264
1265
|
], 6),
|
|
1265
|
-
I(
|
|
1266
|
-
modelValue:
|
|
1267
|
-
"onUpdate:modelValue": y[0] || (y[0] = (T) =>
|
|
1266
|
+
I(fo, {
|
|
1267
|
+
modelValue: l.value,
|
|
1268
|
+
"onUpdate:modelValue": y[0] || (y[0] = (T) => l.value = T)
|
|
1268
1269
|
}, null, 8, ["modelValue"])
|
|
1269
1270
|
], 64)) : E("", !0)
|
|
1270
1271
|
]);
|
|
1271
1272
|
};
|
|
1272
1273
|
}
|
|
1273
|
-
}),
|
|
1274
|
+
}), yo = { class: "flex items-center gap-8" }, ho = { class: "flex flex-col gap-8 text-fm-color-typo-secondary" }, _o = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary" }, bo = /* @__PURE__ */ ue({
|
|
1274
1275
|
__name: "DeprecateSoonWarningDialog",
|
|
1275
1276
|
props: /* @__PURE__ */ Ue({
|
|
1276
1277
|
featureName: {}
|
|
@@ -1280,12 +1281,12 @@ const mo = ["title"], Ge = 48, po = 8, vo = /* @__PURE__ */ ue({
|
|
|
1280
1281
|
}),
|
|
1281
1282
|
emits: /* @__PURE__ */ Ue(["proceed"], ["update:modelValue"]),
|
|
1282
1283
|
setup(o, { emit: e }) {
|
|
1283
|
-
const t = bt(o, "modelValue"),
|
|
1284
|
-
function
|
|
1285
|
-
t.value = !1,
|
|
1284
|
+
const t = bt(o, "modelValue"), s = e;
|
|
1285
|
+
function l() {
|
|
1286
|
+
t.value = !1, s("proceed");
|
|
1286
1287
|
}
|
|
1287
1288
|
return (a, r) => {
|
|
1288
|
-
const u =
|
|
1289
|
+
const u = Y("FmSpacer"), v = Y("FmButton"), p = Y("FmDialog");
|
|
1289
1290
|
return i(), ie(p, {
|
|
1290
1291
|
modelValue: t.value,
|
|
1291
1292
|
"onUpdate:modelValue": r[1] || (r[1] = (L) => t.value = L),
|
|
@@ -1295,9 +1296,9 @@ const mo = ["title"], Ge = 48, po = 8, vo = /* @__PURE__ */ ue({
|
|
|
1295
1296
|
"max-width": "520px"
|
|
1296
1297
|
}, {
|
|
1297
1298
|
"dialog-header": le(() => [
|
|
1298
|
-
|
|
1299
|
-
r[2] || (r[2] =
|
|
1300
|
-
I(
|
|
1299
|
+
S("div", yo, [
|
|
1300
|
+
r[2] || (r[2] = S("span", null, "Feature removal notice", -1)),
|
|
1301
|
+
I(Ot)
|
|
1301
1302
|
])
|
|
1302
1303
|
]),
|
|
1303
1304
|
"dialog-footer": le(() => [
|
|
@@ -1309,32 +1310,32 @@ const mo = ["title"], Ge = 48, po = 8, vo = /* @__PURE__ */ ue({
|
|
|
1309
1310
|
}),
|
|
1310
1311
|
I(v, {
|
|
1311
1312
|
label: "Continue",
|
|
1312
|
-
onClick:
|
|
1313
|
+
onClick: l
|
|
1313
1314
|
})
|
|
1314
1315
|
]),
|
|
1315
1316
|
default: le(() => [
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
r[3] || (r[3] =
|
|
1317
|
+
S("div", ho, [
|
|
1318
|
+
S("p", _o, w(a.featureName ?? "This feature") + " will be removed in a future release. ", 1),
|
|
1319
|
+
r[3] || (r[3] = S("p", { class: "fm-typo-en-body-sm-400" }, " You can continue to use it for now, but we recommend moving to the supported workflow. ", -1))
|
|
1319
1320
|
])
|
|
1320
1321
|
]),
|
|
1321
1322
|
_: 1
|
|
1322
1323
|
}, 8, ["modelValue"]);
|
|
1323
1324
|
};
|
|
1324
1325
|
}
|
|
1325
|
-
}),
|
|
1326
|
+
}), xo = { class: "h-full flex flex-col overflow-auto py-16 gap-2" }, wo = /* @__PURE__ */ ue({
|
|
1326
1327
|
__name: "NavigationTab",
|
|
1327
1328
|
setup(o) {
|
|
1328
|
-
const e = Ct(), t = Ne(),
|
|
1329
|
+
const e = Ct(), t = Ne(), s = ge(), l = Kt(), a = Mt(), r = k(!1), u = k(null), v = k(null), p = k(!1), L = k(null), F = k(null), A = V(
|
|
1329
1330
|
() => {
|
|
1330
|
-
var y,
|
|
1331
|
-
return (
|
|
1331
|
+
var y, x;
|
|
1332
|
+
return (x = Oe(((y = L.value) == null ? void 0 : y.featureKey) ?? "")) == null ? void 0 : x.label;
|
|
1332
1333
|
}
|
|
1333
1334
|
), { menuItems: K } = Ye();
|
|
1334
|
-
|
|
1335
|
-
(y == null ? void 0 : y.menuVersion) === "v3" && (
|
|
1335
|
+
q([() => s.currentBusiness.value, () => e.name], ([y, x]) => {
|
|
1336
|
+
(y == null ? void 0 : y.menuVersion) === "v3" && (x === me.INGREDIENTS || x === me.RECIPE || x === me.UNIT) && t.push({ name: me.STOCK });
|
|
1336
1337
|
});
|
|
1337
|
-
const
|
|
1338
|
+
const Z = V({
|
|
1338
1339
|
get() {
|
|
1339
1340
|
if (e.name)
|
|
1340
1341
|
return String(e.name);
|
|
@@ -1342,57 +1343,57 @@ const mo = ["title"], Ge = 48, po = 8, vo = /* @__PURE__ */ ue({
|
|
|
1342
1343
|
set(y) {
|
|
1343
1344
|
var d;
|
|
1344
1345
|
if (!y) return;
|
|
1345
|
-
const
|
|
1346
|
+
const x = String(y), T = Vt.find((h) => h.route === x), O = It(x, l.value);
|
|
1346
1347
|
if ((d = Oe((T == null ? void 0 : T.featureKey) ?? "")) != null && d.deprecateSoon) {
|
|
1347
|
-
L.value = T ?? null, F.value =
|
|
1348
|
+
L.value = T ?? null, F.value = x, p.value = !0;
|
|
1348
1349
|
return;
|
|
1349
1350
|
}
|
|
1350
1351
|
if (T && O.disabled) {
|
|
1351
1352
|
u.value = T, v.value = O, r.value = !0;
|
|
1352
1353
|
return;
|
|
1353
1354
|
}
|
|
1354
|
-
t.push({ name:
|
|
1355
|
+
t.push({ name: x });
|
|
1355
1356
|
}
|
|
1356
1357
|
});
|
|
1357
|
-
function
|
|
1358
|
+
function te() {
|
|
1358
1359
|
F.value && (t.push({ name: F.value }), F.value = null);
|
|
1359
1360
|
}
|
|
1360
|
-
const
|
|
1361
|
+
const D = V(
|
|
1361
1362
|
() => {
|
|
1362
1363
|
var y;
|
|
1363
|
-
return `NavigationTab.${(y =
|
|
1364
|
+
return `NavigationTab.${(y = s.currentBusiness.value) == null ? void 0 : y._id}`;
|
|
1364
1365
|
}
|
|
1365
|
-
),
|
|
1366
|
+
), B = k(!1), b = V({
|
|
1366
1367
|
get() {
|
|
1367
|
-
return
|
|
1368
|
+
return B.value;
|
|
1368
1369
|
},
|
|
1369
1370
|
set(y) {
|
|
1370
|
-
|
|
1371
|
+
B.value = y, y || a.setItem(D.value, "true");
|
|
1371
1372
|
}
|
|
1372
1373
|
});
|
|
1373
|
-
return
|
|
1374
|
-
|
|
1375
|
-
|
|
1374
|
+
return q([() => D.value], () => {
|
|
1375
|
+
B.value = !1, setTimeout(() => {
|
|
1376
|
+
b.value = !a.getItem(D.value);
|
|
1376
1377
|
}, 2e3);
|
|
1377
|
-
}), (y,
|
|
1378
|
-
const T =
|
|
1379
|
-
return i(), m("div",
|
|
1378
|
+
}), (y, x) => {
|
|
1379
|
+
const T = Y("FmCollapsibleTabs");
|
|
1380
|
+
return i(), m("div", xo, [
|
|
1380
1381
|
I(T, {
|
|
1381
|
-
modelValue:
|
|
1382
|
-
"onUpdate:modelValue":
|
|
1383
|
-
items:
|
|
1382
|
+
modelValue: Z.value,
|
|
1383
|
+
"onUpdate:modelValue": x[0] || (x[0] = (O) => Z.value = O),
|
|
1384
|
+
items: R(K)
|
|
1384
1385
|
}, null, 8, ["modelValue", "items"]),
|
|
1385
|
-
I(
|
|
1386
|
+
I(Ut, {
|
|
1386
1387
|
modelValue: r.value,
|
|
1387
|
-
"onUpdate:modelValue":
|
|
1388
|
+
"onUpdate:modelValue": x[1] || (x[1] = (O) => r.value = O),
|
|
1388
1389
|
capability: u.value,
|
|
1389
1390
|
result: v.value
|
|
1390
1391
|
}, null, 8, ["modelValue", "capability", "result"]),
|
|
1391
|
-
I(
|
|
1392
|
+
I(bo, {
|
|
1392
1393
|
modelValue: p.value,
|
|
1393
|
-
"onUpdate:modelValue":
|
|
1394
|
-
"feature-name":
|
|
1395
|
-
onProceed:
|
|
1394
|
+
"onUpdate:modelValue": x[2] || (x[2] = (O) => p.value = O),
|
|
1395
|
+
"feature-name": A.value,
|
|
1396
|
+
onProceed: te
|
|
1396
1397
|
}, null, 8, ["modelValue", "feature-name"])
|
|
1397
1398
|
]);
|
|
1398
1399
|
};
|
|
@@ -1400,29 +1401,29 @@ const mo = ["title"], Ge = 48, po = 8, vo = /* @__PURE__ */ ue({
|
|
|
1400
1401
|
});
|
|
1401
1402
|
typeof Promise.withResolvers > "u" && (Promise.withResolvers = () => {
|
|
1402
1403
|
let o, e;
|
|
1403
|
-
return { promise: new Promise((
|
|
1404
|
-
o =
|
|
1404
|
+
return { promise: new Promise((s, l) => {
|
|
1405
|
+
o = s, e = l;
|
|
1405
1406
|
}), resolve: o, reject: e };
|
|
1406
1407
|
});
|
|
1407
1408
|
typeof Promise.prototype.delayed > "u" && (Promise.prototype.delayed = async function(o) {
|
|
1408
1409
|
return await new Promise((e) => setTimeout(e, o)), Promise.resolve(this);
|
|
1409
1410
|
});
|
|
1410
|
-
const
|
|
1411
|
+
const ko = {
|
|
1411
1412
|
key: 0,
|
|
1412
1413
|
class: "flex h-5 items-center justify-center bg-amber-100 px-12 text-xs font-medium text-amber-800 shadow-sm"
|
|
1413
|
-
},
|
|
1414
|
+
}, Go = /* @__PURE__ */ ue({
|
|
1414
1415
|
__name: "App",
|
|
1415
1416
|
setup(o) {
|
|
1416
|
-
const e = ge(), t =
|
|
1417
|
+
const e = ge(), t = zt(), s = $t(), l = window.location.href.includes("print-preview");
|
|
1417
1418
|
Ie(() => {
|
|
1418
1419
|
if (window.location.href.includes("print-preview")) {
|
|
1419
1420
|
e.setEmbedded(!0), document.body.classList.add("print-mode");
|
|
1420
1421
|
return;
|
|
1421
1422
|
}
|
|
1422
|
-
e.registerSidebarComponent(
|
|
1423
|
+
e.registerSidebarComponent(wo), t.initGoogleMap(s.appApi.googleMap).catch(() => {
|
|
1423
1424
|
console.error("Google map cannot be loaded");
|
|
1424
1425
|
});
|
|
1425
|
-
}),
|
|
1426
|
+
}), q([() => e.currentCountry.value], () => {
|
|
1426
1427
|
a();
|
|
1427
1428
|
});
|
|
1428
1429
|
async function a() {
|
|
@@ -1433,13 +1434,13 @@ const wo = {
|
|
|
1433
1434
|
console.error("error when trying to reset businesses:", u);
|
|
1434
1435
|
}
|
|
1435
1436
|
}
|
|
1436
|
-
return (r, u) => (i(), m(
|
|
1437
|
-
|
|
1438
|
-
I(
|
|
1439
|
-
|
|
1437
|
+
return (r, u) => (i(), m(H, null, [
|
|
1438
|
+
R(s).isDev && !R(l) ? (i(), m("div", ko, " Non-production environment ")) : E("", !0),
|
|
1439
|
+
I(Zt),
|
|
1440
|
+
R(l) ? E("", !0) : (i(), ie(go, { key: 1 }))
|
|
1440
1441
|
], 64));
|
|
1441
1442
|
}
|
|
1442
1443
|
});
|
|
1443
1444
|
export {
|
|
1444
|
-
|
|
1445
|
+
Go as default
|
|
1445
1446
|
};
|