@feedmepos/mf-inventory-portal 0.0.25-dev.52 → 0.0.25-dev.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/{App-DkPiRPu7.js → App-CjqJghCI.js} +2 -2
  2. package/dist/{ApprovalView-BEF-qPdZ.js → ApprovalView-C42xNBr9.js} +2 -2
  3. package/dist/{BindingsDialog-B6vjaPiA.js → BindingsDialog-DfShaOTO.js} +2 -2
  4. package/dist/{BindingsPicker-BmWf3j6H.js → BindingsPicker-BZmmKaqZ.js} +1 -1
  5. package/dist/{BindingsTable-VVNmzkzf.js → BindingsTable-Dzk1x-qi.js} +1 -1
  6. package/dist/{ClosingDraftView-C6sNEHK5.js → ClosingDraftView-DpP-cqpM.js} +91 -91
  7. package/dist/{ClosingTemplateView-5k8R-fMI.js → ClosingTemplateView-DSo8B_Cq.js} +3 -3
  8. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DclFOxv5.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-JsmwiIQG.js} +3 -3
  9. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BFqAE1ZI.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DhicQW8Q.js} +1 -1
  10. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DwAyTAFy.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-feCBwmiz.js} +1 -1
  11. package/dist/{IngredientGroupView-DAeurvqt.js → IngredientGroupView-p1jRflBc.js} +1 -1
  12. package/dist/{IngredientsView-Ca8fShPE.js → IngredientsView-KrhaER9Y.js} +4 -4
  13. package/dist/{IntegrationView-Db4XlQvK.js → IntegrationView-CFXpiR1g.js} +2 -2
  14. package/dist/{InventoryBindingForm-BTtpF1P5.js → InventoryBindingForm-CaeO-fpj.js} +1 -1
  15. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-ByJPHKqO.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CPgkL2CW.js} +3 -3
  16. package/dist/{InventoryBindingSummary-Bb5gN9Bu.js → InventoryBindingSummary-NLY5i6ql.js} +1 -1
  17. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-D4vUOy_R.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BTJ4Omyi.js} +1 -1
  18. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-fFfOjNOU.js → PremiumBadge.vue_vue_type_script_setup_true_lang-CEroADf4.js} +1 -1
  19. package/dist/{PublishView-BqE9qfwb.js → PublishView-DFTo5S0F.js} +45 -45
  20. package/dist/{PurchaseOrderPrintPreview-Cp6a-P8I.js → PurchaseOrderPrintPreview-7YBYHbP6.js} +1 -1
  21. package/dist/{ReceiveRequestView-DKPPCyAU.js → ReceiveRequestView-BG5s-oS9.js} +9 -9
  22. package/dist/{RecipeView-BEsrqzuU.js → RecipeView-kc50YRZk.js} +3 -3
  23. package/dist/{StockView-DplJi2OM.js → StockView-XymZfzq8.js} +7 -7
  24. package/dist/{SupplierView-DL3D84U2.js → SupplierView-B2vB9f9I.js} +4 -4
  25. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BzFkrRui.js → TransferDetails.vue_vue_type_script_setup_true_lang-CsQoRock.js} +5 -5
  26. package/dist/{TransferTemplateView-DakAYozL.js → TransferTemplateView-OD4SE6qf.js} +7 -7
  27. package/dist/{UnitView-C_Wqv69Z.js → UnitView-Bb8gEtVh.js} +3 -3
  28. package/dist/{WarehouseView-CeoVZ9cs.js → WarehouseView-BeGII5M9.js} +1 -1
  29. package/dist/{app-CulzKCFs.js → app-CvTTGb1Y.js} +8200 -8269
  30. package/dist/app.d.ts +3 -0
  31. package/dist/app.js +1 -1
  32. package/dist/{decimal-DdjfkmJS.js → decimal-XcUTkVCR.js} +1 -1
  33. package/dist/{feature-jwErVPVw.js → feature-Bv1NYHN4.js} +415 -421
  34. package/dist/{format-unit-display-BMC3HZ0N.js → format-unit-display-BsM7BR8x.js} +2 -2
  35. package/dist/{index-BDCZItPF.js → index-j3NNoa4K.js} +1 -1
  36. package/dist/{index-C7-QVxlo.js → index-xfhlIOM0.js} +1 -1
  37. package/dist/{stock-Czw9__W8.js → stock-DgLOMQ1X.js} +1 -1
  38. package/dist/{supplier-f0XPCLm-.js → supplier-B0HyUoxP.js} +1 -1
  39. package/dist/tsconfig.app.tsbuildinfo +1 -1
  40. package/dist/{use-ingredient-select-dialog-DDeNnPW0.js → use-ingredient-select-dialog-D9arr1HY.js} +1 -1
  41. package/dist/{use-inventory-binding-dialog-BTE0Ceov.js → use-inventory-binding-dialog-DGnSxKpE.js} +1 -1
  42. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +88 -0
  43. package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +528 -0
  44. package/dist/{vue-i18n-B0gOxrrS.js → vue-i18n-BFNEEDAX.js} +349 -349
  45. package/package.json +4 -4
@@ -1,15 +1,15 @@
1
1
  var fe = Object.defineProperty;
2
- var pe = (p, l, v) => l in p ? fe(p, l, { enumerable: !0, configurable: !0, writable: !0, value: v }) : p[l] = v;
3
- var ht = (p, l, v) => pe(p, typeof l != "symbol" ? l + "" : l, v);
2
+ var pe = (m, u, h) => u in m ? fe(m, u, { enumerable: !0, configurable: !0, writable: !0, value: h }) : m[u] = h;
3
+ var ct = (m, u, h) => pe(m, typeof u != "symbol" ? u + "" : u, h);
4
4
  import { useCoreStore as vt } from "@feedmepos/mf-common";
5
- import { a5 as dt, u as Dt, aH as re, a as ye } from "./app-CulzKCFs.js";
6
- import { ref as gt, readonly as Kt } from "vue";
5
+ import { a5 as ht, u as Dt, aH as re, a as ye } from "./app-CvTTGb1Y.js";
6
+ import { ref as dt, readonly as Kt } from "vue";
7
7
  var Gt = { exports: {} };
