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

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