@feedmepos/mf-hrm-portal 2.3.0-dev.7 → 2.3.0-dev.9
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.
- package/dist/{ApprovalCodeList-J-NC4Z5M.js → ApprovalCodeList-BDpxEJpC.js} +5 -5
- package/dist/{AuditLogList-B1Sb8HDk.js → AuditLogList-Dgwj1gz8.js} +4 -4
- package/dist/{ConditionBuilderForm.vue_vue_type_script_setup_true_lang-BlXgJvsO.js → ConditionBuilderForm.vue_vue_type_script_setup_true_lang-BBK2gl7r.js} +2 -2
- package/dist/{EmployeeList-DprCwGC9.js → EmployeeList-C8cbVcmY.js} +6 -6
- package/dist/{GrantUserList-BWeZAzUC.js → GrantUserList-zul0_Dlm.js} +6 -6
- package/dist/{Main-Dna6CkrV.js → Main-5TsFTFpc.js} +8 -8
- package/dist/{Main-BZCIlbf3.js → Main-Cjo4FMZZ.js} +5 -5
- package/dist/{Main-CGlnX97k.js → Main-DSr9KbjT.js} +11 -11
- package/dist/{PermissionSetList-DuJjihft.js → PermissionSetList-CDhiiu37.js} +7 -7
- package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-RI8tMDoe.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-DoK944l0.js} +971 -971
- 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
- package/dist/{RoleList-Jn8EeYqo.js → RoleList-DEbOPQD_.js} +9 -9
- package/dist/ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-Cx9jFgBS.js +492 -0
- package/dist/ScheduleGeneralPage-B8PWNsc2.js +776 -0
- package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-DLpFG65j.js → ScheduleModal.vue_vue_type_script_setup_true_lang-V1sZ_xhO.js} +858 -793
- package/dist/SchedulePage-ndLByVBl.js +17785 -0
- package/dist/{SchedulePositionPage-B7S3G8gO.js → SchedulePositionPage-Cuv4ydOK.js} +18 -18
- package/dist/{TeamMemberList-Bx_I5hO6.js → TeamMemberList-DpCGqHCk.js} +10 -10
- package/dist/{TimesheetList-DjDoOqih.js → TimesheetList-B7HAC5zS.js} +7 -7
- package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-pRgaW5ro.js → TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-BGD6m5M-.js} +3 -3
- package/dist/{app-uVAVK4Qd.js → app-Lh0cqgHy.js} +20 -20
- package/dist/app.js +1 -1
- package/dist/{approval-code-C9DmR4Md.js → approval-code-DHsUgc4K.js} +1 -1
- package/dist/{dayjs.min-CdEA8bsz.js → dayjs.min-joq4stsa.js} +1 -1
- package/dist/{employee-mq8mZRLE.js → employee-BPmp9c6i.js} +4 -4
- package/dist/{grant-user-Bv-pJ9Wt.js → grant-user-qzKHFTro.js} +1 -1
- package/dist/{iteration-B5TN8t9O.js → iteration-jvdTHQUx.js} +1 -1
- package/dist/{lodash-DxYGKySa.js → lodash-CIAEpr9s.js} +1 -1
- package/dist/{restaurant-D7PEQjPY.js → restaurant-BbYRA_IT.js} +4 -3
- package/dist/{role-DiyMdYM9.js → role-Dd1TUMhn.js} +2 -2
- package/dist/{rule-BGlU-EJ_.js → rule-DmxI7qEY.js} +3 -3
- package/dist/src/api/schedule/index.d.ts +4 -1
- package/dist/src/types/schedule.d.ts +3 -4
- package/dist/src/views/scheduling/components/ScheduleAreaRows.vue.d.ts +0 -8
- package/dist/src/views/scheduling/components/ScheduleBoardAreaRows.vue.d.ts +0 -5
- package/dist/src/views/scheduling/components/ScheduleBoardEditOverlays.vue.d.ts +0 -2
- package/dist/src/views/scheduling/components/ScheduleBoardEmployeeRows.vue.d.ts +0 -7
- package/dist/src/views/scheduling/components/ScheduleBoardInteractionOverlays.vue.d.ts +0 -6
- package/dist/src/views/scheduling/components/ScheduleContextMenu.vue.d.ts +1 -5
- package/dist/src/views/scheduling/components/{ScheduleAssignEmployeePopover.vue.d.ts → ScheduleOnboardingAssignPositionModal.vue.d.ts} +2 -2
- package/dist/src/views/scheduling/components/SchedulePublishShareArt.vue.d.ts +2 -0
- package/dist/src/views/scheduling/components/ScheduleSelect.vue.d.ts +10 -0
- package/dist/src/views/scheduling/components/ScheduleStaffRows.vue.d.ts +0 -10
- package/dist/src/views/scheduling/composables/schedule-add-employee-form.d.ts +12 -8
- package/dist/src/views/scheduling/composables/useScheduleAddEmployee.d.ts +21 -9
- package/dist/src/views/scheduling/composables/useScheduleAreaBoard.d.ts +0 -13
- package/dist/src/views/scheduling/composables/useScheduleAreaDragDrop.d.ts +2 -8
- package/dist/src/views/scheduling/composables/useScheduleAutoSchedule.d.ts +3 -0
- package/dist/src/views/scheduling/composables/useScheduleBoard.d.ts +29 -4
- package/dist/src/views/scheduling/composables/useScheduleDayTimeline.d.ts +0 -3
- package/dist/src/views/scheduling/composables/useScheduleDemand.d.ts +3 -5
- package/dist/src/views/scheduling/composables/useScheduleDemandSheet.d.ts +6 -3
- package/dist/src/views/scheduling/composables/useScheduleEmployeeAccess.d.ts +7 -2
- package/dist/src/views/scheduling/composables/useScheduleEmployeeAvailability.d.ts +1 -1
- package/dist/src/views/scheduling/composables/useScheduleEmployeeCandidates.d.ts +1 -0
- package/dist/src/views/scheduling/composables/useScheduleEmployeePersistence.d.ts +4 -0
- package/dist/src/views/scheduling/composables/useScheduleEmployeeValidation.d.ts +2 -0
- package/dist/src/views/scheduling/composables/useScheduleGapPopover.d.ts +2 -0
- package/dist/src/views/scheduling/composables/useScheduleOnboardingEmployees.d.ts +21 -3
- package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +223 -21
- package/dist/src/views/scheduling/composables/useSchedulePageOverlays.d.ts +0 -4
- package/dist/src/views/scheduling/composables/useSchedulePositionModal.d.ts +1 -0
- package/dist/src/views/scheduling/composables/useSchedulePositions.d.ts +1 -1
- package/dist/src/views/scheduling/composables/useSchedulePublish.d.ts +2 -0
- package/dist/src/views/scheduling/composables/useScheduleRoster.d.ts +24 -4
- package/dist/src/views/scheduling/composables/useScheduleSettings.d.ts +7 -2
- package/dist/src/views/scheduling/composables/useScheduleShiftActions.d.ts +12 -2
- package/dist/src/views/scheduling/composables/useScheduleShiftDraft.d.ts +1 -0
- package/dist/src/views/scheduling/composables/useScheduleShiftPopover.d.ts +15 -3
- package/dist/src/views/scheduling/country-rules/index.d.ts +4 -4
- package/dist/src/views/scheduling/data.d.ts +5 -1
- package/dist/src/views/scheduling/schedule-state.d.ts +76 -12
- package/dist/src/views/scheduling/schedule-store.d.ts +13 -5
- package/dist/src/views/scheduling/types.d.ts +22 -5
- package/dist/style.css +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useAppStore-d_nHyK5u.js → useAppStore-BoLkvkE2.js} +1 -1
- package/dist/{useLoading-JFoghhRz.js → useLoading-Ch1AUYT1.js} +1 -1
- package/dist/{useReportPermissions-CV0b4SBk.js → useReportPermissions-DM3GOFCC.js} +3 -3
- package/package.json +1 -1
- package/dist/ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-CV0DRK1L.js +0 -470
- package/dist/ScheduleGeneralPage-DMMqTMQs.js +0 -666
- package/dist/SchedulePage-3MWnazgL.js +0 -18251
- package/dist/src/views/scheduling/components/ScheduleAllShiftsRow.vue.d.ts +0 -22
- package/dist/src/views/scheduling/components/ScheduleStackPopover.vue.d.ts +0 -14
- package/dist/src/views/scheduling/composables/useScheduleAllShiftsRow.d.ts +0 -77
- package/dist/src/views/scheduling/composables/useScheduleAssign.d.ts +0 -124
- package/dist/src/views/scheduling/composables/useScheduleOpenShiftCard.d.ts +0 -23
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { onMounted as
|
|
2
|
-
import { useRoute as
|
|
3
|
-
import { useCoreStore as
|
|
4
|
-
import { g as
|
|
5
|
-
import { E as
|
|
6
|
-
function
|
|
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-BPmp9c6i.js";
|
|
6
|
+
function zn(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
|
-
|
|
14
|
+
Ce(() => {
|
|
15
15
|
var n;
|
|
16
16
|
a = ((n = e.value) == null ? void 0 : n.closest(".sch-page")) ?? null, t(), window.addEventListener("resize", t);
|
|
17
|
-
}),
|
|
17
|
+
}), Me(() => {
|
|
18
18
|
window.removeEventListener("resize", t), a && (a.style.height = "");
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function be(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
|
}
|
|
@@ -26,89 +26,89 @@ function wa(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
|
-
function
|
|
30
|
-
const t =
|
|
31
|
-
let n =
|
|
29
|
+
function Aa(e, a) {
|
|
30
|
+
const t = be(e);
|
|
31
|
+
let n = be(a);
|
|
32
32
|
return n <= t && (n += 1440), [t, n];
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
const [t, n] =
|
|
34
|
+
function Ve(e, a) {
|
|
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 = (
|
|
40
|
-
return n ? `${
|
|
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;
|
|
40
|
+
return n ? `${s}:${String(n).padStart(2, "0")}${i}` : `${s}${i}`;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function Vn(e) {
|
|
43
43
|
return Ea(wa(e % 1440));
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function Ke(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 [
|
|
50
|
-
let m =
|
|
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
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
|
|
55
|
-
var
|
|
56
|
-
const t = a ??
|
|
54
|
+
function Kn(e, a) {
|
|
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);
|
|
57
57
|
return Math.max(0, t - Math.min(t, n));
|
|
58
58
|
}
|
|
59
|
-
function
|
|
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
|
|
63
|
+
const ae = 500, ba = 10, Oe = 6, jn = 1500, Ge = 1e6, D = {
|
|
64
64
|
async listEmployeeProfiles(e) {
|
|
65
|
-
return
|
|
66
|
-
await
|
|
65
|
+
return h(
|
|
66
|
+
await f("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
|
|
73
|
-
await
|
|
72
|
+
return h(
|
|
73
|
+
await f(`restaurants/${e}/schedules`).get("employee-configs")
|
|
74
74
|
);
|
|
75
75
|
},
|
|
76
76
|
async saveEmployeeConfigs(e, a) {
|
|
77
|
-
return
|
|
78
|
-
await
|
|
77
|
+
return h(
|
|
78
|
+
await f(`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
|
|
86
|
-
await
|
|
85
|
+
return h(
|
|
86
|
+
await f(`restaurants/${e}/schedules`).get("settings")
|
|
87
87
|
);
|
|
88
88
|
},
|
|
89
89
|
async saveSettings(e, a) {
|
|
90
|
-
return
|
|
91
|
-
await
|
|
90
|
+
return h(
|
|
91
|
+
await f(`restaurants/${e}/schedules`).post("settings", a)
|
|
92
92
|
);
|
|
93
93
|
},
|
|
94
94
|
async generateAutoSchedule(e, a) {
|
|
95
|
-
return
|
|
96
|
-
await
|
|
95
|
+
return h(
|
|
96
|
+
await f(`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
|
|
104
|
-
await
|
|
103
|
+
return h(
|
|
104
|
+
await f(`restaurants/${e}/schedules`).get(
|
|
105
105
|
"auto-schedule/capabilities"
|
|
106
106
|
)
|
|
107
107
|
);
|
|
108
108
|
},
|
|
109
109
|
async applyAutoSchedule(e, a) {
|
|
110
|
-
return
|
|
111
|
-
await
|
|
110
|
+
return h(
|
|
111
|
+
await f(`restaurants/${e}/schedules`).post(
|
|
112
112
|
"auto-schedule/apply",
|
|
113
113
|
a
|
|
114
114
|
)
|
|
@@ -116,81 +116,93 @@ 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
|
|
120
|
-
await
|
|
119
|
+
return h(
|
|
120
|
+
await f(`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
|
|
127
|
-
await
|
|
126
|
+
return h(
|
|
127
|
+
await f(`restaurants/${e}/schedules`).post("time-off", a)
|
|
128
128
|
);
|
|
129
129
|
},
|
|
130
130
|
async updateTimeOffStatus(e, a, t) {
|
|
131
|
-
return
|
|
132
|
-
await
|
|
131
|
+
return h(
|
|
132
|
+
await f(`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
|
|
139
|
+
await f(`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
|
|
143
|
+
return h(await f("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
|
|
148
|
-
await
|
|
147
|
+
return h(
|
|
148
|
+
await f("schedules").post("employees", { employeeId: a, ...t })
|
|
149
149
|
);
|
|
150
150
|
},
|
|
151
|
+
async validatePosAccess(e) {
|
|
152
|
+
await f("schedules").post("employees/validate-pos-access", e);
|
|
153
|
+
},
|
|
151
154
|
/** Positions are shared across the business. */
|
|
152
155
|
async createPosition(e) {
|
|
153
|
-
return
|
|
156
|
+
return h(await f("schedules").post("positions", e));
|
|
154
157
|
},
|
|
155
158
|
async updatePosition(e, a) {
|
|
156
|
-
return
|
|
159
|
+
return h(await f("schedules").post(`positions/${e}`, a));
|
|
157
160
|
},
|
|
158
161
|
/** Deleting one position is `deletePositions` with a single-id array — the backend's
|
|
159
162
|
* `DELETE positions/:id` route is gone; this is now `DELETE positions?ids=`. */
|
|
160
163
|
async deletePosition(e) {
|
|
161
|
-
await
|
|
164
|
+
await f("schedules").delete("positions", {
|
|
162
165
|
params: { ids: e }
|
|
163
166
|
});
|
|
164
167
|
},
|
|
165
168
|
/** Creates one flat demand interval. */
|
|
166
169
|
async createDemand(e, a) {
|
|
167
|
-
return
|
|
168
|
-
await
|
|
170
|
+
return h(
|
|
171
|
+
await f(`restaurants/${e}/schedules`).post("demands", a)
|
|
169
172
|
);
|
|
170
173
|
},
|
|
171
174
|
/** Deletes a batch of demands in one request — e.g. `saveDemand` replacing a whole
|
|
172
175
|
* day/weekday's demand rows wholesale. Deleting one demand is just this with a single-id
|
|
173
176
|
* array. */
|
|
174
177
|
async deleteDemands(e, a) {
|
|
175
|
-
return
|
|
176
|
-
await
|
|
178
|
+
return h(
|
|
179
|
+
await f(`restaurants/${e}/schedules`).delete("demands", {
|
|
177
180
|
params: { ids: a.join(",") }
|
|
178
181
|
})
|
|
179
182
|
);
|
|
180
183
|
},
|
|
181
184
|
/** Atomically replaces one date/weekday's flattened demand rows. */
|
|
182
185
|
async replaceDemands(e, a) {
|
|
183
|
-
return
|
|
184
|
-
await
|
|
186
|
+
return h(
|
|
187
|
+
await f(`restaurants/${e}/schedules`).post(
|
|
185
188
|
"demands/replace",
|
|
186
189
|
a
|
|
187
190
|
)
|
|
188
191
|
);
|
|
189
192
|
},
|
|
193
|
+
/** Atomically replaces several date/weekday demand generations. */
|
|
194
|
+
async bulkReplaceDemands(e, a) {
|
|
195
|
+
return h(
|
|
196
|
+
await f(`restaurants/${e}/schedules`).post(
|
|
197
|
+
"demands/bulk-replace",
|
|
198
|
+
a
|
|
199
|
+
)
|
|
200
|
+
);
|
|
201
|
+
},
|
|
190
202
|
/** Replaces one date's note/holiday-mark. All three fields back to empty/false clears it. */
|
|
191
203
|
async saveScheduleDay(e, a, t) {
|
|
192
|
-
return
|
|
193
|
-
await
|
|
204
|
+
return h(
|
|
205
|
+
await f(`restaurants/${e}/schedules`).post(
|
|
194
206
|
`days/${a}`,
|
|
195
207
|
t
|
|
196
208
|
)
|
|
@@ -198,13 +210,13 @@ const Q = 500, Aa = 10, ke = 6, Vn = 1500, Fe = 1e6, D = {
|
|
|
198
210
|
},
|
|
199
211
|
/** A one-off shift assignment. */
|
|
200
212
|
async createAssignment(e, a) {
|
|
201
|
-
return
|
|
202
|
-
await
|
|
213
|
+
return h(
|
|
214
|
+
await f(`restaurants/${e}/schedules`).post("assignments", a)
|
|
203
215
|
);
|
|
204
216
|
},
|
|
205
217
|
async updateAssignment(e, a, t) {
|
|
206
|
-
return
|
|
207
|
-
await
|
|
218
|
+
return h(
|
|
219
|
+
await f(`restaurants/${e}/schedules`).patch(
|
|
208
220
|
`assignments/${a}`,
|
|
209
221
|
t
|
|
210
222
|
)
|
|
@@ -212,8 +224,8 @@ const Q = 500, Aa = 10, ke = 6, Vn = 1500, Fe = 1e6, D = {
|
|
|
212
224
|
},
|
|
213
225
|
/** Atomically applies assignment updates, creates, and deletes used by moves and swaps. */
|
|
214
226
|
async bulkSaveAssignments(e, a) {
|
|
215
|
-
return
|
|
216
|
-
await
|
|
227
|
+
return h(
|
|
228
|
+
await f(`restaurants/${e}/schedules`).post(
|
|
217
229
|
"assignments/bulk",
|
|
218
230
|
a
|
|
219
231
|
)
|
|
@@ -223,8 +235,8 @@ const Q = 500, Aa = 10, ke = 6, Vn = 1500, Fe = 1e6, D = {
|
|
|
223
235
|
* getting replaced wholesale. Deleting one assignment is just this with a single-id
|
|
224
236
|
* array. */
|
|
225
237
|
async deleteAssignments(e, a) {
|
|
226
|
-
return
|
|
227
|
-
await
|
|
238
|
+
return h(
|
|
239
|
+
await f(`restaurants/${e}/schedules`).delete("assignments", {
|
|
228
240
|
params: { ids: a.join(",") }
|
|
229
241
|
})
|
|
230
242
|
);
|
|
@@ -232,37 +244,37 @@ const Q = 500, Aa = 10, ke = 6, Vn = 1500, Fe = 1e6, D = {
|
|
|
232
244
|
/** Flips a batch of assignments to one status in a single request — e.g. Publish sending
|
|
233
245
|
* every DRAFT shift on the board to PUBLISHED at once. */
|
|
234
246
|
async bulkUpdateAssignmentStatus(e, a) {
|
|
235
|
-
return
|
|
236
|
-
await
|
|
247
|
+
return h(
|
|
248
|
+
await f(`restaurants/${e}/schedules`).patch(
|
|
237
249
|
"assignments/bulk-status",
|
|
238
250
|
a
|
|
239
251
|
)
|
|
240
252
|
);
|
|
241
253
|
}
|
|
242
|
-
},
|
|
243
|
-
payload:
|
|
244
|
-
loading:
|
|
245
|
-
rosterLoading:
|
|
246
|
-
loadError:
|
|
247
|
-
scheduleSetupCompleted:
|
|
248
|
-
dataVersion:
|
|
249
|
-
outletId:
|
|
250
|
-
restaurantEmployees:
|
|
251
|
-
employeeConfigs:
|
|
252
|
-
employeeOutletIds:
|
|
253
|
-
businessEmployees:
|
|
254
|
-
positions:
|
|
255
|
-
positionRecords:
|
|
256
|
-
rolePositions:
|
|
257
|
-
outlet:
|
|
258
|
-
locationOptions:
|
|
259
|
-
locationLabelById:
|
|
260
|
-
departmentOptions:
|
|
261
|
-
compensationGroupOptions:
|
|
262
|
-
compensationGroupMeta:
|
|
263
|
-
existingStaff:
|
|
264
|
-
shiftTemplates:
|
|
265
|
-
rules:
|
|
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({
|
|
266
278
|
coverage: {},
|
|
267
279
|
openFrom: "00:00",
|
|
268
280
|
openTo: "24:00",
|
|
@@ -272,13 +284,13 @@ const Q = 500, Aa = 10, ke = 6, Vn = 1500, Fe = 1e6, D = {
|
|
|
272
284
|
REST_DAY: { regular: 1, overtime: 2 },
|
|
273
285
|
PUBLIC_HOLIDAY: { regular: 2, overtime: 3 }
|
|
274
286
|
},
|
|
275
|
-
otAfterDaily: 0,
|
|
276
287
|
salesForecast: 0,
|
|
277
288
|
closedWeekdays: [],
|
|
278
289
|
labourTarget: 0,
|
|
279
290
|
budgetFromSales: !1,
|
|
280
291
|
budget: 0,
|
|
281
|
-
otCapHours:
|
|
292
|
+
otCapHours: null,
|
|
293
|
+
workingHours: { minHoursPerDay: null, maxHoursPerDay: 8, maxHoursPerWeek: 45 },
|
|
282
294
|
otBudget: 0,
|
|
283
295
|
notify: {
|
|
284
296
|
waConnected: !1,
|
|
@@ -289,163 +301,171 @@ const Q = 500, Aa = 10, ke = 6, Vn = 1500, Fe = 1e6, D = {
|
|
|
289
301
|
})
|
|
290
302
|
}, {
|
|
291
303
|
payload: d,
|
|
292
|
-
loading:
|
|
293
|
-
rosterLoading:
|
|
294
|
-
loadError:
|
|
295
|
-
scheduleSetupCompleted:
|
|
296
|
-
dataVersion:
|
|
304
|
+
loading: Te,
|
|
305
|
+
rosterLoading: $e,
|
|
306
|
+
loadError: me,
|
|
307
|
+
scheduleSetupCompleted: qe,
|
|
308
|
+
dataVersion: V,
|
|
297
309
|
outletId: y,
|
|
298
|
-
restaurantEmployees:
|
|
299
|
-
employeeConfigs:
|
|
300
|
-
employeeOutletIds:
|
|
301
|
-
businessEmployees:
|
|
302
|
-
positions:
|
|
303
|
-
positionRecords:
|
|
304
|
-
rolePositions:
|
|
310
|
+
restaurantEmployees: pe,
|
|
311
|
+
employeeConfigs: _,
|
|
312
|
+
employeeOutletIds: Qe,
|
|
313
|
+
businessEmployees: He,
|
|
314
|
+
positions: Pa,
|
|
315
|
+
positionRecords: K,
|
|
316
|
+
rolePositions: qn,
|
|
305
317
|
outlet: Na,
|
|
306
|
-
locationOptions:
|
|
307
|
-
locationLabelById:
|
|
308
|
-
compensationGroupMeta:
|
|
309
|
-
existingStaff:
|
|
310
|
-
shiftTemplates:
|
|
311
|
-
rules:
|
|
312
|
-
} =
|
|
313
|
-
function
|
|
314
|
-
const e =
|
|
315
|
-
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.
|
|
318
|
+
locationOptions: Ye,
|
|
319
|
+
locationLabelById: ne,
|
|
320
|
+
compensationGroupMeta: Qn,
|
|
321
|
+
existingStaff: Xn,
|
|
322
|
+
shiftTemplates: Jn,
|
|
323
|
+
rules: M
|
|
324
|
+
} = je;
|
|
325
|
+
function ka() {
|
|
326
|
+
const e = je.rules;
|
|
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, {
|
|
316
328
|
waConnected: !1,
|
|
317
329
|
waNumber: "",
|
|
318
330
|
waDisplayName: "",
|
|
319
331
|
defaults: { wa: !1, push: !1, email: !1 }
|
|
320
332
|
});
|
|
321
333
|
}
|
|
322
|
-
const
|
|
323
|
-
function
|
|
334
|
+
const Pe = 7;
|
|
335
|
+
function Ca(e) {
|
|
324
336
|
const a = e.getFullYear(), t = String(e.getMonth() + 1).padStart(2, "0"), n = String(e.getDate()).padStart(2, "0");
|
|
325
337
|
return `${a}-${t}-${n}`;
|
|
326
338
|
}
|
|
327
|
-
function
|
|
339
|
+
function oe(e, a) {
|
|
328
340
|
const t = new Date(e);
|
|
329
341
|
return t.setDate(t.getDate() + a), t;
|
|
330
342
|
}
|
|
331
|
-
function
|
|
343
|
+
function Ne(e) {
|
|
332
344
|
const a = new Date(e);
|
|
333
345
|
return a.setHours(0, 0, 0, 0), a.setDate(a.getDate() - (a.getDay() + 6) % 7), a;
|
|
334
346
|
}
|
|
335
|
-
function
|
|
336
|
-
const t =
|
|
337
|
-
return Array.from({ length:
|
|
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));
|
|
338
350
|
}
|
|
339
|
-
function
|
|
340
|
-
const t = (
|
|
341
|
-
return Math.trunc((
|
|
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));
|
|
342
354
|
}
|
|
343
|
-
const
|
|
344
|
-
let
|
|
345
|
-
function
|
|
346
|
-
return e === y.value ? !1 : (
|
|
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);
|
|
347
359
|
}
|
|
348
|
-
async function
|
|
349
|
-
if (!(!e ||
|
|
350
|
-
|
|
360
|
+
async function ke(e) {
|
|
361
|
+
if (!(!e || fe === e)) {
|
|
362
|
+
$e.value = !0;
|
|
351
363
|
try {
|
|
352
|
-
await
|
|
364
|
+
await Ma(e);
|
|
353
365
|
} finally {
|
|
354
|
-
|
|
366
|
+
$e.value = !1;
|
|
355
367
|
}
|
|
356
368
|
}
|
|
357
369
|
}
|
|
358
|
-
async function
|
|
359
|
-
const a = await
|
|
360
|
-
limit:
|
|
370
|
+
async function Ma(e) {
|
|
371
|
+
const a = await Ee.readEmployeesPage({
|
|
372
|
+
limit: ae,
|
|
361
373
|
offset: 0,
|
|
362
374
|
restaurantIds: [e]
|
|
363
375
|
});
|
|
364
|
-
e === y.value && (
|
|
365
|
-
e === y.value && (
|
|
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);
|
|
366
378
|
}));
|
|
367
379
|
}
|
|
368
380
|
async function Sa(e) {
|
|
369
381
|
const a = y.value;
|
|
370
382
|
if (!a || !e.length) return;
|
|
371
383
|
const t = await D.saveEmployeeConfigs(a, { configs: e });
|
|
372
|
-
|
|
384
|
+
_.value = t, V.value += 1;
|
|
373
385
|
}
|
|
374
386
|
async function La(e, a) {
|
|
375
|
-
const t =
|
|
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(
|
|
376
388
|
0,
|
|
377
|
-
...
|
|
389
|
+
..._.value.filter((i) => i.displayOrder !== null).map((i) => i.displayOrder)
|
|
378
390
|
) + 100 : null);
|
|
379
391
|
await Sa([{ employeeId: e, enabled: a, displayOrder: n }]);
|
|
380
392
|
}
|
|
381
|
-
async function
|
|
393
|
+
async function Ie() {
|
|
382
394
|
const e = y.value;
|
|
383
|
-
e && (
|
|
395
|
+
e && (fe = null, await ke(e));
|
|
384
396
|
}
|
|
385
|
-
async function
|
|
386
|
-
const t =
|
|
397
|
+
async function Re(e, a) {
|
|
398
|
+
const t = Ha(), n = (await Xe(!0)).find((o) => o._id === e);
|
|
387
399
|
if (!n) throw new Error("Could not find this employee");
|
|
388
|
-
const
|
|
389
|
-
restaurantId:
|
|
390
|
-
roleId:
|
|
391
|
-
})),
|
|
392
|
-
if (!
|
|
400
|
+
const i = n.restaurantRole.map((o) => ({
|
|
401
|
+
restaurantId: o.restaurantId,
|
|
402
|
+
roleId: o.roleId
|
|
403
|
+
})), s = a(i);
|
|
404
|
+
if (!s.length)
|
|
393
405
|
throw new Error(
|
|
394
406
|
"An employee must keep at least 1 location, otherwise they are deleted. To delete them, use the Employee page."
|
|
395
407
|
);
|
|
396
408
|
(n.isMasterUser ? "master" : "user") === "master" ? await t.updateMasterEmployee(e, {
|
|
397
409
|
user: { name: n.name, passcode: n.passcode, code: n.code ?? "" },
|
|
398
|
-
roles:
|
|
399
|
-
previousRoles:
|
|
410
|
+
roles: s,
|
|
411
|
+
previousRoles: i
|
|
400
412
|
}) : await t.updateEmployee(e, {
|
|
401
413
|
user: { name: n.name, passcode: n.passcode },
|
|
402
|
-
roles:
|
|
403
|
-
previousRoles:
|
|
414
|
+
roles: s,
|
|
415
|
+
previousRoles: i
|
|
404
416
|
});
|
|
405
417
|
}
|
|
406
|
-
async function
|
|
418
|
+
async function ao(e, a, t = "") {
|
|
407
419
|
const n = [...new Set(a.filter(Boolean))];
|
|
408
|
-
n.length && (await
|
|
409
|
-
...
|
|
410
|
-
...n.map((
|
|
411
|
-
]), y.value && n.includes(y.value) && await La(e, !0), await
|
|
420
|
+
n.length && (await Re(e, (i) => [
|
|
421
|
+
...i.filter((s) => !n.includes(s.restaurantId)),
|
|
422
|
+
...n.map((s) => ({ restaurantId: s, roleId: t }))
|
|
423
|
+
]), y.value && n.includes(y.value) && await La(e, !0), await Ie());
|
|
412
424
|
}
|
|
413
|
-
async function
|
|
425
|
+
async function to(e, a) {
|
|
414
426
|
const t = new Set(a);
|
|
415
|
-
t.size && (await
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
const
|
|
420
|
-
|
|
427
|
+
t.size && (await Re(e, (n) => n.filter((i) => !t.has(i.restaurantId))), await Ie());
|
|
428
|
+
}
|
|
429
|
+
async function no(e, a) {
|
|
430
|
+
if (!a.length) return;
|
|
431
|
+
const t = new Map(a.map((n) => [n.restaurantId, n.roleId]));
|
|
432
|
+
await Re(e, (n) => [
|
|
433
|
+
...n.filter((i) => !t.has(i.restaurantId)),
|
|
434
|
+
...[...t.entries()].map(([i, s]) => ({ restaurantId: i, roleId: s }))
|
|
435
|
+
]), await Ie();
|
|
436
|
+
}
|
|
437
|
+
let ee = null;
|
|
438
|
+
async function Ia() {
|
|
439
|
+
const e = await Ee.readEmployeesPage({
|
|
440
|
+
limit: ae,
|
|
421
441
|
offset: 0,
|
|
422
442
|
includeEmptyPasscode: !0
|
|
423
|
-
}), a = Math.min(
|
|
443
|
+
}), a = Math.min(ba, Math.ceil(e.total / ae)), t = await Promise.all(
|
|
424
444
|
Array.from(
|
|
425
445
|
{ length: Math.max(0, a - 1) },
|
|
426
|
-
(n,
|
|
427
|
-
limit:
|
|
428
|
-
offset: (
|
|
446
|
+
(n, i) => Ee.readEmployeesPage({
|
|
447
|
+
limit: ae,
|
|
448
|
+
offset: (i + 1) * ae,
|
|
429
449
|
includeEmptyPasscode: !0
|
|
430
450
|
})
|
|
431
451
|
)
|
|
432
452
|
);
|
|
433
453
|
return [...e.items, ...t.flatMap((n) => n.items)];
|
|
434
454
|
}
|
|
435
|
-
function
|
|
455
|
+
function Xe(e = !1) {
|
|
436
456
|
if (!e) {
|
|
437
|
-
if (
|
|
438
|
-
if (
|
|
457
|
+
if (ee) return ee;
|
|
458
|
+
if (He.value.length) return Promise.resolve(He.value);
|
|
439
459
|
}
|
|
440
|
-
const a =
|
|
441
|
-
|
|
460
|
+
const a = Ia().then((t) => (He.value = t, t)).finally(() => {
|
|
461
|
+
ee === a && (ee = null);
|
|
442
462
|
});
|
|
443
|
-
return
|
|
463
|
+
return ee = a, a;
|
|
444
464
|
}
|
|
445
465
|
async function Ra() {
|
|
446
466
|
const e = {};
|
|
447
467
|
try {
|
|
448
|
-
(await
|
|
468
|
+
(await Xe()).forEach((a) => {
|
|
449
469
|
e[a._id] = [...new Set(a.restaurantRole.map((t) => t.restaurantId))];
|
|
450
470
|
});
|
|
451
471
|
} catch {
|
|
@@ -453,142 +473,150 @@ async function Ra() {
|
|
|
453
473
|
}
|
|
454
474
|
return e;
|
|
455
475
|
}
|
|
456
|
-
function
|
|
457
|
-
return
|
|
476
|
+
function Be(e, a) {
|
|
477
|
+
return G !== null && j !== null && G <= e && j >= a;
|
|
458
478
|
}
|
|
459
|
-
async function
|
|
460
|
-
const a =
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
479
|
+
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)
|
|
464
484
|
);
|
|
465
485
|
}
|
|
466
|
-
async function
|
|
467
|
-
!
|
|
486
|
+
async function oo() {
|
|
487
|
+
!G || !j || await Je(/* @__PURE__ */ new Date(`${G}T00:00:00`), /* @__PURE__ */ new Date(`${j}T00:00:00`));
|
|
468
488
|
}
|
|
469
|
-
async function
|
|
489
|
+
async function so(e) {
|
|
470
490
|
if (!y.value) throw new Error("No outlet selected");
|
|
471
491
|
const a = await D.createEmployeeProfile(y.value, e);
|
|
472
|
-
d.value && (d.value.employees.push(a),
|
|
492
|
+
d.value && (d.value.employees.push(a), V.value += 1);
|
|
473
493
|
}
|
|
474
|
-
async function
|
|
494
|
+
async function io(e) {
|
|
495
|
+
await D.validatePosAccess(e);
|
|
496
|
+
}
|
|
497
|
+
async function ro(e, a) {
|
|
475
498
|
if (!y.value) throw new Error("No outlet selected");
|
|
476
499
|
const t = await D.updateEmployeeProfile(y.value, e, a);
|
|
477
500
|
if (d.value) {
|
|
478
|
-
const n = d.value.employees.findIndex((
|
|
501
|
+
const n = d.value.employees.findIndex((i) => i.employeeId === e);
|
|
479
502
|
n > -1 && (d.value = {
|
|
480
503
|
...d.value,
|
|
481
|
-
employees: d.value.employees.map((
|
|
504
|
+
employees: d.value.employees.map((i, s) => s === n ? t : i)
|
|
482
505
|
});
|
|
483
506
|
}
|
|
484
507
|
}
|
|
485
|
-
async function
|
|
508
|
+
async function lo(e) {
|
|
486
509
|
const a = await D.createPosition(e);
|
|
487
510
|
d.value && (d.value = { ...d.value, positions: [...d.value.positions, a] });
|
|
488
511
|
}
|
|
489
|
-
async function
|
|
512
|
+
async function uo(e, a) {
|
|
490
513
|
const t = await D.updatePosition(e, a);
|
|
491
514
|
d.value && (d.value = {
|
|
492
515
|
...d.value,
|
|
493
516
|
positions: d.value.positions.map((n) => n.id === e ? t : n)
|
|
494
517
|
});
|
|
495
518
|
}
|
|
496
|
-
async function
|
|
519
|
+
async function co(e) {
|
|
497
520
|
await D.deletePosition(e), d.value && (d.value = {
|
|
498
521
|
...d.value,
|
|
499
522
|
positions: d.value.positions.filter((a) => a.id !== e)
|
|
500
523
|
});
|
|
501
524
|
}
|
|
502
|
-
async function
|
|
503
|
-
var
|
|
525
|
+
async function yo(e, a) {
|
|
526
|
+
var i;
|
|
504
527
|
if (!y.value) throw new Error("No outlet selected");
|
|
505
|
-
const t = (
|
|
528
|
+
const t = (i = d.value) == null ? void 0 : i.days.find((s) => s.date === e), n = await D.saveScheduleDay(y.value, e, {
|
|
506
529
|
...a,
|
|
507
530
|
expectedUpdatedAt: a.expectedUpdatedAt ?? (t == null ? void 0 : t.updatedAt)
|
|
508
531
|
});
|
|
509
532
|
if (d.value) {
|
|
510
|
-
const
|
|
511
|
-
n &&
|
|
533
|
+
const s = d.value.days.filter((l) => l.date !== e);
|
|
534
|
+
n && s.push(n), d.value = { ...d.value, days: s };
|
|
512
535
|
}
|
|
513
536
|
}
|
|
514
|
-
async function
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
endTime: o.endTime
|
|
537
|
+
async function mo(e) {
|
|
538
|
+
await $a([e]);
|
|
539
|
+
}
|
|
540
|
+
function Ta(e) {
|
|
541
|
+
const a = e.periods.flatMap((t) => {
|
|
542
|
+
const n = (t.roles ?? []).filter((l) => l.positionName && l.headcount > 0), i = n.reduce((l, o) => l + o.headcount, 0), s = {
|
|
543
|
+
date: e.date,
|
|
544
|
+
startTime: t.startTime,
|
|
545
|
+
endTime: t.endTime
|
|
524
546
|
};
|
|
525
547
|
return [
|
|
526
|
-
...
|
|
527
|
-
...
|
|
528
|
-
headcount:
|
|
529
|
-
position: { positionId:
|
|
548
|
+
...n.map((l) => ({
|
|
549
|
+
...s,
|
|
550
|
+
headcount: l.headcount,
|
|
551
|
+
position: { positionId: l.positionId, positionName: l.positionName }
|
|
530
552
|
})),
|
|
531
|
-
...
|
|
553
|
+
...t.headcount > i ? [{ ...s, headcount: t.headcount - i }] : []
|
|
532
554
|
];
|
|
533
|
-
}), n = await D.replaceDemands(y.value, {
|
|
534
|
-
...e.date ? { date: e.date } : { dayOfWeek: e.dayOfWeek },
|
|
535
|
-
demands: t
|
|
536
555
|
});
|
|
556
|
+
return {
|
|
557
|
+
date: e.date,
|
|
558
|
+
demands: a
|
|
559
|
+
};
|
|
560
|
+
}
|
|
561
|
+
async function $a(e) {
|
|
562
|
+
if (!y.value) throw new Error("No outlet selected");
|
|
563
|
+
if (!e.length) return;
|
|
564
|
+
const a = e.map(Ta), t = e.length === 1 ? await D.replaceDemands(y.value, a[0]) : await D.bulkReplaceDemands(y.value, { replacements: a });
|
|
537
565
|
if (d.value) {
|
|
538
|
-
const
|
|
539
|
-
d.value = { ...d.value, demands: [...
|
|
566
|
+
const n = new Set(e.map((s) => s.date)), i = d.value.demands.filter((s) => s.date === null || !n.has(s.date));
|
|
567
|
+
d.value = { ...d.value, demands: [...i, ...t] };
|
|
540
568
|
}
|
|
541
569
|
}
|
|
542
|
-
async function
|
|
570
|
+
async function po(e, a) {
|
|
543
571
|
if (!y.value) throw new Error("No outlet selected");
|
|
544
572
|
const t = d.value;
|
|
545
|
-
if (!t || t.demands.some((
|
|
546
|
-
const n = t.demands.filter((
|
|
573
|
+
if (!t || t.demands.some((s) => s.date === a)) return 0;
|
|
574
|
+
const n = t.demands.filter((s) => s.date === e);
|
|
547
575
|
if (!n.length) return 0;
|
|
548
|
-
const
|
|
576
|
+
const i = await Promise.all(
|
|
549
577
|
n.map(
|
|
550
|
-
(
|
|
578
|
+
(s) => D.createDemand(y.value, {
|
|
551
579
|
date: a,
|
|
552
|
-
startTime:
|
|
553
|
-
endTime:
|
|
554
|
-
headcount:
|
|
555
|
-
...
|
|
580
|
+
startTime: s.startTime,
|
|
581
|
+
endTime: s.endTime,
|
|
582
|
+
headcount: s.headcount,
|
|
583
|
+
...s.position ? {
|
|
556
584
|
position: {
|
|
557
|
-
positionId:
|
|
558
|
-
positionName:
|
|
585
|
+
positionId: s.position.positionId,
|
|
586
|
+
positionName: s.position.positionName
|
|
559
587
|
}
|
|
560
588
|
} : {}
|
|
561
589
|
})
|
|
562
590
|
)
|
|
563
591
|
);
|
|
564
|
-
return d.value && (d.value = { ...d.value, demands: [...d.value.demands, ...
|
|
592
|
+
return d.value && (d.value = { ...d.value, demands: [...d.value.demands, ...i] }), i.length;
|
|
565
593
|
}
|
|
566
|
-
async function
|
|
594
|
+
async function fo(e) {
|
|
567
595
|
if (!y.value) throw new Error("No outlet selected");
|
|
568
596
|
return D.generateAutoSchedule(y.value, e);
|
|
569
597
|
}
|
|
570
|
-
async function
|
|
598
|
+
async function ho() {
|
|
571
599
|
if (!y.value) throw new Error("No outlet selected");
|
|
572
600
|
return D.getAutoScheduleCapabilities(y.value);
|
|
573
601
|
}
|
|
574
|
-
async function
|
|
602
|
+
async function vo(e) {
|
|
575
603
|
if (!y.value) throw new Error("No outlet selected");
|
|
576
604
|
return D.applyAutoSchedule(y.value, e);
|
|
577
605
|
}
|
|
578
|
-
async function
|
|
606
|
+
async function Do(e) {
|
|
579
607
|
if (!y.value) throw new Error("No outlet selected");
|
|
580
608
|
return D.bulkSaveAssignments(y.value, e);
|
|
581
609
|
}
|
|
582
|
-
async function
|
|
610
|
+
async function go(e) {
|
|
583
611
|
if (!y.value) throw new Error("No outlet selected");
|
|
584
612
|
e.length && await D.deleteAssignments(y.value, e);
|
|
585
613
|
}
|
|
586
|
-
async function
|
|
614
|
+
async function Ho(e) {
|
|
587
615
|
if (!y.value) throw new Error("No outlet selected");
|
|
588
616
|
const a = await D.createTimeOff(y.value, e);
|
|
589
617
|
return d.value && (d.value = { ...d.value, timeOff: [...d.value.timeOff, a] }), a;
|
|
590
618
|
}
|
|
591
|
-
async function
|
|
619
|
+
async function wo(e, a) {
|
|
592
620
|
if (!y.value) throw new Error("No outlet selected");
|
|
593
621
|
const t = await D.updateTimeOffStatus(y.value, e, a);
|
|
594
622
|
return t && d.value && (d.value = {
|
|
@@ -596,45 +624,45 @@ async function ho(e, a) {
|
|
|
596
624
|
timeOff: d.value.timeOff.map((n) => n.id === e ? t : n)
|
|
597
625
|
}), t;
|
|
598
626
|
}
|
|
599
|
-
async function
|
|
627
|
+
async function Ao(e) {
|
|
600
628
|
if (!y.value) throw new Error("No outlet selected");
|
|
601
629
|
await D.deleteTimeOff(y.value, e), d.value && (d.value = {
|
|
602
630
|
...d.value,
|
|
603
631
|
timeOff: d.value.timeOff.filter((a) => a.id !== e)
|
|
604
632
|
});
|
|
605
633
|
}
|
|
606
|
-
async function
|
|
634
|
+
async function Eo(e) {
|
|
607
635
|
if (!y.value) throw new Error("No outlet selected");
|
|
608
636
|
return D.bulkUpdateAssignmentStatus(y.value, e);
|
|
609
637
|
}
|
|
610
|
-
async function
|
|
638
|
+
async function Je(e, a) {
|
|
611
639
|
const t = y.value;
|
|
612
640
|
if (!t) {
|
|
613
|
-
|
|
641
|
+
me.value = "No outlet selected";
|
|
614
642
|
return;
|
|
615
643
|
}
|
|
616
|
-
const n =
|
|
617
|
-
|
|
618
|
-
const
|
|
644
|
+
const n = se(e), i = se(a), s = ++te;
|
|
645
|
+
Te.value = !0, me.value = null;
|
|
646
|
+
const l = (async () => {
|
|
619
647
|
try {
|
|
620
|
-
const
|
|
621
|
-
if (y.value !== t ||
|
|
622
|
-
d.value =
|
|
623
|
-
} catch (
|
|
624
|
-
if (y.value !== t ||
|
|
625
|
-
|
|
648
|
+
const o = await D.readBoard(t, n, i);
|
|
649
|
+
if (y.value !== t || s !== te) return;
|
|
650
|
+
d.value = o, qe.value = o.settings.setupCompleted, G = n, j = i, V.value += 1;
|
|
651
|
+
} catch (o) {
|
|
652
|
+
if (y.value !== t || s !== te) return;
|
|
653
|
+
me.value = o instanceof Error ? o.message : "Could not load the schedule";
|
|
626
654
|
} finally {
|
|
627
|
-
y.value === t &&
|
|
655
|
+
y.value === t && s === te && (Te.value = !1);
|
|
628
656
|
}
|
|
629
657
|
})();
|
|
630
|
-
|
|
658
|
+
z = l;
|
|
631
659
|
try {
|
|
632
|
-
await
|
|
660
|
+
await l;
|
|
633
661
|
} finally {
|
|
634
|
-
|
|
662
|
+
z === l && (z = null);
|
|
635
663
|
}
|
|
636
664
|
}
|
|
637
|
-
const
|
|
665
|
+
const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
638
666
|
NORMAL: {
|
|
639
667
|
overtime: 1.25
|
|
640
668
|
},
|
|
@@ -646,13 +674,13 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
|
|
|
646
674
|
regular: 2.5,
|
|
647
675
|
overtime: 1.5
|
|
648
676
|
}
|
|
649
|
-
},
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
},
|
|
677
|
+
}, _a = {
|
|
678
|
+
maxHoursPerMonth: null
|
|
679
|
+
}, Fa = {
|
|
680
|
+
minHoursPerDay: null,
|
|
681
|
+
maxHoursPerDay: 8,
|
|
682
|
+
maxHoursPerWeek: 48
|
|
683
|
+
}, Ua = [
|
|
656
684
|
{
|
|
657
685
|
month: 1,
|
|
658
686
|
day: 1,
|
|
@@ -668,7 +696,7 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
|
|
|
668
696
|
day: 3,
|
|
669
697
|
name: "UAE National Day Holiday"
|
|
670
698
|
}
|
|
671
|
-
],
|
|
699
|
+
], Wa = {
|
|
672
700
|
2026: {
|
|
673
701
|
"2026-01-01": "Gregorian New Year",
|
|
674
702
|
"2026-03-20": "Eid Al-Fitr Holiday",
|
|
@@ -698,15 +726,15 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
|
|
|
698
726
|
"2027-12-02": "UAE National Day",
|
|
699
727
|
"2027-12-03": "UAE National Day Holiday"
|
|
700
728
|
}
|
|
701
|
-
},
|
|
702
|
-
countryCode:
|
|
703
|
-
timezone:
|
|
704
|
-
payRate:
|
|
705
|
-
overtime:
|
|
706
|
-
workingHours:
|
|
707
|
-
recurringPublicHolidays:
|
|
708
|
-
publicHolidays:
|
|
709
|
-
},
|
|
729
|
+
}, za = {
|
|
730
|
+
countryCode: Ya,
|
|
731
|
+
timezone: xa,
|
|
732
|
+
payRate: Ba,
|
|
733
|
+
overtime: _a,
|
|
734
|
+
workingHours: Fa,
|
|
735
|
+
recurringPublicHolidays: Ua,
|
|
736
|
+
publicHolidays: Wa
|
|
737
|
+
}, Va = "BN", Ka = "Asia/Brunei", Ga = {
|
|
710
738
|
NORMAL: {
|
|
711
739
|
overtime: 1.5
|
|
712
740
|
},
|
|
@@ -718,13 +746,13 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
|
|
|
718
746
|
regular: 2,
|
|
719
747
|
overtime: 3
|
|
720
748
|
}
|
|
721
|
-
},
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
},
|
|
749
|
+
}, ja = {
|
|
750
|
+
maxHoursPerMonth: 72
|
|
751
|
+
}, qa = {
|
|
752
|
+
minHoursPerDay: null,
|
|
753
|
+
maxHoursPerDay: 8,
|
|
754
|
+
maxHoursPerWeek: 44
|
|
755
|
+
}, Qa = [
|
|
728
756
|
{
|
|
729
757
|
month: 1,
|
|
730
758
|
day: 1,
|
|
@@ -750,7 +778,7 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
|
|
|
750
778
|
day: 25,
|
|
751
779
|
name: "Christmas Day"
|
|
752
780
|
}
|
|
753
|
-
],
|
|
781
|
+
], Xa = {
|
|
754
782
|
2026: {
|
|
755
783
|
"2026-01-01": "New Year's Day",
|
|
756
784
|
"2026-02-17": "Chinese New Year",
|
|
@@ -780,15 +808,15 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
|
|
|
780
808
|
"2027-08-15": "Prophet Muhammad's Birthday",
|
|
781
809
|
"2027-12-25": "Christmas Day"
|
|
782
810
|
}
|
|
783
|
-
},
|
|
784
|
-
countryCode:
|
|
785
|
-
timezone:
|
|
786
|
-
payRate:
|
|
787
|
-
overtime:
|
|
788
|
-
workingHours:
|
|
789
|
-
recurringPublicHolidays:
|
|
790
|
-
publicHolidays:
|
|
791
|
-
},
|
|
811
|
+
}, Ja = {
|
|
812
|
+
countryCode: Va,
|
|
813
|
+
timezone: Ka,
|
|
814
|
+
payRate: Ga,
|
|
815
|
+
overtime: ja,
|
|
816
|
+
workingHours: qa,
|
|
817
|
+
recurringPublicHolidays: Qa,
|
|
818
|
+
publicHolidays: Xa
|
|
819
|
+
}, Za = "ID", et = "Asia/Jakarta", at = {
|
|
792
820
|
NORMAL: {
|
|
793
821
|
overtime: 1.5
|
|
794
822
|
},
|
|
@@ -800,13 +828,13 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
|
|
|
800
828
|
regular: 2,
|
|
801
829
|
overtime: 2
|
|
802
830
|
}
|
|
803
|
-
},
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
},
|
|
831
|
+
}, tt = {
|
|
832
|
+
maxHoursPerMonth: 72
|
|
833
|
+
}, nt = {
|
|
834
|
+
minHoursPerDay: null,
|
|
835
|
+
maxHoursPerDay: 8,
|
|
836
|
+
maxHoursPerWeek: 40
|
|
837
|
+
}, ot = [
|
|
810
838
|
{
|
|
811
839
|
month: 1,
|
|
812
840
|
day: 1,
|
|
@@ -827,7 +855,7 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
|
|
|
827
855
|
day: 25,
|
|
828
856
|
name: "Christmas Day"
|
|
829
857
|
}
|
|
830
|
-
],
|
|
858
|
+
], st = {
|
|
831
859
|
2026: {
|
|
832
860
|
"2026-01-01": "New Year's Day",
|
|
833
861
|
"2026-01-16": "Isra Mi'raj",
|
|
@@ -867,15 +895,15 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
|
|
|
867
895
|
"2027-12-25": "Christmas Day",
|
|
868
896
|
"2027-12-26": "Isra Mi'raj"
|
|
869
897
|
}
|
|
870
|
-
},
|
|
871
|
-
countryCode:
|
|
872
|
-
timezone:
|
|
873
|
-
payRate:
|
|
874
|
-
overtime:
|
|
875
|
-
workingHours:
|
|
876
|
-
recurringPublicHolidays:
|
|
877
|
-
publicHolidays:
|
|
878
|
-
},
|
|
898
|
+
}, it = {
|
|
899
|
+
countryCode: Za,
|
|
900
|
+
timezone: et,
|
|
901
|
+
payRate: at,
|
|
902
|
+
overtime: tt,
|
|
903
|
+
workingHours: nt,
|
|
904
|
+
recurringPublicHolidays: ot,
|
|
905
|
+
publicHolidays: st
|
|
906
|
+
}, rt = "MO", lt = "Asia/Macau", ut = {
|
|
879
907
|
NORMAL: {
|
|
880
908
|
overtime: 1.5
|
|
881
909
|
},
|
|
@@ -887,13 +915,13 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
|
|
|
887
915
|
regular: 2,
|
|
888
916
|
overtime: 3
|
|
889
917
|
}
|
|
890
|
-
},
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
},
|
|
918
|
+
}, dt = {
|
|
919
|
+
maxHoursPerMonth: null
|
|
920
|
+
}, ct = {
|
|
921
|
+
minHoursPerDay: null,
|
|
922
|
+
maxHoursPerDay: 8,
|
|
923
|
+
maxHoursPerWeek: 48
|
|
924
|
+
}, yt = [
|
|
897
925
|
{
|
|
898
926
|
month: 1,
|
|
899
927
|
day: 1,
|
|
@@ -919,7 +947,7 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
|
|
|
919
947
|
day: 25,
|
|
920
948
|
name: "Christmas Day"
|
|
921
949
|
}
|
|
922
|
-
],
|
|
950
|
+
], mt = {
|
|
923
951
|
2026: {
|
|
924
952
|
"2026-01-01": "New Year's Day",
|
|
925
953
|
"2026-02-17": "Lunar New Year's Day",
|
|
@@ -976,15 +1004,15 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
|
|
|
976
1004
|
"2027-12-25": "Christmas Day",
|
|
977
1005
|
"2027-12-27": "Compensatory rest day"
|
|
978
1006
|
}
|
|
979
|
-
},
|
|
980
|
-
countryCode:
|
|
981
|
-
timezone:
|
|
982
|
-
payRate:
|
|
983
|
-
overtime:
|
|
984
|
-
workingHours:
|
|
985
|
-
recurringPublicHolidays:
|
|
986
|
-
publicHolidays:
|
|
987
|
-
},
|
|
1007
|
+
}, pt = {
|
|
1008
|
+
countryCode: rt,
|
|
1009
|
+
timezone: lt,
|
|
1010
|
+
payRate: ut,
|
|
1011
|
+
overtime: dt,
|
|
1012
|
+
workingHours: ct,
|
|
1013
|
+
recurringPublicHolidays: yt,
|
|
1014
|
+
publicHolidays: mt
|
|
1015
|
+
}, ft = "MV", ht = "Indian/Maldives", vt = {
|
|
988
1016
|
NORMAL: {
|
|
989
1017
|
overtime: 1.5
|
|
990
1018
|
},
|
|
@@ -996,13 +1024,13 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
|
|
|
996
1024
|
regular: 2,
|
|
997
1025
|
overtime: 3
|
|
998
1026
|
}
|
|
999
|
-
},
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
},
|
|
1027
|
+
}, Dt = {
|
|
1028
|
+
maxHoursPerMonth: null
|
|
1029
|
+
}, gt = {
|
|
1030
|
+
minHoursPerDay: null,
|
|
1031
|
+
maxHoursPerDay: 8,
|
|
1032
|
+
maxHoursPerWeek: 48
|
|
1033
|
+
}, Ht = [
|
|
1006
1034
|
{
|
|
1007
1035
|
month: 1,
|
|
1008
1036
|
day: 1,
|
|
@@ -1028,7 +1056,7 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
|
|
|
1028
1056
|
day: 11,
|
|
1029
1057
|
name: "Republic Day"
|
|
1030
1058
|
}
|
|
1031
|
-
],
|
|
1059
|
+
], wt = {
|
|
1032
1060
|
2026: {
|
|
1033
1061
|
"2026-01-01": "New Year's Day",
|
|
1034
1062
|
"2026-03-20": "Eid al-Fitr Holiday",
|
|
@@ -1066,15 +1094,15 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
|
|
|
1066
1094
|
"2027-11-03": "Victory Day",
|
|
1067
1095
|
"2027-11-11": "Republic Day"
|
|
1068
1096
|
}
|
|
1069
|
-
},
|
|
1070
|
-
countryCode:
|
|
1071
|
-
timezone:
|
|
1072
|
-
payRate:
|
|
1073
|
-
overtime:
|
|
1074
|
-
workingHours:
|
|
1075
|
-
recurringPublicHolidays:
|
|
1076
|
-
publicHolidays:
|
|
1077
|
-
},
|
|
1097
|
+
}, At = {
|
|
1098
|
+
countryCode: ft,
|
|
1099
|
+
timezone: ht,
|
|
1100
|
+
payRate: vt,
|
|
1101
|
+
overtime: Dt,
|
|
1102
|
+
workingHours: gt,
|
|
1103
|
+
recurringPublicHolidays: Ht,
|
|
1104
|
+
publicHolidays: wt
|
|
1105
|
+
}, Et = "MY", bt = "Asia/Kuala_Lumpur", Pt = {
|
|
1078
1106
|
NORMAL: {
|
|
1079
1107
|
overtime: 1.5
|
|
1080
1108
|
},
|
|
@@ -1086,13 +1114,13 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
|
|
|
1086
1114
|
regular: 2,
|
|
1087
1115
|
overtime: 3
|
|
1088
1116
|
}
|
|
1089
|
-
},
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
},
|
|
1117
|
+
}, Nt = {
|
|
1118
|
+
maxHoursPerMonth: 104
|
|
1119
|
+
}, kt = {
|
|
1120
|
+
minHoursPerDay: null,
|
|
1121
|
+
maxHoursPerDay: 8,
|
|
1122
|
+
maxHoursPerWeek: 45
|
|
1123
|
+
}, Ct = [
|
|
1096
1124
|
{
|
|
1097
1125
|
month: 1,
|
|
1098
1126
|
day: 1,
|
|
@@ -1118,7 +1146,7 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
|
|
|
1118
1146
|
day: 25,
|
|
1119
1147
|
name: "Christmas Day"
|
|
1120
1148
|
}
|
|
1121
|
-
],
|
|
1149
|
+
], Mt = {
|
|
1122
1150
|
2026: {
|
|
1123
1151
|
"2026-01-01": "New Year's Day",
|
|
1124
1152
|
"2026-02-17": "Chinese New Year",
|
|
@@ -1156,15 +1184,15 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
|
|
|
1156
1184
|
"2027-10-28": "Deepavali",
|
|
1157
1185
|
"2027-12-25": "Christmas Day"
|
|
1158
1186
|
}
|
|
1159
|
-
},
|
|
1160
|
-
countryCode:
|
|
1161
|
-
timezone:
|
|
1162
|
-
payRate:
|
|
1163
|
-
overtime:
|
|
1164
|
-
workingHours:
|
|
1165
|
-
recurringPublicHolidays:
|
|
1166
|
-
publicHolidays:
|
|
1167
|
-
},
|
|
1187
|
+
}, St = {
|
|
1188
|
+
countryCode: Et,
|
|
1189
|
+
timezone: bt,
|
|
1190
|
+
payRate: Pt,
|
|
1191
|
+
overtime: Nt,
|
|
1192
|
+
workingHours: kt,
|
|
1193
|
+
recurringPublicHolidays: Ct,
|
|
1194
|
+
publicHolidays: Mt
|
|
1195
|
+
}, Lt = "PK", It = "Asia/Karachi", Rt = {
|
|
1168
1196
|
NORMAL: {
|
|
1169
1197
|
overtime: 1.5
|
|
1170
1198
|
},
|
|
@@ -1177,12 +1205,12 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
|
|
|
1177
1205
|
overtime: 3
|
|
1178
1206
|
}
|
|
1179
1207
|
}, Ot = {
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
},
|
|
1208
|
+
maxHoursPerMonth: null
|
|
1209
|
+
}, Tt = {
|
|
1210
|
+
minHoursPerDay: null,
|
|
1211
|
+
maxHoursPerDay: 9,
|
|
1212
|
+
maxHoursPerWeek: 48
|
|
1213
|
+
}, $t = [
|
|
1186
1214
|
{
|
|
1187
1215
|
month: 1,
|
|
1188
1216
|
day: 1,
|
|
@@ -1213,7 +1241,7 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
|
|
|
1213
1241
|
day: 25,
|
|
1214
1242
|
name: "Quaid-e-Azam Day and Christmas Day"
|
|
1215
1243
|
}
|
|
1216
|
-
],
|
|
1244
|
+
], Yt = {
|
|
1217
1245
|
2026: {
|
|
1218
1246
|
"2026-01-01": "New Year's Day",
|
|
1219
1247
|
"2026-02-05": "Kashmir Day",
|
|
@@ -1238,15 +1266,15 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
|
|
|
1238
1266
|
"2027-08-15": "Eid Milad-un-Nabi",
|
|
1239
1267
|
"2027-12-25": "Quaid-e-Azam Day and Christmas Day"
|
|
1240
1268
|
}
|
|
1241
|
-
},
|
|
1242
|
-
countryCode:
|
|
1243
|
-
timezone:
|
|
1244
|
-
payRate:
|
|
1269
|
+
}, xt = {
|
|
1270
|
+
countryCode: Lt,
|
|
1271
|
+
timezone: It,
|
|
1272
|
+
payRate: Rt,
|
|
1245
1273
|
overtime: Ot,
|
|
1246
|
-
workingHours:
|
|
1247
|
-
recurringPublicHolidays:
|
|
1248
|
-
publicHolidays:
|
|
1249
|
-
},
|
|
1274
|
+
workingHours: Tt,
|
|
1275
|
+
recurringPublicHolidays: $t,
|
|
1276
|
+
publicHolidays: Yt
|
|
1277
|
+
}, Bt = "SG", _t = "Asia/Singapore", Ft = {
|
|
1250
1278
|
NORMAL: {
|
|
1251
1279
|
overtime: 1.5
|
|
1252
1280
|
},
|
|
@@ -1258,13 +1286,13 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
|
|
|
1258
1286
|
regular: 2,
|
|
1259
1287
|
overtime: 1.5
|
|
1260
1288
|
}
|
|
1261
|
-
},
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
},
|
|
1289
|
+
}, Ut = {
|
|
1290
|
+
maxHoursPerMonth: 72
|
|
1291
|
+
}, Wt = {
|
|
1292
|
+
minHoursPerDay: null,
|
|
1293
|
+
maxHoursPerDay: 12,
|
|
1294
|
+
maxHoursPerWeek: 44
|
|
1295
|
+
}, zt = [
|
|
1268
1296
|
{
|
|
1269
1297
|
month: 1,
|
|
1270
1298
|
day: 1,
|
|
@@ -1285,7 +1313,7 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
|
|
|
1285
1313
|
day: 25,
|
|
1286
1314
|
name: "Christmas Day"
|
|
1287
1315
|
}
|
|
1288
|
-
],
|
|
1316
|
+
], Vt = {
|
|
1289
1317
|
2026: {
|
|
1290
1318
|
"2026-01-01": "New Year's Day",
|
|
1291
1319
|
"2026-02-17": "Chinese New Year's Day",
|
|
@@ -1316,15 +1344,15 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
|
|
|
1316
1344
|
"2027-10-28": "Deepavali",
|
|
1317
1345
|
"2027-12-25": "Christmas Day"
|
|
1318
1346
|
}
|
|
1319
|
-
},
|
|
1320
|
-
countryCode:
|
|
1321
|
-
timezone:
|
|
1322
|
-
payRate:
|
|
1323
|
-
overtime:
|
|
1324
|
-
workingHours:
|
|
1325
|
-
recurringPublicHolidays:
|
|
1326
|
-
publicHolidays:
|
|
1327
|
-
},
|
|
1347
|
+
}, Kt = {
|
|
1348
|
+
countryCode: Bt,
|
|
1349
|
+
timezone: _t,
|
|
1350
|
+
payRate: Ft,
|
|
1351
|
+
overtime: Ut,
|
|
1352
|
+
workingHours: Wt,
|
|
1353
|
+
recurringPublicHolidays: zt,
|
|
1354
|
+
publicHolidays: Vt
|
|
1355
|
+
}, Gt = "TH", jt = "Asia/Bangkok", qt = {
|
|
1328
1356
|
NORMAL: {
|
|
1329
1357
|
overtime: 1.5
|
|
1330
1358
|
},
|
|
@@ -1336,13 +1364,13 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
|
|
|
1336
1364
|
regular: 2,
|
|
1337
1365
|
overtime: 3
|
|
1338
1366
|
}
|
|
1339
|
-
},
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
},
|
|
1367
|
+
}, Qt = {
|
|
1368
|
+
maxHoursPerMonth: 36
|
|
1369
|
+
}, Xt = {
|
|
1370
|
+
minHoursPerDay: null,
|
|
1371
|
+
maxHoursPerDay: 8,
|
|
1372
|
+
maxHoursPerWeek: 48
|
|
1373
|
+
}, Jt = [
|
|
1346
1374
|
{
|
|
1347
1375
|
month: 1,
|
|
1348
1376
|
day: 1,
|
|
@@ -1388,7 +1416,7 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
|
|
|
1388
1416
|
day: 31,
|
|
1389
1417
|
name: "New Year's Eve"
|
|
1390
1418
|
}
|
|
1391
|
-
],
|
|
1419
|
+
], Zt = {
|
|
1392
1420
|
2026: {
|
|
1393
1421
|
"2026-01-01": "New Year's Day",
|
|
1394
1422
|
"2026-03-03": "Makha Bucha Day",
|
|
@@ -1428,15 +1456,15 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
|
|
|
1428
1456
|
"2027-12-10": "Constitution Day",
|
|
1429
1457
|
"2027-12-31": "New Year's Eve"
|
|
1430
1458
|
}
|
|
1431
|
-
},
|
|
1432
|
-
countryCode:
|
|
1433
|
-
timezone:
|
|
1434
|
-
payRate:
|
|
1435
|
-
overtime:
|
|
1436
|
-
workingHours:
|
|
1437
|
-
recurringPublicHolidays:
|
|
1438
|
-
publicHolidays:
|
|
1439
|
-
},
|
|
1459
|
+
}, en = {
|
|
1460
|
+
countryCode: Gt,
|
|
1461
|
+
timezone: jt,
|
|
1462
|
+
payRate: qt,
|
|
1463
|
+
overtime: Qt,
|
|
1464
|
+
workingHours: Xt,
|
|
1465
|
+
recurringPublicHolidays: Jt,
|
|
1466
|
+
publicHolidays: Zt
|
|
1467
|
+
}, an = "VN", tn = "Asia/Ho_Chi_Minh", nn = {
|
|
1440
1468
|
NORMAL: {
|
|
1441
1469
|
overtime: 1.5
|
|
1442
1470
|
},
|
|
@@ -1448,13 +1476,13 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
|
|
|
1448
1476
|
regular: 2,
|
|
1449
1477
|
overtime: 3
|
|
1450
1478
|
}
|
|
1451
|
-
},
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
},
|
|
1479
|
+
}, on = {
|
|
1480
|
+
maxHoursPerMonth: 40
|
|
1481
|
+
}, sn = {
|
|
1482
|
+
minHoursPerDay: null,
|
|
1483
|
+
maxHoursPerDay: 8,
|
|
1484
|
+
maxHoursPerWeek: 48
|
|
1485
|
+
}, rn = [
|
|
1458
1486
|
{
|
|
1459
1487
|
month: 1,
|
|
1460
1488
|
day: 1,
|
|
@@ -1475,7 +1503,7 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
|
|
|
1475
1503
|
day: 2,
|
|
1476
1504
|
name: "National Day"
|
|
1477
1505
|
}
|
|
1478
|
-
],
|
|
1506
|
+
], ln = {
|
|
1479
1507
|
2026: {
|
|
1480
1508
|
"2026-01-01": "New Year's Day",
|
|
1481
1509
|
"2026-02-16": "Tet Holiday",
|
|
@@ -1503,16 +1531,16 @@ const Ta = "AE", $a = "Asia/Dubai", Pa = {
|
|
|
1503
1531
|
"2027-09-02": "National Day",
|
|
1504
1532
|
"2027-09-03": "National Day Holiday"
|
|
1505
1533
|
}
|
|
1506
|
-
},
|
|
1507
|
-
countryCode:
|
|
1508
|
-
timezone:
|
|
1509
|
-
payRate:
|
|
1510
|
-
overtime:
|
|
1511
|
-
workingHours:
|
|
1512
|
-
recurringPublicHolidays:
|
|
1513
|
-
publicHolidays:
|
|
1514
|
-
},
|
|
1515
|
-
function
|
|
1534
|
+
}, un = {
|
|
1535
|
+
countryCode: an,
|
|
1536
|
+
timezone: tn,
|
|
1537
|
+
payRate: nn,
|
|
1538
|
+
overtime: on,
|
|
1539
|
+
workingHours: sn,
|
|
1540
|
+
recurringPublicHolidays: rn,
|
|
1541
|
+
publicHolidays: ln
|
|
1542
|
+
}, _e = { AE: za, BN: Ja, ID: it, MO: pt, MV: At, MY: St, PK: xt, SG: Kt, TH: en, VN: un };
|
|
1543
|
+
function dn(e) {
|
|
1516
1544
|
if (typeof e == "string") return e.toUpperCase();
|
|
1517
1545
|
if (e && typeof e == "object" && "code" in e) {
|
|
1518
1546
|
const a = e.code;
|
|
@@ -1520,19 +1548,17 @@ function rn(e) {
|
|
|
1520
1548
|
}
|
|
1521
1549
|
return "MY";
|
|
1522
1550
|
}
|
|
1523
|
-
function
|
|
1524
|
-
return
|
|
1551
|
+
function cn(e) {
|
|
1552
|
+
return _e[dn(e)] ?? _e.MY;
|
|
1525
1553
|
}
|
|
1526
|
-
function
|
|
1527
|
-
var
|
|
1528
|
-
const t = (
|
|
1554
|
+
function bo(e, a) {
|
|
1555
|
+
var s, l;
|
|
1556
|
+
const t = (s = e.publicHolidays[a.slice(0, 4)]) == null ? void 0 : s[a];
|
|
1529
1557
|
if (t) return t;
|
|
1530
|
-
const n = Number(a.slice(5, 7)),
|
|
1531
|
-
return ((
|
|
1558
|
+
const n = Number(a.slice(5, 7)), i = Number(a.slice(8, 10));
|
|
1559
|
+
return ((l = e.recurringPublicHolidays.find((o) => o.month === n && o.day === i)) == null ? void 0 : l.name) ?? null;
|
|
1532
1560
|
}
|
|
1533
|
-
const
|
|
1534
|
-
{ id: qe, label: "Assigned", roles: [], system: !0 }
|
|
1535
|
-
], $e = [
|
|
1561
|
+
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 = [
|
|
1536
1562
|
"#903E1F",
|
|
1537
1563
|
"#5F090A",
|
|
1538
1564
|
"#0A5384",
|
|
@@ -1542,75 +1568,96 @@ const un = Be(), qe = "unassigned", wo = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sa
|
|
|
1542
1568
|
"#0F5C5C",
|
|
1543
1569
|
"#6E2142"
|
|
1544
1570
|
];
|
|
1545
|
-
function
|
|
1546
|
-
var
|
|
1547
|
-
|
|
1571
|
+
function mn(e) {
|
|
1572
|
+
var t;
|
|
1573
|
+
const a = e.trim().toLocaleLowerCase();
|
|
1574
|
+
return (t = K.find((n) => n.name.toLocaleLowerCase() === a)) == null ? void 0 : t.id;
|
|
1548
1575
|
}
|
|
1549
|
-
function
|
|
1576
|
+
function Co(e, a) {
|
|
1550
1577
|
if (e)
|
|
1551
|
-
return { positionId:
|
|
1578
|
+
return { positionId: a ?? mn(e), positionName: e };
|
|
1579
|
+
}
|
|
1580
|
+
function Mo(e, a) {
|
|
1581
|
+
return a ? !K.some((t) => t.id === a) : !!e && !K.some((t) => t.name.toLocaleLowerCase() === e.toLocaleLowerCase());
|
|
1552
1582
|
}
|
|
1553
|
-
const
|
|
1554
|
-
function
|
|
1583
|
+
const So = [1, 1, 1, 1, 1, 1, 1];
|
|
1584
|
+
function ie(e) {
|
|
1555
1585
|
return (e + 6) % 7;
|
|
1556
1586
|
}
|
|
1557
|
-
function
|
|
1587
|
+
function Lo(e) {
|
|
1558
1588
|
return (e + 1) % 7;
|
|
1559
1589
|
}
|
|
1560
|
-
function
|
|
1590
|
+
function ce(e, a) {
|
|
1561
1591
|
e.splice(0, e.length, ...a);
|
|
1562
1592
|
}
|
|
1563
|
-
function
|
|
1564
|
-
return
|
|
1593
|
+
function pn(e, a) {
|
|
1594
|
+
return Ve(e, a) / 60;
|
|
1565
1595
|
}
|
|
1566
|
-
function
|
|
1596
|
+
function fn(e) {
|
|
1567
1597
|
var t;
|
|
1568
1598
|
const a = e.trim().split(/\s+/).filter(Boolean);
|
|
1569
1599
|
return a.length ? (a[0][0] + (((t = a[1]) == null ? void 0 : t[0]) ?? "")).toUpperCase() : "??";
|
|
1570
1600
|
}
|
|
1571
|
-
const
|
|
1572
|
-
function
|
|
1573
|
-
return
|
|
1601
|
+
const ea = /* @__PURE__ */ new Map(), we = /* @__PURE__ */ new Map();
|
|
1602
|
+
function Io(e) {
|
|
1603
|
+
return ea.get(e);
|
|
1574
1604
|
}
|
|
1575
|
-
function
|
|
1576
|
-
const a =
|
|
1605
|
+
function hn(e) {
|
|
1606
|
+
const a = we.get(e);
|
|
1577
1607
|
if (a !== void 0) return a;
|
|
1578
|
-
const t =
|
|
1579
|
-
return
|
|
1608
|
+
const t = Ge + we.size + 1;
|
|
1609
|
+
return we.set(e, t), ea.set(t, e), t;
|
|
1580
1610
|
}
|
|
1581
|
-
function
|
|
1611
|
+
function Ro(e) {
|
|
1582
1612
|
return e.sourceId || String(e.id);
|
|
1583
1613
|
}
|
|
1584
|
-
function
|
|
1585
|
-
Na.name = (e == null ? void 0 : e.outlet.name) ?? "",
|
|
1614
|
+
function vn(e) {
|
|
1615
|
+
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) ?? []);
|
|
1586
1616
|
const a = (e == null ? void 0 : e.restaurantProfile.operatingHours) ?? [], t = Array.from({ length: 7 }, () => []);
|
|
1587
|
-
for (const
|
|
1588
|
-
|
|
1589
|
-
const n = a.filter((
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
a.filter((
|
|
1617
|
+
for (const o of a) t[ie(o.dayOfWeek)] = o.closed ? [] : o.hours;
|
|
1618
|
+
ce(M.dayHours, t);
|
|
1619
|
+
const n = a.filter((o) => !o.closed).flatMap((o) => o.hours);
|
|
1620
|
+
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(
|
|
1621
|
+
M.closedWeekdays,
|
|
1622
|
+
a.filter((o) => o.closed).map((o) => ie(o.dayOfWeek)).sort((o, m) => o - m)
|
|
1593
1623
|
);
|
|
1594
|
-
const
|
|
1595
|
-
|
|
1624
|
+
const i = cn(yn.currentCountry.value), s = (e == null ? void 0 : e.settings.settingsConfigured) === !0, l = s ? e.settings.payRate : i.payRate;
|
|
1625
|
+
M.otCapHours = s ? e.settings.overtime.maxHoursPerMonth : i.overtime.maxHoursPerMonth, M.workingHours = s ? e.settings.workingHours : {
|
|
1626
|
+
minHoursPerDay: null,
|
|
1627
|
+
maxHoursPerDay: i.workingHours.maxHoursPerDay,
|
|
1628
|
+
maxHoursPerWeek: i.workingHours.maxHoursPerWeek
|
|
1629
|
+
}, 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;
|
|
1630
|
+
}
|
|
1631
|
+
Se(d, vn, { immediate: !0 });
|
|
1632
|
+
function he(e) {
|
|
1633
|
+
var a, t, n;
|
|
1634
|
+
return {
|
|
1635
|
+
minHoursPerDay: ((a = e.workingHours) == null ? void 0 : a.minHoursPerDay) ?? M.workingHours.minHoursPerDay,
|
|
1636
|
+
maxHoursPerDay: ((t = e.workingHours) == null ? void 0 : t.maxHoursPerDay) ?? M.workingHours.maxHoursPerDay,
|
|
1637
|
+
maxHoursPerWeek: ((n = e.workingHours) == null ? void 0 : n.maxHoursPerWeek) ?? M.workingHours.maxHoursPerWeek
|
|
1638
|
+
};
|
|
1596
1639
|
}
|
|
1597
|
-
|
|
1598
|
-
function pn(e) {
|
|
1640
|
+
function Dn(e) {
|
|
1599
1641
|
return e.reduce(
|
|
1600
|
-
(a, t) =>
|
|
1642
|
+
(a, t) => {
|
|
1643
|
+
const n = he(t).maxHoursPerWeek;
|
|
1644
|
+
return t.employmentType === "FULLTIME" && n != null ? Math.max(a, n) : a;
|
|
1645
|
+
},
|
|
1601
1646
|
0
|
|
1602
1647
|
);
|
|
1603
1648
|
}
|
|
1604
|
-
function
|
|
1649
|
+
function gn(e, a) {
|
|
1605
1650
|
if (e.wage.type === "HOURLY") return e.wage.amount;
|
|
1606
|
-
const t = e.
|
|
1651
|
+
const t = he(e).maxHoursPerWeek ?? a;
|
|
1607
1652
|
return t ? e.wage.amount / (t * (52 / 12)) : 0;
|
|
1608
1653
|
}
|
|
1609
|
-
function
|
|
1610
|
-
|
|
1654
|
+
function Hn(e, a) {
|
|
1655
|
+
if (e.employmentType === "FULLTIME") return 100;
|
|
1656
|
+
const t = he(e).maxHoursPerWeek;
|
|
1657
|
+
return !a || t == null ? 0 : Math.min(99, Math.round(t / a * 100));
|
|
1611
1658
|
}
|
|
1612
|
-
function
|
|
1613
|
-
var a;
|
|
1659
|
+
function wn(e) {
|
|
1660
|
+
var a, t;
|
|
1614
1661
|
return {
|
|
1615
1662
|
start: e.startTime,
|
|
1616
1663
|
end: e.endTime,
|
|
@@ -1619,10 +1666,11 @@ function Dn(e) {
|
|
|
1619
1666
|
// silently reassigns every "Any position" shift to whatever station the employee is normally
|
|
1620
1667
|
// pinned to.
|
|
1621
1668
|
role: ((a = e.position) == null ? void 0 : a.positionName) ?? "",
|
|
1669
|
+
positionId: ((t = e.position) == null ? void 0 : t.positionId) || void 0,
|
|
1622
1670
|
// Mongo distinguishes a draft from a published/confirmed assignment; the board's third
|
|
1623
1671
|
// state ('ot') is a costing outcome, never something stored.
|
|
1624
1672
|
status: e.status === "DRAFT" ? "pending" : "confirmed",
|
|
1625
|
-
breakMins:
|
|
1673
|
+
breakMins: Ke(e.breaks),
|
|
1626
1674
|
breaks: e.breaks,
|
|
1627
1675
|
// Carried through so an edit updates this same ScheduleShiftAssignments document instead of
|
|
1628
1676
|
// creating a duplicate — see useScheduleBoard's commitShift/persistSlot.
|
|
@@ -1630,10 +1678,10 @@ function Dn(e) {
|
|
|
1630
1678
|
updatedAt: e.updatedAt
|
|
1631
1679
|
};
|
|
1632
1680
|
}
|
|
1633
|
-
function
|
|
1681
|
+
function An(e) {
|
|
1634
1682
|
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
1683
|
}
|
|
1636
|
-
function
|
|
1684
|
+
function En(e, a) {
|
|
1637
1685
|
if (a < e.startDate || a > e.endDate) return null;
|
|
1638
1686
|
const n = e.startDate === e.endDate || a === e.startDate ? e.startPart : a === e.endDate ? e.endPart : "FULL_DAY";
|
|
1639
1687
|
return {
|
|
@@ -1641,139 +1689,149 @@ function wn(e, a) {
|
|
|
1641
1689
|
type: e.type,
|
|
1642
1690
|
leaveType: e.leaveType ?? void 0,
|
|
1643
1691
|
timeOff: e.status === "PENDING" ? "pending" : "approved",
|
|
1644
|
-
reason:
|
|
1692
|
+
reason: An(e),
|
|
1645
1693
|
half: n !== "FULL_DAY",
|
|
1646
1694
|
halfPart: n === "FULL_DAY" ? void 0 : n
|
|
1647
1695
|
};
|
|
1648
1696
|
}
|
|
1649
|
-
function
|
|
1697
|
+
function bn(e) {
|
|
1650
1698
|
return {
|
|
1651
1699
|
employeeId: e._id,
|
|
1652
1700
|
name: e.name,
|
|
1653
1701
|
employmentType: "FULLTIME",
|
|
1654
|
-
workingHour: 0,
|
|
1655
1702
|
wage: { type: "HOURLY", amount: 0 },
|
|
1656
1703
|
primaryPosition: null,
|
|
1657
1704
|
secondaryPositions: [],
|
|
1658
1705
|
availability: []
|
|
1659
1706
|
};
|
|
1660
1707
|
}
|
|
1661
|
-
function
|
|
1662
|
-
const a =
|
|
1708
|
+
function Pn(e) {
|
|
1709
|
+
const a = ne[y.value];
|
|
1663
1710
|
return !a || !e.includes(a) ? e : [a, ...e.filter((t) => t !== a)];
|
|
1664
1711
|
}
|
|
1665
|
-
function
|
|
1712
|
+
function Nn(e) {
|
|
1666
1713
|
var n;
|
|
1667
|
-
const t = (
|
|
1668
|
-
return t.length ?
|
|
1714
|
+
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);
|
|
1715
|
+
return t.length ? Pn([...new Set(t)]) : void 0;
|
|
1669
1716
|
}
|
|
1670
|
-
function
|
|
1717
|
+
function Oo(e = []) {
|
|
1671
1718
|
const a = d.value;
|
|
1672
1719
|
if (!a) return [];
|
|
1673
|
-
const t = new Map(a.employees.map((
|
|
1720
|
+
const t = new Map(a.employees.map((o) => [o.employeeId, o])), n = new Map(
|
|
1721
|
+
_.value.map((o) => [o.employeeId, o])
|
|
1722
|
+
), i = pe.value.filter((o) => {
|
|
1674
1723
|
var m;
|
|
1675
|
-
return ((m = n.get(
|
|
1676
|
-
}).map((
|
|
1677
|
-
for (const
|
|
1678
|
-
const m = `${
|
|
1679
|
-
|
|
1724
|
+
return ((m = n.get(o._id)) == null ? void 0 : m.enabled) !== !1;
|
|
1725
|
+
}).map((o) => t.get(o._id) ?? bn(o)), s = Dn(i), l = /* @__PURE__ */ new Map();
|
|
1726
|
+
for (const o of a.assignments) {
|
|
1727
|
+
const m = `${o.employeeId}|${o.date}`, v = l.get(m);
|
|
1728
|
+
v ? v.push(o) : l.set(m, [o]);
|
|
1680
1729
|
}
|
|
1681
|
-
return
|
|
1682
|
-
var
|
|
1683
|
-
const m =
|
|
1684
|
-
|
|
1685
|
-
...
|
|
1686
|
-
]
|
|
1687
|
-
const
|
|
1730
|
+
return i.map((o) => {
|
|
1731
|
+
var J;
|
|
1732
|
+
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 = [
|
|
1733
|
+
...A && !L ? [A] : [],
|
|
1734
|
+
...o.secondaryPositions.filter((g) => !p(g)).map((g) => g.positionName)
|
|
1735
|
+
], re = q[0] ?? "", x = e.map((g) => {
|
|
1736
|
+
const E = se(g), H = (a.timeOff ?? []).filter((b) => b.employeeId === o.employeeId).map((b) => En(b, E)).find((b) => b !== null);
|
|
1688
1737
|
if (H) return H;
|
|
1689
|
-
const
|
|
1690
|
-
return
|
|
1691
|
-
}),
|
|
1738
|
+
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));
|
|
1739
|
+
return F.length ? F.length === 1 ? F[0] : F : null;
|
|
1740
|
+
}), I = o.availability.length > 0, X = Array.from(
|
|
1692
1741
|
{ length: 7 },
|
|
1693
|
-
(
|
|
1694
|
-
),
|
|
1695
|
-
const H =
|
|
1742
|
+
(g, E) => I ? o.availability.some((H) => ie(H.dayOfWeek) === E) : !0
|
|
1743
|
+
), le = Array.from({ length: 7 }, (g, E) => {
|
|
1744
|
+
const H = o.availability.find((k) => ie(k.dayOfWeek) === E);
|
|
1696
1745
|
return { from: (H == null ? void 0 : H.start) ?? "", to: (H == null ? void 0 : H.end) ?? "" };
|
|
1697
1746
|
});
|
|
1698
1747
|
return {
|
|
1699
|
-
id:
|
|
1700
|
-
sourceId:
|
|
1701
|
-
name:
|
|
1702
|
-
employmentType:
|
|
1703
|
-
role:
|
|
1704
|
-
initials:
|
|
1705
|
-
color:
|
|
1748
|
+
id: v,
|
|
1749
|
+
sourceId: o.employeeId,
|
|
1750
|
+
name: o.name,
|
|
1751
|
+
employmentType: o.employmentType,
|
|
1752
|
+
role: re,
|
|
1753
|
+
initials: fn(o.name),
|
|
1754
|
+
color: Fe[(v - Ge - 1) % Fe.length],
|
|
1706
1755
|
// Gross hours actually rostered this week — the figure the cost rail multiplies by
|
|
1707
1756
|
// the rate. Contracted hours are a separate question, answered by RULES.contract.
|
|
1708
1757
|
// Rounded to one decimal — `hoursBetween` divides by 60, so an unrounded sum reads
|
|
1709
1758
|
// as a long, meaningless float (e.g. 31.983333333333334) everywhere this is shown
|
|
1710
1759
|
// verbatim, matching the rounding `employeeLoadOf`'s own hours figure already uses.
|
|
1711
1760
|
weekHours: Math.round(
|
|
1712
|
-
|
|
1713
|
-
(
|
|
1714
|
-
(H,
|
|
1761
|
+
x.reduce(
|
|
1762
|
+
(g, E) => g + (Array.isArray(E) ? E : E && "start" in E ? [E] : []).reduce(
|
|
1763
|
+
(H, k) => H + pn(k.start, k.end),
|
|
1715
1764
|
0
|
|
1716
1765
|
),
|
|
1717
1766
|
0
|
|
1718
1767
|
) * 10
|
|
1719
1768
|
) / 10,
|
|
1720
|
-
pct:
|
|
1721
|
-
contractHours:
|
|
1769
|
+
pct: Hn(o, s),
|
|
1770
|
+
contractHours: m.maxHoursPerWeek ?? void 0,
|
|
1771
|
+
minHoursPerDay: m.minHoursPerDay ?? void 0,
|
|
1772
|
+
// Keep the persisted override shape here. Consumers that need the effective value use
|
|
1773
|
+
// effectiveWorkingHours(), so an inherited null remains distinguishable from an override.
|
|
1774
|
+
workingHours: o.workingHours,
|
|
1722
1775
|
// Every outlet the POS says this person works at, not just this one — the Add / Edit form
|
|
1723
1776
|
// shows them, and saving keeps them.
|
|
1724
|
-
locations:
|
|
1725
|
-
rate:
|
|
1726
|
-
positions:
|
|
1727
|
-
|
|
1777
|
+
locations: Nn(o.employeeId),
|
|
1778
|
+
rate: gn(o, s),
|
|
1779
|
+
positions: q,
|
|
1780
|
+
archivedPositions: Q.length ? Q : void 0,
|
|
1781
|
+
shifts: x,
|
|
1728
1782
|
// Remarks live in their own collection in the older scheduling design and are not
|
|
1729
1783
|
// part of this board's payload yet.
|
|
1730
1784
|
remarks: [],
|
|
1731
|
-
section:
|
|
1732
|
-
payBasis:
|
|
1733
|
-
payAmount:
|
|
1734
|
-
availDays:
|
|
1735
|
-
availHours:
|
|
1785
|
+
section: Ze,
|
|
1786
|
+
payBasis: o.wage.type === "HOURLY" ? "hourly" : "monthly",
|
|
1787
|
+
payAmount: o.wage.amount,
|
|
1788
|
+
availDays: X,
|
|
1789
|
+
availHours: le
|
|
1736
1790
|
};
|
|
1737
1791
|
});
|
|
1738
1792
|
}
|
|
1739
|
-
function
|
|
1793
|
+
function To() {
|
|
1740
1794
|
return [];
|
|
1741
1795
|
}
|
|
1742
|
-
function
|
|
1743
|
-
var n,
|
|
1796
|
+
function $o() {
|
|
1797
|
+
var n, i;
|
|
1744
1798
|
const e = d.value, a = {}, t = {};
|
|
1745
|
-
for (const
|
|
1746
|
-
const
|
|
1747
|
-
if (!
|
|
1748
|
-
let
|
|
1749
|
-
|
|
1799
|
+
for (const s of (e == null ? void 0 : e.demands) ?? []) {
|
|
1800
|
+
const l = s.date ? a[n = s.date] ?? (a[n] = []) : s.dayOfWeek !== null ? t[i = ie(s.dayOfWeek)] ?? (t[i] = []) : null;
|
|
1801
|
+
if (!l) continue;
|
|
1802
|
+
let o = l.find((m) => m.from === s.startTime && m.to === s.endTime);
|
|
1803
|
+
o || (o = { from: s.startTime, to: s.endTime, n: 0, roles: [] }, l.push(o)), o.n += s.headcount, s.position && o.roles.push({
|
|
1804
|
+
position: s.position.positionName,
|
|
1805
|
+
positionId: s.position.positionId || void 0,
|
|
1806
|
+
n: s.headcount
|
|
1807
|
+
});
|
|
1750
1808
|
}
|
|
1751
1809
|
return { byDate: a, byWeekday: t };
|
|
1752
1810
|
}
|
|
1753
|
-
function
|
|
1754
|
-
const e =
|
|
1755
|
-
() => [...a.value].map((p) => ({ value: p._id, label: p.profile.name })).sort((p,
|
|
1756
|
-
),
|
|
1811
|
+
function Yo() {
|
|
1812
|
+
const e = ze(), { restaurants: a, readRestaurants: t } = ga(), n = va(), i = Da(), s = w(!1), l = $(
|
|
1813
|
+
() => [...a.value].map((p) => ({ value: p._id, label: p.profile.name })).sort((p, A) => p.label.localeCompare(A.label))
|
|
1814
|
+
), o = $(() => {
|
|
1757
1815
|
var p;
|
|
1758
1816
|
return ((p = e.currentRestaurant.value) == null ? void 0 : p._id) ?? "";
|
|
1759
1817
|
});
|
|
1760
|
-
async function m(p,
|
|
1761
|
-
return
|
|
1818
|
+
async function m(p, A) {
|
|
1819
|
+
return xe(p) ? (n.query.restaurantId !== p && i.replace({ query: { ...n.query, restaurantId: p } }), await Promise.all([ke(p), Oa(A)]), !0) : !1;
|
|
1762
1820
|
}
|
|
1763
|
-
const
|
|
1764
|
-
async function
|
|
1765
|
-
var
|
|
1766
|
-
await t(),
|
|
1767
|
-
const p =
|
|
1768
|
-
return p &&
|
|
1821
|
+
const v = (p) => !!p && l.value.some((A) => A.value === p);
|
|
1822
|
+
async function N() {
|
|
1823
|
+
var A;
|
|
1824
|
+
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);
|
|
1825
|
+
const p = v(y.value) ? y.value : v(o.value) ? o.value : ((A = l.value[0]) == null ? void 0 : A.value) ?? "";
|
|
1826
|
+
return p && xe(p), s.value = !0, p;
|
|
1769
1827
|
}
|
|
1770
|
-
async function
|
|
1771
|
-
const p = await
|
|
1772
|
-
return p && await
|
|
1828
|
+
async function Y() {
|
|
1829
|
+
const p = await N();
|
|
1830
|
+
return p && await ke(p), p;
|
|
1773
1831
|
}
|
|
1774
|
-
return { options:
|
|
1832
|
+
return { options: l, ready: s, outletId: y, resolve: Y, resolveOutlet: N, switchTo: m };
|
|
1775
1833
|
}
|
|
1776
|
-
const
|
|
1834
|
+
const kn = ["data-hierarchy", "data-size", "data-icon"], xo = /* @__PURE__ */ Le({
|
|
1777
1835
|
__name: "ScheduleButton",
|
|
1778
1836
|
props: {
|
|
1779
1837
|
hierarchy: { default: "primary" },
|
|
@@ -1781,32 +1839,32 @@ const bn = ["data-hierarchy", "data-size", "data-icon"], Ro = /* @__PURE__ */ Ae
|
|
|
1781
1839
|
iconOnly: { type: Boolean, default: !1 }
|
|
1782
1840
|
},
|
|
1783
1841
|
setup(e) {
|
|
1784
|
-
return (a, t) => (
|
|
1842
|
+
return (a, t) => (P(), C("button", {
|
|
1785
1843
|
type: "button",
|
|
1786
1844
|
class: "sch-button",
|
|
1787
1845
|
"data-hierarchy": e.hierarchy,
|
|
1788
1846
|
"data-size": e.size,
|
|
1789
1847
|
"data-icon": e.iconOnly ? "only" : void 0
|
|
1790
1848
|
}, [
|
|
1791
|
-
|
|
1792
|
-
], 8,
|
|
1849
|
+
We(a.$slots, "default")
|
|
1850
|
+
], 8, kn));
|
|
1793
1851
|
}
|
|
1794
|
-
}),
|
|
1852
|
+
}), Cn = ["disabled", "aria-expanded"], Mn = { class: "sch" }, Sn = ["aria-multiselectable"], Ln = {
|
|
1795
1853
|
key: 0,
|
|
1796
1854
|
class: "fx-pop-head"
|
|
1797
|
-
},
|
|
1855
|
+
}, In = {
|
|
1798
1856
|
key: 1,
|
|
1799
1857
|
class: "fx-pop-search"
|
|
1800
|
-
},
|
|
1858
|
+
}, Rn = {
|
|
1801
1859
|
key: 2,
|
|
1802
1860
|
class: "fx-opt is-off"
|
|
1803
1861
|
}, On = {
|
|
1804
1862
|
key: 0,
|
|
1805
1863
|
class: "fx-grp"
|
|
1806
|
-
},
|
|
1864
|
+
}, Tn = ["aria-selected", "onClick"], $n = {
|
|
1807
1865
|
key: 0,
|
|
1808
1866
|
class: "fx-opt-text"
|
|
1809
|
-
},
|
|
1867
|
+
}, Yn = { key: 0 }, Bo = /* @__PURE__ */ Le({
|
|
1810
1868
|
inheritAttrs: !1,
|
|
1811
1869
|
__name: "ScheduleSelect",
|
|
1812
1870
|
props: {
|
|
@@ -1814,7 +1872,9 @@ const bn = ["data-hierarchy", "data-size", "data-icon"], Ro = /* @__PURE__ */ Ae
|
|
|
1814
1872
|
options: {},
|
|
1815
1873
|
multiple: { type: Boolean },
|
|
1816
1874
|
selected: {},
|
|
1875
|
+
selectedId: {},
|
|
1817
1876
|
placeholder: {},
|
|
1877
|
+
selectedLabel: {},
|
|
1818
1878
|
disabled: { type: Boolean },
|
|
1819
1879
|
menuTitle: {},
|
|
1820
1880
|
searchable: { type: Boolean },
|
|
@@ -1822,201 +1882,202 @@ const bn = ["data-hierarchy", "data-size", "data-icon"], Ro = /* @__PURE__ */ Ae
|
|
|
1822
1882
|
},
|
|
1823
1883
|
emits: ["update:modelValue", "toggle"],
|
|
1824
1884
|
setup(e, { emit: a }) {
|
|
1825
|
-
const t = e, n = a,
|
|
1826
|
-
|
|
1827
|
-
|
|
1885
|
+
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);
|
|
1886
|
+
Ce(() => {
|
|
1887
|
+
o.value = typeof document < "u" && !!document.body;
|
|
1828
1888
|
});
|
|
1829
|
-
const p =
|
|
1830
|
-
var
|
|
1889
|
+
const p = $(() => {
|
|
1890
|
+
var r, c;
|
|
1891
|
+
if (!t.multiple && t.selectedLabel != null) return t.selectedLabel;
|
|
1831
1892
|
if (t.multiple) {
|
|
1832
|
-
const u = ((
|
|
1893
|
+
const u = ((r = t.selected) == null ? void 0 : r.length) ?? 0;
|
|
1833
1894
|
return u ? `${u} selected` : t.placeholder ?? "";
|
|
1834
1895
|
}
|
|
1835
1896
|
return ((c = t.options.find((u) => u.value === t.modelValue)) == null ? void 0 : c.label) ?? "";
|
|
1836
1897
|
});
|
|
1837
|
-
function
|
|
1898
|
+
function A(r) {
|
|
1838
1899
|
var c;
|
|
1839
|
-
return t.multiple ? !!((c = t.selected) != null && c.includes(
|
|
1900
|
+
return t.multiple ? !!((c = t.selected) != null && c.includes(r.value)) : t.selectedId != null ? r.id === t.selectedId : r.value === t.modelValue;
|
|
1840
1901
|
}
|
|
1841
|
-
const
|
|
1842
|
-
const
|
|
1843
|
-
return !t.searchable || !
|
|
1844
|
-
}),
|
|
1845
|
-
const
|
|
1902
|
+
const L = $(() => !!t.menuTitle || t.options.some((r) => r.hint)), T = w(""), q = w(null), Q = $(() => {
|
|
1903
|
+
const r = T.value.trim().toLowerCase();
|
|
1904
|
+
return !t.searchable || !r ? t.options : t.options.filter((c) => `${c.label} ${c.hint ?? ""}`.toLowerCase().includes(r));
|
|
1905
|
+
}), re = $(() => {
|
|
1906
|
+
const r = [];
|
|
1846
1907
|
let c;
|
|
1847
|
-
for (const u of
|
|
1848
|
-
u.group !== c && (c = u.group, c &&
|
|
1849
|
-
return
|
|
1850
|
-
}),
|
|
1851
|
-
function
|
|
1852
|
-
const
|
|
1853
|
-
if (!
|
|
1854
|
-
const u = c.getBoundingClientRect(),
|
|
1855
|
-
|
|
1856
|
-
const
|
|
1857
|
-
|
|
1858
|
-
const
|
|
1859
|
-
let
|
|
1860
|
-
|
|
1861
|
-
const ia = Math.min(Math.max(
|
|
1862
|
-
|
|
1908
|
+
for (const u of Q.value)
|
|
1909
|
+
u.group !== c && (c = u.group, c && r.push({ heading: c })), r.push({ option: u });
|
|
1910
|
+
return r;
|
|
1911
|
+
}), x = 5, I = 8;
|
|
1912
|
+
function X() {
|
|
1913
|
+
const r = N.value, c = v.value;
|
|
1914
|
+
if (!r || !c) return;
|
|
1915
|
+
const u = c.getBoundingClientRect(), S = window.innerWidth || document.documentElement.clientWidth, O = window.innerHeight || document.documentElement.clientHeight;
|
|
1916
|
+
r.style.minWidth = `${Math.round(u.width)}px`, r.style.maxWidth = `${Math.max(180, Math.round(S - I * 2))}px`;
|
|
1917
|
+
const Z = O - u.bottom - x - I, oa = u.top - x - I;
|
|
1918
|
+
r.style.maxHeight = `${Math.max(120, Math.min(320, Math.max(Z, oa)))}px`;
|
|
1919
|
+
const de = r.offsetHeight, sa = r.offsetWidth;
|
|
1920
|
+
let ve = u.bottom + x;
|
|
1921
|
+
ve + de > O - I && (ve = u.top - x - de >= I ? u.top - x - de : Math.max(I, O - de - I));
|
|
1922
|
+
const ia = Math.min(Math.max(I, u.left), Math.max(I, S - sa - I));
|
|
1923
|
+
r.style.top = `${Math.round(ve)}px`, r.style.left = `${Math.round(ia)}px`, r.style.visibility = "visible";
|
|
1863
1924
|
}
|
|
1864
|
-
function
|
|
1865
|
-
var u,
|
|
1866
|
-
const c =
|
|
1867
|
-
c && ((u = m.value) != null && u.contains(c) || (
|
|
1925
|
+
function le(r) {
|
|
1926
|
+
var u, S;
|
|
1927
|
+
const c = r.target;
|
|
1928
|
+
c && ((u = m.value) != null && u.contains(c) || (S = N.value) != null && S.contains(c)) || k();
|
|
1868
1929
|
}
|
|
1869
|
-
function
|
|
1870
|
-
const c =
|
|
1930
|
+
function J(r) {
|
|
1931
|
+
const c = N.value, u = r.target;
|
|
1871
1932
|
if (c && u && u !== document && c.contains(u)) return;
|
|
1872
|
-
const
|
|
1873
|
-
if (!
|
|
1874
|
-
const
|
|
1875
|
-
if (
|
|
1876
|
-
|
|
1933
|
+
const S = v.value;
|
|
1934
|
+
if (!S) return;
|
|
1935
|
+
const O = S.getBoundingClientRect(), Z = window.innerHeight || document.documentElement.clientHeight;
|
|
1936
|
+
if (O.bottom < 0 || O.top > Z) {
|
|
1937
|
+
k();
|
|
1877
1938
|
return;
|
|
1878
1939
|
}
|
|
1879
|
-
|
|
1940
|
+
X();
|
|
1880
1941
|
}
|
|
1881
|
-
function
|
|
1882
|
-
document.addEventListener("click",
|
|
1942
|
+
function g() {
|
|
1943
|
+
document.addEventListener("click", le), document.addEventListener("scroll", J, !0), window.addEventListener("resize", k);
|
|
1883
1944
|
}
|
|
1884
|
-
function
|
|
1885
|
-
document.removeEventListener("click",
|
|
1945
|
+
function E() {
|
|
1946
|
+
document.removeEventListener("click", le), document.removeEventListener("scroll", J, !0), window.removeEventListener("resize", k);
|
|
1886
1947
|
}
|
|
1887
|
-
async function
|
|
1888
|
-
var
|
|
1889
|
-
t.disabled ||
|
|
1948
|
+
async function H() {
|
|
1949
|
+
var r, c, u;
|
|
1950
|
+
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());
|
|
1890
1951
|
}
|
|
1891
|
-
function
|
|
1892
|
-
|
|
1952
|
+
function k() {
|
|
1953
|
+
l.value && (l.value = !1, T.value = "", E());
|
|
1893
1954
|
}
|
|
1894
|
-
|
|
1895
|
-
|
|
1955
|
+
Se(T, async () => {
|
|
1956
|
+
l.value && (await Ae(), X());
|
|
1896
1957
|
});
|
|
1897
|
-
function
|
|
1958
|
+
function F(r) {
|
|
1898
1959
|
var c;
|
|
1899
|
-
if (
|
|
1900
|
-
|
|
1901
|
-
else if (
|
|
1902
|
-
|
|
1903
|
-
const u =
|
|
1904
|
-
u &&
|
|
1960
|
+
if (r.key === "Escape")
|
|
1961
|
+
r.preventDefault(), k(), (c = v.value) == null || c.focus();
|
|
1962
|
+
else if (r.key === "Enter") {
|
|
1963
|
+
r.preventDefault();
|
|
1964
|
+
const u = Q.value.find((S) => !S.disabled);
|
|
1965
|
+
u && ue(u);
|
|
1905
1966
|
}
|
|
1906
1967
|
}
|
|
1907
|
-
function
|
|
1908
|
-
|
|
1968
|
+
function b() {
|
|
1969
|
+
l.value ? k() : H();
|
|
1909
1970
|
}
|
|
1910
|
-
function
|
|
1911
|
-
if (!
|
|
1912
|
-
if (t.multiple && !
|
|
1913
|
-
n("toggle",
|
|
1971
|
+
function ue(r) {
|
|
1972
|
+
if (!r.disabled) {
|
|
1973
|
+
if (t.multiple && !r.command) {
|
|
1974
|
+
n("toggle", r.value);
|
|
1914
1975
|
return;
|
|
1915
1976
|
}
|
|
1916
|
-
if (
|
|
1917
|
-
n("update:modelValue",
|
|
1977
|
+
if (k(), t.multiple) {
|
|
1978
|
+
n("update:modelValue", r.value);
|
|
1918
1979
|
return;
|
|
1919
1980
|
}
|
|
1920
|
-
|
|
1981
|
+
r.value !== t.modelValue && n("update:modelValue", r.value);
|
|
1921
1982
|
}
|
|
1922
1983
|
}
|
|
1923
|
-
const
|
|
1924
|
-
function
|
|
1925
|
-
const c =
|
|
1984
|
+
const aa = $(() => t.options.filter((r) => !r.disabled));
|
|
1985
|
+
function ta(r) {
|
|
1986
|
+
const c = aa.value;
|
|
1926
1987
|
if (t.multiple || !c.length) {
|
|
1927
|
-
|
|
1988
|
+
H();
|
|
1928
1989
|
return;
|
|
1929
1990
|
}
|
|
1930
|
-
const u = c.findIndex((
|
|
1931
|
-
|
|
1991
|
+
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];
|
|
1992
|
+
O && O.value !== t.modelValue ? n("update:modelValue", O.value) : H();
|
|
1932
1993
|
}
|
|
1933
|
-
function
|
|
1994
|
+
function na(r) {
|
|
1934
1995
|
var c;
|
|
1935
|
-
if (
|
|
1936
|
-
if (!
|
|
1937
|
-
|
|
1996
|
+
if (r.key === "Escape") {
|
|
1997
|
+
if (!l.value) return;
|
|
1998
|
+
r.preventDefault(), k(), (c = v.value) == null || c.focus();
|
|
1938
1999
|
return;
|
|
1939
2000
|
}
|
|
1940
|
-
if (
|
|
1941
|
-
|
|
2001
|
+
if (r.key === "Enter" || r.key === " ") {
|
|
2002
|
+
r.preventDefault(), b();
|
|
1942
2003
|
return;
|
|
1943
2004
|
}
|
|
1944
|
-
|
|
2005
|
+
r.key !== "ArrowDown" && r.key !== "ArrowUp" && r.key !== "Home" && r.key !== "End" || (r.preventDefault(), ta(r.key));
|
|
1945
2006
|
}
|
|
1946
|
-
return
|
|
2007
|
+
return Me(E), (r, c) => (P(), C("div", {
|
|
1947
2008
|
ref_key: "rootEl",
|
|
1948
2009
|
ref: m,
|
|
1949
|
-
class:
|
|
2010
|
+
class: ye(["fx-sel", s.value])
|
|
1950
2011
|
}, [
|
|
1951
|
-
|
|
2012
|
+
B("button", ua({
|
|
1952
2013
|
ref_key: "btnEl",
|
|
1953
|
-
ref:
|
|
1954
|
-
},
|
|
2014
|
+
ref: v
|
|
2015
|
+
}, r.$attrs, {
|
|
1955
2016
|
type: "button",
|
|
1956
|
-
class: ["sch-input fx-btn", { "is-open":
|
|
2017
|
+
class: ["sch-input fx-btn", { "is-open": l.value }],
|
|
1957
2018
|
disabled: e.disabled,
|
|
1958
2019
|
"aria-haspopup": "listbox",
|
|
1959
|
-
"aria-expanded":
|
|
1960
|
-
onClick: c[0] || (c[0] = (u) =>
|
|
1961
|
-
onKeydown:
|
|
1962
|
-
}),
|
|
1963
|
-
(
|
|
2020
|
+
"aria-expanded": l.value,
|
|
2021
|
+
onClick: c[0] || (c[0] = (u) => b()),
|
|
2022
|
+
onKeydown: na
|
|
2023
|
+
}), U(p.value), 17, Cn),
|
|
2024
|
+
(P(), la(da, {
|
|
1964
2025
|
to: "body",
|
|
1965
|
-
disabled:
|
|
2026
|
+
disabled: !Y.value
|
|
1966
2027
|
}, [
|
|
1967
|
-
|
|
1968
|
-
|
|
2028
|
+
B("div", Mn, [
|
|
2029
|
+
l.value ? (P(), C("div", {
|
|
1969
2030
|
key: 0,
|
|
1970
2031
|
ref_key: "popEl",
|
|
1971
|
-
ref:
|
|
1972
|
-
class:
|
|
2032
|
+
ref: N,
|
|
2033
|
+
class: ye(["fx-pop", { "fx-pop-rich": L.value }]),
|
|
1973
2034
|
role: "listbox",
|
|
1974
2035
|
"aria-multiselectable": e.multiple || void 0,
|
|
1975
2036
|
style: { visibility: "hidden" }
|
|
1976
2037
|
}, [
|
|
1977
|
-
e.menuTitle ? (
|
|
1978
|
-
e.searchable ? (
|
|
1979
|
-
|
|
2038
|
+
e.menuTitle ? (P(), C("div", Ln, U(e.menuTitle), 1)) : W("", !0),
|
|
2039
|
+
e.searchable ? (P(), C("div", In, [
|
|
2040
|
+
ca(B("input", {
|
|
1980
2041
|
ref_key: "searchEl",
|
|
1981
|
-
ref:
|
|
1982
|
-
"onUpdate:modelValue": c[1] || (c[1] = (u) =>
|
|
2042
|
+
ref: q,
|
|
2043
|
+
"onUpdate:modelValue": c[1] || (c[1] = (u) => T.value = u),
|
|
1983
2044
|
class: "sch-input fx-pop-q",
|
|
1984
2045
|
type: "search",
|
|
1985
2046
|
placeholder: "Search",
|
|
1986
2047
|
autocomplete: "off",
|
|
1987
2048
|
spellcheck: "false",
|
|
1988
2049
|
"aria-label": "Search",
|
|
1989
|
-
onKeydown:
|
|
2050
|
+
onKeydown: F
|
|
1990
2051
|
}, null, 544), [
|
|
1991
|
-
[
|
|
2052
|
+
[ya, T.value]
|
|
1992
2053
|
])
|
|
1993
|
-
])) :
|
|
1994
|
-
e.searchable && !
|
|
1995
|
-
(
|
|
2054
|
+
])) : W("", !0),
|
|
2055
|
+
e.searchable && !re.value.length ? (P(), C("div", Rn, "No matches")) : W("", !0),
|
|
2056
|
+
(P(!0), C(ge, null, ma(re.value, (u) => (P(), C(ge, {
|
|
1996
2057
|
key: "heading" in u ? `heading:${u.heading}` : `option:${u.option.value}`
|
|
1997
2058
|
}, [
|
|
1998
|
-
"heading" in u ? (
|
|
2059
|
+
"heading" in u ? (P(), C("div", On, U(u.heading), 1)) : (P(), C("div", {
|
|
1999
2060
|
key: 1,
|
|
2000
|
-
class:
|
|
2001
|
-
"is-on":
|
|
2061
|
+
class: ye(["fx-opt", {
|
|
2062
|
+
"is-on": A(u.option),
|
|
2002
2063
|
"is-off": u.option.disabled,
|
|
2003
2064
|
"is-new": u.option.command
|
|
2004
2065
|
}]),
|
|
2005
2066
|
role: "option",
|
|
2006
|
-
"aria-selected":
|
|
2007
|
-
onClick: (
|
|
2067
|
+
"aria-selected": A(u.option),
|
|
2068
|
+
onClick: (S) => ue(u.option)
|
|
2008
2069
|
}, [
|
|
2009
|
-
c[2] || (c[2] =
|
|
2070
|
+
c[2] || (c[2] = B("span", {
|
|
2010
2071
|
class: "fx-tick",
|
|
2011
2072
|
"aria-hidden": "true"
|
|
2012
2073
|
}, [
|
|
2013
|
-
|
|
2074
|
+
B("svg", {
|
|
2014
2075
|
width: "11",
|
|
2015
2076
|
height: "11",
|
|
2016
2077
|
viewBox: "0 0 16 16",
|
|
2017
2078
|
fill: "none"
|
|
2018
2079
|
}, [
|
|
2019
|
-
|
|
2080
|
+
B("path", {
|
|
2020
2081
|
d: "m3.5 8.4 3 3 6-7",
|
|
2021
2082
|
stroke: "currentColor",
|
|
2022
2083
|
"stroke-width": "2.2",
|
|
@@ -2025,20 +2086,20 @@ const bn = ["data-hierarchy", "data-size", "data-icon"], Ro = /* @__PURE__ */ Ae
|
|
|
2025
2086
|
})
|
|
2026
2087
|
])
|
|
2027
2088
|
], -1)),
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
u.option.hint ? (
|
|
2031
|
-
])) : (
|
|
2032
|
-
|
|
2089
|
+
L.value ? (P(), C("span", $n, [
|
|
2090
|
+
B("b", null, U(u.option.label), 1),
|
|
2091
|
+
u.option.hint ? (P(), C("small", Yn, U(u.option.hint), 1)) : W("", !0)
|
|
2092
|
+
])) : (P(), C(ge, { key: 1 }, [
|
|
2093
|
+
pa(U(u.option.label), 1)
|
|
2033
2094
|
], 64))
|
|
2034
|
-
], 10,
|
|
2095
|
+
], 10, Tn))
|
|
2035
2096
|
], 64))), 128))
|
|
2036
|
-
], 10,
|
|
2097
|
+
], 10, Sn)) : W("", !0)
|
|
2037
2098
|
])
|
|
2038
2099
|
], 8, ["disabled"]))
|
|
2039
2100
|
], 2));
|
|
2040
2101
|
}
|
|
2041
|
-
}),
|
|
2102
|
+
}), 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({
|
|
2042
2103
|
__name: "ScheduleModal",
|
|
2043
2104
|
props: {
|
|
2044
2105
|
open: { type: Boolean },
|
|
@@ -2050,139 +2111,143 @@ const bn = ["data-hierarchy", "data-size", "data-icon"], Ro = /* @__PURE__ */ Ae
|
|
|
2050
2111
|
},
|
|
2051
2112
|
emits: ["close"],
|
|
2052
2113
|
setup(e, { emit: a }) {
|
|
2053
|
-
const t = e, n = a,
|
|
2054
|
-
let
|
|
2055
|
-
function
|
|
2056
|
-
|
|
2057
|
-
const m =
|
|
2058
|
-
m && (m.querySelector(
|
|
2114
|
+
const t = e, n = a, i = w(null);
|
|
2115
|
+
let s = null;
|
|
2116
|
+
function l() {
|
|
2117
|
+
Ae(() => {
|
|
2118
|
+
const m = i.value;
|
|
2119
|
+
m && (m.querySelector(Ue) ?? m).focus();
|
|
2059
2120
|
});
|
|
2060
2121
|
}
|
|
2061
|
-
function
|
|
2122
|
+
function o(m) {
|
|
2062
2123
|
if (!t.open) return;
|
|
2063
2124
|
if (m.key === "Escape") {
|
|
2064
2125
|
m.preventDefault(), n("close");
|
|
2065
2126
|
return;
|
|
2066
2127
|
}
|
|
2067
|
-
if (m.key !== "Tab" || !
|
|
2068
|
-
const
|
|
2069
|
-
if (!
|
|
2070
|
-
const
|
|
2071
|
-
m.shiftKey && document.activeElement ===
|
|
2128
|
+
if (m.key !== "Tab" || !i.value) return;
|
|
2129
|
+
const v = Array.from(i.value.querySelectorAll(Ue));
|
|
2130
|
+
if (!v.length) return;
|
|
2131
|
+
const N = v[0], Y = v[v.length - 1];
|
|
2132
|
+
m.shiftKey && document.activeElement === N ? (m.preventDefault(), Y.focus()) : !m.shiftKey && document.activeElement === Y && (m.preventDefault(), N.focus());
|
|
2072
2133
|
}
|
|
2073
|
-
return
|
|
2134
|
+
return Se(
|
|
2074
2135
|
() => t.open,
|
|
2075
2136
|
(m) => {
|
|
2076
|
-
m ? (
|
|
2137
|
+
m ? (s = document.activeElement instanceof HTMLElement ? document.activeElement : null, l()) : (s == null || s.focus(), s = null);
|
|
2077
2138
|
},
|
|
2078
2139
|
{ immediate: !0 }
|
|
2079
|
-
),
|
|
2080
|
-
document.removeEventListener("keydown",
|
|
2081
|
-
}), (m,
|
|
2140
|
+
), Ce(() => document.addEventListener("keydown", o)), Me(() => {
|
|
2141
|
+
document.removeEventListener("keydown", o), s = null;
|
|
2142
|
+
}), (m, v) => e.open ? (P(), C("div", {
|
|
2082
2143
|
key: 0,
|
|
2083
2144
|
class: "modal-overlay open",
|
|
2084
|
-
onClick:
|
|
2145
|
+
onClick: v[0] || (v[0] = fa((N) => n("close"), ["self"]))
|
|
2085
2146
|
}, [
|
|
2086
|
-
|
|
2147
|
+
B("div", {
|
|
2087
2148
|
id: e.id,
|
|
2088
2149
|
ref_key: "panel",
|
|
2089
|
-
ref:
|
|
2090
|
-
class:
|
|
2091
|
-
style:
|
|
2150
|
+
ref: i,
|
|
2151
|
+
class: ye(["schedule-modal-panel", e.panelClass]),
|
|
2152
|
+
style: ha(e.panelStyle),
|
|
2092
2153
|
role: "dialog",
|
|
2093
2154
|
"aria-modal": "true",
|
|
2094
2155
|
"aria-labelledby": e.labelledBy,
|
|
2095
2156
|
"aria-label": e.label,
|
|
2096
2157
|
tabindex: "-1"
|
|
2097
2158
|
}, [
|
|
2098
|
-
|
|
2099
|
-
], 14,
|
|
2100
|
-
])) :
|
|
2159
|
+
We(m.$slots, "default")
|
|
2160
|
+
], 14, xn)
|
|
2161
|
+
])) : W("", !0);
|
|
2101
2162
|
}
|
|
2102
2163
|
});
|
|
2103
2164
|
export {
|
|
2104
2165
|
ao as $,
|
|
2105
|
-
|
|
2166
|
+
No as A,
|
|
2106
2167
|
Ea as B,
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2168
|
+
Qn as C,
|
|
2169
|
+
Jn as D,
|
|
2170
|
+
ro as E,
|
|
2171
|
+
Mo as F,
|
|
2172
|
+
wa as G,
|
|
2173
|
+
Ao as H,
|
|
2174
|
+
wo as I,
|
|
2175
|
+
Ho as J,
|
|
2176
|
+
qe as K,
|
|
2177
|
+
D as L,
|
|
2178
|
+
_ as M,
|
|
2179
|
+
Sa as N,
|
|
2180
|
+
Ye as O,
|
|
2181
|
+
Pa as P,
|
|
2182
|
+
Lo as Q,
|
|
2183
|
+
qn as R,
|
|
2184
|
+
ko as S,
|
|
2185
|
+
Xn as T,
|
|
2186
|
+
Ze as U,
|
|
2187
|
+
ie as V,
|
|
2188
|
+
Po as W,
|
|
2189
|
+
Pn as X,
|
|
2190
|
+
Xe as Y,
|
|
2191
|
+
ne as Z,
|
|
2192
|
+
no as _,
|
|
2193
|
+
Oo as a,
|
|
2194
|
+
to as a0,
|
|
2195
|
+
so as a1,
|
|
2196
|
+
Ie as a2,
|
|
2197
|
+
io as a3,
|
|
2198
|
+
hn as a4,
|
|
2199
|
+
se as a5,
|
|
2200
|
+
vo as a6,
|
|
2201
|
+
fo as a7,
|
|
2202
|
+
ho as a8,
|
|
2203
|
+
So as a9,
|
|
2204
|
+
Oa as aa,
|
|
2205
|
+
po as ab,
|
|
2206
|
+
Na as ac,
|
|
2207
|
+
Aa as ad,
|
|
2208
|
+
Vn as ae,
|
|
2209
|
+
$a as af,
|
|
2210
|
+
mn as ag,
|
|
2211
|
+
mo as ah,
|
|
2212
|
+
Te as ai,
|
|
2213
|
+
$e as aj,
|
|
2214
|
+
me as ak,
|
|
2215
|
+
ke as al,
|
|
2216
|
+
$o as am,
|
|
2217
|
+
La as an,
|
|
2218
|
+
xo as ao,
|
|
2219
|
+
Bo as ap,
|
|
2220
|
+
_o as aq,
|
|
2221
|
+
K as ar,
|
|
2222
|
+
zn as as,
|
|
2223
|
+
Yo as at,
|
|
2224
|
+
co as au,
|
|
2225
|
+
lo as av,
|
|
2226
|
+
pe as aw,
|
|
2227
|
+
uo as ax,
|
|
2228
|
+
M as b,
|
|
2229
|
+
To as c,
|
|
2230
|
+
V as d,
|
|
2231
|
+
Gn as e,
|
|
2167
2232
|
d as f,
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2233
|
+
cn as g,
|
|
2234
|
+
bo as h,
|
|
2235
|
+
Ca as i,
|
|
2236
|
+
Io as j,
|
|
2237
|
+
Do as k,
|
|
2238
|
+
go as l,
|
|
2239
|
+
Eo as m,
|
|
2240
|
+
Ne as n,
|
|
2176
2241
|
y as o,
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2242
|
+
Co as p,
|
|
2243
|
+
eo as q,
|
|
2244
|
+
oo as r,
|
|
2245
|
+
yo as s,
|
|
2246
|
+
Pe as t,
|
|
2247
|
+
jn as u,
|
|
2248
|
+
Ro as v,
|
|
2249
|
+
Zn as w,
|
|
2250
|
+
Kn as x,
|
|
2251
|
+
Ve as y,
|
|
2252
|
+
be as z
|
|
2188
2253
|
};
|