@feedmepos/mf-hrm-portal 2.3.0-dev.16 → 2.3.0-dev.18

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