@feedmepos/mf-hrm-portal 2.3.0-dev.7 → 2.3.0-dev.8

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 (44) hide show
  1. package/dist/{ApprovalCodeList-J-NC4Z5M.js → ApprovalCodeList-D5E_FN3f.js} +5 -5
  2. package/dist/{AuditLogList-B1Sb8HDk.js → AuditLogList-CqqiS2xW.js} +4 -4
  3. package/dist/{ConditionBuilderForm.vue_vue_type_script_setup_true_lang-BlXgJvsO.js → ConditionBuilderForm.vue_vue_type_script_setup_true_lang-DC_oQTsP.js} +2 -2
  4. package/dist/{EmployeeList-DprCwGC9.js → EmployeeList-ChMlGxmu.js} +6 -6
  5. package/dist/{GrantUserList-BWeZAzUC.js → GrantUserList-DA26W3K3.js} +6 -6
  6. package/dist/{Main-Dna6CkrV.js → Main-B27Qx8R2.js} +8 -8
  7. package/dist/{Main-BZCIlbf3.js → Main-C0gVAR92.js} +5 -5
  8. package/dist/{Main-CGlnX97k.js → Main-m39gMG-a.js} +11 -11
  9. package/dist/{PermissionSetList-DuJjihft.js → PermissionSetList-mdA65jmw.js} +7 -7
  10. package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-RI8tMDoe.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Dp6bdEZp.js} +1219 -1219
  11. package/dist/{PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-fe-Rdwn4.js → PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-BVz6q3HE.js} +1 -1
  12. package/dist/{RoleList-Jn8EeYqo.js → RoleList-BPayuLxA.js} +9 -9
  13. package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-CV0DRK1L.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-C_EQivMd.js} +1 -1
  14. package/dist/{ScheduleGeneralPage-DMMqTMQs.js → ScheduleGeneralPage-sAqR1-hf.js} +4 -4
  15. package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-DLpFG65j.js → ScheduleModal.vue_vue_type_script_setup_true_lang-ABipaQiR.js} +622 -605
  16. package/dist/{SchedulePage-3MWnazgL.js → SchedulePage-DhbtCR8U.js} +6388 -6093
  17. package/dist/{SchedulePositionPage-B7S3G8gO.js → SchedulePositionPage-BUQy-Itg.js} +9 -9
  18. package/dist/{TeamMemberList-Bx_I5hO6.js → TeamMemberList-CIlvRlf8.js} +10 -10
  19. package/dist/{TimesheetList-DjDoOqih.js → TimesheetList-DFAfhWYG.js} +7 -7
  20. package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-pRgaW5ro.js → TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-QGzHuY7V.js} +3 -3
  21. package/dist/{app-uVAVK4Qd.js → app-C_EW9DFr.js} +20 -20
  22. package/dist/app.js +1 -1
  23. package/dist/{approval-code-C9DmR4Md.js → approval-code-DHsUgc4K.js} +1 -1
  24. package/dist/{dayjs.min-CdEA8bsz.js → dayjs.min-ibysRBBa.js} +1 -1
  25. package/dist/{employee-mq8mZRLE.js → employee-B1BQc4gB.js} +4 -4
  26. package/dist/{grant-user-Bv-pJ9Wt.js → grant-user-qzKHFTro.js} +1 -1
  27. package/dist/{iteration-B5TN8t9O.js → iteration-DQVB-iz0.js} +1 -1
  28. package/dist/{lodash-DxYGKySa.js → lodash-DOj41a0A.js} +1 -1
  29. package/dist/{restaurant-D7PEQjPY.js → restaurant-BbYRA_IT.js} +4 -3
  30. package/dist/{role-DiyMdYM9.js → role-B9MSLu4B.js} +2 -2
  31. package/dist/{rule-BGlU-EJ_.js → rule-e6okoXK6.js} +3 -3
  32. package/dist/src/api/schedule/index.d.ts +3 -1
  33. package/dist/src/types/schedule.d.ts +1 -1
  34. package/dist/src/views/scheduling/components/ScheduleOnboardingAssignPositionModal.vue.d.ts +6 -0
  35. package/dist/src/views/scheduling/components/SchedulePublishShareArt.vue.d.ts +2 -0
  36. package/dist/src/views/scheduling/composables/useScheduleDemandSheet.d.ts +0 -5
  37. package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +126 -1
  38. package/dist/src/views/scheduling/schedule-store.d.ts +1 -0
  39. package/dist/style.css +1 -1
  40. package/dist/tsconfig.app.tsbuildinfo +1 -1
  41. package/dist/{useAppStore-d_nHyK5u.js → useAppStore-BoLkvkE2.js} +1 -1
  42. package/dist/{useLoading-JFoghhRz.js → useLoading-Ch1AUYT1.js} +1 -1
  43. package/dist/{useReportPermissions-CV0b4SBk.js → useReportPermissions-CJ9ey1bN.js} +3 -3
  44. package/package.json +1 -1
@@ -1,9 +1,9 @@
1
- import { onMounted as we, onBeforeUnmount as He, ref as g, reactive as O, shallowRef as de, watch as Ee, computed as Y, defineComponent as Ae, createElementBlock as C, openBlock as N, renderSlot as Ye, useAttrs as sa, nextTick as fe, normalizeClass as oe, createElementVNode as _, createBlock as ra, mergeProps as la, toDisplayString as F, Teleport as ua, createCommentVNode as U, withDirectives as da, vModelText as ca, Fragment as ce, renderList as ya, createTextVNode as ma, withModifiers as fa, normalizeStyle as pa } from "vue";
1
+ import { onMounted as He, onBeforeUnmount as Ae, ref as w, reactive as O, shallowRef as ce, watch as Ee, computed as P, defineComponent as be, createElementBlock as k, openBlock as b, renderSlot as Ye, useAttrs as ia, nextTick as pe, normalizeClass as se, createElementVNode as _, createBlock as ra, mergeProps as la, toDisplayString as F, Teleport as ua, createCommentVNode as U, withDirectives as da, vModelText as ca, Fragment as ye, renderList as ya, createTextVNode as ma, withModifiers as fa, normalizeStyle as pa } from "vue";
2
2
  import { useRoute as ha, useRouter as va } from "vue-router";
3
3
  import { useCoreStore as Be } from "@feedmepos/mf-common";
