@feedmepos/mf-hrm-portal 2.3.0-dev.13 → 2.3.0-dev.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/dist/{ApprovalCodeList-D3egZFML.js → ApprovalCodeList-CY0ox1dX.js} +4 -4
  2. package/dist/{AuditLogList-BzbaEsSj.js → AuditLogList-CBkA-KQT.js} +17 -18
  3. package/dist/{ConditionBuilderForm.vue_vue_type_script_setup_true_lang-Do52KbKm.js → ConditionBuilderForm.vue_vue_type_script_setup_true_lang-B8cb8yqV.js} +2 -2
  4. package/dist/{EmployeeList-BiM8dRwZ.js → EmployeeList-0PrcuHPJ.js} +255 -267
  5. package/dist/{FormItem.vue_vue_type_script_setup_true_lang-CUnlKsxk.js → FormItem.vue_vue_type_script_setup_true_lang-rjDE1B4E.js} +6 -6
  6. package/dist/{GrantUserList-Dj2ms20E.js → GrantUserList-Dw923P2j.js} +5 -5
  7. package/dist/{Main-DmpwTPaI.js → Main-BqX7n1ik.js} +9 -9
  8. package/dist/{Main-C2z7Jf9A.js → Main-C0bcn2NY.js} +5 -5
  9. package/dist/{Main-DklZWoKj.js → Main-Dpf2KdSH.js} +2 -2
  10. package/dist/{PermissionSetList-C-qgCcRO.js → PermissionSetList-xrI130SW.js} +5 -5
  11. package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-ggZB5zWW.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-3_8qycrF.js} +465 -465
  12. package/dist/{RoleList-ohfin77B.js → RoleList-DPkG5dg9.js} +7 -7
  13. package/dist/ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-DYLLW46A.js +501 -0
  14. package/dist/{ScheduleGeneralPage-aCljFf21.js → ScheduleGeneralPage-CISbuAff.js} +141 -143
  15. package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-x_-BYkcc.js → ScheduleModal.vue_vue_type_script_setup_true_lang-BeTuMw3f.js} +989 -858
  16. package/dist/SchedulePage-Dn6_TiBS.js +18757 -0
  17. package/dist/{SchedulePositionPage-CID91orD.js → SchedulePositionPage-Cu3WRfH-.js} +79 -81
  18. package/dist/{SelectFilter-CG13h83-.js → SelectFilter-ssnRUIN6.js} +1 -1
  19. package/dist/{TeamMemberList-DJIKL4dE.js → TeamMemberList-DTqNCDJb.js} +35 -36
  20. package/dist/{TimesheetList-BPXWPNfT.js → TimesheetList-CA19TmKm.js} +52 -53
  21. package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-DVcV0knM.js → TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-B1jnsZpD.js} +2 -2
  22. package/dist/{app-Bz8568j8.js → app-3xGY2Rn0.js} +2062 -1800
  23. package/dist/app.js +1 -1
  24. package/dist/{dayjs.min-DhSRKSu4.js → dayjs.min-C_c8OoEU.js} +1 -1
  25. package/dist/{employee-BM44u8b-.js → employee-Dt0y51t3.js} +3 -3
  26. package/dist/{iteration-BHDxs89d.js → iteration-C4YvbrCe.js} +1 -1
  27. package/dist/{lodash-DgSYLwYD.js → lodash-huRs3Cbj.js} +1 -1
  28. package/dist/object-Dwyg2LgX.js +16 -0
  29. package/dist/{role-BMJ7LEHN.js → role-fM58UmtC.js} +1 -1
  30. package/dist/{rule-CCo7_ckA.js → rule-CCN0QCPF.js} +2 -2
  31. package/dist/src/views/audit-log/locales/index.d.ts +252 -0
  32. package/dist/src/views/scheduling/components/ScheduleAreaRows.vue.d.ts +2 -0
  33. package/dist/src/views/scheduling/components/ScheduleBoardAreaRows.vue.d.ts +1 -0
  34. package/dist/src/views/scheduling/components/ScheduleOnboardingSettings.vue.d.ts +6 -0
  35. package/dist/src/views/scheduling/composables/onboarding-types.d.ts +2 -1
  36. package/dist/src/views/scheduling/composables/schedule-demand-domain.d.ts +13 -1
  37. package/dist/src/views/scheduling/composables/schedule-error.d.ts +3 -0
  38. package/dist/src/views/scheduling/composables/schedule-quick-pick.d.ts +22 -0
  39. package/dist/src/views/scheduling/composables/useScheduleAddEmployee.d.ts +5 -2
  40. package/dist/src/views/scheduling/composables/useScheduleAddPick.d.ts +3 -11
  41. package/dist/src/views/scheduling/composables/useScheduleAutoSchedule.d.ts +7 -0
  42. package/dist/src/views/scheduling/composables/useScheduleBoard.d.ts +45 -1
  43. package/dist/src/views/scheduling/composables/useScheduleCostRail.d.ts +13 -1
  44. package/dist/src/views/scheduling/composables/useScheduleDayTimeline.d.ts +2 -2
  45. package/dist/src/views/scheduling/composables/useScheduleDragDrop.d.ts +1 -0
  46. package/dist/src/views/scheduling/composables/useScheduleEmployeeAccess.d.ts +14 -6
  47. package/dist/src/views/scheduling/composables/useScheduleEmployeeCandidates.d.ts +3 -0
  48. package/dist/src/views/scheduling/composables/useScheduleEmployeeValidation.d.ts +0 -2
  49. package/dist/src/views/scheduling/composables/useScheduleOnboardingEmployees.d.ts +25 -0
  50. package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +163 -4
  51. package/dist/src/views/scheduling/composables/useScheduleRoster.d.ts +44 -0
  52. package/dist/src/views/scheduling/composables/useScheduleSetupBanner.d.ts +2 -2
  53. package/dist/src/views/scheduling/composables/useScheduleShiftActions.d.ts +22 -0
  54. package/dist/src/views/scheduling/composables/useScheduleShiftPopover.d.ts +26 -2
  55. package/dist/src/views/scheduling/country-rules/index.d.ts +8 -3
  56. package/dist/src/views/scheduling/data.d.ts +17 -0
  57. package/dist/src/views/scheduling/schedule-store.d.ts +7 -7
  58. package/dist/src/views/scheduling/types.d.ts +5 -0
  59. package/dist/style.css +1 -1
  60. package/dist/tsconfig.app.tsbuildinfo +1 -1
  61. package/dist/{useReportPermissions-C_Cd__n1.js → useReportPermissions-BlX_Mk5f.js} +3 -3
  62. package/package.json +1 -1
  63. package/dist/ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-diuWysro.js +0 -492
  64. package/dist/SchedulePage-DdMHF6kX.js +0 -17993
  65. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
