@archbase/security-ui 4.0.47 → 4.1.0

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.
package/dist/index.js CHANGED
@@ -1,14 +1,14 @@
1
- import { Modal as Fe, ScrollArea as we, Stack as oe, Grid as I, Group as V, Button as N, Paper as K, Box as He, Text as J, List as Pe, Checkbox as Je, Tooltip as se, ActionIcon as H, Flex as te, Space as sr, Input as he, useTree as Ze, useMantineColorScheme as Oe, TextInput as Qe, Tree as Ye, Badge as Se, Tabs as ie, RingProgress as Zr } from "@mantine/core";
2
- import { getI18nextInstance as t, resolveArchbasePasswordPolicy as Qr, ARCHBASE_IOC_API_TYPE as _, emit as Ie, builder as Te, validateArchbasePassword as Yr, convertDateToISOString as Xr, processErrorMessage as Ae, getKeyByEnumValue as le, useArchbaseTheme as nr, useArchbaseValidator as Kr, useArchbaseTranslation as _r, useValidationErrors as ea, processDetailErrorMessage as De } from "@archbase/core";
3
- import { ArchbaseEdit as ae, ArchbaseNotifications as X, ArchbasePasswordEdit as ra, ArchbaseSelect as aa, ArchbaseCheckbox as pe, ArchbaseAvatarEdit as ta, ArchbaseAsyncSelect as oa, Columns as fe, ArchbaseDataGridColumn as m, ArchbaseDataGrid as be, ArchbaseDialog as ee } from "@archbase/components";
4
- import { useArchbaseV1V2Compatibility as ke, useArchbaseDataSourceListener as Xe, useArchbaseRemoteServiceApi as re, useArchbaseRemoteDataSource as Ue, ArchbaseDataSource as sa, useArchbaseStore as ir, useArchbaseRemoteDataSourceV2 as ye, useArchbaseDataSource as na } from "@archbase/data";
5
- import { useState as O, useCallback as ge, useEffect as Re, forwardRef as ia, useMemo as xe, useRef as je } from "react";
6
- import { IconArrowRight as lr, IconArrowLeft as cr, IconChevronDown as Ke, IconBorderCornerSquare as _e, IconEye as $e, IconEdit as me, IconTrashX as Ce, IconShieldCheckered as Le, IconPlus as ze } from "@tabler/icons-react";
7
- import { UserGroupDto as er, SecurityType as P, UserDto as la, GroupDto as ca, ProfileDto as da, ApiTokenDto as ua } from "@archbase/security";
8
- import { DateTimePicker as ha } from "@mantine/dates";
9
- import { useFocusTrap as pa, useDebouncedValue as rr } from "@mantine/hooks";
10
- import { ArchbaseSpaceFixed as xa, ArchbaseSpaceFill as ma, ArchbaseSpaceBottom as fa } from "@archbase/layout";
11
- var Ve = { exports: {} }, ve = {};
1
+ import { Modal as Fe, ScrollArea as je, Stack as U, Grid as G, Group as D, Button as H, Paper as Y, Box as _e, Text as v, List as Ee, Checkbox as ea, Tooltip as ve, ActionIcon as de, Flex as Te, Space as pa, Input as ge, useTree as aa, useMantineColorScheme as Ne, TextInput as xe, Tree as ra, Badge as se, Tabs as Z, RingProgress as $a, SimpleGrid as Ve, Loader as Qe, Alert as Re, Chip as sa, Table as W } from "@mantine/core";
2
+ import { getI18nextInstance as i, resolveArchbasePasswordPolicy as La, ARCHBASE_IOC_API_TYPE as Q, emit as $e, builder as ke, validateArchbasePassword as Na, convertDateToISOString as Va, processErrorMessage as ue, getKeyByEnumValue as pe, useArchbaseTheme as Xe, useArchbaseValidator as Ga, useArchbaseTranslation as Ma, useValidationErrors as Oa, processDetailErrorMessage as De } from "@archbase/core";
3
+ import { ArchbaseEdit as re, ArchbaseNotifications as _, ArchbasePasswordEdit as Ua, ArchbaseSelect as Ba, ArchbaseCheckbox as fe, ArchbaseAvatarEdit as Wa, ArchbaseAsyncSelect as qa, Columns as we, ArchbaseDataGridColumn as S, ArchbaseDataGrid as xa, ArchbaseDialog as le } from "@archbase/components";
4
+ import { useArchbaseV1V2Compatibility as Ie, useArchbaseDataSourceListener as ta, useArchbaseRemoteServiceApi as X, useArchbaseRemoteDataSource as Ze, ArchbaseDataSource as Ha, useArchbaseStore as ma, useArchbaseRemoteDataSourceV2 as Ce, useArchbaseDataSource as Ja } from "@archbase/data";
5
+ import { useState as k, useCallback as ce, useEffect as ye, forwardRef as Za, useMemo as ae, useRef as be } from "react";
6
+ import { IconArrowRight as ga, IconArrowLeft as fa, IconChevronDown as oa, IconBorderCornerSquare as ia, IconEye as Qa, IconEdit as ba, IconTrashX as Ye, IconShieldCheckered as Xa, IconPlus as ja, IconChartBar as Ya, IconListSearch as Ka, IconShieldSearch as _a } from "@tabler/icons-react";
7
+ import { UserGroupDto as na, SecurityType as q, UserDto as er, GroupDto as ar, ProfileDto as rr, ApiTokenDto as sr } from "@archbase/security";
8
+ import { DateTimePicker as tr } from "@mantine/dates";
9
+ import { useFocusTrap as or, useDebouncedValue as la } from "@mantine/hooks";
10
+ import { ArchbaseSpaceFixed as ir, ArchbaseSpaceFill as nr, ArchbaseSpaceBottom as lr } from "@archbase/layout";
11
+ var Be = { exports: {} }, Se = {};
12
12
  /**
13
13
  * @license React
14
14
  * react-jsx-runtime.production.js
@@ -18,142 +18,142 @@ var Ve = { exports: {} }, ve = {};
18
18
  * This source code is licensed under the MIT license found in the
19
19
  * LICENSE file in the root directory of this source tree.
20
20
  */
