@feedmepos/mf-hrm-portal 2.3.0-dev.2 → 2.3.0-dev.21

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 (127) hide show
  1. package/dist/{ApprovalCodeList-CJaNPHZC.js → ApprovalCodeList-DuPmMQ8Z.js} +7 -7
  2. package/dist/{AuditLogList-CHA98ZqW.js → AuditLogList-BeRA_284.js} +18 -19
  3. package/dist/{ConditionBuilderForm.vue_vue_type_script_setup_true_lang-C7rvthEI.js → ConditionBuilderForm.vue_vue_type_script_setup_true_lang-StnBAQOk.js} +2 -2
  4. package/dist/{EmployeeList-CVmMKt71.js → EmployeeList-qmjsbCjj.js} +255 -266
  5. package/dist/{FormItem.vue_vue_type_script_setup_true_lang-CUnlKsxk.js → FormItem.vue_vue_type_script_setup_true_lang-oQJgMciC.js} +6 -6
  6. package/dist/{GrantUserList-MYjgt5-F.js → GrantUserList--WUK7zrV.js} +8 -8
  7. package/dist/{Main-hlcHtrsc.js → Main-9X2iCXoX.js} +5 -5
  8. package/dist/{Main-C0cnqQ3B.js → Main-BIAeEQV9.js} +8 -8
  9. package/dist/{Main-BgB9lD4K.js → Main-tPL_YTwT.js} +11 -11
  10. package/dist/{PermissionSetList-5f1WIaVa.js → PermissionSetList-ByTyQe0s.js} +19 -18
  11. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Bp9WwlnI.js +4167 -0
  12. package/dist/{PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-fe-Rdwn4.js → PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-DQcgZ0nF.js} +1 -1
  13. package/dist/ResponsiveContextMenu.vue_vue_type_script_setup_true_lang-mSJFKo7r.js +132 -0
  14. package/dist/{RoleList-DNR4miXr.js → RoleList-INlydQmP.js} +21 -20
  15. package/dist/ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-d8KDvgNu.js +530 -0
  16. package/dist/ScheduleGeneralPage-DbOoP9Ez.js +776 -0
  17. package/dist/ScheduleModal.vue_vue_type_script_setup_true_lang-UowMybGr.js +2439 -0
  18. package/dist/SchedulePage-CjOZtRlK.js +19291 -0
  19. package/dist/{SchedulePositionPage-DyRckyUx.js → SchedulePositionPage-CnDqkvL9.js} +78 -80
  20. package/dist/{SelectFilter-CG13h83-.js → SelectFilter-BWw4B9tM.js} +1 -1
  21. package/dist/{TeamMemberList-mw5OveZG.js → TeamMemberList-BgYtoXht.js} +27 -27
  22. package/dist/{TimesheetList-BzXarZbM.js → TimesheetList-Dg0QYsWO.js} +52 -53
  23. package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-Dq5i4poN.js → TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-eTd4J1CB.js} +3 -3
  24. package/dist/{app-DSsdRLHg.js → app-CDo04LrB.js} +2891 -2474
  25. package/dist/app.js +1 -1
  26. package/dist/{approval-code-C9DmR4Md.js → approval-code-BXUiojPH.js} +1 -1
  27. package/dist/{dayjs.min-B6xBXQtU.js → dayjs.min-KFBmxZF3.js} +1 -1
  28. package/dist/{employee-hMhzuqk1.js → employee-BRaYoaOY.js} +4 -4
  29. package/dist/{grant-user-Bv-pJ9Wt.js → grant-user-CBJ3gEgW.js} +1 -1
  30. package/dist/{iteration-B34AvpNC.js → iteration-p-TjO05t.js} +1 -1
  31. package/dist/{lodash-1Vyuy7Mu.js → lodash-D72lpJgs.js} +1 -1
  32. package/dist/object-Dwyg2LgX.js +16 -0
  33. package/dist/{restaurant-D7PEQjPY.js → restaurant-D2mfKHaH.js} +48 -48
  34. package/dist/{role-DKOrgO6f.js → role-a35Vc8gC.js} +2 -2
  35. package/dist/{rule-CBzQ3GeV.js → rule-BRRw0K7p.js} +3 -3
  36. package/dist/src/api/schedule/index.d.ts +9 -1
  37. package/dist/src/components/layout/SchedulePromoBanner.vue.d.ts +2 -0
  38. package/dist/src/composables/useDiscardConfirm.d.ts +3 -1
  39. package/dist/src/types/schedule.d.ts +3 -4
  40. package/dist/src/views/audit-log/locales/index.d.ts +252 -0
  41. package/dist/src/views/scheduling/components/ScheduleAreaRows.vue.d.ts +4 -8
  42. package/dist/src/views/scheduling/components/ScheduleBoardAreaRows.vue.d.ts +1 -4
  43. package/dist/src/views/scheduling/components/ScheduleBoardEditOverlays.vue.d.ts +0 -2
  44. package/dist/src/views/scheduling/components/ScheduleBoardEmployeeRows.vue.d.ts +0 -7
  45. package/dist/src/views/scheduling/components/ScheduleBoardGridHeader.vue.d.ts +5 -0
  46. package/dist/src/views/scheduling/components/ScheduleBoardInteractionOverlays.vue.d.ts +0 -6
  47. package/dist/src/views/scheduling/components/ScheduleBoardOnboardingOverlays.vue.d.ts +1 -0
  48. package/dist/src/views/scheduling/components/ScheduleBoardToolbar.vue.d.ts +0 -1
  49. package/dist/src/views/scheduling/components/ScheduleConfirmModal.vue.d.ts +4 -1
  50. package/dist/src/views/scheduling/components/ScheduleContextMenu.vue.d.ts +1 -5
  51. package/dist/src/views/scheduling/components/ScheduleDayTimeline.vue.d.ts +5 -0
  52. package/dist/src/views/scheduling/components/ScheduleLoadState.vue.d.ts +0 -1
  53. package/dist/src/views/scheduling/components/{ScheduleAssignEmployeePopover.vue.d.ts → ScheduleOnboardingAssignPositionModal.vue.d.ts} +2 -2
  54. package/dist/src/views/scheduling/components/ScheduleOnboardingSettings.vue.d.ts +6 -0
  55. package/dist/src/views/scheduling/components/SchedulePublishShareArt.vue.d.ts +2 -0
  56. package/dist/src/views/scheduling/components/ScheduleSelect.vue.d.ts +10 -0
  57. package/dist/src/views/scheduling/components/ScheduleStaffRows.vue.d.ts +0 -10
  58. package/dist/src/views/scheduling/composables/onboarding-types.d.ts +2 -1
  59. package/dist/src/views/scheduling/composables/remyPrompt.d.ts +4 -2
  60. package/dist/src/views/scheduling/composables/schedule-add-employee-form.d.ts +12 -8
  61. package/dist/src/views/scheduling/composables/schedule-board-helpers.d.ts +4 -0
  62. package/dist/src/views/scheduling/composables/schedule-day-meta.d.ts +1 -3
  63. package/dist/src/views/scheduling/composables/schedule-demand-domain.d.ts +13 -1
  64. package/dist/src/views/scheduling/composables/schedule-error.d.ts +1 -0
  65. package/dist/src/views/scheduling/composables/schedule-quick-pick.d.ts +22 -0
  66. package/dist/src/views/scheduling/composables/schedule-shift-time.d.ts +3 -0
  67. package/dist/src/views/scheduling/composables/useRemyAppStore.d.ts +6 -0
  68. package/dist/src/views/scheduling/composables/useScheduleAddEmployee.d.ts +29 -11
  69. package/dist/src/views/scheduling/composables/useScheduleAddPick.d.ts +3 -11
  70. package/dist/src/views/scheduling/composables/useScheduleAreaBoard.d.ts +0 -13
  71. package/dist/src/views/scheduling/composables/useScheduleAreaDragDrop.d.ts +2 -9
  72. package/dist/src/views/scheduling/composables/useScheduleAutoSchedule.d.ts +11 -3
  73. package/dist/src/views/scheduling/composables/useScheduleBoard.d.ts +86 -11
  74. package/dist/src/views/scheduling/composables/useScheduleCopyWeek.d.ts +3 -10
  75. package/dist/src/views/scheduling/composables/useScheduleCostRail.d.ts +13 -1
  76. package/dist/src/views/scheduling/composables/useScheduleDayNote.d.ts +0 -1
  77. package/dist/src/views/scheduling/composables/useScheduleDayTimeline.d.ts +16 -5
  78. package/dist/src/views/scheduling/composables/useScheduleDemand.d.ts +3 -5
  79. package/dist/src/views/scheduling/composables/useScheduleDemandSheet.d.ts +13 -3
  80. package/dist/src/views/scheduling/composables/useScheduleDragDrop.d.ts +1 -0
  81. package/dist/src/views/scheduling/composables/useScheduleEmployeeAccess.d.ts +20 -7
  82. package/dist/src/views/scheduling/composables/useScheduleEmployeeAvailability.d.ts +1 -1
  83. package/dist/src/views/scheduling/composables/useScheduleEmployeeCandidates.d.ts +5 -1
  84. package/dist/src/views/scheduling/composables/useScheduleEmployeePersistence.d.ts +5 -0
  85. package/dist/src/views/scheduling/composables/useScheduleEmployeeValidation.d.ts +2 -2
  86. package/dist/src/views/scheduling/composables/useScheduleGapPopover.d.ts +2 -0
  87. package/dist/src/views/scheduling/composables/useScheduleOnboardingDemand.d.ts +1 -1
  88. package/dist/src/views/scheduling/composables/useScheduleOnboardingEmployees.d.ts +47 -3
  89. package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +408 -29
  90. package/dist/src/views/scheduling/composables/useScheduleOutlet.d.ts +11 -8
  91. package/dist/src/views/scheduling/composables/useSchedulePageCellDrop.d.ts +3 -1
  92. package/dist/src/views/scheduling/composables/useSchedulePageClearActions.d.ts +1 -0
  93. package/dist/src/views/scheduling/composables/useSchedulePageOverlays.d.ts +0 -4
  94. package/dist/src/views/scheduling/composables/useSchedulePositionModal.d.ts +1 -0
  95. package/dist/src/views/scheduling/composables/useSchedulePositions.d.ts +7 -1
  96. package/dist/src/views/scheduling/composables/useSchedulePublish.d.ts +2 -0
  97. package/dist/src/views/scheduling/composables/useScheduleRoster.d.ts +70 -4
  98. package/dist/src/views/scheduling/composables/useScheduleSettings.d.ts +7 -2
  99. package/dist/src/views/scheduling/composables/useScheduleSetupBanner.d.ts +2 -2
  100. package/dist/src/views/scheduling/composables/useScheduleShiftActions.d.ts +41 -3
  101. package/dist/src/views/scheduling/composables/useScheduleShiftDraft.d.ts +1 -0
  102. package/dist/src/views/scheduling/composables/useScheduleShiftPopover.d.ts +47 -6
  103. package/dist/src/views/scheduling/country-rules/index.d.ts +9 -4
  104. package/dist/src/views/scheduling/data.d.ts +22 -1
  105. package/dist/src/views/scheduling/locales/index.d.ts +28 -0
  106. package/dist/src/views/scheduling/schedule-state.d.ts +272 -208
  107. package/dist/src/views/scheduling/schedule-store.d.ts +36 -11
  108. package/dist/src/views/scheduling/types.d.ts +30 -5
  109. package/dist/style.css +1 -1
  110. package/dist/tsconfig.app.tsbuildinfo +1 -1
  111. package/dist/{useAppStore-d_nHyK5u.js → useAppStore-DZCdxlCd.js} +1 -1
  112. package/dist/useDiscardConfirm-CzZSPyvh.js +28 -0
  113. package/dist/{useLoading-JFoghhRz.js → useLoading-Nygx2zn8.js} +1 -1
  114. package/dist/{useReportPermissions-B2ev0j4w.js → useReportPermissions-Ca-9DEOI.js} +3 -3
  115. package/package.json +1 -1
  116. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CFoTAGIX.js +0 -4167
  117. package/dist/ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-B4VUyKW3.js +0 -470
  118. package/dist/ScheduleGeneralPage-Cd5AlY4z.js +0 -666
  119. package/dist/ScheduleModal.vue_vue_type_script_setup_true_lang-Cf0l2MRg.js +0 -2188
  120. package/dist/SchedulePage-C8m0-m3l.js +0 -18257
  121. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  122. package/dist/src/views/scheduling/components/ScheduleAllShiftsRow.vue.d.ts +0 -22
  123. package/dist/src/views/scheduling/components/ScheduleStackPopover.vue.d.ts +0 -14
  124. package/dist/src/views/scheduling/composables/useScheduleAllShiftsRow.d.ts +0 -77
  125. package/dist/src/views/scheduling/composables/useScheduleAssign.d.ts +0 -124
  126. package/dist/src/views/scheduling/composables/useScheduleOpenShiftCard.d.ts +0 -23
  127. package/dist/useDiscardConfirm-DPhEV6v0.js +0 -157
