@feedmepos/mf-hrm-portal 2.3.0-dev.3 → 2.3.0-dev.30

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 (137) hide show
  1. package/dist/{ApprovalCodeList-SjyWZghY.js → ApprovalCodeList-CaDmeGvQ.js} +7 -7
  2. package/dist/{AuditLogList-aTI3QeO0.js → AuditLogList-hnICcJxN.js} +18 -19
  3. package/dist/{ConditionBuilderForm.vue_vue_type_script_setup_true_lang--JTV7non.js → ConditionBuilderForm.vue_vue_type_script_setup_true_lang-CM3AAsUP.js} +2 -2
  4. package/dist/{EmployeeList-D2Q_2ZE0.js → EmployeeList-DjfBIMQV.js} +255 -266
  5. package/dist/{FormItem.vue_vue_type_script_setup_true_lang-CUnlKsxk.js → FormItem.vue_vue_type_script_setup_true_lang-CTGlmY6t.js} +6 -6
  6. package/dist/{GrantUserList-6YXLPuHR.js → GrantUserList-DH1HXfV4.js} +8 -8
  7. package/dist/{Main-dSqOeBRJ.js → Main-1GboTunP.js} +11 -11
  8. package/dist/{Main-B-a6F9g8.js → Main-C4S5bpnK.js} +8 -8
  9. package/dist/{Main-CFIWlIaC.js → Main-D0o-aQHX.js} +5 -5
  10. package/dist/{PermissionSetList-DxkaPCMs.js → PermissionSetList-CSONq6qt.js} +19 -18
  11. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-fU3Feetb.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-DQZ_w5uM.js → RoleList-WdgayfhL.js} +21 -20
  15. package/dist/ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-Bx1P_UAW.js +530 -0
  16. package/dist/ScheduleGeneralPage-XUX2-_Vc.js +776 -0
  17. package/dist/ScheduleModal.vue_vue_type_script_setup_true_lang-CECio4Kc.js +2457 -0
  18. package/dist/SchedulePage-LQ7-8VUw.js +19366 -0
  19. package/dist/{SchedulePositionPage-BGrZBU3g.js → SchedulePositionPage-DcUbTYV6.js} +79 -81
  20. package/dist/{SelectFilter-CG13h83-.js → SelectFilter-BbkPuYP_.js} +1 -1
  21. package/dist/{TeamMemberList-BiTHVJwE.js → TeamMemberList-BMdMDYBF.js} +27 -27
  22. package/dist/{TimesheetList-CUkYacGW.js → TimesheetList-B6vZEmgb.js} +52 -53
  23. package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-B1Y587O-.js → TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-Bna8vHO7.js} +3 -3
  24. package/dist/{app-CAKCDrbJ.js → app-DwBKX4e9.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-CZ8QYRoc.js → dayjs.min-DAKzxOMD.js} +1 -1
  28. package/dist/{employee-D56eWEFe.js → employee-GhYyAhwS.js} +51 -47
  29. package/dist/{grant-user-Bv-pJ9Wt.js → grant-user-CBJ3gEgW.js} +1 -1
  30. package/dist/{iteration-BVJdyLNq.js → iteration-Da8377p8.js} +1 -1
  31. package/dist/{lodash-BcIRkQPW.js → lodash-DChu1GU2.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-B-eZDaBX.js → role-CyynUSdG.js} +2 -2
  35. package/dist/{rule-D6AIfx8b.js → rule-Cnn7MV1z.js} +3 -3
  36. package/dist/src/api/employee/index.d.ts +2 -2
  37. package/dist/src/api/schedule/index.d.ts +17 -2
  38. package/dist/src/components/layout/SchedulePromoBanner.vue.d.ts +2 -0
  39. package/dist/src/composables/useDiscardConfirm.d.ts +3 -1
  40. package/dist/src/composables/useMessage.d.ts +8 -2
  41. package/dist/src/stores/employee.d.ts +12 -12
  42. package/dist/src/types/schedule.d.ts +3 -4
  43. package/dist/src/views/audit-log/locales/index.d.ts +252 -0
  44. package/dist/src/views/scheduling/components/ScheduleAreaRows.vue.d.ts +4 -8
  45. package/dist/src/views/scheduling/components/{ScheduleAssignEmployeePopover.vue.d.ts → ScheduleAutoScheduleDetailsModal.vue.d.ts} +2 -2
  46. package/dist/src/views/scheduling/components/ScheduleAutoScheduleDoneArt.vue.d.ts +2 -0
  47. package/dist/src/views/scheduling/components/ScheduleBoardAreaRows.vue.d.ts +1 -4
  48. package/dist/src/views/scheduling/components/ScheduleBoardEditOverlays.vue.d.ts +0 -2
  49. package/dist/src/views/scheduling/components/ScheduleBoardEmployeeRows.vue.d.ts +0 -7
  50. package/dist/src/views/scheduling/components/ScheduleBoardGridHeader.vue.d.ts +5 -0
  51. package/dist/src/views/scheduling/components/ScheduleBoardInteractionOverlays.vue.d.ts +2 -6
  52. package/dist/src/views/scheduling/components/ScheduleBoardOnboardingOverlays.vue.d.ts +1 -0
  53. package/dist/src/views/scheduling/components/ScheduleBoardToolbar.vue.d.ts +0 -1
  54. package/dist/src/views/scheduling/components/ScheduleCompletionDialog.vue.d.ts +1 -1
  55. package/dist/src/views/scheduling/components/ScheduleConfirmModal.vue.d.ts +4 -1
  56. package/dist/src/views/scheduling/components/ScheduleContextMenu.vue.d.ts +1 -5
  57. package/dist/src/views/scheduling/components/ScheduleDayTimeline.vue.d.ts +5 -0
  58. package/dist/src/views/scheduling/components/ScheduleLoadState.vue.d.ts +0 -1
  59. package/dist/src/views/scheduling/components/ScheduleOnboardingAssignPositionModal.vue.d.ts +6 -0
  60. package/dist/src/views/scheduling/components/ScheduleOnboardingSettings.vue.d.ts +6 -0
  61. package/dist/src/views/scheduling/components/SchedulePublishShareArt.vue.d.ts +2 -0
  62. package/dist/src/views/scheduling/components/ScheduleSelect.vue.d.ts +10 -0
  63. package/dist/src/views/scheduling/components/ScheduleShiftPopover.vue.d.ts +1 -1
  64. package/dist/src/views/scheduling/components/ScheduleStaffRows.vue.d.ts +0 -10
  65. package/dist/src/views/scheduling/composables/auto-schedule-mapping.d.ts +33 -0
  66. package/dist/src/views/scheduling/composables/onboarding-types.d.ts +2 -1
  67. package/dist/src/views/scheduling/composables/remyPrompt.d.ts +15 -0
  68. package/dist/src/views/scheduling/composables/schedule-add-employee-form.d.ts +12 -8
  69. package/dist/src/views/scheduling/composables/schedule-board-helpers.d.ts +4 -0
  70. package/dist/src/views/scheduling/composables/schedule-day-meta.d.ts +1 -3
  71. package/dist/src/views/scheduling/composables/schedule-demand-domain.d.ts +13 -1
  72. package/dist/src/views/scheduling/composables/schedule-error.d.ts +1 -0
  73. package/dist/src/views/scheduling/composables/schedule-quick-pick.d.ts +22 -0
  74. package/dist/src/views/scheduling/composables/schedule-shift-time.d.ts +3 -0
  75. package/dist/src/views/scheduling/composables/useRemyAppStore.d.ts +16 -0
  76. package/dist/src/views/scheduling/composables/useScheduleAddEmployee.d.ts +46 -11
  77. package/dist/src/views/scheduling/composables/useScheduleAddPick.d.ts +3 -11
  78. package/dist/src/views/scheduling/composables/useScheduleAreaBoard.d.ts +0 -13
  79. package/dist/src/views/scheduling/composables/useScheduleAreaDragDrop.d.ts +2 -9
  80. package/dist/src/views/scheduling/composables/useScheduleAutoSchedule.d.ts +126 -4
  81. package/dist/src/views/scheduling/composables/useScheduleBoard.d.ts +86 -11
  82. package/dist/src/views/scheduling/composables/useScheduleCopyWeek.d.ts +3 -10
  83. package/dist/src/views/scheduling/composables/useScheduleCostRail.d.ts +13 -1
  84. package/dist/src/views/scheduling/composables/useScheduleDayNote.d.ts +0 -1
  85. package/dist/src/views/scheduling/composables/useScheduleDayTimeline.d.ts +16 -5
  86. package/dist/src/views/scheduling/composables/useScheduleDemand.d.ts +3 -5
  87. package/dist/src/views/scheduling/composables/useScheduleDemandSheet.d.ts +14 -3
  88. package/dist/src/views/scheduling/composables/useScheduleDragDrop.d.ts +1 -0
  89. package/dist/src/views/scheduling/composables/useScheduleEmployeeAccess.d.ts +20 -7
  90. package/dist/src/views/scheduling/composables/useScheduleEmployeeAvailability.d.ts +1 -1
  91. package/dist/src/views/scheduling/composables/useScheduleEmployeeCandidates.d.ts +26 -3
  92. package/dist/src/views/scheduling/composables/useScheduleEmployeePersistence.d.ts +7 -0
  93. package/dist/src/views/scheduling/composables/useScheduleEmployeeValidation.d.ts +2 -2
  94. package/dist/src/views/scheduling/composables/useScheduleGapPopover.d.ts +2 -0
  95. package/dist/src/views/scheduling/composables/useScheduleOnboardingDemand.d.ts +1 -1
  96. package/dist/src/views/scheduling/composables/useScheduleOnboardingEmployees.d.ts +48 -4
  97. package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +425 -29
  98. package/dist/src/views/scheduling/composables/useScheduleOutlet.d.ts +11 -8
  99. package/dist/src/views/scheduling/composables/useSchedulePageActions.d.ts +1 -1
  100. package/dist/src/views/scheduling/composables/useSchedulePageCellDrop.d.ts +3 -1
  101. package/dist/src/views/scheduling/composables/useSchedulePageClearActions.d.ts +1 -0
  102. package/dist/src/views/scheduling/composables/useSchedulePageOverlays.d.ts +0 -4
  103. package/dist/src/views/scheduling/composables/useSchedulePositionModal.d.ts +1 -0
  104. package/dist/src/views/scheduling/composables/useSchedulePositions.d.ts +7 -1
  105. package/dist/src/views/scheduling/composables/useSchedulePublish.d.ts +3 -0
  106. package/dist/src/views/scheduling/composables/useScheduleRoster.d.ts +70 -4
  107. package/dist/src/views/scheduling/composables/useScheduleSettings.d.ts +7 -2
  108. package/dist/src/views/scheduling/composables/useScheduleSetupBanner.d.ts +2 -2
  109. package/dist/src/views/scheduling/composables/useScheduleShiftActions.d.ts +41 -3
  110. package/dist/src/views/scheduling/composables/useScheduleShiftDraft.d.ts +1 -0
  111. package/dist/src/views/scheduling/composables/useScheduleShiftPopover.d.ts +47 -6
  112. package/dist/src/views/scheduling/country-rules/index.d.ts +9 -4
  113. package/dist/src/views/scheduling/data.d.ts +22 -1
  114. package/dist/src/views/scheduling/locales/index.d.ts +28 -0
  115. package/dist/src/views/scheduling/schedule-state.d.ts +362 -298
  116. package/dist/src/views/scheduling/schedule-store.d.ts +41 -12
  117. package/dist/src/views/scheduling/types.d.ts +33 -5
  118. package/dist/style.css +1 -1
  119. package/dist/tsconfig.app.tsbuildinfo +1 -1
  120. package/dist/{useAppStore-d_nHyK5u.js → useAppStore-DZCdxlCd.js} +1 -1
  121. package/dist/useDiscardConfirm-CzZSPyvh.js +28 -0
  122. package/dist/{useLoading-JFoghhRz.js → useLoading-Nygx2zn8.js} +1 -1
  123. package/dist/{useReportPermissions-DHA0jrIr.js → useReportPermissions-B3OMJ4QX.js} +3 -3
  124. package/package.json +3 -2
  125. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-DnKckKZ0.js +0 -4167
  126. package/dist/ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-Dr6QruG6.js +0 -470
  127. package/dist/ScheduleGeneralPage-CvskrXcV.js +0 -666
  128. package/dist/ScheduleModal.vue_vue_type_script_setup_true_lang-C4On5sVD.js +0 -2157
  129. package/dist/SchedulePage-CW-K836l.js +0 -18248
  130. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  131. package/dist/src/views/scheduling/components/ScheduleAllShiftsRow.vue.d.ts +0 -22
  132. package/dist/src/views/scheduling/components/ScheduleStackPopover.vue.d.ts +0 -14
  133. package/dist/src/views/scheduling/composables/scheduleAutoSolver.d.ts +0 -23
  134. package/dist/src/views/scheduling/composables/useScheduleAllShiftsRow.d.ts +0 -77
  135. package/dist/src/views/scheduling/composables/useScheduleAssign.d.ts +0 -124
  136. package/dist/src/views/scheduling/composables/useScheduleOpenShiftCard.d.ts +0 -23
  137. package/dist/useDiscardConfirm-DPhEV6v0.js +0 -157
