@feedmepos/mf-hrm-portal 2.0.17-dev.5 → 2.0.18-dev

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 (35) hide show
  1. package/dist/{AuditLogList-Dl3Nmf00.js → AuditLogList-CaoW9uYd.js} +5 -5
  2. package/dist/EmployeeList-DcMvF9U5.js +839 -0
  3. package/dist/Main-CleutFvF.js +567 -0
  4. package/dist/{Main-CQ3KwxDY.js → Main-CvW6Vu8N.js} +2055 -2055
  5. package/dist/{Main-w0XUUaBp.js → Main-D7k57uq5.js} +32 -32
  6. package/dist/{PermissionSetList-B8qNOWH6.js → PermissionSetList-CM7kbWkO.js} +6 -6
  7. package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-C9VUjAu_.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Ces9YwYB.js} +525 -525
  8. package/dist/{RoleList-DMFJsUZv.js → RoleList-DR3eVJ9f.js} +102 -102
  9. package/dist/TeamMemberList-CZZv4Pu5.js +1038 -0
  10. package/dist/{TimesheetList-Bwp9_xHe.js → TimesheetList-WqqoKPbg.js} +132 -126
  11. package/dist/{app-COJbSNM4.js → app-R5EioPr4.js} +4 -4
  12. package/dist/app.js +1 -1
  13. package/dist/{dayjs.min-CcBi6N-K.js → dayjs.min-CN15Ft3o.js} +1 -1
  14. package/dist/employee-DwQlWLkL.js +204 -0
  15. package/dist/{iteration-JOKbtlLf.js → iteration-UBGGRoxQ.js} +9258 -9213
  16. package/dist/{lodash-D5xlVzib.js → lodash-CC6qHVUo.js} +1 -1
  17. package/dist/{rule-3sXHiW0y.js → rule-B519XbW6.js} +273 -273
  18. package/dist/src/api/restaurant/index.d.ts +5 -0
  19. package/dist/src/composables/useRestaurantMap.d.ts +2 -329
  20. package/dist/src/stores/restaurant.d.ts +181 -0
  21. package/dist/src/stores/role.d.ts +7 -7
  22. package/dist/src/types/restaurant.d.ts +11 -0
  23. package/dist/style.css +1 -1
  24. package/dist/{team-CyNektSD.js → team-BGLhgx5P.js} +1 -1
  25. package/dist/{timesheet-DkD3AysG.js → timesheet-BylrXRfd.js} +2 -2
  26. package/dist/tsconfig.app.tsbuildinfo +1 -1
  27. package/dist/useAppStore-Akl8AoVN.js +171 -0
  28. package/dist/{useLoading-4TNmhm5N.js → useLoading-rbrVwWuj.js} +1 -1
  29. package/dist/{useReportPermissions-CWMFFb8E.js → useReportPermissions-BOEZU86S.js} +3 -3
  30. package/package.json +1 -1
  31. package/dist/EmployeeList-DBd_rVW2.js +0 -831
  32. package/dist/Main-pTgqNncY.js +0 -560
  33. package/dist/TeamMemberList-BLRTfKLz.js +0 -1031
  34. package/dist/employee-xiV0LfnL.js +0 -204
  35. package/dist/useAppStore-CvmsaYSG.js +0 -171
@@ -1,23 +1,23 @@
1
- import { computed as _, defineComponent as ge, ref as P, watch as se, onMounted as be, resolveComponent as C, createBlock as L, openBlock as d, unref as o, withCtx as y, createElementVNode as f, createVNode as c, createElementBlock as V, Fragment as A, createCommentVNode as de, renderList as te, toDisplayString as D, h as S, createTextVNode as pe, resolveDynamicComponent as ve, withModifiers as Le, nextTick as fe } from "vue";
2
- import { e as k } from "./iteration-JOKbtlLf.js";
3
- import { useCoreStore as me, useI18n as ye } from "@feedmepos/mf-common";
1
+ import { computed as _, defineComponent as ge, ref as P, watch as se, onMounted as be, resolveComponent as R, createBlock as L, openBlock as d, unref as o, withCtx as y, createElementVNode as f, createVNode as c, createElementBlock as V, Fragment as A, createCommentVNode as de, renderList as le, toDisplayString as D, h as S, createTextVNode as pe, resolveDynamicComponent as ve, withModifiers as Le, nextTick as fe } from "vue";
2
+ import { u as me, e as k } from "./iteration-UBGGRoxQ.js";
3
+ import { useI18n as ye } from "@feedmepos/mf-common";
4
4
  import { useSnackbar as xe, components as ue, useDialog as Ue, useBreakpoints as Ee, FmButtonColorThemeVariant as Ie } from "@feedmepos/ui-library";
