@ibdop/platform-kit 1.0.10 → 1.0.11
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/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/useFeatures.d.ts +98 -0
- package/dist/hooks/useFeatures.d.ts.map +1 -0
- package/dist/index.js +10 -10
- package/dist/index.mjs +811 -603
- package/dist/index.umd.js +10 -10
- package/dist/types/index.d.ts +88 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/hooks/index.ts +6 -0
- package/src/hooks/useFeatures.ts +445 -0
- package/src/types/index.ts +99 -0
package/dist/index.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
const
|
|
1
|
+
import Ze, { useState as R, useRef as Dt, useCallback as k, useEffect as V, useMemo as Ge, Component as $t, createContext as Lt, useContext as Ut } from "react";
|
|
2
|
+
import Vt from "axios";
|
|
3
|
+
const Ye = {
|
|
4
4
|
log: (...t) => {
|
|
5
5
|
},
|
|
6
6
|
warn: (...t) => {
|
|
7
7
|
}
|
|
8
8
|
};
|
|
9
|
-
function
|
|
9
|
+
function he() {
|
|
10
10
|
if (typeof window > "u") return null;
|
|
11
11
|
const t = window;
|
|
12
12
|
if (t.__SHELL_AUTH_INSTANCE__)
|
|
@@ -14,41 +14,41 @@ function fe() {
|
|
|
14
14
|
const r = window;
|
|
15
15
|
return r.__SHELL_AUTH__?.authInstance ? r.__SHELL_AUTH__.authInstance : null;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
const [t, r] =
|
|
19
|
-
|
|
20
|
-
const E =
|
|
17
|
+
function ne() {
|
|
18
|
+
const [t, r] = R(null), [o, u] = R(!0), a = Dt(0), d = 20, s = k(() => he(), []);
|
|
19
|
+
V(() => {
|
|
20
|
+
const E = s();
|
|
21
21
|
if (E) {
|
|
22
|
-
r(E),
|
|
22
|
+
r(E), u(!1);
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
|
-
const
|
|
26
|
-
r(
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
|
|
25
|
+
const l = (c) => {
|
|
26
|
+
r(c.detail), u(!1);
|
|
27
|
+
}, m = setInterval(() => {
|
|
28
|
+
a.current++;
|
|
29
|
+
const c = s();
|
|
30
|
+
c ? (Ye.log("Auth found via polling, attempts:", a.current), r(c), u(!1), clearInterval(m)) : a.current >= d && (u(!1), clearInterval(m));
|
|
31
31
|
}, 500);
|
|
32
|
-
return window.addEventListener("shell-auth-ready",
|
|
33
|
-
clearInterval(
|
|
32
|
+
return window.addEventListener("shell-auth-ready", l), () => {
|
|
33
|
+
clearInterval(m), window.removeEventListener("shell-auth-ready", l);
|
|
34
34
|
};
|
|
35
|
-
}, [
|
|
36
|
-
const
|
|
35
|
+
}, [s]);
|
|
36
|
+
const f = t || {
|
|
37
37
|
user: null,
|
|
38
38
|
isAuthenticated: !1,
|
|
39
39
|
isLoading: o,
|
|
40
40
|
signinRedirect: async () => {
|
|
41
|
-
const E =
|
|
41
|
+
const E = he();
|
|
42
42
|
E?.signinRedirect ? await E.signinRedirect() : typeof window < "u" && (window.location.href = "/");
|
|
43
43
|
},
|
|
44
44
|
removeUser: async () => {
|
|
45
|
-
const E =
|
|
45
|
+
const E = he();
|
|
46
46
|
E?.removeUser && await E.removeUser();
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
|
-
return
|
|
49
|
+
return Ye.log("Auth result:", { isAuthenticated: f.isAuthenticated, isLoading: f.isLoading }), f;
|
|
50
50
|
}
|
|
51
|
-
const
|
|
51
|
+
const Bt = {
|
|
52
52
|
log: (...t) => {
|
|
53
53
|
},
|
|
54
54
|
warn: (...t) => {
|
|
@@ -57,7 +57,7 @@ const Wt = {
|
|
|
57
57
|
console.error("[useInfoData]", ...t);
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
|
-
function
|
|
60
|
+
function Ht(t) {
|
|
61
61
|
if (t) return t;
|
|
62
62
|
if (typeof window < "u") {
|
|
63
63
|
const r = window;
|
|
@@ -65,31 +65,31 @@ function Bt(t) {
|
|
|
65
65
|
}
|
|
66
66
|
return "unknown-mfe";
|
|
67
67
|
}
|
|
68
|
-
function
|
|
69
|
-
const [r, o] =
|
|
70
|
-
const E =
|
|
71
|
-
|
|
72
|
-
if (!
|
|
73
|
-
throw new Error(`HTTP ${
|
|
74
|
-
return
|
|
75
|
-
}).then((
|
|
76
|
-
o(
|
|
77
|
-
}).catch((
|
|
78
|
-
|
|
68
|
+
function zt(t) {
|
|
69
|
+
const [r, o] = R(null), [u, a] = R(!0), [d, s] = R(null), x = k(() => {
|
|
70
|
+
const E = Ht(t?.mfeName).replace("@ib-dop/", "");
|
|
71
|
+
a(!0), s(null), fetch(`/svc/${E}/info.json`).then((l) => {
|
|
72
|
+
if (!l.ok)
|
|
73
|
+
throw new Error(`HTTP ${l.status}: ${l.statusText}`);
|
|
74
|
+
return l.json();
|
|
75
|
+
}).then((l) => {
|
|
76
|
+
o(l);
|
|
77
|
+
}).catch((l) => {
|
|
78
|
+
Bt.error("Failed to load info:", l), s(l instanceof Error ? l.message : String(l));
|
|
79
79
|
}).finally(() => {
|
|
80
|
-
|
|
80
|
+
a(!1);
|
|
81
81
|
});
|
|
82
82
|
}, [t?.mfeName]);
|
|
83
|
-
return
|
|
84
|
-
|
|
85
|
-
}, [
|
|
83
|
+
return V(() => {
|
|
84
|
+
x();
|
|
85
|
+
}, [x]), {
|
|
86
86
|
data: r,
|
|
87
|
-
isLoading:
|
|
88
|
-
error:
|
|
89
|
-
refetch:
|
|
87
|
+
isLoading: u,
|
|
88
|
+
error: d,
|
|
89
|
+
refetch: x
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
|
-
const
|
|
92
|
+
const ge = {
|
|
93
93
|
log: (...t) => {
|
|
94
94
|
},
|
|
95
95
|
warn: (...t) => {
|
|
@@ -97,39 +97,39 @@ const de = {
|
|
|
97
97
|
error: (...t) => {
|
|
98
98
|
console.error("[useV1Config]", ...t);
|
|
99
99
|
}
|
|
100
|
-
},
|
|
100
|
+
}, ee = {
|
|
101
101
|
authority: "",
|
|
102
102
|
client_id: "",
|
|
103
103
|
environment: "development"
|
|
104
104
|
};
|
|
105
105
|
function ar() {
|
|
106
|
-
const [t, r] =
|
|
107
|
-
return
|
|
106
|
+
const [t, r] = R(null), [o, u] = R(!0), [a, d] = R(null);
|
|
107
|
+
return V(() => {
|
|
108
108
|
(() => {
|
|
109
109
|
if (typeof sessionStorage > "u") {
|
|
110
|
-
|
|
110
|
+
d("sessionStorage not available"), r(ee), u(!1);
|
|
111
111
|
return;
|
|
112
112
|
}
|
|
113
113
|
try {
|
|
114
|
-
const
|
|
115
|
-
if (
|
|
116
|
-
const
|
|
117
|
-
r({ ...
|
|
114
|
+
const x = sessionStorage.getItem("config");
|
|
115
|
+
if (x) {
|
|
116
|
+
const f = JSON.parse(x);
|
|
117
|
+
r({ ...ee, ...f }), d(null), ge.log("Config loaded successfully");
|
|
118
118
|
} else
|
|
119
|
-
r(
|
|
120
|
-
} catch (
|
|
121
|
-
|
|
119
|
+
r(ee), d("Config not found in sessionStorage"), ge.warn("Config not found in sessionStorage");
|
|
120
|
+
} catch (x) {
|
|
121
|
+
ge.error("Error parsing config:", x), r(ee), d("Error parsing config");
|
|
122
122
|
} finally {
|
|
123
|
-
|
|
123
|
+
u(!1);
|
|
124
124
|
}
|
|
125
125
|
})();
|
|
126
126
|
}, []), {
|
|
127
127
|
data: t,
|
|
128
128
|
isLoading: o,
|
|
129
|
-
error:
|
|
129
|
+
error: a
|
|
130
130
|
};
|
|
131
131
|
}
|
|
132
|
-
function
|
|
132
|
+
function Qe(t) {
|
|
133
133
|
if (typeof window > "u") return;
|
|
134
134
|
const r = window.__MF_NAME__ || "unknown", o = {
|
|
135
135
|
...t,
|
|
@@ -141,7 +141,7 @@ function Ke(t) {
|
|
|
141
141
|
bubbles: !0
|
|
142
142
|
}));
|
|
143
143
|
}
|
|
144
|
-
function
|
|
144
|
+
function Je(t, r) {
|
|
145
145
|
const o = {
|
|
146
146
|
network: {
|
|
147
147
|
title: "Нет подключения",
|
|
@@ -171,60 +171,60 @@ function Ge(t, r) {
|
|
|
171
171
|
title: "Неизвестная ошибка",
|
|
172
172
|
message: t.message || "Произошла неизвестная ошибка."
|
|
173
173
|
}
|
|
174
|
-
},
|
|
175
|
-
|
|
174
|
+
}, u = o[t.type] || o.unknown;
|
|
175
|
+
Qe({
|
|
176
176
|
type: t.type === "network" ? "warning" : "error",
|
|
177
|
-
title:
|
|
178
|
-
message: r ? `${
|
|
177
|
+
title: u.title,
|
|
178
|
+
message: r ? `${u.message} (${r})` : u.message
|
|
179
179
|
});
|
|
180
180
|
}
|
|
181
|
-
function
|
|
181
|
+
function ir(t, r = {}) {
|
|
182
182
|
const {
|
|
183
183
|
notifyOnError: o = !0,
|
|
184
|
-
notifyOnSuccess:
|
|
185
|
-
successMessage:
|
|
186
|
-
errorContext:
|
|
187
|
-
onSuccess:
|
|
188
|
-
onError:
|
|
189
|
-
} = r, [
|
|
190
|
-
_(!0),
|
|
184
|
+
notifyOnSuccess: u = !1,
|
|
185
|
+
successMessage: a,
|
|
186
|
+
errorContext: d,
|
|
187
|
+
onSuccess: s,
|
|
188
|
+
onError: x
|
|
189
|
+
} = r, [f, E] = R(null), [l, m] = R(null), [c, _] = R(!1), w = l !== null, N = f !== null && !c && !w, C = k(async () => {
|
|
190
|
+
_(!0), m(null);
|
|
191
191
|
try {
|
|
192
|
-
const
|
|
193
|
-
if (
|
|
194
|
-
return E(
|
|
192
|
+
const p = await t();
|
|
193
|
+
if (p.ok)
|
|
194
|
+
return E(p.data), u && a && Qe({
|
|
195
195
|
type: "success",
|
|
196
196
|
title: "Успешно",
|
|
197
|
-
message:
|
|
198
|
-
}),
|
|
197
|
+
message: a
|
|
198
|
+
}), s?.(p.data), p.data;
|
|
199
199
|
{
|
|
200
|
-
const
|
|
201
|
-
message:
|
|
202
|
-
status:
|
|
200
|
+
const A = {
|
|
201
|
+
message: p.data || "Request failed",
|
|
202
|
+
status: p.status,
|
|
203
203
|
type: "client",
|
|
204
204
|
timestamp: Date.now()
|
|
205
205
|
};
|
|
206
|
-
return
|
|
206
|
+
return m(A), o && Je(A, d), x?.(A), null;
|
|
207
207
|
}
|
|
208
|
-
} catch (
|
|
209
|
-
const
|
|
210
|
-
return
|
|
208
|
+
} catch (p) {
|
|
209
|
+
const A = p;
|
|
210
|
+
return m(A), o && Je(A, d), x?.(A), null;
|
|
211
211
|
} finally {
|
|
212
212
|
_(!1);
|
|
213
213
|
}
|
|
214
|
-
}, [t, o,
|
|
215
|
-
E(null),
|
|
214
|
+
}, [t, o, u, a, d, s, x]), b = k(() => {
|
|
215
|
+
E(null), m(null), _(!1);
|
|
216
216
|
}, []);
|
|
217
217
|
return {
|
|
218
|
-
data:
|
|
219
|
-
error:
|
|
220
|
-
isLoading:
|
|
221
|
-
isError:
|
|
222
|
-
isSuccess:
|
|
223
|
-
execute:
|
|
224
|
-
reset:
|
|
218
|
+
data: f,
|
|
219
|
+
error: l,
|
|
220
|
+
isLoading: c,
|
|
221
|
+
isError: w,
|
|
222
|
+
isSuccess: N,
|
|
223
|
+
execute: C,
|
|
224
|
+
reset: b
|
|
225
225
|
};
|
|
226
226
|
}
|
|
227
|
-
const
|
|
227
|
+
const Wt = {
|
|
228
228
|
canView: ["all"],
|
|
229
229
|
canEdit: ["ibdop-user", "ibdop-admin", "ibdop-devops"],
|
|
230
230
|
canDelete: ["ibdop-admin", "ibdop-devops"],
|
|
@@ -233,125 +233,330 @@ const Gt = {
|
|
|
233
233
|
canExportData: ["ibdop-user"],
|
|
234
234
|
canManageUsers: ["ibdop-admin"]
|
|
235
235
|
};
|
|
236
|
-
function
|
|
237
|
-
const r =
|
|
238
|
-
...
|
|
236
|
+
function ur(t = {}) {
|
|
237
|
+
const r = ne(), o = Ge(() => ({
|
|
238
|
+
...Wt,
|
|
239
239
|
...t
|
|
240
|
-
}), [t]),
|
|
241
|
-
const
|
|
242
|
-
return Array.isArray(
|
|
243
|
-
}, [r.user]),
|
|
240
|
+
}), [t]), u = Ge(() => {
|
|
241
|
+
const d = r.user?.profile?.realm_roles || r.user?.profile?.roles || [];
|
|
242
|
+
return Array.isArray(d) ? d : [d];
|
|
243
|
+
}, [r.user]), a = (d) => d.includes("all") ? !0 : d.some((s) => u.includes(s));
|
|
244
244
|
return {
|
|
245
|
-
canView:
|
|
246
|
-
canEdit:
|
|
247
|
-
canDelete:
|
|
248
|
-
canAdmin:
|
|
249
|
-
canViewSensitiveData:
|
|
250
|
-
canExportData:
|
|
251
|
-
canManageUsers:
|
|
245
|
+
canView: a(o.canView),
|
|
246
|
+
canEdit: a(o.canEdit),
|
|
247
|
+
canDelete: a(o.canDelete),
|
|
248
|
+
canAdmin: a(o.canAdmin),
|
|
249
|
+
canViewSensitiveData: a(o.canViewSensitiveData),
|
|
250
|
+
canExportData: a(o.canExportData),
|
|
251
|
+
canManageUsers: a(o.canManageUsers)
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
function cr() {
|
|
255
|
+
const t = ne(), [r, o] = R([]), [u, a] = R(0), [d, s] = R([]), [x, f] = R(!0), [E, l] = R(null), m = k(async () => {
|
|
256
|
+
if (!t.isAuthenticated) {
|
|
257
|
+
console.debug("[useFeatures] Not authenticated"), f(!1);
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
f(!0), l(null);
|
|
261
|
+
try {
|
|
262
|
+
const w = {
|
|
263
|
+
"Content-Type": "application/json"
|
|
264
|
+
}, N = t.user?.access_token;
|
|
265
|
+
N && (w.Authorization = `Bearer ${N}`);
|
|
266
|
+
const C = await fetch("/api/features", { headers: w });
|
|
267
|
+
if (!C.ok)
|
|
268
|
+
throw new Error(`HTTP ${C.status}: ${C.statusText}`);
|
|
269
|
+
const b = await C.json();
|
|
270
|
+
o(b.features || []), a(b.totalCount || 0), s(b.userRoles || []);
|
|
271
|
+
} catch (w) {
|
|
272
|
+
console.debug("Features fetch error:", w), l(w instanceof Error ? w.message : String(w)), o([]), s([]);
|
|
273
|
+
} finally {
|
|
274
|
+
f(!1);
|
|
275
|
+
}
|
|
276
|
+
}, [t.isAuthenticated, t.user?.access_token]);
|
|
277
|
+
V(() => {
|
|
278
|
+
m();
|
|
279
|
+
}, [m]);
|
|
280
|
+
const c = k(
|
|
281
|
+
(w) => r.find((C) => C.name === w)?.userEnabled ?? !1,
|
|
282
|
+
[r]
|
|
283
|
+
), _ = k(
|
|
284
|
+
(w) => r.filter((N) => N.mfDependencies?.includes(w)),
|
|
285
|
+
[r]
|
|
286
|
+
);
|
|
287
|
+
return {
|
|
288
|
+
features: r,
|
|
289
|
+
totalCount: u,
|
|
290
|
+
userRoles: d,
|
|
291
|
+
isLoading: x,
|
|
292
|
+
error: E,
|
|
293
|
+
refetch: m,
|
|
294
|
+
isFeatureEnabled: c,
|
|
295
|
+
getFeaturesByMf: _
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
function lr() {
|
|
299
|
+
const t = ne(), [r, o] = R([]), [u, a] = R([]), [d, s] = R(!1), [x, f] = R(!0), [E, l] = R(null), m = k(async () => {
|
|
300
|
+
if (!t.isAuthenticated) {
|
|
301
|
+
console.debug("[useFeatureAdmin] Not authenticated"), f(!1);
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
f(!0), l(null);
|
|
305
|
+
try {
|
|
306
|
+
const C = {
|
|
307
|
+
"Content-Type": "application/json"
|
|
308
|
+
}, b = t.user?.access_token;
|
|
309
|
+
b && (C.Authorization = `Bearer ${b}`);
|
|
310
|
+
const p = await fetch("/api/features/admin", { headers: C });
|
|
311
|
+
if (!p.ok) {
|
|
312
|
+
if (p.status === 403) {
|
|
313
|
+
console.warn("[useFeatureAdmin] 403 Forbidden - checking if token has admin role"), s(!1), o([]), a([]), f(!1);
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
throw new Error(`HTTP ${p.status}: ${p.statusText}`);
|
|
317
|
+
}
|
|
318
|
+
const A = await p.json();
|
|
319
|
+
o(A.featureToggles || []), a(A.microfrontends || []), s(A.isAdmin || !1);
|
|
320
|
+
} catch (C) {
|
|
321
|
+
console.debug("FeatureAdmin fetch error:", C), o([]), a([]), s(!1);
|
|
322
|
+
} finally {
|
|
323
|
+
f(!1);
|
|
324
|
+
}
|
|
325
|
+
}, [t.isAuthenticated, t.user?.access_token]), c = k(
|
|
326
|
+
async (C) => {
|
|
327
|
+
try {
|
|
328
|
+
const b = {
|
|
329
|
+
"Content-Type": "application/json"
|
|
330
|
+
}, p = t.user?.access_token;
|
|
331
|
+
p && (b.Authorization = `Bearer ${p}`);
|
|
332
|
+
const A = await fetch("/api/features/admin", {
|
|
333
|
+
method: "POST",
|
|
334
|
+
headers: b,
|
|
335
|
+
body: JSON.stringify(C)
|
|
336
|
+
});
|
|
337
|
+
if (!A.ok) {
|
|
338
|
+
const P = await A.json().catch(() => ({}));
|
|
339
|
+
throw new Error(P.error || `HTTP ${A.status}`);
|
|
340
|
+
}
|
|
341
|
+
return await m(), !0;
|
|
342
|
+
} catch (b) {
|
|
343
|
+
return l(b instanceof Error ? b.message : String(b)), !1;
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
[m]
|
|
347
|
+
), _ = k(
|
|
348
|
+
async (C, b) => {
|
|
349
|
+
try {
|
|
350
|
+
const p = {
|
|
351
|
+
"Content-Type": "application/json"
|
|
352
|
+
}, A = t.user?.access_token;
|
|
353
|
+
A && (p.Authorization = `Bearer ${A}`);
|
|
354
|
+
const P = await fetch(`/api/features/admin/${encodeURIComponent(C)}`, {
|
|
355
|
+
method: "PUT",
|
|
356
|
+
headers: p,
|
|
357
|
+
body: JSON.stringify(b)
|
|
358
|
+
});
|
|
359
|
+
if (!P.ok) {
|
|
360
|
+
const z = await P.json().catch(() => ({}));
|
|
361
|
+
throw new Error(z.error || `HTTP ${P.status}`);
|
|
362
|
+
}
|
|
363
|
+
return await m(), !0;
|
|
364
|
+
} catch (p) {
|
|
365
|
+
return l(p instanceof Error ? p.message : String(p)), !1;
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
[m]
|
|
369
|
+
), w = k(
|
|
370
|
+
async (C, b) => {
|
|
371
|
+
try {
|
|
372
|
+
const p = {}, A = t.user?.access_token;
|
|
373
|
+
A && (p.Authorization = `Bearer ${A}`);
|
|
374
|
+
const P = await fetch(
|
|
375
|
+
`/api/features/admin/${encodeURIComponent(C)}/toggle?enabled=${b}`,
|
|
376
|
+
{
|
|
377
|
+
method: "POST",
|
|
378
|
+
headers: p
|
|
379
|
+
}
|
|
380
|
+
);
|
|
381
|
+
if (!P.ok) {
|
|
382
|
+
const z = await P.json().catch(() => ({}));
|
|
383
|
+
throw new Error(z.error || `HTTP ${P.status}`);
|
|
384
|
+
}
|
|
385
|
+
return await m(), !0;
|
|
386
|
+
} catch (p) {
|
|
387
|
+
return l(p instanceof Error ? p.message : String(p)), !1;
|
|
388
|
+
}
|
|
389
|
+
},
|
|
390
|
+
[m]
|
|
391
|
+
), N = k(
|
|
392
|
+
async (C) => {
|
|
393
|
+
try {
|
|
394
|
+
const b = {}, p = t.user?.access_token;
|
|
395
|
+
p && (b.Authorization = `Bearer ${p}`);
|
|
396
|
+
const A = await fetch(`/api/features/admin/${encodeURIComponent(C)}`, {
|
|
397
|
+
method: "DELETE",
|
|
398
|
+
headers: b
|
|
399
|
+
});
|
|
400
|
+
if (!A.ok) {
|
|
401
|
+
const P = await A.json().catch(() => ({}));
|
|
402
|
+
throw new Error(P.error || `HTTP ${A.status}`);
|
|
403
|
+
}
|
|
404
|
+
return await m(), !0;
|
|
405
|
+
} catch (b) {
|
|
406
|
+
return l(b instanceof Error ? b.message : String(b)), !1;
|
|
407
|
+
}
|
|
408
|
+
},
|
|
409
|
+
[m]
|
|
410
|
+
);
|
|
411
|
+
return V(() => {
|
|
412
|
+
m();
|
|
413
|
+
}, [m]), {
|
|
414
|
+
features: r,
|
|
415
|
+
microfrontends: u,
|
|
416
|
+
isAdmin: d,
|
|
417
|
+
isLoading: x,
|
|
418
|
+
error: E,
|
|
419
|
+
refetch: m,
|
|
420
|
+
createFeature: c,
|
|
421
|
+
updateFeature: _,
|
|
422
|
+
toggleFeature: w,
|
|
423
|
+
deleteFeature: N
|
|
252
424
|
};
|
|
253
425
|
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
426
|
+
function fr() {
|
|
427
|
+
const t = ne(), [r, o] = R([]), [u, a] = R(0), [d, s] = R(!0), [x, f] = R(null), E = k(async () => {
|
|
428
|
+
if (!t.isAuthenticated) {
|
|
429
|
+
s(!1);
|
|
430
|
+
return;
|
|
431
|
+
}
|
|
432
|
+
s(!0), f(null);
|
|
433
|
+
try {
|
|
434
|
+
const l = {
|
|
435
|
+
"Content-Type": "application/json"
|
|
436
|
+
}, m = t.user?.access_token;
|
|
437
|
+
m && (l.Authorization = `Bearer ${m}`);
|
|
438
|
+
const c = await fetch("/api/features/microfrontends", { headers: l });
|
|
439
|
+
if (!c.ok)
|
|
440
|
+
throw new Error(`HTTP ${c.status}: ${c.statusText}`);
|
|
441
|
+
const _ = await c.json();
|
|
442
|
+
o(_.microfrontends || []), a(_.totalCount || 0);
|
|
443
|
+
} catch (l) {
|
|
444
|
+
f(l instanceof Error ? l.message : String(l));
|
|
445
|
+
} finally {
|
|
446
|
+
s(!1);
|
|
447
|
+
}
|
|
448
|
+
}, [t.isAuthenticated, t.user?.access_token]);
|
|
449
|
+
return V(() => {
|
|
450
|
+
E();
|
|
451
|
+
}, [E]), {
|
|
452
|
+
microfrontends: r,
|
|
453
|
+
totalCount: u,
|
|
454
|
+
isLoading: d,
|
|
455
|
+
error: x,
|
|
456
|
+
refetch: E
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
var te = { exports: {} }, Y = {};
|
|
460
|
+
var qe;
|
|
461
|
+
function Gt() {
|
|
462
|
+
if (qe) return Y;
|
|
463
|
+
qe = 1;
|
|
464
|
+
var t = Ze, r = /* @__PURE__ */ Symbol.for("react.element"), o = /* @__PURE__ */ Symbol.for("react.fragment"), u = Object.prototype.hasOwnProperty, a = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, d = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
465
|
+
function s(x, f, E) {
|
|
466
|
+
var l, m = {}, c = null, _ = null;
|
|
467
|
+
E !== void 0 && (c = "" + E), f.key !== void 0 && (c = "" + f.key), f.ref !== void 0 && (_ = f.ref);
|
|
468
|
+
for (l in f) u.call(f, l) && !d.hasOwnProperty(l) && (m[l] = f[l]);
|
|
469
|
+
if (x && x.defaultProps) for (l in f = x.defaultProps, f) m[l] === void 0 && (m[l] = f[l]);
|
|
470
|
+
return { $$typeof: r, type: x, key: c, ref: _, props: m, _owner: a.current };
|
|
266
471
|
}
|
|
267
|
-
return
|
|
472
|
+
return Y.Fragment = o, Y.jsx = s, Y.jsxs = s, Y;
|
|
268
473
|
}
|
|
269
|
-
var
|
|
270
|
-
var
|
|
474
|
+
var J = {};
|
|
475
|
+
var Ke;
|
|
271
476
|
function Yt() {
|
|
272
|
-
return
|
|
273
|
-
var t =
|
|
274
|
-
function
|
|
477
|
+
return Ke || (Ke = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
478
|
+
var t = Ze, r = /* @__PURE__ */ Symbol.for("react.element"), o = /* @__PURE__ */ Symbol.for("react.portal"), u = /* @__PURE__ */ Symbol.for("react.fragment"), a = /* @__PURE__ */ Symbol.for("react.strict_mode"), d = /* @__PURE__ */ Symbol.for("react.profiler"), s = /* @__PURE__ */ Symbol.for("react.provider"), x = /* @__PURE__ */ Symbol.for("react.context"), f = /* @__PURE__ */ Symbol.for("react.forward_ref"), E = /* @__PURE__ */ Symbol.for("react.suspense"), l = /* @__PURE__ */ Symbol.for("react.suspense_list"), m = /* @__PURE__ */ Symbol.for("react.memo"), c = /* @__PURE__ */ Symbol.for("react.lazy"), _ = /* @__PURE__ */ Symbol.for("react.offscreen"), w = Symbol.iterator, N = "@@iterator";
|
|
479
|
+
function C(e) {
|
|
275
480
|
if (e === null || typeof e != "object")
|
|
276
481
|
return null;
|
|
277
|
-
var n =
|
|
482
|
+
var n = w && e[w] || e[N];
|
|
278
483
|
return typeof n == "function" ? n : null;
|
|
279
484
|
}
|
|
280
|
-
var
|
|
281
|
-
function
|
|
485
|
+
var b = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
486
|
+
function p(e) {
|
|
282
487
|
{
|
|
283
|
-
for (var n = arguments.length, i = new Array(n > 1 ? n - 1 : 0),
|
|
284
|
-
i[
|
|
285
|
-
|
|
488
|
+
for (var n = arguments.length, i = new Array(n > 1 ? n - 1 : 0), h = 1; h < n; h++)
|
|
489
|
+
i[h - 1] = arguments[h];
|
|
490
|
+
A("error", e, i);
|
|
286
491
|
}
|
|
287
492
|
}
|
|
288
|
-
function
|
|
493
|
+
function A(e, n, i) {
|
|
289
494
|
{
|
|
290
|
-
var
|
|
291
|
-
|
|
292
|
-
var
|
|
293
|
-
return String(
|
|
495
|
+
var h = b.ReactDebugCurrentFrame, S = h.getStackAddendum();
|
|
496
|
+
S !== "" && (n += "%s", i = i.concat([S]));
|
|
497
|
+
var T = i.map(function(y) {
|
|
498
|
+
return String(y);
|
|
294
499
|
});
|
|
295
|
-
|
|
500
|
+
T.unshift("Warning: " + n), Function.prototype.apply.call(console[e], console, T);
|
|
296
501
|
}
|
|
297
502
|
}
|
|
298
|
-
var
|
|
299
|
-
|
|
300
|
-
function
|
|
301
|
-
return !!(typeof e == "string" || typeof e == "function" || e ===
|
|
503
|
+
var P = !1, z = !1, st = !1, at = !1, it = !1, we;
|
|
504
|
+
we = /* @__PURE__ */ Symbol.for("react.module.reference");
|
|
505
|
+
function ut(e) {
|
|
506
|
+
return !!(typeof e == "string" || typeof e == "function" || e === u || e === d || it || e === a || e === E || e === l || at || e === _ || P || z || st || typeof e == "object" && e !== null && (e.$$typeof === c || e.$$typeof === m || e.$$typeof === s || e.$$typeof === x || e.$$typeof === f || // This needs to include all possible module reference object
|
|
302
507
|
// types supported by any Flight configuration anywhere since
|
|
303
508
|
// we don't know which Flight build this will end up being used
|
|
304
509
|
// with.
|
|
305
|
-
e.$$typeof ===
|
|
510
|
+
e.$$typeof === we || e.getModuleId !== void 0));
|
|
306
511
|
}
|
|
307
|
-
function
|
|
308
|
-
var
|
|
309
|
-
if (
|
|
310
|
-
return
|
|
311
|
-
var
|
|
312
|
-
return
|
|
512
|
+
function ct(e, n, i) {
|
|
513
|
+
var h = e.displayName;
|
|
514
|
+
if (h)
|
|
515
|
+
return h;
|
|
516
|
+
var S = n.displayName || n.name || "";
|
|
517
|
+
return S !== "" ? i + "(" + S + ")" : i;
|
|
313
518
|
}
|
|
314
|
-
function
|
|
519
|
+
function be(e) {
|
|
315
520
|
return e.displayName || "Context";
|
|
316
521
|
}
|
|
317
|
-
function
|
|
522
|
+
function $(e) {
|
|
318
523
|
if (e == null)
|
|
319
524
|
return null;
|
|
320
|
-
if (typeof e.tag == "number" &&
|
|
525
|
+
if (typeof e.tag == "number" && p("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
321
526
|
return e.displayName || e.name || null;
|
|
322
527
|
if (typeof e == "string")
|
|
323
528
|
return e;
|
|
324
529
|
switch (e) {
|
|
325
|
-
case
|
|
530
|
+
case u:
|
|
326
531
|
return "Fragment";
|
|
327
532
|
case o:
|
|
328
533
|
return "Portal";
|
|
329
|
-
case
|
|
534
|
+
case d:
|
|
330
535
|
return "Profiler";
|
|
331
|
-
case
|
|
536
|
+
case a:
|
|
332
537
|
return "StrictMode";
|
|
333
538
|
case E:
|
|
334
539
|
return "Suspense";
|
|
335
|
-
case
|
|
540
|
+
case l:
|
|
336
541
|
return "SuspenseList";
|
|
337
542
|
}
|
|
338
543
|
if (typeof e == "object")
|
|
339
544
|
switch (e.$$typeof) {
|
|
340
|
-
case
|
|
545
|
+
case x:
|
|
341
546
|
var n = e;
|
|
342
|
-
return
|
|
343
|
-
case
|
|
547
|
+
return be(n) + ".Consumer";
|
|
548
|
+
case s:
|
|
344
549
|
var i = e;
|
|
345
|
-
return
|
|
346
|
-
case
|
|
347
|
-
return
|
|
348
|
-
case
|
|
349
|
-
var
|
|
350
|
-
return
|
|
351
|
-
case
|
|
352
|
-
var
|
|
550
|
+
return be(i._context) + ".Provider";
|
|
551
|
+
case f:
|
|
552
|
+
return ct(e, e.render, "ForwardRef");
|
|
553
|
+
case m:
|
|
554
|
+
var h = e.displayName || null;
|
|
555
|
+
return h !== null ? h : $(e.type) || "Memo";
|
|
556
|
+
case c: {
|
|
557
|
+
var S = e, T = S._payload, y = S._init;
|
|
353
558
|
try {
|
|
354
|
-
return
|
|
559
|
+
return $(y(T));
|
|
355
560
|
} catch {
|
|
356
561
|
return null;
|
|
357
562
|
}
|
|
@@ -359,18 +564,18 @@ function Yt() {
|
|
|
359
564
|
}
|
|
360
565
|
return null;
|
|
361
566
|
}
|
|
362
|
-
var
|
|
363
|
-
function
|
|
567
|
+
var L = Object.assign, W = 0, xe, Se, Ae, Te, Re, Ce, Ie;
|
|
568
|
+
function ke() {
|
|
364
569
|
}
|
|
365
|
-
|
|
366
|
-
function
|
|
570
|
+
ke.__reactDisabledLog = !0;
|
|
571
|
+
function lt() {
|
|
367
572
|
{
|
|
368
|
-
if (
|
|
369
|
-
|
|
573
|
+
if (W === 0) {
|
|
574
|
+
xe = console.log, Se = console.info, Ae = console.warn, Te = console.error, Re = console.group, Ce = console.groupCollapsed, Ie = console.groupEnd;
|
|
370
575
|
var e = {
|
|
371
576
|
configurable: !0,
|
|
372
577
|
enumerable: !0,
|
|
373
|
-
value:
|
|
578
|
+
value: ke,
|
|
374
579
|
writable: !0
|
|
375
580
|
};
|
|
376
581
|
Object.defineProperties(console, {
|
|
@@ -383,250 +588,250 @@ function Yt() {
|
|
|
383
588
|
groupEnd: e
|
|
384
589
|
});
|
|
385
590
|
}
|
|
386
|
-
|
|
591
|
+
W++;
|
|
387
592
|
}
|
|
388
593
|
}
|
|
389
|
-
function
|
|
594
|
+
function ft() {
|
|
390
595
|
{
|
|
391
|
-
if (
|
|
596
|
+
if (W--, W === 0) {
|
|
392
597
|
var e = {
|
|
393
598
|
configurable: !0,
|
|
394
599
|
enumerable: !0,
|
|
395
600
|
writable: !0
|
|
396
601
|
};
|
|
397
602
|
Object.defineProperties(console, {
|
|
398
|
-
log:
|
|
399
|
-
value: ye
|
|
400
|
-
}),
|
|
401
|
-
info: F({}, e, {
|
|
402
|
-
value: we
|
|
403
|
-
}),
|
|
404
|
-
warn: F({}, e, {
|
|
603
|
+
log: L({}, e, {
|
|
405
604
|
value: xe
|
|
406
605
|
}),
|
|
407
|
-
|
|
408
|
-
value: be
|
|
409
|
-
}),
|
|
410
|
-
group: F({}, e, {
|
|
606
|
+
info: L({}, e, {
|
|
411
607
|
value: Se
|
|
412
608
|
}),
|
|
413
|
-
|
|
609
|
+
warn: L({}, e, {
|
|
610
|
+
value: Ae
|
|
611
|
+
}),
|
|
612
|
+
error: L({}, e, {
|
|
613
|
+
value: Te
|
|
614
|
+
}),
|
|
615
|
+
group: L({}, e, {
|
|
414
616
|
value: Re
|
|
415
617
|
}),
|
|
416
|
-
|
|
417
|
-
value:
|
|
618
|
+
groupCollapsed: L({}, e, {
|
|
619
|
+
value: Ce
|
|
620
|
+
}),
|
|
621
|
+
groupEnd: L({}, e, {
|
|
622
|
+
value: Ie
|
|
418
623
|
})
|
|
419
624
|
});
|
|
420
625
|
}
|
|
421
|
-
|
|
626
|
+
W < 0 && p("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
422
627
|
}
|
|
423
628
|
}
|
|
424
|
-
var
|
|
425
|
-
function
|
|
629
|
+
var ae = b.ReactCurrentDispatcher, ie;
|
|
630
|
+
function K(e, n, i) {
|
|
426
631
|
{
|
|
427
|
-
if (
|
|
632
|
+
if (ie === void 0)
|
|
428
633
|
try {
|
|
429
634
|
throw Error();
|
|
430
|
-
} catch (
|
|
431
|
-
var
|
|
432
|
-
|
|
635
|
+
} catch (S) {
|
|
636
|
+
var h = S.stack.trim().match(/\n( *(at )?)/);
|
|
637
|
+
ie = h && h[1] || "";
|
|
433
638
|
}
|
|
434
639
|
return `
|
|
435
|
-
` +
|
|
640
|
+
` + ie + e;
|
|
436
641
|
}
|
|
437
642
|
}
|
|
438
|
-
var
|
|
643
|
+
var ue = !1, X;
|
|
439
644
|
{
|
|
440
|
-
var
|
|
441
|
-
|
|
645
|
+
var dt = typeof WeakMap == "function" ? WeakMap : Map;
|
|
646
|
+
X = new dt();
|
|
442
647
|
}
|
|
443
648
|
function Me(e, n) {
|
|
444
|
-
if (!e ||
|
|
649
|
+
if (!e || ue)
|
|
445
650
|
return "";
|
|
446
651
|
{
|
|
447
|
-
var i =
|
|
652
|
+
var i = X.get(e);
|
|
448
653
|
if (i !== void 0)
|
|
449
654
|
return i;
|
|
450
655
|
}
|
|
451
|
-
var
|
|
452
|
-
|
|
453
|
-
var
|
|
656
|
+
var h;
|
|
657
|
+
ue = !0;
|
|
658
|
+
var S = Error.prepareStackTrace;
|
|
454
659
|
Error.prepareStackTrace = void 0;
|
|
455
|
-
var
|
|
456
|
-
|
|
660
|
+
var T;
|
|
661
|
+
T = ae.current, ae.current = null, lt();
|
|
457
662
|
try {
|
|
458
663
|
if (n) {
|
|
459
|
-
var
|
|
664
|
+
var y = function() {
|
|
460
665
|
throw Error();
|
|
461
666
|
};
|
|
462
|
-
if (Object.defineProperty(
|
|
667
|
+
if (Object.defineProperty(y.prototype, "props", {
|
|
463
668
|
set: function() {
|
|
464
669
|
throw Error();
|
|
465
670
|
}
|
|
466
671
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
467
672
|
try {
|
|
468
|
-
Reflect.construct(
|
|
469
|
-
} catch (
|
|
470
|
-
|
|
673
|
+
Reflect.construct(y, []);
|
|
674
|
+
} catch (O) {
|
|
675
|
+
h = O;
|
|
471
676
|
}
|
|
472
|
-
Reflect.construct(e, [],
|
|
677
|
+
Reflect.construct(e, [], y);
|
|
473
678
|
} else {
|
|
474
679
|
try {
|
|
475
|
-
|
|
476
|
-
} catch (
|
|
477
|
-
|
|
680
|
+
y.call();
|
|
681
|
+
} catch (O) {
|
|
682
|
+
h = O;
|
|
478
683
|
}
|
|
479
|
-
e.call(
|
|
684
|
+
e.call(y.prototype);
|
|
480
685
|
}
|
|
481
686
|
} else {
|
|
482
687
|
try {
|
|
483
688
|
throw Error();
|
|
484
|
-
} catch (
|
|
485
|
-
|
|
689
|
+
} catch (O) {
|
|
690
|
+
h = O;
|
|
486
691
|
}
|
|
487
692
|
e();
|
|
488
693
|
}
|
|
489
|
-
} catch (
|
|
490
|
-
if (
|
|
491
|
-
for (var
|
|
492
|
-
`),
|
|
493
|
-
`),
|
|
494
|
-
|
|
495
|
-
for (;
|
|
496
|
-
if (
|
|
497
|
-
if (
|
|
694
|
+
} catch (O) {
|
|
695
|
+
if (O && h && typeof O.stack == "string") {
|
|
696
|
+
for (var v = O.stack.split(`
|
|
697
|
+
`), j = h.stack.split(`
|
|
698
|
+
`), I = v.length - 1, M = j.length - 1; I >= 1 && M >= 0 && v[I] !== j[M]; )
|
|
699
|
+
M--;
|
|
700
|
+
for (; I >= 1 && M >= 0; I--, M--)
|
|
701
|
+
if (v[I] !== j[M]) {
|
|
702
|
+
if (I !== 1 || M !== 1)
|
|
498
703
|
do
|
|
499
|
-
if (
|
|
500
|
-
var
|
|
501
|
-
` +
|
|
502
|
-
return e.displayName &&
|
|
704
|
+
if (I--, M--, M < 0 || v[I] !== j[M]) {
|
|
705
|
+
var F = `
|
|
706
|
+
` + v[I].replace(" at new ", " at ");
|
|
707
|
+
return e.displayName && F.includes("<anonymous>") && (F = F.replace("<anonymous>", e.displayName)), typeof e == "function" && X.set(e, F), F;
|
|
503
708
|
}
|
|
504
|
-
while (
|
|
709
|
+
while (I >= 1 && M >= 0);
|
|
505
710
|
break;
|
|
506
711
|
}
|
|
507
712
|
}
|
|
508
713
|
} finally {
|
|
509
|
-
|
|
714
|
+
ue = !1, ae.current = T, ft(), Error.prepareStackTrace = S;
|
|
510
715
|
}
|
|
511
|
-
var
|
|
512
|
-
return typeof e == "function" &&
|
|
716
|
+
var H = e ? e.displayName || e.name : "", U = H ? K(H) : "";
|
|
717
|
+
return typeof e == "function" && X.set(e, U), U;
|
|
513
718
|
}
|
|
514
|
-
function
|
|
719
|
+
function pt(e, n, i) {
|
|
515
720
|
return Me(e, !1);
|
|
516
721
|
}
|
|
517
|
-
function
|
|
722
|
+
function ht(e) {
|
|
518
723
|
var n = e.prototype;
|
|
519
724
|
return !!(n && n.isReactComponent);
|
|
520
725
|
}
|
|
521
|
-
function
|
|
726
|
+
function Z(e, n, i) {
|
|
522
727
|
if (e == null)
|
|
523
728
|
return "";
|
|
524
729
|
if (typeof e == "function")
|
|
525
|
-
return Me(e,
|
|
730
|
+
return Me(e, ht(e));
|
|
526
731
|
if (typeof e == "string")
|
|
527
|
-
return
|
|
732
|
+
return K(e);
|
|
528
733
|
switch (e) {
|
|
529
734
|
case E:
|
|
530
|
-
return
|
|
531
|
-
case
|
|
532
|
-
return
|
|
735
|
+
return K("Suspense");
|
|
736
|
+
case l:
|
|
737
|
+
return K("SuspenseList");
|
|
533
738
|
}
|
|
534
739
|
if (typeof e == "object")
|
|
535
740
|
switch (e.$$typeof) {
|
|
536
|
-
case
|
|
537
|
-
return
|
|
538
|
-
case
|
|
539
|
-
return
|
|
540
|
-
case
|
|
541
|
-
var
|
|
741
|
+
case f:
|
|
742
|
+
return pt(e.render);
|
|
743
|
+
case m:
|
|
744
|
+
return Z(e.type, n, i);
|
|
745
|
+
case c: {
|
|
746
|
+
var h = e, S = h._payload, T = h._init;
|
|
542
747
|
try {
|
|
543
|
-
return
|
|
748
|
+
return Z(T(S), n, i);
|
|
544
749
|
} catch {
|
|
545
750
|
}
|
|
546
751
|
}
|
|
547
752
|
}
|
|
548
753
|
return "";
|
|
549
754
|
}
|
|
550
|
-
var
|
|
551
|
-
function
|
|
755
|
+
var G = Object.prototype.hasOwnProperty, Ne = {}, je = b.ReactDebugCurrentFrame;
|
|
756
|
+
function Q(e) {
|
|
552
757
|
if (e) {
|
|
553
|
-
var n = e._owner, i =
|
|
554
|
-
|
|
758
|
+
var n = e._owner, i = Z(e.type, e._source, n ? n.type : null);
|
|
759
|
+
je.setExtraStackFrame(i);
|
|
555
760
|
} else
|
|
556
|
-
|
|
761
|
+
je.setExtraStackFrame(null);
|
|
557
762
|
}
|
|
558
|
-
function gt(e, n, i,
|
|
763
|
+
function gt(e, n, i, h, S) {
|
|
559
764
|
{
|
|
560
|
-
var
|
|
561
|
-
for (var
|
|
562
|
-
if (
|
|
563
|
-
var
|
|
765
|
+
var T = Function.call.bind(G);
|
|
766
|
+
for (var y in e)
|
|
767
|
+
if (T(e, y)) {
|
|
768
|
+
var v = void 0;
|
|
564
769
|
try {
|
|
565
|
-
if (typeof e[
|
|
566
|
-
var
|
|
567
|
-
throw
|
|
770
|
+
if (typeof e[y] != "function") {
|
|
771
|
+
var j = Error((h || "React class") + ": " + i + " type `" + y + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[y] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
772
|
+
throw j.name = "Invariant Violation", j;
|
|
568
773
|
}
|
|
569
|
-
|
|
570
|
-
} catch (
|
|
571
|
-
|
|
774
|
+
v = e[y](n, y, h, i, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
775
|
+
} catch (I) {
|
|
776
|
+
v = I;
|
|
572
777
|
}
|
|
573
|
-
|
|
778
|
+
v && !(v instanceof Error) && (Q(S), p("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", h || "React class", i, y, typeof v), Q(null)), v instanceof Error && !(v.message in Ne) && (Ne[v.message] = !0, Q(S), p("Failed %s type: %s", i, v.message), Q(null));
|
|
574
779
|
}
|
|
575
780
|
}
|
|
576
781
|
}
|
|
577
782
|
var mt = Array.isArray;
|
|
578
|
-
function
|
|
783
|
+
function ce(e) {
|
|
579
784
|
return mt(e);
|
|
580
785
|
}
|
|
581
|
-
function
|
|
786
|
+
function _t(e) {
|
|
582
787
|
{
|
|
583
788
|
var n = typeof Symbol == "function" && Symbol.toStringTag, i = n && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
584
789
|
return i;
|
|
585
790
|
}
|
|
586
791
|
}
|
|
587
|
-
function
|
|
792
|
+
function vt(e) {
|
|
588
793
|
try {
|
|
589
|
-
return
|
|
794
|
+
return Oe(e), !1;
|
|
590
795
|
} catch {
|
|
591
796
|
return !0;
|
|
592
797
|
}
|
|
593
798
|
}
|
|
594
|
-
function
|
|
799
|
+
function Oe(e) {
|
|
595
800
|
return "" + e;
|
|
596
801
|
}
|
|
597
|
-
function
|
|
598
|
-
if (
|
|
599
|
-
return
|
|
802
|
+
function Pe(e) {
|
|
803
|
+
if (vt(e))
|
|
804
|
+
return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", _t(e)), Oe(e);
|
|
600
805
|
}
|
|
601
|
-
var
|
|
806
|
+
var Fe = b.ReactCurrentOwner, Et = {
|
|
602
807
|
key: !0,
|
|
603
808
|
ref: !0,
|
|
604
809
|
__self: !0,
|
|
605
810
|
__source: !0
|
|
606
|
-
},
|
|
607
|
-
function
|
|
608
|
-
if (
|
|
811
|
+
}, De, $e;
|
|
812
|
+
function yt(e) {
|
|
813
|
+
if (G.call(e, "ref")) {
|
|
609
814
|
var n = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
610
815
|
if (n && n.isReactWarning)
|
|
611
816
|
return !1;
|
|
612
817
|
}
|
|
613
818
|
return e.ref !== void 0;
|
|
614
819
|
}
|
|
615
|
-
function
|
|
616
|
-
if (
|
|
820
|
+
function wt(e) {
|
|
821
|
+
if (G.call(e, "key")) {
|
|
617
822
|
var n = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
618
823
|
if (n && n.isReactWarning)
|
|
619
824
|
return !1;
|
|
620
825
|
}
|
|
621
826
|
return e.key !== void 0;
|
|
622
827
|
}
|
|
623
|
-
function
|
|
624
|
-
typeof e.ref == "string" &&
|
|
828
|
+
function bt(e, n) {
|
|
829
|
+
typeof e.ref == "string" && Fe.current;
|
|
625
830
|
}
|
|
626
831
|
function xt(e, n) {
|
|
627
832
|
{
|
|
628
833
|
var i = function() {
|
|
629
|
-
|
|
834
|
+
De || (De = !0, p("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n));
|
|
630
835
|
};
|
|
631
836
|
i.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
632
837
|
get: i,
|
|
@@ -634,10 +839,10 @@ function Yt() {
|
|
|
634
839
|
});
|
|
635
840
|
}
|
|
636
841
|
}
|
|
637
|
-
function
|
|
842
|
+
function St(e, n) {
|
|
638
843
|
{
|
|
639
844
|
var i = function() {
|
|
640
|
-
|
|
845
|
+
$e || ($e = !0, p("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n));
|
|
641
846
|
};
|
|
642
847
|
i.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
643
848
|
get: i,
|
|
@@ -645,70 +850,70 @@ function Yt() {
|
|
|
645
850
|
});
|
|
646
851
|
}
|
|
647
852
|
}
|
|
648
|
-
var
|
|
649
|
-
var
|
|
853
|
+
var At = function(e, n, i, h, S, T, y) {
|
|
854
|
+
var v = {
|
|
650
855
|
// This tag allows us to uniquely identify this as a React Element
|
|
651
856
|
$$typeof: r,
|
|
652
857
|
// Built-in properties that belong on the element
|
|
653
858
|
type: e,
|
|
654
859
|
key: n,
|
|
655
860
|
ref: i,
|
|
656
|
-
props:
|
|
861
|
+
props: y,
|
|
657
862
|
// Record the component responsible for creating this element.
|
|
658
|
-
_owner:
|
|
863
|
+
_owner: T
|
|
659
864
|
};
|
|
660
|
-
return
|
|
865
|
+
return v._store = {}, Object.defineProperty(v._store, "validated", {
|
|
661
866
|
configurable: !1,
|
|
662
867
|
enumerable: !1,
|
|
663
868
|
writable: !0,
|
|
664
869
|
value: !1
|
|
665
|
-
}), Object.defineProperty(
|
|
870
|
+
}), Object.defineProperty(v, "_self", {
|
|
666
871
|
configurable: !1,
|
|
667
872
|
enumerable: !1,
|
|
668
873
|
writable: !1,
|
|
669
|
-
value:
|
|
670
|
-
}), Object.defineProperty(
|
|
874
|
+
value: h
|
|
875
|
+
}), Object.defineProperty(v, "_source", {
|
|
671
876
|
configurable: !1,
|
|
672
877
|
enumerable: !1,
|
|
673
878
|
writable: !1,
|
|
674
|
-
value:
|
|
675
|
-
}), Object.freeze && (Object.freeze(
|
|
879
|
+
value: S
|
|
880
|
+
}), Object.freeze && (Object.freeze(v.props), Object.freeze(v)), v;
|
|
676
881
|
};
|
|
677
|
-
function
|
|
882
|
+
function Tt(e, n, i, h, S) {
|
|
678
883
|
{
|
|
679
|
-
var
|
|
680
|
-
i !== void 0 && (
|
|
681
|
-
for (
|
|
682
|
-
|
|
884
|
+
var T, y = {}, v = null, j = null;
|
|
885
|
+
i !== void 0 && (Pe(i), v = "" + i), wt(n) && (Pe(n.key), v = "" + n.key), yt(n) && (j = n.ref, bt(n, S));
|
|
886
|
+
for (T in n)
|
|
887
|
+
G.call(n, T) && !Et.hasOwnProperty(T) && (y[T] = n[T]);
|
|
683
888
|
if (e && e.defaultProps) {
|
|
684
|
-
var
|
|
685
|
-
for (
|
|
686
|
-
|
|
889
|
+
var I = e.defaultProps;
|
|
890
|
+
for (T in I)
|
|
891
|
+
y[T] === void 0 && (y[T] = I[T]);
|
|
687
892
|
}
|
|
688
|
-
if (
|
|
689
|
-
var
|
|
690
|
-
|
|
893
|
+
if (v || j) {
|
|
894
|
+
var M = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
895
|
+
v && xt(y, M), j && St(y, M);
|
|
691
896
|
}
|
|
692
|
-
return
|
|
897
|
+
return At(e, v, j, S, h, Fe.current, y);
|
|
693
898
|
}
|
|
694
899
|
}
|
|
695
|
-
var
|
|
696
|
-
function
|
|
900
|
+
var le = b.ReactCurrentOwner, Le = b.ReactDebugCurrentFrame;
|
|
901
|
+
function B(e) {
|
|
697
902
|
if (e) {
|
|
698
|
-
var n = e._owner, i =
|
|
699
|
-
|
|
903
|
+
var n = e._owner, i = Z(e.type, e._source, n ? n.type : null);
|
|
904
|
+
Le.setExtraStackFrame(i);
|
|
700
905
|
} else
|
|
701
|
-
|
|
906
|
+
Le.setExtraStackFrame(null);
|
|
702
907
|
}
|
|
703
|
-
var
|
|
704
|
-
|
|
705
|
-
function
|
|
908
|
+
var fe;
|
|
909
|
+
fe = !1;
|
|
910
|
+
function de(e) {
|
|
706
911
|
return typeof e == "object" && e !== null && e.$$typeof === r;
|
|
707
912
|
}
|
|
708
|
-
function
|
|
913
|
+
function Ue() {
|
|
709
914
|
{
|
|
710
|
-
if (
|
|
711
|
-
var e =
|
|
915
|
+
if (le.current) {
|
|
916
|
+
var e = $(le.current.type);
|
|
712
917
|
if (e)
|
|
713
918
|
return `
|
|
714
919
|
|
|
@@ -717,13 +922,13 @@ Check the render method of \`` + e + "`.";
|
|
|
717
922
|
return "";
|
|
718
923
|
}
|
|
719
924
|
}
|
|
720
|
-
function
|
|
925
|
+
function Rt(e) {
|
|
721
926
|
return "";
|
|
722
927
|
}
|
|
723
|
-
var
|
|
724
|
-
function
|
|
928
|
+
var Ve = {};
|
|
929
|
+
function Ct(e) {
|
|
725
930
|
{
|
|
726
|
-
var n =
|
|
931
|
+
var n = Ue();
|
|
727
932
|
if (!n) {
|
|
728
933
|
var i = typeof e == "string" ? e : e.displayName || e.name;
|
|
729
934
|
i && (n = `
|
|
@@ -733,39 +938,39 @@ Check the top-level render call using <` + i + ">.");
|
|
|
733
938
|
return n;
|
|
734
939
|
}
|
|
735
940
|
}
|
|
736
|
-
function
|
|
941
|
+
function Be(e, n) {
|
|
737
942
|
{
|
|
738
943
|
if (!e._store || e._store.validated || e.key != null)
|
|
739
944
|
return;
|
|
740
945
|
e._store.validated = !0;
|
|
741
|
-
var i =
|
|
742
|
-
if (
|
|
946
|
+
var i = Ct(n);
|
|
947
|
+
if (Ve[i])
|
|
743
948
|
return;
|
|
744
|
-
|
|
745
|
-
var
|
|
746
|
-
e && e._owner && e._owner !==
|
|
949
|
+
Ve[i] = !0;
|
|
950
|
+
var h = "";
|
|
951
|
+
e && e._owner && e._owner !== le.current && (h = " It was passed a child from " + $(e._owner.type) + "."), B(e), p('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', i, h), B(null);
|
|
747
952
|
}
|
|
748
953
|
}
|
|
749
|
-
function
|
|
954
|
+
function He(e, n) {
|
|
750
955
|
{
|
|
751
956
|
if (typeof e != "object")
|
|
752
957
|
return;
|
|
753
|
-
if (
|
|
958
|
+
if (ce(e))
|
|
754
959
|
for (var i = 0; i < e.length; i++) {
|
|
755
|
-
var
|
|
756
|
-
|
|
960
|
+
var h = e[i];
|
|
961
|
+
de(h) && Be(h, n);
|
|
757
962
|
}
|
|
758
|
-
else if (
|
|
963
|
+
else if (de(e))
|
|
759
964
|
e._store && (e._store.validated = !0);
|
|
760
965
|
else if (e) {
|
|
761
|
-
var
|
|
762
|
-
if (typeof
|
|
763
|
-
for (var
|
|
764
|
-
|
|
966
|
+
var S = C(e);
|
|
967
|
+
if (typeof S == "function" && S !== e.entries)
|
|
968
|
+
for (var T = S.call(e), y; !(y = T.next()).done; )
|
|
969
|
+
de(y.value) && Be(y.value, n);
|
|
765
970
|
}
|
|
766
971
|
}
|
|
767
972
|
}
|
|
768
|
-
function
|
|
973
|
+
function It(e) {
|
|
769
974
|
{
|
|
770
975
|
var n = e.type;
|
|
771
976
|
if (n == null || typeof n == "string")
|
|
@@ -773,105 +978,105 @@ Check the top-level render call using <` + i + ">.");
|
|
|
773
978
|
var i;
|
|
774
979
|
if (typeof n == "function")
|
|
775
980
|
i = n.propTypes;
|
|
776
|
-
else if (typeof n == "object" && (n.$$typeof ===
|
|
981
|
+
else if (typeof n == "object" && (n.$$typeof === f || // Note: Memo only checks outer props here.
|
|
777
982
|
// Inner props are checked in the reconciler.
|
|
778
|
-
n.$$typeof ===
|
|
983
|
+
n.$$typeof === m))
|
|
779
984
|
i = n.propTypes;
|
|
780
985
|
else
|
|
781
986
|
return;
|
|
782
987
|
if (i) {
|
|
783
|
-
var
|
|
784
|
-
gt(i, e.props, "prop",
|
|
785
|
-
} else if (n.PropTypes !== void 0 && !
|
|
786
|
-
|
|
787
|
-
var
|
|
788
|
-
|
|
988
|
+
var h = $(n);
|
|
989
|
+
gt(i, e.props, "prop", h, e);
|
|
990
|
+
} else if (n.PropTypes !== void 0 && !fe) {
|
|
991
|
+
fe = !0;
|
|
992
|
+
var S = $(n);
|
|
993
|
+
p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", S || "Unknown");
|
|
789
994
|
}
|
|
790
|
-
typeof n.getDefaultProps == "function" && !n.getDefaultProps.isReactClassApproved &&
|
|
995
|
+
typeof n.getDefaultProps == "function" && !n.getDefaultProps.isReactClassApproved && p("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
791
996
|
}
|
|
792
997
|
}
|
|
793
|
-
function
|
|
998
|
+
function kt(e) {
|
|
794
999
|
{
|
|
795
1000
|
for (var n = Object.keys(e.props), i = 0; i < n.length; i++) {
|
|
796
|
-
var
|
|
797
|
-
if (
|
|
798
|
-
|
|
1001
|
+
var h = n[i];
|
|
1002
|
+
if (h !== "children" && h !== "key") {
|
|
1003
|
+
B(e), p("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", h), B(null);
|
|
799
1004
|
break;
|
|
800
1005
|
}
|
|
801
1006
|
}
|
|
802
|
-
e.ref !== null && (
|
|
1007
|
+
e.ref !== null && (B(e), p("Invalid attribute `ref` supplied to `React.Fragment`."), B(null));
|
|
803
1008
|
}
|
|
804
1009
|
}
|
|
805
|
-
var
|
|
806
|
-
function We(e, n, i,
|
|
1010
|
+
var ze = {};
|
|
1011
|
+
function We(e, n, i, h, S, T) {
|
|
807
1012
|
{
|
|
808
|
-
var
|
|
809
|
-
if (!
|
|
810
|
-
var
|
|
811
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (
|
|
812
|
-
var
|
|
813
|
-
|
|
814
|
-
var
|
|
815
|
-
e === null ?
|
|
1013
|
+
var y = ut(e);
|
|
1014
|
+
if (!y) {
|
|
1015
|
+
var v = "";
|
|
1016
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (v += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
1017
|
+
var j = Rt();
|
|
1018
|
+
j ? v += j : v += Ue();
|
|
1019
|
+
var I;
|
|
1020
|
+
e === null ? I = "null" : ce(e) ? I = "array" : e !== void 0 && e.$$typeof === r ? (I = "<" + ($(e.type) || "Unknown") + " />", v = " Did you accidentally export a JSX literal instead of a component?") : I = typeof e, p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", I, v);
|
|
816
1021
|
}
|
|
817
|
-
var
|
|
818
|
-
if (
|
|
819
|
-
return
|
|
820
|
-
if (
|
|
821
|
-
var
|
|
822
|
-
if (
|
|
823
|
-
if (
|
|
824
|
-
if (
|
|
825
|
-
for (var
|
|
826
|
-
|
|
827
|
-
Object.freeze && Object.freeze(
|
|
1022
|
+
var M = Tt(e, n, i, S, T);
|
|
1023
|
+
if (M == null)
|
|
1024
|
+
return M;
|
|
1025
|
+
if (y) {
|
|
1026
|
+
var F = n.children;
|
|
1027
|
+
if (F !== void 0)
|
|
1028
|
+
if (h)
|
|
1029
|
+
if (ce(F)) {
|
|
1030
|
+
for (var H = 0; H < F.length; H++)
|
|
1031
|
+
He(F[H], e);
|
|
1032
|
+
Object.freeze && Object.freeze(F);
|
|
828
1033
|
} else
|
|
829
|
-
|
|
1034
|
+
p("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
830
1035
|
else
|
|
831
|
-
|
|
1036
|
+
He(F, e);
|
|
832
1037
|
}
|
|
833
|
-
if (
|
|
834
|
-
var
|
|
835
|
-
return
|
|
836
|
-
}),
|
|
837
|
-
if (!
|
|
838
|
-
var
|
|
839
|
-
|
|
1038
|
+
if (G.call(n, "key")) {
|
|
1039
|
+
var U = $(e), O = Object.keys(n).filter(function(Ft) {
|
|
1040
|
+
return Ft !== "key";
|
|
1041
|
+
}), pe = O.length > 0 ? "{key: someKey, " + O.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
1042
|
+
if (!ze[U + pe]) {
|
|
1043
|
+
var Pt = O.length > 0 ? "{" + O.join(": ..., ") + ": ...}" : "{}";
|
|
1044
|
+
p(`A props object containing a "key" prop is being spread into JSX:
|
|
840
1045
|
let props = %s;
|
|
841
1046
|
<%s {...props} />
|
|
842
1047
|
React keys must be passed directly to JSX without using spread:
|
|
843
1048
|
let props = %s;
|
|
844
|
-
<%s key={someKey} {...props} />`,
|
|
1049
|
+
<%s key={someKey} {...props} />`, pe, U, Pt, U), ze[U + pe] = !0;
|
|
845
1050
|
}
|
|
846
1051
|
}
|
|
847
|
-
return e ===
|
|
1052
|
+
return e === u ? kt(M) : It(M), M;
|
|
848
1053
|
}
|
|
849
1054
|
}
|
|
850
|
-
function
|
|
1055
|
+
function Mt(e, n, i) {
|
|
851
1056
|
return We(e, n, i, !0);
|
|
852
1057
|
}
|
|
853
1058
|
function Nt(e, n, i) {
|
|
854
1059
|
return We(e, n, i, !1);
|
|
855
1060
|
}
|
|
856
|
-
var
|
|
857
|
-
|
|
858
|
-
})()),
|
|
1061
|
+
var jt = Nt, Ot = Mt;
|
|
1062
|
+
J.Fragment = u, J.jsx = jt, J.jsxs = Ot;
|
|
1063
|
+
})()), J;
|
|
859
1064
|
}
|
|
860
|
-
var
|
|
1065
|
+
var Xe;
|
|
861
1066
|
function Jt() {
|
|
862
|
-
return
|
|
1067
|
+
return Xe || (Xe = 1, process.env.NODE_ENV === "production" ? te.exports = Gt() : te.exports = Yt()), te.exports;
|
|
863
1068
|
}
|
|
864
|
-
var
|
|
865
|
-
const
|
|
1069
|
+
var g = Jt();
|
|
1070
|
+
const et = "platform-kit", qt = !1, me = {
|
|
866
1071
|
log: (...t) => {
|
|
867
1072
|
},
|
|
868
1073
|
warn: (...t) => {
|
|
869
1074
|
},
|
|
870
1075
|
error: (...t) => {
|
|
871
|
-
console.error(`[${
|
|
1076
|
+
console.error(`[${et}]`, ...t);
|
|
872
1077
|
}
|
|
873
1078
|
};
|
|
874
|
-
class
|
|
1079
|
+
class dr extends $t {
|
|
875
1080
|
hasDispatched = !1;
|
|
876
1081
|
constructor(r) {
|
|
877
1082
|
super(r), this.state = { hasError: !1 };
|
|
@@ -885,7 +1090,7 @@ class ur extends Ft {
|
|
|
885
1090
|
const r = window;
|
|
886
1091
|
if (r.__MF_NAME__) return r.__MF_NAME__;
|
|
887
1092
|
}
|
|
888
|
-
return
|
|
1093
|
+
return et;
|
|
889
1094
|
}
|
|
890
1095
|
/**
|
|
891
1096
|
* Определить нужно ли показывать детали ошибки
|
|
@@ -911,12 +1116,12 @@ class ur extends Ft {
|
|
|
911
1116
|
dispatchError(r, o) {
|
|
912
1117
|
if (this.hasDispatched || typeof window > "u") return;
|
|
913
1118
|
this.hasDispatched = !0;
|
|
914
|
-
const
|
|
915
|
-
|
|
1119
|
+
const u = this.getMfeName();
|
|
1120
|
+
me.error("ErrorBoundary caught:", r);
|
|
916
1121
|
try {
|
|
917
1122
|
window.dispatchEvent(new CustomEvent("mfe-error", {
|
|
918
1123
|
detail: {
|
|
919
|
-
mfeName:
|
|
1124
|
+
mfeName: u,
|
|
920
1125
|
error: r.message || String(r),
|
|
921
1126
|
stack: r.stack,
|
|
922
1127
|
componentStack: o?.componentStack,
|
|
@@ -924,8 +1129,8 @@ class ur extends Ft {
|
|
|
924
1129
|
},
|
|
925
1130
|
bubbles: !0
|
|
926
1131
|
}));
|
|
927
|
-
} catch (
|
|
928
|
-
|
|
1132
|
+
} catch (a) {
|
|
1133
|
+
me.error("Failed to dispatch mfe-error event:", a);
|
|
929
1134
|
}
|
|
930
1135
|
}
|
|
931
1136
|
/**
|
|
@@ -938,7 +1143,7 @@ class ur extends Ft {
|
|
|
938
1143
|
* Обработать ошибку
|
|
939
1144
|
*/
|
|
940
1145
|
componentDidCatch(r, o) {
|
|
941
|
-
this.dispatchError(r, o),
|
|
1146
|
+
this.dispatchError(r, o), me.error("Error info:", o.componentStack);
|
|
942
1147
|
}
|
|
943
1148
|
/**
|
|
944
1149
|
* Копировать ошибку в буфер обмена
|
|
@@ -970,8 +1175,8 @@ ${this.state.error?.stack}`;
|
|
|
970
1175
|
*/
|
|
971
1176
|
render() {
|
|
972
1177
|
if (this.state.hasError) {
|
|
973
|
-
const r = this.state.error?.message || "Unknown error", o = this.state.error?.stack || "",
|
|
974
|
-
return /* @__PURE__ */
|
|
1178
|
+
const r = this.state.error?.message || "Unknown error", o = this.state.error?.stack || "", u = this.shouldShowDetails(), a = this.getMfeName();
|
|
1179
|
+
return /* @__PURE__ */ g.jsxs("div", { style: {
|
|
975
1180
|
padding: "20px",
|
|
976
1181
|
textAlign: "center",
|
|
977
1182
|
color: "#d32f2f",
|
|
@@ -981,12 +1186,12 @@ ${this.state.error?.stack}`;
|
|
|
981
1186
|
borderRadius: "4px",
|
|
982
1187
|
margin: "10px"
|
|
983
1188
|
}, children: [
|
|
984
|
-
/* @__PURE__ */
|
|
1189
|
+
/* @__PURE__ */ g.jsxs("h2", { style: { fontSize: "16px", margin: "0 0 8px 0" }, children: [
|
|
985
1190
|
"⚠️ Ошибка в ",
|
|
986
|
-
|
|
1191
|
+
a
|
|
987
1192
|
] }),
|
|
988
|
-
/* @__PURE__ */
|
|
989
|
-
|
|
1193
|
+
/* @__PURE__ */ g.jsx("p", { style: { fontSize: "12px", margin: 0 }, children: "Произошла ошибка в микрофронтенде. Сообщение отправлено в shell." }),
|
|
1194
|
+
u && /* @__PURE__ */ g.jsxs("details", { style: {
|
|
990
1195
|
whiteSpace: "pre-wrap",
|
|
991
1196
|
textAlign: "left",
|
|
992
1197
|
marginTop: "10px",
|
|
@@ -994,8 +1199,8 @@ ${this.state.error?.stack}`;
|
|
|
994
1199
|
padding: "8px",
|
|
995
1200
|
borderRadius: "4px"
|
|
996
1201
|
}, children: [
|
|
997
|
-
/* @__PURE__ */
|
|
998
|
-
/* @__PURE__ */
|
|
1202
|
+
/* @__PURE__ */ g.jsx("summary", { style: { cursor: "pointer", fontWeight: "bold" }, children: "Детали ошибки" }),
|
|
1203
|
+
/* @__PURE__ */ g.jsxs("pre", { style: {
|
|
999
1204
|
fontSize: "11px",
|
|
1000
1205
|
overflow: "auto",
|
|
1001
1206
|
maxHeight: "150px",
|
|
@@ -1010,8 +1215,8 @@ ${this.state.error?.stack}`;
|
|
|
1010
1215
|
${o}`
|
|
1011
1216
|
] })
|
|
1012
1217
|
] }),
|
|
1013
|
-
/* @__PURE__ */
|
|
1014
|
-
/* @__PURE__ */
|
|
1218
|
+
/* @__PURE__ */ g.jsxs("div", { style: { marginTop: "12px", display: "flex", gap: "8px", justifyContent: "center" }, children: [
|
|
1219
|
+
/* @__PURE__ */ g.jsx(
|
|
1015
1220
|
"button",
|
|
1016
1221
|
{
|
|
1017
1222
|
onClick: this.handleCopy,
|
|
@@ -1026,7 +1231,7 @@ ${o}`
|
|
|
1026
1231
|
children: "📋 Копировать"
|
|
1027
1232
|
}
|
|
1028
1233
|
),
|
|
1029
|
-
/* @__PURE__ */
|
|
1234
|
+
/* @__PURE__ */ g.jsx(
|
|
1030
1235
|
"button",
|
|
1031
1236
|
{
|
|
1032
1237
|
onClick: this.handleRetry,
|
|
@@ -1041,7 +1246,7 @@ ${o}`
|
|
|
1041
1246
|
children: "🔄 Обновить"
|
|
1042
1247
|
}
|
|
1043
1248
|
),
|
|
1044
|
-
/* @__PURE__ */
|
|
1249
|
+
/* @__PURE__ */ g.jsx(
|
|
1045
1250
|
"button",
|
|
1046
1251
|
{
|
|
1047
1252
|
onClick: this.handleGoHome,
|
|
@@ -1062,7 +1267,7 @@ ${o}`
|
|
|
1062
1267
|
return this.props.children == null ? null : this.props.children;
|
|
1063
1268
|
}
|
|
1064
1269
|
}
|
|
1065
|
-
const
|
|
1270
|
+
const D = {
|
|
1066
1271
|
info: "ℹ️",
|
|
1067
1272
|
code: "💻",
|
|
1068
1273
|
link: "🔗",
|
|
@@ -1073,24 +1278,24 @@ const N = {
|
|
|
1073
1278
|
tags: "🏷️",
|
|
1074
1279
|
spreadsheet: "📊"
|
|
1075
1280
|
};
|
|
1076
|
-
function
|
|
1077
|
-
const { data: r, isLoading: o, error:
|
|
1281
|
+
function pr({ mfeName: t }) {
|
|
1282
|
+
const { data: r, isLoading: o, error: u } = zt({ mfeName: t }), [a, d] = R(!1);
|
|
1078
1283
|
if (o)
|
|
1079
|
-
return /* @__PURE__ */
|
|
1080
|
-
/* @__PURE__ */
|
|
1284
|
+
return /* @__PURE__ */ g.jsxs("span", { className: "text-muted small me-2", children: [
|
|
1285
|
+
/* @__PURE__ */ g.jsx("span", { className: "me-1", children: "⏳" }),
|
|
1081
1286
|
"Загрузка..."
|
|
1082
1287
|
] });
|
|
1083
|
-
if (
|
|
1084
|
-
return /* @__PURE__ */
|
|
1085
|
-
/* @__PURE__ */
|
|
1288
|
+
if (u || !r)
|
|
1289
|
+
return /* @__PURE__ */ g.jsxs("span", { className: "text-muted small me-2", title: `Ошибка: ${u || "нет данных"}`, children: [
|
|
1290
|
+
/* @__PURE__ */ g.jsx("span", { className: "me-1", children: "ℹ️" }),
|
|
1086
1291
|
"N/A"
|
|
1087
1292
|
] });
|
|
1088
|
-
const
|
|
1089
|
-
return
|
|
1090
|
-
/* @__PURE__ */
|
|
1293
|
+
const s = r, x = s.BUILD_VERSION || s.IMAGE_VERSION || s.APP_NAME || "N/A", f = [];
|
|
1294
|
+
return s.APP_NAME && f.push({ key: "APP_NAME", value: s.APP_NAME, label: "Приложение", icon: D.apps }), s.BUILD_VERSION && f.push({ key: "BUILD_VERSION", value: s.BUILD_VERSION, label: "Версия", icon: D.tags }), s.IMAGE_VERSION && f.push({ key: "IMAGE_VERSION", value: s.IMAGE_VERSION, label: "Образ", icon: D.storage }), s.GIT_COMMIT && f.push({ key: "GIT_COMMIT", value: s.GIT_COMMIT, label: "Commit", icon: D.spreadsheet }), s.GIT_BRANCH && f.push({ key: "GIT_BRANCH", value: s.GIT_BRANCH, label: "Ветка", icon: D.spreadsheet }), s.CI_COMMIT_AUTHOR && f.push({ key: "CI_COMMIT_AUTHOR", value: s.CI_COMMIT_AUTHOR, label: "Автор", icon: D.user }), s.CI_COMMIT_TIMESTAMP && f.push({ key: "CI_COMMIT_TIMESTAMP", value: s.CI_COMMIT_TIMESTAMP, label: "Дата", icon: D.clock }), s.CI_JOB_URL && f.push({ key: "CI_JOB_URL", value: s.CI_JOB_URL, label: "CI Job", icon: D.link }), s.CI_PIPELINE_URL && f.push({ key: "CI_PIPELINE_URL", value: s.CI_PIPELINE_URL, label: "Pipeline", icon: D.link }), s.CI_COMMIT_MESSAGE && (s.CI_COMMIT_MESSAGE.length > 60 ? s.CI_COMMIT_MESSAGE.substring(0, 57) + "" : s.CI_COMMIT_MESSAGE, f.push({ key: "CI_COMMIT_MESSAGE", value: s.CI_COMMIT_MESSAGE, label: "Сообщение", icon: D.code })), /* @__PURE__ */ g.jsxs("div", { style: { display: "inline-block", position: "relative" }, children: [
|
|
1295
|
+
/* @__PURE__ */ g.jsxs(
|
|
1091
1296
|
"button",
|
|
1092
1297
|
{
|
|
1093
|
-
onClick: () =>
|
|
1298
|
+
onClick: () => d(!a),
|
|
1094
1299
|
style: {
|
|
1095
1300
|
background: "transparent",
|
|
1096
1301
|
border: "none",
|
|
@@ -1102,12 +1307,12 @@ function cr({ mfeName: t }) {
|
|
|
1102
1307
|
},
|
|
1103
1308
|
title: "Информация о версии",
|
|
1104
1309
|
children: [
|
|
1105
|
-
/* @__PURE__ */
|
|
1106
|
-
/* @__PURE__ */
|
|
1310
|
+
/* @__PURE__ */ g.jsx("span", { className: "me-1", children: D.info }),
|
|
1311
|
+
/* @__PURE__ */ g.jsx("span", { className: "text-dark", children: x })
|
|
1107
1312
|
]
|
|
1108
1313
|
}
|
|
1109
1314
|
),
|
|
1110
|
-
|
|
1315
|
+
a && /* @__PURE__ */ g.jsxs(
|
|
1111
1316
|
"div",
|
|
1112
1317
|
{
|
|
1113
1318
|
style: {
|
|
@@ -1124,36 +1329,36 @@ function cr({ mfeName: t }) {
|
|
|
1124
1329
|
marginTop: "4px"
|
|
1125
1330
|
},
|
|
1126
1331
|
children: [
|
|
1127
|
-
/* @__PURE__ */
|
|
1332
|
+
/* @__PURE__ */ g.jsxs("div", { style: {
|
|
1128
1333
|
marginBottom: "12px",
|
|
1129
1334
|
paddingBottom: "8px",
|
|
1130
1335
|
borderBottom: "1px solid #dee2e6",
|
|
1131
1336
|
display: "flex",
|
|
1132
1337
|
alignItems: "center"
|
|
1133
1338
|
}, children: [
|
|
1134
|
-
/* @__PURE__ */
|
|
1135
|
-
/* @__PURE__ */
|
|
1339
|
+
/* @__PURE__ */ g.jsx("span", { className: "me-2", children: D.apps }),
|
|
1340
|
+
/* @__PURE__ */ g.jsx("strong", { children: s.APP_NAME || t })
|
|
1136
1341
|
] }),
|
|
1137
|
-
/* @__PURE__ */
|
|
1138
|
-
/* @__PURE__ */
|
|
1139
|
-
/* @__PURE__ */
|
|
1342
|
+
/* @__PURE__ */ g.jsxs("div", { style: { marginBottom: "12px" }, children: [
|
|
1343
|
+
/* @__PURE__ */ g.jsx("span", { className: "text-muted", children: "Версия: " }),
|
|
1344
|
+
/* @__PURE__ */ g.jsx("strong", { children: x })
|
|
1140
1345
|
] }),
|
|
1141
|
-
|
|
1142
|
-
const _ =
|
|
1143
|
-
return /* @__PURE__ */
|
|
1144
|
-
/* @__PURE__ */
|
|
1145
|
-
/* @__PURE__ */
|
|
1146
|
-
/* @__PURE__ */
|
|
1147
|
-
/* @__PURE__ */
|
|
1346
|
+
f.length > 0 && /* @__PURE__ */ g.jsx("div", { style: { fontSize: "13px" }, children: f.map(({ key: E, value: l, label: m, icon: c }) => {
|
|
1347
|
+
const _ = l.length > 40 && (E.includes("URL") || E.includes("MESSAGE")) ? `${l.substring(0, 37)}...` : l;
|
|
1348
|
+
return /* @__PURE__ */ g.jsxs("div", { style: { marginBottom: "8px", display: "flex", alignItems: "flex-start" }, children: [
|
|
1349
|
+
/* @__PURE__ */ g.jsx("span", { className: "me-2", style: { flexShrink: 0 }, children: c }),
|
|
1350
|
+
/* @__PURE__ */ g.jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
1351
|
+
/* @__PURE__ */ g.jsx("div", { className: "small text-muted", children: m }),
|
|
1352
|
+
/* @__PURE__ */ g.jsx(
|
|
1148
1353
|
"div",
|
|
1149
1354
|
{
|
|
1150
1355
|
className: "font-monospace small text-truncate",
|
|
1151
1356
|
style: { maxWidth: "100%" },
|
|
1152
|
-
title:
|
|
1153
|
-
children: E.includes("URL") ? /* @__PURE__ */
|
|
1357
|
+
title: l,
|
|
1358
|
+
children: E.includes("URL") ? /* @__PURE__ */ g.jsx(
|
|
1154
1359
|
"a",
|
|
1155
1360
|
{
|
|
1156
|
-
href:
|
|
1361
|
+
href: l,
|
|
1157
1362
|
target: "_blank",
|
|
1158
1363
|
rel: "noopener noreferrer",
|
|
1159
1364
|
style: { color: "#007bff" },
|
|
@@ -1165,8 +1370,8 @@ function cr({ mfeName: t }) {
|
|
|
1165
1370
|
] })
|
|
1166
1371
|
] }, E);
|
|
1167
1372
|
}) }),
|
|
1168
|
-
|
|
1169
|
-
/* @__PURE__ */
|
|
1373
|
+
f.length === 0 && /* @__PURE__ */ g.jsx("div", { className: "text-center text-muted py-2 small", children: "Нет информации о версии" }),
|
|
1374
|
+
/* @__PURE__ */ g.jsx("div", { style: {
|
|
1170
1375
|
marginTop: "12px",
|
|
1171
1376
|
paddingTop: "8px",
|
|
1172
1377
|
borderTop: "1px solid #dee2e6",
|
|
@@ -1174,10 +1379,10 @@ function cr({ mfeName: t }) {
|
|
|
1174
1379
|
fontSize: "12px",
|
|
1175
1380
|
color: "#6c757d"
|
|
1176
1381
|
}, children: "IngoBank DevOps Platform" }),
|
|
1177
|
-
/* @__PURE__ */
|
|
1382
|
+
/* @__PURE__ */ g.jsx(
|
|
1178
1383
|
"button",
|
|
1179
1384
|
{
|
|
1180
|
-
onClick: () =>
|
|
1385
|
+
onClick: () => d(!1),
|
|
1181
1386
|
style: {
|
|
1182
1387
|
position: "absolute",
|
|
1183
1388
|
top: "8px",
|
|
@@ -1194,10 +1399,10 @@ function cr({ mfeName: t }) {
|
|
|
1194
1399
|
]
|
|
1195
1400
|
}
|
|
1196
1401
|
),
|
|
1197
|
-
|
|
1402
|
+
a && /* @__PURE__ */ g.jsx(
|
|
1198
1403
|
"div",
|
|
1199
1404
|
{
|
|
1200
|
-
onClick: () =>
|
|
1405
|
+
onClick: () => d(!1),
|
|
1201
1406
|
style: {
|
|
1202
1407
|
position: "fixed",
|
|
1203
1408
|
top: 0,
|
|
@@ -1210,64 +1415,64 @@ function cr({ mfeName: t }) {
|
|
|
1210
1415
|
)
|
|
1211
1416
|
] });
|
|
1212
1417
|
}
|
|
1213
|
-
const
|
|
1214
|
-
function
|
|
1215
|
-
const [r, o] =
|
|
1418
|
+
const _e = "platform-kit", tt = Lt(null);
|
|
1419
|
+
function hr({ children: t }) {
|
|
1420
|
+
const [r, o] = R([]), u = typeof window < "u" && window.__MF_NAME__ || _e, a = k((c, _, w, N) => ({
|
|
1216
1421
|
id: `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
|
|
1217
|
-
type:
|
|
1422
|
+
type: c,
|
|
1218
1423
|
title: _,
|
|
1219
|
-
message:
|
|
1220
|
-
mfeName:
|
|
1424
|
+
message: w,
|
|
1425
|
+
mfeName: u,
|
|
1221
1426
|
timestamp: Date.now(),
|
|
1222
|
-
duration:
|
|
1223
|
-
}), [
|
|
1224
|
-
o((
|
|
1225
|
-
const _ =
|
|
1427
|
+
duration: N
|
|
1428
|
+
}), [u]), d = k((c) => {
|
|
1429
|
+
o((w) => [...w, c].slice(0, 5));
|
|
1430
|
+
const _ = c.duration || 5e3;
|
|
1226
1431
|
_ > 0 && setTimeout(() => {
|
|
1227
|
-
o((
|
|
1432
|
+
o((w) => w.filter((N) => N.id !== c.id));
|
|
1228
1433
|
}, _);
|
|
1229
|
-
}, []),
|
|
1230
|
-
const _ =
|
|
1231
|
-
|
|
1434
|
+
}, []), s = k((c) => {
|
|
1435
|
+
const _ = a(c.type, c.title, c.message, c.duration);
|
|
1436
|
+
d(_), typeof window < "u" && window.dispatchEvent(new CustomEvent("mfe-notification", {
|
|
1232
1437
|
detail: _,
|
|
1233
1438
|
bubbles: !0
|
|
1234
1439
|
}));
|
|
1235
|
-
}, [
|
|
1236
|
-
|
|
1237
|
-
}, [
|
|
1238
|
-
|
|
1239
|
-
}, [
|
|
1240
|
-
|
|
1241
|
-
}, [
|
|
1242
|
-
|
|
1243
|
-
}, [
|
|
1244
|
-
o((_) => _.filter((
|
|
1440
|
+
}, [a, d]), x = k((c, _ = "Успешно") => {
|
|
1441
|
+
s({ type: "success", title: _, message: c });
|
|
1442
|
+
}, [s]), f = k((c, _ = "Ошибка") => {
|
|
1443
|
+
s({ type: "error", title: _, message: c });
|
|
1444
|
+
}, [s]), E = k((c, _ = "Предупреждение") => {
|
|
1445
|
+
s({ type: "warning", title: _, message: c });
|
|
1446
|
+
}, [s]), l = k((c, _ = "Информация") => {
|
|
1447
|
+
s({ type: "info", title: _, message: c });
|
|
1448
|
+
}, [s]), m = k((c) => {
|
|
1449
|
+
o((_) => _.filter((w) => w.id !== c));
|
|
1245
1450
|
}, []);
|
|
1246
|
-
return
|
|
1451
|
+
return V(() => {
|
|
1247
1452
|
if (typeof window > "u") return;
|
|
1248
|
-
const
|
|
1249
|
-
const
|
|
1250
|
-
if (
|
|
1251
|
-
const
|
|
1252
|
-
...
|
|
1453
|
+
const c = (_) => {
|
|
1454
|
+
const w = _.detail;
|
|
1455
|
+
if (w && w.type && w.title && w.message) {
|
|
1456
|
+
const N = {
|
|
1457
|
+
...w,
|
|
1253
1458
|
id: `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`
|
|
1254
1459
|
};
|
|
1255
|
-
|
|
1460
|
+
d(N);
|
|
1256
1461
|
}
|
|
1257
1462
|
};
|
|
1258
|
-
return window.addEventListener("mfe-notification",
|
|
1259
|
-
window.removeEventListener("mfe-notification",
|
|
1463
|
+
return window.addEventListener("mfe-notification", c), () => {
|
|
1464
|
+
window.removeEventListener("mfe-notification", c);
|
|
1260
1465
|
};
|
|
1261
|
-
}, [
|
|
1262
|
-
notify:
|
|
1263
|
-
notifySuccess:
|
|
1264
|
-
notifyError:
|
|
1466
|
+
}, [d]), /* @__PURE__ */ g.jsxs(tt.Provider, { value: {
|
|
1467
|
+
notify: s,
|
|
1468
|
+
notifySuccess: x,
|
|
1469
|
+
notifyError: f,
|
|
1265
1470
|
notifyWarning: E,
|
|
1266
|
-
notifyInfo:
|
|
1267
|
-
removeNotification:
|
|
1471
|
+
notifyInfo: l,
|
|
1472
|
+
removeNotification: m
|
|
1268
1473
|
}, children: [
|
|
1269
1474
|
t,
|
|
1270
|
-
r.length > 0 && /* @__PURE__ */
|
|
1475
|
+
r.length > 0 && /* @__PURE__ */ g.jsx(
|
|
1271
1476
|
"div",
|
|
1272
1477
|
{
|
|
1273
1478
|
style: {
|
|
@@ -1282,31 +1487,31 @@ function fr({ children: t }) {
|
|
|
1282
1487
|
gap: "8px",
|
|
1283
1488
|
pointerEvents: "none"
|
|
1284
1489
|
},
|
|
1285
|
-
children: r.map((
|
|
1490
|
+
children: r.map((c) => /* @__PURE__ */ g.jsxs(
|
|
1286
1491
|
"div",
|
|
1287
1492
|
{
|
|
1288
|
-
className: `notification notification-${
|
|
1493
|
+
className: `notification notification-${c.type}`,
|
|
1289
1494
|
style: {
|
|
1290
1495
|
pointerEvents: "auto",
|
|
1291
1496
|
padding: "12px 16px",
|
|
1292
1497
|
borderRadius: "8px",
|
|
1293
|
-
background:
|
|
1294
|
-
color:
|
|
1498
|
+
background: c.type === "success" ? "#d4edda" : c.type === "error" ? "#f8d7da" : c.type === "warning" ? "#fff3cd" : "#d1ecf1",
|
|
1499
|
+
color: c.type === "success" ? "#155724" : c.type === "error" ? "#721c24" : c.type === "warning" ? "#856404" : "#0c5460",
|
|
1295
1500
|
boxShadow: "0 4px 12px rgba(0,0,0,0.15)",
|
|
1296
1501
|
display: "flex",
|
|
1297
1502
|
alignItems: "flex-start",
|
|
1298
1503
|
gap: "12px"
|
|
1299
1504
|
},
|
|
1300
1505
|
children: [
|
|
1301
|
-
/* @__PURE__ */
|
|
1302
|
-
/* @__PURE__ */
|
|
1303
|
-
/* @__PURE__ */
|
|
1304
|
-
/* @__PURE__ */
|
|
1506
|
+
/* @__PURE__ */ g.jsxs("div", { style: { flex: 1 }, children: [
|
|
1507
|
+
/* @__PURE__ */ g.jsx("strong", { style: { display: "block", marginBottom: "4px" }, children: c.title }),
|
|
1508
|
+
/* @__PURE__ */ g.jsx("p", { style: { margin: 0, fontSize: "14px" }, children: c.message }),
|
|
1509
|
+
/* @__PURE__ */ g.jsx("small", { style: { opacity: 0.7, fontSize: "12px" }, children: c.mfeName })
|
|
1305
1510
|
] }),
|
|
1306
|
-
/* @__PURE__ */
|
|
1511
|
+
/* @__PURE__ */ g.jsx(
|
|
1307
1512
|
"button",
|
|
1308
1513
|
{
|
|
1309
|
-
onClick: () =>
|
|
1514
|
+
onClick: () => m(c.id),
|
|
1310
1515
|
style: {
|
|
1311
1516
|
background: "transparent",
|
|
1312
1517
|
border: "none",
|
|
@@ -1320,14 +1525,14 @@ function fr({ children: t }) {
|
|
|
1320
1525
|
)
|
|
1321
1526
|
]
|
|
1322
1527
|
},
|
|
1323
|
-
|
|
1528
|
+
c.id
|
|
1324
1529
|
))
|
|
1325
1530
|
}
|
|
1326
1531
|
)
|
|
1327
1532
|
] });
|
|
1328
1533
|
}
|
|
1329
|
-
function
|
|
1330
|
-
const t =
|
|
1534
|
+
function gr() {
|
|
1535
|
+
const t = Ut(tt);
|
|
1331
1536
|
return t || {
|
|
1332
1537
|
notify: () => {
|
|
1333
1538
|
},
|
|
@@ -1343,9 +1548,9 @@ function dr() {
|
|
|
1343
1548
|
}
|
|
1344
1549
|
};
|
|
1345
1550
|
}
|
|
1346
|
-
function
|
|
1551
|
+
function mr(t) {
|
|
1347
1552
|
if (typeof window > "u") return;
|
|
1348
|
-
const r = window.__MF_NAME__ ||
|
|
1553
|
+
const r = window.__MF_NAME__ || _e, o = {
|
|
1349
1554
|
...t,
|
|
1350
1555
|
mfeName: r,
|
|
1351
1556
|
timestamp: Date.now()
|
|
@@ -1355,13 +1560,13 @@ function pr(t) {
|
|
|
1355
1560
|
bubbles: !0
|
|
1356
1561
|
}));
|
|
1357
1562
|
}
|
|
1358
|
-
const
|
|
1563
|
+
const rt = "platform-kit", q = {
|
|
1359
1564
|
log: (...t) => {
|
|
1360
1565
|
},
|
|
1361
1566
|
warn: (...t) => {
|
|
1362
1567
|
},
|
|
1363
1568
|
error: (...t) => {
|
|
1364
|
-
console.error(`[${
|
|
1569
|
+
console.error(`[${rt}]`, ...t);
|
|
1365
1570
|
},
|
|
1366
1571
|
info: (...t) => {
|
|
1367
1572
|
}
|
|
@@ -1379,7 +1584,7 @@ function Xt() {
|
|
|
1379
1584
|
if (typeof window > "u") return;
|
|
1380
1585
|
const t = window.__SHELL_AUTH_INSTANCE__;
|
|
1381
1586
|
t?.signinRedirect ? t.signinRedirect().catch((r) => {
|
|
1382
|
-
|
|
1587
|
+
q.error("Failed to redirect to login:", r);
|
|
1383
1588
|
}) : window.location.href = "/";
|
|
1384
1589
|
}
|
|
1385
1590
|
function Zt(t) {
|
|
@@ -1395,63 +1600,63 @@ function Zt(t) {
|
|
|
1395
1600
|
};
|
|
1396
1601
|
}
|
|
1397
1602
|
function Qt(t = {}) {
|
|
1398
|
-
const r = t.name ||
|
|
1399
|
-
log: (...
|
|
1400
|
-
warn: (...
|
|
1401
|
-
error: (...
|
|
1402
|
-
info: (...
|
|
1403
|
-
},
|
|
1603
|
+
const r = t.name || rt, o = {
|
|
1604
|
+
log: (...a) => q.log(`[API:${r}]`, ...a),
|
|
1605
|
+
warn: (...a) => q.warn(`[API:${r}]`, ...a),
|
|
1606
|
+
error: (...a) => q.error(`[API:${r}]`, ...a),
|
|
1607
|
+
info: (...a) => q.info(`[API:${r}]`, ...a)
|
|
1608
|
+
}, u = Vt.create({
|
|
1404
1609
|
timeout: t.timeout ?? 1e4,
|
|
1405
1610
|
baseURL: t.baseURL ?? "",
|
|
1406
1611
|
headers: {
|
|
1407
1612
|
"Content-Type": "application/json"
|
|
1408
1613
|
}
|
|
1409
1614
|
});
|
|
1410
|
-
return
|
|
1411
|
-
(
|
|
1412
|
-
const
|
|
1413
|
-
if (
|
|
1414
|
-
const
|
|
1415
|
-
|
|
1615
|
+
return u.interceptors.request.use(
|
|
1616
|
+
(a) => {
|
|
1617
|
+
const d = Kt();
|
|
1618
|
+
if (d?.isAuthenticated) {
|
|
1619
|
+
const s = d.user?.profile?.access_token;
|
|
1620
|
+
s && a.headers && (a.headers.Authorization = `Bearer ${s}`, o.info("Auth token attached"));
|
|
1416
1621
|
} else
|
|
1417
1622
|
o.info("User not authenticated - request without token");
|
|
1418
|
-
return o.log(`${
|
|
1623
|
+
return o.log(`${a.method?.toUpperCase()} ${a.url}`), a;
|
|
1419
1624
|
},
|
|
1420
|
-
(
|
|
1421
|
-
),
|
|
1422
|
-
(
|
|
1423
|
-
(
|
|
1424
|
-
const
|
|
1425
|
-
return
|
|
1625
|
+
(a) => (o.error("Request interceptor error:", a.message), Promise.reject(a))
|
|
1626
|
+
), u.interceptors.response.use(
|
|
1627
|
+
(a) => (o.log(`Response ${a.status}:`, a.config.url), a),
|
|
1628
|
+
(a) => {
|
|
1629
|
+
const d = a.response?.status, s = a.config?.url;
|
|
1630
|
+
return d === 401 ? (o.warn("401 Unauthorized - triggering re-auth"), Xt()) : d === 403 ? o.warn("403 Forbidden - insufficient permissions") : d === 404 ? o.warn("404 Not found:", s) : d === 429 ? o.warn("429 Rate limited") : d === 500 ? o.error("500 Server error:", s) : a.response ? o.warn(`Error ${d}:`, a.message) : o.error("Network error - backend may be unavailable:", s), Promise.reject(Zt(a));
|
|
1426
1631
|
}
|
|
1427
|
-
),
|
|
1632
|
+
), u;
|
|
1428
1633
|
}
|
|
1429
|
-
const
|
|
1430
|
-
async function
|
|
1431
|
-
const
|
|
1634
|
+
const oe = Qt();
|
|
1635
|
+
async function _r(t, r, o = oe) {
|
|
1636
|
+
const u = await o.get(t, { params: r });
|
|
1432
1637
|
return {
|
|
1433
|
-
data:
|
|
1434
|
-
status:
|
|
1435
|
-
ok:
|
|
1638
|
+
data: u.data,
|
|
1639
|
+
status: u.status,
|
|
1640
|
+
ok: u.status >= 200 && u.status < 300
|
|
1436
1641
|
};
|
|
1437
1642
|
}
|
|
1438
|
-
async function
|
|
1439
|
-
const
|
|
1643
|
+
async function vr(t, r, o = oe) {
|
|
1644
|
+
const u = await o.post(t, r);
|
|
1440
1645
|
return {
|
|
1441
|
-
data:
|
|
1442
|
-
status:
|
|
1443
|
-
ok:
|
|
1646
|
+
data: u.data,
|
|
1647
|
+
status: u.status,
|
|
1648
|
+
ok: u.status >= 200 && u.status < 300
|
|
1444
1649
|
};
|
|
1445
1650
|
}
|
|
1446
|
-
async function
|
|
1447
|
-
const
|
|
1651
|
+
async function Er(t, r, o = oe) {
|
|
1652
|
+
const u = await o.put(t, r);
|
|
1448
1653
|
return {
|
|
1449
|
-
data:
|
|
1450
|
-
status:
|
|
1451
|
-
ok:
|
|
1654
|
+
data: u.data,
|
|
1655
|
+
status: u.status,
|
|
1656
|
+
ok: u.status >= 200 && u.status < 300
|
|
1452
1657
|
};
|
|
1453
1658
|
}
|
|
1454
|
-
async function
|
|
1659
|
+
async function yr(t, r = oe) {
|
|
1455
1660
|
const o = await r.delete(t);
|
|
1456
1661
|
return {
|
|
1457
1662
|
data: o.data,
|
|
@@ -1459,21 +1664,21 @@ async function _r(t, r = ee) {
|
|
|
1459
1664
|
ok: o.status >= 200 && o.status < 300
|
|
1460
1665
|
};
|
|
1461
1666
|
}
|
|
1462
|
-
function
|
|
1667
|
+
function se(t, r) {
|
|
1463
1668
|
const o = r?.prefix ? `[${r.prefix}]` : `[${t}]`;
|
|
1464
1669
|
return {
|
|
1465
|
-
log: (...
|
|
1670
|
+
log: (...u) => {
|
|
1466
1671
|
},
|
|
1467
|
-
warn: (...
|
|
1672
|
+
warn: (...u) => {
|
|
1468
1673
|
},
|
|
1469
|
-
error: (...
|
|
1470
|
-
console.error(o, ...
|
|
1674
|
+
error: (...u) => {
|
|
1675
|
+
console.error(o, ...u);
|
|
1471
1676
|
},
|
|
1472
|
-
info: (...
|
|
1677
|
+
info: (...u) => {
|
|
1473
1678
|
}
|
|
1474
1679
|
};
|
|
1475
1680
|
}
|
|
1476
|
-
const
|
|
1681
|
+
const wr = se("platform-kit", { prefix: "AUTH" }), br = se("platform-kit", { prefix: "API" }), xr = se("platform-kit", { prefix: "ERROR" }), Sr = se("platform-kit", { prefix: "INFO" }), er = {}, tr = {
|
|
1477
1682
|
log: (...t) => {
|
|
1478
1683
|
},
|
|
1479
1684
|
warn: (...t) => {
|
|
@@ -1482,15 +1687,15 @@ const vr = te("platform-kit", { prefix: "AUTH" }), Er = te("platform-kit", { pre
|
|
|
1482
1687
|
console.error("[getMfeName]", ...t);
|
|
1483
1688
|
}
|
|
1484
1689
|
};
|
|
1485
|
-
function
|
|
1690
|
+
function Ee(t) {
|
|
1486
1691
|
return t ? t.mfeName ? t.mfeName : t.name ? t.name.replace("@ib-dop/", "") : null : null;
|
|
1487
1692
|
}
|
|
1488
|
-
function
|
|
1693
|
+
function nt() {
|
|
1489
1694
|
if (typeof window > "u") return null;
|
|
1490
1695
|
const t = window;
|
|
1491
1696
|
return t.__MF_NAME__ ? t.__MF_NAME__ : null;
|
|
1492
1697
|
}
|
|
1493
|
-
function
|
|
1698
|
+
function ot() {
|
|
1494
1699
|
if (typeof window > "u") return null;
|
|
1495
1700
|
try {
|
|
1496
1701
|
const t = sessionStorage.getItem("mf-config");
|
|
@@ -1504,73 +1709,76 @@ function tt() {
|
|
|
1504
1709
|
}
|
|
1505
1710
|
return null;
|
|
1506
1711
|
}
|
|
1507
|
-
function
|
|
1712
|
+
function ye() {
|
|
1508
1713
|
const t = er;
|
|
1509
1714
|
return t.VITE_MFE_NAME ? String(t.VITE_MFE_NAME) : t.MFE_NAME ? String(t.MFE_NAME) : null;
|
|
1510
1715
|
}
|
|
1511
|
-
let
|
|
1716
|
+
let re = null, ve = !1;
|
|
1512
1717
|
function rr(t, r) {
|
|
1513
|
-
const o =
|
|
1718
|
+
const o = Ee(t);
|
|
1514
1719
|
if (o)
|
|
1515
1720
|
return o;
|
|
1516
|
-
if (
|
|
1517
|
-
return
|
|
1518
|
-
const
|
|
1519
|
-
{ source: "window.__MF_NAME__", value:
|
|
1520
|
-
{ source: "sessionStorage.mf-config", value:
|
|
1521
|
-
{ source: "import.meta.env.VITE_MFE_NAME", value:
|
|
1721
|
+
if (ve && re)
|
|
1722
|
+
return re;
|
|
1723
|
+
const u = [
|
|
1724
|
+
{ source: "window.__MF_NAME__", value: nt() },
|
|
1725
|
+
{ source: "sessionStorage.mf-config", value: ot() },
|
|
1726
|
+
{ source: "import.meta.env.VITE_MFE_NAME", value: ye() }
|
|
1522
1727
|
];
|
|
1523
|
-
for (const { source:
|
|
1524
|
-
if (
|
|
1525
|
-
return
|
|
1728
|
+
for (const { source: d, value: s } of u)
|
|
1729
|
+
if (s)
|
|
1730
|
+
return re = s, ve = !0, s;
|
|
1526
1731
|
if (r)
|
|
1527
1732
|
return r;
|
|
1528
|
-
const
|
|
1529
|
-
throw tr.error(
|
|
1733
|
+
const a = "Cannot determine MFE name. Please pass mfeName in props, set window.__MF_NAME__, sessionStorage.mf-config, or VITE_MFE_NAME";
|
|
1734
|
+
throw tr.error(a), new Error(a);
|
|
1530
1735
|
}
|
|
1531
|
-
function
|
|
1736
|
+
function Ar(t) {
|
|
1532
1737
|
return rr(t);
|
|
1533
1738
|
}
|
|
1534
1739
|
function nr(t) {
|
|
1535
|
-
return
|
|
1740
|
+
return Ee(t) ? "props.mfeName" : nt() ? "window.__MF_NAME__" : ot() ? "sessionStorage.mf-config" : ye() ? "import.meta.env.VITE_MFE_NAME" : null;
|
|
1536
1741
|
}
|
|
1537
|
-
function
|
|
1742
|
+
function Tr(t) {
|
|
1538
1743
|
return nr(t) !== null;
|
|
1539
1744
|
}
|
|
1540
|
-
function
|
|
1541
|
-
|
|
1745
|
+
function Rr() {
|
|
1746
|
+
re = null, ve = !1;
|
|
1542
1747
|
}
|
|
1543
|
-
function
|
|
1748
|
+
function Cr(t) {
|
|
1544
1749
|
const r = [];
|
|
1545
|
-
return
|
|
1750
|
+
return Ee(t) && r.push("props.mfeName"), typeof window < "u" && (window.__MF_NAME__ && r.push("window.__MF_NAME__"), sessionStorage.getItem("mf-config") && r.push("sessionStorage.mf-config")), ye() && r.push("import.meta.env.VITE_MFE_NAME"), r;
|
|
1546
1751
|
}
|
|
1547
1752
|
export {
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1753
|
+
dr as ErrorBoundary,
|
|
1754
|
+
hr as NotificationProvider,
|
|
1755
|
+
pr as VersionInfo,
|
|
1756
|
+
oe as api,
|
|
1757
|
+
br as apiLogger,
|
|
1758
|
+
wr as authLogger,
|
|
1554
1759
|
Qt as createApiClient,
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1760
|
+
se as createMfLogger,
|
|
1761
|
+
yr as del,
|
|
1762
|
+
mr as dispatchNotification,
|
|
1763
|
+
xr as errorLogger,
|
|
1764
|
+
_r as get,
|
|
1765
|
+
Cr as getAllMfeNameSources,
|
|
1766
|
+
he as getAuth,
|
|
1562
1767
|
rr as getMfeName,
|
|
1563
1768
|
nr as getMfeNameSource,
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1769
|
+
Tr as hasMfeName,
|
|
1770
|
+
Sr as infoLogger,
|
|
1771
|
+
vr as post,
|
|
1772
|
+
Er as put,
|
|
1773
|
+
Ar as requireMfeName,
|
|
1774
|
+
Rr as resetMfeNameCache,
|
|
1775
|
+
ir as useApi,
|
|
1776
|
+
lr as useFeatureAdmin,
|
|
1777
|
+
cr as useFeatures,
|
|
1778
|
+
zt as useInfoData,
|
|
1779
|
+
fr as useMicrofrontendsFeatures,
|
|
1780
|
+
gr as useNotification,
|
|
1781
|
+
ur as usePermissions,
|
|
1782
|
+
ne as useShellAuth,
|
|
1575
1783
|
ar as useV1Config
|
|
1576
1784
|
};
|