8
- (function(p, l) {
9
- (function(v, d) {
10
- d(l);
11
- })(dt, function(v) {
12
- var d = { getItemSync: function(a) {
8
+ (function(m, u) {
9
+ (function(h, g) {
10
+ g(u);
11
+ })(ht, function(h) {
12
+ var g = { getItemSync: function(a) {
13
13
  try {
14
14
  return localStorage.getItem(a) || null;
15
15
  } catch {
@@ -21,8 +21,8 @@ var Gt = { exports: {} };
21
21
  try {
22
22
  var r = t.getItemSync(a);
23
23
  e == null || e(null, r), i(r);
24
- } catch (s) {
25
- e && e(s, null), n(s);
24
+ } catch (o) {
25
+ e && e(o, null), n(o);
26
26
  }
27
27
  });
28
28
  }, setItem: function(a, e, t) {
@@ -33,101 +33,101 @@ var Gt = { exports: {} };
33
33
  t && t(r, null), n(r);
34
34
  }
35
35
  });
36
- } }, o = function() {
37
- return o = Object.assign || function(a) {
36
+ } }, s = function() {
37
+ return s = Object.assign || function(a) {
38
38
  for (var e, t = 1, i = arguments.length; t < i; t++) for (var n in e = arguments[t]) Object.prototype.hasOwnProperty.call(e, n) && (a[n] = e[n]);
39
39
  return a;
40
- }, o.apply(this, arguments);
40
+ }, s.apply(this, arguments);
41
41
  };
42
- function x(a, e, t, i) {
42
+ function F(a, e, t, i) {
43
43
  return new (t || (t = Promise))(function(n, r) {
44
- function s(f) {
44
+ function o(f) {
45
45
  try {
46
- h(i.next(f));
47
- } catch (u) {
48
- r(u);
46
+ v(i.next(f));
47
+ } catch (l) {
48
+ r(l);
49
49
  }
50
50
  }
51
51
  function c(f) {
52
52
  try {
53
- h(i.throw(f));
54
- } catch (u) {
55
- r(u);
53
+ v(i.throw(f));
54
+ } catch (l) {
55
+ r(l);
56
56
  }
57
57
  }
58
- function h(f) {
59
- var u;
60
- f.done ? n(f.value) : (u = f.value, u instanceof t ? u : new t(function(m) {
61
- m(u);
62
- })).then(s, c);
58
+ function v(f) {
59
+ var l;
60
+ f.done ? n(f.value) : (l = f.value, l instanceof t ? l : new t(function(p) {
61
+ p(l);
62
+ })).then(o, c);
63
63
  }
64
- h((i = i.apply(a, [])).next());
64
+ v((i = i.apply(a, [])).next());
65
65
  });
66
66
  }
67
- function M(a, e) {
68
- var t, i, n, r, s = { label: 0, sent: function() {
67
+ function J(a, e) {
68
+ var t, i, n, r, o = { label: 0, sent: function() {
69
69
  if (1 & n[0]) throw n[1];
70
70
  return n[1];
71
71
  }, trys: [], ops: [] };
72
72
  return r = { next: c(0), throw: c(1), return: c(2) }, typeof Symbol == "function" && (r[Symbol.iterator] = function() {
73
73
  return this;
74
74
  }), r;
75
- function c(h) {
75
+ function c(v) {
76
76
  return function(f) {
77
- return function(u) {
77
+ return function(l) {
78
78
  if (t) throw new TypeError("Generator is already executing.");
79
- for (; s; ) try {
80
- if (t = 1, i && (n = 2 & u[0] ? i.return : u[0] ? i.throw || ((n = i.return) && n.call(i), 0) : i.next) && !(n = n.call(i, u[1])).done) return n;
81
- switch (i = 0, n && (u = [2 & u[0], n.value]), u[0]) {
79
+ for (; o; ) try {
80
+ if (t = 1, i && (n = 2 & l[0] ? i.return : l[0] ? i.throw || ((n = i.return) && n.call(i), 0) : i.next) && !(n = n.call(i, l[1])).done) return n;
81
+ switch (i = 0, n && (l = [2 & l[0], n.value]), l[0]) {
82
82
  case 0:
83
83
  case 1:
84
- n = u;
84
+ n = l;
85
85
  break;
86
86
  case 4:
87
- return s.label++, { value: u[1], done: !1 };
87
+ return o.label++, { value: l[1], done: !1 };
88
88
  case 5:
89
- s.label++, i = u[1], u = [0];
89
+ o.label++, i = l[1], l = [0];
90
90
  continue;
91
91
  case 7:
92
- u = s.ops.pop(), s.trys.pop();
92
+ l = o.ops.pop(), o.trys.pop();
93
93
  continue;
94
94
  default:
95
- if (n = s.trys, !((n = n.length > 0 && n[n.length - 1]) || u[0] !== 6 && u[0] !== 2)) {
96
- s = 0;
95
+ if (n = o.trys, !((n = n.length > 0 && n[n.length - 1]) || l[0] !== 6 && l[0] !== 2)) {
96
+ o = 0;
97
97
  continue;
98
98
  }
99
- if (u[0] === 3 && (!n || u[1] > n[0] && u[1] < n[3])) {
100
- s.label = u[1];
99
+ if (l[0] === 3 && (!n || l[1] > n[0] && l[1] < n[3])) {
100
+ o.label = l[1];
101
101
  break;
102
102
  }
103
- if (u[0] === 6 && s.label < n[1]) {
104
- s.label = n[1], n = u;
103
+ if (l[0] === 6 && o.label < n[1]) {
104
+ o.label = n[1], n = l;
105
105
  break;
106
106
  }
107
- if (n && s.label < n[2]) {
108
- s.label = n[2], s.ops.push(u);
107
+ if (n && o.label < n[2]) {
108
+ o.label = n[2], o.ops.push(l);
109
109
  break;
110
110
  }
111
- n[2] && s.ops.pop(), s.trys.pop();
111
+ n[2] && o.ops.pop(), o.trys.pop();
112
112
  continue;
113
113
  }
114
- u = e.call(a, s);
115
- } catch (m) {
116
- u = [6, m], i = 0;
114
+ l = e.call(a, o);
115
+ } catch (p) {
116
+ l = [6, p], i = 0;
117
117
  } finally {
118
118
  t = n = 0;
119
119
  }
120
- if (5 & u[0]) throw u[1];
121
- return { value: u[0] ? u[1] : void 0, done: !0 };
122
- }([h, f]);
120
+ if (5 & l[0]) throw l[1];
121
+ return { value: l[0] ? l[1] : void 0, done: !0 };
122
+ }([v, f]);
123
123
  };
124
124
  }
125
125
  }
126
- function L(a, e, t) {
126
+ function I(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 W = function a(e, t) {
130
+ var nt = 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;
@@ -143,110 +143,110 @@ var Gt = { exports: {} };
143
143
  if ((i = (r = Object.keys(e)).length) !== Object.keys(t).length) return !1;
144
144
  for (n = i; n-- != 0; ) if (!Object.prototype.hasOwnProperty.call(t, r[n])) return !1;
145
145
  for (n = i; n-- != 0; ) {
146
- var s = r[n];
147
- if (!a(e[s], t[s])) return !1;
146
+ var o = r[n];
147
+ if (!a(e[o], t[o])) return !1;
148
148
  }
149
149
  return !0;
150
150
  }
151
151
  return e != e && t != t;
152
152
  };
153
- function _(a, e) {
153
+ function C(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 !W(n, r);
156
+ return !nt(n, r);
157
157
  });
158
158
  return Object.keys(a || {}).filter(function(i) {
159
159
  Object.keys(e || {}).includes(i) || t.push(i);
160
160
  }), Object.keys(t).length ? t : null;
161
161
  }
162
- var F, g;
163
- function y(a, e, t) {
162
+ var d, S;
163
+ function _(a, e, t) {
164
164
  var i = "shortString", n = !0;
165
165
  typeof t == "number" && (i = "javaDouble", n = !1), a[i] = a[i] || {}, a[i][e] = n ? t + "" : t;
166
166
  }
167
- function C(a) {
167
+ function N(a) {
168
168
  return !!a && typeof a == "object" && a.value !== void 0;
169
169
  }
170
- function R(a) {
170
+ function H(a) {
171
171
  return Object.fromEntries(Object.entries(a).map(function(e) {
172
172
  var t = e[0], i = e[1];
173
- return [t, C(i) ? i : { value: i }];
173
+ return [t, N(i) ? i : { value: i }];
174
174
  }));
175
175
  }
176
- function z(a) {
177
- return o(o({}, a), { identity: a.identity ? o(o({}, a.identity), { traits: R(a.identity.traits || {}) }) : void 0 });
176
+ function X(a) {
177
+ return s(s({}, a), { identity: a.identity ? s(s({}, a.identity), { traits: H(a.identity.traits || {}) }) : void 0 });
178
178
  }
179
179
  (function(a) {
180
180
  a.NONE = "NONE", a.DEFAULT_FLAGS = "DEFAULT_FLAGS", a.CACHE = "CACHE", a.SERVER = "SERVER";
181
- })(F || (F = {}));
182
- var Y, T = null, ce = "FLAGSMITH_EVENT", ut = ce, Jt = "https://edge.api.flagsmith.com/api/v1/", Mt = "flagsmith_value_", Bt = "flagsmith_enabled_", zt = "flagsmith_trait_", he = function() {
181
+ })(d || (d = {}));
182
+ var q, L = null, ce = "FLAGSMITH_EVENT", lt = ce, Jt = "https://edge.api.flagsmith.com/api/v1/", Mt = "flagsmith_value_", Bt = "flagsmith_enabled_", zt = "flagsmith_trait_", ve = 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
- t.log("Get Flags"), t.isLoading = !0, t.loadingState.isFetching || t.setLoadingState(o(o({}, t.loadingState), { isFetching: !0 }));
188
- var s = "".concat(t.getContext().identity), c = function(h) {
189
- var f, u, m, w;
190
- if (h && s === "".concat(t.getContext().identity)) {
191
- var D = h.flags, A = h.traits, k = h.identifier;
187
+ t.log("Get Flags"), t.isLoading = !0, t.loadingState.isFetching || t.setLoadingState(s(s({}, t.loadingState), { isFetching: !0 }));
188
+ var o = "".concat(t.getContext().identity), c = function(v) {
189
+ var f, l, p, E;
190
+ if (v && o === "".concat(t.getContext().identity)) {
191
+ var U = v.flags, T = v.traits, k = v.identifier;
192
192
  t.isLoading = !1;
193
- var j = {}, P = {};
194
- A = A || [], (D = D || []).forEach(function(S) {
195
- j[S.feature.name.toLowerCase().replace(/ /g, "_")] = { id: S.feature.id, enabled: S.enabled, value: S.feature_state_value };
196
- }), A.forEach(function(S) {
197
- P[S.trait_key.toLowerCase().replace(/ /g, "_")] = { transient: S.transient, value: S.trait_value };
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, P);
200
- if ((k || Object.keys(P).length) && (t.evaluationContext.identity = o(o({}, t.evaluationContext.identity), { traits: P }), k && (t.evaluationContext.identity.identifier = k)), t.flags = j, t.updateStorage(), t._onChange(t.oldFlags, { isFromServer: !0, flagsChanged: K, traitsChanged: nt }, t._loadedState(null, F.SERVER)), t.datadogRum) try {
193
+ var A = {}, j = {};
194
+ T = T || [], (U = U || []).forEach(function(y) {
195
+ A[y.feature.name.toLowerCase().replace(/ /g, "_")] = { id: y.feature.id, enabled: y.enabled, value: y.feature_state_value };
196
+ }), T.forEach(function(y) {
197
+ j[y.trait_key.toLowerCase().replace(/ /g, "_")] = { transient: y.transient, value: y.trait_value };
198
+ }), t.oldFlags = s({}, t.flags);
199
+ var D = C(t.oldFlags, A), it = C((f = t.evaluationContext.identity) === null || f === void 0 ? void 0 : f.traits, j);
200
+ if ((k || Object.keys(j).length) && (t.evaluationContext.identity = s(s({}, t.evaluationContext.identity), { traits: j }), k && (t.evaluationContext.identity.identifier = k)), t.flags = A, t.updateStorage(), t._onChange(t.oldFlags, { isFromServer: !0, flagsChanged: D, traitsChanged: it }, t._loadedState(null, d.SERVER)), t.datadogRum) try {
201
201
  if (t.datadogRum.trackTraits) {
202
- var it = {};
203
- Object.keys(((u = t.evaluationContext.identity) === null || u === void 0 ? void 0 : u.traits) || {}).map(function(S) {
204
- it[zt + S] = t.getTrait(S);
202
+ var at = {};
203
+ Object.keys(((l = t.evaluationContext.identity) === null || l === void 0 ? void 0 : l.traits) || {}).map(function(y) {
204
+ at[zt + y] = t.getTrait(y);
205
205
  });
206
- var Z = o(o(o({}, t.datadogRum.client.getUser()), { id: t.datadogRum.client.getUser().id || ((m = t.evaluationContext.identity) === null || m === void 0 ? void 0 : m.identifier) }), it);
207
- t.log("Setting Datadog user", Z), t.datadogRum.client.setUser(Z);
206
+ var W = s(s(s({}, t.datadogRum.client.getUser()), { id: t.datadogRum.client.getUser().id || ((p = t.evaluationContext.identity) === null || p === void 0 ? void 0 : p.identifier) }), at);
207
+ t.log("Setting Datadog user", W), t.datadogRum.client.setUser(W);
208
208
  }
209
- } catch (S) {
210
- console.error(S);
209
+ } catch (y) {
210
+ console.error(y);
211
211
  }
212
212
  if (t.dtrum) try {
213
213
  var O = { javaDouble: {}, date: {}, shortString: {}, javaLongOrObject: {} };
214
- Object.keys(t.flags).map(function(S) {
215
- y(O, Mt + S, t.getValue(S, { skipAnalytics: !0 })), y(O, Bt + S, t.hasFeature(S, { skipAnalytics: !0 }));
216
- }), Object.keys(((w = t.evaluationContext.identity) === null || w === void 0 ? void 0 : w.traits) || {}).map(function(S) {
217
- y(O, zt + S, t.getTrait(S));
214
+ Object.keys(t.flags).map(function(y) {
215
+ _(O, Mt + y, t.getValue(y, { skipAnalytics: !0 })), _(O, Bt + y, t.hasFeature(y, { skipAnalytics: !0 }));
216
+ }), Object.keys(((E = t.evaluationContext.identity) === null || E === void 0 ? void 0 : E.traits) || {}).map(function(y) {
217
+ _(O, zt + y, t.getTrait(y));
218
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
- } catch (S) {
220
- console.error(S);
219
+ } catch (y) {
220
+ console.error(y);
221
221
  }
222
222
  }
223
223
  };
224
- return r.identity ? Promise.all([r.identity.traits && Object.keys(r.identity.traits).length || !r.identity.identifier ? t.getJSON(n + "identities/", "POST", JSON.stringify({ identifier: r.identity.identifier, transient: r.identity.transient, traits: Object.entries(r.identity.traits).map(function(h) {
225
- var f = h[0], u = h[1];
226
- return { trait_key: f, trait_value: u == null ? void 0 : u.value, transient: u == null ? void 0 : u.transient };
227
- }).filter(function(h) {
228
- return h.trait_value !== void 0 || (t.log("Warning - attempted to set an undefined trait value for key", h.trait_key), !1);
229
- }) })) : t.getJSON(n + "identities/?identifier=" + encodeURIComponent(r.identity.identifier) + (r.identity.transient ? "&transient=true" : ""))]).then(function(h) {
230
- return t.evaluationContext.identity = o(o({}, t.evaluationContext.identity), { traits: {} }), c(h == null ? void 0 : h[0]);
231
- }).catch(function(h) {
232
- var f = h.message, u = new Error(f);
233
- return Promise.reject(u);
234
- }) : t.getJSON(n + "flags/").then(function(h) {
235
- return c({ flags: h, traits: void 0 });
224
+ return r.identity ? Promise.all([r.identity.traits && Object.keys(r.identity.traits).length || !r.identity.identifier ? t.getJSON(n + "identities/", "POST", JSON.stringify({ identifier: r.identity.identifier, transient: r.identity.transient, traits: Object.entries(r.identity.traits).map(function(v) {
225
+ var f = v[0], l = v[1];
226
+ return { trait_key: f, trait_value: l == null ? void 0 : l.value, transient: l == null ? void 0 : l.transient };
227
+ }).filter(function(v) {
228
+ return v.trait_value !== void 0 || (t.log("Warning - attempted to set an undefined trait value for key", v.trait_key), !1);
229
+ }) })) : t.getJSON(n + "identities/?identifier=" + encodeURIComponent(r.identity.identifier) + (r.identity.transient ? "&transient=true" : ""))]).then(function(v) {
230
+ return t.evaluationContext.identity = s(s({}, t.evaluationContext.identity), { traits: {} }), c(v == null ? void 0 : v[0]);
231
+ }).catch(function(v) {
232
+ var f = v.message, l = new Error(f);
233
+ return Promise.reject(l);
234
+ }) : t.getJSON(n + "flags/").then(function(v) {
235
+ return c({ flags: v, traits: void 0 });
236
236
  });
237
237
  }, this.analyticsFlags = function() {
238
238
  var i = t.api;
239
239
  if (t.evaluationEvent && t.evaluationContext.environment && t.evaluationEvent[t.evaluationContext.environment.apiKey]) return t.evaluationEvent && Object.getOwnPropertyNames(t.evaluationEvent).length !== 0 && Object.getOwnPropertyNames(t.evaluationEvent[t.evaluationContext.environment.apiKey]).length !== 0 ? t.getJSON(i + "analytics/flags/", "POST", JSON.stringify(t.evaluationEvent[t.evaluationContext.environment.apiKey])).then(function(n) {
240
240
  if (t.evaluationContext.environment) {
241
241
  var r = t.getState();
242
- t.evaluationEvent || (t.evaluationEvent = {}), t.evaluationEvent[t.evaluationContext.environment.apiKey] = {}, t.setState(o(o({}, r), { evaluationEvent: t.evaluationEvent })), t.updateEventStorage();
242
+ t.evaluationEvent || (t.evaluationEvent = {}), t.evaluationEvent[t.evaluationContext.environment.apiKey] = {}, t.setState(s(s({}, r), { evaluationEvent: t.evaluationEvent })), t.updateEventStorage();
243
243
  }
244
244
  }).catch(function(n) {
245
245
  t.log("Exception fetching evaluationEvent", n);
246
246
  }) : void 0;
247
- }, this.datadogRum = null, this.loadingState = { isLoading: !0, isFetching: !0, error: null, source: F.NONE }, this.canUseStorage = !1, this.analyticsInterval = null, this.api = null, this.cacheFlags = !1, this.ts = null, this.enableAnalytics = !1, this.enableLogs = !1, this.evaluationContext = {}, this.evaluationEvent = null, this.flags = null, this.getFlagInterval = null, this.headers = null, this.initialised = !1, this.oldFlags = null, this.onChange = null, this.onError = null, this.ticks = null, this.timer = null, this.dtrum = null, this.withTraits = null, this.cacheOptions = { ttl: 0, skipAPI: !1, loadStale: !1, storageKey: void 0 }, this.getValue = function(i, n, r) {
248
- var s = t.flags && t.flags[i.toLowerCase().replace(/ /g, "_")], c = null;
249
- if (s && (c = s.value), n != null && n.skipAnalytics || r || t.evaluateFlag(i, "VALUE"), c === null && (n == null ? void 0 : n.fallback) !== void 0) return n.fallback;
247
+ }, this.datadogRum = null, this.loadingState = { isLoading: !0, isFetching: !0, error: null, source: d.NONE }, this.canUseStorage = !1, this.analyticsInterval = null, this.api = null, this.cacheFlags = !1, this.ts = null, this.enableAnalytics = !1, this.enableLogs = !1, this.evaluationContext = {}, this.evaluationEvent = null, this.flags = null, this.getFlagInterval = null, this.headers = null, this.initialised = !1, this.oldFlags = null, this.onChange = null, this.onError = null, this.ticks = null, this.timer = null, this.dtrum = null, this.withTraits = null, this.cacheOptions = { ttl: 0, skipAPI: !1, loadStale: !1, storageKey: void 0 }, this.getValue = function(i, n, r) {
248
+ var o = t.flags && t.flags[i.toLowerCase().replace(/ /g, "_")], c = null;
249
+ if (o && (c = o.value), n != null && n.skipAnalytics || r || t.evaluateFlag(i, "VALUE"), c === null && (n == null ? void 0 : n.fallback) !== void 0) return n.fallback;
250
250
  if (n != null && n.json) try {
251
251
  return c === null ? (t.log("Tried to parse null flag as JSON: " + i), null) : JSON.parse(c);
252
252
  } catch {
@@ -259,59 +259,59 @@ var Gt = { exports: {} };
259
259
  }, this.getAllTraits = function() {
260
260
  var i;
261
261
  return Object.fromEntries(Object.entries(((i = t.evaluationContext.identity) === null || i === void 0 ? void 0 : i.traits) || {}).map(function(n) {
262
- var r = n[0], s = n[1];
263
- return [r, s == null ? void 0 : s.value];
262
+ var r = n[0], o = n[1];
263
+ return [r, o == null ? void 0 : o.value];
264
264
  }));
265
265
  }, this.setContext = function(i) {
266
- var n = z(i);
267
- return t.evaluationContext = o(o({}, n), { environment: n.environment || t.evaluationContext.environment }), t.initialised ? t.getFlags() : Promise.resolve();
266
+ var n = X(i);
267
+ return t.evaluationContext = s(s({}, n), { environment: n.environment || t.evaluationContext.environment }), t.initialised ? t.getFlags() : Promise.resolve();
268
268
  }, this.getContext = function() {
269
269
  return t.evaluationContext;
270
270
  }, this.updateContext = function(i) {
271
- return t.setContext(o(o({}, t.getContext()), i));
271
+ return t.setContext(s(s({}, t.getContext()), i));
272
272
  }, this.setTrait = function(i, n) {
273
273
  var r;
274
- if (t.api) return t.setContext(o(o({}, t.evaluationContext), { identity: o(o({}, t.evaluationContext.identity), { traits: o(o({}, (r = t.evaluationContext.identity) === null || r === void 0 ? void 0 : r.traits), R(Object.fromEntries([[i, n]]))) }) }));
274
+ if (t.api) return t.setContext(s(s({}, t.evaluationContext), { identity: s(s({}, t.evaluationContext.identity), { traits: s(s({}, (r = t.evaluationContext.identity) === null || r === void 0 ? void 0 : r.traits), H(Object.fromEntries([[i, n]]))) }) }));
275
275
  }, this.setTraits = function(i) {
276
276
  var n;
277
- if (t.api) return t.setContext(o(o({}, t.evaluationContext), { identity: o(o({}, t.evaluationContext.identity), { traits: o(o({}, (n = t.evaluationContext.identity) === null || n === void 0 ? void 0 : n.traits), Object.fromEntries(Object.entries(i).map(function(r) {
278
- var s = r[0], c = r[1];
279
- return [s, C(c) ? c : { value: c }];
277
+ if (t.api) return t.setContext(s(s({}, t.evaluationContext), { identity: s(s({}, t.evaluationContext.identity), { traits: s(s({}, (n = t.evaluationContext.identity) === null || n === void 0 ? void 0 : n.traits), Object.fromEntries(Object.entries(i).map(function(r) {
278
+ var o = r[0], c = r[1];
279
+ return [o, N(c) ? c : { value: c }];
280
280
  }))) }) }));
281
281
  console.error("Attempted to setTraits a user before calling flagsmith.init. Call flagsmith.init first, if you wish to prevent it sending a request for flags, call init with preventFetch:true.");
282
282
  }, this.hasFeature = function(i, n) {
283
- var r = typeof n == "object", s = t.flags && t.flags[i.toLowerCase().replace(/ /g, "_")], c = !1;
284
- return !s && r && n.fallback !== void 0 ? c = n == null ? void 0 : n.fallback : s && s.enabled && (c = !0), (r && !n.skipAnalytics || !n) && t.evaluateFlag(i, "ENABLED"), c;
283
+ var r = typeof n == "object", o = t.flags && t.flags[i.toLowerCase().replace(/ /g, "_")], c = !1;
284
+ return !o && r && n.fallback !== void 0 ? c = n == null ? void 0 : n.fallback : o && o.enabled && (c = !0), (r && !n.skipAnalytics || !n) && t.evaluateFlag(i, "ENABLED"), c;
285
285
  }, this.getStorageKey = function() {
286
286
  var i, n;
287
287
  return ((i = t.cacheOptions) === null || i === void 0 ? void 0 : i.storageKey) || "FLAGSMITH_DB_" + ((n = t.evaluationContext.environment) === null || n === void 0 ? void 0 : n.apiKey);
288
288
  }, this.getJSON = function(i, n, r) {
289
- var s, c = t;
289
+ var o, c = t;
290
290
  c.evaluationContext;
291
- var h = c.headers, f = { method: n || "GET", body: r, cache: "no-cache", headers: {} };
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
- var u = "".concat((s = t.evaluationContext.identity) === null || s === void 0 ? void 0 : s.identifier);
294
- return g(i, f).then(function(m) {
295
- var w, D, A = "".concat((w = t.evaluationContext.identity) === null || w === void 0 ? void 0 : w.identifier);
296
- if (u === A) {
297
- var k = (D = m.headers) === null || D === void 0 ? void 0 : D.get("x-flagsmith-document-updated-at");
291
+ var v = c.headers, f = { method: n || "GET", body: r, cache: "no-cache", headers: {} };
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"), v && Object.assign(f.headers, v), S || console.error("Flagsmith: fetch is undefined, please specify a fetch implementation into flagsmith.init to support SSR.");
293
+ var l = "".concat((o = t.evaluationContext.identity) === null || o === void 0 ? void 0 : o.identifier);
294
+ return S(i, f).then(function(p) {
295
+ var E, U, T = "".concat((E = t.evaluationContext.identity) === null || E === void 0 ? void 0 : E.identifier);
296
+ if (l === T) {
297
+ var k = (U = p.headers) === null || U === void 0 ? void 0 : U.get("x-flagsmith-document-updated-at");
298
298
  if (k) try {
299
- var j = parseFloat(k);
300
- if (isNaN(j)) return Promise.reject("Failed to parse x-flagsmith-document-updated-at");
301
- t.timestamp = j;
302
- } catch (P) {
303
- t.log(P, "Failed to parse x-flagsmith-document-updated-at", k);
299
+ var A = parseFloat(k);
300
+ if (isNaN(A)) return Promise.reject("Failed to parse x-flagsmith-document-updated-at");
301
+ t.timestamp = A;
302
+ } catch (j) {
303
+ t.log(j, "Failed to parse x-flagsmith-document-updated-at", k);
304
304
  }
305
- return t.log("Fetch response: " + m.status + " " + (n || "GET") + 0 + i), m.text().then(function(P) {
306
- var K = P;
305
+ return t.log("Fetch response: " + p.status + " " + (n || "GET") + 0 + i), p.text().then(function(j) {
306
+ var D = j;
307
307
  try {
308
- K = JSON.parse(P);
308
+ D = JSON.parse(j);
309
309
  } catch {
310
310
  }
311
- return !K && m.status && (K = "API Response: ".concat(m.status)), m.status && m.status >= 200 && m.status < 300 ? K : Promise.reject(new Error(K));
311
+ return !D && p.status && (D = "API Response: ".concat(p.status)), p.status && p.status >= 200 && p.status < 300 ? D : Promise.reject(new Error(D));
312
312
  });
313
313
  }
314
- t.log("Received response with identity mismatch, ignoring response. Requested: ".concat(u, ", Current: ").concat(A));
314
+ t.log("Received response with identity mismatch, ignoring response. Requested: ".concat(l, ", Current: ").concat(T));
315
315
  });
316
316
  }, this.evaluateFlag = function(i, n) {
317
317
  if (t.datadogRum && (t.datadogRum.client.addFeatureFlagEvaluation ? n === "VALUE" ? t.datadogRum.client.addFeatureFlagEvaluation(Mt + i, t.getValue(i, {}, !0)) : t.datadogRum.client.addFeatureFlagEvaluation(Bt + i, t.hasFeature(i, !0)) : console.error("Flagsmith: Your datadog RUM client does not support the function addFeatureFlagEvaluation, please update it.")), t.enableAnalytics) {
@@ -320,127 +320,127 @@ var Gt = { exports: {} };
320
320
  }
321
321
  t.updateEventStorage();
322
322
  }, this._onChange = function(i, n, r) {
323
- var s, c;
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 : 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);
323
+ var o, c;
324
+ t.setLoadingState(r), (o = t.onChange) === null || o === void 0 || o.call(t, i, n, t.loadingState), (c = t._trigger) === null || c === void 0 || c.call(t);
325
+ }, S = e.fetch ? e.fetch : typeof fetch < "u" ? fetch : ht === null || ht === void 0 ? void 0 : ht.fetch, this.canUseStorage = typeof window < "u" || !!e.browserlessStorage, this.log("Constructing flagsmith instance " + e), e.eventSource && (q = e.eventSource), e.AsyncStorage && (L = e.AsyncStorage);
326
326
  }
327
327
  return a.prototype.init = function(e) {
328
328
  var t, i, n;
329
- return x(this, void 0, void 0, function() {
330
- var r, s, c, h, f, u, m, w, D, A, k, j, P, K, nt, it, Z, O, S, pt, at, Zt, Q, yt, Qt, te, mt, ee, St, rt, tt, ne, I = this;
331
- return M(this, function(U) {
332
- switch (U.label) {
329
+ return F(this, void 0, void 0, function() {
330
+ var r, o, c, v, f, l, p, E, U, T, k, A, j, D, it, at, W, O, y, pt, rt, Zt, Y, yt, Qt, te, mt, ee, St, ot, Z, ne, w = this;
331
+ return J(this, function(R) {
332
+ switch (R.label) {
333
333
  case 0:
334
- r = z(e.evaluationContext || this.evaluationContext), U.label = 1;
334
+ r = X(e.evaluationContext || this.evaluationContext), R.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, u = e.onChange, m = e.cacheFlags, w = e.datadogRum, D = e.onError, A = e.defaultFlags, k = e.fetch, j = e.preventFetch, P = e.enableLogs, K = e.enableDynatrace, nt = e.enableAnalytics, it = e.realtime, Z = e.eventSourceUrl, O = Z === void 0 ? "https://realtime.flagsmith.com/" : Z, S = e.AsyncStorage, pt = e.identity, at = e.traits, Zt = e.state, Q = e.cacheOptions, yt = e.angularHttpClient, Qt = e._trigger, te = 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(N) {
338
- return [N[0], { value: N[1] }];
339
- })) : {} } : r.identity, this.evaluationContext = r, this.api = h, this.headers = f, this.getFlagInterval = null, this.analyticsInterval = null, this.onChange = u, mt = "Wrong Flagsmith Configuration: preventFetch is true and no defaulFlags provided", this._trigger = Qt || this._trigger, this._triggerLoadingState = te || this._triggerLoadingState, this.onError = function(N) {
340
- I.setLoadingState(o(o({}, I.loadingState), { isFetching: !1, isLoading: !1, error: N })), D == null || D(N);
341
- }, this.enableLogs = P || !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."), k && (g = k), 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 && !!m, ut = "FLAGSMITH_EVENT_" + r.environment.apiKey, S && (T = S), 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(Zt), 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(N) {
342
- return function(G, V) {
343
- var H = V.headers, b = V.method, et = V.body;
344
- return new Promise(function(q) {
336
+ if (R.trys.push([1, 13, , 14]), o = e.environmentID, c = e.api, v = c === void 0 ? Jt : c, f = e.headers, l = e.onChange, p = e.cacheFlags, E = e.datadogRum, U = e.onError, T = e.defaultFlags, k = e.fetch, A = e.preventFetch, j = e.enableLogs, D = e.enableDynatrace, it = e.enableAnalytics, at = e.realtime, W = e.eventSourceUrl, O = W === void 0 ? "https://realtime.flagsmith.com/" : W, y = e.AsyncStorage, pt = e.identity, rt = e.traits, Zt = e.state, Y = e.cacheOptions, yt = e.angularHttpClient, Qt = e._trigger, te = e._triggerLoadingState, r.environment = o ? { apiKey: o } : r.environment, !r.environment || !r.environment.apiKey) throw new Error("Please provide `evaluationContext.environment` with non-empty `apiKey`");
337
+ if (r.identity = pt || rt ? { identifier: pt, traits: rt ? Object.fromEntries(Object.entries(rt).map(function(P) {
338
+ return [P[0], { value: P[1] }];
339
+ })) : {} } : r.identity, this.evaluationContext = r, this.api = v, 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 = Qt || this._trigger, this._triggerLoadingState = te || this._triggerLoadingState, this.onError = function(P) {
340
+ w.setLoadingState(s(s({}, w.loadingState), { isFetching: !1, isLoading: !1, error: P })), U == null || U(P);
341
+ }, this.enableLogs = j || !1, this.cacheOptions = Y ? { skipAPI: !!Y.skipAPI, ttl: Y.ttl || 0, storageKey: Y.storageKey, loadStale: !!Y.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."), k && (S = k), this.enableAnalytics = it || !1, this.flags = Object.assign({}, T) || {}, this.datadogRum = E || null, this.initialised = !0, this.ticks = 1e4, this.timer = this.enableLogs ? (/* @__PURE__ */ new Date()).valueOf() : null, this.cacheFlags = L !== void 0 && !!p, lt = "FLAGSMITH_EVENT_" + r.environment.apiKey, y && (L = y), at && typeof window < "u" && this.setupRealtime(O, r.environment.apiKey), Object.keys(this.flags).length && (this.loadingState = s(s({}, this.loadingState), { isLoading: !1, source: d.DEFAULT_FLAGS })), this.setState(Zt), this.log("Initialising with properties", e, this), D && (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 && (S = /* @__PURE__ */ function(P) {
342
+ return function(K, G) {
343
+ var B = G.headers, b = G.method, Q = G.body;
344
+ return new Promise(function($) {
345
345
  switch (b) {
346
346
  case "GET":
347
- return N.get(G, { headers: H }).subscribe(function(B) {
348
- q({ ok: !0, text: function() {
349
- return Promise.resolve(B);
347
+ return P.get(K, { headers: B }).subscribe(function(M) {
348
+ $({ ok: !0, text: function() {
349
+ return Promise.resolve(M);
350
350
  } });
351
351
  });
352
352
  case "POST":
353
353
  case "PUT":
354
- return N.post(G, et, { headers: H }).subscribe(function(B) {
355
- q({ ok: !0, text: function() {
356
- return Promise.resolve(B);
354
+ return P.post(K, Q, { headers: B }).subscribe(function(M) {
355
+ $({ ok: !0, text: function() {
356
+ return Promise.resolve(M);
357
357
  } });
358
358
  });
359
359
  }
360
360
  });
361
361
  };
362
- }(yt)), T && this.canUseStorage && T.getItem(ut).then(function(N) {
362
+ }(yt)), L && this.canUseStorage && L.getItem(lt).then(function(P) {
363
363
  try {
364
- I.evaluationEvent = JSON.parse(N) || {};
364
+ w.evaluationEvent = JSON.parse(P) || {};
365
365
  } catch {
366
- I.evaluationEvent = {};
366
+ w.evaluationEvent = {};
367
367
  }
368
- I.analyticsInterval = setInterval(I.analyticsFlags, I.ticks);
369
- }), this.enableAnalytics && (this.analyticsInterval && clearInterval(this.analyticsInterval), T && this.canUseStorage && T.getItem(ut, function(N, G) {
370
- if (G && I.evaluationContext.environment) {
371
- var V = JSON.parse(G);
372
- if (V[I.evaluationContext.environment.apiKey]) {
373
- var H = I.getState();
374
- I.log("Retrieved events from cache", G), I.setState(o(o({}, H), { evaluationEvent: V[I.evaluationContext.environment.apiKey] }));
368
+ w.analyticsInterval = setInterval(w.analyticsFlags, w.ticks);
369
+ }), this.enableAnalytics && (this.analyticsInterval && clearInterval(this.analyticsInterval), L && this.canUseStorage && L.getItem(lt, function(P, K) {
370
+ if (K && w.evaluationContext.environment) {
371
+ var G = JSON.parse(K);
372
+ if (G[w.evaluationContext.environment.apiKey]) {
373
+ var B = w.getState();
374
+ w.log("Retrieved events from cache", K), w.setState(s(s({}, B), { evaluationEvent: G[w.evaluationContext.environment.apiKey] }));
375
375
  }
376
376
  }
377
- })), !m) return [3, 9];
378
- if (!T || !this.canUseStorage) return [3, 8];
379
- ee = function(N, G) {
380
- return x(I, void 0, void 0, function() {
381
- var V, H, b, et, q, B, bt, ie, Ct, _t, xt, Et, Ft, wt, Ot, It, Tt, Lt, At, jt, Pt, Nt, Rt, kt, ae = this;
382
- return M(this, function($) {
383
- switch ($.label) {
377
+ })), !p) return [3, 9];
378
+ if (!L || !this.canUseStorage) return [3, 8];
379
+ ee = function(P, K) {
380
+ return F(w, void 0, void 0, function() {
381
+ var G, B, b, Q, $, M, bt, ie, _t, Ct, xt, Ft, Et, Ot, wt, It, Lt, Tt, At, jt, Pt, Nt, kt, Rt, ae = this;
382
+ return J(this, function(z) {
383
+ switch (z.label) {
384
384
  case 0:
385
- if (!G) return [3, 7];
386
- V = null, H = null, $.label = 1;
385
+ if (!K) return [3, 7];
386
+ G = null, B = null, z.label = 1;
387
387
  case 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), V = _(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({}, ((Nt = (Pt = b.evaluationContext) === null || Pt === void 0 ? void 0 : Pt.identity) === null || Nt === void 0 ? void 0 : Nt.traits) || {}), at || {}) }) : void 0 })) })), this.log("Retrieved flags from cache", b))), et ? (bt = !j && (!this.cacheOptions.skipAPI || q), this._onChange(null, { isFromServer: !1, flagsChanged: V, 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) {
388
+ return z.trys.push([1, 5, , 6]), b = JSON.parse(K), Q = !1, $ = !1, b && b.api === this.api && ((Ct = (_t = b.evaluationContext) === null || _t === void 0 ? void 0 : _t.environment) === null || Ct === void 0 ? void 0 : Ct.apiKey) === ((xt = this.evaluationContext.environment) === null || xt === void 0 ? void 0 : xt.apiKey) && (M = !0, this.evaluationContext.identity && ((Et = (Ft = b.evaluationContext) === null || Ft === void 0 ? void 0 : Ft.identity) === null || Et === void 0 ? void 0 : Et.identifier) !== this.evaluationContext.identity.identifier && (this.log("Ignoring cache, identity has changed from " + ((wt = (Ot = b.evaluationContext) === null || Ot === void 0 ? void 0 : Ot.identity) === null || wt === void 0 ? void 0 : wt.identifier) + " to " + this.evaluationContext.identity.identifier), M = !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"), M = !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"), $ = !0, M = !0)), M && (Q = !0, B = C((It = this.evaluationContext.identity) === null || It === void 0 ? void 0 : It.traits, (Tt = (Lt = b.evaluationContext) === null || Lt === void 0 ? void 0 : Lt.identity) === null || Tt === void 0 ? void 0 : Tt.traits), G = C(this.flags, b.flags), this.setState(s(s({}, b), { evaluationContext: X(s(s({}, b.evaluationContext), { identity: !((At = b.evaluationContext) === null || At === void 0) && At.identity ? s(s({}, (jt = b.evaluationContext) === null || jt === void 0 ? void 0 : jt.identity), { traits: s(s({}, ((Nt = (Pt = b.evaluationContext) === null || Pt === void 0 ? void 0 : Pt.identity) === null || Nt === void 0 ? void 0 : Nt.traits) || {}), rt || {}) }) : void 0 })) })), this.log("Retrieved flags from cache", b))), Q ? (bt = !A && (!this.cacheOptions.skipAPI || $), this._onChange(null, { isFromServer: !1, flagsChanged: G, traitsChanged: B }, this._loadedState(null, d.CACHE, bt)), this.oldFlags = this.flags, this.cacheOptions.skipAPI && Q && !$ && this.log("Skipping API, using cache"), bt && this.getFlags().catch(function(de) {
389
389
  var Ut;
390
- (Ut = ae.onError) === null || Ut === void 0 || Ut.call(ae, ge);
390
+ (Ut = ae.onError) === null || Ut === void 0 || Ut.call(ae, de);
391
391
  }), [3, 4]) : [3, 2];
392
392
  case 2:
393
- return j ? [3, 4] : [4, this.getFlags()];
393
+ return A ? [3, 4] : [4, this.getFlags()];
394
394
  case 3:
395
- $.sent(), $.label = 4;
395
+ z.sent(), z.label = 4;
396
396
  case 4:
397
397
  return [3, 6];
398
398
  case 5:
399
- return ie = $.sent(), this.log("Exception fetching cached logs", ie), [3, 6];
399
+ return ie = z.sent(), this.log("Exception fetching cached logs", ie), [3, 6];
400
400
  case 6:
401
401
  return [3, 10];
402
402
  case 7:
403
- return j ? [3, 9] : [4, this.getFlags()];
403
+ return A ? [3, 9] : [4, this.getFlags()];
404
404
  case 8:
405
- return $.sent(), [3, 10];
405
+ return z.sent(), [3, 10];
406
406
  case 9:
407
- if (A) this._onChange(null, { isFromServer: !1, flagsChanged: _({}, this.flags), traitsChanged: _({}, (Rt = this.evaluationContext.identity) === null || Rt === void 0 ? void 0 : Rt.traits) }, this._loadedState(null, F.DEFAULT_FLAGS));
407
+ if (T) this._onChange(null, { isFromServer: !1, flagsChanged: C({}, this.flags), traitsChanged: C({}, (kt = this.evaluationContext.identity) === null || kt === void 0 ? void 0 : kt.traits) }, this._loadedState(null, d.DEFAULT_FLAGS));
408
408
  else {
409
409
  if (!this.flags) throw new Error(mt);
410
- this._onChange(null, { isFromServer: !1, flagsChanged: _({}, this.flags), traitsChanged: _({}, (kt = this.evaluationContext.identity) === null || kt === void 0 ? void 0 : kt.traits) }, this._loadedState(null, F.DEFAULT_FLAGS));
410
+ this._onChange(null, { isFromServer: !1, flagsChanged: C({}, this.flags), traitsChanged: C({}, (Rt = this.evaluationContext.identity) === null || Rt === void 0 ? void 0 : Rt.traits) }, this._loadedState(null, d.DEFAULT_FLAGS));
411
411
  }
412
- $.label = 10;
412
+ z.label = 10;
413
413
  case 10:
414
414
  return [2];
415
415
  }
416
416
  });
417
417
  });
418
- }, U.label = 2;
418
+ }, R.label = 2;
419
419
  case 2:
420
- return U.trys.push([2, 7, , 8]), T.getItemSync ? (St = T.getItemSync(this.getStorageKey()), [3, 5]) : [3, 3];
420
+ return R.trys.push([2, 7, , 8]), L.getItemSync ? (St = L.getItemSync(this.getStorageKey()), [3, 5]) : [3, 3];
421
421
  case 3:
422
- return [4, T.getItem(this.getStorageKey())];
422
+ return [4, L.getItem(this.getStorageKey())];
423
423
  case 4:
424
- St = U.sent(), U.label = 5;
424
+ St = R.sent(), R.label = 5;
425
425
  case 5:
426
426
  return [4, ee(null, St)];
427
427
  case 6:
428
428
  case 7:
429
- return U.sent(), [3, 8];
429
+ return R.sent(), [3, 8];
430
430
  case 8:
431
431
  return [3, 12];
432
432
  case 9:
433
- return j ? [3, 11] : [4, this.getFlags()];
433
+ return A ? [3, 11] : [4, this.getFlags()];
434
434
  case 10:
435
- return U.sent(), [3, 12];
435
+ return R.sent(), [3, 12];
436
436
  case 11:
437
- if (A) this._onChange(null, { isFromServer: !1, flagsChanged: _({}, A), traitsChanged: _({}, (t = r.identity) === null || t === void 0 ? void 0 : t.traits) }, this._loadedState(null, F.DEFAULT_FLAGS));
438
- else if (this.flags && (rt = null, Object.keys(this.flags).length === 0 && (rt = mt), this._onChange(null, { isFromServer: !1, flagsChanged: _({}, this.flags), traitsChanged: _({}, (i = r.identity) === null || i === void 0 ? void 0 : i.traits) }, this._loadedState(rt, F.DEFAULT_FLAGS)), rt)) throw new Error(rt);
439
- U.label = 12;
437
+ if (T) this._onChange(null, { isFromServer: !1, flagsChanged: C({}, T), traitsChanged: C({}, (t = r.identity) === null || t === void 0 ? void 0 : t.traits) }, this._loadedState(null, d.DEFAULT_FLAGS));
438
+ else if (this.flags && (ot = null, Object.keys(this.flags).length === 0 && (ot = mt), this._onChange(null, { isFromServer: !1, flagsChanged: C({}, this.flags), traitsChanged: C({}, (i = r.identity) === null || i === void 0 ? void 0 : i.traits) }, this._loadedState(ot, d.DEFAULT_FLAGS)), ot)) throw new Error(ot);
439
+ R.label = 12;
440
440
  case 12:
441
441
  return [3, 14];
442
442
  case 13:
443
- throw tt = U.sent(), this.log("Error during initialisation ", tt), ne = tt instanceof Error ? tt : new Error("".concat(tt)), (n = this.onError) === null || n === void 0 || n.call(this, ne), tt;
443
+ throw Z = R.sent(), this.log("Error during initialisation ", Z), ne = Z instanceof Error ? Z : new Error("".concat(Z)), (n = this.onError) === null || n === void 0 || n.call(this, ne), Z;
444
444
  case 14:
445
445
  return [2];
446
446
  }
@@ -450,8 +450,8 @@ var Gt = { exports: {} };
450
450
  return this.flags;
451
451
  }, a.prototype.identify = function(e, t, i) {
452
452
  return this.evaluationContext.identity = { identifier: e, transient: i, traits: this.evaluationContext.identity && this.evaluationContext.identity.identifier == e ? this.evaluationContext.identity.traits : {} }, this.evaluationContext.identity.identifier = e, this.log("Identify: " + this.evaluationContext.identity.identifier), t && (this.evaluationContext.identity.traits = Object.fromEntries(Object.entries(t).map(function(n) {
453
- var r = n[0], s = n[1];
454
- return [r, C(s) ? s : { value: s }];
453
+ var r = n[0], o = n[1];
454
+ return [r, N(o) ? o : { value: o }];
455
455
  }))), this.initialised ? this.getFlags() : Promise.resolve();
456
456
  }, a.prototype.getState = function() {
457
457
  return { api: this.api, flags: this.flags, ts: this.ts, evaluationContext: this.evaluationContext, evaluationEvent: this.evaluationEvent };
@@ -467,52 +467,52 @@ 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, L(["FLAGSMITH:", (/* @__PURE__ */ new Date()).valueOf() - (this.timer || 0), "ms"], e));
470
+ this.enableLogs && console.log.apply(this, I(["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), T.setItem(this.getStorageKey(), e);
475
+ this.log("Setting storage", e), L.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
- T.setItem(ut, e).catch(function(t) {
480
+ L.setItem(lt, 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
- W(e, this.loadingState) || (this.loadingState = o({}, e), this.log("Loading state changed", e), (t = this._triggerLoadingState) === null || t === void 0 || t.call(this));
486
+ nt(e, this.loadingState) || (this.loadingState = s({}, 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
- Y ? this.eventSource || (this.log("Creating event source with url " + n), this.eventSource = new Y(n), this.eventSource.addEventListener("environment_updated", function(r) {
490
- var s;
489
+ q ? this.eventSource || (this.log("Creating event source with url " + n), this.eventSource = new q(n), this.eventSource.addEventListener("environment_updated", function(r) {
490
+ var o;
491
491
  try {
492
- s = JSON.parse(r.data).updated_at;
492
+ o = JSON.parse(r.data).updated_at;
493
493
  } catch (c) {
494
494
  i.log("Could not parse sse event", c);
495
495
  }
496
- s ? !i.timestamp || s > i.timestamp ? i.isLoading ? i.log("updated_at is new, but flags are loading", r.data, i.timestamp) : (i.log("updated_at is new, fetching flags", r.data, i.timestamp), i.getFlags()) : i.log("updated_at is outdated, skipping get flags", r.data, i.timestamp) : i.log("No updated_at received, fetching flags", r);
496
+ o ? !i.timestamp || o > i.timestamp ? i.isLoading ? i.log("updated_at is new, but flags are loading", r.data, i.timestamp) : (i.log("updated_at is new, fetching flags", r.data, i.timestamp), i.getFlags()) : i.log("updated_at is outdated, skipping get flags", r.data, i.timestamp) : i.log("No updated_at received, fetching flags", r);
497
497
  })) : this.log("Error, EventSource is undefined");
498
498
  }, a;
499
499
  }();
500
500
  function Ht(a) {
501
501
  var e = a.fetch, t = a.AsyncStorage, i = a.eventSource;
502
- return new he({ fetch: e, AsyncStorage: t, eventSource: i });
502
+ return new ve({ fetch: e, AsyncStorage: t, eventSource: i });
503
503
  }
504
- var ct, ve = (ct = function(a, e) {
505
- return ct = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, i) {
504
+ var ut, he = (ut = function(a, e) {
505
+ return ut = 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
- }, ct(a, e);
509
+ }, ut(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
- ct(a, e), a.prototype = e === null ? Object.create(e) : (t.prototype = e.prototype, new t());
515
+ ut(a, e), a.prototype = e === null ? Object.create(e) : (t.prototype = e.prototype, new t());
516
516
  }), $t = 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);
@@ -523,9 +523,9 @@ var Gt = { exports: {} };
523
523
  }, Xt = function(a, e) {
524
524
  var t = typeof Symbol == "function" && a[Symbol.iterator];
525
525
  if (!t) return a;
526
- var i, n, r = t.call(a), s = [];
526
+ var i, n, r = t.call(a), o = [];
527
527
  try {
528
- for (; (e === void 0 || e-- > 0) && !(i = r.next()).done; ) s.push(i.value);
528
+ for (; (e === void 0 || e-- > 0) && !(i = r.next()).done; ) o.push(i.value);
529
529
  } catch (c) {
530
530
  n = { error: c };
531
531
  } finally {
@@ -535,20 +535,20 @@ var Gt = { exports: {} };
535
535
  if (n) throw n.error;
536
536
  }
537
537
  }
538
- return s;
538
+ return o;
539
539
  }, ft = function(a, e, t) {
540
540
  if (arguments.length === 2) 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]);
541
541
  return a.concat(i || Array.prototype.slice.call(e));
542
- }, de = function(a) {
542
+ }, ge = function(a) {
543
543
  function e() {
544
544
  return a.call(this, `EventSource not available.
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
- return ve(e, a), e;
547
+ return he(e, a), e;
548
548
  }(Error), qt = function() {
549
549
  function a(e, t) {
550
550
  var i = this;
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();
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 ge();
552
552
  this._onevent_wrapped = function(n) {
553
553
  i._onevent(n);
554
554
  }, this._start();
@@ -557,23 +557,23 @@ Consider loading an EventSource polyfill and making it available globally as Eve
557
557
  throw new Error("Method not implemented.");
558
558
  }, a.prototype._start = function() {
559
559
  var e, t, i = this, n = this.url;
560
- this._lastEventId && (n.indexOf("?") === -1 ? n += "?" : n += "&", n += "lastEventId=" + encodeURIComponent(this._lastEventId)), this._eventSource = new this.eventSourceClass(n, this._configuration), this._eventSource.onopen = function(h) {
561
- i._onopen(h);
562
- }, this._eventSource.onerror = function(h) {
563
- i._onerror(h);
564
- }, this._eventSource.onmessage = function(h) {
565
- i.onmessage(h);
560
+ this._lastEventId && (n.indexOf("?") === -1 ? n += "?" : n += "&", n += "lastEventId=" + encodeURIComponent(this._lastEventId)), this._eventSource = new this.eventSourceClass(n, this._configuration), this._eventSource.onopen = function(v) {
561
+ i._onopen(v);
562
+ }, this._eventSource.onerror = function(v) {
563
+ i._onerror(v);
564
+ }, this._eventSource.onmessage = function(v) {
565
+ i.onmessage(v);
566
566
  };
567
567
  try {
568
- for (var r = $t(Object.keys(this._listeners)), s = r.next(); !s.done; s = r.next()) {
569
- var c = s.value;
568
+ for (var r = $t(Object.keys(this._listeners)), o = r.next(); !o.done; o = r.next()) {
569
+ var c = o.value;
570
570
  this._eventSource.addEventListener(c, this._onevent_wrapped);
571
571
  }
572
- } catch (h) {
573
- e = { error: h };
572
+ } catch (v) {
573
+ e = { error: v };
574
574
  } finally {
575
575
  try {
576
- s && !s.done && (t = r.return) && t.call(r);
576
+ o && !o.done && (t = r.return) && t.call(r);
577
577
  } finally {
578
578
  if (e) throw e.error;
579
579
  }
@@ -594,13 +594,13 @@ Consider loading an EventSource polyfill and making it available globally as Eve
594
594
  e && e.lastEventId && (this._lastEventId = e.lastEventId);
595
595
  var n = this._listeners[e.type];
596
596
  if (n != null) try {
597
- for (var r = $t(ft([], Xt(n), !1)), s = r.next(); !s.done; s = r.next())
598
- s.value.call(this, e);
597
+ for (var r = $t(ft([], Xt(n), !1)), o = r.next(); !o.done; o = r.next())
598
+ o.value.call(this, e);
599
599
  } catch (c) {
600
600
  t = { error: c };
601
601
  } finally {
602
602
  try {
603
- s && !s.done && (i = r.return) && i.call(r);
603
+ o && !o.done && (i = r.return) && i.call(r);
604
604
  } finally {
605
605
  if (t) throw t.error;
606
606
  }
@@ -625,228 +625,214 @@ Consider loading an EventSource polyfill and making it available globally as Eve
625
625
  globalThis.FlagsmithEventSource = typeof EventSource < "u" ? EventSource : null;
626
626
  var Wt = function(a, e) {
627
627
  return e = e || {}, new Promise(function(t, i) {
628
- var n = new XMLHttpRequest(), r = [], s = [], c = {}, h = function() {
628
+ var n = new XMLHttpRequest(), r = [], o = [], c = {}, v = function() {
629
629
  return { ok: (n.status / 100 | 0) == 2, statusText: n.statusText, status: n.status, url: n.responseURL, text: function() {
630
630
  return Promise.resolve(n.responseText);
631
631
  }, json: function() {
632
632
  return Promise.resolve(n.responseText).then(JSON.parse);
633
633
  }, blob: function() {
634
634
  return Promise.resolve(new Blob([n.response]));
635
- }, clone: h, headers: { keys: function() {
635
+ }, clone: v, headers: { keys: function() {
636
636
  return r;
637
637
  }, entries: function() {
638
- return s;
639
- }, get: function(u) {
640
- return c[u.toLowerCase()];
641
- }, has: function(u) {
642
- return u.toLowerCase() in c;
638
+ return o;
639
+ }, get: function(l) {
640
+ return c[l.toLowerCase()];
641
+ }, has: function(l) {
642
+ return l.toLowerCase() in c;
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(u, m, w) {
647
- r.push(m = m.toLowerCase()), s.push([m, w]), c[m] = c[m] ? c[m] + "," + w : w;
648
- }), t(h());
646
+ n.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(l, p, E) {
647
+ r.push(p = p.toLowerCase()), o.push([p, E]), c[p] = c[p] ? c[p] + "," + E : E;
648
+ }), t(v());
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
- }, Yt = Ht({ AsyncStorage: d, fetch: Wt, eventSource: qt });
653
- typeof window < "u" && (window.flagsmith = Yt), v.createFlagsmithInstance = function() {
654
- return Ht({ AsyncStorage: d, fetch: Wt, eventSource: qt });
655
- }, v.default = Yt, Object.defineProperty(v, "__esModule", { value: !0 });
652
+ }, Yt = Ht({ AsyncStorage: g, fetch: Wt, eventSource: qt });
653
+ typeof window < "u" && (window.flagsmith = Yt), h.createFlagsmithInstance = function() {
654
+ return Ht({ AsyncStorage: g, fetch: Wt, eventSource: qt });
655
+ }, h.default = Yt, Object.defineProperty(h, "__esModule", { value: !0 });
656
656
  });
657
657
  })(Gt, Gt.exports);
658
- var me = Gt.exports, se = {
658
+ var me = Gt.exports, Se = {
659
659
  NOT_INITIALIZED: "FeatureFlag not initialized. Call init() first.",
660
660
  INVALID_CONFIG: "Invalid Flagsmith configuration",
661
661
  FETCH_FAILED: "Failed to fetch Flagsmith configuration",
662
662
  NO_USER_CONTEXT: "User context not set. Call setUser() first.",
663
663
  ALREADY_INITIALIZED: "FeatureFlag is already initialized."
664
- }, oe = "business", J, Se = (J = class {
664
+ }, oe = "business", V, be = (V = class {
665
665
  constructor() {
666
- ht(this, "flagsmithClient", null);
667
- ht(this, "userContext", null);
666
+ ct(this, "flagsmithClient", null);
667
+ ct(this, "userContext", null);
668
668
  }
669
669
  static getInstance() {
670
- return J.instance || (J.instance = new J()), J.instance;
670
+ return V.instance || (V.instance = new V()), V.instance;
671
671
  }
672
672
  ensureInitialized() {
673
673
  if (!this.flagsmithClient)
674
- throw new Error(se.NOT_INITIALIZED);
674
+ throw new Error(Se.NOT_INITIALIZED);
675
675
  }
676
- async init(l, v = []) {
676
+ async init(u, h = []) {
677
677
  if (!this.flagsmithClient)
678
678
  try {
679
679
  this.flagsmithClient = me.createFlagsmithInstance();
680
- const d = v.reduce((o, x) => (o[x.feature.name] = x, o), {});
680
+ const g = h.reduce((s, F) => (s[F.feature.name] = F, s), {});
681
681
  await this.flagsmithClient.init({
682
- environmentID: l.apiKey,
683
- api: (l == null ? void 0 : l.url) ?? "https://flag.feedme.farm/api/v1/",
684
- enableAnalytics: (l == null ? void 0 : l.enableAnalytics) ?? !0,
685
- defaultFlags: d,
686
- cacheFlags: (l == null ? void 0 : l.cacheFlags) ?? !0
682
+ environmentID: u.apiKey,
683
+ api: (u == null ? void 0 : u.url) ?? "https://feature-flag-proxy.feedme.farm/api/v1/",
684
+ enableAnalytics: (u == null ? void 0 : u.enableAnalytics) ?? !0,
685
+ defaultFlags: g,
686
+ cacheFlags: (u == null ? void 0 : u.cacheFlags) ?? !0
687
687
  });
688
- } catch (d) {
689
- throw console.error("Failed to initialize FeatureFlag:", d), d;
688
+ } catch (g) {
689
+ throw console.error("Failed to initialize FeatureFlag:", g), g;
690
690
  }
691
691
  }
692
- async setUser(l, v) {
693
- this.ensureInitialized(), this.userContext = { identifier: l, traits: v }, await this.updateContext();
694
- }
695
- async addTraits(l) {
696
- if (this.ensureInitialized(), !this.userContext)
697
- throw new Error(se.NO_USER_CONTEXT);
698
- this.userContext.traits = { ...this.userContext.traits, ...l }, await this.updateContext();
692
+ async setUser(u) {
693
+ this.ensureInitialized(), this.userContext = { identifier: u }, await this.updateContext();
699
694
  }
700
695
  async updateContext() {
701
696
  try {
702
697
  if (!this.userContext) return;
703
698
  await this.flagsmithClient.setContext({
704
699
  identity: {
705
- identifier: this.userContext.identifier,
706
- traits: this.userContext.traits || {}
700
+ identifier: this.userContext.identifier
707
701
  }
708
702
  });
709
- } catch (l) {
710
- throw console.error("Failed to update user context:", l), l;
703
+ } catch (u) {
704
+ throw console.error("Failed to update user context:", u), u;
711
705
  }
712
706
  }
713
707
  async getFlags() {
714
708
  this.ensureInitialized();
715
- const l = this.flagsmithClient.getAllFlags();
716
- return Object.entries(l).map(([v, d]) => {
717
- var o;
709
+ const u = this.flagsmithClient.getAllFlags();
710
+ return Object.entries(u).map(([h, g]) => {
711
+ var s;
718
712
  return {
719
713
  feature: {
720
- name: v,
721
- id: (d == null ? void 0 : d.id) ?? 0
714
+ name: h,
715
+ id: (g == null ? void 0 : g.id) ?? 0
722
716
  },
723
- enabled: d.enabled,
724
- value: ((o = d.value) == null ? void 0 : o.toString()) ?? null
717
+ enabled: g.enabled,
718
+ value: ((s = g.value) == null ? void 0 : s.toString()) ?? null
725
719
  };
726
720
  });
727
721
  }
728
- getFlagValue(l, v) {
722
+ getFlagValue(u, h) {
729
723
  this.ensureInitialized();
730
- const d = this.flagsmithClient.getValue(l);
731
- if (d == null)
724
+ const g = this.flagsmithClient.getValue(u);
725
+ if (g == null)
732
726
  return null;
733
727
  try {
734
- const o = d.toString();
735
- return v ? v(o) : typeof {} == "number" ? isNaN(Number(o)) ? null : Number(o) : typeof {} == "boolean" ? o.toLowerCase() === "true" : o;
736
- } catch (o) {
737
- return console.error("Error transforming flag value:", o), null;
728
+ const s = g.toString();
729
+ return h ? h(s) : typeof {} == "number" ? isNaN(Number(s)) ? null : Number(s) : typeof {} == "boolean" ? s.toLowerCase() === "true" : s;
730
+ } catch (s) {
731
+ return console.error("Error transforming flag value:", s), null;
738
732
  }
739
733
  }
740
- getFlag(l) {
734
+ getFlag(u) {
741
735
  this.ensureInitialized();
742
- const v = this.flagsmithClient.getValue(l);
743
- if (v == null) return null;
744
- const d = this.flagsmithClient.hasFeature(l);
736
+ const h = this.flagsmithClient.getValue(u);
737
+ if (h == null) return null;
738
+ const g = this.flagsmithClient.hasFeature(u);
745
739
  return {
746
740
  feature: {
747
- name: l,
741
+ name: u,
748
742
  id: 0
749
743
  },
750
- enabled: d,
751
- value: v.toString()
744
+ enabled: g,
745
+ value: h.toString()
752
746
  };
753
747
  }
754
- async getUserFlagValue(l, v, d = null, o) {
755
- var M;
756
- const x = this.userContext;
748
+ async getUserFlagValue(u, h, g = null, s) {
749
+ var J;
750
+ const F = this.userContext;
757
751
  try {
758
- return await this.setUser(l), this.getFlagValue(v, o) ?? d;
759
- } catch (L) {
760
- return console.error(`Error getting user flag value for ${v}:`, L), d;
752
+ return await this.setUser(u), this.getFlagValue(h, s) ?? g;
753
+ } catch (I) {
754
+ return console.error(`Error getting user flag value for ${h}:`, I), g;
761
755
  } finally {
762
756
  try {
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);
757
+ await ((J = this.flagsmithClient) == null ? void 0 : J.logout()), this.userContext = null, F && await this.setUser(F.identifier);
758
+ } catch (I) {
759
+ console.error("Error during cleanup:", I);
766
760
  }
767
761
  }
768
762
  }
769
763
  reset() {
770
764
  this.flagsmithClient = null, this.userContext = null;
771
765
  }
772
- }, ht(J, "instance"), J), be = Se.getInstance(), st = gt(!1), ot = gt([]), X = gt(null);
773
- function Ce(p = be) {
774
- const l = () => st.value ? !0 : (console.warn("FeatureFlag is not initialized. Using default values."), !1), v = async (g, y = []) => {
766
+ }, ct(V, "instance"), V), _e = be.getInstance(), st = dt(!1), gt = dt([]), tt = dt(null);
767
+ function Ce(m = _e) {
768
+ const u = () => st.value ? !0 : (console.warn("FeatureFlag is not initialized. Using default values."), !1), h = async (d, S = []) => {
775
769
  if (st.value) {
776
770
  console.warn("FeatureFlag is already initialized.");
777
771
  return;
778
772
  }
779
773
  try {
780
- await p.init(g, y), ot.value = await p.getFlags(), st.value = !0, X.value = null;
781
- } catch (C) {
782
- console.error("Failed to initialize feature flags:", C), X.value = C;
774
+ await m.init(d, S), gt.value = await m.getFlags(), st.value = !0, tt.value = null;
775
+ } catch (_) {
776
+ console.error("Failed to initialize feature flags:", _), tt.value = _;
783
777
  }
784
- }, d = async (g, y) => {
785
- if (l())
786
- try {
787
- await p.setUser(g, y), ot.value = await p.getFlags(), X.value = null;
788
- } catch (C) {
789
- console.error("Failed to set user:", C), X.value = C;
790
- }
791
- }, o = async (g, y) => d(`${oe}-${g}`, y), x = async (g) => {
792
- if (l())
778
+ }, g = async (d) => {
779
+ if (u())
793
780
  try {
794
- await p.addTraits(g), ot.value = await p.getFlags(), X.value = null;
795
- } catch (y) {
796
- console.error("Failed to add traits:", y), X.value = y;
781
+ await m.setUser(d), gt.value = await m.getFlags(), tt.value = null;
782
+ } catch (S) {
783
+ console.error("Failed to set user:", S), tt.value = S;
797
784
  }
798
- }, M = (g, y, C = null) => {
799
- if (!l()) return C;
785
+ }, s = async (d) => g(`${oe}-${d}`), F = (d, S, _ = null) => {
786
+ if (!u()) return _;
800
787
  try {
801
- return p.getFlagValue(g, y) ?? C;
802
- } catch (R) {
803
- return console.error(`Error getting flag value for ${g}:`, R), C;
788
+ return m.getFlagValue(d, S) ?? _;
789
+ } catch (N) {
790
+ return console.error(`Error getting flag value for ${d}:`, N), _;
804
791
  }
805
- }, L = (g, y) => {
806
- if (!l()) return y ?? null;
792
+ }, J = (d, S) => {
793
+ if (!u()) return S ?? null;
807
794
  try {
808
- return p.getFlag(g) ?? y ?? null;
809
- } catch (C) {
810
- return console.error(`Error getting flag for ${g}:`, C), y ?? null;
795
+ return m.getFlag(d) ?? S ?? null;
796
+ } catch (_) {
797
+ return console.error(`Error getting flag for ${d}:`, _), S ?? null;
811
798
  }
812
- }, W = async (g, y, C = null, R) => {
813
- if (!l()) return C;
799
+ }, I = async (d, S, _ = null, N) => {
800
+ if (!u()) return _;
814
801
  try {
815
- return await p.getUserFlagValue(g, y, C, R);
816
- } catch (z) {
817
- return console.error(`Error getting user flag value for ${y}:`, z), C;
802
+ return await m.getUserFlagValue(d, S, _, N);
803
+ } catch (H) {
804
+ return console.error(`Error getting user flag value for ${S}:`, H), _;
818
805
  }
819
- }, _ = async (g, y, C = null, R) => W(`${oe}-${g}`, y, C, R), F = () => {
806
+ }, nt = async (d, S, _ = null, N) => I(`${oe}-${d}`, S, _, N), C = () => {
820
807
  try {
821
- p.reset();
822
- } catch (g) {
823
- console.error("Error resetting feature flags:", g);
808
+ m.reset();
809
+ } catch (d) {
810
+ console.error("Error resetting feature flags:", d);
824
811
  } finally {
825
- ot.value = [], st.value = !1, X.value = null;
812
+ gt.value = [], st.value = !1, tt.value = null;
826
813
  }
827
814
  };
828
815
  return {
829
- flags: Kt(ot),
816
+ flags: Kt(gt),
830
817
  isInitialized: Kt(st),
831
- error: Kt(X),
832
- init: v,
833
- setUser: d,
834
- setBusiness: o,
835
- addTraits: x,
836
- getFlagValue: M,
837
- getFlag: L,
838
- getUserFlagValue: W,
839
- getBusinessFlagValue: _,
840
- reset: F
818
+ error: Kt(tt),
819
+ init: h,
820
+ setUser: g,
821
+ setBusiness: s,
822
+ getFlagValue: F,
823
+ getFlag: J,
824
+ getUserFlagValue: I,
825
+ getBusinessFlagValue: nt,
826
+ reset: C
841
827
  };
842
828
  }
843
829
  var Vt = () => Ce();
844
- const _e = /* @__PURE__ */ new Set([
830
+ const xe = /* @__PURE__ */ new Set([
845
831
  // vivo pizza prod
846
832
  "business_6687e91fa7240b001ba3f4c2",
847
833
  // vivo dev
848
834
  "business_669a1d2efc050a001cfbb5a2"
849
- ]), xe = /* @__PURE__ */ new Set([
835
+ ]), Fe = /* @__PURE__ */ new Set([
850
836
  // vivo pizza prod
851
837
  "business_6687e91fa7240b001ba3f4c2",
852
838
  // vivo dev
@@ -855,17 +841,17 @@ const _e = /* @__PURE__ */ new Set([
855
841
  "business_655b25254fe3be001b123f0b",
856
842
  // King Menu V4
857
843
  "business_646ee00ebffa92001b84c4c7"
858
- ]), le = /* @__PURE__ */ new Set([
844
+ ]), se = /* @__PURE__ */ new Set([
859
845
  // zus dev
860
846
  "business_671005de24a7f4001c87e25e",
861
847
  // zus prod
862
848
  "business_6776a1fe205a52001c516efa"
863
- ]), Ee = /* @__PURE__ */ new Set([
849
+ ]), le = /* @__PURE__ */ new Set([
864
850
  // zus dev
865
851
  "business_671005de24a7f4001c87e25e",
866
852
  // zus prod
867
853
  "business_6776a1fe205a52001c516efa"
868
- ]), Fe = /* @__PURE__ */ new Set([
854
+ ]), Ee = /* @__PURE__ */ new Set([
869
855
  // zus dev
870
856
  "business_671005de24a7f4001c87e25e",
871
857
  // zus prod
@@ -888,128 +874,136 @@ function ue() {
888
874
  enablePoOperateV2: !1
889
875
  };
890
876
  }
891
- const E = gt(ue()), Le = () => ({
877
+ const x = dt(ue()), Te = () => ({
892
878
  get businessDbName() {
893
- var v;
894
- return `business_${((v = vt().currentBusiness.value) == null ? void 0 : v._id) ?? ""}`;
879
+ var h;
880
+ return `business_${((h = vt().currentBusiness.value) == null ? void 0 : h._id) ?? ""}`;
895
881
  },
896
882
  get isWarehouse() {
897
- var l;
898
- return ((l = Dt()._currentLocation) == null ? void 0 : l.type) === re.enum.warehouse;
883
+ var u;
884
+ return ((u = Dt()._currentLocation) == null ? void 0 : u.type) === re.enum.warehouse;
899
885
  },
900
886
  get restaurantPosVersion() {
901
- var v;
902
- const p = Dt();
903
- return (v = vt().restaurants.value.find(
904
- (d) => {
905
- var o;
906
- return d._id === ((o = p._currentLocation) == null ? void 0 : o.doc._id);
887
+ var h;
888
+ const m = Dt();
889
+ return (h = vt().restaurants.value.find(
890
+ (g) => {
891
+ var s;
892
+ return g._id === ((s = m._currentLocation) == null ? void 0 : s.doc._id);
907
893
  }
908
- )) == null ? void 0 : v.posVersion;
894
+ )) == null ? void 0 : h.posVersion;
909
895
  },
910
896
  get enableTotalCost() {
911
- return E.value.enableTotalCost;
897
+ return x.value.enableTotalCost;
912
898
  },
913
899
  get enableBackdatePo() {
914
- return E.value.enableBackdatePo;
900
+ return x.value.enableBackdatePo;
915
901
  },
916
902
  /** @deprecated TODO: remove */
917
903
  get autoReceiveWarehouse() {
918
- return E.value.autoReceiveWarehouse;
904
+ return x.value.autoReceiveWarehouse;
919
905
  },
920
906
  /** @deprecated TODO: remove */
921
907
  get manualReceive() {
922
- return E.value.manualReceive;
908
+ return x.value.manualReceive;
923
909
  },
924
910
  get enablePoTemplate() {
925
- return E.value.enablePoTemplate;
911
+ return x.value.enablePoTemplate;
926
912
  },
927
913
  get enableClosingTemplate() {
928
- return E.value.enableClosingTemplate;
914
+ return x.value.enableClosingTemplate;
929
915
  },
930
916
  get enableWastageTemplate() {
931
- return E.value.enableWastageTemplate;
917
+ return x.value.enableWastageTemplate;
932
918
  },
933
919
  get enableIngredientGroup() {
934
- return E.value.enableIngredientGroup;
920
+ return x.value.enableIngredientGroup;
935
921
  },
936
922
  get mustUsePoTemplate() {
937
- return E.value.mustUsePoTemplate;
923
+ return x.value.mustUsePoTemplate;
938
924
  },
939
925
  get enableSupplierMasterList() {
940
- return E.value.enableSupplierMasterList;
926
+ return x.value.enableSupplierMasterList;
941
927
  },
942
928
  get businessSupplierOnly() {
943
- return E.value.businessSupplierOnly;
929
+ return x.value.businessSupplierOnly;
944
930
  },
945
931
  get enableXilnexTransferNote() {
946
- return E.value.enableXilnexTransferNote;
932
+ return x.value.enableXilnexTransferNote;
947
933
  },
948
934
  get enablePoOperateV2() {
949
- return E.value.enablePoOperateV2;
935
+ return x.value.enablePoOperateV2;
950
936
  },
951
937
  async init() {
952
- const p = vt(), { init: l, setUser: v } = Vt(), d = p.namespace.value === "prod";
953
- await l({
954
- apiKey: d ? "6GhcttsJ9Rj9cTevcdrpin" : "MaGoXrEWuEJNpWgKTqseee"
938
+ const m = vt(), { init: u, setUser: h } = Vt(), g = m.namespace.value === "prod";
939
+ await u({
940
+ apiKey: g ? "6GhcttsJ9Rj9cTevcdrpin" : "MaGoXrEWuEJNpWgKTqseee"
955
941
  // url: 'https://flag.feedme.farm/api/v1/', // optional -> this is a default URL value
956
942
  // enableAnalytics: true, // optional, defaults to true
957
943
  // cacheFlags: true // optional, defaults to true
958
- }), Dt().watchLocation(async (x) => {
959
- var R, z, Y;
960
- if (!x) {
961
- E.value = ue();
944
+ }), Dt().watchLocation(async (F) => {
945
+ var H, X, q;
946
+ if (!F) {
947
+ x.value = ue();
962
948
  return;
963
949
  }
964
- await v(x.doc._id);
965
- const M = ye(), L = vt(), _ = `business_${((R = L.currentBusiness.value) == null ? void 0 : R._id) ?? ""}`, F = x.type === re.enum.warehouse, g = (
950
+ await h(F.doc._id);
951
+ const J = ye(), I = vt(), C = `business_${((H = I.currentBusiness.value) == null ? void 0 : H._id) ?? ""}`, d = F.type === re.enum.warehouse, S = (
966
952
  // if menu v4, must manual receive && must use outlet app
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
953
+ ((X = I.currentBusiness.value) == null ? void 0 : X.menuVersion) === "v4" && // more guard for businesses using menu v4, only those listed for manual receive will be included
968
954
  // TODO: may be removed to use menu version only
969
- _e.has(this.businessDbName)
970
- ), y = le.has(_) || lt(
955
+ xe.has(this.businessDbName)
956
+ ), _ = se.has(C) || et(
971
957
  "inventory_portal_must_use_transfer_template"
972
958
  /* inventory_portal_must_use_transfer_template */
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",
976
- enableBackdatePo: C,
977
- autoReceiveWarehouse: F && !g,
978
- manualReceive: g,
979
- enablePoTemplate: y,
980
- enableClosingTemplate: Ee.has(_) && lt(
959
+ );
960
+ console.log(
961
+ le.has(C),
962
+ et(
963
+ "inventory_pos_closing_v2"
964
+ /* inventory_pos_closing_v2 */
965
+ )
966
+ );
967
+ const N = Fe.has(this.businessDbName) && (this.isWarehouse || J.state.closing !== null);
968
+ x.value = {
969
+ enableTotalCost: ((q = I.currentBusiness.value) == null ? void 0 : q.menuVersion) === "v4",
970
+ enableBackdatePo: N,
971
+ autoReceiveWarehouse: d && !S,
972
+ manualReceive: S,
973
+ enablePoTemplate: _,
974
+ enableClosingTemplate: le.has(C) || et(
981
975
  "inventory_pos_closing_v2"
982
976
  /* inventory_pos_closing_v2 */
983
977
  ),
984
- enableWastageTemplate: Fe.has(_) && lt(
978
+ enableWastageTemplate: Ee.has(C) && et(
985
979
  "inventory_pos_adjust_v2_wastage"
986
980
  /* inventory_pos_adjust_v2_wastage */
987
981
  ),
988
982
  enableIngredientGroup: !1,
989
- mustUsePoTemplate: y,
990
- businessSupplierOnly: y,
991
- enableSupplierMasterList: le.has(_),
992
- enableXilnexTransferNote: lt(
983
+ mustUsePoTemplate: _,
984
+ businessSupplierOnly: _,
985
+ enableSupplierMasterList: se.has(C),
986
+ enableXilnexTransferNote: et(
993
987
  "inventory_portal_xilnex_transfer_note"
994
988
  /* inventory_portal_xilnex_transfer_note */
995
989
  ),
996
- enablePoOperateV2: lt(
990
+ enablePoOperateV2: et(
997
991
  "inventory_portal_po_operate_v2"
998
992
  /* inventory_portal_po_operate_v2 */
999
993
  )
1000
994
  };
1001
995
  }, "feature");
1002
996
  },
1003
- async setUser(p) {
1004
- const { setUser: l } = Vt();
1005
- await l(p.doc._id);
997
+ async setUser(m) {
998
+ const { setUser: u } = Vt();
999
+ await u(m.doc._id);
1006
1000
  }
1007
1001
  });
1008
- function lt(p, l) {
1009
- l = l === void 0 ? null : l;
1010
- const { getFlagValue: v } = Vt();
1011
- return v(p, (d) => d === "true") ?? l;
1002
+ function et(m, u) {
1003
+ u = u === void 0 ? null : u;
1004
+ const { getFlagValue: h } = Vt();
1005
+ return h(m, (g) => (m === "inventory_pos_closing_v2" && console.log(g, typeof g), g === "true")) ?? u;
1012
1006
  }
1013
1007
  export {
1014
- Le as u
1008
+ Te as u
1015
1009
  };