5
- import { _ as Se } from "./app-COJbSNM4.js";
5
+ import { _ as Se } from "./app-R5EioPr4.js";
6
6
  import { u as Pe, _ as he } from "./useDiscardConfirm-DPhEV6v0.js";
7
7
  import { _ as $e } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
8
- import { e as Te, r as W, h as Ce, f as Me, g as _e, a as ae } from "./rule-3sXHiW0y.js";
9
- import { u as Re } from "./useAppStore-CvmsaYSG.js";
10
- import { u as Fe } from "./useReportPermissions-CWMFFb8E.js";
11
- import { l as le } from "./lodash-D5xlVzib.js";
8
+ import { e as Te, r as W, h as Re, f as Me, g as _e, a as ae } from "./rule-B519XbW6.js";
9
+ import { u as Ce } from "./useAppStore-Akl8AoVN.js";
10
+ import { u as Fe } from "./useReportPermissions-BOEZU86S.js";
11
+ import { l as te } from "./lodash-CC6qHVUo.js";
12
12
  import { _ as Be } from "./CollapsibleWrapper.vue_vue_type_script_setup_true_lang-BLJlmPVa.js";
13
13
  import { _ as ie } from "./FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js";
14
- import { u as De } from "./useLoading-4TNmhm5N.js";
14
+ import { u as De } from "./useLoading-rbrVwWuj.js";
15
15
  function Ne() {
16
16
  const j = me();
17
17
  return _(() => {
18
18
  const s = {};
19
- return j.restaurants.value.forEach((w) => {
20
- s[w._id] = w;
19
+ return j.restaurants.value.forEach((C) => {
20
+ s[C._id] = C;
21
21
  }), s;
22
22
  });
23
23
  }
@@ -36,29 +36,29 @@ const Ae = { class: "fm-typo-en-title-md-600" }, Oe = { class: "space-y-40" }, J
36
36
  }
37
37
  },
38
38
  setup(j, { expose: G }) {
39
- const { t: s } = ye(), w = me(), $ = P(""), U = _(() => w.restaurants.value.filter(({ profile: e }) => {
39
+ const { t: s } = ye(), C = me(), $ = P(""), U = _(() => C.restaurants.value.filter(({ profile: e }) => {
40
40
  const a = `${e.code ? e.code + "-" : ""}${e.legalName}`;
41
41
  return !$.value || a.toLowerCase().includes($.value.toLowerCase());
42
- })), O = P(w.restaurants.value.length === 0);
42
+ })), O = P(C.restaurants.value.length === 0);
43
43
  se(
44
- () => w.restaurants.value.length,
44
+ () => C.restaurants.value.length,
45
45
  (e) => {
46
46
  e > 0 && (O.value = !1);
47
47
  }
48
48
  );
49
- const T = Re(), H = xe(), Q = De(H), { fetchReportPermissions: X, allReportPermissions: oe, availableReportKeys: M } = Fe(), R = j, b = P(!1), re = () => {
49
+ const T = Ce(), H = xe(), Q = De(H), { fetchReportPermissions: X, allReportPermissions: oe, availableReportKeys: M } = Fe(), F = j, b = P(!1), re = () => {
50
50
  b.value = !b.value, b.value && Z();
51
- }, J = _(() => R.id ? s("hr.role.form.update") : s("hr.role.form.add")), Y = _(() => R.id ? s("common.update") : s("common.add")), q = _(() => {
51
+ }, J = _(() => F.id ? s("hr.role.form.update") : s("hr.role.form.add")), Y = _(() => F.id ? s("common.update") : s("common.add")), q = _(() => {
52
52
  const e = Te.filter(
53
53
  (i) => i.subject !== k.F_RULE_SUBJECT.enum.report
54
54
  ).map((i) => W(i)), a = oe.value.map((i) => W(i));
55
55
  return [...e, ...a];
56
- }), p = _(() => T.roles.value.find((e) => e._id == R.id)), E = () => ({
56
+ }), p = _(() => T.roles.value.find((e) => e._id == F.id)), E = () => ({
57
57
  name: "",
58
58
  restaurantIds: [],
59
59
  permissions: [],
60
60
  maxDiscountPercentage: 100
61
- }), l = P(E()), z = _(() => [
61
+ }), t = P(E()), z = _(() => [
62
62
  {
63
63
  title: s("hr.role.labels.operation"),
64
64
  filter: (e) => e.isOrderOperation
@@ -79,29 +79,29 @@ const Ae = { class: "fm-typo-en-title-md-600" }, Oe = { class: "space-y-40" }, J
79
79
  }))
80
80
  }))), g = _(() => {
81
81
  var e;
82
- return Ce(((e = p.value) == null ? void 0 : e.permissions) || []);
82
+ return Re(((e = p.value) == null ? void 0 : e.permissions) || []);
83
83
  });
