thecore-auth 0.0.151 → 0.0.153
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/thecore-auth.cjs.js +11 -11
- package/dist/thecore-auth.esm.js +293 -298
- package/package.json +1 -1
package/dist/thecore-auth.esm.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as r from "react";
|
|
2
|
-
import q, { createContext as ce, useState as E, useContext as ue, useEffect as
|
|
2
|
+
import q, { createContext as ce, useState as E, useContext as ue, useEffect as D, useRef as ut } from "react";
|
|
3
3
|
import De from "jwt-decode";
|
|
4
4
|
import { useNavigate as Be, useLocation as Ie, matchPath as We, Outlet as le, Navigate as Xe, Routes as dt, Route as ae, useMatch as ft } from "react-router-dom";
|
|
5
|
-
import { BrowserRouter as x0, Link as v0, NavLink as b0, Outlet as y0, Route as E0, Routes as w0, useLocation as C0, useMatch as j0, useNavigate as
|
|
5
|
+
import { BrowserRouter as x0, Link as v0, NavLink as b0, Outlet as y0, Route as E0, Routes as w0, useLocation as C0, useMatch as j0, useNavigate as S0, useParams as k0 } from "react-router-dom";
|
|
6
6
|
import mt from "axios";
|
|
7
7
|
import { default as L0 } from "axios";
|
|
8
8
|
import pt from "react-dom";
|
|
9
|
-
import { default as
|
|
9
|
+
import { default as T0 } from "react-dom";
|
|
10
10
|
var Oe = { exports: {} }, Ee = {};
|
|
11
11
|
/**
|
|
12
12
|
* @license React
|
|
@@ -58,11 +58,11 @@ function gt() {
|
|
|
58
58
|
return t.$$typeof === me ? null : t.displayName || t.name || null;
|
|
59
59
|
if (typeof t == "string") return t;
|
|
60
60
|
switch (t) {
|
|
61
|
-
case
|
|
61
|
+
case M:
|
|
62
62
|
return "Fragment";
|
|
63
63
|
case T:
|
|
64
64
|
return "Portal";
|
|
65
|
-
case
|
|
65
|
+
case z:
|
|
66
66
|
return "Profiler";
|
|
67
67
|
case V:
|
|
68
68
|
return "StrictMode";
|
|
@@ -75,14 +75,14 @@ function gt() {
|
|
|
75
75
|
switch (typeof t.tag == "number" && console.error(
|
|
76
76
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
77
77
|
), t.$$typeof) {
|
|
78
|
-
case
|
|
78
|
+
case W:
|
|
79
79
|
return (t.displayName || "Context") + ".Provider";
|
|
80
80
|
case X:
|
|
81
81
|
return (t._context.displayName || "Context") + ".Consumer";
|
|
82
|
-
case
|
|
82
|
+
case Y:
|
|
83
83
|
var d = t.render;
|
|
84
84
|
return t = t.displayName, t || (t = d.displayName || d.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
|
|
85
|
-
case
|
|
85
|
+
case F:
|
|
86
86
|
return d = t.displayName || null, d !== null ? d : e(t.type) || "Memo";
|
|
87
87
|
case I:
|
|
88
88
|
d = t._payload, t = t._init;
|
|
@@ -105,19 +105,19 @@ function gt() {
|
|
|
105
105
|
}
|
|
106
106
|
if (d) {
|
|
107
107
|
d = console;
|
|
108
|
-
var f = d.error,
|
|
108
|
+
var f = d.error, L = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
|
|
109
109
|
return f.call(
|
|
110
110
|
d,
|
|
111
111
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
112
|
-
|
|
112
|
+
L
|
|
113
113
|
), s(t);
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
function i() {
|
|
117
117
|
}
|
|
118
118
|
function a() {
|
|
119
|
-
if (
|
|
120
|
-
|
|
119
|
+
if (O === 0) {
|
|
120
|
+
G = console.log, B = console.info, R = console.warn, U = console.error, J = console.group, je = console.groupCollapsed, ve = console.groupEnd;
|
|
121
121
|
var t = {
|
|
122
122
|
configurable: !0,
|
|
123
123
|
enumerable: !0,
|
|
@@ -134,22 +134,22 @@ function gt() {
|
|
|
134
134
|
groupEnd: t
|
|
135
135
|
});
|
|
136
136
|
}
|
|
137
|
-
|
|
137
|
+
O++;
|
|
138
138
|
}
|
|
139
139
|
function l() {
|
|
140
|
-
if (
|
|
140
|
+
if (O--, O === 0) {
|
|
141
141
|
var t = { configurable: !0, enumerable: !0, writable: !0 };
|
|
142
142
|
Object.defineProperties(console, {
|
|
143
|
-
log:
|
|
144
|
-
info:
|
|
145
|
-
warn:
|
|
146
|
-
error:
|
|
147
|
-
group:
|
|
148
|
-
groupCollapsed:
|
|
149
|
-
groupEnd:
|
|
143
|
+
log: Z({}, t, { value: G }),
|
|
144
|
+
info: Z({}, t, { value: B }),
|
|
145
|
+
warn: Z({}, t, { value: R }),
|
|
146
|
+
error: Z({}, t, { value: U }),
|
|
147
|
+
group: Z({}, t, { value: J }),
|
|
148
|
+
groupCollapsed: Z({}, t, { value: je }),
|
|
149
|
+
groupEnd: Z({}, t, { value: ve })
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
|
-
0 >
|
|
152
|
+
0 > O && console.error(
|
|
153
153
|
"disabledDepth fell below zero. This is a bug in React. Please file an issue."
|
|
154
154
|
);
|
|
155
155
|
}
|
|
@@ -159,21 +159,21 @@ function gt() {
|
|
|
159
159
|
throw Error();
|
|
160
160
|
} catch (f) {
|
|
161
161
|
var d = f.stack.trim().match(/\n( *(at )?)/);
|
|
162
|
-
be = d && d[1] || "",
|
|
162
|
+
be = d && d[1] || "", Se = -1 < f.stack.indexOf(`
|
|
163
163
|
at`) ? " (<anonymous>)" : -1 < f.stack.indexOf("@") ? "@unknown:0:0" : "";
|
|
164
164
|
}
|
|
165
165
|
return `
|
|
166
|
-
` + be + t +
|
|
166
|
+
` + be + t + Se;
|
|
167
167
|
}
|
|
168
168
|
function p(t, d) {
|
|
169
169
|
if (!t || Pe) return "";
|
|
170
170
|
var f = Ge.get(t);
|
|
171
171
|
if (f !== void 0) return f;
|
|
172
172
|
Pe = !0, f = Error.prepareStackTrace, Error.prepareStackTrace = void 0;
|
|
173
|
-
var
|
|
174
|
-
|
|
173
|
+
var L = null;
|
|
174
|
+
L = H.H, H.H = null, a();
|
|
175
175
|
try {
|
|
176
|
-
var
|
|
176
|
+
var _ = {
|
|
177
177
|
DetermineComponentFrameRoot: function() {
|
|
178
178
|
try {
|
|
179
179
|
if (d) {
|
|
@@ -188,14 +188,14 @@ function gt() {
|
|
|
188
188
|
try {
|
|
189
189
|
Reflect.construct(oe, []);
|
|
190
190
|
} catch (te) {
|
|
191
|
-
var
|
|
191
|
+
var ke = te;
|
|
192
192
|
}
|
|
193
193
|
Reflect.construct(t, [], oe);
|
|
194
194
|
} else {
|
|
195
195
|
try {
|
|
196
196
|
oe.call();
|
|
197
197
|
} catch (te) {
|
|
198
|
-
|
|
198
|
+
ke = te;
|
|
199
199
|
}
|
|
200
200
|
t.call(oe.prototype);
|
|
201
201
|
}
|
|
@@ -203,34 +203,34 @@ function gt() {
|
|
|
203
203
|
try {
|
|
204
204
|
throw Error();
|
|
205
205
|
} catch (te) {
|
|
206
|
-
|
|
206
|
+
ke = te;
|
|
207
207
|
}
|
|
208
208
|
(oe = t()) && typeof oe.catch == "function" && oe.catch(function() {
|
|
209
209
|
});
|
|
210
210
|
}
|
|
211
211
|
} catch (te) {
|
|
212
|
-
if (te &&
|
|
213
|
-
return [te.stack,
|
|
212
|
+
if (te && ke && typeof te.stack == "string")
|
|
213
|
+
return [te.stack, ke.stack];
|
|
214
214
|
}
|
|
215
215
|
return [null, null];
|
|
216
216
|
}
|
|
217
217
|
};
|
|
218
|
-
|
|
218
|
+
_.DetermineComponentFrameRoot.displayName = "DetermineComponentFrameRoot";
|
|
219
219
|
var P = Object.getOwnPropertyDescriptor(
|
|
220
|
-
|
|
220
|
+
_.DetermineComponentFrameRoot,
|
|
221
221
|
"name"
|
|
222
222
|
);
|
|
223
223
|
P && P.configurable && Object.defineProperty(
|
|
224
|
-
|
|
224
|
+
_.DetermineComponentFrameRoot,
|
|
225
225
|
"name",
|
|
226
226
|
{ value: "DetermineComponentFrameRoot" }
|
|
227
227
|
);
|
|
228
|
-
var w =
|
|
228
|
+
var w = _.DetermineComponentFrameRoot(), ee = w[0], he = w[1];
|
|
229
229
|
if (ee && he) {
|
|
230
|
-
var
|
|
230
|
+
var $ = ee.split(`
|
|
231
231
|
`), ie = he.split(`
|
|
232
232
|
`);
|
|
233
|
-
for (w = P = 0; P <
|
|
233
|
+
for (w = P = 0; P < $.length && !$[P].includes(
|
|
234
234
|
"DetermineComponentFrameRoot"
|
|
235
235
|
); )
|
|
236
236
|
P++;
|
|
@@ -238,16 +238,16 @@ function gt() {
|
|
|
238
238
|
"DetermineComponentFrameRoot"
|
|
239
239
|
); )
|
|
240
240
|
w++;
|
|
241
|
-
if (P ===
|
|
242
|
-
for (P =
|
|
241
|
+
if (P === $.length || w === ie.length)
|
|
242
|
+
for (P = $.length - 1, w = ie.length - 1; 1 <= P && 0 <= w && $[P] !== ie[w]; )
|
|
243
243
|
w--;
|
|
244
244
|
for (; 1 <= P && 0 <= w; P--, w--)
|
|
245
|
-
if (
|
|
245
|
+
if ($[P] !== ie[w]) {
|
|
246
246
|
if (P !== 1 || w !== 1)
|
|
247
247
|
do
|
|
248
|
-
if (P--, w--, 0 > w ||
|
|
248
|
+
if (P--, w--, 0 > w || $[P] !== ie[w]) {
|
|
249
249
|
var ye = `
|
|
250
|
-
` +
|
|
250
|
+
` + $[P].replace(
|
|
251
251
|
" at new ",
|
|
252
252
|
" at "
|
|
253
253
|
);
|
|
@@ -258,9 +258,9 @@ function gt() {
|
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
260
|
} finally {
|
|
261
|
-
Pe = !1,
|
|
261
|
+
Pe = !1, H.H = L, l(), Error.prepareStackTrace = f;
|
|
262
262
|
}
|
|
263
|
-
return
|
|
263
|
+
return $ = ($ = t ? t.displayName || t.name : "") ? u($) : "", typeof t == "function" && Ge.set(t, $), $;
|
|
264
264
|
}
|
|
265
265
|
function m(t) {
|
|
266
266
|
if (t == null) return "";
|
|
@@ -280,9 +280,9 @@ function gt() {
|
|
|
280
280
|
}
|
|
281
281
|
if (typeof t == "object")
|
|
282
282
|
switch (t.$$typeof) {
|
|
283
|
-
case
|
|
283
|
+
case Y:
|
|
284
284
|
return t = p(t.render, !1), t;
|
|
285
|
-
case
|
|
285
|
+
case F:
|
|
286
286
|
return m(t.type);
|
|
287
287
|
case I:
|
|
288
288
|
d = t._payload, t = t._init;
|
|
@@ -294,7 +294,7 @@ function gt() {
|
|
|
294
294
|
return "";
|
|
295
295
|
}
|
|
296
296
|
function g() {
|
|
297
|
-
var t =
|
|
297
|
+
var t = H.A;
|
|
298
298
|
return t === null ? null : t.getOwner();
|
|
299
299
|
}
|
|
300
300
|
function C(t) {
|
|
@@ -316,22 +316,22 @@ function gt() {
|
|
|
316
316
|
configurable: !0
|
|
317
317
|
});
|
|
318
318
|
}
|
|
319
|
-
function
|
|
319
|
+
function b() {
|
|
320
320
|
var t = e(this.type);
|
|
321
321
|
return ze[t] || (ze[t] = !0, console.error(
|
|
322
322
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
323
323
|
)), t = this.props.ref, t !== void 0 ? t : null;
|
|
324
324
|
}
|
|
325
|
-
function c(t, d, f,
|
|
325
|
+
function c(t, d, f, L, _, P) {
|
|
326
326
|
return f = P.ref, t = {
|
|
327
327
|
$$typeof: y,
|
|
328
328
|
type: t,
|
|
329
329
|
key: d,
|
|
330
330
|
props: P,
|
|
331
|
-
_owner:
|
|
331
|
+
_owner: _
|
|
332
332
|
}, (f !== void 0 ? f : null) !== null ? Object.defineProperty(t, "ref", {
|
|
333
333
|
enumerable: !1,
|
|
334
|
-
get:
|
|
334
|
+
get: b
|
|
335
335
|
}) : Object.defineProperty(t, "ref", { enumerable: !1, value: null }), t._store = {}, Object.defineProperty(t._store, "validated", {
|
|
336
336
|
configurable: !1,
|
|
337
337
|
enumerable: !1,
|
|
@@ -344,43 +344,43 @@ function gt() {
|
|
|
344
344
|
value: null
|
|
345
345
|
}), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
|
|
346
346
|
}
|
|
347
|
-
function h(t, d, f,
|
|
348
|
-
if (typeof t == "string" || typeof t == "function" || t ===
|
|
347
|
+
function h(t, d, f, L, _, P) {
|
|
348
|
+
if (typeof t == "string" || typeof t == "function" || t === M || t === z || t === V || t === se || t === K || t === Q || typeof t == "object" && t !== null && (t.$$typeof === I || t.$$typeof === F || t.$$typeof === W || t.$$typeof === X || t.$$typeof === Y || t.$$typeof === pe || t.getModuleId !== void 0)) {
|
|
349
349
|
var w = d.children;
|
|
350
350
|
if (w !== void 0)
|
|
351
|
-
if (
|
|
351
|
+
if (L)
|
|
352
352
|
if (xe(w)) {
|
|
353
|
-
for (
|
|
354
|
-
|
|
353
|
+
for (L = 0; L < w.length; L++)
|
|
354
|
+
v(w[L], t);
|
|
355
355
|
Object.freeze && Object.freeze(w);
|
|
356
356
|
} else
|
|
357
357
|
console.error(
|
|
358
358
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
359
359
|
);
|
|
360
|
-
else
|
|
360
|
+
else v(w, t);
|
|
361
361
|
} else
|
|
362
|
-
w = "", (t === void 0 || typeof t == "object" && t !== null && Object.keys(t).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."), t === null ?
|
|
362
|
+
w = "", (t === void 0 || typeof t == "object" && t !== null && Object.keys(t).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."), t === null ? L = "null" : xe(t) ? L = "array" : t !== void 0 && t.$$typeof === y ? (L = "<" + (e(t.type) || "Unknown") + " />", w = " Did you accidentally export a JSX literal instead of a component?") : L = typeof t, console.error(
|
|
363
363
|
"React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",
|
|
364
|
-
|
|
364
|
+
L,
|
|
365
365
|
w
|
|
366
366
|
);
|
|
367
367
|
if (re.call(d, "key")) {
|
|
368
368
|
w = e(t);
|
|
369
|
-
var ee = Object.keys(d).filter(function(
|
|
370
|
-
return
|
|
369
|
+
var ee = Object.keys(d).filter(function($) {
|
|
370
|
+
return $ !== "key";
|
|
371
371
|
});
|
|
372
|
-
|
|
372
|
+
L = 0 < ee.length ? "{key: someKey, " + ee.join(": ..., ") + ": ...}" : "{key: someKey}", $e[w + L] || (ee = 0 < ee.length ? "{" + ee.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
373
373
|
`A props object containing a "key" prop is being spread into JSX:
|
|
374
374
|
let props = %s;
|
|
375
375
|
<%s {...props} />
|
|
376
376
|
React keys must be passed directly to JSX without using spread:
|
|
377
377
|
let props = %s;
|
|
378
378
|
<%s key={someKey} {...props} />`,
|
|
379
|
-
|
|
379
|
+
L,
|
|
380
380
|
w,
|
|
381
381
|
ee,
|
|
382
382
|
w
|
|
383
|
-
), $e[w +
|
|
383
|
+
), $e[w + L] = !0);
|
|
384
384
|
}
|
|
385
385
|
if (w = null, f !== void 0 && (n(f), w = "" + f), C(d) && (n(d.key), w = "" + d.key), "key" in d) {
|
|
386
386
|
f = {};
|
|
@@ -390,42 +390,42 @@ React keys must be passed directly to JSX without using spread:
|
|
|
390
390
|
return w && j(
|
|
391
391
|
f,
|
|
392
392
|
typeof t == "function" ? t.displayName || t.name || "Unknown" : t
|
|
393
|
-
), c(t, w, P,
|
|
393
|
+
), c(t, w, P, _, g(), f);
|
|
394
394
|
}
|
|
395
|
-
function
|
|
395
|
+
function v(t, d) {
|
|
396
396
|
if (typeof t == "object" && t && t.$$typeof !== ct) {
|
|
397
397
|
if (xe(t))
|
|
398
398
|
for (var f = 0; f < t.length; f++) {
|
|
399
|
-
var
|
|
400
|
-
x(
|
|
399
|
+
var L = t[f];
|
|
400
|
+
x(L) && S(L, d);
|
|
401
401
|
}
|
|
402
402
|
else if (x(t))
|
|
403
403
|
t._store && (t._store.validated = 1);
|
|
404
|
-
else if (t === null || typeof t != "object" ? f = null : (f =
|
|
404
|
+
else if (t === null || typeof t != "object" ? f = null : (f = A && t[A] || t["@@iterator"], f = typeof f == "function" ? f : null), typeof f == "function" && f !== t.entries && (f = f.call(t), f !== t))
|
|
405
405
|
for (; !(t = f.next()).done; )
|
|
406
|
-
x(t.value) &&
|
|
406
|
+
x(t.value) && S(t.value, d);
|
|
407
407
|
}
|
|
408
408
|
}
|
|
409
409
|
function x(t) {
|
|
410
410
|
return typeof t == "object" && t !== null && t.$$typeof === y;
|
|
411
411
|
}
|
|
412
|
-
function
|
|
413
|
-
if (t._store && !t._store.validated && t.key == null && (t._store.validated = 1, d =
|
|
412
|
+
function S(t, d) {
|
|
413
|
+
if (t._store && !t._store.validated && t.key == null && (t._store.validated = 1, d = k(d), !Fe[d])) {
|
|
414
414
|
Fe[d] = !0;
|
|
415
415
|
var f = "";
|
|
416
416
|
t && t._owner != null && t._owner !== g() && (f = null, typeof t._owner.tag == "number" ? f = e(t._owner.type) : typeof t._owner.name == "string" && (f = t._owner.name), f = " It was passed a child from " + f + ".");
|
|
417
|
-
var
|
|
418
|
-
|
|
419
|
-
var
|
|
420
|
-
return
|
|
417
|
+
var L = H.getCurrentStack;
|
|
418
|
+
H.getCurrentStack = function() {
|
|
419
|
+
var _ = m(t.type);
|
|
420
|
+
return L && (_ += L() || ""), _;
|
|
421
421
|
}, console.error(
|
|
422
422
|
'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',
|
|
423
423
|
d,
|
|
424
424
|
f
|
|
425
|
-
),
|
|
425
|
+
), H.getCurrentStack = L;
|
|
426
426
|
}
|
|
427
427
|
}
|
|
428
|
-
function
|
|
428
|
+
function k(t) {
|
|
429
429
|
var d = "", f = g();
|
|
430
430
|
return f && (f = e(f.type)) && (d = `
|
|
431
431
|
|
|
@@ -433,13 +433,13 @@ Check the render method of \`` + f + "`."), d || (t = e(t)) && (d = `
|
|
|
433
433
|
|
|
434
434
|
Check the top-level render call using <` + t + ">."), d;
|
|
435
435
|
}
|
|
436
|
-
var
|
|
436
|
+
var N = q, y = Symbol.for("react.transitional.element"), T = Symbol.for("react.portal"), M = Symbol.for("react.fragment"), V = Symbol.for("react.strict_mode"), z = Symbol.for("react.profiler"), X = Symbol.for("react.consumer"), W = Symbol.for("react.context"), Y = Symbol.for("react.forward_ref"), se = Symbol.for("react.suspense"), K = Symbol.for("react.suspense_list"), F = Symbol.for("react.memo"), I = Symbol.for("react.lazy"), Q = Symbol.for("react.offscreen"), A = Symbol.iterator, me = Symbol.for("react.client.reference"), H = N.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, re = Object.prototype.hasOwnProperty, Z = Object.assign, pe = Symbol.for("react.client.reference"), xe = Array.isArray, O = 0, G, B, R, U, J, je, ve;
|
|
437
437
|
i.__reactDisabledLog = !0;
|
|
438
|
-
var be,
|
|
439
|
-
we.Fragment =
|
|
440
|
-
return h(t, d, f, !1,
|
|
441
|
-
}, we.jsxs = function(t, d, f,
|
|
442
|
-
return h(t, d, f, !0,
|
|
438
|
+
var be, Se, Pe = !1, Ge = new (typeof WeakMap == "function" ? WeakMap : Map)(), ct = Symbol.for("react.client.reference"), _e, ze = {}, $e = {}, Fe = {};
|
|
439
|
+
we.Fragment = M, we.jsx = function(t, d, f, L, _) {
|
|
440
|
+
return h(t, d, f, !1, L, _);
|
|
441
|
+
}, we.jsxs = function(t, d, f, L, _) {
|
|
442
|
+
return h(t, d, f, !0, L, _);
|
|
443
443
|
};
|
|
444
444
|
}()), we;
|
|
445
445
|
}
|
|
@@ -459,7 +459,7 @@ const Ke = ce(), t0 = ({ children: e, defaultComponent: s }) => {
|
|
|
459
459
|
const e = ue(Ke);
|
|
460
460
|
if (e === void 0) throw new Error("Non puoi settare il loading");
|
|
461
461
|
return e;
|
|
462
|
-
}, vt = "0.0.
|
|
462
|
+
}, vt = "0.0.153", bt = ({ errorMessage: e, errorShow: s }) => /* @__PURE__ */ o.jsx("section", { className: s ? "" : "hidden", children: /* @__PURE__ */ o.jsxs("div", { className: "container mx-auto", children: [
|
|
463
463
|
/* @__PURE__ */ o.jsx("h1", { className: "text-center text-8xl my-12", children: "Errore" }),
|
|
464
464
|
/* @__PURE__ */ o.jsx("pre", { className: "text-xl", children: e })
|
|
465
465
|
] }) }), Qe = ce(), r0 = ({ children: e }) => {
|
|
@@ -491,50 +491,50 @@ Esempio di config.json:
|
|
|
491
491
|
"isDebug": "",
|
|
492
492
|
"showHeaderButton": ""
|
|
493
493
|
}`, u = () => {
|
|
494
|
-
const c = /* @__PURE__ */ new Date(), h = String(c.getDate()).padStart(2, "0"),
|
|
495
|
-
return `${h}/${
|
|
496
|
-
}, p = (c, h) => new Promise((
|
|
497
|
-
const
|
|
498
|
-
|
|
499
|
-
const
|
|
500
|
-
|
|
501
|
-
},
|
|
502
|
-
}), m = async (c, h,
|
|
494
|
+
const c = /* @__PURE__ */ new Date(), h = String(c.getDate()).padStart(2, "0"), v = String(c.getMonth() + 1).padStart(2, "0"), x = c.getFullYear(), S = String(c.getHours()).padStart(2, "0"), k = String(c.getMinutes()).padStart(2, "0"), N = String(c.getSeconds()).padStart(2, "0");
|
|
495
|
+
return `${h}/${v}/${x} ${S}:${k}:${N}`;
|
|
496
|
+
}, p = (c, h) => new Promise((v, x) => {
|
|
497
|
+
const S = indexedDB.open(c, 1);
|
|
498
|
+
S.onupgradeneeded = (k) => {
|
|
499
|
+
const N = k.target.result;
|
|
500
|
+
N.objectStoreNames.contains(h) || N.createObjectStore(h, { keyPath: "id" });
|
|
501
|
+
}, S.onsuccess = (k) => v(k.target.result), S.onerror = (k) => x(k.target.error);
|
|
502
|
+
}), m = async (c, h, v) => {
|
|
503
503
|
const x = await p(c, h);
|
|
504
|
-
return new Promise((
|
|
504
|
+
return new Promise((S, k) => {
|
|
505
505
|
if (!x) {
|
|
506
|
-
|
|
506
|
+
k("Errore: DB non disponibile");
|
|
507
507
|
return;
|
|
508
508
|
}
|
|
509
|
-
const
|
|
510
|
-
T.onsuccess = () =>
|
|
509
|
+
const N = x == null ? void 0 : x.transaction(h, "readonly"), y = N == null ? void 0 : N.objectStore(h), T = y == null ? void 0 : y.get(v);
|
|
510
|
+
T.onsuccess = () => S(T.result), T.onerror = (M) => k(M.target.error);
|
|
511
511
|
});
|
|
512
|
-
}, g = async (c, h,
|
|
512
|
+
}, g = async (c, h, v) => {
|
|
513
513
|
const x = await p(c, h);
|
|
514
|
-
return new Promise((
|
|
514
|
+
return new Promise((S, k) => {
|
|
515
515
|
if (!x) {
|
|
516
|
-
|
|
516
|
+
k("Errore: DB non disponibile");
|
|
517
517
|
return;
|
|
518
518
|
}
|
|
519
|
-
const
|
|
520
|
-
T.onsuccess = () =>
|
|
519
|
+
const N = x == null ? void 0 : x.transaction(h, "readwrite"), y = N == null ? void 0 : N.objectStore(h), T = y == null ? void 0 : y.put(v);
|
|
520
|
+
T.onsuccess = () => S(T.result), T.onerror = (M) => k(M.target.error);
|
|
521
521
|
});
|
|
522
522
|
}, C = async (c, h) => {
|
|
523
|
-
let
|
|
523
|
+
let v = Date.now(), x;
|
|
524
524
|
do
|
|
525
|
-
x = await m(c, h,
|
|
525
|
+
x = await m(c, h, v), x && v++;
|
|
526
526
|
while (x);
|
|
527
|
-
return
|
|
528
|
-
}, j = async (c, h,
|
|
529
|
-
|
|
530
|
-
},
|
|
527
|
+
return v;
|
|
528
|
+
}, j = async (c, h, v) => {
|
|
529
|
+
v.id || (v.id = await C(c, h)), await g(c, h, v);
|
|
530
|
+
}, b = async () => {
|
|
531
531
|
try {
|
|
532
532
|
const h = await (await fetch("/config.json")).json();
|
|
533
|
-
let
|
|
534
|
-
h.isDevelopment ?
|
|
533
|
+
let v;
|
|
534
|
+
h.isDevelopment ? v = vt : v = (await (await fetch("/package.json")).json()).version;
|
|
535
535
|
const x = {
|
|
536
536
|
...h,
|
|
537
|
-
version:
|
|
537
|
+
version: v,
|
|
538
538
|
openIndexedDB: p,
|
|
539
539
|
getDataIndexedDB: m,
|
|
540
540
|
setDataIndexedDB: g,
|
|
@@ -547,8 +547,8 @@ Esempio di config.json:
|
|
|
547
547
|
console.error(c), a(!0);
|
|
548
548
|
}
|
|
549
549
|
};
|
|
550
|
-
return
|
|
551
|
-
|
|
550
|
+
return D(() => {
|
|
551
|
+
b();
|
|
552
552
|
}, []), Object.keys(s).length === 0 ? /* @__PURE__ */ o.jsx(bt, { errorShow: i, errorMessage: l }) : /* @__PURE__ */ o.jsx(Qe.Provider, { value: s, children: e });
|
|
553
553
|
}, ne = () => {
|
|
554
554
|
const e = ue(Qe);
|
|
@@ -564,7 +564,7 @@ var et = {
|
|
|
564
564
|
}, Ue = q.createContext && /* @__PURE__ */ q.createContext(et), Ct = ["attr", "size", "title"];
|
|
565
565
|
function jt(e, s) {
|
|
566
566
|
if (e == null) return {};
|
|
567
|
-
var n =
|
|
567
|
+
var n = St(e, s), i, a;
|
|
568
568
|
if (Object.getOwnPropertySymbols) {
|
|
569
569
|
var l = Object.getOwnPropertySymbols(e);
|
|
570
570
|
for (a = 0; a < l.length; a++)
|
|
@@ -572,7 +572,7 @@ function jt(e, s) {
|
|
|
572
572
|
}
|
|
573
573
|
return n;
|
|
574
574
|
}
|
|
575
|
-
function
|
|
575
|
+
function St(e, s) {
|
|
576
576
|
if (e == null) return {};
|
|
577
577
|
var n = {};
|
|
578
578
|
for (var i in e)
|
|
@@ -582,15 +582,15 @@ function kt(e, s) {
|
|
|
582
582
|
}
|
|
583
583
|
return n;
|
|
584
584
|
}
|
|
585
|
-
function
|
|
586
|
-
return
|
|
585
|
+
function Ne() {
|
|
586
|
+
return Ne = Object.assign ? Object.assign.bind() : function(e) {
|
|
587
587
|
for (var s = 1; s < arguments.length; s++) {
|
|
588
588
|
var n = arguments[s];
|
|
589
589
|
for (var i in n)
|
|
590
590
|
Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
|
|
591
591
|
}
|
|
592
592
|
return e;
|
|
593
|
-
},
|
|
593
|
+
}, Ne.apply(this, arguments);
|
|
594
594
|
}
|
|
595
595
|
function qe(e, s) {
|
|
596
596
|
var n = Object.keys(e);
|
|
@@ -602,18 +602,18 @@ function qe(e, s) {
|
|
|
602
602
|
}
|
|
603
603
|
return n;
|
|
604
604
|
}
|
|
605
|
-
function
|
|
605
|
+
function Te(e) {
|
|
606
606
|
for (var s = 1; s < arguments.length; s++) {
|
|
607
607
|
var n = arguments[s] != null ? arguments[s] : {};
|
|
608
608
|
s % 2 ? qe(Object(n), !0).forEach(function(i) {
|
|
609
|
-
|
|
609
|
+
kt(e, i, n[i]);
|
|
610
610
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : qe(Object(n)).forEach(function(i) {
|
|
611
611
|
Object.defineProperty(e, i, Object.getOwnPropertyDescriptor(n, i));
|
|
612
612
|
});
|
|
613
613
|
}
|
|
614
614
|
return e;
|
|
615
615
|
}
|
|
616
|
-
function
|
|
616
|
+
function kt(e, s, n) {
|
|
617
617
|
return s = Ot(s), s in e ? Object.defineProperty(e, s, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[s] = n, e;
|
|
618
618
|
}
|
|
619
619
|
function Ot(e) {
|
|
@@ -631,29 +631,29 @@ function Lt(e, s) {
|
|
|
631
631
|
return (s === "string" ? String : Number)(e);
|
|
632
632
|
}
|
|
633
633
|
function tt(e) {
|
|
634
|
-
return e && e.map((s, n) => /* @__PURE__ */ q.createElement(s.tag,
|
|
634
|
+
return e && e.map((s, n) => /* @__PURE__ */ q.createElement(s.tag, Te({
|
|
635
635
|
key: n
|
|
636
636
|
}, s.attr), tt(s.child)));
|
|
637
637
|
}
|
|
638
638
|
function de(e) {
|
|
639
|
-
return (s) => /* @__PURE__ */ q.createElement(
|
|
640
|
-
attr:
|
|
639
|
+
return (s) => /* @__PURE__ */ q.createElement(Nt, Ne({
|
|
640
|
+
attr: Te({}, e.attr)
|
|
641
641
|
}, s), tt(e.child));
|
|
642
642
|
}
|
|
643
|
-
function
|
|
643
|
+
function Nt(e) {
|
|
644
644
|
var s = (n) => {
|
|
645
645
|
var {
|
|
646
646
|
attr: i,
|
|
647
647
|
size: a,
|
|
648
648
|
title: l
|
|
649
649
|
} = e, u = jt(e, Ct), p = a || n.size || "1em", m;
|
|
650
|
-
return n.className && (m = n.className), e.className && (m = (m ? m + " " : "") + e.className), /* @__PURE__ */ q.createElement("svg",
|
|
650
|
+
return n.className && (m = n.className), e.className && (m = (m ? m + " " : "") + e.className), /* @__PURE__ */ q.createElement("svg", Ne({
|
|
651
651
|
stroke: "currentColor",
|
|
652
652
|
fill: "currentColor",
|
|
653
653
|
strokeWidth: "0"
|
|
654
654
|
}, n.attr, i, u, {
|
|
655
655
|
className: m,
|
|
656
|
-
style:
|
|
656
|
+
style: Te(Te({
|
|
657
657
|
color: e.color || n.color
|
|
658
658
|
}, n.style), e.style),
|
|
659
659
|
height: p,
|
|
@@ -663,7 +663,7 @@ function Tt(e) {
|
|
|
663
663
|
};
|
|
664
664
|
return Ue !== void 0 ? /* @__PURE__ */ q.createElement(Ue.Consumer, null, (n) => s(n)) : s(et);
|
|
665
665
|
}
|
|
666
|
-
function
|
|
666
|
+
function Tt(e) {
|
|
667
667
|
return de({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M17.47 250.9C88.82 328.1 158 397.6 224.5 485.5c72.3-143.8 146.3-288.1 268.4-444.37L460 26.06C356.9 135.4 276.8 238.9 207.2 361.9c-48.4-43.6-126.62-105.3-174.38-137z" }, child: [] }] })(e);
|
|
668
668
|
}
|
|
669
669
|
const rt = ce(), o0 = ({ children: e }) => {
|
|
@@ -708,14 +708,14 @@ const rt = ce(), o0 = ({ children: e }) => {
|
|
|
708
708
|
progressColor: "bg-warning-progress"
|
|
709
709
|
}
|
|
710
710
|
},
|
|
711
|
-
getIcon: (
|
|
712
|
-
switch (
|
|
711
|
+
getIcon: (b) => {
|
|
712
|
+
switch (b) {
|
|
713
713
|
case "danger":
|
|
714
714
|
return /* @__PURE__ */ o.jsx(yt, { className: "w-[20px] h-[20px]" });
|
|
715
715
|
case "info":
|
|
716
716
|
return /* @__PURE__ */ o.jsx(Et, { className: "w-[20px] h-[20px]" });
|
|
717
717
|
case "success":
|
|
718
|
-
return /* @__PURE__ */ o.jsx(
|
|
718
|
+
return /* @__PURE__ */ o.jsx(Tt, { className: "text-xl" });
|
|
719
719
|
case "warning":
|
|
720
720
|
return /* @__PURE__ */ o.jsx(wt, { className: "w-[20px] h-[20px]" });
|
|
721
721
|
}
|
|
@@ -723,9 +723,9 @@ const rt = ce(), o0 = ({ children: e }) => {
|
|
|
723
723
|
closeAlert: () => {
|
|
724
724
|
n(!s);
|
|
725
725
|
},
|
|
726
|
-
activeAlert: (
|
|
726
|
+
activeAlert: (b, c) => {
|
|
727
727
|
n(!1), setTimeout(() => {
|
|
728
|
-
a(
|
|
728
|
+
a(b), u(c), n(!0);
|
|
729
729
|
}, 50);
|
|
730
730
|
}
|
|
731
731
|
};
|
|
@@ -739,10 +739,10 @@ let ge;
|
|
|
739
739
|
const Rt = async (e, s, n, i, a, l) => {
|
|
740
740
|
if (ge) return ge;
|
|
741
741
|
try {
|
|
742
|
-
const p = await (await fetch("/config.json")).json(), m = p.baseUri, { unauthorized: g, notFound: C, defaultMessage: j } = p.axiosErrors,
|
|
742
|
+
const p = await (await fetch("/config.json")).json(), m = p.baseUri, { unauthorized: g, notFound: C, defaultMessage: j } = p.axiosErrors, b = p.axiosTimeout;
|
|
743
743
|
return ge = mt.create({
|
|
744
744
|
baseURL: m,
|
|
745
|
-
timeout:
|
|
745
|
+
timeout: b
|
|
746
746
|
}), ge.interceptors.request.use(
|
|
747
747
|
(c) => c
|
|
748
748
|
), ge.interceptors.response.use(
|
|
@@ -766,131 +766,126 @@ const Rt = async (e, s, n, i, a, l) => {
|
|
|
766
766
|
console.error(u);
|
|
767
767
|
}
|
|
768
768
|
}, ot = ce(), n0 = ({ children: e }) => {
|
|
769
|
-
const { heartbeatEndpoint: s, firstPrivatePath: n, infiniteSession: i, timeDeducted: a, authenticatedEndpoint: l, autoLogin: u, setCurrentDate: p, isDebug: m, backendToken: g, useCustomLoginTimeout: C, customLoginTimeout: j, tokenLog:
|
|
770
|
-
|
|
769
|
+
const { heartbeatEndpoint: s, firstPrivatePath: n, infiniteSession: i, timeDeducted: a, authenticatedEndpoint: l, autoLogin: u, setCurrentDate: p, isDebug: m, backendToken: g, useCustomLoginTimeout: C, customLoginTimeout: j, tokenLog: b, timerInfiniteSession: c } = ne(), { setIsLoading: h, showLoadingFor: v } = Ce(), { setShowAlert: x, setMessageAlert: S, setTypeAlert: k, activeAlert: N } = fe(), y = Be(), [T, M] = E(null), [V, z] = E(), [X, W] = E(), [Y, se] = E(), [K, F] = E(!1), I = async (O = A, G, B) => await Rt(x, k, S, O, G, B), Q = async (O = null, G) => {
|
|
770
|
+
O && O.preventDefault(), F(!0);
|
|
771
771
|
try {
|
|
772
|
-
C || h(!0),
|
|
773
|
-
const
|
|
774
|
-
auth:
|
|
775
|
-
}),
|
|
776
|
-
|
|
777
|
-
} catch (
|
|
778
|
-
console.error(
|
|
772
|
+
C || h(!0), v(j), x(!1);
|
|
773
|
+
const R = await (await I()).post(l, {
|
|
774
|
+
auth: G
|
|
775
|
+
}), U = R.headers.token, J = R.data;
|
|
776
|
+
U && (localStorage.setItem("accessToken", U), localStorage.setItem("user", JSON.stringify(J)), M(!0), z(U), y(`${n}${J.id}`));
|
|
777
|
+
} catch (B) {
|
|
778
|
+
console.error(B);
|
|
779
779
|
} finally {
|
|
780
|
-
|
|
780
|
+
F(!1), C || h(!1);
|
|
781
781
|
}
|
|
782
|
-
},
|
|
783
|
-
localStorage.removeItem("accessToken"), localStorage.removeItem("id"), localStorage.removeItem("user"),
|
|
782
|
+
}, A = () => {
|
|
783
|
+
localStorage.removeItem("accessToken"), localStorage.removeItem("id"), localStorage.removeItem("user"), M(!1), z(null);
|
|
784
784
|
}, me = async () => {
|
|
785
|
-
const N = localStorage.getItem("accessToken"), R = W();
|
|
786
|
-
if (console.log("validToken:", R), R) {
|
|
787
|
-
v && console.log("Token valido, inutile fare la chiamata heartbeat");
|
|
788
|
-
return;
|
|
789
|
-
}
|
|
790
785
|
try {
|
|
791
|
-
const
|
|
786
|
+
const O = localStorage.getItem("accessToken"), R = (await (await I()).get(
|
|
792
787
|
`${s}`,
|
|
793
788
|
{
|
|
794
789
|
headers: {
|
|
795
|
-
Authorization:
|
|
790
|
+
Authorization: O
|
|
796
791
|
}
|
|
797
792
|
}
|
|
798
793
|
)).headers.token;
|
|
799
|
-
localStorage.setItem("accessToken",
|
|
800
|
-
} catch (
|
|
801
|
-
console.error(
|
|
794
|
+
localStorage.setItem("accessToken", R), z(R), m && console.log("[Auth]: Nuovo token: ", R, "Data:", p());
|
|
795
|
+
} catch (O) {
|
|
796
|
+
console.error(O), A();
|
|
802
797
|
}
|
|
803
|
-
},
|
|
804
|
-
const
|
|
805
|
-
if (!
|
|
806
|
-
const
|
|
798
|
+
}, H = (O) => {
|
|
799
|
+
const G = O || V;
|
|
800
|
+
if (!G) return;
|
|
801
|
+
const B = "Token non valido";
|
|
807
802
|
try {
|
|
808
|
-
const
|
|
809
|
-
if (!
|
|
810
|
-
|
|
803
|
+
const R = De(G);
|
|
804
|
+
if (!R.exp) {
|
|
805
|
+
b && console.warn("[Auth]: Token senza data di scadenza, eseguo logout."), A(), N("danger", B);
|
|
811
806
|
return;
|
|
812
807
|
}
|
|
813
|
-
const
|
|
808
|
+
const U = Math.floor(Date.now() / 1e3), J = (R.exp - U) * 1e3;
|
|
814
809
|
if (J <= 0) {
|
|
815
|
-
|
|
810
|
+
b && console.warn("[Auth]: Token scaduto, eseguo logout."), A(), N("danger", B);
|
|
816
811
|
return;
|
|
817
812
|
}
|
|
818
|
-
se(J),
|
|
813
|
+
se(J), W(J - a);
|
|
819
814
|
const je = J - a;
|
|
820
|
-
if (
|
|
821
|
-
const ve = Math.floor(J / 1e3), be = Math.floor(ve / 60),
|
|
822
|
-
console.log(`[Auth]: Token valido per ancora: ${be} minuti e ${
|
|
815
|
+
if (b) {
|
|
816
|
+
const ve = Math.floor(J / 1e3), be = Math.floor(ve / 60), Se = ve % 60;
|
|
817
|
+
console.log(`[Auth]: Token valido per ancora: ${be} minuti e ${Se} secondi`), console.log("[Auth]: Token:", G);
|
|
823
818
|
}
|
|
824
819
|
return je;
|
|
825
|
-
} catch (
|
|
826
|
-
|
|
820
|
+
} catch (R) {
|
|
821
|
+
b && console.error("[Auth]: Errore nella decodifica del token:", R), A(), N("danger", B);
|
|
827
822
|
}
|
|
828
|
-
}, re = (
|
|
829
|
-
if (!
|
|
823
|
+
}, re = (O) => {
|
|
824
|
+
if (!O) return !1;
|
|
830
825
|
try {
|
|
831
|
-
const
|
|
832
|
-
return !
|
|
833
|
-
} catch (
|
|
834
|
-
return console.error("[Auth]: Token non valido o corrotto",
|
|
826
|
+
const G = De(O), B = Math.floor(Date.now() / 1e3);
|
|
827
|
+
return !G.exp || G.exp < B ? (console.warn("[Auth]: Token scaduto o non valido"), !1) : !0;
|
|
828
|
+
} catch (G) {
|
|
829
|
+
return console.error("[Auth]: Token non valido o corrotto", G), !1;
|
|
835
830
|
}
|
|
836
|
-
},
|
|
831
|
+
}, Z = async (O) => {
|
|
837
832
|
try {
|
|
838
|
-
const
|
|
833
|
+
const R = (await (await I()).get(
|
|
839
834
|
s,
|
|
840
835
|
{
|
|
841
836
|
headers: {
|
|
842
|
-
Authorization:
|
|
837
|
+
Authorization: O
|
|
843
838
|
}
|
|
844
839
|
}
|
|
845
840
|
)).data;
|
|
846
|
-
|
|
847
|
-
} catch (
|
|
848
|
-
console.error(
|
|
841
|
+
R && (localStorage.setItem("user", JSON.stringify(R)), localStorage.setItem("accessToken", O), M(!0), y(`${n}${R.id}`));
|
|
842
|
+
} catch (G) {
|
|
843
|
+
console.error(G);
|
|
849
844
|
}
|
|
850
845
|
}, pe = () => {
|
|
851
|
-
const
|
|
852
|
-
re(
|
|
846
|
+
const O = localStorage.getItem("accessToken");
|
|
847
|
+
re(O) ? (b && console.log("[Auth]: Ricarico pagina → controllo scadenza token"), H(O)) : (b && console.warn("[Auth]: Token non valido al reload, eseguo logout"), A());
|
|
853
848
|
};
|
|
854
|
-
|
|
855
|
-
const
|
|
856
|
-
if (!re(
|
|
857
|
-
|
|
849
|
+
D(() => {
|
|
850
|
+
const O = localStorage.getItem("accessToken");
|
|
851
|
+
if (!re(O)) {
|
|
852
|
+
A();
|
|
858
853
|
return;
|
|
859
854
|
}
|
|
860
|
-
|
|
861
|
-
}, []),
|
|
862
|
-
u && !T && !K && (
|
|
863
|
-
}, [u, T, K]),
|
|
855
|
+
M(!0);
|
|
856
|
+
}, []), D(() => {
|
|
857
|
+
u && !T && !K && (b && console.log("[Auth]: Tentativo di autologin con backendToken"), Z(g));
|
|
858
|
+
}, [u, T, K]), D(() => {
|
|
864
859
|
if (document.readyState === "complete")
|
|
865
860
|
pe();
|
|
866
861
|
else
|
|
867
862
|
return window.addEventListener("load", pe), () => window.removeEventListener("load", pe);
|
|
868
|
-
}, []),
|
|
863
|
+
}, []), D(() => {
|
|
869
864
|
if (u) return;
|
|
870
|
-
const
|
|
871
|
-
|
|
872
|
-
let
|
|
873
|
-
i &&
|
|
865
|
+
const O = localStorage.getItem("accessToken"), G = H(O), B = c || G;
|
|
866
|
+
b && console.log("[Auth]: intervallo per il prossimo token:", B);
|
|
867
|
+
let R;
|
|
868
|
+
i && O && G && (b && console.log("[Auth]: Entrato dentro il timer della sessione infinita"), R = setInterval(() => {
|
|
874
869
|
me();
|
|
875
|
-
},
|
|
876
|
-
let
|
|
877
|
-
return !i &&
|
|
878
|
-
|
|
879
|
-
},
|
|
880
|
-
|
|
870
|
+
}, B));
|
|
871
|
+
let U;
|
|
872
|
+
return !i && O && (b && console.log("[Auth]: Entrato dentro il timer della sessione con scadenza del token"), U = setTimeout(() => {
|
|
873
|
+
A(), N("danger", "Sessione scaduta");
|
|
874
|
+
}, Y)), () => {
|
|
875
|
+
R && clearInterval(R), U && clearTimeout(U);
|
|
881
876
|
};
|
|
882
877
|
}, [V, X]);
|
|
883
878
|
const xe = {
|
|
884
879
|
isAuthenticated: T,
|
|
885
|
-
setIsAuthenticated:
|
|
880
|
+
setIsAuthenticated: M,
|
|
886
881
|
login: Q,
|
|
887
|
-
logout:
|
|
888
|
-
setCurrentToken:
|
|
882
|
+
logout: A,
|
|
883
|
+
setCurrentToken: z,
|
|
889
884
|
createAxiosInstances: I,
|
|
890
885
|
fetchHeartbeat: me,
|
|
891
|
-
getTokenExpiry:
|
|
886
|
+
getTokenExpiry: H,
|
|
892
887
|
checkTokenValidity: re,
|
|
893
|
-
fetchUser:
|
|
888
|
+
fetchUser: Z,
|
|
894
889
|
handleLoad: pe
|
|
895
890
|
};
|
|
896
891
|
return /* @__PURE__ */ o.jsx(ot.Provider, { value: xe, children: e });
|
|
@@ -917,8 +912,8 @@ Esempio:
|
|
|
917
912
|
const { login: s } = Re(), { clearLoginFormOnError: n } = ne(), i = {
|
|
918
913
|
email: "",
|
|
919
914
|
password: ""
|
|
920
|
-
}, [a, l] = E("Accedi"), [u, p] = E("Email"), [m, g] = E("email"), [C, j] = E("example@example.it"), [
|
|
921
|
-
overrideStyle:
|
|
915
|
+
}, [a, l] = E("Accedi"), [u, p] = E("Email"), [m, g] = E("email"), [C, j] = E("example@example.it"), [b, c] = E("Accedi"), [h, v] = E(i), [x, S] = E(), [k, N] = E(), [y, T] = E(), [M, V] = E(), [z, X] = E({}), [W, Y] = E(null), F = {
|
|
916
|
+
overrideStyle: z,
|
|
922
917
|
setOverrideStyle: X,
|
|
923
918
|
title: a,
|
|
924
919
|
setTitle: l,
|
|
@@ -928,64 +923,64 @@ Esempio:
|
|
|
928
923
|
setType: g,
|
|
929
924
|
placeholder: C,
|
|
930
925
|
setPlaceholder: j,
|
|
931
|
-
buttonText:
|
|
926
|
+
buttonText: b,
|
|
932
927
|
setButtonText: c,
|
|
933
928
|
formData: h,
|
|
934
|
-
setFormData:
|
|
929
|
+
setFormData: v,
|
|
935
930
|
LogoImg: x,
|
|
936
|
-
setLogoImg:
|
|
937
|
-
styleCardForm:
|
|
938
|
-
setStyleCardForm:
|
|
931
|
+
setLogoImg: S,
|
|
932
|
+
styleCardForm: k,
|
|
933
|
+
setStyleCardForm: N,
|
|
939
934
|
styleContainerLogo: y,
|
|
940
935
|
setStyleContainerLogo: T,
|
|
941
|
-
styleLogo:
|
|
936
|
+
styleLogo: M,
|
|
942
937
|
setStyleLogo: V,
|
|
943
938
|
changeData: (I, Q) => {
|
|
944
|
-
|
|
939
|
+
v((A) => ({ ...A, [I]: Q }));
|
|
945
940
|
},
|
|
946
941
|
handleLogin: (I) => {
|
|
947
|
-
s(I, h), n &&
|
|
942
|
+
s(I, h), n && v(i);
|
|
948
943
|
},
|
|
949
|
-
customVersion:
|
|
950
|
-
setCustomVersion:
|
|
944
|
+
customVersion: W,
|
|
945
|
+
setCustomVersion: Y
|
|
951
946
|
};
|
|
952
|
-
return /* @__PURE__ */ o.jsx(st.Provider, { value:
|
|
947
|
+
return /* @__PURE__ */ o.jsx(st.Provider, { value: F, children: e });
|
|
953
948
|
}, it = () => {
|
|
954
949
|
const e = ue(st);
|
|
955
950
|
if (e === void 0) throw new Error("Non puoi modificare La login");
|
|
956
951
|
return e;
|
|
957
952
|
}, at = ce(), a0 = ({ children: e }) => {
|
|
958
|
-
const [s, n] = E(!1), [i, a] = E(null), [l, u] = E(""), [p, m] = E(null), [g, C] = E(null), [j,
|
|
959
|
-
y(
|
|
960
|
-
},
|
|
961
|
-
a(null), u(""), m(null), x("submit"), h("modal-form"),
|
|
953
|
+
const [s, n] = E(!1), [i, a] = E(null), [l, u] = E(""), [p, m] = E(null), [g, C] = E(null), [j, b] = E(null), [c, h] = E("modal-form"), [v, x] = E("submit"), [S, k] = E({}), [N, y] = E(null), [T, M] = E(null), [V, z] = E(null), X = ({ modalData: F, component: I, title: Q = "", onConfirm: A = null, type: me = "submit", formId: H = "modal-form", item: re = null, style: Z }) => {
|
|
954
|
+
y(F), a(() => I), u(Q), m(() => A), x(me), h(H), b(re), k(Z), n(!0);
|
|
955
|
+
}, W = () => {
|
|
956
|
+
a(null), u(""), m(null), x("submit"), h("modal-form"), b(null), k({}), n(!1), y(null);
|
|
962
957
|
}, K = {
|
|
963
958
|
isOpen: s,
|
|
964
959
|
openModal: X,
|
|
965
|
-
closeModal:
|
|
960
|
+
closeModal: W,
|
|
966
961
|
content: i,
|
|
967
962
|
title: l,
|
|
968
963
|
onConfirm: p,
|
|
969
|
-
type:
|
|
964
|
+
type: v,
|
|
970
965
|
item: j,
|
|
971
966
|
formId: c,
|
|
972
|
-
style:
|
|
973
|
-
modalData:
|
|
967
|
+
style: S,
|
|
968
|
+
modalData: N,
|
|
974
969
|
setModalData: y,
|
|
975
|
-
handleChange: (
|
|
976
|
-
const { name: I, value: Q } =
|
|
977
|
-
y((
|
|
978
|
-
...
|
|
970
|
+
handleChange: (F) => {
|
|
971
|
+
const { name: I, value: Q } = F.target;
|
|
972
|
+
y((A) => ({
|
|
973
|
+
...A,
|
|
979
974
|
[I]: Q
|
|
980
975
|
}));
|
|
981
976
|
},
|
|
982
|
-
handleSubmit: (
|
|
983
|
-
|
|
977
|
+
handleSubmit: (F) => {
|
|
978
|
+
F.preventDefault(), p && (p(N), W());
|
|
984
979
|
},
|
|
985
980
|
headerContent: T,
|
|
986
|
-
setHeaderContent:
|
|
981
|
+
setHeaderContent: M,
|
|
987
982
|
footerContent: V,
|
|
988
|
-
setFooterContent:
|
|
983
|
+
setFooterContent: z,
|
|
989
984
|
onCancel: g,
|
|
990
985
|
setOnCancel: C
|
|
991
986
|
};
|
|
@@ -1009,18 +1004,18 @@ function At(e) {
|
|
|
1009
1004
|
return de({ tag: "svg", attr: { viewBox: "0 0 15 15", fill: "none" }, child: [{ tag: "path", attr: { fillRule: "evenodd", clipRule: "evenodd", d: "M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z", fill: "currentColor" }, child: [] }] })(e);
|
|
1010
1005
|
}
|
|
1011
1006
|
const Ve = () => {
|
|
1012
|
-
const { messageAlert: e, typeAlert: s, alertConfig: n, getIcon: i, closeAlert: a } = fe(), { alertTimeout: l } = ne(), [u, p] = E(0), { bgColor: m, textColor: g, buttonBg: C, hoverBg: j, focusRing:
|
|
1013
|
-
return
|
|
1007
|
+
const { messageAlert: e, typeAlert: s, alertConfig: n, getIcon: i, closeAlert: a } = fe(), { alertTimeout: l } = ne(), [u, p] = E(0), { bgColor: m, textColor: g, buttonBg: C, hoverBg: j, focusRing: b, progressColor: c } = n[s];
|
|
1008
|
+
return D(() => {
|
|
1014
1009
|
let h;
|
|
1015
1010
|
const x = 100 / (l / 100);
|
|
1016
1011
|
h = setInterval(() => {
|
|
1017
|
-
p((
|
|
1012
|
+
p((k) => k >= 100 ? (clearInterval(h), 100) : k + x);
|
|
1018
1013
|
}, 100);
|
|
1019
|
-
const
|
|
1014
|
+
const S = setTimeout(() => {
|
|
1020
1015
|
a();
|
|
1021
1016
|
}, l);
|
|
1022
1017
|
return () => {
|
|
1023
|
-
clearTimeout(
|
|
1018
|
+
clearTimeout(S), clearInterval(h);
|
|
1024
1019
|
};
|
|
1025
1020
|
}, []), /* @__PURE__ */ o.jsxs("div", { className: `flex items-center p-4 pt-6 ${g} rounded-lg ${m} mx-auto max-sm:min-w-[280px] sm:max-w-1/3 fixed top-[calc(100vh-100px)] sm:right-10 right-1/2 translate-x-1/2 sm:translate-0 z-100`, role: "alert", children: [
|
|
1026
1021
|
/* @__PURE__ */ o.jsx("div", { className: "w-full bg-gray-200 rounded-t-lg overflow-hidden h-2.5 absolute top-0 left-0 right-0", children: /* @__PURE__ */ o.jsx("div", { className: `${c} h-2.5 rounded-t-lg`, style: { width: `${u}%` } }) }),
|
|
@@ -1030,7 +1025,7 @@ const Ve = () => {
|
|
|
1030
1025
|
"button",
|
|
1031
1026
|
{
|
|
1032
1027
|
type: "button",
|
|
1033
|
-
className: `ms-auto ${C} rounded-lg focus:ring-2 ${
|
|
1028
|
+
className: `ms-auto ${C} rounded-lg focus:ring-2 ${b} p-1.5 ${j} inline-flex items-center justify-center h-8 w-8 cursor-pointer`,
|
|
1034
1029
|
title: "Close",
|
|
1035
1030
|
onClick: a,
|
|
1036
1031
|
children: /* @__PURE__ */ o.jsx(At, { className: "text-xl" })
|
|
@@ -1038,7 +1033,7 @@ const Ve = () => {
|
|
|
1038
1033
|
)
|
|
1039
1034
|
] });
|
|
1040
1035
|
}, Bt = ({ onClose: e, onConfirm: s, onCancel: n, type: i, formId: a, style: l }) => {
|
|
1041
|
-
const u = l.resetButton ?? !0, p = l.confirmButtonText ?? (i === "delete" ? "Elimina" : "Salva"), m = l.cancelButtonText ?? "Annulla", g = l.bgSaveButton ?? "bg-indigo-600 rounded-lg shadow-md hover:bg-indigo-700 hover:shadow-lg active:bg-indigo-800 text-white", C = l.bgDeleteButton ?? "bg-rose-500 rounded-lg shadow-md hover:bg-rose-600 hover:shadow-lg active:bg-rose-700 text-white", j = l.bgResetButton ?? "bg-rose-500 rounded-lg shadow-md hover:bg-rose-600 hover:shadow-lg active:bg-rose-700 text-white",
|
|
1036
|
+
const u = l.resetButton ?? !0, p = l.confirmButtonText ?? (i === "delete" ? "Elimina" : "Salva"), m = l.cancelButtonText ?? "Annulla", g = l.bgSaveButton ?? "bg-indigo-600 rounded-lg shadow-md hover:bg-indigo-700 hover:shadow-lg active:bg-indigo-800 text-white", C = l.bgDeleteButton ?? "bg-rose-500 rounded-lg shadow-md hover:bg-rose-600 hover:shadow-lg active:bg-rose-700 text-white", j = l.bgResetButton ?? "bg-rose-500 rounded-lg shadow-md hover:bg-rose-600 hover:shadow-lg active:bg-rose-700 text-white", b = l.bgCancelButton ?? "text-gray-800 bg-gray-300 rounded-lg shadow-md hover:bg-gray-400 hover:shadow-lg active:bg-gray-500", c = i === "custom" ? l.customButtonStyle : null, h = {
|
|
1042
1037
|
delete: () => {
|
|
1043
1038
|
s == null || s(), e == null || e();
|
|
1044
1039
|
},
|
|
@@ -1051,7 +1046,7 @@ const Ve = () => {
|
|
|
1051
1046
|
"button",
|
|
1052
1047
|
{
|
|
1053
1048
|
onClick: n || e,
|
|
1054
|
-
className: `${
|
|
1049
|
+
className: `${b} px-4 py-2 cursor-pointer text-sm font-medium active:shadow-sm transition-all duration-150 ease-in-out hover:opacity-90 active:scale-95 active:opacity-70`,
|
|
1055
1050
|
children: m
|
|
1056
1051
|
}
|
|
1057
1052
|
),
|
|
@@ -1071,8 +1066,8 @@ const Ve = () => {
|
|
|
1071
1066
|
type: i === "submit" ? "submit" : "button",
|
|
1072
1067
|
form: i === "submit" ? a : void 0,
|
|
1073
1068
|
onClick: () => {
|
|
1074
|
-
var
|
|
1075
|
-
return (
|
|
1069
|
+
var v;
|
|
1070
|
+
return (v = h[i]) == null ? void 0 : v.call(h);
|
|
1076
1071
|
},
|
|
1077
1072
|
className: c || `${i === "delete" ? C : g} px-4 py-2 cursor-pointer text-sm font-medium active:shadow-sm transition-all duration-150 ease-in-out hover:opacity-90 active:scale-95 active:opacity-70`,
|
|
1078
1073
|
children: p
|
|
@@ -1100,34 +1095,34 @@ const _t = ({ onClose: e, type: s, title: n, name: i, onCancel: a }) => /* @__PU
|
|
|
1100
1095
|
}
|
|
1101
1096
|
)
|
|
1102
1097
|
] }), zt = ({ type: e, children: s, item: n, overrideStyle: i }) => /* @__PURE__ */ o.jsx(o.Fragment, { children: e !== "delete" && /* @__PURE__ */ o.jsx("main", { className: i || "my-8 max-h-[600px] overflow-y-auto overflow-x-hidden", children: e === "delete" && !n ? /* @__PURE__ */ o.jsx("div", { className: "text-red-600 font-semibold", children: "Errore: nessun item selezionato per l'operazione." }) : s }) }), $t = ({ isOpen: e, onClose: s, onCancel: n, title: i, formId: a, children: l, item: u, onConfirm: p, type: m = "submit", style: g = {}, headerContent: C, footerContent: j }) => {
|
|
1103
|
-
const
|
|
1098
|
+
const b = ut(null), [c, h] = E(e), v = () => {
|
|
1104
1099
|
e || h(!1);
|
|
1105
|
-
}, x = g.width ?? (m === "delete" ? "max-w-md w-auto" : "w-full max-w-4xl"),
|
|
1106
|
-
return
|
|
1100
|
+
}, x = g.width ?? (m === "delete" ? "max-w-md w-auto" : "w-full max-w-4xl"), S = g.bgModal ?? "bg-white", k = g.bgOverlay ?? "bg-black/50", N = g.zIndex ?? "z-50";
|
|
1101
|
+
return D(() => {
|
|
1107
1102
|
e && h(!0);
|
|
1108
|
-
}, [e]),
|
|
1103
|
+
}, [e]), D(() => {
|
|
1109
1104
|
const y = (T) => {
|
|
1110
1105
|
T.key === "Escape" && (n ? n() : s());
|
|
1111
1106
|
};
|
|
1112
1107
|
return document.addEventListener("keydown", y), () => document.removeEventListener("keydown", y);
|
|
1113
|
-
}, [s, n]),
|
|
1108
|
+
}, [s, n]), D(() => {
|
|
1114
1109
|
var y;
|
|
1115
1110
|
if (e) {
|
|
1116
1111
|
const T = document.activeElement;
|
|
1117
|
-
return (y =
|
|
1112
|
+
return (y = b.current) == null || y.focus(), () => T == null ? void 0 : T.focus();
|
|
1118
1113
|
}
|
|
1119
1114
|
}, [e]), c ? pt.createPortal(
|
|
1120
1115
|
/* @__PURE__ */ o.jsx(
|
|
1121
1116
|
"div",
|
|
1122
1117
|
{
|
|
1123
|
-
className: `fixed inset-0 ${
|
|
1118
|
+
className: `fixed inset-0 ${N} flex items-center justify-center transition-opacity duration-200 ${e ? `${k} opacity-100` : "opacity-0"}`,
|
|
1124
1119
|
onClick: n || s,
|
|
1125
|
-
onTransitionEnd:
|
|
1120
|
+
onTransitionEnd: v,
|
|
1126
1121
|
children: /* @__PURE__ */ o.jsxs(
|
|
1127
1122
|
"div",
|
|
1128
1123
|
{
|
|
1129
|
-
ref:
|
|
1130
|
-
className: `relative ${
|
|
1124
|
+
ref: b,
|
|
1125
|
+
className: `relative ${S} rounded-lg p-6 shadow-xl ${x} transform transition-transform duration-200 ${e ? "scale-100 opacity-100" : "scale-95 opacity-0"}`,
|
|
1131
1126
|
onClick: (y) => y.stopPropagation(),
|
|
1132
1127
|
role: "dialog",
|
|
1133
1128
|
"aria-modal": "true",
|
|
@@ -1171,20 +1166,20 @@ const _t = ({ onClose: e, type: s, title: n, name: i, onCancel: a }) => /* @__PU
|
|
|
1171
1166
|
document.body
|
|
1172
1167
|
) : null;
|
|
1173
1168
|
}, Ft = (e) => {
|
|
1174
|
-
const { isLoading: s } = Ce(), { showAlert: n } = fe(), { isOpen: i, closeModal: a, onCancel: l, content: u, title: p, onConfirm: m, item: g, type: C, formId: j, style:
|
|
1169
|
+
const { isLoading: s } = Ce(), { showAlert: n } = fe(), { isOpen: i, closeModal: a, onCancel: l, content: u, title: p, onConfirm: m, item: g, type: C, formId: j, style: b, headerContent: c, footerContent: h } = Gt(), v = Ie(), {
|
|
1175
1170
|
isMain: x = !0,
|
|
1176
|
-
headerComponent:
|
|
1177
|
-
showHeaderOnLogin:
|
|
1178
|
-
headerExcludedRoutes:
|
|
1171
|
+
headerComponent: S = null,
|
|
1172
|
+
showHeaderOnLogin: k = !1,
|
|
1173
|
+
headerExcludedRoutes: N = [],
|
|
1179
1174
|
footerComponent: y = null,
|
|
1180
1175
|
showFooterOnLogin: T = !1,
|
|
1181
|
-
footerExcludedRoutes:
|
|
1182
|
-
} = e, V =
|
|
1183
|
-
let
|
|
1184
|
-
|
|
1185
|
-
const X =
|
|
1186
|
-
let
|
|
1187
|
-
return
|
|
1176
|
+
footerExcludedRoutes: M = []
|
|
1177
|
+
} = e, V = N.some((Y) => We(Y, v.pathname));
|
|
1178
|
+
let z;
|
|
1179
|
+
v.pathname === "/" ? z = S && k : z = S && !V;
|
|
1180
|
+
const X = M.some((Y) => We(Y, v.pathname));
|
|
1181
|
+
let W;
|
|
1182
|
+
return v.pathname === "/" ? W = y && T : W = y && !X, /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
1188
1183
|
s && /* @__PURE__ */ o.jsx(Mt, {}),
|
|
1189
1184
|
n && /* @__PURE__ */ o.jsx(Ve, {}),
|
|
1190
1185
|
/* @__PURE__ */ o.jsx(
|
|
@@ -1198,18 +1193,18 @@ const _t = ({ onClose: e, type: s, title: n, name: i, onCancel: a }) => /* @__PU
|
|
|
1198
1193
|
onConfirm: m,
|
|
1199
1194
|
type: C,
|
|
1200
1195
|
item: g,
|
|
1201
|
-
style:
|
|
1196
|
+
style: b,
|
|
1202
1197
|
headerContent: c,
|
|
1203
1198
|
footerContent: h,
|
|
1204
1199
|
children: u
|
|
1205
1200
|
}
|
|
1206
1201
|
),
|
|
1207
|
-
|
|
1202
|
+
z && S,
|
|
1208
1203
|
x ? /* @__PURE__ */ o.jsxs("main", { className: s ? "hidden" : "", children: [
|
|
1209
1204
|
n && /* @__PURE__ */ o.jsx(Ve, {}),
|
|
1210
1205
|
/* @__PURE__ */ o.jsx(le, {})
|
|
1211
1206
|
] }) : /* @__PURE__ */ o.jsx(le, {}),
|
|
1212
|
-
|
|
1207
|
+
W && y
|
|
1213
1208
|
] });
|
|
1214
1209
|
}, Me = (e) => {
|
|
1215
1210
|
const {
|
|
@@ -1286,7 +1281,7 @@ const _t = ({ onClose: e, type: s, title: n, name: i, onCancel: a }) => /* @__PU
|
|
|
1286
1281
|
] });
|
|
1287
1282
|
}, Wt = ({ Logo: e }) => {
|
|
1288
1283
|
const { styleCardForm: s, styleContainerLogo: n, styleLogo: i, overrideStyle: a, customVersion: l } = it(), { firstPrivatePath: u, version: p } = ne(), m = Be();
|
|
1289
|
-
return
|
|
1284
|
+
return D(() => {
|
|
1290
1285
|
const g = JSON.parse(localStorage.getItem("user"));
|
|
1291
1286
|
localStorage.getItem("accessToken") && (g != null && g.id) && m(`${u}${g.id}`);
|
|
1292
1287
|
}, []), /* @__PURE__ */ o.jsxs("section", { id: "login-page", children: [
|
|
@@ -1298,7 +1293,7 @@ const _t = ({ onClose: e, type: s, title: n, name: i, onCancel: a }) => /* @__PU
|
|
|
1298
1293
|
] });
|
|
1299
1294
|
}, Le = () => {
|
|
1300
1295
|
const { isAuthenticated: e } = Re(), { activeAlert: s } = fe(), { autoLogin: n } = ne();
|
|
1301
|
-
return
|
|
1296
|
+
return D(() => {
|
|
1302
1297
|
const i = localStorage.getItem("accessToken");
|
|
1303
1298
|
!e && !i && !n && s("danger", "Non sei autorizzato");
|
|
1304
1299
|
}, []), e === null ? null : e ? /* @__PURE__ */ o.jsx(le, {}) : /* @__PURE__ */ o.jsx(Xe, { to: "/", replace: !0 });
|
|
@@ -1325,10 +1320,10 @@ const _t = ({ onClose: e, type: s, title: n, name: i, onCancel: a }) => /* @__PU
|
|
|
1325
1320
|
} finally {
|
|
1326
1321
|
g(!1);
|
|
1327
1322
|
}
|
|
1328
|
-
},
|
|
1323
|
+
}, b = () => {
|
|
1329
1324
|
e(), l("info", "Hai effettuato il logout");
|
|
1330
1325
|
};
|
|
1331
|
-
return
|
|
1326
|
+
return D(() => {
|
|
1332
1327
|
const c = localStorage.getItem("accessToken");
|
|
1333
1328
|
c && s(c);
|
|
1334
1329
|
}, []), /* @__PURE__ */ o.jsx("section", { children: /* @__PURE__ */ o.jsxs("div", { className: "container mx-auto py-8", children: [
|
|
@@ -1340,7 +1335,7 @@ const _t = ({ onClose: e, type: s, title: n, name: i, onCancel: a }) => /* @__PU
|
|
|
1340
1335
|
/* @__PURE__ */ o.jsx(
|
|
1341
1336
|
"button",
|
|
1342
1337
|
{
|
|
1343
|
-
onClick:
|
|
1338
|
+
onClick: b,
|
|
1344
1339
|
className: "bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded-full cursor-pointer shadow-[0_4px_10px_rgba(239,68,68,0.3),0_2px_4px_rgba(239,68,68,0.2)] hover:shadow-[0_6px_14px_rgba(185,28,28,0.4),0_3px_6px_rgba(185,28,28,0.3)] active:shadow-[0_2px_5px_rgba(239,68,68,0.3)] transition-all duration-200 active:translate-y-[2px]",
|
|
1345
1340
|
children: "Logout"
|
|
1346
1341
|
}
|
|
@@ -1417,27 +1412,27 @@ const _t = ({ onClose: e, type: s, title: n, name: i, onCancel: a }) => /* @__PU
|
|
|
1417
1412
|
headerComponent: g,
|
|
1418
1413
|
showHeaderOnLogin: C,
|
|
1419
1414
|
headerExcludedRoutes: j,
|
|
1420
|
-
footerComponent:
|
|
1415
|
+
footerComponent: b,
|
|
1421
1416
|
showFooterOnLogin: c,
|
|
1422
1417
|
footerExcludedRoutes: h,
|
|
1423
|
-
privateProvider:
|
|
1418
|
+
privateProvider: v,
|
|
1424
1419
|
customProvider: x
|
|
1425
1420
|
} = e;
|
|
1426
|
-
let
|
|
1427
|
-
p === "none" ?
|
|
1421
|
+
let S;
|
|
1422
|
+
p === "none" ? S = null : q.isValidElement(p) ? S = p : S = /* @__PURE__ */ o.jsx(
|
|
1428
1423
|
Ft,
|
|
1429
1424
|
{
|
|
1430
1425
|
isMain: m,
|
|
1431
1426
|
headerComponent: g,
|
|
1432
1427
|
showHeaderOnLogin: C,
|
|
1433
1428
|
headerExcludedRoutes: j,
|
|
1434
|
-
footerComponent:
|
|
1429
|
+
footerComponent: b,
|
|
1435
1430
|
showFooterOnLogin: c,
|
|
1436
1431
|
footerExcludedRoutes: h
|
|
1437
1432
|
}
|
|
1438
1433
|
);
|
|
1439
|
-
const
|
|
1440
|
-
|
|
1434
|
+
const k = v ? q.cloneElement(
|
|
1435
|
+
v,
|
|
1441
1436
|
{},
|
|
1442
1437
|
x ? q.createElement(
|
|
1443
1438
|
x.type,
|
|
@@ -1448,18 +1443,18 @@ const _t = ({ onClose: e, type: s, title: n, name: i, onCancel: a }) => /* @__PU
|
|
|
1448
1443
|
x.type,
|
|
1449
1444
|
x.props,
|
|
1450
1445
|
/* @__PURE__ */ o.jsx(Le, { children: /* @__PURE__ */ o.jsx(le, {}) })
|
|
1451
|
-
) : /* @__PURE__ */ o.jsx(Le, { children: /* @__PURE__ */ o.jsx(le, {}) }),
|
|
1446
|
+
) : /* @__PURE__ */ o.jsx(Le, { children: /* @__PURE__ */ o.jsx(le, {}) }), N = () => {
|
|
1452
1447
|
const y = document.querySelector("link[rel='icon']");
|
|
1453
1448
|
l && (y.href = l);
|
|
1454
1449
|
};
|
|
1455
|
-
return
|
|
1456
|
-
|
|
1457
|
-
}, []), /* @__PURE__ */ o.jsx(dt, { children: /* @__PURE__ */ o.jsxs(ae, { element:
|
|
1450
|
+
return D(() => {
|
|
1451
|
+
N();
|
|
1452
|
+
}, []), /* @__PURE__ */ o.jsx(dt, { children: /* @__PURE__ */ o.jsxs(ae, { element: S, children: [
|
|
1458
1453
|
/* @__PURE__ */ o.jsxs(ae, { path: "/", children: [
|
|
1459
1454
|
/* @__PURE__ */ o.jsx(ae, { index: !0, element: /* @__PURE__ */ o.jsx(Wt, { Logo: a }) }),
|
|
1460
1455
|
s.map((y, T) => /* @__PURE__ */ o.jsx(ae, { path: y.path, element: y.element }, `public-${T}`))
|
|
1461
1456
|
] }),
|
|
1462
|
-
/* @__PURE__ */ o.jsxs(ae, { element:
|
|
1457
|
+
/* @__PURE__ */ o.jsxs(ae, { element: k, children: [
|
|
1463
1458
|
/* @__PURE__ */ o.jsx(ae, { path: `${i ?? "/dashboard/"}:id`, element: u }),
|
|
1464
1459
|
n.map((y, T) => /* @__PURE__ */ o.jsx(ae, { path: y.path, element: y.element }, `private-${T}`))
|
|
1465
1460
|
] })
|
|
@@ -1467,7 +1462,7 @@ const _t = ({ onClose: e, type: s, title: n, name: i, onCancel: a }) => /* @__PU
|
|
|
1467
1462
|
}, c0 = ({ children: e }) => {
|
|
1468
1463
|
var a;
|
|
1469
1464
|
const s = Ie(), { activeAlert: n } = fe(), i = JSON.parse(localStorage.getItem("user"));
|
|
1470
|
-
return
|
|
1465
|
+
return D(() => {
|
|
1471
1466
|
(!i || !i.admin) && n("warning", "Non puoi accedere a questa pagina");
|
|
1472
1467
|
}, [i]), !i || !i.admin ? /* @__PURE__ */ o.jsx(Xe, { to: ((a = s.state) == null ? void 0 : a.from) || "/", replace: !0 }) : e;
|
|
1473
1468
|
}, u0 = ({ spinner: e = !0, spinnerStyle: s, text: n, textStyle: i, children: a, containerStyle: l, overrideStyle: u = {} }) => /* @__PURE__ */ o.jsxs("div", { className: u.container || `w-full h-full relative flex items-center justify-center ${l}`, children: [
|
|
@@ -1644,10 +1639,10 @@ const Vt = (e) => /* @__PURE__ */ r.createElement("svg", { width: "108.41262mm",
|
|
|
1644
1639
|
}, d: "", id: "path40", transform: "scale(0.26458333)" }))), p0 = ({ Logo: e, logo: s }) => {
|
|
1645
1640
|
const { logout: n } = Re(), { activeAlert: i } = fe(), { autoLogin: a, configRoutes: l, firstPrivateTitle: u, showHeaderButton: p } = ne(), { isLoading: m } = Ce(), g = Ie(), C = Be(), j = () => {
|
|
1646
1641
|
n(), i("info", "Hai effettuato il logout");
|
|
1647
|
-
},
|
|
1642
|
+
}, b = l.find((h) => h.path === g.pathname), c = ft("home/:id");
|
|
1648
1643
|
return /* @__PURE__ */ o.jsx("header", { className: m ? "hidden" : "", children: /* @__PURE__ */ o.jsxs("nav", { className: "header-size flex items-center justify-between px-2 shadow-lg border-b gap-2 border-b-gray-300", children: [
|
|
1649
1644
|
/* @__PURE__ */ o.jsx("figure", { children: e && typeof e == "function" ? /* @__PURE__ */ o.jsx(e, { className: "header-logo-size" }) : s ? /* @__PURE__ */ o.jsx("img", { src: s, alt: "Logo", className: "header-logo-size" }) : /* @__PURE__ */ o.jsx(Vt, { className: "header-logo-size" }) }),
|
|
1650
|
-
/* @__PURE__ */ o.jsx("div", { children: /* @__PURE__ */ o.jsx("p", { children: (
|
|
1645
|
+
/* @__PURE__ */ o.jsx("div", { children: /* @__PURE__ */ o.jsx("p", { children: (b == null ? void 0 : b.title) || u }) }),
|
|
1651
1646
|
/* @__PURE__ */ o.jsxs("div", { children: [
|
|
1652
1647
|
!a && c && /* @__PURE__ */ o.jsx(
|
|
1653
1648
|
"button",
|
|
@@ -1699,7 +1694,7 @@ export {
|
|
|
1699
1694
|
b0 as NavLink,
|
|
1700
1695
|
y0 as Outlet,
|
|
1701
1696
|
l0 as PackageRoutes,
|
|
1702
|
-
|
|
1697
|
+
T0 as ReactDOM,
|
|
1703
1698
|
E0 as Route,
|
|
1704
1699
|
s0 as RouteProvider,
|
|
1705
1700
|
w0 as Routes,
|
|
@@ -1713,7 +1708,7 @@ export {
|
|
|
1713
1708
|
it as useLoginForm,
|
|
1714
1709
|
j0 as useMatch,
|
|
1715
1710
|
Gt as useModal,
|
|
1716
|
-
|
|
1717
|
-
|
|
1711
|
+
S0 as useNavigate,
|
|
1712
|
+
k0 as useParams,
|
|
1718
1713
|
Pt as useRoutesInjection
|
|
1719
1714
|
};
|