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