@@ -1,16 +1,16 @@
1
1
  import { computed as y, defineComponent as Pe, ref as V, watch as le, onMounted as Me, resolveComponent as F, createBlock as M, openBlock as v, unref as o, withCtx as g, createElementVNode as u, createVNode as c, createElementBlock as R, Fragment as P, createCommentVNode as _e, renderList as ne, normalizeClass as Ue, toDisplayString as $, h as A, createTextVNode as ge, resolveDynamicComponent as Ee, withModifiers as Ze, nextTick as De } from "vue";
2
- import { e as D } from "./iteration-BHDxs89d.js";
2
+ import { e as D } from "./iteration-C4YvbrCe.js";
3
3
  import { useI18n as Te } from "@feedmepos/mf-common";
4
4
  import { useBreakpoints as Be, useSnackbar as je, components as ye, useDialog as es, FmButtonColorThemeVariant as ss } from "@feedmepos/ui-library";
5
- import { D as ts, k as as, A as ls, S as os, _ as rs } from "./app-Bz8568j8.js";
5
+ import { D as ts, k as as, A as ls, S as os, _ as rs } from "./app-3xGY2Rn0.js";
6
6
  import { _ as $e } from "./ResponsiveContextMenu.vue_vue_type_script_setup_true_lang-mSJFKo7r.js";
7
7
  import { _ as ns } from "./TableEmptyState.vue_vue_type_script_setup_true_lang-IfAZmWr0.js";
