@feedmepos/mf-hrm-portal 2.0.17-dev.3 → 2.0.17-dev.4

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 (51) hide show
  1. package/dist/{AuditLogList-C6qAeY5g.js → AuditLogList-CV82_8fj.js} +350 -324
  2. package/dist/EmployeeList-dE0So94R.js +736 -0
  3. package/dist/FormSection.vue_vue_type_script_setup_true_lang-BVb8c4YU.js +71 -0
  4. package/dist/HorizontalSplitter-o860F4xM.js +12 -0
  5. package/dist/{Main-Dkr5lzbv.js → Main-BAx-c_oZ.js} +9 -9
  6. package/dist/{Main-BNXKItvX.js → Main-CfAQYaaW.js} +14 -16
  7. package/dist/{Main--tejoyEP.js → Main-CyReTP3K.js} +8 -8
  8. package/dist/PermissionSetList-DmsJnW2i.js +341 -0
  9. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BbcY9q1x.js +3480 -0
  10. package/dist/RoleList-CKB8L-BW.js +530 -0
  11. package/dist/TeamMemberList-CszlbmAX.js +1108 -0
  12. package/dist/{TimesheetList-D-3k0Uad.js → TimesheetList-NRUfSiYL.js} +6 -6
  13. package/dist/{app-BjXuSCis.js → app-B0bANDrM.js} +1891 -1404
  14. package/dist/app.js +1 -1
  15. package/dist/{dayjs.min-z-vrgFCL.js → dayjs.min-DdUO0d-2.js} +1 -1
  16. package/dist/{employee-DAqAMupR.js → employee-DJDUT0Wj.js} +3 -3
  17. package/dist/{iteration-Cp1eSTJA.js → iteration-DqYIXL4P.js} +1 -1
  18. package/dist/{lodash-CXLZQQp8.js → lodash-BBQT31li.js} +1 -1
  19. package/dist/rule-T7VKkRdN.js +996 -0
  20. package/dist/src/api/report-query/index.d.ts +2 -2
  21. package/dist/src/components/CheckboxInput.vue.d.ts +1 -1
  22. package/dist/src/components/CollapsibleWrapper.vue.d.ts +0 -2
  23. package/dist/src/composables/useBasePermission.d.ts +1 -1
  24. package/dist/src/views/hr/locales/index.d.ts +172 -16
  25. package/dist/src/views/team/components/BasePermission.vue.d.ts +6 -2
  26. package/dist/src/views/team/components/PosRolePermission.vue.d.ts +2 -2
  27. package/dist/src/views/team/locales/index.d.ts +312 -32
  28. package/dist/src/views/team/member/AddMemberForm.vue.d.ts +3 -5
  29. package/dist/style.css +1 -1
  30. package/dist/{timesheet-BlPhOifI.js → timesheet-DjtuB4we.js} +2 -2
  31. package/dist/tsconfig.app.tsbuildinfo +1 -1
  32. package/dist/{useAppStore-BVnrWyPF.js → useAppStore-CBb-dugK.js} +1 -1
  33. package/dist/useDebounce-B8ZPVS5C.js +15 -0
  34. package/dist/useDiscardConfirm-BHni0LNu.js +28 -0
  35. package/dist/{useLoading-7ia-Bps7.js → useLoading-BCOj8y-t.js} +1 -1
  36. package/dist/useReportPermissions-DyzhBpi8.js +70 -0
  37. package/dist/useSearch-B6WK1LBB.js +15 -0
  38. package/package.json +2 -2
  39. package/dist/CollapsibleWrapper.vue_vue_type_script_setup_true_lang-BLJlmPVa.js +0 -58
  40. package/dist/EmployeeList-COtXtTqG.js +0 -827
  41. package/dist/FormItem.vue_vue_type_script_setup_true_lang-CoorkndT.js +0 -34
  42. package/dist/FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js +0 -49
  43. package/dist/PermissionSetList-B_Sdvbu7.js +0 -340
  44. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BBsaxaXu.js +0 -3439
  45. package/dist/RoleList-SZCgvYvC.js +0 -543
  46. package/dist/TeamMemberList-Dk5HeFfQ.js +0 -1008
  47. package/dist/rule-vBxopbM_.js +0 -990
  48. package/dist/team-CnQ_rIx2.js +0 -33
  49. package/dist/useDiscardConfirm-DPhEV6v0.js +0 -157
  50. package/dist/useReportPermissions-C8HMek35.js +0 -60
  51. package/dist/useSearch-BAPEUu1R.js +0 -15
@@ -1,15 +1,15 @@
1
- import { defineComponent as Ae, ref as h, computed as w, onMounted as ft, onBeforeUnmount as vt, watch as Q, resolveComponent as C, createElementBlock as b, openBlock as c, createBlock as oe, createCommentVNode as V, createElementVNode as l, Fragment as ee, renderList as se, withCtx as N, createVNode as u, toDisplayString as i, unref as n, nextTick as pt } from "vue";
2
- import { d as y } from "./dayjs.min-z-vrgFCL.js";
3
- import { useI18n as Ee, useCoreStore as gt } from "@feedmepos/mf-common";
4
- import { f as Ve, _ as bt } from "./app-BjXuSCis.js";
5
- import { components as Oe } from "@feedmepos/ui-library";
6
- import { g as ht, b as yt } from "./iteration-Cp1eSTJA.js";
1
+ import { defineComponent as Ee, ref as p, computed as L, onMounted as ft, onBeforeUnmount as vt, watch as Q, resolveComponent as E, createElementBlock as y, openBlock as m, createBlock as oe, createCommentVNode as V, createElementVNode as l, Fragment as ee, renderList as se, withCtx as Y, createVNode as u, toDisplayString as i, unref as n, nextTick as pt } from "vue";
2
+ import { d as _ } from "./dayjs.min-DdUO0d-2.js";
3
+ import { useI18n as Ae, useCoreStore as bt } from "@feedmepos/mf-common";
4
+ import { f as Oe, _ as gt } from "./app-B0bANDrM.js";
5
+ import { components as Ve } from "@feedmepos/ui-library";
6
+ import { g as ht, b as yt } from "./iteration-DqYIXL4P.js";
7
7
  import { S as ce } from "./SelectFilter-DUj7GBtT.js";
8
8
  import { _ as _t } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
9
9
  import { _ as xt } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
