@feedmepos/mf-report 5.22.14-beta.2 → 5.22.15-beta.0

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