8
- import { r as ie, h as Ae, f as is, s as us, g as Ie, e as cs, a as oe } from "./rule-CCo7_ckA.js";
8
+ import { r as ie, h as Ae, f as is, s as us, g as Ie, e as cs, a as oe } from "./rule-CCN0QCPF.js";
9
9
  import { u as xe } from "./restaurant-BbYRA_IT.js";
10
- import { u as Oe } from "./role-BMJ7LEHN.js";
11
- import { u as Ne } from "./useReportPermissions-C_Cd__n1.js";
12
- import { l as re } from "./lodash-DgSYLwYD.js";
13
- import { u as ms, _ as ds, a as Le } from "./ConditionBuilderForm.vue_vue_type_script_setup_true_lang-Do52KbKm.js";
10
+ import { u as Oe } from "./role-fM58UmtC.js";
11
+ import { u as Ne } from "./useReportPermissions-BlX_Mk5f.js";
12
+ import { l as re } from "./lodash-huRs3Cbj.js";
13
+ import { u as ms, _ as ds, a as Le } from "./ConditionBuilderForm.vue_vue_type_script_setup_true_lang-B8cb8yqV.js";
14
14
  import { _ as be } from "./FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js";
15
15
  import { u as ps } from "./useDiscardConfirm-CzZSPyvh.js";
16
16
  import { u as fs } from "./useLoading-Ch1AUYT1.js";