@@ -1,35 +1,24 @@
1
- import { toRaw as Ke, defineComponent as Fe, ref as v, computed as h, watch as X, resolveComponent as E, createElementBlock as ee, openBlock as g, Fragment as Ie, renderSlot as Ge, createVNode as i, unref as l, withCtx as y, createElementVNode as f, createBlock as I, createCommentVNode as j, toDisplayString as q, onUnmounted as Be, isRef as we, normalizeClass as ke, createTextVNode as ge, withModifiers as je, resolveDynamicComponent as qe, h as ie } from "vue";
2
- import { useI18n as Re, useCoreStore as He } from "@feedmepos/mf-common";
3
- import { useSnackbar as Me, components as $e, useDialog as Je, useBreakpoints as We } from "@feedmepos/ui-library";
4
- import { S as ue } from "./SelectFilter-CG13h83-.js";
5
- import { _ as Qe, a as Ye } from "./app-DSsdRLHg.js";
6
- import { _ as xe, u as Ze, H as Xe } from "./FormItem.vue_vue_type_script_setup_true_lang-CUnlKsxk.js";
7
- import { u as ea, _ as aa } from "./useDiscardConfirm-DPhEV6v0.js";
8
- import { _ as la } from "./TableEmptyState.vue_vue_type_script_setup_true_lang-IfAZmWr0.js";
9
- import { s as sa, _ as ta, a as oa, b as ra, c as Ee } from "./PasscodePinField.vue_vue_type_script_setup_true_lang-CqG0v0Sz.js";
10
- import { u as na } from "./useDebounce-B8ZPVS5C.js";
11
- import { n as ia } from "./string-VNuQNweN.js";
12
- import { u as Le, E as ua } from "./employee-hMhzuqk1.js";
13
- import { u as Pe } from "./restaurant-D7PEQjPY.js";
14
- import { l as ca } from "./lodash-1Vyuy7Mu.js";
15
- import { _ as Ve } from "./FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js";
16
- import { u as De } from "./useLoading-JFoghhRz.js";
17
- import { u as he } from "./role-DKOrgO6f.js";
1
+ import { defineComponent as Ce, ref as v, computed as h, watch as Z, resolveComponent as E, createElementBlock as X, openBlock as g, Fragment as Ue, renderSlot as Ke, createVNode as i, unref as l, withCtx as y, createElementVNode as f, createBlock as I, createCommentVNode as B, toDisplayString as j, onUnmounted as Oe, isRef as be, normalizeClass as ke, createTextVNode as ye, withModifiers as Ge, resolveDynamicComponent as Be, h as ne } from "vue";
2
+ import { useI18n as Fe, useCoreStore as je } from "@feedmepos/mf-common";
3
+ import { useSnackbar as Ie, components as Me, useDialog as qe, useBreakpoints as He } from "@feedmepos/ui-library";
4
+ import { S as ie } from "./SelectFilter-BWw4B9tM.js";
5
+ import { _ as We, b as Je, a as Qe } from "./app-CDo04LrB.js";
6
+ import { _ as we, u as Ye, H as Ze } from "./FormItem.vue_vue_type_script_setup_true_lang-oQJgMciC.js";
7
+ import { _ as Xe } from "./ResponsiveContextMenu.vue_vue_type_script_setup_true_lang-mSJFKo7r.js";
8
+ import { _ as ea } from "./TableEmptyState.vue_vue_type_script_setup_true_lang-IfAZmWr0.js";
9
+ import { s as aa, _ as la, a as sa, b as ta, c as xe } from "./PasscodePinField.vue_vue_type_script_setup_true_lang-CqG0v0Sz.js";
10
+ import { u as oa } from "./useDebounce-B8ZPVS5C.js";
11
+ import { n as ra } from "./string-VNuQNweN.js";
12
+ import { u as Re, E as na } from "./employee-BRaYoaOY.js";
13
+ import { u as $e } from "./restaurant-D2mfKHaH.js";
14
+ import { l as ia } from "./lodash-D72lpJgs.js";
15
+ import { _ as Ee } from "./FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js";
16
+ import { u as ua } from "./useDiscardConfirm-CzZSPyvh.js";
17
+ import { u as Le } from "./useLoading-Nygx2zn8.js";
18
+ import { c as Ve } from "./object-Dwyg2LgX.js";
19
+ import { u as ge } from "./role-a35Vc8gC.js";
18
20
  /* empty css */
