@feedmepos/mf-hrm-portal 2.3.0-dev.10 → 2.3.0-dev.11

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 (49) hide show
  1. package/dist/{ApprovalCodeList-BLA2rhLB.js → ApprovalCodeList-Ce9BWzt9.js} +2 -2
  2. package/dist/{AuditLogList-DBYdZhZl.js → AuditLogList-Cw7WN8K4.js} +3 -3
  3. package/dist/{ConditionBuilderForm.vue_vue_type_script_setup_true_lang-CtCEzPbE.js → ConditionBuilderForm.vue_vue_type_script_setup_true_lang-BuofBFPC.js} +2 -2
  4. package/dist/{EmployeeList-CA7DWLmy.js → EmployeeList-B8qWPNvj.js} +23 -22
  5. package/dist/{GrantUserList-BYnegeEr.js → GrantUserList-CgigJIPF.js} +3 -3
  6. package/dist/{Main-BeXx0hAc.js → Main-BfoVdxlY.js} +5 -5
  7. package/dist/{Main-Dh-gZSaa.js → Main-Cg2vC_cj.js} +2 -2
  8. package/dist/{Main-NDK7LUmm.js → Main-D26pgKy1.js} +9 -9
  9. package/dist/{PermissionSetList-DDIacDpQ.js → PermissionSetList-CbtDiF4k.js} +17 -16
  10. package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-ONMn3v_f.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-DW1oBTbb.js} +680 -680
  11. package/dist/ResponsiveContextMenu.vue_vue_type_script_setup_true_lang-mSJFKo7r.js +132 -0
  12. package/dist/{RoleList-B30FHIzu.js → RoleList-D0I8mbyI.js} +19 -18
  13. package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-CRRguWTG.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-Ctwukt6o.js} +1 -1
  14. package/dist/{ScheduleGeneralPage-8gEeZbFR.js → ScheduleGeneralPage-Kv4pnxCL.js} +130 -128
  15. package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-TfxTAjO8.js → ScheduleModal.vue_vue_type_script_setup_true_lang-CSA0aaqJ.js} +545 -512
  16. package/dist/SchedulePage-BMWd0bod.js +17942 -0
  17. package/dist/{SchedulePositionPage-oGIDGneA.js → SchedulePositionPage-5Xvx6Dk5.js} +3 -3
  18. package/dist/{TeamMemberList-Drj6R4Y3.js → TeamMemberList-Bh7i5l16.js} +20 -19
  19. package/dist/{TimesheetList-CDQfN5LE.js → TimesheetList-BJKU-hnk.js} +5 -5
  20. package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-Bx-6hjs7.js → TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-MMWnb9bj.js} +2 -2
  21. package/dist/{app-DWe_4-ct.js → app-BDJ5qxhF.js} +8 -8
  22. package/dist/app.js +1 -1
  23. package/dist/{dayjs.min-QSwC9dtX.js → dayjs.min-BWM0vY4w.js} +1 -1
  24. package/dist/{employee-Bb2b3dP6.js → employee-bBSuAJUr.js} +3 -3
  25. package/dist/{iteration-TDU7bFxZ.js → iteration-Dg7VAkAn.js} +1 -1
  26. package/dist/{lodash-D3Ns5VMN.js → lodash-BknY3p4o.js} +1 -1
  27. package/dist/{role-D57Le_-U.js → role-BJnJnNd_.js} +1 -1
  28. package/dist/{rule-DzesUEX7.js → rule-BEuOY7Wf.js} +2 -2
  29. package/dist/src/composables/useDiscardConfirm.d.ts +3 -1
  30. package/dist/src/views/scheduling/components/ScheduleConfirmModal.vue.d.ts +2 -1
  31. package/dist/src/views/scheduling/composables/useScheduleAddEmployee.d.ts +1 -0
  32. package/dist/src/views/scheduling/composables/useScheduleAutoSchedule.d.ts +0 -3
  33. package/dist/src/views/scheduling/composables/useScheduleBoard.d.ts +2 -0
  34. package/dist/src/views/scheduling/composables/useScheduleDemandSheet.d.ts +7 -0
  35. package/dist/src/views/scheduling/composables/useScheduleEmployeeCandidates.d.ts +2 -2
  36. package/dist/src/views/scheduling/composables/useScheduleOnboardingEmployees.d.ts +1 -0
  37. package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +7 -0
  38. package/dist/src/views/scheduling/composables/useScheduleRoster.d.ts +2 -0
  39. package/dist/src/views/scheduling/composables/useScheduleShiftActions.d.ts +1 -0
  40. package/dist/src/views/scheduling/composables/useScheduleShiftPopover.d.ts +6 -1
  41. package/dist/src/views/scheduling/schedule-store.d.ts +13 -0
  42. package/dist/src/views/scheduling/types.d.ts +2 -0
  43. package/dist/style.css +1 -1
  44. package/dist/tsconfig.app.tsbuildinfo +1 -1
  45. package/dist/useDiscardConfirm-CzZSPyvh.js +28 -0
  46. package/dist/{useReportPermissions-Cmuead1K.js → useReportPermissions-D8hJ5W0t.js} +3 -3
  47. package/package.json +1 -1
  48. package/dist/SchedulePage-DQ0VXWWi.js +0 -17832
  49. package/dist/useDiscardConfirm-DPhEV6v0.js +0 -157
