@feedmepos/mf-hrm-portal 2.0.20-dev.1 → 2.0.20-dev.2

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 (30) hide show
  1. package/dist/{AuditLogList-Bsj-qg8n.js → AuditLogList-ChxAzO74.js} +4 -4
  2. package/dist/EmployeeList-Cs-Mn6UA.js +843 -0
  3. package/dist/{Main-BGc6kNaR.js → Main-B9_TyRDo.js} +2008 -2001
  4. package/dist/Main-CdHW4UkN.js +90 -0
  5. package/dist/{Main-CSMAtoMj.js → Main-DcvmP7s-.js} +184 -176
  6. package/dist/PermissionSetList-VFVS0g0v.js +347 -0
  7. package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CdWgTjZw.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Dr3R9JjS.js} +771 -770
  8. package/dist/{RoleList-e0WUqt4Y.js → RoleList-BZ6RZvm2.js} +199 -188
  9. package/dist/TeamMemberList-C-zhFauD.js +1115 -0
  10. package/dist/{TimesheetList-tFjvFHqH.js → TimesheetList-CZex54an.js} +61 -53
  11. package/dist/{app-CL7rUfL3.js → app-CLL3p27X.js} +191 -193
  12. package/dist/app.js +1 -1
  13. package/dist/{dayjs.min-ChdFPuFV.js → dayjs.min-CDt1i9vl.js} +1 -1
  14. package/dist/employee-BpRvjWNh.js +200 -0
  15. package/dist/{iteration-BbD0nOgO.js → iteration-BVjUzYL5.js} +173 -175
  16. package/dist/{lodash-CDf3aG6G.js → lodash-CrwgACp2.js} +1 -1
  17. package/dist/{rule-BJ-y3Sp8.js → rule-BlQ5YZ9Z.js} +27 -26
  18. package/dist/src/types/team.d.ts +1 -0
  19. package/dist/style.css +1 -1
  20. package/dist/{timesheet-BmV02Rkz.js → timesheet-jFs4GTAL.js} +2 -2
  21. package/dist/tsconfig.app.tsbuildinfo +1 -1
  22. package/dist/{useAppStore-D8QAGZ02.js → useAppStore-DMAL8VFY.js} +36 -38
  23. package/dist/{useLoading-KpcQw0p4.js → useLoading-AFTjRLyO.js} +1 -1
  24. package/dist/{useReportPermissions-CmGJAz_N.js → useReportPermissions-hODG0Xx3.js} +3 -3
  25. package/package.json +1 -1
  26. package/dist/EmployeeList-Cy2ayCko.js +0 -824
  27. package/dist/Main-D7bV8EuC.js +0 -86
  28. package/dist/PermissionSetList-CuHhDqWl.js +0 -347
  29. package/dist/TeamMemberList-CpPa1KyV.js +0 -1097
  30. package/dist/employee-kKV7UnHU.js +0 -204