10
- import { p as Pe } from "./rule-vBxopbM_.js";
11
- import { u as Lt } from "./team-CnQ_rIx2.js";
12
- const be = [
10
+ import { t as Lt, p as Pe } from "./rule-T7VKkRdN.js";
11
+ import { defineStore as St } from "pinia";
12
+ const ge = [
13
13
  { key: "all", label: "All", subjectPrefixes: [] },
14
14
  { key: "inventory", label: "Inventory", subjectPrefixes: ["business::inventory", "inventory"] },
15
15
  { key: "report", label: "Report", subjectPrefixes: ["business::report", "report"] },
@@ -19,206 +19,228 @@ const be = [
19
19
  { key: "crm", label: "CRM", subjectPrefixes: ["business::crm", "crm"] }
20
20
  // Add more as modules are revamped with new actionguard:
21
21
  // { key: 'restaurantOperation', label: 'Restaurant Operation', subjectPrefixes: ['restaurant'] },
22
- ], St = "/audit-logs", je = {
23
- async read(s) {
24
- var x, O, E, T, M;
22
+ ], kt = "/audit-logs", je = {
23
+ async read(o) {
24
+ var x, T, P, I, c;
25
25
  const a = {
26
- limit: (s == null ? void 0 : s.limit) ?? 100,
27
- offset: (s == null ? void 0 : s.offset) ?? 0,
28
- ...s != null && s.from ? { from: s.from } : {},
29
- ...s != null && s.to ? { to: s.to } : {},
30
- ...(x = s == null ? void 0 : s.userIds) != null && x.length ? { userIds: s.userIds } : {},
31
- ...(O = s == null ? void 0 : s.subjects) != null && O.length ? { subjects: s.subjects } : {},
32
- ...(E = s == null ? void 0 : s.subjectPrefixes) != null && E.length ? { subjectPrefixes: s.subjectPrefixes } : {},
33
- ...(T = s == null ? void 0 : s.actions) != null && T.length ? { actions: s.actions } : {},
34
- ...(M = s == null ? void 0 : s.outcomes) != null && M.length ? { outcomes: s.outcomes } : {}
26
+ limit: (o == null ? void 0 : o.limit) ?? 100,
27
+ offset: (o == null ? void 0 : o.offset) ?? 0,
28
+ ...o != null && o.from ? { from: o.from } : {},
29
+ ...o != null && o.to ? { to: o.to } : {},
30
+ ...(x = o == null ? void 0 : o.userIds) != null && x.length ? { userIds: o.userIds } : {},
31
+ ...(T = o == null ? void 0 : o.subjects) != null && T.length ? { subjects: o.subjects } : {},
32
+ ...(P = o == null ? void 0 : o.subjectPrefixes) != null && P.length ? { subjectPrefixes: o.subjectPrefixes } : {},
33
+ ...(I = o == null ? void 0 : o.actions) != null && I.length ? { actions: o.actions } : {},
34
+ ...(c = o == null ? void 0 : o.outcomes) != null && c.length ? { outcomes: o.outcomes } : {}
35
35
  };
36
36
  return console.log("[AuditLogAPI] request params:", a), ht(
37
- await yt().get(St, {
37
+ await yt().get(kt, {
38
38
  params: a,
39
39
  // Serialize arrays as repeated params: key=val1&key=val2
40
40
  // (NestJS @Query expects this; axios default adds brackets which break matching)
41
- paramsSerializer: (o) => {
42
- const I = new URLSearchParams();
43
- for (const [Y, p] of Object.entries(o))
44
- if (Array.isArray(p))
45
- for (const P of p) I.append(Y, String(P));
46
- else p != null && I.append(Y, String(p));
47
- return console.log("[AuditLogAPI] serialized query string:", I.toString()), I.toString();
41
+ paramsSerializer: (s) => {
42
+ const w = new URLSearchParams();
43
+ for (const [R, g] of Object.entries(s))
44
+ if (Array.isArray(g))
45
+ for (const j of g) w.append(R, String(j));
46
+ else g != null && w.append(R, String(g));
47
+ return console.log("[AuditLogAPI] serialized query string:", w.toString()), w.toString();
48
48
  }
49
49
  })
50
50
  );
51
51
  }
52
- }, kt = { class: "flex h-[46px] items-center gap-8 rounded-sm px-16 hover:bg-fm-color-opacity-sm" }, wt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Mt = {
52
+ }, wt = { class: "flex h-[46px] items-center gap-8 rounded-sm px-16 hover:bg-fm-color-opacity-sm" }, Mt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ft = {
53
53
  "data-more-measure": "",
54
54
  class: "flex h-[46px] items-center gap-8 rounded-sm px-16"
55
- }, Ft = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Dt = /* @__PURE__ */ Ae({
55
+ }, It = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Tt = /* @__PURE__ */ Ee({
56
56
  __name: "AuditLogModuleTabs",
57
57
  props: {
58
58
  modelValue: {},
59
59
  items: {}
60
60
  },
61
61
  emits: ["update:modelValue"],
62
- setup(s, { emit: a }) {
63
- const x = s, O = a, { t: E } = Ee(), T = h(!1), M = h(null), o = h(null), I = h([]), Y = h(0), p = h(0);
64
- let P = null;
65
- async function F() {
66
- if (await pt(), !o.value) return;
67
- const m = o.value.querySelectorAll("[data-tab-measure]");
68
- I.value = Array.from(m).map((S) => S.offsetWidth);
69
- const f = o.value.querySelector("[data-more-measure]");
70
- Y.value = (f == null ? void 0 : f.offsetWidth) ?? 0;
62
+ setup(o, { emit: a }) {
63
+ const x = o, T = a, { t: P } = Ae(), I = p(!1), c = p(null), s = p(null), w = p([]), R = p(0), g = p(0);
64
+ let j = null;
65
+ async function D() {
66
+ if (await pt(), !s.value) return;
67
+ const f = s.value.querySelectorAll("[data-tab-measure]");
68
+ w.value = Array.from(f).map((M) => M.offsetWidth);
69
+ const v = s.value.querySelector("[data-more-measure]");
70
+ R.value = (v == null ? void 0 : v.offsetWidth) ?? 0;
71
71
  }
72
- const J = w(() => {
73
- const m = x.items.length;
74
- if (m === 0) return 0;
75
- if (!p.value || I.value.length !== m) return m;
76
- const f = I.value;
77
- if (f.reduce((r, B) => r + B, 0) <= p.value) return m;
78
- const k = Y.value;
79
- let z = 0, U = 0;
80
- for (let r = 0; r < m && !(z + f[r] + k > p.value); r++)
81
- z += f[r], U++;
82
- return U;
83
- }), te = w(() => {
84
- const m = J.value, f = x.items.length;
85
- if (m >= f) return [...x.items];
86
- const S = x.items.slice(0, m), k = x.items.find((g) => g.value === x.modelValue);
87
- if (!k || S.some((g) => g.value === k.value)) return S;
88
- if (m === 0) return [k];
89
- const z = x.items.findIndex((g) => g.value === k.value), U = I.value, r = Y.value, B = U[z] ?? 0;
90
- let H = m, ne = U.slice(0, H - 1).reduce((g, ae) => g + ae, 0);
91
- for (; H > 1 && ne + B + r > p.value; )
92
- H--, ne = U.slice(0, H - 1).reduce((g, ae) => g + ae, 0);
93
- return [...x.items.slice(0, Math.max(H - 1, 0)), k];
94
- }), $ = w(() => {
95
- const m = new Set(te.value.map((f) => f.value));
96
- return x.items.filter((f) => !m.has(f.value));
72
+ const J = L(() => {
73
+ const f = x.items.length;
74
+ if (f === 0) return 0;
75
+ if (!g.value || w.value.length !== f) return f;
76
+ const v = w.value;
77
+ if (v.reduce((r, B) => r + B, 0) <= g.value) return f;
78
+ const F = R.value;
79
+ let z = 0, N = 0;
80
+ for (let r = 0; r < f && !(z + v[r] + F > g.value); r++)
81
+ z += v[r], N++;
82
+ return N;
83
+ }), te = L(() => {
84
+ const f = J.value, v = x.items.length;
85
+ if (f >= v) return [...x.items];
86
+ const M = x.items.slice(0, f), F = x.items.find((h) => h.value === x.modelValue);
87
+ if (!F || M.some((h) => h.value === F.value)) return M;
88
+ if (f === 0) return [F];
89
+ const z = x.items.findIndex((h) => h.value === F.value), N = w.value, r = R.value, B = N[z] ?? 0;
90
+ let H = f, ne = N.slice(0, H - 1).reduce((h, ae) => h + ae, 0);
91
+ for (; H > 1 && ne + B + r > g.value; )
92
+ H--, ne = N.slice(0, H - 1).reduce((h, ae) => h + ae, 0);
93
+ return [...x.items.slice(0, Math.max(H - 1, 0)), F];
94
+ }), $ = L(() => {
95
+ const f = new Set(te.value.map((v) => v.value));
96
+ return x.items.filter((v) => !f.has(v.value));
97
97
  });
98
- function R(m) {
99
- T.value = !1, O("update:modelValue", m);
98
+ function U(f) {
99
+ I.value = !1, T("update:modelValue", f);
100
100
  }
101
101
  return ft(async () => {
102
- await F(), M.value && (p.value = M.value.clientWidth, P = new ResizeObserver(() => {
103
- M.value && (p.value = M.value.clientWidth);
104
- }), P.observe(M.value));
102
+ await D(), c.value && (g.value = c.value.clientWidth, j = new ResizeObserver(() => {
103
+ c.value && (g.value = c.value.clientWidth);
104
+ }), j.observe(c.value));
105
105
  }), vt(() => {
106
- P == null || P.disconnect(), P = null;
106
+ j == null || j.disconnect(), j = null;
107
107
  }), Q(
108
108
  () => x.items,
109
109
  () => {
110
- F();
110
+ D();
111
111
  },
112
112
  { deep: !0 }
113
- ), (m, f) => {
114
- const S = C("FmTab"), k = C("FmIcon"), z = C("FmMenuItem"), U = C("FmMenu");
115
- return c(), b("div", {
113
+ ), (f, v) => {
114
+ const M = E("FmTab"), F = E("FmIcon"), z = E("FmMenuItem"), N = E("FmMenu");
115
+ return m(), y("div", {
116
116
  ref_key: "containerRef",
117
- ref: M,
117
+ ref: c,
118
118
  class: "relative flex w-full flex-row items-center"
119
119
  }, [
120
- (c(!0), b(ee, null, se(te.value, (r) => (c(), oe(S, {
120
+ (m(!0), y(ee, null, se(te.value, (r) => (m(), oe(M, {
121
121
  key: r.value,
122
- "model-value": s.modelValue,
122
+ "model-value": o.modelValue,
123
123
  label: r.label,
124
124
  badge: r.badge,
125
125
  disabled: r.disabled,
126
126
  value: r.value,
127
- "onUpdate:modelValue": R
127
+ "onUpdate:modelValue": U
128
128
  }, null, 8, ["model-value", "label", "badge", "disabled", "value"]))), 128)),
129
- $.value.length > 0 ? (c(), oe(U, {
129
+ $.value.length > 0 ? (m(), oe(N, {
130
130
  key: 0,
131
- "show-menu": T.value,
131
+ "show-menu": I.value,
132
132
  class: "max-w-[360px] min-w-[90px] rounded-sm",
133
133
  placement: "bottom-start",
134
- onMenuChanged: f[0] || (f[0] = (r) => T.value = r)
134
+ onMenuChanged: v[0] || (v[0] = (r) => I.value = r)
135
135
  }, {
136
- "menu-button": N(() => [
137
- l("div", kt, [
138
- u(k, { name: "more_vert" }),
139
- l("span", wt, i(n(E)("auditLog.modules.more")), 1)
136
+ "menu-button": Y(() => [
137
+ l("div", wt, [
138
+ u(F, { name: "more_vert" }),
139
+ l("span", Mt, i(n(P)("auditLog.modules.more")), 1)
140
140
  ])
141
141
  ]),
142
- default: N(() => [
143
- (c(!0), b(ee, null, se($.value, (r) => (c(), oe(z, {
142
+ default: Y(() => [
143
+ (m(!0), y(ee, null, se($.value, (r) => (m(), oe(z, {
144
144
  key: r.value,
145
- "model-value": s.modelValue === r.value,
145
+ "model-value": o.modelValue === r.value,
146
146
  label: r.label,
147
147
  disabled: r.disabled,
148
- onClick: (B) => R(r.value)
148
+ onClick: (B) => U(r.value)
149
149
  }, null, 8, ["model-value", "label", "disabled", "onClick"]))), 128))
150
150
  ]),
151
151
  _: 1
152
152
  }, 8, ["show-menu"])) : V("", !0),
153
153
  l("div", {
154
154
  ref_key: "measurerRef",
155
- ref: o,
155
+ ref: s,
156
156
  "aria-hidden": "true",
157
157
  class: "pointer-events-none invisible absolute -left-[9999px] -top-[9999px] flex flex-row items-center"
158
158
  }, [
159
- (c(!0), b(ee, null, se(s.items, (r) => (c(), b("div", {
159
+ (m(!0), y(ee, null, se(o.items, (r) => (m(), y("div", {
160
160
  key: `measure-${r.value}`,
161
161
  "data-tab-measure": ""
162
162
  }, [
163
- u(S, {
164
- "model-value": s.modelValue,
163
+ u(M, {
164
+ "model-value": o.modelValue,
165
165
  label: r.label,
166
166
  badge: r.badge,
167
167
  disabled: r.disabled,
168
168
  value: r.value
169
169
  }, null, 8, ["model-value", "label", "badge", "disabled", "value"])
170
170
  ]))), 128)),
171
- l("div", Mt, [
172
- u(k, { name: "more_vert" }),
173
- l("span", Ft, i(n(E)("auditLog.modules.more")), 1)
171
+ l("div", Ft, [
172
+ u(F, { name: "more_vert" }),
173
+ l("span", It, i(n(P)("auditLog.modules.more")), 1)
174
174
  ])
175
175
  ], 512)
176
176
  ], 512);
177
177
  };
178
178
  }
179
- }), Tt = {
179
+ }), Dt = St("team", () => {
180
+ const o = p([]), a = p(!1), x = L(
181
+ () => Object.fromEntries(o.value.map((c) => [c.doc.userId, c.name]))
182
+ ), T = L(
183
+ () => Object.fromEntries(o.value.map((c) => [c.doc.userId, c.email]))
184
+ ), P = L(
185
+ () => Object.fromEntries(o.value.map((c) => [c.doc.userId, c.phoneNumber]))
186
+ );
187
+ async function I({ force: c = !1 } = {}) {
188
+ if (!(!c && o.value.length > 0))
189
+ try {
190
+ a.value = !0;
191
+ const s = await Lt.readTeamMembers();
192
+ o.value = s.sort((w, R) => w.doc.isOwner ? -1 : w.name.localeCompare(R.name));
193
+ } finally {
194
+ a.value = !1;
195
+ }
196
+ }
197
+ return {
198
+ members: o,
199
+ isLoading: a,
200
+ userIdToName: x,
201
+ userIdToEmail: T,
202
+ userIdToPhone: P,
203
+ readTeamMembers: I
204
+ };
205
+ }), Ot = {
180
206
  class: "flex flex-col gap-4 p-12 w-[260px]"
181
- }, It = {
182
- class: "text-xs font-semibold text-fm-color-typo-secondary mb-4"
183
207
  }, Vt = {
208
+ class: "text-xs font-semibold text-fm-color-typo-secondary mb-4"
209
+ }, Pt = {
184
210
  class: "flex min-h-0 flex-1 flex-col gap-16"
185
- }, Ot = {
211
+ }, jt = {
186
212
  class: "space-y-16"
187
- }, Pt = {
213
+ }, Ct = {
188
214
  class: "flex flex-wrap items-center gap-8"
189
- }, jt = {
215
+ }, Et = {
190
216
  class: "w-fit"
191
- }, Ct = {
217
+ }, At = {
192
218
  key: 0,
193
219
  class: "w-fit"
194
- }, At = {
220
+ }, Rt = {
195
221
  class: "w-fit"
196
- }, Et = {
222
+ }, Ut = {
197
223
  class: "w-fit"
198
- }, Rt = {
224
+ }, Nt = {
199
225
  class: "flex h-full flex-col"
200
- }, Ut = {
226
+ }, $t = {
201
227
  key: 0,
202
228
  class: "flex shrink-0 items-center justify-end border-t border-fm-color-border-default py-4"
203
- }, $t = {
229
+ }, Yt = {
204
230
  class: "text-sm text-fm-color-typo-secondary"
205
- }, Nt = {
231
+ }, zt = {
206
232
  key: 0,
207
233
  class: "space-y-12 p-4 text-sm"
208
- }, Yt = {
209
- class: "flex items-start justify-between gap-8 rounded-lg border border-fm-color-border-default p-12"
210
- }, zt = {
211
- class: "min-w-0 flex-1"
212
234
  }, Bt = {
213
- class: "audit-log-operation-label-detail text-base font-bold leading-snug text-fm-color-typo-primary"
235
+ class: "flex items-start justify-between gap-8 rounded-lg border border-fm-color-border-default p-12"
214
236
  }, Kt = {
215
- class: "rounded-lg border border-fm-color-border-default p-12"
237
+ class: "min-w-0 flex-1"
216
238
  }, qt = {
217
- class: "space-y-12"
239
+ class: "audit-log-operation-label-detail text-base font-bold leading-snug text-fm-color-typo-primary"
218
240
  }, Ht = {
219
- class: "text-xs text-fm-color-typo-secondary"
241
+ class: "rounded-lg border border-fm-color-border-default p-12"
220
242
  }, Wt = {
221
- class: "font-semibold"
243
+ class: "space-y-12"
222
244
  }, Jt = {
223
245
  class: "text-xs text-fm-color-typo-secondary"
224
246
  }, Gt = {
@@ -226,17 +248,17 @@ const be = [
226
248
  }, Xt = {
227
249
  class: "text-xs text-fm-color-typo-secondary"
228
250
  }, Zt = {
229
- class: "break-all font-semibold"
251
+ class: "font-semibold"
230
252
  }, Qt = {
231
253
  class: "text-xs text-fm-color-typo-secondary"
232
254
  }, ea = {
233
- class: "font-semibold"
255
+ class: "break-all font-semibold"
234
256
  }, ta = {
235
- key: 0
236
- }, aa = {
237
257
  class: "text-xs text-fm-color-typo-secondary"
258
+ }, aa = {
259
+ class: "font-semibold"
238
260
  }, la = {
239
- class: "break-all font-mono text-xs font-semibold"
261
+ key: 0
240
262
  }, oa = {
241
263
  class: "text-xs text-fm-color-typo-secondary"
242
264
  }, sa = {
@@ -244,176 +266,180 @@ const be = [
244
266
  }, na = {
245
267
  class: "text-xs text-fm-color-typo-secondary"
246
268
  }, ia = {
247
- class: "font-semibold"
269
+ class: "break-all font-mono text-xs font-semibold"
248
270
  }, ra = {
271
+ class: "text-xs text-fm-color-typo-secondary"
272
+ }, ua = {
273
+ class: "font-semibold"
274
+ }, da = {
249
275
  key: 0,
250
276
  class: "rounded-lg border border-fm-color-border-default"
251
- }, ua = {
277
+ }, ca = {
252
278
  class: "p-12"
253
- }, da = {
279
+ }, ma = {
254
280
  class: "text-base font-bold text-fm-color-typo-primary"
255
- }, ca = {
281
+ }, fa = {
256
282
  class: "space-y-12 p-12"
257
- }, ma = {
283
+ }, va = {
258
284
  class: "text-xs text-fm-color-typo-secondary"
259
- }, fa = {
285
+ }, pa = {
260
286
  class: "font-semibold"
261
- }, va = {
287
+ }, ba = {
262
288
  class: "rounded-lg border border-fm-color-border-default"
263
- }, pa = {
264
- class: "p-12"
265
289
  }, ga = {
290
+ class: "p-12"
291
+ }, ha = {
266
292
  class: "text-base font-bold text-fm-color-typo-primary"
267
- }, ba = {
293
+ }, ya = {
268
294
  class: "space-y-12 p-12"
269
- }, ha = {
295
+ }, _a = {
270
296
  class: "text-xs text-fm-color-typo-secondary"
271
- }, ya = {
297
+ }, xa = {
272
298
  class: "font-semibold"
273
- }, _a = {
299
+ }, La = {
274
300
  key: 0
275
- }, xa = {
301
+ }, Sa = {
276
302
  class: "text-xs text-fm-color-typo-secondary"
277
- }, La = {
303
+ }, ka = {
278
304
  key: 0,
279
305
  class: "font-semibold"
280
- }, Sa = {
306
+ }, wa = {
281
307
  key: 1,
282
308
  class: "break-all font-mono text-xs text-fm-color-typo-secondary"
283
- }, ka = {
309
+ }, Ma = {
284
310
  key: 1
285
- }, wa = {
311
+ }, Fa = {
286
312
  class: "text-xs text-fm-color-typo-secondary"
287
- }, Ma = {
313
+ }, Ia = {
288
314
  class: "font-semibold whitespace-pre-line"
289
- }, Fa = {
315
+ }, Ta = {
290
316
  class: "text-xs text-fm-color-typo-secondary"
291
317
  }, Da = {
292
318
  class: "font-semibold"
293
- }, Ta = {
319
+ }, Oa = {
294
320
  class: "text-xs text-fm-color-typo-secondary"
295
- }, Ia = {
296
- class: "break-all font-mono text-xs font-semibold"
297
321
  }, Va = {
322
+ class: "break-all font-mono text-xs font-semibold"
323
+ }, Pa = {
298
324
  key: 2
299
- }, Oa = {
325
+ }, ja = {
300
326
  class: "text-xs text-fm-color-typo-secondary"
301
- }, Pa = {
327
+ }, Ca = {
302
328
  class: "mt-4 space-y-4"
303
- }, ja = {
329
+ }, Ea = {
304
330
  class: "flex h-16 w-16 shrink-0 items-center justify-center rounded-full bg-fm-color-primary-default text-xs font-bold text-white"
305
- }, Ca = {
306
- class: "text-xs font-semibold"
307
331
  }, Aa = {
332
+ class: "text-xs font-semibold"
333
+ }, Ra = {
308
334
  key: 0,
309
335
  class: "text-fm-color-typo-secondary"
310
- }, Ea = {
336
+ }, Ua = {
311
337
  key: 3
312
- }, Ra = {
338
+ }, Na = {
313
339
  class: "text-xs text-fm-color-typo-secondary"
314
- }, Ua = {
340
+ }, $a = {
315
341
  class: "mt-4 max-h-[400px] overflow-auto rounded bg-gray-100 p-8 font-mono text-xs leading-relaxed shadow-inner whitespace-pre-wrap break-all"
316
- }, he = 100, ye = 1e3, $a = "YYYY-MM-DD HH:mm", D = "YYYY-MM-DD", Ce = "audit-log-export-fields", el = /* @__PURE__ */ Ae({
342
+ }, he = 100, ye = 1e3, Ya = "YYYY-MM-DD HH:mm", O = "YYYY-MM-DD", Ce = "audit-log-export-fields", al = /* @__PURE__ */ Ee({
317
343
  __name: "AuditLogList",
318
- setup(s) {
344
+ setup(o) {
319
345
  const {
320
346
  t: a
321
- } = Ee(), x = gt(), O = Lt(), E = h(!1), T = h(!1), M = h([]), o = h(null), I = h(!1);
322
- async function Y(e) {
323
- const t = Uint8Array.from(atob(e), (_) => _.charCodeAt(0)), v = new DecompressionStream("gzip"), L = v.writable.getWriter();
324
- return await L.write(t), await L.close(), new Response(v.readable).text();
347
+ } = Ae(), x = bt(), T = Dt(), P = p(!1), I = p(!1), c = p([]), s = p(null), w = p(!1);
348
+ async function R(e) {
349
+ const t = Uint8Array.from(atob(e), (S) => S.charCodeAt(0)), b = new DecompressionStream("gzip"), k = b.writable.getWriter();
350
+ return await k.write(t), await k.close(), new Response(b.readable).text();
325
351
  }
326
- const p = h("");
327
- let P = 0;
352
+ const g = p("");
353
+ let j = 0;
328
354
  Q(() => {
329
355
  var e, t;
330
- return (t = (e = o.value) == null ? void 0 : e.metadata) == null ? void 0 : t.requestBody;
356
+ return (t = (e = s.value) == null ? void 0 : e.metadata) == null ? void 0 : t.requestBody;
331
357
  }, async (e) => {
332
- const t = ++P;
358
+ const t = ++j;
333
359
  if (!e) {
334
- p.value = "";
360
+ g.value = "";
335
361
  return;
336
362
  }
337
363
  if (typeof e == "object") {
338
- p.value = JSON.stringify(e, null, 2);
364
+ g.value = JSON.stringify(e, null, 2);
339
365
  return;
340
366
  }
341
367
  if (e.startsWith("gzip:")) {
342
368
  try {
343
- const v = await Y(e.slice(5));
344
- if (t !== P) return;
345
- p.value = JSON.stringify(JSON.parse(v), null, 2);
369
+ const b = await R(e.slice(5));
370
+ if (t !== j) return;
371
+ g.value = JSON.stringify(JSON.parse(b), null, 2);
346
372
  } catch {
347
- if (t !== P) return;
348
- p.value = e;
373
+ if (t !== j) return;
374
+ g.value = e;
349
375
  }
350
376
  return;
351
377
  }
352
378
  try {
353
- p.value = JSON.stringify(JSON.parse(e), null, 2);
379
+ g.value = JSON.stringify(JSON.parse(e), null, 2);
354
380
  } catch {
355
- p.value = e;
381
+ g.value = e;
356
382
  }
357
383
  }, {
358
384
  immediate: !0
359
385
  });
360
- const F = h(1), J = h(!1), te = y().format("YYYY-MM-DD"), $ = h({
386
+ const D = p(1), J = p(!1), te = _().format("YYYY-MM-DD"), $ = p({
361
387
  startDate: `${te} 00:00`,
362
388
  endDate: `${te} 23:59`
363
- }), R = h(), m = h(), f = h(), S = h(), k = h("all");
389
+ }), U = p(), f = p(), v = p(), M = p(), F = p("all");
364
390
  function z(e) {
365
391
  return typeof e == "string" ? [e] : Array.isArray(e) ? e.filter((t) => typeof t == "string") : [];
366
392
  }
367
- const U = w(() => be.map(({
393
+ const N = L(() => ge.map(({
368
394
  key: e
369
395
  }) => ({
370
396
  label: a(`auditLog.modules.${e}`),
371
397
  value: e
372
- }))), r = w(() => be.find((e) => e.key === k.value) ?? be[0]), B = w(() => k.value === "all"), H = w(() => O.members.map((e) => ({
398
+ }))), r = L(() => ge.find((e) => e.key === F.value) ?? ge[0]), B = L(() => F.value === "all"), H = L(() => T.members.map((e) => ({
373
399
  label: e.name,
374
400
  value: e.doc.userId
375
- }))), ne = w(() => {
376
- const e = Pe.flatMap((_) => z(_.subject).map((A) => ({
377
- label: _.label,
401
+ }))), ne = L(() => {
402
+ const e = Pe.flatMap((S) => z(S.subject).map((A) => ({
403
+ label: S.label,
378
404
  value: A
379
- }))), t = Object.entries(Ve).map(([_, A]) => ({
405
+ }))), t = Object.entries(Oe).map(([S, A]) => ({
380
406
  label: A,
381
- value: _
382
- })), v = /* @__PURE__ */ new Set(), L = [];
383
- for (const _ of [...e, ...t])
384
- v.has(_.value) || (v.add(_.value), L.push(_));
385
- return L;
407
+ value: S
408
+ })), b = /* @__PURE__ */ new Set(), k = [];
409
+ for (const S of [...e, ...t])
410
+ b.has(S.value) || (b.add(S.value), k.push(S));
411
+ return k;
386
412
  });
387
413
  function _e(e, t) {
388
- const v = t.toLowerCase();
389
- return e.label.toLowerCase().includes(v) || e.value.replace(/^business::/, "").toLowerCase().includes(v) ? !0 : e.value.toLowerCase().includes(v);
414
+ const b = t.toLowerCase();
415
+ return e.label.toLowerCase().includes(b) || e.value.replace(/^business::/, "").toLowerCase().includes(b) ? !0 : e.value.toLowerCase().includes(b);
390
416
  }
391
- const g = w(() => ({
417
+ const h = L(() => ({
392
418
  manage: a("auditLog.action.manage"),
393
419
  create: a("auditLog.action.create"),
394
420
  read: a("auditLog.action.read"),
395
421
  update: a("auditLog.action.update"),
396
422
  delete: a("auditLog.action.delete")
397
- })), ae = w(() => [{
398
- label: g.value.manage,
423
+ })), ae = L(() => [{
424
+ label: h.value.manage,
399
425
  value: "manage"
400
426
  }, {
401
- label: g.value.create,
427
+ label: h.value.create,
402
428
  value: "create"
403
429
  }, {
404
- label: g.value.read,
430
+ label: h.value.read,
405
431
  value: "read"
406
432
  }, {
407
- label: g.value.update,
433
+ label: h.value.update,
408
434
  value: "update"
409
435
  }, {
410
- label: g.value.delete,
436
+ label: h.value.delete,
411
437
  value: "delete"
412
- }]), ie = w(() => ({
438
+ }]), ie = L(() => ({
413
439
  allowed: a("auditLog.outcome.success"),
414
440
  denied: a("auditLog.outcome.failed"),
415
441
  skipped: a("auditLog.outcome.skipped")
416
- })), Re = w(() => [{
442
+ })), Re = L(() => [{
417
443
  label: ie.value.allowed,
418
444
  value: "allowed"
419
445
  }, {
@@ -422,7 +448,7 @@ const be = [
422
448
  }, {
423
449
  label: ie.value.skipped,
424
450
  value: "skipped"
425
- }]), Ue = w(() => ({
451
+ }]), Ue = L(() => ({
426
452
  admin: a("auditLog.detail.resolvedFromValue.admin"),
427
453
  staff: a("auditLog.detail.resolvedFromValue.staff"),
428
454
  permissionSet: a("auditLog.detail.resolvedFromValue.permissionSet"),
@@ -430,86 +456,86 @@ const be = [
430
456
  custom: a("auditLog.detail.resolvedFromValue.custom"),
431
457
  "no-match": a("auditLog.detail.resolvedFromValue.noMatch"),
432
458
  unknown: a("auditLog.detail.resolvedFromValue.unknown")
433
- })), $e = w(() => ({
434
- GET: g.value.read,
435
- POST: g.value.create,
436
- PUT: g.value.update,
437
- PATCH: g.value.update,
438
- DELETE: g.value.delete
459
+ })), Ne = L(() => ({
460
+ GET: h.value.read,
461
+ POST: h.value.create,
462
+ PUT: h.value.update,
463
+ PATCH: h.value.update,
464
+ DELETE: h.value.delete
439
465
  })), xe = {
440
466
  allowed: "success",
441
467
  denied: "critical",
442
468
  skipped: "warning"
443
- }, Ne = w(() => {
469
+ }, $e = L(() => {
444
470
  const {
445
471
  startDate: e,
446
472
  endDate: t
447
473
  } = $.value;
448
474
  return e && t ? `${e} – ${t}` : e || t || a("auditLog.dateRange.placeholder");
449
- }), Ye = w(() => [{
475
+ }), Ye = L(() => [{
450
476
  label: a("date.predefinedRanges.today"),
451
477
  value: {
452
- startDate: y().format(D),
453
- endDate: y().format(D)
478
+ startDate: _().format(O),
479
+ endDate: _().format(O)
454
480
  }
455
481
  }, {
456
482
  label: a("date.predefinedRanges.yesterday"),
457
483
  value: {
458
- startDate: y().subtract(1, "day").format(D),
459
- endDate: y().subtract(1, "day").format(D)
484
+ startDate: _().subtract(1, "day").format(O),
485
+ endDate: _().subtract(1, "day").format(O)
460
486
  }
461
487
  }, {
462
488
  label: a("date.predefinedRanges.thisWeek"),
463
489
  value: {
464
- startDate: y().startOf("week").format(D),
465
- endDate: y().endOf("week").format(D)
490
+ startDate: _().startOf("week").format(O),
491
+ endDate: _().endOf("week").format(O)
466
492
  }
467
493
  }, {
468
494
  label: a("date.predefinedRanges.lastWeek"),
469
495
  value: {
470
- startDate: y().subtract(1, "week").startOf("week").format(D),
471
- endDate: y().subtract(1, "week").endOf("week").format(D)
496
+ startDate: _().subtract(1, "week").startOf("week").format(O),
497
+ endDate: _().subtract(1, "week").endOf("week").format(O)
472
498
  }
473
499
  }, {
474
500
  label: a("date.predefinedRanges.last7Days"),
475
501
  value: {
476
- startDate: y().subtract(7, "day").format(D),
477
- endDate: y().subtract(1, "day").format(D)
502
+ startDate: _().subtract(7, "day").format(O),
503
+ endDate: _().subtract(1, "day").format(O)
478
504
  }
479
505
  }, {
480
506
  label: a("date.predefinedRanges.thisMonth"),
481
507
  value: {
482
- startDate: y().startOf("month").format(D),
483
- endDate: y().endOf("month").format(D)
508
+ startDate: _().startOf("month").format(O),
509
+ endDate: _().endOf("month").format(O)
484
510
  }
485
511
  }, {
486
512
  label: a("date.predefinedRanges.lastMonth"),
487
513
  value: {
488
- startDate: y().subtract(1, "month").startOf("month").format(D),
489
- endDate: y().subtract(1, "month").endOf("month").format(D)
514
+ startDate: _().subtract(1, "month").startOf("month").format(O),
515
+ endDate: _().subtract(1, "month").endOf("month").format(O)
490
516
  }
491
517
  }]);
492
518
  function me(e) {
493
519
  var t;
494
- return ((t = Pe.find((v) => v.subject === e)) == null ? void 0 : t.label) ?? Ve[e];
520
+ return ((t = Pe.find((b) => b.subject === e)) == null ? void 0 : t.label) ?? Oe[e];
495
521
  }
496
522
  function re(e) {
497
- return O.userIdToName[e.userId] || e.userId;
523
+ return T.userIdToName[e.userId] || e.userId;
498
524
  }
499
525
  function Le(e) {
500
- return O.userIdToPhone[e.userId] || "-";
526
+ return T.userIdToPhone[e.userId] || "-";
501
527
  }
502
528
  function ze(e) {
503
- return O.userIdToEmail[e.userId] || "-";
529
+ return T.userIdToEmail[e.userId] || "-";
504
530
  }
505
531
  function Se(e) {
506
- return y(e).format("DD MMM YYYY, HH:mm");
532
+ return _(e).format("DD MMM YYYY, HH:mm");
507
533
  }
508
534
  function Be(e) {
509
- return y(e).format("DD MMM YYYY, HH:mm:ss").toUpperCase();
535
+ return _(e).format("DD MMM YYYY, HH:mm:ss").toUpperCase();
510
536
  }
511
537
  function ke(e) {
512
- return g.value[e] ?? e;
538
+ return h.value[e] ?? e;
513
539
  }
514
540
  function fe(e) {
515
541
  return e.metadata.operationLabel ?? ke(e.action);
@@ -521,7 +547,7 @@ const be = [
521
547
  return Ue.value[e] ?? e;
522
548
  }
523
549
  function qe(e) {
524
- return e.metadata.requestMethod ? $e.value[e.metadata.requestMethod] ?? e.metadata.requestMethod : ke(e.action);
550
+ return e.metadata.requestMethod ? Ne.value[e.metadata.requestMethod] ?? e.metadata.requestMethod : ke(e.action);
525
551
  }
526
552
  function we(e) {
527
553
  const t = String(e ?? "");
@@ -613,7 +639,7 @@ const be = [
613
639
  }
614
640
  return new Set(pe.filter((e) => e.defaultSelected).map((e) => e.key));
615
641
  }
616
- const G = h(He());
642
+ const G = p(He());
617
643
  function We(e) {
618
644
  const t = new Set(G.value);
619
645
  if (t.has(e)) {
@@ -628,9 +654,9 @@ const be = [
628
654
  }
629
655
  }
630
656
  async function Je() {
631
- var e, t, v, L, _, A;
632
- if (!T.value) {
633
- T.value = !0;
657
+ var e, t, b, k, S, A;
658
+ if (!I.value) {
659
+ I.value = !0;
634
660
  try {
635
661
  const {
636
662
  startDate: K,
@@ -640,39 +666,39 @@ const be = [
640
666
  from: ue(K)
641
667
  } : {},
642
668
  to: Z,
643
- ...(e = R.value) != null && e.length ? {
644
- userIds: R.value
669
+ ...(e = U.value) != null && e.length ? {
670
+ userIds: U.value
645
671
  } : {},
646
- ...B.value && ((t = m.value) != null && t.length) ? {
647
- subjects: m.value
672
+ ...B.value && ((t = f.value) != null && t.length) ? {
673
+ subjects: f.value
648
674
  } : {},
649
675
  ...W.length ? {
650
676
  subjectPrefixes: [...W]
651
677
  } : {},
652
- ...(v = S.value) != null && v.length ? {
653
- actions: S.value
678
+ ...(b = M.value) != null && b.length ? {
679
+ actions: M.value
654
680
  } : {},
655
- ...(L = f.value) != null && L.length ? {
656
- outcomes: f.value
681
+ ...(k = v.value) != null && k.length ? {
682
+ outcomes: v.value
657
683
  } : {}
658
684
  }, Me = [];
659
685
  let Fe = 0;
660
686
  for (; ; ) {
661
- const j = await je.read({
687
+ const C = await je.read({
662
688
  ...tt,
663
689
  limit: ye,
664
690
  offset: Fe
665
691
  });
666
- if (Me.push(...j), j.length < ye) break;
692
+ if (Me.push(...C), C.length < ye) break;
667
693
  Fe += ye;
668
694
  }
669
- const De = pe.filter((j) => G.value.has(j.key)), at = De.map((j) => a(j.labelKey)), lt = Me.map((j) => De.map((mt) => mt.getValue(j) ?? "")), ge = -(/* @__PURE__ */ new Date()).getTimezoneOffset(), ot = ge >= 0 ? "+" : "-", st = String(Math.floor(Math.abs(ge) / 60)).padStart(2, "0"), nt = String(Math.abs(ge) % 60).padStart(2, "0"), it = `UTC${ot}${st}:${nt}`, Te = ((_ = x.currentBusiness.value) == null ? void 0 : _.name) || "", rt = [K, q].filter(Boolean).join(" – "), ut = [...[[a("auditLog.title")], [`${a("auditLog.frontMatter.date")}: ${rt}`], ...Te ? [[`${a("auditLog.frontMatter.business")}: ${Te}`]] : [], [`${a("auditLog.frontMatter.generatedBy")}: ${y().format("DD MMM YYYY, HH:mm")} (${it})`], []].map((j) => j.map(we).join(",")), ...[at, ...lt].map((j) => j.map(we).join(","))].join(`
670
- `), dt = `audit-log_${(((A = x.currentBusiness.value) == null ? void 0 : A.name) || "business").replace(/[^a-z0-9_-]+/gi, "_")}_${y().format("YYYYMMDD_HHmmss")}.csv`, ct = new Blob([`\uFEFF${ut}`], {
695
+ const Ie = pe.filter((C) => G.value.has(C.key)), at = Ie.map((C) => a(C.labelKey)), lt = Me.map((C) => Ie.map((mt) => mt.getValue(C) ?? "")), be = -(/* @__PURE__ */ new Date()).getTimezoneOffset(), ot = be >= 0 ? "+" : "-", st = String(Math.floor(Math.abs(be) / 60)).padStart(2, "0"), nt = String(Math.abs(be) % 60).padStart(2, "0"), it = `UTC${ot}${st}:${nt}`, Te = ((S = x.currentBusiness.value) == null ? void 0 : S.name) || "", rt = [K, q].filter(Boolean).join(" – "), ut = [...[[a("auditLog.title")], [`${a("auditLog.frontMatter.date")}: ${rt}`], ...Te ? [[`${a("auditLog.frontMatter.business")}: ${Te}`]] : [], [`${a("auditLog.frontMatter.generatedBy")}: ${_().format("DD MMM YYYY, HH:mm")} (${it})`], []].map((C) => C.map(we).join(",")), ...[at, ...lt].map((C) => C.map(we).join(","))].join(`
696
+ `), dt = `audit-log_${(((A = x.currentBusiness.value) == null ? void 0 : A.name) || "business").replace(/[^a-z0-9_-]+/gi, "_")}_${_().format("YYYYMMDD_HHmmss")}.csv`, ct = new Blob([`\uFEFF${ut}`], {
671
697
  type: "text/csv;charset=utf-8;"
672
- }), Ie = window.URL.createObjectURL(ct), le = document.createElement("a");
673
- le.href = Ie, le.download = dt, document.body.appendChild(le), le.click(), le.remove(), window.URL.revokeObjectURL(Ie);
698
+ }), De = window.URL.createObjectURL(ct), le = document.createElement("a");
699
+ le.href = De, le.download = dt, document.body.appendChild(le), le.click(), le.remove(), window.URL.revokeObjectURL(De);
674
700
  } finally {
675
- T.value = !1;
701
+ I.value = !1;
676
702
  }
677
703
  }
678
704
  }
@@ -691,7 +717,7 @@ const be = [
691
717
  const t = e.row.original;
692
718
  return u("div", {
693
719
  class: "flex items-center gap-8"
694
- }, [u(Oe.FmAvatar, {
720
+ }, [u(Ve.FmAvatar, {
695
721
  initials: re(t),
696
722
  size: "sm",
697
723
  class: "shrink-0"
@@ -732,7 +758,7 @@ const be = [
732
758
  enableSorting: !1,
733
759
  cell(e) {
734
760
  const t = e.row.original;
735
- return u(Oe.FmChip, {
761
+ return u(Ve.FmChip, {
736
762
  variant: xe[t.outcome] ?? "neutral",
737
763
  label: ve(t.outcome),
738
764
  compact: !0
@@ -740,92 +766,92 @@ const be = [
740
766
  }
741
767
  }];
742
768
  function ue(e) {
743
- const t = y(e, $a);
769
+ const t = _(e, Ya);
744
770
  return new Date(t.year(), t.month(), t.date(), t.hour(), t.minute(), 0).toISOString().slice(0, 19).replace("T", " ");
745
771
  }
746
772
  async function X() {
747
- var e, t, v, L;
748
- E.value = !0;
773
+ var e, t, b, k;
774
+ P.value = !0;
749
775
  try {
750
776
  const {
751
- startDate: _,
777
+ startDate: S,
752
778
  endDate: A
753
- } = $.value, K = (F.value - 1) * he, q = r.value.subjectPrefixes, W = await je.read({
779
+ } = $.value, K = (D.value - 1) * he, q = r.value.subjectPrefixes, W = await je.read({
754
780
  limit: he,
755
781
  offset: K,
756
- ..._ ? {
757
- from: ue(_)
782
+ ...S ? {
783
+ from: ue(S)
758
784
  } : {},
759
785
  ...A ? {
760
786
  to: ue(A)
761
787
  } : {},
762
- ...(e = R.value) != null && e.length ? {
763
- userIds: R.value
788
+ ...(e = U.value) != null && e.length ? {
789
+ userIds: U.value
764
790
  } : {},
765
- ...B.value && ((t = m.value) != null && t.length) ? {
766
- subjects: m.value
791
+ ...B.value && ((t = f.value) != null && t.length) ? {
792
+ subjects: f.value
767
793
  } : {},
768
794
  ...q.length ? {
769
795
  subjectPrefixes: [...q]
770
796
  } : {},
771
- ...(v = S.value) != null && v.length ? {
772
- actions: S.value
797
+ ...(b = M.value) != null && b.length ? {
798
+ actions: M.value
773
799
  } : {},
774
- ...(L = f.value) != null && L.length ? {
775
- outcomes: f.value
800
+ ...(k = v.value) != null && k.length ? {
801
+ outcomes: v.value
776
802
  } : {}
777
803
  });
778
- M.value = W, J.value = W.length === he;
804
+ c.value = W, J.value = W.length === he;
779
805
  } finally {
780
- E.value = !1;
806
+ P.value = !1;
781
807
  }
782
808
  }
783
809
  Q($, () => {
784
- F.value = 1, X();
785
- }), Q([R, m, f, S], () => {
786
- F.value = 1, X();
787
- }), Q(k, () => {
788
- F.value = 1, X();
810
+ D.value = 1, X();
811
+ }), Q([U, f, v, M], () => {
812
+ D.value = 1, X();
813
+ }), Q(F, () => {
814
+ D.value = 1, X();
789
815
  });
790
816
  async function Xe() {
791
- F.value > 1 && (F.value--, await X());
817
+ D.value > 1 && (D.value--, await X());
792
818
  }
793
819
  async function Ze() {
794
- J.value && (F.value++, await X());
820
+ J.value && (D.value++, await X());
795
821
  }
796
822
  function Qe(e) {
797
- o.value = e, I.value = !0;
823
+ s.value = e, w.value = !0;
798
824
  }
799
825
  function et() {
800
- I.value = !1, o.value = null;
826
+ w.value = !1, s.value = null;
801
827
  }
802
828
  return Q(x.currentBusiness, (e) => {
803
- e && (F.value = 1, O.readTeamMembers(), X());
829
+ e && (D.value = 1, T.readTeamMembers(), X());
804
830
  }, {
805
831
  immediate: !0
806
832
  }), (e, t) => {
807
- const v = C("FmSpacer"), L = C("FmButton"), _ = C("FmMenuItem"), A = C("FmMenu"), K = C("FmChip"), q = C("FmDateRangePicker"), W = C("FmTable"), de = C("FmSideSheet");
808
- return c(), b(ee, null, [u(_t, {
833
+ const b = E("FmSpacer"), k = E("FmButton"), S = E("FmMenuItem"), A = E("FmMenu"), K = E("FmChip"), q = E("FmDateRangePicker"), W = E("FmTable"), de = E("FmSideSheet");
834
+ return m(), y(ee, null, [u(_t, {
809
835
  heading: n(a)("auditLog.title")
810
836
  }, {
811
- "append-heading": N(() => [u(v), u(L, {
837
+ "append-heading": Y(() => [u(b), u(k, {
812
838
  variant: "primary",
813
839
  "prepend-icon": "upload",
814
840
  label: n(a)("auditLog.export"),
815
- disabled: M.value.length === 0 || T.value || n(O).isLoading || n(O).members.length === 0,
816
- loading: T.value,
841
+ disabled: c.value.length === 0 || I.value || n(T).isLoading || n(T).members.length === 0,
842
+ loading: I.value,
817
843
  onClick: Je
818
844
  }, null, 8, ["label", "disabled", "loading"]), u(A, {
819
845
  "close-on-click": !1,
820
846
  "z-index": 50
821
847
  }, {
822
- "menu-button": N(() => [u(L, {
848
+ "menu-button": Y(() => [u(k, {
823
849
  variant: "tertiary",
824
850
  icon: "settings",
825
851
  "aria-label": n(a)("auditLog.exportSettings.title"),
826
- disabled: T.value
852
+ disabled: I.value
827
853
  }, null, 8, ["aria-label", "disabled"])]),
828
- default: N(() => [l("div", Tt, [l("p", It, i(n(a)("auditLog.exportSettings.title")), 1), (c(), b(ee, null, se(pe, (d) => u(_, {
854
+ default: Y(() => [l("div", Ot, [l("p", Vt, i(n(a)("auditLog.exportSettings.title")), 1), (m(), y(ee, null, se(pe, (d) => u(S, {
829
855
  key: d.key,
830
856
  label: n(a)(d.labelKey),
831
857
  "has-checkbox": "",
@@ -835,34 +861,34 @@ const be = [
835
861
  }, null, 8, ["label", "model-value", "disabled", "onClick"])), 64))])]),
836
862
  _: 1
837
863
  })]),
838
- default: N(() => [l("div", Vt, [l("div", Ot, [u(Dt, {
839
- modelValue: k.value,
840
- "onUpdate:modelValue": t[0] || (t[0] = (d) => k.value = d),
841
- items: U.value
842
- }, null, 8, ["modelValue", "items"]), l("div", Pt, [u(q, {
864
+ default: Y(() => [l("div", Pt, [l("div", jt, [u(Tt, {
865
+ modelValue: F.value,
866
+ "onUpdate:modelValue": t[0] || (t[0] = (d) => F.value = d),
867
+ items: N.value
868
+ }, null, 8, ["modelValue", "items"]), l("div", Ct, [u(q, {
843
869
  modelValue: $.value,
844
870
  "onUpdate:modelValue": t[1] || (t[1] = (d) => $.value = d),
845
871
  "show-predefined-range": "",
846
872
  "show-time": "",
847
873
  "predefined-range": Ye.value
848
874
  }, {
849
- "trigger-button": N(() => [u(K, {
850
- label: Ne.value,
875
+ "trigger-button": Y(() => [u(K, {
876
+ label: $e.value,
851
877
  icon: "calendar_month"
852
878
  }, null, 8, ["label"])]),
853
879
  _: 1
854
- }, 8, ["modelValue", "predefined-range"]), l("div", jt, [u(ce, {
855
- modelValue: R.value,
856
- "onUpdate:modelValue": t[2] || (t[2] = (d) => R.value = d),
880
+ }, 8, ["modelValue", "predefined-range"]), l("div", Et, [u(ce, {
881
+ modelValue: U.value,
882
+ "onUpdate:modelValue": t[2] || (t[2] = (d) => U.value = d),
857
883
  items: H.value,
858
884
  multiple: "",
859
885
  variant: "dark",
860
886
  placeholder: n(a)("auditLog.filter.user_placeholder"),
861
887
  "selected-prefix": n(a)("auditLog.filter.selected_user_prefix"),
862
888
  "chip-icon": "account_circle"
863
- }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])]), B.value ? (c(), b("div", Ct, [u(ce, {
864
- modelValue: m.value,
865
- "onUpdate:modelValue": t[3] || (t[3] = (d) => m.value = d),
889
+ }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])]), B.value ? (m(), y("div", At, [u(ce, {
890
+ modelValue: f.value,
891
+ "onUpdate:modelValue": t[3] || (t[3] = (d) => f.value = d),
866
892
  items: ne.value,
867
893
  "filter-fn": _e,
868
894
  multiple: "",
@@ -870,18 +896,18 @@ const be = [
870
896
  placeholder: n(a)("auditLog.filter.subject_placeholder"),
871
897
  "selected-prefix": n(a)("auditLog.filter.selected_subject_prefix"),
872
898
  "chip-icon": "badge"
873
- }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])])) : V("", !0), l("div", At, [u(ce, {
874
- modelValue: S.value,
875
- "onUpdate:modelValue": t[4] || (t[4] = (d) => S.value = d),
899
+ }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])])) : V("", !0), l("div", Rt, [u(ce, {
900
+ modelValue: M.value,
901
+ "onUpdate:modelValue": t[4] || (t[4] = (d) => M.value = d),
876
902
  items: ae.value,
877
903
  multiple: "",
878
904
  variant: "dark",
879
905
  placeholder: n(a)("auditLog.filter.action_placeholder"),
880
906
  "selected-prefix": n(a)("auditLog.filter.selected_action_prefix"),
881
907
  searchable: !1
882
- }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])]), l("div", Et, [u(ce, {
883
- modelValue: f.value,
884
- "onUpdate:modelValue": t[5] || (t[5] = (d) => f.value = d),
908
+ }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])]), l("div", Ut, [u(ce, {
909
+ modelValue: v.value,
910
+ "onUpdate:modelValue": t[5] || (t[5] = (d) => v.value = d),
885
911
  items: Re.value,
886
912
  multiple: "",
887
913
  variant: "dark",
@@ -889,31 +915,31 @@ const be = [
889
915
  "selected-prefix": n(a)("auditLog.filter.selected_status_prefix"),
890
916
  searchable: !1,
891
917
  "chip-icon": "check_circle"
892
- }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])])])]), !E.value && M.value.length === 0 ? (c(), oe(n(xt), {
918
+ }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])])])]), !P.value && c.value.length === 0 ? (m(), oe(n(xt), {
893
919
  key: 0,
894
920
  title: n(a)("auditLog.noData.title"),
895
921
  subtitle: n(a)("auditLog.noData.subtitle")
896
- }, null, 8, ["title", "subtitle"])) : (c(), oe(bt, {
922
+ }, null, 8, ["title", "subtitle"])) : (m(), oe(gt, {
897
923
  key: 1
898
924
  }, {
899
- default: N(() => [l("div", Rt, [u(W, {
925
+ default: Y(() => [l("div", Nt, [u(W, {
900
926
  "column-defs": Ge,
901
- "row-data": M.value,
902
- "page-size": M.value.length,
903
- loading: E.value,
927
+ "row-data": c.value,
928
+ "page-size": c.value.length,
929
+ loading: P.value,
904
930
  "pin-header-row": "",
905
931
  "hide-footer": "",
906
932
  class: "min-h-0 flex-1 cursor-pointer",
907
933
  onRowClick: t[6] || (t[6] = (d) => Qe(d.original))
908
- }, null, 8, ["row-data", "page-size", "loading"]), F.value > 1 || J.value ? (c(), b("div", Ut, [u(L, {
934
+ }, null, 8, ["row-data", "page-size", "loading"]), D.value > 1 || J.value ? (m(), y("div", $t, [u(k, {
909
935
  variant: "tertiary",
910
936
  icon: "chevron_left",
911
- disabled: F.value === 1,
937
+ disabled: D.value === 1,
912
938
  "aria-label": n(a)("auditLog.pagination.prevPage"),
913
939
  onClick: Xe
914
- }, null, 8, ["disabled", "aria-label"]), l("span", $t, i(n(a)("auditLog.pagination.page", {
915
- page: F.value
916
- })), 1), u(L, {
940
+ }, null, 8, ["disabled", "aria-label"]), l("span", Yt, i(n(a)("auditLog.pagination.page", {
941
+ page: D.value
942
+ })), 1), u(k, {
917
943
  variant: "tertiary",
918
944
  icon: "chevron_right",
919
945
  disabled: !J.value,
@@ -925,30 +951,30 @@ const be = [
925
951
  _: 1
926
952
  }, 8, ["heading"]), u(de, {
927
953
  header: n(a)("auditLog.detail.header"),
928
- "model-value": I.value,
954
+ "model-value": w.value,
929
955
  "max-width": 480,
930
956
  "dismiss-away": "",
931
957
  "onUpdate:modelValue": t[7] || (t[7] = (d) => {
932
958
  d || et();
933
959
  })
934
960
  }, {
935
- default: N(() => [o.value ? (c(), b("div", Nt, [l("div", Yt, [l("div", zt, [l("p", Bt, i(fe(o.value)), 1)]), u(K, {
936
- variant: xe[o.value.outcome] ?? "neutral",
937
- label: ve(o.value.outcome),
961
+ default: Y(() => [s.value ? (m(), y("div", zt, [l("div", Bt, [l("div", Kt, [l("p", qt, i(fe(s.value)), 1)]), u(K, {
962
+ variant: xe[s.value.outcome] ?? "neutral",
963
+ label: ve(s.value.outcome),
938
964
  compact: ""
939
- }, null, 8, ["variant", "label"])]), l("div", Kt, [l("div", qt, [l("div", null, [l("p", Ht, i(n(a)("auditLog.detail.date")), 1), l("p", Wt, i(Be(o.value.timestamp)), 1)]), l("div", null, [l("p", Jt, i(n(a)("auditLog.detail.user")), 1), l("p", Gt, i(re(o.value)), 1)]), l("div", null, [l("p", Xt, i(n(a)("auditLog.detail.email")), 1), l("p", Zt, i(ze(o.value)), 1)]), l("div", null, [l("p", Qt, i(n(a)("auditLog.detail.role")), 1), l("p", ea, i(me(o.value.subject) || o.value.subject), 1)]), o.value.field ? (c(), b("div", ta, [l("p", aa, i(n(a)("auditLog.detail.field")), 1), l("p", la, i(o.value.field), 1)])) : V("", !0), l("div", null, [l("p", oa, i(n(a)("auditLog.detail.business")), 1), l("p", sa, i(o.value.businessId || "-"), 1)]), l("div", null, [l("p", na, i(n(a)("auditLog.detail.restaurant")), 1), l("p", ia, i(o.value.restaurantId || "-"), 1)])])]), o.value.metadata.operationLabel ? (c(), b("div", ra, [l("div", ua, [l("p", da, i(n(a)("auditLog.detail.changeDetails")), 1)]), t[8] || (t[8] = l("hr", {
965
+ }, null, 8, ["variant", "label"])]), l("div", Ht, [l("div", Wt, [l("div", null, [l("p", Jt, i(n(a)("auditLog.detail.date")), 1), l("p", Gt, i(Be(s.value.timestamp)), 1)]), l("div", null, [l("p", Xt, i(n(a)("auditLog.detail.user")), 1), l("p", Zt, i(re(s.value)), 1)]), l("div", null, [l("p", Qt, i(n(a)("auditLog.detail.email")), 1), l("p", ea, i(ze(s.value)), 1)]), l("div", null, [l("p", ta, i(n(a)("auditLog.detail.role")), 1), l("p", aa, i(me(s.value.subject) || s.value.subject), 1)]), s.value.field ? (m(), y("div", la, [l("p", oa, i(n(a)("auditLog.detail.field")), 1), l("p", sa, i(s.value.field), 1)])) : V("", !0), l("div", null, [l("p", na, i(n(a)("auditLog.detail.business")), 1), l("p", ia, i(s.value.businessId || "-"), 1)]), l("div", null, [l("p", ra, i(n(a)("auditLog.detail.restaurant")), 1), l("p", ua, i(s.value.restaurantId || "-"), 1)])])]), s.value.metadata.operationLabel ? (m(), y("div", da, [l("div", ca, [l("p", ma, i(n(a)("auditLog.detail.changeDetails")), 1)]), t[8] || (t[8] = l("hr", {
940
966
  class: "border-fm-color-border-default"
941
- }, null, -1)), l("div", ca, [l("div", null, [l("p", ma, i(n(a)("auditLog.detail.eventType")), 1), l("p", fa, i(o.value.metadata.operationLabel), 1)])])])) : V("", !0), l("div", va, [l("div", pa, [l("p", ga, i(n(a)("auditLog.detail.metadata")), 1)]), t[9] || (t[9] = l("hr", {
967
+ }, null, -1)), l("div", fa, [l("div", null, [l("p", va, i(n(a)("auditLog.detail.eventType")), 1), l("p", pa, i(s.value.metadata.operationLabel), 1)])])])) : V("", !0), l("div", ba, [l("div", ga, [l("p", ha, i(n(a)("auditLog.detail.metadata")), 1)]), t[9] || (t[9] = l("hr", {
942
968
  class: "border-fm-color-border-default"
943
- }, null, -1)), l("div", ba, [l("div", null, [l("p", ha, i(n(a)("auditLog.detail.resolvedFrom")), 1), l("p", ya, i(Ke(o.value.metadata.resolvedFrom)), 1)]), (o.value.metadata.resolvedFrom === "permissionSet" || o.value.metadata.resolvedFrom === "systemPermissionSet") && (o.value.metadata.permissionSetName || o.value.metadata.permissionSetId) ? (c(), b("div", _a, [l("p", xa, i(n(a)("auditLog.detail.permissionSet")), 1), o.value.metadata.permissionSetName ? (c(), b("p", La, i(o.value.metadata.permissionSetName), 1)) : V("", !0), o.value.metadata.permissionSetId ? (c(), b("p", Sa, i(o.value.metadata.permissionSetId), 1)) : V("", !0)])) : V("", !0), o.value.metadata.reason ? (c(), b("div", ka, [l("p", wa, i(n(a)("auditLog.detail.reason")), 1), l("p", Ma, i(o.value.metadata.reason), 1)])) : V("", !0), l("div", null, [l("p", Fa, i(n(a)("auditLog.detail.requestMethod")), 1), l("p", Da, i(qe(o.value)), 1)]), l("div", null, [l("p", Ta, i(n(a)("auditLog.detail.requestPath")), 1), l("p", Ia, i(o.value.metadata.requestPath || "-"), 1)]), o.value.metadata.trace && o.value.metadata.trace.length > 0 ? (c(), b("div", Va, [l("p", Oa, i(n(a)("auditLog.detail.permissionTrace")), 1), l("ol", Pa, [(c(!0), b(ee, null, se(o.value.metadata.trace, (d, Z) => (c(), b("li", {
969
+ }, null, -1)), l("div", ya, [l("div", null, [l("p", _a, i(n(a)("auditLog.detail.resolvedFrom")), 1), l("p", xa, i(Ke(s.value.metadata.resolvedFrom)), 1)]), (s.value.metadata.resolvedFrom === "permissionSet" || s.value.metadata.resolvedFrom === "systemPermissionSet") && (s.value.metadata.permissionSetName || s.value.metadata.permissionSetId) ? (m(), y("div", La, [l("p", Sa, i(n(a)("auditLog.detail.permissionSet")), 1), s.value.metadata.permissionSetName ? (m(), y("p", ka, i(s.value.metadata.permissionSetName), 1)) : V("", !0), s.value.metadata.permissionSetId ? (m(), y("p", wa, i(s.value.metadata.permissionSetId), 1)) : V("", !0)])) : V("", !0), s.value.metadata.reason ? (m(), y("div", Ma, [l("p", Fa, i(n(a)("auditLog.detail.reason")), 1), l("p", Ia, i(s.value.metadata.reason), 1)])) : V("", !0), l("div", null, [l("p", Ta, i(n(a)("auditLog.detail.requestMethod")), 1), l("p", Da, i(qe(s.value)), 1)]), l("div", null, [l("p", Oa, i(n(a)("auditLog.detail.requestPath")), 1), l("p", Va, i(s.value.metadata.requestPath || "-"), 1)]), s.value.metadata.trace && s.value.metadata.trace.length > 0 ? (m(), y("div", Pa, [l("p", ja, i(n(a)("auditLog.detail.permissionTrace")), 1), l("ol", Ca, [(m(!0), y(ee, null, se(s.value.metadata.trace, (d, Z) => (m(), y("li", {
944
970
  key: Z,
945
971
  class: "flex items-center gap-6"
946
- }, [l("span", ja, i(Z + 1), 1), l("span", Ca, i(d), 1), Z < o.value.metadata.trace.length - 1 ? (c(), b("span", Aa, "→")) : V("", !0)]))), 128))])])) : V("", !0), p.value ? (c(), b("div", Ea, [l("p", Ra, i(n(a)("auditLog.detail.requestBody")), 1), l("pre", Ua, i(p.value), 1)])) : V("", !0)])])])) : V("", !0)]),
972
+ }, [l("span", Ea, i(Z + 1), 1), l("span", Aa, i(d), 1), Z < s.value.metadata.trace.length - 1 ? (m(), y("span", Ra, "→")) : V("", !0)]))), 128))])])) : V("", !0), g.value ? (m(), y("div", Ua, [l("p", Na, i(n(a)("auditLog.detail.requestBody")), 1), l("pre", $a, i(g.value), 1)])) : V("", !0)])])])) : V("", !0)]),
947
973
  _: 1
948
974
  }, 8, ["header", "model-value"])], 64);
949
975
  };
950
976
  }
951
977
  });
952
978
  export {
953
- el as default
979
+ al as default
954
980
  };