@feedmepos/mf-hrm-portal 2.0.24-dev.3 → 2.0.24-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 (28) hide show
  1. package/dist/AuditLogList-mfHfCrDp.js +1054 -0
  2. package/dist/{EmployeeList-DXTIVdNQ.js → EmployeeList-mnaGEL4R.js} +6 -6
  3. package/dist/{Main-DndCDnpH.js → Main-B4Xf2dm4.js} +4 -4
  4. package/dist/{Main-BBGd8ZTL.js → Main-BWSMKWxB.js} +6 -6
  5. package/dist/{Main-lGjnpbfI.js → Main-DTJOj2jJ.js} +9 -9
  6. package/dist/{PermissionSetList-ENyBOnPF.js → PermissionSetList-CgPUMTJg.js} +6 -6
  7. package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BWBZROlT.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CfHx0q1H.js} +592 -592
  8. package/dist/{PortalUserSearcher.vue_vue_type_style_index_0_scoped_a439fdd8_lang-CDtl09zY.js → PortalUserSearcher.vue_vue_type_style_index_0_scoped_a439fdd8_lang-Cod0zTbu.js} +1 -1
  9. package/dist/{RoleList-BX_2VJZ6.js → RoleList-Cg8Ye2Zk.js} +7 -7
  10. package/dist/{TeamMemberList-D5dwxHbo.js → TeamMemberList-BoVZBjtB.js} +8 -8
  11. package/dist/{TimesheetList-B92TB91G.js → TimesheetList-BiQswrw7.js} +6 -6
  12. package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_d7ed31d7_lang-fZeEZTuq.js → TimesheetList.vue_vue_type_style_index_0_scoped_d7ed31d7_lang-Bx5-vyxN.js} +2 -2
  13. package/dist/{app-KE1Um386.js → app-CZLWCtKb.js} +28 -16
  14. package/dist/app.js +1 -1
  15. package/dist/{dayjs.min-1lGJFcPX.js → dayjs.min-BMdREwIr.js} +1 -1
  16. package/dist/{employee-BqMV_HCx.js → employee-CHBituQX.js} +3 -3
  17. package/dist/{iteration-DlBvbGKr.js → iteration-DLrwtjjD.js} +1 -1
  18. package/dist/{lodash-aPPIHJY6.js → lodash-DrGn50Sb.js} +1 -1
  19. package/dist/{rule-BxTkC7Lz.js → rule-BFOjocRa.js} +2 -2
  20. package/dist/src/stores/team.d.ts +4 -1
  21. package/dist/src/views/audit-log/locales/index.d.ts +16 -4
  22. package/dist/style.css +1 -1
  23. package/dist/tsconfig.app.tsbuildinfo +1 -1
  24. package/dist/{useAppStore-DT7SMn0u.js → useAppStore-C1TRO_QU.js} +1 -1
  25. package/dist/{useLoading-DogwStiv.js → useLoading-BBHvBcQn.js} +1 -1
  26. package/dist/{useReportPermissions-CsXjuESs.js → useReportPermissions-DhyumGy6.js} +3 -3
  27. package/package.json +1 -1
  28. package/dist/AuditLogList-Czy2T2Rx.js +0 -1056
