@feedmepos/mf-report 5.22.8 → 5.22.10
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-D7cjotni.js → App-BZyVuyG5.js} +5 -5
- package/dist/{BaseDialog.vue_vue_type_script_setup_true_lang-498jR5eR.js → BaseDialog.vue_vue_type_script_setup_true_lang-5_-2t_C6.js} +3 -3
- package/dist/{DateRangeSelect.vue_vue_type_script_setup_true_lang-DDKp9kfF.js → DateRangeSelect.vue_vue_type_script_setup_true_lang-C8r-uiGo.js} +2 -2
- package/dist/{Default.vue_vue_type_script_setup_true_lang-Br99yDiJ.js → Default.vue_vue_type_script_setup_true_lang-C1p1ivTM.js} +2 -2
- package/dist/{FilterSelector.vue_vue_type_script_setup_true_lang-B0qBdHAf.js → FilterSelector.vue_vue_type_script_setup_true_lang-BEc-zVFt.js} +6 -6
- package/dist/{InsightView-BcA59RGK.js → InsightView-nHNpcMG5.js} +6 -6
- package/dist/Integration-Bp69QKo2.js +7196 -0
- package/dist/{Integrations-B_tBGNMa.js → Integrations-CCmc1w4g.js} +239 -173
- package/dist/{Layout-IsoY4xGs.js → Layout-BgHGGQqs.js} +1 -1
- package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-DwA86Ges.js → MenuTab.vue_vue_type_script_setup_true_lang-Dw8rFazr.js} +5 -5
- package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-uwUXuTFd.js → NavigationTab.vue_vue_type_script_setup_true_lang-Vbz3Y3D7.js} +5 -5
- package/dist/{NoData.vue_vue_type_script_setup_true_lang-BWqYdFid.js → NoData.vue_vue_type_script_setup_true_lang-B_9FoeId.js} +1 -1
- package/dist/{OverviewView-CiotUyZ8.js → OverviewView-CFOB8P_I.js} +5 -5
- package/dist/{Report-FMWzysFR.js → Report-DXNktP_o.js} +4 -4
- package/dist/{ReportEditor-GUESqAT3.js → ReportEditor-Dmn-ARx9.js} +6 -6
- package/dist/{ReportView-D4AOGBsk.js → ReportView-Dj_kaBwu.js} +8 -8
- package/dist/{SelectComponent.vue_vue_type_script_setup_true_lang-czUiQdNp.js → SelectComponent.vue_vue_type_script_setup_true_lang-DCnW5kSR.js} +1 -1
- package/dist/{Setting--RhZ6vYw.js → Setting-Bq_Y_njK.js} +5 -5
- package/dist/{TileEditor-BgBhNQfP.js → TileEditor-ChUIEs1W.js} +8 -8
- package/dist/{TransitionFade-CwHy5HRj.js → TransitionFade-DgPPOAKT.js} +6 -6
- package/dist/{app-CxLB9i84.js → app-yofEsI_0.js} +81 -48
- package/dist/app.js +1 -1
- package/dist/style.css +1 -1
- package/dist/useRestaurantPermission-R6V-93ZN.js +1240 -0
- package/dist/{vue-i18n-CtuwQWnL.js → vue-i18n-Bv_lm6ws.js} +1 -1
- package/package.json +4 -2
- package/dist/Integration-Q89tPGWi.js +0 -7004
|
@@ -0,0 +1,1240 @@
|
|
|
1
|
+
import { computed as je } from "vue";
|
|
2
|
+
import { u as Oe } from "./vue-i18n-Bv_lm6ws.js";
|
|
3
|
+
import { useSnackbar as Re } from "@feedmepos/ui-library";
|
|
4
|
+
import { useCoreStore as Te } from "@feedmepos/mf-common";
|
|
5
|
+
import { g as we, c as $e } from "./app-yofEsI_0.js";
|
|
6
|
+
var se = { exports: {} };
|
|
7
|
+
(function(e, u) {
|
|
8
|
+
(function(l, i) {
|
|
9
|
+
e.exports = i();
|
|
10
|
+
})($e, function() {
|
|
11
|
+
return function(l) {
|
|
12
|
+
var i = {};
|
|
13
|
+
function o(s) {
|
|
14
|
+
if (i[s]) return i[s].exports;
|
|
15
|
+
var p = i[s] = { i: s, l: !1, exports: {} };
|
|
16
|
+
return l[s].call(p.exports, p, p.exports, o), p.l = !0, p.exports;
|
|
17
|
+
}
|
|
18
|
+
return o.m = l, o.c = i, o.d = function(s, p, d) {
|
|
19
|
+
o.o(s, p) || Object.defineProperty(s, p, { enumerable: !0, get: d });
|
|
20
|
+
}, o.r = function(s) {
|
|
21
|
+
typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(s, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(s, "__esModule", { value: !0 });
|
|
22
|
+
}, o.t = function(s, p) {
|
|
23
|
+
if (1 & p && (s = o(s)), 8 & p || 4 & p && typeof s == "object" && s && s.__esModule) return s;
|
|
24
|
+
var d = /* @__PURE__ */ Object.create(null);
|
|
25
|
+
if (o.r(d), Object.defineProperty(d, "default", { enumerable: !0, value: s }), 2 & p && typeof s != "string")
|
|
26
|
+
for (var j in s)
|
|
27
|
+
o.d(
|
|
28
|
+
d,
|
|
29
|
+
j,
|
|
30
|
+
(function(O) {
|
|
31
|
+
return s[O];
|
|
32
|
+
}).bind(null, j)
|
|
33
|
+
);
|
|
34
|
+
return d;
|
|
35
|
+
}, o.n = function(s) {
|
|
36
|
+
var p = s && s.__esModule ? function() {
|
|
37
|
+
return s.default;
|
|
38
|
+
} : function() {
|
|
39
|
+
return s;
|
|
40
|
+
};
|
|
41
|
+
return o.d(p, "a", p), p;
|
|
42
|
+
}, o.o = function(s, p) {
|
|
43
|
+
return Object.prototype.hasOwnProperty.call(s, p);
|
|
44
|
+
}, o.p = "", o(o.s = 0);
|
|
45
|
+
}([
|
|
46
|
+
function(l, i, o) {
|
|
47
|
+
l.exports = o(1);
|
|
48
|
+
},
|
|
49
|
+
function(l, i, o) {
|
|
50
|
+
function s(t) {
|
|
51
|
+
return (s = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(r) {
|
|
52
|
+
return typeof r;
|
|
53
|
+
} : function(r) {
|
|
54
|
+
return r && typeof Symbol == "function" && r.constructor === Symbol && r !== Symbol.prototype ? "symbol" : typeof r;
|
|
55
|
+
})(t);
|
|
56
|
+
}
|
|
57
|
+
function p(t) {
|
|
58
|
+
var r = "[object " + t + "]";
|
|
59
|
+
return function(a) {
|
|
60
|
+
return Object.prototype.toString.call(a) === r;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
o.r(i), o.d(i, "default", function() {
|
|
64
|
+
return he;
|
|
65
|
+
}), o.d(i, "compare", function() {
|
|
66
|
+
return ee;
|
|
67
|
+
}), o.d(i, "comparable", function() {
|
|
68
|
+
return z;
|
|
69
|
+
});
|
|
70
|
+
var d = p("Array"), j = p("Object"), O = p("Function");
|
|
71
|
+
function T(t, r) {
|
|
72
|
+
return O(t.get) ? t.get(r) : t[r];
|
|
73
|
+
}
|
|
74
|
+
function w(t) {
|
|
75
|
+
return function(r, a) {
|
|
76
|
+
if (!d(a) || !a.length) return t(r, a);
|
|
77
|
+
for (var f = 0, y = a.length; f < y; f++)
|
|
78
|
+
if (t(r, T(a, f))) return !0;
|
|
79
|
+
return !1;
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
function N(t) {
|
|
83
|
+
return function(r, a) {
|
|
84
|
+
if (!d(a) || !a.length) return t(r, a);
|
|
85
|
+
for (var f = 0, y = a.length; f < y; f++)
|
|
86
|
+
if (!t(r, T(a, f))) return !1;
|
|
87
|
+
return !0;
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function $(t, r, a, f) {
|
|
91
|
+
return t.validate(t.options, r, a, f);
|
|
92
|
+
}
|
|
93
|
+
var S = {
|
|
94
|
+
$eq: w(function(t, r) {
|
|
95
|
+
return t(r);
|
|
96
|
+
}),
|
|
97
|
+
$ne: N(function(t, r) {
|
|
98
|
+
return t(r);
|
|
99
|
+
}),
|
|
100
|
+
$gt: w(function(t, r) {
|
|
101
|
+
return t(r);
|
|
102
|
+
}),
|
|
103
|
+
$gte: w(function(t, r) {
|
|
104
|
+
return t(r);
|
|
105
|
+
}),
|
|
106
|
+
$lt: w(function(t, r) {
|
|
107
|
+
return t(r);
|
|
108
|
+
}),
|
|
109
|
+
$lte: w(function(t, r) {
|
|
110
|
+
return t(r);
|
|
111
|
+
}),
|
|
112
|
+
$mod: w(function(t, r) {
|
|
113
|
+
return t(r);
|
|
114
|
+
}),
|
|
115
|
+
$in: function(t, r) {
|
|
116
|
+
return t(r);
|
|
117
|
+
},
|
|
118
|
+
$nin: function(t, r) {
|
|
119
|
+
return t(r);
|
|
120
|
+
},
|
|
121
|
+
$not: function(t, r, a, f) {
|
|
122
|
+
return t(r, a, f);
|
|
123
|
+
},
|
|
124
|
+
$type: function(t, r) {
|
|
125
|
+
return t(r);
|
|
126
|
+
},
|
|
127
|
+
$all: function(t, r, a, f) {
|
|
128
|
+
return S.$and(t, r, a, f);
|
|
129
|
+
},
|
|
130
|
+
$size: function(t, r) {
|
|
131
|
+
return !!r && t === r.length;
|
|
132
|
+
},
|
|
133
|
+
$or: function(t, r, a, f) {
|
|
134
|
+
for (var y = 0, m = t.length; y < m; y++)
|
|
135
|
+
if ($(T(t, y), r, a, f)) return !0;
|
|
136
|
+
return !1;
|
|
137
|
+
},
|
|
138
|
+
$nor: function(t, r, a, f) {
|
|
139
|
+
return !S.$or(t, r, a, f);
|
|
140
|
+
},
|
|
141
|
+
$and: function(t, r, a, f) {
|
|
142
|
+
for (var y = 0, m = t.length; y < m; y++)
|
|
143
|
+
if (!$(T(t, y), r, a, f)) return !1;
|
|
144
|
+
return !0;
|
|
145
|
+
},
|
|
146
|
+
$regex: w(function(t, r) {
|
|
147
|
+
return typeof r == "string" && t.test(r);
|
|
148
|
+
}),
|
|
149
|
+
$where: function(t, r, a, f) {
|
|
150
|
+
return t.call(r, r, a, f);
|
|
151
|
+
},
|
|
152
|
+
$elemMatch: function(t, r, a, f) {
|
|
153
|
+
return d(r) ? !!~function(y, m) {
|
|
154
|
+
for (var b = 0; b < y.length; b++)
|
|
155
|
+
if (T(y, b), $(m, T(y, b))) return b;
|
|
156
|
+
return -1;
|
|
157
|
+
}(r, t) : $(t, r, a, f);
|
|
158
|
+
},
|
|
159
|
+
$exists: function(t, r, a, f) {
|
|
160
|
+
return f.hasOwnProperty(a) === t;
|
|
161
|
+
}
|
|
162
|
+
}, P = {
|
|
163
|
+
$eq: function(t, r, a) {
|
|
164
|
+
var f = a.comparable, y = a.compare;
|
|
165
|
+
return t instanceof RegExp ? w(function(m) {
|
|
166
|
+
return typeof m == "string" && t.test(m);
|
|
167
|
+
}) : t instanceof Function ? w(t) : d(t) && !t.length ? w(function(m) {
|
|
168
|
+
return d(m) && !m.length;
|
|
169
|
+
}) : w(
|
|
170
|
+
t === null ? function(m) {
|
|
171
|
+
return m == null;
|
|
172
|
+
} : function(m) {
|
|
173
|
+
return y(f(m), f(t)) === 0;
|
|
174
|
+
}
|
|
175
|
+
);
|
|
176
|
+
},
|
|
177
|
+
$gt: function(t, r, a) {
|
|
178
|
+
var f = a.comparable, y = a.compare;
|
|
179
|
+
return function(m) {
|
|
180
|
+
return y(f(m), f(t)) > 0;
|
|
181
|
+
};
|
|
182
|
+
},
|
|
183
|
+
$gte: function(t, r, a) {
|
|
184
|
+
var f = a.comparable, y = a.compare;
|
|
185
|
+
return function(m) {
|
|
186
|
+
return y(f(m), f(t)) >= 0;
|
|
187
|
+
};
|
|
188
|
+
},
|
|
189
|
+
$lt: function(t, r, a) {
|
|
190
|
+
var f = a.comparable, y = a.compare;
|
|
191
|
+
return function(m) {
|
|
192
|
+
return y(f(m), f(t)) < 0;
|
|
193
|
+
};
|
|
194
|
+
},
|
|
195
|
+
$lte: function(t, r, a) {
|
|
196
|
+
var f = a.comparable, y = a.compare;
|
|
197
|
+
return function(m) {
|
|
198
|
+
return y(f(m), f(t)) <= 0;
|
|
199
|
+
};
|
|
200
|
+
},
|
|
201
|
+
$in: function(t, r, a) {
|
|
202
|
+
var f = a.comparable;
|
|
203
|
+
return function(y) {
|
|
204
|
+
if (!(y instanceof Array)) {
|
|
205
|
+
var m = f(y);
|
|
206
|
+
if (m === y && s(y) === "object") {
|
|
207
|
+
for (h = t.length; h--; )
|
|
208
|
+
if (String(t[h]) === String(y) && String(y) !== "[object Object]")
|
|
209
|
+
return !0;
|
|
210
|
+
}
|
|
211
|
+
if (m === void 0) {
|
|
212
|
+
for (h = t.length; h--; ) if (t[h] == null) return !0;
|
|
213
|
+
}
|
|
214
|
+
for (h = t.length; h--; ) {
|
|
215
|
+
var b = $(Z(T(t, h), a), m, h, t);
|
|
216
|
+
if (b && String(b) !== "[object Object]" && String(m) !== "[object Object]")
|
|
217
|
+
return !0;
|
|
218
|
+
}
|
|
219
|
+
return !!~t.indexOf(m);
|
|
220
|
+
}
|
|
221
|
+
for (var h = y.length; h--; )
|
|
222
|
+
if (~t.indexOf(f(T(y, h)))) return !0;
|
|
223
|
+
return !1;
|
|
224
|
+
};
|
|
225
|
+
},
|
|
226
|
+
$nin: function(t, r, a) {
|
|
227
|
+
var f = P.$in(t, r, a);
|
|
228
|
+
return function(y, m, b, h) {
|
|
229
|
+
return !f(y, m, b, h);
|
|
230
|
+
};
|
|
231
|
+
},
|
|
232
|
+
$mod: function(t) {
|
|
233
|
+
return function(r) {
|
|
234
|
+
return r % t[0] == t[1];
|
|
235
|
+
};
|
|
236
|
+
},
|
|
237
|
+
$ne: function(t, r, a) {
|
|
238
|
+
var f = P.$eq(t, r, a);
|
|
239
|
+
return N(function(y, m, b, h) {
|
|
240
|
+
return !f(y, m, b, h);
|
|
241
|
+
});
|
|
242
|
+
},
|
|
243
|
+
$and: function(t, r, a) {
|
|
244
|
+
return t.map(F(a));
|
|
245
|
+
},
|
|
246
|
+
$all: function(t, r, a) {
|
|
247
|
+
return P.$and(t, r, a);
|
|
248
|
+
},
|
|
249
|
+
$or: function(t, r, a) {
|
|
250
|
+
return t.map(F(a));
|
|
251
|
+
},
|
|
252
|
+
$nor: function(t, r, a) {
|
|
253
|
+
return t.map(F(a));
|
|
254
|
+
},
|
|
255
|
+
$not: function(t, r, a) {
|
|
256
|
+
var f = F(a)(t);
|
|
257
|
+
return function(y, m, b) {
|
|
258
|
+
return !$(f, y, m, b);
|
|
259
|
+
};
|
|
260
|
+
},
|
|
261
|
+
$type: function(t) {
|
|
262
|
+
return function(r, a, f) {
|
|
263
|
+
return r != null && (r instanceof t || r.constructor == t);
|
|
264
|
+
};
|
|
265
|
+
},
|
|
266
|
+
$regex: function(t, r) {
|
|
267
|
+
return new RegExp(t, r.$options);
|
|
268
|
+
},
|
|
269
|
+
$where: function(t) {
|
|
270
|
+
if (typeof t == "function") return t;
|
|
271
|
+
throw new Error(
|
|
272
|
+
'In CSP mode, sift does not support strings in "$where" condition'
|
|
273
|
+
);
|
|
274
|
+
},
|
|
275
|
+
$elemMatch: function(t, r, a) {
|
|
276
|
+
return F(a)(t);
|
|
277
|
+
},
|
|
278
|
+
$exists: function(t) {
|
|
279
|
+
return !!t;
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
function D(t, r) {
|
|
283
|
+
return { options: t, validate: r };
|
|
284
|
+
}
|
|
285
|
+
function me(t, r) {
|
|
286
|
+
var a = t.keyPath, f = t.child, y = t.query, m = [];
|
|
287
|
+
if (function te(E, C, M, ge, B) {
|
|
288
|
+
if (M === C.length || E == null)
|
|
289
|
+
return void B.push([E, C[M - 1], ge]);
|
|
290
|
+
var ne = T(C, M);
|
|
291
|
+
if (d(E) && isNaN(Number(ne)))
|
|
292
|
+
for (var W = 0, _e = E.length; W < _e; W++) te(T(E, W), C, M, E, B);
|
|
293
|
+
else te(T(E, ne), C, M + 1, E, B);
|
|
294
|
+
}(r, a, 0, r, m), m.length === 1) {
|
|
295
|
+
var b = m[0];
|
|
296
|
+
return $(f, b[0], b[1], b[2]);
|
|
297
|
+
}
|
|
298
|
+
for (var h = y && y.$ne !== void 0, _ = h, k = 0; k < m.length; k++) {
|
|
299
|
+
var x = m[k], H = $(f, x[0], x[1], x[2]);
|
|
300
|
+
h ? _ &= H : _ |= H;
|
|
301
|
+
}
|
|
302
|
+
return _;
|
|
303
|
+
}
|
|
304
|
+
function be(t, r, a) {
|
|
305
|
+
return D({ keyPath: t, child: r, query: a }, me);
|
|
306
|
+
}
|
|
307
|
+
function F(t) {
|
|
308
|
+
var r = t.comparable, a = t.expressions, f = function(b) {
|
|
309
|
+
var h;
|
|
310
|
+
return (!b || !(h = b) || h.constructor !== Object && h.constructor !== Array && h.constructor.toString() !== "function Object() { [native code] }" && h.constructor.toString() !== "function Array() { [native code] }" || h.toJSON) && (b = { $eq: b }), b;
|
|
311
|
+
}, y = function(b) {
|
|
312
|
+
b = r(b);
|
|
313
|
+
var h = [];
|
|
314
|
+
for (var _ in b) {
|
|
315
|
+
var k = b[_];
|
|
316
|
+
if (_ !== "$options") {
|
|
317
|
+
var x = S[_] || t && a && a[_];
|
|
318
|
+
if (x) P[_] && (k = P[_](k, b, t)), h.push(D(r(k), x));
|
|
319
|
+
else {
|
|
320
|
+
if (_.charCodeAt(0) === 36)
|
|
321
|
+
throw new Error("Unknown operation " + _);
|
|
322
|
+
var H = _.split(".");
|
|
323
|
+
h.push(be(H, m(k), k));
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
return h.length === 1 ? h[0] : D(h, S.$and);
|
|
328
|
+
}, m = function(b) {
|
|
329
|
+
return b = f(b), function h(_, k) {
|
|
330
|
+
if (!j(_)) return k;
|
|
331
|
+
for (var x in _) k.push(x), h(_[x], k);
|
|
332
|
+
return k;
|
|
333
|
+
}(b, []).join(",").search(/[$.]/) === -1 ? D(b, U) : y(b);
|
|
334
|
+
};
|
|
335
|
+
return function(b) {
|
|
336
|
+
return y(f(b));
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
function U(t, r) {
|
|
340
|
+
if (Object.prototype.toString.call(t) !== Object.prototype.toString.call(r))
|
|
341
|
+
return !1;
|
|
342
|
+
if (j(t)) {
|
|
343
|
+
if (Object.keys(t).length !== Object.keys(r).length) return !1;
|
|
344
|
+
for (var a in t) if (!U(t[a], r[a])) return !1;
|
|
345
|
+
return !0;
|
|
346
|
+
}
|
|
347
|
+
if (d(t)) {
|
|
348
|
+
if (t.length !== r.length) return !1;
|
|
349
|
+
for (var f = 0, y = t.length; f < y; f++)
|
|
350
|
+
if (!U(t[f], r[f])) return !1;
|
|
351
|
+
return !0;
|
|
352
|
+
}
|
|
353
|
+
return t === r;
|
|
354
|
+
}
|
|
355
|
+
function Z(t, r) {
|
|
356
|
+
var a = F(r)(t);
|
|
357
|
+
return r && r.select && (a = {
|
|
358
|
+
options: a,
|
|
359
|
+
validate: function(f, y, m, b) {
|
|
360
|
+
return $(f, y && r.select(y), m, b);
|
|
361
|
+
}
|
|
362
|
+
}), a;
|
|
363
|
+
}
|
|
364
|
+
function he(t, r) {
|
|
365
|
+
var a = Z(t, r = Object.assign({ compare: ee, comparable: z }, r));
|
|
366
|
+
return function(f, y, m) {
|
|
367
|
+
return $(a, f, y, m);
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
function ee(t, r) {
|
|
371
|
+
if (U(t, r)) return 0;
|
|
372
|
+
if (s(t) === s(r)) {
|
|
373
|
+
if (t > r) return 1;
|
|
374
|
+
if (t < r) return -1;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
function z(t) {
|
|
378
|
+
return t instanceof Date ? t.getTime() : d(t) ? t.map(z) : t && typeof t.toJSON == "function" ? t.toJSON() : t;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
]);
|
|
382
|
+
});
|
|
383
|
+
})(se);
|
|
384
|
+
var ke = se.exports;
|
|
385
|
+
const Ae = /* @__PURE__ */ we(ke);
|
|
386
|
+
function Se(e, u) {
|
|
387
|
+
for (var l = 0; l < u.length; l++) {
|
|
388
|
+
var i = u[l];
|
|
389
|
+
i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, i.key, i);
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
function Pe(e, u, l) {
|
|
393
|
+
return u && Se(e.prototype, u), e;
|
|
394
|
+
}
|
|
395
|
+
function xe(e, u) {
|
|
396
|
+
e.prototype = Object.create(u.prototype), e.prototype.constructor = e, e.__proto__ = u;
|
|
397
|
+
}
|
|
398
|
+
function J(e) {
|
|
399
|
+
return J = Object.setPrototypeOf ? Object.getPrototypeOf : function(l) {
|
|
400
|
+
return l.__proto__ || Object.getPrototypeOf(l);
|
|
401
|
+
}, J(e);
|
|
402
|
+
}
|
|
403
|
+
function q(e, u) {
|
|
404
|
+
return q = Object.setPrototypeOf || function(i, o) {
|
|
405
|
+
return i.__proto__ = o, i;
|
|
406
|
+
}, q(e, u);
|
|
407
|
+
}
|
|
408
|
+
function De() {
|
|
409
|
+
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
|
|
410
|
+
if (typeof Proxy == "function") return !0;
|
|
411
|
+
try {
|
|
412
|
+
return Date.prototype.toString.call(Reflect.construct(Date, [], function() {
|
|
413
|
+
})), !0;
|
|
414
|
+
} catch {
|
|
415
|
+
return !1;
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
function L(e, u, l) {
|
|
419
|
+
return De() ? L = Reflect.construct : L = function(o, s, p) {
|
|
420
|
+
var d = [null];
|
|
421
|
+
d.push.apply(d, s);
|
|
422
|
+
var j = Function.bind.apply(o, d), O = new j();
|
|
423
|
+
return p && q(O, p.prototype), O;
|
|
424
|
+
}, L.apply(null, arguments);
|
|
425
|
+
}
|
|
426
|
+
function Ee(e) {
|
|
427
|
+
return Function.toString.call(e).indexOf("[native code]") !== -1;
|
|
428
|
+
}
|
|
429
|
+
function X(e) {
|
|
430
|
+
var u = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
431
|
+
return X = function(i) {
|
|
432
|
+
if (i === null || !Ee(i)) return i;
|
|
433
|
+
if (typeof i != "function")
|
|
434
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
435
|
+
if (typeof u < "u") {
|
|
436
|
+
if (u.has(i)) return u.get(i);
|
|
437
|
+
u.set(i, o);
|
|
438
|
+
}
|
|
439
|
+
function o() {
|
|
440
|
+
return L(i, arguments, J(this).constructor);
|
|
441
|
+
}
|
|
442
|
+
return o.prototype = Object.create(i.prototype, {
|
|
443
|
+
constructor: {
|
|
444
|
+
value: o,
|
|
445
|
+
enumerable: !1,
|
|
446
|
+
writable: !0,
|
|
447
|
+
configurable: !0
|
|
448
|
+
}
|
|
449
|
+
}), q(o, i);
|
|
450
|
+
}, X(e);
|
|
451
|
+
}
|
|
452
|
+
function re(e) {
|
|
453
|
+
if (e === void 0)
|
|
454
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
455
|
+
return e;
|
|
456
|
+
}
|
|
457
|
+
var ae = function(u) {
|
|
458
|
+
return 'Cannot execute "' + u.action + '" on "' + u.subjectName + '"';
|
|
459
|
+
}, G = ae, Fe = /* @__PURE__ */ function(e) {
|
|
460
|
+
xe(u, e), u.setDefaultMessage = function(o) {
|
|
461
|
+
o === null ? G = ae : G = typeof o == "string" ? function() {
|
|
462
|
+
return o;
|
|
463
|
+
} : o;
|
|
464
|
+
}, u.from = function(o) {
|
|
465
|
+
var s = new this("");
|
|
466
|
+
return Object.defineProperty(s, "ability", {
|
|
467
|
+
value: o
|
|
468
|
+
}), s;
|
|
469
|
+
};
|
|
470
|
+
function u(i, o) {
|
|
471
|
+
var s;
|
|
472
|
+
return o === void 0 && (o = {}), s = e.call(this, i) || this, s._setMetadata(o), s.message = i || G(re(s)), s._customMessage = null, typeof Error.captureStackTrace == "function" && (s.name = s.constructor.name, Error.captureStackTrace(re(s), s.constructor)), s;
|
|
473
|
+
}
|
|
474
|
+
var l = u.prototype;
|
|
475
|
+
return l.setMessage = function(o) {
|
|
476
|
+
return this._customMessage = o, this;
|
|
477
|
+
}, l.throwUnlessCan = function(o, s, p) {
|
|
478
|
+
if (!this.ability)
|
|
479
|
+
throw new ReferenceError("Cannot throw FordiddenError without respective ability instance");
|
|
480
|
+
var d = this.ability.relevantRuleFor(o, s, p);
|
|
481
|
+
if (!(d && !d.inverted)) {
|
|
482
|
+
this._setMetadata({
|
|
483
|
+
action: o,
|
|
484
|
+
subject: s,
|
|
485
|
+
field: p,
|
|
486
|
+
subjectName: this.ability.subjectName(s)
|
|
487
|
+
});
|
|
488
|
+
var j = d ? d.reason : "";
|
|
489
|
+
throw this.message = this._customMessage || j || G(this), this;
|
|
490
|
+
}
|
|
491
|
+
}, l._setMetadata = function(o) {
|
|
492
|
+
this.subject = o.subject, this.subjectName = o.subjectName, this.action = o.action, this.field = o.field;
|
|
493
|
+
}, u;
|
|
494
|
+
}(X(Error));
|
|
495
|
+
function V(e) {
|
|
496
|
+
return Array.isArray(e) ? e : [e];
|
|
497
|
+
}
|
|
498
|
+
function Ie(e) {
|
|
499
|
+
if (!e || typeof e == "string")
|
|
500
|
+
return e;
|
|
501
|
+
var u = typeof e == "object" ? e.constructor : e;
|
|
502
|
+
return u.modelName || u.name;
|
|
503
|
+
}
|
|
504
|
+
function Ce(e) {
|
|
505
|
+
return JSON.parse(JSON.stringify(e));
|
|
506
|
+
}
|
|
507
|
+
var Me = /[-/\\^$+?.()|[\]{}]/g, Ne = /\.?\*+\.?/g, Ue = /\*+/, He = /\./g;
|
|
508
|
+
function Ge(e, u, l) {
|
|
509
|
+
var i = l[0] === "*" || e[0] === "." && e[e.length - 1] === "." ? "+" : "*", o = e.indexOf("**") === -1 ? "[^.]" : ".", s = e.replace(He, "\\$&").replace(Ue, o + i);
|
|
510
|
+
return u + e.length === l.length ? "(?:" + s + ")?" : s;
|
|
511
|
+
}
|
|
512
|
+
function Le(e, u, l) {
|
|
513
|
+
return e === "." && (l[u - 1] === "*" || l[u + 1] === "*") ? e : "\\" + e;
|
|
514
|
+
}
|
|
515
|
+
function qe(e) {
|
|
516
|
+
var u = e.map(function(i) {
|
|
517
|
+
return i.replace(Me, Le).replace(Ne, Ge);
|
|
518
|
+
}), l = u.length > 1 ? "(?:" + u.join("|") + ")" : u[0];
|
|
519
|
+
return new RegExp("^" + l + "$");
|
|
520
|
+
}
|
|
521
|
+
var ze = /* @__PURE__ */ function() {
|
|
522
|
+
function e(l) {
|
|
523
|
+
this.actions = l.actions || l.action, this.subject = l.subject, this.fields = !l.fields || l.fields.length === 0 ? void 0 : V(l.fields), Object.defineProperty(this, "_fieldsPattern", {
|
|
524
|
+
writable: !0
|
|
525
|
+
}), this.inverted = !!l.inverted, this.conditions = l.conditions, Object.defineProperty(this, "_matches", {
|
|
526
|
+
writable: !0,
|
|
527
|
+
value: this.conditions ? Ae(this.conditions) : void 0
|
|
528
|
+
}), this.reason = l.reason;
|
|
529
|
+
}
|
|
530
|
+
var u = e.prototype;
|
|
531
|
+
return u.matches = function(i) {
|
|
532
|
+
return this._matches ? typeof i == "string" ? !this.inverted : this._matches(i) : !0;
|
|
533
|
+
}, u.isRelevantFor = function(i, o) {
|
|
534
|
+
return this.fields ? o ? this.matchesField(o) : !this.inverted : !0;
|
|
535
|
+
}, u.matchesField = function(i) {
|
|
536
|
+
return typeof this._fieldsPattern > "u" && (this._fieldsPattern = this.fields.join("").indexOf("*") === -1 ? null : qe(this.fields)), this._fieldsPattern === null || i.indexOf("*") !== -1 ? this.fields.indexOf(i) !== -1 : this._fieldsPattern.test(i);
|
|
537
|
+
}, e;
|
|
538
|
+
}(), A = typeof Symbol < "u" ? Symbol("private") : "__" + Date.now(), ie = {
|
|
539
|
+
crud: ["create", "read", "update", "delete"]
|
|
540
|
+
};
|
|
541
|
+
function oe(e, u) {
|
|
542
|
+
return e === u || Array.isArray(u) && u.indexOf(e) !== -1;
|
|
543
|
+
}
|
|
544
|
+
var Be = /* @__PURE__ */ function() {
|
|
545
|
+
e.addAlias = function(i, o) {
|
|
546
|
+
if (i === "manage" || oe("manage", o))
|
|
547
|
+
throw new Error('Cannot add alias for "manage" action because it represents any action');
|
|
548
|
+
if (oe(i, o))
|
|
549
|
+
throw new Error("Attempt to alias action to itself: " + i + " -> " + o.toString());
|
|
550
|
+
return ie[i] = o, this;
|
|
551
|
+
};
|
|
552
|
+
function e(l, i) {
|
|
553
|
+
i === void 0 && (i = {}), Object.defineProperty(this, "subjectName", {
|
|
554
|
+
value: i.subjectName || Ie
|
|
555
|
+
}), this[A] = {
|
|
556
|
+
RuleType: i.RuleType || ze,
|
|
557
|
+
originalRules: l || [],
|
|
558
|
+
hasPerFieldRules: !1,
|
|
559
|
+
indexedRules: /* @__PURE__ */ Object.create(null),
|
|
560
|
+
mergedRules: /* @__PURE__ */ Object.create(null),
|
|
561
|
+
events: {},
|
|
562
|
+
aliases: Ce(ie)
|
|
563
|
+
}, this.update(l);
|
|
564
|
+
}
|
|
565
|
+
var u = e.prototype;
|
|
566
|
+
return u.update = function(i) {
|
|
567
|
+
if (!Array.isArray(i))
|
|
568
|
+
return this;
|
|
569
|
+
var o = {
|
|
570
|
+
rules: i,
|
|
571
|
+
ability: this
|
|
572
|
+
};
|
|
573
|
+
this.emit("update", o), this[A].originalRules = i.slice(0), this[A].mergedRules = /* @__PURE__ */ Object.create(null);
|
|
574
|
+
var s = this.buildIndexFor(i);
|
|
575
|
+
return process.env.NODE_ENV !== "production" && s.isAllInverted && i.length && console.warn("[casl]: Ability contains only inverted rules. That means user will not be able to do any actions. This will be changed to Error throw in the next major version"), this[A].indexedRules = s.rules, this[A].hasPerFieldRules = s.hasPerFieldRules, this.emit("updated", o), this;
|
|
576
|
+
}, u.buildIndexFor = function(i) {
|
|
577
|
+
for (var o = /* @__PURE__ */ Object.create(null), s = this[A].RuleType, p = !0, d = !1, j = 0; j < i.length; j++) {
|
|
578
|
+
var O = new s(i[j]), T = this.expandActions(O.actions), w = V(O.subject), N = i.length - j - 1;
|
|
579
|
+
p = !!(p && O.inverted), !d && O.fields && (d = !0);
|
|
580
|
+
for (var $ = 0; $ < w.length; $++) {
|
|
581
|
+
var S = w[$];
|
|
582
|
+
o[S] = o[S] || /* @__PURE__ */ Object.create(null);
|
|
583
|
+
for (var P = 0; P < T.length; P++) {
|
|
584
|
+
var D = T[P];
|
|
585
|
+
o[S][D] = o[S][D] || /* @__PURE__ */ Object.create(null), o[S][D][N] = O;
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
return {
|
|
590
|
+
isAllInverted: p,
|
|
591
|
+
hasPerFieldRules: d,
|
|
592
|
+
rules: o
|
|
593
|
+
};
|
|
594
|
+
}, u.expandActions = function(i) {
|
|
595
|
+
for (var o = this[A].aliases, s = V(i), p = 0; p < s.length; ) {
|
|
596
|
+
var d = s[p++];
|
|
597
|
+
o.hasOwnProperty(d) && (s = s.concat(o[d]));
|
|
598
|
+
}
|
|
599
|
+
return s;
|
|
600
|
+
}, u.can = function(i, o, s) {
|
|
601
|
+
if (s && typeof s != "string")
|
|
602
|
+
throw new Error("Ability.can expects 3rd parameter to be a string. See https://stalniy.github.io/casl/abilities/2017/07/21/check-abilities.html#checking-fields for details");
|
|
603
|
+
var p = this.relevantRuleFor(i, o, s);
|
|
604
|
+
return !!p && !p.inverted;
|
|
605
|
+
}, u.relevantRuleFor = function(i, o, s) {
|
|
606
|
+
for (var p = this.rulesFor(i, o, s), d = 0; d < p.length; d++)
|
|
607
|
+
if (p[d].matches(o))
|
|
608
|
+
return p[d];
|
|
609
|
+
return null;
|
|
610
|
+
}, u.possibleRulesFor = function(i, o) {
|
|
611
|
+
var s = this.subjectName(o), p = this[A].mergedRules, d = s + "_" + i;
|
|
612
|
+
return p[d] || (p[d] = this.mergeRulesFor(i, s)), p[d];
|
|
613
|
+
}, u.mergeRulesFor = function(i, o) {
|
|
614
|
+
var s = this[A].indexedRules, p = [o, "all"].reduce(function(d, j) {
|
|
615
|
+
var O = s[j];
|
|
616
|
+
return O ? Object.assign(d, O[i], O.manage) : d;
|
|
617
|
+
}, []);
|
|
618
|
+
return p.filter(Boolean);
|
|
619
|
+
}, u.rulesFor = function(i, o, s) {
|
|
620
|
+
var p = this.possibleRulesFor(i, o);
|
|
621
|
+
return this[A].hasPerFieldRules ? p.filter(function(d) {
|
|
622
|
+
return d.isRelevantFor(o, s);
|
|
623
|
+
}) : p;
|
|
624
|
+
}, u.cannot = function() {
|
|
625
|
+
return !this.can.apply(this, arguments);
|
|
626
|
+
}, u.throwUnlessCan = function() {
|
|
627
|
+
var i;
|
|
628
|
+
console.warn(`
|
|
629
|
+
Ability.throwUnlessCan is deprecated and will be removed in 4.x version.
|
|
630
|
+
Please use "ForbiddenError.from(ability).throwUnlessCan(...)" instead.
|
|
631
|
+
`.trim()), (i = Fe.from(this)).throwUnlessCan.apply(i, arguments);
|
|
632
|
+
}, u.on = function(i, o) {
|
|
633
|
+
var s = this[A].events, p = !0;
|
|
634
|
+
return s[i] || (s[i] = []), s[i].push(o), function() {
|
|
635
|
+
if (p) {
|
|
636
|
+
var d = s[i].indexOf(o);
|
|
637
|
+
s[i].splice(d, 1), p = !1;
|
|
638
|
+
}
|
|
639
|
+
};
|
|
640
|
+
}, u.emit = function(i, o) {
|
|
641
|
+
var s = this[A].events[i];
|
|
642
|
+
s && s.slice(0).forEach(function(p) {
|
|
643
|
+
return p(o);
|
|
644
|
+
});
|
|
645
|
+
}, Pe(e, [{
|
|
646
|
+
key: "rules",
|
|
647
|
+
get: function() {
|
|
648
|
+
return this[A].originalRules;
|
|
649
|
+
}
|
|
650
|
+
}]), e;
|
|
651
|
+
}(), n = /* @__PURE__ */ ((e) => (e.manage = "manage", e.create = "create", e.read = "read", e.update = "update", e.delete = "delete", e))(n || {}), c = /* @__PURE__ */ ((e) => (e.crm = "business::crm", e.crm_promotion = "business::crm::promotion", e.crm_voucher = "business::crm::voucher", e.crm_membership = "business::crm::membership", e.inventory_stock = "business::inventory::stock", e.inventory_stockBalance = "business::inventory::stockBalance", e.inventory_stockAdjustment = "business::inventory::stockAdjustment", e.inventory_unitCostHistory = "business::inventory::unitCostHistory", e.inventory_wastageTemplate = "business::inventory::wastageTemplate", e.inventory_closingHistory = "business::inventory::closingHistory", e.inventory_closingTemplate = "business::inventory::closingTemplate", e.inventory_closingDraft = "business::inventory::closingDraft", e.inventory_ingredient = "business::inventory::ingredient", e.inventory_ingredientGroup = "business::inventory::ingredientGroup", e.inventory_recipe = "business::inventory::recipe", e.inventory_unit = "business::inventory::unit", e.inventory_purchaseTransfer = "business::inventory::purchaseTransfer", e.inventory_orderDraftApproval = "business::inventory::orderDraftApproval", e.inventory_transferOut = "business::inventory::transferOut", e.inventory_surcharge = "business::inventory::surcharge", e.inventory_orderTemplate = "business::inventory::orderTemplate", e.inventory_supplier = "business::inventory::supplier", e.inventory_warehouse = "business::inventory::warehouse", e.inventory_publish = "business::inventory::publish", e.inventory_import = "business::inventory::import", e.inventory_integration = "business::inventory::integration", e.hrm = "business::hrm", e.hrm_employee = "business::hrm::employee", e.hrm_teamMember = "business::hrm::teamMember", e.hrm_auditLog = "business::hrm::auditLog", e.menu = "business::menu", e.restaurant = "business::restaurant", e.role = "business::role", e.profile = "business::profile", e))(c || {}), g = /* @__PURE__ */ ((e) => (e.profile = "business::profile", e.restaurant = "business::restaurant", e.menu = "business::menu", e.promotion = "business::promotion", e.voucher = "business::voucher", e.membership = "business::membership", e.stock = "business::stock", e.permission = "business::permission", e.role = "business::role", e.wastageTemplate = "business::wastageTemplate", e.closingTemplate = "business::closingTemplate", e.orderTemplate = "business::orderTemplate", e.ingredient = "business::ingredient", e.recipe = "business::recipe", e.unit = "business::unit", e.supplier = "business::supplier", e.warehouse = "business::warehouse", e.publish = "business::publish", e.integration = "business::integration", e.orderDraft = "business::orderDraft", e.unitCostHistory = "business::unitCostHistory", e))(g || {}), Y = /* @__PURE__ */ ((e) => (e.restaurant = "restaurant", e))(Y || {});
|
|
652
|
+
g.permission + "", c.hrm_teamMember, g.promotion + "", c.crm_promotion, g.voucher + "", c.crm_voucher, g.membership + "", c.crm_membership, g.stock + "", c.inventory_stock, g.wastageTemplate + "", c.inventory_wastageTemplate, g.closingTemplate + "", c.inventory_closingTemplate, g.orderTemplate + "", c.inventory_orderTemplate, g.ingredient + "", c.inventory_ingredient, g.recipe + "", c.inventory_recipe, g.unit + "", c.inventory_unit, g.supplier + "", c.inventory_supplier, g.warehouse + "", c.inventory_warehouse, g.publish + "", c.inventory_publish, g.integration + "", c.inventory_integration, g.orderDraft + "", c.inventory_orderDraftApproval, g.unitCostHistory + "", c.inventory_unitCostHistory;
|
|
653
|
+
c.restaurant, n.manage, c.menu, n.manage, c.inventory_stockBalance, n.manage, c.inventory_stockAdjustment, n.manage, c.inventory_unitCostHistory, n.manage, c.inventory_wastageTemplate, n.manage, c.inventory_closingHistory, n.manage, c.inventory_closingTemplate, n.manage, c.inventory_closingDraft, n.manage, c.inventory_ingredient, n.manage, c.inventory_ingredientGroup, n.manage, c.inventory_recipe, n.manage, c.inventory_unit, n.manage, c.inventory_purchaseTransfer, n.manage, c.inventory_orderDraftApproval, n.manage, c.inventory_transferOut, n.manage, c.inventory_surcharge, n.manage, c.inventory_orderTemplate, n.manage, c.inventory_supplier, n.manage, c.inventory_warehouse, n.manage, c.inventory_publish, n.manage, c.inventory_import, n.manage, c.inventory_integration, n.manage, c.crm_promotion, n.manage, c.crm_voucher, n.manage, c.crm_membership, n.manage, c.hrm_teamMember, n.manage, c.hrm_employee, n.manage, c.hrm_auditLog, n.manage;
|
|
654
|
+
var v = /* @__PURE__ */ ((e) => (e.inventory = "inventory", e.inventory_stock = "inventory::stock", e.inventory_stockAdjustment = "inventory::stockAdjustment", e.inventory_stockRecalculation = "inventory::stockRecalculation", e.inventory_unitCostHistory = "inventory::unitCostHistory", e.inventory_wastageTemplate = "inventory::wastageTemplate", e.inventory_closing = "inventory::closing", e.inventory_closingDraft = "inventory::closingDraft", e.inventory_closingTemplate = "inventory::closingTemplate", e.inventory_ingredient = "inventory::ingredient", e.inventory_ingredientGroup = "inventory::ingredientGroup", e.inventory_recipe = "inventory::recipe", e.inventory_unit = "inventory::unit", e.inventory_orderTemplate = "inventory::orderTemplate", e.inventory_orderDraft = "inventory::orderDraft", e.inventory_printTemplate = "inventory::printTemplate", e.inventory_purchaseOrder = "inventory::purchaseOrder", e.inventory_transferOutApproval = "inventory::transferOutApproval", e.inventory_adjustmentTemplate = "inventory::adjustmentTemplate", e.inventory_surcharge = "inventory::surcharge", e.inventory_supplier = "inventory::supplier", e.inventory_warehouse = "inventory::warehouse", e.inventory_publish = "inventory::publish", e.inventory_integration = "inventory::integration", e.inventory_deliveryOrder = "inventory::deliveryOrder", e.inventory_shipment = "inventory::shipment", e.inventory_orderDraftApproval = "inventory::orderDraftApproval", e))(v || {});
|
|
655
|
+
const R = [
|
|
656
|
+
{
|
|
657
|
+
label: "Inventory",
|
|
658
|
+
subject: v.inventory,
|
|
659
|
+
actions: [n.read]
|
|
660
|
+
}
|
|
661
|
+
], K = [
|
|
662
|
+
...R,
|
|
663
|
+
{
|
|
664
|
+
label: "Stock",
|
|
665
|
+
subject: v.inventory_stock,
|
|
666
|
+
actions: [n.read, n.create, n.update]
|
|
667
|
+
},
|
|
668
|
+
{
|
|
669
|
+
label: "Stock Adjustment",
|
|
670
|
+
subject: v.inventory_stockAdjustment,
|
|
671
|
+
actions: [n.read, n.update]
|
|
672
|
+
},
|
|
673
|
+
{
|
|
674
|
+
label: "Stock Recalculation",
|
|
675
|
+
subject: v.inventory_stockRecalculation,
|
|
676
|
+
actions: [n.update]
|
|
677
|
+
},
|
|
678
|
+
{
|
|
679
|
+
label: "Unit Cost History",
|
|
680
|
+
subject: v.inventory_unitCostHistory,
|
|
681
|
+
actions: [n.read]
|
|
682
|
+
}
|
|
683
|
+
], We = [
|
|
684
|
+
...R,
|
|
685
|
+
{
|
|
686
|
+
label: "Stock Adjustment",
|
|
687
|
+
subject: v.inventory_stockAdjustment,
|
|
688
|
+
actions: [n.update]
|
|
689
|
+
}
|
|
690
|
+
], ue = [
|
|
691
|
+
...R,
|
|
692
|
+
{
|
|
693
|
+
label: "Unit Cost History",
|
|
694
|
+
subject: v.inventory_unitCostHistory,
|
|
695
|
+
actions: [n.read, n.update]
|
|
696
|
+
}
|
|
697
|
+
], ce = [
|
|
698
|
+
...R,
|
|
699
|
+
{
|
|
700
|
+
label: "Wastage Template",
|
|
701
|
+
subject: v.inventory_wastageTemplate,
|
|
702
|
+
actions: [
|
|
703
|
+
n.read,
|
|
704
|
+
n.create,
|
|
705
|
+
n.update,
|
|
706
|
+
n.delete
|
|
707
|
+
]
|
|
708
|
+
}
|
|
709
|
+
];
|
|
710
|
+
[
|
|
711
|
+
...K,
|
|
712
|
+
...ue,
|
|
713
|
+
...ce
|
|
714
|
+
];
|
|
715
|
+
const Q = [
|
|
716
|
+
...R,
|
|
717
|
+
{
|
|
718
|
+
label: "Closing",
|
|
719
|
+
subject: v.inventory_closing,
|
|
720
|
+
actions: [n.read, n.create]
|
|
721
|
+
},
|
|
722
|
+
{
|
|
723
|
+
label: "Stock Recalculation",
|
|
724
|
+
subject: v.inventory_stockRecalculation,
|
|
725
|
+
actions: [n.read, n.update]
|
|
726
|
+
},
|
|
727
|
+
{
|
|
728
|
+
label: "Closing Draft",
|
|
729
|
+
subject: v.inventory_closingDraft,
|
|
730
|
+
actions: [n.read]
|
|
731
|
+
}
|
|
732
|
+
], le = [
|
|
733
|
+
...R,
|
|
734
|
+
{
|
|
735
|
+
label: "Closing Draft",
|
|
736
|
+
subject: v.inventory_closingDraft,
|
|
737
|
+
actions: [n.read, n.create, n.update]
|
|
738
|
+
},
|
|
739
|
+
{
|
|
740
|
+
label: "Closing",
|
|
741
|
+
subject: v.inventory_closing,
|
|
742
|
+
actions: [n.read]
|
|
743
|
+
},
|
|
744
|
+
{
|
|
745
|
+
label: "Stock Recalculation",
|
|
746
|
+
subject: v.inventory_stockRecalculation,
|
|
747
|
+
actions: [n.read, n.update]
|
|
748
|
+
},
|
|
749
|
+
{
|
|
750
|
+
label: "Stock",
|
|
751
|
+
subject: v.inventory_stock,
|
|
752
|
+
actions: [n.read]
|
|
753
|
+
},
|
|
754
|
+
{
|
|
755
|
+
label: "Stock Adjustment",
|
|
756
|
+
subject: v.inventory_stockAdjustment,
|
|
757
|
+
actions: [n.read]
|
|
758
|
+
}
|
|
759
|
+
], pe = [
|
|
760
|
+
...R,
|
|
761
|
+
{
|
|
762
|
+
label: "Closing Template",
|
|
763
|
+
subject: v.inventory_closingTemplate,
|
|
764
|
+
actions: [
|
|
765
|
+
n.read,
|
|
766
|
+
n.create,
|
|
767
|
+
n.update,
|
|
768
|
+
n.delete
|
|
769
|
+
]
|
|
770
|
+
},
|
|
771
|
+
{
|
|
772
|
+
label: "Closing",
|
|
773
|
+
subject: v.inventory_closing,
|
|
774
|
+
actions: [n.read]
|
|
775
|
+
}
|
|
776
|
+
];
|
|
777
|
+
[
|
|
778
|
+
...Q,
|
|
779
|
+
...le,
|
|
780
|
+
...pe
|
|
781
|
+
];
|
|
782
|
+
const Je = [
|
|
783
|
+
{
|
|
784
|
+
label: "Inventory",
|
|
785
|
+
subject: v.inventory,
|
|
786
|
+
actions: [n.read, n.update]
|
|
787
|
+
},
|
|
788
|
+
{
|
|
789
|
+
label: "Order Template",
|
|
790
|
+
subject: v.inventory_orderTemplate,
|
|
791
|
+
actions: [n.read, n.update]
|
|
792
|
+
},
|
|
793
|
+
{
|
|
794
|
+
label: "Wastage Template",
|
|
795
|
+
subject: v.inventory_wastageTemplate,
|
|
796
|
+
actions: [n.read, n.update]
|
|
797
|
+
},
|
|
798
|
+
{
|
|
799
|
+
label: "Closing Template",
|
|
800
|
+
subject: v.inventory_closingTemplate,
|
|
801
|
+
actions: [n.read, n.update]
|
|
802
|
+
}
|
|
803
|
+
], Xe = [
|
|
804
|
+
{
|
|
805
|
+
label: "Inventory",
|
|
806
|
+
subject: v.inventory,
|
|
807
|
+
actions: [n.read, n.update]
|
|
808
|
+
}
|
|
809
|
+
], Ve = [
|
|
810
|
+
{
|
|
811
|
+
label: "Inventory",
|
|
812
|
+
subject: v.inventory,
|
|
813
|
+
actions: [n.read, n.update]
|
|
814
|
+
}
|
|
815
|
+
], Ye = [
|
|
816
|
+
{
|
|
817
|
+
label: "Inventory",
|
|
818
|
+
subject: v.inventory,
|
|
819
|
+
actions: [n.read, n.update]
|
|
820
|
+
}
|
|
821
|
+
], fe = [
|
|
822
|
+
{
|
|
823
|
+
label: "Purchase Order",
|
|
824
|
+
subject: v.inventory_purchaseOrder,
|
|
825
|
+
actions: [n.read, n.create, n.update]
|
|
826
|
+
},
|
|
827
|
+
{
|
|
828
|
+
label: "Inventory",
|
|
829
|
+
subject: v.inventory,
|
|
830
|
+
actions: [n.read, n.create, n.update]
|
|
831
|
+
},
|
|
832
|
+
{
|
|
833
|
+
label: "Closing",
|
|
834
|
+
subject: v.inventory_closing,
|
|
835
|
+
actions: [n.read]
|
|
836
|
+
},
|
|
837
|
+
{
|
|
838
|
+
label: "Order Template",
|
|
839
|
+
subject: v.inventory_orderTemplate,
|
|
840
|
+
actions: [n.read]
|
|
841
|
+
},
|
|
842
|
+
{
|
|
843
|
+
label: "Supplier",
|
|
844
|
+
subject: v.inventory_supplier,
|
|
845
|
+
actions: [n.read]
|
|
846
|
+
},
|
|
847
|
+
{
|
|
848
|
+
label: "Surcharge",
|
|
849
|
+
subject: v.inventory_surcharge,
|
|
850
|
+
actions: [n.read]
|
|
851
|
+
},
|
|
852
|
+
{
|
|
853
|
+
label: "Delivery Order",
|
|
854
|
+
subject: v.inventory_deliveryOrder,
|
|
855
|
+
actions: [n.read, n.create, n.update]
|
|
856
|
+
},
|
|
857
|
+
{
|
|
858
|
+
label: "Shipment",
|
|
859
|
+
subject: v.inventory_shipment,
|
|
860
|
+
actions: [n.read, n.update]
|
|
861
|
+
}
|
|
862
|
+
], ye = [
|
|
863
|
+
{
|
|
864
|
+
label: "Purchase Order",
|
|
865
|
+
subject: v.inventory_purchaseOrder,
|
|
866
|
+
actions: [n.read, n.update]
|
|
867
|
+
},
|
|
868
|
+
{
|
|
869
|
+
label: "Inventory",
|
|
870
|
+
subject: v.inventory,
|
|
871
|
+
actions: [n.read, n.create, n.update]
|
|
872
|
+
},
|
|
873
|
+
{
|
|
874
|
+
label: "Delivery Order",
|
|
875
|
+
subject: v.inventory_deliveryOrder,
|
|
876
|
+
actions: [n.read, n.create, n.update]
|
|
877
|
+
},
|
|
878
|
+
{
|
|
879
|
+
label: "Shipment",
|
|
880
|
+
subject: v.inventory_shipment,
|
|
881
|
+
actions: [n.read, n.update]
|
|
882
|
+
}
|
|
883
|
+
], ve = [
|
|
884
|
+
...R,
|
|
885
|
+
{
|
|
886
|
+
label: "Surcharge",
|
|
887
|
+
subject: v.inventory_surcharge,
|
|
888
|
+
actions: [
|
|
889
|
+
n.read,
|
|
890
|
+
n.create,
|
|
891
|
+
n.update,
|
|
892
|
+
n.delete
|
|
893
|
+
]
|
|
894
|
+
},
|
|
895
|
+
{
|
|
896
|
+
label: "Supplier",
|
|
897
|
+
subject: v.inventory_supplier,
|
|
898
|
+
actions: [n.read]
|
|
899
|
+
}
|
|
900
|
+
], de = [
|
|
901
|
+
...R,
|
|
902
|
+
{
|
|
903
|
+
label: "Order Template",
|
|
904
|
+
subject: v.inventory_orderTemplate,
|
|
905
|
+
actions: [
|
|
906
|
+
n.read,
|
|
907
|
+
n.create,
|
|
908
|
+
n.update,
|
|
909
|
+
n.delete
|
|
910
|
+
]
|
|
911
|
+
},
|
|
912
|
+
{
|
|
913
|
+
label: "Supplier",
|
|
914
|
+
subject: v.inventory_supplier,
|
|
915
|
+
actions: [n.read]
|
|
916
|
+
},
|
|
917
|
+
{
|
|
918
|
+
label: "Shipment",
|
|
919
|
+
subject: v.inventory_shipment,
|
|
920
|
+
actions: [n.read, n.update]
|
|
921
|
+
}
|
|
922
|
+
], Ke = [
|
|
923
|
+
...R,
|
|
924
|
+
{
|
|
925
|
+
label: "Order Draft Approval",
|
|
926
|
+
subject: v.inventory_orderDraftApproval,
|
|
927
|
+
actions: [n.update]
|
|
928
|
+
}
|
|
929
|
+
];
|
|
930
|
+
[
|
|
931
|
+
...fe,
|
|
932
|
+
...ye,
|
|
933
|
+
...ve,
|
|
934
|
+
...de
|
|
935
|
+
];
|
|
936
|
+
const Qe = [
|
|
937
|
+
...R,
|
|
938
|
+
{
|
|
939
|
+
label: "Supplier",
|
|
940
|
+
subject: v.inventory_supplier,
|
|
941
|
+
actions: [
|
|
942
|
+
n.read,
|
|
943
|
+
n.create,
|
|
944
|
+
n.update,
|
|
945
|
+
n.delete
|
|
946
|
+
]
|
|
947
|
+
},
|
|
948
|
+
{
|
|
949
|
+
label: "Order Template",
|
|
950
|
+
subject: v.inventory_orderTemplate,
|
|
951
|
+
actions: [n.read, n.update]
|
|
952
|
+
}
|
|
953
|
+
], Ze = [
|
|
954
|
+
...R,
|
|
955
|
+
{
|
|
956
|
+
label: "Warehouse",
|
|
957
|
+
subject: v.inventory_warehouse,
|
|
958
|
+
actions: [
|
|
959
|
+
n.read,
|
|
960
|
+
n.create,
|
|
961
|
+
n.update,
|
|
962
|
+
n.delete
|
|
963
|
+
]
|
|
964
|
+
}
|
|
965
|
+
], et = [
|
|
966
|
+
{
|
|
967
|
+
label: "Inventory",
|
|
968
|
+
subject: v.inventory,
|
|
969
|
+
actions: [n.read, n.update]
|
|
970
|
+
}
|
|
971
|
+
], tt = [
|
|
972
|
+
...R,
|
|
973
|
+
{
|
|
974
|
+
label: "Inventory",
|
|
975
|
+
subject: v.inventory,
|
|
976
|
+
actions: [n.update]
|
|
977
|
+
}
|
|
978
|
+
], nt = [
|
|
979
|
+
...R,
|
|
980
|
+
{
|
|
981
|
+
label: "Integration",
|
|
982
|
+
subject: v.inventory_integration,
|
|
983
|
+
actions: [n.read, n.create, n.update]
|
|
984
|
+
}
|
|
985
|
+
];
|
|
986
|
+
[
|
|
987
|
+
...R,
|
|
988
|
+
...K,
|
|
989
|
+
...Q
|
|
990
|
+
];
|
|
991
|
+
const rt = {
|
|
992
|
+
[`set_${c.inventory_stockBalance}`]: {
|
|
993
|
+
key: "sys:inventory:stock_balance",
|
|
994
|
+
name: "Stock Balance",
|
|
995
|
+
permissions: K
|
|
996
|
+
},
|
|
997
|
+
[`set_${c.inventory_stockAdjustment}`]: {
|
|
998
|
+
key: "sys:inventory:stock_adjustment",
|
|
999
|
+
name: "Stock Adjustment",
|
|
1000
|
+
permissions: We
|
|
1001
|
+
},
|
|
1002
|
+
[`set_${c.inventory_unitCostHistory}`]: {
|
|
1003
|
+
key: "sys:inventory:unit_cost_history",
|
|
1004
|
+
name: "Unit Cost History",
|
|
1005
|
+
permissions: ue
|
|
1006
|
+
},
|
|
1007
|
+
[`set_${c.inventory_wastageTemplate}`]: {
|
|
1008
|
+
key: "sys:inventory:wastage_template",
|
|
1009
|
+
name: "Wastage Template",
|
|
1010
|
+
permissions: ce
|
|
1011
|
+
},
|
|
1012
|
+
[`set_${c.inventory_closingHistory}`]: {
|
|
1013
|
+
key: "sys:inventory:closing_history",
|
|
1014
|
+
name: "Closing History",
|
|
1015
|
+
permissions: Q
|
|
1016
|
+
},
|
|
1017
|
+
[`set_${c.inventory_closingTemplate}`]: {
|
|
1018
|
+
key: "sys:inventory:closing_template",
|
|
1019
|
+
name: "Closing Template",
|
|
1020
|
+
permissions: pe
|
|
1021
|
+
},
|
|
1022
|
+
[`set_${c.inventory_closingDraft}`]: {
|
|
1023
|
+
key: "sys:inventory:closing_draft",
|
|
1024
|
+
name: "Closing Draft",
|
|
1025
|
+
permissions: le
|
|
1026
|
+
},
|
|
1027
|
+
[`set_${c.inventory_ingredient}`]: {
|
|
1028
|
+
key: "sys:inventory:ingredient",
|
|
1029
|
+
name: "Ingredient",
|
|
1030
|
+
permissions: Je
|
|
1031
|
+
},
|
|
1032
|
+
[`set_${c.inventory_ingredientGroup}`]: {
|
|
1033
|
+
key: "sys:inventory:ingredient_group",
|
|
1034
|
+
name: "Ingredient Group",
|
|
1035
|
+
permissions: Xe
|
|
1036
|
+
},
|
|
1037
|
+
[`set_${c.inventory_recipe}`]: {
|
|
1038
|
+
key: "sys:inventory:recipe",
|
|
1039
|
+
name: "Recipe",
|
|
1040
|
+
permissions: Ve
|
|
1041
|
+
},
|
|
1042
|
+
[`set_${c.inventory_unit}`]: {
|
|
1043
|
+
key: "sys:inventory:unit",
|
|
1044
|
+
name: "Unit",
|
|
1045
|
+
permissions: Ye
|
|
1046
|
+
},
|
|
1047
|
+
[`set_${c.inventory_purchaseTransfer}`]: {
|
|
1048
|
+
key: "sys:inventory:purchase_transfer",
|
|
1049
|
+
name: "Purchase Transfer",
|
|
1050
|
+
permissions: fe
|
|
1051
|
+
},
|
|
1052
|
+
[`set_${c.inventory_orderDraftApproval}`]: {
|
|
1053
|
+
key: "sys:inventory:order_draft_approval",
|
|
1054
|
+
name: "Order Draft Approval",
|
|
1055
|
+
permissions: Ke
|
|
1056
|
+
},
|
|
1057
|
+
[`set_${c.inventory_transferOut}`]: {
|
|
1058
|
+
key: "sys:inventory:transfer_out",
|
|
1059
|
+
name: "Transfer Out",
|
|
1060
|
+
permissions: ye
|
|
1061
|
+
},
|
|
1062
|
+
[`set_${c.inventory_surcharge}`]: {
|
|
1063
|
+
key: "sys:inventory:surcharge",
|
|
1064
|
+
name: "Surcharge",
|
|
1065
|
+
permissions: ve
|
|
1066
|
+
},
|
|
1067
|
+
[`set_${c.inventory_orderTemplate}`]: {
|
|
1068
|
+
key: "sys:inventory:order_template",
|
|
1069
|
+
name: "Order Template",
|
|
1070
|
+
permissions: de
|
|
1071
|
+
},
|
|
1072
|
+
[`set_${c.inventory_supplier}`]: {
|
|
1073
|
+
key: "sys:inventory:supplier",
|
|
1074
|
+
name: "Supplier",
|
|
1075
|
+
permissions: Qe
|
|
1076
|
+
},
|
|
1077
|
+
[`set_${c.inventory_warehouse}`]: {
|
|
1078
|
+
key: "sys:inventory:warehouse",
|
|
1079
|
+
name: "Warehouse",
|
|
1080
|
+
permissions: Ze
|
|
1081
|
+
},
|
|
1082
|
+
[`set_${c.inventory_publish}`]: {
|
|
1083
|
+
key: "sys:inventory:publish",
|
|
1084
|
+
name: "Publish",
|
|
1085
|
+
permissions: et
|
|
1086
|
+
},
|
|
1087
|
+
[`set_${c.inventory_import}`]: {
|
|
1088
|
+
key: "sys:inventory:import",
|
|
1089
|
+
name: "Import",
|
|
1090
|
+
permissions: tt
|
|
1091
|
+
},
|
|
1092
|
+
[`set_${c.inventory_integration}`]: {
|
|
1093
|
+
key: "sys:inventory:integration",
|
|
1094
|
+
name: "Integration",
|
|
1095
|
+
permissions: nt
|
|
1096
|
+
}
|
|
1097
|
+
};
|
|
1098
|
+
var I = /* @__PURE__ */ ((e) => (e.hrm_posRole = "hrm::posRole", e.hrm_portalUsers = "hrm::portalUsers", e))(I || {});
|
|
1099
|
+
const it = {
|
|
1100
|
+
/**
|
|
1101
|
+
* Triggered by: hrm_teamMember:manage (portal toggle)
|
|
1102
|
+
* Injects: team member list read + pos role read
|
|
1103
|
+
* Users who can manage team members need to see the team member list and assign POS roles.
|
|
1104
|
+
*/
|
|
1105
|
+
[`set_${c.hrm_teamMember}`]: {
|
|
1106
|
+
key: "sys:team_member_access",
|
|
1107
|
+
name: "Team Member Access",
|
|
1108
|
+
permissions: [
|
|
1109
|
+
{
|
|
1110
|
+
label: "Portal Users",
|
|
1111
|
+
subject: I.hrm_portalUsers,
|
|
1112
|
+
actions: [n.manage]
|
|
1113
|
+
},
|
|
1114
|
+
{
|
|
1115
|
+
label: "Role resource",
|
|
1116
|
+
subject: c.role,
|
|
1117
|
+
actions: [n.read, n.update]
|
|
1118
|
+
},
|
|
1119
|
+
{
|
|
1120
|
+
label: "Pos Role",
|
|
1121
|
+
subject: I.hrm_posRole,
|
|
1122
|
+
actions: [n.read]
|
|
1123
|
+
}
|
|
1124
|
+
]
|
|
1125
|
+
},
|
|
1126
|
+
/**
|
|
1127
|
+
* Triggered by: hrm_employee:manage (portal toggle)
|
|
1128
|
+
* Injects: pos role read + restaurant manage (cross-level: needed for employee–restaurant linking)
|
|
1129
|
+
*/
|
|
1130
|
+
[`set_${c.hrm_employee}`]: {
|
|
1131
|
+
key: "sys:employee_access",
|
|
1132
|
+
name: "Employee Access",
|
|
1133
|
+
permissions: [
|
|
1134
|
+
{
|
|
1135
|
+
label: "Portal Users",
|
|
1136
|
+
subject: I.hrm_portalUsers,
|
|
1137
|
+
actions: [n.read]
|
|
1138
|
+
},
|
|
1139
|
+
{
|
|
1140
|
+
label: "Restaurant resource",
|
|
1141
|
+
subject: c.restaurant,
|
|
1142
|
+
actions: [n.read]
|
|
1143
|
+
},
|
|
1144
|
+
{
|
|
1145
|
+
label: "Pos Role",
|
|
1146
|
+
subject: I.hrm_posRole,
|
|
1147
|
+
actions: [n.manage]
|
|
1148
|
+
}
|
|
1149
|
+
]
|
|
1150
|
+
},
|
|
1151
|
+
/**
|
|
1152
|
+
* Triggered by: hrm_auditLog:manage (portal toggle)
|
|
1153
|
+
* Injects: portal user list read — audit log must resolve portal user names from the list API.
|
|
1154
|
+
* Uses HrmResource.hrm_portalUsers (not the module subject hrm_teamMember) to avoid
|
|
1155
|
+
* conflating the audit-log read dependency with the full team-management module grant.
|
|
1156
|
+
*/
|
|
1157
|
+
[`set_${c.hrm_auditLog}`]: {
|
|
1158
|
+
key: "sys:audit_log_access",
|
|
1159
|
+
name: "Audit Log Access",
|
|
1160
|
+
permissions: [
|
|
1161
|
+
{
|
|
1162
|
+
label: "Portal Users",
|
|
1163
|
+
subject: I.hrm_portalUsers,
|
|
1164
|
+
actions: [n.read]
|
|
1165
|
+
}
|
|
1166
|
+
]
|
|
1167
|
+
}
|
|
1168
|
+
}, ot = {
|
|
1169
|
+
...rt,
|
|
1170
|
+
...it
|
|
1171
|
+
};
|
|
1172
|
+
Object.values(
|
|
1173
|
+
ot
|
|
1174
|
+
).flatMap((e) => e.permissions ?? []).reduce(
|
|
1175
|
+
(e, u) => {
|
|
1176
|
+
var l;
|
|
1177
|
+
return e[l = u.subject] ?? (e[l] = u.label), e;
|
|
1178
|
+
},
|
|
1179
|
+
{}
|
|
1180
|
+
);
|
|
1181
|
+
function st(e) {
|
|
1182
|
+
const u = Array.isArray(e) ? e : [];
|
|
1183
|
+
return new Be(u);
|
|
1184
|
+
}
|
|
1185
|
+
function at(e) {
|
|
1186
|
+
const { ability: u, action: l, restaurantId: i } = e;
|
|
1187
|
+
return i ? u.can(l, {
|
|
1188
|
+
constructor: { name: Y.restaurant },
|
|
1189
|
+
restaurantId: i
|
|
1190
|
+
}) : u.can(l, Y.restaurant);
|
|
1191
|
+
}
|
|
1192
|
+
function ut(e) {
|
|
1193
|
+
const { integrationRestaurantIds: u, ability: l, action: i } = e;
|
|
1194
|
+
if (!Array.isArray(u) || u.length === 0)
|
|
1195
|
+
return [];
|
|
1196
|
+
const o = [];
|
|
1197
|
+
for (const s of u)
|
|
1198
|
+
typeof s == "string" && (at({ ability: l, action: i, restaurantId: s }) || o.push(s));
|
|
1199
|
+
return o;
|
|
1200
|
+
}
|
|
1201
|
+
function ct(e) {
|
|
1202
|
+
return ut({
|
|
1203
|
+
integrationRestaurantIds: e.integrationRestaurantIds,
|
|
1204
|
+
ability: e.ability,
|
|
1205
|
+
action: e.action
|
|
1206
|
+
}).length > 0;
|
|
1207
|
+
}
|
|
1208
|
+
function dt() {
|
|
1209
|
+
const e = Re(), { t: u } = Oe(), { sessionUser: l } = Te(), i = je(
|
|
1210
|
+
() => {
|
|
1211
|
+
var p;
|
|
1212
|
+
return st((p = l.value) == null ? void 0 : p.permissions);
|
|
1213
|
+
}
|
|
1214
|
+
);
|
|
1215
|
+
function o(p) {
|
|
1216
|
+
e.open({
|
|
1217
|
+
type: "error",
|
|
1218
|
+
message: u("report.integration.error.containsUnauthorizedRestaurant", {
|
|
1219
|
+
action: u(`report.integration.permissionAction.${p}`)
|
|
1220
|
+
})
|
|
1221
|
+
});
|
|
1222
|
+
}
|
|
1223
|
+
function s(p) {
|
|
1224
|
+
return ct({
|
|
1225
|
+
integrationRestaurantIds: p.integrationRestaurantIds,
|
|
1226
|
+
ability: i.value,
|
|
1227
|
+
action: p.action
|
|
1228
|
+
});
|
|
1229
|
+
}
|
|
1230
|
+
return {
|
|
1231
|
+
ability: i,
|
|
1232
|
+
notifyUnauthorized: o,
|
|
1233
|
+
isRestricted: s
|
|
1234
|
+
};
|
|
1235
|
+
}
|
|
1236
|
+
export {
|
|
1237
|
+
n as e,
|
|
1238
|
+
ct as h,
|
|
1239
|
+
dt as u
|
|
1240
|
+
};
|