@feedmepos/mf-inventory-portal 0.0.25-dev.26 → 0.0.25-dev.28
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-FlLD43pf.js → App-DSmyUe9i.js} +2 -2
- package/dist/{ApprovalView-DwTvIjyF.js → ApprovalView-BEFFaX86.js} +2 -2
- package/dist/{BindingsDialog-Ctxe-2eR.js → BindingsDialog-D-8BvojK.js} +2 -2
- package/dist/{BindingsPicker-DpHgBr9I.js → BindingsPicker-Cy1yg1bG.js} +1 -1
- package/dist/{BindingsTable-C0onBRN2.js → BindingsTable-Dhz8ONJT.js} +1 -1
- package/dist/ClosingDraftView-BAe-mbpn.js +1340 -0
- package/dist/{ClosingTemplateView-MRYukFc9.js → ClosingTemplateView-DzNurLwH.js} +2 -2
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DLo0_EnE.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DlyahP5t.js} +3 -3
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-vMjhugJb.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CLOyc7cd.js} +1 -1
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-C81Jfejj.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-CPphZwgW.js} +1 -1
- package/dist/{IngredientGroupView-CRK2IXYi.js → IngredientGroupView-B3VDBCV0.js} +1 -1
- package/dist/{IngredientsView-BVJDcDaw.js → IngredientsView-fH4XMnpj.js} +4 -4
- package/dist/{IntegrationView-D2xZ-auL.js → IntegrationView-BzDRH4Bb.js} +1 -1
- package/dist/{InventoryBindingForm-D2nu9Ffp.js → InventoryBindingForm-UHqEY-qM.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DTcqJhdD.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CA5CZZLs.js} +3 -3
- package/dist/{InventoryBindingSummary-BrfjSG-X.js → InventoryBindingSummary-BEG0ALdu.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BuSqcjGE.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-D42I0B0D.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-DNDFZjc2.js → PremiumBadge.vue_vue_type_script_setup_true_lang-G3lrGACK.js} +1 -1
- package/dist/{PublishView-C53GSTpI.js → PublishView-M59-kjB0.js} +2 -2
- package/dist/{PurchaseOrderPrintPreview-BJwg7kN3.js → PurchaseOrderPrintPreview-DqmHchcj.js} +1 -1
- package/dist/{ReceiveRequestView-DSVVaWMp.js → ReceiveRequestView-B0UIDOcH.js} +961 -962
- package/dist/{RecipeView-BHQqcnww.js → RecipeView-BilboVDa.js} +3 -3
- package/dist/{StockView-Cnn-wHVz.js → StockView-Cfn5imH5.js} +7 -7
- package/dist/{SupplierView-B87uSeNG.js → SupplierView-CNGj0VUZ.js} +4 -4
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BtEavLOY.js → TransferDetails.vue_vue_type_script_setup_true_lang-B19fXcww.js} +4 -4
- package/dist/{TransferTemplateView-6bRr_A5Y.js → TransferTemplateView-DzGNHKGY.js} +7 -7
- package/dist/{UnitView-Ck94whT5.js → UnitView-Bf-w3APZ.js} +3 -3
- package/dist/{WarehouseView-BceoB6Cq.js → WarehouseView-XorSVXc0.js} +1 -1
- package/dist/api/netsuite.d.ts +16 -0
- package/dist/{app-CtbmMi1h.js → app-fx2FK22w.js} +8239 -8220
- package/dist/app.js +1 -1
- package/dist/{decimal-D1zkJPMb.js → decimal-BFVy6_IW.js} +1 -1
- package/dist/{feature-OQuluLLR.js → feature-C2loTRTd.js} +139 -131
- package/dist/{format-unit-display-nGgm9HEU.js → format-unit-display-BLRFNu3V.js} +2 -2
- package/dist/{index-DZ88SgFi.js → index-Koid_wNd.js} +2 -2
- package/dist/{stock-DZzQZdU1.js → stock-Dx-ZW-_n.js} +1 -1
- package/dist/stores/feature.d.ts +4 -1
- package/dist/stores/integration/netsuite.d.ts +16 -0
- package/dist/{supplier-C7vjGYYz.js → supplier-DUp4Kl5Y.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-DKsbfBJ5.js → use-ingredient-select-dialog-DXFC8qWH.js} +1 -1
- package/dist/{use-inventory-binding-dialog-BM3hVdj-.js → use-inventory-binding-dialog-BXPkFjVT.js} +1 -1
- package/dist/views/closing-draft/helpers/export-draft.helper.d.ts +2 -2
- package/dist/views/receive-request/components/transfer-details/TransferDetails.vue.d.ts +2 -0
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +6 -0
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +6 -0
- package/dist/views/receive-request/import/export.d.ts +2 -4
- package/dist/{vue-i18n-kwkYkNRD.js → vue-i18n-C6MVnEFi.js} +437 -437
- package/package.json +3 -3
- package/dist/ClosingDraftView-bACYchEO.js +0 -1308
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
var fe = Object.defineProperty;
|
|
2
2
|
var pe = (S, u, v) => u in S ? fe(S, u, { enumerable: !0, configurable: !0, writable: !0, value: v }) : S[u] = v;
|
|
3
|
-
var
|
|
4
|
-
import { useCoreStore as
|
|
5
|
-
import { a4 as
|
|
3
|
+
var ht = (S, u, v) => pe(S, typeof u != "symbol" ? u + "" : u, v);
|
|
4
|
+
import { useCoreStore as vt } from "@feedmepos/mf-common";
|
|
5
|
+
import { a4 as dt, u as Dt, ax as ae, a as ye } from "./app-fx2FK22w.js";
|
|
6
6
|
import { ref as gt, readonly as Kt } from "vue";
|
|
7
7
|
var Gt = { exports: {} };
|
|
8
8
|
(function(S, u) {
|
|
9
9
|
(function(v, d) {
|
|
10
10
|
d(u);
|
|
11
|
-
})(
|
|
11
|
+
})(dt, function(v) {
|
|
12
12
|
var d = { getItemSync: function(a) {
|
|
13
13
|
try {
|
|
14
14
|
return localStorage.getItem(a) || null;
|
|
@@ -39,7 +39,7 @@ var Gt = { exports: {} };
|
|
|
39
39
|
return a;
|
|
40
40
|
}, o.apply(this, arguments);
|
|
41
41
|
};
|
|
42
|
-
function
|
|
42
|
+
function x(a, e, t, i) {
|
|
43
43
|
return new (t || (t = Promise))(function(n, r) {
|
|
44
44
|
function s(f) {
|
|
45
45
|
try {
|
|
@@ -123,11 +123,11 @@ var Gt = { exports: {} };
|
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function L(a, e, t) {
|
|
127
127
|
for (var i, n = 0, r = e.length; n < r; n++) !i && n in e || (i || (i = Array.prototype.slice.call(e, 0, n)), i[n] = e[n]);
|
|
128
128
|
return a.concat(i || Array.prototype.slice.call(e));
|
|
129
129
|
}
|
|
130
|
-
var
|
|
130
|
+
var W = function a(e, t) {
|
|
131
131
|
if (e === t) return !0;
|
|
132
132
|
if (e && t && typeof e == "object" && typeof t == "object") {
|
|
133
133
|
if (e.constructor !== t.constructor) return !1;
|
|
@@ -153,7 +153,7 @@ var Gt = { exports: {} };
|
|
|
153
153
|
function _(a, e) {
|
|
154
154
|
var t = Object.keys(e || {}).filter(function(i) {
|
|
155
155
|
var n = a == null ? void 0 : a[i], r = e == null ? void 0 : e[i];
|
|
156
|
-
return !
|
|
156
|
+
return !W(n, r);
|
|
157
157
|
});
|
|
158
158
|
return Object.keys(a || {}).filter(function(i) {
|
|
159
159
|
Object.keys(e || {}).includes(i) || t.push(i);
|
|
@@ -179,25 +179,25 @@ var Gt = { exports: {} };
|
|
|
179
179
|
(function(a) {
|
|
180
180
|
a.NONE = "NONE", a.DEFAULT_FLAGS = "DEFAULT_FLAGS", a.CACHE = "CACHE", a.SERVER = "SERVER";
|
|
181
181
|
})(F || (F = {}));
|
|
182
|
-
var Y,
|
|
182
|
+
var Y, T = null, ce = "FLAGSMITH_EVENT", ut = ce, Jt = "https://edge.api.flagsmith.com/api/v1/", Vt = "flagsmith_value_", Mt = "flagsmith_enabled_", Bt = "flagsmith_trait_", he = function() {
|
|
183
183
|
function a(e) {
|
|
184
184
|
var t = this;
|
|
185
185
|
this._trigger = null, this._triggerLoadingState = null, this.timestamp = null, this.isLoading = !1, this.eventSource = null, this.getFlags = function() {
|
|
186
186
|
var i = t, n = i.api, r = i.evaluationContext;
|
|
187
187
|
t.log("Get Flags"), t.isLoading = !0, t.loadingState.isFetching || t.setLoadingState(o(o({}, t.loadingState), { isFetching: !0 }));
|
|
188
188
|
var s = "".concat(t.getContext().identity), c = function(h) {
|
|
189
|
-
var f, l, y,
|
|
189
|
+
var f, l, y, w;
|
|
190
190
|
if (h && s === "".concat(t.getContext().identity)) {
|
|
191
191
|
var D = h.flags, A = h.traits, R = h.identifier;
|
|
192
192
|
t.isLoading = !1;
|
|
193
|
-
var j = {},
|
|
193
|
+
var j = {}, N = {};
|
|
194
194
|
A = A || [], (D = D || []).forEach(function(m) {
|
|
195
195
|
j[m.feature.name.toLowerCase().replace(/ /g, "_")] = { id: m.feature.id, enabled: m.enabled, value: m.feature_state_value };
|
|
196
196
|
}), A.forEach(function(m) {
|
|
197
|
-
|
|
197
|
+
N[m.trait_key.toLowerCase().replace(/ /g, "_")] = { transient: m.transient, value: m.trait_value };
|
|
198
198
|
}), t.oldFlags = o({}, t.flags);
|
|
199
|
-
var K = _(t.oldFlags, j), nt = _((f = t.evaluationContext.identity) === null || f === void 0 ? void 0 : f.traits,
|
|
200
|
-
if ((R || Object.keys(
|
|
199
|
+
var K = _(t.oldFlags, j), nt = _((f = t.evaluationContext.identity) === null || f === void 0 ? void 0 : f.traits, N);
|
|
200
|
+
if ((R || Object.keys(N).length) && (t.evaluationContext.identity = o(o({}, t.evaluationContext.identity), { traits: N }), R && (t.evaluationContext.identity.identifier = R)), t.flags = j, t.updateStorage(), t._onChange(t.oldFlags, { isFromServer: !0, flagsChanged: K, traitsChanged: nt }, t._loadedState(null, F.SERVER)), t.datadogRum) try {
|
|
201
201
|
if (t.datadogRum.trackTraits) {
|
|
202
202
|
var it = {};
|
|
203
203
|
Object.keys(((l = t.evaluationContext.identity) === null || l === void 0 ? void 0 : l.traits) || {}).map(function(m) {
|
|
@@ -210,12 +210,12 @@ var Gt = { exports: {} };
|
|
|
210
210
|
console.error(m);
|
|
211
211
|
}
|
|
212
212
|
if (t.dtrum) try {
|
|
213
|
-
var
|
|
213
|
+
var O = { javaDouble: {}, date: {}, shortString: {}, javaLongOrObject: {} };
|
|
214
214
|
Object.keys(t.flags).map(function(m) {
|
|
215
|
-
p(
|
|
216
|
-
}), Object.keys(((
|
|
217
|
-
p(
|
|
218
|
-
}), t.log("Sending javaLongOrObject traits to dynatrace",
|
|
215
|
+
p(O, Vt + m, t.getValue(m, { skipAnalytics: !0 })), p(O, Mt + m, t.hasFeature(m, { skipAnalytics: !0 }));
|
|
216
|
+
}), Object.keys(((w = t.evaluationContext.identity) === null || w === void 0 ? void 0 : w.traits) || {}).map(function(m) {
|
|
217
|
+
p(O, Bt + m, t.getTrait(m));
|
|
218
|
+
}), t.log("Sending javaLongOrObject traits to dynatrace", O.javaLongOrObject), t.log("Sending date traits to dynatrace", O.date), t.log("Sending shortString traits to dynatrace", O.shortString), t.log("Sending javaDouble to dynatrace", O.javaDouble), t.dtrum.sendSessionProperties(O.javaLongOrObject, O.date, O.shortString, O.javaDouble);
|
|
219
219
|
} catch (m) {
|
|
220
220
|
console.error(m);
|
|
221
221
|
}
|
|
@@ -292,20 +292,20 @@ var Gt = { exports: {} };
|
|
|
292
292
|
t.evaluationContext.environment && (f.headers["X-Environment-Key"] = t.evaluationContext.environment.apiKey), n && n !== "GET" && (f.headers["Content-Type"] = "application/json; charset=utf-8"), h && Object.assign(f.headers, h), g || console.error("Flagsmith: fetch is undefined, please specify a fetch implementation into flagsmith.init to support SSR.");
|
|
293
293
|
var l = "".concat((s = t.evaluationContext.identity) === null || s === void 0 ? void 0 : s.identifier);
|
|
294
294
|
return g(i, f).then(function(y) {
|
|
295
|
-
var
|
|
295
|
+
var w, D, A = "".concat((w = t.evaluationContext.identity) === null || w === void 0 ? void 0 : w.identifier);
|
|
296
296
|
if (l === A) {
|
|
297
297
|
var R = (D = y.headers) === null || D === void 0 ? void 0 : D.get("x-flagsmith-document-updated-at");
|
|
298
298
|
if (R) try {
|
|
299
299
|
var j = parseFloat(R);
|
|
300
300
|
if (isNaN(j)) return Promise.reject("Failed to parse x-flagsmith-document-updated-at");
|
|
301
301
|
t.timestamp = j;
|
|
302
|
-
} catch (
|
|
303
|
-
t.log(
|
|
302
|
+
} catch (N) {
|
|
303
|
+
t.log(N, "Failed to parse x-flagsmith-document-updated-at", R);
|
|
304
304
|
}
|
|
305
|
-
return t.log("Fetch response: " + y.status + " " + (n || "GET") + 0 + i), y.text().then(function(
|
|
306
|
-
var K =
|
|
305
|
+
return t.log("Fetch response: " + y.status + " " + (n || "GET") + 0 + i), y.text().then(function(N) {
|
|
306
|
+
var K = N;
|
|
307
307
|
try {
|
|
308
|
-
K = JSON.parse(
|
|
308
|
+
K = JSON.parse(N);
|
|
309
309
|
} catch {
|
|
310
310
|
}
|
|
311
311
|
return !K && y.status && (K = "API Response: ".concat(y.status)), y.status && y.status >= 200 && y.status < 300 ? K : Promise.reject(new Error(K));
|
|
@@ -322,70 +322,70 @@ var Gt = { exports: {} };
|
|
|
322
322
|
}, this._onChange = function(i, n, r) {
|
|
323
323
|
var s, c;
|
|
324
324
|
t.setLoadingState(r), (s = t.onChange) === null || s === void 0 || s.call(t, i, n, t.loadingState), (c = t._trigger) === null || c === void 0 || c.call(t);
|
|
325
|
-
}, g = e.fetch ? e.fetch : typeof fetch < "u" ? fetch :
|
|
325
|
+
}, g = e.fetch ? e.fetch : typeof fetch < "u" ? fetch : dt === null || dt === void 0 ? void 0 : dt.fetch, this.canUseStorage = typeof window < "u" || !!e.browserlessStorage, this.log("Constructing flagsmith instance " + e), e.eventSource && (Y = e.eventSource), e.AsyncStorage && (T = e.AsyncStorage);
|
|
326
326
|
}
|
|
327
327
|
return a.prototype.init = function(e) {
|
|
328
328
|
var t, i, n;
|
|
329
|
-
return
|
|
330
|
-
var r, s, c, h, f, l, y,
|
|
329
|
+
return x(this, void 0, void 0, function() {
|
|
330
|
+
var r, s, c, h, f, l, y, w, D, A, R, j, N, K, nt, it, Z, O, m, pt, at, Yt, Q, yt, Zt, Qt, mt, te, St, rt, tt, ee, I = this;
|
|
331
331
|
return M(this, function(U) {
|
|
332
332
|
switch (U.label) {
|
|
333
333
|
case 0:
|
|
334
334
|
r = z(e.evaluationContext || this.evaluationContext), U.label = 1;
|
|
335
335
|
case 1:
|
|
336
|
-
if (U.trys.push([1, 13, , 14]), s = e.environmentID, c = e.api, h = c === void 0 ? Jt : c, f = e.headers, l = e.onChange, y = e.cacheFlags,
|
|
337
|
-
if (r.identity = pt || at ? { identifier: pt, traits: at ? Object.fromEntries(Object.entries(at).map(function(
|
|
338
|
-
return [
|
|
339
|
-
})) : {} } : r.identity, this.evaluationContext = r, this.api = h, this.headers = f, this.getFlagInterval = null, this.analyticsInterval = null, this.onChange = l, mt = "Wrong Flagsmith Configuration: preventFetch is true and no defaulFlags provided", this._trigger = Zt || this._trigger, this._triggerLoadingState = Qt || this._triggerLoadingState, this.onError = function(
|
|
340
|
-
|
|
341
|
-
}, this.enableLogs =
|
|
336
|
+
if (U.trys.push([1, 13, , 14]), s = e.environmentID, c = e.api, h = c === void 0 ? Jt : c, f = e.headers, l = e.onChange, y = e.cacheFlags, w = e.datadogRum, D = e.onError, A = e.defaultFlags, R = e.fetch, j = e.preventFetch, N = e.enableLogs, K = e.enableDynatrace, nt = e.enableAnalytics, it = e.realtime, Z = e.eventSourceUrl, O = Z === void 0 ? "https://realtime.flagsmith.com/" : Z, m = e.AsyncStorage, pt = e.identity, at = e.traits, Yt = e.state, Q = e.cacheOptions, yt = e.angularHttpClient, Zt = e._trigger, Qt = e._triggerLoadingState, r.environment = s ? { apiKey: s } : r.environment, !r.environment || !r.environment.apiKey) throw new Error("Please provide `evaluationContext.environment` with non-empty `apiKey`");
|
|
337
|
+
if (r.identity = pt || at ? { identifier: pt, traits: at ? Object.fromEntries(Object.entries(at).map(function(P) {
|
|
338
|
+
return [P[0], { value: P[1] }];
|
|
339
|
+
})) : {} } : r.identity, this.evaluationContext = r, this.api = h, this.headers = f, this.getFlagInterval = null, this.analyticsInterval = null, this.onChange = l, mt = "Wrong Flagsmith Configuration: preventFetch is true and no defaulFlags provided", this._trigger = Zt || this._trigger, this._triggerLoadingState = Qt || this._triggerLoadingState, this.onError = function(P) {
|
|
340
|
+
I.setLoadingState(o(o({}, I.loadingState), { isFetching: !1, isLoading: !1, error: P })), D == null || D(P);
|
|
341
|
+
}, this.enableLogs = N || !1, this.cacheOptions = Q ? { skipAPI: !!Q.skipAPI, ttl: Q.ttl || 0, storageKey: Q.storageKey, loadStale: !!Q.loadStale } : this.cacheOptions, !this.cacheOptions.ttl && this.cacheOptions.skipAPI && console.warn("Flagsmith: you have set a cache ttl of 0 and are skipping API calls, this means the API will not be hit unless you clear local storage."), R && (g = R), this.enableAnalytics = nt || !1, this.flags = Object.assign({}, A) || {}, this.datadogRum = w || null, this.initialised = !0, this.ticks = 1e4, this.timer = this.enableLogs ? (/* @__PURE__ */ new Date()).valueOf() : null, this.cacheFlags = T !== void 0 && !!y, ut = "FLAGSMITH_EVENT_" + r.environment.apiKey, m && (T = m), it && typeof window < "u" && this.setupRealtime(O, r.environment.apiKey), Object.keys(this.flags).length && (this.loadingState = o(o({}, this.loadingState), { isLoading: !1, source: F.DEFAULT_FLAGS })), this.setState(Yt), this.log("Initialising with properties", e, this), K && (typeof dtrum > "u" ? console.error("You have attempted to enable dynatrace but dtrum is undefined, please check you have the Dynatrace RUM JavaScript API installed.") : this.dtrum = dtrum), yt && (g = /* @__PURE__ */ function(P) {
|
|
342
342
|
return function(G, J) {
|
|
343
343
|
var H = J.headers, b = J.method, et = J.body;
|
|
344
|
-
return new Promise(function(
|
|
344
|
+
return new Promise(function(q) {
|
|
345
345
|
switch (b) {
|
|
346
346
|
case "GET":
|
|
347
|
-
return
|
|
348
|
-
|
|
347
|
+
return P.get(G, { headers: H }).subscribe(function(B) {
|
|
348
|
+
q({ ok: !0, text: function() {
|
|
349
349
|
return Promise.resolve(B);
|
|
350
350
|
} });
|
|
351
351
|
});
|
|
352
352
|
case "POST":
|
|
353
353
|
case "PUT":
|
|
354
|
-
return
|
|
355
|
-
|
|
354
|
+
return P.post(G, et, { headers: H }).subscribe(function(B) {
|
|
355
|
+
q({ ok: !0, text: function() {
|
|
356
356
|
return Promise.resolve(B);
|
|
357
357
|
} });
|
|
358
358
|
});
|
|
359
359
|
}
|
|
360
360
|
});
|
|
361
361
|
};
|
|
362
|
-
}(yt)),
|
|
362
|
+
}(yt)), T && this.canUseStorage && T.getItem(ut).then(function(P) {
|
|
363
363
|
try {
|
|
364
|
-
|
|
364
|
+
I.evaluationEvent = JSON.parse(P) || {};
|
|
365
365
|
} catch {
|
|
366
|
-
|
|
366
|
+
I.evaluationEvent = {};
|
|
367
367
|
}
|
|
368
|
-
|
|
369
|
-
}), this.enableAnalytics && (this.analyticsInterval && clearInterval(this.analyticsInterval),
|
|
370
|
-
if (G &&
|
|
368
|
+
I.analyticsInterval = setInterval(I.analyticsFlags, I.ticks);
|
|
369
|
+
}), this.enableAnalytics && (this.analyticsInterval && clearInterval(this.analyticsInterval), T && this.canUseStorage && T.getItem(ut, function(P, G) {
|
|
370
|
+
if (G && I.evaluationContext.environment) {
|
|
371
371
|
var J = JSON.parse(G);
|
|
372
|
-
if (J[
|
|
373
|
-
var H =
|
|
374
|
-
|
|
372
|
+
if (J[I.evaluationContext.environment.apiKey]) {
|
|
373
|
+
var H = I.getState();
|
|
374
|
+
I.log("Retrieved events from cache", G), I.setState(o(o({}, H), { evaluationEvent: J[I.evaluationContext.environment.apiKey] }));
|
|
375
375
|
}
|
|
376
376
|
}
|
|
377
377
|
})), !y) return [3, 9];
|
|
378
|
-
if (!
|
|
379
|
-
te = function(
|
|
380
|
-
return
|
|
381
|
-
var J, H, b, et,
|
|
378
|
+
if (!T || !this.canUseStorage) return [3, 8];
|
|
379
|
+
te = function(P, G) {
|
|
380
|
+
return x(I, void 0, void 0, function() {
|
|
381
|
+
var J, H, b, et, q, B, bt, ne, Ct, _t, xt, Et, Ft, wt, Ot, It, Tt, Lt, At, jt, Nt, Pt, kt, Rt, ie = this;
|
|
382
382
|
return M(this, function($) {
|
|
383
383
|
switch ($.label) {
|
|
384
384
|
case 0:
|
|
385
385
|
if (!G) return [3, 7];
|
|
386
386
|
J = null, H = null, $.label = 1;
|
|
387
387
|
case 1:
|
|
388
|
-
return $.trys.push([1, 5, , 6]), b = JSON.parse(G), et = !1,
|
|
388
|
+
return $.trys.push([1, 5, , 6]), b = JSON.parse(G), et = !1, q = !1, b && b.api === this.api && ((_t = (Ct = b.evaluationContext) === null || Ct === void 0 ? void 0 : Ct.environment) === null || _t === void 0 ? void 0 : _t.apiKey) === ((xt = this.evaluationContext.environment) === null || xt === void 0 ? void 0 : xt.apiKey) && (B = !0, this.evaluationContext.identity && ((Ft = (Et = b.evaluationContext) === null || Et === void 0 ? void 0 : Et.identity) === null || Ft === void 0 ? void 0 : Ft.identifier) !== this.evaluationContext.identity.identifier && (this.log("Ignoring cache, identity has changed from " + ((Ot = (wt = b.evaluationContext) === null || wt === void 0 ? void 0 : wt.identity) === null || Ot === void 0 ? void 0 : Ot.identifier) + " to " + this.evaluationContext.identity.identifier), B = !1), this.cacheOptions.ttl && (!b.ts || (/* @__PURE__ */ new Date()).valueOf() - b.ts > this.cacheOptions.ttl) && (b.ts && !this.cacheOptions.loadStale ? (this.log("Ignoring cache, timestamp is too old ts:" + b.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - b.ts) + "ms"), B = !1) : b.ts && this.cacheOptions.loadStale && (this.log("Loading stale cache, timestamp ts:" + b.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - b.ts) + "ms"), q = !0, B = !0)), B && (et = !0, H = _((It = this.evaluationContext.identity) === null || It === void 0 ? void 0 : It.traits, (Lt = (Tt = b.evaluationContext) === null || Tt === void 0 ? void 0 : Tt.identity) === null || Lt === void 0 ? void 0 : Lt.traits), J = _(this.flags, b.flags), this.setState(o(o({}, b), { evaluationContext: z(o(o({}, b.evaluationContext), { identity: !((At = b.evaluationContext) === null || At === void 0) && At.identity ? o(o({}, (jt = b.evaluationContext) === null || jt === void 0 ? void 0 : jt.identity), { traits: o(o({}, ((Pt = (Nt = b.evaluationContext) === null || Nt === void 0 ? void 0 : Nt.identity) === null || Pt === void 0 ? void 0 : Pt.traits) || {}), at || {}) }) : void 0 })) })), this.log("Retrieved flags from cache", b))), et ? (bt = !j && (!this.cacheOptions.skipAPI || q), this._onChange(null, { isFromServer: !1, flagsChanged: J, traitsChanged: H }, this._loadedState(null, F.CACHE, bt)), this.oldFlags = this.flags, this.cacheOptions.skipAPI && et && !q && this.log("Skipping API, using cache"), bt && this.getFlags().catch(function(ge) {
|
|
389
389
|
var Ut;
|
|
390
390
|
(Ut = ie.onError) === null || Ut === void 0 || Ut.call(ie, ge);
|
|
391
391
|
}), [3, 4]) : [3, 2];
|
|
@@ -417,9 +417,9 @@ var Gt = { exports: {} };
|
|
|
417
417
|
});
|
|
418
418
|
}, U.label = 2;
|
|
419
419
|
case 2:
|
|
420
|
-
return U.trys.push([2, 7, , 8]),
|
|
420
|
+
return U.trys.push([2, 7, , 8]), T.getItemSync ? (St = T.getItemSync(this.getStorageKey()), [3, 5]) : [3, 3];
|
|
421
421
|
case 3:
|
|
422
|
-
return [4,
|
|
422
|
+
return [4, T.getItem(this.getStorageKey())];
|
|
423
423
|
case 4:
|
|
424
424
|
St = U.sent(), U.label = 5;
|
|
425
425
|
case 5:
|
|
@@ -467,23 +467,23 @@ var Gt = { exports: {} };
|
|
|
467
467
|
return e === void 0 && (e = null), i === void 0 && (i = !1), { error: e, isFetching: i, isLoading: !1, source: t };
|
|
468
468
|
}, a.prototype.log = function() {
|
|
469
469
|
for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];
|
|
470
|
-
this.enableLogs && console.log.apply(this,
|
|
470
|
+
this.enableLogs && console.log.apply(this, L(["FLAGSMITH:", (/* @__PURE__ */ new Date()).valueOf() - (this.timer || 0), "ms"], e));
|
|
471
471
|
}, a.prototype.updateStorage = function() {
|
|
472
472
|
if (this.cacheFlags) {
|
|
473
473
|
this.ts = (/* @__PURE__ */ new Date()).valueOf();
|
|
474
474
|
var e = JSON.stringify(this.getState());
|
|
475
|
-
this.log("Setting storage", e),
|
|
475
|
+
this.log("Setting storage", e), T.setItem(this.getStorageKey(), e);
|
|
476
476
|
}
|
|
477
477
|
}, a.prototype.updateEventStorage = function() {
|
|
478
478
|
if (this.enableAnalytics) {
|
|
479
479
|
var e = JSON.stringify(this.getState().evaluationEvent);
|
|
480
|
-
|
|
480
|
+
T.setItem(ut, e).catch(function(t) {
|
|
481
481
|
return console.error("Flagsmith: Error setting item in async storage", t);
|
|
482
482
|
});
|
|
483
483
|
}
|
|
484
484
|
}, a.prototype.setLoadingState = function(e) {
|
|
485
485
|
var t;
|
|
486
|
-
|
|
486
|
+
W(e, this.loadingState) || (this.loadingState = o({}, e), this.log("Loading state changed", e), (t = this._triggerLoadingState) === null || t === void 0 || t.call(this));
|
|
487
487
|
}, a.prototype.setupRealtime = function(e, t) {
|
|
488
488
|
var i = this, n = e + "sse/environments/" + t + "/stream";
|
|
489
489
|
Y ? this.eventSource || (this.log("Creating event source with url " + n), this.eventSource = new Y(n), this.eventSource.addEventListener("environment_updated", function(r) {
|
|
@@ -501,18 +501,18 @@ var Gt = { exports: {} };
|
|
|
501
501
|
var e = a.fetch, t = a.AsyncStorage, i = a.eventSource;
|
|
502
502
|
return new he({ fetch: e, AsyncStorage: t, eventSource: i });
|
|
503
503
|
}
|
|
504
|
-
var
|
|
505
|
-
return
|
|
504
|
+
var ct, ve = (ct = function(a, e) {
|
|
505
|
+
return ct = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, i) {
|
|
506
506
|
t.__proto__ = i;
|
|
507
507
|
} || function(t, i) {
|
|
508
508
|
for (var n in i) Object.prototype.hasOwnProperty.call(i, n) && (t[n] = i[n]);
|
|
509
|
-
},
|
|
509
|
+
}, ct(a, e);
|
|
510
510
|
}, function(a, e) {
|
|
511
511
|
if (typeof e != "function" && e !== null) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
|
|
512
512
|
function t() {
|
|
513
513
|
this.constructor = a;
|
|
514
514
|
}
|
|
515
|
-
|
|
515
|
+
ct(a, e), a.prototype = e === null ? Object.create(e) : (t.prototype = e.prototype, new t());
|
|
516
516
|
}), Ht = function(a) {
|
|
517
517
|
var e = typeof Symbol == "function" && Symbol.iterator, t = e && a[e], i = 0;
|
|
518
518
|
if (t) return t.call(a);
|
|
@@ -545,7 +545,7 @@ var Gt = { exports: {} };
|
|
|
545
545
|
Consider loading an EventSource polyfill and making it available globally as EventSource, or passing one in as eventSourceClass to the ReconnectingEventSource constructor.`) || this;
|
|
546
546
|
}
|
|
547
547
|
return ve(e, a), e;
|
|
548
|
-
}(Error),
|
|
548
|
+
}(Error), Xt = function() {
|
|
549
549
|
function a(e, t) {
|
|
550
550
|
var i = this;
|
|
551
551
|
if (this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, this._configuration = t != null ? Object.assign({}, t) : void 0, this.withCredentials = !1, this._eventSource = null, this._lastEventId = null, this._timer = null, this._listeners = { open: [], error: [], message: [] }, this.url = e.toString(), this.readyState = this.CONNECTING, this.max_retry_time = 3e3, this.eventSourceClass = globalThis.FlagsmithEventSource, this._configuration != null && (this._configuration.lastEventId && (this._lastEventId = this._configuration.lastEventId, delete this._configuration.lastEventId), this._configuration.max_retry_time && (this.max_retry_time = this._configuration.max_retry_time, delete this._configuration.max_retry_time), this._configuration.eventSourceClass && (this.eventSourceClass = this._configuration.eventSourceClass, delete this._configuration.eventSourceClass)), this.eventSourceClass == null || typeof this.eventSourceClass != "function") throw new de();
|
|
@@ -623,7 +623,7 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
623
623
|
}, a;
|
|
624
624
|
}();
|
|
625
625
|
globalThis.FlagsmithEventSource = typeof EventSource < "u" ? EventSource : null;
|
|
626
|
-
var
|
|
626
|
+
var qt = function(a, e) {
|
|
627
627
|
return e = e || {}, new Promise(function(t, i) {
|
|
628
628
|
var n = new XMLHttpRequest(), r = [], s = [], c = {}, h = function() {
|
|
629
629
|
return { ok: (n.status / 100 | 0) == 2, statusText: n.statusText, status: n.status, url: n.responseURL, text: function() {
|
|
@@ -643,16 +643,16 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
643
643
|
} } };
|
|
644
644
|
};
|
|
645
645
|
for (var f in n.open(e.method || "get", a, !0), n.onload = function() {
|
|
646
|
-
n.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(l, y,
|
|
647
|
-
r.push(y = y.toLowerCase()), s.push([y,
|
|
646
|
+
n.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(l, y, w) {
|
|
647
|
+
r.push(y = y.toLowerCase()), s.push([y, w]), c[y] = c[y] ? c[y] + "," + w : w;
|
|
648
648
|
}), t(h());
|
|
649
649
|
}, n.onerror = i, n.withCredentials = e.credentials == "include", e.headers) n.setRequestHeader(f, e.headers[f]);
|
|
650
650
|
n.send(e.body || null);
|
|
651
651
|
});
|
|
652
|
-
},
|
|
653
|
-
typeof window < "u" && (window.flagsmith =
|
|
654
|
-
return zt({ AsyncStorage: d, fetch:
|
|
655
|
-
}, v.default =
|
|
652
|
+
}, Wt = zt({ AsyncStorage: d, fetch: qt, eventSource: Xt });
|
|
653
|
+
typeof window < "u" && (window.flagsmith = Wt), v.createFlagsmithInstance = function() {
|
|
654
|
+
return zt({ AsyncStorage: d, fetch: qt, eventSource: Xt });
|
|
655
|
+
}, v.default = Wt, Object.defineProperty(v, "__esModule", { value: !0 });
|
|
656
656
|
});
|
|
657
657
|
})(Gt, Gt.exports);
|
|
658
658
|
var me = Gt.exports, re = {
|
|
@@ -663,8 +663,8 @@ var me = Gt.exports, re = {
|
|
|
663
663
|
ALREADY_INITIALIZED: "FeatureFlag is already initialized."
|
|
664
664
|
}, se = "business", V, Se = (V = class {
|
|
665
665
|
constructor() {
|
|
666
|
-
|
|
667
|
-
|
|
666
|
+
ht(this, "flagsmithClient", null);
|
|
667
|
+
ht(this, "userContext", null);
|
|
668
668
|
}
|
|
669
669
|
static getInstance() {
|
|
670
670
|
return V.instance || (V.instance = new V()), V.instance;
|
|
@@ -677,7 +677,7 @@ var me = Gt.exports, re = {
|
|
|
677
677
|
if (!this.flagsmithClient)
|
|
678
678
|
try {
|
|
679
679
|
this.flagsmithClient = me.createFlagsmithInstance();
|
|
680
|
-
const d = v.reduce((o,
|
|
680
|
+
const d = v.reduce((o, x) => (o[x.feature.name] = x, o), {});
|
|
681
681
|
await this.flagsmithClient.init({
|
|
682
682
|
environmentID: u.apiKey,
|
|
683
683
|
api: (u == null ? void 0 : u.url) ?? "https://flag.feedme.farm/api/v1/",
|
|
@@ -753,23 +753,23 @@ var me = Gt.exports, re = {
|
|
|
753
753
|
}
|
|
754
754
|
async getUserFlagValue(u, v, d = null, o) {
|
|
755
755
|
var M;
|
|
756
|
-
const
|
|
756
|
+
const x = this.userContext;
|
|
757
757
|
try {
|
|
758
758
|
return await this.setUser(u), this.getFlagValue(v, o) ?? d;
|
|
759
|
-
} catch (
|
|
760
|
-
return console.error(`Error getting user flag value for ${v}:`,
|
|
759
|
+
} catch (L) {
|
|
760
|
+
return console.error(`Error getting user flag value for ${v}:`, L), d;
|
|
761
761
|
} finally {
|
|
762
762
|
try {
|
|
763
|
-
await ((M = this.flagsmithClient) == null ? void 0 : M.logout()), this.userContext = null,
|
|
764
|
-
} catch (
|
|
765
|
-
console.error("Error during cleanup:",
|
|
763
|
+
await ((M = this.flagsmithClient) == null ? void 0 : M.logout()), this.userContext = null, x && await this.setUser(x.identifier, x.traits);
|
|
764
|
+
} catch (L) {
|
|
765
|
+
console.error("Error during cleanup:", L);
|
|
766
766
|
}
|
|
767
767
|
}
|
|
768
768
|
}
|
|
769
769
|
reset() {
|
|
770
770
|
this.flagsmithClient = null, this.userContext = null;
|
|
771
771
|
}
|
|
772
|
-
},
|
|
772
|
+
}, ht(V, "instance"), V), be = Se.getInstance(), st = gt(!1), ot = gt([]), X = gt(null);
|
|
773
773
|
function Ce(S = be) {
|
|
774
774
|
const u = () => st.value ? !0 : (console.warn("FeatureFlag is not initialized. Using default values."), !1), v = async (g, p = []) => {
|
|
775
775
|
if (st.value) {
|
|
@@ -777,23 +777,23 @@ function Ce(S = be) {
|
|
|
777
777
|
return;
|
|
778
778
|
}
|
|
779
779
|
try {
|
|
780
|
-
await S.init(g, p), ot.value = await S.getFlags(), st.value = !0,
|
|
780
|
+
await S.init(g, p), ot.value = await S.getFlags(), st.value = !0, X.value = null;
|
|
781
781
|
} catch (C) {
|
|
782
|
-
console.error("Failed to initialize feature flags:", C),
|
|
782
|
+
console.error("Failed to initialize feature flags:", C), X.value = C;
|
|
783
783
|
}
|
|
784
784
|
}, d = async (g, p) => {
|
|
785
785
|
if (u())
|
|
786
786
|
try {
|
|
787
|
-
await S.setUser(g, p), ot.value = await S.getFlags(),
|
|
787
|
+
await S.setUser(g, p), ot.value = await S.getFlags(), X.value = null;
|
|
788
788
|
} catch (C) {
|
|
789
|
-
console.error("Failed to set user:", C),
|
|
789
|
+
console.error("Failed to set user:", C), X.value = C;
|
|
790
790
|
}
|
|
791
|
-
}, o = async (g, p) => d(`${se}-${g}`, p),
|
|
791
|
+
}, o = async (g, p) => d(`${se}-${g}`, p), x = async (g) => {
|
|
792
792
|
if (u())
|
|
793
793
|
try {
|
|
794
|
-
await S.addTraits(g), ot.value = await S.getFlags(),
|
|
794
|
+
await S.addTraits(g), ot.value = await S.getFlags(), X.value = null;
|
|
795
795
|
} catch (p) {
|
|
796
|
-
console.error("Failed to add traits:", p),
|
|
796
|
+
console.error("Failed to add traits:", p), X.value = p;
|
|
797
797
|
}
|
|
798
798
|
}, M = (g, p, C = null) => {
|
|
799
799
|
if (!u()) return C;
|
|
@@ -802,40 +802,40 @@ function Ce(S = be) {
|
|
|
802
802
|
} catch (k) {
|
|
803
803
|
return console.error(`Error getting flag value for ${g}:`, k), C;
|
|
804
804
|
}
|
|
805
|
-
},
|
|
805
|
+
}, L = (g, p) => {
|
|
806
806
|
if (!u()) return p ?? null;
|
|
807
807
|
try {
|
|
808
808
|
return S.getFlag(g) ?? p ?? null;
|
|
809
809
|
} catch (C) {
|
|
810
810
|
return console.error(`Error getting flag for ${g}:`, C), p ?? null;
|
|
811
811
|
}
|
|
812
|
-
},
|
|
812
|
+
}, W = async (g, p, C = null, k) => {
|
|
813
813
|
if (!u()) return C;
|
|
814
814
|
try {
|
|
815
815
|
return await S.getUserFlagValue(g, p, C, k);
|
|
816
816
|
} catch (z) {
|
|
817
817
|
return console.error(`Error getting user flag value for ${p}:`, z), C;
|
|
818
818
|
}
|
|
819
|
-
}, _ = async (g, p, C = null, k) =>
|
|
819
|
+
}, _ = async (g, p, C = null, k) => W(`${se}-${g}`, p, C, k), F = () => {
|
|
820
820
|
try {
|
|
821
821
|
S.reset();
|
|
822
822
|
} catch (g) {
|
|
823
823
|
console.error("Error resetting feature flags:", g);
|
|
824
824
|
} finally {
|
|
825
|
-
ot.value = [], st.value = !1,
|
|
825
|
+
ot.value = [], st.value = !1, X.value = null;
|
|
826
826
|
}
|
|
827
827
|
};
|
|
828
828
|
return {
|
|
829
829
|
flags: Kt(ot),
|
|
830
830
|
isInitialized: Kt(st),
|
|
831
|
-
error: Kt(
|
|
831
|
+
error: Kt(X),
|
|
832
832
|
init: v,
|
|
833
833
|
setUser: d,
|
|
834
834
|
setBusiness: o,
|
|
835
|
-
addTraits:
|
|
835
|
+
addTraits: x,
|
|
836
836
|
getFlagValue: M,
|
|
837
|
-
getFlag:
|
|
838
|
-
getUserFlagValue:
|
|
837
|
+
getFlag: L,
|
|
838
|
+
getUserFlagValue: W,
|
|
839
839
|
getBusinessFlagValue: _,
|
|
840
840
|
reset: F
|
|
841
841
|
};
|
|
@@ -846,7 +846,7 @@ const _e = /* @__PURE__ */ new Set([
|
|
|
846
846
|
"business_6687e91fa7240b001ba3f4c2",
|
|
847
847
|
// vivo dev
|
|
848
848
|
"business_669a1d2efc050a001cfbb5a2"
|
|
849
|
-
]),
|
|
849
|
+
]), xe = /* @__PURE__ */ new Set([
|
|
850
850
|
// vivo pizza prod
|
|
851
851
|
"business_6687e91fa7240b001ba3f4c2",
|
|
852
852
|
// vivo dev
|
|
@@ -860,12 +860,12 @@ const _e = /* @__PURE__ */ new Set([
|
|
|
860
860
|
"business_671005de24a7f4001c87e25e",
|
|
861
861
|
// zus prod
|
|
862
862
|
"business_6776a1fe205a52001c516efa"
|
|
863
|
-
]),
|
|
863
|
+
]), Ee = /* @__PURE__ */ new Set([
|
|
864
864
|
// zus dev
|
|
865
865
|
"business_671005de24a7f4001c87e25e",
|
|
866
866
|
// zus prod
|
|
867
867
|
"business_6776a1fe205a52001c516efa"
|
|
868
|
-
]),
|
|
868
|
+
]), Fe = /* @__PURE__ */ new Set([
|
|
869
869
|
// zus dev
|
|
870
870
|
"business_671005de24a7f4001c87e25e",
|
|
871
871
|
// zus prod
|
|
@@ -884,13 +884,14 @@ function ue() {
|
|
|
884
884
|
enableWastageTemplate: !1,
|
|
885
885
|
manualReceive: !1,
|
|
886
886
|
mustUsePoTemplate: !1,
|
|
887
|
-
enableReturnStocks: !1
|
|
887
|
+
enableReturnStocks: !1,
|
|
888
|
+
enableXilnexTransferNote: !1
|
|
888
889
|
};
|
|
889
890
|
}
|
|
890
|
-
const
|
|
891
|
+
const E = gt(ue()), Le = () => ({
|
|
891
892
|
get businessDbName() {
|
|
892
893
|
var v;
|
|
893
|
-
return `business_${((v =
|
|
894
|
+
return `business_${((v = vt().currentBusiness.value) == null ? void 0 : v._id) ?? ""}`;
|
|
894
895
|
},
|
|
895
896
|
get isWarehouse() {
|
|
896
897
|
var u;
|
|
@@ -899,7 +900,7 @@ const I = gt(ue()), Te = () => ({
|
|
|
899
900
|
get restaurantPosVersion() {
|
|
900
901
|
var v;
|
|
901
902
|
const S = Dt();
|
|
902
|
-
return (v =
|
|
903
|
+
return (v = vt().restaurants.value.find(
|
|
903
904
|
(d) => {
|
|
904
905
|
var o;
|
|
905
906
|
return d._id === ((o = S._currentLocation) == null ? void 0 : o.doc._id);
|
|
@@ -907,77 +908,80 @@ const I = gt(ue()), Te = () => ({
|
|
|
907
908
|
)) == null ? void 0 : v.posVersion;
|
|
908
909
|
},
|
|
909
910
|
get enableTotalCost() {
|
|
910
|
-
return
|
|
911
|
+
return E.value.enableTotalCost;
|
|
911
912
|
},
|
|
912
913
|
get enableBackdatePo() {
|
|
913
|
-
return
|
|
914
|
+
return E.value.enableBackdatePo;
|
|
914
915
|
},
|
|
915
916
|
/** @deprecated TODO: remove */
|
|
916
917
|
get autoReceiveWarehouse() {
|
|
917
|
-
return
|
|
918
|
+
return E.value.autoReceiveWarehouse;
|
|
918
919
|
},
|
|
919
920
|
/** @deprecated TODO: remove */
|
|
920
921
|
get manualReceive() {
|
|
921
|
-
return
|
|
922
|
+
return E.value.manualReceive;
|
|
922
923
|
},
|
|
923
924
|
get enablePoTemplate() {
|
|
924
|
-
return
|
|
925
|
+
return E.value.enablePoTemplate;
|
|
925
926
|
},
|
|
926
927
|
get enableClosingTemplate() {
|
|
927
|
-
return
|
|
928
|
+
return E.value.enableClosingTemplate;
|
|
928
929
|
},
|
|
929
930
|
get enableWastageTemplate() {
|
|
930
|
-
return
|
|
931
|
+
return E.value.enableWastageTemplate;
|
|
931
932
|
},
|
|
932
933
|
get enableIngredientGroup() {
|
|
933
|
-
return
|
|
934
|
+
return E.value.enableIngredientGroup;
|
|
934
935
|
},
|
|
935
936
|
get mustUsePoTemplate() {
|
|
936
|
-
return
|
|
937
|
+
return E.value.mustUsePoTemplate;
|
|
937
938
|
},
|
|
938
939
|
get enableSupplierMasterList() {
|
|
939
|
-
return
|
|
940
|
+
return E.value.enableSupplierMasterList;
|
|
940
941
|
},
|
|
941
942
|
get businessSupplierOnly() {
|
|
942
|
-
return
|
|
943
|
+
return E.value.businessSupplierOnly;
|
|
943
944
|
},
|
|
944
945
|
get enableReturnStocks() {
|
|
945
|
-
return
|
|
946
|
+
return E.value.enableReturnStocks;
|
|
947
|
+
},
|
|
948
|
+
get enableXilnexTransferNote() {
|
|
949
|
+
return E.value.enableXilnexTransferNote;
|
|
946
950
|
},
|
|
947
951
|
async init() {
|
|
948
|
-
const S =
|
|
952
|
+
const S = vt(), { init: u, setUser: v } = le(), d = S.namespace.value === "prod";
|
|
949
953
|
await u({
|
|
950
954
|
apiKey: d ? "6GhcttsJ9Rj9cTevcdrpin" : "MaGoXrEWuEJNpWgKTqseee"
|
|
951
955
|
// url: 'https://flag.feedme.farm/api/v1/', // optional -> this is a default URL value
|
|
952
956
|
// enableAnalytics: true, // optional, defaults to true
|
|
953
957
|
// cacheFlags: true // optional, defaults to true
|
|
954
|
-
}), Dt().watchLocation(async (
|
|
958
|
+
}), Dt().watchLocation(async (x) => {
|
|
955
959
|
var k, z, Y;
|
|
956
|
-
if (!
|
|
957
|
-
|
|
960
|
+
if (!x) {
|
|
961
|
+
E.value = ue();
|
|
958
962
|
return;
|
|
959
963
|
}
|
|
960
|
-
await v(
|
|
961
|
-
const M = ye(),
|
|
964
|
+
await v(x.doc._id);
|
|
965
|
+
const M = ye(), L = vt(), _ = `business_${((k = L.currentBusiness.value) == null ? void 0 : k._id) ?? ""}`, F = x.type === ae.enum.warehouse, g = (
|
|
962
966
|
// if menu v4, must manual receive && must use outlet app
|
|
963
|
-
((z =
|
|
967
|
+
((z = L.currentBusiness.value) == null ? void 0 : z.menuVersion) === "v4" && // more guard for businesses using menu v4, only those listed for manual receive will be included
|
|
964
968
|
// TODO: may be removed to use menu version only
|
|
965
969
|
_e.has(this.businessDbName)
|
|
966
|
-
), p = oe.has(_) ||
|
|
970
|
+
), p = oe.has(_) || lt(
|
|
967
971
|
"inventory_portal_must_use_transfer_template"
|
|
968
972
|
/* inventory_portal_must_use_transfer_template */
|
|
969
|
-
), C =
|
|
970
|
-
|
|
971
|
-
enableTotalCost: ((Y =
|
|
973
|
+
), C = xe.has(this.businessDbName) && (this.isWarehouse || M.state.closing !== null);
|
|
974
|
+
E.value = {
|
|
975
|
+
enableTotalCost: ((Y = L.currentBusiness.value) == null ? void 0 : Y.menuVersion) === "v4",
|
|
972
976
|
enableBackdatePo: C,
|
|
973
977
|
autoReceiveWarehouse: F && !g,
|
|
974
978
|
manualReceive: g,
|
|
975
979
|
enablePoTemplate: p,
|
|
976
|
-
enableClosingTemplate:
|
|
980
|
+
enableClosingTemplate: Ee.has(_) && lt(
|
|
977
981
|
"inventory_pos_closing_v2"
|
|
978
982
|
/* inventory_pos_closing_v2 */
|
|
979
983
|
),
|
|
980
|
-
enableWastageTemplate:
|
|
984
|
+
enableWastageTemplate: Fe.has(_) && lt(
|
|
981
985
|
"inventory_pos_adjust_v2_wastage"
|
|
982
986
|
/* inventory_pos_adjust_v2_wastage */
|
|
983
987
|
),
|
|
@@ -985,19 +989,23 @@ const I = gt(ue()), Te = () => ({
|
|
|
985
989
|
mustUsePoTemplate: p,
|
|
986
990
|
businessSupplierOnly: p,
|
|
987
991
|
enableSupplierMasterList: oe.has(_),
|
|
988
|
-
enableReturnStocks:
|
|
992
|
+
enableReturnStocks: lt(
|
|
989
993
|
"inventory_portal_stock_return"
|
|
990
994
|
/* inventory_portal_stock_return */
|
|
995
|
+
),
|
|
996
|
+
enableXilnexTransferNote: lt(
|
|
997
|
+
"inventory_portal_xilnex_transfer_note"
|
|
998
|
+
/* inventory_portal_xilnex_transfer_note */
|
|
991
999
|
)
|
|
992
1000
|
};
|
|
993
1001
|
}, "feature");
|
|
994
1002
|
}
|
|
995
1003
|
});
|
|
996
|
-
function
|
|
1004
|
+
function lt(S, u) {
|
|
997
1005
|
u = u === void 0 ? null : u;
|
|
998
1006
|
const { getFlagValue: v } = le();
|
|
999
1007
|
return v(S, (d) => d === "true") ?? u;
|
|
1000
1008
|
}
|
|
1001
1009
|
export {
|
|
1002
|
-
|
|
1010
|
+
Le as u
|
|
1003
1011
|
};
|