@@ -0,0 +1,1054 @@
1
+ import { defineComponent as Be, ref as g, computed as _, onMounted as wt, onBeforeUnmount as Mt, watch as fe, resolveComponent as U, createElementBlock as S, openBlock as f, createBlock as Z, createCommentVNode as C, createElementVNode as l, Fragment as ee, renderList as ue, withCtx as B, createVNode as h, toDisplayString as u, unref as n, nextTick as Ft } from "vue";
2
+ import { d as y } from "./dayjs.min-BMdREwIr.js";
3
+ import { useI18n as Ke, useCoreStore as Dt } from "@feedmepos/mf-common";
4
+ import { G as Ee, _ as It } from "./app-CZLWCtKb.js";
5
+ import { components as Re } from "@feedmepos/ui-library";
6
+ import { g as Ce, b as Ue } from "./iteration-DLrwtjjD.js";
7
+ import { S as me, _ as Ot } from "./SelectFilter-C61IZSID.js";
8
+ import { _ as Tt } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
9
+ import { _ as jt } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
10
+ import { t as Pt, p as $e } from "./rule-BFOjocRa.js";
11
+ import { defineStore as Vt } from "pinia";
12
+ const se = [
13
+ { key: "all", label: "All", subjectPrefixes: [] },
14
+ { key: "inventory", label: "Inventory", subjectPrefixes: ["business::inventory", "inventory"] },
15
+ { key: "report", label: "Report", subjectPrefixes: ["business::report", "report"] },
16
+ { key: "hrm", label: "HRM", subjectPrefixes: ["business::hrm", "hrm"] },
17
+ { key: "payment", label: "Payment", subjectPrefixes: ["business::payment", "payment"] },
18
+ { key: "menu", label: "Menu", subjectPrefixes: ["business::menu", "menu"] },
19
+ { key: "crm", label: "CRM", subjectPrefixes: ["business::crm", "crm"] }
20
+ // Add more as modules are revamped with new actionguard:
21
+ // { key: 'restaurantOperation', label: 'Restaurant Operation', subjectPrefixes: ['restaurant'] },
22
+ ], Ye = "/audit-logs", _e = {
23
+ async count(a) {
24
+ var w, j, M, k, s;
25
+ const o = {
26
+ ...a != null && a.from ? { from: a.from } : {},
27
+ ...a != null && a.to ? { to: a.to } : {},
28
+ ...(w = a == null ? void 0 : a.userIds) != null && w.length ? { userIds: a.userIds } : {},
29
+ ...(j = a == null ? void 0 : a.subjects) != null && j.length ? { subjects: a.subjects } : {},
30
+ ...(M = a == null ? void 0 : a.subjectPrefixes) != null && M.length ? { subjectPrefixes: a.subjectPrefixes } : {},
31
+ ...(k = a == null ? void 0 : a.actions) != null && k.length ? { actions: a.actions } : {},
32
+ ...(s = a == null ? void 0 : a.outcomes) != null && s.length ? { outcomes: a.outcomes } : {}
33
+ };
34
+ return (await Ce(
35
+ await Ue().get(`${Ye}/count`, {
36
+ params: o,
37
+ paramsSerializer: (O) => {
38
+ const P = new URLSearchParams();
39
+ for (const [c, F] of Object.entries(O))
40
+ if (Array.isArray(F))
41
+ for (const K of F) P.append(c, String(K));
42
+ else F != null && P.append(c, String(F));
43
+ return P.toString();
44
+ }
45
+ })
46
+ )).total;
47
+ },
48
+ async read(a) {
49
+ var v, w, j, M, k;
50
+ const o = {
51
+ limit: (a == null ? void 0 : a.limit) ?? 100,
52
+ offset: (a == null ? void 0 : a.offset) ?? 0,
53
+ ...a != null && a.from ? { from: a.from } : {},
54
+ ...a != null && a.to ? { to: a.to } : {},
55
+ ...(v = a == null ? void 0 : a.userIds) != null && v.length ? { userIds: a.userIds } : {},
56
+ ...(w = a == null ? void 0 : a.subjects) != null && w.length ? { subjects: a.subjects } : {},
57
+ ...(j = a == null ? void 0 : a.subjectPrefixes) != null && j.length ? { subjectPrefixes: a.subjectPrefixes } : {},
58
+ ...(M = a == null ? void 0 : a.actions) != null && M.length ? { actions: a.actions } : {},
59
+ ...(k = a == null ? void 0 : a.outcomes) != null && k.length ? { outcomes: a.outcomes } : {}
60
+ };
61
+ return Ce(
62
+ await Ue().get(Ye, {
63
+ params: o,
64
+ // Serialize arrays as repeated params: key=val1&key=val2
65
+ // (NestJS @Query expects this; axios default adds brackets which break matching)
66
+ paramsSerializer: (s) => {
67
+ const O = new URLSearchParams();
68
+ for (const [P, c] of Object.entries(s))
69
+ if (Array.isArray(c))
70
+ for (const F of c) O.append(P, String(F));
71
+ else c != null && O.append(P, String(c));
72
+ return O.toString();
73
+ }
74
+ })
75
+ );
76
+ }
77
+ }, At = { class: "flex h-[46px] items-center gap-8 rounded-sm px-16 hover:bg-fm-color-opacity-sm" }, Et = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Rt = {
78
+ "data-more-measure": "",
79
+ class: "flex h-[46px] items-center gap-8 rounded-sm px-16"
80
+ }, Ct = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ut = /* @__PURE__ */ Be({
81
+ __name: "AuditLogModuleTabs",
82
+ props: {
83
+ modelValue: {},
84
+ items: {}
85
+ },
86
+ emits: ["update:modelValue"],
87
+ setup(a, { emit: o }) {
88
+ const v = a, w = o, { t: j } = Ke(), M = g(!1), k = g(null), s = g(null), O = g([]), P = g(0), c = g(0);
89
+ let F = null;
90
+ async function K() {
91
+ if (await Ft(), !s.value) return;
92
+ const b = s.value.querySelectorAll("[data-tab-measure]");
93
+ O.value = Array.from(b).map((D) => D.offsetWidth);
94
+ const m = s.value.querySelector("[data-more-measure]");
95
+ P.value = (m == null ? void 0 : m.offsetWidth) ?? 0;
96
+ }
97
+ const ve = _(() => {
98
+ const b = v.items.length;
99
+ if (b === 0) return 0;
100
+ if (!c.value || O.value.length !== b) return b;
101
+ const m = O.value;
102
+ if (m.reduce((r, H) => r + H, 0) <= c.value) return b;
103
+ const x = P.value;
104
+ let T = 0, V = 0;
105
+ for (let r = 0; r < b && !(T + m[r] + x > c.value); r++)
106
+ T += m[r], V++;
107
+ return V;
108
+ }), J = _(() => {
109
+ const b = ve.value, m = v.items.length;
110
+ if (b >= m) return [...v.items];
111
+ const D = v.items.slice(0, b), x = v.items.find((E) => E.value === v.modelValue);
112
+ if (!x || D.some((E) => E.value === x.value)) return D;
113
+ if (b === 0) return [x];
114
+ const T = v.items.findIndex((E) => E.value === x.value), V = O.value, r = P.value, H = V[T] ?? 0;
115
+ let N = b, ae = V.slice(0, N - 1).reduce((E, z) => E + z, 0);
116
+ for (; N > 1 && ae + H + r > c.value; )
117
+ N--, ae = V.slice(0, N - 1).reduce((E, z) => E + z, 0);
118
+ return [...v.items.slice(0, Math.max(N - 1, 0)), x];
119
+ }), te = _(() => {
120
+ const b = new Set(J.value.map((m) => m.value));
121
+ return v.items.filter((m) => !b.has(m.value));
122
+ });
123
+ function oe(b) {
124
+ M.value = !1, w("update:modelValue", b);
125
+ }
126
+ return wt(async () => {
127
+ await K(), k.value && (c.value = k.value.clientWidth, F = new ResizeObserver(() => {
128
+ k.value && (c.value = k.value.clientWidth);
129
+ }), F.observe(k.value));
130
+ }), Mt(() => {
131
+ F == null || F.disconnect(), F = null;
132
+ }), fe(
133
+ () => v.items,
134
+ () => {
135
+ K();
136
+ },
137
+ { deep: !0 }
138
+ ), (b, m) => {
139
+ const D = U("FmTab"), x = U("FmIcon"), T = U("FmMenuItem"), V = U("FmMenu");
140
+ return f(), S("div", {
141
+ ref_key: "containerRef",
142
+ ref: k,
143
+ class: "relative flex w-full flex-row items-center"
144
+ }, [
145
+ (f(!0), S(ee, null, ue(J.value, (r) => (f(), Z(D, {
146
+ key: r.value,
147
+ "model-value": a.modelValue,
148
+ label: r.label,
149
+ badge: r.badge,
150
+ disabled: r.disabled,
151
+ value: r.value,
152
+ "onUpdate:modelValue": oe
153
+ }, null, 8, ["model-value", "label", "badge", "disabled", "value"]))), 128)),
154
+ te.value.length > 0 ? (f(), Z(V, {
155
+ key: 0,
156
+ "show-menu": M.value,
157
+ class: "max-w-[360px] min-w-[90px] rounded-sm",
158
+ placement: "bottom-start",
159
+ onMenuChanged: m[0] || (m[0] = (r) => M.value = r)
160
+ }, {
161
+ "menu-button": B(() => [
162
+ l("div", At, [
163
+ h(x, { name: "more_vert" }),
164
+ l("span", Et, u(n(j)("auditLog.modules.more")), 1)
165
+ ])
166
+ ]),
167
+ default: B(() => [
168
+ (f(!0), S(ee, null, ue(te.value, (r) => (f(), Z(T, {
169
+ key: r.value,
170
+ "model-value": a.modelValue === r.value,
171
+ label: r.label,
172
+ disabled: r.disabled,
173
+ onClick: (H) => oe(r.value)
174
+ }, null, 8, ["model-value", "label", "disabled", "onClick"]))), 128))
175
+ ]),
176
+ _: 1
177
+ }, 8, ["show-menu"])) : C("", !0),
178
+ l("div", {
179
+ ref_key: "measurerRef",
180
+ ref: s,
181
+ "aria-hidden": "true",
182
+ class: "pointer-events-none invisible absolute -left-[9999px] -top-[9999px] flex flex-row items-center"
183
+ }, [
184
+ (f(!0), S(ee, null, ue(a.items, (r) => (f(), S("div", {
185
+ key: `measure-${r.value}`,
186
+ "data-tab-measure": ""
187
+ }, [
188
+ h(D, {
189
+ "model-value": a.modelValue,
190
+ label: r.label,
191
+ badge: r.badge,
192
+ disabled: r.disabled,
193
+ value: r.value
194
+ }, null, 8, ["model-value", "label", "badge", "disabled", "value"])
195
+ ]))), 128)),
196
+ l("div", Rt, [
197
+ h(x, { name: "more_vert" }),
198
+ l("span", Ct, u(n(j)("auditLog.modules.more")), 1)
199
+ ])
200
+ ], 512)
201
+ ], 512);
202
+ };
203
+ }
204
+ }), $t = Vt("team", () => {
205
+ const a = g([]), o = g(!1), v = g(!1), w = _(
206
+ () => Object.fromEntries(a.value.map((s) => [s.doc.userId, s.name]))
207
+ ), j = _(
208
+ () => Object.fromEntries(a.value.map((s) => [s.doc.userId, s.email]))
209
+ ), M = _(
210
+ () => Object.fromEntries(a.value.map((s) => [s.doc.userId, s.phoneNumber]))
211
+ );
212
+ async function k({ force: s = !1 } = {}) {
213
+ if (!(!s && a.value.length > 0))
214
+ try {
215
+ o.value = !0;
216
+ const O = await Pt.readTeamMembers();
217
+ a.value = O.sort((P, c) => P.doc.isOwner ? -1 : P.name.localeCompare(c.name)), v.value = !0;
218
+ } finally {
219
+ o.value = !1;
220
+ }
221
+ }
222
+ return {
223
+ members: a,
224
+ isLoading: o,
225
+ hasLoaded: v,
226
+ userIdToName: w,
227
+ userIdToEmail: j,
228
+ userIdToPhone: M,
229
+ readTeamMembers: k
230
+ };
231
+ }), Yt = {
232
+ class: "flex flex-col gap-4 p-12 w-[260px]"
233
+ }, Nt = {
234
+ class: "text-xs font-semibold text-fm-color-typo-secondary mb-4"
235
+ }, Bt = {
236
+ class: "flex min-h-0 flex-1 flex-col gap-16"
237
+ }, Kt = {
238
+ class: "space-y-16"
239
+ }, zt = {
240
+ class: "flex flex-wrap items-center gap-8"
241
+ }, qt = {
242
+ class: "w-fit"
243
+ }, Ht = {
244
+ key: 0,
245
+ class: "w-fit"
246
+ }, Wt = {
247
+ class: "w-fit"
248
+ }, Jt = {
249
+ class: "w-fit"
250
+ }, Gt = {
251
+ key: 0,
252
+ class: "space-y-12 p-4 text-sm"
253
+ }, Xt = {
254
+ class: "flex items-start justify-between gap-8 rounded-lg border border-fm-color-border-default p-12"
255
+ }, Qt = {
256
+ class: "min-w-0 flex-1"
257
+ }, Zt = {
258
+ class: "audit-log-operation-label-detail text-base font-bold leading-snug text-fm-color-typo-primary"
259
+ }, eo = {
260
+ class: "rounded-lg border border-fm-color-border-default p-12"
261
+ }, to = {
262
+ class: "space-y-12"
263
+ }, oo = {
264
+ class: "text-xs text-fm-color-typo-secondary"
265
+ }, ao = {
266
+ class: "font-semibold"
267
+ }, lo = {
268
+ class: "text-xs text-fm-color-typo-secondary"
269
+ }, so = {
270
+ class: "font-semibold"
271
+ }, no = {
272
+ class: "text-xs text-fm-color-typo-secondary"
273
+ }, uo = {
274
+ class: "break-all font-semibold"
275
+ }, io = {
276
+ key: 0
277
+ }, ro = {
278
+ class: "text-xs text-fm-color-typo-secondary"
279
+ }, co = {
280
+ class: "break-all font-mono text-xs font-semibold"
281
+ }, mo = {
282
+ class: "text-xs text-fm-color-typo-secondary"
283
+ }, fo = {
284
+ class: "break-all font-mono text-xs font-semibold"
285
+ }, vo = {
286
+ class: "text-xs text-fm-color-typo-secondary"
287
+ }, bo = {
288
+ class: "font-semibold"
289
+ }, go = {
290
+ key: 0,
291
+ class: "rounded-lg border border-fm-color-border-default"
292
+ }, po = {
293
+ class: "p-12"
294
+ }, ho = {
295
+ class: "text-base font-bold text-fm-color-typo-primary"
296
+ }, yo = {
297
+ class: "space-y-12 p-12"
298
+ }, _o = {
299
+ class: "text-xs text-fm-color-typo-secondary"
300
+ }, xo = {
301
+ class: "font-semibold"
302
+ }, Lo = {
303
+ class: "rounded-lg border border-fm-color-border-default"
304
+ }, So = {
305
+ class: "p-12"
306
+ }, ko = {
307
+ class: "text-base font-bold text-fm-color-typo-primary"
308
+ }, wo = {
309
+ class: "space-y-12 p-12"
310
+ }, Mo = {
311
+ class: "text-xs text-fm-color-typo-secondary"
312
+ }, Fo = {
313
+ class: "font-semibold"
314
+ }, Do = {
315
+ key: 0
316
+ }, Io = {
317
+ class: "text-xs text-fm-color-typo-secondary"
318
+ }, Oo = {
319
+ key: 0,
320
+ class: "font-semibold"
321
+ }, To = {
322
+ key: 1,
323
+ class: "break-all font-mono text-xs text-fm-color-typo-secondary"
324
+ }, jo = {
325
+ key: 1
326
+ }, Po = {
327
+ class: "text-xs text-fm-color-typo-secondary"
328
+ }, Vo = {
329
+ class: "font-semibold whitespace-pre-line"
330
+ }, Ao = {
331
+ class: "text-xs text-fm-color-typo-secondary"
332
+ }, Eo = {
333
+ class: "font-semibold"
334
+ }, Ro = {
335
+ class: "text-xs text-fm-color-typo-secondary"
336
+ }, Co = {
337
+ class: "break-all font-mono text-xs font-semibold"
338
+ }, Uo = {
339
+ key: 2
340
+ }, $o = {
341
+ class: "text-xs text-fm-color-typo-secondary"
342
+ }, Yo = {
343
+ class: "mt-4 space-y-4"
344
+ }, No = {
345
+ 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"
346
+ }, Bo = {
347
+ class: "text-xs font-semibold"
348
+ }, Ko = {
349
+ key: 0,
350
+ class: "text-fm-color-typo-secondary"
351
+ }, zo = {
352
+ key: 3
353
+ }, qo = {
354
+ class: "text-xs text-fm-color-typo-secondary"
355
+ }, Ho = {
356
+ 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"
357
+ }, ne = 100, xe = 1e3, Wo = "D MMM YYYY h:mm A", Jo = "YYYY-MM-DD HH:mm", A = "YYYY-MM-DD", Ne = "audit-log-export-fields", Go = /* @__PURE__ */ Be({
358
+ __name: "AuditLogList",
359
+ setup(a) {
360
+ const {
361
+ t: o
362
+ } = Ke(), v = Dt(), w = $t(), j = g(!1), M = g(!1), k = g([]), s = g(null), O = g(!1);
363
+ async function P(e) {
364
+ const t = Uint8Array.from(atob(e), (p) => p.charCodeAt(0)), i = new DecompressionStream("gzip"), L = i.writable.getWriter();
365
+ return await L.write(t), await L.close(), new Response(i.readable).text();
366
+ }
367
+ const c = g("");
368
+ let F = 0;
369
+ fe(() => {
370
+ var e, t;
371
+ return (t = (e = s.value) == null ? void 0 : e.metadata) == null ? void 0 : t.requestBody;
372
+ }, async (e) => {
373
+ const t = ++F;
374
+ if (!e) {
375
+ c.value = "";
376
+ return;
377
+ }
378
+ if (typeof e == "object") {
379
+ c.value = JSON.stringify(e, null, 2);
380
+ return;
381
+ }
382
+ if (e.startsWith("gzip:")) {
383
+ try {
384
+ const i = await P(e.slice(5));
385
+ if (t !== F) return;
386
+ c.value = JSON.stringify(JSON.parse(i), null, 2);
387
+ } catch {
388
+ if (t !== F) return;
389
+ c.value = e;
390
+ }
391
+ return;
392
+ }
393
+ try {
394
+ c.value = JSON.stringify(JSON.parse(e), null, 2);
395
+ } catch {
396
+ c.value = e;
397
+ }
398
+ }, {
399
+ immediate: !0
400
+ });
401
+ const K = g(1), ve = g(!1), J = g(0), te = _(() => Math.max(1, Math.ceil(J.value / ne))), oe = y().format("YYYY-MM-DD"), b = g({
402
+ startDate: `${oe} 00:00`,
403
+ endDate: `${oe} 23:59`
404
+ }), m = g(), D = g(), x = g(), T = g(), V = g("all");
405
+ function r(e) {
406
+ return typeof e == "string" ? [e] : Array.isArray(e) ? e.filter((t) => typeof t == "string") : [];
407
+ }
408
+ const H = se.filter((e) => e.key !== "all").map((e) => e.key);
409
+ function N(e) {
410
+ const t = se.find((i) => i.key !== "all" && i.subjectPrefixes.some((L) => e.startsWith(L)));
411
+ return (t == null ? void 0 : t.key) ?? "other";
412
+ }
413
+ function ae(e) {
414
+ const t = H.indexOf(e);
415
+ return t === -1 ? H.length : t;
416
+ }
417
+ const Le = _(() => se.map(({
418
+ key: e
419
+ }) => ({
420
+ label: o(`auditLog.modules.${e}`),
421
+ value: e
422
+ }))), E = _(() => se.find((e) => e.key === V.value) ?? se[0]), z = _(() => V.value === "all"), ze = _(() => w.members.map((e) => ({
423
+ label: e.name,
424
+ value: e.doc.userId
425
+ }))), qe = _(() => {
426
+ const e = $e.flatMap((p) => r(p.subject).map((I) => ({
427
+ label: p.label,
428
+ value: I
429
+ }))), t = Object.entries(Ee).map(([p, I]) => ({
430
+ label: I,
431
+ value: p
432
+ })), i = /* @__PURE__ */ new Set(), L = [];
433
+ for (const p of [...e, ...t])
434
+ if (!i.has(p.value)) {
435
+ i.add(p.value);
436
+ const I = N(p.value);
437
+ L.push({
438
+ ...p,
439
+ group: o(`auditLog.modules.${I}`)
440
+ });
441
+ }
442
+ return L.sort((p, I) => ae(N(p.value)) - ae(N(I.value)));
443
+ });
444
+ function He(e, t) {
445
+ const i = t.toLowerCase();
446
+ return e.label.toLowerCase().includes(i) || e.value.replace(/^business::/, "").toLowerCase().includes(i) ? !0 : e.value.toLowerCase().includes(i);
447
+ }
448
+ const $ = _(() => ({
449
+ manage: o("auditLog.action.manage"),
450
+ create: o("auditLog.action.create"),
451
+ read: o("auditLog.action.read"),
452
+ update: o("auditLog.action.update"),
453
+ delete: o("auditLog.action.delete")
454
+ })), We = _(() => [{
455
+ label: $.value.manage,
456
+ value: "manage"
457
+ }, {
458
+ label: $.value.create,
459
+ value: "create"
460
+ }, {
461
+ label: $.value.read,
462
+ value: "read"
463
+ }, {
464
+ label: $.value.update,
465
+ value: "update"
466
+ }, {
467
+ label: $.value.delete,
468
+ value: "delete"
469
+ }]), ie = _(() => ({
470
+ allowed: o("auditLog.outcome.success"),
471
+ denied: o("auditLog.outcome.failed"),
472
+ skipped: o("auditLog.outcome.skipped")
473
+ })), Je = _(() => [{
474
+ label: ie.value.allowed,
475
+ value: "allowed"
476
+ }, {
477
+ label: ie.value.denied,
478
+ value: "denied"
479
+ }, {
480
+ label: ie.value.skipped,
481
+ value: "skipped"
482
+ }]), Ge = _(() => ({
483
+ admin: o("auditLog.detail.resolvedFromValue.admin"),
484
+ staff: o("auditLog.detail.resolvedFromValue.staff"),
485
+ permissionSet: o("auditLog.detail.resolvedFromValue.permissionSet"),
486
+ systemPermissionSet: o("auditLog.detail.resolvedFromValue.systemPermissionSet"),
487
+ custom: o("auditLog.detail.resolvedFromValue.custom"),
488
+ "no-match": o("auditLog.detail.resolvedFromValue.noMatch"),
489
+ unknown: o("auditLog.detail.resolvedFromValue.unknown")
490
+ })), Xe = _(() => ({
491
+ GET: $.value.read,
492
+ POST: $.value.create,
493
+ PUT: $.value.update,
494
+ PATCH: $.value.update,
495
+ DELETE: $.value.delete
496
+ })), Se = {
497
+ allowed: "success",
498
+ denied: "critical",
499
+ skipped: "warning"
500
+ };
501
+ function re(e) {
502
+ return y(e).format(Wo);
503
+ }
504
+ const Qe = _(() => {
505
+ const {
506
+ startDate: e,
507
+ endDate: t
508
+ } = b.value;
509
+ return e && t ? `${re(e)} – ${re(t)}` : e ? re(e) : t ? re(t) : o("auditLog.dateRange.placeholder");
510
+ }), Ze = _(() => [{
511
+ label: o("date.predefinedRanges.today"),
512
+ value: {
513
+ startDate: y().format(A),
514
+ endDate: y().format(A)
515
+ }
516
+ }, {
517
+ label: o("date.predefinedRanges.yesterday"),
518
+ value: {
519
+ startDate: y().subtract(1, "day").format(A),
520
+ endDate: y().subtract(1, "day").format(A)
521
+ }
522
+ }, {
523
+ label: o("date.predefinedRanges.thisWeek"),
524
+ value: {
525
+ startDate: y().startOf("week").format(A),
526
+ endDate: y().endOf("week").format(A)
527
+ }
528
+ }, {
529
+ label: o("date.predefinedRanges.lastWeek"),
530
+ value: {
531
+ startDate: y().subtract(1, "week").startOf("week").format(A),
532
+ endDate: y().subtract(1, "week").endOf("week").format(A)
533
+ }
534
+ }, {
535
+ label: o("date.predefinedRanges.last7Days"),
536
+ value: {
537
+ startDate: y().subtract(7, "day").format(A),
538
+ endDate: y().subtract(1, "day").format(A)
539
+ }
540
+ }, {
541
+ label: o("date.predefinedRanges.thisMonth"),
542
+ value: {
543
+ startDate: y().startOf("month").format(A),
544
+ endDate: y().endOf("month").format(A)
545
+ }
546
+ }, {
547
+ label: o("date.predefinedRanges.lastMonth"),
548
+ value: {
549
+ startDate: y().subtract(1, "month").startOf("month").format(A),
550
+ endDate: y().subtract(1, "month").endOf("month").format(A)
551
+ }
552
+ }]);
553
+ function be(e) {
554
+ var t;
555
+ return ((t = $e.find((i) => i.subject === e)) == null ? void 0 : t.label) ?? Ee[e];
556
+ }
557
+ function de(e) {
558
+ var i;
559
+ const t = w.userIdToName[e.userId];
560
+ return t || (w.hasLoaded ? (i = v.sessionUser.value) != null && i.isInternal ? `${e.actorName ?? e.userId} (${o("auditLog.user.feedmeAdmin")})` : o("auditLog.user.feedmeAdmin") : e.userId);
561
+ }
562
+ function ke(e) {
563
+ return w.userIdToPhone[e.userId] || "-";
564
+ }
565
+ function et(e) {
566
+ return w.userIdToEmail[e.userId] || "-";
567
+ }
568
+ function we(e) {
569
+ return y(e).format("DD MMM YYYY, HH:mm");
570
+ }
571
+ function tt(e) {
572
+ return y(e).format("DD MMM YYYY, HH:mm:ss").toUpperCase();
573
+ }
574
+ function Me(e) {
575
+ return $.value[e] ?? e;
576
+ }
577
+ function Fe(e) {
578
+ return e.metadata.operationLabel ?? Me(e.action);
579
+ }
580
+ function ot(e) {
581
+ return be(e.subject) ?? e.subject;
582
+ }
583
+ function ge(e) {
584
+ return ie.value[e];
585
+ }
586
+ function at(e) {
587
+ return Ge.value[e] ?? e;
588
+ }
589
+ function lt(e) {
590
+ return e.metadata.requestMethod ? Xe.value[e.metadata.requestMethod] ?? e.metadata.requestMethod : Me(e.action);
591
+ }
592
+ function De(e) {
593
+ const t = String(e ?? "");
594
+ return `"${(/^[=+\-@\t\r]/.test(t) ? `'${t}` : t).replace(/"/g, '""')}"`;
595
+ }
596
+ const pe = [{
597
+ key: "timestamp",
598
+ labelKey: "auditLog.exportFields.timestamp",
599
+ getValue: (e) => we(e.timestamp),
600
+ defaultSelected: !0
601
+ }, {
602
+ key: "userName",
603
+ labelKey: "auditLog.exportFields.userName",
604
+ getValue: (e) => de(e),
605
+ defaultSelected: !0
606
+ }, {
607
+ key: "userPhone",
608
+ labelKey: "auditLog.exportFields.userPhone",
609
+ getValue: (e) => ke(e),
610
+ defaultSelected: !0
611
+ }, {
612
+ key: "subject",
613
+ labelKey: "auditLog.exportFields.subject",
614
+ getValue: (e) => be(e.subject) ?? e.subject,
615
+ defaultSelected: !0
616
+ }, {
617
+ key: "action",
618
+ labelKey: "auditLog.exportFields.action",
619
+ getValue: (e) => e.action,
620
+ defaultSelected: !0
621
+ }, {
622
+ key: "operation",
623
+ labelKey: "auditLog.exportFields.operation",
624
+ getValue: (e) => Fe(e),
625
+ defaultSelected: !0
626
+ }, {
627
+ key: "outcome",
628
+ labelKey: "auditLog.exportFields.outcome",
629
+ getValue: (e) => ge(e.outcome),
630
+ defaultSelected: !0
631
+ }, {
632
+ key: "businessId",
633
+ labelKey: "auditLog.exportFields.businessId",
634
+ getValue: (e) => e.businessId,
635
+ defaultSelected: !1
636
+ }, {
637
+ key: "restaurantId",
638
+ labelKey: "auditLog.exportFields.restaurantId",
639
+ getValue: (e) => e.restaurantId,
640
+ defaultSelected: !1
641
+ }, {
642
+ key: "country",
643
+ labelKey: "auditLog.exportFields.country",
644
+ getValue: (e) => e.country,
645
+ defaultSelected: !1
646
+ }, {
647
+ key: "resolvedFrom",
648
+ labelKey: "auditLog.exportFields.resolvedFrom",
649
+ getValue: (e) => {
650
+ var t;
651
+ return (t = e.metadata) == null ? void 0 : t.resolvedFrom;
652
+ },
653
+ defaultSelected: !1
654
+ }, {
655
+ key: "requestMethod",
656
+ labelKey: "auditLog.exportFields.requestMethod",
657
+ getValue: (e) => {
658
+ var t;
659
+ return (t = e.metadata) == null ? void 0 : t.requestMethod;
660
+ },
661
+ defaultSelected: !1
662
+ }, {
663
+ key: "requestPath",
664
+ labelKey: "auditLog.exportFields.requestPath",
665
+ getValue: (e) => {
666
+ var t;
667
+ return (t = e.metadata) == null ? void 0 : t.requestPath;
668
+ },
669
+ defaultSelected: !1
670
+ }];
671
+ function st() {
672
+ try {
673
+ const e = localStorage.getItem(Ne);
674
+ if (e) {
675
+ const t = JSON.parse(e);
676
+ if (Array.isArray(t) && t.length > 0) return new Set(t);
677
+ }
678
+ } catch {
679
+ }
680
+ return new Set(pe.filter((e) => e.defaultSelected).map((e) => e.key));
681
+ }
682
+ const G = g(st());
683
+ function nt(e) {
684
+ const t = new Set(G.value);
685
+ if (t.has(e)) {
686
+ if (t.size <= 1) return;
687
+ t.delete(e);
688
+ } else
689
+ t.add(e);
690
+ G.value = t;
691
+ try {
692
+ localStorage.setItem(Ne, JSON.stringify([...t]));
693
+ } catch {
694
+ }
695
+ }
696
+ async function ut() {
697
+ var e, t, i, L, p, I;
698
+ if (!M.value) {
699
+ M.value = !0;
700
+ try {
701
+ const {
702
+ startDate: Y,
703
+ endDate: q
704
+ } = b.value, W = E.value.subjectPrefixes, ce = (/* @__PURE__ */ new Date()).toISOString().slice(0, 19).replace("T", " "), d = q ? X(q) : null, Q = d && d < ce ? d : ce, ft = {
705
+ ...Y ? {
706
+ from: X(Y)
707
+ } : {},
708
+ to: Q,
709
+ ...(e = m.value) != null && e.length ? {
710
+ userIds: m.value
711
+ } : {},
712
+ ...z.value && ((t = D.value) != null && t.length) ? {
713
+ subjects: D.value
714
+ } : {},
715
+ ...W.length ? {
716
+ subjectPrefixes: [...W]
717
+ } : {},
718
+ ...(i = T.value) != null && i.length ? {
719
+ actions: T.value
720
+ } : {},
721
+ ...(L = x.value) != null && L.length ? {
722
+ outcomes: x.value
723
+ } : {}
724
+ }, Te = [];
725
+ let je = 0;
726
+ for (; ; ) {
727
+ const R = await _e.read({
728
+ ...ft,
729
+ limit: xe,
730
+ offset: je
731
+ });
732
+ if (Te.push(...R), R.length < xe) break;
733
+ je += xe;
734
+ }
735
+ const Pe = pe.filter((R) => G.value.has(R.key)), vt = Pe.map((R) => o(R.labelKey)), bt = Te.map((R) => Pe.map((kt) => kt.getValue(R) ?? "")), ye = -(/* @__PURE__ */ new Date()).getTimezoneOffset(), gt = ye >= 0 ? "+" : "-", pt = String(Math.floor(Math.abs(ye) / 60)).padStart(2, "0"), ht = String(Math.abs(ye) % 60).padStart(2, "0"), yt = `UTC${gt}${pt}:${ht}`, Ve = ((p = v.currentBusiness.value) == null ? void 0 : p.name) || "", _t = [Y, q].filter(Boolean).join(" – "), xt = [...[[o("auditLog.title")], [`${o("auditLog.frontMatter.date")}: ${_t}`], ...Ve ? [[`${o("auditLog.frontMatter.business")}: ${Ve}`]] : [], [`${o("auditLog.frontMatter.generatedBy")}: ${y().format("DD MMM YYYY, HH:mm")} (${yt})`], []].map((R) => R.map(De).join(",")), ...[vt, ...bt].map((R) => R.map(De).join(","))].join(`
736
+ `), Lt = `audit-log_${(((I = v.currentBusiness.value) == null ? void 0 : I.name) || "business").replace(/[^a-z0-9_-]+/gi, "_")}_${y().format("YYYYMMDD_HHmmss")}.csv`, St = new Blob([`\uFEFF${xt}`], {
737
+ type: "text/csv;charset=utf-8;"
738
+ }), Ae = window.URL.createObjectURL(St), le = document.createElement("a");
739
+ le.href = Ae, le.download = Lt, document.body.appendChild(le), le.click(), le.remove(), window.URL.revokeObjectURL(Ae);
740
+ } finally {
741
+ M.value = !1;
742
+ }
743
+ }
744
+ }
745
+ const it = [{
746
+ accessorKey: "timestamp",
747
+ header: () => o("auditLog.columns.timestamp"),
748
+ cell(e) {
749
+ return we(e.row.original.timestamp);
750
+ }
751
+ }, {
752
+ accessorKey: "userId",
753
+ header: () => o("auditLog.columns.user"),
754
+ enableSorting: !1,
755
+ size: 220,
756
+ cell(e) {
757
+ const t = e.row.original;
758
+ return h("div", {
759
+ class: "flex items-center gap-8"
760
+ }, [h(Re.FmAvatar, {
761
+ name: de(t),
762
+ size: "sm",
763
+ class: "shrink-0"
764
+ }, null), h("div", {
765
+ class: "min-w-0"
766
+ }, [h("p", {
767
+ class: "truncate font-semibold"
768
+ }, [de(t)]), h("p", {
769
+ class: "truncate text-fm-color-typo-secondary"
770
+ }, [ke(t)])])]);
771
+ }
772
+ }, {
773
+ accessorKey: "subject",
774
+ header: () => o("auditLog.columns.subject"),
775
+ cell(e) {
776
+ const t = e.row.original;
777
+ return be(t.subject) ?? t.subject;
778
+ }
779
+ }, {
780
+ accessorKey: "action",
781
+ header: () => o("auditLog.columns.action"),
782
+ enableSorting: !1,
783
+ size: 280,
784
+ meta: {
785
+ cellSpanClass: "audit-log-action-label"
786
+ },
787
+ cell(e) {
788
+ return Fe(e.row.original);
789
+ }
790
+ }, {
791
+ accessorKey: "outcome",
792
+ header: () => o("auditLog.columns.outcome"),
793
+ enableSorting: !1,
794
+ cell(e) {
795
+ const t = e.row.original;
796
+ return h(Re.FmChip, {
797
+ variant: Se[t.outcome] ?? "neutral",
798
+ label: ge(t.outcome),
799
+ compact: !0
800
+ }, null);
801
+ }
802
+ }];
803
+ function X(e) {
804
+ const t = y(e, Jo);
805
+ return new Date(t.year(), t.month(), t.date(), t.hour(), t.minute(), 0).toISOString().slice(0, 19).replace("T", " ");
806
+ }
807
+ async function Ie() {
808
+ var e, t, i, L;
809
+ j.value = !0;
810
+ try {
811
+ const {
812
+ startDate: p,
813
+ endDate: I
814
+ } = b.value, Y = (K.value - 1) * ne, q = E.value.subjectPrefixes, W = await _e.read({
815
+ limit: ne,
816
+ offset: Y,
817
+ ...p ? {
818
+ from: X(p)
819
+ } : {},
820
+ ...I ? {
821
+ to: X(I)
822
+ } : {},
823
+ ...(e = m.value) != null && e.length ? {
824
+ userIds: m.value
825
+ } : {},
826
+ ...z.value && ((t = D.value) != null && t.length) ? {
827
+ subjects: D.value
828
+ } : {},
829
+ ...q.length ? {
830
+ subjectPrefixes: [...q]
831
+ } : {},
832
+ ...(i = T.value) != null && i.length ? {
833
+ actions: T.value
834
+ } : {},
835
+ ...(L = x.value) != null && L.length ? {
836
+ outcomes: x.value
837
+ } : {}
838
+ });
839
+ k.value = W, ve.value = W.length === ne;
840
+ } finally {
841
+ j.value = !1;
842
+ }
843
+ }
844
+ const Oe = _(() => {
845
+ var e;
846
+ return JSON.stringify({
847
+ businessId: ((e = v.currentBusiness.value) == null ? void 0 : e._id) ?? "",
848
+ dateRange: b.value,
849
+ users: [...m.value ?? []].sort(),
850
+ subjects: [...D.value ?? []].sort(),
851
+ outcomes: [...x.value ?? []].sort(),
852
+ actions: [...T.value ?? []].sort(),
853
+ moduleKey: V.value
854
+ });
855
+ });
856
+ async function rt() {
857
+ var L, p, I, Y;
858
+ const {
859
+ startDate: e,
860
+ endDate: t
861
+ } = b.value, i = E.value.subjectPrefixes;
862
+ J.value = await _e.count({
863
+ ...e ? {
864
+ from: X(e)
865
+ } : {},
866
+ ...t ? {
867
+ to: X(t)
868
+ } : {},
869
+ ...(L = m.value) != null && L.length ? {
870
+ userIds: m.value
871
+ } : {},
872
+ ...z.value && ((p = D.value) != null && p.length) ? {
873
+ subjects: D.value
874
+ } : {},
875
+ ...i.length ? {
876
+ subjectPrefixes: [...i]
877
+ } : {},
878
+ ...(I = T.value) != null && I.length ? {
879
+ actions: T.value
880
+ } : {},
881
+ ...(Y = x.value) != null && Y.length ? {
882
+ outcomes: x.value
883
+ } : {}
884
+ });
885
+ }
886
+ fe(Oe, async () => {
887
+ var e;
888
+ K.value = 1, (e = v.currentBusiness.value) != null && e._id && await Promise.all([rt(), Ie()]);
889
+ }, {
890
+ immediate: !0
891
+ });
892
+ let he = !1;
893
+ async function dt({
894
+ pageIndex: e
895
+ }) {
896
+ var t;
897
+ if ((t = v.currentBusiness.value) != null && t._id && e !== 0 && !he) {
898
+ he = !0, K.value = e + 1;
899
+ try {
900
+ await Ie();
901
+ } finally {
902
+ he = !1;
903
+ }
904
+ }
905
+ }
906
+ function ct(e) {
907
+ s.value = e, O.value = !0;
908
+ }
909
+ function mt() {
910
+ O.value = !1, s.value = null;
911
+ }
912
+ return fe(v.currentBusiness, (e) => {
913
+ e && w.readTeamMembers();
914
+ }, {
915
+ immediate: !0
916
+ }), (e, t) => {
917
+ const i = U("FmSpacer"), L = U("FmButton"), p = U("FmMenuItem"), I = U("FmMenu"), Y = U("FmChip"), q = U("FmDateRangePicker"), W = U("FmTable"), ce = U("FmSideSheet");
918
+ return f(), S(ee, null, [h(Tt, {
919
+ heading: n(o)("auditLog.title")
920
+ }, {
921
+ "append-heading": B(() => [h(i), h(L, {
922
+ variant: "primary",
923
+ "prepend-icon": "upload",
924
+ label: n(o)("auditLog.export"),
925
+ disabled: k.value.length === 0 || M.value || n(w).isLoading || n(w).members.length === 0,
926
+ loading: M.value,
927
+ onClick: ut
928
+ }, null, 8, ["label", "disabled", "loading"]), h(I, {
929
+ "close-on-click": !1,
930
+ "z-index": 50
931
+ }, {
932
+ "menu-button": B(() => [h(L, {
933
+ variant: "tertiary",
934
+ icon: "settings",
935
+ "aria-label": n(o)("auditLog.exportSettings.title"),
936
+ disabled: M.value
937
+ }, null, 8, ["aria-label", "disabled"])]),
938
+ default: B(() => [l("div", Yt, [l("p", Nt, u(n(o)("auditLog.exportSettings.title")), 1), (f(), S(ee, null, ue(pe, (d) => h(p, {
939
+ key: d.key,
940
+ label: n(o)(d.labelKey),
941
+ "has-checkbox": "",
942
+ "model-value": G.value.has(d.key),
943
+ disabled: G.value.has(d.key) && G.value.size === 1,
944
+ onClick: (Q) => nt(d.key)
945
+ }, null, 8, ["label", "model-value", "disabled", "onClick"])), 64))])]),
946
+ _: 1
947
+ })]),
948
+ default: B(() => [l("div", Bt, [l("div", Kt, [h(Ut, {
949
+ modelValue: V.value,
950
+ "onUpdate:modelValue": t[0] || (t[0] = (d) => V.value = d),
951
+ items: Le.value
952
+ }, null, 8, ["modelValue", "items"]), l("div", zt, [h(q, {
953
+ modelValue: b.value,
954
+ "onUpdate:modelValue": t[1] || (t[1] = (d) => b.value = d),
955
+ "show-predefined-range": "",
956
+ "show-time": "",
957
+ "predefined-range": Ze.value
958
+ }, {
959
+ "trigger-button": B(() => [h(Y, {
960
+ label: Qe.value,
961
+ icon: "calendar_month"
962
+ }, null, 8, ["label"])]),
963
+ _: 1
964
+ }, 8, ["modelValue", "predefined-range"]), l("div", qt, [h(me, {
965
+ modelValue: m.value,
966
+ "onUpdate:modelValue": t[2] || (t[2] = (d) => m.value = d),
967
+ items: ze.value,
968
+ multiple: "",
969
+ variant: "dark",
970
+ placeholder: n(o)("auditLog.filter.user_placeholder"),
971
+ "selected-prefix": n(o)("auditLog.filter.selected_user_prefix"),
972
+ "chip-icon": "account_circle"
973
+ }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])]), z.value ? (f(), S("div", Ht, [h(me, {
974
+ modelValue: D.value,
975
+ "onUpdate:modelValue": t[3] || (t[3] = (d) => D.value = d),
976
+ items: qe.value,
977
+ "filter-fn": He,
978
+ multiple: "",
979
+ variant: "dark",
980
+ placeholder: n(o)("auditLog.filter.subject_placeholder"),
981
+ "selected-prefix": n(o)("auditLog.filter.selected_subject_prefix"),
982
+ "chip-icon": "badge"
983
+ }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])])) : C("", !0), l("div", Wt, [h(me, {
984
+ modelValue: T.value,
985
+ "onUpdate:modelValue": t[4] || (t[4] = (d) => T.value = d),
986
+ items: We.value,
987
+ multiple: "",
988
+ variant: "dark",
989
+ placeholder: n(o)("auditLog.filter.action_placeholder"),
990
+ "selected-prefix": n(o)("auditLog.filter.selected_action_prefix"),
991
+ searchable: !1
992
+ }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])]), l("div", Jt, [h(me, {
993
+ modelValue: x.value,
994
+ "onUpdate:modelValue": t[5] || (t[5] = (d) => x.value = d),
995
+ items: Je.value,
996
+ multiple: "",
997
+ variant: "dark",
998
+ placeholder: n(o)("auditLog.filter.status_placeholder"),
999
+ "selected-prefix": n(o)("auditLog.filter.selected_status_prefix"),
1000
+ searchable: !1,
1001
+ "chip-icon": "check_circle"
1002
+ }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])])])]), !j.value && k.value.length === 0 ? (f(), Z(n(jt), {
1003
+ key: 0,
1004
+ title: n(o)("auditLog.noData.title"),
1005
+ subtitle: n(o)("auditLog.noData.subtitle")
1006
+ }, null, 8, ["title", "subtitle"])) : (f(), Z(It, {
1007
+ key: 1
1008
+ }, {
1009
+ default: B(() => [(f(), Z(W, {
1010
+ key: Oe.value,
1011
+ "column-defs": it,
1012
+ "row-data": k.value,
1013
+ "page-size": ne,
1014
+ "page-count": te.value,
1015
+ "row-count": J.value,
1016
+ "fetch-fn": dt,
1017
+ "hide-footer": te.value <= 1,
1018
+ loading: j.value,
1019
+ "pin-header-row": "",
1020
+ class: "audit-log-list-table min-h-0 flex-1 cursor-pointer",
1021
+ onRowClick: t[6] || (t[6] = (d) => ct(d.original))
1022
+ }, null, 8, ["row-data", "page-count", "row-count", "hide-footer", "loading"]))]),
1023
+ _: 1
1024
+ }))])]),
1025
+ _: 1
1026
+ }, 8, ["heading"]), h(ce, {
1027
+ header: n(o)("auditLog.detail.header"),
1028
+ "model-value": O.value,
1029
+ "max-width": 480,
1030
+ "dismiss-away": "",
1031
+ "onUpdate:modelValue": t[7] || (t[7] = (d) => {
1032
+ d || mt();
1033
+ })
1034
+ }, {
1035
+ default: B(() => [s.value ? (f(), S("div", Gt, [l("div", Xt, [l("div", Qt, [l("p", Zt, u(ot(s.value)), 1)]), h(Y, {
1036
+ variant: Se[s.value.outcome] ?? "neutral",
1037
+ label: ge(s.value.outcome),
1038
+ compact: ""
1039
+ }, null, 8, ["variant", "label"])]), l("div", eo, [l("div", to, [l("div", null, [l("p", oo, u(n(o)("auditLog.detail.date")), 1), l("p", ao, u(tt(s.value.timestamp)), 1)]), l("div", null, [l("p", lo, u(n(o)("auditLog.detail.user")), 1), l("p", so, u(de(s.value)), 1)]), l("div", null, [l("p", no, u(n(o)("auditLog.detail.email")), 1), l("p", uo, u(et(s.value)), 1)]), s.value.field ? (f(), S("div", io, [l("p", ro, u(n(o)("auditLog.detail.field")), 1), l("p", co, u(s.value.field), 1)])) : C("", !0), l("div", null, [l("p", mo, u(n(o)("auditLog.detail.business")), 1), l("p", fo, u(s.value.businessId || "-"), 1)]), l("div", null, [l("p", vo, u(n(o)("auditLog.detail.restaurant")), 1), l("p", bo, u(s.value.restaurantId || "-"), 1)])])]), s.value.metadata.operationLabel ? (f(), S("div", go, [l("div", po, [l("p", ho, u(n(o)("auditLog.detail.eventDetails")), 1)]), t[8] || (t[8] = l("hr", {
1040
+ class: "border-fm-color-border-default"
1041
+ }, null, -1)), l("div", yo, [l("div", null, [l("p", _o, u(n(o)("auditLog.detail.actionDescription")), 1), l("p", xo, u(s.value.metadata.operationLabel), 1)])])])) : C("", !0), l("div", Lo, [l("div", So, [l("p", ko, u(n(o)("auditLog.detail.metadata")), 1)]), t[9] || (t[9] = l("hr", {
1042
+ class: "border-fm-color-border-default"
1043
+ }, null, -1)), l("div", wo, [l("div", null, [l("p", Mo, u(n(o)("auditLog.detail.resolvedFrom")), 1), l("p", Fo, u(at(s.value.metadata.resolvedFrom)), 1)]), (s.value.metadata.resolvedFrom === "permissionSet" || s.value.metadata.resolvedFrom === "systemPermissionSet") && (s.value.metadata.permissionSetName || s.value.metadata.permissionSetId) ? (f(), S("div", Do, [l("p", Io, u(n(o)("auditLog.detail.permissionSet")), 1), s.value.metadata.permissionSetName ? (f(), S("p", Oo, u(s.value.metadata.permissionSetName), 1)) : C("", !0), s.value.metadata.permissionSetId ? (f(), S("p", To, u(s.value.metadata.permissionSetId), 1)) : C("", !0)])) : C("", !0), s.value.metadata.reason ? (f(), S("div", jo, [l("p", Po, u(n(o)("auditLog.detail.reason")), 1), l("p", Vo, u(s.value.metadata.reason), 1)])) : C("", !0), l("div", null, [l("p", Ao, u(n(o)("auditLog.detail.requestMethod")), 1), l("p", Eo, u(lt(s.value)), 1)]), l("div", null, [l("p", Ro, u(n(o)("auditLog.detail.requestPath")), 1), l("p", Co, u(s.value.metadata.requestPath || "-"), 1)]), s.value.metadata.trace && s.value.metadata.trace.length > 0 ? (f(), S("div", Uo, [l("p", $o, u(n(o)("auditLog.detail.permissionTrace")), 1), l("ol", Yo, [(f(!0), S(ee, null, ue(s.value.metadata.trace, (d, Q) => (f(), S("li", {
1044
+ key: Q,
1045
+ class: "flex items-center gap-6"
1046
+ }, [l("span", No, u(Q + 1), 1), l("span", Bo, u(d), 1), Q < s.value.metadata.trace.length - 1 ? (f(), S("span", Ko, "→")) : C("", !0)]))), 128))])])) : C("", !0), c.value ? (f(), S("div", zo, [l("p", qo, u(n(o)("auditLog.detail.requestBody")), 1), l("pre", Ho, u(c.value), 1)])) : C("", !0)])])])) : C("", !0)]),
1047
+ _: 1
1048
+ }, 8, ["header", "model-value"])], 64);
1049
+ };
1050
+ }
1051
+ }), da = /* @__PURE__ */ Ot(Go, [["__scopeId", "data-v-61b74784"]]);
1052
+ export {
1053
+ da as default
1054
+ };