@@ -1,8 +1,8 @@
1
- import { onMounted as Ce, onBeforeUnmount as Me, ref as w, reactive as R, shallowRef as De, watch as Se, computed as $, defineComponent as Le, createElementBlock as C, openBlock as P, renderSlot as We, useAttrs as ra, nextTick as Ae, normalizeClass as ye, createElementVNode as B, createBlock as la, mergeProps as ua, toDisplayString as U, Teleport as da, createCommentVNode as W, withDirectives as ca, vModelText as ya, Fragment as ge, renderList as ma, createTextVNode as pa, withModifiers as fa, normalizeStyle as ha } from "vue";
2
- import { useRoute as va, useRouter as Da } from "vue-router";
3
- import { useCoreStore as ze } from "@feedmepos/mf-common";
4
- import { g as h, b as f, u as ga } from "./restaurant-BbYRA_IT.js";
5
- import { E as Ee, u as Ha } from "./employee-Bb2b3dP6.js";
1
+ import { onMounted as Se, onBeforeUnmount as Le, ref as A, reactive as I, shallowRef as we, watch as Ie, computed as T, defineComponent as Re, createElementBlock as C, openBlock as N, renderSlot as ze, useAttrs as la, nextTick as be, normalizeClass as pe, createElementVNode as Y, createBlock as ua, mergeProps as da, toDisplayString as U, Teleport as ca, createCommentVNode as W, withDirectives as ya, vModelText as ma, Fragment as He, renderList as pa, createTextVNode as fa, withModifiers as ha, normalizeStyle as va } from "vue";
2
+ import { useRoute as Da, useRouter as ga } from "vue-router";
3
+ import { useCoreStore as Ve } from "@feedmepos/mf-common";
4
+ import { g as v, b as p, u as wa } from "./restaurant-BbYRA_IT.js";
5
+ import { E as Pe, u as Ke } from "./employee-bBSuAJUr.js";
6
6
  function zn(e) {
7
7
  let a = null;
8
8
  function t() {
@@ -11,104 +11,104 @@ function zn(e) {
11
11
  const n = a.getBoundingClientRect().top;
12
12
  a.style.height = `${Math.max(0, window.innerHeight - n)}px`;
13
13
  }
14
- Ce(() => {
14
+ Se(() => {
15
15
  var n;
16
16
  a = ((n = e.value) == null ? void 0 : n.closest(".sch-page")) ?? null, t(), window.addEventListener("resize", t);
17
- }), Me(() => {
17
+ }), Le(() => {
18
18
  window.removeEventListener("resize", t), a && (a.style.height = "");
19
19
  });
20
20
  }
21
- function be(e) {
21
+ function Ne(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
  }
25
- function wa(e) {
25
+ function Ha(e) {
26
26
  const a = Math.max(0, Math.min(1439, Math.round(e)));
27
27
  return `${String(Math.floor(a / 60)).padStart(2, "0")}:${String(a % 60).padStart(2, "0")}`;
28
28
  }
29
29
  function Aa(e, a) {
30
- const t = be(e);
31
- let n = be(a);
30
+ const t = Ne(e);
31
+ let n = Ne(a);
32
32
  return n <= t && (n += 1440), [t, n];
33
33
  }
34
- function Ve(e, a) {
34
+ function Ge(e, a) {
35
35
  const [t, n] = Aa(e, a);
36
36
  return Math.max(0, n - t);
37
37
  }
38
38
  function Ea(e) {
39
- const a = (be(e) % 1440 + 1440) % 1440, t = Math.floor(a / 60), n = a % 60, i = t < 12 ? "am" : "pm", s = t % 12 || 12;
39
+ const a = (Ne(e) % 1440 + 1440) % 1440, t = Math.floor(a / 60), n = a % 60, i = t < 12 ? "am" : "pm", s = t % 12 || 12;
40
40
  return n ? `${s}:${String(n).padStart(2, "0")}${i}` : `${s}${i}`;
41
41
  }
42
42
  function Vn(e) {
43
- return Ea(wa(e % 1440));
43
+ return Ea(Ha(e % 1440));
44
44
  }
45
- function Ke(e) {
45
+ function je(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
49
  const [i, s] = n.startTime.split(":").map(Number), [l, o] = n.endTime.split(":").map(Number);
50
- let m = l * 60 + o - (i * 60 + s);
51
- return m < 0 && (m += 24 * 60), t + m;
50
+ let u = l * 60 + o - (i * 60 + s);
51
+ return u < 0 && (u += 24 * 60), t + u;
52
52
  }, 0) : Math.max(0, e && !Array.isArray(e) ? e.breakMins ?? 0 : 0);
53
53
  }
54
54
  function Kn(e, a) {
55
55
  var i;
56
- const t = a ?? Ve(e.start, e.end), n = (i = e.breaks) != null && i.length ? e.breaks.reduce((s, l) => s + (l.breakPayType === "UNPAID" ? Ke([l]) : 0), 0) : Math.max(0, e.breakMins ?? 0);
56
+ const t = a ?? Ge(e.start, e.end), n = (i = e.breaks) != null && i.length ? e.breaks.reduce((s, l) => s + (l.breakPayType === "UNPAID" ? je([l]) : 0), 0) : Math.max(0, e.breakMins ?? 0);
57
57
  return Math.max(0, t - Math.min(t, n));
58
58
  }
59
59
  function Gn(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 ae = 500, ba = 10, Oe = 6, jn = 1500, Ge = 1e6, D = {
63
+ const ae = 500, ba = 10, Te = 6, jn = 1500, Qe = 1e6, w = {
64
64
  async listEmployeeProfiles(e) {
65
- return h(
66
- await f("schedules").get("employees", {
65
+ return v(
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 h(
73
- await f(`restaurants/${e}/schedules`).get("employee-configs")
72
+ return v(
73
+ await p(`restaurants/${e}/schedules`).get("employee-configs")
74
74
  );
75
75
  },
76
76
  async saveEmployeeConfigs(e, a) {
77
- return h(
78
- await f(`restaurants/${e}/schedules`).post(
77
+ return v(
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 h(
86
- await f(`restaurants/${e}/schedules`).get("settings")
85
+ return v(
86
+ await p(`restaurants/${e}/schedules`).get("settings")
87
87
  );
88
88
  },
89
89
  async saveSettings(e, a) {
90
- return h(
91
- await f(`restaurants/${e}/schedules`).post("settings", a)
90
+ return v(
91
+ await p(`restaurants/${e}/schedules`).post("settings", a)
92
92
  );
93
93
  },
94
94
  async generateAutoSchedule(e, a) {
95
- return h(
96
- await f(`restaurants/${e}/schedules`).post(
95
+ return v(
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 h(
104
- await f(`restaurants/${e}/schedules`).get(
103
+ return v(
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 h(
111
- await f(`restaurants/${e}/schedules`).post(
110
+ return v(
111
+ await p(`restaurants/${e}/schedules`).post(
112
112
  "auto-schedule/apply",
113
113
  a
114
114
  )
@@ -116,75 +116,75 @@ const ae = 500, ba = 10, Oe = 6, jn = 1500, Ge = 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 h(
120
- await f(`restaurants/${e}/schedules`).get("board", {
119
+ return v(
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 h(
127
- await f(`restaurants/${e}/schedules`).post("time-off", a)
126
+ return v(
127
+ await p(`restaurants/${e}/schedules`).post("time-off", a)
128
128
  );
129
129
  },
130
130
  async updateTimeOffStatus(e, a, t) {
131
- return h(
132
- await f(`restaurants/${e}/schedules`).post(
131
+ return v(
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 f(`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 h(await f("schedules").post("employees", a));
143
+ return v(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 h(
148
- await f("schedules").post("employees", { employeeId: a, ...t })
147
+ return v(
148
+ await p("schedules").post("employees", { employeeId: a, ...t })
149
149
  );
150
150
  },
151
151
  async validatePosAccess(e) {
152
- await f("schedules").post("employees/validate-pos-access", e);
152
+ await p("schedules").post("employees/validate-pos-access", e);
153
153
  },
154
154
  /** Positions are shared across the business. */
155
155
  async createPosition(e) {
156
- return h(await f("schedules").post("positions", e));
156
+ return v(await p("schedules").post("positions", e));
157
157
  },
158
158
  async updatePosition(e, a) {
159
- return h(await f("schedules").post(`positions/${e}`, a));
159
+ return v(await p("schedules").post(`positions/${e}`, a));
160
160
  },
161
161
  /** Deleting one position is `deletePositions` with a single-id array — the backend's
162
162
  * `DELETE positions/:id` route is gone; this is now `DELETE positions?ids=`. */
163
163
  async deletePosition(e) {
164
- await f("schedules").delete("positions", {
164
+ await p("schedules").delete("positions", {
165
165
  params: { ids: e }
166
166
  });
167
167
  },
168
168
  /** Creates one flat demand interval. */
169
169
  async createDemand(e, a) {
170
- return h(
171
- await f(`restaurants/${e}/schedules`).post("demands", a)
170
+ return v(
171
+ await p(`restaurants/${e}/schedules`).post("demands", a)
172
172
  );
173
173
  },
174
174
  /** Deletes a batch of demands in one request — e.g. `saveDemand` replacing a whole
175
175
  * day/weekday's demand rows wholesale. Deleting one demand is just this with a single-id
176
176
  * array. */
177
177
  async deleteDemands(e, a) {
178
- return h(
179
- await f(`restaurants/${e}/schedules`).delete("demands", {
178
+ return v(
179
+ await p(`restaurants/${e}/schedules`).delete("demands", {
180
180
  params: { ids: a.join(",") }
181
181
  })
182
182
  );
183
183
  },
184
184
  /** Atomically replaces one date/weekday's flattened demand rows. */
185
185
  async replaceDemands(e, a) {
186
- return h(
187
- await f(`restaurants/${e}/schedules`).post(
186
+ return v(
187
+ await p(`restaurants/${e}/schedules`).post(
188
188
  "demands/replace",
189
189
  a
190
190
  )
@@ -192,8 +192,8 @@ const ae = 500, ba = 10, Oe = 6, jn = 1500, Ge = 1e6, D = {
192
192
  },
193
193
  /** Atomically replaces several date/weekday demand generations. */
194
194
  async bulkReplaceDemands(e, a) {
195
- return h(
196
- await f(`restaurants/${e}/schedules`).post(
195
+ return v(
196
+ await p(`restaurants/${e}/schedules`).post(
197
197
  "demands/bulk-replace",
198
198
  a
199
199
  )
@@ -201,8 +201,8 @@ const ae = 500, ba = 10, Oe = 6, jn = 1500, Ge = 1e6, D = {
201
201
  },
202
202
  /** Replaces one date's note/holiday-mark. All three fields back to empty/false clears it. */
203
203
  async saveScheduleDay(e, a, t) {
204
- return h(
205
- await f(`restaurants/${e}/schedules`).post(
204
+ return v(
205
+ await p(`restaurants/${e}/schedules`).post(
206
206
  `days/${a}`,
207
207
  t
208
208
  )
@@ -210,13 +210,13 @@ const ae = 500, ba = 10, Oe = 6, jn = 1500, Ge = 1e6, D = {
210
210
  },
211
211
  /** A one-off shift assignment. */
212
212
  async createAssignment(e, a) {
213
- return h(
214
- await f(`restaurants/${e}/schedules`).post("assignments", a)
213
+ return v(
214
+ await p(`restaurants/${e}/schedules`).post("assignments", a)
215
215
  );
216
216
  },
217
217
  async updateAssignment(e, a, t) {
218
- return h(
219
- await f(`restaurants/${e}/schedules`).patch(
218
+ return v(
219
+ await p(`restaurants/${e}/schedules`).patch(
220
220
  `assignments/${a}`,
221
221
  t
222
222
  )
@@ -224,8 +224,8 @@ const ae = 500, ba = 10, Oe = 6, jn = 1500, Ge = 1e6, D = {
224
224
  },
225
225
  /** Atomically applies assignment updates, creates, and deletes used by moves and swaps. */
226
226
  async bulkSaveAssignments(e, a) {
227
- return h(
228
- await f(`restaurants/${e}/schedules`).post(
227
+ return v(
228
+ await p(`restaurants/${e}/schedules`).post(
229
229
  "assignments/bulk",
230
230
  a
231
231
  )
@@ -235,8 +235,8 @@ const ae = 500, ba = 10, Oe = 6, jn = 1500, Ge = 1e6, D = {
235
235
  * getting replaced wholesale. Deleting one assignment is just this with a single-id
236
236
  * array. */
237
237
  async deleteAssignments(e, a) {
238
- return h(
239
- await f(`restaurants/${e}/schedules`).delete("assignments", {
238
+ return v(
239
+ await p(`restaurants/${e}/schedules`).delete("assignments", {
240
240
  params: { ids: a.join(",") }
241
241
  })
242
242
  );
@@ -244,37 +244,37 @@ const ae = 500, ba = 10, Oe = 6, jn = 1500, Ge = 1e6, D = {
244
244
  /** Flips a batch of assignments to one status in a single request — e.g. Publish sending
245
245
  * every DRAFT shift on the board to PUBLISHED at once. */
246
246
  async bulkUpdateAssignmentStatus(e, a) {
247
- return h(
248
- await f(`restaurants/${e}/schedules`).patch(
247
+ return v(
248
+ await p(`restaurants/${e}/schedules`).patch(
249
249
  "assignments/bulk-status",
250
250
  a
251
251
  )
252
252
  );
253
253
  }
254
- }, je = {
255
- payload: De(null),
256
- loading: w(!1),
257
- rosterLoading: w(!1),
258
- loadError: w(null),
259
- scheduleSetupCompleted: w(!1),
260
- dataVersion: w(0),
261
- outletId: w(""),
262
- restaurantEmployees: w([]),
263
- employeeConfigs: w([]),
264
- employeeOutletIds: De({}),
265
- businessEmployees: De([]),
266
- positions: R([]),
267
- positionRecords: R([]),
268
- rolePositions: R({}),
269
- outlet: R({ name: "" }),
270
- locationOptions: R([]),
271
- locationLabelById: R({}),
272
- departmentOptions: R([]),
273
- compensationGroupOptions: R([]),
274
- compensationGroupMeta: R({}),
275
- existingStaff: R([]),
276
- shiftTemplates: R([]),
277
- rules: R({
254
+ }, Xe = {
255
+ payload: we(null),
256
+ loading: A(!1),
257
+ rosterLoading: A(!1),
258
+ loadError: A(null),
259
+ scheduleSetupCompleted: A(!1),
260
+ dataVersion: A(0),
261
+ outletId: A(""),
262
+ restaurantEmployees: A([]),
263
+ employeeConfigs: A([]),
264
+ employeeOutletIds: we({}),
265
+ businessEmployees: we([]),
266
+ positions: I([]),
267
+ positionRecords: I([]),
268
+ rolePositions: I({}),
269
+ outlet: I({ name: "" }),
270
+ locationOptions: I([]),
271
+ locationLabelById: I({}),
272
+ departmentOptions: I([]),
273
+ compensationGroupOptions: I([]),
274
+ compensationGroupMeta: I({}),
275
+ existingStaff: I([]),
276
+ shiftTemplates: I([]),
277
+ rules: I({
278
278
  coverage: {},
279
279
  openFrom: "00:00",
280
280
  openTo: "24:00",
@@ -300,30 +300,30 @@ const ae = 500, ba = 10, Oe = 6, jn = 1500, Ge = 1e6, D = {
300
300
  }
301
301
  })
302
302
  }, {
303
- payload: d,
304
- loading: Te,
305
- rosterLoading: $e,
306
- loadError: me,
307
- scheduleSetupCompleted: qe,
303
+ payload: c,
304
+ loading: $e,
305
+ rosterLoading: Ye,
306
+ loadError: fe,
307
+ scheduleSetupCompleted: Je,
308
308
  dataVersion: V,
309
- outletId: y,
310
- restaurantEmployees: pe,
311
- employeeConfigs: _,
312
- employeeOutletIds: Qe,
313
- businessEmployees: He,
309
+ outletId: m,
310
+ restaurantEmployees: se,
311
+ employeeConfigs: F,
312
+ employeeOutletIds: Ze,
313
+ businessEmployees: Ae,
314
314
  positions: Pa,
315
315
  positionRecords: K,
316
- rolePositions: qn,
316
+ rolePositions: Qn,
317
317
  outlet: Na,
318
- locationOptions: Ye,
318
+ locationOptions: xe,
319
319
  locationLabelById: ne,
320
- compensationGroupMeta: Qn,
321
- existingStaff: Xn,
322
- shiftTemplates: Jn,
320
+ compensationGroupMeta: Xn,
321
+ existingStaff: Jn,
322
+ shiftTemplates: Zn,
323
323
  rules: M
324
- } = je;
324
+ } = Xe;
325
325
  function ka() {
326
- const e = je.rules;
326
+ const e = Xe.rules;
327
327
  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 = { minHoursPerDay: null, maxHoursPerDay: 8, maxHoursPerWeek: 45 }, e.otBudget = 0, Object.assign(e.notify, {
328
328
  waConnected: !1,
329
329
  waNumber: "",
@@ -331,7 +331,7 @@ function ka() {
331
331
  defaults: { wa: !1, push: !1, email: !1 }
332
332
  });
333
333
  }
334
- const Pe = 7;
334
+ const ke = 7;
335
335
  function Ca(e) {
336
336
  const a = e.getFullYear(), t = String(e.getMonth() + 1).padStart(2, "0"), n = String(e.getDate()).padStart(2, "0");
337
337
  return `${a}-${t}-${n}`;
@@ -340,62 +340,62 @@ function oe(e, a) {
340
340
  const t = new Date(e);
341
341
  return t.setDate(t.getDate() + a), t;
342
342
  }
343
- function Ne(e) {
343
+ function Ce(e) {
344
344
  const a = new Date(e);
345
345
  return a.setHours(0, 0, 0, 0), a.setDate(a.getDate() - (a.getDay() + 6) % 7), a;
346
346
  }
347
- function Zn(e, a = /* @__PURE__ */ new Date()) {
348
- const t = oe(Ne(a), e * Pe);
349
- return Array.from({ length: Pe }, (n, i) => oe(t, i));
347
+ function qn(e, a = /* @__PURE__ */ new Date()) {
348
+ const t = oe(Ce(a), e * ke);
349
+ return Array.from({ length: ke }, (n, i) => oe(t, i));
350
350
  }
351
351
  function eo(e, a) {
352
- const t = (s) => Date.UTC(s.getFullYear(), s.getMonth(), s.getDate()), n = t(Ne(e)), i = t(Ne(a));
353
- return Math.trunc((i - n) / (Pe * 24 * 60 * 60 * 1e3));
352
+ const t = (s) => Date.UTC(s.getFullYear(), s.getMonth(), s.getDate()), n = t(Ce(e)), i = t(Ce(a));
353
+ return Math.trunc((i - n) / (ke * 24 * 60 * 60 * 1e3));
354
354
  }
355
- const se = Ca;
356
- let G = null, j = null, z = null, te = 0, fe = null;
357
- function xe(e) {
358
- return e === y.value ? !1 : (ka(), y.value = e, d.value = null, G = null, j = null, me.value = null, fe = null, qe.value = !1, pe.value = [], _.value = [], z = null, te += 1, V.value += 1, !0);
355
+ const ie = Ca;
356
+ let G = null, j = null, z = null, te = 0, he = null;
357
+ function Be(e) {
358
+ return e === m.value ? !1 : (ka(), m.value = e, c.value = null, G = null, j = null, fe.value = null, he = null, Je.value = !1, se.value = [], F.value = [], z = null, te += 1, V.value += 1, !0);
359
359
  }
360
- async function ke(e) {
361
- if (!(!e || fe === e)) {
362
- $e.value = !0;
360
+ async function Me(e) {
361
+ if (!(!e || he === e)) {
362
+ Ye.value = !0;
363
363
  try {
364
364
  await Ma(e);
365
365
  } finally {
366
- $e.value = !1;
366
+ Ye.value = !1;
367
367
  }
368
368
  }
369
369
  }
370
370
  async function Ma(e) {
371
- const a = await Ee.readEmployeesPage({
371
+ const a = await Pe.readEmployeesPage({
372
372
  limit: ae,
373
373
  offset: 0,
374
374
  restaurantIds: [e]
375
375
  });
376
- e === y.value && (pe.value = a.items, _.value = await D.listEmployeeConfigs(e), fe = e, V.value += 1, Ra().then((t) => {
377
- e === y.value && (Qe.value = t, V.value += 1);
376
+ e === m.value && (se.value = a.items, F.value = await w.listEmployeeConfigs(e), he = e, V.value += 1, Ra().then((t) => {
377
+ e === m.value && (Ze.value = t, V.value += 1);
378
378
  }));
379
379
  }
380
380
  async function Sa(e) {
381
- const a = y.value;
381
+ const a = m.value;
382
382
  if (!a || !e.length) return;
383
- const t = await D.saveEmployeeConfigs(a, { configs: e });
384
- _.value = t, V.value += 1;
383
+ const t = await w.saveEmployeeConfigs(a, { configs: e });
384
+ F.value = t, V.value += 1;
385
385
  }
386
386
  async function La(e, a) {
387
- const t = _.value.find((i) => i.employeeId === e), n = (t == null ? void 0 : t.displayOrder) ?? (a && _.value.some((i) => i.displayOrder !== null) ? Math.max(
387
+ 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(
388
388
  0,
389
- ..._.value.filter((i) => i.displayOrder !== null).map((i) => i.displayOrder)
389
+ ...F.value.filter((i) => i.displayOrder !== null).map((i) => i.displayOrder)
390
390
  ) + 100 : null);
391
391
  await Sa([{ employeeId: e, enabled: a, displayOrder: n }]);
392
392
  }
393
- async function Ie() {
394
- const e = y.value;
395
- e && (fe = null, await ke(e));
393
+ async function Oe() {
394
+ const e = m.value;
395
+ e && (he = null, await Me(e));
396
396
  }
397
- async function Re(e, a) {
398
- const t = Ha(), n = (await Xe(!0)).find((o) => o._id === e);
397
+ async function qe(e, a) {
398
+ const t = Ke(), n = (await re(!0)).find((o) => o._id === e);
399
399
  if (!n) throw new Error("Could not find this employee");
400
400
  const i = n.restaurantRole.map((o) => ({
401
401
  restaurantId: o.restaurantId,
@@ -413,37 +413,60 @@ async function Re(e, a) {
413
413
  user: { name: n.name, passcode: n.passcode },
414
414
  roles: s,
415
415
  previousRoles: i
416
- });
416
+ }), await re(!0);
417
417
  }
418
418
  async function ao(e, a, t = "") {
419
419
  const n = [...new Set(a.filter(Boolean))];
420
- n.length && (await Re(e, (i) => [
420
+ n.length && (await qe(e, (i) => [
421
421
  ...i.filter((s) => !n.includes(s.restaurantId)),
422
422
  ...n.map((s) => ({ restaurantId: s, roleId: t }))
423
- ]), y.value && n.includes(y.value) && await La(e, !0), await Ie());
423
+ ]), m.value && n.includes(m.value) && await La(e, !0), await Oe());
424
424
  }
425
425
  async function to(e, a) {
426
- const t = new Set(a);
427
- t.size && (await Re(e, (n) => n.filter((i) => !t.has(i.restaurantId))), await Ie());
428
- }
429
- async function no(e, a) {
430
426
  if (!a.length) return;
431
427
  const t = new Map(a.map((n) => [n.restaurantId, n.roleId]));
432
- await Re(e, (n) => [
428
+ await qe(e, (n) => [
433
429
  ...n.filter((i) => !t.has(i.restaurantId)),
434
430
  ...[...t.entries()].map(([i, s]) => ({ restaurantId: i, roleId: s }))
435
- ]), await Ie();
431
+ ]), await Oe();
432
+ }
433
+ async function no(e, a) {
434
+ const t = Ke(), n = (await re(!0)).find((u) => u._id === e);
435
+ if (!n) throw new Error("Could not find this employee");
436
+ const i = (u) => u.slice().sort((f, H) => f.restaurantId.localeCompare(H.restaurantId)).map((f) => `${f.restaurantId}:${f.roleId}`).join("|"), s = i(n.restaurantRole) !== i(a.roles), l = n.passcode !== a.passcode || n.isMasterUser !== a.masterUser || a.masterUser && (n.code ?? "") !== a.masterCode;
437
+ if (!s && !l) return;
438
+ const o = n.restaurantRole.map((u) => ({
439
+ restaurantId: u.restaurantId,
440
+ roleId: u.roleId
441
+ }));
442
+ if (a.masterUser) {
443
+ const u = {
444
+ user: { name: a.name, passcode: a.passcode, code: a.masterCode },
445
+ roles: a.roles,
446
+ previousRoles: o
447
+ };
448
+ n.isMasterUser ? await t.updateMasterEmployee(e, u) : await t.migrateToMasterUser(e, u);
449
+ } else {
450
+ if (n.isMasterUser)
451
+ throw new Error("Master users cannot be converted back from this form");
452
+ await t.updateEmployee(e, {
453
+ user: { name: a.name, passcode: a.passcode },
454
+ roles: a.roles,
455
+ previousRoles: o
456
+ });
457
+ }
458
+ await re(!0), await Oe();
436
459
  }
437
460
  let ee = null;
438
461
  async function Ia() {
439
- const e = await Ee.readEmployeesPage({
462
+ const e = await Pe.readEmployeesPage({
440
463
  limit: ae,
441
464
  offset: 0,
442
465
  includeEmptyPasscode: !0
443
466
  }), a = Math.min(ba, Math.ceil(e.total / ae)), t = await Promise.all(
444
467
  Array.from(
445
468
  { length: Math.max(0, a - 1) },
446
- (n, i) => Ee.readEmployeesPage({
469
+ (n, i) => Pe.readEmployeesPage({
447
470
  limit: ae,
448
471
  offset: (i + 1) * ae,
449
472
  includeEmptyPasscode: !0
@@ -452,12 +475,12 @@ async function Ia() {
452
475
  );
453
476
  return [...e.items, ...t.flatMap((n) => n.items)];
454
477
  }
455
- function Xe(e = !1) {
478
+ function re(e = !1) {
456
479
  if (!e) {
457
480
  if (ee) return ee;
458
- if (He.value.length) return Promise.resolve(He.value);
481
+ if (Ae.value.length) return Promise.resolve(Ae.value);
459
482
  }
460
- const a = Ia().then((t) => (He.value = t, t)).finally(() => {
483
+ const a = Ia().then((t) => (Ae.value = t, t)).finally(() => {
461
484
  ee === a && (ee = null);
462
485
  });
463
486
  return ee = a, a;
@@ -465,7 +488,7 @@ function Xe(e = !1) {
465
488
  async function Ra() {
466
489
  const e = {};
467
490
  try {
468
- (await Xe()).forEach((a) => {
491
+ (await re()).forEach((a) => {
469
492
  e[a._id] = [...new Set(a.restaurantRole.map((t) => t.restaurantId))];
470
493
  });
471
494
  } catch {
@@ -473,65 +496,65 @@ async function Ra() {
473
496
  }
474
497
  return e;
475
498
  }
476
- function Be(e, a) {
499
+ function _e(e, a) {
477
500
  return G !== null && j !== null && G <= e && j >= a;
478
501
  }
479
502
  async function Oa(e) {
480
- const a = se(e), t = se(oe(e, 6));
481
- Be(a, t) || z && (await z, Be(a, t)) || await Je(
482
- oe(e, -7 * Oe),
483
- oe(e, 7 * Oe)
503
+ const a = ie(e), t = ie(oe(e, 6));
504
+ _e(a, t) || z && (await z, _e(a, t)) || await ea(
505
+ oe(e, -7 * Te),
506
+ oe(e, 7 * Te)
484
507
  );
485
508
  }
486
509
  async function oo() {
487
- !G || !j || await Je(/* @__PURE__ */ new Date(`${G}T00:00:00`), /* @__PURE__ */ new Date(`${j}T00:00:00`));
510
+ !G || !j || await ea(/* @__PURE__ */ new Date(`${G}T00:00:00`), /* @__PURE__ */ new Date(`${j}T00:00:00`));
488
511
  }
489
512
  async function so(e) {
490
- if (!y.value) throw new Error("No outlet selected");
491
- const a = await D.createEmployeeProfile(y.value, e);
492
- d.value && (d.value.employees.push(a), V.value += 1);
513
+ if (!m.value) throw new Error("No outlet selected");
514
+ const a = await w.createEmployeeProfile(m.value, e);
515
+ c.value && (c.value.employees.push(a), V.value += 1);
493
516
  }
494
517
  async function io(e) {
495
- await D.validatePosAccess(e);
518
+ await w.validatePosAccess(e);
496
519
  }
497
520
  async function ro(e, a) {
498
- if (!y.value) throw new Error("No outlet selected");
499
- const t = await D.updateEmployeeProfile(y.value, e, a);
500
- if (d.value) {
501
- const n = d.value.employees.findIndex((i) => i.employeeId === e);
502
- n > -1 && (d.value = {
503
- ...d.value,
504
- employees: d.value.employees.map((i, s) => s === n ? t : i)
521
+ if (!m.value) throw new Error("No outlet selected");
522
+ const t = await w.updateEmployeeProfile(m.value, e, a);
523
+ if (c.value) {
524
+ const n = c.value.employees.findIndex((i) => i.employeeId === e);
525
+ n > -1 && (c.value = {
526
+ ...c.value,
527
+ employees: c.value.employees.map((i, s) => s === n ? t : i)
505
528
  });
506
529
  }
507
530
  }
508
531
  async function lo(e) {
509
- const a = await D.createPosition(e);
510
- d.value && (d.value = { ...d.value, positions: [...d.value.positions, a] });
532
+ const a = await w.createPosition(e);
533
+ c.value && (c.value = { ...c.value, positions: [...c.value.positions, a] });
511
534
  }
512
535
  async function uo(e, a) {
513
- const t = await D.updatePosition(e, a);
514
- d.value && (d.value = {
515
- ...d.value,
516
- positions: d.value.positions.map((n) => n.id === e ? t : n)
536
+ const t = await w.updatePosition(e, a);
537
+ c.value && (c.value = {
538
+ ...c.value,
539
+ positions: c.value.positions.map((n) => n.id === e ? t : n)
517
540
  });
518
541
  }
519
542
  async function co(e) {
520
- await D.deletePosition(e), d.value && (d.value = {
521
- ...d.value,
522
- positions: d.value.positions.filter((a) => a.id !== e)
543
+ await w.deletePosition(e), c.value && (c.value = {
544
+ ...c.value,
545
+ positions: c.value.positions.filter((a) => a.id !== e)
523
546
  });
524
547
  }
525
548
  async function yo(e, a) {
526
549
  var i;
527
- if (!y.value) throw new Error("No outlet selected");
528
- const t = (i = d.value) == null ? void 0 : i.days.find((s) => s.date === e), n = await D.saveScheduleDay(y.value, e, {
550
+ if (!m.value) throw new Error("No outlet selected");
551
+ const t = (i = c.value) == null ? void 0 : i.days.find((s) => s.date === e), n = await w.saveScheduleDay(m.value, e, {
529
552
  ...a,
530
553
  expectedUpdatedAt: a.expectedUpdatedAt ?? (t == null ? void 0 : t.updatedAt)
531
554
  });
532
- if (d.value) {
533
- const s = d.value.days.filter((l) => l.date !== e);
534
- n && s.push(n), d.value = { ...d.value, days: s };
555
+ if (c.value) {
556
+ const s = c.value.days.filter((l) => l.date !== e);
557
+ n && s.push(n), c.value = { ...c.value, days: s };
535
558
  }
536
559
  }
537
560
  async function mo(e) {
@@ -558,23 +581,23 @@ function Ta(e) {
558
581
  };
559
582
  }
560
583
  async function $a(e) {
561
- if (!y.value) throw new Error("No outlet selected");
584
+ if (!m.value) throw new Error("No outlet selected");
562
585
  if (!e.length) return;
563
- const a = e.map(Ta), t = e.length === 1 ? await D.replaceDemands(y.value, a[0]) : await D.bulkReplaceDemands(y.value, { replacements: a });
564
- if (d.value) {
565
- const n = new Set(e.map((s) => s.date)), i = d.value.demands.filter((s) => s.date === null || !n.has(s.date));
566
- d.value = { ...d.value, demands: [...i, ...t] };
586
+ const a = e.map(Ta), t = e.length === 1 ? await w.replaceDemands(m.value, a[0]) : await w.bulkReplaceDemands(m.value, { replacements: a });
587
+ if (c.value) {
588
+ const n = new Set(e.map((s) => s.date)), i = c.value.demands.filter((s) => s.date === null || !n.has(s.date));
589
+ c.value = { ...c.value, demands: [...i, ...t] };
567
590
  }
568
591
  }
569
592
  async function po(e, a) {
570
- if (!y.value) throw new Error("No outlet selected");
571
- const t = d.value;
593
+ if (!m.value) throw new Error("No outlet selected");
594
+ const t = c.value;
572
595
  if (!t || t.demands.some((s) => s.date === a)) return 0;
573
596
  const n = t.demands.filter((s) => s.date === e);
574
597
  if (!n.length) return 0;
575
598
  const i = await Promise.all(
576
599
  n.map(
577
- (s) => D.createDemand(y.value, {
600
+ (s) => w.createDemand(m.value, {
578
601
  date: a,
579
602
  startTime: s.startTime,
580
603
  endTime: s.endTime,
@@ -588,70 +611,70 @@ async function po(e, a) {
588
611
  })
589
612
  )
590
613
  );
591
- return d.value && (d.value = { ...d.value, demands: [...d.value.demands, ...i] }), i.length;
614
+ return c.value && (c.value = { ...c.value, demands: [...c.value.demands, ...i] }), i.length;
592
615
  }
593
616
  async function fo(e) {
594
- if (!y.value) throw new Error("No outlet selected");
595
- return D.generateAutoSchedule(y.value, e);
617
+ if (!m.value) throw new Error("No outlet selected");
618
+ return w.generateAutoSchedule(m.value, e);
596
619
  }
597
620
  async function ho() {
598
- if (!y.value) throw new Error("No outlet selected");
599
- return D.getAutoScheduleCapabilities(y.value);
621
+ if (!m.value) throw new Error("No outlet selected");
622
+ return w.getAutoScheduleCapabilities(m.value);
600
623
  }
601
624
  async function vo(e) {
602
- if (!y.value) throw new Error("No outlet selected");
603
- return D.applyAutoSchedule(y.value, e);
625
+ if (!m.value) throw new Error("No outlet selected");
626
+ return w.applyAutoSchedule(m.value, e);
604
627
  }
605
628
  async function Do(e) {
606
- if (!y.value) throw new Error("No outlet selected");
607
- return D.bulkSaveAssignments(y.value, e);
629
+ if (!m.value) throw new Error("No outlet selected");
630
+ return w.bulkSaveAssignments(m.value, e);
608
631
  }
609
632
  async function go(e) {
610
- if (!y.value) throw new Error("No outlet selected");
611
- e.length && await D.deleteAssignments(y.value, e);
612
- }
613
- async function Ho(e) {
614
- if (!y.value) throw new Error("No outlet selected");
615
- const a = await D.createTimeOff(y.value, e);
616
- return d.value && (d.value = { ...d.value, timeOff: [...d.value.timeOff, a] }), a;
617
- }
618
- async function wo(e, a) {
619
- if (!y.value) throw new Error("No outlet selected");
620
- const t = await D.updateTimeOffStatus(y.value, e, a);
621
- return t && d.value && (d.value = {
622
- ...d.value,
623
- timeOff: d.value.timeOff.map((n) => n.id === e ? t : n)
633
+ if (!m.value) throw new Error("No outlet selected");
634
+ e.length && await w.deleteAssignments(m.value, e);
635
+ }
636
+ async function wo(e) {
637
+ if (!m.value) throw new Error("No outlet selected");
638
+ const a = await w.createTimeOff(m.value, e);
639
+ return c.value && (c.value = { ...c.value, timeOff: [...c.value.timeOff, a] }), a;
640
+ }
641
+ async function Ho(e, a) {
642
+ if (!m.value) throw new Error("No outlet selected");
643
+ const t = await w.updateTimeOffStatus(m.value, e, a);
644
+ return t && c.value && (c.value = {
645
+ ...c.value,
646
+ timeOff: c.value.timeOff.map((n) => n.id === e ? t : n)
624
647
  }), t;
625
648
  }
626
649
  async function Ao(e) {
627
- if (!y.value) throw new Error("No outlet selected");
628
- await D.deleteTimeOff(y.value, e), d.value && (d.value = {
629
- ...d.value,
630
- timeOff: d.value.timeOff.filter((a) => a.id !== e)
650
+ if (!m.value) throw new Error("No outlet selected");
651
+ await w.deleteTimeOff(m.value, e), c.value && (c.value = {
652
+ ...c.value,
653
+ timeOff: c.value.timeOff.filter((a) => a.id !== e)
631
654
  });
632
655
  }
633
656
  async function Eo(e) {
634
- if (!y.value) throw new Error("No outlet selected");
635
- return D.bulkUpdateAssignmentStatus(y.value, e);
657
+ if (!m.value) throw new Error("No outlet selected");
658
+ return w.bulkUpdateAssignmentStatus(m.value, e);
636
659
  }
637
- async function Je(e, a) {
638
- const t = y.value;
660
+ async function ea(e, a) {
661
+ const t = m.value;
639
662
  if (!t) {
640
- me.value = "No outlet selected";
663
+ fe.value = "No outlet selected";
641
664
  return;
642
665
  }
643
- const n = se(e), i = se(a), s = ++te;
644
- Te.value = !0, me.value = null;
666
+ const n = ie(e), i = ie(a), s = ++te;
667
+ $e.value = !0, fe.value = null;
645
668
  const l = (async () => {
646
669
  try {
647
- const o = await D.readBoard(t, n, i);
648
- if (y.value !== t || s !== te) return;
649
- d.value = o, qe.value = o.settings.setupCompleted, G = n, j = i, V.value += 1;
670
+ const o = await w.readBoard(t, n, i);
671
+ if (m.value !== t || s !== te) return;
672
+ c.value = o, Je.value = o.settings.setupCompleted, G = n, j = i, V.value += 1;
650
673
  } catch (o) {
651
- if (y.value !== t || s !== te) return;
652
- me.value = o instanceof Error ? o.message : "Could not load the schedule";
674
+ if (m.value !== t || s !== te) return;
675
+ fe.value = o instanceof Error ? o.message : "Could not load the schedule";
653
676
  } finally {
654
- y.value === t && s === te && (Te.value = !1);
677
+ m.value === t && s === te && ($e.value = !1);
655
678
  }
656
679
  })();
657
680
  z = l;
@@ -747,11 +770,11 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
747
770
  }
748
771
  }, ja = {
749
772
  maxHoursPerMonth: 72
750
- }, qa = {
773
+ }, Qa = {
751
774
  minHoursPerDay: null,
752
775
  maxHoursPerDay: 8,
753
776
  maxHoursPerWeek: 44
754
- }, Qa = [
777
+ }, Xa = [
755
778
  {
756
779
  month: 1,
757
780
  day: 1,
@@ -777,7 +800,7 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
777
800
  day: 25,
778
801
  name: "Christmas Day"
779
802
  }
780
- ], Xa = {
803
+ ], Ja = {
781
804
  2026: {
782
805
  "2026-01-01": "New Year's Day",
783
806
  "2026-02-17": "Chinese New Year",
@@ -807,15 +830,15 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
807
830
  "2027-08-15": "Prophet Muhammad's Birthday",
808
831
  "2027-12-25": "Christmas Day"
809
832
  }
810
- }, Ja = {
833
+ }, Za = {
811
834
  countryCode: Va,
812
835
  timezone: Ka,
813
836
  payRate: Ga,
814
837
  overtime: ja,
815
- workingHours: qa,
816
- recurringPublicHolidays: Qa,
817
- publicHolidays: Xa
818
- }, Za = "ID", et = "Asia/Jakarta", at = {
838
+ workingHours: Qa,
839
+ recurringPublicHolidays: Xa,
840
+ publicHolidays: Ja
841
+ }, qa = "ID", et = "Asia/Jakarta", at = {
819
842
  NORMAL: {
820
843
  overtime: 1.5
821
844
  },
@@ -895,7 +918,7 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
895
918
  "2027-12-26": "Isra Mi'raj"
896
919
  }
897
920
  }, it = {
898
- countryCode: Za,
921
+ countryCode: qa,
899
922
  timezone: et,
900
923
  payRate: at,
901
924
  overtime: tt,
@@ -1029,7 +1052,7 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
1029
1052
  minHoursPerDay: null,
1030
1053
  maxHoursPerDay: 8,
1031
1054
  maxHoursPerWeek: 48
1032
- }, Ht = [
1055
+ }, wt = [
1033
1056
  {
1034
1057
  month: 1,
1035
1058
  day: 1,
@@ -1055,7 +1078,7 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
1055
1078
  day: 11,
1056
1079
  name: "Republic Day"
1057
1080
  }
1058
- ], wt = {
1081
+ ], Ht = {
1059
1082
  2026: {
1060
1083
  "2026-01-01": "New Year's Day",
1061
1084
  "2026-03-20": "Eid al-Fitr Holiday",
@@ -1099,8 +1122,8 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
1099
1122
  payRate: vt,
1100
1123
  overtime: Dt,
1101
1124
  workingHours: gt,
1102
- recurringPublicHolidays: Ht,
1103
- publicHolidays: wt
1125
+ recurringPublicHolidays: wt,
1126
+ publicHolidays: Ht
1104
1127
  }, Et = "MY", bt = "Asia/Kuala_Lumpur", Pt = {
1105
1128
  NORMAL: {
1106
1129
  overtime: 1.5
@@ -1351,7 +1374,7 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
1351
1374
  workingHours: Wt,
1352
1375
  recurringPublicHolidays: zt,
1353
1376
  publicHolidays: Vt
1354
- }, Gt = "TH", jt = "Asia/Bangkok", qt = {
1377
+ }, Gt = "TH", jt = "Asia/Bangkok", Qt = {
1355
1378
  NORMAL: {
1356
1379
  overtime: 1.5
1357
1380
  },
@@ -1363,13 +1386,13 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
1363
1386
  regular: 2,
1364
1387
  overtime: 3
1365
1388
  }
1366
- }, Qt = {
1367
- maxHoursPerMonth: 36
1368
1389
  }, Xt = {
1390
+ maxHoursPerMonth: 36
1391
+ }, Jt = {
1369
1392
  minHoursPerDay: null,
1370
1393
  maxHoursPerDay: 8,
1371
1394
  maxHoursPerWeek: 48
1372
- }, Jt = [
1395
+ }, Zt = [
1373
1396
  {
1374
1397
  month: 1,
1375
1398
  day: 1,
@@ -1415,7 +1438,7 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
1415
1438
  day: 31,
1416
1439
  name: "New Year's Eve"
1417
1440
  }
1418
- ], Zt = {
1441
+ ], qt = {
1419
1442
  2026: {
1420
1443
  "2026-01-01": "New Year's Day",
1421
1444
  "2026-03-03": "Makha Bucha Day",
@@ -1458,11 +1481,11 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
1458
1481
  }, en = {
1459
1482
  countryCode: Gt,
1460
1483
  timezone: jt,
1461
- payRate: qt,
1462
- overtime: Qt,
1463
- workingHours: Xt,
1464
- recurringPublicHolidays: Jt,
1465
- publicHolidays: Zt
1484
+ payRate: Qt,
1485
+ overtime: Xt,
1486
+ workingHours: Jt,
1487
+ recurringPublicHolidays: Zt,
1488
+ publicHolidays: qt
1466
1489
  }, an = "VN", tn = "Asia/Ho_Chi_Minh", nn = {
1467
1490
  NORMAL: {
1468
1491
  overtime: 1.5
@@ -1538,7 +1561,7 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
1538
1561
  workingHours: sn,
1539
1562
  recurringPublicHolidays: rn,
1540
1563
  publicHolidays: ln
1541
- }, _e = { AE: za, BN: Ja, ID: it, MO: pt, MV: At, MY: St, PK: xt, SG: Kt, TH: en, VN: un };
1564
+ }, Fe = { AE: za, BN: Za, ID: it, MO: pt, MV: At, MY: St, PK: xt, SG: Kt, TH: en, VN: un };
1542
1565
  function dn(e) {
1543
1566
  if (typeof e == "string") return e.toUpperCase();
1544
1567
  if (e && typeof e == "object" && "code" in e) {
@@ -1548,7 +1571,7 @@ function dn(e) {
1548
1571
  return "MY";
1549
1572
  }
1550
1573
  function cn(e) {
1551
- return _e[dn(e)] ?? _e.MY;
1574
+ return Fe[dn(e)] ?? Fe.MY;
1552
1575
  }
1553
1576
  function bo(e, a) {
1554
1577
  var s, l;
@@ -1557,7 +1580,7 @@ function bo(e, a) {
1557
1580
  const n = Number(a.slice(5, 7)), i = Number(a.slice(8, 10));
1558
1581
  return ((l = e.recurringPublicHolidays.find((o) => o.month === n && o.day === i)) == null ? void 0 : l.name) ?? null;
1559
1582
  }
1560
- const yn = ze(), Ze = "unassigned", Po = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], No = "All Stations", ko = [{ id: Ze, label: "Assigned", roles: [], system: !0 }], Fe = [
1583
+ const yn = Ve(), aa = "unassigned", Po = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], No = "All Stations", ko = [{ id: aa, label: "Assigned", roles: [], system: !0 }], Ue = [
1561
1584
  "#903E1F",
1562
1585
  "#5F090A",
1563
1586
  "#0A5384",
@@ -1580,45 +1603,45 @@ function Mo(e, a) {
1580
1603
  return a ? !K.some((t) => t.id === a) : !!e && !K.some((t) => t.name.toLocaleLowerCase() === e.toLocaleLowerCase());
1581
1604
  }
1582
1605
  const So = [1, 1, 1, 1, 1, 1, 1];
1583
- function ie(e) {
1606
+ function le(e) {
1584
1607
  return (e + 6) % 7;
1585
1608
  }
1586
1609
  function Lo(e) {
1587
1610
  return (e + 1) % 7;
1588
1611
  }
1589
- function ce(e, a) {
1612
+ function me(e, a) {
1590
1613
  e.splice(0, e.length, ...a);
1591
1614
  }
1592
1615
  function pn(e, a) {
1593
- return Ve(e, a) / 60;
1616
+ return Ge(e, a) / 60;
1594
1617
  }
1595
1618
  function fn(e) {
1596
1619
  var t;
1597
1620
  const a = e.trim().split(/\s+/).filter(Boolean);
1598
1621
  return a.length ? (a[0][0] + (((t = a[1]) == null ? void 0 : t[0]) ?? "")).toUpperCase() : "??";
1599
1622
  }
1600
- const ea = /* @__PURE__ */ new Map(), we = /* @__PURE__ */ new Map();
1623
+ const ta = /* @__PURE__ */ new Map(), Ee = /* @__PURE__ */ new Map();
1601
1624
  function Io(e) {
1602
- return ea.get(e);
1625
+ return ta.get(e);
1603
1626
  }
1604
1627
  function hn(e) {
1605
- const a = we.get(e);
1628
+ const a = Ee.get(e);
1606
1629
  if (a !== void 0) return a;
1607
- const t = Ge + we.size + 1;
1608
- return we.set(e, t), ea.set(t, e), t;
1630
+ const t = Qe + Ee.size + 1;
1631
+ return Ee.set(e, t), ta.set(t, e), t;
1609
1632
  }
1610
1633
  function Ro(e) {
1611
1634
  return e.sourceId || String(e.id);
1612
1635
  }
1613
1636
  function vn(e) {
1614
- Na.name = (e == null ? void 0 : e.outlet.name) ?? "", ce(Pa, (e == null ? void 0 : e.positions.map((o) => o.name)) ?? []), ce(K, (e == null ? void 0 : e.positions) ?? []);
1637
+ Na.name = (e == null ? void 0 : e.outlet.name) ?? "", me(Pa, (e == null ? void 0 : e.positions.map((o) => o.name)) ?? []), me(K, (e == null ? void 0 : e.positions) ?? []);
1615
1638
  const a = (e == null ? void 0 : e.restaurantProfile.operatingHours) ?? [], t = Array.from({ length: 7 }, () => []);
1616
- for (const o of a) t[ie(o.dayOfWeek)] = o.closed ? [] : o.hours;
1617
- ce(M.dayHours, t);
1639
+ for (const o of a) t[le(o.dayOfWeek)] = o.closed ? [] : o.hours;
1640
+ me(M.dayHours, t);
1618
1641
  const n = a.filter((o) => !o.closed).flatMap((o) => o.hours);
1619
- M.openFrom = n.length ? n.map((o) => o.start).reduce((o, m) => m < o ? m : o) : "00:00", M.openTo = n.length ? n.map((o) => o.end).reduce((o, m) => m > o ? m : o) : "24:00", ce(
1642
+ M.openFrom = n.length ? n.map((o) => o.start).reduce((o, u) => u < o ? u : o) : "00:00", M.openTo = n.length ? n.map((o) => o.end).reduce((o, u) => u > o ? u : o) : "24:00", me(
1620
1643
  M.closedWeekdays,
1621
- a.filter((o) => o.closed).map((o) => ie(o.dayOfWeek)).sort((o, m) => o - m)
1644
+ a.filter((o) => o.closed).map((o) => le(o.dayOfWeek)).sort((o, u) => o - u)
1622
1645
  );
1623
1646
  const i = cn(yn.currentCountry.value), s = (e == null ? void 0 : e.settings.settingsConfigured) === !0, l = s ? e.settings.payRate : i.payRate;
1624
1647
  M.otCapHours = s ? e.settings.overtime.maxHoursPerMonth : i.overtime.maxHoursPerMonth, M.workingHours = s ? e.settings.workingHours : {
@@ -1627,8 +1650,8 @@ function vn(e) {
1627
1650
  maxHoursPerWeek: i.workingHours.maxHoursPerWeek
1628
1651
  }, M.payRate.NORMAL.overtime = l.NORMAL.overtime, M.payRate.REST_DAY.regular = l.REST_DAY.regular, M.payRate.REST_DAY.overtime = l.REST_DAY.overtime, M.payRate.PUBLIC_HOLIDAY.regular = l.PUBLIC_HOLIDAY.regular, M.payRate.PUBLIC_HOLIDAY.overtime = l.PUBLIC_HOLIDAY.overtime;
1629
1652
  }
1630
- Se(d, vn, { immediate: !0 });
1631
- function he(e) {
1653
+ Ie(c, vn, { immediate: !0 });
1654
+ function ve(e) {
1632
1655
  var a, t, n;
1633
1656
  return {
1634
1657
  minHoursPerDay: ((a = e.workingHours) == null ? void 0 : a.minHoursPerDay) ?? M.workingHours.minHoursPerDay,
@@ -1639,7 +1662,7 @@ function he(e) {
1639
1662
  function Dn(e) {
1640
1663
  return e.reduce(
1641
1664
  (a, t) => {
1642
- const n = he(t).maxHoursPerWeek;
1665
+ const n = ve(t).maxHoursPerWeek;
1643
1666
  return t.employmentType === "FULLTIME" && n != null ? Math.max(a, n) : a;
1644
1667
  },
1645
1668
  0
@@ -1647,15 +1670,15 @@ function Dn(e) {
1647
1670
  }
1648
1671
  function gn(e, a) {
1649
1672
  if (e.wage.type === "HOURLY") return e.wage.amount;
1650
- const t = he(e).maxHoursPerWeek ?? a;
1673
+ const t = ve(e).maxHoursPerWeek ?? a;
1651
1674
  return t ? e.wage.amount / (t * (52 / 12)) : 0;
1652
1675
  }
1653
- function Hn(e, a) {
1676
+ function wn(e, a) {
1654
1677
  if (e.employmentType === "FULLTIME") return 100;
1655
- const t = he(e).maxHoursPerWeek;
1678
+ const t = ve(e).maxHoursPerWeek;
1656
1679
  return !a || t == null ? 0 : Math.min(99, Math.round(t / a * 100));
1657
1680
  }
1658
- function wn(e) {
1681
+ function Hn(e) {
1659
1682
  var a, t;
1660
1683
  return {
1661
1684
  start: e.startTime,
@@ -1669,7 +1692,7 @@ function wn(e) {
1669
1692
  // Mongo distinguishes a draft from a published/confirmed assignment; the board's third
1670
1693
  // state ('ot') is a costing outcome, never something stored.
1671
1694
  status: e.status === "DRAFT" ? "pending" : "confirmed",
1672
- breakMins: Ke(e.breaks),
1695
+ breakMins: je(e.breaks),
1673
1696
  breaks: e.breaks,
1674
1697
  // Carried through so an edit updates this same ScheduleShiftAssignments document instead of
1675
1698
  // creating a duplicate — see useScheduleBoard's commitShift/persistSlot.
@@ -1705,69 +1728,79 @@ function bn(e) {
1705
1728
  };
1706
1729
  }
1707
1730
  function Pn(e) {
1708
- const a = ne[y.value];
1731
+ const a = ne[m.value];
1709
1732
  return !a || !e.includes(a) ? e : [a, ...e.filter((t) => t !== a)];
1710
1733
  }
1711
1734
  function Nn(e) {
1712
1735
  var n;
1713
- const t = (Qe.value[e] ?? ((n = pe.value.find((i) => i._id === e)) == null ? void 0 : n.restaurantRole.map((i) => i.restaurantId)) ?? []).map((i) => ne[i]).filter((i) => !!i);
1736
+ const t = (Ze.value[e] ?? ((n = se.value.find((i) => i._id === e)) == null ? void 0 : n.restaurantRole.map((i) => i.restaurantId)) ?? []).map((i) => ne[i]).filter((i) => !!i);
1714
1737
  return t.length ? Pn([...new Set(t)]) : void 0;
1715
1738
  }
1716
1739
  function Oo(e = []) {
1717
- const a = d.value;
1740
+ const a = c.value;
1718
1741
  if (!a) return [];
1719
1742
  const t = new Map(a.employees.map((o) => [o.employeeId, o])), n = new Map(
1720
- _.value.map((o) => [o.employeeId, o])
1721
- ), i = pe.value.filter((o) => {
1722
- var m;
1723
- return ((m = n.get(o._id)) == null ? void 0 : m.enabled) !== !1;
1743
+ F.value.map((o) => [o.employeeId, o])
1744
+ ), i = se.value.filter((o) => {
1745
+ var u;
1746
+ return ((u = n.get(o._id)) == null ? void 0 : u.enabled) !== !1;
1724
1747
  }).map((o) => t.get(o._id) ?? bn(o)), s = Dn(i), l = /* @__PURE__ */ new Map();
1725
1748
  for (const o of a.assignments) {
1726
- const m = `${o.employeeId}|${o.date}`, v = l.get(m);
1727
- v ? v.push(o) : l.set(m, [o]);
1749
+ const u = `${o.employeeId}|${o.date}`, f = l.get(u);
1750
+ f ? f.push(o) : l.set(u, [o]);
1728
1751
  }
1729
1752
  return i.map((o) => {
1730
- var J;
1731
- const m = he(o), v = hn(o.employeeId), N = new Set(K.map((g) => g.id)), Y = new Set(K.map((g) => g.name.toLocaleLowerCase())), p = (g) => g.positionId ? N.has(g.positionId) : Y.has(g.positionName.toLocaleLowerCase()), A = (J = o.primaryPosition) == null ? void 0 : J.positionName, L = !!o.primaryPosition && p(o.primaryPosition), T = o.secondaryPositions.filter(p).map((g) => g.positionName), q = A ? L ? [A, ...T] : [] : T, Q = [
1732
- ...A && !L ? [A] : [],
1733
- ...o.secondaryPositions.filter((g) => !p(g)).map((g) => g.positionName)
1734
- ], re = q[0] ?? "", x = e.map((g) => {
1735
- const E = se(g), H = (a.timeOff ?? []).filter((b) => b.employeeId === o.employeeId).map((b) => En(b, E)).find((b) => b !== null);
1736
- if (H) return H;
1737
- const F = (l.get(`${o.employeeId}|${E}`) ?? []).filter((b) => b.startTime && b.endTime).map((b) => wn(b)).sort((b, ue) => b.start.localeCompare(ue.start));
1738
- return F.length ? F.length === 1 ? F[0] : F : null;
1739
- }), I = o.availability.length > 0, X = Array.from(
1753
+ var ce;
1754
+ const u = se.value.find((D) => D._id === o.employeeId) ?? {
1755
+ code: void 0,
1756
+ passcode: "",
1757
+ isMasterUser: !1
1758
+ }, f = ve(o), H = hn(o.employeeId), $ = new Set(K.map((D) => D.id)), h = new Set(K.map((D) => D.name.toLocaleLowerCase())), b = (D) => D.positionId ? $.has(D.positionId) : h.has(D.positionName.toLocaleLowerCase()), k = (ce = o.primaryPosition) == null ? void 0 : ce.positionName, O = !!o.primaryPosition && b(o.primaryPosition), Q = o.secondaryPositions.filter(b).map((D) => D.positionName), X = k ? O ? [k, ...Q] : [] : Q, J = [
1759
+ ...k && !O ? [k] : [],
1760
+ ...o.secondaryPositions.filter((D) => !b(D)).map((D) => D.positionName)
1761
+ ], x = X[0] ?? "", S = e.map((D) => {
1762
+ const E = ie(D), g = (a.timeOff ?? []).filter((P) => P.employeeId === o.employeeId).map((P) => En(P, E)).find((P) => P !== null);
1763
+ if (g) return g;
1764
+ const _ = (l.get(`${o.employeeId}|${E}`) ?? []).filter((P) => P.startTime && P.endTime).map((P) => Hn(P)).sort((P, De) => P.start.localeCompare(De.start));
1765
+ return _.length ? _.length === 1 ? _[0] : _ : null;
1766
+ }), Z = o.availability.length > 0, ue = Array.from(
1740
1767
  { length: 7 },
1741
- (g, E) => I ? o.availability.some((H) => ie(H.dayOfWeek) === E) : !0
1742
- ), le = Array.from({ length: 7 }, (g, E) => {
1743
- const H = o.availability.find((k) => ie(k.dayOfWeek) === E);
1744
- return { from: (H == null ? void 0 : H.start) ?? "", to: (H == null ? void 0 : H.end) ?? "" };
1768
+ (D, E) => Z ? o.availability.some((g) => le(g.dayOfWeek) === E) : !0
1769
+ ), de = Array.from({ length: 7 }, (D, E) => {
1770
+ const g = o.availability.find((B) => le(B.dayOfWeek) === E);
1771
+ return { from: (g == null ? void 0 : g.start) ?? "", to: (g == null ? void 0 : g.end) ?? "" };
1745
1772
  });
1746
1773
  return {
1747
- id: v,
1774
+ id: H,
1748
1775
  sourceId: o.employeeId,
1749
1776
  name: o.name,
1777
+ // POS access belongs to the POS roster, not the scheduling profile. Keep these
1778
+ // fields on the board employee so the edit form can initialise its access section
1779
+ // from the employee's existing POS account.
1780
+ passcode: u.passcode || void 0,
1781
+ code: u.code,
1782
+ masterUser: u.isMasterUser,
1750
1783
  employmentType: o.employmentType,
1751
- role: re,
1784
+ role: x,
1752
1785
  initials: fn(o.name),
1753
- color: Fe[(v - Ge - 1) % Fe.length],
1786
+ color: Ue[(H - Qe - 1) % Ue.length],
1754
1787
  // Gross hours actually rostered this week — the figure the cost rail multiplies by
1755
1788
  // the rate. Contracted hours are a separate question, answered by RULES.contract.
1756
1789
  // Rounded to one decimal — `hoursBetween` divides by 60, so an unrounded sum reads
1757
1790
  // as a long, meaningless float (e.g. 31.983333333333334) everywhere this is shown
1758
1791
  // verbatim, matching the rounding `employeeLoadOf`'s own hours figure already uses.
1759
1792
  weekHours: Math.round(
1760
- x.reduce(
1761
- (g, E) => g + (Array.isArray(E) ? E : E && "start" in E ? [E] : []).reduce(
1762
- (H, k) => H + pn(k.start, k.end),
1793
+ S.reduce(
1794
+ (D, E) => D + (Array.isArray(E) ? E : E && "start" in E ? [E] : []).reduce(
1795
+ (g, B) => g + pn(B.start, B.end),
1763
1796
  0
1764
1797
  ),
1765
1798
  0
1766
1799
  ) * 10
1767
1800
  ) / 10,
1768
- pct: Hn(o, s),
1769
- contractHours: m.maxHoursPerWeek ?? void 0,
1770
- minHoursPerDay: m.minHoursPerDay ?? void 0,
1801
+ pct: wn(o, s),
1802
+ contractHours: f.maxHoursPerWeek ?? void 0,
1803
+ minHoursPerDay: f.minHoursPerDay ?? void 0,
1771
1804
  // Keep the persisted override shape here. Consumers that need the effective value use
1772
1805
  // effectiveWorkingHours(), so an inherited null remains distinguishable from an override.
1773
1806
  workingHours: o.workingHours,
@@ -1775,17 +1808,17 @@ function Oo(e = []) {
1775
1808
  // shows them, and saving keeps them.
1776
1809
  locations: Nn(o.employeeId),
1777
1810
  rate: gn(o, s),
1778
- positions: q,
1779
- archivedPositions: Q.length ? Q : void 0,
1780
- shifts: x,
1811
+ positions: X,
1812
+ archivedPositions: J.length ? J : void 0,
1813
+ shifts: S,
1781
1814
  // Remarks live in their own collection in the older scheduling design and are not
1782
1815
  // part of this board's payload yet.
1783
1816
  remarks: [],
1784
- section: Ze,
1817
+ section: aa,
1785
1818
  payBasis: o.wage.type === "HOURLY" ? "hourly" : "monthly",
1786
1819
  payAmount: o.wage.amount,
1787
- availDays: X,
1788
- availHours: le
1820
+ availDays: ue,
1821
+ availHours: de
1789
1822
  };
1790
1823
  });
1791
1824
  }
@@ -1794,11 +1827,11 @@ function To() {
1794
1827
  }
1795
1828
  function $o() {
1796
1829
  var n, i;
1797
- const e = d.value, a = {}, t = {};
1830
+ const e = c.value, a = {}, t = {};
1798
1831
  for (const s of (e == null ? void 0 : e.demands) ?? []) {
1799
- const l = s.date ? a[n = s.date] ?? (a[n] = []) : s.dayOfWeek !== null ? t[i = ie(s.dayOfWeek)] ?? (t[i] = []) : null;
1832
+ const l = s.date ? a[n = s.date] ?? (a[n] = []) : s.dayOfWeek !== null ? t[i = le(s.dayOfWeek)] ?? (t[i] = []) : null;
1800
1833
  if (!l) continue;
1801
- let o = l.find((m) => m.from === s.startTime && m.to === s.endTime);
1834
+ let o = l.find((u) => u.from === s.startTime && u.to === s.endTime);
1802
1835
  o || (o = { from: s.startTime, to: s.endTime, n: 0, roles: [] }, l.push(o)), o.n += s.headcount, s.position && o.roles.push({
1803
1836
  position: s.position.positionName,
1804
1837
  positionId: s.position.positionId || void 0,
@@ -1808,29 +1841,29 @@ function $o() {
1808
1841
  return { byDate: a, byWeekday: t };
1809
1842
  }
1810
1843
  function Yo() {
1811
- const e = ze(), { restaurants: a, readRestaurants: t } = ga(), n = va(), i = Da(), s = w(!1), l = $(
1812
- () => [...a.value].map((p) => ({ value: p._id, label: p.profile.name })).sort((p, A) => p.label.localeCompare(A.label))
1813
- ), o = $(() => {
1814
- var p;
1815
- return ((p = e.currentRestaurant.value) == null ? void 0 : p._id) ?? "";
1844
+ const e = Ve(), { restaurants: a, readRestaurants: t } = wa(), n = Da(), i = ga(), s = A(!1), l = T(
1845
+ () => [...a.value].map((h) => ({ value: h._id, label: h.profile.name })).sort((h, b) => h.label.localeCompare(b.label))
1846
+ ), o = T(() => {
1847
+ var h;
1848
+ return ((h = e.currentRestaurant.value) == null ? void 0 : h._id) ?? "";
1816
1849
  });
1817
- async function m(p, A) {
1818
- return xe(p) ? (n.query.restaurantId !== p && i.replace({ query: { ...n.query, restaurantId: p } }), await Promise.all([ke(p), Oa(A)]), !0) : !1;
1850
+ async function u(h, b) {
1851
+ return Be(h) ? (n.query.restaurantId !== h && i.replace({ query: { ...n.query, restaurantId: h } }), await Promise.all([Me(h), Oa(b)]), !0) : !1;
1819
1852
  }
1820
- const v = (p) => !!p && l.value.some((A) => A.value === p);
1821
- async function N() {
1822
- var A;
1823
- await t(), Ye.splice(0, Ye.length, ...l.value.map((L) => L.label)), Object.keys(ne).forEach((L) => delete ne[L]), l.value.forEach((L) => ne[L.value] = L.label);
1824
- const p = v(y.value) ? y.value : v(o.value) ? o.value : ((A = l.value[0]) == null ? void 0 : A.value) ?? "";
1825
- return p && xe(p), s.value = !0, p;
1853
+ const f = (h) => !!h && l.value.some((b) => b.value === h);
1854
+ async function H() {
1855
+ var b;
1856
+ await t(), xe.splice(0, xe.length, ...l.value.map((k) => k.label)), Object.keys(ne).forEach((k) => delete ne[k]), l.value.forEach((k) => ne[k.value] = k.label);
1857
+ const h = f(m.value) ? m.value : f(o.value) ? o.value : ((b = l.value[0]) == null ? void 0 : b.value) ?? "";
1858
+ return h && Be(h), s.value = !0, h;
1826
1859
  }
1827
- async function Y() {
1828
- const p = await N();
1829
- return p && await ke(p), p;
1860
+ async function $() {
1861
+ const h = await H();
1862
+ return h && await Me(h), h;
1830
1863
  }
1831
- return { options: l, ready: s, outletId: y, resolve: Y, resolveOutlet: N, switchTo: m };
1864
+ return { options: l, ready: s, outletId: m, resolve: $, resolveOutlet: H, switchTo: u };
1832
1865
  }
1833
- const kn = ["data-hierarchy", "data-size", "data-icon"], xo = /* @__PURE__ */ Le({
1866
+ const kn = ["data-hierarchy", "data-size", "data-icon"], xo = /* @__PURE__ */ Re({
1834
1867
  __name: "ScheduleButton",
1835
1868
  props: {
1836
1869
  hierarchy: { default: "primary" },
@@ -1838,14 +1871,14 @@ const kn = ["data-hierarchy", "data-size", "data-icon"], xo = /* @__PURE__ */ Le
1838
1871
  iconOnly: { type: Boolean, default: !1 }
1839
1872
  },
1840
1873
  setup(e) {
1841
- return (a, t) => (P(), C("button", {
1874
+ return (a, t) => (N(), C("button", {
1842
1875
  type: "button",
1843
1876
  class: "sch-button",
1844
1877
  "data-hierarchy": e.hierarchy,
1845
1878
  "data-size": e.size,
1846
1879
  "data-icon": e.iconOnly ? "only" : void 0
1847
1880
  }, [
1848
- We(a.$slots, "default")
1881
+ ze(a.$slots, "default")
1849
1882
  ], 8, kn));
1850
1883
  }
1851
1884
  }), Cn = ["disabled", "aria-expanded"], Mn = { class: "sch" }, Sn = ["aria-multiselectable"], Ln = {
@@ -1863,7 +1896,7 @@ const kn = ["data-hierarchy", "data-size", "data-icon"], xo = /* @__PURE__ */ Le
1863
1896
  }, Tn = ["aria-selected", "onClick"], $n = {
1864
1897
  key: 0,
1865
1898
  class: "fx-opt-text"
1866
- }, Yn = { key: 0 }, Bo = /* @__PURE__ */ Le({
1899
+ }, Yn = { key: 0 }, Bo = /* @__PURE__ */ Re({
1867
1900
  inheritAttrs: !1,
1868
1901
  __name: "ScheduleSelect",
1869
1902
  props: {
@@ -1881,202 +1914,202 @@ const kn = ["data-hierarchy", "data-size", "data-icon"], xo = /* @__PURE__ */ Le
1881
1914
  },
1882
1915
  emits: ["update:modelValue", "toggle"],
1883
1916
  setup(e, { emit: a }) {
1884
- const t = e, n = a, i = ra(), s = $(() => i.class ?? ""), l = w(!1), o = w(!1), m = w(null), v = w(null), N = w(null), Y = $(() => t.teleport !== !1 && o.value);
1885
- Ce(() => {
1917
+ const t = e, n = a, i = la(), s = T(() => i.class ?? ""), l = A(!1), o = A(!1), u = A(null), f = A(null), H = A(null), $ = T(() => t.teleport !== !1 && o.value);
1918
+ Se(() => {
1886
1919
  o.value = typeof document < "u" && !!document.body;
1887
1920
  });
1888
- const p = $(() => {
1889
- var r, c;
1921
+ const h = T(() => {
1922
+ var r, y;
1890
1923
  if (!t.multiple && t.selectedLabel != null) return t.selectedLabel;
1891
1924
  if (t.multiple) {
1892
- const u = ((r = t.selected) == null ? void 0 : r.length) ?? 0;
1893
- return u ? `${u} selected` : t.placeholder ?? "";
1925
+ const d = ((r = t.selected) == null ? void 0 : r.length) ?? 0;
1926
+ return d ? `${d} selected` : t.placeholder ?? "";
1894
1927
  }
1895
- return ((c = t.options.find((u) => u.value === t.modelValue)) == null ? void 0 : c.label) ?? "";
1928
+ return ((y = t.options.find((d) => d.value === t.modelValue)) == null ? void 0 : y.label) ?? "";
1896
1929
  });
1897
- function A(r) {
1898
- var c;
1899
- return t.multiple ? !!((c = t.selected) != null && c.includes(r.value)) : t.selectedId != null ? r.id === t.selectedId : r.value === t.modelValue;
1930
+ function b(r) {
1931
+ var y;
1932
+ return t.multiple ? !!((y = t.selected) != null && y.includes(r.value)) : t.selectedId != null ? r.id === t.selectedId : r.value === t.modelValue;
1900
1933
  }
1901
- const L = $(() => !!t.menuTitle || t.options.some((r) => r.hint)), T = w(""), q = w(null), Q = $(() => {
1902
- const r = T.value.trim().toLowerCase();
1903
- return !t.searchable || !r ? t.options : t.options.filter((c) => `${c.label} ${c.hint ?? ""}`.toLowerCase().includes(r));
1904
- }), re = $(() => {
1934
+ const k = T(() => !!t.menuTitle || t.options.some((r) => r.hint)), O = A(""), Q = A(null), X = T(() => {
1935
+ const r = O.value.trim().toLowerCase();
1936
+ return !t.searchable || !r ? t.options : t.options.filter((y) => `${y.label} ${y.hint ?? ""}`.toLowerCase().includes(r));
1937
+ }), J = T(() => {
1905
1938
  const r = [];
1906
- let c;
1907
- for (const u of Q.value)
1908
- u.group !== c && (c = u.group, c && r.push({ heading: c })), r.push({ option: u });
1939
+ let y;
1940
+ for (const d of X.value)
1941
+ d.group !== y && (y = d.group, y && r.push({ heading: y })), r.push({ option: d });
1909
1942
  return r;
1910
- }), x = 5, I = 8;
1911
- function X() {
1912
- const r = N.value, c = v.value;
1913
- if (!r || !c) return;
1914
- const u = c.getBoundingClientRect(), S = window.innerWidth || document.documentElement.clientWidth, O = window.innerHeight || document.documentElement.clientHeight;
1915
- r.style.minWidth = `${Math.round(u.width)}px`, r.style.maxWidth = `${Math.max(180, Math.round(S - I * 2))}px`;
1916
- const Z = O - u.bottom - x - I, oa = u.top - x - I;
1917
- r.style.maxHeight = `${Math.max(120, Math.min(320, Math.max(Z, oa)))}px`;
1918
- const de = r.offsetHeight, sa = r.offsetWidth;
1919
- let ve = u.bottom + x;
1920
- ve + de > O - I && (ve = u.top - x - de >= I ? u.top - x - de : Math.max(I, O - de - I));
1921
- const ia = Math.min(Math.max(I, u.left), Math.max(I, S - sa - I));
1922
- r.style.top = `${Math.round(ve)}px`, r.style.left = `${Math.round(ia)}px`, r.style.visibility = "visible";
1943
+ }), x = 5, S = 8;
1944
+ function Z() {
1945
+ const r = H.value, y = f.value;
1946
+ if (!r || !y) return;
1947
+ const d = y.getBoundingClientRect(), L = window.innerWidth || document.documentElement.clientWidth, R = window.innerHeight || document.documentElement.clientHeight;
1948
+ r.style.minWidth = `${Math.round(d.width)}px`, r.style.maxWidth = `${Math.max(180, Math.round(L - S * 2))}px`;
1949
+ const q = R - d.bottom - x - S, sa = d.top - x - S;
1950
+ r.style.maxHeight = `${Math.max(120, Math.min(320, Math.max(q, sa)))}px`;
1951
+ const ye = r.offsetHeight, ia = r.offsetWidth;
1952
+ let ge = d.bottom + x;
1953
+ ge + ye > R - S && (ge = d.top - x - ye >= S ? d.top - x - ye : Math.max(S, R - ye - S));
1954
+ const ra = Math.min(Math.max(S, d.left), Math.max(S, L - ia - S));
1955
+ r.style.top = `${Math.round(ge)}px`, r.style.left = `${Math.round(ra)}px`, r.style.visibility = "visible";
1923
1956
  }
1924
- function le(r) {
1925
- var u, S;
1926
- const c = r.target;
1927
- c && ((u = m.value) != null && u.contains(c) || (S = N.value) != null && S.contains(c)) || k();
1957
+ function ue(r) {
1958
+ var d, L;
1959
+ const y = r.target;
1960
+ y && ((d = u.value) != null && d.contains(y) || (L = H.value) != null && L.contains(y)) || g();
1928
1961
  }
1929
- function J(r) {
1930
- const c = N.value, u = r.target;
1931
- if (c && u && u !== document && c.contains(u)) return;
1932
- const S = v.value;
1933
- if (!S) return;
1934
- const O = S.getBoundingClientRect(), Z = window.innerHeight || document.documentElement.clientHeight;
1935
- if (O.bottom < 0 || O.top > Z) {
1936
- k();
1962
+ function de(r) {
1963
+ const y = H.value, d = r.target;
1964
+ if (y && d && d !== document && y.contains(d)) return;
1965
+ const L = f.value;
1966
+ if (!L) return;
1967
+ const R = L.getBoundingClientRect(), q = window.innerHeight || document.documentElement.clientHeight;
1968
+ if (R.bottom < 0 || R.top > q) {
1969
+ g();
1937
1970
  return;
1938
1971
  }
1939
- X();
1972
+ Z();
1940
1973
  }
1941
- function g() {
1942
- document.addEventListener("click", le), document.addEventListener("scroll", J, !0), window.addEventListener("resize", k);
1974
+ function ce() {
1975
+ document.addEventListener("click", ue), document.addEventListener("scroll", de, !0), window.addEventListener("resize", g);
1943
1976
  }
1944
- function E() {
1945
- document.removeEventListener("click", le), document.removeEventListener("scroll", J, !0), window.removeEventListener("resize", k);
1977
+ function D() {
1978
+ document.removeEventListener("click", ue), document.removeEventListener("scroll", de, !0), window.removeEventListener("resize", g);
1946
1979
  }
1947
- async function H() {
1948
- var r, c, u;
1949
- t.disabled || l.value || (T.value = "", l.value = !0, await Ae(), X(), (r = q.value) == null || r.focus(), (u = (c = N.value) == null ? void 0 : c.querySelector(".fx-opt.is-on")) == null || u.scrollIntoView({ block: "nearest" }), g());
1980
+ async function E() {
1981
+ var r, y, d;
1982
+ t.disabled || l.value || (O.value = "", l.value = !0, await be(), Z(), (r = Q.value) == null || r.focus(), (d = (y = H.value) == null ? void 0 : y.querySelector(".fx-opt.is-on")) == null || d.scrollIntoView({ block: "nearest" }), ce());
1950
1983
  }
1951
- function k() {
1952
- l.value && (l.value = !1, T.value = "", E());
1984
+ function g() {
1985
+ l.value && (l.value = !1, O.value = "", D());
1953
1986
  }
1954
- Se(T, async () => {
1955
- l.value && (await Ae(), X());
1987
+ Ie(O, async () => {
1988
+ l.value && (await be(), Z());
1956
1989
  });
1957
- function F(r) {
1958
- var c;
1990
+ function B(r) {
1991
+ var y;
1959
1992
  if (r.key === "Escape")
1960
- r.preventDefault(), k(), (c = v.value) == null || c.focus();
1993
+ r.preventDefault(), g(), (y = f.value) == null || y.focus();
1961
1994
  else if (r.key === "Enter") {
1962
1995
  r.preventDefault();
1963
- const u = Q.value.find((S) => !S.disabled);
1964
- u && ue(u);
1996
+ const d = X.value.find((L) => !L.disabled);
1997
+ d && P(d);
1965
1998
  }
1966
1999
  }
1967
- function b() {
1968
- l.value ? k() : H();
2000
+ function _() {
2001
+ l.value ? g() : E();
1969
2002
  }
1970
- function ue(r) {
2003
+ function P(r) {
1971
2004
  if (!r.disabled) {
1972
2005
  if (t.multiple && !r.command) {
1973
2006
  n("toggle", r.value);
1974
2007
  return;
1975
2008
  }
1976
- if (k(), t.multiple) {
2009
+ if (g(), t.multiple) {
1977
2010
  n("update:modelValue", r.value);
1978
2011
  return;
1979
2012
  }
1980
2013
  r.value !== t.modelValue && n("update:modelValue", r.value);
1981
2014
  }
1982
2015
  }
1983
- const aa = $(() => t.options.filter((r) => !r.disabled));
1984
- function ta(r) {
1985
- const c = aa.value;
1986
- if (t.multiple || !c.length) {
1987
- H();
2016
+ const De = T(() => t.options.filter((r) => !r.disabled));
2017
+ function na(r) {
2018
+ const y = De.value;
2019
+ if (t.multiple || !y.length) {
2020
+ E();
1988
2021
  return;
1989
2022
  }
1990
- const u = c.findIndex((Z) => Z.value === t.modelValue), S = r === "Home" ? 0 : r === "End" ? c.length - 1 : r === "ArrowDown" ? Math.min(c.length - 1, (u < 0 ? -1 : u) + 1) : Math.max(0, (u < 0 ? 1 : u) - 1), O = c[S];
1991
- O && O.value !== t.modelValue ? n("update:modelValue", O.value) : H();
2023
+ const d = y.findIndex((q) => q.value === t.modelValue), L = r === "Home" ? 0 : r === "End" ? y.length - 1 : r === "ArrowDown" ? Math.min(y.length - 1, (d < 0 ? -1 : d) + 1) : Math.max(0, (d < 0 ? 1 : d) - 1), R = y[L];
2024
+ R && R.value !== t.modelValue ? n("update:modelValue", R.value) : E();
1992
2025
  }
1993
- function na(r) {
1994
- var c;
2026
+ function oa(r) {
2027
+ var y;
1995
2028
  if (r.key === "Escape") {
1996
2029
  if (!l.value) return;
1997
- r.preventDefault(), k(), (c = v.value) == null || c.focus();
2030
+ r.preventDefault(), g(), (y = f.value) == null || y.focus();
1998
2031
  return;
1999
2032
  }
2000
2033
  if (r.key === "Enter" || r.key === " ") {
2001
- r.preventDefault(), b();
2034
+ r.preventDefault(), _();
2002
2035
  return;
2003
2036
  }
2004
- r.key !== "ArrowDown" && r.key !== "ArrowUp" && r.key !== "Home" && r.key !== "End" || (r.preventDefault(), ta(r.key));
2037
+ r.key !== "ArrowDown" && r.key !== "ArrowUp" && r.key !== "Home" && r.key !== "End" || (r.preventDefault(), na(r.key));
2005
2038
  }
2006
- return Me(E), (r, c) => (P(), C("div", {
2039
+ return Le(D), (r, y) => (N(), C("div", {
2007
2040
  ref_key: "rootEl",
2008
- ref: m,
2009
- class: ye(["fx-sel", s.value])
2041
+ ref: u,
2042
+ class: pe(["fx-sel", s.value])
2010
2043
  }, [
2011
- B("button", ua({
2044
+ Y("button", da({
2012
2045
  ref_key: "btnEl",
2013
- ref: v
2046
+ ref: f
2014
2047
  }, r.$attrs, {
2015
2048
  type: "button",
2016
2049
  class: ["sch-input fx-btn", { "is-open": l.value }],
2017
2050
  disabled: e.disabled,
2018
2051
  "aria-haspopup": "listbox",
2019
2052
  "aria-expanded": l.value,
2020
- onClick: c[0] || (c[0] = (u) => b()),
2021
- onKeydown: na
2022
- }), U(p.value), 17, Cn),
2023
- (P(), la(da, {
2053
+ onClick: y[0] || (y[0] = (d) => _()),
2054
+ onKeydown: oa
2055
+ }), U(h.value), 17, Cn),
2056
+ (N(), ua(ca, {
2024
2057
  to: "body",
2025
- disabled: !Y.value
2058
+ disabled: !$.value
2026
2059
  }, [
2027
- B("div", Mn, [
2028
- l.value ? (P(), C("div", {
2060
+ Y("div", Mn, [
2061
+ l.value ? (N(), C("div", {
2029
2062
  key: 0,
2030
2063
  ref_key: "popEl",
2031
- ref: N,
2032
- class: ye(["fx-pop", { "fx-pop-rich": L.value }]),
2064
+ ref: H,
2065
+ class: pe(["fx-pop", { "fx-pop-rich": k.value }]),
2033
2066
  role: "listbox",
2034
2067
  "aria-multiselectable": e.multiple || void 0,
2035
2068
  style: { visibility: "hidden" }
2036
2069
  }, [
2037
- e.menuTitle ? (P(), C("div", Ln, U(e.menuTitle), 1)) : W("", !0),
2038
- e.searchable ? (P(), C("div", In, [
2039
- ca(B("input", {
2070
+ e.menuTitle ? (N(), C("div", Ln, U(e.menuTitle), 1)) : W("", !0),
2071
+ e.searchable ? (N(), C("div", In, [
2072
+ ya(Y("input", {
2040
2073
  ref_key: "searchEl",
2041
- ref: q,
2042
- "onUpdate:modelValue": c[1] || (c[1] = (u) => T.value = u),
2074
+ ref: Q,
2075
+ "onUpdate:modelValue": y[1] || (y[1] = (d) => O.value = d),
2043
2076
  class: "sch-input fx-pop-q",
2044
2077
  type: "search",
2045
2078
  placeholder: "Search",
2046
2079
  autocomplete: "off",
2047
2080
  spellcheck: "false",
2048
2081
  "aria-label": "Search",
2049
- onKeydown: F
2082
+ onKeydown: B
2050
2083
  }, null, 544), [
2051
- [ya, T.value]
2084
+ [ma, O.value]
2052
2085
  ])
2053
2086
  ])) : W("", !0),
2054
- e.searchable && !re.value.length ? (P(), C("div", Rn, "No matches")) : W("", !0),
2055
- (P(!0), C(ge, null, ma(re.value, (u) => (P(), C(ge, {
2056
- key: "heading" in u ? `heading:${u.heading}` : `option:${u.option.value}`
2087
+ e.searchable && !J.value.length ? (N(), C("div", Rn, "No matches")) : W("", !0),
2088
+ (N(!0), C(He, null, pa(J.value, (d) => (N(), C(He, {
2089
+ key: "heading" in d ? `heading:${d.heading}` : `option:${d.option.value}`
2057
2090
  }, [
2058
- "heading" in u ? (P(), C("div", On, U(u.heading), 1)) : (P(), C("div", {
2091
+ "heading" in d ? (N(), C("div", On, U(d.heading), 1)) : (N(), C("div", {
2059
2092
  key: 1,
2060
- class: ye(["fx-opt", {
2061
- "is-on": A(u.option),
2062
- "is-off": u.option.disabled,
2063
- "is-new": u.option.command
2093
+ class: pe(["fx-opt", {
2094
+ "is-on": b(d.option),
2095
+ "is-off": d.option.disabled,
2096
+ "is-new": d.option.command
2064
2097
  }]),
2065
2098
  role: "option",
2066
- "aria-selected": A(u.option),
2067
- onClick: (S) => ue(u.option)
2099
+ "aria-selected": b(d.option),
2100
+ onClick: (L) => P(d.option)
2068
2101
  }, [
2069
- c[2] || (c[2] = B("span", {
2102
+ y[2] || (y[2] = Y("span", {
2070
2103
  class: "fx-tick",
2071
2104
  "aria-hidden": "true"
2072
2105
  }, [
2073
- B("svg", {
2106
+ Y("svg", {
2074
2107
  width: "11",
2075
2108
  height: "11",
2076
2109
  viewBox: "0 0 16 16",
2077
2110
  fill: "none"
2078
2111
  }, [
2079
- B("path", {
2112
+ Y("path", {
2080
2113
  d: "m3.5 8.4 3 3 6-7",
2081
2114
  stroke: "currentColor",
2082
2115
  "stroke-width": "2.2",
@@ -2085,11 +2118,11 @@ const kn = ["data-hierarchy", "data-size", "data-icon"], xo = /* @__PURE__ */ Le
2085
2118
  })
2086
2119
  ])
2087
2120
  ], -1)),
2088
- L.value ? (P(), C("span", $n, [
2089
- B("b", null, U(u.option.label), 1),
2090
- u.option.hint ? (P(), C("small", Yn, U(u.option.hint), 1)) : W("", !0)
2091
- ])) : (P(), C(ge, { key: 1 }, [
2092
- pa(U(u.option.label), 1)
2121
+ k.value ? (N(), C("span", $n, [
2122
+ Y("b", null, U(d.option.label), 1),
2123
+ d.option.hint ? (N(), C("small", Yn, U(d.option.hint), 1)) : W("", !0)
2124
+ ])) : (N(), C(He, { key: 1 }, [
2125
+ fa(U(d.option.label), 1)
2093
2126
  ], 64))
2094
2127
  ], 10, Tn))
2095
2128
  ], 64))), 128))
@@ -2098,7 +2131,7 @@ const kn = ["data-hierarchy", "data-size", "data-icon"], xo = /* @__PURE__ */ Le
2098
2131
  ], 8, ["disabled"]))
2099
2132
  ], 2));
2100
2133
  }
2101
- }), xn = ["id", "aria-labelledby", "aria-label"], Ue = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])', _o = /* @__PURE__ */ Le({
2134
+ }), xn = ["id", "aria-labelledby", "aria-label"], We = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])', _o = /* @__PURE__ */ Re({
2102
2135
  __name: "ScheduleModal",
2103
2136
  props: {
2104
2137
  open: { type: Boolean },
@@ -2110,52 +2143,52 @@ const kn = ["data-hierarchy", "data-size", "data-icon"], xo = /* @__PURE__ */ Le
2110
2143
  },
2111
2144
  emits: ["close"],
2112
2145
  setup(e, { emit: a }) {
2113
- const t = e, n = a, i = w(null);
2146
+ const t = e, n = a, i = A(null);
2114
2147
  let s = null;
2115
2148
  function l() {
2116
- Ae(() => {
2117
- const m = i.value;
2118
- m && (m.querySelector(Ue) ?? m).focus();
2149
+ be(() => {
2150
+ const u = i.value;
2151
+ u && (u.querySelector(We) ?? u).focus();
2119
2152
  });
2120
2153
  }
2121
- function o(m) {
2154
+ function o(u) {
2122
2155
  if (!t.open) return;
2123
- if (m.key === "Escape") {
2124
- m.preventDefault(), n("close");
2156
+ if (u.key === "Escape") {
2157
+ u.preventDefault(), n("close");
2125
2158
  return;
2126
2159
  }
2127
- if (m.key !== "Tab" || !i.value) return;
2128
- const v = Array.from(i.value.querySelectorAll(Ue));
2129
- if (!v.length) return;
2130
- const N = v[0], Y = v[v.length - 1];
2131
- m.shiftKey && document.activeElement === N ? (m.preventDefault(), Y.focus()) : !m.shiftKey && document.activeElement === Y && (m.preventDefault(), N.focus());
2160
+ if (u.key !== "Tab" || !i.value) return;
2161
+ const f = Array.from(i.value.querySelectorAll(We));
2162
+ if (!f.length) return;
2163
+ const H = f[0], $ = f[f.length - 1];
2164
+ u.shiftKey && document.activeElement === H ? (u.preventDefault(), $.focus()) : !u.shiftKey && document.activeElement === $ && (u.preventDefault(), H.focus());
2132
2165
  }
2133
- return Se(
2166
+ return Ie(
2134
2167
  () => t.open,
2135
- (m) => {
2136
- m ? (s = document.activeElement instanceof HTMLElement ? document.activeElement : null, l()) : (s == null || s.focus(), s = null);
2168
+ (u) => {
2169
+ u ? (s = document.activeElement instanceof HTMLElement ? document.activeElement : null, l()) : (s == null || s.focus(), s = null);
2137
2170
  },
2138
2171
  { immediate: !0 }
2139
- ), Ce(() => document.addEventListener("keydown", o)), Me(() => {
2172
+ ), Se(() => document.addEventListener("keydown", o)), Le(() => {
2140
2173
  document.removeEventListener("keydown", o), s = null;
2141
- }), (m, v) => e.open ? (P(), C("div", {
2174
+ }), (u, f) => e.open ? (N(), C("div", {
2142
2175
  key: 0,
2143
2176
  class: "modal-overlay open",
2144
- onClick: v[0] || (v[0] = fa((N) => n("close"), ["self"]))
2177
+ onClick: f[0] || (f[0] = ha((H) => n("close"), ["self"]))
2145
2178
  }, [
2146
- B("div", {
2179
+ Y("div", {
2147
2180
  id: e.id,
2148
2181
  ref_key: "panel",
2149
2182
  ref: i,
2150
- class: ye(["schedule-modal-panel", e.panelClass]),
2151
- style: ha(e.panelStyle),
2183
+ class: pe(["schedule-modal-panel", e.panelClass]),
2184
+ style: va(e.panelStyle),
2152
2185
  role: "dialog",
2153
2186
  "aria-modal": "true",
2154
2187
  "aria-labelledby": e.labelledBy,
2155
2188
  "aria-label": e.label,
2156
2189
  tabindex: "-1"
2157
2190
  }, [
2158
- We(m.$slots, "default")
2191
+ ze(u.$slots, "default")
2159
2192
  ], 14, xn)
2160
2193
  ])) : W("", !0);
2161
2194
  }
@@ -2163,40 +2196,40 @@ const kn = ["data-hierarchy", "data-size", "data-icon"], xo = /* @__PURE__ */ Le
2163
2196
  export {
2164
2197
  no as $,
2165
2198
  No as A,
2166
- be as B,
2167
- Qn as C,
2199
+ Ne as B,
2200
+ Xn as C,
2168
2201
  Ea as D,
2169
- Jn as E,
2202
+ Zn as E,
2170
2203
  ro as F,
2171
2204
  Mo as G,
2172
- wa as H,
2205
+ Ha as H,
2173
2206
  Ao as I,
2174
- wo as J,
2175
- Ho as K,
2176
- qe as L,
2177
- D as M,
2178
- _ as N,
2207
+ Ho as J,
2208
+ wo as K,
2209
+ Je as L,
2210
+ w as M,
2211
+ F as N,
2179
2212
  Sa as O,
2180
2213
  Pa as P,
2181
- Ye as Q,
2182
- qn as R,
2214
+ xe as Q,
2215
+ Qn as R,
2183
2216
  ko as S,
2184
2217
  Lo as T,
2185
- Ze as U,
2186
- Xn as V,
2218
+ aa as U,
2219
+ Jn as V,
2187
2220
  Po as W,
2188
- ie as X,
2221
+ le as X,
2189
2222
  Pn as Y,
2190
- Xe as Z,
2223
+ re as Z,
2191
2224
  ne as _,
2192
2225
  Oo as a,
2193
- ao as a0,
2194
- to as a1,
2195
- so as a2,
2196
- Ie as a3,
2226
+ so as a0,
2227
+ Oe as a1,
2228
+ to as a2,
2229
+ ao as a3,
2197
2230
  io as a4,
2198
2231
  hn as a5,
2199
- se as a6,
2232
+ ie as a6,
2200
2233
  vo as a7,
2201
2234
  fo as a8,
2202
2235
  ho as a9,
@@ -2206,13 +2239,13 @@ export {
2206
2239
  Na as ad,
2207
2240
  Vn as ae,
2208
2241
  $a as af,
2209
- mn as ag,
2210
- mo as ah,
2211
- Te as ai,
2212
- $e as aj,
2213
- me as ak,
2214
- ke as al,
2215
- $o as am,
2242
+ $e as ag,
2243
+ $o as ah,
2244
+ mn as ai,
2245
+ mo as aj,
2246
+ Ye as ak,
2247
+ fe as al,
2248
+ Me as am,
2216
2249
  La as an,
2217
2250
  xo as ao,
2218
2251
  Bo as ap,
@@ -2222,13 +2255,13 @@ export {
2222
2255
  Yo as at,
2223
2256
  co as au,
2224
2257
  lo as av,
2225
- pe as aw,
2258
+ se as aw,
2226
2259
  uo as ax,
2227
2260
  M as b,
2228
2261
  To as c,
2229
2262
  V as d,
2230
2263
  Gn as e,
2231
- d as f,
2264
+ c as f,
2232
2265
  cn as g,
2233
2266
  bo as h,
2234
2267
  Ca as i,
@@ -2237,16 +2270,16 @@ export {
2237
2270
  Do as l,
2238
2271
  go as m,
2239
2272
  Eo as n,
2240
- y as o,
2273
+ m as o,
2241
2274
  Co as p,
2242
- Ne as q,
2275
+ Ce as q,
2243
2276
  oo as r,
2244
2277
  Aa as s,
2245
2278
  eo as t,
2246
- Pe as u,
2279
+ ke as u,
2247
2280
  jn as v,
2248
- Zn as w,
2281
+ qn as w,
2249
2282
  Ro as x,
2250
2283
  Kn as y,
2251
- Ve as z
2284
+ Ge as z
2252
2285
  };