19
- import { _ as ma } from "./_plugin-vue_export-helper-CHgC5LLL.js";
20
- function Se($) {
21
- return JSON.parse(JSON.stringify($));
22
- }
23
- function Ce($) {
24
- if (typeof structuredClone > "u")
25
- return Se($);
26
- try {
27
- return structuredClone(Ke($));
28
- } catch {
29
- return Se($);
30
- }
31
- }
32
- const da = { class: "flex w-full items-center justify-between" }, pa = { class: "fm-typo-en-title-md-600" }, fa = { class: "space-y-40" }, va = { class: "flex flex-row gap-16" }, ya = { class: "space-y-16" }, ga = { class: "flex gap-8 items-center justify-start" }, Ue = 4, ha = /* @__PURE__ */ Fe({
21
+ const ma = { class: "flex w-full items-center justify-between" }, ca = { class: "fm-typo-en-title-md-600" }, da = { class: "space-y-40" }, pa = { class: "flex flex-row gap-16" }, fa = { class: "space-y-16" }, va = { class: "flex gap-8 items-center justify-start" }, Se = 4, ya = /* @__PURE__ */ Ce({
33
22
  __name: "EmployeeForm",
34
23
  props: {
35
24
  roleErrorMessage: {
@@ -38,30 +27,30 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
38
27
  }
39
28
  },
40
29
  emits: ["submitted"],
41
- setup($, { expose: ce, emit: n }) {
42
- const k = he(), d = Pe(), C = Le(), me = Me(), U = De(me), de = n, { t: c } = Re(), V = v(!1), R = v(!0);
43
- function O() {
30
+ setup(Pe, { expose: ue, emit: n }) {
31
+ const w = ge(), d = $e(), C = Re(), me = Ie(), U = Le(me), ce = n, { t: m } = Fe(), V = v(!1), M = v(!0);
32
+ function A() {
44
33
  return {
45
34
  restaurantId: "",
46
35
  roleId: ""
47
36
  };
48
37
  }
49
- function pe(u) {
38
+ function de(u) {
50
39
  if (!u) return _();
51
- const o = Ce(u);
40
+ const o = Ve(u);
52
41
  return {
53
42
  code: o.code ?? "",
54
43
  isMasterUser: o.isMasterUser ?? !1,
55
44
  name: o.name ?? "",
56
45
  passcode: o.passcode ?? "",
57
- restaurants: o.restaurants.length > 0 ? o.restaurants.map(({ restaurantId: w, roleId: S }) => ({
58
- restaurantId: w,
46
+ restaurants: o.restaurants.length > 0 ? o.restaurants.map(({ restaurantId: k, roleId: S }) => ({
47
+ restaurantId: k,
59
48
  roleId: S
60
- })) : [O()]
49
+ })) : [A()]
61
50
  };
62
51
  }
63
- const ae = (u) => {
64
- s.value = pe(u), b.value = Ce(s.value), J.value = u == null ? void 0 : u._id, F.value = [], s.value.passcode ? (F.value = s.value.passcode.split(""), P.value = !0) : P.value = !1, R.value = !u, V.value = !0;
52
+ const ee = (u) => {
53
+ s.value = de(u), b.value = Ve(s.value), H.value = u == null ? void 0 : u._id, F.value = [], s.value.passcode ? (F.value = s.value.passcode.split(""), L.value = !0) : L.value = !1, M.value = !u, V.value = !0;
65
54
  };
66
55
  function _() {
67
56
  return {
@@ -69,41 +58,41 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
69
58
  isMasterUser: !1,
70
59
  name: "",
71
60
  passcode: "",
72
- restaurants: [O()]
61
+ restaurants: [A()]
73
62
  };
74
63
  }
75
- const T = h(() => R.value ? c("hr.employee.form.add") : c("hr.employee.form.update")), H = h(() => R.value ? c("common.create") : c("common.update")), b = v(_()), s = v(_()), J = v(void 0), L = h(
76
- () => sa(s.value.restaurants)
64
+ const T = h(() => M.value ? m("hr.employee.form.add") : m("hr.employee.form.update")), q = h(() => M.value ? m("common.create") : m("common.update")), b = v(_()), s = v(_()), H = v(void 0), $ = h(
65
+ () => aa(s.value.restaurants)
77
66
  );
78
- function le(u) {
67
+ function ae(u) {
79
68
  var o;
80
- return u ? !((o = d.restaurants.value.find((w) => w._id === u)) != null && o.managable) : !1;
69
+ return u ? !((o = d.restaurants.value.find((k) => k._id === u)) != null && o.managable) : !1;
81
70
  }
82
- function se(u) {
71
+ function le(u) {
83
72
  return u.isUsable;
84
73
  }
85
- const F = v([]), P = v(!1), z = v(!1), W = v(!1), te = h(() => L.value.length > 0);
86
- async function D() {
87
- if (te.value)
74
+ const F = v([]), L = v(!1), z = v(!1), W = v(!1), se = h(() => $.value.length > 0);
75
+ async function P() {
76
+ if (se.value)
88
77
  try {
89
78
  const u = await U.custom(
90
- () => ua.generateEmployeePasscode({
91
- restaurantIds: L.value,
92
- excludePosUserId: J.value
79
+ () => na.generateEmployeePasscode({
80
+ restaurantIds: $.value,
81
+ excludePosUserId: H.value
93
82
  }),
94
83
  { isLoading: W }
95
84
  );
96
- P.value = !1, F.value = u.split(""), s.value.passcode = u;
85
+ L.value = !1, F.value = u.split(""), s.value.passcode = u;
97
86
  } catch {
98
87
  }
99
88
  }
100
- const K = ea(
101
- () => !ca.isEqual(s.value, b.value),
89
+ const K = ua(
90
+ () => !ia.isEqual(s.value, b.value),
102
91
  () => {
103
92
  V.value = !1;
104
93
  }
105
94
  );
106
- async function fe() {
95
+ async function pe() {
107
96
  const u = {
108
97
  user: {
109
98
  name: s.value.name,
@@ -114,9 +103,9 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
114
103
  };
115
104
  s.value.isMasterUser ? await C.createMasterEmployee(u) : (delete u.user.code, await C.createEmployee(u));
116
105
  }
117
- async function Q() {
118
- var S, M;
119
- const u = b.value, o = J.value, w = {
106
+ async function J() {
107
+ var S, R;
108
+ const u = b.value, o = H.value, k = {
120
109
  user: {
121
110
  name: s.value.name,
122
111
  passcode: s.value.passcode
@@ -128,7 +117,7 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
128
117
  }))
129
118
  };
130
119
  if (!s.value.isMasterUser)
131
- await C.updateEmployee(o, w);
120
+ await C.updateEmployee(o, k);
132
121
  else {
133
122
  const x = {
134
123
  user: {
@@ -137,51 +126,51 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
137
126
  code: s.value.code
138
127
  },
139
128
  roles: s.value.restaurants,
140
- previousRoles: (M = u.restaurants) == null ? void 0 : M.map((N) => ({
141
- restaurantId: N.restaurantId,
142
- roleId: N.roleId
129
+ previousRoles: (R = u.restaurants) == null ? void 0 : R.map((D) => ({
130
+ restaurantId: D.restaurantId,
131
+ roleId: D.roleId
143
132
  }))
144
133
  };
145
134
  b.value.isMasterUser ? await C.updateMasterEmployee(o, x) : await C.migrateToMasterUser(o, x);
146
135
  }
147
136
  }
148
- async function G() {
149
- R.value ? await U.minor(
137
+ async function O() {
138
+ M.value ? await U.minor(
150
139
  async () => {
151
- await fe();
140
+ await pe();
152
141
  },
153
142
  {
154
- successMessage: c("hr.employee.create.successMessage"),
143
+ successMessage: m("hr.employee.create.successMessage"),
155
144
  isLoading: z
156
145
  }
157
146
  ) : await U.minor(
158
147
  async () => {
159
- await Q();
148
+ await J();
160
149
  },
161
150
  {
162
- successMessage: c("hr.employee.update.successMessage"),
151
+ successMessage: m("hr.employee.update.successMessage"),
163
152
  isLoading: z
164
153
  }
165
- ), de("submitted"), V.value = !1;
154
+ ), ce("submitted"), V.value = !1;
166
155
  }
167
- return X(
156
+ return Z(
168
157
  () => V.value,
169
158
  (u) => {
170
159
  }
171
- ), ce({
160
+ ), ue({
172
161
  show: V,
173
- trigger: ae
162
+ trigger: ee
174
163
  }), (u, o) => {
175
- const w = E("FmIcon"), S = E("FmSwitch"), M = E("FmTextField"), x = E("FmFormGroup"), N = E("fm-button"), oe = E("fm-side-sheet");
176
- return g(), ee(Ie, null, [
177
- Ge(u.$slots, "default", { trigger: ae }),
178
- i(oe, {
164
+ const k = E("FmIcon"), S = E("FmSwitch"), R = E("FmTextField"), x = E("FmFormGroup"), D = E("fm-button"), te = E("fm-side-sheet");
165
+ return g(), X(Ue, null, [
166
+ Ke(u.$slots, "default", { trigger: ee }),
167
+ i(te, {
179
168
  id: "unit-form",
180
169
  modelValue: V.value,
181
170
  "onUpdate:modelValue": o[9] || (o[9] = (t) => V.value = t),
182
- "is-container": l($e).FmForm,
171
+ "is-container": l(Me).FmForm,
183
172
  "is-container-props": {
184
- onValidationSuccess: G,
173
+ onValidationSuccess: O,
185
174
  blameFormChildOnValidationFailed: !0
186
175
  },
187
176
  "max-width": 960,
@@ -189,9 +178,9 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
189
178
  "onOn:clickedAway": l(K)
190
179
  }, {
191
180
  "side-sheet-header": y(() => [
192
- f("div", da, [
193
- f("p", pa, q(T.value), 1),
194
- i(w, {
181
+ f("div", ma, [
182
+ f("p", ca, j(T.value), 1),
183
+ i(k, {
195
184
  name: "close",
196
185
  size: "md",
197
186
  class: "cursor-pointer",
@@ -200,16 +189,16 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
200
189
  ])
201
190
  ]),
202
191
  "side-sheet-footer": y(() => [
203
- f("div", ga, [
204
- i(N, {
205
- label: H.value,
192
+ f("div", va, [
193
+ i(D, {
194
+ label: q.value,
206
195
  size: "lg",
207
196
  type: "submit",
208
197
  variant: "primary",
209
198
  disabled: z.value
210
199
  }, null, 8, ["label", "disabled"]),
211
- i(N, {
212
- label: l(c)("common.cancel"),
200
+ i(D, {
201
+ label: l(m)("common.cancel"),
213
202
  size: "lg",
214
203
  variant: "tertiary",
215
204
  disabled: z.value,
@@ -218,72 +207,72 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
218
207
  ])
219
208
  ]),
220
209
  default: y(() => [
221
- f("div", fa, [
222
- i(Ve, {
223
- title: l(c)("hr.employee.form.employeeSetting")
210
+ f("div", da, [
211
+ i(Ee, {
212
+ title: l(m)("hr.employee.form.employeeSetting")
224
213
  }, {
225
214
  default: y(() => [
226
- i(xe, {
227
- label: l(c)("hr.employee.form.masterUserConfig")
215
+ i(we, {
216
+ label: l(m)("hr.employee.form.masterUserConfig")
228
217
  }, {
229
218
  default: y(() => [
230
219
  i(S, {
231
220
  modelValue: s.value.isMasterUser,
232
221
  "onUpdate:modelValue": o[0] || (o[0] = (t) => s.value.isMasterUser = t),
233
222
  value: "masterUser",
234
- label: l(c)("hr.employee.form.masterUser"),
235
- sublabel: l(c)("hr.employee.form.masterUserSublabel"),
223
+ label: l(m)("hr.employee.form.masterUser"),
224
+ sublabel: l(m)("hr.employee.form.masterUserSublabel"),
236
225
  "label-placement": "right"
237
226
  }, null, 8, ["modelValue", "label", "sublabel"])
238
227
  ]),
239
228
  _: 1
240
229
  }, 8, ["label"]),
241
- f("div", va, [
242
- s.value.isMasterUser ? (g(), I(M, {
230
+ f("div", pa, [
231
+ s.value.isMasterUser ? (g(), I(R, {
243
232
  key: 0,
244
233
  modelValue: s.value.code,
245
234
  "onUpdate:modelValue": o[1] || (o[1] = (t) => s.value.code = t),
246
- label: l(c)("hr.employee.form.code")
247
- }, null, 8, ["modelValue", "label"])) : j("", !0),
248
- i(M, {
235
+ label: l(m)("hr.employee.form.code")
236
+ }, null, 8, ["modelValue", "label"])) : B("", !0),
237
+ i(R, {
249
238
  modelValue: s.value.name,
250
239
  "onUpdate:modelValue": o[2] || (o[2] = (t) => s.value.name = t),
251
240
  class: "w-full",
252
- label: l(c)("hr.employee.form.name"),
253
- rules: [(t) => !!t || l(c)("hr.employee.form.required")]
241
+ label: l(m)("hr.employee.form.name"),
242
+ rules: [(t) => !!t || l(m)("hr.employee.form.required")]
254
243
  }, null, 8, ["modelValue", "label", "rules"])
255
244
  ]),
256
- i(xe, {
257
- label: l(c)("hr.employee.form.passcode")
245
+ i(we, {
246
+ label: l(m)("hr.employee.form.passcode")
258
247
  }, {
259
248
  default: y(() => [
260
- f("div", ya, [
249
+ f("div", fa, [
261
250
  i(x, {
262
251
  modelValue: F.value,
263
252
  "onUpdate:modelValue": o[6] || (o[6] = (t) => F.value = t),
264
253
  rules: [
265
- (t) => (t == null ? void 0 : t.filter((B) => !!B).length) !== Ue ? l(c)("hr.employee.form.passcodeRequired") : !0
254
+ (t) => (t == null ? void 0 : t.filter((G) => !!G).length) !== Se ? l(m)("hr.employee.form.passcodeRequired") : !0
266
255
  ]
267
256
  }, {
268
257
  default: y(() => [
269
- i(ta, {
258
+ i(la, {
270
259
  modelValue: F.value,
271
260
  "onUpdate:modelValue": o[3] || (o[3] = (t) => F.value = t),
272
- masked: P.value,
273
- "onUpdate:masked": o[4] || (o[4] = (t) => P.value = t),
274
- length: Ue,
275
- "toggle-label": l(c)("hr.employee.form.passcodeToggleVisibility"),
261
+ masked: L.value,
262
+ "onUpdate:masked": o[4] || (o[4] = (t) => L.value = t),
263
+ length: Se,
264
+ "toggle-label": l(m)("hr.employee.form.passcodeToggleVisibility"),
276
265
  onComplete: o[5] || (o[5] = (t) => s.value.passcode = t)
277
266
  }, null, 8, ["modelValue", "masked", "toggle-label"])
278
267
  ]),
279
268
  _: 1
280
269
  }, 8, ["modelValue", "rules"]),
281
- i(oa, {
282
- label: l(c)("hr.employee.form.passcodeGenerate"),
283
- hint: l(c)("hr.employee.form.passcodeSelectOutletFirst"),
270
+ i(sa, {
271
+ label: l(m)("hr.employee.form.passcodeGenerate"),
272
+ hint: l(m)("hr.employee.form.passcodeSelectOutletFirst"),
284
273
  loading: W.value,
285
- disabled: !te.value,
286
- onClick: D
274
+ disabled: !se.value,
275
+ onClick: P
287
276
  }, null, 8, ["label", "hint", "loading", "disabled"])
288
277
  ])
289
278
  ]),
@@ -292,31 +281,31 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
292
281
  ]),
293
282
  _: 1
294
283
  }, 8, ["title"]),
295
- i(Ve, null, {
284
+ i(Ee, null, {
296
285
  default: y(() => [
297
286
  i(x, {
298
287
  modelValue: s.value.restaurants,
299
288
  "onUpdate:modelValue": o[8] || (o[8] = (t) => s.value.restaurants = t),
300
289
  tag: "div",
301
290
  rules: [
302
- (t) => t.length > 0 || l(c)("hr.employee.form.atLeastOneRestaurant"),
303
- (t) => t.every((B) => B.restaurantId && B.roleId) || l(c)("hr.employee.form.roleRequired")
291
+ (t) => t.length > 0 || l(m)("hr.employee.form.atLeastOneRestaurant"),
292
+ (t) => t.every((G) => G.restaurantId && G.roleId) || l(m)("hr.employee.form.roleRequired")
304
293
  ]
305
294
  }, {
306
295
  default: y(() => [
307
- i(ra, {
296
+ i(ta, {
308
297
  modelValue: s.value.restaurants,
309
298
  "onUpdate:modelValue": o[7] || (o[7] = (t) => s.value.restaurants = t),
310
299
  restaurants: l(d).restaurants.value,
311
- roles: l(k).roles.value,
312
- "is-role-usable": se,
313
- "is-restaurant-locked": le,
314
- "create-row": O,
315
- title: l(c)("hr.employee.form.assignmentSection"),
316
- "restaurant-label": l(c)("hr.employee.columns.restaurants"),
317
- "role-label": l(c)("hr.employee.form.role"),
318
- "add-label": l(c)("hr.employee.form.addAnother"),
319
- "remove-label": l(c)("common.remove")
300
+ roles: l(w).roles.value,
301
+ "is-role-usable": le,
302
+ "is-restaurant-locked": ae,
303
+ "create-row": A,
304
+ title: l(m)("hr.employee.form.assignmentSection"),
305
+ "restaurant-label": l(m)("hr.employee.columns.restaurants"),
306
+ "role-label": l(m)("hr.employee.form.role"),
307
+ "add-label": l(m)("hr.employee.form.addAnother"),
308
+ "remove-label": l(m)("common.remove")
320
309
  }, null, 8, ["modelValue", "restaurants", "roles", "title", "restaurant-label", "role-label", "add-label", "remove-label"])
321
310
  ]),
322
311
  _: 1
@@ -331,70 +320,70 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
331
320
  ], 64);
332
321
  };
333
322
  }
334
- }), _a = {
323
+ }), ga = {
335
324
  class: "space-y-8"
336
- }, ba = {
325
+ }, ha = {
337
326
  key: 0,
338
327
  class: "flex w-full items-start justify-between"
339
- }, wa = {
328
+ }, _a = {
340
329
  class: "flex items-start gap-8"
341
- }, ka = {
330
+ }, ba = {
342
331
  class: "flex"
343
- }, xa = {
332
+ }, ka = {
344
333
  key: 1,
345
334
  class: "space-y-4"
346
- }, Ea = {
335
+ }, wa = {
347
336
  class: "px-16"
348
- }, Va = {
337
+ }, xa = {
349
338
  class: "px-16 flex items-start gap-8"
350
- }, Sa = {
339
+ }, Ea = {
351
340
  class: "flex h-full flex-col overflow-auto"
352
- }, Ca = {
341
+ }, Va = {
353
342
  class: "space-y-4"
354
- }, Ua = {
343
+ }, Sa = {
355
344
  class: "fm-typo-en-body-lg-600"
356
- }, Fa = {
345
+ }, Ca = {
357
346
  key: 0,
358
347
  class: "mr-4"
359
- }, Ia = {
348
+ }, Ua = {
360
349
  class: "text-fm-color-typo-secondary"
361
- }, Ra = {
350
+ }, Fa = {
362
351
  class: "line-clamp-2"
363
- }, Ma = {
352
+ }, Ia = {
364
353
  class: "font-bold"
365
- }, A = 200, $a = /* @__PURE__ */ Fe({
354
+ }, N = 200, Ma = /* @__PURE__ */ Ce({
366
355
  __name: "EmployeeList",
367
- setup($, {
368
- expose: ce
356
+ setup(Pe, {
357
+ expose: ue
369
358
  }) {
370
359
  const {
371
360
  t: n
372
- } = Re(), k = v(), d = Le(), C = Pe(), me = He(), {
361
+ } = Fe(), w = v(), d = Re(), C = $e(), me = je(), {
373
362
  currentBusiness: U,
374
- sessionUser: de
375
- } = me, c = he(), V = h(() => C.isLoading.value), R = v(c.roles.value.length === 0);
376
- X(C.restaurants, (e) => {
363
+ sessionUser: ce
364
+ } = me, m = ge(), V = h(() => C.isLoading.value), M = v(m.roles.value.length === 0);
365
+ Z(C.restaurants, (e) => {
377
366
  if (e.length > 0 && d.listEmployees.value.length > 0) {
378
367
  const a = new Map(e.map((r) => [r._id, r]));
379
368
  d.listEmployees.value = d.listEmployees.value.map((r) => ({
380
369
  ...r,
381
370
  restaurants: r.restaurants.map((p) => {
382
- var Y, Z;
371
+ var Q, Y;
383
372
  return {
384
373
  ...p,
385
- restaurantName: ((Y = a.get(p.restaurantId)) == null ? void 0 : Y.profile.name) || p.restaurantName,
386
- restaurantCode: ((Z = a.get(p.restaurantId)) == null ? void 0 : Z.profile.code) ?? void 0
374
+ restaurantName: ((Q = a.get(p.restaurantId)) == null ? void 0 : Q.profile.name) || p.restaurantName,
375
+ restaurantCode: ((Y = a.get(p.restaurantId)) == null ? void 0 : Y.profile.code) ?? void 0
387
376
  };
388
377
  })
389
378
  }));
390
379
  }
391
380
  });
392
- const O = h(() => C.restaurants.value.map((e) => ({
381
+ const A = h(() => C.restaurants.value.map((e) => ({
393
382
  label: `${e.profile.code ? `${e.profile.code} - ` : ""}${e.profile.name}`,
394
383
  value: e._id
395
- }))), pe = X(c.roles, (e) => {
384
+ }))), de = Z(m.roles, (e) => {
396
385
  if (e.length > 0) {
397
- if (R.value = !1, d.listEmployees.value.length > 0) {
386
+ if (M.value = !1, d.listEmployees.value.length > 0) {
398
387
  const a = new Map(e.map((r) => [r._id, r.name]));
399
388
  d.listEmployees.value = d.listEmployees.value.map((r) => ({
400
389
  ...r,
@@ -404,29 +393,29 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
404
393
  }))
405
394
  }));
406
395
  }
407
- pe();
396
+ de();
408
397
  }
409
- }), ae = h(() => d.listEmployees.value), {
398
+ }), ee = h(() => d.listEmployees.value), {
410
399
  searchKey: _
411
- } = Ze(), T = v(""), H = h(() => ae.value), b = h(() => d.totalEmployees.value), s = v(1), J = h(() => d.isLoading.value), L = v(!1), le = h(() => {
400
+ } = Ye(), T = v(""), q = h(() => ee.value), b = h(() => d.totalEmployees.value), s = v(1), H = h(() => d.isLoading.value), $ = v(!1), ae = h(() => {
412
401
  var e;
413
402
  return JSON.stringify({
414
403
  businessId: ((e = U.value) == null ? void 0 : e._id) ?? "",
415
404
  search: T.value.trim(),
416
- restaurantIds: [...k.value ?? []].sort(),
405
+ restaurantIds: [...w.value ?? []].sort(),
417
406
  roleIds: [...t.value ?? []].sort()
418
407
  });
419
- }), se = (e) => {
408
+ }), le = (e) => {
420
409
  const a = e.restaurantCode, r = e.restaurantName;
421
410
  return a ? `${a} - ${r}` : r;
422
411
  }, F = (e) => e.roleName || "-";
423
- function P(e) {
412
+ function L(e) {
424
413
  return [{
425
414
  label: n("hr.employee.form.update"),
426
- onClick: () => w(e)
415
+ onClick: () => k(e)
427
416
  }, {
428
417
  label: n("hr.employee.remove.title"),
429
- onClick: () => M(e),
418
+ onClick: () => R(e),
430
419
  itemClass: "text-fm-color-typo-error"
431
420
  }];
432
421
  }
@@ -438,8 +427,8 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
438
427
  onClick: (r) => {
439
428
  r.stopPropagation();
440
429
  }
441
- }, [i(aa, {
442
- items: P(e)
430
+ }, [i(Xe, {
431
+ items: L(e)
443
432
  }, null)]), W = [{
444
433
  accessorKey: "code",
445
434
  size: 100,
@@ -452,9 +441,9 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
452
441
  const a = e.row.original;
453
442
  return i("div", {
454
443
  class: "flex items-center gap-8"
455
- }, [i($e.FmAvatar, {
444
+ }, [i(Me.FmAvatar, {
456
445
  name: a.name,
457
- initials: ia(a.name),
446
+ initials: ra(a.name),
458
447
  size: "sm",
459
448
  class: "shrink-0"
460
449
  }, null), i("span", {
@@ -467,9 +456,9 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
467
456
  header: () => n("hr.employee.columns.restaurants"),
468
457
  enableSorting: !1,
469
458
  cell(e) {
470
- return V.value || R.value ? ie(Ee) : e.row.original.restaurants.map((a, r) => {
471
- const p = se(a);
472
- return ie("div", {
459
+ return V.value || M.value ? ne(xe) : e.row.original.restaurants.map((a, r) => {
460
+ const p = le(a);
461
+ return ne("div", {
473
462
  key: a.restaurantId || r
474
463
  }, (r ? `
475
464
  ` : "") + p);
@@ -481,11 +470,11 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
481
470
  header: () => n("hr.employee.columns.assignedRole"),
482
471
  enableSorting: !1,
483
472
  cell(e) {
484
- return V.value || R.value ? ie(Ee, {
473
+ return V.value || M.value ? ne(xe, {
485
474
  width: "120px"
486
475
  }) : e.row.original.restaurants.map((a, r) => {
487
476
  const p = F(a);
488
- return ie("div", {
477
+ return ne("div", {
489
478
  key: a.restaurantId || r
490
479
  }, (r ? `
491
480
  ` : "") + p);
@@ -508,7 +497,7 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
508
497
  className: "flex w-full items-center justify-end"
509
498
  });
510
499
  }
511
- }], te = ({
500
+ }], se = ({
512
501
  employee: e
513
502
  }) => i("div", {
514
503
  class: "flex flex-col gap-4 grow p-8"
@@ -519,22 +508,22 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
519
508
  row: {
520
509
  original: e
521
510
  }
522
- }) : e[a.accessorKey]]))]), D = Me(), K = Je(), fe = De(D), Q = v(!1), G = v(), u = v();
511
+ }) : e[a.accessorKey]]))]), P = Ie(), K = qe(), pe = Le(P), J = v(!1), O = v(), u = v();
523
512
  function o(e) {
524
513
  const a = e.isRestricted;
525
- return a && D.open({
514
+ return a && P.open({
526
515
  message: n("hr.employee.cannotUpdateMasterUser", {
527
516
  name: e.name
528
517
  }),
529
518
  type: "error"
530
519
  }), a;
531
520
  }
532
- const w = (e) => {
521
+ const k = (e) => {
533
522
  var r;
534
523
  e && o(e) || (r = u.value) == null || r.trigger(e);
535
524
  }, {
536
525
  breakpoints: S
537
- } = We(), M = (e) => {
526
+ } = He(), R = (e) => {
538
527
  o(e) || K.open({
539
528
  title: n("hr.employee.remove.title"),
540
529
  message: n("hr.employee.remove.message", {
@@ -545,19 +534,19 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
545
534
  text: n("common.remove"),
546
535
  close: !1,
547
536
  variant: "destructive",
548
- isLoading: Q
537
+ isLoading: J
549
538
  },
550
539
  secondaryActions: {
551
540
  text: n("common.cancel"),
552
541
  close: !0
553
542
  }
554
543
  }).onPrimary(async () => {
555
- if (Q.value) return;
544
+ if (J.value) return;
556
545
  const r = e.isMasterUser ? d.deleteMasterEmployee : d.deleteEmployee;
557
- await fe.minor(async () => {
558
- await r(e), await ve();
546
+ await pe.minor(async () => {
547
+ await r(e), await fe();
559
548
  }, {
560
- isLoading: Q,
549
+ isLoading: J,
561
550
  successMessage: n("hr.employee.remove.successMessage", {
562
551
  name: e.name
563
552
  })
@@ -565,141 +554,141 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
565
554
  }), K.close();
566
555
  });
567
556
  }, x = v("");
568
- function N() {
557
+ function D() {
569
558
  var e;
570
559
  (e = u.value) == null || e.trigger();
571
560
  }
572
- const oe = h(() => he().roles.value.map((e) => ({
561
+ const te = h(() => ge().roles.value.map((e) => ({
573
562
  label: e.name,
574
563
  value: e._id
575
564
  }))), t = v();
576
- async function B() {
565
+ async function G() {
577
566
  try {
578
- await d.syncUsersMeta(), await ve(), D.open({
567
+ await d.syncUsersMeta(), await fe(), P.open({
579
568
  message: n("hr.employee.sync.successMessage"),
580
569
  type: "success"
581
570
  });
582
571
  } catch (e) {
583
- console.error("Error syncing users:", e), D.open({
572
+ console.error("Error syncing users:", e), P.open({
584
573
  message: n("hr.employee.sync.errorMessage"),
585
574
  type: "error"
586
575
  });
587
576
  }
588
577
  }
589
- async function re(e = s.value) {
578
+ async function oe(e = s.value) {
590
579
  var a, r;
591
580
  try {
592
581
  await d.readEmployeesPage({
593
- limit: A,
594
- offset: (e - 1) * A,
582
+ limit: N,
583
+ offset: (e - 1) * N,
595
584
  search: T.value.trim() || void 0,
596
- restaurantIds: (a = k.value) != null && a.length ? k.value : void 0,
585
+ restaurantIds: (a = w.value) != null && a.length ? w.value : void 0,
597
586
  roleIds: (r = t.value) != null && r.length ? t.value : void 0
598
587
  });
599
588
  } catch (p) {
600
- console.error("Failed to load employees:", p), D.open({
589
+ console.error("Failed to load employees:", p), P.open({
601
590
  message: p instanceof Error ? p.message : String(p),
602
591
  type: "error"
603
592
  });
604
593
  }
605
594
  }
606
- async function ve() {
595
+ async function fe() {
607
596
  var a;
608
597
  if (!((a = U.value) != null && a._id)) return;
609
- await re(s.value);
610
- const e = Math.max(1, Math.ceil(b.value / A));
611
- s.value > e && (s.value = e, await re(s.value));
598
+ await oe(s.value);
599
+ const e = Math.max(1, Math.ceil(b.value / N));
600
+ s.value > e && (s.value = e, await oe(s.value));
612
601
  }
613
- async function Ne() {
602
+ async function De() {
614
603
  var e, a;
615
604
  return await d.readAllEmployeesPage({
616
605
  search: T.value.trim() || void 0,
617
- restaurantIds: (e = k.value) != null && e.length ? k.value : void 0,
606
+ restaurantIds: (e = w.value) != null && e.length ? w.value : void 0,
618
607
  roleIds: (a = t.value) != null && a.length ? t.value : void 0
619
608
  }, b.value);
620
609
  }
621
- const Ae = na(_, () => {
610
+ const Ne = oa(_, () => {
622
611
  T.value = _.value;
623
612
  }, 300);
624
- Be(Ae);
625
- let ye = !1;
626
- async function Oe({
613
+ Oe(Ne);
614
+ let ve = !1;
615
+ async function Ae({
627
616
  pageIndex: e
628
617
  }) {
629
618
  var a;
630
- if ((a = U.value) != null && a._id && !ye && !(e === 0 && s.value === 1 && H.value.length > 0)) {
631
- ye = !0, s.value = e + 1;
619
+ if ((a = U.value) != null && a._id && !ve && !(e === 0 && s.value === 1 && q.value.length > 0)) {
620
+ ve = !0, s.value = e + 1;
632
621
  try {
633
- await re(s.value);
622
+ await oe(s.value);
634
623
  } finally {
635
- ye = !1;
624
+ ve = !1;
636
625
  }
637
626
  }
638
627
  }
639
- X(le, async () => {
628
+ Z(ae, async () => {
640
629
  var e;
641
- s.value = 1, L.value = !1, (e = U.value) != null && e._id && (await re(1), L.value = !0);
630
+ s.value = 1, $.value = !1, (e = U.value) != null && e._id && (await oe(1), $.value = !0);
642
631
  }, {
643
632
  immediate: !0
644
- }), X(() => G.value && G.value.restaurants, (e) => {
633
+ }), Z(() => O.value && O.value.restaurants, (e) => {
645
634
  e && e.length > 0 && (x.value = "");
646
635
  });
647
- const Te = h(() => b.value > A);
648
- return ce({
649
- create: N,
650
- filteredEmployees: H,
651
- exportEmployees: Ne,
636
+ const Te = h(() => b.value > N);
637
+ return ue({
638
+ create: D,
639
+ filteredEmployees: q,
640
+ exportEmployees: De,
652
641
  getHasPaginationFooter: () => Te.value
653
642
  }), (e, a) => {
654
- var _e, be;
655
- const r = E("FmButton"), p = E("FmTooltip"), Y = E("FmSearch"), Z = E("FmListItem"), ze = E("FmTable");
656
- return g(), ee(Ie, null, [i(ha, {
643
+ var he, _e;
644
+ const r = E("FmButton"), p = E("FmTooltip"), Q = E("FmSearch"), Y = E("FmListItem"), ze = E("FmTable");
645
+ return g(), X(Ue, null, [i(ya, {
657
646
  ref_key: "employeeFormRef",
658
647
  ref: u,
659
- modelValue: G.value,
660
- "onUpdate:modelValue": a[0] || (a[0] = (m) => G.value = m),
648
+ modelValue: O.value,
649
+ "onUpdate:modelValue": a[0] || (a[0] = (c) => O.value = c),
661
650
  "role-error-message": x.value,
662
651
  class: "gap-8",
663
- onSubmitted: ve
664
- }, null, 8, ["modelValue", "role-error-message"]), f("div", _a, [l(S).xs ? (g(), ee("div", xa, [f("div", Ea, [i(Y, {
652
+ onSubmitted: fe
653
+ }, null, 8, ["modelValue", "role-error-message"]), f("div", ga, [l(S).xs ? (g(), X("div", ka, [f("div", wa, [i(Q, {
665
654
  modelValue: l(_),
666
- "onUpdate:modelValue": a[4] || (a[4] = (m) => we(_) ? _.value = m : null),
655
+ "onUpdate:modelValue": a[4] || (a[4] = (c) => be(_) ? _.value = c : null),
667
656
  placeholder: l(n)("hr.employee.search.placeholder")
668
- }, null, 8, ["modelValue", "placeholder"])]), i(Xe), f("div", Va, [i(ue, {
669
- modelValue: k.value,
670
- "onUpdate:modelValue": a[5] || (a[5] = (m) => k.value = m),
657
+ }, null, 8, ["modelValue", "placeholder"])]), i(Ze), f("div", xa, [i(ie, {
658
+ modelValue: w.value,
659
+ "onUpdate:modelValue": a[5] || (a[5] = (c) => w.value = c),
671
660
  multiple: "",
672
- items: O.value,
661
+ items: A.value,
673
662
  variant: "dark",
674
663
  "selected-prefix": l(n)("hr.role.columns.restaurants"),
675
664
  placeholder: l(n)("hr.role.columns.restaurants"),
676
665
  class: "!w-auto"
677
- }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), i(ue, {
666
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), i(ie, {
678
667
  modelValue: t.value,
679
- "onUpdate:modelValue": a[6] || (a[6] = (m) => t.value = m),
668
+ "onUpdate:modelValue": a[6] || (a[6] = (c) => t.value = c),
680
669
  multiple: "",
681
- items: oe.value,
670
+ items: te.value,
682
671
  variant: "dark",
683
672
  "selected-prefix": l(n)("hr.employee.filter.selected_role_prefix"),
684
673
  placeholder: l(n)("hr.employee.filter.role_placeholder")
685
- }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])])) : (g(), ee("div", ba, [f("div", wa, [i(ue, {
686
- modelValue: k.value,
687
- "onUpdate:modelValue": a[1] || (a[1] = (m) => k.value = m),
674
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])])) : (g(), X("div", ha, [f("div", _a, [i(ie, {
675
+ modelValue: w.value,
676
+ "onUpdate:modelValue": a[1] || (a[1] = (c) => w.value = c),
688
677
  multiple: "",
689
- items: O.value,
678
+ items: A.value,
690
679
  variant: "dark",
691
680
  "selected-prefix": l(n)("hr.role.columns.restaurants"),
692
681
  placeholder: l(n)("hr.role.columns.restaurants"),
693
682
  class: "!w-auto"
694
- }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), i(ue, {
683
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), i(ie, {
695
684
  modelValue: t.value,
696
- "onUpdate:modelValue": a[2] || (a[2] = (m) => t.value = m),
685
+ "onUpdate:modelValue": a[2] || (a[2] = (c) => t.value = c),
697
686
  multiple: "",
698
687
  variant: "dark",
699
- items: oe.value,
688
+ items: te.value,
700
689
  "selected-prefix": l(n)("hr.employee.filter.selected_role_prefix"),
701
690
  placeholder: l(n)("hr.employee.filter.role_placeholder")
702
- }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), f("div", ka, [(_e = l(de)) != null && _e.role.isAdmin ? (g(), I(p, {
691
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), f("div", ba, [(he = l(ce)) != null && he.role.isAdmin ? (g(), I(p, {
703
692
  key: 0,
704
693
  content: l(n)("hr.employee.sync.tooltip")
705
694
  }, {
@@ -707,21 +696,21 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
707
696
  icon: "refresh",
708
697
  label: l(n)("hr.employee.sync.tooltip"),
709
698
  variant: "tertiary",
710
- onClick: B
699
+ onClick: G
711
700
  }, null, 8, ["label"])]),
712
701
  _: 1
713
- }, 8, ["content"])) : j("", !0), i(Y, {
702
+ }, 8, ["content"])) : B("", !0), i(Q, {
714
703
  modelValue: l(_),
715
- "onUpdate:modelValue": a[3] || (a[3] = (m) => we(_) ? _.value = m : null),
704
+ "onUpdate:modelValue": a[3] || (a[3] = (c) => be(_) ? _.value = c : null),
716
705
  autofocus: "",
717
706
  class: "pl-4 w-[320px]",
718
707
  placeholder: l(n)("hr.employee.search.placeholder")
719
- }, null, 8, ["modelValue", "placeholder"])])])), (be = l(U)) != null && be._id ? (g(), I(Qe, {
708
+ }, null, 8, ["modelValue", "placeholder"])])])), (_e = l(U)) != null && _e._id ? (g(), I(We, {
720
709
  key: 2
721
710
  }, {
722
- default: y(() => [f("div", Sa, [!L.value && l(d).isLoading.value ? (g(), I(Ye, {
711
+ default: y(() => [f("div", Ea, [!$.value && l(d).isLoading.value ? (g(), I(Je, {
723
712
  key: 0
724
- })) : j("", !0), L.value ? (g(), I(la, {
713
+ })) : B("", !0), $.value ? (g(), I(ea, {
725
714
  key: 1,
726
715
  "is-loading": l(d).isLoading.value,
727
716
  "is-empty": b.value === 0,
@@ -729,59 +718,59 @@ const da = { class: "flex w-full items-center justify-between" }, pa = { class:
729
718
  subtitle: l(n)("hr.employee.noData.subtitle")
730
719
  }, {
731
720
  default: y(() => [(g(), I(ze, {
732
- key: le.value,
721
+ key: ae.value,
733
722
  class: ke(["employee-list-table h-full", {
734
- "employee-list-table--pagination-loading": J.value
723
+ "employee-list-table--pagination-loading": H.value
735
724
  }]),
736
725
  "column-defs": W,
737
- "row-data": H.value,
738
- "page-size": A,
739
- "page-count": Math.ceil(b.value / A),
726
+ "row-data": q.value,
727
+ "page-size": N,
728
+ "page-count": Math.ceil(b.value / N),
740
729
  "row-count": b.value,
741
- "fetch-fn": Oe,
742
- "hide-footer": b.value <= A,
730
+ "fetch-fn": Ae,
731
+ "hide-footer": b.value <= N,
743
732
  loading: l(d).isLoading.value,
744
733
  virtual: !1,
745
734
  "pin-header-row": "",
746
- onRowClick: a[7] || (a[7] = (m) => w(m.original))
735
+ onRowClick: a[7] || (a[7] = (c) => k(c.original))
747
736
  }, {
748
- "list-row": y((m) => [l(S).xs ? (g(), I(Z, {
737
+ "list-row": y((c) => [l(S).xs ? (g(), I(Y, {
749
738
  key: 0,
750
739
  class: ke(["py-12 px-16 items-center justify-between", {
751
- "border-t border-fm-color-neutral-gray-100": m.index > 0
740
+ "border-t border-fm-color-neutral-gray-100": c.index > 0
752
741
  }]),
753
- onClick: (ne) => w(m.original)
742
+ onClick: (re) => k(c.original)
754
743
  }, {
755
- default: y(() => [f("div", Ca, [f("p", Ua, [m.original.code ? (g(), ee("span", Fa, q(m.original.code) + ".", 1)) : j("", !0), ge(q(m.original.name), 1)]), f("div", Ia, [f("p", Ra, [f("span", Ma, q(l(n)("hr.employee.columns.restaurants")) + ":", 1), ge(" " + q(m.original.restaurants.map((ne) => se(ne)).join(", ")), 1)]), f("p", null, [a[8] || (a[8] = f("span", {
744
+ default: y(() => [f("div", Va, [f("p", Sa, [c.original.code ? (g(), X("span", Ca, j(c.original.code) + ".", 1)) : B("", !0), ye(j(c.original.name), 1)]), f("div", Ua, [f("p", Fa, [f("span", Ia, j(l(n)("hr.employee.columns.restaurants")) + ":", 1), ye(" " + j(c.original.restaurants.map((re) => le(re)).join(", ")), 1)]), f("p", null, [a[8] || (a[8] = f("span", {
756
745
  class: "font-bold"
757
- }, "Since:", -1)), ge(" " + q(m.original.since), 1)])])]), i(r, {
746
+ }, "Since:", -1)), ye(" " + j(c.original.since), 1)])])]), i(r, {
758
747
  icon: "delete",
759
748
  variant: "tertiary",
760
749
  "text-color": "neutral-gray-400",
761
- onClick: je((ne) => M(m.original), ["stop"])
750
+ onClick: Ge((re) => R(c.original), ["stop"])
762
751
  }, null, 8, ["onClick"])]),
763
752
  _: 2
764
- }, 1032, ["class", "onClick"])) : (g(), I(Z, {
753
+ }, 1032, ["class", "onClick"])) : (g(), I(Y, {
765
754
  key: 1,
766
755
  style: {
767
756
  padding: "0"
768
757
  },
769
- onClick: (ne) => w(m.original)
758
+ onClick: (re) => k(c.original)
770
759
  }, {
771
- default: y(() => [(g(), I(qe(te), {
772
- employee: m.original
760
+ default: y(() => [(g(), I(Be(se), {
761
+ employee: c.original
773
762
  }, null, 8, ["employee"]))]),
774
763
  _: 2
775
764
  }, 1032, ["onClick"]))]),
776
765
  _: 1
777
766
  }, 8, ["class", "row-data", "page-count", "row-count", "hide-footer", "loading"]))]),
778
767
  _: 1
779
- }, 8, ["is-loading", "is-empty", "title", "subtitle"])) : j("", !0)])]),
768
+ }, 8, ["is-loading", "is-empty", "title", "subtitle"])) : B("", !0)])]),
780
769
  _: 1
781
- })) : j("", !0)])], 64);
770
+ })) : B("", !0)])], 64);
782
771
  };
783
772
  }
784
- }), Xa = /* @__PURE__ */ ma($a, [["__scopeId", "data-v-5aed0d1c"]]);
773
+ }), Za = /* @__PURE__ */ Qe(Ma, [["__scopeId", "data-v-5aed0d1c"]]);
785
774
  export {
786
- Xa as default
775
+ Za as default
787
776
  };