@@ -0,0 +1,501 @@
1
+ import { ref as h, watch as ne, computed as S, reactive as Ie, nextTick as be, defineComponent as Pe, createBlock as Q, openBlock as b, withCtx as C, createElementVNode as n, createVNode as R, toDisplayString as f, unref as q, createElementBlock as N, withDirectives as se, withKeys as we, vModelText as oe, normalizeClass as ie, createTextVNode as M, createCommentVNode as G, Fragment as de, renderList as Ne } from "vue";
2
+ import { au as X, p as z, ax as $e, ay as me, az as pe, u as Ce, aA as Se, I as W, e as H, at as Ae, ar as O } from "./ScheduleModal.vue_vue_type_script_setup_true_lang-BeTuMw3f.js";
3
+ import { useI18n as Ee } from "@feedmepos/mf-common";
4
+ function ue() {
5
+ return X.map((e) => ({ id: e.id, name: e.name }));
6
+ }
7
+ function ta(e = {}) {
8
+ const s = h(ue());
9
+ ne(
10
+ () => X.map((i) => `${i.id}:${i.name}`).join(" "),
11
+ () => {
12
+ s.value = ue();
13
+ }
14
+ ), ne(
15
+ () => {
16
+ var i;
17
+ return (((i = z.value) == null ? void 0 : i.positions) ?? []).map((m) => `${m.id}:${m.name}`).join(" ");
18
+ },
19
+ () => {
20
+ var i;
21
+ s.value = (((i = z.value) == null ? void 0 : i.positions) ?? []).map((m) => ({ id: m.id, name: m.name }));
22
+ }
23
+ );
24
+ const g = h(!1), a = h(""), t = h(null), c = h(!1), k = h(null);
25
+ function A(i) {
26
+ var m;
27
+ return (((m = z.value) == null ? void 0 : m.employees) ?? []).filter(
28
+ (P) => {
29
+ var I;
30
+ return ((I = P.primaryPosition) == null ? void 0 : I.positionId) === i || P.secondaryPositions.some((V) => V.positionId === i);
31
+ }
32
+ ).length;
33
+ }
34
+ function j(i) {
35
+ return s.value.some((m) => m.name.toLowerCase() === i.toLowerCase());
36
+ }
37
+ function F() {
38
+ g.value = !0, a.value = "", t.value = null, k.value = null;
39
+ }
40
+ function $() {
41
+ g.value = !1, a.value = "";
42
+ }
43
+ async function D() {
44
+ var m, P;
45
+ const i = a.value.trim().slice(0, 40);
46
+ if (!(!i || j(i))) {
47
+ c.value = !0, k.value = null;
48
+ try {
49
+ await me({ name: i }), g.value = !1, a.value = "", (m = e.notify) == null || m.call(e, "Position added", "success");
50
+ } catch (I) {
51
+ k.value = I instanceof Error ? I.message : "Could not add this position", (P = e.notify) == null || P.call(e, k.value, "error");
52
+ } finally {
53
+ c.value = !1;
54
+ }
55
+ }
56
+ }
57
+ function E(i) {
58
+ t.value = i;
59
+ }
60
+ function p() {
61
+ t.value = null;
62
+ }
63
+ async function L(i) {
64
+ var m, P;
65
+ c.value = !0, k.value = null;
66
+ try {
67
+ await $e(i), s.value = s.value.filter((I) => I.id !== i), t.value = null, (m = e.notify) == null || m.call(e, "Position removed", "success");
68
+ } catch (I) {
69
+ k.value = I instanceof Error ? I.message : "Could not delete this position", (P = e.notify) == null || P.call(e, k.value, "error");
70
+ } finally {
71
+ c.value = !1;
72
+ }
73
+ }
74
+ const J = S(() => s.value.length);
75
+ return {
76
+ positions: s,
77
+ count: J,
78
+ isAdding: g,
79
+ newName: a,
80
+ pendingDeleteId: t,
81
+ saving: c,
82
+ error: k,
83
+ usageCountFor: A,
84
+ startAdd: F,
85
+ cancelAdd: $,
86
+ confirmAdd: D,
87
+ askDelete: E,
88
+ cancelDelete: p,
89
+ confirmDelete: L
90
+ };
91
+ }
92
+ function xe(e) {
93
+ var g;
94
+ const s = e.trim().split(/\s+/).filter(Boolean);
95
+ return s.length ? (s[0][0] + (((g = s[1]) == null ? void 0 : g[0]) ?? "")).toUpperCase() : "??";
96
+ }
97
+ function na(e, s = {}) {
98
+ const g = h(!1), a = h(""), t = h(""), c = Ie({}), k = h(!1), A = h(null), j = h(null), F = h(!1), $ = h(null);
99
+ let D = "", E = /* @__PURE__ */ new Set();
100
+ const p = S(() => {
101
+ var r;
102
+ const l = new Map((((r = z.value) == null ? void 0 : r.employees) ?? []).map((v) => [v.employeeId, v]));
103
+ return pe.value.map((v) => {
104
+ var T;
105
+ const d = l.get(v._id), x = [d == null ? void 0 : d.primaryPosition, ...(d == null ? void 0 : d.secondaryPositions) ?? []].map((o) => Ce(o)).filter((o) => !!o), u = [
106
+ (T = d == null ? void 0 : d.primaryPosition) == null ? void 0 : T.positionId,
107
+ ...((d == null ? void 0 : d.secondaryPositions) ?? []).map((o) => o.positionId)
108
+ ].filter((o) => !!o);
109
+ return {
110
+ employeeId: v._id,
111
+ name: v.name,
112
+ initials: xe(v.name),
113
+ held: x,
114
+ heldPositionIds: u
115
+ };
116
+ });
117
+ }), L = S(() => {
118
+ const l = t.value.trim().toLowerCase();
119
+ return p.value.filter((r) => !l || r.name.toLowerCase().includes(l));
120
+ }), J = S(
121
+ () => p.value.filter((l) => c[l.employeeId]).map((l) => l.employeeId)
122
+ ), i = S(
123
+ () => L.value.length > 0 && L.value.every((l) => c[l.employeeId])
124
+ ), m = S(() => a.value.trim().slice(0, 40)), P = S(
125
+ () => !!m.value && X.some(
126
+ (l) => l.id !== $.value && l.name.toLowerCase() === m.value.toLowerCase()
127
+ )
128
+ ), I = S(() => !!m.value && !P.value && !k.value);
129
+ function V() {
130
+ a.value = "", t.value = "", Object.keys(c).forEach((l) => delete c[l]), A.value = null, F.value = !1, j.value = null, $.value = null, D = "", E = /* @__PURE__ */ new Set();
131
+ }
132
+ function ce() {
133
+ V(), g.value = !0;
134
+ }
135
+ function re(l, r) {
136
+ V(), $.value = l, a.value = r, D = r, E = new Set(
137
+ p.value.filter((v) => v.heldPositionIds.includes(l)).map((v) => v.employeeId)
138
+ ), E.forEach((v) => c[v] = !0), g.value = !0;
139
+ }
140
+ function ve() {
141
+ g.value = !1, V();
142
+ }
143
+ function ye(l) {
144
+ c[l] = !c[l];
145
+ }
146
+ function fe() {
147
+ if (i.value) {
148
+ Object.keys(c).forEach((l) => delete c[l]);
149
+ return;
150
+ }
151
+ L.value.forEach((l) => c[l.employeeId] = !0);
152
+ }
153
+ function Y(l, r) {
154
+ const v = !!(l != null && l.primaryPosition), d = ((l == null ? void 0 : l.secondaryPositions) ?? []).map((u) => ({
155
+ positionId: u.positionId,
156
+ positionName: u.positionName
157
+ })), x = v ? [...d, { positionName: r }] : d;
158
+ return {
159
+ ...v ? {} : { primaryPosition: H(r) },
160
+ secondaryPositions: x.map((u) => H(u.positionName, u.positionId)).filter((u) => !!u)
161
+ };
162
+ }
163
+ async function he() {
164
+ var x;
165
+ const l = m.value;
166
+ await me({ name: l }), await be(), e == null || e(l);
167
+ const r = p.value.filter((u) => c[u.employeeId]), d = (await Promise.allSettled(
168
+ r.map((u) => {
169
+ var o;
170
+ const T = (o = z.value) == null ? void 0 : o.employees.find((y) => y.employeeId === u.employeeId);
171
+ return W(u.employeeId, {
172
+ employeeName: u.name,
173
+ ...Y(T, l)
174
+ });
175
+ })
176
+ )).filter((u) => u.status === "rejected").length;
177
+ return j.value = { name: l, assigned: r.length - d, failed: d }, (x = s.notify) == null || x.call(
178
+ s,
179
+ d ? `Position added, but ${d} employee assignment${d === 1 ? "" : "s"} failed` : "Position added",
180
+ d ? "error" : "success"
181
+ ), !0;
182
+ }
183
+ async function ge(l) {
184
+ var T;
185
+ const r = m.value;
186
+ await Se(l, { name: r }), e == null || e(r);
187
+ const v = p.value.filter(
188
+ (o) => c[o.employeeId] && !E.has(o.employeeId)
189
+ ), d = p.value.filter(
190
+ (o) => !c[o.employeeId] && E.has(o.employeeId)
191
+ ), u = (await Promise.allSettled([
192
+ ...v.map((o) => {
193
+ var K;
194
+ const y = (K = z.value) == null ? void 0 : K.employees.find((U) => U.employeeId === o.employeeId);
195
+ return W(o.employeeId, {
196
+ employeeName: o.name,
197
+ ...Y(y, r)
198
+ });
199
+ }),
200
+ ...d.map((o) => {
201
+ var ee, ae, le, te;
202
+ const y = (ee = z.value) == null ? void 0 : ee.employees.find((w) => w.employeeId === o.employeeId), K = ((y == null ? void 0 : y.secondaryPositions) ?? []).filter(
203
+ (w) => w.positionId !== l && (w.positionId || w.positionName !== D)
204
+ ), U = ((ae = y == null ? void 0 : y.primaryPosition) == null ? void 0 : ae.positionId) === l || !((le = y == null ? void 0 : y.primaryPosition) != null && le.positionId) && ((te = y == null ? void 0 : y.primaryPosition) == null ? void 0 : te.positionName) === D, B = U ? K.shift() : void 0;
205
+ return W(o.employeeId, {
206
+ employeeName: o.name,
207
+ ...U ? {
208
+ primaryPosition: H(B == null ? void 0 : B.positionName, B == null ? void 0 : B.positionId) ?? null
209
+ } : {},
210
+ secondaryPositions: K.map((w) => H(w.positionName, w.positionId)).filter((w) => !!w)
211
+ });
212
+ })
213
+ ])).filter((o) => o.status === "rejected").length;
214
+ return j.value = { name: r, assigned: Math.max(0, v.length - u), failed: u }, (T = s.notify) == null || T.call(
215
+ s,
216
+ u ? `Position updated, but ${u} employee assignment${u === 1 ? "" : "s"} failed` : "Position updated",
217
+ u ? "error" : "success"
218
+ ), !0;
219
+ }
220
+ async function Z() {
221
+ var l;
222
+ if (!m.value)
223
+ return F.value = !0, !1;
224
+ if (!I.value) return !1;
225
+ k.value = !0, A.value = null;
226
+ try {
227
+ return await ($.value ? ge($.value) : he());
228
+ } catch (r) {
229
+ return A.value = r instanceof Error ? r.message : `Could not ${$.value ? "save" : "add"} this position`, (l = s.notify) == null || l.call(s, A.value, "error"), !1;
230
+ } finally {
231
+ k.value = !1;
232
+ }
233
+ }
234
+ function _() {
235
+ V();
236
+ }
237
+ async function ke() {
238
+ await Z() && _();
239
+ }
240
+ return {
241
+ open: g,
242
+ name: a,
243
+ search: t,
244
+ picks: c,
245
+ saving: k,
246
+ error: A,
247
+ done: j,
248
+ nameError: F,
249
+ people: p,
250
+ visible: L,
251
+ pickedIds: J,
252
+ allPicked: i,
253
+ nameTaken: P,
254
+ canSave: I,
255
+ editingId: $,
256
+ openNew: ce,
257
+ openEdit: re,
258
+ close: ve,
259
+ toggle: ye,
260
+ toggleAll: fe,
261
+ save: Z,
262
+ saveAndAnother: ke,
263
+ another: _
264
+ };
265
+ }
266
+ const Te = { class: "am-head" }, Me = {
267
+ id: "schedule-position-title",
268
+ class: "am-title"
269
+ }, Oe = { class: "ce-body" }, ze = { key: 0 }, je = { class: "ce-field" }, De = {
270
+ class: "ce-field asg-field",
271
+ style: { "margin-bottom": "0" }
272
+ }, Le = { class: "asg-head" }, Ve = { class: "asg-count" }, Be = { class: "asg-list position-asg-list" }, Fe = ["checked", "onChange"], Ke = { class: "asg-av" }, Re = { class: "asg-id" }, Ue = ["title"], qe = { class: "asg-sub" }, Ge = { key: 1 }, He = {
273
+ key: 0,
274
+ class: "asg-sub",
275
+ style: { padding: "10px" }
276
+ }, Je = { key: 1 }, Qe = { class: "cg-done" }, We = { class: "cg-st-main" }, Xe = {
277
+ key: 0,
278
+ class: "cg-done-also"
279
+ }, Ye = { class: "am-foot" }, Ze = {
280
+ key: 0,
281
+ class: "am-foot-btns"
282
+ }, _e = {
283
+ key: 1,
284
+ class: "am-foot-btns"
285
+ }, sa = /* @__PURE__ */ Pe({
286
+ __name: "ScheduleAddPositionModal",
287
+ props: {
288
+ modal: {}
289
+ },
290
+ setup(e) {
291
+ const { t: s } = Ee();
292
+ return (g, a) => (b(), Q(Ae, {
293
+ open: e.modal.open.value,
294
+ "panel-class": "ce-modal",
295
+ "panel-style": "width: min(480px, 95vw)",
296
+ "labelled-by": "schedule-position-title",
297
+ onClose: a[11] || (a[11] = (t) => e.modal.close())
298
+ }, {
299
+ default: C(() => [
300
+ n("div", Te, [
301
+ n("div", Me, f(e.modal.editingId.value ? q(s)("scheduling.positionModal.editTitle") : q(s)("scheduling.positionModal.addTitle")), 1),
302
+ R(O, {
303
+ hierarchy: "ghost",
304
+ size: "xs",
305
+ "icon-only": "",
306
+ class: "ce-close-x",
307
+ type: "button",
308
+ "aria-label": "Close",
309
+ onClick: a[0] || (a[0] = (t) => e.modal.close())
310
+ }, {
311
+ default: C(() => [...a[12] || (a[12] = [
312
+ n("svg", {
313
+ width: "20",
314
+ height: "20",
315
+ viewBox: "0 0 20 20",
316
+ fill: "none",
317
+ stroke: "currentColor",
318
+ "stroke-width": "1.8",
319
+ "stroke-linecap": "round",
320
+ "aria-hidden": "true"
321
+ }, [
322
+ n("path", { d: "M5.5 5.5l9 9M14.5 5.5l-9 9" })
323
+ ], -1)
324
+ ])]),
325
+ _: 1
326
+ })
327
+ ]),
328
+ n("div", Oe, [
329
+ e.modal.done.value ? (b(), N("div", Je, [
330
+ n("div", Qe, [
331
+ a[16] || (a[16] = n("span", {
332
+ class: "cg-done-tick",
333
+ "aria-hidden": "true"
334
+ }, "✓", -1)),
335
+ n("div", We, [
336
+ n("b", null, f(e.modal.done.value.name), 1),
337
+ n("small", null, f(e.modal.editingId.value ? "Position updated" : e.modal.done.value.assigned ? `Added to ${e.modal.done.value.assigned} ${e.modal.done.value.assigned === 1 ? "employee" : "employees"}` : "Position added"), 1)
338
+ ])
339
+ ]),
340
+ e.modal.done.value.failed ? (b(), N("div", Xe, f(e.modal.done.value.failed) + " " + f(e.modal.done.value.failed === 1 ? "employee" : "employees") + " could not be updated. Add the position to them from their profile. ", 1)) : G("", !0)
341
+ ])) : (b(), N("div", ze, [
342
+ n("div", je, [
343
+ a[13] || (a[13] = n("label", {
344
+ class: "ce-label",
345
+ for: "skName"
346
+ }, "Position name", -1)),
347
+ se(n("input", {
348
+ id: "skName",
349
+ "onUpdate:modelValue": a[1] || (a[1] = (t) => e.modal.name.value = t),
350
+ class: "sch-input ce-input",
351
+ maxlength: "40",
352
+ placeholder: "e.g. FOH, Kitchen, Manager, Cashier…",
353
+ autocomplete: "off",
354
+ onInput: a[2] || (a[2] = (t) => e.modal.nameError.value = !1),
355
+ onKeyup: a[3] || (a[3] = we((t) => e.modal.save(), ["enter"]))
356
+ }, null, 544), [
357
+ [oe, e.modal.name.value]
358
+ ]),
359
+ n("div", {
360
+ class: ie(["ce-err", { show: e.modal.nameError.value || e.modal.nameTaken.value }])
361
+ }, f(e.modal.nameTaken.value ? "A position with this name already exists" : "Give the position a name"), 3)
362
+ ]),
363
+ n("div", De, [
364
+ n("div", Le, [
365
+ a[14] || (a[14] = n("span", { class: "asg-lbl" }, "Employees with this position", -1)),
366
+ R(O, {
367
+ hierarchy: "ghost",
368
+ size: "sm",
369
+ class: "ce-add-link asg-all",
370
+ type: "button",
371
+ onClick: a[4] || (a[4] = (t) => e.modal.toggleAll())
372
+ }, {
373
+ default: C(() => [
374
+ M(f(e.modal.allPicked.value ? "Clear all" : "Select all"), 1)
375
+ ]),
376
+ _: 1
377
+ }),
378
+ n("span", Ve, f(e.modal.pickedIds.value.length) + " selected", 1)
379
+ ]),
380
+ se(n("input", {
381
+ "onUpdate:modelValue": a[5] || (a[5] = (t) => e.modal.search.value = t),
382
+ class: "sch-input ce-input asg-search",
383
+ placeholder: "Search team…",
384
+ autocomplete: "off"
385
+ }, null, 512), [
386
+ [oe, e.modal.search.value]
387
+ ]),
388
+ n("div", Be, [
389
+ (b(!0), N(de, null, Ne(e.modal.visible.value, (t) => (b(), N("label", {
390
+ key: t.employeeId,
391
+ class: "asg-row"
392
+ }, [
393
+ n("input", {
394
+ type: "checkbox",
395
+ class: "sch-checkbox asg-check",
396
+ checked: !!e.modal.picks[t.employeeId],
397
+ onChange: (c) => e.modal.toggle(t.employeeId),
398
+ "data-platform": "desktop"
399
+ }, null, 40, Fe),
400
+ n("span", Ke, f(t.initials), 1),
401
+ n("span", Re, [
402
+ n("span", {
403
+ class: "asg-nm",
404
+ title: t.name
405
+ }, f(t.name), 9, Ue),
406
+ n("span", qe, [
407
+ t.held.length ? (b(), N(de, { key: 0 }, [
408
+ M(f(t.held.join(", ")), 1)
409
+ ], 64)) : (b(), N("i", Ge, "No positions added"))
410
+ ])
411
+ ])
412
+ ]))), 128)),
413
+ e.modal.visible.value.length ? G("", !0) : (b(), N("div", He, " No one matches. "))
414
+ ]),
415
+ a[15] || (a[15] = n("div", { class: "ce-hint" }, "Ticked people can work this position.", -1))
416
+ ]),
417
+ n("div", {
418
+ class: ie(["ce-err", { show: !!e.modal.error.value }])
419
+ }, f(e.modal.error.value), 3)
420
+ ]))
421
+ ]),
422
+ n("div", Ye, [
423
+ a[19] || (a[19] = n("div", { class: "am-cost-preview" }, null, -1)),
424
+ e.modal.done.value ? (b(), N("div", _e, [
425
+ e.modal.editingId.value ? G("", !0) : (b(), Q(O, {
426
+ key: 0,
427
+ hierarchy: "secondary",
428
+ size: "sm",
429
+ class: "am-btn am-btn-sec",
430
+ type: "button",
431
+ onClick: a[9] || (a[9] = (t) => e.modal.another())
432
+ }, {
433
+ default: C(() => [...a[18] || (a[18] = [
434
+ M("Add another", -1)
435
+ ])]),
436
+ _: 1
437
+ })),
438
+ R(O, {
439
+ hierarchy: "primary",
440
+ size: "sm",
441
+ class: "am-btn am-btn-primary",
442
+ type: "button",
443
+ onClick: a[10] || (a[10] = (t) => e.modal.close())
444
+ }, {
445
+ default: C(() => [
446
+ M(f(q(s)("scheduling.common.done")), 1)
447
+ ]),
448
+ _: 1
449
+ })
450
+ ])) : (b(), N("div", Ze, [
451
+ R(O, {
452
+ hierarchy: "secondary",
453
+ size: "sm",
454
+ class: "am-btn am-btn-sec",
455
+ type: "button",
456
+ onClick: a[6] || (a[6] = (t) => e.modal.close())
457
+ }, {
458
+ default: C(() => [
459
+ M(f(q(s)("scheduling.common.cancel")), 1)
460
+ ]),
461
+ _: 1
462
+ }),
463
+ e.modal.editingId.value ? G("", !0) : (b(), Q(O, {
464
+ key: 0,
465
+ hierarchy: "secondary",
466
+ size: "sm",
467
+ class: "am-btn am-btn-sec",
468
+ type: "button",
469
+ disabled: !e.modal.canSave.value,
470
+ onClick: a[7] || (a[7] = (t) => e.modal.saveAndAnother())
471
+ }, {
472
+ default: C(() => [...a[17] || (a[17] = [
473
+ M(" Save & add another ", -1)
474
+ ])]),
475
+ _: 1
476
+ }, 8, ["disabled"])),
477
+ R(O, {
478
+ hierarchy: "primary",
479
+ size: "sm",
480
+ class: "am-btn am-btn-primary",
481
+ type: "button",
482
+ disabled: !e.modal.canSave.value,
483
+ onClick: a[8] || (a[8] = (t) => e.modal.save())
484
+ }, {
485
+ default: C(() => [
486
+ M(f(e.modal.editingId.value ? e.modal.saving.value ? "Saving…" : "Save changes" : e.modal.saving.value ? "Adding…" : "Add position"), 1)
487
+ ]),
488
+ _: 1
489
+ }, 8, ["disabled"])
490
+ ]))
491
+ ])
492
+ ]),
493
+ _: 1
494
+ }, 8, ["open"]));
495
+ }
496
+ });
497
+ export {
498
+ sa as _,
499
+ na as a,
500
+ ta as u
501
+ };