@@ -0,0 +1,2457 @@
1
+ import { onMounted as Ie, onBeforeUnmount as Te, ref as P, reactive as I, shallowRef as He, watch as Re, computed as _, defineComponent as Oe, createElementBlock as k, openBlock as N, renderSlot as Ke, useAttrs as da, nextTick as be, normalizeClass as pe, createElementVNode as B, createBlock as ca, mergeProps as ma, toDisplayString as G, Teleport as ya, createCommentVNode as j, withDirectives as pa, vModelText as fa, Fragment as Ae, renderList as ha, createTextVNode as va, withModifiers as ga, normalizeStyle as Da } from "vue";
2
+ import { useRoute as wa, useRouter as Ha } from "vue-router";
3
+ import { useCoreStore as Ge } from "@feedmepos/mf-common";
4
+ import { g as D, b as f, u as Aa } from "./restaurant-D2mfKHaH.js";
5
+ import { E as Ne, u as je } from "./employee-GhYyAhwS.js";
6
+ import { t as $e, q as Ea } from "./rule-Cnn7MV1z.js";
7
+ function Qn(e) {
8
+ let a = null;
9
+ function t() {
10
+ if (!a) return;
11
+ a.style.height = "";
12
+ const n = a.getBoundingClientRect().top;
13
+ a.style.height = `${Math.max(0, window.innerHeight - n)}px`;
14
+ }
15
+ Ie(() => {
16
+ var n;
17
+ a = ((n = e.value) == null ? void 0 : n.closest(".sch-page")) ?? null, t(), window.addEventListener("resize", t);
18
+ }), Te(() => {
19
+ window.removeEventListener("resize", t), a && (a.style.height = "");
20
+ });
21
+ }
22
+ function ke(e) {
23
+ const [a, t] = String(e || "0:0").split(":").map(Number);
24
+ return (Number.isFinite(a) ? a : 0) * 60 + (Number.isFinite(t) ? t : 0);
25
+ }
26
+ function Pa(e) {
27
+ const a = Math.max(0, Math.min(1439, Math.round(e)));
28
+ return `${String(Math.floor(a / 60)).padStart(2, "0")}:${String(a % 60).padStart(2, "0")}`;
29
+ }
30
+ function ba(e, a) {
31
+ const t = ke(e);
32
+ let n = ke(a);
33
+ return n <= t && (n += 1440), [t, n];
34
+ }
35
+ function Qe(e, a) {
36
+ const [t, n] = ba(e, a);
37
+ return Math.max(0, n - t);
38
+ }
39
+ function Na(e) {
40
+ const a = (ke(e) % 1440 + 1440) % 1440, t = Math.floor(a / 60), n = a % 60, o = t < 12 ? "am" : "pm", i = t % 12 || 12;
41
+ return n ? `${i}:${String(n).padStart(2, "0")}${o}` : `${i}${o}`;
42
+ }
43
+ function Xn(e) {
44
+ return Na(Pa(e % 1440));
45
+ }
46
+ function Xe(e) {
47
+ const a = Array.isArray(e) ? e : e == null ? void 0 : e.breaks;
48
+ return a != null && a.length ? a.reduce((t, n) => {
49
+ if (n.type === "DURATION") return t + n.minutes;
50
+ const [o, i] = n.startTime.split(":").map(Number), [l, s] = n.endTime.split(":").map(Number);
51
+ let d = l * 60 + s - (o * 60 + i);
52
+ return d < 0 && (d += 24 * 60), t + d;
53
+ }, 0) : Math.max(0, e && !Array.isArray(e) ? e.breakMins ?? 0 : 0);
54
+ }
55
+ function Jn(e, a) {
56
+ var o;
57
+ const t = a ?? Qe(e.start, e.end), n = (o = e.breaks) != null && o.length ? e.breaks.reduce((i, l) => i + (l.breakPayType === "UNPAID" ? Xe([l]) : 0), 0) : Math.max(0, e.breakMins ?? 0);
58
+ return Math.max(0, t - Math.min(t, n));
59
+ }
60
+ function Zn(e) {
61
+ const a = Math.max(0, Math.round(e ?? 0));
62
+ return a ? [{ type: "DURATION", minutes: a, breakPayType: "UNPAID" }] : [];
63
+ }
64
+ const te = 500, ka = 10, xe = 6, qn = 1500, Je = 1e6, H = {
65
+ async completeOnboarding(e, a) {
66
+ return D(
67
+ await f(`restaurants/${e}/schedules`).post("onboarding", a)
68
+ );
69
+ },
70
+ async listEmployeeProfiles(e) {
71
+ return D(
72
+ await f("schedules").get("employees", {
73
+ params: e != null && e.length ? { ids: e.join(",") } : void 0
74
+ })
75
+ );
76
+ },
77
+ async listEmployeeConfigs(e) {
78
+ return D(
79
+ await f(`restaurants/${e}/schedules`).get("employee-configs")
80
+ );
81
+ },
82
+ async saveEmployeeConfigs(e, a) {
83
+ return D(
84
+ await f(`restaurants/${e}/schedules`).post(
85
+ "employee-configs/reorder",
86
+ a
87
+ )
88
+ );
89
+ },
90
+ async getSettings(e) {
91
+ return D(
92
+ await f(`restaurants/${e}/schedules`).get("settings")
93
+ );
94
+ },
95
+ async saveSettings(e, a) {
96
+ return D(
97
+ await f(`restaurants/${e}/schedules`).post("settings", a)
98
+ );
99
+ },
100
+ async generateAutoSchedule(e, a) {
101
+ return D(
102
+ await f(`restaurants/${e}/schedules`).post(
103
+ "auto-schedule/generate",
104
+ a
105
+ )
106
+ );
107
+ },
108
+ async getAutoScheduleCapabilities(e) {
109
+ return D(
110
+ await f(`restaurants/${e}/schedules`).get(
111
+ "auto-schedule/capabilities"
112
+ )
113
+ );
114
+ },
115
+ async applyAutoSchedule(e, a) {
116
+ return D(
117
+ await f(`restaurants/${e}/schedules`).post(
118
+ "auto-schedule/apply",
119
+ a
120
+ )
121
+ );
122
+ },
123
+ /** One outlet's whole board over `[from, to]` (inclusive, 'YYYY-MM-DD'). */
124
+ async readBoard(e, a, t) {
125
+ return D(
126
+ await f(`restaurants/${e}/schedules`).get("board", {
127
+ params: { from: a, to: t }
128
+ })
129
+ );
130
+ },
131
+ async createTimeOff(e, a) {
132
+ return D(
133
+ await f(`restaurants/${e}/schedules`).post("time-off", a)
134
+ );
135
+ },
136
+ async updateTimeOffStatus(e, a, t) {
137
+ return D(
138
+ await f(`restaurants/${e}/schedules`).post(
139
+ `time-off/${a}/status`,
140
+ t
141
+ )
142
+ );
143
+ },
144
+ async deleteTimeOff(e, a) {
145
+ await f(`restaurants/${e}/schedules`).delete(`time-off/${a}`);
146
+ },
147
+ /** Creates or updates the employee's shared business-level scheduling profile. */
148
+ async createEmployeeProfile(e, a) {
149
+ return D(await f("schedules").post("employees", a));
150
+ },
151
+ /** Edits the employee's shared business-level scheduling profile. */
152
+ async updateEmployeeProfile(e, a, t) {
153
+ return D(
154
+ await f("schedules").post("employees", { employeeId: a, ...t })
155
+ );
156
+ },
157
+ async validatePosAccess(e) {
158
+ await f("schedules").post("employees/validate-pos-access", e);
159
+ },
160
+ /** Positions are shared across the business. */
161
+ async createPosition(e) {
162
+ return D(await f("schedules").post("positions", e));
163
+ },
164
+ async updatePosition(e, a) {
165
+ return D(await f("schedules").post(`positions/${e}`, a));
166
+ },
167
+ /** Deleting one position is `deletePositions` with a single-id array — the backend's
168
+ * `DELETE positions/:id` route is gone; this is now `DELETE positions?ids=`. */
169
+ async deletePosition(e) {
170
+ await f("schedules").delete("positions", {
171
+ params: { ids: e }
172
+ });
173
+ },
174
+ /** Creates one flat demand interval. */
175
+ async createDemand(e, a) {
176
+ return D(
177
+ await f(`restaurants/${e}/schedules`).post("demands", a)
178
+ );
179
+ },
180
+ /** Deletes a batch of demands in one request — e.g. `saveDemand` replacing a whole
181
+ * day/weekday's demand rows wholesale. Deleting one demand is just this with a single-id
182
+ * array. */
183
+ async deleteDemands(e, a) {
184
+ return D(
185
+ await f(`restaurants/${e}/schedules`).delete("demands", {
186
+ params: { ids: a.join(",") }
187
+ })
188
+ );
189
+ },
190
+ /** Atomically replaces one date/weekday's flattened demand rows. */
191
+ async replaceDemands(e, a) {
192
+ return D(
193
+ await f(`restaurants/${e}/schedules`).post(
194
+ "demands/replace",
195
+ a
196
+ )
197
+ );
198
+ },
199
+ /** Atomically replaces several date/weekday demand generations. */
200
+ async bulkReplaceDemands(e, a) {
201
+ return D(
202
+ await f(`restaurants/${e}/schedules`).post(
203
+ "demands/bulk-replace",
204
+ a
205
+ )
206
+ );
207
+ },
208
+ /** Replaces one date's note/holiday-mark. All three fields back to empty/false clears it. */
209
+ async saveScheduleDay(e, a, t) {
210
+ return D(
211
+ await f(`restaurants/${e}/schedules`).post(
212
+ `days/${a}`,
213
+ t
214
+ )
215
+ );
216
+ },
217
+ /** A one-off shift assignment. */
218
+ async createAssignment(e, a) {
219
+ return D(
220
+ await f(`restaurants/${e}/schedules`).post("assignments", a)
221
+ );
222
+ },
223
+ async updateAssignment(e, a, t) {
224
+ return D(
225
+ await f(`restaurants/${e}/schedules`).patch(
226
+ `assignments/${a}`,
227
+ t
228
+ )
229
+ );
230
+ },
231
+ /** Atomically applies assignment updates, creates, and deletes used by moves and swaps. */
232
+ async bulkSaveAssignments(e, a) {
233
+ return D(
234
+ await f(`restaurants/${e}/schedules`).post(
235
+ "assignments/bulk",
236
+ a
237
+ )
238
+ );
239
+ },
240
+ /** Replaces demand and/or assignments in one backend transaction. */
241
+ async copySchedule(e, a) {
242
+ return D(
243
+ await f(`restaurants/${e}/schedules`).post("copy", a)
244
+ );
245
+ },
246
+ /** Clears demand and/or assignments in one backend transaction. */
247
+ async clearSchedule(e, a) {
248
+ return D(
249
+ await f(`restaurants/${e}/schedules`).post("clear", a)
250
+ );
251
+ },
252
+ /** Deletes a batch of assignments in one request — e.g. a shift split into several segments
253
+ * getting replaced wholesale. Deleting one assignment is just this with a single-id
254
+ * array. */
255
+ async deleteAssignments(e, a) {
256
+ return D(
257
+ await f(`restaurants/${e}/schedules`).delete("assignments", {
258
+ params: { ids: a.join(",") }
259
+ })
260
+ );
261
+ },
262
+ /** Removes all assignments for an employee from the inclusive removal date onward. */
263
+ async deleteEmployeeFutureAssignments(e, a, t) {
264
+ return D(
265
+ await f(`restaurants/${e}/schedules`).delete(
266
+ "assignments/employee-future",
267
+ { params: { employeeId: a, from: t } }
268
+ )
269
+ );
270
+ },
271
+ /** Flips a batch of assignments to one status in a single request — e.g. Publish sending
272
+ * every DRAFT shift on the board to PUBLISHED at once. */
273
+ async bulkUpdateAssignmentStatus(e, a) {
274
+ return D(
275
+ await f(`restaurants/${e}/schedules`).patch(
276
+ "assignments/bulk-status",
277
+ a
278
+ )
279
+ );
280
+ }
281
+ }, Ze = {
282
+ payload: He(null),
283
+ loading: P(!1),
284
+ rosterLoading: P(!1),
285
+ loadError: P(null),
286
+ scheduleSetupCompleted: P(!1),
287
+ dataVersion: P(0),
288
+ outletId: P(""),
289
+ restaurantEmployees: P([]),
290
+ employeeConfigs: P([]),
291
+ employeeOutletIds: He({}),
292
+ businessEmployees: He([]),
293
+ positions: I([]),
294
+ positionRecords: I([]),
295
+ rolePositions: I({}),
296
+ outlet: I({ name: "" }),
297
+ locationOptions: I([]),
298
+ locationLabelById: I({}),
299
+ departmentOptions: I([]),
300
+ compensationGroupOptions: I([]),
301
+ compensationGroupMeta: I({}),
302
+ existingStaff: I([]),
303
+ shiftTemplates: I([]),
304
+ rules: I({
305
+ coverage: {},
306
+ openFrom: "00:00",
307
+ openTo: "24:00",
308
+ dayHours: Array.from({ length: 7 }, () => []),
309
+ payRate: {
310
+ NORMAL: { overtime: 1.5 },
311
+ REST_DAY: { regular: 1, overtime: 2 },
312
+ PUBLIC_HOLIDAY: { regular: 2, overtime: 3 }
313
+ },
314
+ salesForecast: 0,
315
+ closedWeekdays: [],
316
+ labourTarget: 0,
317
+ budgetFromSales: !1,
318
+ budget: 0,
319
+ otCapHours: null,
320
+ workingHours: {
321
+ minHoursPerDay: null,
322
+ maxHoursPerDay: 8,
323
+ maxHoursPerWeek: 45
324
+ },
325
+ otBudget: 0,
326
+ notify: {
327
+ waConnected: !1,
328
+ waNumber: "",
329
+ waDisplayName: "",
330
+ defaults: { wa: !1, push: !1, email: !1 }
331
+ }
332
+ })
333
+ }, {
334
+ payload: r,
335
+ loading: Ye,
336
+ rosterLoading: Be,
337
+ loadError: fe,
338
+ scheduleSetupCompleted: he,
339
+ dataVersion: J,
340
+ outletId: m,
341
+ restaurantEmployees: re,
342
+ employeeConfigs: z,
343
+ employeeOutletIds: qe,
344
+ businessEmployees: Ee,
345
+ positions: Sa,
346
+ positionRecords: U,
347
+ rolePositions: eo,
348
+ outlet: Ca,
349
+ locationOptions: _e,
350
+ locationLabelById: oe,
351
+ compensationGroupMeta: ao,
352
+ existingStaff: to,
353
+ shiftTemplates: no,
354
+ rules: S
355
+ } = Ze;
356
+ function Ma() {
357
+ const e = Ze.rules;
358
+ Object.keys(e.coverage).forEach((a) => delete e.coverage[a]), e.openFrom = "00:00", e.openTo = "24:00", e.dayHours.splice(0, e.dayHours.length, ...Array.from({ length: 7 }, () => [])), Object.assign(e.payRate.NORMAL, { overtime: 1.5 }), Object.assign(e.payRate.REST_DAY, { regular: 1, overtime: 2 }), Object.assign(e.payRate.PUBLIC_HOLIDAY, { regular: 2, overtime: 3 }), e.salesForecast = 0, e.closedWeekdays.splice(0, e.closedWeekdays.length), e.labourTarget = 0, e.budgetFromSales = !1, e.budget = 0, e.otCapHours = null, e.workingHours = {
359
+ minHoursPerDay: null,
360
+ maxHoursPerDay: 8,
361
+ maxHoursPerWeek: 45
362
+ }, e.otBudget = 0, Object.assign(e.notify, {
363
+ waConnected: !1,
364
+ waNumber: "",
365
+ waDisplayName: "",
366
+ defaults: { wa: !1, push: !1, email: !1 }
367
+ });
368
+ }
369
+ const Se = 7;
370
+ function La(e) {
371
+ const a = e.getFullYear(), t = String(e.getMonth() + 1).padStart(2, "0"), n = String(e.getDate()).padStart(2, "0");
372
+ return `${a}-${t}-${n}`;
373
+ }
374
+ function se(e, a) {
375
+ const t = new Date(e);
376
+ return t.setDate(t.getDate() + a), t;
377
+ }
378
+ function Ce(e) {
379
+ const a = new Date(e);
380
+ return a.setHours(0, 0, 0, 0), a.setDate(a.getDate() - (a.getDay() + 6) % 7), a;
381
+ }
382
+ function oo(e, a = /* @__PURE__ */ new Date()) {
383
+ const t = se(Ce(a), e * Se);
384
+ return Array.from({ length: Se }, (n, o) => se(t, o));
385
+ }
386
+ function so(e, a) {
387
+ const t = (i) => Date.UTC(i.getFullYear(), i.getMonth(), i.getDate()), n = t(Ce(e)), o = t(Ce(a));
388
+ return Math.trunc((o - n) / (Se * 24 * 60 * 60 * 1e3));
389
+ }
390
+ const V = La;
391
+ let Z = null, q = null, Q = null, ne = 0, ve = null;
392
+ function Fe(e) {
393
+ return e === m.value ? !1 : (Ma(), m.value = e, r.value = null, Z = null, q = null, fe.value = null, ve = null, he.value = !1, re.value = [], z.value = [], Q = null, ne += 1, J.value += 1, !0);
394
+ }
395
+ async function Me(e) {
396
+ if (!(!e || ve === e)) {
397
+ Be.value = !0;
398
+ try {
399
+ await Ia(e);
400
+ } finally {
401
+ Be.value = !1;
402
+ }
403
+ }
404
+ }
405
+ async function Ia(e) {
406
+ const a = await Ne.readEmployeesPage({
407
+ limit: te,
408
+ offset: 0,
409
+ restaurantIds: [e]
410
+ });
411
+ e === m.value && (re.value = a.items, z.value = await H.listEmployeeConfigs(e), ve = e, J.value += 1, xa().then((t) => {
412
+ e === m.value && (qe.value = t, J.value += 1);
413
+ }));
414
+ }
415
+ async function Ta(e) {
416
+ const a = m.value;
417
+ if (!a || !e.length) return;
418
+ const t = await H.saveEmployeeConfigs(a, { configs: e });
419
+ z.value = t, J.value += 1;
420
+ }
421
+ async function io(e) {
422
+ const a = m.value;
423
+ if (!a) throw new Error("No outlet selected");
424
+ const t = await H.saveSettings(a, e);
425
+ return m.value === a && r.value && (r.value = { ...r.value, settings: t }), t;
426
+ }
427
+ function ea() {
428
+ !he.value && r.value && r.value.demands.length > 0 && r.value.assignments.length > 0 && (he.value = !0);
429
+ }
430
+ async function Ra(e, a) {
431
+ const t = z.value.find((o) => o.employeeId === e), n = (t == null ? void 0 : t.displayOrder) ?? (z.value.some((o) => o.displayOrder !== null) ? Math.max(
432
+ 0,
433
+ ...z.value.filter(
434
+ (o) => o.displayOrder !== null
435
+ ).map((o) => o.displayOrder)
436
+ ) + 100 : null);
437
+ await Ta([{ employeeId: e, enabled: a, displayOrder: n }]);
438
+ }
439
+ async function ro(e, a = V(/* @__PURE__ */ new Date())) {
440
+ const t = m.value;
441
+ if (!t) throw new Error("No outlet selected");
442
+ await H.deleteEmployeeFutureAssignments(t, e, a), r.value && (r.value = {
443
+ ...r.value,
444
+ assignments: r.value.assignments.filter(
445
+ (n) => n.employeeId !== e || n.date < a
446
+ )
447
+ });
448
+ }
449
+ async function Le() {
450
+ const e = m.value;
451
+ e && (ve = null, await Me(e));
452
+ }
453
+ async function Oa(e, a) {
454
+ const t = je(), n = (await X(!0)).find((s) => s._id === e);
455
+ if (!n) throw new Error("Could not find this employee");
456
+ const o = n.restaurantRole.map((s) => ({
457
+ restaurantId: s.restaurantId,
458
+ roleId: s.roleId
459
+ })), i = a(o);
460
+ if (!i.length)
461
+ throw new Error(
462
+ "An employee must keep at least 1 location, otherwise they are deleted. To delete them, use the Employee page."
463
+ );
464
+ (n.isMasterUser ? "master" : "user") === "master" ? await t.updateMasterEmployee(e, {
465
+ user: { name: n.name, passcode: n.passcode, code: n.code ?? "" },
466
+ roles: i,
467
+ previousRoles: o
468
+ }) : await t.updateEmployee(e, {
469
+ user: { name: n.name, passcode: n.passcode },
470
+ roles: i,
471
+ previousRoles: o
472
+ }), await X(!0);
473
+ }
474
+ async function lo(e, a, t = "", n = !0) {
475
+ const o = [...new Set(a.filter(Boolean))];
476
+ o.length && (await Oa(e, (i) => [
477
+ ...i.filter((l) => !o.includes(l.restaurantId)),
478
+ ...o.map((l) => ({ restaurantId: l, roleId: t }))
479
+ ]), n && m.value && o.includes(m.value) && await Ra(e, !0), await Le());
480
+ }
481
+ async function uo(e, a, t) {
482
+ const n = je(), o = (t == null ? void 0 : t._id) === e ? t : (await X(!0)).find((g) => g._id === e);
483
+ if (!o) throw new Error("Could not find this employee");
484
+ const i = (g) => g.slice().sort((A, O) => A.restaurantId.localeCompare(O.restaurantId)).map((A) => `${A.restaurantId}:${A.roleId}`).join("|"), l = i(o.restaurantRole) !== i(a.roles), s = o.name !== a.name || o.passcode !== a.passcode || o.isMasterUser !== a.masterUser || a.masterUser && (o.code ?? "") !== a.masterCode;
485
+ if (!l && !s) return;
486
+ const d = o.restaurantRole.map((g) => ({
487
+ restaurantId: g.restaurantId,
488
+ roleId: g.roleId
489
+ })), v = o.isMasterUser ? (await $e.readTeamMembers()).find((g) => g.doc.posUserId === e) : void 0;
490
+ if (v) {
491
+ const g = Ea(), A = g.getPermissionAssignmentByUserId(v.id) ?? await g.readPermissionAssignmentByUserId(v.id), O = a.masterUser ? {
492
+ code: a.masterCode,
493
+ name: a.name,
494
+ passcode: a.passcode,
495
+ roles: a.roles
496
+ } : null;
497
+ await $e.updateTeamMember(v.id, {
498
+ permissions: v.permissions,
499
+ customPermissions: (A == null ? void 0 : A.customPermissions) ?? v.permissions,
500
+ permissionSetIds: (A == null ? void 0 : A.permissionSetIds) ?? v.doc.permissionSetIds ?? [],
501
+ posUser: O
502
+ }), await X(!0), await Le();
503
+ return;
504
+ }
505
+ if (a.masterUser) {
506
+ const g = {
507
+ user: { name: a.name, passcode: a.passcode, code: a.masterCode },
508
+ roles: a.roles,
509
+ previousRoles: d
510
+ };
511
+ o.isMasterUser ? await n.updateMasterEmployee(e, g) : await n.migrateToMasterUser(e, g);
512
+ } else
513
+ o.isMasterUser ? await n.updateMasterEmployee(e, {
514
+ user: { name: o.name, passcode: o.passcode, code: o.code ?? "" },
515
+ roles: [],
516
+ previousRoles: d
517
+ }) : await n.updateEmployee(e, {
518
+ user: { name: a.name, passcode: a.passcode },
519
+ roles: a.roles,
520
+ previousRoles: d
521
+ });
522
+ await X(!0), await Le();
523
+ }
524
+ let ae = null;
525
+ async function $a() {
526
+ const e = await Ne.readEmployeesPage({
527
+ limit: te,
528
+ offset: 0,
529
+ includeEmptyPasscode: !0
530
+ }), a = Math.min(ka, Math.ceil(e.total / te)), t = await Promise.all(
531
+ Array.from(
532
+ { length: Math.max(0, a - 1) },
533
+ (n, o) => Ne.readEmployeesPage({
534
+ limit: te,
535
+ offset: (o + 1) * te,
536
+ includeEmptyPasscode: !0
537
+ })
538
+ )
539
+ );
540
+ return [...e.items, ...t.flatMap((n) => n.items)];
541
+ }
542
+ function X(e = !1) {
543
+ if (!e) {
544
+ if (ae) return ae;
545
+ if (Ee.value.length) return Promise.resolve(Ee.value);
546
+ }
547
+ const a = $a().then((t) => (Ee.value = t, t)).finally(() => {
548
+ ae === a && (ae = null);
549
+ });
550
+ return ae = a, a;
551
+ }
552
+ async function xa() {
553
+ const e = {};
554
+ try {
555
+ (await X()).forEach((a) => {
556
+ e[a._id] = [...new Set(a.restaurantRole.map((t) => t.restaurantId))];
557
+ });
558
+ } catch {
559
+ return e;
560
+ }
561
+ return e;
562
+ }
563
+ function Ue(e, a) {
564
+ return Z !== null && q !== null && Z <= e && q >= a;
565
+ }
566
+ async function Ya(e) {
567
+ const a = V(e), t = V(se(e, 6));
568
+ Ue(a, t) || Q && (await Q, Ue(a, t)) || await aa(
569
+ se(e, -7 * xe),
570
+ se(e, 7 * xe)
571
+ );
572
+ }
573
+ async function co() {
574
+ !Z || !q || await aa(/* @__PURE__ */ new Date(`${Z}T00:00:00`), /* @__PURE__ */ new Date(`${q}T00:00:00`));
575
+ }
576
+ async function mo(e) {
577
+ if (!m.value) throw new Error("No outlet selected");
578
+ const a = await H.createEmployeeProfile(m.value, e);
579
+ r.value && (r.value.employees.push(a), J.value += 1);
580
+ }
581
+ async function yo(e) {
582
+ await H.validatePosAccess(e);
583
+ }
584
+ async function po(e, a) {
585
+ if (!m.value) throw new Error("No outlet selected");
586
+ const t = await H.updateEmployeeProfile(m.value, e, a);
587
+ if (r.value) {
588
+ const n = r.value.employees.findIndex((o) => o.employeeId === e);
589
+ n > -1 && (r.value = {
590
+ ...r.value,
591
+ employees: r.value.employees.map((o, i) => i === n ? t : o)
592
+ });
593
+ }
594
+ }
595
+ async function fo(e) {
596
+ const a = await H.createPosition(e);
597
+ r.value && (r.value = { ...r.value, positions: [...r.value.positions, a] });
598
+ }
599
+ async function ho(e, a) {
600
+ const t = await H.updatePosition(e, a);
601
+ if (r.value) {
602
+ const n = r.value.positions.find((i) => i.id === e), o = (i) => i.positionId === e || !i.positionId && i.positionName === (n == null ? void 0 : n.name);
603
+ r.value = {
604
+ ...r.value,
605
+ positions: r.value.positions.map((i) => i.id === e ? t : i),
606
+ employees: r.value.employees.map((i) => ({
607
+ ...i,
608
+ primaryPosition: i.primaryPosition && o(i.primaryPosition) ? { ...i.primaryPosition, positionName: t.name } : i.primaryPosition,
609
+ secondaryPositions: i.secondaryPositions.map(
610
+ (l) => o(l) ? { ...l, positionName: t.name } : l
611
+ )
612
+ }))
613
+ };
614
+ }
615
+ }
616
+ async function vo(e) {
617
+ await H.deletePosition(e), r.value && (r.value = {
618
+ ...r.value,
619
+ positions: r.value.positions.filter((a) => a.id !== e)
620
+ });
621
+ }
622
+ async function go(e, a) {
623
+ var o;
624
+ if (!m.value) throw new Error("No outlet selected");
625
+ const t = (o = r.value) == null ? void 0 : o.days.find((i) => i.date === e), n = await H.saveScheduleDay(m.value, e, {
626
+ ...a,
627
+ expectedUpdatedAt: a.expectedUpdatedAt ?? (t == null ? void 0 : t.updatedAt)
628
+ });
629
+ if (r.value) {
630
+ const i = r.value.days.filter((l) => l.date !== e);
631
+ n && i.push(n), r.value = { ...r.value, days: i };
632
+ }
633
+ }
634
+ function Ba(e) {
635
+ const a = e.periods.flatMap((t) => {
636
+ const n = (t.roles ?? []).filter((l) => l.positionName && l.headcount > 0), o = n.reduce((l, s) => l + s.headcount, 0), i = {
637
+ startTime: t.startTime,
638
+ endTime: t.endTime
639
+ };
640
+ return [
641
+ ...n.map((l) => ({
642
+ ...i,
643
+ headcount: l.headcount,
644
+ position: { positionId: l.positionId, positionName: l.positionName }
645
+ })),
646
+ ...t.headcount > o ? [{ ...i, headcount: t.headcount - o }] : []
647
+ ];
648
+ });
649
+ return {
650
+ date: e.date,
651
+ demands: a
652
+ };
653
+ }
654
+ async function Do(e) {
655
+ if (!m.value) throw new Error("No outlet selected");
656
+ if (!e.length) return;
657
+ const a = e.map(Ba), t = e.length === 1 ? await H.replaceDemands(m.value, a[0]) : await H.bulkReplaceDemands(m.value, { replacements: a });
658
+ if (r.value) {
659
+ const n = new Set(e.map((i) => i.date)), o = r.value.demands.filter((i) => i.date === null || !n.has(i.date));
660
+ r.value = { ...r.value, demands: [...o, ...t] };
661
+ }
662
+ ea();
663
+ }
664
+ async function wo(e) {
665
+ if (!m.value) throw new Error("No outlet selected");
666
+ return H.generateAutoSchedule(m.value, e);
667
+ }
668
+ async function Ho() {
669
+ if (!m.value) throw new Error("No outlet selected");
670
+ return H.getAutoScheduleCapabilities(m.value);
671
+ }
672
+ async function Ao(e) {
673
+ if (!m.value) throw new Error("No outlet selected");
674
+ return H.applyAutoSchedule(m.value, e);
675
+ }
676
+ async function Eo(e) {
677
+ if (!m.value) throw new Error("No outlet selected");
678
+ const a = await H.bulkSaveAssignments(m.value, e);
679
+ if (r.value) {
680
+ const t = new Set(e.deleteIds), n = new Map(
681
+ r.value.assignments.filter((o) => !t.has(o.id)).map((o) => [o.id, o])
682
+ );
683
+ a.updated.forEach((o) => n.set(o.id, o)), a.created.forEach((o) => n.set(o.id, o)), r.value = { ...r.value, assignments: [...n.values()] };
684
+ }
685
+ return ea(), a;
686
+ }
687
+ async function Po(e) {
688
+ if (!m.value) throw new Error("No outlet selected");
689
+ return H.copySchedule(m.value, e);
690
+ }
691
+ async function bo(e) {
692
+ var t;
693
+ if (!m.value) throw new Error("No outlet selected");
694
+ const a = await H.clearSchedule(m.value, e);
695
+ if (r.value) {
696
+ const n = new Set(
697
+ (((t = e.demand) == null ? void 0 : t.replacements) ?? []).map((l) => l.date)
698
+ ), o = new Set(a.deletedAssignmentIds), i = a.demand;
699
+ r.value = {
700
+ ...r.value,
701
+ demands: [
702
+ ...r.value.demands.filter((l) => l.date === null || !n.has(l.date)),
703
+ ...i
704
+ ],
705
+ assignments: r.value.assignments.filter((l) => !o.has(l.id))
706
+ };
707
+ }
708
+ return a;
709
+ }
710
+ async function No(e) {
711
+ if (!m.value) throw new Error("No outlet selected");
712
+ if (e.length && (await H.deleteAssignments(m.value, e), r.value)) {
713
+ const a = new Set(e);
714
+ r.value = {
715
+ ...r.value,
716
+ assignments: r.value.assignments.filter((t) => !a.has(t.id))
717
+ };
718
+ }
719
+ }
720
+ async function ko(e) {
721
+ if (!m.value) throw new Error("No outlet selected");
722
+ const a = await H.createTimeOff(m.value, e);
723
+ return r.value && (r.value = { ...r.value, timeOff: [...r.value.timeOff, a] }), a;
724
+ }
725
+ async function So(e, a) {
726
+ if (!m.value) throw new Error("No outlet selected");
727
+ const t = await H.updateTimeOffStatus(m.value, e, a);
728
+ return t && r.value && (r.value = {
729
+ ...r.value,
730
+ timeOff: r.value.timeOff.map((n) => n.id === e ? t : n)
731
+ }), t;
732
+ }
733
+ async function Co(e) {
734
+ if (!m.value) throw new Error("No outlet selected");
735
+ await H.deleteTimeOff(m.value, e), r.value && (r.value = {
736
+ ...r.value,
737
+ timeOff: r.value.timeOff.filter((a) => a.id !== e)
738
+ });
739
+ }
740
+ async function Mo(e) {
741
+ if (!m.value) throw new Error("No outlet selected");
742
+ const a = await H.bulkUpdateAssignmentStatus(m.value, e);
743
+ if (r.value && a.length) {
744
+ const t = new Map(a.map((n) => [n.id, n]));
745
+ r.value = {
746
+ ...r.value,
747
+ assignments: r.value.assignments.map(
748
+ (n) => t.get(n.id) ?? n
749
+ )
750
+ };
751
+ }
752
+ return a;
753
+ }
754
+ async function aa(e, a) {
755
+ const t = m.value;
756
+ if (!t) {
757
+ fe.value = "No outlet selected";
758
+ return;
759
+ }
760
+ const n = V(e), o = V(a), i = ++ne;
761
+ Ye.value = !0, fe.value = null;
762
+ const l = (async () => {
763
+ try {
764
+ const s = await H.readBoard(t, n, o);
765
+ if (m.value !== t || i !== ne) return;
766
+ r.value = s, he.value = s.settings.setupCompleted, Z = n, q = o, J.value += 1;
767
+ } catch (s) {
768
+ if (m.value !== t || i !== ne) return;
769
+ fe.value = s instanceof Error ? s.message : "Could not load the schedule";
770
+ } finally {
771
+ m.value === t && i === ne && (Ye.value = !1);
772
+ }
773
+ })();
774
+ Q = l;
775
+ try {
776
+ await l;
777
+ } finally {
778
+ Q === l && (Q = null);
779
+ }
780
+ }
781
+ const _a = "AE", Fa = "Asia/Dubai", Ua = {
782
+ NORMAL: {
783
+ overtime: 1.25
784
+ },
785
+ REST_DAY: {
786
+ regular: 1,
787
+ overtime: 2
788
+ },
789
+ PUBLIC_HOLIDAY: {
790
+ regular: 2.5,
791
+ overtime: 1.5
792
+ }
793
+ }, Wa = {
794
+ maxHoursPerMonth: null
795
+ }, za = {
796
+ fullTime: {
797
+ minHoursPerDay: null,
798
+ maxHoursPerDay: 8,
799
+ maxHoursPerWeek: 48
800
+ },
801
+ partTime: {
802
+ maxHoursPerWeek: 32
803
+ }
804
+ }, Va = [
805
+ {
806
+ month: 1,
807
+ day: 1,
808
+ name: "New Year's Day"
809
+ },
810
+ {
811
+ month: 12,
812
+ day: 2,
813
+ name: "UAE National Day"
814
+ },
815
+ {
816
+ month: 12,
817
+ day: 3,
818
+ name: "UAE National Day Holiday"
819
+ }
820
+ ], Ka = {
821
+ 2026: {
822
+ "2026-01-01": "Gregorian New Year",
823
+ "2026-03-20": "Eid Al-Fitr Holiday",
824
+ "2026-03-21": "Eid Al-Fitr Holiday",
825
+ "2026-03-22": "Eid Al-Fitr Holiday",
826
+ "2026-05-26": "Arafat Day",
827
+ "2026-05-27": "Eid Al-Adha Holiday",
828
+ "2026-05-28": "Eid Al-Adha Holiday",
829
+ "2026-05-29": "Eid Al-Adha Holiday",
830
+ "2026-06-17": "Islamic New Year",
831
+ "2026-08-26": "Prophet Muhammad's Birthday",
832
+ "2026-12-02": "UAE National Day",
833
+ "2026-12-03": "UAE National Day Holiday"
834
+ },
835
+ 2027: {
836
+ "2027-01-01": "Gregorian New Year",
837
+ "2027-03-08": "Eid Al-Fitr Holiday",
838
+ "2027-03-09": "Eid Al-Fitr Holiday",
839
+ "2027-03-10": "Eid Al-Fitr Holiday",
840
+ "2027-03-11": "Eid Al-Fitr Holiday",
841
+ "2027-05-15": "Arafat Day",
842
+ "2027-05-16": "Eid Al-Adha Holiday",
843
+ "2027-05-17": "Eid Al-Adha Holiday",
844
+ "2027-05-18": "Eid Al-Adha Holiday",
845
+ "2027-06-06": "Islamic New Year",
846
+ "2027-08-14": "Prophet Muhammad's Birthday",
847
+ "2027-12-02": "UAE National Day",
848
+ "2027-12-03": "UAE National Day Holiday"
849
+ }
850
+ }, Ga = {
851
+ countryCode: _a,
852
+ timezone: Fa,
853
+ payRate: Ua,
854
+ overtime: Wa,
855
+ workingHours: za,
856
+ recurringPublicHolidays: Va,
857
+ publicHolidays: Ka
858
+ }, ja = "BN", Qa = "Asia/Brunei", Xa = {
859
+ NORMAL: {
860
+ overtime: 1.5
861
+ },
862
+ REST_DAY: {
863
+ regular: 1,
864
+ overtime: 2
865
+ },
866
+ PUBLIC_HOLIDAY: {
867
+ regular: 2,
868
+ overtime: 3
869
+ }
870
+ }, Ja = {
871
+ maxHoursPerMonth: 72
872
+ }, Za = {
873
+ fullTime: {
874
+ minHoursPerDay: null,
875
+ maxHoursPerDay: 8,
876
+ maxHoursPerWeek: 44
877
+ },
878
+ partTime: {
879
+ maxHoursPerWeek: 30
880
+ }
881
+ }, qa = [
882
+ {
883
+ month: 1,
884
+ day: 1,
885
+ name: "New Year's Day"
886
+ },
887
+ {
888
+ month: 2,
889
+ day: 23,
890
+ name: "National Day"
891
+ },
892
+ {
893
+ month: 5,
894
+ day: 1,
895
+ name: "International Labour Day"
896
+ },
897
+ {
898
+ month: 7,
899
+ day: 15,
900
+ name: "Sultan's Birthday"
901
+ },
902
+ {
903
+ month: 12,
904
+ day: 25,
905
+ name: "Christmas Day"
906
+ }
907
+ ], et = {
908
+ 2026: {
909
+ "2026-01-01": "New Year's Day",
910
+ "2026-02-17": "Chinese New Year",
911
+ "2026-02-23": "National Day",
912
+ "2026-03-07": "Nuzul Al-Quran",
913
+ "2026-03-20": "Hari Raya Aidilfitri",
914
+ "2026-03-21": "Hari Raya Aidilfitri Holiday",
915
+ "2026-03-22": "Hari Raya Aidilfitri Holiday",
916
+ "2026-05-01": "International Labour Day",
917
+ "2026-05-27": "Hari Raya Aidiladha",
918
+ "2026-06-17": "Islamic New Year",
919
+ "2026-07-15": "Sultan's Birthday",
920
+ "2026-08-25": "Prophet Muhammad's Birthday",
921
+ "2026-12-25": "Christmas Day"
922
+ },
923
+ 2027: {
924
+ "2027-01-01": "New Year's Day",
925
+ "2027-02-06": "Chinese New Year",
926
+ "2027-02-23": "National Day",
927
+ "2027-03-07": "Nuzul Al-Quran",
928
+ "2027-03-10": "Hari Raya Aidilfitri",
929
+ "2027-03-11": "Hari Raya Aidilfitri Holiday",
930
+ "2027-05-01": "International Labour Day",
931
+ "2027-05-17": "Hari Raya Aidiladha",
932
+ "2027-06-06": "Islamic New Year",
933
+ "2027-07-15": "Sultan's Birthday",
934
+ "2027-08-15": "Prophet Muhammad's Birthday",
935
+ "2027-12-25": "Christmas Day"
936
+ }
937
+ }, at = {
938
+ countryCode: ja,
939
+ timezone: Qa,
940
+ payRate: Xa,
941
+ overtime: Ja,
942
+ workingHours: Za,
943
+ recurringPublicHolidays: qa,
944
+ publicHolidays: et
945
+ }, tt = "ID", nt = "Asia/Jakarta", ot = {
946
+ NORMAL: {
947
+ overtime: 1.5
948
+ },
949
+ REST_DAY: {
950
+ regular: 1,
951
+ overtime: 2
952
+ },
953
+ PUBLIC_HOLIDAY: {
954
+ regular: 2,
955
+ overtime: 2
956
+ }
957
+ }, st = {
958
+ maxHoursPerMonth: 72
959
+ }, it = {
960
+ fullTime: {
961
+ minHoursPerDay: null,
962
+ maxHoursPerDay: 8,
963
+ maxHoursPerWeek: 40
964
+ },
965
+ partTime: {
966
+ maxHoursPerWeek: null
967
+ }
968
+ }, rt = [
969
+ {
970
+ month: 1,
971
+ day: 1,
972
+ name: "New Year's Day"
973
+ },
974
+ {
975
+ month: 5,
976
+ day: 1,
977
+ name: "International Labour Day"
978
+ },
979
+ {
980
+ month: 8,
981
+ day: 17,
982
+ name: "Independence Day"
983
+ },
984
+ {
985
+ month: 12,
986
+ day: 25,
987
+ name: "Christmas Day"
988
+ }
989
+ ], lt = {
990
+ 2026: {
991
+ "2026-01-01": "New Year's Day",
992
+ "2026-01-16": "Isra Mi'raj",
993
+ "2026-02-17": "Chinese New Year",
994
+ "2026-03-19": "Nyepi",
995
+ "2026-03-21": "Eid al-Fitr",
996
+ "2026-03-22": "Eid al-Fitr Holiday",
997
+ "2026-04-03": "Good Friday",
998
+ "2026-04-05": "Easter Sunday",
999
+ "2026-05-01": "International Labour Day",
1000
+ "2026-05-14": "Ascension Day",
1001
+ "2026-05-27": "Eid al-Adha",
1002
+ "2026-05-31": "Vesak Day",
1003
+ "2026-06-01": "Pancasila Day",
1004
+ "2026-06-16": "Islamic New Year",
1005
+ "2026-08-17": "Independence Day",
1006
+ "2026-08-25": "Prophet Muhammad's Birthday",
1007
+ "2026-12-25": "Christmas Day"
1008
+ },
1009
+ 2027: {
1010
+ "2027-01-01": "New Year's Day",
1011
+ "2027-01-05": "Isra Mi'raj",
1012
+ "2027-02-06": "Chinese New Year",
1013
+ "2027-03-08": "Nyepi",
1014
+ "2027-03-10": "Eid al-Fitr",
1015
+ "2027-03-11": "Eid al-Fitr Holiday",
1016
+ "2027-03-26": "Good Friday",
1017
+ "2027-03-28": "Easter Sunday",
1018
+ "2027-05-01": "International Labour Day",
1019
+ "2027-05-06": "Ascension Day",
1020
+ "2027-05-17": "Eid al-Adha",
1021
+ "2027-05-20": "Vesak Day",
1022
+ "2027-06-01": "Pancasila Day",
1023
+ "2027-06-06": "Islamic New Year",
1024
+ "2027-08-15": "Prophet Muhammad's Birthday",
1025
+ "2027-08-17": "Independence Day",
1026
+ "2027-12-25": "Christmas Day",
1027
+ "2027-12-26": "Isra Mi'raj"
1028
+ }
1029
+ }, ut = {
1030
+ countryCode: tt,
1031
+ timezone: nt,
1032
+ payRate: ot,
1033
+ overtime: st,
1034
+ workingHours: it,
1035
+ recurringPublicHolidays: rt,
1036
+ publicHolidays: lt
1037
+ }, dt = "MO", ct = "Asia/Macau", mt = {
1038
+ NORMAL: {
1039
+ overtime: 1.5
1040
+ },
1041
+ REST_DAY: {
1042
+ regular: 1,
1043
+ overtime: 2
1044
+ },
1045
+ PUBLIC_HOLIDAY: {
1046
+ regular: 2,
1047
+ overtime: 3
1048
+ }
1049
+ }, yt = {
1050
+ maxHoursPerMonth: null
1051
+ }, pt = {
1052
+ fullTime: {
1053
+ minHoursPerDay: null,
1054
+ maxHoursPerDay: 8,
1055
+ maxHoursPerWeek: 48
1056
+ },
1057
+ partTime: {
1058
+ maxHoursPerWeek: null
1059
+ }
1060
+ }, ft = [
1061
+ {
1062
+ month: 1,
1063
+ day: 1,
1064
+ name: "New Year's Day"
1065
+ },
1066
+ {
1067
+ month: 5,
1068
+ day: 1,
1069
+ name: "Labour Day"
1070
+ },
1071
+ {
1072
+ month: 10,
1073
+ day: 1,
1074
+ name: "National Day"
1075
+ },
1076
+ {
1077
+ month: 12,
1078
+ day: 20,
1079
+ name: "Macao Special Administrative Region Establishment Day"
1080
+ },
1081
+ {
1082
+ month: 12,
1083
+ day: 25,
1084
+ name: "Christmas Day"
1085
+ }
1086
+ ], ht = {
1087
+ 2026: {
1088
+ "2026-01-01": "New Year's Day",
1089
+ "2026-02-17": "Lunar New Year's Day",
1090
+ "2026-02-18": "Second day of Lunar New Year",
1091
+ "2026-02-19": "Third day of Lunar New Year",
1092
+ "2026-04-03": "Good Friday",
1093
+ "2026-04-04": "Day before Easter",
1094
+ "2026-04-05": "Cheng Ming Festival",
1095
+ "2026-04-06": "Compensatory rest day",
1096
+ "2026-04-07": "Compensatory rest day",
1097
+ "2026-05-01": "Labour Day",
1098
+ "2026-05-24": "Buddha's Birthday",
1099
+ "2026-05-25": "Compensatory rest day",
1100
+ "2026-06-19": "Dragon Boat Festival",
1101
+ "2026-09-26": "Day following Mid-Autumn Festival",
1102
+ "2026-09-28": "Compensatory rest day",
1103
+ "2026-10-01": "National Day",
1104
+ "2026-10-02": "Day following National Day",
1105
+ "2026-10-18": "Chong Yeung Festival",
1106
+ "2026-10-19": "Compensatory rest day",
1107
+ "2026-11-02": "All Souls' Day",
1108
+ "2026-12-08": "Immaculate Conception",
1109
+ "2026-12-20": "Macao SAR Establishment Day",
1110
+ "2026-12-21": "Compensatory rest day",
1111
+ "2026-12-22": "Winter Solstice",
1112
+ "2026-12-24": "Christmas Eve",
1113
+ "2026-12-25": "Christmas Day"
1114
+ },
1115
+ 2027: {
1116
+ "2027-01-01": "New Year's Day",
1117
+ "2027-02-06": "Lunar New Year's Day",
1118
+ "2027-02-07": "Second day of Lunar New Year",
1119
+ "2027-02-08": "Third day of Lunar New Year",
1120
+ "2027-02-09": "Compensatory rest day",
1121
+ "2027-02-10": "Compensatory rest day",
1122
+ "2027-03-26": "Good Friday",
1123
+ "2027-03-27": "Day before Easter",
1124
+ "2027-03-29": "Compensatory rest day",
1125
+ "2027-04-05": "Cheng Ming Festival",
1126
+ "2027-05-01": "Labour Day",
1127
+ "2027-05-03": "Compensatory rest day",
1128
+ "2027-05-13": "Buddha's Birthday",
1129
+ "2027-06-09": "Dragon Boat Festival",
1130
+ "2027-09-16": "Day following Mid-Autumn Festival",
1131
+ "2027-10-01": "National Day",
1132
+ "2027-10-02": "Day following National Day",
1133
+ "2027-10-04": "Compensatory rest day",
1134
+ "2027-10-08": "Chong Yeung Festival",
1135
+ "2027-11-02": "All Souls' Day",
1136
+ "2027-12-08": "Immaculate Conception",
1137
+ "2027-12-20": "Macao SAR Establishment Day",
1138
+ "2027-12-22": "Winter Solstice",
1139
+ "2027-12-24": "Christmas Eve",
1140
+ "2027-12-25": "Christmas Day",
1141
+ "2027-12-27": "Compensatory rest day"
1142
+ }
1143
+ }, vt = {
1144
+ countryCode: dt,
1145
+ timezone: ct,
1146
+ payRate: mt,
1147
+ overtime: yt,
1148
+ workingHours: pt,
1149
+ recurringPublicHolidays: ft,
1150
+ publicHolidays: ht
1151
+ }, gt = "MV", Dt = "Indian/Maldives", wt = {
1152
+ NORMAL: {
1153
+ overtime: 1.5
1154
+ },
1155
+ REST_DAY: {
1156
+ regular: 1,
1157
+ overtime: 2
1158
+ },
1159
+ PUBLIC_HOLIDAY: {
1160
+ regular: 2,
1161
+ overtime: 3
1162
+ }
1163
+ }, Ht = {
1164
+ maxHoursPerMonth: null
1165
+ }, At = {
1166
+ fullTime: {
1167
+ minHoursPerDay: null,
1168
+ maxHoursPerDay: 8,
1169
+ maxHoursPerWeek: 48
1170
+ },
1171
+ partTime: {
1172
+ maxHoursPerWeek: null
1173
+ }
1174
+ }, Et = [
1175
+ {
1176
+ month: 1,
1177
+ day: 1,
1178
+ name: "New Year's Day"
1179
+ },
1180
+ {
1181
+ month: 5,
1182
+ day: 1,
1183
+ name: "Labour Day"
1184
+ },
1185
+ {
1186
+ month: 7,
1187
+ day: 26,
1188
+ name: "Independence Day"
1189
+ },
1190
+ {
1191
+ month: 11,
1192
+ day: 3,
1193
+ name: "Victory Day"
1194
+ },
1195
+ {
1196
+ month: 11,
1197
+ day: 11,
1198
+ name: "Republic Day"
1199
+ }
1200
+ ], Pt = {
1201
+ 2026: {
1202
+ "2026-01-01": "New Year's Day",
1203
+ "2026-03-20": "Eid al-Fitr Holiday",
1204
+ "2026-03-21": "Eid al-Fitr Holiday",
1205
+ "2026-03-22": "Eid al-Fitr Holiday",
1206
+ "2026-05-01": "Labour Day",
1207
+ "2026-05-26": "Arafah Day",
1208
+ "2026-05-27": "Eid al-Adha Holiday",
1209
+ "2026-05-28": "Eid al-Adha Holiday",
1210
+ "2026-05-29": "Eid al-Adha Holiday",
1211
+ "2026-06-17": "Islamic New Year",
1212
+ "2026-07-26": "Independence Day",
1213
+ "2026-07-27": "Independence Day Holiday",
1214
+ "2026-08-14": "National Day",
1215
+ "2026-08-25": "Prophet Muhammad's Birthday",
1216
+ "2026-09-13": "The Day Maldives Embraced Islam",
1217
+ "2026-11-03": "Victory Day",
1218
+ "2026-11-11": "Republic Day"
1219
+ },
1220
+ 2027: {
1221
+ "2027-01-01": "New Year's Day",
1222
+ "2027-03-10": "Eid al-Fitr Holiday",
1223
+ "2027-03-11": "Eid al-Fitr Holiday",
1224
+ "2027-05-01": "Labour Day",
1225
+ "2027-05-15": "Arafah Day",
1226
+ "2027-05-16": "Eid al-Adha Holiday",
1227
+ "2027-05-17": "Eid al-Adha Holiday",
1228
+ "2027-05-18": "Eid al-Adha Holiday",
1229
+ "2027-06-06": "Islamic New Year",
1230
+ "2027-07-26": "Independence Day",
1231
+ "2027-07-27": "Independence Day Holiday",
1232
+ "2027-08-14": "National Day",
1233
+ "2027-08-15": "Prophet Muhammad's Birthday",
1234
+ "2027-09-03": "The Day Maldives Embraced Islam",
1235
+ "2027-11-03": "Victory Day",
1236
+ "2027-11-11": "Republic Day"
1237
+ }
1238
+ }, bt = {
1239
+ countryCode: gt,
1240
+ timezone: Dt,
1241
+ payRate: wt,
1242
+ overtime: Ht,
1243
+ workingHours: At,
1244
+ recurringPublicHolidays: Et,
1245
+ publicHolidays: Pt
1246
+ }, Nt = "MY", kt = "Asia/Kuala_Lumpur", St = {
1247
+ NORMAL: {
1248
+ overtime: 1.5
1249
+ },
1250
+ REST_DAY: {
1251
+ regular: 1,
1252
+ overtime: 2
1253
+ },
1254
+ PUBLIC_HOLIDAY: {
1255
+ regular: 2,
1256
+ overtime: 3
1257
+ }
1258
+ }, Ct = {
1259
+ maxHoursPerMonth: 104
1260
+ }, Mt = {
1261
+ fullTime: {
1262
+ minHoursPerDay: null,
1263
+ maxHoursPerDay: 8,
1264
+ maxHoursPerWeek: 45
1265
+ },
1266
+ partTime: {
1267
+ maxHoursPerWeek: 31.5
1268
+ }
1269
+ }, Lt = [
1270
+ {
1271
+ month: 1,
1272
+ day: 1,
1273
+ name: "New Year's Day"
1274
+ },
1275
+ {
1276
+ month: 5,
1277
+ day: 1,
1278
+ name: "Labour Day"
1279
+ },
1280
+ {
1281
+ month: 8,
1282
+ day: 31,
1283
+ name: "Merdeka Day"
1284
+ },
1285
+ {
1286
+ month: 9,
1287
+ day: 16,
1288
+ name: "Malaysia Day"
1289
+ },
1290
+ {
1291
+ month: 12,
1292
+ day: 25,
1293
+ name: "Christmas Day"
1294
+ }
1295
+ ], It = {
1296
+ 2026: {
1297
+ "2026-01-01": "New Year's Day",
1298
+ "2026-02-17": "Chinese New Year",
1299
+ "2026-02-18": "Chinese New Year Holiday",
1300
+ "2026-03-07": "Nuzul Al-Quran",
1301
+ "2026-03-20": "Hari Raya Aidilfitri",
1302
+ "2026-03-21": "Hari Raya Aidilfitri Holiday",
1303
+ "2026-03-22": "Hari Raya Aidilfitri Holiday",
1304
+ "2026-03-23": "Hari Raya Aidilfitri Holiday",
1305
+ "2026-05-01": "Labour Day",
1306
+ "2026-05-27": "Hari Raya Haji",
1307
+ "2026-05-31": "Wesak Day",
1308
+ "2026-06-01": "Agong's Birthday",
1309
+ "2026-06-17": "Awal Muharram",
1310
+ "2026-08-25": "Prophet Muhammad's Birthday",
1311
+ "2026-08-31": "Merdeka Day",
1312
+ "2026-09-16": "Malaysia Day",
1313
+ "2026-11-08": "Deepavali",
1314
+ "2026-12-25": "Christmas Day"
1315
+ },
1316
+ 2027: {
1317
+ "2027-01-01": "New Year's Day",
1318
+ "2027-02-06": "Chinese New Year",
1319
+ "2027-02-07": "Chinese New Year Holiday",
1320
+ "2027-03-10": "Hari Raya Aidilfitri",
1321
+ "2027-03-11": "Hari Raya Aidilfitri Holiday",
1322
+ "2027-05-01": "Labour Day",
1323
+ "2027-05-17": "Hari Raya Haji",
1324
+ "2027-05-20": "Wesak Day",
1325
+ "2027-06-01": "Agong's Birthday",
1326
+ "2027-06-06": "Awal Muharram",
1327
+ "2027-08-15": "Prophet Muhammad's Birthday",
1328
+ "2027-08-31": "Merdeka Day",
1329
+ "2027-09-16": "Malaysia Day",
1330
+ "2027-10-28": "Deepavali",
1331
+ "2027-12-25": "Christmas Day"
1332
+ }
1333
+ }, Tt = {
1334
+ countryCode: Nt,
1335
+ timezone: kt,
1336
+ payRate: St,
1337
+ overtime: Ct,
1338
+ workingHours: Mt,
1339
+ recurringPublicHolidays: Lt,
1340
+ publicHolidays: It
1341
+ }, Rt = "PK", Ot = "Asia/Karachi", $t = {
1342
+ NORMAL: {
1343
+ overtime: 1.5
1344
+ },
1345
+ REST_DAY: {
1346
+ regular: 1,
1347
+ overtime: 2
1348
+ },
1349
+ PUBLIC_HOLIDAY: {
1350
+ regular: 2,
1351
+ overtime: 3
1352
+ }
1353
+ }, xt = {
1354
+ maxHoursPerMonth: null
1355
+ }, Yt = {
1356
+ fullTime: {
1357
+ minHoursPerDay: null,
1358
+ maxHoursPerDay: 9,
1359
+ maxHoursPerWeek: 48
1360
+ },
1361
+ partTime: {
1362
+ maxHoursPerWeek: null
1363
+ }
1364
+ }, Bt = [
1365
+ {
1366
+ month: 1,
1367
+ day: 1,
1368
+ name: "New Year's Day"
1369
+ },
1370
+ {
1371
+ month: 2,
1372
+ day: 5,
1373
+ name: "Kashmir Day"
1374
+ },
1375
+ {
1376
+ month: 3,
1377
+ day: 23,
1378
+ name: "Pakistan Day"
1379
+ },
1380
+ {
1381
+ month: 5,
1382
+ day: 1,
1383
+ name: "Labour Day"
1384
+ },
1385
+ {
1386
+ month: 8,
1387
+ day: 14,
1388
+ name: "Independence Day"
1389
+ },
1390
+ {
1391
+ month: 12,
1392
+ day: 25,
1393
+ name: "Quaid-e-Azam Day and Christmas Day"
1394
+ }
1395
+ ], _t = {
1396
+ 2026: {
1397
+ "2026-01-01": "New Year's Day",
1398
+ "2026-02-05": "Kashmir Day",
1399
+ "2026-03-23": "Pakistan Day",
1400
+ "2026-05-01": "Labour Day",
1401
+ "2026-06-27": "Eid al-Adha",
1402
+ "2026-06-28": "Eid al-Adha Holiday",
1403
+ "2026-06-29": "Eid al-Adha Holiday",
1404
+ "2026-08-14": "Independence Day",
1405
+ "2026-08-25": "Eid Milad-un-Nabi",
1406
+ "2026-12-25": "Quaid-e-Azam Day and Christmas Day"
1407
+ },
1408
+ 2027: {
1409
+ "2027-01-01": "New Year's Day",
1410
+ "2027-02-05": "Kashmir Day",
1411
+ "2027-03-23": "Pakistan Day",
1412
+ "2027-05-01": "Labour Day",
1413
+ "2027-05-17": "Eid al-Adha",
1414
+ "2027-05-18": "Eid al-Adha Holiday",
1415
+ "2027-05-19": "Eid al-Adha Holiday",
1416
+ "2027-08-14": "Independence Day",
1417
+ "2027-08-15": "Eid Milad-un-Nabi",
1418
+ "2027-12-25": "Quaid-e-Azam Day and Christmas Day"
1419
+ }
1420
+ }, Ft = {
1421
+ countryCode: Rt,
1422
+ timezone: Ot,
1423
+ payRate: $t,
1424
+ overtime: xt,
1425
+ workingHours: Yt,
1426
+ recurringPublicHolidays: Bt,
1427
+ publicHolidays: _t
1428
+ }, Ut = "SG", Wt = "Asia/Singapore", zt = {
1429
+ NORMAL: {
1430
+ overtime: 1.5
1431
+ },
1432
+ REST_DAY: {
1433
+ regular: 1,
1434
+ overtime: 2
1435
+ },
1436
+ PUBLIC_HOLIDAY: {
1437
+ regular: 2,
1438
+ overtime: 1.5
1439
+ }
1440
+ }, Vt = {
1441
+ maxHoursPerMonth: 72
1442
+ }, Kt = {
1443
+ fullTime: {
1444
+ minHoursPerDay: null,
1445
+ maxHoursPerDay: 12,
1446
+ maxHoursPerWeek: 44
1447
+ },
1448
+ partTime: {
1449
+ maxHoursPerWeek: 35
1450
+ }
1451
+ }, Gt = [
1452
+ {
1453
+ month: 1,
1454
+ day: 1,
1455
+ name: "New Year's Day"
1456
+ },
1457
+ {
1458
+ month: 5,
1459
+ day: 1,
1460
+ name: "Labour Day"
1461
+ },
1462
+ {
1463
+ month: 8,
1464
+ day: 9,
1465
+ name: "National Day"
1466
+ },
1467
+ {
1468
+ month: 12,
1469
+ day: 25,
1470
+ name: "Christmas Day"
1471
+ }
1472
+ ], jt = {
1473
+ 2026: {
1474
+ "2026-01-01": "New Year's Day",
1475
+ "2026-02-17": "Chinese New Year's Day",
1476
+ "2026-02-18": "Chinese New Year's Holiday",
1477
+ "2026-03-21": "Hari Raya Puasa",
1478
+ "2026-04-03": "Good Friday",
1479
+ "2026-05-01": "Labour Day",
1480
+ "2026-05-27": "Hari Raya Haji",
1481
+ "2026-05-31": "Vesak Day",
1482
+ "2026-06-01": "Vesak Day Holiday",
1483
+ "2026-08-09": "National Day",
1484
+ "2026-08-10": "National Day Holiday",
1485
+ "2026-11-08": "Deepavali",
1486
+ "2026-11-09": "Deepavali Holiday",
1487
+ "2026-12-25": "Christmas Day"
1488
+ },
1489
+ 2027: {
1490
+ "2027-01-01": "New Year's Day",
1491
+ "2027-02-06": "Chinese New Year's Day",
1492
+ "2027-02-07": "Chinese New Year's Holiday",
1493
+ "2027-02-08": "Chinese New Year Holiday",
1494
+ "2027-03-10": "Hari Raya Puasa",
1495
+ "2027-03-26": "Good Friday",
1496
+ "2027-05-01": "Labour Day",
1497
+ "2027-05-17": "Hari Raya Haji",
1498
+ "2027-05-20": "Vesak Day",
1499
+ "2027-08-09": "National Day",
1500
+ "2027-10-28": "Deepavali",
1501
+ "2027-12-25": "Christmas Day"
1502
+ }
1503
+ }, Qt = {
1504
+ countryCode: Ut,
1505
+ timezone: Wt,
1506
+ payRate: zt,
1507
+ overtime: Vt,
1508
+ workingHours: Kt,
1509
+ recurringPublicHolidays: Gt,
1510
+ publicHolidays: jt
1511
+ }, Xt = "TH", Jt = "Asia/Bangkok", Zt = {
1512
+ NORMAL: {
1513
+ overtime: 1.5
1514
+ },
1515
+ REST_DAY: {
1516
+ regular: 1,
1517
+ overtime: 2
1518
+ },
1519
+ PUBLIC_HOLIDAY: {
1520
+ regular: 2,
1521
+ overtime: 3
1522
+ }
1523
+ }, qt = {
1524
+ maxHoursPerMonth: 36
1525
+ }, en = {
1526
+ fullTime: {
1527
+ minHoursPerDay: null,
1528
+ maxHoursPerDay: 8,
1529
+ maxHoursPerWeek: 48
1530
+ },
1531
+ partTime: {
1532
+ maxHoursPerWeek: null
1533
+ }
1534
+ }, an = [
1535
+ {
1536
+ month: 1,
1537
+ day: 1,
1538
+ name: "New Year's Day"
1539
+ },
1540
+ {
1541
+ month: 4,
1542
+ day: 6,
1543
+ name: "Chakri Memorial Day"
1544
+ },
1545
+ {
1546
+ month: 5,
1547
+ day: 1,
1548
+ name: "National Labour Day"
1549
+ },
1550
+ {
1551
+ month: 7,
1552
+ day: 28,
1553
+ name: "King's Birthday"
1554
+ },
1555
+ {
1556
+ month: 8,
1557
+ day: 12,
1558
+ name: "Queen Mother's Birthday"
1559
+ },
1560
+ {
1561
+ month: 10,
1562
+ day: 13,
1563
+ name: "Memorial Day"
1564
+ },
1565
+ {
1566
+ month: 12,
1567
+ day: 5,
1568
+ name: "King Bhumibol's Birthday"
1569
+ },
1570
+ {
1571
+ month: 12,
1572
+ day: 10,
1573
+ name: "Constitution Day"
1574
+ },
1575
+ {
1576
+ month: 12,
1577
+ day: 31,
1578
+ name: "New Year's Eve"
1579
+ }
1580
+ ], tn = {
1581
+ 2026: {
1582
+ "2026-01-01": "New Year's Day",
1583
+ "2026-03-03": "Makha Bucha Day",
1584
+ "2026-04-06": "Chakri Memorial Day",
1585
+ "2026-04-13": "Songkran Festival",
1586
+ "2026-04-14": "Songkran Festival",
1587
+ "2026-04-15": "Songkran Festival",
1588
+ "2026-05-01": "National Labour Day",
1589
+ "2026-05-04": "Coronation Day",
1590
+ "2026-05-13": "Royal Ploughing Ceremony",
1591
+ "2026-05-31": "Visakha Bucha Day",
1592
+ "2026-06-01": "Visakha Bucha Holiday",
1593
+ "2026-07-28": "King's Birthday",
1594
+ "2026-08-12": "Queen Mother's Birthday",
1595
+ "2026-10-13": "Memorial Day",
1596
+ "2026-10-23": "Chulalongkorn Memorial Day",
1597
+ "2026-12-05": "King Bhumibol's Birthday",
1598
+ "2026-12-10": "Constitution Day",
1599
+ "2026-12-31": "New Year's Eve"
1600
+ },
1601
+ 2027: {
1602
+ "2027-01-01": "New Year's Day",
1603
+ "2027-02-26": "Makha Bucha Day",
1604
+ "2027-04-06": "Chakri Memorial Day",
1605
+ "2027-04-13": "Songkran Festival",
1606
+ "2027-04-14": "Songkran Festival",
1607
+ "2027-04-15": "Songkran Festival",
1608
+ "2027-05-01": "National Labour Day",
1609
+ "2027-05-03": "Labour Day Holiday",
1610
+ "2027-05-04": "Coronation Day",
1611
+ "2027-07-28": "King's Birthday",
1612
+ "2027-08-12": "Queen Mother's Birthday",
1613
+ "2027-10-13": "Memorial Day",
1614
+ "2027-10-23": "Chulalongkorn Memorial Day",
1615
+ "2027-12-05": "King Bhumibol's Birthday",
1616
+ "2027-12-06": "King Bhumibol's Birthday Holiday",
1617
+ "2027-12-10": "Constitution Day",
1618
+ "2027-12-31": "New Year's Eve"
1619
+ }
1620
+ }, nn = {
1621
+ countryCode: Xt,
1622
+ timezone: Jt,
1623
+ payRate: Zt,
1624
+ overtime: qt,
1625
+ workingHours: en,
1626
+ recurringPublicHolidays: an,
1627
+ publicHolidays: tn
1628
+ }, on = "VN", sn = "Asia/Ho_Chi_Minh", rn = {
1629
+ NORMAL: {
1630
+ overtime: 1.5
1631
+ },
1632
+ REST_DAY: {
1633
+ regular: 1,
1634
+ overtime: 2
1635
+ },
1636
+ PUBLIC_HOLIDAY: {
1637
+ regular: 2,
1638
+ overtime: 3
1639
+ }
1640
+ }, ln = {
1641
+ maxHoursPerMonth: 40
1642
+ }, un = {
1643
+ fullTime: {
1644
+ minHoursPerDay: null,
1645
+ maxHoursPerDay: 8,
1646
+ maxHoursPerWeek: 48
1647
+ },
1648
+ partTime: {
1649
+ maxHoursPerWeek: null
1650
+ }
1651
+ }, dn = [
1652
+ {
1653
+ month: 1,
1654
+ day: 1,
1655
+ name: "New Year's Day"
1656
+ },
1657
+ {
1658
+ month: 4,
1659
+ day: 30,
1660
+ name: "Reunification Day"
1661
+ },
1662
+ {
1663
+ month: 5,
1664
+ day: 1,
1665
+ name: "International Labour Day"
1666
+ },
1667
+ {
1668
+ month: 9,
1669
+ day: 2,
1670
+ name: "National Day"
1671
+ }
1672
+ ], cn = {
1673
+ 2026: {
1674
+ "2026-01-01": "New Year's Day",
1675
+ "2026-02-16": "Tet Holiday",
1676
+ "2026-02-17": "Tet Holiday",
1677
+ "2026-02-18": "Tet Holiday",
1678
+ "2026-02-19": "Tet Holiday",
1679
+ "2026-02-20": "Tet Holiday",
1680
+ "2026-04-26": "Hung Kings Commemoration Day",
1681
+ "2026-04-27": "Hung Kings Holiday",
1682
+ "2026-04-30": "Reunification Day",
1683
+ "2026-05-01": "International Labour Day",
1684
+ "2026-09-02": "National Day",
1685
+ "2026-09-03": "National Day Holiday"
1686
+ },
1687
+ 2027: {
1688
+ "2027-01-01": "New Year's Day",
1689
+ "2027-02-05": "Tet Holiday",
1690
+ "2027-02-06": "Tet Holiday",
1691
+ "2027-02-07": "Tet Holiday",
1692
+ "2027-02-08": "Tet Holiday",
1693
+ "2027-02-09": "Tet Holiday",
1694
+ "2027-04-16": "Hung Kings Commemoration Day",
1695
+ "2027-04-30": "Reunification Day",
1696
+ "2027-05-01": "International Labour Day",
1697
+ "2027-09-02": "National Day",
1698
+ "2027-09-03": "National Day Holiday"
1699
+ }
1700
+ }, mn = {
1701
+ countryCode: on,
1702
+ timezone: sn,
1703
+ payRate: rn,
1704
+ overtime: ln,
1705
+ workingHours: un,
1706
+ recurringPublicHolidays: dn,
1707
+ publicHolidays: cn
1708
+ }, We = { AE: Ga, BN: at, ID: ut, MO: vt, MV: bt, MY: Tt, PK: Ft, SG: Qt, TH: nn, VN: mn };
1709
+ function yn(e) {
1710
+ if (typeof e == "string") return e.toUpperCase();
1711
+ if (e && typeof e == "object" && "code" in e) {
1712
+ const a = e.code;
1713
+ if (typeof a == "string") return a.toUpperCase();
1714
+ }
1715
+ return "MY";
1716
+ }
1717
+ function pn(e) {
1718
+ return We[yn(e)] ?? We.MY;
1719
+ }
1720
+ function Lo(e, a) {
1721
+ var i, l;
1722
+ const t = (i = e.publicHolidays[a.slice(0, 4)]) == null ? void 0 : i[a];
1723
+ if (t) return t;
1724
+ const n = Number(a.slice(5, 7)), o = Number(a.slice(8, 10));
1725
+ return ((l = e.recurringPublicHolidays.find((s) => s.month === n && s.day === o)) == null ? void 0 : l.name) ?? null;
1726
+ }
1727
+ const fn = Ge(), ta = "unassigned", Io = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], To = "All Stations", Ro = [{ id: ta, label: "Assigned", roles: [], system: !0 }], ze = [
1728
+ "#903E1F",
1729
+ "#5F090A",
1730
+ "#0A5384",
1731
+ "#1F5F3E",
1732
+ "#5B2C6F",
1733
+ "#7D5A00",
1734
+ "#0F5C5C",
1735
+ "#6E2142"
1736
+ ];
1737
+ function hn(e) {
1738
+ var t;
1739
+ const a = e.trim().toLocaleLowerCase();
1740
+ return (t = U.find((n) => n.name.toLocaleLowerCase() === a)) == null ? void 0 : t.id;
1741
+ }
1742
+ function Oo(e, a) {
1743
+ if (e)
1744
+ return { positionId: a ?? hn(e), positionName: e };
1745
+ }
1746
+ function ie(e, a = U) {
1747
+ var t;
1748
+ if (e)
1749
+ return (e.positionId && ((t = a.find((n) => n.id === e.positionId)) == null ? void 0 : t.name)) ?? e.positionName;
1750
+ }
1751
+ function $o(e, a = U) {
1752
+ var t, n;
1753
+ if (e)
1754
+ return e.positionId ? (t = a.find((o) => o.id === e.positionId)) == null ? void 0 : t.name : (n = a.find((o) => o.name.toLocaleLowerCase() === e.positionName.toLocaleLowerCase())) == null ? void 0 : n.name;
1755
+ }
1756
+ function xo(e, a) {
1757
+ return a ? !U.some((t) => t.id === a) : !!e && !U.some((t) => t.name.toLocaleLowerCase() === e.toLocaleLowerCase());
1758
+ }
1759
+ const Yo = [1, 1, 1, 1, 1, 1, 1];
1760
+ function le(e) {
1761
+ return (e + 6) % 7;
1762
+ }
1763
+ function Bo(e) {
1764
+ return (e + 1) % 7;
1765
+ }
1766
+ function ye(e, a) {
1767
+ e.splice(0, e.length, ...a);
1768
+ }
1769
+ function vn(e, a) {
1770
+ return Qe(e, a) / 60;
1771
+ }
1772
+ function gn(e) {
1773
+ var t;
1774
+ const a = e.trim().split(/\s+/).filter(Boolean);
1775
+ return a.length ? (a[0][0] + (((t = a[1]) == null ? void 0 : t[0]) ?? "")).toUpperCase() : "??";
1776
+ }
1777
+ const na = /* @__PURE__ */ new Map(), Pe = /* @__PURE__ */ new Map();
1778
+ function _o(e) {
1779
+ return na.get(e);
1780
+ }
1781
+ function Dn(e) {
1782
+ const a = Pe.get(e);
1783
+ if (a !== void 0) return a;
1784
+ const t = Je + Pe.size + 1;
1785
+ return Pe.set(e, t), na.set(t, e), t;
1786
+ }
1787
+ function Fo(e) {
1788
+ return e.sourceId || String(e.id);
1789
+ }
1790
+ function wn(e) {
1791
+ Ca.name = (e == null ? void 0 : e.outlet.name) ?? "", ye(Sa, (e == null ? void 0 : e.positions.map((s) => s.name)) ?? []), ye(U, (e == null ? void 0 : e.positions) ?? []);
1792
+ const a = (e == null ? void 0 : e.restaurantProfile.operatingHours) ?? [], t = Array.from({ length: 7 }, () => []);
1793
+ for (const s of a) t[le(s.dayOfWeek)] = s.closed ? [] : s.hours;
1794
+ ye(S.dayHours, t);
1795
+ const n = a.filter((s) => !s.closed).flatMap((s) => s.hours);
1796
+ S.openFrom = n.length ? n.map((s) => s.start).reduce((s, d) => d < s ? d : s) : "00:00", S.openTo = n.length ? n.map((s) => s.end).reduce((s, d) => d > s ? d : s) : "24:00", ye(
1797
+ S.closedWeekdays,
1798
+ a.filter((s) => s.closed).map((s) => le(s.dayOfWeek)).sort((s, d) => s - d)
1799
+ );
1800
+ const o = pn(fn.currentCountry.value), i = (e == null ? void 0 : e.settings.settingsConfigured) === !0, l = i ? e.settings.payRate : o.payRate;
1801
+ S.otCapHours = i ? e.settings.overtime.maxHoursPerMonth : o.overtime.maxHoursPerMonth, S.workingHours = i ? e.settings.workingHours : {
1802
+ minHoursPerDay: null,
1803
+ maxHoursPerDay: o.workingHours.fullTime.maxHoursPerDay,
1804
+ maxHoursPerWeek: o.workingHours.fullTime.maxHoursPerWeek
1805
+ }, S.payRate.NORMAL.overtime = l.NORMAL.overtime, S.payRate.REST_DAY.regular = l.REST_DAY.regular, S.payRate.REST_DAY.overtime = l.REST_DAY.overtime, S.payRate.PUBLIC_HOLIDAY.regular = l.PUBLIC_HOLIDAY.regular, S.payRate.PUBLIC_HOLIDAY.overtime = l.PUBLIC_HOLIDAY.overtime;
1806
+ }
1807
+ Re(r, wn, { immediate: !0 });
1808
+ function ge(e) {
1809
+ var a, t, n;
1810
+ return {
1811
+ minHoursPerDay: ((a = e.workingHours) == null ? void 0 : a.minHoursPerDay) ?? S.workingHours.minHoursPerDay,
1812
+ maxHoursPerDay: ((t = e.workingHours) == null ? void 0 : t.maxHoursPerDay) ?? S.workingHours.maxHoursPerDay,
1813
+ maxHoursPerWeek: ((n = e.workingHours) == null ? void 0 : n.maxHoursPerWeek) ?? S.workingHours.maxHoursPerWeek
1814
+ };
1815
+ }
1816
+ function Hn(e) {
1817
+ return e.reduce(
1818
+ (a, t) => {
1819
+ const n = ge(t).maxHoursPerWeek;
1820
+ return t.employmentType === "FULLTIME" && n != null ? Math.max(a, n) : a;
1821
+ },
1822
+ 0
1823
+ );
1824
+ }
1825
+ function An(e, a) {
1826
+ if (e.wage.type === "HOURLY") return e.wage.amount;
1827
+ const t = ge(e).maxHoursPerWeek ?? a;
1828
+ return t ? e.wage.amount / (t * (52 / 12)) : 0;
1829
+ }
1830
+ function En(e, a) {
1831
+ if (e.employmentType === "FULLTIME") return 100;
1832
+ const t = ge(e).maxHoursPerWeek;
1833
+ return !a || t == null ? 0 : Math.min(99, Math.round(t / a * 100));
1834
+ }
1835
+ function Pn(e) {
1836
+ var a;
1837
+ return {
1838
+ start: e.startTime,
1839
+ end: e.endTime,
1840
+ // A missing position means this assignment was genuinely saved as "Any position" — it must
1841
+ // stay blank rather than falling back to the employee's own primary position, or a reload
1842
+ // silently reassigns every "Any position" shift to whatever station the employee is normally
1843
+ // pinned to.
1844
+ role: ie(e.position) ?? "",
1845
+ positionId: ((a = e.position) == null ? void 0 : a.positionId) || void 0,
1846
+ // Mongo distinguishes a draft from a published/confirmed assignment; the board's third
1847
+ // state ('ot') is a costing outcome, never something stored.
1848
+ status: e.status === "DRAFT" ? "pending" : "confirmed",
1849
+ breakMins: Xe(e.breaks),
1850
+ breaks: e.breaks,
1851
+ // Carried through so an edit updates this same ScheduleShiftAssignments document instead of
1852
+ // creating a duplicate — see useScheduleBoard's commitShift/persistSlot.
1853
+ assignmentId: e.id,
1854
+ updatedAt: e.updatedAt
1855
+ };
1856
+ }
1857
+ function bn(e) {
1858
+ return e.type === "OFF_DAY" ? "Off day" : e.leaveType === "MEDICAL" ? "Medical Leave" : e.leaveType === "EMERGENCY" ? "Emergency Leave" : e.leaveType === "UNPAID" ? "Unpaid Leave" : "Annual Leave";
1859
+ }
1860
+ function Nn(e, a) {
1861
+ if (a < e.startDate || a > e.endDate) return null;
1862
+ const n = e.startDate === e.endDate || a === e.startDate ? e.startPart : a === e.endDate ? e.endPart : "FULL_DAY";
1863
+ return {
1864
+ requestId: e.id,
1865
+ type: e.type,
1866
+ leaveType: e.leaveType ?? void 0,
1867
+ timeOff: e.status === "PENDING" ? "pending" : "approved",
1868
+ reason: bn(e),
1869
+ half: n !== "FULL_DAY",
1870
+ halfPart: n === "FULL_DAY" ? void 0 : n
1871
+ };
1872
+ }
1873
+ function kn(e) {
1874
+ return {
1875
+ employeeId: e._id,
1876
+ name: e.name,
1877
+ employmentType: "FULLTIME",
1878
+ wage: { type: "HOURLY", amount: 0 },
1879
+ primaryPosition: null,
1880
+ secondaryPositions: [],
1881
+ availability: []
1882
+ };
1883
+ }
1884
+ function Sn(e) {
1885
+ const a = oe[m.value];
1886
+ return !a || !e.includes(a) ? e : [a, ...e.filter((t) => t !== a)];
1887
+ }
1888
+ function Cn(e) {
1889
+ var n;
1890
+ const t = (qe.value[e] ?? ((n = re.value.find((o) => o._id === e)) == null ? void 0 : n.restaurantRole.map((o) => o.restaurantId)) ?? []).map((o) => oe[o]).filter((o) => !!o);
1891
+ return t.length ? Sn([...new Set(t)]) : void 0;
1892
+ }
1893
+ function Uo(e = []) {
1894
+ const a = r.value;
1895
+ if (!a) return [];
1896
+ const t = new Map(a.employees.map((s) => [s.employeeId, s])), n = new Map(
1897
+ z.value.map((s) => [s.employeeId, s])
1898
+ ), o = re.value.filter((s) => {
1899
+ var d;
1900
+ return ((d = n.get(s._id)) == null ? void 0 : d.enabled) !== !1;
1901
+ }).map((s) => t.get(s._id) ?? kn(s)), i = Hn(o), l = /* @__PURE__ */ new Map();
1902
+ for (const s of a.assignments) {
1903
+ const d = `${s.employeeId}|${s.date}`, v = l.get(d);
1904
+ v ? v.push(s) : l.set(d, [s]);
1905
+ }
1906
+ return o.map((s) => {
1907
+ const d = re.value.find((h) => h._id === s.employeeId) ?? {
1908
+ name: s.name,
1909
+ code: void 0,
1910
+ passcode: "",
1911
+ isMasterUser: !1
1912
+ }, v = ge(s), g = Dn(s.employeeId), A = new Set(U.map((h) => h.id)), O = new Set(U.map((h) => h.name.toLocaleLowerCase())), $ = (h) => h.positionId ? A.has(h.positionId) : O.has(h.positionName.toLocaleLowerCase()), x = ie(s.primaryPosition), p = !!s.primaryPosition && $(s.primaryPosition), b = s.secondaryPositions.filter($).map((h) => ie(h)).filter((h) => !!h), F = x ? p ? [x, ...b] : [] : b, M = [
1913
+ ...x && !p ? [x] : [],
1914
+ ...s.secondaryPositions.filter((h) => !$(h)).map((h) => ie(h)).filter((h) => !!h)
1915
+ ], W = F[0] ?? "", L = e.map((h) => {
1916
+ const E = V(h);
1917
+ return (a.timeOff ?? []).filter((w) => w.employeeId === s.employeeId).map((w) => Nn(w, E)).find((w) => w !== null) ?? null;
1918
+ }), K = e.map((h) => {
1919
+ const E = V(h), T = (l.get(`${s.employeeId}|${E}`) ?? []).filter((Y) => Y.startTime && Y.endTime).map((Y) => Pn(Y)).sort((Y, ce) => Y.start.localeCompare(ce.start));
1920
+ return T.length ? T.length === 1 ? T[0] : T : null;
1921
+ }), ue = s.availability.length > 0, de = Array.from(
1922
+ { length: 7 },
1923
+ (h, E) => ue ? s.availability.some((w) => le(w.dayOfWeek) === E) : !0
1924
+ ), De = Array.from({ length: 7 }, (h, E) => {
1925
+ const w = s.availability.find((T) => le(T.dayOfWeek) === E);
1926
+ return { from: (w == null ? void 0 : w.start) ?? "", to: (w == null ? void 0 : w.end) ?? "" };
1927
+ });
1928
+ return {
1929
+ id: g,
1930
+ sourceId: s.employeeId,
1931
+ // Employee page edits update the POS employee name. Use that as the display
1932
+ // source so Scheduling reflects those changes after its roster refresh.
1933
+ name: d.name,
1934
+ // POS access belongs to the POS roster, not the scheduling profile. Keep these
1935
+ // fields on the board employee so the edit form can initialise its access section
1936
+ // from the employee's existing POS account.
1937
+ passcode: d.passcode || void 0,
1938
+ code: d.code,
1939
+ masterUser: d.isMasterUser,
1940
+ employmentType: s.employmentType,
1941
+ role: W,
1942
+ initials: gn(d.name),
1943
+ color: ze[(g - Je - 1) % ze.length],
1944
+ // Gross hours actually rostered this week — the figure the cost rail multiplies by
1945
+ // the rate. Contracted hours are a separate question, answered by RULES.contract.
1946
+ // Rounded to one decimal — `hoursBetween` divides by 60, so an unrounded sum reads
1947
+ // as a long, meaningless float (e.g. 31.983333333333334) everywhere this is shown
1948
+ // verbatim, matching the rounding `employeeLoadOf`'s own hours figure already uses.
1949
+ weekHours: Math.round(
1950
+ K.reduce(
1951
+ (h, E) => h + (Array.isArray(E) ? E : E && "start" in E ? [E] : []).reduce(
1952
+ (w, T) => w + vn(T.start, T.end),
1953
+ 0
1954
+ ),
1955
+ 0
1956
+ ) * 10
1957
+ ) / 10,
1958
+ pct: En(s, i),
1959
+ contractHours: v.maxHoursPerWeek ?? void 0,
1960
+ minHoursPerDay: v.minHoursPerDay ?? void 0,
1961
+ // Keep the persisted override shape here. Consumers that need the effective value use
1962
+ // effectiveWorkingHours(), so an inherited null remains distinguishable from an override.
1963
+ workingHours: s.workingHours,
1964
+ // Every outlet the POS says this person works at, not just this one — the Add / Edit form
1965
+ // shows them, and saving keeps them.
1966
+ locations: Cn(s.employeeId),
1967
+ rate: An(s, i),
1968
+ positions: F,
1969
+ archivedPositions: M.length ? M : void 0,
1970
+ shifts: K,
1971
+ timeOff: L,
1972
+ // Remarks live in their own collection in the older scheduling design and are not
1973
+ // part of this board's payload yet.
1974
+ remarks: [],
1975
+ section: ta,
1976
+ payBasis: s.wage.type === "HOURLY" ? "hourly" : "monthly",
1977
+ payAmount: s.wage.amount,
1978
+ availDays: de,
1979
+ availHours: De
1980
+ };
1981
+ });
1982
+ }
1983
+ function Wo() {
1984
+ return [];
1985
+ }
1986
+ function zo() {
1987
+ var n, o;
1988
+ const e = r.value, a = {}, t = {};
1989
+ for (const i of (e == null ? void 0 : e.demands) ?? []) {
1990
+ const l = i.date ? a[n = i.date] ?? (a[n] = []) : i.dayOfWeek !== null ? t[o = le(i.dayOfWeek)] ?? (t[o] = []) : null;
1991
+ if (!l) continue;
1992
+ let s = l.find((d) => d.from === i.startTime && d.to === i.endTime);
1993
+ s || (s = { from: i.startTime, to: i.endTime, n: 0, roles: [] }, l.push(s)), s.n += i.headcount, i.position && s.roles.push({
1994
+ position: ie(i.position) ?? "",
1995
+ positionId: i.position.positionId || void 0,
1996
+ n: i.headcount
1997
+ });
1998
+ }
1999
+ return { byDate: a, byWeekday: t };
2000
+ }
2001
+ function Vo() {
2002
+ const e = Ge(), { restaurants: a, readRestaurants: t } = Aa(), n = wa(), o = Ha(), i = P(!1);
2003
+ let l = () => !0;
2004
+ const s = _(
2005
+ () => a.value.filter((p) => p.managable).map((p) => ({ value: p._id, label: p.profile.name })).sort((p, b) => p.label.localeCompare(b.label))
2006
+ ), d = () => {
2007
+ var p;
2008
+ return `hrm-schedule-outlet:${((p = e.currentBusiness.value) == null ? void 0 : p._id) ?? ""}`;
2009
+ }, v = _(() => {
2010
+ var p;
2011
+ return ((p = e.currentRestaurant.value) == null ? void 0 : p._id) ?? "";
2012
+ });
2013
+ async function g(p, b) {
2014
+ return p !== m.value && !await l(p) || !Fe(p) ? !1 : (localStorage.setItem(d(), p), n.query.restaurantId !== p && o.replace({ query: { ...n.query, restaurantId: p } }), await Promise.all([Me(p), Ya(b)]), !0);
2015
+ }
2016
+ function A(p) {
2017
+ l = p;
2018
+ }
2019
+ const O = (p) => !!p && s.value.some((b) => b.value === p);
2020
+ async function $() {
2021
+ var F;
2022
+ await t(), _e.splice(0, _e.length, ...s.value.map((M) => M.label)), Object.keys(oe).forEach((M) => delete oe[M]), a.value.forEach((M) => oe[M._id] = M.profile.name);
2023
+ const p = localStorage.getItem(d()) ?? "", b = [m.value, p, v.value].find(O) ?? ((F = s.value[0]) == null ? void 0 : F.value) ?? "";
2024
+ return b && Fe(b), i.value = !0, b;
2025
+ }
2026
+ async function x() {
2027
+ const p = await $();
2028
+ return p && await Me(p), p;
2029
+ }
2030
+ return { options: s, ready: i, outletId: m, resolve: x, resolveOutlet: $, switchTo: g, setBeforeSwitch: A };
2031
+ }
2032
+ const Mn = ["data-hierarchy", "data-size", "data-icon"], Ko = /* @__PURE__ */ Oe({
2033
+ __name: "ScheduleButton",
2034
+ props: {
2035
+ hierarchy: { default: "primary" },
2036
+ size: { default: "sm" },
2037
+ iconOnly: { type: Boolean, default: !1 }
2038
+ },
2039
+ setup(e) {
2040
+ return (a, t) => (N(), k("button", {
2041
+ type: "button",
2042
+ class: "sch-button",
2043
+ "data-hierarchy": e.hierarchy,
2044
+ "data-size": e.size,
2045
+ "data-icon": e.iconOnly ? "only" : void 0
2046
+ }, [
2047
+ Ke(a.$slots, "default")
2048
+ ], 8, Mn));
2049
+ }
2050
+ }), Ln = ["disabled", "aria-expanded"], In = { class: "fx-btn-label" }, Tn = { class: "sch" }, Rn = ["aria-multiselectable"], On = {
2051
+ key: 0,
2052
+ class: "fx-pop-head"
2053
+ }, $n = {
2054
+ key: 1,
2055
+ class: "fx-pop-search"
2056
+ }, xn = {
2057
+ key: 2,
2058
+ class: "fx-opt is-off"
2059
+ }, Yn = {
2060
+ key: 0,
2061
+ class: "fx-grp"
2062
+ }, Bn = ["aria-selected", "onClick"], _n = {
2063
+ key: 0,
2064
+ class: "fx-opt-text"
2065
+ }, Fn = { key: 0 }, Go = /* @__PURE__ */ Oe({
2066
+ inheritAttrs: !1,
2067
+ __name: "ScheduleSelect",
2068
+ props: {
2069
+ modelValue: {},
2070
+ options: {},
2071
+ multiple: { type: Boolean },
2072
+ selected: {},
2073
+ selectedId: {},
2074
+ placeholder: {},
2075
+ selectedLabel: {},
2076
+ disabled: { type: Boolean },
2077
+ menuTitle: {},
2078
+ searchable: { type: Boolean },
2079
+ teleport: { type: Boolean, default: !0 }
2080
+ },
2081
+ emits: ["update:modelValue", "toggle"],
2082
+ setup(e, { emit: a }) {
2083
+ const t = e, n = a, o = da(), i = _(() => o.class ?? ""), l = P(!1), s = P(!1), d = P(null), v = P(null), g = P(null), A = _(() => t.teleport !== !1 && s.value);
2084
+ Ie(() => {
2085
+ s.value = typeof document < "u" && !!document.body;
2086
+ });
2087
+ const O = _(() => {
2088
+ var u, y;
2089
+ if (t.selectedLabel != null) return t.selectedLabel;
2090
+ if (t.multiple) {
2091
+ const c = ((u = t.selected) == null ? void 0 : u.length) ?? 0;
2092
+ return c ? `${c} selected` : t.placeholder ?? "";
2093
+ }
2094
+ return ((y = t.options.find((c) => c.value === t.modelValue)) == null ? void 0 : y.label) ?? t.placeholder ?? "";
2095
+ });
2096
+ function $(u) {
2097
+ var y;
2098
+ return t.multiple ? !!((y = t.selected) != null && y.includes(u.value)) : t.selectedId != null ? u.id === t.selectedId : u.value === t.modelValue;
2099
+ }
2100
+ const x = _(() => !!t.menuTitle || t.options.some((u) => u.hint)), p = P(""), b = P(null), F = _(() => {
2101
+ const u = p.value.trim().toLowerCase();
2102
+ return !t.searchable || !u ? t.options : t.options.filter((y) => `${y.label} ${y.hint ?? ""}`.toLowerCase().includes(u));
2103
+ }), M = _(() => {
2104
+ const u = [];
2105
+ let y;
2106
+ for (const c of F.value)
2107
+ c.group !== y && (y = c.group, y && u.push({ heading: y })), u.push({ option: c });
2108
+ return u;
2109
+ }), W = 5, L = 8;
2110
+ function K() {
2111
+ const u = g.value, y = v.value;
2112
+ if (!u || !y) return;
2113
+ const c = y.getBoundingClientRect(), C = window.innerWidth || document.documentElement.clientWidth, R = window.innerHeight || document.documentElement.clientHeight;
2114
+ u.style.minWidth = `${Math.round(c.width)}px`, u.style.maxWidth = `${Math.max(180, Math.round(C - L * 2))}px`;
2115
+ const ee = R - c.bottom - W - L, ra = c.top - W - L;
2116
+ u.style.maxHeight = `${Math.max(120, Math.min(320, Math.max(ee, ra)))}px`;
2117
+ const me = u.offsetHeight, la = u.offsetWidth;
2118
+ let we = c.bottom + W;
2119
+ we + me > R - L && (we = c.top - W - me >= L ? c.top - W - me : Math.max(L, R - me - L));
2120
+ const ua = Math.min(Math.max(L, c.left), Math.max(L, C - la - L));
2121
+ u.style.top = `${Math.round(we)}px`, u.style.left = `${Math.round(ua)}px`, u.style.visibility = "visible";
2122
+ }
2123
+ function ue(u) {
2124
+ var c, C;
2125
+ const y = u.target;
2126
+ y && ((c = d.value) != null && c.contains(y) || (C = g.value) != null && C.contains(y)) || w();
2127
+ }
2128
+ function de(u) {
2129
+ const y = g.value, c = u.target;
2130
+ if (y && c && c !== document && y.contains(c)) return;
2131
+ const C = v.value;
2132
+ if (!C) return;
2133
+ const R = C.getBoundingClientRect(), ee = window.innerHeight || document.documentElement.clientHeight;
2134
+ if (R.bottom < 0 || R.top > ee) {
2135
+ w();
2136
+ return;
2137
+ }
2138
+ K();
2139
+ }
2140
+ function De() {
2141
+ document.addEventListener("click", ue), document.addEventListener("scroll", de, !0), window.addEventListener("resize", w);
2142
+ }
2143
+ function h() {
2144
+ document.removeEventListener("click", ue), document.removeEventListener("scroll", de, !0), window.removeEventListener("resize", w);
2145
+ }
2146
+ async function E() {
2147
+ var u, y, c;
2148
+ t.disabled || l.value || (p.value = "", l.value = !0, await be(), K(), (u = b.value) == null || u.focus(), (c = (y = g.value) == null ? void 0 : y.querySelector(".fx-opt.is-on")) == null || c.scrollIntoView({ block: "nearest" }), De());
2149
+ }
2150
+ function w() {
2151
+ l.value && (l.value = !1, p.value = "", h());
2152
+ }
2153
+ Re(p, async () => {
2154
+ l.value && (await be(), K());
2155
+ });
2156
+ function T(u) {
2157
+ var y;
2158
+ if (u.key === "Escape")
2159
+ u.preventDefault(), w(), (y = v.value) == null || y.focus();
2160
+ else if (u.key === "Enter") {
2161
+ u.preventDefault();
2162
+ const c = F.value.find((C) => !C.disabled);
2163
+ c && ce(c);
2164
+ }
2165
+ }
2166
+ function Y() {
2167
+ l.value ? w() : E();
2168
+ }
2169
+ function ce(u) {
2170
+ if (!u.disabled) {
2171
+ if (t.multiple && !u.command) {
2172
+ n("toggle", u.value);
2173
+ return;
2174
+ }
2175
+ if (w(), t.multiple) {
2176
+ n("update:modelValue", u.value);
2177
+ return;
2178
+ }
2179
+ u.value !== t.modelValue && n("update:modelValue", u.value);
2180
+ }
2181
+ }
2182
+ const oa = _(() => t.options.filter((u) => !u.disabled));
2183
+ function sa(u) {
2184
+ const y = oa.value;
2185
+ if (t.multiple || !y.length) {
2186
+ E();
2187
+ return;
2188
+ }
2189
+ const c = y.findIndex((ee) => ee.value === t.modelValue), C = u === "Home" ? 0 : u === "End" ? y.length - 1 : u === "ArrowDown" ? Math.min(y.length - 1, (c < 0 ? -1 : c) + 1) : Math.max(0, (c < 0 ? 1 : c) - 1), R = y[C];
2190
+ R && R.value !== t.modelValue ? n("update:modelValue", R.value) : E();
2191
+ }
2192
+ function ia(u) {
2193
+ var y;
2194
+ if (u.key === "Escape") {
2195
+ if (!l.value) return;
2196
+ u.preventDefault(), w(), (y = v.value) == null || y.focus();
2197
+ return;
2198
+ }
2199
+ if (u.key === "Enter" || u.key === " ") {
2200
+ u.preventDefault(), Y();
2201
+ return;
2202
+ }
2203
+ u.key !== "ArrowDown" && u.key !== "ArrowUp" && u.key !== "Home" && u.key !== "End" || (u.preventDefault(), sa(u.key));
2204
+ }
2205
+ return Te(h), (u, y) => (N(), k("div", {
2206
+ ref_key: "rootEl",
2207
+ ref: d,
2208
+ class: pe(["fx-sel", i.value])
2209
+ }, [
2210
+ B("button", ma({
2211
+ ref_key: "btnEl",
2212
+ ref: v
2213
+ }, u.$attrs, {
2214
+ type: "button",
2215
+ class: ["sch-input fx-btn", { "is-open": l.value }],
2216
+ disabled: e.disabled,
2217
+ "aria-haspopup": "listbox",
2218
+ "aria-expanded": l.value,
2219
+ onClick: y[0] || (y[0] = (c) => Y()),
2220
+ onKeydown: ia
2221
+ }), [
2222
+ B("span", In, G(O.value), 1)
2223
+ ], 16, Ln),
2224
+ (N(), ca(ya, {
2225
+ to: "body",
2226
+ disabled: !A.value
2227
+ }, [
2228
+ B("div", Tn, [
2229
+ l.value ? (N(), k("div", {
2230
+ key: 0,
2231
+ ref_key: "popEl",
2232
+ ref: g,
2233
+ class: pe(["fx-pop", { "fx-pop-rich": x.value }]),
2234
+ role: "listbox",
2235
+ "aria-multiselectable": e.multiple || void 0,
2236
+ style: { visibility: "hidden" }
2237
+ }, [
2238
+ e.menuTitle ? (N(), k("div", On, G(e.menuTitle), 1)) : j("", !0),
2239
+ e.searchable ? (N(), k("div", $n, [
2240
+ pa(B("input", {
2241
+ ref_key: "searchEl",
2242
+ ref: b,
2243
+ "onUpdate:modelValue": y[1] || (y[1] = (c) => p.value = c),
2244
+ class: "sch-input fx-pop-q",
2245
+ type: "search",
2246
+ placeholder: "Search",
2247
+ autocomplete: "off",
2248
+ spellcheck: "false",
2249
+ "aria-label": "Search",
2250
+ onKeydown: T
2251
+ }, null, 544), [
2252
+ [fa, p.value]
2253
+ ])
2254
+ ])) : j("", !0),
2255
+ e.searchable && !M.value.length ? (N(), k("div", xn, "No matches")) : j("", !0),
2256
+ (N(!0), k(Ae, null, ha(M.value, (c) => (N(), k(Ae, {
2257
+ key: "heading" in c ? `heading:${c.heading}` : `option:${c.option.value}`
2258
+ }, [
2259
+ "heading" in c ? (N(), k("div", Yn, G(c.heading), 1)) : (N(), k("div", {
2260
+ key: 1,
2261
+ class: pe(["fx-opt", {
2262
+ "is-on": $(c.option),
2263
+ "is-off": c.option.disabled,
2264
+ "is-new": c.option.command
2265
+ }]),
2266
+ role: "option",
2267
+ "aria-selected": $(c.option),
2268
+ onClick: (C) => ce(c.option)
2269
+ }, [
2270
+ y[2] || (y[2] = B("span", {
2271
+ class: "fx-tick",
2272
+ "aria-hidden": "true"
2273
+ }, [
2274
+ B("svg", {
2275
+ width: "11",
2276
+ height: "11",
2277
+ viewBox: "0 0 16 16",
2278
+ fill: "none"
2279
+ }, [
2280
+ B("path", {
2281
+ d: "m3.5 8.4 3 3 6-7",
2282
+ stroke: "currentColor",
2283
+ "stroke-width": "2.2",
2284
+ "stroke-linecap": "round",
2285
+ "stroke-linejoin": "round"
2286
+ })
2287
+ ])
2288
+ ], -1)),
2289
+ x.value ? (N(), k("span", _n, [
2290
+ B("b", null, G(c.option.label), 1),
2291
+ c.option.hint ? (N(), k("small", Fn, G(c.option.hint), 1)) : j("", !0)
2292
+ ])) : (N(), k(Ae, { key: 1 }, [
2293
+ va(G(c.option.label), 1)
2294
+ ], 64))
2295
+ ], 10, Bn))
2296
+ ], 64))), 128))
2297
+ ], 10, Rn)) : j("", !0)
2298
+ ])
2299
+ ], 8, ["disabled"]))
2300
+ ], 2));
2301
+ }
2302
+ }), Un = ["id", "aria-labelledby", "aria-label"], Ve = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])', jo = /* @__PURE__ */ Oe({
2303
+ __name: "ScheduleModal",
2304
+ props: {
2305
+ open: { type: Boolean },
2306
+ id: {},
2307
+ panelClass: { default: "ob-modal" },
2308
+ panelStyle: {},
2309
+ labelledBy: {},
2310
+ label: {}
2311
+ },
2312
+ emits: ["close"],
2313
+ setup(e, { emit: a }) {
2314
+ const t = e, n = a, o = P(null);
2315
+ let i = null;
2316
+ function l() {
2317
+ be(() => {
2318
+ const d = o.value;
2319
+ d && (d.querySelector(Ve) ?? d).focus();
2320
+ });
2321
+ }
2322
+ function s(d) {
2323
+ if (!t.open) return;
2324
+ if (d.key === "Escape") {
2325
+ d.preventDefault(), n("close");
2326
+ return;
2327
+ }
2328
+ if (d.key !== "Tab" || !o.value) return;
2329
+ const v = Array.from(o.value.querySelectorAll(Ve));
2330
+ if (!v.length) return;
2331
+ const g = v[0], A = v[v.length - 1];
2332
+ d.shiftKey && document.activeElement === g ? (d.preventDefault(), A.focus()) : !d.shiftKey && document.activeElement === A && (d.preventDefault(), g.focus());
2333
+ }
2334
+ return Re(
2335
+ () => t.open,
2336
+ (d) => {
2337
+ d ? (i = document.activeElement instanceof HTMLElement ? document.activeElement : null, l()) : (i == null || i.focus(), i = null);
2338
+ },
2339
+ { immediate: !0 }
2340
+ ), Ie(() => document.addEventListener("keydown", s)), Te(() => {
2341
+ document.removeEventListener("keydown", s), i = null;
2342
+ }), (d, v) => e.open ? (N(), k("div", {
2343
+ key: 0,
2344
+ class: "modal-overlay open",
2345
+ onClick: v[0] || (v[0] = ga((g) => n("close"), ["self"]))
2346
+ }, [
2347
+ B("div", {
2348
+ id: e.id,
2349
+ ref_key: "panel",
2350
+ ref: o,
2351
+ class: pe(["schedule-modal-panel", e.panelClass]),
2352
+ style: Da(e.panelStyle),
2353
+ role: "dialog",
2354
+ "aria-modal": "true",
2355
+ "aria-labelledby": e.labelledBy,
2356
+ "aria-label": e.label,
2357
+ tabindex: "-1"
2358
+ }, [
2359
+ Ke(d.$slots, "default")
2360
+ ], 14, Un)
2361
+ ])) : j("", !0);
2362
+ }
2363
+ });
2364
+ export {
2365
+ H as $,
2366
+ To as A,
2367
+ Jn as B,
2368
+ ao as C,
2369
+ se as D,
2370
+ Qe as E,
2371
+ ke as F,
2372
+ Na as G,
2373
+ no as H,
2374
+ po as I,
2375
+ xo as J,
2376
+ Pa as K,
2377
+ Co as L,
2378
+ So as M,
2379
+ ko as N,
2380
+ he as O,
2381
+ Sa as P,
2382
+ io as Q,
2383
+ eo as R,
2384
+ Ro as S,
2385
+ z as T,
2386
+ ta as U,
2387
+ Ta as V,
2388
+ Io as W,
2389
+ _e as X,
2390
+ Bo as Y,
2391
+ to as Z,
2392
+ Sn as _,
2393
+ Uo as a,
2394
+ le as a0,
2395
+ ie as a1,
2396
+ oe as a2,
2397
+ uo as a3,
2398
+ mo as a4,
2399
+ Le as a5,
2400
+ X as a6,
2401
+ lo as a7,
2402
+ Ra as a8,
2403
+ yo as a9,
2404
+ re as aA,
2405
+ ho as aB,
2406
+ Dn as aa,
2407
+ V as ab,
2408
+ Ao as ac,
2409
+ wo as ad,
2410
+ Ho as ae,
2411
+ Yo as af,
2412
+ Ya as ag,
2413
+ Po as ah,
2414
+ Ca as ai,
2415
+ Xn as aj,
2416
+ Do as ak,
2417
+ Ye as al,
2418
+ zo as am,
2419
+ Be as an,
2420
+ fe as ao,
2421
+ Me as ap,
2422
+ bo as aq,
2423
+ ro as ar,
2424
+ Ko as as,
2425
+ Go as at,
2426
+ jo as au,
2427
+ U as av,
2428
+ Qn as aw,
2429
+ Vo as ax,
2430
+ vo as ay,
2431
+ fo as az,
2432
+ S as b,
2433
+ Wo as c,
2434
+ J as d,
2435
+ Oo as e,
2436
+ Zn as f,
2437
+ pn as g,
2438
+ Lo as h,
2439
+ La as i,
2440
+ go as j,
2441
+ _o as k,
2442
+ Eo as l,
2443
+ No as m,
2444
+ Mo as n,
2445
+ m as o,
2446
+ r as p,
2447
+ Ce as q,
2448
+ co as r,
2449
+ ba as s,
2450
+ so as t,
2451
+ $o as u,
2452
+ Se as v,
2453
+ oo as w,
2454
+ hn as x,
2455
+ qn as y,
2456
+ Fo as z
2457
+ };