@ibdop/platform-kit 1.0.16 → 1.0.17
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/components/VersionInfo.d.ts.map +1 -1
- package/dist/index.js +10 -10
- package/dist/index.mjs +574 -575
- package/dist/index.umd.js +10 -10
- package/package.json +1 -1
- package/src/components/VersionInfo.tsx +39 -36
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import et, { useState as A, useRef as tt, useCallback as
|
|
1
|
+
import et, { useState as A, useRef as tt, useCallback as S, useEffect as L, useMemo as ye, Component as Lt, createContext as Ut, useContext as Bt } from "react";
|
|
2
2
|
import Vt from "axios";
|
|
3
3
|
function B() {
|
|
4
4
|
if (typeof window > "u") return null;
|
|
@@ -13,14 +13,14 @@ function dr() {
|
|
|
13
13
|
if (!t)
|
|
14
14
|
return { isAuthenticated: !1 };
|
|
15
15
|
let r;
|
|
16
|
-
const
|
|
16
|
+
const n = t;
|
|
17
17
|
if (t.user?.access_token)
|
|
18
18
|
r = t.user.access_token;
|
|
19
19
|
else if (t.user?.profile?.access_token)
|
|
20
20
|
r = t.user.profile.access_token;
|
|
21
|
-
else if (typeof
|
|
21
|
+
else if (typeof n.getAccessToken == "function")
|
|
22
22
|
try {
|
|
23
|
-
const i =
|
|
23
|
+
const i = n.getAccessToken();
|
|
24
24
|
i instanceof Promise ? console.warn("[shellAuth] getAccessToken returned Promise - token may not be available synchronously") : typeof i == "string" && (r = i);
|
|
25
25
|
} catch (i) {
|
|
26
26
|
console.warn("[shellAuth] Failed to get access token via getAccessToken:", i);
|
|
@@ -52,40 +52,40 @@ const Je = {
|
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
54
|
function ae() {
|
|
55
|
-
const [t, r] = A(null), [
|
|
55
|
+
const [t, r] = A(null), [n, i] = A(!0), c = tt(0), d = 20, a = S(() => B(), []);
|
|
56
56
|
L(() => {
|
|
57
|
-
const
|
|
58
|
-
if (
|
|
59
|
-
r(
|
|
57
|
+
const y = a();
|
|
58
|
+
if (y) {
|
|
59
|
+
r(y), i(!1);
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
|
-
const
|
|
62
|
+
const u = (f) => {
|
|
63
63
|
r(f.detail), i(!1);
|
|
64
|
-
},
|
|
64
|
+
}, h = setInterval(() => {
|
|
65
65
|
c.current++;
|
|
66
|
-
const f =
|
|
67
|
-
f ? (Je.log("Auth found via polling, attempts:", c.current), r(f), i(!1), clearInterval(
|
|
66
|
+
const f = a();
|
|
67
|
+
f ? (Je.log("Auth found via polling, attempts:", c.current), r(f), i(!1), clearInterval(h)) : c.current >= d && (i(!1), clearInterval(h));
|
|
68
68
|
}, 500);
|
|
69
|
-
return window.addEventListener("shell-auth-ready",
|
|
70
|
-
clearInterval(
|
|
69
|
+
return window.addEventListener("shell-auth-ready", u), () => {
|
|
70
|
+
clearInterval(h), window.removeEventListener("shell-auth-ready", u);
|
|
71
71
|
};
|
|
72
|
-
}, [
|
|
73
|
-
const
|
|
72
|
+
}, [a]);
|
|
73
|
+
const p = t || {
|
|
74
74
|
user: null,
|
|
75
75
|
isAuthenticated: !1,
|
|
76
|
-
isLoading:
|
|
76
|
+
isLoading: n,
|
|
77
77
|
signinRedirect: async () => {
|
|
78
|
-
const
|
|
79
|
-
|
|
78
|
+
const y = B();
|
|
79
|
+
y?.signinRedirect ? await y.signinRedirect() : typeof window < "u" && (window.location.href = "/");
|
|
80
80
|
},
|
|
81
81
|
removeUser: async () => {
|
|
82
|
-
const
|
|
83
|
-
|
|
82
|
+
const y = B();
|
|
83
|
+
y?.removeUser && await y.removeUser();
|
|
84
84
|
}
|
|
85
85
|
};
|
|
86
|
-
return Je.log("Auth result:", { isAuthenticated:
|
|
86
|
+
return Je.log("Auth result:", { isAuthenticated: p.isAuthenticated, isLoading: p.isLoading }), p;
|
|
87
87
|
}
|
|
88
|
-
const
|
|
88
|
+
const zt = {
|
|
89
89
|
log: (...t) => {
|
|
90
90
|
},
|
|
91
91
|
warn: (...t) => {
|
|
@@ -94,7 +94,7 @@ const Wt = {
|
|
|
94
94
|
console.error("[useInfoData]", ...t);
|
|
95
95
|
}
|
|
96
96
|
};
|
|
97
|
-
function
|
|
97
|
+
function Wt(t) {
|
|
98
98
|
if (t) return t;
|
|
99
99
|
if (typeof window < "u") {
|
|
100
100
|
const r = window;
|
|
@@ -103,27 +103,27 @@ function zt(t) {
|
|
|
103
103
|
return "unknown-mfe";
|
|
104
104
|
}
|
|
105
105
|
function Gt(t) {
|
|
106
|
-
const [r,
|
|
107
|
-
const
|
|
108
|
-
c(!0),
|
|
109
|
-
if (!
|
|
110
|
-
throw new Error(`HTTP ${
|
|
111
|
-
return
|
|
112
|
-
}).then((
|
|
113
|
-
|
|
114
|
-
}).catch((
|
|
115
|
-
|
|
106
|
+
const [r, n] = A(null), [i, c] = A(!0), [d, a] = A(null), s = S(() => {
|
|
107
|
+
const y = Wt(t?.mfeName).replace("@ib-dop/", "");
|
|
108
|
+
c(!0), a(null), fetch(`/svc/${y}/info.json`).then((u) => {
|
|
109
|
+
if (!u.ok)
|
|
110
|
+
throw new Error(`HTTP ${u.status}: ${u.statusText}`);
|
|
111
|
+
return u.json();
|
|
112
|
+
}).then((u) => {
|
|
113
|
+
n(u);
|
|
114
|
+
}).catch((u) => {
|
|
115
|
+
zt.error("Failed to load info:", u), a(u instanceof Error ? u.message : String(u));
|
|
116
116
|
}).finally(() => {
|
|
117
117
|
c(!1);
|
|
118
118
|
});
|
|
119
119
|
}, [t?.mfeName]);
|
|
120
120
|
return L(() => {
|
|
121
|
-
|
|
122
|
-
}, [
|
|
121
|
+
s();
|
|
122
|
+
}, [s]), {
|
|
123
123
|
data: r,
|
|
124
124
|
isLoading: i,
|
|
125
125
|
error: d,
|
|
126
|
-
refetch:
|
|
126
|
+
refetch: s
|
|
127
127
|
};
|
|
128
128
|
}
|
|
129
129
|
const _e = {
|
|
@@ -140,7 +140,7 @@ const _e = {
|
|
|
140
140
|
environment: "development"
|
|
141
141
|
};
|
|
142
142
|
function gr() {
|
|
143
|
-
const [t, r] = A(null), [
|
|
143
|
+
const [t, r] = A(null), [n, i] = A(!0), [c, d] = A(null);
|
|
144
144
|
return L(() => {
|
|
145
145
|
(() => {
|
|
146
146
|
if (typeof sessionStorage > "u") {
|
|
@@ -148,21 +148,21 @@ function gr() {
|
|
|
148
148
|
return;
|
|
149
149
|
}
|
|
150
150
|
try {
|
|
151
|
-
const
|
|
152
|
-
if (
|
|
153
|
-
const
|
|
154
|
-
r({ ...re, ...
|
|
151
|
+
const s = sessionStorage.getItem("config");
|
|
152
|
+
if (s) {
|
|
153
|
+
const p = JSON.parse(s);
|
|
154
|
+
r({ ...re, ...p }), d(null), _e.log("Config loaded successfully");
|
|
155
155
|
} else
|
|
156
156
|
r(re), d("Config not found in sessionStorage"), _e.warn("Config not found in sessionStorage");
|
|
157
|
-
} catch (
|
|
158
|
-
_e.error("Error parsing config:",
|
|
157
|
+
} catch (s) {
|
|
158
|
+
_e.error("Error parsing config:", s), r(re), d("Error parsing config");
|
|
159
159
|
} finally {
|
|
160
160
|
i(!1);
|
|
161
161
|
}
|
|
162
162
|
})();
|
|
163
163
|
}, []), {
|
|
164
164
|
data: t,
|
|
165
|
-
isLoading:
|
|
165
|
+
isLoading: n,
|
|
166
166
|
error: c
|
|
167
167
|
};
|
|
168
168
|
}
|
|
@@ -179,12 +179,12 @@ const rt = "platform-kit", ne = {
|
|
|
179
179
|
};
|
|
180
180
|
function Yt(t) {
|
|
181
181
|
const r = t.response;
|
|
182
|
-
let
|
|
183
|
-
return r ? r.status === 401 ?
|
|
182
|
+
let n = "unknown";
|
|
183
|
+
return r ? r.status === 401 ? n = "unauthorized" : r.status === 403 ? n = "forbidden" : r.status === 404 ? n = "not_found" : r.status >= 500 && (n = "server") : n = "network", {
|
|
184
184
|
message: r?.data?.message ?? t.message ?? "Unknown error",
|
|
185
185
|
code: r?.data?.code,
|
|
186
186
|
status: r?.status,
|
|
187
|
-
type:
|
|
187
|
+
type: n,
|
|
188
188
|
timestamp: Date.now(),
|
|
189
189
|
url: t.config?.url
|
|
190
190
|
};
|
|
@@ -196,12 +196,12 @@ function Kt(t) {
|
|
|
196
196
|
function Xt(t) {
|
|
197
197
|
return new Promise((r) => setTimeout(r, t));
|
|
198
198
|
}
|
|
199
|
-
function
|
|
200
|
-
const r = t.name || rt,
|
|
201
|
-
log: (...
|
|
202
|
-
warn: (...
|
|
203
|
-
error: (...
|
|
204
|
-
info: (...
|
|
199
|
+
function Qt(t = {}) {
|
|
200
|
+
const r = t.name || rt, n = t.retries ?? qt, i = t.retryDelay ?? Jt, c = {
|
|
201
|
+
log: (...a) => ne.log(`[API:${r}]`, ...a),
|
|
202
|
+
warn: (...a) => ne.warn(`[API:${r}]`, ...a),
|
|
203
|
+
error: (...a) => ne.error(`[API:${r}]`, ...a),
|
|
204
|
+
info: (...a) => ne.info(`[API:${r}]`, ...a)
|
|
205
205
|
}, d = Vt.create({
|
|
206
206
|
timeout: t.timeout ?? 1e4,
|
|
207
207
|
baseURL: t.baseURL ?? "",
|
|
@@ -210,48 +210,48 @@ function Zt(t = {}) {
|
|
|
210
210
|
}
|
|
211
211
|
});
|
|
212
212
|
return d.interceptors.request.use(
|
|
213
|
-
(
|
|
214
|
-
const
|
|
213
|
+
(a) => {
|
|
214
|
+
const s = B();
|
|
215
215
|
return c.info("Auth state check:", {
|
|
216
|
-
isAuthenticated:
|
|
217
|
-
hasUser: !!
|
|
218
|
-
hasToken: !!
|
|
219
|
-
}),
|
|
216
|
+
isAuthenticated: s?.isAuthenticated,
|
|
217
|
+
hasUser: !!s?.user,
|
|
218
|
+
hasToken: !!s?.user?.access_token
|
|
219
|
+
}), s?.isAuthenticated && s.user?.access_token ? (a.headers.Authorization = `Bearer ${s.user.access_token}`, c.info("Auth token attached")) : s?.isAuthenticated && !s.user?.access_token ? c.info("User authenticated but token not yet available") : c.info("User not authenticated - request without token"), c.log(`${a.method?.toUpperCase()} ${a.url}`), a;
|
|
220
220
|
},
|
|
221
|
-
(
|
|
221
|
+
(a) => (c.error("Request interceptor error:", a.message), Promise.reject(a))
|
|
222
222
|
), d.interceptors.response.use(
|
|
223
|
-
(
|
|
224
|
-
async (
|
|
225
|
-
const
|
|
226
|
-
if (Kt(
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
const
|
|
230
|
-
return c.warn(`Retrying (${
|
|
223
|
+
(a) => (c.log(`Response ${a.status}:`, a.config.url), a),
|
|
224
|
+
async (a) => {
|
|
225
|
+
const s = a.response?.status, p = a.config?.url, y = a.config?._retryCount ?? 0;
|
|
226
|
+
if (Kt(s) && y < n) {
|
|
227
|
+
const u = a.config;
|
|
228
|
+
u._retryCount = y + 1;
|
|
229
|
+
const h = i * Math.pow(2, y);
|
|
230
|
+
return c.warn(`Retrying (${u._retryCount}/${n}) after ${h}ms:`, p), await Xt(h), d.request(u);
|
|
231
231
|
}
|
|
232
|
-
return
|
|
232
|
+
return s === 401 ? (c.warn("401 Unauthorized - triggering re-auth"), Ht()) : s === 403 ? c.warn("403 Forbidden - insufficient permissions") : s === 404 ? c.warn("404 Not found:", p) : s === 429 ? c.warn("429 Rate limited") : s === 500 ? c.error("500 Server error:", p) : a.response ? c.warn(`Error ${s}:`, a.message) : c.error("Network error - backend may be unavailable:", p), Promise.reject(Yt(a));
|
|
233
233
|
}
|
|
234
234
|
), d;
|
|
235
235
|
}
|
|
236
|
-
const H =
|
|
237
|
-
async function _r(t, r,
|
|
238
|
-
const i = await
|
|
236
|
+
const H = Qt();
|
|
237
|
+
async function _r(t, r, n = H) {
|
|
238
|
+
const i = await n.get(t, { params: r });
|
|
239
239
|
return {
|
|
240
240
|
data: i.data,
|
|
241
241
|
status: i.status,
|
|
242
242
|
ok: i.status >= 200 && i.status < 300
|
|
243
243
|
};
|
|
244
244
|
}
|
|
245
|
-
async function vr(t, r,
|
|
246
|
-
const i = await
|
|
245
|
+
async function vr(t, r, n = H) {
|
|
246
|
+
const i = await n.post(t, r);
|
|
247
247
|
return {
|
|
248
248
|
data: i.data,
|
|
249
249
|
status: i.status,
|
|
250
250
|
ok: i.status >= 200 && i.status < 300
|
|
251
251
|
};
|
|
252
252
|
}
|
|
253
|
-
async function yr(t, r,
|
|
254
|
-
const i = await
|
|
253
|
+
async function yr(t, r, n = H) {
|
|
254
|
+
const i = await n.put(t, r);
|
|
255
255
|
return {
|
|
256
256
|
data: i.data,
|
|
257
257
|
status: i.status,
|
|
@@ -259,27 +259,27 @@ async function yr(t, r, s = H) {
|
|
|
259
259
|
};
|
|
260
260
|
}
|
|
261
261
|
async function Er(t, r = H) {
|
|
262
|
-
const
|
|
262
|
+
const n = await r.delete(t);
|
|
263
263
|
return {
|
|
264
|
-
data:
|
|
265
|
-
status:
|
|
266
|
-
ok:
|
|
264
|
+
data: n.data,
|
|
265
|
+
status: n.status,
|
|
266
|
+
ok: n.status >= 200 && n.status < 300
|
|
267
267
|
};
|
|
268
268
|
}
|
|
269
269
|
function nt(t) {
|
|
270
270
|
if (typeof window > "u") return;
|
|
271
|
-
const r = window.__MF_NAME__ || "unknown",
|
|
271
|
+
const r = window.__MF_NAME__ || "unknown", n = {
|
|
272
272
|
...t,
|
|
273
273
|
mfeName: r,
|
|
274
274
|
timestamp: Date.now()
|
|
275
275
|
};
|
|
276
276
|
window.dispatchEvent(new CustomEvent("mfe-notification", {
|
|
277
|
-
detail:
|
|
277
|
+
detail: n,
|
|
278
278
|
bubbles: !0
|
|
279
279
|
}));
|
|
280
280
|
}
|
|
281
281
|
function Ke(t, r) {
|
|
282
|
-
const
|
|
282
|
+
const n = {
|
|
283
283
|
network: {
|
|
284
284
|
title: "Нет подключения",
|
|
285
285
|
message: "Сервер недоступен. Проверьте подключение к интернету."
|
|
@@ -308,44 +308,44 @@ function Ke(t, r) {
|
|
|
308
308
|
title: "Неизвестная ошибка",
|
|
309
309
|
message: t.message || "Произошла неизвестная ошибка."
|
|
310
310
|
}
|
|
311
|
-
}, i =
|
|
311
|
+
}, i = n[t.type] || n.unknown;
|
|
312
312
|
nt({
|
|
313
313
|
type: t.type === "network" ? "warning" : "error",
|
|
314
314
|
title: i.title,
|
|
315
315
|
message: r ? `${i.message} (${r})` : i.message
|
|
316
316
|
});
|
|
317
317
|
}
|
|
318
|
-
function
|
|
318
|
+
function Zt(t) {
|
|
319
319
|
return t instanceof Error && t.name === "AbortError";
|
|
320
320
|
}
|
|
321
321
|
function ie(t, r = {}) {
|
|
322
322
|
const {
|
|
323
|
-
notifyOnError:
|
|
323
|
+
notifyOnError: n = !0,
|
|
324
324
|
notifyOnSuccess: i = !1,
|
|
325
325
|
successMessage: c,
|
|
326
326
|
errorContext: d,
|
|
327
|
-
onSuccess:
|
|
328
|
-
onError:
|
|
329
|
-
} = r, [
|
|
327
|
+
onSuccess: a,
|
|
328
|
+
onError: s
|
|
329
|
+
} = r, [p, y] = A(null), [u, h] = A(null), [f, E] = A(!1), g = tt(null), C = u !== null, R = p !== null && !f && !C;
|
|
330
330
|
L(() => () => {
|
|
331
|
-
|
|
331
|
+
g.current && g.current.abort();
|
|
332
332
|
}, []);
|
|
333
|
-
const x =
|
|
334
|
-
|
|
335
|
-
}, []),
|
|
336
|
-
|
|
337
|
-
const
|
|
338
|
-
E(!0),
|
|
333
|
+
const x = S(() => {
|
|
334
|
+
g.current && (g.current.abort(), g.current = null, E(!1));
|
|
335
|
+
}, []), _ = S(async () => {
|
|
336
|
+
g.current && g.current.abort(), g.current = new AbortController();
|
|
337
|
+
const P = g.current.signal;
|
|
338
|
+
E(!0), h(null);
|
|
339
339
|
try {
|
|
340
|
-
const O = await t(
|
|
341
|
-
if (
|
|
340
|
+
const O = await t(P);
|
|
341
|
+
if (P.aborted)
|
|
342
342
|
return null;
|
|
343
343
|
if (O.ok)
|
|
344
|
-
return
|
|
344
|
+
return y(O.data), i && c && nt({
|
|
345
345
|
type: "success",
|
|
346
346
|
title: "Успешно",
|
|
347
347
|
message: c
|
|
348
|
-
}),
|
|
348
|
+
}), a?.(O.data), O.data;
|
|
349
349
|
{
|
|
350
350
|
const U = {
|
|
351
351
|
message: O.data || "Request failed",
|
|
@@ -353,47 +353,47 @@ function ie(t, r = {}) {
|
|
|
353
353
|
type: "client",
|
|
354
354
|
timestamp: Date.now()
|
|
355
355
|
};
|
|
356
|
-
return
|
|
356
|
+
return h(U), n && Ke(U, d), s?.(U), null;
|
|
357
357
|
}
|
|
358
358
|
} catch (O) {
|
|
359
|
-
if (
|
|
359
|
+
if (Zt(O))
|
|
360
360
|
return null;
|
|
361
361
|
const U = O;
|
|
362
|
-
return
|
|
362
|
+
return h(U), n && Ke(U, d), s?.(U), null;
|
|
363
363
|
} finally {
|
|
364
|
-
|
|
364
|
+
P.aborted || E(!1), g.current = null;
|
|
365
365
|
}
|
|
366
|
-
}, [t,
|
|
367
|
-
|
|
366
|
+
}, [t, n, i, c, d, a, s]), I = S(() => {
|
|
367
|
+
y(null), h(null), E(!1);
|
|
368
368
|
}, []);
|
|
369
369
|
return {
|
|
370
|
-
data:
|
|
371
|
-
error:
|
|
370
|
+
data: p,
|
|
371
|
+
error: u,
|
|
372
372
|
isLoading: f,
|
|
373
|
-
isError:
|
|
374
|
-
isSuccess:
|
|
375
|
-
execute:
|
|
376
|
-
reset:
|
|
373
|
+
isError: C,
|
|
374
|
+
isSuccess: R,
|
|
375
|
+
execute: _,
|
|
376
|
+
reset: I,
|
|
377
377
|
abort: x
|
|
378
378
|
};
|
|
379
379
|
}
|
|
380
380
|
function wr(t, r = {}) {
|
|
381
|
-
const { skip:
|
|
382
|
-
const
|
|
381
|
+
const { skip: n = !1, headers: i, immediate: c = !0, ...d } = r, a = ye(() => (p) => {
|
|
382
|
+
const y = i ? i() : {};
|
|
383
383
|
return H.get(t, {
|
|
384
|
-
headers: { "Content-Type": "application/json", ...
|
|
385
|
-
signal:
|
|
386
|
-
}).then((
|
|
387
|
-
}, [t, i]),
|
|
384
|
+
headers: { "Content-Type": "application/json", ...y },
|
|
385
|
+
signal: p
|
|
386
|
+
}).then((u) => ({ data: u.data, status: u.status, ok: u.status >= 200 && u.status < 300 }));
|
|
387
|
+
}, [t, i]), s = ie(a, { ...d });
|
|
388
388
|
return L(() => {
|
|
389
|
-
c && !
|
|
390
|
-
}, [c,
|
|
389
|
+
c && !n && s.execute();
|
|
390
|
+
}, [c, n, t]), s;
|
|
391
391
|
}
|
|
392
|
-
function br(t, r,
|
|
393
|
-
return ie((c) => H.post(t, r, { signal: c }).then((d) => ({ data: d.data, status: d.status, ok: d.status >= 200 && d.status < 300 })),
|
|
392
|
+
function br(t, r, n = {}) {
|
|
393
|
+
return ie((c) => H.post(t, r, { signal: c }).then((d) => ({ data: d.data, status: d.status, ok: d.status >= 200 && d.status < 300 })), n);
|
|
394
394
|
}
|
|
395
|
-
function xr(t, r,
|
|
396
|
-
return ie((c) => H.put(t, r, { signal: c }).then((d) => ({ data: d.data, status: d.status, ok: d.status >= 200 && d.status < 300 })),
|
|
395
|
+
function xr(t, r, n = {}) {
|
|
396
|
+
return ie((c) => H.put(t, r, { signal: c }).then((d) => ({ data: d.data, status: d.status, ok: d.status >= 200 && d.status < 300 })), n);
|
|
397
397
|
}
|
|
398
398
|
function kr(t, r = {}) {
|
|
399
399
|
return ie((i) => H.delete(t, { signal: i }).then((c) => ({ data: c.data, status: c.status, ok: c.status >= 200 && c.status < 300 })), r);
|
|
@@ -408,287 +408,287 @@ const er = {
|
|
|
408
408
|
canManageUsers: ["ibdop-admin"]
|
|
409
409
|
};
|
|
410
410
|
function Ar(t = {}) {
|
|
411
|
-
const r = ae(),
|
|
411
|
+
const r = ae(), n = ye(() => ({
|
|
412
412
|
...er,
|
|
413
413
|
...t
|
|
414
414
|
}), [t]), i = ye(() => {
|
|
415
415
|
const d = r.user?.profile?.realm_roles || r.user?.profile?.roles || [];
|
|
416
416
|
return Array.isArray(d) ? d : [d];
|
|
417
|
-
}, [r.user]), c = (d) => d.includes("all") ? !0 : d.some((
|
|
417
|
+
}, [r.user]), c = (d) => d.includes("all") ? !0 : d.some((a) => i.includes(a));
|
|
418
418
|
return {
|
|
419
|
-
canView: c(
|
|
420
|
-
canEdit: c(
|
|
421
|
-
canDelete: c(
|
|
422
|
-
canAdmin: c(
|
|
423
|
-
canViewSensitiveData: c(
|
|
424
|
-
canExportData: c(
|
|
425
|
-
canManageUsers: c(
|
|
419
|
+
canView: c(n.canView),
|
|
420
|
+
canEdit: c(n.canEdit),
|
|
421
|
+
canDelete: c(n.canDelete),
|
|
422
|
+
canAdmin: c(n.canAdmin),
|
|
423
|
+
canViewSensitiveData: c(n.canViewSensitiveData),
|
|
424
|
+
canExportData: c(n.canExportData),
|
|
425
|
+
canManageUsers: c(n.canManageUsers)
|
|
426
426
|
};
|
|
427
427
|
}
|
|
428
428
|
function Tr() {
|
|
429
|
-
const t = ae(), [r,
|
|
429
|
+
const t = ae(), [r, n] = A([]), [i, c] = A(0), [d, a] = A([]), [s, p] = A(!0), [y, u] = A(null), h = S(async () => {
|
|
430
430
|
if (!t.isAuthenticated) {
|
|
431
|
-
console.debug("[useFeatures] Not authenticated"),
|
|
431
|
+
console.debug("[useFeatures] Not authenticated"), p(!1);
|
|
432
432
|
return;
|
|
433
433
|
}
|
|
434
|
-
|
|
434
|
+
p(!0), u(null);
|
|
435
435
|
try {
|
|
436
|
-
const
|
|
436
|
+
const g = {
|
|
437
437
|
"Content-Type": "application/json"
|
|
438
|
-
},
|
|
439
|
-
|
|
440
|
-
const
|
|
441
|
-
if (!
|
|
442
|
-
throw new Error(`HTTP ${
|
|
443
|
-
const x = await
|
|
444
|
-
|
|
445
|
-
} catch (
|
|
446
|
-
console.debug("Features fetch error:",
|
|
438
|
+
}, C = t.user?.access_token;
|
|
439
|
+
C && (g.Authorization = `Bearer ${C}`);
|
|
440
|
+
const R = await fetch("/api/features", { headers: g });
|
|
441
|
+
if (!R.ok)
|
|
442
|
+
throw new Error(`HTTP ${R.status}: ${R.statusText}`);
|
|
443
|
+
const x = await R.json();
|
|
444
|
+
n(x.features || []), c(x.totalCount || 0), a(x.userRoles || []);
|
|
445
|
+
} catch (g) {
|
|
446
|
+
console.debug("Features fetch error:", g), u(g instanceof Error ? g.message : String(g)), n([]), a([]);
|
|
447
447
|
} finally {
|
|
448
|
-
|
|
448
|
+
p(!1);
|
|
449
449
|
}
|
|
450
450
|
}, [t.isAuthenticated, t.user?.access_token]);
|
|
451
451
|
L(() => {
|
|
452
|
-
|
|
453
|
-
}, [
|
|
454
|
-
const f =
|
|
455
|
-
(
|
|
452
|
+
h();
|
|
453
|
+
}, [h]);
|
|
454
|
+
const f = S(
|
|
455
|
+
(g) => r.find((R) => R.name === g)?.userEnabled ?? !1,
|
|
456
456
|
[r]
|
|
457
|
-
), E =
|
|
458
|
-
(
|
|
457
|
+
), E = S(
|
|
458
|
+
(g) => r.filter((C) => C.mfDependencies?.includes(g)),
|
|
459
459
|
[r]
|
|
460
460
|
);
|
|
461
461
|
return {
|
|
462
462
|
features: r,
|
|
463
463
|
totalCount: i,
|
|
464
464
|
userRoles: d,
|
|
465
|
-
isLoading:
|
|
466
|
-
error:
|
|
467
|
-
refetch:
|
|
465
|
+
isLoading: s,
|
|
466
|
+
error: y,
|
|
467
|
+
refetch: h,
|
|
468
468
|
isFeatureEnabled: f,
|
|
469
469
|
getFeaturesByMf: E
|
|
470
470
|
};
|
|
471
471
|
}
|
|
472
|
-
function
|
|
473
|
-
const t = ae(), [r,
|
|
472
|
+
function Rr() {
|
|
473
|
+
const t = ae(), [r, n] = A([]), [i, c] = A([]), [d, a] = A(!1), [s, p] = A(!0), [y, u] = A(null), h = S(async () => {
|
|
474
474
|
if (!t.isAuthenticated) {
|
|
475
|
-
console.debug("[useFeatureAdmin] Not authenticated"),
|
|
475
|
+
console.debug("[useFeatureAdmin] Not authenticated"), p(!1);
|
|
476
476
|
return;
|
|
477
477
|
}
|
|
478
|
-
|
|
478
|
+
p(!0), u(null);
|
|
479
479
|
try {
|
|
480
|
-
const
|
|
480
|
+
const R = {
|
|
481
481
|
"Content-Type": "application/json"
|
|
482
482
|
}, x = t.user?.access_token;
|
|
483
|
-
x && (
|
|
484
|
-
const
|
|
485
|
-
if (!
|
|
486
|
-
if (
|
|
487
|
-
console.warn("[useFeatureAdmin] 403 Forbidden - checking if token has admin role"),
|
|
483
|
+
x && (R.Authorization = `Bearer ${x}`);
|
|
484
|
+
const _ = await fetch("/api/features/admin", { headers: R });
|
|
485
|
+
if (!_.ok) {
|
|
486
|
+
if (_.status === 403) {
|
|
487
|
+
console.warn("[useFeatureAdmin] 403 Forbidden - checking if token has admin role"), a(!1), n([]), c([]), p(!1);
|
|
488
488
|
return;
|
|
489
489
|
}
|
|
490
|
-
throw new Error(`HTTP ${
|
|
490
|
+
throw new Error(`HTTP ${_.status}: ${_.statusText}`);
|
|
491
491
|
}
|
|
492
|
-
const
|
|
493
|
-
|
|
494
|
-
} catch (
|
|
495
|
-
console.debug("FeatureAdmin fetch error:",
|
|
492
|
+
const I = await _.json();
|
|
493
|
+
n(I.featureToggles || []), c(I.microfrontends || []), a(I.isAdmin || !1);
|
|
494
|
+
} catch (R) {
|
|
495
|
+
console.debug("FeatureAdmin fetch error:", R), n([]), c([]), a(!1);
|
|
496
496
|
} finally {
|
|
497
|
-
|
|
497
|
+
p(!1);
|
|
498
498
|
}
|
|
499
|
-
}, [t.isAuthenticated, t.user?.access_token]), f =
|
|
500
|
-
async (
|
|
499
|
+
}, [t.isAuthenticated, t.user?.access_token]), f = S(
|
|
500
|
+
async (R) => {
|
|
501
501
|
try {
|
|
502
502
|
const x = {
|
|
503
503
|
"Content-Type": "application/json"
|
|
504
|
-
},
|
|
505
|
-
|
|
506
|
-
const
|
|
504
|
+
}, _ = t.user?.access_token;
|
|
505
|
+
_ && (x.Authorization = `Bearer ${_}`);
|
|
506
|
+
const I = await fetch("/api/features/admin", {
|
|
507
507
|
method: "POST",
|
|
508
508
|
headers: x,
|
|
509
|
-
body: JSON.stringify(
|
|
509
|
+
body: JSON.stringify(R)
|
|
510
510
|
});
|
|
511
|
-
if (!
|
|
512
|
-
const
|
|
513
|
-
throw new Error(
|
|
511
|
+
if (!I.ok) {
|
|
512
|
+
const P = await I.json().catch(() => ({}));
|
|
513
|
+
throw new Error(P.error || `HTTP ${I.status}`);
|
|
514
514
|
}
|
|
515
|
-
return await
|
|
515
|
+
return await h(), !0;
|
|
516
516
|
} catch (x) {
|
|
517
|
-
return
|
|
517
|
+
return u(x instanceof Error ? x.message : String(x)), !1;
|
|
518
518
|
}
|
|
519
519
|
},
|
|
520
|
-
[
|
|
521
|
-
), E =
|
|
522
|
-
async (
|
|
520
|
+
[h]
|
|
521
|
+
), E = S(
|
|
522
|
+
async (R, x) => {
|
|
523
523
|
try {
|
|
524
|
-
const
|
|
524
|
+
const _ = {
|
|
525
525
|
"Content-Type": "application/json"
|
|
526
|
-
},
|
|
527
|
-
|
|
528
|
-
const
|
|
526
|
+
}, I = t.user?.access_token;
|
|
527
|
+
I && (_.Authorization = `Bearer ${I}`);
|
|
528
|
+
const P = await fetch(`/api/features/admin/${encodeURIComponent(R)}`, {
|
|
529
529
|
method: "PUT",
|
|
530
|
-
headers:
|
|
530
|
+
headers: _,
|
|
531
531
|
body: JSON.stringify(x)
|
|
532
532
|
});
|
|
533
|
-
if (!
|
|
534
|
-
const O = await
|
|
535
|
-
throw new Error(O.error || `HTTP ${
|
|
533
|
+
if (!P.ok) {
|
|
534
|
+
const O = await P.json().catch(() => ({}));
|
|
535
|
+
throw new Error(O.error || `HTTP ${P.status}`);
|
|
536
536
|
}
|
|
537
|
-
return await
|
|
538
|
-
} catch (
|
|
539
|
-
return
|
|
537
|
+
return await h(), !0;
|
|
538
|
+
} catch (_) {
|
|
539
|
+
return u(_ instanceof Error ? _.message : String(_)), !1;
|
|
540
540
|
}
|
|
541
541
|
},
|
|
542
|
-
[
|
|
543
|
-
),
|
|
544
|
-
async (
|
|
542
|
+
[h]
|
|
543
|
+
), g = S(
|
|
544
|
+
async (R, x) => {
|
|
545
545
|
try {
|
|
546
|
-
const
|
|
547
|
-
|
|
548
|
-
const
|
|
549
|
-
`/api/features/admin/${encodeURIComponent(
|
|
546
|
+
const _ = {}, I = t.user?.access_token;
|
|
547
|
+
I && (_.Authorization = `Bearer ${I}`);
|
|
548
|
+
const P = await fetch(
|
|
549
|
+
`/api/features/admin/${encodeURIComponent(R)}/toggle?enabled=${x}`,
|
|
550
550
|
{
|
|
551
551
|
method: "POST",
|
|
552
|
-
headers:
|
|
552
|
+
headers: _
|
|
553
553
|
}
|
|
554
554
|
);
|
|
555
|
-
if (!
|
|
556
|
-
const O = await
|
|
557
|
-
throw new Error(O.error || `HTTP ${
|
|
555
|
+
if (!P.ok) {
|
|
556
|
+
const O = await P.json().catch(() => ({}));
|
|
557
|
+
throw new Error(O.error || `HTTP ${P.status}`);
|
|
558
558
|
}
|
|
559
|
-
return await
|
|
560
|
-
} catch (
|
|
561
|
-
return
|
|
559
|
+
return await h(), !0;
|
|
560
|
+
} catch (_) {
|
|
561
|
+
return u(_ instanceof Error ? _.message : String(_)), !1;
|
|
562
562
|
}
|
|
563
563
|
},
|
|
564
|
-
[
|
|
565
|
-
),
|
|
566
|
-
async (
|
|
564
|
+
[h]
|
|
565
|
+
), C = S(
|
|
566
|
+
async (R) => {
|
|
567
567
|
try {
|
|
568
|
-
const x = {},
|
|
569
|
-
|
|
570
|
-
const
|
|
568
|
+
const x = {}, _ = t.user?.access_token;
|
|
569
|
+
_ && (x.Authorization = `Bearer ${_}`);
|
|
570
|
+
const I = await fetch(`/api/features/admin/${encodeURIComponent(R)}`, {
|
|
571
571
|
method: "DELETE",
|
|
572
572
|
headers: x
|
|
573
573
|
});
|
|
574
|
-
if (!
|
|
575
|
-
const
|
|
576
|
-
throw new Error(
|
|
574
|
+
if (!I.ok) {
|
|
575
|
+
const P = await I.json().catch(() => ({}));
|
|
576
|
+
throw new Error(P.error || `HTTP ${I.status}`);
|
|
577
577
|
}
|
|
578
|
-
return await
|
|
578
|
+
return await h(), !0;
|
|
579
579
|
} catch (x) {
|
|
580
|
-
return
|
|
580
|
+
return u(x instanceof Error ? x.message : String(x)), !1;
|
|
581
581
|
}
|
|
582
582
|
},
|
|
583
|
-
[
|
|
583
|
+
[h]
|
|
584
584
|
);
|
|
585
585
|
return L(() => {
|
|
586
|
-
|
|
587
|
-
}, [
|
|
586
|
+
h();
|
|
587
|
+
}, [h]), {
|
|
588
588
|
features: r,
|
|
589
589
|
microfrontends: i,
|
|
590
590
|
isAdmin: d,
|
|
591
|
-
isLoading:
|
|
592
|
-
error:
|
|
593
|
-
refetch:
|
|
591
|
+
isLoading: s,
|
|
592
|
+
error: y,
|
|
593
|
+
refetch: h,
|
|
594
594
|
createFeature: f,
|
|
595
595
|
updateFeature: E,
|
|
596
|
-
toggleFeature:
|
|
597
|
-
deleteFeature:
|
|
596
|
+
toggleFeature: g,
|
|
597
|
+
deleteFeature: C
|
|
598
598
|
};
|
|
599
599
|
}
|
|
600
|
-
function
|
|
601
|
-
const t = ae(), [r,
|
|
600
|
+
function Sr() {
|
|
601
|
+
const t = ae(), [r, n] = A([]), [i, c] = A(0), [d, a] = A(!0), [s, p] = A(null), y = S(async () => {
|
|
602
602
|
if (!t.isAuthenticated) {
|
|
603
|
-
|
|
603
|
+
a(!1);
|
|
604
604
|
return;
|
|
605
605
|
}
|
|
606
|
-
|
|
606
|
+
a(!0), p(null);
|
|
607
607
|
try {
|
|
608
|
-
const
|
|
608
|
+
const u = {
|
|
609
609
|
"Content-Type": "application/json"
|
|
610
|
-
},
|
|
611
|
-
|
|
612
|
-
const f = await fetch("/api/features/microfrontends", { headers:
|
|
610
|
+
}, h = t.user?.access_token;
|
|
611
|
+
h && (u.Authorization = `Bearer ${h}`);
|
|
612
|
+
const f = await fetch("/api/features/microfrontends", { headers: u });
|
|
613
613
|
if (!f.ok)
|
|
614
614
|
throw new Error(`HTTP ${f.status}: ${f.statusText}`);
|
|
615
615
|
const E = await f.json();
|
|
616
|
-
|
|
617
|
-
} catch (
|
|
618
|
-
|
|
616
|
+
n(E.microfrontends || []), c(E.totalCount || 0);
|
|
617
|
+
} catch (u) {
|
|
618
|
+
p(u instanceof Error ? u.message : String(u));
|
|
619
619
|
} finally {
|
|
620
|
-
|
|
620
|
+
a(!1);
|
|
621
621
|
}
|
|
622
622
|
}, [t.isAuthenticated, t.user?.access_token]);
|
|
623
623
|
return L(() => {
|
|
624
|
-
|
|
625
|
-
}, [
|
|
624
|
+
y();
|
|
625
|
+
}, [y]), {
|
|
626
626
|
microfrontends: r,
|
|
627
627
|
totalCount: i,
|
|
628
628
|
isLoading: d,
|
|
629
|
-
error:
|
|
630
|
-
refetch:
|
|
629
|
+
error: s,
|
|
630
|
+
refetch: y
|
|
631
631
|
};
|
|
632
632
|
}
|
|
633
|
-
var
|
|
633
|
+
var oe = { exports: {} }, K = {};
|
|
634
634
|
var Xe;
|
|
635
635
|
function tr() {
|
|
636
636
|
if (Xe) return K;
|
|
637
637
|
Xe = 1;
|
|
638
|
-
var t = et, r = /* @__PURE__ */ Symbol.for("react.element"),
|
|
639
|
-
function
|
|
640
|
-
var
|
|
641
|
-
|
|
642
|
-
for (
|
|
643
|
-
if (
|
|
644
|
-
return { $$typeof: r, type:
|
|
638
|
+
var t = et, r = /* @__PURE__ */ Symbol.for("react.element"), n = /* @__PURE__ */ Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, c = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, d = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
639
|
+
function a(s, p, y) {
|
|
640
|
+
var u, h = {}, f = null, E = null;
|
|
641
|
+
y !== void 0 && (f = "" + y), p.key !== void 0 && (f = "" + p.key), p.ref !== void 0 && (E = p.ref);
|
|
642
|
+
for (u in p) i.call(p, u) && !d.hasOwnProperty(u) && (h[u] = p[u]);
|
|
643
|
+
if (s && s.defaultProps) for (u in p = s.defaultProps, p) h[u] === void 0 && (h[u] = p[u]);
|
|
644
|
+
return { $$typeof: r, type: s, key: f, ref: E, props: h, _owner: c.current };
|
|
645
645
|
}
|
|
646
|
-
return K.Fragment =
|
|
646
|
+
return K.Fragment = n, K.jsx = a, K.jsxs = a, K;
|
|
647
647
|
}
|
|
648
648
|
var X = {};
|
|
649
|
-
var
|
|
649
|
+
var Qe;
|
|
650
650
|
function rr() {
|
|
651
|
-
return
|
|
652
|
-
var t = et, r = /* @__PURE__ */ Symbol.for("react.element"),
|
|
653
|
-
function
|
|
651
|
+
return Qe || (Qe = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
652
|
+
var t = et, r = /* @__PURE__ */ Symbol.for("react.element"), n = /* @__PURE__ */ Symbol.for("react.portal"), i = /* @__PURE__ */ Symbol.for("react.fragment"), c = /* @__PURE__ */ Symbol.for("react.strict_mode"), d = /* @__PURE__ */ Symbol.for("react.profiler"), a = /* @__PURE__ */ Symbol.for("react.provider"), s = /* @__PURE__ */ Symbol.for("react.context"), p = /* @__PURE__ */ Symbol.for("react.forward_ref"), y = /* @__PURE__ */ Symbol.for("react.suspense"), u = /* @__PURE__ */ Symbol.for("react.suspense_list"), h = /* @__PURE__ */ Symbol.for("react.memo"), f = /* @__PURE__ */ Symbol.for("react.lazy"), E = /* @__PURE__ */ Symbol.for("react.offscreen"), g = Symbol.iterator, C = "@@iterator";
|
|
653
|
+
function R(e) {
|
|
654
654
|
if (e === null || typeof e != "object")
|
|
655
655
|
return null;
|
|
656
|
-
var
|
|
657
|
-
return typeof
|
|
656
|
+
var o = g && e[g] || e[C];
|
|
657
|
+
return typeof o == "function" ? o : null;
|
|
658
658
|
}
|
|
659
659
|
var x = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
660
|
-
function
|
|
660
|
+
function _(e) {
|
|
661
661
|
{
|
|
662
|
-
for (var
|
|
663
|
-
|
|
664
|
-
|
|
662
|
+
for (var o = arguments.length, l = new Array(o > 1 ? o - 1 : 0), m = 1; m < o; m++)
|
|
663
|
+
l[m - 1] = arguments[m];
|
|
664
|
+
I("error", e, l);
|
|
665
665
|
}
|
|
666
666
|
}
|
|
667
|
-
function
|
|
667
|
+
function I(e, o, l) {
|
|
668
668
|
{
|
|
669
|
-
var
|
|
670
|
-
k !== "" && (
|
|
671
|
-
var T =
|
|
669
|
+
var m = x.ReactDebugCurrentFrame, k = m.getStackAddendum();
|
|
670
|
+
k !== "" && (o += "%s", l = l.concat([k]));
|
|
671
|
+
var T = l.map(function(b) {
|
|
672
672
|
return String(b);
|
|
673
673
|
});
|
|
674
|
-
T.unshift("Warning: " +
|
|
674
|
+
T.unshift("Warning: " + o), Function.prototype.apply.call(console[e], console, T);
|
|
675
675
|
}
|
|
676
676
|
}
|
|
677
|
-
var
|
|
677
|
+
var P = !1, O = !1, U = !1, ct = !1, ut = !1, ke;
|
|
678
678
|
ke = /* @__PURE__ */ Symbol.for("react.module.reference");
|
|
679
679
|
function lt(e) {
|
|
680
|
-
return !!(typeof e == "string" || typeof e == "function" || e === i || e === d || ut || e === c || e ===
|
|
680
|
+
return !!(typeof e == "string" || typeof e == "function" || e === i || e === d || ut || e === c || e === y || e === u || ct || e === E || P || O || U || typeof e == "object" && e !== null && (e.$$typeof === f || e.$$typeof === h || e.$$typeof === a || e.$$typeof === s || e.$$typeof === p || // This needs to include all possible module reference object
|
|
681
681
|
// types supported by any Flight configuration anywhere since
|
|
682
682
|
// we don't know which Flight build this will end up being used
|
|
683
683
|
// with.
|
|
684
684
|
e.$$typeof === ke || e.getModuleId !== void 0));
|
|
685
685
|
}
|
|
686
|
-
function ft(e,
|
|
687
|
-
var
|
|
688
|
-
if (
|
|
689
|
-
return
|
|
690
|
-
var k =
|
|
691
|
-
return k !== "" ?
|
|
686
|
+
function ft(e, o, l) {
|
|
687
|
+
var m = e.displayName;
|
|
688
|
+
if (m)
|
|
689
|
+
return m;
|
|
690
|
+
var k = o.displayName || o.name || "";
|
|
691
|
+
return k !== "" ? l + "(" + k + ")" : l;
|
|
692
692
|
}
|
|
693
693
|
function Ae(e) {
|
|
694
694
|
return e.displayName || "Context";
|
|
@@ -696,37 +696,37 @@ function rr() {
|
|
|
696
696
|
function V(e) {
|
|
697
697
|
if (e == null)
|
|
698
698
|
return null;
|
|
699
|
-
if (typeof e.tag == "number" &&
|
|
699
|
+
if (typeof e.tag == "number" && _("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
700
700
|
return e.displayName || e.name || null;
|
|
701
701
|
if (typeof e == "string")
|
|
702
702
|
return e;
|
|
703
703
|
switch (e) {
|
|
704
704
|
case i:
|
|
705
705
|
return "Fragment";
|
|
706
|
-
case
|
|
706
|
+
case n:
|
|
707
707
|
return "Portal";
|
|
708
708
|
case d:
|
|
709
709
|
return "Profiler";
|
|
710
710
|
case c:
|
|
711
711
|
return "StrictMode";
|
|
712
|
-
case
|
|
712
|
+
case y:
|
|
713
713
|
return "Suspense";
|
|
714
|
-
case
|
|
714
|
+
case u:
|
|
715
715
|
return "SuspenseList";
|
|
716
716
|
}
|
|
717
717
|
if (typeof e == "object")
|
|
718
718
|
switch (e.$$typeof) {
|
|
719
|
+
case s:
|
|
720
|
+
var o = e;
|
|
721
|
+
return Ae(o) + ".Consumer";
|
|
719
722
|
case a:
|
|
720
|
-
var
|
|
721
|
-
return Ae(
|
|
722
|
-
case
|
|
723
|
-
var u = e;
|
|
724
|
-
return Ae(u._context) + ".Provider";
|
|
725
|
-
case h:
|
|
723
|
+
var l = e;
|
|
724
|
+
return Ae(l._context) + ".Provider";
|
|
725
|
+
case p:
|
|
726
726
|
return ft(e, e.render, "ForwardRef");
|
|
727
|
-
case
|
|
728
|
-
var
|
|
729
|
-
return
|
|
727
|
+
case h:
|
|
728
|
+
var m = e.displayName || null;
|
|
729
|
+
return m !== null ? m : V(e.type) || "Memo";
|
|
730
730
|
case f: {
|
|
731
731
|
var k = e, T = k._payload, b = k._init;
|
|
732
732
|
try {
|
|
@@ -738,18 +738,18 @@ function rr() {
|
|
|
738
738
|
}
|
|
739
739
|
return null;
|
|
740
740
|
}
|
|
741
|
-
var
|
|
742
|
-
function
|
|
741
|
+
var z = Object.assign, q = 0, Te, Re, Se, Ce, Ie, Me, Ne;
|
|
742
|
+
function Pe() {
|
|
743
743
|
}
|
|
744
|
-
|
|
744
|
+
Pe.__reactDisabledLog = !0;
|
|
745
745
|
function dt() {
|
|
746
746
|
{
|
|
747
747
|
if (q === 0) {
|
|
748
|
-
Te = console.log,
|
|
748
|
+
Te = console.log, Re = console.info, Se = console.warn, Ce = console.error, Ie = console.group, Me = console.groupCollapsed, Ne = console.groupEnd;
|
|
749
749
|
var e = {
|
|
750
750
|
configurable: !0,
|
|
751
751
|
enumerable: !0,
|
|
752
|
-
value:
|
|
752
|
+
value: Pe,
|
|
753
753
|
writable: !0
|
|
754
754
|
};
|
|
755
755
|
Object.defineProperties(console, {
|
|
@@ -774,67 +774,67 @@ function rr() {
|
|
|
774
774
|
writable: !0
|
|
775
775
|
};
|
|
776
776
|
Object.defineProperties(console, {
|
|
777
|
-
log:
|
|
777
|
+
log: z({}, e, {
|
|
778
778
|
value: Te
|
|
779
779
|
}),
|
|
780
|
-
info:
|
|
781
|
-
value: Se
|
|
782
|
-
}),
|
|
783
|
-
warn: W({}, e, {
|
|
780
|
+
info: z({}, e, {
|
|
784
781
|
value: Re
|
|
785
782
|
}),
|
|
786
|
-
|
|
783
|
+
warn: z({}, e, {
|
|
784
|
+
value: Se
|
|
785
|
+
}),
|
|
786
|
+
error: z({}, e, {
|
|
787
787
|
value: Ce
|
|
788
788
|
}),
|
|
789
|
-
group:
|
|
789
|
+
group: z({}, e, {
|
|
790
790
|
value: Ie
|
|
791
791
|
}),
|
|
792
|
-
groupCollapsed:
|
|
792
|
+
groupCollapsed: z({}, e, {
|
|
793
793
|
value: Me
|
|
794
794
|
}),
|
|
795
|
-
groupEnd:
|
|
795
|
+
groupEnd: z({}, e, {
|
|
796
796
|
value: Ne
|
|
797
797
|
})
|
|
798
798
|
});
|
|
799
799
|
}
|
|
800
|
-
q < 0 &&
|
|
800
|
+
q < 0 && _("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
801
801
|
}
|
|
802
802
|
}
|
|
803
803
|
var ue = x.ReactCurrentDispatcher, le;
|
|
804
|
-
function
|
|
804
|
+
function Q(e, o, l) {
|
|
805
805
|
{
|
|
806
806
|
if (le === void 0)
|
|
807
807
|
try {
|
|
808
808
|
throw Error();
|
|
809
809
|
} catch (k) {
|
|
810
|
-
var
|
|
811
|
-
le =
|
|
810
|
+
var m = k.stack.trim().match(/\n( *(at )?)/);
|
|
811
|
+
le = m && m[1] || "";
|
|
812
812
|
}
|
|
813
813
|
return `
|
|
814
814
|
` + le + e;
|
|
815
815
|
}
|
|
816
816
|
}
|
|
817
|
-
var fe = !1,
|
|
817
|
+
var fe = !1, Z;
|
|
818
818
|
{
|
|
819
819
|
var ht = typeof WeakMap == "function" ? WeakMap : Map;
|
|
820
|
-
|
|
820
|
+
Z = new ht();
|
|
821
821
|
}
|
|
822
|
-
function Oe(e,
|
|
822
|
+
function Oe(e, o) {
|
|
823
823
|
if (!e || fe)
|
|
824
824
|
return "";
|
|
825
825
|
{
|
|
826
|
-
var
|
|
827
|
-
if (
|
|
828
|
-
return
|
|
826
|
+
var l = Z.get(e);
|
|
827
|
+
if (l !== void 0)
|
|
828
|
+
return l;
|
|
829
829
|
}
|
|
830
|
-
var
|
|
830
|
+
var m;
|
|
831
831
|
fe = !0;
|
|
832
832
|
var k = Error.prepareStackTrace;
|
|
833
833
|
Error.prepareStackTrace = void 0;
|
|
834
834
|
var T;
|
|
835
835
|
T = ue.current, ue.current = null, dt();
|
|
836
836
|
try {
|
|
837
|
-
if (
|
|
837
|
+
if (o) {
|
|
838
838
|
var b = function() {
|
|
839
839
|
throw Error();
|
|
840
840
|
};
|
|
@@ -846,14 +846,14 @@ function rr() {
|
|
|
846
846
|
try {
|
|
847
847
|
Reflect.construct(b, []);
|
|
848
848
|
} catch (F) {
|
|
849
|
-
|
|
849
|
+
m = F;
|
|
850
850
|
}
|
|
851
851
|
Reflect.construct(e, [], b);
|
|
852
852
|
} else {
|
|
853
853
|
try {
|
|
854
854
|
b.call();
|
|
855
855
|
} catch (F) {
|
|
856
|
-
|
|
856
|
+
m = F;
|
|
857
857
|
}
|
|
858
858
|
e.call(b.prototype);
|
|
859
859
|
}
|
|
@@ -861,80 +861,80 @@ function rr() {
|
|
|
861
861
|
try {
|
|
862
862
|
throw Error();
|
|
863
863
|
} catch (F) {
|
|
864
|
-
|
|
864
|
+
m = F;
|
|
865
865
|
}
|
|
866
866
|
e();
|
|
867
867
|
}
|
|
868
868
|
} catch (F) {
|
|
869
|
-
if (F &&
|
|
869
|
+
if (F && m && typeof F.stack == "string") {
|
|
870
870
|
for (var w = F.stack.split(`
|
|
871
|
-
`),
|
|
872
|
-
`),
|
|
873
|
-
|
|
874
|
-
for (;
|
|
875
|
-
if (w[
|
|
876
|
-
if (
|
|
871
|
+
`), j = m.stack.split(`
|
|
872
|
+
`), M = w.length - 1, N = j.length - 1; M >= 1 && N >= 0 && w[M] !== j[N]; )
|
|
873
|
+
N--;
|
|
874
|
+
for (; M >= 1 && N >= 0; M--, N--)
|
|
875
|
+
if (w[M] !== j[N]) {
|
|
876
|
+
if (M !== 1 || N !== 1)
|
|
877
877
|
do
|
|
878
|
-
if (
|
|
878
|
+
if (M--, N--, N < 0 || w[M] !== j[N]) {
|
|
879
879
|
var $ = `
|
|
880
|
-
` + w[
|
|
881
|
-
return e.displayName && $.includes("<anonymous>") && ($ = $.replace("<anonymous>", e.displayName)), typeof e == "function" &&
|
|
880
|
+
` + w[M].replace(" at new ", " at ");
|
|
881
|
+
return e.displayName && $.includes("<anonymous>") && ($ = $.replace("<anonymous>", e.displayName)), typeof e == "function" && Z.set(e, $), $;
|
|
882
882
|
}
|
|
883
|
-
while (
|
|
883
|
+
while (M >= 1 && N >= 0);
|
|
884
884
|
break;
|
|
885
885
|
}
|
|
886
886
|
}
|
|
887
887
|
} finally {
|
|
888
888
|
fe = !1, ue.current = T, pt(), Error.prepareStackTrace = k;
|
|
889
889
|
}
|
|
890
|
-
var Y = e ? e.displayName || e.name : "",
|
|
891
|
-
return typeof e == "function" &&
|
|
890
|
+
var Y = e ? e.displayName || e.name : "", W = Y ? Q(Y) : "";
|
|
891
|
+
return typeof e == "function" && Z.set(e, W), W;
|
|
892
892
|
}
|
|
893
|
-
function mt(e,
|
|
893
|
+
function mt(e, o, l) {
|
|
894
894
|
return Oe(e, !1);
|
|
895
895
|
}
|
|
896
896
|
function gt(e) {
|
|
897
|
-
var
|
|
898
|
-
return !!(
|
|
897
|
+
var o = e.prototype;
|
|
898
|
+
return !!(o && o.isReactComponent);
|
|
899
899
|
}
|
|
900
|
-
function ee(e,
|
|
900
|
+
function ee(e, o, l) {
|
|
901
901
|
if (e == null)
|
|
902
902
|
return "";
|
|
903
903
|
if (typeof e == "function")
|
|
904
904
|
return Oe(e, gt(e));
|
|
905
905
|
if (typeof e == "string")
|
|
906
|
-
return
|
|
906
|
+
return Q(e);
|
|
907
907
|
switch (e) {
|
|
908
|
-
case
|
|
909
|
-
return
|
|
910
|
-
case
|
|
911
|
-
return
|
|
908
|
+
case y:
|
|
909
|
+
return Q("Suspense");
|
|
910
|
+
case u:
|
|
911
|
+
return Q("SuspenseList");
|
|
912
912
|
}
|
|
913
913
|
if (typeof e == "object")
|
|
914
914
|
switch (e.$$typeof) {
|
|
915
|
-
case
|
|
915
|
+
case p:
|
|
916
916
|
return mt(e.render);
|
|
917
|
-
case
|
|
918
|
-
return ee(e.type,
|
|
917
|
+
case h:
|
|
918
|
+
return ee(e.type, o, l);
|
|
919
919
|
case f: {
|
|
920
|
-
var
|
|
920
|
+
var m = e, k = m._payload, T = m._init;
|
|
921
921
|
try {
|
|
922
|
-
return ee(T(k),
|
|
922
|
+
return ee(T(k), o, l);
|
|
923
923
|
} catch {
|
|
924
924
|
}
|
|
925
925
|
}
|
|
926
926
|
}
|
|
927
927
|
return "";
|
|
928
928
|
}
|
|
929
|
-
var J = Object.prototype.hasOwnProperty,
|
|
929
|
+
var J = Object.prototype.hasOwnProperty, je = {}, De = x.ReactDebugCurrentFrame;
|
|
930
930
|
function te(e) {
|
|
931
931
|
if (e) {
|
|
932
|
-
var
|
|
933
|
-
De.setExtraStackFrame(
|
|
932
|
+
var o = e._owner, l = ee(e.type, e._source, o ? o.type : null);
|
|
933
|
+
De.setExtraStackFrame(l);
|
|
934
934
|
} else
|
|
935
935
|
De.setExtraStackFrame(null);
|
|
936
936
|
}
|
|
937
|
-
function _t(e,
|
|
937
|
+
function _t(e, o, l, m, k) {
|
|
938
938
|
{
|
|
939
939
|
var T = Function.call.bind(J);
|
|
940
940
|
for (var b in e)
|
|
@@ -942,14 +942,14 @@ function rr() {
|
|
|
942
942
|
var w = void 0;
|
|
943
943
|
try {
|
|
944
944
|
if (typeof e[b] != "function") {
|
|
945
|
-
var
|
|
946
|
-
throw
|
|
945
|
+
var j = Error((m || "React class") + ": " + l + " type `" + b + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[b] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
946
|
+
throw j.name = "Invariant Violation", j;
|
|
947
947
|
}
|
|
948
|
-
w = e[b](
|
|
949
|
-
} catch (
|
|
950
|
-
w =
|
|
948
|
+
w = e[b](o, b, m, l, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
949
|
+
} catch (M) {
|
|
950
|
+
w = M;
|
|
951
951
|
}
|
|
952
|
-
w && !(w instanceof Error) && (te(k),
|
|
952
|
+
w && !(w instanceof Error) && (te(k), _("%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).", m || "React class", l, b, typeof w), te(null)), w instanceof Error && !(w.message in je) && (je[w.message] = !0, te(k), _("Failed %s type: %s", l, w.message), te(null));
|
|
953
953
|
}
|
|
954
954
|
}
|
|
955
955
|
}
|
|
@@ -959,8 +959,8 @@ function rr() {
|
|
|
959
959
|
}
|
|
960
960
|
function yt(e) {
|
|
961
961
|
{
|
|
962
|
-
var
|
|
963
|
-
return
|
|
962
|
+
var o = typeof Symbol == "function" && Symbol.toStringTag, l = o && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
963
|
+
return l;
|
|
964
964
|
}
|
|
965
965
|
}
|
|
966
966
|
function Et(e) {
|
|
@@ -975,7 +975,7 @@ function rr() {
|
|
|
975
975
|
}
|
|
976
976
|
function $e(e) {
|
|
977
977
|
if (Et(e))
|
|
978
|
-
return
|
|
978
|
+
return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", yt(e)), Fe(e);
|
|
979
979
|
}
|
|
980
980
|
var Le = x.ReactCurrentOwner, wt = {
|
|
981
981
|
key: !0,
|
|
@@ -985,53 +985,53 @@ function rr() {
|
|
|
985
985
|
}, Ue, Be;
|
|
986
986
|
function bt(e) {
|
|
987
987
|
if (J.call(e, "ref")) {
|
|
988
|
-
var
|
|
989
|
-
if (
|
|
988
|
+
var o = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
989
|
+
if (o && o.isReactWarning)
|
|
990
990
|
return !1;
|
|
991
991
|
}
|
|
992
992
|
return e.ref !== void 0;
|
|
993
993
|
}
|
|
994
994
|
function xt(e) {
|
|
995
995
|
if (J.call(e, "key")) {
|
|
996
|
-
var
|
|
997
|
-
if (
|
|
996
|
+
var o = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
997
|
+
if (o && o.isReactWarning)
|
|
998
998
|
return !1;
|
|
999
999
|
}
|
|
1000
1000
|
return e.key !== void 0;
|
|
1001
1001
|
}
|
|
1002
|
-
function kt(e,
|
|
1002
|
+
function kt(e, o) {
|
|
1003
1003
|
typeof e.ref == "string" && Le.current;
|
|
1004
1004
|
}
|
|
1005
|
-
function At(e,
|
|
1005
|
+
function At(e, o) {
|
|
1006
1006
|
{
|
|
1007
|
-
var
|
|
1008
|
-
Ue || (Ue = !0,
|
|
1007
|
+
var l = function() {
|
|
1008
|
+
Ue || (Ue = !0, _("%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)", o));
|
|
1009
1009
|
};
|
|
1010
|
-
|
|
1011
|
-
get:
|
|
1010
|
+
l.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
1011
|
+
get: l,
|
|
1012
1012
|
configurable: !0
|
|
1013
1013
|
});
|
|
1014
1014
|
}
|
|
1015
1015
|
}
|
|
1016
|
-
function Tt(e,
|
|
1016
|
+
function Tt(e, o) {
|
|
1017
1017
|
{
|
|
1018
|
-
var
|
|
1019
|
-
Be || (Be = !0,
|
|
1018
|
+
var l = function() {
|
|
1019
|
+
Be || (Be = !0, _("%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)", o));
|
|
1020
1020
|
};
|
|
1021
|
-
|
|
1022
|
-
get:
|
|
1021
|
+
l.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
1022
|
+
get: l,
|
|
1023
1023
|
configurable: !0
|
|
1024
1024
|
});
|
|
1025
1025
|
}
|
|
1026
1026
|
}
|
|
1027
|
-
var
|
|
1027
|
+
var Rt = function(e, o, l, m, k, T, b) {
|
|
1028
1028
|
var w = {
|
|
1029
1029
|
// This tag allows us to uniquely identify this as a React Element
|
|
1030
1030
|
$$typeof: r,
|
|
1031
1031
|
// Built-in properties that belong on the element
|
|
1032
1032
|
type: e,
|
|
1033
|
-
key:
|
|
1034
|
-
ref:
|
|
1033
|
+
key: o,
|
|
1034
|
+
ref: l,
|
|
1035
1035
|
props: b,
|
|
1036
1036
|
// Record the component responsible for creating this element.
|
|
1037
1037
|
_owner: T
|
|
@@ -1045,7 +1045,7 @@ function rr() {
|
|
|
1045
1045
|
configurable: !1,
|
|
1046
1046
|
enumerable: !1,
|
|
1047
1047
|
writable: !1,
|
|
1048
|
-
value:
|
|
1048
|
+
value: m
|
|
1049
1049
|
}), Object.defineProperty(w, "_source", {
|
|
1050
1050
|
configurable: !1,
|
|
1051
1051
|
enumerable: !1,
|
|
@@ -1053,29 +1053,29 @@ function rr() {
|
|
|
1053
1053
|
value: k
|
|
1054
1054
|
}), Object.freeze && (Object.freeze(w.props), Object.freeze(w)), w;
|
|
1055
1055
|
};
|
|
1056
|
-
function
|
|
1056
|
+
function St(e, o, l, m, k) {
|
|
1057
1057
|
{
|
|
1058
|
-
var T, b = {}, w = null,
|
|
1059
|
-
|
|
1060
|
-
for (T in
|
|
1061
|
-
J.call(
|
|
1058
|
+
var T, b = {}, w = null, j = null;
|
|
1059
|
+
l !== void 0 && ($e(l), w = "" + l), xt(o) && ($e(o.key), w = "" + o.key), bt(o) && (j = o.ref, kt(o, k));
|
|
1060
|
+
for (T in o)
|
|
1061
|
+
J.call(o, T) && !wt.hasOwnProperty(T) && (b[T] = o[T]);
|
|
1062
1062
|
if (e && e.defaultProps) {
|
|
1063
|
-
var
|
|
1064
|
-
for (T in
|
|
1065
|
-
b[T] === void 0 && (b[T] =
|
|
1063
|
+
var M = e.defaultProps;
|
|
1064
|
+
for (T in M)
|
|
1065
|
+
b[T] === void 0 && (b[T] = M[T]);
|
|
1066
1066
|
}
|
|
1067
|
-
if (w ||
|
|
1068
|
-
var
|
|
1069
|
-
w && At(b,
|
|
1067
|
+
if (w || j) {
|
|
1068
|
+
var N = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
1069
|
+
w && At(b, N), j && Tt(b, N);
|
|
1070
1070
|
}
|
|
1071
|
-
return
|
|
1071
|
+
return Rt(e, w, j, k, m, Le.current, b);
|
|
1072
1072
|
}
|
|
1073
1073
|
}
|
|
1074
1074
|
var pe = x.ReactCurrentOwner, Ve = x.ReactDebugCurrentFrame;
|
|
1075
1075
|
function G(e) {
|
|
1076
1076
|
if (e) {
|
|
1077
|
-
var
|
|
1078
|
-
Ve.setExtraStackFrame(
|
|
1077
|
+
var o = e._owner, l = ee(e.type, e._source, o ? o.type : null);
|
|
1078
|
+
Ve.setExtraStackFrame(l);
|
|
1079
1079
|
} else
|
|
1080
1080
|
Ve.setExtraStackFrame(null);
|
|
1081
1081
|
}
|
|
@@ -1099,155 +1099,155 @@ Check the render method of \`` + e + "`.";
|
|
|
1099
1099
|
function Ct(e) {
|
|
1100
1100
|
return "";
|
|
1101
1101
|
}
|
|
1102
|
-
var
|
|
1102
|
+
var ze = {};
|
|
1103
1103
|
function It(e) {
|
|
1104
1104
|
{
|
|
1105
|
-
var
|
|
1106
|
-
if (!
|
|
1107
|
-
var
|
|
1108
|
-
|
|
1105
|
+
var o = He();
|
|
1106
|
+
if (!o) {
|
|
1107
|
+
var l = typeof e == "string" ? e : e.displayName || e.name;
|
|
1108
|
+
l && (o = `
|
|
1109
1109
|
|
|
1110
|
-
Check the top-level render call using <` +
|
|
1110
|
+
Check the top-level render call using <` + l + ">.");
|
|
1111
1111
|
}
|
|
1112
|
-
return
|
|
1112
|
+
return o;
|
|
1113
1113
|
}
|
|
1114
1114
|
}
|
|
1115
|
-
function
|
|
1115
|
+
function We(e, o) {
|
|
1116
1116
|
{
|
|
1117
1117
|
if (!e._store || e._store.validated || e.key != null)
|
|
1118
1118
|
return;
|
|
1119
1119
|
e._store.validated = !0;
|
|
1120
|
-
var
|
|
1121
|
-
if (
|
|
1120
|
+
var l = It(o);
|
|
1121
|
+
if (ze[l])
|
|
1122
1122
|
return;
|
|
1123
|
-
|
|
1124
|
-
var
|
|
1125
|
-
e && e._owner && e._owner !== pe.current && (
|
|
1123
|
+
ze[l] = !0;
|
|
1124
|
+
var m = "";
|
|
1125
|
+
e && e._owner && e._owner !== pe.current && (m = " It was passed a child from " + V(e._owner.type) + "."), G(e), _('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', l, m), G(null);
|
|
1126
1126
|
}
|
|
1127
1127
|
}
|
|
1128
|
-
function Ge(e,
|
|
1128
|
+
function Ge(e, o) {
|
|
1129
1129
|
{
|
|
1130
1130
|
if (typeof e != "object")
|
|
1131
1131
|
return;
|
|
1132
1132
|
if (de(e))
|
|
1133
|
-
for (var
|
|
1134
|
-
var
|
|
1135
|
-
me(
|
|
1133
|
+
for (var l = 0; l < e.length; l++) {
|
|
1134
|
+
var m = e[l];
|
|
1135
|
+
me(m) && We(m, o);
|
|
1136
1136
|
}
|
|
1137
1137
|
else if (me(e))
|
|
1138
1138
|
e._store && (e._store.validated = !0);
|
|
1139
1139
|
else if (e) {
|
|
1140
|
-
var k =
|
|
1140
|
+
var k = R(e);
|
|
1141
1141
|
if (typeof k == "function" && k !== e.entries)
|
|
1142
1142
|
for (var T = k.call(e), b; !(b = T.next()).done; )
|
|
1143
|
-
me(b.value) &&
|
|
1143
|
+
me(b.value) && We(b.value, o);
|
|
1144
1144
|
}
|
|
1145
1145
|
}
|
|
1146
1146
|
}
|
|
1147
1147
|
function Mt(e) {
|
|
1148
1148
|
{
|
|
1149
|
-
var
|
|
1150
|
-
if (
|
|
1149
|
+
var o = e.type;
|
|
1150
|
+
if (o == null || typeof o == "string")
|
|
1151
1151
|
return;
|
|
1152
|
-
var
|
|
1153
|
-
if (typeof
|
|
1154
|
-
|
|
1155
|
-
else if (typeof
|
|
1152
|
+
var l;
|
|
1153
|
+
if (typeof o == "function")
|
|
1154
|
+
l = o.propTypes;
|
|
1155
|
+
else if (typeof o == "object" && (o.$$typeof === p || // Note: Memo only checks outer props here.
|
|
1156
1156
|
// Inner props are checked in the reconciler.
|
|
1157
|
-
|
|
1158
|
-
|
|
1157
|
+
o.$$typeof === h))
|
|
1158
|
+
l = o.propTypes;
|
|
1159
1159
|
else
|
|
1160
1160
|
return;
|
|
1161
|
-
if (
|
|
1162
|
-
var
|
|
1163
|
-
_t(
|
|
1164
|
-
} else if (
|
|
1161
|
+
if (l) {
|
|
1162
|
+
var m = V(o);
|
|
1163
|
+
_t(l, e.props, "prop", m, e);
|
|
1164
|
+
} else if (o.PropTypes !== void 0 && !he) {
|
|
1165
1165
|
he = !0;
|
|
1166
|
-
var k = V(
|
|
1167
|
-
|
|
1166
|
+
var k = V(o);
|
|
1167
|
+
_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", k || "Unknown");
|
|
1168
1168
|
}
|
|
1169
|
-
typeof
|
|
1169
|
+
typeof o.getDefaultProps == "function" && !o.getDefaultProps.isReactClassApproved && _("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
1170
1170
|
}
|
|
1171
1171
|
}
|
|
1172
1172
|
function Nt(e) {
|
|
1173
1173
|
{
|
|
1174
|
-
for (var
|
|
1175
|
-
var
|
|
1176
|
-
if (
|
|
1177
|
-
G(e),
|
|
1174
|
+
for (var o = Object.keys(e.props), l = 0; l < o.length; l++) {
|
|
1175
|
+
var m = o[l];
|
|
1176
|
+
if (m !== "children" && m !== "key") {
|
|
1177
|
+
G(e), _("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", m), G(null);
|
|
1178
1178
|
break;
|
|
1179
1179
|
}
|
|
1180
1180
|
}
|
|
1181
|
-
e.ref !== null && (G(e),
|
|
1181
|
+
e.ref !== null && (G(e), _("Invalid attribute `ref` supplied to `React.Fragment`."), G(null));
|
|
1182
1182
|
}
|
|
1183
1183
|
}
|
|
1184
1184
|
var Ye = {};
|
|
1185
|
-
function qe(e,
|
|
1185
|
+
function qe(e, o, l, m, k, T) {
|
|
1186
1186
|
{
|
|
1187
1187
|
var b = lt(e);
|
|
1188
1188
|
if (!b) {
|
|
1189
1189
|
var w = "";
|
|
1190
1190
|
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (w += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
1191
|
-
var
|
|
1192
|
-
|
|
1193
|
-
var
|
|
1194
|
-
e === null ?
|
|
1191
|
+
var j = Ct();
|
|
1192
|
+
j ? w += j : w += He();
|
|
1193
|
+
var M;
|
|
1194
|
+
e === null ? M = "null" : de(e) ? M = "array" : e !== void 0 && e.$$typeof === r ? (M = "<" + (V(e.type) || "Unknown") + " />", w = " Did you accidentally export a JSX literal instead of a component?") : M = typeof e, _("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", M, w);
|
|
1195
1195
|
}
|
|
1196
|
-
var
|
|
1197
|
-
if (
|
|
1198
|
-
return
|
|
1196
|
+
var N = St(e, o, l, k, T);
|
|
1197
|
+
if (N == null)
|
|
1198
|
+
return N;
|
|
1199
1199
|
if (b) {
|
|
1200
|
-
var $ =
|
|
1200
|
+
var $ = o.children;
|
|
1201
1201
|
if ($ !== void 0)
|
|
1202
|
-
if (
|
|
1202
|
+
if (m)
|
|
1203
1203
|
if (de($)) {
|
|
1204
1204
|
for (var Y = 0; Y < $.length; Y++)
|
|
1205
1205
|
Ge($[Y], e);
|
|
1206
1206
|
Object.freeze && Object.freeze($);
|
|
1207
1207
|
} else
|
|
1208
|
-
|
|
1208
|
+
_("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
1209
1209
|
else
|
|
1210
1210
|
Ge($, e);
|
|
1211
1211
|
}
|
|
1212
|
-
if (J.call(
|
|
1213
|
-
var
|
|
1212
|
+
if (J.call(o, "key")) {
|
|
1213
|
+
var W = V(e), F = Object.keys(o).filter(function($t) {
|
|
1214
1214
|
return $t !== "key";
|
|
1215
1215
|
}), ge = F.length > 0 ? "{key: someKey, " + F.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
1216
|
-
if (!Ye[
|
|
1216
|
+
if (!Ye[W + ge]) {
|
|
1217
1217
|
var Ft = F.length > 0 ? "{" + F.join(": ..., ") + ": ...}" : "{}";
|
|
1218
|
-
|
|
1218
|
+
_(`A props object containing a "key" prop is being spread into JSX:
|
|
1219
1219
|
let props = %s;
|
|
1220
1220
|
<%s {...props} />
|
|
1221
1221
|
React keys must be passed directly to JSX without using spread:
|
|
1222
1222
|
let props = %s;
|
|
1223
|
-
<%s key={someKey} {...props} />`, ge,
|
|
1223
|
+
<%s key={someKey} {...props} />`, ge, W, Ft, W), Ye[W + ge] = !0;
|
|
1224
1224
|
}
|
|
1225
1225
|
}
|
|
1226
|
-
return e === i ? Nt(
|
|
1226
|
+
return e === i ? Nt(N) : Mt(N), N;
|
|
1227
1227
|
}
|
|
1228
1228
|
}
|
|
1229
|
-
function
|
|
1230
|
-
return qe(e,
|
|
1229
|
+
function Pt(e, o, l) {
|
|
1230
|
+
return qe(e, o, l, !0);
|
|
1231
1231
|
}
|
|
1232
|
-
function Ot(e,
|
|
1233
|
-
return qe(e,
|
|
1232
|
+
function Ot(e, o, l) {
|
|
1233
|
+
return qe(e, o, l, !1);
|
|
1234
1234
|
}
|
|
1235
|
-
var
|
|
1236
|
-
X.Fragment = i, X.jsx =
|
|
1235
|
+
var jt = Ot, Dt = Pt;
|
|
1236
|
+
X.Fragment = i, X.jsx = jt, X.jsxs = Dt;
|
|
1237
1237
|
})()), X;
|
|
1238
1238
|
}
|
|
1239
|
-
var
|
|
1239
|
+
var Ze;
|
|
1240
1240
|
function nr() {
|
|
1241
|
-
return
|
|
1241
|
+
return Ze || (Ze = 1, process.env.NODE_ENV === "production" ? oe.exports = tr() : oe.exports = rr()), oe.exports;
|
|
1242
1242
|
}
|
|
1243
1243
|
var v = nr();
|
|
1244
|
-
const
|
|
1244
|
+
const ot = "platform-kit", or = !1, ve = {
|
|
1245
1245
|
log: (...t) => {
|
|
1246
1246
|
},
|
|
1247
1247
|
warn: (...t) => {
|
|
1248
1248
|
},
|
|
1249
1249
|
error: (...t) => {
|
|
1250
|
-
console.error(`[${
|
|
1250
|
+
console.error(`[${ot}]`, ...t);
|
|
1251
1251
|
}
|
|
1252
1252
|
};
|
|
1253
1253
|
class Cr extends Lt {
|
|
@@ -1264,7 +1264,7 @@ class Cr extends Lt {
|
|
|
1264
1264
|
const r = window;
|
|
1265
1265
|
if (r.__MF_NAME__) return r.__MF_NAME__;
|
|
1266
1266
|
}
|
|
1267
|
-
return
|
|
1267
|
+
return ot;
|
|
1268
1268
|
}
|
|
1269
1269
|
/**
|
|
1270
1270
|
* Определить нужно ли показывать детали ошибки
|
|
@@ -1276,18 +1276,18 @@ class Cr extends Lt {
|
|
|
1276
1276
|
try {
|
|
1277
1277
|
const r = sessionStorage.getItem("config");
|
|
1278
1278
|
if (r) {
|
|
1279
|
-
const
|
|
1280
|
-
if (
|
|
1281
|
-
return
|
|
1279
|
+
const n = JSON.parse(r);
|
|
1280
|
+
if (n.showErrorDetails !== void 0)
|
|
1281
|
+
return n.showErrorDetails;
|
|
1282
1282
|
}
|
|
1283
1283
|
} catch {
|
|
1284
1284
|
}
|
|
1285
|
-
return
|
|
1285
|
+
return or;
|
|
1286
1286
|
}
|
|
1287
1287
|
/**
|
|
1288
1288
|
* Dispatch ошибки в shell
|
|
1289
1289
|
*/
|
|
1290
|
-
dispatchError(r,
|
|
1290
|
+
dispatchError(r, n) {
|
|
1291
1291
|
if (this.hasDispatched || typeof window > "u") return;
|
|
1292
1292
|
this.hasDispatched = !0;
|
|
1293
1293
|
const i = this.getMfeName();
|
|
@@ -1298,7 +1298,7 @@ class Cr extends Lt {
|
|
|
1298
1298
|
mfeName: i,
|
|
1299
1299
|
error: r.message || String(r),
|
|
1300
1300
|
stack: r.stack,
|
|
1301
|
-
componentStack:
|
|
1301
|
+
componentStack: n?.componentStack,
|
|
1302
1302
|
timestamp: Date.now()
|
|
1303
1303
|
},
|
|
1304
1304
|
bubbles: !0
|
|
@@ -1316,8 +1316,8 @@ class Cr extends Lt {
|
|
|
1316
1316
|
/**
|
|
1317
1317
|
* Обработать ошибку
|
|
1318
1318
|
*/
|
|
1319
|
-
componentDidCatch(r,
|
|
1320
|
-
this.dispatchError(r,
|
|
1319
|
+
componentDidCatch(r, n) {
|
|
1320
|
+
this.dispatchError(r, n), ve.error("Error info:", n.componentStack);
|
|
1321
1321
|
}
|
|
1322
1322
|
/**
|
|
1323
1323
|
* Копировать ошибку в буфер обмена
|
|
@@ -1349,7 +1349,7 @@ ${this.state.error?.stack}`;
|
|
|
1349
1349
|
*/
|
|
1350
1350
|
render() {
|
|
1351
1351
|
if (this.state.hasError) {
|
|
1352
|
-
const r = this.state.error?.message || "Unknown error",
|
|
1352
|
+
const r = this.state.error?.message || "Unknown error", n = this.state.error?.stack || "", i = this.shouldShowDetails(), c = this.getMfeName();
|
|
1353
1353
|
return /* @__PURE__ */ v.jsxs("div", { style: {
|
|
1354
1354
|
padding: "20px",
|
|
1355
1355
|
textAlign: "center",
|
|
@@ -1384,9 +1384,9 @@ ${this.state.error?.stack}`;
|
|
|
1384
1384
|
borderRadius: "4px"
|
|
1385
1385
|
}, children: [
|
|
1386
1386
|
r,
|
|
1387
|
-
|
|
1387
|
+
n && `
|
|
1388
1388
|
|
|
1389
|
-
${
|
|
1389
|
+
${n}`
|
|
1390
1390
|
] })
|
|
1391
1391
|
] }),
|
|
1392
1392
|
/* @__PURE__ */ v.jsxs("div", { style: { marginTop: "12px", display: "flex", gap: "8px", justifyContent: "center" }, children: [
|
|
@@ -1441,16 +1441,20 @@ ${s}`
|
|
|
1441
1441
|
return this.props.children == null ? null : this.props.children;
|
|
1442
1442
|
}
|
|
1443
1443
|
}
|
|
1444
|
-
function
|
|
1444
|
+
function sr() {
|
|
1445
1445
|
const [t, r] = A("light");
|
|
1446
1446
|
return L(() => {
|
|
1447
|
-
const
|
|
1448
|
-
const
|
|
1449
|
-
r(
|
|
1447
|
+
const n = () => {
|
|
1448
|
+
const d = document.body.classList.contains("dark") || document.body.classList.contains("dark-theme") || document.body.classList.contains("theme-dark") || document.body.classList.contains("bg-dark") || document.documentElement.classList.contains("dark") || document.documentElement.classList.contains("dark-theme") || window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
1449
|
+
r(d ? "dark" : "light"), console.log("[VersionInfo] Theme detected:", d ? "dark" : "light", "classes:", document.body.className);
|
|
1450
|
+
};
|
|
1451
|
+
n();
|
|
1452
|
+
const i = new MutationObserver(n);
|
|
1453
|
+
i.observe(document.body, { attributes: !0, attributeFilter: ["class"] });
|
|
1454
|
+
const c = window.matchMedia("(prefers-color-scheme: dark)");
|
|
1455
|
+
return c.addEventListener("change", n), () => {
|
|
1456
|
+
i.disconnect(), c.removeEventListener("change", n);
|
|
1450
1457
|
};
|
|
1451
|
-
s();
|
|
1452
|
-
const i = new MutationObserver(s);
|
|
1453
|
-
return i.observe(document.body, { attributes: !0, attributeFilter: ["class"] }), () => i.disconnect();
|
|
1454
1458
|
}, []), t;
|
|
1455
1459
|
}
|
|
1456
1460
|
const D = {
|
|
@@ -1465,8 +1469,8 @@ const D = {
|
|
|
1465
1469
|
spreadsheet: "📊"
|
|
1466
1470
|
};
|
|
1467
1471
|
function Ir({ mfeName: t }) {
|
|
1468
|
-
const { data: r, isLoading:
|
|
1469
|
-
if (
|
|
1472
|
+
const { data: r, isLoading: n, error: i } = Gt({ mfeName: t }), [c, d] = A(!1), a = sr();
|
|
1473
|
+
if (n)
|
|
1470
1474
|
return /* @__PURE__ */ v.jsxs("span", { className: "text-muted small me-2", children: [
|
|
1471
1475
|
/* @__PURE__ */ v.jsx("span", { className: "me-1", children: "⏳" }),
|
|
1472
1476
|
"Загрузка..."
|
|
@@ -1476,8 +1480,8 @@ function Ir({ mfeName: t }) {
|
|
|
1476
1480
|
/* @__PURE__ */ v.jsx("span", { className: "me-1", children: "ℹ️" }),
|
|
1477
1481
|
"N/A"
|
|
1478
1482
|
] });
|
|
1479
|
-
const
|
|
1480
|
-
return
|
|
1483
|
+
const s = r, p = s.BUILD_VERSION || s.IMAGE_VERSION || s.APP_NAME || "N/A", y = s.APP_NAME ? `${s.APP_NAME}: ${p}` : p || t, u = [];
|
|
1484
|
+
return s.APP_NAME && u.push({ key: "APP_NAME", value: s.APP_NAME, label: "Приложение", icon: D.apps }), s.BUILD_VERSION && u.push({ key: "BUILD_VERSION", value: s.BUILD_VERSION, label: "Версия", icon: D.tags }), s.IMAGE_VERSION && u.push({ key: "IMAGE_VERSION", value: s.IMAGE_VERSION, label: "Образ", icon: D.storage }), s.GIT_COMMIT && u.push({ key: "GIT_COMMIT", value: s.GIT_COMMIT, label: "Commit", icon: D.spreadsheet }), s.COMMIT_SHA && u.push({ key: "COMMIT_SHA", value: s.COMMIT_SHA, label: "Commit", icon: D.spreadsheet }), s.GIT_BRANCH && u.push({ key: "GIT_BRANCH", value: s.GIT_BRANCH, label: "Ветка", icon: D.spreadsheet }), s.BUILD_BRANCH && u.push({ key: "BUILD_BRANCH", value: s.BUILD_BRANCH, label: "Ветка", icon: D.spreadsheet }), s.CI_COMMIT_AUTHOR && u.push({ key: "CI_COMMIT_AUTHOR", value: s.CI_COMMIT_AUTHOR, label: "Автор", icon: D.user }), s.CI_COMMIT_TIMESTAMP && u.push({ key: "CI_COMMIT_TIMESTAMP", value: s.CI_COMMIT_TIMESTAMP, label: "Дата", icon: D.clock }), s.BUILD_DATE && u.push({ key: "BUILD_DATE", value: s.BUILD_DATE, label: "Сборка", icon: D.clock }), s.CI_JOB_URL && u.push({ key: "CI_JOB_URL", value: s.CI_JOB_URL, label: "CI Job", icon: D.link }), s.CI_PIPELINE_URL && u.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, u.push({ key: "CI_COMMIT_MESSAGE", value: s.CI_COMMIT_MESSAGE, label: "Сообщение", icon: D.code })), /* @__PURE__ */ v.jsxs("div", { style: { display: "inline-block", position: "relative" }, children: [
|
|
1481
1485
|
/* @__PURE__ */ v.jsxs(
|
|
1482
1486
|
"button",
|
|
1483
1487
|
{
|
|
@@ -1494,7 +1498,7 @@ function Ir({ mfeName: t }) {
|
|
|
1494
1498
|
title: "Информация о версии",
|
|
1495
1499
|
children: [
|
|
1496
1500
|
/* @__PURE__ */ v.jsx("span", { className: "me-1", children: D.info }),
|
|
1497
|
-
/* @__PURE__ */ v.jsx("span", { style: { color:
|
|
1501
|
+
/* @__PURE__ */ v.jsx("span", { style: { color: a === "dark" ? "#c4c7cc" : "#212529" }, children: p })
|
|
1498
1502
|
]
|
|
1499
1503
|
}
|
|
1500
1504
|
),
|
|
@@ -1508,8 +1512,8 @@ function Ir({ mfeName: t }) {
|
|
|
1508
1512
|
zIndex: 1e3,
|
|
1509
1513
|
minWidth: "220px",
|
|
1510
1514
|
maxWidth: "280px",
|
|
1511
|
-
background:
|
|
1512
|
-
border: `1px solid ${
|
|
1515
|
+
background: a === "dark" ? "#2d3036" : "white",
|
|
1516
|
+
border: `1px solid ${a === "dark" ? "#40444b" : "#dee2e6"}`,
|
|
1513
1517
|
borderRadius: "6px",
|
|
1514
1518
|
boxShadow: "0 4px 12px rgba(0,0,0,0.15)",
|
|
1515
1519
|
padding: "10px 12px",
|
|
@@ -1519,49 +1523,44 @@ function Ir({ mfeName: t }) {
|
|
|
1519
1523
|
/* @__PURE__ */ v.jsxs("div", { style: {
|
|
1520
1524
|
marginBottom: "8px",
|
|
1521
1525
|
paddingBottom: "6px",
|
|
1522
|
-
borderBottom: `1px solid ${
|
|
1526
|
+
borderBottom: `1px solid ${a === "dark" ? "#40444b" : "#dee2e6"}`,
|
|
1523
1527
|
display: "flex",
|
|
1524
|
-
alignItems: "center"
|
|
1528
|
+
alignItems: "center",
|
|
1529
|
+
fontSize: "13px"
|
|
1525
1530
|
}, children: [
|
|
1526
|
-
/* @__PURE__ */ v.jsx("span", { className: "me-
|
|
1527
|
-
/* @__PURE__ */ v.jsx("strong", { style: { color:
|
|
1531
|
+
/* @__PURE__ */ v.jsx("span", { className: "me-1", children: D.apps }),
|
|
1532
|
+
/* @__PURE__ */ v.jsx("strong", { style: { color: a === "dark" ? "#e4e5e6" : "#212529" }, children: y })
|
|
1528
1533
|
] }),
|
|
1529
|
-
/* @__PURE__ */ v.
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
/* @__PURE__ */ v.
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
}
|
|
1554
|
-
) : _
|
|
1555
|
-
}
|
|
1556
|
-
)
|
|
1557
|
-
] })
|
|
1558
|
-
] }, l);
|
|
1534
|
+
u.length > 0 && /* @__PURE__ */ v.jsx("div", { style: { fontSize: "12px" }, children: u.filter(
|
|
1535
|
+
(h) => (
|
|
1536
|
+
// Hide these fields - they're already in header or redundant
|
|
1537
|
+
h.key !== "APP_NAME" && h.key !== "BUILD_VERSION" && h.key !== "IMAGE_VERSION"
|
|
1538
|
+
)
|
|
1539
|
+
).map(({ key: h, value: f, label: E, icon: g }) => {
|
|
1540
|
+
const C = h.includes("URL"), R = C ? "🔗" : f;
|
|
1541
|
+
return /* @__PURE__ */ v.jsxs("div", { style: { marginBottom: "4px", display: "flex", alignItems: "center" }, children: [
|
|
1542
|
+
/* @__PURE__ */ v.jsx("span", { className: "me-1", style: { flexShrink: 0 }, children: g }),
|
|
1543
|
+
/* @__PURE__ */ v.jsxs("span", { style: { color: a === "dark" ? "#949ba3" : "#6c757d", marginRight: "4px" }, children: [
|
|
1544
|
+
E,
|
|
1545
|
+
":"
|
|
1546
|
+
] }),
|
|
1547
|
+
C ? /* @__PURE__ */ v.jsx(
|
|
1548
|
+
"a",
|
|
1549
|
+
{
|
|
1550
|
+
href: f,
|
|
1551
|
+
target: "_blank",
|
|
1552
|
+
rel: "noopener noreferrer",
|
|
1553
|
+
style: { color: "#4da6ff", textDecoration: "none" },
|
|
1554
|
+
children: "🔗"
|
|
1555
|
+
}
|
|
1556
|
+
) : /* @__PURE__ */ v.jsx("span", { style: { color: a === "dark" ? "#c4c7cc" : "#212529" }, children: R })
|
|
1557
|
+
] }, h);
|
|
1559
1558
|
}) }),
|
|
1560
|
-
|
|
1559
|
+
u.length === 0 && /* @__PURE__ */ v.jsx("div", { className: "text-center text-muted py-2 small", children: "Нет информации о версии" }),
|
|
1561
1560
|
/* @__PURE__ */ v.jsx("div", { style: {
|
|
1562
1561
|
marginTop: "8px",
|
|
1563
1562
|
paddingTop: "6px",
|
|
1564
|
-
borderTop: `1px solid ${
|
|
1563
|
+
borderTop: `1px solid ${a === "dark" ? "#40444b" : "#dee2e6"}`,
|
|
1565
1564
|
textAlign: "center",
|
|
1566
1565
|
fontSize: "11px",
|
|
1567
1566
|
color: "#6c757d"
|
|
@@ -1602,61 +1601,61 @@ function Ir({ mfeName: t }) {
|
|
|
1602
1601
|
)
|
|
1603
1602
|
] });
|
|
1604
1603
|
}
|
|
1605
|
-
const Ee = "platform-kit",
|
|
1604
|
+
const Ee = "platform-kit", st = Ut(null);
|
|
1606
1605
|
function Mr({ children: t }) {
|
|
1607
|
-
const [r,
|
|
1606
|
+
const [r, n] = A([]), i = typeof window < "u" && window.__MF_NAME__ || Ee, c = S((f, E, g, C) => ({
|
|
1608
1607
|
id: `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
|
|
1609
1608
|
type: f,
|
|
1610
1609
|
title: E,
|
|
1611
|
-
message:
|
|
1610
|
+
message: g,
|
|
1612
1611
|
mfeName: i,
|
|
1613
1612
|
timestamp: Date.now(),
|
|
1614
|
-
duration:
|
|
1615
|
-
}), [i]), d =
|
|
1616
|
-
|
|
1613
|
+
duration: C
|
|
1614
|
+
}), [i]), d = S((f) => {
|
|
1615
|
+
n((g) => [...g, f].slice(0, 5));
|
|
1617
1616
|
const E = f.duration || 5e3;
|
|
1618
1617
|
E > 0 && setTimeout(() => {
|
|
1619
|
-
|
|
1618
|
+
n((g) => g.filter((C) => C.id !== f.id));
|
|
1620
1619
|
}, E);
|
|
1621
|
-
}, []),
|
|
1620
|
+
}, []), a = S((f) => {
|
|
1622
1621
|
const E = c(f.type, f.title, f.message, f.duration);
|
|
1623
1622
|
d(E), typeof window < "u" && window.dispatchEvent(new CustomEvent("mfe-notification", {
|
|
1624
1623
|
detail: E,
|
|
1625
1624
|
bubbles: !0
|
|
1626
1625
|
}));
|
|
1627
|
-
}, [c, d]),
|
|
1628
|
-
|
|
1629
|
-
}, [
|
|
1630
|
-
|
|
1631
|
-
}, [
|
|
1632
|
-
|
|
1633
|
-
}, [
|
|
1634
|
-
|
|
1635
|
-
}, [
|
|
1636
|
-
|
|
1626
|
+
}, [c, d]), s = S((f, E = "Успешно") => {
|
|
1627
|
+
a({ type: "success", title: E, message: f });
|
|
1628
|
+
}, [a]), p = S((f, E = "Ошибка") => {
|
|
1629
|
+
a({ type: "error", title: E, message: f });
|
|
1630
|
+
}, [a]), y = S((f, E = "Предупреждение") => {
|
|
1631
|
+
a({ type: "warning", title: E, message: f });
|
|
1632
|
+
}, [a]), u = S((f, E = "Информация") => {
|
|
1633
|
+
a({ type: "info", title: E, message: f });
|
|
1634
|
+
}, [a]), h = S((f) => {
|
|
1635
|
+
n((E) => E.filter((g) => g.id !== f));
|
|
1637
1636
|
}, []);
|
|
1638
1637
|
return L(() => {
|
|
1639
1638
|
if (typeof window > "u") return;
|
|
1640
1639
|
const f = (E) => {
|
|
1641
|
-
const
|
|
1642
|
-
if (
|
|
1643
|
-
const
|
|
1644
|
-
...
|
|
1640
|
+
const g = E.detail;
|
|
1641
|
+
if (g && g.type && g.title && g.message) {
|
|
1642
|
+
const C = {
|
|
1643
|
+
...g,
|
|
1645
1644
|
id: `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`
|
|
1646
1645
|
};
|
|
1647
|
-
d(
|
|
1646
|
+
d(C);
|
|
1648
1647
|
}
|
|
1649
1648
|
};
|
|
1650
1649
|
return window.addEventListener("mfe-notification", f), () => {
|
|
1651
1650
|
window.removeEventListener("mfe-notification", f);
|
|
1652
1651
|
};
|
|
1653
|
-
}, [d]), /* @__PURE__ */ v.jsxs(
|
|
1654
|
-
notify:
|
|
1655
|
-
notifySuccess:
|
|
1656
|
-
notifyError:
|
|
1657
|
-
notifyWarning:
|
|
1658
|
-
notifyInfo:
|
|
1659
|
-
removeNotification:
|
|
1652
|
+
}, [d]), /* @__PURE__ */ v.jsxs(st.Provider, { value: {
|
|
1653
|
+
notify: a,
|
|
1654
|
+
notifySuccess: s,
|
|
1655
|
+
notifyError: p,
|
|
1656
|
+
notifyWarning: y,
|
|
1657
|
+
notifyInfo: u,
|
|
1658
|
+
removeNotification: h
|
|
1660
1659
|
}, children: [
|
|
1661
1660
|
t,
|
|
1662
1661
|
r.length > 0 && /* @__PURE__ */ v.jsx(
|
|
@@ -1698,7 +1697,7 @@ function Mr({ children: t }) {
|
|
|
1698
1697
|
/* @__PURE__ */ v.jsx(
|
|
1699
1698
|
"button",
|
|
1700
1699
|
{
|
|
1701
|
-
onClick: () =>
|
|
1700
|
+
onClick: () => h(f.id),
|
|
1702
1701
|
style: {
|
|
1703
1702
|
background: "transparent",
|
|
1704
1703
|
border: "none",
|
|
@@ -1719,7 +1718,7 @@ function Mr({ children: t }) {
|
|
|
1719
1718
|
] });
|
|
1720
1719
|
}
|
|
1721
1720
|
function Nr() {
|
|
1722
|
-
const t = Bt(
|
|
1721
|
+
const t = Bt(st);
|
|
1723
1722
|
return t || {
|
|
1724
1723
|
notify: () => {
|
|
1725
1724
|
},
|
|
@@ -1735,33 +1734,33 @@ function Nr() {
|
|
|
1735
1734
|
}
|
|
1736
1735
|
};
|
|
1737
1736
|
}
|
|
1738
|
-
function
|
|
1737
|
+
function Pr(t) {
|
|
1739
1738
|
if (typeof window > "u") return;
|
|
1740
|
-
const r = window.__MF_NAME__ || Ee,
|
|
1739
|
+
const r = window.__MF_NAME__ || Ee, n = {
|
|
1741
1740
|
...t,
|
|
1742
1741
|
mfeName: r,
|
|
1743
1742
|
timestamp: Date.now()
|
|
1744
1743
|
};
|
|
1745
1744
|
window.dispatchEvent(new CustomEvent("mfe-notification", {
|
|
1746
|
-
detail:
|
|
1745
|
+
detail: n,
|
|
1747
1746
|
bubbles: !0
|
|
1748
1747
|
}));
|
|
1749
1748
|
}
|
|
1750
1749
|
function ce(t, r) {
|
|
1751
|
-
const
|
|
1750
|
+
const n = r?.prefix ? `[${r.prefix}]` : `[${t}]`;
|
|
1752
1751
|
return {
|
|
1753
1752
|
log: (...i) => {
|
|
1754
1753
|
},
|
|
1755
1754
|
warn: (...i) => {
|
|
1756
1755
|
},
|
|
1757
1756
|
error: (...i) => {
|
|
1758
|
-
console.error(
|
|
1757
|
+
console.error(n, ...i);
|
|
1759
1758
|
},
|
|
1760
1759
|
info: (...i) => {
|
|
1761
1760
|
}
|
|
1762
1761
|
};
|
|
1763
1762
|
}
|
|
1764
|
-
const Or = ce("platform-kit", { prefix: "AUTH" }),
|
|
1763
|
+
const Or = ce("platform-kit", { prefix: "AUTH" }), jr = ce("platform-kit", { prefix: "API" }), Dr = ce("platform-kit", { prefix: "ERROR" }), Fr = ce("platform-kit", { prefix: "INFO" }), ar = {}, ir = {
|
|
1765
1764
|
log: (...t) => {
|
|
1766
1765
|
},
|
|
1767
1766
|
warn: (...t) => {
|
|
@@ -1796,21 +1795,21 @@ function xe() {
|
|
|
1796
1795
|
const t = ar;
|
|
1797
1796
|
return t.VITE_MFE_NAME ? String(t.VITE_MFE_NAME) : t.MFE_NAME ? String(t.MFE_NAME) : null;
|
|
1798
1797
|
}
|
|
1799
|
-
let
|
|
1798
|
+
let se = null, we = !1;
|
|
1800
1799
|
function cr(t, r) {
|
|
1801
|
-
const
|
|
1802
|
-
if (
|
|
1803
|
-
return
|
|
1804
|
-
if (we &&
|
|
1805
|
-
return
|
|
1800
|
+
const n = be(t);
|
|
1801
|
+
if (n)
|
|
1802
|
+
return n;
|
|
1803
|
+
if (we && se)
|
|
1804
|
+
return se;
|
|
1806
1805
|
const i = [
|
|
1807
1806
|
{ source: "window.__MF_NAME__", value: at() },
|
|
1808
1807
|
{ source: "sessionStorage.mf-config", value: it() },
|
|
1809
1808
|
{ source: "import.meta.env.VITE_MFE_NAME", value: xe() }
|
|
1810
1809
|
];
|
|
1811
|
-
for (const { source: d, value:
|
|
1812
|
-
if (
|
|
1813
|
-
return
|
|
1810
|
+
for (const { source: d, value: a } of i)
|
|
1811
|
+
if (a)
|
|
1812
|
+
return se = a, we = !0, a;
|
|
1814
1813
|
if (r)
|
|
1815
1814
|
return r;
|
|
1816
1815
|
const c = "Cannot determine MFE name. Please pass mfeName in props, set window.__MF_NAME__, sessionStorage.mf-config, or VITE_MFE_NAME";
|
|
@@ -1826,7 +1825,7 @@ function Lr(t) {
|
|
|
1826
1825
|
return ur(t) !== null;
|
|
1827
1826
|
}
|
|
1828
1827
|
function Ur() {
|
|
1829
|
-
|
|
1828
|
+
se = null, we = !1;
|
|
1830
1829
|
}
|
|
1831
1830
|
function Br(t) {
|
|
1832
1831
|
const r = [];
|
|
@@ -1837,12 +1836,12 @@ export {
|
|
|
1837
1836
|
Mr as NotificationProvider,
|
|
1838
1837
|
Ir as VersionInfo,
|
|
1839
1838
|
H as api,
|
|
1840
|
-
|
|
1839
|
+
jr as apiLogger,
|
|
1841
1840
|
Or as authLogger,
|
|
1842
|
-
|
|
1841
|
+
Qt as createApiClient,
|
|
1843
1842
|
ce as createMfLogger,
|
|
1844
1843
|
Er as del,
|
|
1845
|
-
|
|
1844
|
+
Pr as dispatchNotification,
|
|
1846
1845
|
Dr as errorLogger,
|
|
1847
1846
|
_r as get,
|
|
1848
1847
|
pr as getAccessToken,
|
|
@@ -1862,11 +1861,11 @@ export {
|
|
|
1862
1861
|
Ur as resetMfeNameCache,
|
|
1863
1862
|
ie as useApi,
|
|
1864
1863
|
kr as useDel,
|
|
1865
|
-
|
|
1864
|
+
Rr as useFeatureAdmin,
|
|
1866
1865
|
Tr as useFeatures,
|
|
1867
1866
|
wr as useGet,
|
|
1868
1867
|
Gt as useInfoData,
|
|
1869
|
-
|
|
1868
|
+
Sr as useMicrofrontendsFeatures,
|
|
1870
1869
|
Nr as useNotification,
|
|
1871
1870
|
Ar as usePermissions,
|
|
1872
1871
|
br as usePost,
|