21
- var ar;
22
- function ba() {
23
- if (ar)
24
- return ve;
25
- ar = 1;
26
- var r = Symbol.for("react.transitional.element"), u = Symbol.for("react.fragment");
27
- function g(i, l, x) {
28
- var A = null;
29
- if (x !== void 0 && (A = "" + x), l.key !== void 0 && (A = "" + l.key), "key" in l) {
30
- x = {};
31
- for (var c in l)
32
- c !== "key" && (x[c] = l[c]);
21
+ var ca;
22
+ function cr() {
23
+ if (ca)
24
+ return Se;
25
+ ca = 1;
26
+ var a = Symbol.for("react.transitional.element"), r = Symbol.for("react.fragment");
27
+ function n(o, l, t) {
28
+ var b = null;
29
+ if (t !== void 0 && (b = "" + t), l.key !== void 0 && (b = "" + l.key), "key" in l) {
30
+ t = {};
31
+ for (var m in l)
32
+ m !== "key" && (t[m] = l[m]);
33
33
  } else
34
- x = l;
35
- return l = x.ref, {
36
- $$typeof: r,
37
- type: i,
38
- key: A,
34
+ t = l;
35
+ return l = t.ref, {
36
+ $$typeof: a,
37
+ type: o,
38
+ key: b,
39
39
  ref: l !== void 0 ? l : null,
40
- props: x
40
+ props: t
41
41
  };
42
42
  }
43
- return ve.Fragment = u, ve.jsx = g, ve.jsxs = g, ve;
43
+ return Se.Fragment = r, Se.jsx = n, Se.jsxs = n, Se;
44
44
  }
45
- var tr;
46
- function ga() {
47
- return tr || (tr = 1, Ve.exports = ba()), Ve.exports;
45
+ var da;
46
+ function dr() {
47
+ return da || (da = 1, Be.exports = cr()), Be.exports;
48
48
  }
49
- var e = ga();
50
- const ja = (r) => {
51
- const u = { ...r.options ?? {} }, g = () => {
52
- r.onCustomSave ? r.onCustomSave(r.dataSource.getCurrentRecord(), (l) => {
53
- l && r.onAfterSave && r.onAfterSave(r.dataSource.getCurrentRecord()), r.onClickOk(r.dataSource.getCurrentRecord(), l);
54
- }) : r.onClickOk(r.dataSource.getCurrentRecord(), !0);
55
- }, i = () => {
56
- r.onClickCancel(r.dataSource.getCurrentRecord());
49
+ var e = dr();
50
+ const ur = (a) => {
51
+ const r = { ...a.options ?? {} }, n = () => {
52
+ a.onCustomSave ? a.onCustomSave(a.dataSource.getCurrentRecord(), (l) => {
53
+ l && a.onAfterSave && a.onAfterSave(a.dataSource.getCurrentRecord()), a.onClickOk(a.dataSource.getCurrentRecord(), l);
54
+ }) : a.onClickOk(a.dataSource.getCurrentRecord(), !0);
55
+ }, o = () => {
56
+ a.onClickCancel(a.dataSource.getCurrentRecord());
57
57
  };
58
58
  return /* @__PURE__ */ e.jsx(
59
59
  Fe,
60
60
  {
61
- opened: r.opened,
62
- onClose: i,
63
- title: t().t("archbase:Perfil"),
61
+ opened: a.opened,
62
+ onClose: o,
63
+ title: i().t("archbase:Perfil"),
64
64
  size: "60%",
65
65
  styles: { content: { maxWidth: 1e3 } },
66
- children: /* @__PURE__ */ e.jsx(we, { style: { height: "460px" }, children: /* @__PURE__ */ e.jsxs(oe, { w: "98%", children: [
67
- u?.customContentBefore && u.customContentBefore(r.dataSource.getCurrentRecord()),
68
- /* @__PURE__ */ e.jsxs(I, { children: [
69
- /* @__PURE__ */ e.jsx(I.Col, { span: { base: 12, md: 12, lg: 12 }, children: /* @__PURE__ */ e.jsx(
70
- ae,
66
+ children: /* @__PURE__ */ e.jsx(je, { style: { height: "460px" }, children: /* @__PURE__ */ e.jsxs(U, { w: "98%", children: [
67
+ r?.customContentBefore && r.customContentBefore(a.dataSource.getCurrentRecord()),
68
+ /* @__PURE__ */ e.jsxs(G, { children: [
69
+ /* @__PURE__ */ e.jsx(G.Col, { span: { base: 12, md: 12, lg: 12 }, children: /* @__PURE__ */ e.jsx(
70
+ re,
71
71
  {
72
- label: `${t().t("archbase:Nome do perfil")}`,
73
- placeholder: `${t().t("archbase:Informe o nome do perfil")}`,
74
- dataSource: r.dataSource,
72
+ label: `${i().t("archbase:Nome do perfil")}`,
73
+ placeholder: `${i().t("archbase:Informe o nome do perfil")}`,
74
+ dataSource: a.dataSource,
75
75
  dataField: "name"
76
76
  }
77
77
  ) }),
78
- /* @__PURE__ */ e.jsx(I.Col, { span: { base: 12, md: 12, lg: 12 }, children: /* @__PURE__ */ e.jsx(
79
- ae,
78
+ /* @__PURE__ */ e.jsx(G.Col, { span: { base: 12, md: 12, lg: 12 }, children: /* @__PURE__ */ e.jsx(
79
+ re,
80
80
  {
81
- label: `${t().t("archbase:Descrição do perfil")}`,
82
- placeholder: `${t().t("archbase:Informe a descrição do perfil")}`,
83
- dataSource: r.dataSource,
81
+ label: `${i().t("archbase:Descrição do perfil")}`,
82
+ placeholder: `${i().t("archbase:Informe a descrição do perfil")}`,
83
+ dataSource: a.dataSource,
84
84
  dataField: "description"
85
85
  }
86
86
  ) })
87
87
  ] }),
88
- u?.customContentAfter && u.customContentAfter(r.dataSource.getCurrentRecord()),
89
- /* @__PURE__ */ e.jsxs(V, { justify: "flex-end", mt: "md", children: [
90
- /* @__PURE__ */ e.jsx(N, { variant: "default", onClick: i, children: t().t("archbase:Cancelar") }),
91
- /* @__PURE__ */ e.jsx(N, { onClick: g, children: t().t("archbase:Salvar") })
88
+ r?.customContentAfter && r.customContentAfter(a.dataSource.getCurrentRecord()),
89
+ /* @__PURE__ */ e.jsxs(D, { justify: "flex-end", mt: "md", children: [
90
+ /* @__PURE__ */ e.jsx(H, { variant: "default", onClick: o, children: i().t("archbase:Cancelar") }),
91
+ /* @__PURE__ */ e.jsx(H, { onClick: n, children: i().t("archbase:Salvar") })
92
92
  ] })
93
93
  ] }) })
94
94
  }
95
95
  );
96
96
  };
97
- function wa({
98
- availableItemsDS: r,
99
- assignedItemsDS: u,
100
- idFieldAvailable: g,
101
- labelFieldAvailable: i,
97
+ function hr({
98
+ availableItemsDS: a,
99
+ assignedItemsDS: r,
100
+ idFieldAvailable: n,
101
+ labelFieldAvailable: o,
102
102
  idFieldAssigned: l,
103
- labelFieldAssigned: x,
104
- handleCreateAssociationObject: A,
105
- width: c = "400px",
106
- height: $ = "200px",
107
- titleAvailable: h = "Disponíveis",
108
- titleAssigned: S = "Selecionados"
103
+ labelFieldAssigned: t,
104
+ handleCreateAssociationObject: b,
105
+ width: m = "400px",
106
+ height: C = "200px",
107
+ titleAvailable: c = "Disponíveis",
108
+ titleAssigned: y = "Selecionados"
109
109
  }) {
110
- ke(
110
+ Ie(
111
111
  "ArchbaseDualListSelector-Available",
112
- r,
112
+ a,
113
113
  void 0,
114
114
  []
115
115
  );
116
- const z = ke(
116
+ const u = Ie(
117
117
  "ArchbaseDualListSelector-Assigned",
118
- u,
118
+ r,
119
119
  void 0,
120
120
  []
121
- ), [j, M] = O([]), [f, Y] = O([]), [B, d] = O([]), [v, T] = O([]), W = ge(() => {
122
- r && M(r.browseRecords()), u && Y(u.browseRecords());
123
- }, [r, u]);
124
- Xe({
121
+ ), [f, F] = k([]), [j, B] = k([]), [L, s] = k([]), [d, x] = k([]), I = ce(() => {
122
+ a && F(a.browseRecords()), r && B(r.browseRecords());
123
+ }, [a, r]);
124
+ ta({
125
+ dataSource: a,
126
+ listener: () => I()
127
+ }), ta({
125
128
  dataSource: r,
126
- listener: () => W()
127
- }), Xe({
128
- dataSource: u,
129
- listener: () => W()
130
- }), Re(() => {
131
- W();
132
- }, [W]);
133
- const E = (p, w) => typeof w == "function" ? w(p) : p[w], Q = (p, w) => typeof w == "function" ? w(p) : p[w], o = (p, w) => {
134
- p((b) => b.includes(w) ? b.filter((ce) => ce !== w) : [...b, w]);
135
- }, D = () => {
136
- B.forEach((p) => {
137
- const w = j.find((b) => E(b, g) === p);
138
- if (w) {
139
- const b = A(w);
140
- z.isDataSourceV2 ? (u.insert(b), u.save()) : (u.insert(b), u.save(), z.v1State.forceUpdate());
141
- }
142
- }), d([]);
143
- }, Z = () => {
144
- v.forEach((p) => {
145
- const w = f.find((b) => E(b, l) === p);
146
- if (w) {
147
- const b = typeof l == "function" ? { customId: l(w) } : { [l]: p };
148
- z.isDataSourceV2 ? u.remove(() => u.locate(b)) : (u.remove(() => u.locate(b)), z.v1State.forceUpdate());
149
- }
150
- }), T([]);
129
+ listener: () => I()
130
+ }), ye(() => {
131
+ I();
132
+ }, [I]);
133
+ const P = (w, T) => typeof T == "function" ? T(w) : w[T], g = (w, T) => typeof T == "function" ? T(w) : w[T], ee = (w, T) => {
134
+ w((A) => A.includes(T) ? A.filter((me) => me !== T) : [...A, T]);
135
+ }, N = () => {
136
+ L.forEach((w) => {
137
+ const T = f.find((A) => P(A, n) === w);
138
+ if (T) {
139
+ const A = b(T);
140
+ u.isDataSourceV2 ? (r.insert(A), r.save()) : (r.insert(A), r.save(), u.v1State.forceUpdate());
141
+ }
142
+ }), s([]);
143
+ }, J = () => {
144
+ d.forEach((w) => {
145
+ const T = j.find((A) => P(A, l) === w);
146
+ if (T) {
147
+ const A = typeof l == "function" ? { customId: l(T) } : { [l]: w };
148
+ u.isDataSourceV2 ? r.remove(() => r.locate(A)) : (r.remove(() => r.locate(A)), u.v1State.forceUpdate());
149
+ }
150
+ }), x([]);
151
151
  };
152
- return /* @__PURE__ */ e.jsxs(K, { withBorder: !0, style: { display: "flex", width: c, height: $ }, children: [
153
- /* @__PURE__ */ e.jsxs(He, { style: { minWidth: "44%", minHeight: $ }, children: [
154
- /* @__PURE__ */ e.jsx(J, { children: h }),
152
+ return /* @__PURE__ */ e.jsxs(Y, { withBorder: !0, style: { display: "flex", width: m, height: C }, children: [
153
+ /* @__PURE__ */ e.jsxs(_e, { style: { minWidth: "44%", minHeight: C }, children: [
154
+ /* @__PURE__ */ e.jsx(v, { children: c }),
155
155
  /* @__PURE__ */ e.jsx(
156
- Pe,
156
+ Ee,
157
157
  {
158
158
  spacing: "xs",
159
159
  size: "sm",
@@ -165,28 +165,28 @@ function wa({
165
165
  overflowX: "hidden",
166
166
  height: "calc(100% - 32px)"
167
167
  },
168
- children: j.map((p) => /* @__PURE__ */ e.jsx(Pe.Item, { children: /* @__PURE__ */ e.jsx(
169
- Je,
168
+ children: f.map((w) => /* @__PURE__ */ e.jsx(Ee.Item, { children: /* @__PURE__ */ e.jsx(
169
+ ea,
170
170
  {
171
- label: Q(p, i),
172
- checked: B.includes(E(p, g)),
173
- onChange: () => o(d, E(p, g)),
174
- disabled: f.some(
175
- (w) => E(w, l) === E(p, g)
171
+ label: g(w, o),
172
+ checked: L.includes(P(w, n)),
173
+ onChange: () => ee(s, P(w, n)),
174
+ disabled: j.some(
175
+ (T) => P(T, l) === P(w, n)
176
176
  )
177
177
  }
178
- ) }, E(p, g)))
178
+ ) }, P(w, n)))
179
179
  }
180
180
  )
181
181
  ] }),
182
- /* @__PURE__ */ e.jsxs(oe, { gap: 5, style: { minWidth: "10%" }, justify: "center", align: "center", children: [
183
- /* @__PURE__ */ e.jsx(se, { label: "Adicionar", children: /* @__PURE__ */ e.jsx(H, { onClick: D, disabled: !B.length, children: /* @__PURE__ */ e.jsx(lr, {}) }) }),
184
- /* @__PURE__ */ e.jsx(se, { label: "Remover", children: /* @__PURE__ */ e.jsx(H, { onClick: Z, disabled: !v.length, children: /* @__PURE__ */ e.jsx(cr, {}) }) })
182
+ /* @__PURE__ */ e.jsxs(U, { gap: 5, style: { minWidth: "10%" }, justify: "center", align: "center", children: [
183
+ /* @__PURE__ */ e.jsx(ve, { label: "Adicionar", children: /* @__PURE__ */ e.jsx(de, { onClick: N, disabled: !L.length, children: /* @__PURE__ */ e.jsx(ga, {}) }) }),
184
+ /* @__PURE__ */ e.jsx(ve, { label: "Remover", children: /* @__PURE__ */ e.jsx(de, { onClick: J, disabled: !d.length, children: /* @__PURE__ */ e.jsx(fa, {}) }) })
185
185
  ] }),
186
- /* @__PURE__ */ e.jsxs(He, { style: { minWidth: "44%", minHeight: $ }, children: [
187
- /* @__PURE__ */ e.jsx(J, { children: S }),
186
+ /* @__PURE__ */ e.jsxs(_e, { style: { minWidth: "44%", minHeight: C }, children: [
187
+ /* @__PURE__ */ e.jsx(v, { children: y }),
188
188
  /* @__PURE__ */ e.jsx(
189
- Pe,
189
+ Ee,
190
190
  {
191
191
  spacing: "xs",
192
192
  size: "sm",
@@ -198,25 +198,25 @@ function wa({
198
198
  overflowX: "hidden",
199
199
  height: "calc(100% - 32px)"
200
200
  },
201
- children: f.map((p) => /* @__PURE__ */ e.jsx(Pe.Item, { children: /* @__PURE__ */ e.jsx(
202
- Je,
201
+ children: j.map((w) => /* @__PURE__ */ e.jsx(Ee.Item, { children: /* @__PURE__ */ e.jsx(
202
+ ea,
203
203
  {
204
- label: Q(p, x),
205
- checked: v.includes(E(p, l)),
206
- onChange: () => o(T, E(p, l))
204
+ label: g(w, t),
205
+ checked: d.includes(P(w, l)),
206
+ onChange: () => ee(x, P(w, l))
207
207
  }
208
- ) }, E(p, l)))
208
+ ) }, P(w, l)))
209
209
  }
210
210
  )
211
211
  ] })
212
212
  ] });
213
213
  }
214
- const ya = ia(
215
- ({ image: r, label: u, description: g, origin: i, ...l }, x) => /* @__PURE__ */ e.jsx("div", { ref: x, ...l, children: /* @__PURE__ */ e.jsxs(te, { children: [
216
- /* @__PURE__ */ e.jsx(J, { size: "sm", fw: 600, children: i ? i.name : "" }),
217
- /* @__PURE__ */ e.jsx(sr, { w: "lg" })
214
+ const pr = Za(
215
+ ({ image: a, label: r, description: n, origin: o, ...l }, t) => /* @__PURE__ */ e.jsx("div", { ref: t, ...l, children: /* @__PURE__ */ e.jsxs(Te, { children: [
216
+ /* @__PURE__ */ e.jsx(v, { size: "sm", fw: 600, children: o ? o.name : "" }),
217
+ /* @__PURE__ */ e.jsx(pa, { w: "lg" })
218
218
  ] }) })
219
- ), va = {
219
+ ), xr = {
220
220
  // Campos de identificação
221
221
  showNickname: !0,
222
222
  // Campos de perfil e grupos
@@ -240,574 +240,574 @@ const ya = ia(
240
240
  avatarImageQuality: 1,
241
241
  avatarMaxOutputSizePx: 512,
242
242
  allowEditEmail: !0
243
- }, Ca = (r) => {
244
- const [u, g] = O(""), i = { ...va, ...r.options ?? {} }, l = r.dataSource.getFieldValue("passwordChangedAt"), x = l ? new Date(l) : void 0, A = x && !Number.isNaN(x.getTime()) ? x.toLocaleString() : void 0, c = Qr(i.passwordPolicy), $ = i.forbidPersonalDataInPassword ? ["name", "nickname", "email"].map((d) => {
245
- const v = r.dataSource.getFieldValue(d);
246
- return d === "email" && v ? v.split("@")[0] : v;
247
- }).filter((d) => typeof d == "string" && d.trim().length >= 3) : [], h = c ? {
248
- ...c,
249
- blocklist: [...c.blocklist ?? [], ...$]
250
- } : void 0, S = re(_.Group), { dataSource: z } = Ue({
243
+ }, mr = (a) => {
244
+ const [r, n] = k(""), o = { ...xr, ...a.options ?? {} }, l = a.dataSource.getFieldValue("passwordChangedAt"), t = l ? new Date(l) : void 0, b = t && !Number.isNaN(t.getTime()) ? t.toLocaleString() : void 0, m = La(o.passwordPolicy), C = o.forbidPersonalDataInPassword ? ["name", "nickname", "email"].map((s) => {
245
+ const d = a.dataSource.getFieldValue(s);
246
+ return s === "email" && d ? d.split("@")[0] : d;
247
+ }).filter((s) => typeof s == "string" && s.trim().length >= 3) : [], c = m ? {
248
+ ...m,
249
+ blocklist: [...m.blocklist ?? [], ...C]
250
+ } : void 0, y = X(Q.Group), { dataSource: u } = Ze({
251
251
  name: "dsGroups",
252
- service: S,
252
+ service: y,
253
253
  pageSize: 9999,
254
254
  loadOnStart: !0,
255
255
  sort: ["name:asc"],
256
- onError: (d, v) => {
257
- X.showError(t().t("archbase:WARNING"), d, v);
256
+ onError: (s, d) => {
257
+ _.showError(i().t("archbase:WARNING"), s, d);
258
258
  }
259
259
  });
260
260
  console.log("versão 12/05/2026");
261
- const j = re(_.Profile), { dataSource: M } = Ue({
261
+ const f = X(Q.Profile), { dataSource: F } = Ze({
262
262
  name: "dsProfiles",
263
- service: j,
263
+ service: f,
264
264
  pageSize: 9999,
265
265
  loadOnStart: !0,
266
266
  sort: ["name:asc"],
267
- onError: (d, v) => {
268
- X.showError(t().t("archbase:WARNING"), d, v);
267
+ onError: (s, d) => {
268
+ _.showError(i().t("archbase:WARNING"), s, d);
269
269
  }
270
270
  });
271
- Re(() => {
272
- g("");
273
- }, [r.dataSource.getFieldValue("password")]);
274
- const f = async () => {
275
- if (r.dataSource.isInserting()) {
276
- if (i.userDefaultProfile) {
277
- const d = Ie(Te.eq("name", i.userDefaultProfile)), v = await j.findAllWithFilter(d, 0, 1);
278
- v && v.content.length > 0 && r.dataSource.setFieldValue("profile", v.content[0]);
279
- }
280
- if (i.userDefaultGroups) {
281
- const d = Ie(Te.in("name", i.userDefaultGroups)), v = await S.findAllWithFilter(d, 0, 500);
282
- v && v.content.length > 0 && r.dataSource.setFieldValue("groups", v.content.map((T) => er.newInstance(T)));
271
+ ye(() => {
272
+ n("");
273
+ }, [a.dataSource.getFieldValue("password")]);
274
+ const j = async () => {
275
+ if (a.dataSource.isInserting()) {
276
+ if (o.userDefaultProfile) {
277
+ const s = $e(ke.eq("name", o.userDefaultProfile)), d = await f.findAllWithFilter(s, 0, 1);
278
+ d && d.content.length > 0 && a.dataSource.setFieldValue("profile", d.content[0]);
279
+ }
280
+ if (o.userDefaultGroups) {
281
+ const s = $e(ke.in("name", o.userDefaultGroups)), d = await y.findAllWithFilter(s, 0, 500);
282
+ d && d.content.length > 0 && a.dataSource.setFieldValue("groups", d.content.map((x) => na.newInstance(x)));
283
283
  }
284
284
  }
285
285
  };
286
- Re(() => {
287
- r.opened && f();
288
- }, [r.opened]);
289
- const Y = () => {
290
- const d = r.dataSource.getCurrentRecord();
291
- if (!d.password && r.dataSource.isInserting()) {
292
- g(t().t("archbase:Informe a senha"));
286
+ ye(() => {
287
+ a.opened && j();
288
+ }, [a.opened]);
289
+ const B = () => {
290
+ const s = a.dataSource.getCurrentRecord();
291
+ if (!s.password && a.dataSource.isInserting()) {
292
+ n(i().t("archbase:Informe a senha"));
293
293
  return;
294
294
  }
295
- if (h && d.password) {
296
- const v = Yr(d.password, h);
297
- if (!v.valid) {
298
- g(v.error);
295
+ if (c && s.password) {
296
+ const d = Na(s.password, c);
297
+ if (!d.valid) {
298
+ n(d.error);
299
299
  return;
300
300
  }
301
301
  }
302
- r.onCustomSave ? r.onCustomSave(d, (v) => {
303
- v && r.onAfterSave && r.onAfterSave(d), r.onClickOk(d, v);
304
- }) : r.onClickOk(d, !0);
305
- }, B = () => {
306
- r.onClickCancel(r.dataSource.getCurrentRecord());
302
+ a.onCustomSave ? a.onCustomSave(s, (d) => {
303
+ d && a.onAfterSave && a.onAfterSave(s), a.onClickOk(s, d);
304
+ }) : a.onClickOk(s, !0);
305
+ }, L = () => {
306
+ a.onClickCancel(a.dataSource.getCurrentRecord());
307
307
  };
308
308
  return /* @__PURE__ */ e.jsxs(
309
309
  Fe,
310
310
  {
311
- opened: r.opened,
312
- onClose: B,
313
- title: t().t("archbase:Usuário"),
311
+ opened: a.opened,
312
+ onClose: L,
313
+ title: i().t("archbase:Usuário"),
314
314
  size: "80%",
315
315
  styles: { content: { maxWidth: 1e3 } },
316
316
  children: [
317
- /* @__PURE__ */ e.jsx(we, { style: { height: "500px" }, children: /* @__PURE__ */ e.jsxs(oe, { w: "98%", children: [
318
- i?.customContentBefore && /* @__PURE__ */ e.jsx(e.Fragment, { children: i.customContentBefore(r.dataSource.getCurrentRecord()) }),
319
- /* @__PURE__ */ e.jsxs(I, { children: [
320
- /* @__PURE__ */ e.jsx(I.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsxs(V, { children: [
317
+ /* @__PURE__ */ e.jsx(je, { style: { height: "500px" }, children: /* @__PURE__ */ e.jsxs(U, { w: "98%", children: [
318
+ o?.customContentBefore && /* @__PURE__ */ e.jsx(e.Fragment, { children: o.customContentBefore(a.dataSource.getCurrentRecord()) }),
319
+ /* @__PURE__ */ e.jsxs(G, { children: [
320
+ /* @__PURE__ */ e.jsx(G.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsxs(D, { children: [
321
321
  /* @__PURE__ */ e.jsx(
322
- ae,
322
+ re,
323
323
  {
324
- label: `${t().t("archbase:Nome completo")}`,
325
- placeholder: `${t().t("archbase:Informe o nome completo do usuário")}`,
326
- dataSource: r.dataSource,
324
+ label: `${i().t("archbase:Nome completo")}`,
325
+ placeholder: `${i().t("archbase:Informe o nome completo do usuário")}`,
326
+ dataSource: a.dataSource,
327
327
  dataField: "name",
328
328
  required: !0,
329
329
  width: "calc(100% - 208px)"
330
330
  }
331
331
  ),
332
- i.showNickname && /* @__PURE__ */ e.jsx(
333
- ae,
332
+ o.showNickname && /* @__PURE__ */ e.jsx(
333
+ re,
334
334
  {
335
- label: `${t().t("archbase:Apelido")}`,
336
- placeholder: `${t().t("archbase:Apelido")}`,
337
- dataSource: r.dataSource,
335
+ label: `${i().t("archbase:Apelido")}`,
336
+ placeholder: `${i().t("archbase:Apelido")}`,
337
+ dataSource: a.dataSource,
338
338
  dataField: "nickname",
339
- required: i.requiredNickname
339
+ required: o.requiredNickname
340
340
  }
341
341
  )
342
342
  ] }) }),
343
- /* @__PURE__ */ e.jsx(I.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsx(
344
- ae,
343
+ /* @__PURE__ */ e.jsx(G.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsx(
344
+ re,
345
345
  {
346
- label: `${t().t("archbase:Descrição do usuário")}`,
347
- placeholder: `${t().t("archbase:Informe a descrição do usuário")}`,
348
- dataSource: r.dataSource,
346
+ label: `${i().t("archbase:Descrição do usuário")}`,
347
+ placeholder: `${i().t("archbase:Informe a descrição do usuário")}`,
348
+ dataSource: a.dataSource,
349
349
  dataField: "description",
350
350
  required: !0
351
351
  }
352
352
  ) })
353
353
  ] }),
354
- /* @__PURE__ */ e.jsxs(I, { children: [
355
- /* @__PURE__ */ e.jsx(I.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsx(
356
- ae,
354
+ /* @__PURE__ */ e.jsxs(G, { children: [
355
+ /* @__PURE__ */ e.jsx(G.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsx(
356
+ re,
357
357
  {
358
- label: `${t().t("archbase:E-mail")}`,
359
- placeholder: `${t().t("archbase:Informe o e-mail do usuário")}`,
360
- dataSource: r.dataSource,
361
- onChangeValue: (d) => r.dataSource.setFieldValue("userName", d),
358
+ label: `${i().t("archbase:E-mail")}`,
359
+ placeholder: `${i().t("archbase:Informe o e-mail do usuário")}`,
360
+ dataSource: a.dataSource,
361
+ onChangeValue: (s) => a.dataSource.setFieldValue("userName", s),
362
362
  dataField: "email",
363
- readOnly: r.dataSource.isEditing() ? !i.allowEditEmail : !1,
363
+ readOnly: a.dataSource.isEditing() ? !o.allowEditEmail : !1,
364
364
  required: !0
365
365
  }
366
366
  ) }),
367
- /* @__PURE__ */ e.jsx(I.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsx(
368
- ra,
367
+ /* @__PURE__ */ e.jsx(G.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsx(
368
+ Ua,
369
369
  {
370
- label: `${t().t("archbase:Senha usuário")}`,
371
- dataSource: r.dataSource,
370
+ label: `${i().t("archbase:Senha usuário")}`,
371
+ dataSource: a.dataSource,
372
372
  dataField: "password",
373
- error: u,
374
- required: r.dataSource.getFieldValue("isNewUser"),
375
- passwordPolicy: h,
376
- showPasswordRequirements: i.showPasswordRequirements
373
+ error: r,
374
+ required: a.dataSource.getFieldValue("isNewUser"),
375
+ passwordPolicy: c,
376
+ showPasswordRequirements: o.showPasswordRequirements
377
377
  }
378
378
  ) })
379
379
  ] }),
380
- /* @__PURE__ */ e.jsx(I, { children: i.showProfile && /* @__PURE__ */ e.jsx(I.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsx(
381
- aa,
380
+ /* @__PURE__ */ e.jsx(G, { children: o.showProfile && /* @__PURE__ */ e.jsx(G.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsx(
381
+ Ba,
382
382
  {
383
- label: `${t().t("archbase:Perfil do usuário")}`,
384
- dataSource: r.dataSource,
383
+ label: `${i().t("archbase:Perfil do usuário")}`,
384
+ dataSource: a.dataSource,
385
385
  dataField: "profile",
386
- options: M,
386
+ options: F,
387
387
  allowDeselect: !0,
388
388
  optionsLabelField: "nome",
389
- itemComponent: ya,
390
- getOptionLabel: (d) => d.name,
391
- getOptionValue: (d) => d.id
389
+ itemComponent: pr,
390
+ getOptionLabel: (s) => s.name,
391
+ getOptionValue: (s) => s.id
392
392
  }
393
393
  ) }) }),
394
- /* @__PURE__ */ e.jsxs(I, { children: [
395
- /* @__PURE__ */ e.jsx(I.Col, { span: { base: 12 }, children: i.showAccountConfigLabel && /* @__PURE__ */ e.jsx(J, { fz: 14, fw: 500, children: "Informe" }) }),
396
- /* @__PURE__ */ e.jsx(I.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ e.jsxs(oe, { gap: "lg", children: [
397
- i.showChangePasswordOnNextLogin && /* @__PURE__ */ e.jsx(he.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
398
- pe,
394
+ /* @__PURE__ */ e.jsxs(G, { children: [
395
+ /* @__PURE__ */ e.jsx(G.Col, { span: { base: 12 }, children: o.showAccountConfigLabel && /* @__PURE__ */ e.jsx(v, { fz: 14, fw: 500, children: "Informe" }) }),
396
+ /* @__PURE__ */ e.jsx(G.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ e.jsxs(U, { gap: "lg", children: [
397
+ o.showChangePasswordOnNextLogin && /* @__PURE__ */ e.jsx(ge.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
398
+ fe,
399
399
  {
400
- dataSource: r.dataSource,
400
+ dataSource: a.dataSource,
401
401
  dataField: "changePasswordOnNextLogin",
402
- label: `${t().t("archbase:Deve alterar senha próximo login ?")}`
402
+ label: `${i().t("archbase:Deve alterar senha próximo login ?")}`
403
403
  }
404
404
  ) }),
405
- i.showAllowPasswordChange && /* @__PURE__ */ e.jsx(he.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
406
- pe,
405
+ o.showAllowPasswordChange && /* @__PURE__ */ e.jsx(ge.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
406
+ fe,
407
407
  {
408
- dataSource: r.dataSource,
408
+ dataSource: a.dataSource,
409
409
  dataField: "allowPasswordChange",
410
- label: `${t().t("archbase:Pode alterar a senha ?")}`
410
+ label: `${i().t("archbase:Pode alterar a senha ?")}`
411
411
  }
412
412
  ) }),
413
- i.showPasswordNeverExpires && /* @__PURE__ */ e.jsxs(he.Wrapper, { label: "", children: [
413
+ o.showPasswordNeverExpires && /* @__PURE__ */ e.jsxs(ge.Wrapper, { label: "", children: [
414
414
  /* @__PURE__ */ e.jsx(
415
- pe,
415
+ fe,
416
416
  {
417
- dataSource: r.dataSource,
417
+ dataSource: a.dataSource,
418
418
  dataField: "passwordNeverExpires",
419
- label: `${t().t("archbase:Senha nunca expira ?")}`
419
+ label: `${i().t("archbase:Senha nunca expira ?")}`
420
420
  }
421
421
  ),
422
- /* @__PURE__ */ e.jsx(J, { fz: 12, c: "dimmed", children: t().t(
422
+ /* @__PURE__ */ e.jsx(v, { fz: 12, c: "dimmed", children: i().t(
423
423
  'archbase:Desmarcado, a senha expira conforme a política de validade do servidor. Para exigir a troca agora, use "Deve alterar senha próximo login".'
424
424
  ) })
425
425
  ] }),
426
- i.showPasswordChangedAt && A && /* @__PURE__ */ e.jsx(J, { fz: 12, c: "dimmed", children: `${t().t("archbase:Última troca de senha")}: ${A}` })
426
+ o.showPasswordChangedAt && b && /* @__PURE__ */ e.jsx(v, { fz: 12, c: "dimmed", children: `${i().t("archbase:Última troca de senha")}: ${b}` })
427
427
  ] }) }),
428
- /* @__PURE__ */ e.jsx(I.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ e.jsxs(oe, { gap: "lg", children: [
429
- i.showAccountDeactivated && /* @__PURE__ */ e.jsx(he.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
430
- pe,
428
+ /* @__PURE__ */ e.jsx(G.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ e.jsxs(U, { gap: "lg", children: [
429
+ o.showAccountDeactivated && /* @__PURE__ */ e.jsx(ge.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
430
+ fe,
431
431
  {
432
- dataSource: r.dataSource,
432
+ dataSource: a.dataSource,
433
433
  dataField: "accountDeactivated",
434
- label: `${t().t("archbase:Conta desativada ?")}`
434
+ label: `${i().t("archbase:Conta desativada ?")}`
435
435
  }
436
436
  ) }),
437
- i.showAccountLocked && /* @__PURE__ */ e.jsx(he.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
438
- pe,
437
+ o.showAccountLocked && /* @__PURE__ */ e.jsx(ge.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
438
+ fe,
439
439
  {
440
- dataSource: r.dataSource,
440
+ dataSource: a.dataSource,
441
441
  dataField: "accountLocked",
442
- label: `${t().t("archbase:Conta bloqueada ?")}`
442
+ label: `${i().t("archbase:Conta bloqueada ?")}`
443
443
  }
444
444
  ) }),
445
- i.showIsAdministrator && /* @__PURE__ */ e.jsx(he.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
446
- pe,
445
+ o.showIsAdministrator && /* @__PURE__ */ e.jsx(ge.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
446
+ fe,
447
447
  {
448
- dataSource: r.dataSource,
448
+ dataSource: a.dataSource,
449
449
  dataField: "isAdministrator",
450
- label: `${t().t("archbase:Administrador ?")}`
450
+ label: `${i().t("archbase:Administrador ?")}`
451
451
  }
452
452
  ) })
453
453
  ] }) }),
454
- /* @__PURE__ */ e.jsx(I.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ e.jsx(oe, { gap: "lg", children: /* @__PURE__ */ e.jsx(
455
- ta,
454
+ /* @__PURE__ */ e.jsx(G.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ e.jsx(U, { gap: "lg", children: /* @__PURE__ */ e.jsx(
455
+ Wa,
456
456
  {
457
- label: t().t("archbase:Foto do usuário"),
458
- dataSource: r.dataSource,
457
+ label: i().t("archbase:Foto do usuário"),
458
+ dataSource: a.dataSource,
459
459
  dataField: "avatar",
460
460
  width: 120,
461
461
  height: 120,
462
- maxSizeKB: i.avatarMaxSizeKB,
463
- imageQuality: i.avatarImageQuality,
464
- maxOutputSizePx: i.avatarMaxOutputSizePx
462
+ maxSizeKB: o.avatarMaxSizeKB,
463
+ imageQuality: o.avatarImageQuality,
464
+ maxOutputSizePx: o.avatarMaxOutputSizePx
465
465
  }
466
466
  ) }) })
467
467
  ] }),
468
- i.showGroups && /* @__PURE__ */ e.jsxs(I, { children: [
469
- /* @__PURE__ */ e.jsx(I.Col, { span: { base: 12 }, children: /* @__PURE__ */ e.jsx(J, { fz: 14, fw: 500, children: "Grupos" }) }),
470
- /* @__PURE__ */ e.jsx(I.Col, { span: { base: 12 }, children: /* @__PURE__ */ e.jsx(
471
- wa,
468
+ o.showGroups && /* @__PURE__ */ e.jsxs(G, { children: [
469
+ /* @__PURE__ */ e.jsx(G.Col, { span: { base: 12 }, children: /* @__PURE__ */ e.jsx(v, { fz: 14, fw: 500, children: "Grupos" }) }),
470
+ /* @__PURE__ */ e.jsx(G.Col, { span: { base: 12 }, children: /* @__PURE__ */ e.jsx(
471
+ hr,
472
472
  {
473
- titleAvailable: t().t("archbase:Disponíveis"),
474
- titleAssigned: t().t("archbase:Selecionados"),
475
- assignedItemsDS: new sa("dsDualList", {
476
- records: r.dataSource.getFieldValue("groups"),
477
- grandTotalRecords: r.dataSource.getFieldValue("groups").length,
473
+ titleAvailable: i().t("archbase:Disponíveis"),
474
+ titleAssigned: i().t("archbase:Selecionados"),
475
+ assignedItemsDS: new Ha("dsDualList", {
476
+ records: a.dataSource.getFieldValue("groups"),
477
+ grandTotalRecords: a.dataSource.getFieldValue("groups").length,
478
478
  currentPage: 0,
479
479
  totalPages: 0,
480
480
  pageSize: 999999
481
481
  }),
482
482
  width: "100%",
483
483
  height: "200px",
484
- availableItemsDS: z,
485
- handleCreateAssociationObject: (d) => er.newInstance(d),
486
- idFieldAssigned: (d) => d && d.group ? d.group.id : "",
484
+ availableItemsDS: u,
485
+ handleCreateAssociationObject: (s) => na.newInstance(s),
486
+ idFieldAssigned: (s) => s && s.group ? s.group.id : "",
487
487
  idFieldAvailable: "id",
488
- labelFieldAssigned: (d) => d && d.group ? d.group.name : "",
488
+ labelFieldAssigned: (s) => s && s.group ? s.group.name : "",
489
489
  labelFieldAvailable: "name"
490
490
  }
491
491
  ) })
492
492
  ] }),
493
- i?.customContentAfter && /* @__PURE__ */ e.jsx(e.Fragment, { children: i.customContentAfter(r.dataSource.getCurrentRecord()) }),
494
- /* @__PURE__ */ e.jsx(sr, { h: "12px" })
493
+ o?.customContentAfter && /* @__PURE__ */ e.jsx(e.Fragment, { children: o.customContentAfter(a.dataSource.getCurrentRecord()) }),
494
+ /* @__PURE__ */ e.jsx(pa, { h: "12px" })
495
495
  ] }) }),
496
- /* @__PURE__ */ e.jsxs(V, { justify: "flex-end", mt: "md", children: [
497
- /* @__PURE__ */ e.jsx(N, { variant: "default", onClick: B, children: t().t("archbase:Cancelar") }),
498
- /* @__PURE__ */ e.jsx(N, { onClick: Y, children: t().t("archbase:Salvar") })
496
+ /* @__PURE__ */ e.jsxs(D, { justify: "flex-end", mt: "md", children: [
497
+ /* @__PURE__ */ e.jsx(H, { variant: "default", onClick: L, children: i().t("archbase:Cancelar") }),
498
+ /* @__PURE__ */ e.jsx(H, { onClick: B, children: i().t("archbase:Salvar") })
499
499
  ] })
500
500
  ]
501
501
  }
502
502
  );
503
- }, Sa = (r) => {
504
- const u = { ...r.options ?? {} }, g = () => {
505
- r.onCustomSave ? r.onCustomSave(r.dataSource.getCurrentRecord(), (l) => {
506
- l && r.onAfterSave && r.onAfterSave(r.dataSource.getCurrentRecord()), r.onClickOk(r.dataSource.getCurrentRecord(), l);
507
- }) : r.onClickOk(r.dataSource.getCurrentRecord(), !0);
508
- }, i = () => {
509
- r.onClickCancel(r.dataSource.getCurrentRecord());
503
+ }, gr = (a) => {
504
+ const r = { ...a.options ?? {} }, n = () => {
505
+ a.onCustomSave ? a.onCustomSave(a.dataSource.getCurrentRecord(), (l) => {
506
+ l && a.onAfterSave && a.onAfterSave(a.dataSource.getCurrentRecord()), a.onClickOk(a.dataSource.getCurrentRecord(), l);
507
+ }) : a.onClickOk(a.dataSource.getCurrentRecord(), !0);
508
+ }, o = () => {
509
+ a.onClickCancel(a.dataSource.getCurrentRecord());
510
510
  };
511
511
  return /* @__PURE__ */ e.jsx(
512
512
  Fe,
513
513
  {
514
- opened: r.opened,
515
- onClose: i,
516
- title: t().t("archbase:Grupo"),
514
+ opened: a.opened,
515
+ onClose: o,
516
+ title: i().t("archbase:Grupo"),
517
517
  size: "60%",
518
518
  styles: { content: { maxWidth: 1e3 } },
519
- children: /* @__PURE__ */ e.jsx(we, { style: { height: "460px" }, children: /* @__PURE__ */ e.jsxs(oe, { w: "98%", children: [
520
- u?.customContentBefore && u.customContentBefore(r.dataSource.getCurrentRecord()),
521
- /* @__PURE__ */ e.jsxs(I, { children: [
522
- /* @__PURE__ */ e.jsx(I.Col, { span: { base: 12 }, children: /* @__PURE__ */ e.jsx(
523
- ae,
519
+ children: /* @__PURE__ */ e.jsx(je, { style: { height: "460px" }, children: /* @__PURE__ */ e.jsxs(U, { w: "98%", children: [
520
+ r?.customContentBefore && r.customContentBefore(a.dataSource.getCurrentRecord()),
521
+ /* @__PURE__ */ e.jsxs(G, { children: [
522
+ /* @__PURE__ */ e.jsx(G.Col, { span: { base: 12 }, children: /* @__PURE__ */ e.jsx(
523
+ re,
524
524
  {
525
- label: `${t().t("archbase:Nome do grupo")}`,
526
- placeholder: `${t().t("archbase:Informe o nome do grupo")}`,
527
- dataSource: r.dataSource,
525
+ label: `${i().t("archbase:Nome do grupo")}`,
526
+ placeholder: `${i().t("archbase:Informe o nome do grupo")}`,
527
+ dataSource: a.dataSource,
528
528
  dataField: "name"
529
529
  }
530
530
  ) }),
531
- /* @__PURE__ */ e.jsx(I.Col, { span: { base: 12 }, children: /* @__PURE__ */ e.jsx(
532
- ae,
531
+ /* @__PURE__ */ e.jsx(G.Col, { span: { base: 12 }, children: /* @__PURE__ */ e.jsx(
532
+ re,
533
533
  {
534
- label: `${t().t("archbase:Descrição do grupo")}`,
535
- placeholder: `${t().t("archbase:Informe a descrição do grupo")}`,
536
- dataSource: r.dataSource,
534
+ label: `${i().t("archbase:Descrição do grupo")}`,
535
+ placeholder: `${i().t("archbase:Informe a descrição do grupo")}`,
536
+ dataSource: a.dataSource,
537
537
  dataField: "description"
538
538
  }
539
539
  ) })
540
540
  ] }),
541
- u?.customContentAfter && u.customContentAfter(r.dataSource.getCurrentRecord()),
542
- /* @__PURE__ */ e.jsxs(V, { justify: "flex-end", mt: "md", children: [
543
- /* @__PURE__ */ e.jsx(N, { variant: "default", onClick: i, children: t().t("archbase:Cancelar") }),
544
- /* @__PURE__ */ e.jsx(N, { onClick: g, children: t().t("archbase:Salvar") })
541
+ r?.customContentAfter && r.customContentAfter(a.dataSource.getCurrentRecord()),
542
+ /* @__PURE__ */ e.jsxs(D, { justify: "flex-end", mt: "md", children: [
543
+ /* @__PURE__ */ e.jsx(H, { variant: "default", onClick: o, children: i().t("archbase:Cancelar") }),
544
+ /* @__PURE__ */ e.jsx(H, { onClick: n, children: i().t("archbase:Salvar") })
545
545
  ] })
546
546
  ] }) })
547
547
  }
548
548
  );
549
- }, Aa = ({ image: r, label: u, description: g, ...i }) => /* @__PURE__ */ e.jsx("div", { ...i, children: /* @__PURE__ */ e.jsxs(V, { grow: !0, children: [
550
- /* @__PURE__ */ e.jsx("img", { style: { maxWidth: "32px" }, src: r }),
549
+ }, fr = ({ image: a, label: r, description: n, ...o }) => /* @__PURE__ */ e.jsx("div", { ...o, children: /* @__PURE__ */ e.jsxs(D, { grow: !0, children: [
550
+ /* @__PURE__ */ e.jsx("img", { style: { maxWidth: "32px" }, src: a }),
551
551
  /* @__PURE__ */ e.jsxs("div", { children: [
552
- /* @__PURE__ */ e.jsx(J, { size: "sm", children: u }),
553
- /* @__PURE__ */ e.jsx(J, { size: "xs", opacity: 0.65, children: g })
552
+ /* @__PURE__ */ e.jsx(v, { size: "sm", children: r }),
553
+ /* @__PURE__ */ e.jsx(v, { size: "xs", opacity: 0.65, children: n })
554
554
  ] })
555
- ] }) }), Ta = (r) => {
556
- pa();
557
- const [u, g] = O(), i = re(_.User), l = ke(
555
+ ] }) }), br = (a) => {
556
+ or();
557
+ const [r, n] = k(), o = X(Q.User), l = Ie(
558
558
  "ApiTokenModal",
559
- r.dataSource,
559
+ a.dataSource,
560
560
  "expirationDate",
561
561
  ""
562
- ), x = (h) => {
563
- if (!h)
562
+ ), t = (c) => {
563
+ if (!c)
564
564
  l.handleValueChange(void 0);
565
565
  else {
566
- const S = typeof h == "string" ? new Date(h) : h, z = Xr(S);
567
- l.handleValueChange(z);
566
+ const y = typeof c == "string" ? new Date(c) : c, u = Va(y);
567
+ l.handleValueChange(u);
568
568
  }
569
- g(h);
570
- }, A = async (h, S) => new Promise(async (z, j) => {
569
+ n(c);
570
+ }, b = async (c, y) => new Promise(async (u, f) => {
571
571
  try {
572
- const M = Ie(Te.or(Te.eq("name", `^*${S.trim()}*`))), f = await i.findAllWithFilter(M, h, 20);
573
- z({
574
- options: f.content,
575
- page: f.pageable.pageNumber,
576
- totalPages: f.totalPages
572
+ const F = $e(ke.or(ke.eq("name", `^*${y.trim()}*`))), j = await o.findAllWithFilter(F, c, 20);
573
+ u({
574
+ options: j.content,
575
+ page: j.pageable.pageNumber,
576
+ totalPages: j.totalPages
577
577
  });
578
- } catch (M) {
579
- j(Ae(M));
578
+ } catch (F) {
579
+ f(ue(F));
580
580
  }
581
- }), c = () => {
582
- r.onCustomSave ? r.onCustomSave(r.dataSource.current, (h) => {
583
- h && r.onAfterSave && r.onAfterSave(r.dataSource.current), r.onClickOk(r.dataSource.current, h);
584
- }) : r.onClickOk(r.dataSource.current, !0);
585
- }, $ = () => {
586
- r.onClickCancel(r.dataSource.current);
581
+ }), m = () => {
582
+ a.onCustomSave ? a.onCustomSave(a.dataSource.current, (c) => {
583
+ c && a.onAfterSave && a.onAfterSave(a.dataSource.current), a.onClickOk(a.dataSource.current, c);
584
+ }) : a.onClickOk(a.dataSource.current, !0);
585
+ }, C = () => {
586
+ a.onClickCancel(a.dataSource.current);
587
587
  };
588
588
  return /* @__PURE__ */ e.jsxs(
589
589
  Fe,
590
590
  {
591
- opened: r.opened,
592
- onClose: $,
593
- title: t().t("archbase:Token de API"),
591
+ opened: a.opened,
592
+ onClose: C,
593
+ title: i().t("archbase:Token de API"),
594
594
  size: "50%",
595
595
  children: [
596
- /* @__PURE__ */ e.jsxs(we, { style: { height: "300px" }, children: [
596
+ /* @__PURE__ */ e.jsxs(je, { style: { height: "300px" }, children: [
597
597
  /* @__PURE__ */ e.jsx(
598
- ae,
598
+ re,
599
599
  {
600
- label: `${t().t("archbase:Nome do token")}`,
601
- placeholder: `${t().t("archbase:Informe o nome do token")}`,
602
- dataSource: r.dataSource,
600
+ label: `${i().t("archbase:Nome do token")}`,
601
+ placeholder: `${i().t("archbase:Informe o nome do token")}`,
602
+ dataSource: a.dataSource,
603
603
  dataField: "name"
604
604
  }
605
605
  ),
606
606
  /* @__PURE__ */ e.jsx(
607
- ae,
607
+ re,
608
608
  {
609
- label: `${t().t("archbase:Descrição do token")}`,
610
- placeholder: `${t().t("archbase:Informe a descrição do token")}`,
611
- dataSource: r.dataSource,
609
+ label: `${i().t("archbase:Descrição do token")}`,
610
+ placeholder: `${i().t("archbase:Informe a descrição do token")}`,
611
+ dataSource: a.dataSource,
612
612
  dataField: "description"
613
613
  }
614
614
  ),
615
615
  /* @__PURE__ */ e.jsx(
616
- ha,
616
+ tr,
617
617
  {
618
618
  withSeconds: !0,
619
- value: u,
620
- onChange: x,
619
+ value: r,
620
+ onChange: t,
621
621
  label: "Data/hora expiração",
622
622
  placeholder: "Selecione a data de expiração"
623
623
  }
624
624
  ),
625
625
  /* @__PURE__ */ e.jsx(
626
- oa,
626
+ qa,
627
627
  {
628
- label: `${t().t("archbase:Usuário")}`,
629
- dataSource: r.dataSource,
628
+ label: `${i().t("archbase:Usuário")}`,
629
+ dataSource: a.dataSource,
630
630
  dataField: "user",
631
- placeholder: `${t().t("archbase:Digite aqui o nome do usuário")}`,
632
- getOptionLabel: (h) => h && h.email ? h.email : "",
633
- getOptionValue: (h) => h && h.id ? h.id.toString() : "",
634
- getOptions: A,
631
+ placeholder: `${i().t("archbase:Digite aqui o nome do usuário")}`,
632
+ getOptionLabel: (c) => c && c.email ? c.email : "",
633
+ getOptionValue: (c) => c && c.id ? c.id.toString() : "",
634
+ getOptions: b,
635
635
  debounceTime: 500,
636
636
  minCharsToSearch: 1,
637
- itemComponent: Aa
637
+ itemComponent: fr
638
638
  }
639
639
  )
640
640
  ] }),
641
- /* @__PURE__ */ e.jsxs(V, { justify: "flex-end", mt: "md", children: [
642
- /* @__PURE__ */ e.jsx(N, { variant: "default", onClick: $, children: t().t("archbase:Cancelar") }),
643
- /* @__PURE__ */ e.jsx(N, { onClick: c, children: t().t("archbase:Salvar") })
641
+ /* @__PURE__ */ e.jsxs(D, { justify: "flex-end", mt: "md", children: [
642
+ /* @__PURE__ */ e.jsx(H, { variant: "default", onClick: C, children: i().t("archbase:Cancelar") }),
643
+ /* @__PURE__ */ e.jsx(H, { onClick: m, children: i().t("archbase:Salvar") })
644
644
  ] })
645
645
  ]
646
646
  }
647
647
  );
648
- }, or = (r) => {
649
- const u = "->";
650
- return r.includes(u) ? r.split(u).map((l) => l.trim()).map((l) => t().t(l)).join(` ${u} `) : t().t(r);
648
+ }, ua = (a) => {
649
+ const r = "->";
650
+ return a.includes(r) ? a.split(r).map((l) => l.trim()).map((l) => i().t(l)).join(` ${r} `) : i().t(a);
651
651
  };
652
- function Me({ dataSource: r, opened: u, close: g }) {
653
- const i = xe(() => r?.getFieldValue("name") || "", [r]), l = xe(() => r?.getFieldValue("id") || "", [r]), x = xe(() => r?.getFieldValue("type") || "", [r]), A = Ze(), c = Ze(), [$, h] = O([]), [S, z] = O([]), [j, M] = O(), [f, Y] = O(), [B, d] = O(""), [v] = rr(B, 200), [T, W] = O(""), [E] = rr(T, 200), Q = re(_.Resource), { colorScheme: o } = Oe(), D = o === "dark" ? "var(--mantine-primary-color-7)" : "var(--mantine-primary-color-4)", Z = xe(() => S.sort((s, n) => s.resourceDescription.localeCompare(n.resourceDescription)).map((s) => ({
654
- value: s.resourceId,
655
- label: s.resourceDescription,
656
- children: s.permissions.filter((n) => n.actionDescription.toLowerCase().includes(E.toLowerCase())).sort((n, L) => n.actionDescription.localeCompare(L.actionDescription)).map((n) => ({
657
- value: n.actionId,
658
- label: n.actionDescription,
652
+ function We({ dataSource: a, opened: r, close: n }) {
653
+ const o = ae(() => a?.getFieldValue("name") || "", [a]), l = ae(() => a?.getFieldValue("id") || "", [a]), t = ae(() => a?.getFieldValue("type") || "", [a]), b = aa(), m = aa(), [C, c] = k([]), [y, u] = k([]), [f, F] = k(), [j, B] = k(), [L, s] = k(""), [d] = la(L, 200), [x, I] = k(""), [P] = la(x, 200), g = X(Q.Resource), { colorScheme: ee } = Ne(), N = ee === "dark" ? "var(--mantine-primary-color-7)" : "var(--mantine-primary-color-4)", J = ae(() => y.sort((h, p) => h.resourceDescription.localeCompare(p.resourceDescription)).map((h) => ({
654
+ value: h.resourceId,
655
+ label: h.resourceDescription,
656
+ children: h.permissions.filter((p) => p.actionDescription.toLowerCase().includes(P.toLowerCase())).sort((p, V) => p.actionDescription.localeCompare(V.actionDescription)).map((p) => ({
657
+ value: p.actionId,
658
+ label: p.actionDescription,
659
659
  nodeProps: {
660
- permissionId: n.permissionId,
661
- types: n.types ?? [],
662
- owner: s
660
+ permissionId: p.permissionId,
661
+ types: p.types ?? [],
662
+ owner: h
663
663
  }
664
664
  }))
665
- })), [S, E]), p = xe(() => S.map((s) => s.permissions.map((n) => n.actionId)).flat(), [S]), w = xe(() => $.sort((s, n) => s.resourceDescription.localeCompare(n.resourceDescription)).map((s) => ({
666
- value: s.resourceId,
667
- label: s.resourceDescription,
668
- children: s.permissions.filter((n) => n.actionDescription.toLowerCase().includes(v.toLowerCase())).sort((n, L) => n.actionDescription.localeCompare(L.actionDescription)).map((n) => {
669
- const L = S.find((C) => C.resourceId === s.resourceId)?.permissions.find((C) => C.actionId === n.actionId);
665
+ })), [y, P]), w = ae(() => y.map((h) => h.permissions.map((p) => p.actionId)).flat(), [y]), T = ae(() => C.sort((h, p) => h.resourceDescription.localeCompare(p.resourceDescription)).map((h) => ({
666
+ value: h.resourceId,
667
+ label: h.resourceDescription,
668
+ children: h.permissions.filter((p) => p.actionDescription.toLowerCase().includes(d.toLowerCase())).sort((p, V) => p.actionDescription.localeCompare(V.actionDescription)).map((p) => {
669
+ const V = y.find((z) => z.resourceId === h.resourceId)?.permissions.find((z) => z.actionId === p.actionId);
670
670
  return {
671
- value: n.actionId,
672
- label: n.actionDescription,
671
+ value: p.actionId,
672
+ label: p.actionDescription,
673
673
  nodeProps: {
674
- granted: p.includes(n.actionId) && L?.types?.includes(le(P, x)),
675
- owner: s
674
+ granted: w.includes(p.actionId) && V?.types?.includes(pe(q, t)),
675
+ owner: h
676
676
  }
677
677
  };
678
678
  })
679
- })), [$, S, p, x, v]), b = ge(async () => {
679
+ })), [C, y, w, t, d]), A = ce(async () => {
680
680
  if (l) {
681
- const s = await Q.getPermissionsBySecurityId(l, x), n = await Q.getAllPermissionsAvailable();
682
- h(n), z(s);
681
+ const h = await g.getPermissionsBySecurityId(l, t), p = await g.getAllPermissionsAvailable();
682
+ c(p), u(h);
683
683
  }
684
- }, [l, x]), ce = ge(() => {
685
- j?.value && l && Q.createPermission(l, j.value, x).then((s) => {
686
- if (s) {
687
- z((G) => {
688
- let k;
689
- return G.map((y) => y.resourceId).includes(s.resourceId) ? k = G.map((y) => y.resourceId === s.resourceId ? y.permissions.map((R) => R.actionId).includes(j.value) ? {
690
- ...y,
691
- permissions: y.permissions.map(
692
- (R) => R.actionId === j.value ? {
693
- ...R,
694
- permissionId: s.permissionId,
695
- types: [...R.types ?? [], le(P, x)]
696
- } : R
684
+ }, [l, t]), me = ce(() => {
685
+ f?.value && l && g.createPermission(l, f.value, t).then((h) => {
686
+ if (h) {
687
+ u((M) => {
688
+ let E;
689
+ return M.map((O) => O.resourceId).includes(h.resourceId) ? E = M.map((O) => O.resourceId === h.resourceId ? O.permissions.map(($) => $.actionId).includes(f.value) ? {
690
+ ...O,
691
+ permissions: O.permissions.map(
692
+ ($) => $.actionId === f.value ? {
693
+ ...$,
694
+ permissionId: h.permissionId,
695
+ types: [...$.types ?? [], pe(q, t)]
696
+ } : $
697
697
  )
698
698
  } : {
699
- ...y,
699
+ ...O,
700
700
  permissions: [
701
- ...y.permissions ?? [],
701
+ ...O.permissions ?? [],
702
702
  {
703
- actionId: s.actionId,
704
- actionDescription: s.actionDescription,
705
- permissionId: s.permissionId,
706
- types: [le(P, x)]
703
+ actionId: h.actionId,
704
+ actionDescription: h.actionDescription,
705
+ permissionId: h.permissionId,
706
+ types: [pe(q, t)]
707
707
  }
708
708
  ]
709
- } : y) : k = [
710
- ...G,
709
+ } : O) : E = [
710
+ ...M,
711
711
  {
712
- resourceId: s.resourceId,
713
- resourceDescription: s.resourceDescription,
712
+ resourceId: h.resourceId,
713
+ resourceDescription: h.resourceDescription,
714
714
  permissions: [
715
715
  {
716
- actionId: s.actionId,
717
- actionDescription: s.actionDescription,
718
- permissionId: s.permissionId,
719
- types: [le(P, x)]
716
+ actionId: h.actionId,
717
+ actionDescription: h.actionDescription,
718
+ permissionId: h.permissionId,
719
+ types: [pe(q, t)]
720
720
  }
721
721
  ]
722
722
  }
723
- ], k;
723
+ ], E;
724
724
  });
725
- const n = w.filter((G) => G.value === j?.nodeProps?.owner?.resourceId).map((G) => G.children).flat(), L = n.map((G) => G.value).indexOf(j.value), C = n.find((G, k) => !G?.nodeProps?.granted && G?.value !== j.value && (n.length > L + 1 ? k > L : !0));
726
- C?.value && A.select(C.value), c.expand(s.resourceId), M(C);
725
+ const p = T.filter((M) => M.value === f?.nodeProps?.owner?.resourceId).map((M) => M.children).flat(), V = p.map((M) => M.value).indexOf(f.value), z = p.find((M, E) => !M?.nodeProps?.granted && M?.value !== f.value && (p.length > V + 1 ? E > V : !0));
726
+ z?.value && b.select(z.value), m.expand(h.resourceId), F(z);
727
727
  }
728
728
  });
729
- }, [j, l, x, Q, w, $, S, A, c]), ne = ge(() => {
730
- f?.nodeProps?.permissionId && Q.deletePermission(f.nodeProps.permissionId).then(() => {
731
- z((C) => [...C].filter((k) => {
732
- let y = !0;
733
- return k.permissions?.forEach((R) => {
734
- R.permissionId !== void 0 && R.permissionId === f?.nodeProps?.permissionId && k.permissions.length === 1 && R?.types?.length === 1 && R.types[0] === le(P, x) && (y = !1);
735
- }), y;
736
- }).map((k) => {
737
- const y = f?.nodeProps?.owner;
738
- return k.resourceId === y.resourceId ? f?.nodeProps?.types?.length === 1 ? {
739
- ...k,
740
- permissions: [...(k.permissions ?? []).filter((R) => R.permissionId !== f?.nodeProps?.permissionId)]
729
+ }, [f, l, t, g, T, C, y, b, m]), he = ce(() => {
730
+ j?.nodeProps?.permissionId && g.deletePermission(j.nodeProps.permissionId).then(() => {
731
+ u((z) => [...z].filter((E) => {
732
+ let O = !0;
733
+ return E.permissions?.forEach(($) => {
734
+ $.permissionId !== void 0 && $.permissionId === j?.nodeProps?.permissionId && E.permissions.length === 1 && $?.types?.length === 1 && $.types[0] === pe(q, t) && (O = !1);
735
+ }), O;
736
+ }).map((E) => {
737
+ const O = j?.nodeProps?.owner;
738
+ return E.resourceId === O.resourceId ? j?.nodeProps?.types?.length === 1 ? {
739
+ ...E,
740
+ permissions: [...(E.permissions ?? []).filter(($) => $.permissionId !== j?.nodeProps?.permissionId)]
741
741
  } : {
742
- ...k,
743
- permissions: (k.permissions ?? []).map((R) => R.actionId === f.value ? {
744
- actionId: R.actionId,
745
- actionDescription: R.actionDescription,
746
- types: [...R.types?.filter((de) => de && de !== le(P, x)) ?? []]
747
- } : R)
748
- } : k;
742
+ ...E,
743
+ permissions: (E.permissions ?? []).map(($) => $.actionId === j.value ? {
744
+ actionId: $.actionId,
745
+ actionDescription: $.actionDescription,
746
+ types: [...$.types?.filter((te) => te && te !== pe(q, t)) ?? []]
747
+ } : $)
748
+ } : E;
749
749
  }));
750
- const s = Z.filter((C) => C.value === f?.nodeProps?.owner?.resourceId).map((C) => C.children).flat(), n = s.map((C) => C.value).indexOf(f.value), L = s.find((C, G) => C?.nodeProps?.types.includes(le(P, x)) && C?.value !== f.value && (s.length > n + 1 ? G > n : !0));
751
- L?.value && c.select(L.value), Y(L);
750
+ const h = J.filter((z) => z.value === j?.nodeProps?.owner?.resourceId).map((z) => z.children).flat(), p = h.map((z) => z.value).indexOf(j.value), V = h.find((z, M) => z?.nodeProps?.types.includes(pe(q, t)) && z?.value !== j.value && (h.length > p + 1 ? M > p : !0));
751
+ V?.value && m.select(V.value), B(V);
752
752
  });
753
- }, [f, Q, x, Z, S, c]);
754
- return Re(() => {
755
- u && r && (M(void 0), Y(void 0), d(""), W(""), c.collapseAllNodes(), A.collapseAllNodes(), b());
756
- }, [u, x, l, b]), r ? /* @__PURE__ */ e.jsx(Fe, { opened: u, onClose: g, title: `${t().t(`archbase:${x}`)}: ${i}`, size: "80%", styles: { root: { overflow: "hidden" } }, children: /* @__PURE__ */ e.jsxs(xa, { height: "540px", children: [
757
- /* @__PURE__ */ e.jsx(ma, { children: /* @__PURE__ */ e.jsx(K, { withBorder: !0, my: 20, p: 20, style: { height: "calc(100% - 40px)", overflow: "hidden", display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ e.jsxs("div", { style: { flex: 1, display: "flex", flexDirection: "row", overflow: "hidden", minHeight: 0, gap: "8px" }, children: [
753
+ }, [j, g, t, J, y, m]);
754
+ return ye(() => {
755
+ r && a && (F(void 0), B(void 0), s(""), I(""), m.collapseAllNodes(), b.collapseAllNodes(), A());
756
+ }, [r, t, l, A]), a ? /* @__PURE__ */ e.jsx(Fe, { opened: r, onClose: n, title: `${i().t(`archbase:${t}`)}: ${o}`, size: "80%", styles: { root: { overflow: "hidden" } }, children: /* @__PURE__ */ e.jsxs(ir, { height: "540px", children: [
757
+ /* @__PURE__ */ e.jsx(nr, { children: /* @__PURE__ */ e.jsx(Y, { withBorder: !0, my: 20, p: 20, style: { height: "calc(100% - 40px)", overflow: "hidden", display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ e.jsxs("div", { style: { flex: 1, display: "flex", flexDirection: "row", overflow: "hidden", minHeight: 0, gap: "8px" }, children: [
758
758
  /* @__PURE__ */ e.jsxs("div", { style: { flex: 9, display: "flex", flexDirection: "column", overflow: "hidden", minHeight: 0 }, children: [
759
- /* @__PURE__ */ e.jsxs(V, { mb: 20, children: [
760
- /* @__PURE__ */ e.jsx(J, { children: t().t("archbase:Available") }),
759
+ /* @__PURE__ */ e.jsxs(D, { mb: 20, children: [
760
+ /* @__PURE__ */ e.jsx(v, { children: i().t("archbase:Available") }),
761
761
  /* @__PURE__ */ e.jsx(
762
- Qe,
762
+ xe,
763
763
  {
764
764
  size: "xs",
765
- value: B,
766
- onChange: (s) => d(s.target.value),
767
- placeholder: t().t("archbase:Filter available permissions")
765
+ value: L,
766
+ onChange: (h) => s(h.target.value),
767
+ placeholder: i().t("archbase:Filter available permissions")
768
768
  }
769
769
  )
770
770
  ] }),
771
- /* @__PURE__ */ e.jsx(we, { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e.jsx(
772
- Ye,
771
+ /* @__PURE__ */ e.jsx(je, { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e.jsx(
772
+ ra,
773
773
  {
774
- data: w,
774
+ data: T,
775
775
  selectOnClick: !0,
776
776
  allowRangeSelection: !1,
777
- tree: A,
778
- renderNode: ({ level: s, node: n, expanded: L, hasChildren: C, selected: G, elementProps: k }) => {
779
- const y = n?.nodeProps?.granted, R = y ? "dimmed" : void 0, de = y ? "line-through" : void 0, U = ge((Ee) => {
780
- M(n), k.onClick(Ee);
781
- }, [n, k.onClick]);
777
+ tree: b,
778
+ renderNode: ({ level: h, node: p, expanded: V, hasChildren: z, selected: M, elementProps: E }) => {
779
+ const O = p?.nodeProps?.granted, $ = O ? "dimmed" : void 0, te = O ? "line-through" : void 0, Ge = ce((Me) => {
780
+ F(p), E.onClick(Me);
781
+ }, [p, E.onClick]);
782
782
  return /* @__PURE__ */ e.jsxs(
783
- V,
783
+ D,
784
784
  {
785
- ml: C ? 0 : 5,
785
+ ml: z ? 0 : 5,
786
786
  gap: 5,
787
- ...k,
788
- bg: G && s === 2 ? D : "",
789
- onClick: U,
787
+ ...E,
788
+ bg: M && h === 2 ? N : "",
789
+ onClick: Ge,
790
790
  children: [
791
- C && /* @__PURE__ */ e.jsx(
792
- Ke,
791
+ z && /* @__PURE__ */ e.jsx(
792
+ oa,
793
793
  {
794
794
  size: 18,
795
- style: { transform: L ? "rotate(0deg)" : "rotate(-90deg)" }
795
+ style: { transform: V ? "rotate(0deg)" : "rotate(-90deg)" }
796
796
  }
797
797
  ),
798
- !C && /* @__PURE__ */ e.jsx(
799
- _e,
798
+ !z && /* @__PURE__ */ e.jsx(
799
+ ia,
800
800
  {
801
801
  size: 12,
802
802
  style: { transform: "rotate(-90deg)", marginTop: "-5px" }
803
803
  }
804
804
  ),
805
805
  /* @__PURE__ */ e.jsx(
806
- J,
806
+ v,
807
807
  {
808
- c: R,
809
- td: de,
810
- children: or(n.label)
808
+ c: $,
809
+ td: te,
810
+ children: ua(p.label)
811
811
  }
812
812
  )
813
813
  ]
@@ -817,61 +817,61 @@ function Me({ dataSource: r, opened: u, close: g }) {
817
817
  }
818
818
  ) })
819
819
  ] }),
820
- /* @__PURE__ */ e.jsx("div", { style: { flex: 2, display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ e.jsxs(oe, { gap: 5, align: "center", children: [
821
- /* @__PURE__ */ e.jsx(se, { label: t().t("archbase:Add"), children: /* @__PURE__ */ e.jsx(H, { onClick: ce, disabled: !j || j?.nodeProps?.granted || !j.nodeProps, children: /* @__PURE__ */ e.jsx(lr, {}) }) }),
822
- /* @__PURE__ */ e.jsx(se, { label: t().t("archbase:Remove"), children: /* @__PURE__ */ e.jsx(H, { onClick: ne, disabled: !f || !f?.nodeProps?.permissionId || !f.nodeProps, children: /* @__PURE__ */ e.jsx(cr, {}) }) })
820
+ /* @__PURE__ */ e.jsx("div", { style: { flex: 2, display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ e.jsxs(U, { gap: 5, align: "center", children: [
821
+ /* @__PURE__ */ e.jsx(ve, { label: i().t("archbase:Add"), children: /* @__PURE__ */ e.jsx(de, { onClick: me, disabled: !f || f?.nodeProps?.granted || !f.nodeProps, children: /* @__PURE__ */ e.jsx(ga, {}) }) }),
822
+ /* @__PURE__ */ e.jsx(ve, { label: i().t("archbase:Remove"), children: /* @__PURE__ */ e.jsx(de, { onClick: he, disabled: !j || !j?.nodeProps?.permissionId || !j.nodeProps, children: /* @__PURE__ */ e.jsx(fa, {}) }) })
823
823
  ] }) }),
824
824
  /* @__PURE__ */ e.jsxs("div", { style: { flex: 9, display: "flex", flexDirection: "column", overflow: "hidden", minHeight: 0 }, children: [
825
- /* @__PURE__ */ e.jsxs(V, { mb: 20, children: [
826
- /* @__PURE__ */ e.jsx(J, { children: t().t("archbase:Granted") }),
825
+ /* @__PURE__ */ e.jsxs(D, { mb: 20, children: [
826
+ /* @__PURE__ */ e.jsx(v, { children: i().t("archbase:Granted") }),
827
827
  /* @__PURE__ */ e.jsx(
828
- Qe,
828
+ xe,
829
829
  {
830
830
  size: "xs",
831
- value: T,
832
- onChange: (s) => W(s.target.value),
833
- placeholder: t().t("archbase:Filter granted permissions")
831
+ value: x,
832
+ onChange: (h) => I(h.target.value),
833
+ placeholder: i().t("archbase:Filter granted permissions")
834
834
  }
835
835
  )
836
836
  ] }),
837
- /* @__PURE__ */ e.jsx(we, { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e.jsx(
838
- Ye,
837
+ /* @__PURE__ */ e.jsx(je, { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e.jsx(
838
+ ra,
839
839
  {
840
- data: Z,
840
+ data: J,
841
841
  selectOnClick: !0,
842
842
  allowRangeSelection: !1,
843
- tree: c,
844
- renderNode: ({ level: s, node: n, expanded: L, hasChildren: C, selected: G, elementProps: k }) => {
845
- const y = ge((R) => {
846
- Y(n), k.onClick(R);
847
- }, [n, k.onClick]);
843
+ tree: m,
844
+ renderNode: ({ level: h, node: p, expanded: V, hasChildren: z, selected: M, elementProps: E }) => {
845
+ const O = ce(($) => {
846
+ B(p), E.onClick($);
847
+ }, [p, E.onClick]);
848
848
  return /* @__PURE__ */ e.jsxs(
849
- V,
849
+ D,
850
850
  {
851
- ml: C ? 0 : 5,
851
+ ml: z ? 0 : 5,
852
852
  gap: 5,
853
- ...k,
854
- bg: G && s === 2 ? D : "",
855
- onClick: y,
853
+ ...E,
854
+ bg: M && h === 2 ? N : "",
855
+ onClick: O,
856
856
  children: [
857
- C && /* @__PURE__ */ e.jsx(
858
- Ke,
857
+ z && /* @__PURE__ */ e.jsx(
858
+ oa,
859
859
  {
860
860
  size: 18,
861
- style: { transform: L ? "rotate(0deg)" : "rotate(-90deg)" }
861
+ style: { transform: V ? "rotate(0deg)" : "rotate(-90deg)" }
862
862
  }
863
863
  ),
864
- !C && /* @__PURE__ */ e.jsx(
865
- _e,
864
+ !z && /* @__PURE__ */ e.jsx(
865
+ ia,
866
866
  {
867
867
  size: 12,
868
868
  style: { transform: "rotate(-90deg)", marginTop: "-5px" }
869
869
  }
870
870
  ),
871
- /* @__PURE__ */ e.jsx(J, { children: or(n.label) }),
872
- n?.nodeProps?.types?.includes("USER") && /* @__PURE__ */ e.jsx(Se, { color: "blue", children: t().t("archbase:user") }),
873
- n?.nodeProps?.types?.includes("GROUP") && /* @__PURE__ */ e.jsx(Se, { color: "orange", children: t().t("archbase:group") }),
874
- n?.nodeProps?.types?.includes("PROFILE") && /* @__PURE__ */ e.jsx(Se, { color: "pink", children: t().t("archbase:profile") })
871
+ /* @__PURE__ */ e.jsx(v, { children: ua(p.label) }),
872
+ p?.nodeProps?.types?.includes("USER") && /* @__PURE__ */ e.jsx(se, { color: "blue", children: i().t("archbase:user") }),
873
+ p?.nodeProps?.types?.includes("GROUP") && /* @__PURE__ */ e.jsx(se, { color: "orange", children: i().t("archbase:group") }),
874
+ p?.nodeProps?.types?.includes("PROFILE") && /* @__PURE__ */ e.jsx(se, { color: "pink", children: i().t("archbase:profile") })
875
875
  ]
876
876
  }
877
877
  );
@@ -880,847 +880,834 @@ function Me({ dataSource: r, opened: u, close: g }) {
880
880
  ) })
881
881
  ] })
882
882
  ] }) }) }),
883
- /* @__PURE__ */ e.jsx(fa, { size: "40px", children: /* @__PURE__ */ e.jsx(V, { justify: "flex-end", children: /* @__PURE__ */ e.jsx(N, { onClick: g, children: t().t("archbase:Close") }) }) })
883
+ /* @__PURE__ */ e.jsx(lr, { size: "40px", children: /* @__PURE__ */ e.jsx(D, { justify: "flex-end", children: /* @__PURE__ */ e.jsx(H, { onClick: n, children: i().t("archbase:Close") }) }) })
884
884
  ] }) }) : null;
885
885
  }
886
- const Ne = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAAABj1BMVEUAAADMzMzLy8vAwMDLy8vLy8vLy8vMzMzKysrR0dHPz8/MzMzNzc3KysrMzMzKysrLy8vLy8vLy8vJycnR0dHMzMzPz8/Ozs7MzMxPT0/Nzc1UVFTJyclTU1PMzMzKysrMzMzJycldXV1iYmLMzMzIyMhNTU1NTU3MzMzLy8vNzc3MzMxVVVXLy8vMzMzLy8vLy8tNTU3MzMzOzs5QUFDLy8vKyspRUVFRUVHMzMxZWVlycnLLy8tUVFTJycnKyspZWVlXV1dhYWHGxsZMTExQUFBPT0/Ozs7Ly8vPz89SUlJSUlLMzMxVVVVWVlZVVVXKysptbW1bW1t6enpmZmbLy8tKSkrQ0NDOzs5FRUXNzc1NTU3S0tLU1NRHR0dSUlKzs7ORkZF4eHhPT0/Jycm9vb26urp8fHxYWFisrKylpaWdnZ11dXVubm5fX1+8vLy3t7ehoaFkZGRVVVXBwcG/v7+vr6+ZmZmUlJSNjY2GhoZzc3NcXFzGxsbDw8Ofn5+WlpaBgYGwsLCpqalqampaWRCJAAAAVXRSTlMA+YUG1M7Df1AQ8urbdWdiXjo2HQkE+/vu4qqIcV1bRDEpIRwXFO/q2ZiObWJZSiv+9uTe3cq8s6qkgX55b1pWR0YVDfvJyLCcmZWTi2lZVz82LRcUQGGNCgAAA9pJREFUWMPll2db2zAQgJ0AgUIYDSl7tZRZ6N57793akizZCSSEEJKw9yi0/eHtEwgid5IxfOX9mnvenM93J8s4tZw5391Q3/Hu0mj3lTMnllys+hi6HqBCCCIEDVwPDVddPEEqXW9qiEOoeQAlDqlpGz1eYo2VYSFsE2ELcSPY6FvTV1njUFMDdVqCff48DWGgAdhOuMtPie8JrUaWq+3I5zs76Jg+cG50e3seVxPTF6S63svT0URNn1BSqffUEhvHE/ofgn8x9aZLKJpcja/sZnO57Pp0yqbIVKv2VDUBD93amedsn0QuA1U2eazynG8BceRPnrnWAczdmAERtLoHe6IhAaJWLWaVwNLLBPxXxQskCjogZse1ICz2G+TkDKNGbAb5THELwzaXQB2bzpZ6zt0GD5acZ5bKNA4LGSorET2BDz/NLDVT0FQywGW34GT81YhYForKo4dbCHjsVMLSEJuxgWnUkMAKkTmmE7E52ExhuX2vBGDzj+lFa7AKzRHUQ1K0qheNQZETPHj3FQSKfulF0zCYlpcVpyyAlseypcOdojC6uThxdQLt94mYTpRI2WjvduyL3kqRbGxXk1A+iYJFmywRhEyCIuEZwUXqq7Hxb+M60QYOtlsaZa3BT7PazuZxisP3VkA3/MX79a8QHH5574iWtfbZ2RDRUBDVA5HPzsbvvw6LaMZraLGodu9YdEzPhsRrBCIq985FLDKpto8mKY4WD+VWQymlXWVjpydshaiuILpcEKGxjSkfLE4VwaSqIOq5aioQ40w1IMRUEUEjgrctXkaqEZFDi1lccL1fGd5s94RKRLMMJZSTHrBGcEfiMxJ3Ne5HeYhg7CX03vgsVUZGiuesLBJqSrzUcNxgFBxHMGA2gVeRAjFkFOkJmCqSebekqzeTyrDmQ182IV8NEJtQNtytc+irBn5rwUHLqMJEvSGJlitCCCr2BsVRNFzyGdklcEQcHwAZop58SRmqEt2aZ3iJpChMuyJqlPC1CQRs51RDm08RdIAAhpzD6dCpvPpjNJ2hh5NyhvCFb5DIq0F83NKd/VY2LlWkXHFXjlTTfU1qlzNLC+OTs8Tev0JElHfZQkpkaT0GNEiVWJ8oqIjm8vdQ2GR7bAFrsGphbZHYQnthC5orm8y1fOCy9Fhy2NDyANVYr3IfGB6MXOM+Rdc+GZ48venLxG8+M46g9y734bl7wTiazlZ+hKZ1xPBFb/sA99D0t/cafrnQ3sq50sJb2+FTefOz804/50DC+++MPDeOTe+XD68GeJGXA6/ff4bJ+OfHt2edj+7ff9T59Ptz47TyD0dpv5fjoIC3AAAAAElFTkSuQmCC", ka = (r) => r.groups ? /* @__PURE__ */ e.jsx("div", { style: { display: "flex" }, children: r.groups.slice().sort((u, g) => (u.group?.name ?? "").localeCompare(g.group?.name ?? "")).map((u, g) => /* @__PURE__ */ e.jsx("div", { style: { paddingRight: "2px" }, children: /* @__PURE__ */ e.jsx(Se, { color: "blue", children: u.group?.name }) }, g)) }) : null, Ra = (r) => r.profile ? /* @__PURE__ */ e.jsx(Se, { color: "green", children: r.profile?.name }) : null;
887
- function Ma({
888
- height: r = "400px",
889
- width: u = "100%",
890
- createEntitiesWithId: g = !0,
891
- userModalOptions: i,
886
+ const Ke = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAAABj1BMVEUAAADMzMzLy8vAwMDLy8vLy8vLy8vMzMzKysrR0dHPz8/MzMzNzc3KysrMzMzKysrLy8vLy8vLy8vJycnR0dHMzMzPz8/Ozs7MzMxPT0/Nzc1UVFTJyclTU1PMzMzKysrMzMzJycldXV1iYmLMzMzIyMhNTU1NTU3MzMzLy8vNzc3MzMxVVVXLy8vMzMzLy8vLy8tNTU3MzMzOzs5QUFDLy8vKyspRUVFRUVHMzMxZWVlycnLLy8tUVFTJycnKyspZWVlXV1dhYWHGxsZMTExQUFBPT0/Ozs7Ly8vPz89SUlJSUlLMzMxVVVVWVlZVVVXKysptbW1bW1t6enpmZmbLy8tKSkrQ0NDOzs5FRUXNzc1NTU3S0tLU1NRHR0dSUlKzs7ORkZF4eHhPT0/Jycm9vb26urp8fHxYWFisrKylpaWdnZ11dXVubm5fX1+8vLy3t7ehoaFkZGRVVVXBwcG/v7+vr6+ZmZmUlJSNjY2GhoZzc3NcXFzGxsbDw8Ofn5+WlpaBgYGwsLCpqalqampaWRCJAAAAVXRSTlMA+YUG1M7Df1AQ8urbdWdiXjo2HQkE+/vu4qqIcV1bRDEpIRwXFO/q2ZiObWJZSiv+9uTe3cq8s6qkgX55b1pWR0YVDfvJyLCcmZWTi2lZVz82LRcUQGGNCgAAA9pJREFUWMPll2db2zAQgJ0AgUIYDSl7tZRZ6N57793akizZCSSEEJKw9yi0/eHtEwgid5IxfOX9mnvenM93J8s4tZw5391Q3/Hu0mj3lTMnllys+hi6HqBCCCIEDVwPDVddPEEqXW9qiEOoeQAlDqlpGz1eYo2VYSFsE2ELcSPY6FvTV1njUFMDdVqCff48DWGgAdhOuMtPie8JrUaWq+3I5zs76Jg+cG50e3seVxPTF6S63svT0URNn1BSqffUEhvHE/ofgn8x9aZLKJpcja/sZnO57Pp0yqbIVKv2VDUBD93amedsn0QuA1U2eazynG8BceRPnrnWAczdmAERtLoHe6IhAaJWLWaVwNLLBPxXxQskCjogZse1ICz2G+TkDKNGbAb5THELwzaXQB2bzpZ6zt0GD5acZ5bKNA4LGSorET2BDz/NLDVT0FQywGW34GT81YhYForKo4dbCHjsVMLSEJuxgWnUkMAKkTmmE7E52ExhuX2vBGDzj+lFa7AKzRHUQ1K0qheNQZETPHj3FQSKfulF0zCYlpcVpyyAlseypcOdojC6uThxdQLt94mYTpRI2WjvduyL3kqRbGxXk1A+iYJFmywRhEyCIuEZwUXqq7Hxb+M60QYOtlsaZa3BT7PazuZxisP3VkA3/MX79a8QHH5574iWtfbZ2RDRUBDVA5HPzsbvvw6LaMZraLGodu9YdEzPhsRrBCIq985FLDKpto8mKY4WD+VWQymlXWVjpydshaiuILpcEKGxjSkfLE4VwaSqIOq5aioQ40w1IMRUEUEjgrctXkaqEZFDi1lccL1fGd5s94RKRLMMJZSTHrBGcEfiMxJ3Ne5HeYhg7CX03vgsVUZGiuesLBJqSrzUcNxgFBxHMGA2gVeRAjFkFOkJmCqSebekqzeTyrDmQ182IV8NEJtQNtytc+irBn5rwUHLqMJEvSGJlitCCCr2BsVRNFzyGdklcEQcHwAZop58SRmqEt2aZ3iJpChMuyJqlPC1CQRs51RDm08RdIAAhpzD6dCpvPpjNJ2hh5NyhvCFb5DIq0F83NKd/VY2LlWkXHFXjlTTfU1qlzNLC+OTs8Tev0JElHfZQkpkaT0GNEiVWJ8oqIjm8vdQ2GR7bAFrsGphbZHYQnthC5orm8y1fOCy9Fhy2NDyANVYr3IfGB6MXOM+Rdc+GZ48venLxG8+M46g9y734bl7wTiazlZ+hKZ1xPBFb/sA99D0t/cafrnQ3sq50sJb2+FTefOz804/50DC+++MPDeOTe+XD68GeJGXA6/ff4bJ+OfHt2edj+7ff9T59Ptz47TyD0dpv5fjoIC3AAAAAElFTkSuQmCC", jr = (a) => a.groups ? /* @__PURE__ */ e.jsx("div", { style: { display: "flex" }, children: a.groups.slice().sort((r, n) => (r.group?.name ?? "").localeCompare(n.group?.name ?? "")).map((r, n) => /* @__PURE__ */ e.jsx("div", { style: { paddingRight: "2px" }, children: /* @__PURE__ */ e.jsx(se, { color: "blue", children: r.group?.name }) }, n)) }) : null, vr = (a) => a.profile ? /* @__PURE__ */ e.jsx(se, { color: "green", children: a.profile?.name }) : null, yr = (a) => /* @__PURE__ */ e.jsxs(we, { children: [
887
+ /* @__PURE__ */ e.jsx(
888
+ S,
889
+ {
890
+ dataField: "user.avatar",
891
+ dataType: "image",
892
+ size: 80,
893
+ header: `${a("archbase:Foto")}`,
894
+ render: (r) => /* @__PURE__ */ e.jsx(
895
+ "img",
896
+ {
897
+ style: { borderRadius: 50, height: "32px", maxHeight: "32px" },
898
+ src: r.row.user && r.row.user.avatar ? atob(r.row.user.avatar) : Ke
899
+ }
900
+ ),
901
+ inputFilterType: "text",
902
+ align: "center",
903
+ exportable: !1
904
+ }
905
+ ),
906
+ /* @__PURE__ */ e.jsx(
907
+ S,
908
+ {
909
+ dataField: "user.userName",
910
+ dataType: "text",
911
+ size: 300,
912
+ header: `${a("archbase:Nome de Usuário")}`,
913
+ inputFilterType: "text"
914
+ }
915
+ ),
916
+ /* @__PURE__ */ e.jsx(
917
+ S,
918
+ {
919
+ dataField: "user.email",
920
+ dataType: "text",
921
+ header: `${a("archbase:Email")}`,
922
+ size: 300,
923
+ inputFilterType: "text"
924
+ }
925
+ ),
926
+ /* @__PURE__ */ e.jsx(
927
+ S,
928
+ {
929
+ dataField: "expirationDate",
930
+ dataType: "text",
931
+ size: 300,
932
+ header: `${a("archbase:Expira em")}`,
933
+ render: (r) => /* @__PURE__ */ e.jsx(v, { size: "sm", children: r.row.expirationDate }),
934
+ inputFilterType: "text"
935
+ }
936
+ ),
937
+ /* @__PURE__ */ e.jsx(
938
+ S,
939
+ {
940
+ dataField: "revoked",
941
+ dataType: "boolean",
942
+ header: `${a("archbase:Revogado ?")}`,
943
+ inputFilterType: "checkbox"
944
+ }
945
+ ),
946
+ /* @__PURE__ */ e.jsx(
947
+ S,
948
+ {
949
+ dataField: "expired",
950
+ dataType: "boolean",
951
+ header: `${a("archbase:Expirado ?")}`,
952
+ inputFilterType: "checkbox"
953
+ }
954
+ ),
955
+ /* @__PURE__ */ e.jsx(
956
+ S,
957
+ {
958
+ dataField: "token",
959
+ dataType: "text",
960
+ header: `${a("archbase:Token Acesso")}`,
961
+ size: 300,
962
+ inputFilterType: "text"
963
+ }
964
+ )
965
+ ] }), wr = (a) => /* @__PURE__ */ e.jsxs(we, { children: [
966
+ /* @__PURE__ */ e.jsx(
967
+ S,
968
+ {
969
+ dataField: "avatar",
970
+ dataType: "image",
971
+ size: 80,
972
+ header: `${a("archbase:Foto")}`,
973
+ render: (r) => /* @__PURE__ */ e.jsx(
974
+ "img",
975
+ {
976
+ style: { borderRadius: 50, height: "32px", maxHeight: "32px" },
977
+ src: r.row.avatar ? atob(r.row.avatar) : Ke
978
+ }
979
+ ),
980
+ enableSorting: !1,
981
+ enableColumnFilter: !1,
982
+ enableGlobalFilter: !1,
983
+ align: "center",
984
+ exportable: !1
985
+ }
986
+ ),
987
+ /* @__PURE__ */ e.jsx(
988
+ S,
989
+ {
990
+ dataField: "name",
991
+ dataType: "text",
992
+ size: 300,
993
+ header: `${a("archbase:Nome")}`,
994
+ inputFilterType: "text",
995
+ truncate: !0
996
+ }
997
+ ),
998
+ /* @__PURE__ */ e.jsx(
999
+ S,
1000
+ {
1001
+ dataField: "nickname",
1002
+ dataType: "text",
1003
+ size: 120,
1004
+ header: `${a("archbase:Apelido")}`,
1005
+ inputFilterType: "text",
1006
+ truncate: !0
1007
+ }
1008
+ ),
1009
+ /* @__PURE__ */ e.jsx(
1010
+ S,
1011
+ {
1012
+ dataField: "email",
1013
+ dataType: "text",
1014
+ header: `${a("archbase:Email")}`,
1015
+ size: 300,
1016
+ inputFilterType: "text",
1017
+ truncate: !0
1018
+ }
1019
+ ),
1020
+ /* @__PURE__ */ e.jsx(
1021
+ S,
1022
+ {
1023
+ dataField: "accountDeactivated",
1024
+ dataType: "boolean",
1025
+ header: `${a("archbase:Desativado?")}`,
1026
+ inputFilterType: "checkbox",
1027
+ size: 120
1028
+ }
1029
+ ),
1030
+ /* @__PURE__ */ e.jsx(
1031
+ S,
1032
+ {
1033
+ dataField: "profile.name",
1034
+ dataType: "text",
1035
+ header: `${a("archbase:Perfil")}`,
1036
+ size: 200,
1037
+ render: (r) => vr(r.row),
1038
+ inputFilterType: "text"
1039
+ }
1040
+ ),
1041
+ /* @__PURE__ */ e.jsx(
1042
+ S,
1043
+ {
1044
+ dataField: "groups",
1045
+ dataType: "text",
1046
+ size: 300,
1047
+ header: `${a("archbase:Grupos")}`,
1048
+ render: (r) => jr(r.row),
1049
+ exportValue: (r) => r.groups?.slice().sort((n, o) => (n.group?.name ?? "").localeCompare(o.group?.name ?? "")).map((n) => n.group?.name).filter(Boolean).join(", ") || "",
1050
+ enableSorting: !1,
1051
+ enableColumnFilter: !1,
1052
+ enableGlobalFilter: !1
1053
+ }
1054
+ ),
1055
+ /* @__PURE__ */ e.jsx(
1056
+ S,
1057
+ {
1058
+ dataField: "isAdministrator",
1059
+ dataType: "boolean",
1060
+ header: `${a("archbase:Admin ?")}`,
1061
+ inputFilterType: "checkbox"
1062
+ }
1063
+ ),
1064
+ /* @__PURE__ */ e.jsx(
1065
+ S,
1066
+ {
1067
+ dataField: "changePasswordOnNextLogin",
1068
+ dataType: "boolean",
1069
+ header: `${a("archbase:Alt.senha próximo login?")}`,
1070
+ inputFilterType: "checkbox",
1071
+ size: 120
1072
+ }
1073
+ ),
1074
+ /* @__PURE__ */ e.jsx(
1075
+ S,
1076
+ {
1077
+ dataField: "allowPasswordChange",
1078
+ dataType: "boolean",
1079
+ header: `${a("archbase:Pode alterar senha?")}`,
1080
+ inputFilterType: "checkbox",
1081
+ size: 120
1082
+ }
1083
+ ),
1084
+ /* @__PURE__ */ e.jsx(
1085
+ S,
1086
+ {
1087
+ dataField: "allowMultipleLogins",
1088
+ dataType: "boolean",
1089
+ header: `${a("archbase:Permite multiplos logins?")}`,
1090
+ inputFilterType: "checkbox",
1091
+ size: 120
1092
+ }
1093
+ ),
1094
+ /* @__PURE__ */ e.jsx(
1095
+ S,
1096
+ {
1097
+ dataField: "passwordNeverExpires",
1098
+ dataType: "boolean",
1099
+ header: `${a("archbase:Senha nunca expira?")}`,
1100
+ inputFilterType: "checkbox",
1101
+ size: 120
1102
+ }
1103
+ ),
1104
+ /* @__PURE__ */ e.jsx(
1105
+ S,
1106
+ {
1107
+ dataField: "passwordChangedAt",
1108
+ dataType: "datetime",
1109
+ header: `${a("archbase:Última troca de senha")}`,
1110
+ inputFilterType: "date-range",
1111
+ size: 160
1112
+ }
1113
+ ),
1114
+ /* @__PURE__ */ e.jsx(
1115
+ S,
1116
+ {
1117
+ dataField: "accountLocked",
1118
+ dataType: "boolean",
1119
+ header: `${a("archbase:Bloqueado?")}`,
1120
+ inputFilterType: "checkbox",
1121
+ size: 120
1122
+ }
1123
+ ),
1124
+ /* @__PURE__ */ e.jsx(
1125
+ S,
1126
+ {
1127
+ dataField: "unlimitedAccessHours",
1128
+ dataType: "boolean",
1129
+ header: `${a("archbase:Horário acesso ilimitado?")}`,
1130
+ inputFilterType: "checkbox",
1131
+ size: 140
1132
+ }
1133
+ )
1134
+ ] }), Cr = (a) => /* @__PURE__ */ e.jsxs(we, { children: [
1135
+ /* @__PURE__ */ e.jsx(
1136
+ S,
1137
+ {
1138
+ dataField: "name",
1139
+ dataType: "text",
1140
+ size: 300,
1141
+ header: `${a("archbase:Nome do grupo")}`,
1142
+ inputFilterType: "text"
1143
+ }
1144
+ ),
1145
+ /* @__PURE__ */ e.jsx(
1146
+ S,
1147
+ {
1148
+ dataField: "description",
1149
+ dataType: "text",
1150
+ header: `${a("archbase:Descrição")}`,
1151
+ size: 800,
1152
+ inputFilterType: "text"
1153
+ }
1154
+ )
1155
+ ] }), Sr = (a) => /* @__PURE__ */ e.jsxs(we, { children: [
1156
+ /* @__PURE__ */ e.jsx(
1157
+ S,
1158
+ {
1159
+ dataField: "name",
1160
+ dataType: "text",
1161
+ size: 300,
1162
+ header: `${a("archbase:Nome do perfil")}`,
1163
+ inputFilterType: "text"
1164
+ }
1165
+ ),
1166
+ /* @__PURE__ */ e.jsx(
1167
+ S,
1168
+ {
1169
+ dataField: "description",
1170
+ dataType: "text",
1171
+ header: `${a("archbase:Descrição")}`,
1172
+ size: 800,
1173
+ inputFilterType: "text"
1174
+ }
1175
+ )
1176
+ ] }), Ar = (a) => /* @__PURE__ */ e.jsxs(we, { children: [
1177
+ /* @__PURE__ */ e.jsx(
1178
+ S,
1179
+ {
1180
+ dataField: "name",
1181
+ dataType: "text",
1182
+ size: 300,
1183
+ header: `${a("archbase:Nome do recurso")}`,
1184
+ inputFilterType: "text"
1185
+ }
1186
+ ),
1187
+ /* @__PURE__ */ e.jsx(
1188
+ S,
1189
+ {
1190
+ dataField: "description",
1191
+ dataType: "text",
1192
+ header: `${a("archbase:Descrição")}`,
1193
+ size: 800,
1194
+ inputFilterType: "text"
1195
+ }
1196
+ )
1197
+ ] });
1198
+ function Ae({
1199
+ active: a,
1200
+ printTitle: r,
1201
+ gridRef: n,
1202
+ dataSource: o,
1203
+ isLoading: l,
1204
+ error: t,
1205
+ getRowId: b,
1206
+ striped: m = !1,
1207
+ enableRowActions: C = !0,
1208
+ toolbarLeftContent: c,
1209
+ renderRowActions: y,
1210
+ actionsColumnWidth: u,
1211
+ children: f
1212
+ }) {
1213
+ return /* @__PURE__ */ e.jsx(
1214
+ Y,
1215
+ {
1216
+ withBorder: !0,
1217
+ mt: "md",
1218
+ style: {
1219
+ display: a ? "flex" : "none",
1220
+ width: "100%",
1221
+ flex: 1,
1222
+ minHeight: 0,
1223
+ overflow: "auto"
1224
+ },
1225
+ children: /* @__PURE__ */ e.jsx(
1226
+ xa,
1227
+ {
1228
+ gridRef: n,
1229
+ printTitle: r,
1230
+ width: "100%",
1231
+ height: "100%",
1232
+ withBorder: !1,
1233
+ dataSource: o,
1234
+ withColumnBorders: !0,
1235
+ striped: m,
1236
+ enableTopToolbar: !0,
1237
+ enableRowActions: C,
1238
+ pageSize: 50,
1239
+ isLoading: l,
1240
+ isError: !!t,
1241
+ error: t,
1242
+ enableGlobalFilter: !0,
1243
+ getRowId: b,
1244
+ toolbarLeftContent: c,
1245
+ renderRowActions: y,
1246
+ actionsColumnWidth: u,
1247
+ children: f
1248
+ }
1249
+ )
1250
+ }
1251
+ );
1252
+ }
1253
+ function qe({
1254
+ dataSource: a,
1255
+ securityType: r,
1256
+ newInstance: n,
1257
+ createEntitiesWithId: o,
1258
+ removeMessageKey: l,
1259
+ setOpenedModal: t,
1260
+ setOpenedPermissionsModal: b,
1261
+ validationContext: m,
1262
+ t: C
1263
+ }) {
1264
+ const c = a, y = (d) => c.isEmpty() ? null : c.gotoRecordByData(d) ?? null;
1265
+ return {
1266
+ handleAdd: () => {
1267
+ const d = n();
1268
+ o || (d.id = void 0), c.insert(d), t(r);
1269
+ },
1270
+ handleViewRow: (d) => {
1271
+ y(d) && t(r);
1272
+ },
1273
+ handleEditRow: (d) => {
1274
+ y(d) && (c.isEditing() || c.edit(), t(r));
1275
+ },
1276
+ handleRemoveRow: (d) => {
1277
+ y(d) && le.showConfirmDialogYesNo(
1278
+ `${C("archbase:Confirme")}`,
1279
+ `${C(l)}${d.name} ?`,
1280
+ () => {
1281
+ c.remove();
1282
+ },
1283
+ () => {
1284
+ }
1285
+ );
1286
+ },
1287
+ handleSaveModal: async () => {
1288
+ try {
1289
+ await c.save();
1290
+ } catch {
1291
+ return;
1292
+ }
1293
+ t(""), m?.clearAll();
1294
+ },
1295
+ handleCancelModal: () => {
1296
+ t(""), c.isBrowsing() || c.cancel(), m?.clearAll();
1297
+ },
1298
+ handleOpenPermissionsModal: () => {
1299
+ b(r);
1300
+ }
1301
+ };
1302
+ }
1303
+ function He({
1304
+ row: a,
1305
+ onView: r,
1306
+ onEdit: n,
1307
+ onRemove: o,
1308
+ onEditPermissions: l,
1309
+ before: t,
1310
+ after: b,
1311
+ t: m
1312
+ }) {
1313
+ const C = Xe(), { colorScheme: c } = Ne(), y = c === "dark", u = (f) => y ? C.colors[f][8] : C.colors[f][4];
1314
+ return /* @__PURE__ */ e.jsxs(D, { gap: 1, wrap: "nowrap", children: [
1315
+ t?.(a),
1316
+ /* @__PURE__ */ e.jsx(de, { variant: "transparent", onClick: () => r(a), children: /* @__PURE__ */ e.jsx(Qa, { size: 20, color: u("blue") }) }),
1317
+ /* @__PURE__ */ e.jsx(de, { variant: "transparent", onClick: () => n(a), children: /* @__PURE__ */ e.jsx(ba, { size: 20, color: u("yellow") }) }),
1318
+ /* @__PURE__ */ e.jsx(de, { variant: "transparent", onClick: () => o(a), children: /* @__PURE__ */ e.jsx(Ye, { size: 20, color: u("red") }) }),
1319
+ /* @__PURE__ */ e.jsx(ve, { withinPortal: !0, withArrow: !0, position: "left", label: `${m("archbase:Edit permissions")}`, children: /* @__PURE__ */ e.jsx(de, { variant: "transparent", onClick: l, children: /* @__PURE__ */ e.jsx(Xa, { size: 20, color: u("green") }) }) }),
1320
+ b?.(a)
1321
+ ] });
1322
+ }
1323
+ const Je = ({ onAdd: a, onEditPermissions: r, t: n }) => /* @__PURE__ */ e.jsxs(Te, { justify: "space-between", style: { width: "50%" }, children: [
1324
+ /* @__PURE__ */ e.jsxs(D, { align: "end", gap: "4px", wrap: "nowrap", children: [
1325
+ /* @__PURE__ */ e.jsx(H, { color: "green", leftSection: /* @__PURE__ */ e.jsx(ja, {}), onClick: a, children: `${n("archbase:New")}` }),
1326
+ /* @__PURE__ */ e.jsx(H, { color: "blue", leftSection: /* @__PURE__ */ e.jsx(ba, {}), onClick: r, children: `${n("archbase:Edit permissions")}` })
1327
+ ] }),
1328
+ /* @__PURE__ */ e.jsx(Te, { align: "flex-start", justify: "flex-end", style: { width: "200px" } })
1329
+ ] });
1330
+ function Xr({
1331
+ height: a = "400px",
1332
+ width: r = "100%",
1333
+ createEntitiesWithId: n = !0,
1334
+ userModalOptions: o,
892
1335
  profileModalOptions: l,
893
- groupModalOptions: x,
894
- options: A
1336
+ groupModalOptions: t,
1337
+ options: b
895
1338
  }) {
896
- const c = nr();
897
- ir("securityStore");
898
- const $ = Kr(), { colorScheme: h } = Oe(), [S, z] = O(void 0), [j, M] = O("users"), f = re(_.User), Y = re(_.Group), B = re(_.Resource), d = re(_.Profile), [v, T] = O(""), [W, E] = O(""), Q = re(_.AccessToken), { t: o } = _r(), D = je(null), Z = je(null), p = je(null), w = je(null), b = je(null), ce = (a) => a.id, ne = (a) => a.id, s = (a) => a.id, n = (a) => a.id, L = (a) => a.id, {
899
- dataSource: C,
900
- isLoading: G,
901
- refreshData: k
902
- } = ye({
1339
+ Xe(), ma("securityStore");
1340
+ const m = Ga(), { colorScheme: C } = Ne(), [c, y] = k(void 0), [u, f] = k("users"), F = X(Q.User), j = X(Q.Group), B = X(Q.Resource), L = X(Q.Profile), [s, d] = k(""), [x, I] = k(""), P = X(Q.AccessToken), { t: g } = Ma(), ee = be(null), N = be(null), J = be(null), w = be(null), T = be(null), A = (R) => R.id, me = (R) => R.id, he = (R) => R.id, h = (R) => R.id, p = (R) => R.id, {
1341
+ dataSource: V,
1342
+ isLoading: z,
1343
+ refreshData: M
1344
+ } = Ce({
903
1345
  name: "accessTokenApi",
904
- service: Q,
905
- validator: $,
1346
+ service: P,
1347
+ validator: m,
906
1348
  pageSize: 25,
907
1349
  defaultSortFields: ["user.email", "expirationTime:desc"],
908
- onError: (a, F) => {
909
- z(a), X.showError(`${o("archbase:WARNING")}`, a, F);
1350
+ onError: (R, K) => {
1351
+ y(R), _.showError(`${g("archbase:WARNING")}`, R, K);
910
1352
  }
911
1353
  }), {
912
- dataSource: y,
913
- isLoading: R,
914
- refreshData: de
915
- } = ye({
1354
+ dataSource: E,
1355
+ isLoading: O,
1356
+ refreshData: $
1357
+ } = Ce({
916
1358
  name: "dsUsers",
917
- service: f,
918
- validator: $,
1359
+ service: F,
1360
+ validator: m,
919
1361
  pageSize: 25,
920
- onError: (a, F) => {
921
- z(a), X.showError(`${o("archbase:WARNING")}`, a, F);
1362
+ onError: (R, K) => {
1363
+ y(R), _.showError(`${g("archbase:WARNING")}`, R, K);
922
1364
  }
923
1365
  }), {
924
- dataSource: U,
925
- isLoading: Ee,
926
- refreshData: dr
927
- } = ye({
1366
+ dataSource: te,
1367
+ isLoading: Ge,
1368
+ refreshData: Me
1369
+ } = Ce({
928
1370
  name: "dsGroups",
929
- service: Y,
930
- validator: $,
1371
+ service: j,
1372
+ validator: m,
931
1373
  pageSize: 25,
932
- onError: (a, F) => {
933
- z(a), X.showError(`${o("archbase:WARNING")}`, a, F);
1374
+ onError: (R, K) => {
1375
+ y(R), _.showError(`${g("archbase:WARNING")}`, R, K);
934
1376
  }
935
1377
  }), {
936
- dataSource: q,
937
- isLoading: ur,
938
- refreshData: hr
939
- } = ye({
1378
+ dataSource: ze,
1379
+ isLoading: va,
1380
+ refreshData: ya
1381
+ } = Ce({
940
1382
  name: "dsProfile",
941
- service: d,
942
- validator: $,
1383
+ service: L,
1384
+ validator: m,
943
1385
  pageSize: 25,
944
- onError: (a, F) => {
945
- z(a), X.showError(`${o("archbase:WARNING")}`, a, F);
1386
+ onError: (R, K) => {
1387
+ y(R), _.showError(`${g("archbase:WARNING")}`, R, K);
946
1388
  }
947
1389
  }), {
948
- dataSource: pr,
949
- isLoading: xr,
950
- refreshData: mr
951
- } = ye({
1390
+ dataSource: wa,
1391
+ isLoading: Ca,
1392
+ refreshData: Sa
1393
+ } = Ce({
952
1394
  name: "dsResources",
953
1395
  service: B,
954
- validator: $,
1396
+ validator: m,
955
1397
  pageSize: 25,
956
- onError: (a, F) => {
957
- z(a), X.showError(`${o("archbase:WARNING")}`, a, F);
1398
+ onError: (R, K) => {
1399
+ y(R), _.showError(`${g("archbase:WARNING")}`, R, K);
958
1400
  }
959
1401
  });
960
- Re(() => {
961
- k({ filter: Ie(Te.eq("revoked", "false")) }), de(), dr(), hr(), mr();
1402
+ ye(() => {
1403
+ M({ filter: $e(ke.eq("revoked", "false")) }), $(), Me(), ya(), Sa();
962
1404
  }, []);
963
- const fr = /* @__PURE__ */ e.jsxs(fe, { children: [
964
- /* @__PURE__ */ e.jsx(
965
- m,
966
- {
967
- dataField: "user.avatar",
968
- dataType: "image",
969
- size: 80,
970
- header: `${o("archbase:Foto")}`,
971
- render: (a) => /* @__PURE__ */ e.jsx(
972
- "img",
973
- {
974
- style: { borderRadius: 50, height: "32px", maxHeight: "32px" },
975
- src: a.row.user && a.row.user.avatar ? atob(a.row.user.avatar) : Ne
976
- }
977
- ),
978
- inputFilterType: "text",
979
- align: "center",
980
- exportable: !1
981
- }
982
- ),
983
- /* @__PURE__ */ e.jsx(
984
- m,
985
- {
986
- dataField: "user.userName",
987
- dataType: "text",
988
- size: 300,
989
- header: `${o("archbase:Nome de Usuário")}`,
990
- inputFilterType: "text"
991
- }
992
- ),
993
- /* @__PURE__ */ e.jsx(
994
- m,
995
- {
996
- dataField: "user.email",
997
- dataType: "text",
998
- header: `${o("archbase:Email")}`,
999
- size: 300,
1000
- inputFilterType: "text"
1001
- }
1002
- ),
1003
- /* @__PURE__ */ e.jsx(
1004
- m,
1005
- {
1006
- dataField: "expirationDate",
1007
- dataType: "text",
1008
- size: 300,
1009
- header: `${o("archbase:Expira em")}`,
1010
- render: (a) => /* @__PURE__ */ e.jsx(J, { size: "sm", children: a.row.expirationDate }),
1011
- inputFilterType: "text"
1012
- }
1013
- ),
1014
- /* @__PURE__ */ e.jsx(
1015
- m,
1016
- {
1017
- dataField: "revoked",
1018
- dataType: "boolean",
1019
- header: `${o("archbase:Revogado ?")}`,
1020
- inputFilterType: "checkbox"
1021
- }
1022
- ),
1023
- /* @__PURE__ */ e.jsx(
1024
- m,
1025
- {
1026
- dataField: "expired",
1027
- dataType: "boolean",
1028
- header: `${o("archbase:Expirado ?")}`,
1029
- inputFilterType: "checkbox"
1030
- }
1031
- ),
1032
- /* @__PURE__ */ e.jsx(
1033
- m,
1034
- {
1035
- dataField: "token",
1036
- dataType: "text",
1037
- header: `${o("archbase:Token Acesso")}`,
1038
- size: 300,
1039
- inputFilterType: "text"
1040
- }
1041
- )
1042
- ] }), br = /* @__PURE__ */ e.jsxs(fe, { children: [
1043
- /* @__PURE__ */ e.jsx(
1044
- m,
1045
- {
1046
- dataField: "avatar",
1047
- dataType: "image",
1048
- size: 80,
1049
- header: `${o("archbase:Foto")}`,
1050
- render: (a) => /* @__PURE__ */ e.jsx(
1051
- "img",
1052
- {
1053
- style: { borderRadius: 50, height: "32px", maxHeight: "32px" },
1054
- src: a.row.avatar ? atob(a.row.avatar) : Ne
1055
- }
1056
- ),
1057
- enableSorting: !1,
1058
- enableColumnFilter: !1,
1059
- enableGlobalFilter: !1,
1060
- align: "center",
1061
- exportable: !1
1062
- }
1063
- ),
1064
- /* @__PURE__ */ e.jsx(
1065
- m,
1066
- {
1067
- dataField: "name",
1068
- dataType: "text",
1069
- size: 300,
1070
- header: `${o("archbase:Nome")}`,
1071
- inputFilterType: "text",
1072
- truncate: !0
1073
- }
1074
- ),
1075
- /* @__PURE__ */ e.jsx(
1076
- m,
1077
- {
1078
- dataField: "nickname",
1079
- dataType: "text",
1080
- size: 120,
1081
- header: `${o("archbase:Apelido")}`,
1082
- inputFilterType: "text",
1083
- truncate: !0
1084
- }
1085
- ),
1086
- /* @__PURE__ */ e.jsx(
1087
- m,
1088
- {
1089
- dataField: "email",
1090
- dataType: "text",
1091
- header: `${o("archbase:Email")}`,
1092
- size: 300,
1093
- inputFilterType: "text",
1094
- truncate: !0
1095
- }
1096
- ),
1097
- /* @__PURE__ */ e.jsx(
1098
- m,
1099
- {
1100
- dataField: "accountDeactivated",
1101
- dataType: "boolean",
1102
- header: `${o("archbase:Desativado?")}`,
1103
- inputFilterType: "checkbox",
1104
- size: 120
1105
- }
1106
- ),
1107
- /* @__PURE__ */ e.jsx(
1108
- m,
1109
- {
1110
- dataField: "profile.name",
1111
- dataType: "text",
1112
- header: `${o("archbase:Perfil")}`,
1113
- size: 200,
1114
- render: (a) => Ra(a.row),
1115
- inputFilterType: "text"
1116
- }
1117
- ),
1118
- /* @__PURE__ */ e.jsx(
1119
- m,
1120
- {
1121
- dataField: "groups",
1122
- dataType: "text",
1123
- size: 300,
1124
- header: `${o("archbase:Grupos")}`,
1125
- render: (a) => ka(a.row),
1126
- exportValue: (a) => a.groups?.slice().sort((F, Jr) => (F.group?.name ?? "").localeCompare(Jr.group?.name ?? "")).map((F) => F.group?.name).filter(Boolean).join(", ") || "",
1127
- enableSorting: !1,
1128
- enableColumnFilter: !1,
1129
- enableGlobalFilter: !1
1130
- }
1131
- ),
1132
- /* @__PURE__ */ e.jsx(
1133
- m,
1134
- {
1135
- dataField: "isAdministrator",
1136
- dataType: "boolean",
1137
- header: `${o("archbase:Admin ?")}`,
1138
- inputFilterType: "checkbox"
1139
- }
1140
- ),
1141
- /* @__PURE__ */ e.jsx(
1142
- m,
1143
- {
1144
- dataField: "changePasswordOnNextLogin",
1145
- dataType: "boolean",
1146
- header: `${o("archbase:Alt.senha próximo login?")}`,
1147
- inputFilterType: "checkbox",
1148
- size: 120
1149
- }
1150
- ),
1151
- /* @__PURE__ */ e.jsx(
1152
- m,
1153
- {
1154
- dataField: "allowPasswordChange",
1155
- dataType: "boolean",
1156
- header: `${o("archbase:Pode alterar senha?")}`,
1157
- inputFilterType: "checkbox",
1158
- size: 120
1159
- }
1160
- ),
1161
- /* @__PURE__ */ e.jsx(
1162
- m,
1163
- {
1164
- dataField: "allowMultipleLogins",
1165
- dataType: "boolean",
1166
- header: `${o("archbase:Permite multiplos logins?")}`,
1167
- inputFilterType: "checkbox",
1168
- size: 120
1169
- }
1170
- ),
1171
- /* @__PURE__ */ e.jsx(
1172
- m,
1173
- {
1174
- dataField: "passwordNeverExpires",
1175
- dataType: "boolean",
1176
- header: `${o("archbase:Senha nunca expira?")}`,
1177
- inputFilterType: "checkbox",
1178
- size: 120
1179
- }
1180
- ),
1181
- /* @__PURE__ */ e.jsx(
1182
- m,
1183
- {
1184
- dataField: "passwordChangedAt",
1185
- dataType: "datetime",
1186
- header: `${o("archbase:Última troca de senha")}`,
1187
- inputFilterType: "date-range",
1188
- size: 160
1189
- }
1190
- ),
1191
- /* @__PURE__ */ e.jsx(
1192
- m,
1193
- {
1194
- dataField: "accountLocked",
1195
- dataType: "boolean",
1196
- header: `${o("archbase:Bloqueado?")}`,
1197
- inputFilterType: "checkbox",
1198
- size: 120
1199
- }
1200
- ),
1201
- /* @__PURE__ */ e.jsx(
1202
- m,
1203
- {
1204
- dataField: "unlimitedAccessHours",
1205
- dataType: "boolean",
1206
- header: `${o("archbase:Horário acesso ilimitado?")}`,
1207
- inputFilterType: "checkbox",
1208
- size: 140
1209
- }
1210
- )
1211
- ] }), gr = /* @__PURE__ */ e.jsxs(fe, { children: [
1212
- /* @__PURE__ */ e.jsx(
1213
- m,
1214
- {
1215
- dataField: "name",
1216
- dataType: "text",
1217
- size: 300,
1218
- header: `${o("archbase:Nome do grupo")}`,
1219
- inputFilterType: "text"
1220
- }
1221
- ),
1222
- /* @__PURE__ */ e.jsx(
1223
- m,
1224
- {
1225
- dataField: "description",
1226
- dataType: "text",
1227
- header: `${o("archbase:Descrição")}`,
1228
- size: 800,
1229
- inputFilterType: "text"
1230
- }
1231
- )
1232
- ] }), jr = /* @__PURE__ */ e.jsxs(fe, { children: [
1233
- /* @__PURE__ */ e.jsx(
1234
- m,
1235
- {
1236
- dataField: "name",
1237
- dataType: "text",
1238
- size: 300,
1239
- header: `${o("archbase:Nome do perfil")}`,
1240
- inputFilterType: "text"
1241
- }
1242
- ),
1243
- /* @__PURE__ */ e.jsx(
1244
- m,
1245
- {
1246
- dataField: "description",
1247
- dataType: "text",
1248
- header: `${o("archbase:Descrição")}`,
1249
- size: 800,
1250
- inputFilterType: "text"
1251
- }
1252
- )
1253
- ] }), wr = /* @__PURE__ */ e.jsxs(fe, { children: [
1254
- /* @__PURE__ */ e.jsx(
1255
- m,
1256
- {
1257
- dataField: "name",
1258
- dataType: "text",
1259
- size: 300,
1260
- header: `${o("archbase:Nome do recurso")}`,
1261
- inputFilterType: "text"
1262
- }
1263
- ),
1264
- /* @__PURE__ */ e.jsx(
1265
- m,
1266
- {
1267
- dataField: "description",
1268
- dataType: "text",
1269
- header: `${o("archbase:Descrição")}`,
1270
- size: 800,
1271
- inputFilterType: "text"
1272
- }
1273
- )
1274
- ] }), yr = () => {
1275
- const a = la.newInstance();
1276
- g || (a.id = void 0), y.insert(a), T(P.USER);
1277
- }, vr = (a) => {
1278
- y.isEmpty() || y.gotoRecordByData(a) && (y.edit(), T(P.USER));
1279
- }, Cr = (a) => {
1280
- y.isEmpty() || y.gotoRecordByData(a) && ee.showConfirmDialogYesNo(
1281
- `${o("archbase:Confirme")}`,
1282
- `${o("archbase:Deseja remover o usuário ")}${a.name} ?`,
1283
- () => {
1284
- y.remove();
1285
- },
1286
- () => {
1287
- }
1288
- );
1289
- }, Sr = (a) => {
1290
- y.isEmpty() || y.gotoRecordByData(a) && T(P.USER);
1291
- }, Ar = (a) => /* @__PURE__ */ e.jsxs(V, { gap: 1, wrap: "nowrap", children: [
1292
- A?.beforeDefaultUserActions?.(a),
1293
- /* @__PURE__ */ e.jsx(H, { variant: "transparent", onClick: () => Sr(a), children: /* @__PURE__ */ e.jsx($e, { size: 20, color: h === "dark" ? c.colors.blue[8] : c.colors.blue[4] }) }),
1294
- /* @__PURE__ */ e.jsx(H, { variant: "transparent", onClick: () => vr(a), children: /* @__PURE__ */ e.jsx(me, { size: 20, color: h === "dark" ? c.colors.yellow[8] : c.colors.yellow[4] }) }),
1295
- /* @__PURE__ */ e.jsx(H, { variant: "transparent", onClick: () => Cr(a), children: /* @__PURE__ */ e.jsx(Ce, { size: 20, color: h === "dark" ? c.colors.red[8] : c.colors.red[4] }) }),
1296
- /* @__PURE__ */ e.jsx(se, { withinPortal: !0, withArrow: !0, position: "left", label: `${o("archbase:Edit permissions")}`, children: /* @__PURE__ */ e.jsx(H, { variant: "transparent", onClick: Be, children: /* @__PURE__ */ e.jsx(Le, { size: 20, color: h === "dark" ? c.colors.green[8] : c.colors.green[4] }) }) }),
1297
- A?.afterDefaultUserActions?.(a)
1298
- ] }), Tr = () => {
1299
- const a = ca.newInstance();
1300
- g || (a.id = void 0), U.insert(a), T(P.GROUP);
1301
- }, kr = (a) => {
1302
- U.isEmpty() || U.gotoRecordByData(a) && (U.isEditing() || U.edit(), T(P.GROUP));
1303
- }, Rr = (a) => {
1304
- U.isEmpty() || U.gotoRecordByData(a) && ee.showConfirmDialogYesNo(
1305
- `${o("archbase:Confirme")}`,
1306
- `${o("archbase:Deseja remover o grupo ")}${a.name} ?`,
1307
- () => {
1308
- U.remove();
1309
- },
1310
- () => {
1311
- }
1312
- );
1313
- }, Fr = (a) => {
1314
- U.isEmpty() || U.gotoRecordByData(a) && T(P.GROUP);
1315
- }, Pr = (a) => /* @__PURE__ */ e.jsxs(V, { gap: 1, wrap: "nowrap", children: [
1316
- A?.beforeDefaultGroupActions?.(a),
1317
- /* @__PURE__ */ e.jsx(H, { variant: "transparent", onClick: () => Fr(a), children: /* @__PURE__ */ e.jsx($e, { size: 20, color: h === "dark" ? c.colors.blue[8] : c.colors.blue[4] }) }),
1318
- /* @__PURE__ */ e.jsx(H, { variant: "transparent", onClick: () => kr(a), children: /* @__PURE__ */ e.jsx(me, { size: 20, color: h === "dark" ? c.colors.yellow[8] : c.colors.yellow[4] }) }),
1319
- /* @__PURE__ */ e.jsx(H, { variant: "transparent", onClick: () => Rr(a), children: /* @__PURE__ */ e.jsx(Ce, { size: 20, color: h === "dark" ? c.colors.red[8] : c.colors.red[4] }) }),
1320
- /* @__PURE__ */ e.jsx(se, { withinPortal: !0, withArrow: !0, position: "left", label: `${o("archbase:Edit permissions")}`, children: /* @__PURE__ */ e.jsx(H, { variant: "transparent", onClick: We, children: /* @__PURE__ */ e.jsx(Le, { size: 20, color: h === "dark" ? c.colors.green[8] : c.colors.green[4] }) }) }),
1321
- A?.afterDefaultGroupActions?.(a)
1322
- ] }), ue = ea(), Dr = async () => {
1323
- try {
1324
- await y.save();
1325
- } catch {
1326
- return;
1405
+ const Aa = yr(g), Ta = wr(g), Ra = Cr(g), ka = Sr(g), Ia = Ar(g), Oe = Oa(), oe = qe({
1406
+ dataSource: E,
1407
+ securityType: q.USER,
1408
+ newInstance: () => er.newInstance(),
1409
+ createEntitiesWithId: n,
1410
+ removeMessageKey: "archbase:Deseja remover o usuário ",
1411
+ setOpenedModal: d,
1412
+ setOpenedPermissionsModal: I,
1413
+ validationContext: Oe,
1414
+ t: g
1415
+ }), ie = qe({
1416
+ dataSource: te,
1417
+ securityType: q.GROUP,
1418
+ newInstance: () => ar.newInstance(),
1419
+ createEntitiesWithId: n,
1420
+ removeMessageKey: "archbase:Deseja remover o grupo ",
1421
+ setOpenedModal: d,
1422
+ setOpenedPermissionsModal: I,
1423
+ validationContext: Oe,
1424
+ t: g
1425
+ }), ne = qe({
1426
+ dataSource: ze,
1427
+ securityType: q.PROFILE,
1428
+ newInstance: () => rr.newInstance(),
1429
+ createEntitiesWithId: n,
1430
+ removeMessageKey: "archbase:Deseja remover o perfil ",
1431
+ setOpenedModal: d,
1432
+ setOpenedPermissionsModal: I,
1433
+ validationContext: Oe,
1434
+ t: g
1435
+ }), Pa = (R) => /* @__PURE__ */ e.jsx(
1436
+ He,
1437
+ {
1438
+ row: R,
1439
+ onView: oe.handleViewRow,
1440
+ onEdit: oe.handleEditRow,
1441
+ onRemove: oe.handleRemoveRow,
1442
+ onEditPermissions: oe.handleOpenPermissionsModal,
1443
+ before: b?.beforeDefaultUserActions,
1444
+ after: b?.afterDefaultUserActions,
1445
+ t: g
1327
1446
  }
1328
- T(""), ue?.clearAll();
1329
- }, zr = () => {
1330
- T(""), y.isBrowsing() || y.cancel(), ue?.clearAll();
1331
- }, Ir = async () => {
1332
- try {
1333
- await U.save();
1334
- } catch {
1335
- return;
1447
+ ), Fa = (R) => /* @__PURE__ */ e.jsx(
1448
+ He,
1449
+ {
1450
+ row: R,
1451
+ onView: ie.handleViewRow,
1452
+ onEdit: ie.handleEditRow,
1453
+ onRemove: ie.handleRemoveRow,
1454
+ onEditPermissions: ie.handleOpenPermissionsModal,
1455
+ before: b?.beforeDefaultGroupActions,
1456
+ after: b?.afterDefaultGroupActions,
1457
+ t: g
1336
1458
  }
1337
- T(""), ue?.clearAll();
1338
- }, Er = () => {
1339
- T(""), U.isBrowsing() || U.cancel(), ue?.clearAll();
1340
- }, Gr = async () => {
1341
- try {
1342
- await q.save();
1343
- } catch {
1344
- return;
1459
+ ), za = (R) => /* @__PURE__ */ e.jsx(
1460
+ He,
1461
+ {
1462
+ row: R,
1463
+ onView: ne.handleViewRow,
1464
+ onEdit: ne.handleEditRow,
1465
+ onRemove: ne.handleRemoveRow,
1466
+ onEditPermissions: ne.handleOpenPermissionsModal,
1467
+ before: b?.beforeDefaultProfileActions,
1468
+ after: b?.afterDefaultProfileActions,
1469
+ t: g
1345
1470
  }
1346
- T(""), ue?.clearAll();
1347
- }, $r = () => {
1348
- T(""), q.isBrowsing() || q.cancel(), ue?.clearAll();
1349
- }, Lr = () => {
1350
- const a = da.newInstance();
1351
- g || (a.id = void 0), q.insert(a), T(P.PROFILE);
1352
- }, Vr = (a) => {
1353
- q.isEmpty() || q.gotoRecordByData(a) && (q.isEditing() || q.edit(), T(P.PROFILE));
1354
- }, Mr = (a) => {
1355
- q.isEmpty() || q.gotoRecordByData(a) && ee.showConfirmDialogYesNo(
1356
- `${o("archbase:Confirme")}`,
1357
- `${o("archbase:Deseja remover o perfil ")}${a.name} ?`,
1358
- () => {
1359
- q.remove();
1360
- },
1361
- () => {
1362
- }
1363
- );
1364
- }, Ur = (a) => {
1365
- q.isEmpty() || q.gotoRecordByData(a) && T(P.PROFILE);
1366
- }, Nr = (a) => /* @__PURE__ */ e.jsxs(V, { gap: 1, wrap: "nowrap", children: [
1367
- A?.beforeDefaultProfileActions?.(a),
1368
- /* @__PURE__ */ e.jsx(H, { variant: "transparent", onClick: () => Ur(a), children: /* @__PURE__ */ e.jsx($e, { size: 20, color: h === "dark" ? c.colors.blue[8] : c.colors.blue[4] }) }),
1369
- /* @__PURE__ */ e.jsx(H, { variant: "transparent", onClick: () => Vr(a), children: /* @__PURE__ */ e.jsx(me, { size: 20, color: h === "dark" ? c.colors.yellow[8] : c.colors.yellow[4] }) }),
1370
- /* @__PURE__ */ e.jsx(H, { variant: "transparent", onClick: () => Mr(a), children: /* @__PURE__ */ e.jsx(Ce, { size: 20, color: h === "dark" ? c.colors.red[8] : c.colors.red[4] }) }),
1371
- /* @__PURE__ */ e.jsx(se, { withinPortal: !0, withArrow: !0, position: "left", label: `${o("archbase:Edit permissions")}`, children: /* @__PURE__ */ e.jsx(H, { variant: "transparent", onClick: qe, children: /* @__PURE__ */ e.jsx(Le, { size: 20, color: h === "dark" ? c.colors.green[8] : c.colors.green[4] }) }) }),
1372
- A?.afterDefaultProfileActions?.(a)
1373
- ] }), Or = () => {
1374
- const a = C.getCurrentRecord();
1375
- a && ee.showConfirmDialogYesNo(
1376
- `${o("archbase:Confirme")}`,
1377
- `${o("archbase:Deseja revogar o token de Acesso do usuário ")}${a.user.name} ?`,
1471
+ ), Ea = () => {
1472
+ const R = V.getCurrentRecord();
1473
+ R && le.showConfirmDialogYesNo(
1474
+ `${g("archbase:Confirme")}`,
1475
+ `${g("archbase:Deseja revogar o token de Acesso do usuário ")}${R.user.name} ?`,
1378
1476
  async () => {
1379
- await Q.revoke(a.token).then(async () => {
1380
- X.showSuccess(
1381
- `${o("mentors:Informação")}`,
1382
- `${o("mentors:Token de Acesso revogado com sucesso!")}`
1383
- ), C.refreshData();
1384
- }).catch((F) => {
1385
- ee.showErrorWithDetails(
1386
- `${o("mentors:Atenção")}`,
1387
- Ae(F),
1388
- De(F)
1477
+ await P.revoke(R.token).then(async () => {
1478
+ _.showSuccess(
1479
+ `${g("mentors:Informação")}`,
1480
+ `${g("mentors:Token de Acesso revogado com sucesso!")}`
1481
+ ), V.refreshData();
1482
+ }).catch((K) => {
1483
+ le.showErrorWithDetails(
1484
+ `${g("mentors:Atenção")}`,
1485
+ ue(K),
1486
+ De(K)
1389
1487
  );
1390
1488
  });
1391
1489
  },
1392
1490
  () => {
1393
1491
  }
1394
1492
  );
1395
- }, Be = () => {
1396
- E(P.USER);
1397
- }, We = () => {
1398
- E(P.GROUP);
1399
- }, qe = () => {
1400
- E(P.PROFILE);
1401
- }, Ge = () => {
1402
- E("");
1403
- }, Br = () => /* @__PURE__ */ e.jsxs(te, { justify: "space-between", style: { width: "50%" }, children: [
1404
- /* @__PURE__ */ e.jsxs(V, { align: "end", gap: "4px", wrap: "nowrap", children: [
1405
- /* @__PURE__ */ e.jsx(N, { color: "green", leftSection: /* @__PURE__ */ e.jsx(ze, {}), onClick: yr, children: `${o("archbase:New")}` }),
1406
- /* @__PURE__ */ e.jsx(N, { color: "blue", leftSection: /* @__PURE__ */ e.jsx(me, {}), onClick: Be, children: `${o("archbase:Edit permissions")}` })
1407
- ] }),
1408
- /* @__PURE__ */ e.jsx(te, { align: "flex-start", justify: "flex-end", style: { width: "200px" } })
1409
- ] }), Wr = () => /* @__PURE__ */ e.jsxs(te, { justify: "space-between", style: { width: "50%" }, children: [
1410
- /* @__PURE__ */ e.jsxs(V, { align: "end", gap: "4px", wrap: "nowrap", children: [
1411
- /* @__PURE__ */ e.jsx(N, { color: "green", leftSection: /* @__PURE__ */ e.jsx(ze, {}), onClick: Tr, children: `${o("archbase:New")}` }),
1412
- /* @__PURE__ */ e.jsx(N, { color: "blue", leftSection: /* @__PURE__ */ e.jsx(me, {}), onClick: We, children: `${o("archbase:Edit permissions")}` })
1413
- ] }),
1414
- /* @__PURE__ */ e.jsx(te, { align: "flex-start", justify: "flex-end", style: { width: "200px" } })
1415
- ] }), qr = () => /* @__PURE__ */ e.jsxs(te, { justify: "space-between", style: { width: "50%" }, children: [
1416
- /* @__PURE__ */ e.jsxs(V, { align: "end", gap: "4px", wrap: "nowrap", children: [
1417
- /* @__PURE__ */ e.jsx(N, { color: "green", leftSection: /* @__PURE__ */ e.jsx(ze, {}), onClick: Lr, children: `${o("archbase:New")}` }),
1418
- /* @__PURE__ */ e.jsx(N, { color: "blue", leftSection: /* @__PURE__ */ e.jsx(me, {}), onClick: qe, children: `${o("archbase:Edit permissions")}` })
1419
- ] }),
1420
- /* @__PURE__ */ e.jsx(te, { align: "flex-start", justify: "flex-end", style: { width: "200px" } })
1421
- ] }), Hr = () => /* @__PURE__ */ e.jsx(te, { justify: "space-between", style: { width: "50%" }, children: /* @__PURE__ */ e.jsx(V, { align: "start", gap: "4px", wrap: "nowrap", children: /* @__PURE__ */ e.jsx(
1422
- N,
1493
+ }, Ue = () => {
1494
+ I("");
1495
+ }, Da = () => /* @__PURE__ */ e.jsx(Te, { justify: "space-between", style: { width: "50%" }, children: /* @__PURE__ */ e.jsx(D, { align: "start", gap: "4px", wrap: "nowrap", children: /* @__PURE__ */ e.jsx(
1496
+ H,
1423
1497
  {
1424
- disabled: !C.getCurrentRecord(),
1498
+ disabled: !V.getCurrentRecord(),
1425
1499
  color: "red",
1426
- leftSection: /* @__PURE__ */ e.jsx(Ce, {}),
1427
- onClick: Or,
1428
- children: `${o("archbase:Revoke")}`
1500
+ leftSection: /* @__PURE__ */ e.jsx(Ye, {}),
1501
+ onClick: Ea,
1502
+ children: `${g("archbase:Revoke")}`
1429
1503
  }
1430
1504
  ) }) });
1431
- return /* @__PURE__ */ e.jsxs(K, { p: "md", style: { height: r, display: "flex", flexDirection: "column" }, children: [
1432
- /* @__PURE__ */ e.jsx(ie, { variant: "pills", value: j, onChange: M, children: /* @__PURE__ */ e.jsxs(ie.List, { children: [
1433
- /* @__PURE__ */ e.jsx(ie.Tab, { value: "users", children: `${o("Usuários")}` }),
1434
- /* @__PURE__ */ e.jsx(ie.Tab, { value: "groups", children: `${o("Grupos")}` }),
1435
- /* @__PURE__ */ e.jsx(ie.Tab, { value: "profiles", children: `${o("Perfis")}` }),
1436
- /* @__PURE__ */ e.jsx(ie.Tab, { value: "resources", children: `${o("Recursos")}` }),
1437
- /* @__PURE__ */ e.jsx(ie.Tab, { value: "accessTokens", children: `${o("Tokens Acesso")}` })
1505
+ return /* @__PURE__ */ e.jsxs(Y, { p: "md", style: { height: a, display: "flex", flexDirection: "column" }, children: [
1506
+ /* @__PURE__ */ e.jsx(Z, { variant: "pills", value: u, onChange: f, children: /* @__PURE__ */ e.jsxs(Z.List, { children: [
1507
+ /* @__PURE__ */ e.jsx(Z.Tab, { value: "users", children: `${g("Usuários")}` }),
1508
+ /* @__PURE__ */ e.jsx(Z.Tab, { value: "groups", children: `${g("Grupos")}` }),
1509
+ /* @__PURE__ */ e.jsx(Z.Tab, { value: "profiles", children: `${g("Perfis")}` }),
1510
+ /* @__PURE__ */ e.jsx(Z.Tab, { value: "resources", children: `${g("Recursos")}` }),
1511
+ /* @__PURE__ */ e.jsx(Z.Tab, { value: "accessTokens", children: `${g("Tokens Acesso")}` })
1438
1512
  ] }) }),
1439
1513
  /* @__PURE__ */ e.jsx(
1440
- K,
1514
+ Ae,
1441
1515
  {
1442
- withBorder: !0,
1443
- mt: "md",
1444
- style: {
1445
- display: j === "users" ? "flex" : "none",
1446
- width: "100%",
1447
- flex: 1,
1448
- minHeight: 0,
1449
- overflow: "auto"
1450
- },
1451
- children: /* @__PURE__ */ e.jsx(
1452
- be,
1516
+ active: u === "users",
1517
+ printTitle: "Usuários",
1518
+ gridRef: ee,
1519
+ dataSource: E,
1520
+ isLoading: O,
1521
+ error: c,
1522
+ getRowId: A,
1523
+ striped: !0,
1524
+ toolbarLeftContent: /* @__PURE__ */ e.jsx(
1525
+ Je,
1453
1526
  {
1454
- gridRef: D,
1455
- printTitle: "Usuários",
1456
- width: "100%",
1457
- height: "100%",
1458
- withBorder: !1,
1459
- dataSource: y,
1460
- withColumnBorders: !0,
1461
- striped: !0,
1462
- enableTopToolbar: !0,
1463
- enableRowActions: !0,
1464
- pageSize: 50,
1465
- isLoading: R,
1466
- isError: !!S,
1467
- error: S,
1468
- enableGlobalFilter: !0,
1469
- getRowId: ce,
1470
- toolbarLeftContent: Br(),
1471
- renderRowActions: Ar,
1472
- actionsColumnWidth: A?.userActionsColumnWidth,
1473
- children: br
1527
+ onAdd: oe.handleAdd,
1528
+ onEditPermissions: oe.handleOpenPermissionsModal,
1529
+ t: g
1474
1530
  }
1475
- )
1531
+ ),
1532
+ renderRowActions: Pa,
1533
+ actionsColumnWidth: b?.userActionsColumnWidth,
1534
+ children: Ta
1476
1535
  }
1477
1536
  ),
1478
1537
  /* @__PURE__ */ e.jsx(
1479
- K,
1538
+ Ae,
1480
1539
  {
1481
- withBorder: !0,
1482
- mt: "md",
1483
- style: {
1484
- display: j === "groups" ? "flex" : "none",
1485
- flex: 1,
1486
- minHeight: 0,
1487
- overflow: "auto"
1488
- },
1489
- children: /* @__PURE__ */ e.jsx(
1490
- be,
1540
+ active: u === "groups",
1541
+ printTitle: "Grupos",
1542
+ gridRef: N,
1543
+ dataSource: te,
1544
+ isLoading: Ge,
1545
+ error: c,
1546
+ getRowId: me,
1547
+ toolbarLeftContent: /* @__PURE__ */ e.jsx(
1548
+ Je,
1491
1549
  {
1492
- gridRef: Z,
1493
- printTitle: "Grupos",
1494
- width: "100%",
1495
- height: "100%",
1496
- withBorder: !1,
1497
- dataSource: U,
1498
- withColumnBorders: !0,
1499
- striped: !1,
1500
- enableTopToolbar: !0,
1501
- enableRowActions: !0,
1502
- pageSize: 50,
1503
- isLoading: Ee,
1504
- isError: !!S,
1505
- error: S,
1506
- enableGlobalFilter: !0,
1507
- getRowId: ne,
1508
- renderRowActions: Pr,
1509
- actionsColumnWidth: A?.groupActionsColumnWidth,
1510
- children: gr,
1511
- toolbarLeftContent: Wr()
1550
+ onAdd: ie.handleAdd,
1551
+ onEditPermissions: ie.handleOpenPermissionsModal,
1552
+ t: g
1512
1553
  }
1513
- )
1554
+ ),
1555
+ renderRowActions: Fa,
1556
+ actionsColumnWidth: b?.groupActionsColumnWidth,
1557
+ children: Ra
1514
1558
  }
1515
1559
  ),
1516
1560
  /* @__PURE__ */ e.jsx(
1517
- K,
1561
+ Ae,
1518
1562
  {
1519
- withBorder: !0,
1520
- mt: "md",
1521
- style: {
1522
- display: j === "profiles" ? "flex" : "none",
1523
- flex: 1,
1524
- minHeight: 0,
1525
- overflow: "auto"
1526
- },
1527
- children: /* @__PURE__ */ e.jsx(
1528
- be,
1563
+ active: u === "profiles",
1564
+ printTitle: "Perfis",
1565
+ gridRef: J,
1566
+ dataSource: ze,
1567
+ isLoading: va,
1568
+ error: c,
1569
+ getRowId: he,
1570
+ toolbarLeftContent: /* @__PURE__ */ e.jsx(
1571
+ Je,
1529
1572
  {
1530
- gridRef: p,
1531
- printTitle: "Perfis",
1532
- width: "100%",
1533
- height: "100%",
1534
- withBorder: !1,
1535
- dataSource: q,
1536
- withColumnBorders: !0,
1537
- striped: !1,
1538
- enableTopToolbar: !0,
1539
- enableRowActions: !0,
1540
- pageSize: 50,
1541
- isLoading: ur,
1542
- isError: !!S,
1543
- error: S,
1544
- enableGlobalFilter: !0,
1545
- getRowId: s,
1546
- toolbarLeftContent: qr(),
1547
- renderRowActions: Nr,
1548
- actionsColumnWidth: A?.profileActionsColumnWidth,
1549
- children: jr
1573
+ onAdd: ne.handleAdd,
1574
+ onEditPermissions: ne.handleOpenPermissionsModal,
1575
+ t: g
1550
1576
  }
1551
- )
1577
+ ),
1578
+ renderRowActions: za,
1579
+ actionsColumnWidth: b?.profileActionsColumnWidth,
1580
+ children: ka
1552
1581
  }
1553
1582
  ),
1554
1583
  /* @__PURE__ */ e.jsx(
1555
- K,
1584
+ Ae,
1556
1585
  {
1557
- withBorder: !0,
1558
- mt: "md",
1559
- style: {
1560
- display: j === "resources" ? "flex" : "none",
1561
- flex: 1,
1562
- minHeight: 0,
1563
- overflow: "auto"
1564
- },
1565
- children: /* @__PURE__ */ e.jsx(
1566
- be,
1567
- {
1568
- gridRef: w,
1569
- printTitle: "Recursos",
1570
- width: "100%",
1571
- height: "100%",
1572
- withBorder: !1,
1573
- dataSource: pr,
1574
- withColumnBorders: !0,
1575
- striped: !1,
1576
- enableTopToolbar: !0,
1577
- enableRowActions: !1,
1578
- pageSize: 50,
1579
- isLoading: xr,
1580
- isError: !!S,
1581
- error: S,
1582
- enableGlobalFilter: !0,
1583
- getRowId: n,
1584
- children: wr
1585
- }
1586
- )
1586
+ active: u === "resources",
1587
+ printTitle: "Recursos",
1588
+ gridRef: w,
1589
+ dataSource: wa,
1590
+ isLoading: Ca,
1591
+ error: c,
1592
+ getRowId: h,
1593
+ enableRowActions: !1,
1594
+ children: Ia
1587
1595
  }
1588
1596
  ),
1589
1597
  /* @__PURE__ */ e.jsx(
1590
- K,
1598
+ Ae,
1591
1599
  {
1592
- withBorder: !0,
1593
- mt: "md",
1594
- style: {
1595
- display: j === "accessTokens" ? "flex" : "none",
1596
- width: "100%",
1597
- flex: 1,
1598
- minHeight: 0,
1599
- overflow: "auto"
1600
- },
1601
- children: /* @__PURE__ */ e.jsx(
1602
- be,
1603
- {
1604
- gridRef: b,
1605
- printTitle: "Tokens de API",
1606
- width: "100%",
1607
- height: "100%",
1608
- withBorder: !1,
1609
- dataSource: C,
1610
- withColumnBorders: !0,
1611
- striped: !0,
1612
- enableTopToolbar: !0,
1613
- enableRowActions: !1,
1614
- pageSize: 50,
1615
- isLoading: G,
1616
- isError: !!S,
1617
- error: S,
1618
- enableGlobalFilter: !0,
1619
- getRowId: L,
1620
- toolbarLeftContent: Hr(),
1621
- children: fr
1622
- }
1623
- )
1600
+ active: u === "accessTokens",
1601
+ printTitle: "Tokens de API",
1602
+ gridRef: T,
1603
+ dataSource: V,
1604
+ isLoading: z,
1605
+ error: c,
1606
+ getRowId: p,
1607
+ striped: !0,
1608
+ enableRowActions: !1,
1609
+ toolbarLeftContent: Da(),
1610
+ children: Aa
1624
1611
  }
1625
1612
  ),
1626
- v === P.USER ? /* @__PURE__ */ e.jsx(
1627
- Ca,
1613
+ s === q.USER ? /* @__PURE__ */ e.jsx(
1614
+ mr,
1628
1615
  {
1629
- onClickOk: Dr,
1616
+ onClickOk: oe.handleSaveModal,
1630
1617
  opened: !0,
1631
- dataSource: y,
1632
- onClickCancel: zr,
1633
- options: i
1618
+ dataSource: E,
1619
+ onClickCancel: oe.handleCancelModal,
1620
+ options: o
1634
1621
  }
1635
1622
  ) : null,
1636
- v === P.GROUP ? /* @__PURE__ */ e.jsx(
1637
- Sa,
1623
+ s === q.GROUP ? /* @__PURE__ */ e.jsx(
1624
+ gr,
1638
1625
  {
1639
- onClickOk: Ir,
1626
+ onClickOk: ie.handleSaveModal,
1640
1627
  opened: !0,
1641
- dataSource: U,
1642
- onClickCancel: Er,
1643
- options: x
1628
+ dataSource: te,
1629
+ onClickCancel: ie.handleCancelModal,
1630
+ options: t
1644
1631
  }
1645
1632
  ) : null,
1646
- v === P.PROFILE ? /* @__PURE__ */ e.jsx(
1647
- ja,
1633
+ s === q.PROFILE ? /* @__PURE__ */ e.jsx(
1634
+ ur,
1648
1635
  {
1649
- onClickOk: Gr,
1636
+ onClickOk: ne.handleSaveModal,
1650
1637
  opened: !0,
1651
- dataSource: q,
1652
- onClickCancel: $r,
1638
+ dataSource: ze,
1639
+ onClickCancel: ne.handleCancelModal,
1653
1640
  options: l
1654
1641
  }
1655
1642
  ) : null,
1656
- W === P.USER ? /* @__PURE__ */ e.jsx(
1657
- Me,
1643
+ x === q.USER ? /* @__PURE__ */ e.jsx(
1644
+ We,
1658
1645
  {
1659
- dataSource: y,
1660
- opened: !!W,
1661
- close: Ge
1646
+ dataSource: E,
1647
+ opened: !!x,
1648
+ close: Ue
1662
1649
  }
1663
1650
  ) : null,
1664
- W === P.GROUP ? /* @__PURE__ */ e.jsx(
1665
- Me,
1651
+ x === q.GROUP ? /* @__PURE__ */ e.jsx(
1652
+ We,
1666
1653
  {
1667
- dataSource: U,
1668
- opened: !!W,
1669
- close: Ge
1654
+ dataSource: te,
1655
+ opened: !!x,
1656
+ close: Ue
1670
1657
  }
1671
1658
  ) : null,
1672
- W === P.PROFILE ? /* @__PURE__ */ e.jsx(
1673
- Me,
1659
+ x === q.PROFILE ? /* @__PURE__ */ e.jsx(
1660
+ We,
1674
1661
  {
1675
- dataSource: q,
1676
- opened: !!W,
1677
- close: Ge
1662
+ dataSource: ze,
1663
+ opened: !!x,
1664
+ close: Ue
1678
1665
  }
1679
1666
  ) : null
1680
1667
  ] });
1681
1668
  }
1682
- function Ua({ height: r = "400px", width: u = "100%" }) {
1683
- nr();
1684
- const g = ir("apiTokenStore"), i = { validateEntity: () => [] }, { colorScheme: l } = Oe(), [x, A] = O(void 0), c = re(_.ApiToken), [$, h] = O(""), S = je(null), z = (D) => D.id, { dataSource: j } = na({
1669
+ function Yr({ height: a = "400px", width: r = "100%" }) {
1670
+ Xe();
1671
+ const n = ma("apiTokenStore"), o = { validateEntity: () => [] }, { colorScheme: l } = Ne(), [t, b] = k(void 0), m = X(Q.ApiToken), [C, c] = k(""), y = be(null), u = (N) => N.id, { dataSource: f } = Ja({
1685
1672
  initialData: [],
1686
1673
  name: "dataSource"
1687
- }), M = ke(
1674
+ }), F = Ie(
1688
1675
  "ArchbaseApiTokenView-LocalDataSource",
1689
- j,
1676
+ f,
1690
1677
  void 0,
1691
1678
  void 0
1692
- ), { dataSource: f, isLoading: Y } = Ue({
1679
+ ), { dataSource: j, isLoading: B } = Ze({
1693
1680
  name: "dsApiToken",
1694
- service: c,
1695
- store: g,
1696
- validator: i,
1681
+ service: m,
1682
+ store: n,
1683
+ validator: o,
1697
1684
  pageSize: 25,
1698
1685
  loadOnStart: !0,
1699
- onLoadComplete: (D) => {
1686
+ onLoadComplete: (N) => {
1700
1687
  },
1701
- onDestroy: (D) => {
1688
+ onDestroy: (N) => {
1702
1689
  },
1703
- onError: (D, Z) => {
1704
- A(D), X.showError(t().t("archbase:WARNING"), D, Z);
1690
+ onError: (N, J) => {
1691
+ b(N), _.showError(i().t("archbase:WARNING"), N, J);
1705
1692
  }
1706
- }), B = ke(
1693
+ }), L = Ie(
1707
1694
  "ArchbaseApiTokenView-RemoteDataSource",
1708
- f,
1695
+ j,
1709
1696
  void 0,
1710
1697
  void 0
1711
- ), d = `calc(${r} - 40px)`, v = /* @__PURE__ */ e.jsxs(fe, { children: [
1698
+ ), s = `calc(${a} - 40px)`, d = /* @__PURE__ */ e.jsxs(we, { children: [
1712
1699
  /* @__PURE__ */ e.jsx(
1713
- m,
1700
+ S,
1714
1701
  {
1715
1702
  dataField: "user.avatar",
1716
1703
  dataType: "image",
1717
1704
  size: 80,
1718
1705
  header: "Foto",
1719
- render: (D) => /* @__PURE__ */ e.jsx(
1706
+ render: (N) => /* @__PURE__ */ e.jsx(
1720
1707
  "img",
1721
1708
  {
1722
1709
  style: { borderRadius: 50, height: "32px", maxHeight: "32px" },
1723
- src: D.row.user && D.row.user.avatar ? atob(D.row.user.avatar) : Ne
1710
+ src: N.row.user && N.row.user.avatar ? atob(N.row.user.avatar) : Ke
1724
1711
  }
1725
1712
  ),
1726
1713
  inputFilterType: "text",
@@ -1728,7 +1715,7 @@ function Ua({ height: r = "400px", width: u = "100%" }) {
1728
1715
  }
1729
1716
  ),
1730
1717
  /* @__PURE__ */ e.jsx(
1731
- m,
1718
+ S,
1732
1719
  {
1733
1720
  dataField: "user.userName",
1734
1721
  dataType: "text",
@@ -1738,7 +1725,7 @@ function Ua({ height: r = "400px", width: u = "100%" }) {
1738
1725
  }
1739
1726
  ),
1740
1727
  /* @__PURE__ */ e.jsx(
1741
- m,
1728
+ S,
1742
1729
  {
1743
1730
  dataField: "user.email",
1744
1731
  dataType: "text",
@@ -1748,7 +1735,7 @@ function Ua({ height: r = "400px", width: u = "100%" }) {
1748
1735
  }
1749
1736
  ),
1750
1737
  /* @__PURE__ */ e.jsx(
1751
- m,
1738
+ S,
1752
1739
  {
1753
1740
  dataField: "name",
1754
1741
  dataType: "text",
@@ -1758,7 +1745,7 @@ function Ua({ height: r = "400px", width: u = "100%" }) {
1758
1745
  }
1759
1746
  ),
1760
1747
  /* @__PURE__ */ e.jsx(
1761
- m,
1748
+ S,
1762
1749
  {
1763
1750
  dataField: "description",
1764
1751
  dataType: "text",
@@ -1768,7 +1755,7 @@ function Ua({ height: r = "400px", width: u = "100%" }) {
1768
1755
  }
1769
1756
  ),
1770
1757
  /* @__PURE__ */ e.jsx(
1771
- m,
1758
+ S,
1772
1759
  {
1773
1760
  dataField: "token",
1774
1761
  dataType: "text",
@@ -1779,7 +1766,7 @@ function Ua({ height: r = "400px", width: u = "100%" }) {
1779
1766
  }
1780
1767
  ),
1781
1768
  /* @__PURE__ */ e.jsx(
1782
- m,
1769
+ S,
1783
1770
  {
1784
1771
  dataField: "tenantId",
1785
1772
  dataType: "text",
@@ -1790,41 +1777,41 @@ function Ua({ height: r = "400px", width: u = "100%" }) {
1790
1777
  }
1791
1778
  ),
1792
1779
  /* @__PURE__ */ e.jsx(
1793
- m,
1780
+ S,
1794
1781
  {
1795
1782
  dataField: "expirationDate",
1796
1783
  dataType: "text",
1797
1784
  size: 240,
1798
1785
  header: "Validade",
1799
- render: (D) => {
1800
- if (!D.row.expirationDate)
1801
- return /* @__PURE__ */ e.jsx(J, { c: "dimmed", children: "Sem expiração" });
1802
- const Z = /* @__PURE__ */ new Date();
1803
- Z.setHours(0, 0, 0, 0);
1804
- const p = new Date(D.row.expirationDate);
1805
- p.setHours(0, 0, 0, 0);
1806
- const w = p.getTime() - Z.getTime(), b = Math.ceil(w / (1e3 * 60 * 60 * 24));
1807
- let ne = Math.max(0, Math.min(100, b / 365 * 100)), s = "green", n = "";
1808
- b < 0 ? (s = "red", ne = 100, n = `Vencido há ${Math.abs(b)} dia${Math.abs(b) !== 1 ? "s" : ""}`) : b === 0 ? (s = "red", ne = 5, n = "Vence hoje") : b <= 7 ? (s = "red", n = `${b} dia${b !== 1 ? "s" : ""}`) : b <= 30 ? (s = "orange", n = `${b} dias`) : b <= 90 ? (s = "yellow", n = `${b} dias`) : (s = "green", n = `${b} dias`);
1809
- const L = b < 0 ? `Vencido em ${p.toLocaleDateString()}` : `Expira em ${p.toLocaleDateString()}`;
1810
- return /* @__PURE__ */ e.jsx(se, { label: L, withArrow: !0, children: /* @__PURE__ */ e.jsxs(V, { gap: "xs", wrap: "nowrap", children: [
1786
+ render: (N) => {
1787
+ if (!N.row.expirationDate)
1788
+ return /* @__PURE__ */ e.jsx(v, { c: "dimmed", children: "Sem expiração" });
1789
+ const J = /* @__PURE__ */ new Date();
1790
+ J.setHours(0, 0, 0, 0);
1791
+ const w = new Date(N.row.expirationDate);
1792
+ w.setHours(0, 0, 0, 0);
1793
+ const T = w.getTime() - J.getTime(), A = Math.ceil(T / (1e3 * 60 * 60 * 24));
1794
+ let he = Math.max(0, Math.min(100, A / 365 * 100)), h = "green", p = "";
1795
+ A < 0 ? (h = "red", he = 100, p = `Vencido há ${Math.abs(A)} dia${Math.abs(A) !== 1 ? "s" : ""}`) : A === 0 ? (h = "red", he = 5, p = "Vence hoje") : A <= 7 ? (h = "red", p = `${A} dia${A !== 1 ? "s" : ""}`) : A <= 30 ? (h = "orange", p = `${A} dias`) : A <= 90 ? (h = "yellow", p = `${A} dias`) : (h = "green", p = `${A} dias`);
1796
+ const V = A < 0 ? `Vencido em ${w.toLocaleDateString()}` : `Expira em ${w.toLocaleDateString()}`;
1797
+ return /* @__PURE__ */ e.jsx(ve, { label: V, withArrow: !0, children: /* @__PURE__ */ e.jsxs(D, { gap: "xs", wrap: "nowrap", children: [
1811
1798
  /* @__PURE__ */ e.jsx(
1812
- Zr,
1799
+ $a,
1813
1800
  {
1814
1801
  size: 36,
1815
1802
  thickness: 4,
1816
1803
  roundCaps: !0,
1817
- sections: [{ value: b < 0 ? 100 : ne, color: s }]
1804
+ sections: [{ value: A < 0 ? 100 : he, color: h }]
1818
1805
  }
1819
1806
  ),
1820
- /* @__PURE__ */ e.jsx(J, { size: "sm", c: b < 0 ? "red" : void 0, fw: b <= 7 ? 600 : void 0, children: n })
1807
+ /* @__PURE__ */ e.jsx(v, { size: "sm", c: A < 0 ? "red" : void 0, fw: A <= 7 ? 600 : void 0, children: p })
1821
1808
  ] }) });
1822
1809
  },
1823
1810
  inputFilterType: "text"
1824
1811
  }
1825
1812
  ),
1826
1813
  /* @__PURE__ */ e.jsx(
1827
- m,
1814
+ S,
1828
1815
  {
1829
1816
  dataField: "activated",
1830
1817
  dataType: "boolean",
@@ -1833,7 +1820,7 @@ function Ua({ height: r = "400px", width: u = "100%" }) {
1833
1820
  }
1834
1821
  ),
1835
1822
  /* @__PURE__ */ e.jsx(
1836
- m,
1823
+ S,
1837
1824
  {
1838
1825
  dataField: "revoked",
1839
1826
  dataType: "boolean",
@@ -1841,73 +1828,73 @@ function Ua({ height: r = "400px", width: u = "100%" }) {
1841
1828
  inputFilterType: "checkbox"
1842
1829
  }
1843
1830
  )
1844
- ] }), T = () => {
1845
- j.insert(ua.newInstance()), j && !M.isDataSourceV2 && M.v1State.forceUpdate(), h("apiToken");
1846
- }, W = () => {
1847
- f.getCurrentRecord() && ee.showConfirmDialogYesNo(
1848
- `${t().t("archbase:Confirme")}`,
1849
- `${t().t("archbase:Deseja revogar o token de API do usuário ")}${f.getCurrentRecord().user.name} ?`,
1831
+ ] }), x = () => {
1832
+ f.insert(sr.newInstance()), f && !F.isDataSourceV2 && F.v1State.forceUpdate(), c("apiToken");
1833
+ }, I = () => {
1834
+ j.getCurrentRecord() && le.showConfirmDialogYesNo(
1835
+ `${i().t("archbase:Confirme")}`,
1836
+ `${i().t("archbase:Deseja revogar o token de API do usuário ")}${j.getCurrentRecord().user.name} ?`,
1850
1837
  async () => {
1851
- await c.revoke(f.getCurrentRecord().token).then(async () => {
1852
- X.showSuccess(
1853
- `${t().t("mentors:Informação")}`,
1854
- `${t().t("mentors:Token de API revogado com sucesso!")}`
1855
- ), f.refreshData(), f && !B.isDataSourceV2 && B.v1State.forceUpdate();
1856
- }).catch((D) => {
1857
- ee.showErrorWithDetails(
1858
- `${t().t("mentors:Atenção")}`,
1859
- Ae(D),
1860
- De(D)
1838
+ await m.revoke(j.getCurrentRecord().token).then(async () => {
1839
+ _.showSuccess(
1840
+ `${i().t("mentors:Informação")}`,
1841
+ `${i().t("mentors:Token de API revogado com sucesso!")}`
1842
+ ), j.refreshData(), j && !L.isDataSourceV2 && L.v1State.forceUpdate();
1843
+ }).catch((N) => {
1844
+ le.showErrorWithDetails(
1845
+ `${i().t("mentors:Atenção")}`,
1846
+ ue(N),
1847
+ De(N)
1861
1848
  );
1862
1849
  });
1863
1850
  },
1864
1851
  () => {
1865
1852
  }
1866
1853
  );
1867
- }, E = () => {
1868
- h("");
1869
- }, Q = async (D, Z) => {
1870
- const p = j.getCurrentRecord();
1871
- if (p)
1854
+ }, P = () => {
1855
+ c("");
1856
+ }, g = async (N, J) => {
1857
+ const w = f.getCurrentRecord();
1858
+ if (w)
1872
1859
  try {
1873
- if (j.validate(), !p.user || !p.user.email) {
1874
- ee.showErrorWithDetails(
1875
- `${t().t("archbase:WARNING")}`,
1876
- `${t().t("archbase:Selecione um usuário para o token de API")}`,
1860
+ if (f.validate(), !w.user || !w.user.email) {
1861
+ le.showErrorWithDetails(
1862
+ `${i().t("archbase:WARNING")}`,
1863
+ `${i().t("archbase:Selecione um usuário para o token de API")}`,
1877
1864
  ""
1878
1865
  );
1879
1866
  return;
1880
1867
  }
1881
- await c.create(p.user.email, p.expirationDate, p.name, p.description).then(async (w) => {
1882
- j.cancel(), j && !M.isDataSourceV2 && M.v1State.forceUpdate(), f.append(w), f && !B.isDataSourceV2 && B.v1State.forceUpdate(), X.showSuccess(
1883
- `${t().t("mentors:Informação")}`,
1884
- `${t().t("mentors:Token de API gerado com sucesso!")}`
1885
- ), Z && Z(!0);
1886
- }).catch((w) => {
1887
- ee.showErrorWithDetails(
1888
- `${t().t("mentors:Atenção")}`,
1889
- Ae(w),
1890
- De(w)
1868
+ await m.create(w.user.email, w.expirationDate, w.name, w.description).then(async (T) => {
1869
+ f.cancel(), f && !F.isDataSourceV2 && F.v1State.forceUpdate(), j.append(T), j && !L.isDataSourceV2 && L.v1State.forceUpdate(), _.showSuccess(
1870
+ `${i().t("mentors:Informação")}`,
1871
+ `${i().t("mentors:Token de API gerado com sucesso!")}`
1872
+ ), J && J(!0);
1873
+ }).catch((T) => {
1874
+ le.showErrorWithDetails(
1875
+ `${i().t("mentors:Atenção")}`,
1876
+ ue(T),
1877
+ De(T)
1891
1878
  );
1892
1879
  });
1893
- } catch (w) {
1894
- ee.showErrorWithDetails(
1895
- `${t().t("mentors:Atenção")}`,
1896
- Ae(w),
1897
- De(w)
1880
+ } catch (T) {
1881
+ le.showErrorWithDetails(
1882
+ `${i().t("mentors:Atenção")}`,
1883
+ ue(T),
1884
+ De(T)
1898
1885
  );
1899
1886
  }
1900
- }, o = () => /* @__PURE__ */ e.jsx(te, { justify: "space-between", style: { width: "50%" }, children: /* @__PURE__ */ e.jsxs(V, { align: "start", gap: "2px", wrap: "nowrap", children: [
1901
- /* @__PURE__ */ e.jsx(N, { color: "green", leftSection: /* @__PURE__ */ e.jsx(ze, {}), onClick: T, children: t().t("archbase:New") }),
1902
- /* @__PURE__ */ e.jsx(N, { disabled: !f.getCurrentRecord(), color: "red", leftSection: /* @__PURE__ */ e.jsx(Ce, {}), onClick: W, children: t().t("archbase:Revoke") })
1887
+ }, ee = () => /* @__PURE__ */ e.jsx(Te, { justify: "space-between", style: { width: "50%" }, children: /* @__PURE__ */ e.jsxs(D, { align: "start", gap: "2px", wrap: "nowrap", children: [
1888
+ /* @__PURE__ */ e.jsx(H, { color: "green", leftSection: /* @__PURE__ */ e.jsx(ja, {}), onClick: x, children: i().t("archbase:New") }),
1889
+ /* @__PURE__ */ e.jsx(H, { disabled: !j.getCurrentRecord(), color: "red", leftSection: /* @__PURE__ */ e.jsx(Ye, {}), onClick: I, children: i().t("archbase:Revoke") })
1903
1890
  ] }) });
1904
- return /* @__PURE__ */ e.jsxs(K, { p: "md", style: { height: r, display: "flex", flexDirection: "column" }, children: [
1891
+ return /* @__PURE__ */ e.jsxs(Y, { p: "md", style: { height: a, display: "flex", flexDirection: "column" }, children: [
1905
1892
  /* @__PURE__ */ e.jsx(
1906
- K,
1893
+ Y,
1907
1894
  {
1908
1895
  withBorder: !0,
1909
1896
  style: {
1910
- height: d,
1897
+ height: s,
1911
1898
  display: "flex",
1912
1899
  width: "100%",
1913
1900
  flex: 1,
@@ -1915,51 +1902,465 @@ function Ua({ height: r = "400px", width: u = "100%" }) {
1915
1902
  overflow: "auto"
1916
1903
  },
1917
1904
  children: /* @__PURE__ */ e.jsx(
1918
- be,
1905
+ xa,
1919
1906
  {
1920
- gridRef: S,
1907
+ gridRef: y,
1921
1908
  printTitle: "Tokens de API",
1922
1909
  width: "100%",
1923
1910
  height: "100%",
1924
1911
  withBorder: !1,
1925
- dataSource: f,
1912
+ dataSource: j,
1926
1913
  withColumnBorders: !0,
1927
1914
  striped: !0,
1928
1915
  enableTopToolbar: !0,
1929
1916
  enableRowActions: !1,
1930
1917
  pageSize: 50,
1931
- isLoading: Y,
1932
- isError: !!x,
1933
- error: x,
1918
+ isLoading: B,
1919
+ isError: !!t,
1920
+ error: t,
1934
1921
  enableGlobalFilter: !0,
1935
- getRowId: z,
1936
- toolbarLeftContent: o(),
1937
- children: v
1922
+ getRowId: u,
1923
+ toolbarLeftContent: ee(),
1924
+ children: d
1938
1925
  }
1939
1926
  )
1940
1927
  }
1941
1928
  ),
1942
- $ === "apiToken" ? /* @__PURE__ */ e.jsx(
1943
- Ta,
1929
+ C === "apiToken" ? /* @__PURE__ */ e.jsx(
1930
+ br,
1944
1931
  {
1945
- onClickOk: E,
1932
+ onClickOk: P,
1946
1933
  opened: !0,
1947
- dataSource: j,
1948
- onCustomSave: Q,
1949
- onClickCancel: E
1934
+ dataSource: f,
1935
+ onCustomSave: g,
1936
+ onClickCancel: P
1950
1937
  }
1951
1938
  ) : null
1952
1939
  ] });
1953
1940
  }
1941
+ const Le = (a) => {
1942
+ switch (a) {
1943
+ case "critical":
1944
+ return "red";
1945
+ case "warning":
1946
+ return "orange";
1947
+ case "ok":
1948
+ return "green";
1949
+ default:
1950
+ return "gray";
1951
+ }
1952
+ }, Tr = ({ card: a }) => /* @__PURE__ */ e.jsx(Y, { withBorder: !0, radius: "md", p: "sm", style: { borderLeft: `3px solid var(--mantine-color-${Le(a.severity)}-6)` }, children: /* @__PURE__ */ e.jsxs(U, { gap: 4, children: [
1953
+ /* @__PURE__ */ e.jsxs(D, { gap: 8, align: "baseline", wrap: "wrap", children: [
1954
+ /* @__PURE__ */ e.jsx(v, { fw: 600, size: "1.7rem", lh: 1.05, c: Le(a.severity), children: a.value }),
1955
+ a.of ? /* @__PURE__ */ e.jsx(v, { size: "xs", c: "dimmed", children: a.of }) : null
1956
+ ] }),
1957
+ /* @__PURE__ */ e.jsx(v, { size: "sm", fw: 550, children: a.label }),
1958
+ a.description ? /* @__PURE__ */ e.jsx(v, { size: "xs", c: "dimmed", lh: 1.45, children: a.description }) : null
1959
+ ] }) }), Rr = ({ cards: a }) => /* @__PURE__ */ e.jsx(Ve, { cols: { base: 1, sm: 2, lg: 3, xl: 4 }, spacing: "xs", children: a.map((r, n) => /* @__PURE__ */ e.jsx(Tr, { card: r }, `${r.label}-${n}`)) }), kr = ({ flags: a }) => /* @__PURE__ */ e.jsx(Ve, { cols: { base: 1, sm: 2, lg: 4 }, spacing: "xs", children: a.map((r) => /* @__PURE__ */ e.jsx(Y, { withBorder: !0, radius: "md", p: "sm", children: /* @__PURE__ */ e.jsxs(U, { gap: 3, children: [
1960
+ /* @__PURE__ */ e.jsx(v, { size: "10px", c: "dimmed", ff: "monospace", style: { wordBreak: "break-all" }, children: r.key }),
1961
+ /* @__PURE__ */ e.jsxs(D, { gap: 7, wrap: "nowrap", children: [
1962
+ /* @__PURE__ */ e.jsx(se, { size: "xs", circle: !0, color: Le(r.severity) }),
1963
+ /* @__PURE__ */ e.jsx(v, { size: "sm", fw: 550, children: r.value })
1964
+ ] }),
1965
+ r.description ? /* @__PURE__ */ e.jsx(v, { size: "xs", c: "dimmed", lh: 1.4, children: r.description }) : null
1966
+ ] }) }, r.key)) }), Ir = ({ attributes: a }) => /* @__PURE__ */ e.jsx(U, { gap: 7, children: a.map((r, n) => /* @__PURE__ */ e.jsxs(D, { gap: 12, wrap: "nowrap", justify: "space-between", children: [
1967
+ /* @__PURE__ */ e.jsx(v, { size: "sm", c: "dimmed", children: r.label }),
1968
+ /* @__PURE__ */ e.jsx(v, { size: "sm", fw: 600, ta: "right", children: r.value })
1969
+ ] }, `${r.label}-${n}`)) }), Pe = ({ title: a, hint: r, children: n }) => /* @__PURE__ */ e.jsxs(U, { gap: "xs", children: [
1970
+ /* @__PURE__ */ e.jsxs(D, { gap: 10, align: "baseline", wrap: "wrap", children: [
1971
+ /* @__PURE__ */ e.jsx(v, { size: "xs", fw: 650, tt: "uppercase", style: { letterSpacing: ".05em" }, children: a }),
1972
+ r ? /* @__PURE__ */ e.jsx(v, { size: "xs", c: "dimmed", children: r }) : null
1973
+ ] }),
1974
+ n
1975
+ ] }), Pr = (a, r) => r > 0 ? ` · ${Math.round(a / r * 100)}%` : "", Fr = (a) => {
1976
+ const r = a.flags;
1977
+ return [
1978
+ {
1979
+ key: "archbase.security.access.require-active",
1980
+ label: "Filtro de ativo",
1981
+ value: r.requireActive ? "Ligado" : "Desligado",
1982
+ severity: r.requireActive ? "ok" : "critical",
1983
+ description: r.requireActive ? "Permissão para ação inativa não decide." : "Permissão para ação inativa ainda decide."
1984
+ },
1985
+ {
1986
+ key: "archbase.security.admin-endpoints.policy",
1987
+ label: "Endpoints administrativos",
1988
+ value: r.adminEndpointsPolicy,
1989
+ severity: r.adminEndpointsPolicy === "permit" ? "critical" : "ok",
1990
+ description: r.adminEndpointsPolicy === "permit" ? "permit = qualquer autenticado administra segurança." : "Restrito."
1991
+ },
1992
+ {
1993
+ key: "ArchbaseRoleResolver",
1994
+ label: "Resolver de papel",
1995
+ value: r.roleResolverRegistered ? "Registrado" : "Ausente",
1996
+ severity: r.roleResolverRegistered ? "ok" : "warning",
1997
+ description: r.roleResolverRegistered ? "@RequireRole é avaliado." : "@RequireRole não restringe nada sem ele."
1998
+ },
1999
+ {
2000
+ key: "scan",
2001
+ label: "Varredura de capacidades",
2002
+ value: r.scanConfigured ? "Configurada" : "Não configurada",
2003
+ severity: r.scanConfigured ? "ok" : "warning",
2004
+ description: r.scanConfigured ? "O catálogo se alimenta do código." : "O catálogo não se alimenta do código."
2005
+ }
2006
+ ];
2007
+ }, zr = (a) => [
2008
+ {
2009
+ severity: "critical",
2010
+ value: a.permissionsPointingToInactive,
2011
+ of: `de ${a.permissions}${Pr(a.permissionsPointingToInactive, a.permissions)}`,
2012
+ label: "Permissões inertes",
2013
+ description: "Apontam para ação ou recurso inativo. É o acesso que o operador acredita ter concedido."
2014
+ },
2015
+ {
2016
+ severity: "warning",
2017
+ value: a.administrators,
2018
+ of: `de ${a.users} usuários`,
2019
+ label: "Administradores",
2020
+ description: "Passam direto pelo portão GRANT. Nada configurado nesta tela se aplica a eles."
2021
+ },
2022
+ {
2023
+ severity: "warning",
2024
+ value: a.actionsInactive,
2025
+ of: `de ${a.actions} ações`,
2026
+ label: "Ações inativas",
2027
+ description: "Capacidades do catálogo que não valem. São a origem das permissões inertes."
2028
+ },
2029
+ {
2030
+ severity: "warning",
2031
+ value: a.apiResourcesInactive,
2032
+ of: `de ${a.apiResources} recursos API`,
2033
+ label: "Recursos API desativados",
2034
+ description: "Desativados pela varredura por não terem @HasPermission correspondente."
2035
+ },
2036
+ {
2037
+ severity: "neutral",
2038
+ value: a.resourcesWithoutAction,
2039
+ of: `de ${a.resources} recursos`,
2040
+ label: "Recursos sem ação",
2041
+ description: "Telas ainda não abertas neste tenant. Indicador operacional, não alerta."
2042
+ },
2043
+ {
2044
+ severity: "warning",
2045
+ value: a.actionsWithoutPermission,
2046
+ of: "ações",
2047
+ label: "Ninguém tem",
2048
+ description: "Capacidade existe no catálogo e não foi concedida a ninguém."
2049
+ }
2050
+ ], Er = ({ slots: a, onError: r }) => {
2051
+ const n = X(
2052
+ Q.SecurityDiagnostics
2053
+ ), [o, l] = k(void 0), [t, b] = k(!0), [m, C] = k(void 0);
2054
+ ye(() => {
2055
+ let u = !0;
2056
+ return b(!0), n.getOverview().then((f) => {
2057
+ u && (l(f), C(void 0));
2058
+ }).catch((f) => {
2059
+ if (u) {
2060
+ const F = ue(f);
2061
+ C(F), r?.(F);
2062
+ }
2063
+ }).finally(() => {
2064
+ u && b(!1);
2065
+ }), () => {
2066
+ u = !1;
2067
+ };
2068
+ }, [n]);
2069
+ const c = ae(
2070
+ () => o ? [...Fr(o), ...a?.additionalFlags?.(o) ?? []] : [],
2071
+ [o, a]
2072
+ ), y = ae(
2073
+ () => o ? [...zr(o), ...a?.additionalOverviewCards?.(o) ?? []] : [],
2074
+ [o, a]
2075
+ );
2076
+ return t ? /* @__PURE__ */ e.jsx(Qe, { size: "sm" }) : m ? /* @__PURE__ */ e.jsx(Re, { color: "red", title: "Não foi possível ler o diagnóstico", children: m }) : o ? /* @__PURE__ */ e.jsxs(U, { gap: "lg", children: [
2077
+ /* @__PURE__ */ e.jsxs(Pe, { title: "Proteções", hint: "de AccessOverview.flags", children: [
2078
+ /* @__PURE__ */ e.jsx(kr, { flags: c }),
2079
+ /* @__PURE__ */ e.jsx(v, { size: "xs", c: "dimmed", lh: 1.45, children: "Todas nascem com o padrão compatível — ligadas só quando alguém decide." })
2080
+ ] }),
2081
+ /* @__PURE__ */ e.jsx(Pe, { title: "Catálogo e concessões", hint: "contagens vivas", children: /* @__PURE__ */ e.jsx(Rr, { cards: y }) }),
2082
+ a?.afterOverview?.(o)
2083
+ ] }) : null;
2084
+ }, ha = {
2085
+ EFFECTIVE: { label: "Efetiva", color: "green" },
2086
+ INERT: { label: "Inerte", color: "orange" },
2087
+ DENIED: { label: "Negada", color: "red" }
2088
+ }, Dr = { GROUP: "grupo", PROFILE: "perfil", USER: "direto" }, $r = [
2089
+ { value: "all", label: "Todas" },
2090
+ { value: "EFFECTIVE", label: "Só efetivas" },
2091
+ { value: "INERT", label: "Só inertes" },
2092
+ { value: "DENIED", label: "Negadas" },
2093
+ { value: "inherited", label: "Só herdadas" }
2094
+ ], Lr = ({ slots: a, onError: r }) => {
2095
+ const n = X(
2096
+ Q.SecurityDiagnostics
2097
+ ), [o, l] = k(""), [t, b] = k(void 0), [m, C] = k(!1), [c, y] = k(void 0), [u, f] = k("all"), F = ce(
2098
+ async (s) => {
2099
+ const d = s.trim();
2100
+ if (d) {
2101
+ C(!0), y(void 0);
2102
+ try {
2103
+ const x = d.includes("@") ? await n.getEffectiveAccessByEmail(d) : await n.getEffectiveAccessByUserId(d);
2104
+ b(x);
2105
+ } catch (x) {
2106
+ const I = ue(x);
2107
+ y(I), r?.(I), b(void 0);
2108
+ } finally {
2109
+ C(!1);
2110
+ }
2111
+ }
2112
+ },
2113
+ [n, r]
2114
+ ), j = ae(() => t ? [
2115
+ { label: "Perfil", value: t.profileName || "—" },
2116
+ { label: "Grupos", value: t.groupNames.length ? t.groupNames.join(", ") : "—" },
2117
+ ...a?.userAttributes?.(t) ?? []
2118
+ ] : [], [t, a]), B = ae(() => t ? u === "all" ? t.capabilities : u === "inherited" ? t.capabilities.filter((s) => s.grantedByType !== "USER") : t.capabilities.filter((s) => s.situation === u) : [], [t, u]), L = a?.additionalCapabilityColumns ?? [];
2119
+ return /* @__PURE__ */ e.jsxs(U, { gap: "lg", children: [
2120
+ /* @__PURE__ */ e.jsx(Pe, { title: "Consultar", hint: "por e-mail ou id do usuário", children: a?.renderUserSearch ? a.renderUserSearch((s) => {
2121
+ l(s), F(s);
2122
+ }) : /* @__PURE__ */ e.jsxs(D, { gap: "xs", align: "flex-end", children: [
2123
+ /* @__PURE__ */ e.jsx(
2124
+ xe,
2125
+ {
2126
+ style: { flex: 1, minWidth: 240 },
2127
+ label: "Usuário",
2128
+ placeholder: "pessoa@empresa.com.br",
2129
+ value: o,
2130
+ onChange: (s) => l(s.currentTarget.value),
2131
+ onKeyDown: (s) => {
2132
+ s.key === "Enter" && F(o);
2133
+ }
2134
+ }
2135
+ ),
2136
+ /* @__PURE__ */ e.jsx(H, { onClick: () => void F(o), loading: m, children: "Consultar" })
2137
+ ] }) }),
2138
+ c ? /* @__PURE__ */ e.jsx(Re, { color: "red", title: "Não foi possível ler o efetivo", children: c }) : null,
2139
+ m && !t ? /* @__PURE__ */ e.jsx(Qe, { size: "sm" }) : null,
2140
+ t ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2141
+ /* @__PURE__ */ e.jsx(Y, { withBorder: !0, radius: "md", p: "md", children: /* @__PURE__ */ e.jsxs(U, { gap: "sm", children: [
2142
+ /* @__PURE__ */ e.jsxs(D, { gap: 8, wrap: "wrap", align: "center", children: [
2143
+ /* @__PURE__ */ e.jsx(v, { fw: 620, children: t.userLabel }),
2144
+ t.administrator ? /* @__PURE__ */ e.jsx(se, { color: "red", children: "administrador" }) : null,
2145
+ t.enabled ? null : /* @__PURE__ */ e.jsx(se, { color: "red", children: "conta desativada" }),
2146
+ a?.afterUserBadges?.(t)
2147
+ ] }),
2148
+ /* @__PURE__ */ e.jsx(Ir, { attributes: j })
2149
+ ] }) }),
2150
+ t.administrator ? /* @__PURE__ */ e.jsxs(Re, { color: "orange", title: "Administrador passa direto", children: [
2151
+ "O portão GRANT concede sem consultar o catálogo. A lista abaixo vir vazia não é falta de dado — é o atalho que a flag ",
2152
+ /* @__PURE__ */ e.jsx("code", { children: "isAdministrator" }),
2153
+ " representa."
2154
+ ] }) : null,
2155
+ /* @__PURE__ */ e.jsx(Ve, { cols: { base: 2, sm: 4 }, spacing: "xs", children: [
2156
+ ["concedidas", t.granted, "neutral"],
2157
+ ["efetivas", t.effective, "ok"],
2158
+ ["inertes", t.inert, "warning"],
2159
+ ["negadas", t.denied, "critical"]
2160
+ ].map(([s, d, x]) => /* @__PURE__ */ e.jsx(Y, { withBorder: !0, radius: "md", p: "sm", children: /* @__PURE__ */ e.jsxs(U, { gap: 2, children: [
2161
+ /* @__PURE__ */ e.jsx(v, { size: "1.3rem", fw: 620, c: Le(x), children: d }),
2162
+ /* @__PURE__ */ e.jsx(v, { size: "xs", c: "dimmed", children: s })
2163
+ ] }) }, s)) }),
2164
+ a?.afterEffectiveTally?.(t),
2165
+ /* @__PURE__ */ e.jsxs(Pe, { title: "Capacidades", hint: `${B.length} de ${t.capabilities.length}`, children: [
2166
+ /* @__PURE__ */ e.jsx(sa.Group, { multiple: !1, value: u, onChange: (s) => f(s), children: /* @__PURE__ */ e.jsx(D, { gap: 6, children: $r.map((s) => /* @__PURE__ */ e.jsx(sa, { value: s.value, size: "xs", variant: "outline", children: s.label }, s.value)) }) }),
2167
+ /* @__PURE__ */ e.jsx(W.ScrollContainer, { minWidth: 640, children: /* @__PURE__ */ e.jsxs(W, { striped: !0, highlightOnHover: !0, withTableBorder: !0, children: [
2168
+ /* @__PURE__ */ e.jsx(W.Thead, { children: /* @__PURE__ */ e.jsxs(W.Tr, { children: [
2169
+ /* @__PURE__ */ e.jsx(W.Th, { children: "Capacidade" }),
2170
+ /* @__PURE__ */ e.jsx(W.Th, { children: "Origem" }),
2171
+ /* @__PURE__ */ e.jsx(W.Th, { children: "Situação" }),
2172
+ L.map((s) => /* @__PURE__ */ e.jsx(W.Th, { children: s.header }, s.header))
2173
+ ] }) }),
2174
+ /* @__PURE__ */ e.jsxs(W.Tbody, { children: [
2175
+ B.map((s, d) => /* @__PURE__ */ e.jsxs(W.Tr, { children: [
2176
+ /* @__PURE__ */ e.jsx(W.Td, { children: /* @__PURE__ */ e.jsxs(v, { size: "sm", ff: "monospace", children: [
2177
+ s.resource,
2178
+ ":",
2179
+ s.action
2180
+ ] }) }),
2181
+ /* @__PURE__ */ e.jsx(W.Td, { children: /* @__PURE__ */ e.jsxs(v, { size: "sm", children: [
2182
+ /* @__PURE__ */ e.jsxs(v, { span: !0, c: "dimmed", children: [
2183
+ Dr[s.grantedByType] ?? s.grantedByType,
2184
+ " "
2185
+ ] }),
2186
+ s.grantedByName
2187
+ ] }) }),
2188
+ /* @__PURE__ */ e.jsx(W.Td, { children: /* @__PURE__ */ e.jsx(se, { color: ha[s.situation].color, variant: "light", children: ha[s.situation].label }) }),
2189
+ L.map((x) => /* @__PURE__ */ e.jsx(W.Td, { children: x.render(s, t) }, x.header))
2190
+ ] }, `${s.resource}:${s.action}:${d}`)),
2191
+ B.length === 0 ? /* @__PURE__ */ e.jsx(W.Tr, { children: /* @__PURE__ */ e.jsx(W.Td, { colSpan: 3 + L.length, children: /* @__PURE__ */ e.jsx(v, { size: "sm", c: "dimmed", ta: "center", py: "md", children: "Nenhuma capacidade neste filtro." }) }) }) : null
2192
+ ] })
2193
+ ] }) })
2194
+ ] })
2195
+ ] }) : null
2196
+ ] });
2197
+ }, Nr = [
2198
+ { gate: "IDENTITY", titulo: "Identidade", papel: "só nega", pergunta: "O principal é resolvível e a conta está ativa?" },
2199
+ { gate: "SCOPE", titulo: "Escopo", papel: "só nega", pergunta: "A concessão vale para o tenant, empresa e projeto pedidos?" },
2200
+ { gate: "RESTRICTION", titulo: "Restrições", papel: "só nega", pergunta: "Perfil, papel e persona exigidos pela anotação." },
2201
+ { gate: "LEVEL", titulo: "Nível", papel: "só nega", pergunta: "O nível da pessoa alcança o piso da capacidade?" },
2202
+ { gate: "GRANT", titulo: "Concessão", papel: "concede", pergunta: "Existe permissão, sem negação explícita?" }
2203
+ ], Vr = ({ slots: a, onError: r }) => {
2204
+ const n = X(
2205
+ Q.SecurityDiagnostics
2206
+ ), [o, l] = k(""), [t, b] = k(""), [m, C] = k(""), [c, y] = k({}), [u, f] = k(void 0), [F, j] = k(!1), [B, L] = k(void 0), s = ce(async () => {
2207
+ if (!(!o.trim() || !t.trim() || !m.trim())) {
2208
+ j(!0), L(void 0);
2209
+ try {
2210
+ const x = o.trim(), I = await n.simulate({
2211
+ ...x.includes("@") ? { email: x } : { userId: x },
2212
+ resource: t.trim(),
2213
+ action: m.trim(),
2214
+ companyId: c.companyId,
2215
+ projectId: c.projectId
2216
+ });
2217
+ f(I);
2218
+ } catch (x) {
2219
+ const I = ue(x);
2220
+ L(I), r?.(I), f(void 0);
2221
+ } finally {
2222
+ j(!1);
2223
+ }
2224
+ }
2225
+ }, [n, o, t, m, c, r]), d = (x, I) => {
2226
+ const P = I.chain?.find((g) => g.gate === x);
2227
+ return P ? P.passed ? "passou" : "negou" : "nao-avaliado";
2228
+ };
2229
+ return /* @__PURE__ */ e.jsxs(U, { gap: "lg", children: [
2230
+ /* @__PURE__ */ e.jsx(Y, { withBorder: !0, radius: "md", p: "md", children: /* @__PURE__ */ e.jsxs(U, { gap: "sm", children: [
2231
+ /* @__PURE__ */ e.jsxs(Ve, { cols: { base: 1, sm: 2, lg: 4 }, spacing: "xs", children: [
2232
+ /* @__PURE__ */ e.jsx(
2233
+ xe,
2234
+ {
2235
+ label: "Usuário",
2236
+ placeholder: "e-mail ou id",
2237
+ value: o,
2238
+ onChange: (x) => l(x.currentTarget.value)
2239
+ }
2240
+ ),
2241
+ /* @__PURE__ */ e.jsx(
2242
+ xe,
2243
+ {
2244
+ label: "Recurso",
2245
+ placeholder: "tms.ordemservico",
2246
+ value: t,
2247
+ onChange: (x) => b(x.currentTarget.value)
2248
+ }
2249
+ ),
2250
+ /* @__PURE__ */ e.jsx(
2251
+ xe,
2252
+ {
2253
+ label: "Ação",
2254
+ placeholder: "aprovar_custo",
2255
+ value: m,
2256
+ onChange: (x) => C(x.currentTarget.value)
2257
+ }
2258
+ ),
2259
+ /* @__PURE__ */ e.jsx(
2260
+ xe,
2261
+ {
2262
+ label: "Empresa (opcional)",
2263
+ placeholder: "companyId",
2264
+ value: c.companyId ?? "",
2265
+ onChange: (x) => y((I) => ({ ...I, companyId: x.currentTarget.value || void 0 }))
2266
+ }
2267
+ )
2268
+ ] }),
2269
+ a?.afterSimulationFields?.((x) => y((I) => ({ ...I, ...x }))),
2270
+ /* @__PURE__ */ e.jsxs(D, { gap: "xs", align: "center", children: [
2271
+ /* @__PURE__ */ e.jsx(H, { onClick: () => void s(), loading: F, children: "Simular" }),
2272
+ /* @__PURE__ */ e.jsx(v, { size: "xs", c: "dimmed", children: "Somente leitura — não altera permissão nenhuma." })
2273
+ ] })
2274
+ ] }) }),
2275
+ B ? /* @__PURE__ */ e.jsx(Re, { color: "red", title: "Não foi possível simular", children: B }) : null,
2276
+ F && !u ? /* @__PURE__ */ e.jsx(Qe, { size: "sm" }) : null,
2277
+ u ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2278
+ /* @__PURE__ */ e.jsx(Pe, { title: "Cadeia de decisão", hint: "os quatro primeiros só negam; só o quinto concede", children: /* @__PURE__ */ e.jsx(Y, { withBorder: !0, radius: "md", p: "md", children: /* @__PURE__ */ e.jsx(U, { gap: "sm", children: Nr.map((x, I) => {
2279
+ const P = d(x.gate, u), g = u.chain?.find((ee) => ee.gate === x.gate)?.detail;
2280
+ return /* @__PURE__ */ e.jsxs(D, { align: "flex-start", wrap: "nowrap", gap: "sm", children: [
2281
+ /* @__PURE__ */ e.jsx(v, { size: "xs", ff: "monospace", c: "dimmed", w: 16, children: I + 1 }),
2282
+ /* @__PURE__ */ e.jsxs(U, { gap: 2, style: { flex: 1, minWidth: 0 }, children: [
2283
+ /* @__PURE__ */ e.jsxs(D, { gap: 8, align: "baseline", wrap: "wrap", children: [
2284
+ /* @__PURE__ */ e.jsx(
2285
+ v,
2286
+ {
2287
+ size: "sm",
2288
+ fw: 600,
2289
+ c: P === "negou" ? "red" : void 0,
2290
+ opacity: P === "nao-avaliado" ? 0.5 : 1,
2291
+ children: x.titulo
2292
+ }
2293
+ ),
2294
+ /* @__PURE__ */ e.jsxs(v, { size: "xs", c: "dimmed", children: [
2295
+ "· ",
2296
+ x.papel
2297
+ ] })
2298
+ ] }),
2299
+ /* @__PURE__ */ e.jsx(v, { size: "xs", c: "dimmed", opacity: P === "nao-avaliado" ? 0.5 : 1, children: x.pergunta }),
2300
+ g ? /* @__PURE__ */ e.jsx(v, { size: "xs", c: "dimmed", children: g }) : null
2301
+ ] }),
2302
+ /* @__PURE__ */ e.jsx(
2303
+ se,
2304
+ {
2305
+ variant: "light",
2306
+ color: P === "negou" ? "red" : P === "passou" ? "green" : "gray",
2307
+ children: P === "nao-avaliado" ? "não avaliado" : P
2308
+ }
2309
+ )
2310
+ ] }, x.gate);
2311
+ }) }) }) }),
2312
+ /* @__PURE__ */ e.jsx(Re, { color: u.allowed ? "green" : "red", title: u.allowed ? "Pode" : "Não pode", children: /* @__PURE__ */ e.jsxs(U, { gap: 6, children: [
2313
+ /* @__PURE__ */ e.jsx(v, { size: "sm", children: u.message }),
2314
+ /* @__PURE__ */ e.jsxs(v, { size: "xs", ff: "monospace", c: "dimmed", children: [
2315
+ "reasonCode: ",
2316
+ u.reasonCode,
2317
+ u.deniedAt ? ` · deniedAt: ${u.deniedAt}` : "",
2318
+ u.grantedByName ? ` · grantedBy: ${u.grantedByName}` : ""
2319
+ ] })
2320
+ ] }) }),
2321
+ a?.afterDecision?.(u)
2322
+ ] }) : null
2323
+ ] });
2324
+ }, Gr = ["overview", "effective", "simulate"];
2325
+ function Kr({
2326
+ height: a = "100%",
2327
+ width: r = "100%",
2328
+ defaultTab: n = "overview",
2329
+ tabs: o = Gr,
2330
+ slots: l,
2331
+ onError: t
2332
+ }) {
2333
+ const [b, m] = k(n), C = (c) => o.includes(c);
2334
+ return /* @__PURE__ */ e.jsx(Y, { style: { height: a, width: r }, p: "md", withBorder: !1, children: /* @__PURE__ */ e.jsxs(Z, { value: b, onChange: m, variant: "pills", keepMounted: !1, children: [
2335
+ /* @__PURE__ */ e.jsxs(Z.List, { mb: "md", children: [
2336
+ C("overview") ? /* @__PURE__ */ e.jsx(Z.Tab, { value: "overview", leftSection: /* @__PURE__ */ e.jsx(Ya, { size: "1rem" }), children: "Panorama" }) : null,
2337
+ C("effective") ? /* @__PURE__ */ e.jsx(Z.Tab, { value: "effective", leftSection: /* @__PURE__ */ e.jsx(Ka, { size: "1rem" }), children: "Efetivo do usuário" }) : null,
2338
+ C("simulate") ? /* @__PURE__ */ e.jsx(Z.Tab, { value: "simulate", leftSection: /* @__PURE__ */ e.jsx(_a, { size: "1rem" }), children: "Simular" }) : null
2339
+ ] }),
2340
+ C("overview") ? /* @__PURE__ */ e.jsx(Z.Panel, { value: "overview", children: /* @__PURE__ */ e.jsx(Er, { slots: l, onError: t }) }) : null,
2341
+ C("effective") ? /* @__PURE__ */ e.jsx(Z.Panel, { value: "effective", children: /* @__PURE__ */ e.jsx(Lr, { slots: l, onError: t }) }) : null,
2342
+ C("simulate") ? /* @__PURE__ */ e.jsx(Z.Panel, { value: "simulate", children: /* @__PURE__ */ e.jsx(Vr, { slots: l, onError: t }) }) : null
2343
+ ] }) });
2344
+ }
1954
2345
  export {
1955
- Ta as ApiTokenModal,
1956
- Ua as ArchbaseApiTokenView,
1957
- wa as ArchbaseDualListSelector,
1958
- Ma as ArchbaseSecurityView,
1959
- Sa as GroupModal,
1960
- Me as PermissionsSelectorModal,
1961
- ja as ProfileModal,
1962
- ya as RenderProfileUserItem,
1963
- Ca as UserModal
2346
+ br as ApiTokenModal,
2347
+ Yr as ArchbaseApiTokenView,
2348
+ hr as ArchbaseDualListSelector,
2349
+ Kr as ArchbaseSecurityDiagnosticsView,
2350
+ Xr as ArchbaseSecurityView,
2351
+ Ir as AttributeList,
2352
+ Lr as EffectiveAccessPanel,
2353
+ kr as FlagStrip,
2354
+ gr as GroupModal,
2355
+ Tr as MetricCard,
2356
+ Rr as MetricCards,
2357
+ Er as OverviewPanel,
2358
+ We as PermissionsSelectorModal,
2359
+ ur as ProfileModal,
2360
+ pr as RenderProfileUserItem,
2361
+ Pe as Section,
2362
+ Vr as SimulationPanel,
2363
+ mr as UserModal,
2364
+ Le as severityColor
1964
2365
  };
1965
2366
  //# sourceMappingURL=index.js.map