@feedmepos/mf-hrm-portal 2.3.0-dev.13 → 2.3.0-dev.14
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-D3egZFML.js → ApprovalCodeList-C9dauQ81.js} +4 -4
- package/dist/{AuditLogList-BzbaEsSj.js → AuditLogList-zW_N_ECT.js} +17 -18
- package/dist/{ConditionBuilderForm.vue_vue_type_script_setup_true_lang-Do52KbKm.js → ConditionBuilderForm.vue_vue_type_script_setup_true_lang-DJuO1qPX.js} +2 -2
- package/dist/{EmployeeList-BiM8dRwZ.js → EmployeeList-8jkHTd7q.js} +255 -267
- package/dist/{FormItem.vue_vue_type_script_setup_true_lang-CUnlKsxk.js → FormItem.vue_vue_type_script_setup_true_lang-CJc_g0tW.js} +6 -6
- package/dist/{GrantUserList-Dj2ms20E.js → GrantUserList-Dj55GA7O.js} +5 -5
- package/dist/{Main-C2z7Jf9A.js → Main-0TfvGJ4N.js} +5 -5
- package/dist/{Main-DmpwTPaI.js → Main-BQNkTyET.js} +9 -9
- package/dist/{Main-DklZWoKj.js → Main-CuUG6svQ.js} +2 -2
- package/dist/{PermissionSetList-C-qgCcRO.js → PermissionSetList-BsLi-TOK.js} +5 -5
- package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-ggZB5zWW.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-C2l8nWx2.js} +1014 -1014
- package/dist/{RoleList-ohfin77B.js → RoleList-DLDcyVWT.js} +7 -7
- package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-diuWysro.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-CUXUPfRc.js} +190 -181
- package/dist/{ScheduleGeneralPage-aCljFf21.js → ScheduleGeneralPage-BhYI6O9g.js} +132 -133
- package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-x_-BYkcc.js → ScheduleModal.vue_vue_type_script_setup_true_lang-BLBLBtNG.js} +669 -646
- package/dist/{SchedulePage-DdMHF6kX.js → SchedulePage-DPU4taJt.js} +7407 -7359
- package/dist/{SchedulePositionPage-CID91orD.js → SchedulePositionPage-Byt6nmUj.js} +82 -84
- package/dist/{SelectFilter-CG13h83-.js → SelectFilter-1fh00OZW.js} +1 -1
- package/dist/{TeamMemberList-DJIKL4dE.js → TeamMemberList-CyUX8Afk.js} +35 -36
- package/dist/{TimesheetList-BPXWPNfT.js → TimesheetList-Q4FeNgOT.js} +52 -53
- package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-DVcV0knM.js → TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-C3iU4Zmc.js} +2 -2
- package/dist/{app-Bz8568j8.js → app-TuHQoM7K.js} +676 -666
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-DhSRKSu4.js → dayjs.min-DXnA8GYn.js} +1 -1
- package/dist/{employee-BM44u8b-.js → employee-Ctnil3cD.js} +3 -3
- package/dist/{iteration-BHDxs89d.js → iteration-BxOzv27y.js} +1 -1
- package/dist/{lodash-DgSYLwYD.js → lodash-CKT_RxJs.js} +1 -1
- package/dist/object-Dwyg2LgX.js +16 -0
- package/dist/{role-BMJ7LEHN.js → role-CNEJPyaD.js} +1 -1
- package/dist/{rule-CCo7_ckA.js → rule-FbuHv6Gh.js} +2 -2
- package/dist/src/views/scheduling/composables/onboarding-types.d.ts +2 -1
- package/dist/src/views/scheduling/composables/useScheduleCostRail.d.ts +3 -1
- package/dist/src/views/scheduling/composables/useScheduleOnboardingEmployees.d.ts +2 -0
- package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +3 -1
- package/dist/src/views/scheduling/data.d.ts +17 -0
- package/dist/style.css +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useReportPermissions-C_Cd__n1.js → useReportPermissions-lemBrd1S.js} +3 -3
- package/package.json +1 -1
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { onMounted as Se, onBeforeUnmount as Le, ref as A, reactive as
|
|
2
|
-
import { useRoute as
|
|
1
|
+
import { onMounted as Se, onBeforeUnmount as Le, ref as A, reactive as O, shallowRef as we, watch as Ie, computed as Y, defineComponent as Re, createElementBlock as C, openBlock as N, renderSlot as ze, useAttrs as ua, nextTick as be, normalizeClass as fe, createElementVNode as x, createBlock as da, mergeProps as ca, toDisplayString as W, Teleport as ya, createCommentVNode as z, withDirectives as ma, vModelText as pa, Fragment as He, renderList as fa, createTextVNode as ha, withModifiers as va, normalizeStyle as ga } from "vue";
|
|
2
|
+
import { useRoute as Da, useRouter as wa } from "vue-router";
|
|
3
3
|
import { useCoreStore as Ve } from "@feedmepos/mf-common";
|
|
4
|
-
import { g
|
|
5
|
-
import { E as Pe, u as Ke } from "./employee-
|
|
6
|
-
function
|
|
4
|
+
import { g, b as f, u as Ha } from "./restaurant-BbYRA_IT.js";
|
|
5
|
+
import { E as Pe, u as Ke } from "./employee-Ctnil3cD.js";
|
|
6
|
+
function Kn(e) {
|
|
7
7
|
let a = null;
|
|
8
8
|
function t() {
|
|
9
9
|
if (!a) return;
|
|
@@ -22,59 +22,59 @@ function Ne(e) {
|
|
|
22
22
|
const [a, t] = String(e || "0:0").split(":").map(Number);
|
|
23
23
|
return (Number.isFinite(a) ? a : 0) * 60 + (Number.isFinite(t) ? t : 0);
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function Aa(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
|
|
29
|
+
function Ea(e, a) {
|
|
30
30
|
const t = Ne(e);
|
|
31
31
|
let n = Ne(a);
|
|
32
32
|
return n <= t && (n += 1440), [t, n];
|
|
33
33
|
}
|
|
34
34
|
function Ge(e, a) {
|
|
35
|
-
const [t, n] =
|
|
35
|
+
const [t, n] = Ea(e, a);
|
|
36
36
|
return Math.max(0, n - t);
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
const a = (Ne(e) % 1440 + 1440) % 1440, t = Math.floor(a / 60), n = a % 60, i = t < 12 ? "am" : "pm",
|
|
40
|
-
return n ? `${
|
|
38
|
+
function ba(e) {
|
|
39
|
+
const a = (Ne(e) % 1440 + 1440) % 1440, t = Math.floor(a / 60), n = a % 60, i = t < 12 ? "am" : "pm", o = t % 12 || 12;
|
|
40
|
+
return n ? `${o}:${String(n).padStart(2, "0")}${i}` : `${o}${i}`;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
return
|
|
42
|
+
function Gn(e) {
|
|
43
|
+
return ba(Aa(e % 1440));
|
|
44
44
|
}
|
|
45
45
|
function je(e) {
|
|
46
46
|
const a = Array.isArray(e) ? e : e == null ? void 0 : e.breaks;
|
|
47
47
|
return a != null && a.length ? a.reduce((t, n) => {
|
|
48
48
|
if (n.type === "DURATION") return t + n.minutes;
|
|
49
|
-
const [i,
|
|
50
|
-
let u = l * 60 +
|
|
49
|
+
const [i, o] = n.startTime.split(":").map(Number), [l, s] = n.endTime.split(":").map(Number);
|
|
50
|
+
let u = l * 60 + s - (i * 60 + o);
|
|
51
51
|
return u < 0 && (u += 24 * 60), t + u;
|
|
52
52
|
}, 0) : Math.max(0, e && !Array.isArray(e) ? e.breakMins ?? 0 : 0);
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function jn(e, a) {
|
|
55
55
|
var i;
|
|
56
|
-
const t = a ?? Ge(e.start, e.end), n = (i = e.breaks) != null && i.length ? e.breaks.reduce((
|
|
56
|
+
const t = a ?? Ge(e.start, e.end), n = (i = e.breaks) != null && i.length ? e.breaks.reduce((o, l) => o + (l.breakPayType === "UNPAID" ? je([l]) : 0), 0) : Math.max(0, e.breakMins ?? 0);
|
|
57
57
|
return Math.max(0, t - Math.min(t, n));
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function Qn(e) {
|
|
60
60
|
const a = Math.max(0, Math.round(e ?? 0));
|
|
61
61
|
return a ? [{ type: "DURATION", minutes: a, breakPayType: "UNPAID" }] : [];
|
|
62
62
|
}
|
|
63
|
-
const ae = 500,
|
|
63
|
+
const ae = 500, Pa = 10, Te = 6, Xn = 1500, Qe = 1e6, D = {
|
|
64
64
|
async listEmployeeProfiles(e) {
|
|
65
|
-
return
|
|
65
|
+
return g(
|
|
66
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
|
|
72
|
+
return g(
|
|
73
73
|
await f(`restaurants/${e}/schedules`).get("employee-configs")
|
|
74
74
|
);
|
|
75
75
|
},
|
|
76
76
|
async saveEmployeeConfigs(e, a) {
|
|
77
|
-
return
|
|
77
|
+
return g(
|
|
78
78
|
await f(`restaurants/${e}/schedules`).post(
|
|
79
79
|
"employee-configs/reorder",
|
|
80
80
|
a
|
|
@@ -82,17 +82,17 @@ const ae = 500, ba = 10, Te = 6, jn = 1500, Qe = 1e6, w = {
|
|
|
82
82
|
);
|
|
83
83
|
},
|
|
84
84
|
async getSettings(e) {
|
|
85
|
-
return
|
|
85
|
+
return g(
|
|
86
86
|
await f(`restaurants/${e}/schedules`).get("settings")
|
|
87
87
|
);
|
|
88
88
|
},
|
|
89
89
|
async saveSettings(e, a) {
|
|
90
|
-
return
|
|
90
|
+
return g(
|
|
91
91
|
await f(`restaurants/${e}/schedules`).post("settings", a)
|
|
92
92
|
);
|
|
93
93
|
},
|
|
94
94
|
async generateAutoSchedule(e, a) {
|
|
95
|
-
return
|
|
95
|
+
return g(
|
|
96
96
|
await f(`restaurants/${e}/schedules`).post(
|
|
97
97
|
"auto-schedule/generate",
|
|
98
98
|
a
|
|
@@ -100,14 +100,14 @@ const ae = 500, ba = 10, Te = 6, jn = 1500, Qe = 1e6, w = {
|
|
|
100
100
|
);
|
|
101
101
|
},
|
|
102
102
|
async getAutoScheduleCapabilities(e) {
|
|
103
|
-
return
|
|
103
|
+
return g(
|
|
104
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
|
|
110
|
+
return g(
|
|
111
111
|
await f(`restaurants/${e}/schedules`).post(
|
|
112
112
|
"auto-schedule/apply",
|
|
113
113
|
a
|
|
@@ -116,19 +116,19 @@ const ae = 500, ba = 10, Te = 6, jn = 1500, Qe = 1e6, w = {
|
|
|
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
|
|
119
|
+
return g(
|
|
120
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
|
|
126
|
+
return g(
|
|
127
127
|
await f(`restaurants/${e}/schedules`).post("time-off", a)
|
|
128
128
|
);
|
|
129
129
|
},
|
|
130
130
|
async updateTimeOffStatus(e, a, t) {
|
|
131
|
-
return
|
|
131
|
+
return g(
|
|
132
132
|
await f(`restaurants/${e}/schedules`).post(
|
|
133
133
|
`time-off/${a}/status`,
|
|
134
134
|
t
|
|
@@ -140,11 +140,11 @@ const ae = 500, ba = 10, Te = 6, jn = 1500, Qe = 1e6, w = {
|
|
|
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 g(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
|
|
147
|
+
return g(
|
|
148
148
|
await f("schedules").post("employees", { employeeId: a, ...t })
|
|
149
149
|
);
|
|
150
150
|
},
|
|
@@ -153,10 +153,10 @@ const ae = 500, ba = 10, Te = 6, jn = 1500, Qe = 1e6, w = {
|
|
|
153
153
|
},
|
|
154
154
|
/** Positions are shared across the business. */
|
|
155
155
|
async createPosition(e) {
|
|
156
|
-
return
|
|
156
|
+
return g(await f("schedules").post("positions", e));
|
|
157
157
|
},
|
|
158
158
|
async updatePosition(e, a) {
|
|
159
|
-
return
|
|
159
|
+
return g(await f("schedules").post(`positions/${e}`, a));
|
|
160
160
|
},
|
|
161
161
|
/** Deleting one position is `deletePositions` with a single-id array — the backend's
|
|
162
162
|
* `DELETE positions/:id` route is gone; this is now `DELETE positions?ids=`. */
|
|
@@ -167,7 +167,7 @@ const ae = 500, ba = 10, Te = 6, jn = 1500, Qe = 1e6, w = {
|
|
|
167
167
|
},
|
|
168
168
|
/** Creates one flat demand interval. */
|
|
169
169
|
async createDemand(e, a) {
|
|
170
|
-
return
|
|
170
|
+
return g(
|
|
171
171
|
await f(`restaurants/${e}/schedules`).post("demands", a)
|
|
172
172
|
);
|
|
173
173
|
},
|
|
@@ -175,7 +175,7 @@ const ae = 500, ba = 10, Te = 6, jn = 1500, Qe = 1e6, w = {
|
|
|
175
175
|
* day/weekday's demand rows wholesale. Deleting one demand is just this with a single-id
|
|
176
176
|
* array. */
|
|
177
177
|
async deleteDemands(e, a) {
|
|
178
|
-
return
|
|
178
|
+
return g(
|
|
179
179
|
await f(`restaurants/${e}/schedules`).delete("demands", {
|
|
180
180
|
params: { ids: a.join(",") }
|
|
181
181
|
})
|
|
@@ -183,7 +183,7 @@ const ae = 500, ba = 10, Te = 6, jn = 1500, Qe = 1e6, w = {
|
|
|
183
183
|
},
|
|
184
184
|
/** Atomically replaces one date/weekday's flattened demand rows. */
|
|
185
185
|
async replaceDemands(e, a) {
|
|
186
|
-
return
|
|
186
|
+
return g(
|
|
187
187
|
await f(`restaurants/${e}/schedules`).post(
|
|
188
188
|
"demands/replace",
|
|
189
189
|
a
|
|
@@ -192,7 +192,7 @@ const ae = 500, ba = 10, Te = 6, jn = 1500, Qe = 1e6, w = {
|
|
|
192
192
|
},
|
|
193
193
|
/** Atomically replaces several date/weekday demand generations. */
|
|
194
194
|
async bulkReplaceDemands(e, a) {
|
|
195
|
-
return
|
|
195
|
+
return g(
|
|
196
196
|
await f(`restaurants/${e}/schedules`).post(
|
|
197
197
|
"demands/bulk-replace",
|
|
198
198
|
a
|
|
@@ -201,7 +201,7 @@ const ae = 500, ba = 10, Te = 6, jn = 1500, Qe = 1e6, w = {
|
|
|
201
201
|
},
|
|
202
202
|
/** Replaces one date's note/holiday-mark. All three fields back to empty/false clears it. */
|
|
203
203
|
async saveScheduleDay(e, a, t) {
|
|
204
|
-
return
|
|
204
|
+
return g(
|
|
205
205
|
await f(`restaurants/${e}/schedules`).post(
|
|
206
206
|
`days/${a}`,
|
|
207
207
|
t
|
|
@@ -210,12 +210,12 @@ const ae = 500, ba = 10, Te = 6, jn = 1500, Qe = 1e6, w = {
|
|
|
210
210
|
},
|
|
211
211
|
/** A one-off shift assignment. */
|
|
212
212
|
async createAssignment(e, a) {
|
|
213
|
-
return
|
|
213
|
+
return g(
|
|
214
214
|
await f(`restaurants/${e}/schedules`).post("assignments", a)
|
|
215
215
|
);
|
|
216
216
|
},
|
|
217
217
|
async updateAssignment(e, a, t) {
|
|
218
|
-
return
|
|
218
|
+
return g(
|
|
219
219
|
await f(`restaurants/${e}/schedules`).patch(
|
|
220
220
|
`assignments/${a}`,
|
|
221
221
|
t
|
|
@@ -224,7 +224,7 @@ const ae = 500, ba = 10, Te = 6, jn = 1500, Qe = 1e6, w = {
|
|
|
224
224
|
},
|
|
225
225
|
/** Atomically applies assignment updates, creates, and deletes used by moves and swaps. */
|
|
226
226
|
async bulkSaveAssignments(e, a) {
|
|
227
|
-
return
|
|
227
|
+
return g(
|
|
228
228
|
await f(`restaurants/${e}/schedules`).post(
|
|
229
229
|
"assignments/bulk",
|
|
230
230
|
a
|
|
@@ -235,7 +235,7 @@ const ae = 500, ba = 10, Te = 6, jn = 1500, Qe = 1e6, w = {
|
|
|
235
235
|
* getting replaced wholesale. Deleting one assignment is just this with a single-id
|
|
236
236
|
* array. */
|
|
237
237
|
async deleteAssignments(e, a) {
|
|
238
|
-
return
|
|
238
|
+
return g(
|
|
239
239
|
await f(`restaurants/${e}/schedules`).delete("assignments", {
|
|
240
240
|
params: { ids: a.join(",") }
|
|
241
241
|
})
|
|
@@ -244,7 +244,7 @@ const ae = 500, ba = 10, Te = 6, jn = 1500, Qe = 1e6, w = {
|
|
|
244
244
|
/** Flips a batch of assignments to one status in a single request — e.g. Publish sending
|
|
245
245
|
* every DRAFT shift on the board to PUBLISHED at once. */
|
|
246
246
|
async bulkUpdateAssignmentStatus(e, a) {
|
|
247
|
-
return
|
|
247
|
+
return g(
|
|
248
248
|
await f(`restaurants/${e}/schedules`).patch(
|
|
249
249
|
"assignments/bulk-status",
|
|
250
250
|
a
|
|
@@ -263,18 +263,18 @@ const ae = 500, ba = 10, Te = 6, jn = 1500, Qe = 1e6, w = {
|
|
|
263
263
|
employeeConfigs: A([]),
|
|
264
264
|
employeeOutletIds: we({}),
|
|
265
265
|
businessEmployees: we([]),
|
|
266
|
-
positions:
|
|
267
|
-
positionRecords:
|
|
268
|
-
rolePositions:
|
|
269
|
-
outlet:
|
|
270
|
-
locationOptions:
|
|
271
|
-
locationLabelById:
|
|
272
|
-
departmentOptions:
|
|
273
|
-
compensationGroupOptions:
|
|
274
|
-
compensationGroupMeta:
|
|
275
|
-
existingStaff:
|
|
276
|
-
shiftTemplates:
|
|
277
|
-
rules:
|
|
266
|
+
positions: O([]),
|
|
267
|
+
positionRecords: O([]),
|
|
268
|
+
rolePositions: O({}),
|
|
269
|
+
outlet: O({ name: "" }),
|
|
270
|
+
locationOptions: O([]),
|
|
271
|
+
locationLabelById: O({}),
|
|
272
|
+
departmentOptions: O([]),
|
|
273
|
+
compensationGroupOptions: O([]),
|
|
274
|
+
compensationGroupMeta: O({}),
|
|
275
|
+
existingStaff: O([]),
|
|
276
|
+
shiftTemplates: O([]),
|
|
277
|
+
rules: O({
|
|
278
278
|
coverage: {},
|
|
279
279
|
openFrom: "00:00",
|
|
280
280
|
openTo: "24:00",
|
|
@@ -302,27 +302,27 @@ const ae = 500, ba = 10, Te = 6, jn = 1500, Qe = 1e6, w = {
|
|
|
302
302
|
}, {
|
|
303
303
|
payload: c,
|
|
304
304
|
loading: $e,
|
|
305
|
-
rosterLoading:
|
|
306
|
-
loadError:
|
|
305
|
+
rosterLoading: xe,
|
|
306
|
+
loadError: he,
|
|
307
307
|
scheduleSetupCompleted: Je,
|
|
308
|
-
dataVersion:
|
|
308
|
+
dataVersion: K,
|
|
309
309
|
outletId: m,
|
|
310
|
-
restaurantEmployees:
|
|
310
|
+
restaurantEmployees: ie,
|
|
311
311
|
employeeConfigs: F,
|
|
312
312
|
employeeOutletIds: Ze,
|
|
313
313
|
businessEmployees: Ae,
|
|
314
|
-
positions:
|
|
315
|
-
positionRecords:
|
|
316
|
-
rolePositions:
|
|
317
|
-
outlet:
|
|
318
|
-
locationOptions:
|
|
314
|
+
positions: Na,
|
|
315
|
+
positionRecords: B,
|
|
316
|
+
rolePositions: Jn,
|
|
317
|
+
outlet: ka,
|
|
318
|
+
locationOptions: Ye,
|
|
319
319
|
locationLabelById: ne,
|
|
320
|
-
compensationGroupMeta:
|
|
321
|
-
existingStaff:
|
|
322
|
-
shiftTemplates:
|
|
323
|
-
rules:
|
|
320
|
+
compensationGroupMeta: Zn,
|
|
321
|
+
existingStaff: qn,
|
|
322
|
+
shiftTemplates: eo,
|
|
323
|
+
rules: M
|
|
324
324
|
} = Xe;
|
|
325
|
-
function
|
|
325
|
+
function Ca() {
|
|
326
326
|
const e = Xe.rules;
|
|
327
327
|
Object.keys(e.coverage).forEach((a) => delete e.coverage[a]), e.openFrom = "00:00", e.openTo = "24:00", e.dayHours.splice(0, e.dayHours.length, ...Array.from({ length: 7 }, () => [])), Object.assign(e.payRate.NORMAL, { overtime: 1.5 }), Object.assign(e.payRate.REST_DAY, { regular: 1, overtime: 2 }), Object.assign(e.payRate.PUBLIC_HOLIDAY, { regular: 2, overtime: 3 }), e.salesForecast = 0, e.closedWeekdays.splice(0, e.closedWeekdays.length), e.labourTarget = 0, e.budgetFromSales = !1, e.budget = 0, e.otCapHours = null, e.workingHours = { minHoursPerDay: null, maxHoursPerDay: 8, maxHoursPerWeek: 45 }, e.otBudget = 0, Object.assign(e.notify, {
|
|
328
328
|
waConnected: !1,
|
|
@@ -332,7 +332,7 @@ function ka() {
|
|
|
332
332
|
});
|
|
333
333
|
}
|
|
334
334
|
const ke = 7;
|
|
335
|
-
function
|
|
335
|
+
function Ma(e) {
|
|
336
336
|
const a = e.getFullYear(), t = String(e.getMonth() + 1).padStart(2, "0"), n = String(e.getDate()).padStart(2, "0");
|
|
337
337
|
return `${a}-${t}-${n}`;
|
|
338
338
|
}
|
|
@@ -344,98 +344,98 @@ function Ce(e) {
|
|
|
344
344
|
const a = new Date(e);
|
|
345
345
|
return a.setHours(0, 0, 0, 0), a.setDate(a.getDate() - (a.getDay() + 6) % 7), a;
|
|
346
346
|
}
|
|
347
|
-
function
|
|
347
|
+
function ao(e, a = /* @__PURE__ */ new Date()) {
|
|
348
348
|
const t = oe(Ce(a), e * ke);
|
|
349
349
|
return Array.from({ length: ke }, (n, i) => oe(t, i));
|
|
350
350
|
}
|
|
351
|
-
function
|
|
352
|
-
const t = (
|
|
351
|
+
function to(e, a) {
|
|
352
|
+
const t = (o) => Date.UTC(o.getFullYear(), o.getMonth(), o.getDate()), n = t(Ce(e)), i = t(Ce(a));
|
|
353
353
|
return Math.trunc((i - n) / (ke * 24 * 60 * 60 * 1e3));
|
|
354
354
|
}
|
|
355
|
-
const
|
|
356
|
-
let G = null, j = null,
|
|
355
|
+
const re = Ma;
|
|
356
|
+
let G = null, j = null, V = null, te = 0, ve = null;
|
|
357
357
|
function Be(e) {
|
|
358
|
-
return e === m.value ? !1 : (
|
|
358
|
+
return e === m.value ? !1 : (Ca(), m.value = e, c.value = null, G = null, j = null, he.value = null, ve = null, Je.value = !1, ie.value = [], F.value = [], V = null, te += 1, K.value += 1, !0);
|
|
359
359
|
}
|
|
360
360
|
async function Me(e) {
|
|
361
|
-
if (!(!e ||
|
|
362
|
-
|
|
361
|
+
if (!(!e || ve === e)) {
|
|
362
|
+
xe.value = !0;
|
|
363
363
|
try {
|
|
364
|
-
await
|
|
364
|
+
await Sa(e);
|
|
365
365
|
} finally {
|
|
366
|
-
|
|
366
|
+
xe.value = !1;
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
369
|
}
|
|
370
|
-
async function
|
|
370
|
+
async function Sa(e) {
|
|
371
371
|
const a = await Pe.readEmployeesPage({
|
|
372
372
|
limit: ae,
|
|
373
373
|
offset: 0,
|
|
374
374
|
restaurantIds: [e]
|
|
375
375
|
});
|
|
376
|
-
e === m.value && (
|
|
377
|
-
e === m.value && (Ze.value = t,
|
|
376
|
+
e === m.value && (ie.value = a.items, F.value = await D.listEmployeeConfigs(e), ve = e, K.value += 1, Oa().then((t) => {
|
|
377
|
+
e === m.value && (Ze.value = t, K.value += 1);
|
|
378
378
|
}));
|
|
379
379
|
}
|
|
380
|
-
async function
|
|
380
|
+
async function La(e) {
|
|
381
381
|
const a = m.value;
|
|
382
382
|
if (!a || !e.length) return;
|
|
383
|
-
const t = await
|
|
384
|
-
F.value = t,
|
|
383
|
+
const t = await D.saveEmployeeConfigs(a, { configs: e });
|
|
384
|
+
F.value = t, K.value += 1;
|
|
385
385
|
}
|
|
386
|
-
async function
|
|
386
|
+
async function Ia(e, a) {
|
|
387
387
|
const t = F.value.find((i) => i.employeeId === e), n = (t == null ? void 0 : t.displayOrder) ?? (a && F.value.some((i) => i.displayOrder !== null) ? Math.max(
|
|
388
388
|
0,
|
|
389
389
|
...F.value.filter((i) => i.displayOrder !== null).map((i) => i.displayOrder)
|
|
390
390
|
) + 100 : null);
|
|
391
|
-
await
|
|
391
|
+
await La([{ employeeId: e, enabled: a, displayOrder: n }]);
|
|
392
392
|
}
|
|
393
393
|
async function Oe() {
|
|
394
394
|
const e = m.value;
|
|
395
|
-
e && (
|
|
395
|
+
e && (ve = null, await Me(e));
|
|
396
396
|
}
|
|
397
397
|
async function qe(e, a) {
|
|
398
|
-
const t = Ke(), n = (await
|
|
398
|
+
const t = Ke(), n = (await le(!0)).find((s) => s._id === e);
|
|
399
399
|
if (!n) throw new Error("Could not find this employee");
|
|
400
|
-
const i = n.restaurantRole.map((
|
|
401
|
-
restaurantId:
|
|
402
|
-
roleId:
|
|
403
|
-
})),
|
|
404
|
-
if (!
|
|
400
|
+
const i = n.restaurantRole.map((s) => ({
|
|
401
|
+
restaurantId: s.restaurantId,
|
|
402
|
+
roleId: s.roleId
|
|
403
|
+
})), o = a(i);
|
|
404
|
+
if (!o.length)
|
|
405
405
|
throw new Error(
|
|
406
406
|
"An employee must keep at least 1 location, otherwise they are deleted. To delete them, use the Employee page."
|
|
407
407
|
);
|
|
408
408
|
(n.isMasterUser ? "master" : "user") === "master" ? await t.updateMasterEmployee(e, {
|
|
409
409
|
user: { name: n.name, passcode: n.passcode, code: n.code ?? "" },
|
|
410
|
-
roles:
|
|
410
|
+
roles: o,
|
|
411
411
|
previousRoles: i
|
|
412
412
|
}) : await t.updateEmployee(e, {
|
|
413
413
|
user: { name: n.name, passcode: n.passcode },
|
|
414
|
-
roles:
|
|
414
|
+
roles: o,
|
|
415
415
|
previousRoles: i
|
|
416
|
-
}), await
|
|
416
|
+
}), await le(!0);
|
|
417
417
|
}
|
|
418
|
-
async function
|
|
418
|
+
async function no(e, a, t = "") {
|
|
419
419
|
const n = [...new Set(a.filter(Boolean))];
|
|
420
420
|
n.length && (await qe(e, (i) => [
|
|
421
|
-
...i.filter((
|
|
422
|
-
...n.map((
|
|
423
|
-
]), m.value && n.includes(m.value) && await
|
|
421
|
+
...i.filter((o) => !n.includes(o.restaurantId)),
|
|
422
|
+
...n.map((o) => ({ restaurantId: o, roleId: t }))
|
|
423
|
+
]), m.value && n.includes(m.value) && await Ia(e, !0), await Oe());
|
|
424
424
|
}
|
|
425
|
-
async function
|
|
425
|
+
async function oo(e, a) {
|
|
426
426
|
if (!a.length) return;
|
|
427
427
|
const t = new Map(a.map((n) => [n.restaurantId, n.roleId]));
|
|
428
428
|
await qe(e, (n) => [
|
|
429
429
|
...n.filter((i) => !t.has(i.restaurantId)),
|
|
430
|
-
...[...t.entries()].map(([i,
|
|
430
|
+
...[...t.entries()].map(([i, o]) => ({ restaurantId: i, roleId: o }))
|
|
431
431
|
]), await Oe();
|
|
432
432
|
}
|
|
433
|
-
async function
|
|
434
|
-
const t = Ke(), n = (await
|
|
433
|
+
async function so(e, a) {
|
|
434
|
+
const t = Ke(), n = (await le(!0)).find((u) => u._id === e);
|
|
435
435
|
if (!n) throw new Error("Could not find this employee");
|
|
436
|
-
const i = (u) => u.slice().sort((
|
|
437
|
-
if (!
|
|
438
|
-
const
|
|
436
|
+
const i = (u) => u.slice().sort((v, E) => v.restaurantId.localeCompare(E.restaurantId)).map((v) => `${v.restaurantId}:${v.roleId}`).join("|"), o = i(n.restaurantRole) !== i(a.roles), l = n.passcode !== a.passcode || n.isMasterUser !== a.masterUser || a.masterUser && (n.code ?? "") !== a.masterCode;
|
|
437
|
+
if (!o && !l) return;
|
|
438
|
+
const s = n.restaurantRole.map((u) => ({
|
|
439
439
|
restaurantId: u.restaurantId,
|
|
440
440
|
roleId: u.roleId
|
|
441
441
|
}));
|
|
@@ -443,7 +443,7 @@ async function no(e, a) {
|
|
|
443
443
|
const u = {
|
|
444
444
|
user: { name: a.name, passcode: a.passcode, code: a.masterCode },
|
|
445
445
|
roles: a.roles,
|
|
446
|
-
previousRoles:
|
|
446
|
+
previousRoles: s
|
|
447
447
|
};
|
|
448
448
|
n.isMasterUser ? await t.updateMasterEmployee(e, u) : await t.migrateToMasterUser(e, u);
|
|
449
449
|
} else {
|
|
@@ -452,18 +452,18 @@ async function no(e, a) {
|
|
|
452
452
|
await t.updateEmployee(e, {
|
|
453
453
|
user: { name: a.name, passcode: a.passcode },
|
|
454
454
|
roles: a.roles,
|
|
455
|
-
previousRoles:
|
|
455
|
+
previousRoles: s
|
|
456
456
|
});
|
|
457
457
|
}
|
|
458
|
-
await
|
|
458
|
+
await le(!0), await Oe();
|
|
459
459
|
}
|
|
460
460
|
let ee = null;
|
|
461
|
-
async function
|
|
461
|
+
async function Ra() {
|
|
462
462
|
const e = await Pe.readEmployeesPage({
|
|
463
463
|
limit: ae,
|
|
464
464
|
offset: 0,
|
|
465
465
|
includeEmptyPasscode: !0
|
|
466
|
-
}), a = Math.min(
|
|
466
|
+
}), a = Math.min(Pa, Math.ceil(e.total / ae)), t = await Promise.all(
|
|
467
467
|
Array.from(
|
|
468
468
|
{ length: Math.max(0, a - 1) },
|
|
469
469
|
(n, i) => Pe.readEmployeesPage({
|
|
@@ -475,20 +475,20 @@ async function Ia() {
|
|
|
475
475
|
);
|
|
476
476
|
return [...e.items, ...t.flatMap((n) => n.items)];
|
|
477
477
|
}
|
|
478
|
-
function
|
|
478
|
+
function le(e = !1) {
|
|
479
479
|
if (!e) {
|
|
480
480
|
if (ee) return ee;
|
|
481
481
|
if (Ae.value.length) return Promise.resolve(Ae.value);
|
|
482
482
|
}
|
|
483
|
-
const a =
|
|
483
|
+
const a = Ra().then((t) => (Ae.value = t, t)).finally(() => {
|
|
484
484
|
ee === a && (ee = null);
|
|
485
485
|
});
|
|
486
486
|
return ee = a, a;
|
|
487
487
|
}
|
|
488
|
-
async function
|
|
488
|
+
async function Oa() {
|
|
489
489
|
const e = {};
|
|
490
490
|
try {
|
|
491
|
-
(await
|
|
491
|
+
(await le()).forEach((a) => {
|
|
492
492
|
e[a._id] = [...new Set(a.restaurantRole.map((t) => t.restaurantId))];
|
|
493
493
|
});
|
|
494
494
|
} catch {
|
|
@@ -499,80 +499,90 @@ async function Ra() {
|
|
|
499
499
|
function _e(e, a) {
|
|
500
500
|
return G !== null && j !== null && G <= e && j >= a;
|
|
501
501
|
}
|
|
502
|
-
async function
|
|
503
|
-
const a =
|
|
504
|
-
_e(a, t) ||
|
|
502
|
+
async function Ta(e) {
|
|
503
|
+
const a = re(e), t = re(oe(e, 6));
|
|
504
|
+
_e(a, t) || V && (await V, _e(a, t)) || await ea(
|
|
505
505
|
oe(e, -7 * Te),
|
|
506
506
|
oe(e, 7 * Te)
|
|
507
507
|
);
|
|
508
508
|
}
|
|
509
|
-
async function
|
|
509
|
+
async function io() {
|
|
510
510
|
!G || !j || await ea(/* @__PURE__ */ new Date(`${G}T00:00:00`), /* @__PURE__ */ new Date(`${j}T00:00:00`));
|
|
511
511
|
}
|
|
512
|
-
async function
|
|
512
|
+
async function ro(e) {
|
|
513
513
|
if (!m.value) throw new Error("No outlet selected");
|
|
514
|
-
const a = await
|
|
515
|
-
c.value && (c.value.employees.push(a),
|
|
514
|
+
const a = await D.createEmployeeProfile(m.value, e);
|
|
515
|
+
c.value && (c.value.employees.push(a), K.value += 1);
|
|
516
516
|
}
|
|
517
|
-
async function
|
|
518
|
-
await
|
|
517
|
+
async function lo(e) {
|
|
518
|
+
await D.validatePosAccess(e);
|
|
519
519
|
}
|
|
520
|
-
async function
|
|
520
|
+
async function uo(e, a) {
|
|
521
521
|
if (!m.value) throw new Error("No outlet selected");
|
|
522
|
-
const t = await
|
|
522
|
+
const t = await D.updateEmployeeProfile(m.value, e, a);
|
|
523
523
|
if (c.value) {
|
|
524
524
|
const n = c.value.employees.findIndex((i) => i.employeeId === e);
|
|
525
525
|
n > -1 && (c.value = {
|
|
526
526
|
...c.value,
|
|
527
|
-
employees: c.value.employees.map((i,
|
|
527
|
+
employees: c.value.employees.map((i, o) => o === n ? t : i)
|
|
528
528
|
});
|
|
529
529
|
}
|
|
530
530
|
}
|
|
531
|
-
async function
|
|
532
|
-
const a = await
|
|
531
|
+
async function co(e) {
|
|
532
|
+
const a = await D.createPosition(e);
|
|
533
533
|
c.value && (c.value = { ...c.value, positions: [...c.value.positions, a] });
|
|
534
534
|
}
|
|
535
|
-
async function
|
|
536
|
-
const t = await
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
535
|
+
async function yo(e, a) {
|
|
536
|
+
const t = await D.updatePosition(e, a);
|
|
537
|
+
if (c.value) {
|
|
538
|
+
const n = c.value.positions.find((o) => o.id === e), i = (o) => o.positionId === e || !o.positionId && o.positionName === (n == null ? void 0 : n.name);
|
|
539
|
+
c.value = {
|
|
540
|
+
...c.value,
|
|
541
|
+
positions: c.value.positions.map((o) => o.id === e ? t : o),
|
|
542
|
+
employees: c.value.employees.map((o) => ({
|
|
543
|
+
...o,
|
|
544
|
+
primaryPosition: o.primaryPosition && i(o.primaryPosition) ? { ...o.primaryPosition, positionName: t.name } : o.primaryPosition,
|
|
545
|
+
secondaryPositions: o.secondaryPositions.map(
|
|
546
|
+
(l) => i(l) ? { ...l, positionName: t.name } : l
|
|
547
|
+
)
|
|
548
|
+
}))
|
|
549
|
+
};
|
|
550
|
+
}
|
|
541
551
|
}
|
|
542
|
-
async function
|
|
543
|
-
await
|
|
552
|
+
async function mo(e) {
|
|
553
|
+
await D.deletePosition(e), c.value && (c.value = {
|
|
544
554
|
...c.value,
|
|
545
555
|
positions: c.value.positions.filter((a) => a.id !== e)
|
|
546
556
|
});
|
|
547
557
|
}
|
|
548
|
-
async function
|
|
558
|
+
async function po(e, a) {
|
|
549
559
|
var i;
|
|
550
560
|
if (!m.value) throw new Error("No outlet selected");
|
|
551
|
-
const t = (i = c.value) == null ? void 0 : i.days.find((
|
|
561
|
+
const t = (i = c.value) == null ? void 0 : i.days.find((o) => o.date === e), n = await D.saveScheduleDay(m.value, e, {
|
|
552
562
|
...a,
|
|
553
563
|
expectedUpdatedAt: a.expectedUpdatedAt ?? (t == null ? void 0 : t.updatedAt)
|
|
554
564
|
});
|
|
555
565
|
if (c.value) {
|
|
556
|
-
const
|
|
557
|
-
n &&
|
|
566
|
+
const o = c.value.days.filter((l) => l.date !== e);
|
|
567
|
+
n && o.push(n), c.value = { ...c.value, days: o };
|
|
558
568
|
}
|
|
559
569
|
}
|
|
560
|
-
async function
|
|
561
|
-
await
|
|
570
|
+
async function fo(e) {
|
|
571
|
+
await xa([e]);
|
|
562
572
|
}
|
|
563
|
-
function
|
|
573
|
+
function $a(e) {
|
|
564
574
|
const a = e.periods.flatMap((t) => {
|
|
565
|
-
const n = (t.roles ?? []).filter((l) => l.positionName && l.headcount > 0), i = n.reduce((l,
|
|
575
|
+
const n = (t.roles ?? []).filter((l) => l.positionName && l.headcount > 0), i = n.reduce((l, s) => l + s.headcount, 0), o = {
|
|
566
576
|
startTime: t.startTime,
|
|
567
577
|
endTime: t.endTime
|
|
568
578
|
};
|
|
569
579
|
return [
|
|
570
580
|
...n.map((l) => ({
|
|
571
|
-
...
|
|
581
|
+
...o,
|
|
572
582
|
headcount: l.headcount,
|
|
573
583
|
position: { positionId: l.positionId, positionName: l.positionName }
|
|
574
584
|
})),
|
|
575
|
-
...t.headcount > i ? [{ ...
|
|
585
|
+
...t.headcount > i ? [{ ...o, headcount: t.headcount - i }] : []
|
|
576
586
|
];
|
|
577
587
|
});
|
|
578
588
|
return {
|
|
@@ -580,32 +590,32 @@ function Ta(e) {
|
|
|
580
590
|
demands: a
|
|
581
591
|
};
|
|
582
592
|
}
|
|
583
|
-
async function
|
|
593
|
+
async function xa(e) {
|
|
584
594
|
if (!m.value) throw new Error("No outlet selected");
|
|
585
595
|
if (!e.length) return;
|
|
586
|
-
const a = e.map(
|
|
596
|
+
const a = e.map($a), t = e.length === 1 ? await D.replaceDemands(m.value, a[0]) : await D.bulkReplaceDemands(m.value, { replacements: a });
|
|
587
597
|
if (c.value) {
|
|
588
|
-
const n = new Set(e.map((
|
|
598
|
+
const n = new Set(e.map((o) => o.date)), i = c.value.demands.filter((o) => o.date === null || !n.has(o.date));
|
|
589
599
|
c.value = { ...c.value, demands: [...i, ...t] };
|
|
590
600
|
}
|
|
591
601
|
}
|
|
592
|
-
async function
|
|
602
|
+
async function ho(e, a) {
|
|
593
603
|
if (!m.value) throw new Error("No outlet selected");
|
|
594
604
|
const t = c.value;
|
|
595
|
-
if (!t || t.demands.some((
|
|
596
|
-
const n = t.demands.filter((
|
|
605
|
+
if (!t || t.demands.some((o) => o.date === a)) return 0;
|
|
606
|
+
const n = t.demands.filter((o) => o.date === e);
|
|
597
607
|
if (!n.length) return 0;
|
|
598
608
|
const i = await Promise.all(
|
|
599
609
|
n.map(
|
|
600
|
-
(
|
|
610
|
+
(o) => D.createDemand(m.value, {
|
|
601
611
|
date: a,
|
|
602
|
-
startTime:
|
|
603
|
-
endTime:
|
|
604
|
-
headcount:
|
|
605
|
-
...
|
|
612
|
+
startTime: o.startTime,
|
|
613
|
+
endTime: o.endTime,
|
|
614
|
+
headcount: o.headcount,
|
|
615
|
+
...o.position ? {
|
|
606
616
|
position: {
|
|
607
|
-
positionId:
|
|
608
|
-
positionName:
|
|
617
|
+
positionId: o.position.positionId,
|
|
618
|
+
positionName: o.position.positionName
|
|
609
619
|
}
|
|
610
620
|
} : {}
|
|
611
621
|
})
|
|
@@ -613,78 +623,78 @@ async function po(e, a) {
|
|
|
613
623
|
);
|
|
614
624
|
return c.value && (c.value = { ...c.value, demands: [...c.value.demands, ...i] }), i.length;
|
|
615
625
|
}
|
|
616
|
-
async function
|
|
626
|
+
async function vo(e) {
|
|
617
627
|
if (!m.value) throw new Error("No outlet selected");
|
|
618
|
-
return
|
|
628
|
+
return D.generateAutoSchedule(m.value, e);
|
|
619
629
|
}
|
|
620
|
-
async function
|
|
630
|
+
async function go() {
|
|
621
631
|
if (!m.value) throw new Error("No outlet selected");
|
|
622
|
-
return
|
|
632
|
+
return D.getAutoScheduleCapabilities(m.value);
|
|
623
633
|
}
|
|
624
|
-
async function
|
|
634
|
+
async function Do(e) {
|
|
625
635
|
if (!m.value) throw new Error("No outlet selected");
|
|
626
|
-
return
|
|
636
|
+
return D.applyAutoSchedule(m.value, e);
|
|
627
637
|
}
|
|
628
|
-
async function
|
|
638
|
+
async function wo(e) {
|
|
629
639
|
if (!m.value) throw new Error("No outlet selected");
|
|
630
|
-
return
|
|
640
|
+
return D.bulkSaveAssignments(m.value, e);
|
|
631
641
|
}
|
|
632
|
-
async function
|
|
642
|
+
async function Ho(e) {
|
|
633
643
|
if (!m.value) throw new Error("No outlet selected");
|
|
634
|
-
e.length && await
|
|
644
|
+
e.length && await D.deleteAssignments(m.value, e);
|
|
635
645
|
}
|
|
636
|
-
async function
|
|
646
|
+
async function Ao(e) {
|
|
637
647
|
if (!m.value) throw new Error("No outlet selected");
|
|
638
|
-
const a = await
|
|
648
|
+
const a = await D.createTimeOff(m.value, e);
|
|
639
649
|
return c.value && (c.value = { ...c.value, timeOff: [...c.value.timeOff, a] }), a;
|
|
640
650
|
}
|
|
641
|
-
async function
|
|
651
|
+
async function Eo(e, a) {
|
|
642
652
|
if (!m.value) throw new Error("No outlet selected");
|
|
643
|
-
const t = await
|
|
653
|
+
const t = await D.updateTimeOffStatus(m.value, e, a);
|
|
644
654
|
return t && c.value && (c.value = {
|
|
645
655
|
...c.value,
|
|
646
656
|
timeOff: c.value.timeOff.map((n) => n.id === e ? t : n)
|
|
647
657
|
}), t;
|
|
648
658
|
}
|
|
649
|
-
async function
|
|
659
|
+
async function bo(e) {
|
|
650
660
|
if (!m.value) throw new Error("No outlet selected");
|
|
651
|
-
await
|
|
661
|
+
await D.deleteTimeOff(m.value, e), c.value && (c.value = {
|
|
652
662
|
...c.value,
|
|
653
663
|
timeOff: c.value.timeOff.filter((a) => a.id !== e)
|
|
654
664
|
});
|
|
655
665
|
}
|
|
656
|
-
async function
|
|
666
|
+
async function Po(e) {
|
|
657
667
|
if (!m.value) throw new Error("No outlet selected");
|
|
658
|
-
return
|
|
668
|
+
return D.bulkUpdateAssignmentStatus(m.value, e);
|
|
659
669
|
}
|
|
660
670
|
async function ea(e, a) {
|
|
661
671
|
const t = m.value;
|
|
662
672
|
if (!t) {
|
|
663
|
-
|
|
673
|
+
he.value = "No outlet selected";
|
|
664
674
|
return;
|
|
665
675
|
}
|
|
666
|
-
const n =
|
|
667
|
-
$e.value = !0,
|
|
676
|
+
const n = re(e), i = re(a), o = ++te;
|
|
677
|
+
$e.value = !0, he.value = null;
|
|
668
678
|
const l = (async () => {
|
|
669
679
|
try {
|
|
670
|
-
const
|
|
671
|
-
if (m.value !== t ||
|
|
672
|
-
c.value =
|
|
673
|
-
} catch (
|
|
674
|
-
if (m.value !== t ||
|
|
675
|
-
|
|
680
|
+
const s = await D.readBoard(t, n, i);
|
|
681
|
+
if (m.value !== t || o !== te) return;
|
|
682
|
+
c.value = s, Je.value = s.settings.setupCompleted, G = n, j = i, K.value += 1;
|
|
683
|
+
} catch (s) {
|
|
684
|
+
if (m.value !== t || o !== te) return;
|
|
685
|
+
he.value = s instanceof Error ? s.message : "Could not load the schedule";
|
|
676
686
|
} finally {
|
|
677
|
-
m.value === t &&
|
|
687
|
+
m.value === t && o === te && ($e.value = !1);
|
|
678
688
|
}
|
|
679
689
|
})();
|
|
680
|
-
|
|
690
|
+
V = l;
|
|
681
691
|
try {
|
|
682
692
|
await l;
|
|
683
693
|
} finally {
|
|
684
|
-
|
|
694
|
+
V === l && (V = null);
|
|
685
695
|
}
|
|
686
696
|
}
|
|
687
|
-
const Ya = "AE",
|
|
697
|
+
const Ya = "AE", Ba = "Asia/Dubai", _a = {
|
|
688
698
|
NORMAL: {
|
|
689
699
|
overtime: 1.25
|
|
690
700
|
},
|
|
@@ -696,13 +706,13 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
696
706
|
regular: 2.5,
|
|
697
707
|
overtime: 1.5
|
|
698
708
|
}
|
|
699
|
-
}, _a = {
|
|
700
|
-
maxHoursPerMonth: null
|
|
701
709
|
}, Fa = {
|
|
710
|
+
maxHoursPerMonth: null
|
|
711
|
+
}, Ua = {
|
|
702
712
|
minHoursPerDay: null,
|
|
703
713
|
maxHoursPerDay: 8,
|
|
704
714
|
maxHoursPerWeek: 48
|
|
705
|
-
},
|
|
715
|
+
}, Wa = [
|
|
706
716
|
{
|
|
707
717
|
month: 1,
|
|
708
718
|
day: 1,
|
|
@@ -718,7 +728,7 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
718
728
|
day: 3,
|
|
719
729
|
name: "UAE National Day Holiday"
|
|
720
730
|
}
|
|
721
|
-
],
|
|
731
|
+
], za = {
|
|
722
732
|
2026: {
|
|
723
733
|
"2026-01-01": "Gregorian New Year",
|
|
724
734
|
"2026-03-20": "Eid Al-Fitr Holiday",
|
|
@@ -748,15 +758,15 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
748
758
|
"2027-12-02": "UAE National Day",
|
|
749
759
|
"2027-12-03": "UAE National Day Holiday"
|
|
750
760
|
}
|
|
751
|
-
},
|
|
761
|
+
}, Va = {
|
|
752
762
|
countryCode: Ya,
|
|
753
|
-
timezone:
|
|
754
|
-
payRate:
|
|
755
|
-
overtime:
|
|
756
|
-
workingHours:
|
|
757
|
-
recurringPublicHolidays:
|
|
758
|
-
publicHolidays:
|
|
759
|
-
},
|
|
763
|
+
timezone: Ba,
|
|
764
|
+
payRate: _a,
|
|
765
|
+
overtime: Fa,
|
|
766
|
+
workingHours: Ua,
|
|
767
|
+
recurringPublicHolidays: Wa,
|
|
768
|
+
publicHolidays: za
|
|
769
|
+
}, Ka = "BN", Ga = "Asia/Brunei", ja = {
|
|
760
770
|
NORMAL: {
|
|
761
771
|
overtime: 1.5
|
|
762
772
|
},
|
|
@@ -768,13 +778,13 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
768
778
|
regular: 2,
|
|
769
779
|
overtime: 3
|
|
770
780
|
}
|
|
771
|
-
}, ja = {
|
|
772
|
-
maxHoursPerMonth: 72
|
|
773
781
|
}, Qa = {
|
|
782
|
+
maxHoursPerMonth: 72
|
|
783
|
+
}, Xa = {
|
|
774
784
|
minHoursPerDay: null,
|
|
775
785
|
maxHoursPerDay: 8,
|
|
776
786
|
maxHoursPerWeek: 44
|
|
777
|
-
},
|
|
787
|
+
}, Ja = [
|
|
778
788
|
{
|
|
779
789
|
month: 1,
|
|
780
790
|
day: 1,
|
|
@@ -800,7 +810,7 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
800
810
|
day: 25,
|
|
801
811
|
name: "Christmas Day"
|
|
802
812
|
}
|
|
803
|
-
],
|
|
813
|
+
], Za = {
|
|
804
814
|
2026: {
|
|
805
815
|
"2026-01-01": "New Year's Day",
|
|
806
816
|
"2026-02-17": "Chinese New Year",
|
|
@@ -830,15 +840,15 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
830
840
|
"2027-08-15": "Prophet Muhammad's Birthday",
|
|
831
841
|
"2027-12-25": "Christmas Day"
|
|
832
842
|
}
|
|
833
|
-
},
|
|
834
|
-
countryCode:
|
|
835
|
-
timezone:
|
|
836
|
-
payRate:
|
|
837
|
-
overtime:
|
|
838
|
-
workingHours:
|
|
839
|
-
recurringPublicHolidays:
|
|
840
|
-
publicHolidays:
|
|
841
|
-
},
|
|
843
|
+
}, qa = {
|
|
844
|
+
countryCode: Ka,
|
|
845
|
+
timezone: Ga,
|
|
846
|
+
payRate: ja,
|
|
847
|
+
overtime: Qa,
|
|
848
|
+
workingHours: Xa,
|
|
849
|
+
recurringPublicHolidays: Ja,
|
|
850
|
+
publicHolidays: Za
|
|
851
|
+
}, et = "ID", at = "Asia/Jakarta", tt = {
|
|
842
852
|
NORMAL: {
|
|
843
853
|
overtime: 1.5
|
|
844
854
|
},
|
|
@@ -850,13 +860,13 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
850
860
|
regular: 2,
|
|
851
861
|
overtime: 2
|
|
852
862
|
}
|
|
853
|
-
}, tt = {
|
|
854
|
-
maxHoursPerMonth: 72
|
|
855
863
|
}, nt = {
|
|
864
|
+
maxHoursPerMonth: 72
|
|
865
|
+
}, ot = {
|
|
856
866
|
minHoursPerDay: null,
|
|
857
867
|
maxHoursPerDay: 8,
|
|
858
868
|
maxHoursPerWeek: 40
|
|
859
|
-
},
|
|
869
|
+
}, st = [
|
|
860
870
|
{
|
|
861
871
|
month: 1,
|
|
862
872
|
day: 1,
|
|
@@ -877,7 +887,7 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
877
887
|
day: 25,
|
|
878
888
|
name: "Christmas Day"
|
|
879
889
|
}
|
|
880
|
-
],
|
|
890
|
+
], it = {
|
|
881
891
|
2026: {
|
|
882
892
|
"2026-01-01": "New Year's Day",
|
|
883
893
|
"2026-01-16": "Isra Mi'raj",
|
|
@@ -917,15 +927,15 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
917
927
|
"2027-12-25": "Christmas Day",
|
|
918
928
|
"2027-12-26": "Isra Mi'raj"
|
|
919
929
|
}
|
|
920
|
-
},
|
|
921
|
-
countryCode:
|
|
922
|
-
timezone:
|
|
923
|
-
payRate:
|
|
924
|
-
overtime:
|
|
925
|
-
workingHours:
|
|
926
|
-
recurringPublicHolidays:
|
|
927
|
-
publicHolidays:
|
|
928
|
-
},
|
|
930
|
+
}, rt = {
|
|
931
|
+
countryCode: et,
|
|
932
|
+
timezone: at,
|
|
933
|
+
payRate: tt,
|
|
934
|
+
overtime: nt,
|
|
935
|
+
workingHours: ot,
|
|
936
|
+
recurringPublicHolidays: st,
|
|
937
|
+
publicHolidays: it
|
|
938
|
+
}, lt = "MO", ut = "Asia/Macau", dt = {
|
|
929
939
|
NORMAL: {
|
|
930
940
|
overtime: 1.5
|
|
931
941
|
},
|
|
@@ -937,13 +947,13 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
937
947
|
regular: 2,
|
|
938
948
|
overtime: 3
|
|
939
949
|
}
|
|
940
|
-
}, dt = {
|
|
941
|
-
maxHoursPerMonth: null
|
|
942
950
|
}, ct = {
|
|
951
|
+
maxHoursPerMonth: null
|
|
952
|
+
}, yt = {
|
|
943
953
|
minHoursPerDay: null,
|
|
944
954
|
maxHoursPerDay: 8,
|
|
945
955
|
maxHoursPerWeek: 48
|
|
946
|
-
},
|
|
956
|
+
}, mt = [
|
|
947
957
|
{
|
|
948
958
|
month: 1,
|
|
949
959
|
day: 1,
|
|
@@ -969,7 +979,7 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
969
979
|
day: 25,
|
|
970
980
|
name: "Christmas Day"
|
|
971
981
|
}
|
|
972
|
-
],
|
|
982
|
+
], pt = {
|
|
973
983
|
2026: {
|
|
974
984
|
"2026-01-01": "New Year's Day",
|
|
975
985
|
"2026-02-17": "Lunar New Year's Day",
|
|
@@ -1026,15 +1036,15 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
1026
1036
|
"2027-12-25": "Christmas Day",
|
|
1027
1037
|
"2027-12-27": "Compensatory rest day"
|
|
1028
1038
|
}
|
|
1029
|
-
},
|
|
1030
|
-
countryCode:
|
|
1031
|
-
timezone:
|
|
1032
|
-
payRate:
|
|
1033
|
-
overtime:
|
|
1034
|
-
workingHours:
|
|
1035
|
-
recurringPublicHolidays:
|
|
1036
|
-
publicHolidays:
|
|
1037
|
-
},
|
|
1039
|
+
}, ft = {
|
|
1040
|
+
countryCode: lt,
|
|
1041
|
+
timezone: ut,
|
|
1042
|
+
payRate: dt,
|
|
1043
|
+
overtime: ct,
|
|
1044
|
+
workingHours: yt,
|
|
1045
|
+
recurringPublicHolidays: mt,
|
|
1046
|
+
publicHolidays: pt
|
|
1047
|
+
}, ht = "MV", vt = "Indian/Maldives", gt = {
|
|
1038
1048
|
NORMAL: {
|
|
1039
1049
|
overtime: 1.5
|
|
1040
1050
|
},
|
|
@@ -1046,13 +1056,13 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
1046
1056
|
regular: 2,
|
|
1047
1057
|
overtime: 3
|
|
1048
1058
|
}
|
|
1049
|
-
}, gt = {
|
|
1050
|
-
maxHoursPerMonth: null
|
|
1051
1059
|
}, Dt = {
|
|
1060
|
+
maxHoursPerMonth: null
|
|
1061
|
+
}, wt = {
|
|
1052
1062
|
minHoursPerDay: null,
|
|
1053
1063
|
maxHoursPerDay: 8,
|
|
1054
1064
|
maxHoursPerWeek: 48
|
|
1055
|
-
},
|
|
1065
|
+
}, Ht = [
|
|
1056
1066
|
{
|
|
1057
1067
|
month: 1,
|
|
1058
1068
|
day: 1,
|
|
@@ -1078,7 +1088,7 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
1078
1088
|
day: 11,
|
|
1079
1089
|
name: "Republic Day"
|
|
1080
1090
|
}
|
|
1081
|
-
],
|
|
1091
|
+
], At = {
|
|
1082
1092
|
2026: {
|
|
1083
1093
|
"2026-01-01": "New Year's Day",
|
|
1084
1094
|
"2026-03-20": "Eid al-Fitr Holiday",
|
|
@@ -1116,15 +1126,15 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
1116
1126
|
"2027-11-03": "Victory Day",
|
|
1117
1127
|
"2027-11-11": "Republic Day"
|
|
1118
1128
|
}
|
|
1119
|
-
},
|
|
1120
|
-
countryCode:
|
|
1121
|
-
timezone:
|
|
1122
|
-
payRate:
|
|
1123
|
-
overtime:
|
|
1124
|
-
workingHours:
|
|
1125
|
-
recurringPublicHolidays:
|
|
1126
|
-
publicHolidays:
|
|
1127
|
-
},
|
|
1129
|
+
}, Et = {
|
|
1130
|
+
countryCode: ht,
|
|
1131
|
+
timezone: vt,
|
|
1132
|
+
payRate: gt,
|
|
1133
|
+
overtime: Dt,
|
|
1134
|
+
workingHours: wt,
|
|
1135
|
+
recurringPublicHolidays: Ht,
|
|
1136
|
+
publicHolidays: At
|
|
1137
|
+
}, bt = "MY", Pt = "Asia/Kuala_Lumpur", Nt = {
|
|
1128
1138
|
NORMAL: {
|
|
1129
1139
|
overtime: 1.5
|
|
1130
1140
|
},
|
|
@@ -1136,13 +1146,13 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
1136
1146
|
regular: 2,
|
|
1137
1147
|
overtime: 3
|
|
1138
1148
|
}
|
|
1139
|
-
}, Nt = {
|
|
1140
|
-
maxHoursPerMonth: 104
|
|
1141
1149
|
}, kt = {
|
|
1150
|
+
maxHoursPerMonth: 104
|
|
1151
|
+
}, Ct = {
|
|
1142
1152
|
minHoursPerDay: null,
|
|
1143
1153
|
maxHoursPerDay: 8,
|
|
1144
1154
|
maxHoursPerWeek: 45
|
|
1145
|
-
},
|
|
1155
|
+
}, Mt = [
|
|
1146
1156
|
{
|
|
1147
1157
|
month: 1,
|
|
1148
1158
|
day: 1,
|
|
@@ -1168,7 +1178,7 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
1168
1178
|
day: 25,
|
|
1169
1179
|
name: "Christmas Day"
|
|
1170
1180
|
}
|
|
1171
|
-
],
|
|
1181
|
+
], St = {
|
|
1172
1182
|
2026: {
|
|
1173
1183
|
"2026-01-01": "New Year's Day",
|
|
1174
1184
|
"2026-02-17": "Chinese New Year",
|
|
@@ -1206,15 +1216,15 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
1206
1216
|
"2027-10-28": "Deepavali",
|
|
1207
1217
|
"2027-12-25": "Christmas Day"
|
|
1208
1218
|
}
|
|
1209
|
-
},
|
|
1210
|
-
countryCode:
|
|
1211
|
-
timezone:
|
|
1212
|
-
payRate:
|
|
1213
|
-
overtime:
|
|
1214
|
-
workingHours:
|
|
1215
|
-
recurringPublicHolidays:
|
|
1216
|
-
publicHolidays:
|
|
1217
|
-
},
|
|
1219
|
+
}, Lt = {
|
|
1220
|
+
countryCode: bt,
|
|
1221
|
+
timezone: Pt,
|
|
1222
|
+
payRate: Nt,
|
|
1223
|
+
overtime: kt,
|
|
1224
|
+
workingHours: Ct,
|
|
1225
|
+
recurringPublicHolidays: Mt,
|
|
1226
|
+
publicHolidays: St
|
|
1227
|
+
}, It = "PK", Rt = "Asia/Karachi", Ot = {
|
|
1218
1228
|
NORMAL: {
|
|
1219
1229
|
overtime: 1.5
|
|
1220
1230
|
},
|
|
@@ -1226,13 +1236,13 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
1226
1236
|
regular: 2,
|
|
1227
1237
|
overtime: 3
|
|
1228
1238
|
}
|
|
1229
|
-
}, Ot = {
|
|
1230
|
-
maxHoursPerMonth: null
|
|
1231
1239
|
}, Tt = {
|
|
1240
|
+
maxHoursPerMonth: null
|
|
1241
|
+
}, $t = {
|
|
1232
1242
|
minHoursPerDay: null,
|
|
1233
1243
|
maxHoursPerDay: 9,
|
|
1234
1244
|
maxHoursPerWeek: 48
|
|
1235
|
-
},
|
|
1245
|
+
}, xt = [
|
|
1236
1246
|
{
|
|
1237
1247
|
month: 1,
|
|
1238
1248
|
day: 1,
|
|
@@ -1288,15 +1298,15 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
1288
1298
|
"2027-08-15": "Eid Milad-un-Nabi",
|
|
1289
1299
|
"2027-12-25": "Quaid-e-Azam Day and Christmas Day"
|
|
1290
1300
|
}
|
|
1291
|
-
},
|
|
1292
|
-
countryCode:
|
|
1293
|
-
timezone:
|
|
1294
|
-
payRate:
|
|
1295
|
-
overtime:
|
|
1296
|
-
workingHours:
|
|
1297
|
-
recurringPublicHolidays:
|
|
1301
|
+
}, Bt = {
|
|
1302
|
+
countryCode: It,
|
|
1303
|
+
timezone: Rt,
|
|
1304
|
+
payRate: Ot,
|
|
1305
|
+
overtime: Tt,
|
|
1306
|
+
workingHours: $t,
|
|
1307
|
+
recurringPublicHolidays: xt,
|
|
1298
1308
|
publicHolidays: Yt
|
|
1299
|
-
},
|
|
1309
|
+
}, _t = "SG", Ft = "Asia/Singapore", Ut = {
|
|
1300
1310
|
NORMAL: {
|
|
1301
1311
|
overtime: 1.5
|
|
1302
1312
|
},
|
|
@@ -1308,13 +1318,13 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
1308
1318
|
regular: 2,
|
|
1309
1319
|
overtime: 1.5
|
|
1310
1320
|
}
|
|
1311
|
-
}, Ut = {
|
|
1312
|
-
maxHoursPerMonth: 72
|
|
1313
1321
|
}, Wt = {
|
|
1322
|
+
maxHoursPerMonth: 72
|
|
1323
|
+
}, zt = {
|
|
1314
1324
|
minHoursPerDay: null,
|
|
1315
1325
|
maxHoursPerDay: 12,
|
|
1316
1326
|
maxHoursPerWeek: 44
|
|
1317
|
-
},
|
|
1327
|
+
}, Vt = [
|
|
1318
1328
|
{
|
|
1319
1329
|
month: 1,
|
|
1320
1330
|
day: 1,
|
|
@@ -1335,7 +1345,7 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
1335
1345
|
day: 25,
|
|
1336
1346
|
name: "Christmas Day"
|
|
1337
1347
|
}
|
|
1338
|
-
],
|
|
1348
|
+
], Kt = {
|
|
1339
1349
|
2026: {
|
|
1340
1350
|
"2026-01-01": "New Year's Day",
|
|
1341
1351
|
"2026-02-17": "Chinese New Year's Day",
|
|
@@ -1366,15 +1376,15 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
1366
1376
|
"2027-10-28": "Deepavali",
|
|
1367
1377
|
"2027-12-25": "Christmas Day"
|
|
1368
1378
|
}
|
|
1369
|
-
},
|
|
1370
|
-
countryCode:
|
|
1371
|
-
timezone:
|
|
1372
|
-
payRate:
|
|
1373
|
-
overtime:
|
|
1374
|
-
workingHours:
|
|
1375
|
-
recurringPublicHolidays:
|
|
1376
|
-
publicHolidays:
|
|
1377
|
-
},
|
|
1379
|
+
}, Gt = {
|
|
1380
|
+
countryCode: _t,
|
|
1381
|
+
timezone: Ft,
|
|
1382
|
+
payRate: Ut,
|
|
1383
|
+
overtime: Wt,
|
|
1384
|
+
workingHours: zt,
|
|
1385
|
+
recurringPublicHolidays: Vt,
|
|
1386
|
+
publicHolidays: Kt
|
|
1387
|
+
}, jt = "TH", Qt = "Asia/Bangkok", Xt = {
|
|
1378
1388
|
NORMAL: {
|
|
1379
1389
|
overtime: 1.5
|
|
1380
1390
|
},
|
|
@@ -1386,13 +1396,13 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
1386
1396
|
regular: 2,
|
|
1387
1397
|
overtime: 3
|
|
1388
1398
|
}
|
|
1389
|
-
}, Xt = {
|
|
1390
|
-
maxHoursPerMonth: 36
|
|
1391
1399
|
}, Jt = {
|
|
1400
|
+
maxHoursPerMonth: 36
|
|
1401
|
+
}, Zt = {
|
|
1392
1402
|
minHoursPerDay: null,
|
|
1393
1403
|
maxHoursPerDay: 8,
|
|
1394
1404
|
maxHoursPerWeek: 48
|
|
1395
|
-
},
|
|
1405
|
+
}, qt = [
|
|
1396
1406
|
{
|
|
1397
1407
|
month: 1,
|
|
1398
1408
|
day: 1,
|
|
@@ -1438,7 +1448,7 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
1438
1448
|
day: 31,
|
|
1439
1449
|
name: "New Year's Eve"
|
|
1440
1450
|
}
|
|
1441
|
-
],
|
|
1451
|
+
], en = {
|
|
1442
1452
|
2026: {
|
|
1443
1453
|
"2026-01-01": "New Year's Day",
|
|
1444
1454
|
"2026-03-03": "Makha Bucha Day",
|
|
@@ -1478,15 +1488,15 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
1478
1488
|
"2027-12-10": "Constitution Day",
|
|
1479
1489
|
"2027-12-31": "New Year's Eve"
|
|
1480
1490
|
}
|
|
1481
|
-
},
|
|
1482
|
-
countryCode:
|
|
1483
|
-
timezone:
|
|
1484
|
-
payRate:
|
|
1485
|
-
overtime:
|
|
1486
|
-
workingHours:
|
|
1487
|
-
recurringPublicHolidays:
|
|
1488
|
-
publicHolidays:
|
|
1489
|
-
},
|
|
1491
|
+
}, an = {
|
|
1492
|
+
countryCode: jt,
|
|
1493
|
+
timezone: Qt,
|
|
1494
|
+
payRate: Xt,
|
|
1495
|
+
overtime: Jt,
|
|
1496
|
+
workingHours: Zt,
|
|
1497
|
+
recurringPublicHolidays: qt,
|
|
1498
|
+
publicHolidays: en
|
|
1499
|
+
}, tn = "VN", nn = "Asia/Ho_Chi_Minh", on = {
|
|
1490
1500
|
NORMAL: {
|
|
1491
1501
|
overtime: 1.5
|
|
1492
1502
|
},
|
|
@@ -1498,13 +1508,13 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
1498
1508
|
regular: 2,
|
|
1499
1509
|
overtime: 3
|
|
1500
1510
|
}
|
|
1501
|
-
}, on = {
|
|
1502
|
-
maxHoursPerMonth: 40
|
|
1503
1511
|
}, sn = {
|
|
1512
|
+
maxHoursPerMonth: 40
|
|
1513
|
+
}, rn = {
|
|
1504
1514
|
minHoursPerDay: null,
|
|
1505
1515
|
maxHoursPerDay: 8,
|
|
1506
1516
|
maxHoursPerWeek: 48
|
|
1507
|
-
},
|
|
1517
|
+
}, ln = [
|
|
1508
1518
|
{
|
|
1509
1519
|
month: 1,
|
|
1510
1520
|
day: 1,
|
|
@@ -1525,7 +1535,7 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
1525
1535
|
day: 2,
|
|
1526
1536
|
name: "National Day"
|
|
1527
1537
|
}
|
|
1528
|
-
],
|
|
1538
|
+
], un = {
|
|
1529
1539
|
2026: {
|
|
1530
1540
|
"2026-01-01": "New Year's Day",
|
|
1531
1541
|
"2026-02-16": "Tet Holiday",
|
|
@@ -1553,16 +1563,16 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
1553
1563
|
"2027-09-02": "National Day",
|
|
1554
1564
|
"2027-09-03": "National Day Holiday"
|
|
1555
1565
|
}
|
|
1556
|
-
},
|
|
1557
|
-
countryCode:
|
|
1558
|
-
timezone:
|
|
1559
|
-
payRate:
|
|
1560
|
-
overtime:
|
|
1561
|
-
workingHours:
|
|
1562
|
-
recurringPublicHolidays:
|
|
1563
|
-
publicHolidays:
|
|
1564
|
-
}, Fe = { AE:
|
|
1565
|
-
function
|
|
1566
|
+
}, dn = {
|
|
1567
|
+
countryCode: tn,
|
|
1568
|
+
timezone: nn,
|
|
1569
|
+
payRate: on,
|
|
1570
|
+
overtime: sn,
|
|
1571
|
+
workingHours: rn,
|
|
1572
|
+
recurringPublicHolidays: ln,
|
|
1573
|
+
publicHolidays: un
|
|
1574
|
+
}, Fe = { AE: Va, BN: qa, ID: rt, MO: ft, MV: Et, MY: Lt, PK: Bt, SG: Gt, TH: an, VN: dn };
|
|
1575
|
+
function cn(e) {
|
|
1566
1576
|
if (typeof e == "string") return e.toUpperCase();
|
|
1567
1577
|
if (e && typeof e == "object" && "code" in e) {
|
|
1568
1578
|
const a = e.code;
|
|
@@ -1570,17 +1580,17 @@ function dn(e) {
|
|
|
1570
1580
|
}
|
|
1571
1581
|
return "MY";
|
|
1572
1582
|
}
|
|
1573
|
-
function
|
|
1574
|
-
return Fe[
|
|
1583
|
+
function yn(e) {
|
|
1584
|
+
return Fe[cn(e)] ?? Fe.MY;
|
|
1575
1585
|
}
|
|
1576
|
-
function
|
|
1577
|
-
var
|
|
1578
|
-
const t = (
|
|
1586
|
+
function No(e, a) {
|
|
1587
|
+
var o, l;
|
|
1588
|
+
const t = (o = e.publicHolidays[a.slice(0, 4)]) == null ? void 0 : o[a];
|
|
1579
1589
|
if (t) return t;
|
|
1580
1590
|
const n = Number(a.slice(5, 7)), i = Number(a.slice(8, 10));
|
|
1581
|
-
return ((l = e.recurringPublicHolidays.find((
|
|
1591
|
+
return ((l = e.recurringPublicHolidays.find((s) => s.month === n && s.day === i)) == null ? void 0 : l.name) ?? null;
|
|
1582
1592
|
}
|
|
1583
|
-
const
|
|
1593
|
+
const mn = Ve(), aa = "unassigned", ko = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], Co = "All Stations", Mo = [{ id: aa, label: "Assigned", roles: [], system: !0 }], Ue = [
|
|
1584
1594
|
"#903E1F",
|
|
1585
1595
|
"#5F090A",
|
|
1586
1596
|
"#0A5384",
|
|
@@ -1590,96 +1600,106 @@ const yn = Ve(), aa = "unassigned", Po = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sa
|
|
|
1590
1600
|
"#0F5C5C",
|
|
1591
1601
|
"#6E2142"
|
|
1592
1602
|
];
|
|
1593
|
-
function
|
|
1603
|
+
function pn(e) {
|
|
1594
1604
|
var t;
|
|
1595
1605
|
const a = e.trim().toLocaleLowerCase();
|
|
1596
|
-
return (t =
|
|
1606
|
+
return (t = B.find((n) => n.name.toLocaleLowerCase() === a)) == null ? void 0 : t.id;
|
|
1607
|
+
}
|
|
1608
|
+
function So(e, a) {
|
|
1609
|
+
if (e)
|
|
1610
|
+
return { positionId: a ?? pn(e), positionName: e };
|
|
1597
1611
|
}
|
|
1598
|
-
function
|
|
1612
|
+
function se(e, a = B) {
|
|
1613
|
+
var t;
|
|
1614
|
+
if (e)
|
|
1615
|
+
return (e.positionId && ((t = a.find((n) => n.id === e.positionId)) == null ? void 0 : t.name)) ?? e.positionName;
|
|
1616
|
+
}
|
|
1617
|
+
function Lo(e, a = B) {
|
|
1618
|
+
var t, n;
|
|
1599
1619
|
if (e)
|
|
1600
|
-
return
|
|
1620
|
+
return e.positionId ? (t = a.find((i) => i.id === e.positionId)) == null ? void 0 : t.name : (n = a.find((i) => i.name.toLocaleLowerCase() === e.positionName.toLocaleLowerCase())) == null ? void 0 : n.name;
|
|
1601
1621
|
}
|
|
1602
|
-
function
|
|
1603
|
-
return a ? !
|
|
1622
|
+
function Io(e, a) {
|
|
1623
|
+
return a ? !B.some((t) => t.id === a) : !!e && !B.some((t) => t.name.toLocaleLowerCase() === e.toLocaleLowerCase());
|
|
1604
1624
|
}
|
|
1605
|
-
const
|
|
1606
|
-
function
|
|
1625
|
+
const Ro = [1, 1, 1, 1, 1, 1, 1];
|
|
1626
|
+
function ue(e) {
|
|
1607
1627
|
return (e + 6) % 7;
|
|
1608
1628
|
}
|
|
1609
|
-
function
|
|
1629
|
+
function Oo(e) {
|
|
1610
1630
|
return (e + 1) % 7;
|
|
1611
1631
|
}
|
|
1612
|
-
function
|
|
1632
|
+
function pe(e, a) {
|
|
1613
1633
|
e.splice(0, e.length, ...a);
|
|
1614
1634
|
}
|
|
1615
|
-
function
|
|
1635
|
+
function fn(e, a) {
|
|
1616
1636
|
return Ge(e, a) / 60;
|
|
1617
1637
|
}
|
|
1618
|
-
function
|
|
1638
|
+
function hn(e) {
|
|
1619
1639
|
var t;
|
|
1620
1640
|
const a = e.trim().split(/\s+/).filter(Boolean);
|
|
1621
1641
|
return a.length ? (a[0][0] + (((t = a[1]) == null ? void 0 : t[0]) ?? "")).toUpperCase() : "??";
|
|
1622
1642
|
}
|
|
1623
1643
|
const ta = /* @__PURE__ */ new Map(), Ee = /* @__PURE__ */ new Map();
|
|
1624
|
-
function
|
|
1644
|
+
function To(e) {
|
|
1625
1645
|
return ta.get(e);
|
|
1626
1646
|
}
|
|
1627
|
-
function
|
|
1647
|
+
function vn(e) {
|
|
1628
1648
|
const a = Ee.get(e);
|
|
1629
1649
|
if (a !== void 0) return a;
|
|
1630
1650
|
const t = Qe + Ee.size + 1;
|
|
1631
1651
|
return Ee.set(e, t), ta.set(t, e), t;
|
|
1632
1652
|
}
|
|
1633
|
-
function
|
|
1653
|
+
function $o(e) {
|
|
1634
1654
|
return e.sourceId || String(e.id);
|
|
1635
1655
|
}
|
|
1636
|
-
function
|
|
1637
|
-
|
|
1656
|
+
function gn(e) {
|
|
1657
|
+
ka.name = (e == null ? void 0 : e.outlet.name) ?? "", pe(Na, (e == null ? void 0 : e.positions.map((s) => s.name)) ?? []), pe(B, (e == null ? void 0 : e.positions) ?? []);
|
|
1638
1658
|
const a = (e == null ? void 0 : e.restaurantProfile.operatingHours) ?? [], t = Array.from({ length: 7 }, () => []);
|
|
1639
|
-
for (const
|
|
1640
|
-
|
|
1641
|
-
const n = a.filter((
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
a.filter((
|
|
1659
|
+
for (const s of a) t[ue(s.dayOfWeek)] = s.closed ? [] : s.hours;
|
|
1660
|
+
pe(M.dayHours, t);
|
|
1661
|
+
const n = a.filter((s) => !s.closed).flatMap((s) => s.hours);
|
|
1662
|
+
M.openFrom = n.length ? n.map((s) => s.start).reduce((s, u) => u < s ? u : s) : "00:00", M.openTo = n.length ? n.map((s) => s.end).reduce((s, u) => u > s ? u : s) : "24:00", pe(
|
|
1663
|
+
M.closedWeekdays,
|
|
1664
|
+
a.filter((s) => s.closed).map((s) => ue(s.dayOfWeek)).sort((s, u) => s - u)
|
|
1645
1665
|
);
|
|
1646
|
-
const i =
|
|
1647
|
-
|
|
1666
|
+
const i = yn(mn.currentCountry.value), o = (e == null ? void 0 : e.settings.settingsConfigured) === !0, l = o ? e.settings.payRate : i.payRate;
|
|
1667
|
+
M.otCapHours = o ? e.settings.overtime.maxHoursPerMonth : i.overtime.maxHoursPerMonth, M.workingHours = o ? e.settings.workingHours : {
|
|
1648
1668
|
minHoursPerDay: null,
|
|
1649
1669
|
maxHoursPerDay: i.workingHours.maxHoursPerDay,
|
|
1650
1670
|
maxHoursPerWeek: i.workingHours.maxHoursPerWeek
|
|
1651
|
-
},
|
|
1671
|
+
}, 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;
|
|
1652
1672
|
}
|
|
1653
|
-
Ie(c,
|
|
1654
|
-
function
|
|
1673
|
+
Ie(c, gn, { immediate: !0 });
|
|
1674
|
+
function ge(e) {
|
|
1655
1675
|
var a, t, n;
|
|
1656
1676
|
return {
|
|
1657
|
-
minHoursPerDay: ((a = e.workingHours) == null ? void 0 : a.minHoursPerDay) ??
|
|
1658
|
-
maxHoursPerDay: ((t = e.workingHours) == null ? void 0 : t.maxHoursPerDay) ??
|
|
1659
|
-
maxHoursPerWeek: ((n = e.workingHours) == null ? void 0 : n.maxHoursPerWeek) ??
|
|
1677
|
+
minHoursPerDay: ((a = e.workingHours) == null ? void 0 : a.minHoursPerDay) ?? M.workingHours.minHoursPerDay,
|
|
1678
|
+
maxHoursPerDay: ((t = e.workingHours) == null ? void 0 : t.maxHoursPerDay) ?? M.workingHours.maxHoursPerDay,
|
|
1679
|
+
maxHoursPerWeek: ((n = e.workingHours) == null ? void 0 : n.maxHoursPerWeek) ?? M.workingHours.maxHoursPerWeek
|
|
1660
1680
|
};
|
|
1661
1681
|
}
|
|
1662
|
-
function
|
|
1682
|
+
function Dn(e) {
|
|
1663
1683
|
return e.reduce(
|
|
1664
1684
|
(a, t) => {
|
|
1665
|
-
const n =
|
|
1685
|
+
const n = ge(t).maxHoursPerWeek;
|
|
1666
1686
|
return t.employmentType === "FULLTIME" && n != null ? Math.max(a, n) : a;
|
|
1667
1687
|
},
|
|
1668
1688
|
0
|
|
1669
1689
|
);
|
|
1670
1690
|
}
|
|
1671
|
-
function
|
|
1691
|
+
function wn(e, a) {
|
|
1672
1692
|
if (e.wage.type === "HOURLY") return e.wage.amount;
|
|
1673
|
-
const t =
|
|
1693
|
+
const t = ge(e).maxHoursPerWeek ?? a;
|
|
1674
1694
|
return t ? e.wage.amount / (t * (52 / 12)) : 0;
|
|
1675
1695
|
}
|
|
1676
|
-
function
|
|
1696
|
+
function Hn(e, a) {
|
|
1677
1697
|
if (e.employmentType === "FULLTIME") return 100;
|
|
1678
|
-
const t =
|
|
1698
|
+
const t = ge(e).maxHoursPerWeek;
|
|
1679
1699
|
return !a || t == null ? 0 : Math.min(99, Math.round(t / a * 100));
|
|
1680
1700
|
}
|
|
1681
|
-
function
|
|
1682
|
-
var a
|
|
1701
|
+
function An(e) {
|
|
1702
|
+
var a;
|
|
1683
1703
|
return {
|
|
1684
1704
|
start: e.startTime,
|
|
1685
1705
|
end: e.endTime,
|
|
@@ -1687,8 +1707,8 @@ function Hn(e) {
|
|
|
1687
1707
|
// stay blank rather than falling back to the employee's own primary position, or a reload
|
|
1688
1708
|
// silently reassigns every "Any position" shift to whatever station the employee is normally
|
|
1689
1709
|
// pinned to.
|
|
1690
|
-
role: (
|
|
1691
|
-
positionId: ((
|
|
1710
|
+
role: se(e.position) ?? "",
|
|
1711
|
+
positionId: ((a = e.position) == null ? void 0 : a.positionId) || void 0,
|
|
1692
1712
|
// Mongo distinguishes a draft from a published/confirmed assignment; the board's third
|
|
1693
1713
|
// state ('ot') is a costing outcome, never something stored.
|
|
1694
1714
|
status: e.status === "DRAFT" ? "pending" : "confirmed",
|
|
@@ -1700,10 +1720,10 @@ function Hn(e) {
|
|
|
1700
1720
|
updatedAt: e.updatedAt
|
|
1701
1721
|
};
|
|
1702
1722
|
}
|
|
1703
|
-
function
|
|
1723
|
+
function En(e) {
|
|
1704
1724
|
return e.type === "OFF_DAY" ? "Off day" : e.leaveType === "MEDICAL" ? "Medical Leave" : e.leaveType === "EMERGENCY" ? "Emergency Leave" : e.leaveType === "UNPAID" ? "Unpaid Leave" : "Annual Leave";
|
|
1705
1725
|
}
|
|
1706
|
-
function
|
|
1726
|
+
function bn(e, a) {
|
|
1707
1727
|
if (a < e.startDate || a > e.endDate) return null;
|
|
1708
1728
|
const n = e.startDate === e.endDate || a === e.startDate ? e.startPart : a === e.endDate ? e.endPart : "FULL_DAY";
|
|
1709
1729
|
return {
|
|
@@ -1711,12 +1731,12 @@ function En(e, a) {
|
|
|
1711
1731
|
type: e.type,
|
|
1712
1732
|
leaveType: e.leaveType ?? void 0,
|
|
1713
1733
|
timeOff: e.status === "PENDING" ? "pending" : "approved",
|
|
1714
|
-
reason:
|
|
1734
|
+
reason: En(e),
|
|
1715
1735
|
half: n !== "FULL_DAY",
|
|
1716
1736
|
halfPart: n === "FULL_DAY" ? void 0 : n
|
|
1717
1737
|
};
|
|
1718
1738
|
}
|
|
1719
|
-
function
|
|
1739
|
+
function Pn(e) {
|
|
1720
1740
|
return {
|
|
1721
1741
|
employeeId: e._id,
|
|
1722
1742
|
name: e.name,
|
|
@@ -1727,62 +1747,61 @@ function bn(e) {
|
|
|
1727
1747
|
availability: []
|
|
1728
1748
|
};
|
|
1729
1749
|
}
|
|
1730
|
-
function
|
|
1750
|
+
function Nn(e) {
|
|
1731
1751
|
const a = ne[m.value];
|
|
1732
1752
|
return !a || !e.includes(a) ? e : [a, ...e.filter((t) => t !== a)];
|
|
1733
1753
|
}
|
|
1734
|
-
function
|
|
1754
|
+
function kn(e) {
|
|
1735
1755
|
var n;
|
|
1736
|
-
const t = (Ze.value[e] ?? ((n =
|
|
1737
|
-
return t.length ?
|
|
1756
|
+
const t = (Ze.value[e] ?? ((n = ie.value.find((i) => i._id === e)) == null ? void 0 : n.restaurantRole.map((i) => i.restaurantId)) ?? []).map((i) => ne[i]).filter((i) => !!i);
|
|
1757
|
+
return t.length ? Nn([...new Set(t)]) : void 0;
|
|
1738
1758
|
}
|
|
1739
|
-
function
|
|
1759
|
+
function xo(e = []) {
|
|
1740
1760
|
const a = c.value;
|
|
1741
1761
|
if (!a) return [];
|
|
1742
|
-
const t = new Map(a.employees.map((
|
|
1743
|
-
F.value.map((
|
|
1744
|
-
), i =
|
|
1762
|
+
const t = new Map(a.employees.map((s) => [s.employeeId, s])), n = new Map(
|
|
1763
|
+
F.value.map((s) => [s.employeeId, s])
|
|
1764
|
+
), i = ie.value.filter((s) => {
|
|
1745
1765
|
var u;
|
|
1746
|
-
return ((u = n.get(
|
|
1747
|
-
}).map((
|
|
1748
|
-
for (const
|
|
1749
|
-
const u = `${
|
|
1750
|
-
|
|
1766
|
+
return ((u = n.get(s._id)) == null ? void 0 : u.enabled) !== !1;
|
|
1767
|
+
}).map((s) => t.get(s._id) ?? Pn(s)), o = Dn(i), l = /* @__PURE__ */ new Map();
|
|
1768
|
+
for (const s of a.assignments) {
|
|
1769
|
+
const u = `${s.employeeId}|${s.date}`, v = l.get(u);
|
|
1770
|
+
v ? v.push(s) : l.set(u, [s]);
|
|
1751
1771
|
}
|
|
1752
|
-
return i.map((
|
|
1753
|
-
|
|
1754
|
-
const u = se.value.find((g) => g._id === o.employeeId) ?? {
|
|
1772
|
+
return i.map((s) => {
|
|
1773
|
+
const u = ie.value.find((h) => h._id === s.employeeId) ?? {
|
|
1755
1774
|
code: void 0,
|
|
1756
1775
|
passcode: "",
|
|
1757
1776
|
isMasterUser: !1
|
|
1758
|
-
},
|
|
1759
|
-
...
|
|
1760
|
-
...
|
|
1761
|
-
],
|
|
1762
|
-
const b =
|
|
1763
|
-
if (
|
|
1764
|
-
const
|
|
1765
|
-
return
|
|
1766
|
-
}), Z =
|
|
1777
|
+
}, v = ge(s), E = vn(s.employeeId), $ = new Set(B.map((h) => h.id)), Q = new Set(B.map((h) => h.name.toLocaleLowerCase())), p = (h) => h.positionId ? $.has(h.positionId) : Q.has(h.positionName.toLocaleLowerCase()), w = se(s.primaryPosition), I = !!s.primaryPosition && p(s.primaryPosition), R = s.secondaryPositions.filter(p).map((h) => se(h)).filter((h) => !!h), X = w ? I ? [w, ...R] : [] : R, J = [
|
|
1778
|
+
...w && !I ? [w] : [],
|
|
1779
|
+
...s.secondaryPositions.filter((h) => !p(h)).map((h) => se(h)).filter((h) => !!h)
|
|
1780
|
+
], _ = X[0] ?? "", S = e.map((h) => {
|
|
1781
|
+
const b = re(h), H = (a.timeOff ?? []).filter((P) => P.employeeId === s.employeeId).map((P) => bn(P, b)).find((P) => P !== null);
|
|
1782
|
+
if (H) return H;
|
|
1783
|
+
const U = (l.get(`${s.employeeId}|${b}`) ?? []).filter((P) => P.startTime && P.endTime).map((P) => An(P)).sort((P, ye) => P.start.localeCompare(ye.start));
|
|
1784
|
+
return U.length ? U.length === 1 ? U[0] : U : null;
|
|
1785
|
+
}), Z = s.availability.length > 0, de = Array.from(
|
|
1767
1786
|
{ length: 7 },
|
|
1768
|
-
(
|
|
1769
|
-
),
|
|
1770
|
-
const
|
|
1771
|
-
return { from: (
|
|
1787
|
+
(h, b) => Z ? s.availability.some((H) => ue(H.dayOfWeek) === b) : !0
|
|
1788
|
+
), ce = Array.from({ length: 7 }, (h, b) => {
|
|
1789
|
+
const H = s.availability.find((k) => ue(k.dayOfWeek) === b);
|
|
1790
|
+
return { from: (H == null ? void 0 : H.start) ?? "", to: (H == null ? void 0 : H.end) ?? "" };
|
|
1772
1791
|
});
|
|
1773
1792
|
return {
|
|
1774
1793
|
id: E,
|
|
1775
|
-
sourceId:
|
|
1776
|
-
name:
|
|
1794
|
+
sourceId: s.employeeId,
|
|
1795
|
+
name: s.name,
|
|
1777
1796
|
// POS access belongs to the POS roster, not the scheduling profile. Keep these
|
|
1778
1797
|
// fields on the board employee so the edit form can initialise its access section
|
|
1779
1798
|
// from the employee's existing POS account.
|
|
1780
1799
|
passcode: u.passcode || void 0,
|
|
1781
1800
|
code: u.code,
|
|
1782
1801
|
masterUser: u.isMasterUser,
|
|
1783
|
-
employmentType:
|
|
1784
|
-
role:
|
|
1785
|
-
initials:
|
|
1802
|
+
employmentType: s.employmentType,
|
|
1803
|
+
role: _,
|
|
1804
|
+
initials: hn(s.name),
|
|
1786
1805
|
color: Ue[(E - Qe - 1) % Ue.length],
|
|
1787
1806
|
// Gross hours actually rostered this week — the figure the cost rail multiplies by
|
|
1788
1807
|
// the rate. Contracted hours are a separate question, answered by RULES.contract.
|
|
@@ -1790,83 +1809,83 @@ function Oo(e = []) {
|
|
|
1790
1809
|
// as a long, meaningless float (e.g. 31.983333333333334) everywhere this is shown
|
|
1791
1810
|
// verbatim, matching the rounding `employeeLoadOf`'s own hours figure already uses.
|
|
1792
1811
|
weekHours: Math.round(
|
|
1793
|
-
|
|
1794
|
-
(
|
|
1795
|
-
(
|
|
1812
|
+
S.reduce(
|
|
1813
|
+
(h, b) => h + (Array.isArray(b) ? b : b && "start" in b ? [b] : []).reduce(
|
|
1814
|
+
(H, k) => H + fn(k.start, k.end),
|
|
1796
1815
|
0
|
|
1797
1816
|
),
|
|
1798
1817
|
0
|
|
1799
1818
|
) * 10
|
|
1800
1819
|
) / 10,
|
|
1801
|
-
pct:
|
|
1802
|
-
contractHours:
|
|
1803
|
-
minHoursPerDay:
|
|
1820
|
+
pct: Hn(s, o),
|
|
1821
|
+
contractHours: v.maxHoursPerWeek ?? void 0,
|
|
1822
|
+
minHoursPerDay: v.minHoursPerDay ?? void 0,
|
|
1804
1823
|
// Keep the persisted override shape here. Consumers that need the effective value use
|
|
1805
1824
|
// effectiveWorkingHours(), so an inherited null remains distinguishable from an override.
|
|
1806
|
-
workingHours:
|
|
1825
|
+
workingHours: s.workingHours,
|
|
1807
1826
|
// Every outlet the POS says this person works at, not just this one — the Add / Edit form
|
|
1808
1827
|
// shows them, and saving keeps them.
|
|
1809
|
-
locations:
|
|
1810
|
-
rate:
|
|
1828
|
+
locations: kn(s.employeeId),
|
|
1829
|
+
rate: wn(s, o),
|
|
1811
1830
|
positions: X,
|
|
1812
1831
|
archivedPositions: J.length ? J : void 0,
|
|
1813
|
-
shifts:
|
|
1832
|
+
shifts: S,
|
|
1814
1833
|
// Remarks live in their own collection in the older scheduling design and are not
|
|
1815
1834
|
// part of this board's payload yet.
|
|
1816
1835
|
remarks: [],
|
|
1817
1836
|
section: aa,
|
|
1818
|
-
payBasis:
|
|
1819
|
-
payAmount:
|
|
1820
|
-
availDays:
|
|
1821
|
-
availHours:
|
|
1837
|
+
payBasis: s.wage.type === "HOURLY" ? "hourly" : "monthly",
|
|
1838
|
+
payAmount: s.wage.amount,
|
|
1839
|
+
availDays: de,
|
|
1840
|
+
availHours: ce
|
|
1822
1841
|
};
|
|
1823
1842
|
});
|
|
1824
1843
|
}
|
|
1825
|
-
function
|
|
1844
|
+
function Yo() {
|
|
1826
1845
|
return [];
|
|
1827
1846
|
}
|
|
1828
|
-
function
|
|
1847
|
+
function Bo() {
|
|
1829
1848
|
var n, i;
|
|
1830
1849
|
const e = c.value, a = {}, t = {};
|
|
1831
|
-
for (const
|
|
1832
|
-
const l =
|
|
1850
|
+
for (const o of (e == null ? void 0 : e.demands) ?? []) {
|
|
1851
|
+
const l = o.date ? a[n = o.date] ?? (a[n] = []) : o.dayOfWeek !== null ? t[i = ue(o.dayOfWeek)] ?? (t[i] = []) : null;
|
|
1833
1852
|
if (!l) continue;
|
|
1834
|
-
let
|
|
1835
|
-
|
|
1836
|
-
position:
|
|
1837
|
-
positionId:
|
|
1838
|
-
n:
|
|
1853
|
+
let s = l.find((u) => u.from === o.startTime && u.to === o.endTime);
|
|
1854
|
+
s || (s = { from: o.startTime, to: o.endTime, n: 0, roles: [] }, l.push(s)), s.n += o.headcount, o.position && s.roles.push({
|
|
1855
|
+
position: se(o.position) ?? "",
|
|
1856
|
+
positionId: o.position.positionId || void 0,
|
|
1857
|
+
n: o.headcount
|
|
1839
1858
|
});
|
|
1840
1859
|
}
|
|
1841
1860
|
return { byDate: a, byWeekday: t };
|
|
1842
1861
|
}
|
|
1843
|
-
function
|
|
1844
|
-
const e = Ve(), { restaurants: a, readRestaurants: t } =
|
|
1845
|
-
() => a.value.filter((p) => p.managable).map((p) => ({ value: p._id, label: p.profile.name })).sort((p,
|
|
1846
|
-
),
|
|
1862
|
+
function _o() {
|
|
1863
|
+
const e = Ve(), { restaurants: a, readRestaurants: t } = Ha(), n = Da(), i = wa(), o = A(!1), l = Y(
|
|
1864
|
+
() => a.value.filter((p) => p.managable).map((p) => ({ value: p._id, label: p.profile.name })).sort((p, w) => p.label.localeCompare(w.label))
|
|
1865
|
+
), s = () => {
|
|
1847
1866
|
var p;
|
|
1848
1867
|
return `hrm-schedule-outlet:${((p = e.currentBusiness.value) == null ? void 0 : p._id) ?? ""}`;
|
|
1849
|
-
}, u =
|
|
1868
|
+
}, u = Y(() => {
|
|
1850
1869
|
var p;
|
|
1851
1870
|
return ((p = e.currentRestaurant.value) == null ? void 0 : p._id) ?? "";
|
|
1852
1871
|
});
|
|
1853
|
-
async function
|
|
1854
|
-
return Be(p) ? (localStorage.setItem(
|
|
1872
|
+
async function v(p, w) {
|
|
1873
|
+
return Be(p) ? (localStorage.setItem(s(), p), n.query.restaurantId !== p && i.replace({ query: { ...n.query, restaurantId: p } }), await Promise.all([Me(p), Ta(w)]), !0) : !1;
|
|
1855
1874
|
}
|
|
1856
|
-
const E = (p) => !!p && l.value.some((
|
|
1857
|
-
async function
|
|
1858
|
-
var
|
|
1859
|
-
await t(),
|
|
1860
|
-
const p = localStorage.getItem(
|
|
1861
|
-
return
|
|
1875
|
+
const E = (p) => !!p && l.value.some((w) => w.value === p);
|
|
1876
|
+
async function $() {
|
|
1877
|
+
var I;
|
|
1878
|
+
await t(), Ye.splice(0, Ye.length, ...l.value.map((R) => R.label)), Object.keys(ne).forEach((R) => delete ne[R]), a.value.forEach((R) => ne[R._id] = R.profile.name);
|
|
1879
|
+
const p = localStorage.getItem(s()) ?? "", w = [m.value, p, u.value].find(E) ?? ((I = l.value[0]) == null ? void 0 : I.value) ?? "";
|
|
1880
|
+
return w && Be(w), o.value = !0, w;
|
|
1862
1881
|
}
|
|
1863
1882
|
async function Q() {
|
|
1864
|
-
const p = await
|
|
1883
|
+
const p = await $();
|
|
1865
1884
|
return p && await Me(p), p;
|
|
1866
1885
|
}
|
|
1867
|
-
return { options: l, ready:
|
|
1886
|
+
return { options: l, ready: o, outletId: m, resolve: Q, resolveOutlet: $, switchTo: v };
|
|
1868
1887
|
}
|
|
1869
|
-
const
|
|
1888
|
+
const Cn = ["data-hierarchy", "data-size", "data-icon"], Fo = /* @__PURE__ */ Re({
|
|
1870
1889
|
__name: "ScheduleButton",
|
|
1871
1890
|
props: {
|
|
1872
1891
|
hierarchy: { default: "primary" },
|
|
@@ -1874,7 +1893,7 @@ const kn = ["data-hierarchy", "data-size", "data-icon"], xo = /* @__PURE__ */ Re
|
|
|
1874
1893
|
iconOnly: { type: Boolean, default: !1 }
|
|
1875
1894
|
},
|
|
1876
1895
|
setup(e) {
|
|
1877
|
-
return (a, t) => (N(),
|
|
1896
|
+
return (a, t) => (N(), C("button", {
|
|
1878
1897
|
type: "button",
|
|
1879
1898
|
class: "sch-button",
|
|
1880
1899
|
"data-hierarchy": e.hierarchy,
|
|
@@ -1882,24 +1901,24 @@ const kn = ["data-hierarchy", "data-size", "data-icon"], xo = /* @__PURE__ */ Re
|
|
|
1882
1901
|
"data-icon": e.iconOnly ? "only" : void 0
|
|
1883
1902
|
}, [
|
|
1884
1903
|
ze(a.$slots, "default")
|
|
1885
|
-
], 8,
|
|
1904
|
+
], 8, Cn));
|
|
1886
1905
|
}
|
|
1887
|
-
}),
|
|
1906
|
+
}), Mn = ["disabled", "aria-expanded"], Sn = { class: "fx-btn-label" }, Ln = { class: "sch" }, In = ["aria-multiselectable"], Rn = {
|
|
1888
1907
|
key: 0,
|
|
1889
1908
|
class: "fx-pop-head"
|
|
1890
|
-
},
|
|
1909
|
+
}, On = {
|
|
1891
1910
|
key: 1,
|
|
1892
1911
|
class: "fx-pop-search"
|
|
1893
|
-
},
|
|
1912
|
+
}, Tn = {
|
|
1894
1913
|
key: 2,
|
|
1895
1914
|
class: "fx-opt is-off"
|
|
1896
|
-
},
|
|
1915
|
+
}, $n = {
|
|
1897
1916
|
key: 0,
|
|
1898
1917
|
class: "fx-grp"
|
|
1899
|
-
},
|
|
1918
|
+
}, xn = ["aria-selected", "onClick"], Yn = {
|
|
1900
1919
|
key: 0,
|
|
1901
1920
|
class: "fx-opt-text"
|
|
1902
|
-
},
|
|
1921
|
+
}, Bn = { key: 0 }, Uo = /* @__PURE__ */ Re({
|
|
1903
1922
|
inheritAttrs: !1,
|
|
1904
1923
|
__name: "ScheduleSelect",
|
|
1905
1924
|
props: {
|
|
@@ -1917,13 +1936,13 @@ const kn = ["data-hierarchy", "data-size", "data-icon"], xo = /* @__PURE__ */ Re
|
|
|
1917
1936
|
},
|
|
1918
1937
|
emits: ["update:modelValue", "toggle"],
|
|
1919
1938
|
setup(e, { emit: a }) {
|
|
1920
|
-
const t = e, n = a, i =
|
|
1939
|
+
const t = e, n = a, i = ua(), o = Y(() => i.class ?? ""), l = A(!1), s = A(!1), u = A(null), v = A(null), E = A(null), $ = Y(() => t.teleport !== !1 && s.value);
|
|
1921
1940
|
Se(() => {
|
|
1922
|
-
|
|
1941
|
+
s.value = typeof document < "u" && !!document.body;
|
|
1923
1942
|
});
|
|
1924
|
-
const Q =
|
|
1943
|
+
const Q = Y(() => {
|
|
1925
1944
|
var r, y;
|
|
1926
|
-
if (
|
|
1945
|
+
if (t.selectedLabel != null) return t.selectedLabel;
|
|
1927
1946
|
if (t.multiple) {
|
|
1928
1947
|
const d = ((r = t.selected) == null ? void 0 : r.length) ?? 0;
|
|
1929
1948
|
return d ? `${d} selected` : t.placeholder ?? "";
|
|
@@ -1934,185 +1953,187 @@ const kn = ["data-hierarchy", "data-size", "data-icon"], xo = /* @__PURE__ */ Re
|
|
|
1934
1953
|
var y;
|
|
1935
1954
|
return t.multiple ? !!((y = t.selected) != null && y.includes(r.value)) : t.selectedId != null ? r.id === t.selectedId : r.value === t.modelValue;
|
|
1936
1955
|
}
|
|
1937
|
-
const
|
|
1938
|
-
const r =
|
|
1956
|
+
const w = Y(() => !!t.menuTitle || t.options.some((r) => r.hint)), I = A(""), R = A(null), X = Y(() => {
|
|
1957
|
+
const r = I.value.trim().toLowerCase();
|
|
1939
1958
|
return !t.searchable || !r ? t.options : t.options.filter((y) => `${y.label} ${y.hint ?? ""}`.toLowerCase().includes(r));
|
|
1940
|
-
}), J =
|
|
1959
|
+
}), J = Y(() => {
|
|
1941
1960
|
const r = [];
|
|
1942
1961
|
let y;
|
|
1943
1962
|
for (const d of X.value)
|
|
1944
1963
|
d.group !== y && (y = d.group, y && r.push({ heading: y })), r.push({ option: d });
|
|
1945
1964
|
return r;
|
|
1946
|
-
}),
|
|
1965
|
+
}), _ = 5, S = 8;
|
|
1947
1966
|
function Z() {
|
|
1948
|
-
const r = E.value, y =
|
|
1967
|
+
const r = E.value, y = v.value;
|
|
1949
1968
|
if (!r || !y) return;
|
|
1950
|
-
const d = y.getBoundingClientRect(),
|
|
1951
|
-
r.style.minWidth = `${Math.round(d.width)}px`, r.style.maxWidth = `${Math.max(180, Math.round(
|
|
1952
|
-
const q =
|
|
1953
|
-
r.style.maxHeight = `${Math.max(120, Math.min(320, Math.max(q,
|
|
1954
|
-
const
|
|
1955
|
-
let De = d.bottom +
|
|
1956
|
-
De +
|
|
1957
|
-
const
|
|
1958
|
-
r.style.top = `${Math.round(De)}px`, r.style.left = `${Math.round(
|
|
1969
|
+
const d = y.getBoundingClientRect(), L = window.innerWidth || document.documentElement.clientWidth, T = window.innerHeight || document.documentElement.clientHeight;
|
|
1970
|
+
r.style.minWidth = `${Math.round(d.width)}px`, r.style.maxWidth = `${Math.max(180, Math.round(L - S * 2))}px`;
|
|
1971
|
+
const q = T - d.bottom - _ - S, ia = d.top - _ - S;
|
|
1972
|
+
r.style.maxHeight = `${Math.max(120, Math.min(320, Math.max(q, ia)))}px`;
|
|
1973
|
+
const me = r.offsetHeight, ra = r.offsetWidth;
|
|
1974
|
+
let De = d.bottom + _;
|
|
1975
|
+
De + me > T - S && (De = d.top - _ - me >= S ? d.top - _ - me : Math.max(S, T - me - S));
|
|
1976
|
+
const la = Math.min(Math.max(S, d.left), Math.max(S, L - ra - S));
|
|
1977
|
+
r.style.top = `${Math.round(De)}px`, r.style.left = `${Math.round(la)}px`, r.style.visibility = "visible";
|
|
1959
1978
|
}
|
|
1960
|
-
function
|
|
1961
|
-
var d,
|
|
1979
|
+
function de(r) {
|
|
1980
|
+
var d, L;
|
|
1962
1981
|
const y = r.target;
|
|
1963
|
-
y && ((d = u.value) != null && d.contains(y) || (
|
|
1982
|
+
y && ((d = u.value) != null && d.contains(y) || (L = E.value) != null && L.contains(y)) || k();
|
|
1964
1983
|
}
|
|
1965
|
-
function
|
|
1984
|
+
function ce(r) {
|
|
1966
1985
|
const y = E.value, d = r.target;
|
|
1967
1986
|
if (y && d && d !== document && y.contains(d)) return;
|
|
1968
|
-
const
|
|
1969
|
-
if (!
|
|
1970
|
-
const
|
|
1971
|
-
if (
|
|
1972
|
-
|
|
1987
|
+
const L = v.value;
|
|
1988
|
+
if (!L) return;
|
|
1989
|
+
const T = L.getBoundingClientRect(), q = window.innerHeight || document.documentElement.clientHeight;
|
|
1990
|
+
if (T.bottom < 0 || T.top > q) {
|
|
1991
|
+
k();
|
|
1973
1992
|
return;
|
|
1974
1993
|
}
|
|
1975
1994
|
Z();
|
|
1976
1995
|
}
|
|
1977
|
-
function
|
|
1978
|
-
document.addEventListener("click",
|
|
1996
|
+
function h() {
|
|
1997
|
+
document.addEventListener("click", de), document.addEventListener("scroll", ce, !0), window.addEventListener("resize", k);
|
|
1979
1998
|
}
|
|
1980
|
-
function
|
|
1981
|
-
document.removeEventListener("click",
|
|
1999
|
+
function b() {
|
|
2000
|
+
document.removeEventListener("click", de), document.removeEventListener("scroll", ce, !0), window.removeEventListener("resize", k);
|
|
1982
2001
|
}
|
|
1983
|
-
async function
|
|
2002
|
+
async function H() {
|
|
1984
2003
|
var r, y, d;
|
|
1985
|
-
t.disabled || l.value || (
|
|
2004
|
+
t.disabled || l.value || (I.value = "", l.value = !0, await be(), Z(), (r = R.value) == null || r.focus(), (d = (y = E.value) == null ? void 0 : y.querySelector(".fx-opt.is-on")) == null || d.scrollIntoView({ block: "nearest" }), h());
|
|
1986
2005
|
}
|
|
1987
|
-
function
|
|
1988
|
-
l.value && (l.value = !1,
|
|
2006
|
+
function k() {
|
|
2007
|
+
l.value && (l.value = !1, I.value = "", b());
|
|
1989
2008
|
}
|
|
1990
|
-
Ie(
|
|
2009
|
+
Ie(I, async () => {
|
|
1991
2010
|
l.value && (await be(), Z());
|
|
1992
2011
|
});
|
|
1993
|
-
function
|
|
2012
|
+
function U(r) {
|
|
1994
2013
|
var y;
|
|
1995
2014
|
if (r.key === "Escape")
|
|
1996
|
-
r.preventDefault(),
|
|
2015
|
+
r.preventDefault(), k(), (y = v.value) == null || y.focus();
|
|
1997
2016
|
else if (r.key === "Enter") {
|
|
1998
2017
|
r.preventDefault();
|
|
1999
|
-
const d = X.value.find((
|
|
2000
|
-
d &&
|
|
2018
|
+
const d = X.value.find((L) => !L.disabled);
|
|
2019
|
+
d && ye(d);
|
|
2001
2020
|
}
|
|
2002
2021
|
}
|
|
2003
|
-
function
|
|
2004
|
-
l.value ?
|
|
2022
|
+
function P() {
|
|
2023
|
+
l.value ? k() : H();
|
|
2005
2024
|
}
|
|
2006
|
-
function
|
|
2025
|
+
function ye(r) {
|
|
2007
2026
|
if (!r.disabled) {
|
|
2008
2027
|
if (t.multiple && !r.command) {
|
|
2009
2028
|
n("toggle", r.value);
|
|
2010
2029
|
return;
|
|
2011
2030
|
}
|
|
2012
|
-
if (
|
|
2031
|
+
if (k(), t.multiple) {
|
|
2013
2032
|
n("update:modelValue", r.value);
|
|
2014
2033
|
return;
|
|
2015
2034
|
}
|
|
2016
2035
|
r.value !== t.modelValue && n("update:modelValue", r.value);
|
|
2017
2036
|
}
|
|
2018
2037
|
}
|
|
2019
|
-
const
|
|
2020
|
-
function
|
|
2021
|
-
const y =
|
|
2038
|
+
const na = Y(() => t.options.filter((r) => !r.disabled));
|
|
2039
|
+
function oa(r) {
|
|
2040
|
+
const y = na.value;
|
|
2022
2041
|
if (t.multiple || !y.length) {
|
|
2023
|
-
|
|
2042
|
+
H();
|
|
2024
2043
|
return;
|
|
2025
2044
|
}
|
|
2026
|
-
const d = y.findIndex((q) => q.value === t.modelValue),
|
|
2027
|
-
|
|
2045
|
+
const d = y.findIndex((q) => q.value === t.modelValue), L = r === "Home" ? 0 : r === "End" ? y.length - 1 : r === "ArrowDown" ? Math.min(y.length - 1, (d < 0 ? -1 : d) + 1) : Math.max(0, (d < 0 ? 1 : d) - 1), T = y[L];
|
|
2046
|
+
T && T.value !== t.modelValue ? n("update:modelValue", T.value) : H();
|
|
2028
2047
|
}
|
|
2029
|
-
function
|
|
2048
|
+
function sa(r) {
|
|
2030
2049
|
var y;
|
|
2031
2050
|
if (r.key === "Escape") {
|
|
2032
2051
|
if (!l.value) return;
|
|
2033
|
-
r.preventDefault(),
|
|
2052
|
+
r.preventDefault(), k(), (y = v.value) == null || y.focus();
|
|
2034
2053
|
return;
|
|
2035
2054
|
}
|
|
2036
2055
|
if (r.key === "Enter" || r.key === " ") {
|
|
2037
|
-
r.preventDefault(),
|
|
2056
|
+
r.preventDefault(), P();
|
|
2038
2057
|
return;
|
|
2039
2058
|
}
|
|
2040
|
-
r.key !== "ArrowDown" && r.key !== "ArrowUp" && r.key !== "Home" && r.key !== "End" || (r.preventDefault(),
|
|
2059
|
+
r.key !== "ArrowDown" && r.key !== "ArrowUp" && r.key !== "Home" && r.key !== "End" || (r.preventDefault(), oa(r.key));
|
|
2041
2060
|
}
|
|
2042
|
-
return Le(
|
|
2061
|
+
return Le(b), (r, y) => (N(), C("div", {
|
|
2043
2062
|
ref_key: "rootEl",
|
|
2044
2063
|
ref: u,
|
|
2045
|
-
class:
|
|
2064
|
+
class: fe(["fx-sel", o.value])
|
|
2046
2065
|
}, [
|
|
2047
|
-
|
|
2066
|
+
x("button", ca({
|
|
2048
2067
|
ref_key: "btnEl",
|
|
2049
|
-
ref:
|
|
2068
|
+
ref: v
|
|
2050
2069
|
}, r.$attrs, {
|
|
2051
2070
|
type: "button",
|
|
2052
2071
|
class: ["sch-input fx-btn", { "is-open": l.value }],
|
|
2053
2072
|
disabled: e.disabled,
|
|
2054
2073
|
"aria-haspopup": "listbox",
|
|
2055
2074
|
"aria-expanded": l.value,
|
|
2056
|
-
onClick: y[0] || (y[0] = (d) =>
|
|
2057
|
-
onKeydown:
|
|
2058
|
-
}),
|
|
2059
|
-
|
|
2075
|
+
onClick: y[0] || (y[0] = (d) => P()),
|
|
2076
|
+
onKeydown: sa
|
|
2077
|
+
}), [
|
|
2078
|
+
x("span", Sn, W(Q.value), 1)
|
|
2079
|
+
], 16, Mn),
|
|
2080
|
+
(N(), da(ya, {
|
|
2060
2081
|
to: "body",
|
|
2061
|
-
disabled:
|
|
2082
|
+
disabled: !$.value
|
|
2062
2083
|
}, [
|
|
2063
|
-
|
|
2064
|
-
l.value ? (N(),
|
|
2084
|
+
x("div", Ln, [
|
|
2085
|
+
l.value ? (N(), C("div", {
|
|
2065
2086
|
key: 0,
|
|
2066
2087
|
ref_key: "popEl",
|
|
2067
2088
|
ref: E,
|
|
2068
|
-
class:
|
|
2089
|
+
class: fe(["fx-pop", { "fx-pop-rich": w.value }]),
|
|
2069
2090
|
role: "listbox",
|
|
2070
2091
|
"aria-multiselectable": e.multiple || void 0,
|
|
2071
2092
|
style: { visibility: "hidden" }
|
|
2072
2093
|
}, [
|
|
2073
|
-
e.menuTitle ? (N(),
|
|
2074
|
-
e.searchable ? (N(),
|
|
2075
|
-
|
|
2094
|
+
e.menuTitle ? (N(), C("div", Rn, W(e.menuTitle), 1)) : z("", !0),
|
|
2095
|
+
e.searchable ? (N(), C("div", On, [
|
|
2096
|
+
ma(x("input", {
|
|
2076
2097
|
ref_key: "searchEl",
|
|
2077
|
-
ref:
|
|
2078
|
-
"onUpdate:modelValue": y[1] || (y[1] = (d) =>
|
|
2098
|
+
ref: R,
|
|
2099
|
+
"onUpdate:modelValue": y[1] || (y[1] = (d) => I.value = d),
|
|
2079
2100
|
class: "sch-input fx-pop-q",
|
|
2080
2101
|
type: "search",
|
|
2081
2102
|
placeholder: "Search",
|
|
2082
2103
|
autocomplete: "off",
|
|
2083
2104
|
spellcheck: "false",
|
|
2084
2105
|
"aria-label": "Search",
|
|
2085
|
-
onKeydown:
|
|
2106
|
+
onKeydown: U
|
|
2086
2107
|
}, null, 544), [
|
|
2087
|
-
[
|
|
2108
|
+
[pa, I.value]
|
|
2088
2109
|
])
|
|
2089
|
-
])) :
|
|
2090
|
-
e.searchable && !J.value.length ? (N(),
|
|
2091
|
-
(N(!0),
|
|
2110
|
+
])) : z("", !0),
|
|
2111
|
+
e.searchable && !J.value.length ? (N(), C("div", Tn, "No matches")) : z("", !0),
|
|
2112
|
+
(N(!0), C(He, null, fa(J.value, (d) => (N(), C(He, {
|
|
2092
2113
|
key: "heading" in d ? `heading:${d.heading}` : `option:${d.option.value}`
|
|
2093
2114
|
}, [
|
|
2094
|
-
"heading" in d ? (N(),
|
|
2115
|
+
"heading" in d ? (N(), C("div", $n, W(d.heading), 1)) : (N(), C("div", {
|
|
2095
2116
|
key: 1,
|
|
2096
|
-
class:
|
|
2117
|
+
class: fe(["fx-opt", {
|
|
2097
2118
|
"is-on": p(d.option),
|
|
2098
2119
|
"is-off": d.option.disabled,
|
|
2099
2120
|
"is-new": d.option.command
|
|
2100
2121
|
}]),
|
|
2101
2122
|
role: "option",
|
|
2102
2123
|
"aria-selected": p(d.option),
|
|
2103
|
-
onClick: (
|
|
2124
|
+
onClick: (L) => ye(d.option)
|
|
2104
2125
|
}, [
|
|
2105
|
-
y[2] || (y[2] =
|
|
2126
|
+
y[2] || (y[2] = x("span", {
|
|
2106
2127
|
class: "fx-tick",
|
|
2107
2128
|
"aria-hidden": "true"
|
|
2108
2129
|
}, [
|
|
2109
|
-
|
|
2130
|
+
x("svg", {
|
|
2110
2131
|
width: "11",
|
|
2111
2132
|
height: "11",
|
|
2112
2133
|
viewBox: "0 0 16 16",
|
|
2113
2134
|
fill: "none"
|
|
2114
2135
|
}, [
|
|
2115
|
-
|
|
2136
|
+
x("path", {
|
|
2116
2137
|
d: "m3.5 8.4 3 3 6-7",
|
|
2117
2138
|
stroke: "currentColor",
|
|
2118
2139
|
"stroke-width": "2.2",
|
|
@@ -2121,20 +2142,20 @@ const kn = ["data-hierarchy", "data-size", "data-icon"], xo = /* @__PURE__ */ Re
|
|
|
2121
2142
|
})
|
|
2122
2143
|
])
|
|
2123
2144
|
], -1)),
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
d.option.hint ? (N(),
|
|
2127
|
-
])) : (N(),
|
|
2128
|
-
|
|
2145
|
+
w.value ? (N(), C("span", Yn, [
|
|
2146
|
+
x("b", null, W(d.option.label), 1),
|
|
2147
|
+
d.option.hint ? (N(), C("small", Bn, W(d.option.hint), 1)) : z("", !0)
|
|
2148
|
+
])) : (N(), C(He, { key: 1 }, [
|
|
2149
|
+
ha(W(d.option.label), 1)
|
|
2129
2150
|
], 64))
|
|
2130
|
-
], 10,
|
|
2151
|
+
], 10, xn))
|
|
2131
2152
|
], 64))), 128))
|
|
2132
|
-
], 10,
|
|
2153
|
+
], 10, In)) : z("", !0)
|
|
2133
2154
|
])
|
|
2134
2155
|
], 8, ["disabled"]))
|
|
2135
2156
|
], 2));
|
|
2136
2157
|
}
|
|
2137
|
-
}),
|
|
2158
|
+
}), _n = ["id", "aria-labelledby", "aria-label"], We = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])', Wo = /* @__PURE__ */ Re({
|
|
2138
2159
|
__name: "ScheduleModal",
|
|
2139
2160
|
props: {
|
|
2140
2161
|
open: { type: Boolean },
|
|
@@ -2147,44 +2168,44 @@ const kn = ["data-hierarchy", "data-size", "data-icon"], xo = /* @__PURE__ */ Re
|
|
|
2147
2168
|
emits: ["close"],
|
|
2148
2169
|
setup(e, { emit: a }) {
|
|
2149
2170
|
const t = e, n = a, i = A(null);
|
|
2150
|
-
let
|
|
2171
|
+
let o = null;
|
|
2151
2172
|
function l() {
|
|
2152
2173
|
be(() => {
|
|
2153
2174
|
const u = i.value;
|
|
2154
2175
|
u && (u.querySelector(We) ?? u).focus();
|
|
2155
2176
|
});
|
|
2156
2177
|
}
|
|
2157
|
-
function
|
|
2178
|
+
function s(u) {
|
|
2158
2179
|
if (!t.open) return;
|
|
2159
2180
|
if (u.key === "Escape") {
|
|
2160
2181
|
u.preventDefault(), n("close");
|
|
2161
2182
|
return;
|
|
2162
2183
|
}
|
|
2163
2184
|
if (u.key !== "Tab" || !i.value) return;
|
|
2164
|
-
const
|
|
2165
|
-
if (!
|
|
2166
|
-
const E =
|
|
2167
|
-
u.shiftKey && document.activeElement === E ? (u.preventDefault(),
|
|
2185
|
+
const v = Array.from(i.value.querySelectorAll(We));
|
|
2186
|
+
if (!v.length) return;
|
|
2187
|
+
const E = v[0], $ = v[v.length - 1];
|
|
2188
|
+
u.shiftKey && document.activeElement === E ? (u.preventDefault(), $.focus()) : !u.shiftKey && document.activeElement === $ && (u.preventDefault(), E.focus());
|
|
2168
2189
|
}
|
|
2169
2190
|
return Ie(
|
|
2170
2191
|
() => t.open,
|
|
2171
2192
|
(u) => {
|
|
2172
|
-
u ? (
|
|
2193
|
+
u ? (o = document.activeElement instanceof HTMLElement ? document.activeElement : null, l()) : (o == null || o.focus(), o = null);
|
|
2173
2194
|
},
|
|
2174
2195
|
{ immediate: !0 }
|
|
2175
|
-
), Se(() => document.addEventListener("keydown",
|
|
2176
|
-
document.removeEventListener("keydown",
|
|
2177
|
-
}), (u,
|
|
2196
|
+
), Se(() => document.addEventListener("keydown", s)), Le(() => {
|
|
2197
|
+
document.removeEventListener("keydown", s), o = null;
|
|
2198
|
+
}), (u, v) => e.open ? (N(), C("div", {
|
|
2178
2199
|
key: 0,
|
|
2179
2200
|
class: "modal-overlay open",
|
|
2180
|
-
onClick:
|
|
2201
|
+
onClick: v[0] || (v[0] = va((E) => n("close"), ["self"]))
|
|
2181
2202
|
}, [
|
|
2182
|
-
|
|
2203
|
+
x("div", {
|
|
2183
2204
|
id: e.id,
|
|
2184
2205
|
ref_key: "panel",
|
|
2185
2206
|
ref: i,
|
|
2186
|
-
class:
|
|
2187
|
-
style:
|
|
2207
|
+
class: fe(["schedule-modal-panel", e.panelClass]),
|
|
2208
|
+
style: ga(e.panelStyle),
|
|
2188
2209
|
role: "dialog",
|
|
2189
2210
|
"aria-modal": "true",
|
|
2190
2211
|
"aria-labelledby": e.labelledBy,
|
|
@@ -2192,97 +2213,99 @@ const kn = ["data-hierarchy", "data-size", "data-icon"], xo = /* @__PURE__ */ Re
|
|
|
2192
2213
|
tabindex: "-1"
|
|
2193
2214
|
}, [
|
|
2194
2215
|
ze(u.$slots, "default")
|
|
2195
|
-
], 14,
|
|
2196
|
-
])) :
|
|
2216
|
+
], 14, _n)
|
|
2217
|
+
])) : z("", !0);
|
|
2197
2218
|
}
|
|
2198
2219
|
});
|
|
2199
2220
|
export {
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
+
le as $,
|
|
2222
|
+
Co as A,
|
|
2223
|
+
Ge as B,
|
|
2224
|
+
Zn as C,
|
|
2225
|
+
Ne as D,
|
|
2226
|
+
ba as E,
|
|
2227
|
+
eo as F,
|
|
2228
|
+
uo as G,
|
|
2229
|
+
Io as H,
|
|
2230
|
+
Aa as I,
|
|
2231
|
+
bo as J,
|
|
2232
|
+
Eo as K,
|
|
2233
|
+
Ao as L,
|
|
2234
|
+
Je as M,
|
|
2235
|
+
D as N,
|
|
2236
|
+
F as O,
|
|
2237
|
+
Na as P,
|
|
2238
|
+
La as Q,
|
|
2239
|
+
Jn as R,
|
|
2240
|
+
Mo as S,
|
|
2241
|
+
Ye as T,
|
|
2221
2242
|
aa as U,
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2243
|
+
Oo as V,
|
|
2244
|
+
ko as W,
|
|
2245
|
+
qn as X,
|
|
2246
|
+
ue as Y,
|
|
2247
|
+
se as Z,
|
|
2248
|
+
Nn as _,
|
|
2249
|
+
xo as a,
|
|
2250
|
+
ne as a0,
|
|
2251
|
+
so as a1,
|
|
2252
|
+
ro as a2,
|
|
2253
|
+
Oe as a3,
|
|
2254
|
+
oo as a4,
|
|
2255
|
+
no as a5,
|
|
2256
|
+
lo as a6,
|
|
2257
|
+
vn as a7,
|
|
2258
|
+
re as a8,
|
|
2259
|
+
Do as a9,
|
|
2260
|
+
vo as aa,
|
|
2261
|
+
go as ab,
|
|
2262
|
+
Ro as ac,
|
|
2263
|
+
Ta as ad,
|
|
2264
|
+
ho as ae,
|
|
2265
|
+
ka as af,
|
|
2266
|
+
Gn as ag,
|
|
2267
|
+
xa as ah,
|
|
2268
|
+
$e as ai,
|
|
2269
|
+
Bo as aj,
|
|
2270
|
+
pn as ak,
|
|
2271
|
+
fo as al,
|
|
2272
|
+
xe as am,
|
|
2273
|
+
he as an,
|
|
2274
|
+
Me as ao,
|
|
2275
|
+
Ia as ap,
|
|
2276
|
+
Fo as aq,
|
|
2277
|
+
Uo as ar,
|
|
2278
|
+
Wo as as,
|
|
2279
|
+
B as at,
|
|
2280
|
+
Kn as au,
|
|
2281
|
+
_o as av,
|
|
2282
|
+
mo as aw,
|
|
2283
|
+
co as ax,
|
|
2284
|
+
ie as ay,
|
|
2285
|
+
yo as az,
|
|
2286
|
+
M as b,
|
|
2287
|
+
Yo as c,
|
|
2288
|
+
K as d,
|
|
2289
|
+
Qn as e,
|
|
2267
2290
|
c as f,
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2291
|
+
yn as g,
|
|
2292
|
+
No as h,
|
|
2293
|
+
Ma as i,
|
|
2294
|
+
po as j,
|
|
2295
|
+
To as k,
|
|
2296
|
+
wo as l,
|
|
2297
|
+
Ho as m,
|
|
2298
|
+
Po as n,
|
|
2276
2299
|
m as o,
|
|
2277
|
-
|
|
2300
|
+
So as p,
|
|
2278
2301
|
Ce as q,
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2302
|
+
io as r,
|
|
2303
|
+
Ea as s,
|
|
2304
|
+
to as t,
|
|
2305
|
+
Lo as u,
|
|
2306
|
+
ke as v,
|
|
2307
|
+
ao as w,
|
|
2308
|
+
Xn as x,
|
|
2309
|
+
$o as y,
|
|
2310
|
+
jn as z
|
|
2288
2311
|
};
|