84
84
  function Z() {
85
85
  var e;
86
- l.value = E(), l.value.name = ((e = p.value) == null ? void 0 : e.name) ?? "", g.value ? (l.value.restaurantIds = U.value.map((a) => a._id), l.value.permissions = q.value.map((a) => a.value)) : p.value && (l.value.restaurantIds = p.value.restaurants.map((a) => a.id), l.value.permissions = p.value.permissions.map((a) => W(a).value).filter((a) => a.startsWith("report:") ? M.value.has(a.split(":")[1]) : !0), l.value.maxDiscountPercentage = _e(
86
+ t.value = E(), t.value.name = ((e = p.value) == null ? void 0 : e.name) ?? "", g.value ? (t.value.restaurantIds = U.value.map((a) => a._id), t.value.permissions = q.value.map((a) => a.value)) : p.value && (t.value.restaurantIds = p.value.restaurants.map((a) => a.id), t.value.permissions = p.value.permissions.map((a) => W(a).value).filter((a) => a.startsWith("report:") ? M.value.has(a.split(":")[1]) : !0), t.value.maxDiscountPercentage = _e(
87
87
  p.value.permissions
88
88
  ));
89
89
  }
90
90
  be(async () => {
91
- await X(), Z();
91
+ await C.readRestaurants(), await X(), Z();
92
92
  }), se(b, async (e) => {
93
93
  e && await X();
94
94
  }), se(M, () => {
95
- b.value && p.value && !g.value && (l.value.permissions = l.value.permissions.filter((e) => e.startsWith("report:") ? M.value.has(e.split(":")[1]) : !0));
95
+ b.value && p.value && !g.value && (t.value.permissions = t.value.permissions.filter((e) => e.startsWith("report:") ? M.value.has(e.split(":")[1]) : !0));
96
96
  });
97
- const ne = P(""), t = _(() => ({
98
- restaurantIds: l.value.restaurantIds,
97
+ const ne = P(""), l = _(() => ({
98
+ restaurantIds: t.value.restaurantIds,
99
99
  role: {
100
- name: l.value.name,
101
- permissions: Me(l.value.permissions, l.value.maxDiscountPercentage)
100
+ name: t.value.name,
101
+ permissions: Me(t.value.permissions, t.value.maxDiscountPercentage)
102
102
  }
103
103
  })), r = async () => {
104
- const e = t.value;
104
+ const e = l.value;
105
105
  await Q.minor(
106
106
  async () => {
107
107
  p.value ? await T.updateRole(p.value._id, e) : await T.createRole(e);
@@ -111,18 +111,18 @@ const Ae = { class: "fm-typo-en-title-md-600" }, Oe = { class: "space-y-40" }, J
111
111
  }
112
112
  ), b.value = !1;
113
113
  }, m = _(
114
- () => l.value.restaurantIds.filter((e) => U.value.some((a) => a._id === e))
114
+ () => t.value.restaurantIds.filter((e) => U.value.some((a) => a._id === e))
115
115
  ), u = _(() => U.value.length > 0 && U.value.length === m.value.length), h = () => {
116
- const e = l.value.restaurantIds.filter((a) => !m.value.includes(a));
117
- u.value === !0 ? l.value.restaurantIds = e : l.value.restaurantIds = U.value.map((a) => a._id);
118
- }, x = (e) => e.map((i) => i.value).every((i) => l.value.permissions.includes(i)), v = (e) => {
119
- const a = l.value.permissions.filter(
116
+ const e = t.value.restaurantIds.filter((a) => !m.value.includes(a));
117
+ u.value === !0 ? t.value.restaurantIds = e : t.value.restaurantIds = U.value.map((a) => a._id);
118
+ }, x = (e) => e.map((i) => i.value).every((i) => t.value.permissions.includes(i)), v = (e) => {
119
+ const a = t.value.permissions.filter(
120
120
  (i) => !e.map((N) => N.value).includes(i)
121
121
  );
122
- x(e) === !0 ? l.value.permissions = a : l.value.permissions = [...a, ...e.map((i) => i.value)];
122
+ x(e) === !0 ? t.value.permissions = a : t.value.permissions = [...a, ...e.map((i) => i.value)];
123
123
  };
124
124
  se(
125
- () => l.value.restaurantIds,
125
+ () => t.value.restaurantIds,
126
126
  (e) => {
127
127
  e.length > 0 && (ne.value = "");
128
128
  }
@@ -130,14 +130,14 @@ const Ae = { class: "fm-typo-en-title-md-600" }, Oe = { class: "space-y-40" }, J
130
130
  const B = Pe(
131
131
  () => {
132
132
  var e, a, i, N;
133
- return !le.isEqual(l.value.name, ((e = p.value) == null ? void 0 : e.name) || E().name) || !le.isEqual(
134
- l.value.restaurantIds,
133
+ return !te.isEqual(t.value.name, ((e = p.value) == null ? void 0 : e.name) || E().name) || !te.isEqual(
134
+ t.value.restaurantIds,
135
135
  ((a = p.value) == null ? void 0 : a.restaurants.map((K) => K.id)) || E().restaurantIds
136
- ) || !le.isEqual(
137
- l.value.permissions,
136
+ ) || !te.isEqual(
137
+ t.value.permissions,
138
138
  ((i = p.value) == null ? void 0 : i.permissions.map((K) => W(K).value)) || E().permissions
139
- ) || !le.isEqual(
140
- l.value.maxDiscountPercentage,
139
+ ) || !te.isEqual(
140
+ t.value.maxDiscountPercentage,
141
141
  p.value ? _e((N = p.value) == null ? void 0 : N.permissions) : E().maxDiscountPercentage
142
142
  );
143
143
  },
@@ -149,7 +149,7 @@ const Ae = { class: "fm-typo-en-title-md-600" }, Oe = { class: "space-y-40" }, J
149
149
  show: b,
150
150
  trigger: re
151
151
  }), (e, a) => {
152
- const i = C("FmTextField"), N = C("FmCircularProgress"), K = C("FmSearch"), ee = C("FmCheckbox"), we = C("FmFormGroup"), Ve = C("FmCard"), ce = C("fm-button"), ke = C("fm-side-sheet");
152
+ const i = R("FmTextField"), N = R("FmCircularProgress"), K = R("FmSearch"), ee = R("FmCheckbox"), we = R("FmFormGroup"), Ve = R("FmCard"), ce = R("fm-button"), ke = R("fm-side-sheet");
153
153
  return d(), L(ke, {
154
154
  id: "unit-form",
155
155
  modelValue: b.value,
@@ -187,8 +187,8 @@ const Ae = { class: "fm-typo-en-title-md-600" }, Oe = { class: "space-y-40" }, J
187
187
  c(ie, { title: "Role detail" }, {
188
188
  default: y(() => [
189
189
  c(i, {
190
- modelValue: l.value.name,
191
- "onUpdate:modelValue": a[0] || (a[0] = (n) => l.value.name = n),
190
+ modelValue: t.value.name,
191
+ "onUpdate:modelValue": a[0] || (a[0] = (n) => t.value.name = n),
192
192
  autofocus: "",
193
193
  rules: [(n) => !!n || o(s)("hr.role.form.required")],
194
194
  label: o(s)("hr.role.form.name"),
@@ -210,8 +210,8 @@ const Ae = { class: "fm-typo-en-title-md-600" }, Oe = { class: "space-y-40" }, J
210
210
  placeholder: o(s)("hr.restaurant.search.placeholder")
211
211
  }, null, 8, ["modelValue", "placeholder"]),
212
212
  c(we, {
213
- modelValue: l.value.restaurantIds,
214
- "onUpdate:modelValue": a[3] || (a[3] = (n) => l.value.restaurantIds = n),
213
+ modelValue: t.value.restaurantIds,
214
+ "onUpdate:modelValue": a[3] || (a[3] = (n) => t.value.restaurantIds = n),
215
215
  rules: [(n) => n.length > 0 || o(s)("hr.role.form.atLeastOneRestaurant")]
216
216
  }, {
217
217
  default: y(() => [
@@ -224,12 +224,12 @@ const Ae = { class: "fm-typo-en-title-md-600" }, Oe = { class: "space-y-40" }, J
224
224
  disabled: g.value,
225
225
  "onUpdate:modelValue": h
226
226
  }, null, 8, ["model-value", "label", "disabled"])),
227
- (d(!0), V(A, null, te(U.value, (n) => (d(), V("div", {
227
+ (d(!0), V(A, null, le(U.value, (n) => (d(), V("div", {
228
228
  key: n._id
229
229
  }, [
230
230
  c(ee, {
231
- modelValue: l.value.restaurantIds,
232
- "onUpdate:modelValue": a[2] || (a[2] = (I) => l.value.restaurantIds = I),
231
+ modelValue: t.value.restaurantIds,
232
+ "onUpdate:modelValue": a[2] || (a[2] = (I) => t.value.restaurantIds = I),
233
233
  label: `${n.profile.code ? n.profile.code + "-" : ""}${n.profile.name}`,
234
234
  value: n._id,
235
235
  disabled: g.value
@@ -247,7 +247,7 @@ const Ae = { class: "fm-typo-en-title-md-600" }, Oe = { class: "space-y-40" }, J
247
247
  title: o(s)("hr.role.form.permissions")
248
248
  }, {
249
249
  default: y(() => [
250
- (d(!0), V(A, null, te(z.value, (n) => (d(), L(Ve, {
250
+ (d(!0), V(A, null, le(z.value, (n) => (d(), L(Ve, {
251
251
  key: n.title,
252
252
  variant: "outlined",
253
253
  class: "p-16"
@@ -266,26 +266,26 @@ const Ae = { class: "fm-typo-en-title-md-600" }, Oe = { class: "space-y-40" }, J
266
266
  disabled: g.value,
267
267
  "onUpdate:modelValue": (I) => v(n.options)
268
268
  }, null, 8, ["model-value", "label", "disabled", "onUpdate:modelValue"]),
269
- (d(!0), V(A, null, te(n.options, (I) => (d(), V("div", {
269
+ (d(!0), V(A, null, le(n.options, (I) => (d(), V("div", {
270
270
  key: I.value
271
271
  }, [
272
272
  c(ee, {
273
- modelValue: l.value.permissions,
274
- "onUpdate:modelValue": a[4] || (a[4] = (F) => l.value.permissions = F),
273
+ modelValue: t.value.permissions,
274
+ "onUpdate:modelValue": a[4] || (a[4] = (w) => t.value.permissions = w),
275
275
  label: I.label,
276
276
  value: I.value,
277
277
  disabled: g.value
278
278
  }, null, 8, ["modelValue", "label", "value", "disabled"]),
279
- I.value === "order:discount" && l.value.permissions.includes(I.value) ? (d(), V("div", We, [
279
+ I.value === "order:discount" && t.value.permissions.includes(I.value) ? (d(), V("div", We, [
280
280
  f("div", je, D(o(s)("hr.role.form.maxDiscountPercentage")), 1),
281
281
  c(i, {
282
- modelValue: l.value.maxDiscountPercentage,
283
- "onUpdate:modelValue": a[5] || (a[5] = (F) => l.value.maxDiscountPercentage = F),
282
+ modelValue: t.value.maxDiscountPercentage,
283
+ "onUpdate:modelValue": a[5] || (a[5] = (w) => t.value.maxDiscountPercentage = w),
284
284
  rules: [
285
- (F) => !!F || o(s)("hr.role.form.required"),
286
- (F) => !isNaN(F) || o(s)("hr.role.form.onlyContainsNumber"),
287
- (F) => F <= 100 || o(s)("hr.role.form.maxValueIs", { max: 100 }),
288
- (F) => F >= 0 || o(s)("hr.role.form.minValueIs", { min: 0 })
285
+ (w) => !!w || o(s)("hr.role.form.required"),
286
+ (w) => !isNaN(w) || o(s)("hr.role.form.onlyContainsNumber"),
287
+ (w) => w <= 100 || o(s)("hr.role.form.maxValueIs", { max: 100 }),
288
+ (w) => w >= 0 || o(s)("hr.role.form.minValueIs", { min: 0 })
289
289
  ],
290
290
  "append-text": "%",
291
291
  disabled: g.value
@@ -322,7 +322,7 @@ const Ae = { class: "fm-typo-en-title-md-600" }, Oe = { class: "space-y-40" }, J
322
322
  class: "text-fm-color-typo-secondary"
323
323
  }, as = {
324
324
  class: "flex"
325
- }, ls = {
325
+ }, ts = {
326
326
  class: "flex"
327
327
  }, gs = /* @__PURE__ */ ge({
328
328
  __name: "RoleList",
@@ -332,41 +332,41 @@ const Ae = { class: "fm-typo-en-title-md-600" }, Oe = { class: "space-y-40" }, J
332
332
  const {
333
333
  t: s
334
334
  } = ye(), {
335
- allReportPermissions: w
336
- } = Fe(), $ = me(), U = _(() => $.restaurants.value), O = _(() => U.value.map((t) => t._id));
337
- function T(t, r) {
338
- const m = r === k.F_RULE_SUBJECT.enum.report ? w.value : void 0, u = ae(t, r, m);
335
+ allReportPermissions: C
336
+ } = Fe(), $ = me(), U = _(() => $.restaurants.value), O = _(() => U.value.map((l) => l._id));
337
+ function T(l, r) {
338
+ const m = r === k.F_RULE_SUBJECT.enum.report ? C.value : void 0, u = ae(l, r, m);
339
339
  return ["-", "All"].includes(u) ? () => null : () => S(ue.FmTooltip, {
340
340
  "z-index": "999",
341
341
  placement: "top",
342
342
  class: "ml-2"
343
343
  }, {
344
- content: () => S("div", [s("hr.role.tooltip.labels.permission"), ...t.filter((h) => h.subject === r).map((h) => S("div", ["- ", W(h).label]))]),
344
+ content: () => S("div", [s("hr.role.tooltip.labels.permission"), ...l.filter((h) => h.subject === r).map((h) => S("div", ["- ", W(h).label]))]),
345
345
  default: () => S(ue.FmIcon, {
346
346
  name: "info",
347
347
  color: Ie.NeutralGray400
348
348
  })
349
349
  });
350
350
  }
351
- function H(t, r) {
352
- const m = r === k.F_RULE_SUBJECT.enum.report ? w.value : void 0, u = ae(t, r, m);
351
+ function H(l, r) {
352
+ const m = r === k.F_RULE_SUBJECT.enum.report ? C.value : void 0, u = ae(l, r, m);
353
353
  return () => u === "All" ? u : S("div", {
354
354
  class: "flex items-center"
355
- }, [u, T(t, r)()]);
355
+ }, [u, T(l, r)()]);
356
356
  }
357
- function Q(t) {
357
+ function Q(l) {
358
358
  return [{
359
359
  label: s("hr.role.form.update"),
360
- onClick: () => M(t)
360
+ onClick: () => M(l)
361
361
  }, {
362
362
  label: s("hr.role.remove.title"),
363
- onClick: () => E(t),
363
+ onClick: () => E(l),
364
364
  itemClass: "text-fm-color-typo-error",
365
- disabled: Ce(t.permissions)
365
+ disabled: Re(l.permissions)
366
366
  }];
367
367
  }
368
368
  const X = ({
369
- role: t,
369
+ role: l,
370
370
  className: r = ""
371
371
  }) => c("div", {
372
372
  class: r,
@@ -374,7 +374,7 @@ const Ae = { class: "fm-typo-en-title-md-600" }, Oe = { class: "space-y-40" }, J
374
374
  m.stopPropagation();
375
375
  }
376
376
  }, [c(he, {
377
- items: Q(t)
377
+ items: Q(l)
378
378
  }, null)]), oe = [{
379
379
  accessorKey: "name",
380
380
  header: () => s("hr.role.columns.name"),
@@ -382,17 +382,17 @@ const Ae = { class: "fm-typo-en-title-md-600" }, Oe = { class: "space-y-40" }, J
382
382
  }, {
383
383
  accessorKey: "operation",
384
384
  header: () => s("hr.role.columns.operation"),
385
- cell: (t) => S(H(t.row.original.permissions, k.F_RULE_SUBJECT.enum.order)),
385
+ cell: (l) => S(H(l.row.original.permissions, k.F_RULE_SUBJECT.enum.order)),
386
386
  enableSorting: !1
387
387
  }, {
388
388
  accessorKey: "report",
389
389
  header: () => s("hr.role.columns.report"),
390
- cell: (t) => S(H(t.row.original.permissions, k.F_RULE_SUBJECT.enum.report)),
390
+ cell: (l) => S(H(l.row.original.permissions, k.F_RULE_SUBJECT.enum.report)),
391
391
  enableSorting: !1
392
392
  }, {
393
393
  accessorKey: "restaurants",
394
394
  header: () => s("hr.role.columns.restaurants"),
395
- cell: (t) => t.row.original.restaurants.map((r, m) => {
395
+ cell: (l) => l.row.original.restaurants.map((r, m) => {
396
396
  const u = r.code, h = `${u ? u + " - " : ""}${r.name}`;
397
397
  return S("div", (m ? `
398
398
  ` : "") + h);
@@ -405,16 +405,16 @@ const Ae = { class: "fm-typo-en-title-md-600" }, Oe = { class: "space-y-40" }, J
405
405
  cellClass: "pl-16",
406
406
  headerContentClass: "-mx-16"
407
407
  },
408
- cell: (t) => X({
409
- role: t.row.original,
408
+ cell: (l) => X({
409
+ role: l.row.original,
410
410
  className: "flex w-full items-center justify-end"
411
411
  })
412
- }], M = async (t) => {
412
+ }], M = async (l) => {
413
413
  var r;
414
- g.value = t._id, await fe(), (r = z.value) == null || r.trigger();
415
- }, R = Re(), b = Ne(), re = _(() => {
416
- const t = R.roles.value || [];
417
- return (O.value.length === 0 ? t : t.filter((m) => m.restaurants.some((u) => O.value.includes(u.id)))).map((m) => {
414
+ g.value = l._id, await fe(), (r = z.value) == null || r.trigger();
415
+ }, F = Ce(), b = Ne(), re = _(() => {
416
+ const l = F.roles.value || [];
417
+ return (O.value.length === 0 ? l : l.filter((m) => m.restaurants.some((u) => O.value.includes(u.id)))).map((m) => {
418
418
  const u = m.restaurants.map((h) => {
419
419
  const x = b.value[h.id];
420
420
  return {
@@ -433,7 +433,7 @@ const Ae = { class: "fm-typo-en-title-md-600" }, Oe = { class: "space-y-40" }, J
433
433
  }), J = _(() => {
434
434
  var r;
435
435
  return (r = re.value) == null ? void 0 : r.filter((m) => {
436
- const u = l.value.toLowerCase(), h = m.name.toLowerCase().includes(u), v = (m.restaurants || []).some((B) => {
436
+ const u = t.value.toLowerCase(), h = m.name.toLowerCase().includes(u), v = (m.restaurants || []).some((B) => {
437
437
  var e;
438
438
  return B.name.toLowerCase().includes(u) || ((e = B.code) == null ? void 0 : e.toLowerCase().includes(u));
439
439
  });
@@ -441,11 +441,11 @@ const Ae = { class: "fm-typo-en-title-md-600" }, Oe = { class: "space-y-40" }, J
441
441
  });
442
442
  }), Y = Ue(), q = xe(), {
443
443
  breakpoints: p
444
- } = Ee(), E = (t) => {
444
+ } = Ee(), E = (l) => {
445
445
  Y.open({
446
446
  title: s("hr.role.remove.title"),
447
447
  message: s("hr.role.remove.message", {
448
- name: t.name
448
+ name: l.name
449
449
  }),
450
450
  minWidth: p.value.lg ? 588 : 0,
451
451
  primaryActions: {
@@ -458,9 +458,9 @@ const Ae = { class: "fm-typo-en-title-md-600" }, Oe = { class: "space-y-40" }, J
458
458
  close: !0
459
459
  }
460
460
  }).onPrimary(async () => {
461
- await R.deleteRole(t).then(() => q.open({
461
+ await F.deleteRole(l).then(() => q.open({
462
462
  message: s("hr.role.remove.successMessage", {
463
- name: t.name
463
+ name: l.name
464
464
  }),
465
465
  type: "success"
466
466
  })).catch((r) => q.open({
@@ -468,32 +468,32 @@ const Ae = { class: "fm-typo-en-title-md-600" }, Oe = { class: "space-y-40" }, J
468
468
  type: "error"
469
469
  })), Y.close();
470
470
  });
471
- }, l = P(""), z = P(), g = P(void 0);
471
+ }, t = P(""), z = P(), g = P(void 0);
472
472
  async function Z() {
473
- var t;
474
- g.value = void 0, await fe(), (t = z.value) == null || t.trigger();
473
+ var l;
474
+ g.value = void 0, await fe(), (l = z.value) == null || l.trigger();
475
475
  }
476
476
  async function ne() {
477
- R.roles.value.length === 0 && await R.readRoles();
477
+ F.roles.value.length === 0 && await F.readRoles();
478
478
  }
479
479
  return be(() => {
480
480
  ne();
481
481
  }), G({
482
482
  create: Z
483
- }), (t, r) => {
484
- const m = C("FmSearch"), u = C("FmTable"), h = C("FmListItem"), x = C("FmList");
483
+ }), (l, r) => {
484
+ const m = R("FmSearch"), u = R("FmTable"), h = R("FmListItem"), x = R("FmList");
485
485
  return d(), V(A, null, [(d(), L(He, {
486
486
  id: g.value,
487
487
  key: g.value,
488
488
  ref_key: "roleFormRef",
489
489
  ref: z
490
490
  }, null, 8, ["id"])), f("div", Qe, [f("div", Xe, [c(m, {
491
- modelValue: l.value,
492
- "onUpdate:modelValue": r[0] || (r[0] = (v) => l.value = v),
491
+ modelValue: t.value,
492
+ "onUpdate:modelValue": r[0] || (r[0] = (v) => t.value = v),
493
493
  class: "w-[320px] xs:w-full",
494
494
  autofocus: "",
495
495
  placeholder: o(s)("hr.role.search.placeholder") + " / " + o(s)("hr.restaurant.search.placeholder")
496
- }, null, 8, ["modelValue", "placeholder"])]), o(R).roles.value.length > 0 || o(R).isLoading.value ? (d(), L(Se, {
496
+ }, null, 8, ["modelValue", "placeholder"])]), o(F).roles.value.length > 0 || o(F).isLoading.value ? (d(), L(Se, {
497
497
  key: 0,
498
498
  class: "overflow-auto"
499
499
  }, {
@@ -502,7 +502,7 @@ const Ae = { class: "fm-typo-en-title-md-600" }, Oe = { class: "space-y-40" }, J
502
502
  "column-defs": oe,
503
503
  "row-data": J.value,
504
504
  "page-size": J.value.length,
505
- loading: o(R).isLoading.value,
505
+ loading: o(F).isLoading.value,
506
506
  "pin-header-row": "",
507
507
  "hide-footer": "",
508
508
  "shrink-at": !1,
@@ -510,7 +510,7 @@ const Ae = { class: "fm-typo-en-title-md-600" }, Oe = { class: "space-y-40" }, J
510
510
  }, null, 8, ["row-data", "page-size", "loading"]), f("div", Ye, [c(x, {
511
511
  separator: ""
512
512
  }, {
513
- default: y(() => [(d(!0), V(A, null, te(J.value, (v) => (d(), L(h, {
513
+ default: y(() => [(d(!0), V(A, null, le(J.value, (v) => (d(), L(h, {
514
514
  key: v._id,
515
515
  class: "py-12 px-16 items-center justify-between",
516
516
  onClick: (B) => M(v)
@@ -519,8 +519,8 @@ const Ae = { class: "fm-typo-en-title-md-600" }, Oe = { class: "space-y-40" }, J
519
519
  items: v.restaurants.map((B) => B.name).join(", ")
520
520
  })), 1), f("p", as, [pe(D(o(s)("hr.role.labels.operationList", {
521
521
  items: o(ae)(v.permissions, o(k.F_RULE_SUBJECT).enum.order)
522
- })) + " ", 1), (d(), L(ve(T(v.permissions, o(k.F_RULE_SUBJECT).enum.order))))]), f("p", ls, [pe(D(o(s)("hr.role.labels.reportList", {
523
- items: o(ae)(v.permissions, o(k.F_RULE_SUBJECT).enum.report, o(w))
522
+ })) + " ", 1), (d(), L(ve(T(v.permissions, o(k.F_RULE_SUBJECT).enum.order))))]), f("p", ts, [pe(D(o(s)("hr.role.labels.reportList", {
523
+ items: o(ae)(v.permissions, o(k.F_RULE_SUBJECT).enum.report, o(C))
524
524
  })) + " ", 1), (d(), L(ve(T(v.permissions, o(k.F_RULE_SUBJECT).enum.report))))])])]), f("div", {
525
525
  onClick: r[2] || (r[2] = Le(() => {
526
526
  }, ["stop"]))