@@ -0,0 +1,1115 @@
1
+ import { defineComponent as Fe, resolveComponent as w, createElementBlock as O, openBlock as g, createElementVNode as i, createVNode as u, toDisplayString as $, unref as o, ref as v, computed as P, createCommentVNode as J, withCtx as pe, createBlock as H, watch as ue, Fragment as Ie, renderList as ts, withKeys as Ae, withModifiers as Se, nextTick as as, onUnmounted as ls, h as os, createTextVNode as ns } from "vue";
2
+ import { useI18n as Ve, useCoreStore as ke, baseClientInstance as Be } from "@feedmepos/mf-common";
3
+ import { useSnackbar as We, useDialog as rs, useBreakpoints as is, components as Me } from "@feedmepos/ui-library";
4
+ import { u as us, _ as ms } from "./useDebounce-CWb5QR9G.js";
5
+ import { _ as ds, S as fe } from "./SelectFilter-DUj7GBtT.js";
6
+ import { b as je, m as cs, C as ps, _ as vs, a as fs } from "./app-CLL3p27X.js";
7
+ import { u as bs, _ as ys } from "./useDiscardConfirm-DPhEV6v0.js";
8
+ import { _ as hs } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
9
+ import { u as gs } from "./useLoading-AFTjRLyO.js";
10
+ import { l as Ne } from "./lodash-CrwgACp2.js";
11
+ import { g as Ee, d as ce, u as Je } from "./iteration-BVjUzYL5.js";
12
+ import { u as Xe, c as Le, b as Te, m as Pe, d as Ze, p as qe, i as _s, j as Ke, k as ze, l as xs, n as Us, s as Ss, o as Fs, q as Vs, t as Ue } from "./rule-BlQ5YZ9Z.js";
13
+ import { u as Qe } from "./useAppStore-DMAL8VFY.js";
14
+ /* empty css */
15
+ import { _ as ws } from "./PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Dr3R9JjS.js";
16
+ var ye = /* @__PURE__ */ ((m) => (m.Update = "Update", m.Remove = "Remove", m))(ye || {});
17
+ const Ps = { class: "w-full flex flex-col gap-16" }, Is = { class: "flex items-center gap-16" }, ks = { class: "space-y-4 min-w-0 flex-1" }, Rs = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, $s = { class: "fm-typo-en-body-lg-600 truncate" }, Cs = { class: "w-full flex gap-16 items-center" }, Ms = { class: "flex-1 flex flex-col gap-4 min-w-0" }, Ns = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, Ds = { class: "fm-typo-en-body-lg-600 truncate" }, Os = { class: "flex-1 flex flex-col gap-4 min-w-0" }, As = { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, Bs = { class: "fm-typo-en-body-lg-600 truncate" }, js = /* @__PURE__ */ Fe({
18
+ __name: "MemberInfo",
19
+ props: {
20
+ data: {}
21
+ },
22
+ setup(m) {
23
+ const { t: A } = Ve();
24
+ return (n, a) => {
25
+ const d = w("FmAvatar");
26
+ return g(), O("div", Ps, [
27
+ i("div", Is, [
28
+ u(d, {
29
+ size: "xl",
30
+ initials: m.data.name
31
+ }, null, 8, ["initials"]),
32
+ i("div", ks, [
33
+ i("p", Rs, $(o(A)("team.memberForm.memberInfo.memberName")), 1),
34
+ i("p", $s, $(m.data.name || "--"), 1)
35
+ ])
36
+ ]),
37
+ i("div", Cs, [
38
+ i("div", Ms, [
39
+ i("p", Ns, $(o(A)("team.memberForm.memberInfo.mobileNumber")), 1),
40
+ i("p", Ds, $(m.data.phoneNumber || "--"), 1)
41
+ ]),
42
+ i("div", Os, [
43
+ i("p", As, $(o(A)("team.memberForm.memberInfo.emailAddress")), 1),
44
+ i("p", Bs, $(m.data.email || "--"), 1)
45
+ ])
46
+ ])
47
+ ]);
48
+ };
49
+ }
50
+ }), Ge = {
51
+ async readPermissionUserByPhoneNo(m) {
52
+ var n;
53
+ const { currentBusiness: A } = ke();
54
+ return Ee(
55
+ await Be("/").get(`/user/b/${(n = A.value) == null ? void 0 : n._id}/phone/${m}`)
56
+ );
57
+ },
58
+ async readPermissionUserByEmail(m) {
59
+ var n;
60
+ const { currentBusiness: A } = ke();
61
+ return Ee(
62
+ await Be("/").get(`/user/b/${(n = A.value) == null ? void 0 : n._id}/email/${m}`)
63
+ );
64
+ }
65
+ }, Es = { class: "flex flex-col gap-24 w-full" }, Ls = {
66
+ key: 0,
67
+ class: "flex flex-col gap-8"
68
+ }, Ts = { class: "user-info-icon user-info-icon--lg" }, qs = { class: "flex-1 overflow-hidden" }, Ks = { class: "profile-displayName" }, zs = { class: "profile-email" }, Gs = { class: "profile-phone" }, Ws = { key: 2 }, Js = /* @__PURE__ */ Fe({
69
+ __name: "PortalUserSearcher",
70
+ emits: ["invite"],
71
+ setup(m, { emit: A }) {
72
+ const n = A, { t: a } = Ve(), d = We(), C = ke(), M = v("phone"), x = v(""), B = v(""), p = v();
73
+ async function b() {
74
+ if (!x.value && !B.value) {
75
+ d.open({
76
+ type: "error",
77
+ title: a("team.memberForm.searchUser.emptyError")
78
+ });
79
+ return;
80
+ }
81
+ const F = M.value === "phone" ? await Ge.readPermissionUserByPhoneNo(x.value.replace(/ /g, "")) : await Ge.readPermissionUserByEmail(B.value);
82
+ F || d.open({
83
+ type: "error",
84
+ title: a("team.memberForm.searchUser.userNotFound")
85
+ }), p.value = F;
86
+ }
87
+ const ee = P(() => {
88
+ var K;
89
+ let F = ((K = p.value) == null ? void 0 : K.displayName) ?? "";
90
+ F || (F = "Feed Me");
91
+ const [y, D] = F.split(" ");
92
+ return D ? `${y[0]}${D[0]}` : y.slice(0, 2);
93
+ }), E = v(!1);
94
+ function le(F) {
95
+ n("invite", F), E.value = !0;
96
+ }
97
+ function q() {
98
+ E.value = !1;
99
+ }
100
+ return (F, y) => {
101
+ var _, N, X;
102
+ const D = w("FmRadio"), K = w("FmPhoneNumber"), ae = w("FmTextField"), r = w("FmRadioGroup"), l = w("FmButton");
103
+ return g(), O("div", Es, [
104
+ E.value ? J("", !0) : (g(), O("div", Ls, [
105
+ u(r, {
106
+ modelValue: M.value,
107
+ "onUpdate:modelValue": y[2] || (y[2] = (j) => M.value = j)
108
+ }, {
109
+ default: pe(() => [
110
+ u(D, {
111
+ value: "phone",
112
+ label: o(a)("team.memberForm.searchUser.phoneNumber")
113
+ }, null, 8, ["label"]),
114
+ M.value === "phone" ? (g(), H(K, {
115
+ key: 0,
116
+ modelValue: x.value,
117
+ "onUpdate:modelValue": y[0] || (y[0] = (j) => x.value = j),
118
+ "extra-country-codes": o(C).enabledCountries.value,
119
+ class: "ml-8"
120
+ }, null, 8, ["modelValue", "extra-country-codes"])) : J("", !0),
121
+ u(D, {
122
+ value: "email",
123
+ label: o(a)("team.memberForm.searchUser.email")
124
+ }, null, 8, ["label"]),
125
+ M.value === "email" ? (g(), H(ae, {
126
+ key: 1,
127
+ modelValue: B.value,
128
+ "onUpdate:modelValue": y[1] || (y[1] = (j) => B.value = j),
129
+ placeholder: o(a)("team.memberForm.searchUser.emailPlaceholder"),
130
+ class: "ml-8"
131
+ }, null, 8, ["modelValue", "placeholder"])) : J("", !0)
132
+ ]),
133
+ _: 1
134
+ }, 8, ["modelValue"]),
135
+ u(l, {
136
+ label: o(a)("team.memberForm.searchUser.search"),
137
+ variant: "secondary",
138
+ onClick: b
139
+ }, null, 8, ["label"])
140
+ ])),
141
+ p.value ? (g(), O("div", {
142
+ key: 1,
143
+ class: "profile-menu--profile cursor-pointer hover:bg-fm-color-opacity-sm",
144
+ onClick: y[3] || (y[3] = (j) => le(p.value))
145
+ }, [
146
+ i("div", Ts, $(ee.value), 1),
147
+ i("div", qs, [
148
+ i("p", Ks, $((_ = p.value) == null ? void 0 : _.displayName), 1),
149
+ i("p", zs, $((N = p.value) == null ? void 0 : N.email), 1),
150
+ i("p", Gs, $((X = p.value) == null ? void 0 : X.phoneNumber), 1)
151
+ ])
152
+ ])) : J("", !0),
153
+ E.value ? (g(), O("div", Ws, [
154
+ u(l, {
155
+ label: o(a)("team.memberForm.searchUser.changeUser"),
156
+ variant: "secondary",
157
+ onClick: q
158
+ }, null, 8, ["label"])
159
+ ])) : J("", !0)
160
+ ]);
161
+ };
162
+ }
163
+ }), Xs = /* @__PURE__ */ ds(Js, [["__scopeId", "data-v-c2c7ed35"]]), Zs = { class: "flex flex-col gap-40" }, Qs = { class: "flex items-center" }, Ys = { class: "flex-1 flex flex-col" }, Hs = { class: "fm-typo-en-title-sm-600" }, et = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st = { class: "flex flex-row gap-16" }, tt = { class: "flex flex-col gap-8" }, at = { class: "fm-typo-en-body-lg-400" }, lt = { class: "space-y-16 rounded-lg border border-fm-color-neutral-gray-200 p-16" }, ot = { class: "fm-typo-en-title-sm-600" }, nt = { class: "space-y-16" }, rt = { class: "grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto] gap-16" }, it = { class: "text-sm font-semibold text-fm-color-typo-primary" }, ut = { class: "text-sm font-semibold text-fm-color-typo-primary" }, mt = { class: "flex justify-self-end" }, dt = ["aria-label", "onClick", "onKeydown"], De = 4, ct = /* @__PURE__ */ Fe({
164
+ __name: "TeamMemberMasterUser",
165
+ props: {
166
+ modelValue: {
167
+ type: Object,
168
+ default: void 0
169
+ },
170
+ fallbackName: {
171
+ type: String,
172
+ required: !0
173
+ },
174
+ fallbackPasscode: {
175
+ type: String,
176
+ default: void 0
177
+ },
178
+ restaurants: {
179
+ type: Array,
180
+ required: !0
181
+ },
182
+ roles: {
183
+ type: Array,
184
+ required: !0
185
+ }
186
+ },
187
+ emits: ["update:model-value"],
188
+ setup(m, { emit: A }) {
189
+ const n = m, a = A, { t: d } = Ve(), C = v(!0), M = v([]);
190
+ function x() {
191
+ return { restaurantId: "", roleId: "" };
192
+ }
193
+ const B = P(
194
+ () => {
195
+ var r;
196
+ return ((r = n.modelValue) == null ? void 0 : r.roles.map((l) => l.restaurantId).filter(Boolean)) ?? [];
197
+ }
198
+ );
199
+ function p(r) {
200
+ r ? n.modelValue || a("update:model-value", {
201
+ code: "",
202
+ name: n.fallbackName,
203
+ roles: [x()],
204
+ passcode: n.fallbackPasscode || ""
205
+ }) : a("update:model-value", null);
206
+ }
207
+ function b(r, l) {
208
+ if (!n.modelValue || r === "passcode" && n.modelValue.passcode === l) return;
209
+ const _ = ce(n.modelValue);
210
+ _[r] = l, a("update:model-value", _);
211
+ }
212
+ function ee(r = "") {
213
+ return n.restaurants.filter((l) => l.managable || l._id === r).map((l) => ({
214
+ label: `${l.profile.code ? `${l.profile.code} - ` : ""}${l.profile.name}`,
215
+ value: l._id,
216
+ disabled: B.value.includes(l._id) && l._id !== r
217
+ }));
218
+ }
219
+ function E(r = "") {
220
+ return n.roles.map((l) => ({
221
+ label: l.label,
222
+ value: l.value,
223
+ disabled: !!l.disabled && l.value !== r
224
+ }));
225
+ }
226
+ function le(r, l) {
227
+ var z, L, G;
228
+ if (!n.modelValue) return;
229
+ const _ = n.modelValue.roles.length > 0 ? [...n.modelValue.roles] : [x()], N = ((z = _[r]) == null ? void 0 : z.roleId) ?? "", X = E(N), j = ((L = X.find((c) => c.value === N && !c.disabled)) == null ? void 0 : L.value) ?? ((G = X.find((c) => !c.disabled)) == null ? void 0 : G.value) ?? "";
230
+ _[r] = { restaurantId: l, roleId: j }, b("roles", _);
231
+ }
232
+ function q(r, l) {
233
+ var N;
234
+ if (!n.modelValue) return;
235
+ const _ = n.modelValue.roles.length > 0 ? [...n.modelValue.roles] : [x()];
236
+ _[r] = {
237
+ restaurantId: ((N = _[r]) == null ? void 0 : N.restaurantId) ?? "",
238
+ roleId: l
239
+ }, b("roles", _);
240
+ }
241
+ function F() {
242
+ n.modelValue && b("roles", [...n.modelValue.roles, x()]);
243
+ }
244
+ function y(r) {
245
+ if (!n.modelValue) return;
246
+ const l = n.modelValue.roles.length > 0 ? [...n.modelValue.roles] : [x()];
247
+ b(
248
+ "roles",
249
+ l.length === 1 ? [x()] : l.filter((_, N) => N !== r)
250
+ );
251
+ }
252
+ const D = P(() => {
253
+ if (!n.modelValue) return !1;
254
+ const r = n.restaurants.some(
255
+ (_) => _.managable && !B.value.includes(_._id)
256
+ ), l = n.modelValue.roles.every(
257
+ (_) => _.restaurantId && _.roleId
258
+ );
259
+ return r && l;
260
+ });
261
+ function K() {
262
+ C.value && (C.value = !1, M.value = [], b("passcode", ""));
263
+ }
264
+ ue(
265
+ () => {
266
+ var r;
267
+ return (r = n.modelValue) == null ? void 0 : r.passcode;
268
+ },
269
+ (r) => {
270
+ r && r.length === De ? (M.value = r.split(""), C.value = !0) : (M.value = [], C.value = !1);
271
+ },
272
+ { immediate: !0 }
273
+ ), ue(
274
+ () => {
275
+ var r;
276
+ return (r = n.modelValue) == null ? void 0 : r.roles;
277
+ },
278
+ (r) => {
279
+ n.modelValue && (!r || r.length === 0) && b("roles", [x()]);
280
+ },
281
+ { immediate: !0, deep: !0 }
282
+ );
283
+ const ae = P({
284
+ get: () => {
285
+ var r;
286
+ return ((r = n.modelValue) == null ? void 0 : r.roles) ?? [];
287
+ },
288
+ set: () => {
289
+ }
290
+ });
291
+ return (r, l) => {
292
+ const _ = w("FmSwitch"), N = w("FmTextField"), X = w("FmPinField"), j = w("FmFormGroup"), z = w("FmSelect"), L = w("FmIcon"), G = w("FmButton");
293
+ return g(), O("div", Zs, [
294
+ i("div", Qs, [
295
+ i("div", Ys, [
296
+ i("div", Hs, $(o(d)("team.memberForm.masterUser.title")), 1),
297
+ i("div", et, $(o(d)("team.memberForm.masterUser.sublabel")), 1)
298
+ ]),
299
+ i("div", null, [
300
+ u(_, {
301
+ "model-value": !!m.modelValue,
302
+ value: "master-user",
303
+ "onUpdate:modelValue": p
304
+ }, null, 8, ["model-value"])
305
+ ])
306
+ ]),
307
+ m.modelValue ? (g(), O(Ie, { key: 0 }, [
308
+ i("div", st, [
309
+ u(N, {
310
+ "model-value": m.modelValue.code,
311
+ label: o(d)("team.memberForm.masterUser.code"),
312
+ "onUpdate:modelValue": l[0] || (l[0] = (c) => b("code", c))
313
+ }, null, 8, ["model-value", "label"]),
314
+ u(N, {
315
+ "model-value": m.modelValue.name,
316
+ class: "w-full",
317
+ label: o(d)("team.memberForm.masterUser.name"),
318
+ rules: [(c) => !!c || o(d)("team.memberForm.masterUser.nameEmptyError")],
319
+ "onUpdate:modelValue": l[1] || (l[1] = (c) => b("name", c))
320
+ }, null, 8, ["model-value", "label", "rules"])
321
+ ]),
322
+ i("div", tt, [
323
+ i("div", at, $(o(d)("team.memberForm.masterUser.passcode")), 1),
324
+ u(j, {
325
+ modelValue: M.value,
326
+ "onUpdate:modelValue": l[4] || (l[4] = (c) => M.value = c),
327
+ rules: [
328
+ (c) => (c == null ? void 0 : c.filter((h) => !!h).length) !== De ? o(d)("team.memberForm.masterUser.passcodeRequired") : !0
329
+ ]
330
+ }, {
331
+ default: pe(() => [
332
+ (g(), H(X, {
333
+ key: `pin-field-${C.value}`,
334
+ modelValue: M.value,
335
+ "onUpdate:modelValue": l[2] || (l[2] = (c) => M.value = c),
336
+ length: De,
337
+ masked: C.value,
338
+ onComplete: l[3] || (l[3] = (c) => b("passcode", c)),
339
+ onFocus: K
340
+ }, null, 8, ["modelValue", "masked"]))
341
+ ]),
342
+ _: 1
343
+ }, 8, ["modelValue", "rules"])
344
+ ]),
345
+ u(j, {
346
+ tag: "div",
347
+ modelValue: ae.value,
348
+ "onUpdate:modelValue": l[5] || (l[5] = (c) => ae.value = c),
349
+ rules: [
350
+ (c) => !c || c.length === 0 || c.every((h) => !h.restaurantId) ? o(d)("team.memberForm.masterUser.restaurantRequired") : c.some((h) => !h.restaurantId || !h.roleId) ? o(d)("team.memberForm.masterUser.roleRequired") : !0
351
+ ]
352
+ }, {
353
+ default: pe(() => [
354
+ i("div", lt, [
355
+ i("div", ot, $(o(d)("team.memberForm.masterUser.assignmentSection")), 1),
356
+ i("div", nt, [
357
+ i("div", rt, [
358
+ i("div", it, $(o(d)("team.table.columns.restaurant")), 1),
359
+ i("div", ut, $(o(d)("team.memberForm.masterUser.role")), 1),
360
+ l[6] || (l[6] = i("div", null, null, -1))
361
+ ]),
362
+ (g(!0), O(Ie, null, ts(m.modelValue.roles, (c, h) => (g(), O("div", {
363
+ key: `${c.restaurantId || "new"}-${h}`,
364
+ class: "grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto] items-center gap-16"
365
+ }, [
366
+ u(z, {
367
+ class: "min-w-0",
368
+ "model-value": c.restaurantId,
369
+ items: ee(c.restaurantId),
370
+ multiselect: !1,
371
+ placeholder: o(d)("team.table.columns.restaurant"),
372
+ "onUpdate:modelValue": (W) => le(h, W)
373
+ }, null, 8, ["model-value", "items", "placeholder", "onUpdate:modelValue"]),
374
+ u(z, {
375
+ class: "min-w-0",
376
+ "model-value": c.roleId,
377
+ items: E(c.roleId),
378
+ multiselect: !1,
379
+ placeholder: o(d)("team.memberForm.masterUser.role"),
380
+ disabled: !c.restaurantId,
381
+ "onUpdate:modelValue": (W) => q(h, W)
382
+ }, null, 8, ["model-value", "items", "placeholder", "disabled", "onUpdate:modelValue"]),
383
+ i("div", mt, [
384
+ m.modelValue.roles.length > 1 ? (g(), O("div", {
385
+ key: 0,
386
+ role: "button",
387
+ tabindex: "0",
388
+ class: "inline-flex h-40 w-40 shrink-0 cursor-pointer items-center justify-center rounded-lg text-fm-color-neutral-gray-400 transition-colors hover:bg-fm-color-neutral-gray-100 focus:outline-none focus:ring-2 focus:ring-fm-color-primary",
389
+ "aria-label": o(d)("common.remove"),
390
+ onClick: Se((W) => y(h), ["stop"]),
391
+ onKeydown: [
392
+ Ae(Se((W) => y(h), ["prevent", "stop"]), ["enter"]),
393
+ Ae(Se((W) => y(h), ["prevent", "stop"]), ["space"])
394
+ ]
395
+ }, [
396
+ u(L, {
397
+ name: "delete",
398
+ size: "md"
399
+ })
400
+ ], 40, dt)) : J("", !0)
401
+ ])
402
+ ]))), 128))
403
+ ]),
404
+ u(G, {
405
+ type: "button",
406
+ variant: "secondary",
407
+ "text-color": "primary",
408
+ "border-color": "primary",
409
+ "prepend-icon": "add",
410
+ label: o(d)("team.memberForm.masterUser.addAnother"),
411
+ size: "md",
412
+ disabled: !D.value,
413
+ onClick: Se(F, ["stop"])
414
+ }, null, 8, ["label", "disabled"])
415
+ ])
416
+ ]),
417
+ _: 1
418
+ }, 8, ["modelValue", "rules"])
419
+ ], 64)) : J("", !0)
420
+ ]);
421
+ };
422
+ }
423
+ }), pt = { class: "flex flex-col gap-32" }, vt = { class: "flex w-full" }, ft = {
424
+ key: 0,
425
+ class: "space-y-24"
426
+ }, bt = { class: "space-y-16 rounded-lg border border-fm-color-neutral-gray-200 p-16" }, yt = { class: "fm-typo-en-title-sm-600" }, ht = { class: "space-y-16" }, gt = { class: "fm-typo-en-title-sm-600" }, _t = {
427
+ key: 1,
428
+ class: "flex items-center justify-center py-64"
429
+ }, xt = /* @__PURE__ */ Fe({
430
+ __name: "AddMemberForm",
431
+ props: {
432
+ initialValue: {
433
+ type: Object
434
+ },
435
+ roleErrorMessage: {
436
+ type: String,
437
+ default: ""
438
+ },
439
+ loading: {
440
+ type: Boolean,
441
+ default: !1
442
+ }
443
+ },
444
+ setup(m, { expose: A }) {
445
+ var ve, ge, _e;
446
+ const n = m, { t: a } = Ve(), d = v(), C = Xe(), M = P(
447
+ () => C.permissionSets.value.map((t) => ({
448
+ label: t.name,
449
+ value: t.id
450
+ }))
451
+ ), x = v(((ve = n.initialValue) == null ? void 0 : ve.permissionSetIds) || []), B = P(
452
+ () => Le(x.value, C.permissionSets.value)
453
+ ), p = v((ge = n.initialValue) == null ? void 0 : ge.posUser), b = v(
454
+ Te(
455
+ Pe(B.value),
456
+ ((_e = n.initialValue) == null ? void 0 : _e.permissions) || []
457
+ )
458
+ ), { customReportPermissions: ee, isLoaded: E } = Ze(), le = new Set(
459
+ qe.filter((t) => t.subject.startsWith(_s)).map((t) => t.subject)
460
+ ), q = P(() => {
461
+ const t = new Set(le);
462
+ for (const f of ee.value) t.add(f.subject);
463
+ return t;
464
+ }), F = P(() => {
465
+ const t = /* @__PURE__ */ new Set();
466
+ for (const f of qe)
467
+ f.category === je.reports && t.add(f.subject);
468
+ for (const f of ee.value)
469
+ f.category === je.reports && t.add(f.subject);
470
+ return t;
471
+ }), y = Je(), D = Qe().roles, K = P(() => Ke(b.value)), ae = P(() => {
472
+ const t = ze(b.value);
473
+ return t === null ? y.restaurants.value : y.restaurants.value.filter((f) => t.includes(f._id));
474
+ }), r = P(() => {
475
+ const t = K.value;
476
+ return D.value.map(
477
+ (f) => ({
478
+ label: f.name,
479
+ value: f._id,
480
+ disabled: !!t && !t.includes(f._id)
481
+ })
482
+ );
483
+ }), l = v({ permissionSetIds: [], userPermissions: [], posUser: void 0 });
484
+ function _(t) {
485
+ d.value = void 0, x.value = [...(t == null ? void 0 : t.permissionSetIds) ?? []], b.value = Te(
486
+ Pe(
487
+ Le(
488
+ x.value,
489
+ C.permissionSets.value
490
+ )
491
+ ),
492
+ (t == null ? void 0 : t.permissions) || []
493
+ ), p.value = t != null && t.posUser ? h(ce(t.posUser), b.value) : void 0, W.value = !!p.value, l.value = {
494
+ permissionSetIds: [...x.value],
495
+ userPermissions: ce(b.value),
496
+ posUser: p.value ? ce(p.value) : void 0
497
+ };
498
+ }
499
+ function N() {
500
+ return !n.initialValue && d.value ? !0 : !Ne.isEqual(x.value, l.value.permissionSetIds) || !Ne.isEqual(b.value, l.value.userPermissions) || !Ne.isEqual(p.value, l.value.posUser);
501
+ }
502
+ function X(t) {
503
+ d.value = t;
504
+ }
505
+ function j(t) {
506
+ p.value = h(p.value, t);
507
+ }
508
+ function z() {
509
+ const t = Pe(B.value), f = E.value ? q.value : le, I = xs(b.value, f), k = Us(I, F.value), R = Ss(k);
510
+ return Fs(t, R);
511
+ }
512
+ function L() {
513
+ var I, k, R, Z, ne, re, me, se, Q, de;
514
+ const t = z(), f = b.value.filter((Y) => !Y.inverted);
515
+ return {
516
+ email: ((I = d.value) == null ? void 0 : I.email) ?? void 0,
517
+ phoneNumber: ((k = d.value) == null ? void 0 : k.phoneNumber) ?? void 0,
518
+ customPermissions: t,
519
+ permissions: f.map((Y) => ({
520
+ ...Y,
521
+ subject: cs(Y.subject)
522
+ })),
523
+ permissionSetIds: x.value,
524
+ name: ((R = d.value) == null ? void 0 : R.displayName) || ((Z = n.initialValue) == null ? void 0 : Z.name) || "",
525
+ posUser: p.value ? {
526
+ ...p.value,
527
+ name: p.value.name || ((re = (ne = n.initialValue) == null ? void 0 : ne.posUser) == null ? void 0 : re.name) || ((me = n.initialValue) == null ? void 0 : me.name) || ((se = d.value) == null ? void 0 : se.displayName) || "",
528
+ code: p.value.code || ((de = (Q = n.initialValue) == null ? void 0 : Q.posUser) == null ? void 0 : de.code) || "",
529
+ passcode: p.value.passcode,
530
+ roles: p.value.roles.filter((Y) => !!Y.roleId)
531
+ } : p.value === null ? null : void 0
532
+ };
533
+ }
534
+ const G = v();
535
+ function c() {
536
+ b.value = Pe(B.value);
537
+ }
538
+ function h(t, f) {
539
+ if (!t) return t;
540
+ const I = Ke(f), k = ze(f);
541
+ if (I === null && k === null) return t;
542
+ const R = ce(t);
543
+ return R.roles = R.roles.filter(
544
+ (Z) => (I === null || I.includes(Z.roleId)) && (k === null || k.includes(Z.restaurantId))
545
+ ), R;
546
+ }
547
+ const W = v(!!p.value), he = v(!1);
548
+ function Re(t) {
549
+ p.value = t, he.value = !0;
550
+ }
551
+ ue(
552
+ () => !!p.value,
553
+ async (t) => {
554
+ t && !W.value && (await as(), G.value && G.value.$el.scrollIntoView({ behavior: "smooth", block: "start" })), W.value = t;
555
+ }
556
+ );
557
+ const oe = v();
558
+ async function we() {
559
+ return (await oe.value.validateInputsWithoutSubmit()).length ? null : L();
560
+ }
561
+ return ue(
562
+ () => n.initialValue,
563
+ (t, f) => {
564
+ if (!f || !t) {
565
+ he.value = !1, _(t);
566
+ return;
567
+ }
568
+ t.posUser !== void 0 && !he.value && (p.value = t.posUser ? h(ce(t.posUser), b.value) : void 0, l.value = {
569
+ ...l.value,
570
+ posUser: p.value ? ce(p.value) : void 0
571
+ });
572
+ },
573
+ { immediate: !0 }
574
+ ), ue(
575
+ b,
576
+ (t) => {
577
+ p.value = h(p.value, t);
578
+ },
579
+ { deep: !0 }
580
+ ), A({
581
+ readFormData: L,
582
+ validate: we,
583
+ isModified: N
584
+ }), (t, f) => {
585
+ const I = w("FmSelect"), k = w("FmCircularProgress"), R = w("FmForm");
586
+ return g(), H(R, {
587
+ ref_key: "formRef",
588
+ ref: oe,
589
+ class: "mx-4"
590
+ }, {
591
+ default: pe(() => {
592
+ var Z, ne, re, me, se;
593
+ return [
594
+ i("div", pt, [
595
+ i("div", vt, [
596
+ m.initialValue ? (g(), H(js, {
597
+ key: 1,
598
+ data: m.initialValue
599
+ }, null, 8, ["data"])) : (g(), H(Xs, {
600
+ key: 0,
601
+ onInvite: f[0] || (f[0] = (Q) => X(Q))
602
+ }))
603
+ ]),
604
+ d.value || m.initialValue ? (g(), O(Ie, { key: 0 }, [
605
+ (Z = m.initialValue) != null && Z.isOwner ? J("", !0) : (g(), O("div", ft, [
606
+ i("div", bt, [
607
+ i("div", yt, $(o(a)("team.memberForm.permissionSet.title")), 1),
608
+ u(I, {
609
+ modelValue: x.value,
610
+ "onUpdate:modelValue": [
611
+ f[1] || (f[1] = (Q) => x.value = Q),
612
+ c
613
+ ],
614
+ multiselect: "",
615
+ searchable: "",
616
+ "search-debounce": 300,
617
+ items: M.value,
618
+ placeholder: o(a)("team.memberForm.permissionSet.selectPlaceholder")
619
+ }, null, 8, ["modelValue", "items", "placeholder"])
620
+ ]),
621
+ i("div", ht, [
622
+ i("div", gt, $(o(a)("team.memberForm.permissions.title")), 1),
623
+ u(ws, {
624
+ modelValue: b.value,
625
+ "onUpdate:modelValue": f[2] || (f[2] = (Q) => b.value = Q),
626
+ "inherit-permissions": B.value,
627
+ onPermissionChanged: j
628
+ }, null, 8, ["modelValue", "inherit-permissions"])
629
+ ])
630
+ ])),
631
+ m.loading ? (g(), O("div", _t, [
632
+ u(k, { size: "xl" })
633
+ ])) : (g(), H(ct, {
634
+ key: 2,
635
+ ref_key: "masterUserContentRef",
636
+ ref: G,
637
+ "model-value": p.value,
638
+ "fallback-name": ((ne = m.initialValue) == null ? void 0 : ne.name) || ((re = d.value) == null ? void 0 : re.displayName) || "",
639
+ "fallback-passcode": (se = (me = m.initialValue) == null ? void 0 : me.posUser) == null ? void 0 : se.passcode,
640
+ roles: r.value,
641
+ restaurants: ae.value,
642
+ "onUpdate:modelValue": Re
643
+ }, null, 8, ["model-value", "fallback-name", "fallback-passcode", "roles", "restaurants"]))
644
+ ], 64)) : J("", !0)
645
+ ])
646
+ ];
647
+ }),
648
+ _: 1
649
+ }, 512);
650
+ };
651
+ }
652
+ }), Ut = {
653
+ class: "space-y-24"
654
+ }, St = {
655
+ class: "space-y-8"
656
+ }, Ft = {
657
+ key: 0,
658
+ class: "flex w-full items-start justify-between px-16"
659
+ }, Vt = {
660
+ class: "flex items-start gap-8"
661
+ }, wt = {
662
+ key: 1,
663
+ class: "space-y-4 px-16"
664
+ }, Pt = {
665
+ class: "flex items-start gap-8"
666
+ }, It = {
667
+ class: "flex h-full flex-col"
668
+ }, kt = {
669
+ class: "flex items-center justify-start gap-8"
670
+ }, be = 100;
671
+ var te = /* @__PURE__ */ function(m) {
672
+ return m[m.ADD = 0] = "ADD", m[m.UPDATE = 1] = "UPDATE", m[m.CLOSED = 2] = "CLOSED", m;
673
+ }(te || {});
674
+ const zt = /* @__PURE__ */ Fe({
675
+ __name: "TeamMemberList",
676
+ setup(m, {
677
+ expose: A
678
+ }) {
679
+ const {
680
+ fetchCustomReportPermissions: n
681
+ } = Ze(), {
682
+ t: a
683
+ } = Ve(), d = ke(), C = Je(), M = Qe(), x = We(), B = gs(x), p = Xe(), b = Vs(), ee = v(!0), E = v(!1), le = P(() => C.isLoading.value), q = v([]), F = v(0), y = v(1), D = v(""), K = v("");
684
+ ue(C.restaurants, (e) => {
685
+ if (e.length > 0 && q.value.length > 0) {
686
+ const s = new Map(e.map((S) => [S._id, S.profile.name])), U = e.map((S) => S.profile.name).sort();
687
+ q.value = q.value.map((S) => ({
688
+ ...S,
689
+ restaurants: S.managableRestaurantIds === null ? U : S.managableRestaurantIds.map((T) => s.get(T) ?? "").filter(Boolean).sort()
690
+ }));
691
+ }
692
+ });
693
+ const ae = P(() => C.restaurants.value.map((e) => ({
694
+ label: `${e.profile.code ? `${e.profile.code} - ` : ""}${e.profile.name}`,
695
+ value: e._id
696
+ }))), r = ({
697
+ member: e,
698
+ className: s = ""
699
+ }) => {
700
+ const U = {
701
+ label: a("team.actions.updateMember"),
702
+ onClick: () => G(ye.Update, e)
703
+ }, S = {
704
+ label: a("team.actions.removeMember"),
705
+ onClick: () => G(ye.Remove, e),
706
+ itemClass: "text-fm-color-typo-error"
707
+ }, T = e.doc.isOwner ? [U] : [U, S];
708
+ return u(ys, {
709
+ class: s,
710
+ items: T
711
+ }, null);
712
+ }, l = (e) => e.doc.isOwner ? a("team.labels.businessOwner") : e.restaurants.join(", "), _ = [{
713
+ accessorKey: "name",
714
+ header: () => a("team.table.columns.name"),
715
+ enableSorting: !1,
716
+ cell(e) {
717
+ const s = e.row.original;
718
+ return u("div", {
719
+ class: "flex items-center gap-8"
720
+ }, [u(Me.FmAvatar, {
721
+ initials: s.name,
722
+ size: "sm",
723
+ class: "shrink-0"
724
+ }, null), u("span", {
725
+ class: "truncate"
726
+ }, [s.name])]);
727
+ }
728
+ }, {
729
+ accessorKey: "phoneNumber",
730
+ header: () => a("team.table.columns.phoneNumber"),
731
+ enableSorting: !1
732
+ }, {
733
+ accessorKey: "restaurant",
734
+ header: () => a("team.table.columns.restaurant"),
735
+ enableSorting: !1,
736
+ cell(e) {
737
+ if (le.value)
738
+ return os(ms);
739
+ const s = e.row.original;
740
+ return l(s);
741
+ }
742
+ }, {
743
+ accessorKey: "assignedRoles",
744
+ header: () => a("team.table.columns.assignedRoles"),
745
+ enableSorting: !1,
746
+ cell(e) {
747
+ const s = e.row.original, U = b.getPermissionAssignmentByUserId(s.id), S = (U == null ? void 0 : U.permissionSetIds) || s.doc.permissionSetIds || [];
748
+ return p.permissionSets.value.filter((ie) => S.includes(ie.id)).map((ie) => ie.name).join(", ");
749
+ }
750
+ }, {
751
+ accessorKey: "permission",
752
+ header: () => a("team.table.columns.permission"),
753
+ enableSorting: !1,
754
+ cell(e) {
755
+ const s = e.row.original;
756
+ return N(s);
757
+ },
758
+ meta: {
759
+ width: "200px"
760
+ }
761
+ }, {
762
+ id: "action",
763
+ meta: {
764
+ cellClass: "pl-16",
765
+ headerContentClass: "-mx-16"
766
+ },
767
+ cell(e) {
768
+ const s = e.row.original;
769
+ return r({
770
+ member: s,
771
+ className: "flex justify-end w-full"
772
+ });
773
+ },
774
+ enableSorting: !1
775
+ }];
776
+ function N(e) {
777
+ if (e.doc.isOwner)
778
+ return a("team.labels.businessOwner");
779
+ const s = u(Me.FmTooltip, {
780
+ variant: "plain",
781
+ placement: "top"
782
+ }, {
783
+ default: () => u(Me.FmIcon, {
784
+ name: "info",
785
+ class: "cursor-pointer text-fm-color-neutral-gray-300"
786
+ }, null),
787
+ content: () => u("div", null, [a("team.labels.permission"), e.permissionLabels.map((U) => u("div", null, [ns("- "), U]))])
788
+ });
789
+ return u("div", {
790
+ class: "flex flex-row items-center gap-8"
791
+ }, [u("span", null, [a("team.labels.allowed", {
792
+ count: e.permissionLabels.length
793
+ })]), e.permissionLabels.length > 0 && s]);
794
+ }
795
+ function X(e) {
796
+ var T, ie, xe, V;
797
+ const s = b.getPermissionAssignmentByUserId(e.id), U = (s == null ? void 0 : s.customPermissions) || e.permissions || [], S = (s == null ? void 0 : s.permissionSetIds) || [];
798
+ return {
799
+ id: e.id,
800
+ isOwner: e.doc.isOwner,
801
+ name: e.name,
802
+ phoneNumber: e.phoneNumber,
803
+ email: e.email,
804
+ permissions: U,
805
+ permissionSetIds: S,
806
+ posUser: e.doc.posUser ? {
807
+ code: ((T = e.doc.posUser) == null ? void 0 : T.code) ?? "",
808
+ name: ((ie = e.doc.posUser) == null ? void 0 : ie.name) ?? e.name,
809
+ passcode: ((xe = e.doc.posUser) == null ? void 0 : xe.passcode) ?? "",
810
+ roles: ((V = e.doc.posUser) == null ? void 0 : V.roles) ?? []
811
+ } : void 0
812
+ };
813
+ }
814
+ function j(e) {
815
+ const s = b.getPermissionAssignmentByUserId(e.id), U = (s == null ? void 0 : s.customPermissions) || e.permissions || [], S = (s == null ? void 0 : s.permissionSetIds) || [];
816
+ return {
817
+ id: e.id,
818
+ isOwner: e.doc.isOwner,
819
+ name: e.name,
820
+ phoneNumber: e.phoneNumber,
821
+ email: e.email,
822
+ permissions: U,
823
+ permissionSetIds: S,
824
+ posUser: void 0
825
+ };
826
+ }
827
+ const z = v(!1);
828
+ let L = 0;
829
+ const G = async (e, s) => {
830
+ if (e == ye.Update) {
831
+ const U = ++L;
832
+ oe.value = j(s), h.value = te.UPDATE, z.value = s.doc.hasPosUser === !0;
833
+ try {
834
+ const S = await Ue.readTeamMember(s.id);
835
+ if (U !== L) return;
836
+ oe.value = X(S);
837
+ } catch {
838
+ if (U !== L) return;
839
+ x.open({
840
+ message: a("common.error"),
841
+ type: "error"
842
+ }), ge();
843
+ } finally {
844
+ U === L && (z.value = !1);
845
+ }
846
+ }
847
+ e == ye.Remove && t(s);
848
+ }, c = rs(), h = v(te.CLOSED), W = P(() => h.value !== te.CLOSED), he = P(() => h.value === te.ADD ? a("common.add") : a("common.update")), Re = P(() => h.value === te.ADD ? a("team.actions.addMember") : a("team.actions.updateMember")), oe = v();
849
+ function we() {
850
+ L++, z.value = !1, h.value = te.CLOSED;
851
+ }
852
+ const ve = bs(() => {
853
+ var e;
854
+ return ((e = de.value) == null ? void 0 : e.isModified()) ?? !1;
855
+ }, we);
856
+ function ge() {
857
+ ve();
858
+ }
859
+ const {
860
+ breakpoints: _e
861
+ } = is(), t = (e) => {
862
+ c.open({
863
+ title: a("team.actions.removeMember"),
864
+ message: a("team.removeMember.confirmationMessage", {
865
+ memberName: e.name
866
+ }),
867
+ minWidth: _e.value.lg ? 588 : 0,
868
+ primaryActions: {
869
+ text: "Remove",
870
+ close: !1,
871
+ variant: "destructive",
872
+ isLoading: $e
873
+ },
874
+ secondaryActions: {
875
+ text: "Cancel",
876
+ close: !0
877
+ }
878
+ }).onPrimary(async () => {
879
+ $e.value || (await B.minor(async () => {
880
+ await Ue.deleteTeamMember(e.id), await Q();
881
+ }, {
882
+ isLoading: $e,
883
+ successMessage: a("team.removeMember.successMessage", {
884
+ memberName: e.name
885
+ })
886
+ }), c.close());
887
+ });
888
+ }, f = () => {
889
+ oe.value = null, h.value = te.ADD;
890
+ }, I = v(), k = v(), R = v(), Z = P(() => {
891
+ var e;
892
+ return JSON.stringify({
893
+ businessId: ((e = d.currentBusiness.value) == null ? void 0 : e._id) ?? "",
894
+ search: K.value.trim(),
895
+ restaurantIds: [...I.value ?? []].sort(),
896
+ permissionSubjects: [...k.value ?? []].sort(),
897
+ permissionSetIds: [...R.value ?? []].sort()
898
+ });
899
+ }), ne = P(() => Object.values(ps).map((e) => ({
900
+ label: e.label,
901
+ value: e.subject
902
+ }))), re = P(() => p.permissionSets.value.map((e) => ({
903
+ label: e.name,
904
+ value: e.id
905
+ })));
906
+ async function me() {
907
+ await M.readRoles();
908
+ }
909
+ async function se(e = y.value) {
910
+ var s, U, S;
911
+ ee.value = !0;
912
+ try {
913
+ const T = await Ue.readTeamMembersPage({
914
+ limit: be,
915
+ offset: (e - 1) * be,
916
+ search: K.value.trim() || void 0,
917
+ restaurantIds: (s = I.value) != null && s.length ? I.value : void 0,
918
+ permissionSubjects: (U = k.value) != null && U.length ? k.value : void 0,
919
+ permissionSetIds: (S = R.value) != null && S.length ? R.value : void 0
920
+ });
921
+ q.value = T.items, F.value = T.total;
922
+ } finally {
923
+ ee.value = !1;
924
+ }
925
+ }
926
+ async function Q() {
927
+ var s;
928
+ if (!((s = d.currentBusiness.value) != null && s._id)) return;
929
+ await se(y.value);
930
+ const e = Math.max(1, Math.ceil(F.value / be));
931
+ y.value > e && (y.value = e, await se(y.value));
932
+ }
933
+ const de = v(), Y = v(!1), $e = v(!1);
934
+ async function Ye() {
935
+ if (!de.value) return;
936
+ const e = await de.value.validate();
937
+ if (!e) return;
938
+ const s = h.value === te.ADD;
939
+ await B.minor(async () => {
940
+ await (s ? Ue.createTeamMember(e) : Ue.updateTeamMember(oe.value.id, e)), we(), await Oe(), await Q();
941
+ }, {
942
+ successMessage: s ? a("team.addMember.successMessage", {
943
+ memberName: e.name
944
+ }) : a("team.updateMember.successMessage", {
945
+ memberName: e.name
946
+ }),
947
+ isLoading: Y
948
+ }), h.value = te.CLOSED;
949
+ }
950
+ async function He() {
951
+ await p.readPermissionSets();
952
+ }
953
+ async function Oe() {
954
+ await b.readPermissionAssignments();
955
+ }
956
+ let Ce = !1;
957
+ async function es({
958
+ pageIndex: e
959
+ }) {
960
+ var s;
961
+ if ((s = d.currentBusiness.value) != null && s._id && !Ce && !(e === 0 && y.value === 1 && q.value.length > 0)) {
962
+ Ce = !0, y.value = e + 1;
963
+ try {
964
+ await se(y.value);
965
+ } finally {
966
+ Ce = !1;
967
+ }
968
+ }
969
+ }
970
+ const ss = us(D, () => {
971
+ K.value = D.value;
972
+ });
973
+ return ls(ss), ue(Z, async () => {
974
+ var e;
975
+ y.value = 1, E.value = !1, (e = d.currentBusiness.value) != null && e._id && (await se(1), E.value = !0);
976
+ }, {
977
+ immediate: !0
978
+ }), ue(d.currentBusiness, async () => {
979
+ var e;
980
+ if ((e = d.currentBusiness.value) != null && e._id)
981
+ try {
982
+ await Promise.all([C.readRestaurants(), He(), Oe(), n(), me()]);
983
+ } catch (s) {
984
+ console.error("Failed to load team member dependencies:", s), x.open({
985
+ message: s instanceof Error ? s.message : String(s),
986
+ type: "error"
987
+ });
988
+ }
989
+ }, {
990
+ immediate: !0
991
+ }), A({
992
+ create: f
993
+ }), (e, s) => {
994
+ var xe;
995
+ const U = w("FmSearch"), S = w("FmTable"), T = w("FmButton"), ie = w("FmSideSheet");
996
+ return g(), O(Ie, null, [i("div", Ut, [i("div", St, [o(_e).xs ? (g(), O("div", wt, [u(U, {
997
+ modelValue: D.value,
998
+ "onUpdate:modelValue": s[4] || (s[4] = (V) => D.value = V),
999
+ class: "w-[320px] xs:w-full xs:mt-8",
1000
+ placeholder: o(a)("team.search.placeholder")
1001
+ }, null, 8, ["modelValue", "placeholder"]), i("div", Pt, [u(fe, {
1002
+ modelValue: I.value,
1003
+ "onUpdate:modelValue": s[5] || (s[5] = (V) => I.value = V),
1004
+ multiple: "",
1005
+ items: ae.value,
1006
+ variant: "dark",
1007
+ "selected-prefix": o(a)("team.table.columns.restaurant"),
1008
+ placeholder: o(a)("team.table.columns.restaurant"),
1009
+ class: "!w-auto"
1010
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), u(fe, {
1011
+ modelValue: k.value,
1012
+ "onUpdate:modelValue": s[6] || (s[6] = (V) => k.value = V),
1013
+ multiple: "",
1014
+ variant: "dark",
1015
+ items: ne.value,
1016
+ "selected-prefix": o(a)("team.filter.selected_permission_prefix"),
1017
+ placeholder: o(a)("team.filter.permission_placeholder")
1018
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), u(fe, {
1019
+ modelValue: R.value,
1020
+ "onUpdate:modelValue": s[7] || (s[7] = (V) => R.value = V),
1021
+ multiple: "",
1022
+ variant: "dark",
1023
+ items: re.value,
1024
+ "selected-prefix": o(a)("team.filter.selected_assigned_role_prefix"),
1025
+ placeholder: o(a)("team.filter.assigned_role_placeholder")
1026
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])])) : (g(), O("div", Ft, [i("div", Vt, [u(fe, {
1027
+ modelValue: I.value,
1028
+ "onUpdate:modelValue": s[0] || (s[0] = (V) => I.value = V),
1029
+ multiple: "",
1030
+ items: ae.value,
1031
+ variant: "dark",
1032
+ "selected-prefix": o(a)("team.table.columns.restaurant"),
1033
+ placeholder: o(a)("team.table.columns.restaurant"),
1034
+ class: "!w-auto"
1035
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), u(fe, {
1036
+ modelValue: k.value,
1037
+ "onUpdate:modelValue": s[1] || (s[1] = (V) => k.value = V),
1038
+ multiple: "",
1039
+ variant: "dark",
1040
+ items: ne.value,
1041
+ "selected-prefix": o(a)("team.filter.selected_permission_prefix"),
1042
+ placeholder: o(a)("team.filter.permission_placeholder")
1043
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), u(fe, {
1044
+ modelValue: R.value,
1045
+ "onUpdate:modelValue": s[2] || (s[2] = (V) => R.value = V),
1046
+ multiple: "",
1047
+ variant: "dark",
1048
+ items: re.value,
1049
+ "selected-prefix": o(a)("team.filter.selected_assigned_role_prefix"),
1050
+ placeholder: o(a)("team.filter.assigned_role_placeholder")
1051
+ }, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), u(U, {
1052
+ modelValue: D.value,
1053
+ "onUpdate:modelValue": s[3] || (s[3] = (V) => D.value = V),
1054
+ class: "w-[320px] xs:w-full xs:mt-8",
1055
+ autofocus: "",
1056
+ placeholder: o(a)("team.search.placeholder")
1057
+ }, null, 8, ["modelValue", "placeholder"])])), (xe = o(d).currentBusiness.value) != null && xe._id ? (g(), H(vs, {
1058
+ key: 2
1059
+ }, {
1060
+ default: pe(() => [i("div", It, [E.value ? F.value === 0 ? (g(), H(o(hs), {
1061
+ key: 1,
1062
+ title: o(a)("team.emptyState.title"),
1063
+ subtitle: o(a)("team.emptyState.description")
1064
+ }, null, 8, ["title", "subtitle"])) : J("", !0) : (g(), H(fs, {
1065
+ key: 0
1066
+ })), E.value ? (g(), H(S, {
1067
+ key: Z.value,
1068
+ "column-defs": _,
1069
+ "row-data": q.value,
1070
+ "page-size": be,
1071
+ "page-count": Math.ceil(F.value / be),
1072
+ "row-count": F.value,
1073
+ "fetch-fn": es,
1074
+ "hide-footer": F.value <= be,
1075
+ loading: ee.value,
1076
+ "pin-header-row": "",
1077
+ onRowClick: s[8] || (s[8] = (V) => G(o(ye).Update, V.original))
1078
+ }, null, 8, ["row-data", "page-count", "row-count", "hide-footer", "loading"])) : J("", !0)])]),
1079
+ _: 1
1080
+ })) : J("", !0)])]), u(ie, {
1081
+ header: Re.value,
1082
+ "model-value": W.value,
1083
+ "max-width": 960,
1084
+ "onOn:clickedAway": o(ve),
1085
+ "onOn:close": o(ve)
1086
+ }, {
1087
+ "side-sheet-footer": pe(() => [i("div", kt, [u(T, {
1088
+ label: he.value,
1089
+ size: "md",
1090
+ variant: "primary",
1091
+ "is-loading": Y.value,
1092
+ disabled: Y.value,
1093
+ onClick: Se(Ye, ["prevent"])
1094
+ }, null, 8, ["label", "is-loading", "disabled"]), u(T, {
1095
+ label: o(a)("common.cancel"),
1096
+ size: "md",
1097
+ variant: "secondary",
1098
+ disabled: Y.value,
1099
+ onClick: ge
1100
+ }, null, 8, ["label", "disabled"])])]),
1101
+ default: pe(() => [u(xt, {
1102
+ ref_key: "memberForm",
1103
+ ref: de,
1104
+ initialValue: oe.value,
1105
+ loading: z.value,
1106
+ class: "gap-8"
1107
+ }, null, 8, ["initialValue", "loading"])]),
1108
+ _: 1
1109
+ }, 8, ["header", "model-value", "onOn:clickedAway", "onOn:close"])], 64);
1110
+ };
1111
+ }
1112
+ });
1113
+ export {
1114
+ zt as default
1115
+ };