4
- import { g as v, b as h, u as Da } from "./restaurant-D7PEQjPY.js";
5
- import { E as pe, u as ga } from "./employee-mq8mZRLE.js";
6
- function Fn(e) {
4
+ import { g as h, b as p, u as Da } from "./restaurant-BbYRA_IT.js";
5
+ import { E as he, u as ga } from "./employee-B1BQc4gB.js";
6
+ function Wn(e) {
7
7
  let a = null;
8
8
  function t() {
9
9
  if (!a) return;
@@ -11,14 +11,14 @@ function Fn(e) {
11
11
  const n = a.getBoundingClientRect().top;
12
12
  a.style.height = `${Math.max(0, window.innerHeight - n)}px`;
13
13
  }
14
- we(() => {
14
+ He(() => {
15
15
  var n;
16
16
  a = ((n = e.value) == null ? void 0 : n.closest(".sch-page")) ?? null, t(), window.addEventListener("resize", t);
17
- }), He(() => {
17
+ }), Ae(() => {
18
18
  window.removeEventListener("resize", t), a && (a.style.height = "");
19
19
  });
20
20
  }
21
- function he(e) {
21
+ function ve(e) {
22
22
  const [a, t] = String(e || "0:0").split(":").map(Number);
23
23
  return (Number.isFinite(a) ? a : 0) * 60 + (Number.isFinite(t) ? t : 0);
24
24
  }
@@ -27,88 +27,88 @@ function wa(e) {
27
27
  return `${String(Math.floor(a / 60)).padStart(2, "0")}:${String(a % 60).padStart(2, "0")}`;
28
28
  }
29
29
  function Ha(e, a) {
30
- const t = he(e);
31
- let n = he(a);
30
+ const t = ve(e);
31
+ let n = ve(a);
32
32
  return n <= t && (n += 1440), [t, n];
33
33
  }
34
34
  function _e(e, a) {
35
35
  const [t, n] = Ha(e, a);
36
36
  return Math.max(0, n - t);
37
37
  }
38
- function Ea(e) {
39
- const a = (he(e) % 1440 + 1440) % 1440, t = Math.floor(a / 60), n = a % 60, s = t < 12 ? "am" : "pm", o = t % 12 || 12;
40
- return n ? `${o}:${String(n).padStart(2, "0")}${s}` : `${o}${s}`;
38
+ function Aa(e) {
39
+ const a = (ve(e) % 1440 + 1440) % 1440, t = Math.floor(a / 60), n = a % 60, r = t < 12 ? "am" : "pm", o = t % 12 || 12;
40
+ return n ? `${o}:${String(n).padStart(2, "0")}${r}` : `${o}${r}`;
41
41
  }
42
- function Un(e) {
43
- return Ea(wa(e % 1440));
42
+ function zn(e) {
43
+ return Aa(wa(e % 1440));
44
44
  }
45
45
  function xe(e) {
46
46
  const a = Array.isArray(e) ? e : e == null ? void 0 : e.breaks;
47
47
  return a != null && a.length ? a.reduce((t, n) => {
48
48
  if (n.type === "DURATION") return t + n.minutes;
49
- const [s, o] = n.startTime.split(":").map(Number), [r, i] = n.endTime.split(":").map(Number);
50
- let m = r * 60 + i - (s * 60 + o);
49
+ const [r, o] = n.startTime.split(":").map(Number), [s, i] = n.endTime.split(":").map(Number);
50
+ let m = s * 60 + i - (r * 60 + o);
51
51
  return m < 0 && (m += 24 * 60), t + m;
52
52
  }, 0) : Math.max(0, e && !Array.isArray(e) ? e.breakMins ?? 0 : 0);
53
53
  }
54
- function Wn(e, a) {
55
- var s;
56
- const t = a ?? _e(e.start, e.end), n = (s = e.breaks) != null && s.length ? e.breaks.reduce((o, r) => o + (r.breakPayType === "UNPAID" ? xe([r]) : 0), 0) : Math.max(0, e.breakMins ?? 0);
54
+ function Vn(e, a) {
55
+ var r;
56
+ const t = a ?? _e(e.start, e.end), n = (r = e.breaks) != null && r.length ? e.breaks.reduce((o, s) => o + (s.breakPayType === "UNPAID" ? xe([s]) : 0), 0) : Math.max(0, e.breakMins ?? 0);
57
57
  return Math.max(0, t - Math.min(t, n));
58
58
  }
59
- function zn(e) {
59
+ function Kn(e) {
60
60
  const a = Math.max(0, Math.round(e ?? 0));
61
61
  return a ? [{ type: "DURATION", minutes: a, breakPayType: "UNPAID" }] : [];
62
62
  }
63
- const Q = 500, Aa = 10, ke = 6, Vn = 1500, Fe = 1e6, D = {
63
+ const q = 500, Ea = 10, Me = 6, Gn = 1500, Fe = 1e6, D = {
64
64
  async listEmployeeProfiles(e) {
65
- return v(
66
- await h("schedules").get("employees", {
65
+ return h(
66
+ await p("schedules").get("employees", {
67
67
  params: e != null && e.length ? { ids: e.join(",") } : void 0
68
68
  })
69
69
  );
70
70
  },
71
71
  async listEmployeeConfigs(e) {
72
- return v(
73
- await h(`restaurants/${e}/schedules`).get("employee-configs")
72
+ return h(
73
+ await p(`restaurants/${e}/schedules`).get("employee-configs")
74
74
  );
75
75
  },
76
76
  async saveEmployeeConfigs(e, a) {
77
- return v(
78
- await h(`restaurants/${e}/schedules`).post(
77
+ return h(
78
+ await p(`restaurants/${e}/schedules`).post(
79
79
  "employee-configs/reorder",
80
80
  a
81
81
  )
82
82
  );
83
83
  },
84
84
  async getSettings(e) {
85
- return v(
86
- await h(`restaurants/${e}/schedules`).get("settings")
85
+ return h(
86
+ await p(`restaurants/${e}/schedules`).get("settings")
87
87
  );
88
88
  },
89
89
  async saveSettings(e, a) {
90
- return v(
91
- await h(`restaurants/${e}/schedules`).post("settings", a)
90
+ return h(
91
+ await p(`restaurants/${e}/schedules`).post("settings", a)
92
92
  );
93
93
  },
94
94
  async generateAutoSchedule(e, a) {
95
- return v(
96
- await h(`restaurants/${e}/schedules`).post(
95
+ return h(
96
+ await p(`restaurants/${e}/schedules`).post(
97
97
  "auto-schedule/generate",
98
98
  a
99
99
  )
100
100
  );
101
101
  },
102
102
  async getAutoScheduleCapabilities(e) {
103
- return v(
104
- await h(`restaurants/${e}/schedules`).get(
103
+ return h(
104
+ await p(`restaurants/${e}/schedules`).get(
105
105
  "auto-schedule/capabilities"
106
106
  )
107
107
  );
108
108
  },
109
109
  async applyAutoSchedule(e, a) {
110
- return v(
111
- await h(`restaurants/${e}/schedules`).post(
110
+ return h(
111
+ await p(`restaurants/${e}/schedules`).post(
112
112
  "auto-schedule/apply",
113
113
  a
114
114
  )
@@ -116,81 +116,90 @@ const Q = 500, Aa = 10, ke = 6, Vn = 1500, Fe = 1e6, D = {
116
116
  },
117
117
  /** One outlet's whole board over `[from, to]` (inclusive, 'YYYY-MM-DD'). */
118
118
  async readBoard(e, a, t) {
119
- return v(
120
- await h(`restaurants/${e}/schedules`).get("board", {
119
+ return h(
120
+ await p(`restaurants/${e}/schedules`).get("board", {
121
121
  params: { from: a, to: t }
122
122
  })
123
123
  );
124
124
  },
125
125
  async createTimeOff(e, a) {
126
- return v(
127
- await h(`restaurants/${e}/schedules`).post("time-off", a)
126
+ return h(
127
+ await p(`restaurants/${e}/schedules`).post("time-off", a)
128
128
  );
129
129
  },
130
130
  async updateTimeOffStatus(e, a, t) {
131
- return v(
132
- await h(`restaurants/${e}/schedules`).post(
131
+ return h(
132
+ await p(`restaurants/${e}/schedules`).post(
133
133
  `time-off/${a}/status`,
134
134
  t
135
135
  )
136
136
  );
137
137
  },
138
138
  async deleteTimeOff(e, a) {
139
- await h(`restaurants/${e}/schedules`).delete(`time-off/${a}`);
139
+ await p(`restaurants/${e}/schedules`).delete(`time-off/${a}`);
140
140
  },
141
141
  /** Creates or updates the employee's shared business-level scheduling profile. */
142
142
  async createEmployeeProfile(e, a) {
143
- return v(await h("schedules").post("employees", a));
143
+ return h(await p("schedules").post("employees", a));
144
144
  },
145
145
  /** Edits the employee's shared business-level scheduling profile. */
146
146
  async updateEmployeeProfile(e, a, t) {
147
- return v(
148
- await h("schedules").post("employees", { employeeId: a, ...t })
147
+ return h(
148
+ await p("schedules").post("employees", { employeeId: a, ...t })
149
149
  );
150
150
  },
151
151
  /** Positions are shared across the business. */
152
152
  async createPosition(e) {
153
- return v(await h("schedules").post("positions", e));
153
+ return h(await p("schedules").post("positions", e));
154
154
  },
155
155
  async updatePosition(e, a) {
156
- return v(await h("schedules").post(`positions/${e}`, a));
156
+ return h(await p("schedules").post(`positions/${e}`, a));
157
157
  },
158
158
  /** Deleting one position is `deletePositions` with a single-id array — the backend's
159
159
  * `DELETE positions/:id` route is gone; this is now `DELETE positions?ids=`. */
160
160
  async deletePosition(e) {
161
- await h("schedules").delete("positions", {
161
+ await p("schedules").delete("positions", {
162
162
  params: { ids: e }
163
163
  });
164
164
  },
165
165
  /** Creates one flat demand interval. */
166
166
  async createDemand(e, a) {
167
- return v(
168
- await h(`restaurants/${e}/schedules`).post("demands", a)
167
+ return h(
168
+ await p(`restaurants/${e}/schedules`).post("demands", a)
169
169
  );
170
170
  },
171
171
  /** Deletes a batch of demands in one request — e.g. `saveDemand` replacing a whole
172
172
  * day/weekday's demand rows wholesale. Deleting one demand is just this with a single-id
173
173
  * array. */
174
174
  async deleteDemands(e, a) {
175
- return v(
176
- await h(`restaurants/${e}/schedules`).delete("demands", {
175
+ return h(
176
+ await p(`restaurants/${e}/schedules`).delete("demands", {
177
177
  params: { ids: a.join(",") }
178
178
  })
179
179
  );
180
180
  },
181
181
  /** Atomically replaces one date/weekday's flattened demand rows. */
182
182
  async replaceDemands(e, a) {
183
- return v(
184
- await h(`restaurants/${e}/schedules`).post(
183
+ return h(
184
+ await p(`restaurants/${e}/schedules`).post(
185
185
  "demands/replace",
186
186
  a
187
187
  )
188
188
  );
189
189
  },
190
+ /** Atomically replaces several date/weekday demand generations. */
191
+ async bulkReplaceDemands(e, a) {
192
+ return h(
193
+ await p(`restaurants/${e}/schedules`).post(
194
+ "demands/bulk-replace",
195
+ a
196
+ )
197
+ );
198
+ },
190
199
  /** Replaces one date's note/holiday-mark. All three fields back to empty/false clears it. */
191
200
  async saveScheduleDay(e, a, t) {
192
- return v(
193
- await h(`restaurants/${e}/schedules`).post(
201
+ return h(
202
+ await p(`restaurants/${e}/schedules`).post(
194
203
  `days/${a}`,
195
204
  t
196
205
  )
@@ -198,13 +207,13 @@ const Q = 500, Aa = 10, ke = 6, Vn = 1500, Fe = 1e6, D = {
198
207
  },
199
208
  /** A one-off shift assignment. */
200
209
  async createAssignment(e, a) {
201
- return v(
202
- await h(`restaurants/${e}/schedules`).post("assignments", a)
210
+ return h(
211
+ await p(`restaurants/${e}/schedules`).post("assignments", a)
203
212
  );
204
213
  },
205
214
  async updateAssignment(e, a, t) {
206
- return v(
207
- await h(`restaurants/${e}/schedules`).patch(
215
+ return h(
216
+ await p(`restaurants/${e}/schedules`).patch(
208
217
  `assignments/${a}`,
209
218
  t
210
219
  )
@@ -212,8 +221,8 @@ const Q = 500, Aa = 10, ke = 6, Vn = 1500, Fe = 1e6, D = {
212
221
  },
213
222
  /** Atomically applies assignment updates, creates, and deletes used by moves and swaps. */
214
223
  async bulkSaveAssignments(e, a) {
215
- return v(
216
- await h(`restaurants/${e}/schedules`).post(
224
+ return h(
225
+ await p(`restaurants/${e}/schedules`).post(
217
226
  "assignments/bulk",
218
227
  a
219
228
  )
@@ -223,8 +232,8 @@ const Q = 500, Aa = 10, ke = 6, Vn = 1500, Fe = 1e6, D = {
223
232
  * getting replaced wholesale. Deleting one assignment is just this with a single-id
224
233
  * array. */
225
234
  async deleteAssignments(e, a) {
226
- return v(
227
- await h(`restaurants/${e}/schedules`).delete("assignments", {
235
+ return h(
236
+ await p(`restaurants/${e}/schedules`).delete("assignments", {
228
237
  params: { ids: a.join(",") }
229
238
  })
230
239
  );
@@ -232,25 +241,25 @@ const Q = 500, Aa = 10, ke = 6, Vn = 1500, Fe = 1e6, D = {
232
241
  /** Flips a batch of assignments to one status in a single request — e.g. Publish sending
233
242
  * every DRAFT shift on the board to PUBLISHED at once. */
234
243
  async bulkUpdateAssignmentStatus(e, a) {
235
- return v(
236
- await h(`restaurants/${e}/schedules`).patch(
244
+ return h(
245
+ await p(`restaurants/${e}/schedules`).patch(
237
246
  "assignments/bulk-status",
238
247
  a
239
248
  )
240
249
  );
241
250
  }
242
251
  }, Ue = {
243
- payload: de(null),
244
- loading: g(!1),
245
- rosterLoading: g(!1),
246
- loadError: g(null),
247
- scheduleSetupCompleted: g(!1),
248
- dataVersion: g(0),
249
- outletId: g(""),
250
- restaurantEmployees: g([]),
251
- employeeConfigs: g([]),
252
- employeeOutletIds: de({}),
253
- businessEmployees: de([]),
252
+ payload: ce(null),
253
+ loading: w(!1),
254
+ rosterLoading: w(!1),
255
+ loadError: w(null),
256
+ scheduleSetupCompleted: w(!1),
257
+ dataVersion: w(0),
258
+ outletId: w(""),
259
+ restaurantEmployees: w([]),
260
+ employeeConfigs: w([]),
261
+ employeeOutletIds: ce({}),
262
+ businessEmployees: ce([]),
254
263
  positions: O([]),
255
264
  positionRecords: O([]),
256
265
  rolePositions: O({}),
@@ -290,27 +299,27 @@ const Q = 500, Aa = 10, ke = 6, Vn = 1500, Fe = 1e6, D = {
290
299
  }, {
291
300
  payload: d,
292
301
  loading: Se,
293
- rosterLoading: Le,
302
+ rosterLoading: Oe,
294
303
  loadError: ie,
295
304
  scheduleSetupCompleted: We,
296
305
  dataVersion: z,
297
306
  outletId: y,
298
- restaurantEmployees: se,
307
+ restaurantEmployees: re,
299
308
  employeeConfigs: x,
300
309
  employeeOutletIds: ze,
301
- businessEmployees: ye,
310
+ businessEmployees: me,
302
311
  positions: ba,
303
312
  positionRecords: Ve,
304
- rolePositions: Kn,
313
+ rolePositions: jn,
305
314
  outlet: Na,
306
- locationOptions: Oe,
307
- locationLabelById: X,
308
- compensationGroupMeta: Gn,
309
- existingStaff: jn,
310
- shiftTemplates: Qn,
311
- rules: T
315
+ locationOptions: Le,
316
+ locationLabelById: J,
317
+ compensationGroupMeta: Qn,
318
+ existingStaff: qn,
319
+ shiftTemplates: Xn,
320
+ rules: I
312
321
  } = Ue;
313
- function Ca() {
322
+ function ka() {
314
323
  const e = Ue.rules;
315
324
  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.otAfterDaily = 0, e.salesForecast = 0, e.closedWeekdays.splice(0, e.closedWeekdays.length), e.labourTarget = 0, e.budgetFromSales = !1, e.budget = 0, e.otCapHours = 0, e.otBudget = 0, Object.assign(e.notify, {
316
325
  waConnected: !1,
@@ -319,49 +328,49 @@ function Ca() {
319
328
  defaults: { wa: !1, push: !1, email: !1 }
320
329
  });
321
330
  }
322
- const ve = 7;
323
- function Ma(e) {
331
+ const De = 7;
332
+ function Ca(e) {
324
333
  const a = e.getFullYear(), t = String(e.getMonth() + 1).padStart(2, "0"), n = String(e.getDate()).padStart(2, "0");
325
334
  return `${a}-${t}-${n}`;
326
335
  }
327
- function J(e, a) {
336
+ function Z(e, a) {
328
337
  const t = new Date(e);
329
338
  return t.setDate(t.getDate() + a), t;
330
339
  }
331
- function De(e) {
340
+ function ge(e) {
332
341
  const a = new Date(e);
333
342
  return a.setHours(0, 0, 0, 0), a.setDate(a.getDate() - (a.getDay() + 6) % 7), a;
334
343
  }
335
- function qn(e, a = /* @__PURE__ */ new Date()) {
336
- const t = J(De(a), e * ve);
337
- return Array.from({ length: ve }, (n, s) => J(t, s));
344
+ function Jn(e, a = /* @__PURE__ */ new Date()) {
345
+ const t = Z(ge(a), e * De);
346
+ return Array.from({ length: De }, (n, r) => Z(t, r));
338
347
  }
339
- function Xn(e, a) {
340
- const t = (o) => Date.UTC(o.getFullYear(), o.getMonth(), o.getDate()), n = t(De(e)), s = t(De(a));
341
- return Math.trunc((s - n) / (ve * 24 * 60 * 60 * 1e3));
348
+ function Zn(e, a) {
349
+ const t = (o) => Date.UTC(o.getFullYear(), o.getMonth(), o.getDate()), n = t(ge(e)), r = t(ge(a));
350
+ return Math.trunc((r - n) / (De * 24 * 60 * 60 * 1e3));
342
351
  }
343
- const Z = Ma;
344
- let V = null, K = null, W = null, q = 0, re = null;
352
+ const ee = Ca;
353
+ let V = null, K = null, W = null, X = 0, le = null;
345
354
  function Re(e) {
346
- return e === y.value ? !1 : (Ca(), y.value = e, d.value = null, V = null, K = null, ie.value = null, re = null, We.value = !1, se.value = [], x.value = [], W = null, q += 1, z.value += 1, !0);
355
+ return e === y.value ? !1 : (ka(), y.value = e, d.value = null, V = null, K = null, ie.value = null, le = null, We.value = !1, re.value = [], x.value = [], W = null, X += 1, z.value += 1, !0);
347
356
  }
348
- async function ge(e) {
349
- if (!(!e || re === e)) {
350
- Le.value = !0;
357
+ async function we(e) {
358
+ if (!(!e || le === e)) {
359
+ Oe.value = !0;
351
360
  try {
352
- await ka(e);
361
+ await Ma(e);
353
362
  } finally {
354
- Le.value = !1;
363
+ Oe.value = !1;
355
364
  }
356
365
  }
357
366
  }
358
- async function ka(e) {
359
- const a = await pe.readEmployeesPage({
360
- limit: Q,
367
+ async function Ma(e) {
368
+ const a = await he.readEmployeesPage({
369
+ limit: q,
361
370
  offset: 0,
362
371
  restaurantIds: [e]
363
372
  });
364
- e === y.value && (se.value = a.items, x.value = await D.listEmployeeConfigs(e), re = e, z.value += 1, Ra().then((t) => {
373
+ e === y.value && (re.value = a.items, x.value = await D.listEmployeeConfigs(e), le = e, z.value += 1, Ra().then((t) => {
365
374
  e === y.value && (ze.value = t, z.value += 1);
366
375
  }));
367
376
  }
@@ -371,24 +380,24 @@ async function Sa(e) {
371
380
  const t = await D.saveEmployeeConfigs(a, { configs: e });
372
381
  x.value = t, z.value += 1;
373
382
  }
374
- async function La(e, a) {
375
- const t = x.value.find((s) => s.employeeId === e), n = (t == null ? void 0 : t.displayOrder) ?? (a && x.value.some((s) => s.displayOrder !== null) ? Math.max(
383
+ async function Oa(e, a) {
384
+ const t = x.value.find((r) => r.employeeId === e), n = (t == null ? void 0 : t.displayOrder) ?? (a && x.value.some((r) => r.displayOrder !== null) ? Math.max(
376
385
  0,
377
- ...x.value.filter((s) => s.displayOrder !== null).map((s) => s.displayOrder)
386
+ ...x.value.filter((r) => r.displayOrder !== null).map((r) => r.displayOrder)
378
387
  ) + 100 : null);
379
388
  await Sa([{ employeeId: e, enabled: a, displayOrder: n }]);
380
389
  }
381
390
  async function Ke() {
382
391
  const e = y.value;
383
- e && (re = null, await ge(e));
392
+ e && (le = null, await we(e));
384
393
  }
385
394
  async function Ge(e, a) {
386
395
  const t = ga(), n = (await je(!0)).find((i) => i._id === e);
387
396
  if (!n) throw new Error("Could not find this employee");
388
- const s = n.restaurantRole.map((i) => ({
397
+ const r = n.restaurantRole.map((i) => ({
389
398
  restaurantId: i.restaurantId,
390
399
  roleId: i.roleId
391
- })), o = a(s);
400
+ })), o = a(r);
392
401
  if (!o.length)
393
402
  throw new Error(
394
403
  "An employee must keep at least 1 location, otherwise they are deleted. To delete them, use the Employee page."
@@ -396,36 +405,36 @@ async function Ge(e, a) {
396
405
  (n.isMasterUser ? "master" : "user") === "master" ? await t.updateMasterEmployee(e, {
397
406
  user: { name: n.name, passcode: n.passcode, code: n.code ?? "" },
398
407
  roles: o,
399
- previousRoles: s
408
+ previousRoles: r
400
409
  }) : await t.updateEmployee(e, {
401
410
  user: { name: n.name, passcode: n.passcode },
402
411
  roles: o,
403
- previousRoles: s
412
+ previousRoles: r
404
413
  });
405
414
  }
406
- async function Jn(e, a, t = "") {
415
+ async function eo(e, a, t = "") {
407
416
  const n = [...new Set(a.filter(Boolean))];
408
- n.length && (await Ge(e, (s) => [
409
- ...s.filter((o) => !n.includes(o.restaurantId)),
417
+ n.length && (await Ge(e, (r) => [
418
+ ...r.filter((o) => !n.includes(o.restaurantId)),
410
419
  ...n.map((o) => ({ restaurantId: o, roleId: t }))
411
- ]), y.value && n.includes(y.value) && await La(e, !0), await Ke());
420
+ ]), y.value && n.includes(y.value) && await Oa(e, !0), await Ke());
412
421
  }
413
- async function Zn(e, a) {
422
+ async function ao(e, a) {
414
423
  const t = new Set(a);
415
- t.size && (await Ge(e, (n) => n.filter((s) => !t.has(s.restaurantId))), await Ke());
424
+ t.size && (await Ge(e, (n) => n.filter((r) => !t.has(r.restaurantId))), await Ke());
416
425
  }
417
- let j = null;
418
- async function Oa() {
419
- const e = await pe.readEmployeesPage({
420
- limit: Q,
426
+ let Q = null;
427
+ async function La() {
428
+ const e = await he.readEmployeesPage({
429
+ limit: q,
421
430
  offset: 0,
422
431
  includeEmptyPasscode: !0
423
- }), a = Math.min(Aa, Math.ceil(e.total / Q)), t = await Promise.all(
432
+ }), a = Math.min(Ea, Math.ceil(e.total / q)), t = await Promise.all(
424
433
  Array.from(
425
434
  { length: Math.max(0, a - 1) },
426
- (n, s) => pe.readEmployeesPage({
427
- limit: Q,
428
- offset: (s + 1) * Q,
435
+ (n, r) => he.readEmployeesPage({
436
+ limit: q,
437
+ offset: (r + 1) * q,
429
438
  includeEmptyPasscode: !0
430
439
  })
431
440
  )
@@ -434,13 +443,13 @@ async function Oa() {
434
443
  }
435
444
  function je(e = !1) {
436
445
  if (!e) {
437
- if (j) return j;
438
- if (ye.value.length) return Promise.resolve(ye.value);
446
+ if (Q) return Q;
447
+ if (me.value.length) return Promise.resolve(me.value);
439
448
  }
440
- const a = Oa().then((t) => (ye.value = t, t)).finally(() => {
441
- j === a && (j = null);
449
+ const a = La().then((t) => (me.value = t, t)).finally(() => {
450
+ Q === a && (Q = null);
442
451
  });
443
- return j = a, a;
452
+ return Q = a, a;
444
453
  }
445
454
  async function Ra() {
446
455
  const e = {};
@@ -457,95 +466,102 @@ function Ie(e, a) {
457
466
  return V !== null && K !== null && V <= e && K >= a;
458
467
  }
459
468
  async function Ia(e) {
460
- const a = Z(e), t = Z(J(e, 6));
469
+ const a = ee(e), t = ee(Z(e, 6));
461
470
  Ie(a, t) || W && (await W, Ie(a, t)) || await Qe(
462
- J(e, -7 * ke),
463
- J(e, 7 * ke)
471
+ Z(e, -7 * Me),
472
+ Z(e, 7 * Me)
464
473
  );
465
474
  }
466
- async function eo() {
475
+ async function to() {
467
476
  !V || !K || await Qe(/* @__PURE__ */ new Date(`${V}T00:00:00`), /* @__PURE__ */ new Date(`${K}T00:00:00`));
468
477
  }
469
- async function ao(e) {
478
+ async function no(e) {
470
479
  if (!y.value) throw new Error("No outlet selected");
471
480
  const a = await D.createEmployeeProfile(y.value, e);
472
481
  d.value && (d.value.employees.push(a), z.value += 1);
473
482
  }
474
- async function to(e, a) {
483
+ async function oo(e, a) {
475
484
  if (!y.value) throw new Error("No outlet selected");
476
485
  const t = await D.updateEmployeeProfile(y.value, e, a);
477
486
  if (d.value) {
478
- const n = d.value.employees.findIndex((s) => s.employeeId === e);
487
+ const n = d.value.employees.findIndex((r) => r.employeeId === e);
479
488
  n > -1 && (d.value = {
480
489
  ...d.value,
481
- employees: d.value.employees.map((s, o) => o === n ? t : s)
490
+ employees: d.value.employees.map((r, o) => o === n ? t : r)
482
491
  });
483
492
  }
484
493
  }
485
- async function no(e) {
494
+ async function so(e) {
486
495
  const a = await D.createPosition(e);
487
496
  d.value && (d.value = { ...d.value, positions: [...d.value.positions, a] });
488
497
  }
489
- async function oo(e, a) {
498
+ async function io(e, a) {
490
499
  const t = await D.updatePosition(e, a);
491
500
  d.value && (d.value = {
492
501
  ...d.value,
493
502
  positions: d.value.positions.map((n) => n.id === e ? t : n)
494
503
  });
495
504
  }
496
- async function io(e) {
505
+ async function ro(e) {
497
506
  await D.deletePosition(e), d.value && (d.value = {
498
507
  ...d.value,
499
508
  positions: d.value.positions.filter((a) => a.id !== e)
500
509
  });
501
510
  }
502
- async function so(e, a) {
503
- var s;
511
+ async function lo(e, a) {
512
+ var r;
504
513
  if (!y.value) throw new Error("No outlet selected");
505
- const t = (s = d.value) == null ? void 0 : s.days.find((o) => o.date === e), n = await D.saveScheduleDay(y.value, e, {
514
+ const t = (r = d.value) == null ? void 0 : r.days.find((o) => o.date === e), n = await D.saveScheduleDay(y.value, e, {
506
515
  ...a,
507
516
  expectedUpdatedAt: a.expectedUpdatedAt ?? (t == null ? void 0 : t.updatedAt)
508
517
  });
509
518
  if (d.value) {
510
- const o = d.value.days.filter((r) => r.date !== e);
519
+ const o = d.value.days.filter((s) => s.date !== e);
511
520
  n && o.push(n), d.value = { ...d.value, days: o };
512
521
  }
513
522
  }
514
- async function ro(e) {
515
- var s;
516
- if (!y.value) throw new Error("No outlet selected");
517
- const a = (((s = d.value) == null ? void 0 : s.demands) ?? []).filter(
518
- (o) => e.date ? o.date === e.date : o.dayOfWeek === e.dayOfWeek
519
- ), t = e.periods.flatMap((o) => {
520
- const r = (o.roles ?? []).filter((f) => f.positionName && f.headcount > 0), i = r.reduce((f, w) => f + w.headcount, 0), m = {
523
+ async function uo(e) {
524
+ await $a([e]);
525
+ }
526
+ function Ta(e) {
527
+ const a = e.periods.flatMap((t) => {
528
+ const n = (t.roles ?? []).filter((s) => s.positionName && s.headcount > 0), r = n.reduce((s, i) => s + i.headcount, 0), o = {
521
529
  ...e.date ? { date: e.date } : { dayOfWeek: e.dayOfWeek },
522
- startTime: o.startTime,
523
- endTime: o.endTime
530
+ startTime: t.startTime,
531
+ endTime: t.endTime
524
532
  };
525
533
  return [
526
- ...r.map((f) => ({
527
- ...m,
528
- headcount: f.headcount,
529
- position: { positionId: f.positionId, positionName: f.positionName }
534
+ ...n.map((s) => ({
535
+ ...o,
536
+ headcount: s.headcount,
537
+ position: { positionId: s.positionId, positionName: s.positionName }
530
538
  })),
531
- ...o.headcount > i ? [{ ...m, headcount: o.headcount - i }] : []
539
+ ...t.headcount > r ? [{ ...o, headcount: t.headcount - r }] : []
532
540
  ];
533
- }), n = await D.replaceDemands(y.value, {
534
- ...e.date ? { date: e.date } : { dayOfWeek: e.dayOfWeek },
535
- demands: t
536
541
  });
542
+ return {
543
+ ...e.date ? { date: e.date } : { dayOfWeek: e.dayOfWeek },
544
+ demands: a
545
+ };
546
+ }
547
+ async function $a(e) {
548
+ if (!y.value) throw new Error("No outlet selected");
549
+ if (!e.length) return;
550
+ const a = e.map(Ta), t = e.length === 1 ? await D.replaceDemands(y.value, a[0]) : await D.bulkReplaceDemands(y.value, { replacements: a });
537
551
  if (d.value) {
538
- const o = d.value.demands.filter((r) => !a.some((i) => i.id === r.id));
539
- d.value = { ...d.value, demands: [...o, ...n] };
552
+ const n = e.map((o) => ({ date: o.date, dayOfWeek: o.dayOfWeek })), r = d.value.demands.filter(
553
+ (o) => !n.some((s) => s.date ? o.date === s.date : o.dayOfWeek === s.dayOfWeek)
554
+ );
555
+ d.value = { ...d.value, demands: [...r, ...t] };
540
556
  }
541
557
  }
542
- async function lo(e, a) {
558
+ async function co(e, a) {
543
559
  if (!y.value) throw new Error("No outlet selected");
544
560
  const t = d.value;
545
561
  if (!t || t.demands.some((o) => o.date === a)) return 0;
546
562
  const n = t.demands.filter((o) => o.date === e);
547
563
  if (!n.length) return 0;
548
- const s = await Promise.all(
564
+ const r = await Promise.all(
549
565
  n.map(
550
566
  (o) => D.createDemand(y.value, {
551
567
  date: a,
@@ -561,34 +577,34 @@ async function lo(e, a) {
561
577
  })
562
578
  )
563
579
  );
564
- return d.value && (d.value = { ...d.value, demands: [...d.value.demands, ...s] }), s.length;
580
+ return d.value && (d.value = { ...d.value, demands: [...d.value.demands, ...r] }), r.length;
565
581
  }
566
- async function uo(e) {
582
+ async function yo(e) {
567
583
  if (!y.value) throw new Error("No outlet selected");
568
584
  return D.generateAutoSchedule(y.value, e);
569
585
  }
570
- async function co() {
586
+ async function mo() {
571
587
  if (!y.value) throw new Error("No outlet selected");
572
588
  return D.getAutoScheduleCapabilities(y.value);
573
589
  }
574
- async function yo(e) {
590
+ async function fo(e) {
575
591
  if (!y.value) throw new Error("No outlet selected");
576
592
  return D.applyAutoSchedule(y.value, e);
577
593
  }
578
- async function mo(e) {
594
+ async function po(e) {
579
595
  if (!y.value) throw new Error("No outlet selected");
580
596
  return D.bulkSaveAssignments(y.value, e);
581
597
  }
582
- async function fo(e) {
598
+ async function ho(e) {
583
599
  if (!y.value) throw new Error("No outlet selected");
584
600
  e.length && await D.deleteAssignments(y.value, e);
585
601
  }
586
- async function po(e) {
602
+ async function vo(e) {
587
603
  if (!y.value) throw new Error("No outlet selected");
588
604
  const a = await D.createTimeOff(y.value, e);
589
605
  return d.value && (d.value = { ...d.value, timeOff: [...d.value.timeOff, a] }), a;
590
606
  }
591
- async function ho(e, a) {
607
+ async function Do(e, a) {
592
608
  if (!y.value) throw new Error("No outlet selected");
593
609
  const t = await D.updateTimeOffStatus(y.value, e, a);
594
610
  return t && d.value && (d.value = {
@@ -596,14 +612,14 @@ async function ho(e, a) {
596
612
  timeOff: d.value.timeOff.map((n) => n.id === e ? t : n)
597
613
  }), t;
598
614
  }
599
- async function vo(e) {
615
+ async function go(e) {
600
616
  if (!y.value) throw new Error("No outlet selected");
601
617
  await D.deleteTimeOff(y.value, e), d.value && (d.value = {
602
618
  ...d.value,
603
619
  timeOff: d.value.timeOff.filter((a) => a.id !== e)
604
620
  });
605
621
  }
606
- async function Do(e) {
622
+ async function wo(e) {
607
623
  if (!y.value) throw new Error("No outlet selected");
608
624
  return D.bulkUpdateAssignmentStatus(y.value, e);
609
625
  }
@@ -613,28 +629,28 @@ async function Qe(e, a) {
613
629
  ie.value = "No outlet selected";
614
630
  return;
615
631
  }
616
- const n = Z(e), s = Z(a), o = ++q;
632
+ const n = ee(e), r = ee(a), o = ++X;
617
633
  Se.value = !0, ie.value = null;
618
- const r = (async () => {
634
+ const s = (async () => {
619
635
  try {
620
- const i = await D.readBoard(t, n, s);
621
- if (y.value !== t || o !== q) return;
622
- d.value = i, We.value = i.settings.setupCompleted, V = n, K = s, z.value += 1;
636
+ const i = await D.readBoard(t, n, r);
637
+ if (y.value !== t || o !== X) return;
638
+ d.value = i, We.value = i.settings.setupCompleted, V = n, K = r, z.value += 1;
623
639
  } catch (i) {
624
- if (y.value !== t || o !== q) return;
640
+ if (y.value !== t || o !== X) return;
625
641
  ie.value = i instanceof Error ? i.message : "Could not load the schedule";
626
642
  } finally {
627
- y.value === t && o === q && (Se.value = !1);
643
+ y.value === t && o === X && (Se.value = !1);
628
644
  }
629
645
  })();
630
- W = r;
646
+ W = s;
631
647
  try {
632
- await r;
648
+ await s;
633
649
  } finally {
634
- W === r && (W = null);
650
+ W === s && (W = null);
635
651
  }
636
652
  }
637
- const Ta = "AE", $a = "Asia/Dubai", Pa = {
653
+ const Pa = "AE", Ya = "Asia/Dubai", Ba = {
638
654
  NORMAL: {
639
655
  overtime: 1.25
640
656
  },
@@ -646,13 +662,13 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
646
662
  regular: 2.5,
647
663
  overtime: 1.5
648
664
  }
649
- }, Ya = {
665
+ }, _a = {
650
666
  maxMonthlyHours: null,
651
667
  afterDailyHours: 2
652
- }, Ba = {
668
+ }, xa = {
653
669
  standardWeeklyHours: 48,
654
670
  maxDailyHours: 8
655
- }, _a = [
671
+ }, Fa = [
656
672
  {
657
673
  month: 1,
658
674
  day: 1,
@@ -668,7 +684,7 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
668
684
  day: 3,
669
685
  name: "UAE National Day Holiday"
670
686
  }
671
- ], xa = {
687
+ ], Ua = {
672
688
  2026: {
673
689
  "2026-01-01": "Gregorian New Year",
674
690
  "2026-03-20": "Eid Al-Fitr Holiday",
@@ -698,15 +714,15 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
698
714
  "2027-12-02": "UAE National Day",
699
715
  "2027-12-03": "UAE National Day Holiday"
700
716
  }
701
- }, Fa = {
702
- countryCode: Ta,
703
- timezone: $a,
704
- payRate: Pa,
705
- overtime: Ya,
706
- workingHours: Ba,
707
- recurringPublicHolidays: _a,
708
- publicHolidays: xa
709
- }, Ua = "BN", Wa = "Asia/Brunei", za = {
717
+ }, Wa = {
718
+ countryCode: Pa,
719
+ timezone: Ya,
720
+ payRate: Ba,
721
+ overtime: _a,
722
+ workingHours: xa,
723
+ recurringPublicHolidays: Fa,
724
+ publicHolidays: Ua
725
+ }, za = "BN", Va = "Asia/Brunei", Ka = {
710
726
  NORMAL: {
711
727
  overtime: 1.5
712
728
  },
@@ -718,13 +734,13 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
718
734
  regular: 2,
719
735
  overtime: 3
720
736
  }
721
- }, Va = {
737
+ }, Ga = {
722
738
  maxMonthlyHours: 72,
723
739
  afterDailyHours: null
724
- }, Ka = {
740
+ }, ja = {
725
741
  standardWeeklyHours: 44,
726
742
  maxDailyHours: 8
727
- }, Ga = [
743
+ }, Qa = [
728
744
  {
729
745
  month: 1,
730
746
  day: 1,
@@ -750,7 +766,7 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
750
766
  day: 25,
751
767
  name: "Christmas Day"
752
768
  }
753
- ], ja = {
769
+ ], qa = {
754
770
  2026: {
755
771
  "2026-01-01": "New Year's Day",
756
772
  "2026-02-17": "Chinese New Year",
@@ -780,15 +796,15 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
780
796
  "2027-08-15": "Prophet Muhammad's Birthday",
781
797
  "2027-12-25": "Christmas Day"
782
798
  }
783
- }, Qa = {
784
- countryCode: Ua,
785
- timezone: Wa,
786
- payRate: za,
787
- overtime: Va,
788
- workingHours: Ka,
789
- recurringPublicHolidays: Ga,
790
- publicHolidays: ja
791
- }, qa = "ID", Xa = "Asia/Jakarta", Ja = {
799
+ }, Xa = {
800
+ countryCode: za,
801
+ timezone: Va,
802
+ payRate: Ka,
803
+ overtime: Ga,
804
+ workingHours: ja,
805
+ recurringPublicHolidays: Qa,
806
+ publicHolidays: qa
807
+ }, Ja = "ID", Za = "Asia/Jakarta", et = {
792
808
  NORMAL: {
793
809
  overtime: 1.5
794
810
  },
@@ -800,13 +816,13 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
800
816
  regular: 2,
801
817
  overtime: 2
802
818
  }
803
- }, Za = {
819
+ }, at = {
804
820
  maxMonthlyHours: 72,
805
821
  afterDailyHours: 3
806
- }, et = {
822
+ }, tt = {
807
823
  standardWeeklyHours: 40,
808
824
  maxDailyHours: 8
809
- }, at = [
825
+ }, nt = [
810
826
  {
811
827
  month: 1,
812
828
  day: 1,
@@ -827,7 +843,7 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
827
843
  day: 25,
828
844
  name: "Christmas Day"
829
845
  }
830
- ], tt = {
846
+ ], ot = {
831
847
  2026: {
832
848
  "2026-01-01": "New Year's Day",
833
849
  "2026-01-16": "Isra Mi'raj",
@@ -867,15 +883,15 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
867
883
  "2027-12-25": "Christmas Day",
868
884
  "2027-12-26": "Isra Mi'raj"
869
885
  }
870
- }, nt = {
871
- countryCode: qa,
872
- timezone: Xa,
873
- payRate: Ja,
874
- overtime: Za,
875
- workingHours: et,
876
- recurringPublicHolidays: at,
877
- publicHolidays: tt
878
- }, ot = "MO", it = "Asia/Macau", st = {
886
+ }, st = {
887
+ countryCode: Ja,
888
+ timezone: Za,
889
+ payRate: et,
890
+ overtime: at,
891
+ workingHours: tt,
892
+ recurringPublicHolidays: nt,
893
+ publicHolidays: ot
894
+ }, it = "MO", rt = "Asia/Macau", lt = {
879
895
  NORMAL: {
880
896
  overtime: 1.5
881
897
  },
@@ -887,13 +903,13 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
887
903
  regular: 2,
888
904
  overtime: 3
889
905
  }
890
- }, rt = {
906
+ }, ut = {
891
907
  maxMonthlyHours: null,
892
908
  afterDailyHours: null
893
- }, lt = {
909
+ }, dt = {
894
910
  standardWeeklyHours: 48,
895
911
  maxDailyHours: 8
896
- }, ut = [
912
+ }, ct = [
897
913
  {
898
914
  month: 1,
899
915
  day: 1,
@@ -919,7 +935,7 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
919
935
  day: 25,
920
936
  name: "Christmas Day"
921
937
  }
922
- ], dt = {
938
+ ], yt = {
923
939
  2026: {
924
940
  "2026-01-01": "New Year's Day",
925
941
  "2026-02-17": "Lunar New Year's Day",
@@ -976,15 +992,15 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
976
992
  "2027-12-25": "Christmas Day",
977
993
  "2027-12-27": "Compensatory rest day"
978
994
  }
979
- }, ct = {
980
- countryCode: ot,
981
- timezone: it,
982
- payRate: st,
983
- overtime: rt,
984
- workingHours: lt,
985
- recurringPublicHolidays: ut,
986
- publicHolidays: dt
987
- }, yt = "MV", mt = "Indian/Maldives", ft = {
995
+ }, mt = {
996
+ countryCode: it,
997
+ timezone: rt,
998
+ payRate: lt,
999
+ overtime: ut,
1000
+ workingHours: dt,
1001
+ recurringPublicHolidays: ct,
1002
+ publicHolidays: yt
1003
+ }, ft = "MV", pt = "Indian/Maldives", ht = {
988
1004
  NORMAL: {
989
1005
  overtime: 1.5
990
1006
  },
@@ -996,13 +1012,13 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
996
1012
  regular: 2,
997
1013
  overtime: 3
998
1014
  }
999
- }, pt = {
1015
+ }, vt = {
1000
1016
  maxMonthlyHours: null,
1001
1017
  afterDailyHours: null
1002
- }, ht = {
1018
+ }, Dt = {
1003
1019
  standardWeeklyHours: 48,
1004
1020
  maxDailyHours: 8
1005
- }, vt = [
1021
+ }, gt = [
1006
1022
  {
1007
1023
  month: 1,
1008
1024
  day: 1,
@@ -1028,7 +1044,7 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
1028
1044
  day: 11,
1029
1045
  name: "Republic Day"
1030
1046
  }
1031
- ], Dt = {
1047
+ ], wt = {
1032
1048
  2026: {
1033
1049
  "2026-01-01": "New Year's Day",
1034
1050
  "2026-03-20": "Eid al-Fitr Holiday",
@@ -1066,15 +1082,15 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
1066
1082
  "2027-11-03": "Victory Day",
1067
1083
  "2027-11-11": "Republic Day"
1068
1084
  }
1069
- }, gt = {
1070
- countryCode: yt,
1071
- timezone: mt,
1072
- payRate: ft,
1073
- overtime: pt,
1074
- workingHours: ht,
1075
- recurringPublicHolidays: vt,
1076
- publicHolidays: Dt
1077
- }, wt = "MY", Ht = "Asia/Kuala_Lumpur", Et = {
1085
+ }, Ht = {
1086
+ countryCode: ft,
1087
+ timezone: pt,
1088
+ payRate: ht,
1089
+ overtime: vt,
1090
+ workingHours: Dt,
1091
+ recurringPublicHolidays: gt,
1092
+ publicHolidays: wt
1093
+ }, At = "MY", Et = "Asia/Kuala_Lumpur", bt = {
1078
1094
  NORMAL: {
1079
1095
  overtime: 1.5
1080
1096
  },
@@ -1086,13 +1102,13 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
1086
1102
  regular: 2,
1087
1103
  overtime: 3
1088
1104
  }
1089
- }, At = {
1105
+ }, Nt = {
1090
1106
  maxMonthlyHours: 104,
1091
1107
  afterDailyHours: null
1092
- }, bt = {
1108
+ }, kt = {
1093
1109
  standardWeeklyHours: 45,
1094
1110
  maxDailyHours: 8
1095
- }, Nt = [
1111
+ }, Ct = [
1096
1112
  {
1097
1113
  month: 1,
1098
1114
  day: 1,
@@ -1118,7 +1134,7 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
1118
1134
  day: 25,
1119
1135
  name: "Christmas Day"
1120
1136
  }
1121
- ], Ct = {
1137
+ ], Mt = {
1122
1138
  2026: {
1123
1139
  "2026-01-01": "New Year's Day",
1124
1140
  "2026-02-17": "Chinese New Year",
@@ -1156,15 +1172,15 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
1156
1172
  "2027-10-28": "Deepavali",
1157
1173
  "2027-12-25": "Christmas Day"
1158
1174
  }
1159
- }, Mt = {
1160
- countryCode: wt,
1161
- timezone: Ht,
1162
- payRate: Et,
1163
- overtime: At,
1164
- workingHours: bt,
1165
- recurringPublicHolidays: Nt,
1166
- publicHolidays: Ct
1167
- }, kt = "PK", St = "Asia/Karachi", Lt = {
1175
+ }, St = {
1176
+ countryCode: At,
1177
+ timezone: Et,
1178
+ payRate: bt,
1179
+ overtime: Nt,
1180
+ workingHours: kt,
1181
+ recurringPublicHolidays: Ct,
1182
+ publicHolidays: Mt
1183
+ }, Ot = "PK", Lt = "Asia/Karachi", Rt = {
1168
1184
  NORMAL: {
1169
1185
  overtime: 1.5
1170
1186
  },
@@ -1176,13 +1192,13 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
1176
1192
  regular: 2,
1177
1193
  overtime: 3
1178
1194
  }
1179
- }, Ot = {
1195
+ }, It = {
1180
1196
  maxMonthlyHours: null,
1181
1197
  afterDailyHours: null
1182
- }, Rt = {
1198
+ }, Tt = {
1183
1199
  standardWeeklyHours: 48,
1184
1200
  maxDailyHours: 9
1185
- }, It = [
1201
+ }, $t = [
1186
1202
  {
1187
1203
  month: 1,
1188
1204
  day: 1,
@@ -1213,7 +1229,7 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
1213
1229
  day: 25,
1214
1230
  name: "Quaid-e-Azam Day and Christmas Day"
1215
1231
  }
1216
- ], Tt = {
1232
+ ], Pt = {
1217
1233
  2026: {
1218
1234
  "2026-01-01": "New Year's Day",
1219
1235
  "2026-02-05": "Kashmir Day",
@@ -1238,15 +1254,15 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
1238
1254
  "2027-08-15": "Eid Milad-un-Nabi",
1239
1255
  "2027-12-25": "Quaid-e-Azam Day and Christmas Day"
1240
1256
  }
1241
- }, $t = {
1242
- countryCode: kt,
1243
- timezone: St,
1244
- payRate: Lt,
1245
- overtime: Ot,
1246
- workingHours: Rt,
1247
- recurringPublicHolidays: It,
1248
- publicHolidays: Tt
1249
- }, Pt = "SG", Yt = "Asia/Singapore", Bt = {
1257
+ }, Yt = {
1258
+ countryCode: Ot,
1259
+ timezone: Lt,
1260
+ payRate: Rt,
1261
+ overtime: It,
1262
+ workingHours: Tt,
1263
+ recurringPublicHolidays: $t,
1264
+ publicHolidays: Pt
1265
+ }, Bt = "SG", _t = "Asia/Singapore", xt = {
1250
1266
  NORMAL: {
1251
1267
  overtime: 1.5
1252
1268
  },
@@ -1258,13 +1274,13 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
1258
1274
  regular: 2,
1259
1275
  overtime: 1.5
1260
1276
  }
1261
- }, _t = {
1277
+ }, Ft = {
1262
1278
  maxMonthlyHours: 72,
1263
1279
  afterDailyHours: null
1264
- }, xt = {
1280
+ }, Ut = {
1265
1281
  standardWeeklyHours: 44,
1266
1282
  maxDailyHours: 12
1267
- }, Ft = [
1283
+ }, Wt = [
1268
1284
  {
1269
1285
  month: 1,
1270
1286
  day: 1,
@@ -1285,7 +1301,7 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
1285
1301
  day: 25,
1286
1302
  name: "Christmas Day"
1287
1303
  }
1288
- ], Ut = {
1304
+ ], zt = {
1289
1305
  2026: {
1290
1306
  "2026-01-01": "New Year's Day",
1291
1307
  "2026-02-17": "Chinese New Year's Day",
@@ -1316,15 +1332,15 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
1316
1332
  "2027-10-28": "Deepavali",
1317
1333
  "2027-12-25": "Christmas Day"
1318
1334
  }
1319
- }, Wt = {
1320
- countryCode: Pt,
1321
- timezone: Yt,
1322
- payRate: Bt,
1323
- overtime: _t,
1324
- workingHours: xt,
1325
- recurringPublicHolidays: Ft,
1326
- publicHolidays: Ut
1327
- }, zt = "TH", Vt = "Asia/Bangkok", Kt = {
1335
+ }, Vt = {
1336
+ countryCode: Bt,
1337
+ timezone: _t,
1338
+ payRate: xt,
1339
+ overtime: Ft,
1340
+ workingHours: Ut,
1341
+ recurringPublicHolidays: Wt,
1342
+ publicHolidays: zt
1343
+ }, Kt = "TH", Gt = "Asia/Bangkok", jt = {
1328
1344
  NORMAL: {
1329
1345
  overtime: 1.5
1330
1346
  },
@@ -1336,13 +1352,13 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
1336
1352
  regular: 2,
1337
1353
  overtime: 3
1338
1354
  }
1339
- }, Gt = {
1355
+ }, Qt = {
1340
1356
  maxMonthlyHours: 36,
1341
1357
  afterDailyHours: null
1342
- }, jt = {
1358
+ }, qt = {
1343
1359
  standardWeeklyHours: 48,
1344
1360
  maxDailyHours: 8
1345
- }, Qt = [
1361
+ }, Xt = [
1346
1362
  {
1347
1363
  month: 1,
1348
1364
  day: 1,
@@ -1388,7 +1404,7 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
1388
1404
  day: 31,
1389
1405
  name: "New Year's Eve"
1390
1406
  }
1391
- ], qt = {
1407
+ ], Jt = {
1392
1408
  2026: {
1393
1409
  "2026-01-01": "New Year's Day",
1394
1410
  "2026-03-03": "Makha Bucha Day",
@@ -1428,15 +1444,15 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
1428
1444
  "2027-12-10": "Constitution Day",
1429
1445
  "2027-12-31": "New Year's Eve"
1430
1446
  }
1431
- }, Xt = {
1432
- countryCode: zt,
1433
- timezone: Vt,
1434
- payRate: Kt,
1435
- overtime: Gt,
1436
- workingHours: jt,
1437
- recurringPublicHolidays: Qt,
1438
- publicHolidays: qt
1439
- }, Jt = "VN", Zt = "Asia/Ho_Chi_Minh", en = {
1447
+ }, Zt = {
1448
+ countryCode: Kt,
1449
+ timezone: Gt,
1450
+ payRate: jt,
1451
+ overtime: Qt,
1452
+ workingHours: qt,
1453
+ recurringPublicHolidays: Xt,
1454
+ publicHolidays: Jt
1455
+ }, en = "VN", an = "Asia/Ho_Chi_Minh", tn = {
1440
1456
  NORMAL: {
1441
1457
  overtime: 1.5
1442
1458
  },
@@ -1448,13 +1464,13 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
1448
1464
  regular: 2,
1449
1465
  overtime: 3
1450
1466
  }
1451
- }, an = {
1467
+ }, nn = {
1452
1468
  maxMonthlyHours: 40,
1453
1469
  afterDailyHours: null
1454
- }, tn = {
1470
+ }, on = {
1455
1471
  standardWeeklyHours: 48,
1456
1472
  maxDailyHours: 8
1457
- }, nn = [
1473
+ }, sn = [
1458
1474
  {
1459
1475
  month: 1,
1460
1476
  day: 1,
@@ -1475,7 +1491,7 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
1475
1491
  day: 2,
1476
1492
  name: "National Day"
1477
1493
  }
1478
- ], on = {
1494
+ ], rn = {
1479
1495
  2026: {
1480
1496
  "2026-01-01": "New Year's Day",
1481
1497
  "2026-02-16": "Tet Holiday",
@@ -1503,16 +1519,16 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
1503
1519
  "2027-09-02": "National Day",
1504
1520
  "2027-09-03": "National Day Holiday"
1505
1521
  }
1506
- }, sn = {
1507
- countryCode: Jt,
1508
- timezone: Zt,
1509
- payRate: en,
1510
- overtime: an,
1511
- workingHours: tn,
1512
- recurringPublicHolidays: nn,
1513
- publicHolidays: on
1514
- }, Te = { AE: Fa, BN: Qa, ID: nt, MO: ct, MV: gt, MY: Mt, PK: $t, SG: Wt, TH: Xt, VN: sn };
1515
- function rn(e) {
1522
+ }, ln = {
1523
+ countryCode: en,
1524
+ timezone: an,
1525
+ payRate: tn,
1526
+ overtime: nn,
1527
+ workingHours: on,
1528
+ recurringPublicHolidays: sn,
1529
+ publicHolidays: rn
1530
+ }, Te = { AE: Wa, BN: Xa, ID: st, MO: mt, MV: Ht, MY: St, PK: Yt, SG: Vt, TH: Zt, VN: ln };
1531
+ function un(e) {
1516
1532
  if (typeof e == "string") return e.toUpperCase();
1517
1533
  if (e && typeof e == "object" && "code" in e) {
1518
1534
  const a = e.code;
@@ -1520,17 +1536,17 @@ function rn(e) {
1520
1536
  }
1521
1537
  return "MY";
1522
1538
  }
1523
- function ln(e) {
1524
- return Te[rn(e)] ?? Te.MY;
1539
+ function dn(e) {
1540
+ return Te[un(e)] ?? Te.MY;
1525
1541
  }
1526
- function go(e, a) {
1527
- var o, r;
1542
+ function Ho(e, a) {
1543
+ var o, s;
1528
1544
  const t = (o = e.publicHolidays[a.slice(0, 4)]) == null ? void 0 : o[a];
1529
1545
  if (t) return t;
1530
- const n = Number(a.slice(5, 7)), s = Number(a.slice(8, 10));
1531
- return ((r = e.recurringPublicHolidays.find((i) => i.month === n && i.day === s)) == null ? void 0 : r.name) ?? null;
1546
+ const n = Number(a.slice(5, 7)), r = Number(a.slice(8, 10));
1547
+ return ((s = e.recurringPublicHolidays.find((i) => i.month === n && i.day === r)) == null ? void 0 : s.name) ?? null;
1532
1548
  }
1533
- const un = Be(), qe = "unassigned", wo = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], Ho = "All Stations", Eo = [
1549
+ const cn = Be(), qe = "unassigned", Ao = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], Eo = "All Stations", bo = [
1534
1550
  { id: qe, label: "Assigned", roles: [], system: !0 }
1535
1551
  ], $e = [
1536
1552
  "#903E1F",
@@ -1542,74 +1558,74 @@ const un = Be(), qe = "unassigned", wo = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sa
1542
1558
  "#0F5C5C",
1543
1559
  "#6E2142"
1544
1560
  ];
1545
- function dn(e) {
1561
+ function yn(e) {
1546
1562
  var a;
1547
1563
  return (a = Ve.find((t) => t.name === e)) == null ? void 0 : a.id;
1548
1564
  }
1549
- function Ao(e) {
1565
+ function No(e) {
1550
1566
  if (e)
1551
- return { positionId: dn(e), positionName: e };
1567
+ return { positionId: yn(e), positionName: e };
1552
1568
  }
1553
- const bo = [1, 1, 1, 1, 1, 1, 1];
1554
- function ee(e) {
1569
+ const ko = [1, 1, 1, 1, 1, 1, 1];
1570
+ function ae(e) {
1555
1571
  return (e + 6) % 7;
1556
1572
  }
1557
- function No(e) {
1573
+ function Co(e) {
1558
1574
  return (e + 1) % 7;
1559
1575
  }
1560
- function ne(e, a) {
1576
+ function oe(e, a) {
1561
1577
  e.splice(0, e.length, ...a);
1562
1578
  }
1563
- function cn(e, a) {
1579
+ function mn(e, a) {
1564
1580
  return _e(e, a) / 60;
1565
1581
  }
1566
- function yn(e) {
1582
+ function fn(e) {
1567
1583
  var t;
1568
1584
  const a = e.trim().split(/\s+/).filter(Boolean);
1569
1585
  return a.length ? (a[0][0] + (((t = a[1]) == null ? void 0 : t[0]) ?? "")).toUpperCase() : "??";
1570
1586
  }
1571
- const Xe = /* @__PURE__ */ new Map(), me = /* @__PURE__ */ new Map();
1572
- function Co(e) {
1587
+ const Xe = /* @__PURE__ */ new Map(), fe = /* @__PURE__ */ new Map();
1588
+ function Mo(e) {
1573
1589
  return Xe.get(e);
1574
1590
  }
1575
- function mn(e) {
1576
- const a = me.get(e);
1591
+ function pn(e) {
1592
+ const a = fe.get(e);
1577
1593
  if (a !== void 0) return a;
1578
- const t = Fe + me.size + 1;
1579
- return me.set(e, t), Xe.set(t, e), t;
1594
+ const t = Fe + fe.size + 1;
1595
+ return fe.set(e, t), Xe.set(t, e), t;
1580
1596
  }
1581
- function Mo(e) {
1597
+ function So(e) {
1582
1598
  return e.sourceId || String(e.id);
1583
1599
  }
1584
- function fn(e) {
1585
- Na.name = (e == null ? void 0 : e.outlet.name) ?? "", ne(ba, (e == null ? void 0 : e.positions.map((r) => r.name)) ?? []), ne(Ve, (e == null ? void 0 : e.positions) ?? []);
1600
+ function hn(e) {
1601
+ Na.name = (e == null ? void 0 : e.outlet.name) ?? "", oe(ba, (e == null ? void 0 : e.positions.map((s) => s.name)) ?? []), oe(Ve, (e == null ? void 0 : e.positions) ?? []);
1586
1602
  const a = (e == null ? void 0 : e.restaurantProfile.operatingHours) ?? [], t = Array.from({ length: 7 }, () => []);
1587
- for (const r of a) t[ee(r.dayOfWeek)] = r.closed ? [] : r.hours;
1588
- ne(T.dayHours, t);
1589
- const n = a.filter((r) => !r.closed).flatMap((r) => r.hours);
1590
- T.openFrom = n.length ? n.map((r) => r.start).reduce((r, i) => i < r ? i : r) : "00:00", T.openTo = n.length ? n.map((r) => r.end).reduce((r, i) => i > r ? i : r) : "24:00", ne(
1591
- T.closedWeekdays,
1592
- a.filter((r) => r.closed).map((r) => ee(r.dayOfWeek)).sort((r, i) => r - i)
1603
+ for (const s of a) t[ae(s.dayOfWeek)] = s.closed ? [] : s.hours;
1604
+ oe(I.dayHours, t);
1605
+ const n = a.filter((s) => !s.closed).flatMap((s) => s.hours);
1606
+ I.openFrom = n.length ? n.map((s) => s.start).reduce((s, i) => i < s ? i : s) : "00:00", I.openTo = n.length ? n.map((s) => s.end).reduce((s, i) => i > s ? i : s) : "24:00", oe(
1607
+ I.closedWeekdays,
1608
+ a.filter((s) => s.closed).map((s) => ae(s.dayOfWeek)).sort((s, i) => s - i)
1593
1609
  );
1594
- const s = ln(un.currentCountry.value), o = (e == null ? void 0 : e.settings.payRate) ?? s.payRate;
1595
- T.otCapHours = (e == null ? void 0 : e.settings.overtime.maxMonthlyHours) ?? s.overtime.maxMonthlyHours ?? 0, T.payRate.NORMAL.overtime = o.NORMAL.overtime, T.payRate.REST_DAY.regular = o.REST_DAY.regular, T.payRate.REST_DAY.overtime = o.REST_DAY.overtime, T.payRate.PUBLIC_HOLIDAY.regular = o.PUBLIC_HOLIDAY.regular, T.payRate.PUBLIC_HOLIDAY.overtime = o.PUBLIC_HOLIDAY.overtime;
1610
+ const r = dn(cn.currentCountry.value), o = (e == null ? void 0 : e.settings.payRate) ?? r.payRate;
1611
+ I.otCapHours = (e == null ? void 0 : e.settings.overtime.maxMonthlyHours) ?? r.overtime.maxMonthlyHours ?? 0, I.payRate.NORMAL.overtime = o.NORMAL.overtime, I.payRate.REST_DAY.regular = o.REST_DAY.regular, I.payRate.REST_DAY.overtime = o.REST_DAY.overtime, I.payRate.PUBLIC_HOLIDAY.regular = o.PUBLIC_HOLIDAY.regular, I.payRate.PUBLIC_HOLIDAY.overtime = o.PUBLIC_HOLIDAY.overtime;
1596
1612
  }
1597
- Ee(d, fn, { immediate: !0 });
1598
- function pn(e) {
1613
+ Ee(d, hn, { immediate: !0 });
1614
+ function vn(e) {
1599
1615
  return e.reduce(
1600
1616
  (a, t) => t.employmentType === "FULLTIME" ? Math.max(a, t.workingHour) : a,
1601
1617
  0
1602
1618
  );
1603
1619
  }
1604
- function hn(e, a) {
1620
+ function Dn(e, a) {
1605
1621
  if (e.wage.type === "HOURLY") return e.wage.amount;
1606
1622
  const t = e.workingHour || a;
1607
1623
  return t ? e.wage.amount / (t * (52 / 12)) : 0;
1608
1624
  }
1609
- function vn(e, a) {
1625
+ function gn(e, a) {
1610
1626
  return e.employmentType === "FULLTIME" ? 100 : !a || !e.workingHour ? 0 : Math.min(99, Math.round(e.workingHour / a * 100));
1611
1627
  }
1612
- function Dn(e) {
1628
+ function wn(e) {
1613
1629
  var a;
1614
1630
  return {
1615
1631
  start: e.startTime,
@@ -1630,10 +1646,10 @@ function Dn(e) {
1630
1646
  updatedAt: e.updatedAt
1631
1647
  };
1632
1648
  }
1633
- function gn(e) {
1649
+ function Hn(e) {
1634
1650
  return e.type === "OFF_DAY" ? "Off day" : e.leaveType === "MEDICAL" ? "Medical Leave" : e.leaveType === "EMERGENCY" ? "Emergency Leave" : e.leaveType === "UNPAID" ? "Unpaid Leave" : "Annual Leave";
1635
1651
  }
1636
- function wn(e, a) {
1652
+ function An(e, a) {
1637
1653
  if (a < e.startDate || a > e.endDate) return null;
1638
1654
  const n = e.startDate === e.endDate || a === e.startDate ? e.startPart : a === e.endDate ? e.endPart : "FULL_DAY";
1639
1655
  return {
@@ -1641,12 +1657,12 @@ function wn(e, a) {
1641
1657
  type: e.type,
1642
1658
  leaveType: e.leaveType ?? void 0,
1643
1659
  timeOff: e.status === "PENDING" ? "pending" : "approved",
1644
- reason: gn(e),
1660
+ reason: Hn(e),
1645
1661
  half: n !== "FULL_DAY",
1646
1662
  halfPart: n === "FULL_DAY" ? void 0 : n
1647
1663
  };
1648
1664
  }
1649
- function Hn(e) {
1665
+ function En(e) {
1650
1666
  return {
1651
1667
  employeeId: e._id,
1652
1668
  name: e.name,
@@ -1658,50 +1674,50 @@ function Hn(e) {
1658
1674
  availability: []
1659
1675
  };
1660
1676
  }
1661
- function En(e) {
1662
- const a = X[y.value];
1677
+ function bn(e) {
1678
+ const a = J[y.value];
1663
1679
  return !a || !e.includes(a) ? e : [a, ...e.filter((t) => t !== a)];
1664
1680
  }
1665
- function An(e) {
1681
+ function Nn(e) {
1666
1682
  var n;
1667
- const t = (ze.value[e] ?? ((n = se.value.find((s) => s._id === e)) == null ? void 0 : n.restaurantRole.map((s) => s.restaurantId)) ?? []).map((s) => X[s]).filter((s) => !!s);
1668
- return t.length ? En([...new Set(t)]) : void 0;
1683
+ const t = (ze.value[e] ?? ((n = re.value.find((r) => r._id === e)) == null ? void 0 : n.restaurantRole.map((r) => r.restaurantId)) ?? []).map((r) => J[r]).filter((r) => !!r);
1684
+ return t.length ? bn([...new Set(t)]) : void 0;
1669
1685
  }
1670
- function ko(e = []) {
1686
+ function Oo(e = []) {
1671
1687
  const a = d.value;
1672
1688
  if (!a) return [];
1673
- const t = new Map(a.employees.map((i) => [i.employeeId, i])), n = new Map(x.value.map((i) => [i.employeeId, i])), s = se.value.filter((i) => {
1689
+ const t = new Map(a.employees.map((i) => [i.employeeId, i])), n = new Map(x.value.map((i) => [i.employeeId, i])), r = re.value.filter((i) => {
1674
1690
  var m;
1675
1691
  return ((m = n.get(i._id)) == null ? void 0 : m.enabled) !== !1;
1676
- }).map((i) => t.get(i._id) ?? Hn(i)), o = pn(s), r = /* @__PURE__ */ new Map();
1692
+ }).map((i) => t.get(i._id) ?? En(i)), o = vn(r), s = /* @__PURE__ */ new Map();
1677
1693
  for (const i of a.assignments) {
1678
- const m = `${i.employeeId}|${i.date}`, f = r.get(m);
1679
- f ? f.push(i) : r.set(m, [i]);
1694
+ const m = `${i.employeeId}|${i.date}`, v = s.get(m);
1695
+ v ? v.push(i) : s.set(m, [i]);
1680
1696
  }
1681
- return s.map((i) => {
1682
- var S, P;
1683
- const m = mn(i.employeeId), f = ((S = i.primaryPosition) == null ? void 0 : S.positionName) ?? "", w = [
1684
- (P = i.primaryPosition) == null ? void 0 : P.positionName,
1685
- ...i.secondaryPositions.map((L) => L.positionName)
1686
- ].filter((L) => !!L), $ = e.map((L) => {
1687
- const A = Z(L), H = (a.timeOff ?? []).filter((E) => E.employeeId === i.employeeId).map((E) => wn(E, A)).find((E) => E !== null);
1688
- if (H) return H;
1689
- const b = (r.get(`${i.employeeId}|${A}`) ?? []).filter((E) => E.startTime && E.endTime).map((E) => Dn(E)).sort((E, ae) => E.start.localeCompare(ae.start));
1690
- return b.length ? b.length === 1 ? b[0] : b : null;
1691
- }), p = Array.from(
1697
+ return r.map((i) => {
1698
+ var $, G;
1699
+ const m = pn(i.employeeId), v = (($ = i.primaryPosition) == null ? void 0 : $.positionName) ?? "", N = [
1700
+ (G = i.primaryPosition) == null ? void 0 : G.positionName,
1701
+ ...i.secondaryPositions.map((S) => S.positionName)
1702
+ ].filter((S) => !!S), T = e.map((S) => {
1703
+ const A = ee(S), g = (a.timeOff ?? []).filter((E) => E.employeeId === i.employeeId).map((E) => An(E, A)).find((E) => E !== null);
1704
+ if (g) return g;
1705
+ const Y = (s.get(`${i.employeeId}|${A}`) ?? []).filter((E) => E.startTime && E.endTime).map((E) => wn(E)).sort((E, te) => E.start.localeCompare(te.start));
1706
+ return Y.length ? Y.length === 1 ? Y[0] : Y : null;
1707
+ }), f = i.availability.length > 0, C = Array.from(
1692
1708
  { length: 7 },
1693
- (L, A) => i.availability.some((H) => ee(H.dayOfWeek) === A)
1694
- ), M = Array.from({ length: 7 }, (L, A) => {
1695
- const H = i.availability.find((R) => ee(R.dayOfWeek) === A);
1696
- return { from: (H == null ? void 0 : H.start) ?? "", to: (H == null ? void 0 : H.end) ?? "" };
1709
+ (S, A) => f ? i.availability.some((g) => ae(g.dayOfWeek) === A) : !0
1710
+ ), L = Array.from({ length: 7 }, (S, A) => {
1711
+ const g = i.availability.find((H) => ae(H.dayOfWeek) === A);
1712
+ return { from: (g == null ? void 0 : g.start) ?? "", to: (g == null ? void 0 : g.end) ?? "" };
1697
1713
  });
1698
1714
  return {
1699
1715
  id: m,
1700
1716
  sourceId: i.employeeId,
1701
1717
  name: i.name,
1702
1718
  employmentType: i.employmentType,
1703
- role: f,
1704
- initials: yn(i.name),
1719
+ role: v,
1720
+ initials: fn(i.name),
1705
1721
  color: $e[(m - Fe - 1) % $e.length],
1706
1722
  // Gross hours actually rostered this week — the figure the cost rail multiplies by
1707
1723
  // the rate. Contracted hours are a separate question, answered by RULES.contract.
@@ -1709,71 +1725,71 @@ function ko(e = []) {
1709
1725
  // as a long, meaningless float (e.g. 31.983333333333334) everywhere this is shown
1710
1726
  // verbatim, matching the rounding `employeeLoadOf`'s own hours figure already uses.
1711
1727
  weekHours: Math.round(
1712
- $.reduce(
1713
- (L, A) => L + (Array.isArray(A) ? A : A && "start" in A ? [A] : []).reduce(
1714
- (H, R) => H + cn(R.start, R.end),
1728
+ T.reduce(
1729
+ (S, A) => S + (Array.isArray(A) ? A : A && "start" in A ? [A] : []).reduce(
1730
+ (g, H) => g + mn(H.start, H.end),
1715
1731
  0
1716
1732
  ),
1717
1733
  0
1718
1734
  ) * 10
1719
1735
  ) / 10,
1720
- pct: vn(i, o),
1736
+ pct: gn(i, o),
1721
1737
  contractHours: i.workingHour || void 0,
1722
1738
  // Every outlet the POS says this person works at, not just this one — the Add / Edit form
1723
1739
  // shows them, and saving keeps them.
1724
- locations: An(i.employeeId),
1725
- rate: hn(i, o),
1726
- positions: w,
1727
- shifts: $,
1740
+ locations: Nn(i.employeeId),
1741
+ rate: Dn(i, o),
1742
+ positions: N,
1743
+ shifts: T,
1728
1744
  // Remarks live in their own collection in the older scheduling design and are not
1729
1745
  // part of this board's payload yet.
1730
1746
  remarks: [],
1731
1747
  section: qe,
1732
1748
  payBasis: i.wage.type === "HOURLY" ? "hourly" : "monthly",
1733
1749
  payAmount: i.wage.amount,
1734
- availDays: p,
1735
- availHours: M
1750
+ availDays: C,
1751
+ availHours: L
1736
1752
  };
1737
1753
  });
1738
1754
  }
1739
- function So() {
1755
+ function Lo() {
1740
1756
  return [];
1741
1757
  }
1742
- function Lo() {
1743
- var n, s;
1758
+ function Ro() {
1759
+ var n, r;
1744
1760
  const e = d.value, a = {}, t = {};
1745
1761
  for (const o of (e == null ? void 0 : e.demands) ?? []) {
1746
- const r = o.date ? a[n = o.date] ?? (a[n] = []) : o.dayOfWeek !== null ? t[s = ee(o.dayOfWeek)] ?? (t[s] = []) : null;
1747
- if (!r) continue;
1748
- let i = r.find((m) => m.from === o.startTime && m.to === o.endTime);
1749
- i || (i = { from: o.startTime, to: o.endTime, n: 0, roles: [] }, r.push(i)), i.n += o.headcount, o.position && i.roles.push({ position: o.position.positionName, n: o.headcount });
1762
+ const s = o.date ? a[n = o.date] ?? (a[n] = []) : o.dayOfWeek !== null ? t[r = ae(o.dayOfWeek)] ?? (t[r] = []) : null;
1763
+ if (!s) continue;
1764
+ let i = s.find((m) => m.from === o.startTime && m.to === o.endTime);
1765
+ i || (i = { from: o.startTime, to: o.endTime, n: 0, roles: [] }, s.push(i)), i.n += o.headcount, o.position && i.roles.push({ position: o.position.positionName, n: o.headcount });
1750
1766
  }
1751
1767
  return { byDate: a, byWeekday: t };
1752
1768
  }
1753
- function Oo() {
1754
- const e = Be(), { restaurants: a, readRestaurants: t } = Da(), n = ha(), s = va(), o = g(!1), r = Y(
1755
- () => [...a.value].map((p) => ({ value: p._id, label: p.profile.name })).sort((p, M) => p.label.localeCompare(M.label))
1756
- ), i = Y(() => {
1757
- var p;
1758
- return ((p = e.currentRestaurant.value) == null ? void 0 : p._id) ?? "";
1769
+ function Io() {
1770
+ const e = Be(), { restaurants: a, readRestaurants: t } = Da(), n = ha(), r = va(), o = w(!1), s = P(
1771
+ () => [...a.value].map((f) => ({ value: f._id, label: f.profile.name })).sort((f, C) => f.label.localeCompare(C.label))
1772
+ ), i = P(() => {
1773
+ var f;
1774
+ return ((f = e.currentRestaurant.value) == null ? void 0 : f._id) ?? "";
1759
1775
  });
1760
- async function m(p, M) {
1761
- return Re(p) ? (n.query.restaurantId !== p && s.replace({ query: { ...n.query, restaurantId: p } }), await Promise.all([ge(p), Ia(M)]), !0) : !1;
1776
+ async function m(f, C) {
1777
+ return Re(f) ? (n.query.restaurantId !== f && r.replace({ query: { ...n.query, restaurantId: f } }), await Promise.all([we(f), Ia(C)]), !0) : !1;
1762
1778
  }
1763
- const f = (p) => !!p && r.value.some((M) => M.value === p);
1764
- async function w() {
1765
- var M;
1766
- await t(), Oe.splice(0, Oe.length, ...r.value.map((S) => S.label)), Object.keys(X).forEach((S) => delete X[S]), r.value.forEach((S) => X[S.value] = S.label);
1767
- const p = f(y.value) ? y.value : f(i.value) ? i.value : ((M = r.value[0]) == null ? void 0 : M.value) ?? "";
1768
- return p && Re(p), o.value = !0, p;
1779
+ const v = (f) => !!f && s.value.some((C) => C.value === f);
1780
+ async function N() {
1781
+ var C;
1782
+ await t(), Le.splice(0, Le.length, ...s.value.map((L) => L.label)), Object.keys(J).forEach((L) => delete J[L]), s.value.forEach((L) => J[L.value] = L.label);
1783
+ const f = v(y.value) ? y.value : v(i.value) ? i.value : ((C = s.value[0]) == null ? void 0 : C.value) ?? "";
1784
+ return f && Re(f), o.value = !0, f;
1769
1785
  }
1770
- async function $() {
1771
- const p = await w();
1772
- return p && await ge(p), p;
1786
+ async function T() {
1787
+ const f = await N();
1788
+ return f && await we(f), f;
1773
1789
  }
1774
- return { options: r, ready: o, outletId: y, resolve: $, resolveOutlet: w, switchTo: m };
1790
+ return { options: s, ready: o, outletId: y, resolve: T, resolveOutlet: N, switchTo: m };
1775
1791
  }
1776
- const bn = ["data-hierarchy", "data-size", "data-icon"], Ro = /* @__PURE__ */ Ae({
1792
+ const kn = ["data-hierarchy", "data-size", "data-icon"], To = /* @__PURE__ */ be({
1777
1793
  __name: "ScheduleButton",
1778
1794
  props: {
1779
1795
  hierarchy: { default: "primary" },
@@ -1781,7 +1797,7 @@ const bn = ["data-hierarchy", "data-size", "data-icon"], Ro = /* @__PURE__ */ Ae
1781
1797
  iconOnly: { type: Boolean, default: !1 }
1782
1798
  },
1783
1799
  setup(e) {
1784
- return (a, t) => (N(), C("button", {
1800
+ return (a, t) => (b(), k("button", {
1785
1801
  type: "button",
1786
1802
  class: "sch-button",
1787
1803
  "data-hierarchy": e.hierarchy,
@@ -1789,24 +1805,24 @@ const bn = ["data-hierarchy", "data-size", "data-icon"], Ro = /* @__PURE__ */ Ae
1789
1805
  "data-icon": e.iconOnly ? "only" : void 0
1790
1806
  }, [
1791
1807
  Ye(a.$slots, "default")
1792
- ], 8, bn));
1808
+ ], 8, kn));
1793
1809
  }
1794
- }), Nn = ["disabled", "aria-expanded"], Cn = { class: "sch" }, Mn = ["aria-multiselectable"], kn = {
1810
+ }), Cn = ["disabled", "aria-expanded"], Mn = { class: "sch" }, Sn = ["aria-multiselectable"], On = {
1795
1811
  key: 0,
1796
1812
  class: "fx-pop-head"
1797
- }, Sn = {
1813
+ }, Ln = {
1798
1814
  key: 1,
1799
1815
  class: "fx-pop-search"
1800
- }, Ln = {
1816
+ }, Rn = {
1801
1817
  key: 2,
1802
1818
  class: "fx-opt is-off"
1803
- }, On = {
1819
+ }, In = {
1804
1820
  key: 0,
1805
1821
  class: "fx-grp"
1806
- }, Rn = ["aria-selected", "onClick"], In = {
1822
+ }, Tn = ["aria-selected", "onClick"], $n = {
1807
1823
  key: 0,
1808
1824
  class: "fx-opt-text"
1809
- }, Tn = { key: 0 }, Io = /* @__PURE__ */ Ae({
1825
+ }, Pn = { key: 0 }, $o = /* @__PURE__ */ be({
1810
1826
  inheritAttrs: !1,
1811
1827
  __name: "ScheduleSelect",
1812
1828
  props: {
@@ -1822,11 +1838,11 @@ const bn = ["data-hierarchy", "data-size", "data-icon"], Ro = /* @__PURE__ */ Ae
1822
1838
  },
1823
1839
  emits: ["update:modelValue", "toggle"],
1824
1840
  setup(e, { emit: a }) {
1825
- const t = e, n = a, s = sa(), o = Y(() => s.class ?? ""), r = g(!1), i = g(!1), m = g(null), f = g(null), w = g(null), $ = Y(() => t.teleport !== !1 && i.value);
1826
- we(() => {
1841
+ const t = e, n = a, r = ia(), o = P(() => r.class ?? ""), s = w(!1), i = w(!1), m = w(null), v = w(null), N = w(null), T = P(() => t.teleport !== !1 && i.value);
1842
+ He(() => {
1827
1843
  i.value = typeof document < "u" && !!document.body;
1828
1844
  });
1829
- const p = Y(() => {
1845
+ const f = P(() => {
1830
1846
  var l, c;
1831
1847
  if (t.multiple) {
1832
1848
  const u = ((l = t.selected) == null ? void 0 : l.length) ?? 0;
@@ -1834,80 +1850,80 @@ const bn = ["data-hierarchy", "data-size", "data-icon"], Ro = /* @__PURE__ */ Ae
1834
1850
  }
1835
1851
  return ((c = t.options.find((u) => u.value === t.modelValue)) == null ? void 0 : c.label) ?? "";
1836
1852
  });
1837
- function M(l) {
1853
+ function C(l) {
1838
1854
  var c;
1839
1855
  return t.multiple ? !!((c = t.selected) != null && c.includes(l.value)) : l.value === t.modelValue;
1840
1856
  }
1841
- const S = Y(() => !!t.menuTitle || t.options.some((l) => l.hint)), P = g(""), L = g(null), A = Y(() => {
1842
- const l = P.value.trim().toLowerCase();
1857
+ const L = P(() => !!t.menuTitle || t.options.some((l) => l.hint)), $ = w(""), G = w(null), S = P(() => {
1858
+ const l = $.value.trim().toLowerCase();
1843
1859
  return !t.searchable || !l ? t.options : t.options.filter((c) => `${c.label} ${c.hint ?? ""}`.toLowerCase().includes(l));
1844
- }), H = Y(() => {
1860
+ }), A = P(() => {
1845
1861
  const l = [];
1846
1862
  let c;
1847
- for (const u of A.value)
1863
+ for (const u of S.value)
1848
1864
  u.group !== c && (c = u.group, c && l.push({ heading: c })), l.push({ option: u });
1849
1865
  return l;
1850
- }), R = 5, b = 8;
1851
- function E() {
1852
- const l = w.value, c = f.value;
1866
+ }), g = 5, H = 8;
1867
+ function Y() {
1868
+ const l = N.value, c = v.value;
1853
1869
  if (!l || !c) return;
1854
- const u = c.getBoundingClientRect(), k = window.innerWidth || document.documentElement.clientWidth, I = window.innerHeight || document.documentElement.clientHeight;
1855
- l.style.minWidth = `${Math.round(u.width)}px`, l.style.maxWidth = `${Math.max(180, Math.round(k - b * 2))}px`;
1856
- const G = I - u.bottom - R - b, na = u.top - R - b;
1857
- l.style.maxHeight = `${Math.max(120, Math.min(320, Math.max(G, na)))}px`;
1858
- const te = l.offsetHeight, oa = l.offsetWidth;
1859
- let ue = u.bottom + R;
1860
- ue + te > I - b && (ue = u.top - R - te >= b ? u.top - R - te : Math.max(b, I - te - b));
1861
- const ia = Math.min(Math.max(b, u.left), Math.max(b, k - oa - b));
1862
- l.style.top = `${Math.round(ue)}px`, l.style.left = `${Math.round(ia)}px`, l.style.visibility = "visible";
1870
+ const u = c.getBoundingClientRect(), M = window.innerWidth || document.documentElement.clientWidth, R = window.innerHeight || document.documentElement.clientHeight;
1871
+ l.style.minWidth = `${Math.round(u.width)}px`, l.style.maxWidth = `${Math.max(180, Math.round(M - H * 2))}px`;
1872
+ const j = R - u.bottom - g - H, na = u.top - g - H;
1873
+ l.style.maxHeight = `${Math.max(120, Math.min(320, Math.max(j, na)))}px`;
1874
+ const ne = l.offsetHeight, oa = l.offsetWidth;
1875
+ let de = u.bottom + g;
1876
+ de + ne > R - H && (de = u.top - g - ne >= H ? u.top - g - ne : Math.max(H, R - ne - H));
1877
+ const sa = Math.min(Math.max(H, u.left), Math.max(H, M - oa - H));
1878
+ l.style.top = `${Math.round(de)}px`, l.style.left = `${Math.round(sa)}px`, l.style.visibility = "visible";
1863
1879
  }
1864
- function ae(l) {
1865
- var u, k;
1880
+ function E(l) {
1881
+ var u, M;
1866
1882
  const c = l.target;
1867
- c && ((u = m.value) != null && u.contains(c) || (k = w.value) != null && k.contains(c)) || B();
1883
+ c && ((u = m.value) != null && u.contains(c) || (M = N.value) != null && M.contains(c)) || B();
1868
1884
  }
1869
- function be(l) {
1870
- const c = w.value, u = l.target;
1885
+ function te(l) {
1886
+ const c = N.value, u = l.target;
1871
1887
  if (c && u && u !== document && c.contains(u)) return;
1872
- const k = f.value;
1873
- if (!k) return;
1874
- const I = k.getBoundingClientRect(), G = window.innerHeight || document.documentElement.clientHeight;
1875
- if (I.bottom < 0 || I.top > G) {
1888
+ const M = v.value;
1889
+ if (!M) return;
1890
+ const R = M.getBoundingClientRect(), j = window.innerHeight || document.documentElement.clientHeight;
1891
+ if (R.bottom < 0 || R.top > j) {
1876
1892
  B();
1877
1893
  return;
1878
1894
  }
1879
- E();
1895
+ Y();
1880
1896
  }
1881
1897
  function Je() {
1882
- document.addEventListener("click", ae), document.addEventListener("scroll", be, !0), window.addEventListener("resize", B);
1898
+ document.addEventListener("click", E), document.addEventListener("scroll", te, !0), window.addEventListener("resize", B);
1883
1899
  }
1884
1900
  function Ne() {
1885
- document.removeEventListener("click", ae), document.removeEventListener("scroll", be, !0), window.removeEventListener("resize", B);
1901
+ document.removeEventListener("click", E), document.removeEventListener("scroll", te, !0), window.removeEventListener("resize", B);
1886
1902
  }
1887
- async function le() {
1903
+ async function ue() {
1888
1904
  var l, c, u;
1889
- t.disabled || r.value || (P.value = "", r.value = !0, await fe(), E(), (l = L.value) == null || l.focus(), (u = (c = w.value) == null ? void 0 : c.querySelector(".fx-opt.is-on")) == null || u.scrollIntoView({ block: "nearest" }), Je());
1905
+ t.disabled || s.value || ($.value = "", s.value = !0, await pe(), Y(), (l = G.value) == null || l.focus(), (u = (c = N.value) == null ? void 0 : c.querySelector(".fx-opt.is-on")) == null || u.scrollIntoView({ block: "nearest" }), Je());
1890
1906
  }
1891
1907
  function B() {
1892
- r.value && (r.value = !1, P.value = "", Ne());
1908
+ s.value && (s.value = !1, $.value = "", Ne());
1893
1909
  }
1894
- Ee(P, async () => {
1895
- r.value && (await fe(), E());
1910
+ Ee($, async () => {
1911
+ s.value && (await pe(), Y());
1896
1912
  });
1897
1913
  function Ze(l) {
1898
1914
  var c;
1899
1915
  if (l.key === "Escape")
1900
- l.preventDefault(), B(), (c = f.value) == null || c.focus();
1916
+ l.preventDefault(), B(), (c = v.value) == null || c.focus();
1901
1917
  else if (l.key === "Enter") {
1902
1918
  l.preventDefault();
1903
- const u = A.value.find((k) => !k.disabled);
1904
- u && Me(u);
1919
+ const u = S.value.find((M) => !M.disabled);
1920
+ u && Ce(u);
1905
1921
  }
1906
1922
  }
1907
- function Ce() {
1908
- r.value ? B() : le();
1923
+ function ke() {
1924
+ s.value ? B() : ue();
1909
1925
  }
1910
- function Me(l) {
1926
+ function Ce(l) {
1911
1927
  if (!l.disabled) {
1912
1928
  if (t.multiple && !l.command) {
1913
1929
  n("toggle", l.value);
@@ -1920,66 +1936,66 @@ const bn = ["data-hierarchy", "data-size", "data-icon"], Ro = /* @__PURE__ */ Ae
1920
1936
  l.value !== t.modelValue && n("update:modelValue", l.value);
1921
1937
  }
1922
1938
  }
1923
- const ea = Y(() => t.options.filter((l) => !l.disabled));
1939
+ const ea = P(() => t.options.filter((l) => !l.disabled));
1924
1940
  function aa(l) {
1925
1941
  const c = ea.value;
1926
1942
  if (t.multiple || !c.length) {
1927
- le();
1943
+ ue();
1928
1944
  return;
1929
1945
  }
1930
- const u = c.findIndex((G) => G.value === t.modelValue), k = l === "Home" ? 0 : l === "End" ? c.length - 1 : l === "ArrowDown" ? Math.min(c.length - 1, (u < 0 ? -1 : u) + 1) : Math.max(0, (u < 0 ? 1 : u) - 1), I = c[k];
1931
- I && I.value !== t.modelValue ? n("update:modelValue", I.value) : le();
1946
+ const u = c.findIndex((j) => j.value === t.modelValue), M = l === "Home" ? 0 : l === "End" ? c.length - 1 : l === "ArrowDown" ? Math.min(c.length - 1, (u < 0 ? -1 : u) + 1) : Math.max(0, (u < 0 ? 1 : u) - 1), R = c[M];
1947
+ R && R.value !== t.modelValue ? n("update:modelValue", R.value) : ue();
1932
1948
  }
1933
1949
  function ta(l) {
1934
1950
  var c;
1935
1951
  if (l.key === "Escape") {
1936
- if (!r.value) return;
1937
- l.preventDefault(), B(), (c = f.value) == null || c.focus();
1952
+ if (!s.value) return;
1953
+ l.preventDefault(), B(), (c = v.value) == null || c.focus();
1938
1954
  return;
1939
1955
  }
1940
1956
  if (l.key === "Enter" || l.key === " ") {
1941
- l.preventDefault(), Ce();
1957
+ l.preventDefault(), ke();
1942
1958
  return;
1943
1959
  }
1944
1960
  l.key !== "ArrowDown" && l.key !== "ArrowUp" && l.key !== "Home" && l.key !== "End" || (l.preventDefault(), aa(l.key));
1945
1961
  }
1946
- return He(Ne), (l, c) => (N(), C("div", {
1962
+ return Ae(Ne), (l, c) => (b(), k("div", {
1947
1963
  ref_key: "rootEl",
1948
1964
  ref: m,
1949
- class: oe(["fx-sel", o.value])
1965
+ class: se(["fx-sel", o.value])
1950
1966
  }, [
1951
1967
  _("button", la({
1952
1968
  ref_key: "btnEl",
1953
- ref: f
1969
+ ref: v
1954
1970
  }, l.$attrs, {
1955
1971
  type: "button",
1956
- class: ["sch-input fx-btn", { "is-open": r.value }],
1972
+ class: ["sch-input fx-btn", { "is-open": s.value }],
1957
1973
  disabled: e.disabled,
1958
1974
  "aria-haspopup": "listbox",
1959
- "aria-expanded": r.value,
1960
- onClick: c[0] || (c[0] = (u) => Ce()),
1975
+ "aria-expanded": s.value,
1976
+ onClick: c[0] || (c[0] = (u) => ke()),
1961
1977
  onKeydown: ta
1962
- }), F(p.value), 17, Nn),
1963
- (N(), ra(ua, {
1978
+ }), F(f.value), 17, Cn),
1979
+ (b(), ra(ua, {
1964
1980
  to: "body",
1965
- disabled: !$.value
1981
+ disabled: !T.value
1966
1982
  }, [
1967
- _("div", Cn, [
1968
- r.value ? (N(), C("div", {
1983
+ _("div", Mn, [
1984
+ s.value ? (b(), k("div", {
1969
1985
  key: 0,
1970
1986
  ref_key: "popEl",
1971
- ref: w,
1972
- class: oe(["fx-pop", { "fx-pop-rich": S.value }]),
1987
+ ref: N,
1988
+ class: se(["fx-pop", { "fx-pop-rich": L.value }]),
1973
1989
  role: "listbox",
1974
1990
  "aria-multiselectable": e.multiple || void 0,
1975
1991
  style: { visibility: "hidden" }
1976
1992
  }, [
1977
- e.menuTitle ? (N(), C("div", kn, F(e.menuTitle), 1)) : U("", !0),
1978
- e.searchable ? (N(), C("div", Sn, [
1993
+ e.menuTitle ? (b(), k("div", On, F(e.menuTitle), 1)) : U("", !0),
1994
+ e.searchable ? (b(), k("div", Ln, [
1979
1995
  da(_("input", {
1980
1996
  ref_key: "searchEl",
1981
- ref: L,
1982
- "onUpdate:modelValue": c[1] || (c[1] = (u) => P.value = u),
1997
+ ref: G,
1998
+ "onUpdate:modelValue": c[1] || (c[1] = (u) => $.value = u),
1983
1999
  class: "sch-input fx-pop-q",
1984
2000
  type: "search",
1985
2001
  placeholder: "Search",
@@ -1988,23 +2004,23 @@ const bn = ["data-hierarchy", "data-size", "data-icon"], Ro = /* @__PURE__ */ Ae
1988
2004
  "aria-label": "Search",
1989
2005
  onKeydown: Ze
1990
2006
  }, null, 544), [
1991
- [ca, P.value]
2007
+ [ca, $.value]
1992
2008
  ])
1993
2009
  ])) : U("", !0),
1994
- e.searchable && !H.value.length ? (N(), C("div", Ln, "No matches")) : U("", !0),
1995
- (N(!0), C(ce, null, ya(H.value, (u) => (N(), C(ce, {
2010
+ e.searchable && !A.value.length ? (b(), k("div", Rn, "No matches")) : U("", !0),
2011
+ (b(!0), k(ye, null, ya(A.value, (u) => (b(), k(ye, {
1996
2012
  key: "heading" in u ? `heading:${u.heading}` : `option:${u.option.value}`
1997
2013
  }, [
1998
- "heading" in u ? (N(), C("div", On, F(u.heading), 1)) : (N(), C("div", {
2014
+ "heading" in u ? (b(), k("div", In, F(u.heading), 1)) : (b(), k("div", {
1999
2015
  key: 1,
2000
- class: oe(["fx-opt", {
2001
- "is-on": M(u.option),
2016
+ class: se(["fx-opt", {
2017
+ "is-on": C(u.option),
2002
2018
  "is-off": u.option.disabled,
2003
2019
  "is-new": u.option.command
2004
2020
  }]),
2005
2021
  role: "option",
2006
- "aria-selected": M(u.option),
2007
- onClick: (k) => Me(u.option)
2022
+ "aria-selected": C(u.option),
2023
+ onClick: (M) => Ce(u.option)
2008
2024
  }, [
2009
2025
  c[2] || (c[2] = _("span", {
2010
2026
  class: "fx-tick",
@@ -2025,20 +2041,20 @@ const bn = ["data-hierarchy", "data-size", "data-icon"], Ro = /* @__PURE__ */ Ae
2025
2041
  })
2026
2042
  ])
2027
2043
  ], -1)),
2028
- S.value ? (N(), C("span", In, [
2044
+ L.value ? (b(), k("span", $n, [
2029
2045
  _("b", null, F(u.option.label), 1),
2030
- u.option.hint ? (N(), C("small", Tn, F(u.option.hint), 1)) : U("", !0)
2031
- ])) : (N(), C(ce, { key: 1 }, [
2046
+ u.option.hint ? (b(), k("small", Pn, F(u.option.hint), 1)) : U("", !0)
2047
+ ])) : (b(), k(ye, { key: 1 }, [
2032
2048
  ma(F(u.option.label), 1)
2033
2049
  ], 64))
2034
- ], 10, Rn))
2050
+ ], 10, Tn))
2035
2051
  ], 64))), 128))
2036
- ], 10, Mn)) : U("", !0)
2052
+ ], 10, Sn)) : U("", !0)
2037
2053
  ])
2038
2054
  ], 8, ["disabled"]))
2039
2055
  ], 2));
2040
2056
  }
2041
- }), $n = ["id", "aria-labelledby", "aria-label"], Pe = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])', To = /* @__PURE__ */ Ae({
2057
+ }), Yn = ["id", "aria-labelledby", "aria-label"], Pe = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])', Po = /* @__PURE__ */ be({
2042
2058
  __name: "ScheduleModal",
2043
2059
  props: {
2044
2060
  open: { type: Boolean },
@@ -2050,11 +2066,11 @@ const bn = ["data-hierarchy", "data-size", "data-icon"], Ro = /* @__PURE__ */ Ae
2050
2066
  },
2051
2067
  emits: ["close"],
2052
2068
  setup(e, { emit: a }) {
2053
- const t = e, n = a, s = g(null);
2069
+ const t = e, n = a, r = w(null);
2054
2070
  let o = null;
2055
- function r() {
2056
- fe(() => {
2057
- const m = s.value;
2071
+ function s() {
2072
+ pe(() => {
2073
+ const m = r.value;
2058
2074
  m && (m.querySelector(Pe) ?? m).focus();
2059
2075
  });
2060
2076
  }
@@ -2064,30 +2080,30 @@ const bn = ["data-hierarchy", "data-size", "data-icon"], Ro = /* @__PURE__ */ Ae
2064
2080
  m.preventDefault(), n("close");
2065
2081
  return;
2066
2082
  }
2067
- if (m.key !== "Tab" || !s.value) return;
2068
- const f = Array.from(s.value.querySelectorAll(Pe));
2069
- if (!f.length) return;
2070
- const w = f[0], $ = f[f.length - 1];
2071
- m.shiftKey && document.activeElement === w ? (m.preventDefault(), $.focus()) : !m.shiftKey && document.activeElement === $ && (m.preventDefault(), w.focus());
2083
+ if (m.key !== "Tab" || !r.value) return;
2084
+ const v = Array.from(r.value.querySelectorAll(Pe));
2085
+ if (!v.length) return;
2086
+ const N = v[0], T = v[v.length - 1];
2087
+ m.shiftKey && document.activeElement === N ? (m.preventDefault(), T.focus()) : !m.shiftKey && document.activeElement === T && (m.preventDefault(), N.focus());
2072
2088
  }
2073
2089
  return Ee(
2074
2090
  () => t.open,
2075
2091
  (m) => {
2076
- m ? (o = document.activeElement instanceof HTMLElement ? document.activeElement : null, r()) : (o == null || o.focus(), o = null);
2092
+ m ? (o = document.activeElement instanceof HTMLElement ? document.activeElement : null, s()) : (o == null || o.focus(), o = null);
2077
2093
  },
2078
2094
  { immediate: !0 }
2079
- ), we(() => document.addEventListener("keydown", i)), He(() => {
2095
+ ), He(() => document.addEventListener("keydown", i)), Ae(() => {
2080
2096
  document.removeEventListener("keydown", i), o = null;
2081
- }), (m, f) => e.open ? (N(), C("div", {
2097
+ }), (m, v) => e.open ? (b(), k("div", {
2082
2098
  key: 0,
2083
2099
  class: "modal-overlay open",
2084
- onClick: f[0] || (f[0] = fa((w) => n("close"), ["self"]))
2100
+ onClick: v[0] || (v[0] = fa((N) => n("close"), ["self"]))
2085
2101
  }, [
2086
2102
  _("div", {
2087
2103
  id: e.id,
2088
2104
  ref_key: "panel",
2089
- ref: s,
2090
- class: oe(["schedule-modal-panel", e.panelClass]),
2105
+ ref: r,
2106
+ class: se(["schedule-modal-panel", e.panelClass]),
2091
2107
  style: pa(e.panelStyle),
2092
2108
  role: "dialog",
2093
2109
  "aria-modal": "true",
@@ -2096,93 +2112,94 @@ const bn = ["data-hierarchy", "data-size", "data-icon"], Ro = /* @__PURE__ */ Ae
2096
2112
  tabindex: "-1"
2097
2113
  }, [
2098
2114
  Ye(m.$slots, "default")
2099
- ], 14, $n)
2115
+ ], 14, Yn)
2100
2116
  ])) : U("", !0);
2101
2117
  }
2102
2118
  });
2103
2119
  export {
2104
- ao as $,
2105
- Ho as A,
2106
- Ea as B,
2107
- Gn as C,
2108
- Qn as D,
2109
- to as E,
2120
+ no as $,
2121
+ Eo as A,
2122
+ Aa as B,
2123
+ Qn as C,
2124
+ Xn as D,
2125
+ oo as E,
2110
2126
  wa as F,
2111
- vo as G,
2112
- ho as H,
2113
- po as I,
2127
+ go as G,
2128
+ Do as H,
2129
+ vo as I,
2114
2130
  We as J,
2115
2131
  D as K,
2116
2132
  x as L,
2117
2133
  Sa as M,
2118
- Oe as N,
2119
- No as O,
2134
+ Le as N,
2135
+ Co as O,
2120
2136
  ba as P,
2121
- jn as Q,
2122
- Kn as R,
2123
- Eo as S,
2124
- ee as T,
2137
+ qn as Q,
2138
+ jn as R,
2139
+ bo as S,
2140
+ ae as T,
2125
2141
  qe as U,
2126
- En as V,
2127
- wo as W,
2142
+ bn as V,
2143
+ Ao as W,
2128
2144
  je as X,
2129
- X as Y,
2130
- Jn as Z,
2131
- Zn as _,
2132
- ko as a,
2145
+ J as Y,
2146
+ eo as Z,
2147
+ ao as _,
2148
+ Oo as a,
2133
2149
  Ke as a0,
2134
- mn as a1,
2135
- Z as a2,
2136
- yo as a3,
2137
- uo as a4,
2138
- co as a5,
2139
- bo as a6,
2150
+ pn as a1,
2151
+ ee as a2,
2152
+ fo as a3,
2153
+ yo as a4,
2154
+ mo as a5,
2155
+ ko as a6,
2140
2156
  Ia as a7,
2141
- lo as a8,
2157
+ co as a8,
2142
2158
  Na as a9,
2143
2159
  Ha as aa,
2144
- Un as ab,
2145
- ro as ac,
2146
- dn as ad,
2147
- Se as ae,
2148
- Le as af,
2149
- ie as ag,
2150
- ge as ah,
2151
- Lo as ai,
2152
- La as aj,
2153
- Ro as ak,
2154
- Io as al,
2155
- To as am,
2156
- Fn as an,
2157
- Oo as ao,
2158
- Ve as ap,
2159
- io as aq,
2160
- no as ar,
2161
- se as as,
2162
- oo as at,
2163
- T as b,
2164
- So as c,
2160
+ zn as ab,
2161
+ $a as ac,
2162
+ uo as ad,
2163
+ yn as ae,
2164
+ Se as af,
2165
+ Oe as ag,
2166
+ ie as ah,
2167
+ we as ai,
2168
+ Ro as aj,
2169
+ Oa as ak,
2170
+ To as al,
2171
+ $o as am,
2172
+ Po as an,
2173
+ Wn as ao,
2174
+ Io as ap,
2175
+ Ve as aq,
2176
+ ro as ar,
2177
+ so as as,
2178
+ re as at,
2179
+ io as au,
2180
+ I as b,
2181
+ Lo as c,
2165
2182
  z as d,
2166
- zn as e,
2183
+ Kn as e,
2167
2184
  d as f,
2168
- ln as g,
2169
- go as h,
2170
- Ma as i,
2171
- Co as j,
2172
- mo as k,
2173
- fo as l,
2174
- Do as m,
2175
- De as n,
2185
+ dn as g,
2186
+ Ho as h,
2187
+ Ca as i,
2188
+ Mo as j,
2189
+ po as k,
2190
+ ho as l,
2191
+ wo as m,
2192
+ ge as n,
2176
2193
  y as o,
2177
- Ao as p,
2178
- Xn as q,
2179
- eo as r,
2180
- so as s,
2181
- ve as t,
2182
- Vn as u,
2183
- Mo as v,
2184
- qn as w,
2185
- Wn as x,
2194
+ No as p,
2195
+ Zn as q,
2196
+ to as r,
2197
+ lo as s,
2198
+ De as t,
2199
+ Gn as u,
2200
+ So as v,
2201
+ Jn as w,
2202
+ Vn as x,
2186
2203
  _e as y,
2187
- he as z
2204
+ ve as z
2188
2205
  };