thecore-auth 0.0.0 → 0.0.1

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.
@@ -1,6 +1,7 @@
1
- import M, { createContext as ge, useState as A, useContext as ve, useEffect as V } from "react";
2
- import { useNavigate as ot, Outlet as at, Navigate as Mt, useParams as zt } from "react-router-dom";
3
- import Wt from "axios";
1
+ import M, { createContext as de, useState as A, useContext as ge, useEffect as Y } from "react";
2
+ import Dt from "jwt-decode";
3
+ import { useNavigate as tt, Outlet as rt, Navigate as Lt, useParams as Ft } from "react-router-dom";
4
+ import Mt from "axios";
4
5
  var le = { exports: {} }, ee = {};
5
6
  /**
6
7
  * @license React
@@ -11,19 +12,19 @@ var le = { exports: {} }, ee = {};
11
12
  * This source code is licensed under the MIT license found in the
12
13
  * LICENSE file in the root directory of this source tree.
13
14
  */
14
- var He;
15
- function Bt() {
16
- if (He) return ee;
17
- He = 1;
18
- var t = M, n = Symbol.for("react.element"), o = Symbol.for("react.fragment"), a = Object.prototype.hasOwnProperty, c = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, u = { key: !0, ref: !0, __self: !0, __source: !0 };
19
- function g(p, f, y) {
20
- var w, m = {}, E = null, T = null;
21
- y !== void 0 && (E = "" + y), f.key !== void 0 && (E = "" + f.key), f.ref !== void 0 && (T = f.ref);
22
- for (w in f) a.call(f, w) && !u.hasOwnProperty(w) && (m[w] = f[w]);
23
- if (p && p.defaultProps) for (w in f = p.defaultProps, f) m[w] === void 0 && (m[w] = f[w]);
24
- return { $$typeof: n, type: p, key: E, ref: T, props: m, _owner: c.current };
15
+ var Ke;
16
+ function zt() {
17
+ if (Ke) return ee;
18
+ Ke = 1;
19
+ var t = M, n = Symbol.for("react.element"), a = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, u = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, g = { key: !0, ref: !0, __self: !0, __source: !0 };
20
+ function p(v, c, y) {
21
+ var w, h = {}, E = null, T = null;
22
+ y !== void 0 && (E = "" + y), c.key !== void 0 && (E = "" + c.key), c.ref !== void 0 && (T = c.ref);
23
+ for (w in c) s.call(c, w) && !g.hasOwnProperty(w) && (h[w] = c[w]);
24
+ if (v && v.defaultProps) for (w in c = v.defaultProps, c) h[w] === void 0 && (h[w] = c[w]);
25
+ return { $$typeof: n, type: v, key: E, ref: T, props: h, _owner: u.current };
25
26
  }
26
- return ee.Fragment = o, ee.jsx = g, ee.jsxs = g, ee;
27
+ return ee.Fragment = a, ee.jsx = p, ee.jsxs = p, ee;
27
28
  }
28
29
  var te = {};
29
30
  /**
@@ -35,11 +36,11 @@ var te = {};
35
36
  * This source code is licensed under the MIT license found in the
36
37
  * LICENSE file in the root directory of this source tree.
37
38
  */
38
- var Xe;
39
- function Ut() {
40
- return Xe || (Xe = 1, process.env.NODE_ENV !== "production" && function() {
41
- var t = M, n = Symbol.for("react.element"), o = Symbol.for("react.portal"), a = Symbol.for("react.fragment"), c = Symbol.for("react.strict_mode"), u = Symbol.for("react.profiler"), g = Symbol.for("react.provider"), p = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), y = Symbol.for("react.suspense"), w = Symbol.for("react.suspense_list"), m = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), T = Symbol.for("react.offscreen"), N = Symbol.iterator, L = "@@iterator";
42
- function O(e) {
39
+ var Ge;
40
+ function Wt() {
41
+ return Ge || (Ge = 1, process.env.NODE_ENV !== "production" && function() {
42
+ var t = M, n = Symbol.for("react.element"), a = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), u = Symbol.for("react.strict_mode"), g = Symbol.for("react.profiler"), p = Symbol.for("react.provider"), v = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), y = Symbol.for("react.suspense"), w = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), T = Symbol.for("react.offscreen"), N = Symbol.iterator, L = "@@iterator";
43
+ function P(e) {
43
44
  if (e === null || typeof e != "object")
44
45
  return null;
45
46
  var r = N && e[N] || e[L];
@@ -48,38 +49,38 @@ function Ut() {
48
49
  var b = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
49
50
  function j(e) {
50
51
  {
51
- for (var r = arguments.length, s = new Array(r > 1 ? r - 1 : 0), l = 1; l < r; l++)
52
- s[l - 1] = arguments[l];
53
- D("error", e, s);
52
+ for (var r = arguments.length, o = new Array(r > 1 ? r - 1 : 0), l = 1; l < r; l++)
53
+ o[l - 1] = arguments[l];
54
+ D("error", e, o);
54
55
  }
55
56
  }
56
- function D(e, r, s) {
57
+ function D(e, r, o) {
57
58
  {
58
- var l = b.ReactDebugCurrentFrame, h = l.getStackAddendum();
59
- h !== "" && (r += "%s", s = s.concat([h]));
60
- var x = s.map(function(v) {
61
- return String(v);
59
+ var l = b.ReactDebugCurrentFrame, m = l.getStackAddendum();
60
+ m !== "" && (r += "%s", o = o.concat([m]));
61
+ var x = o.map(function(d) {
62
+ return String(d);
62
63
  });
63
64
  x.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, x);
64
65
  }
65
66
  }
66
- var I = !1, H = !1, X = !1, _ = !1, P = !1, z;
67
+ var I = !1, H = !1, X = !1, _ = !1, O = !1, z;
67
68
  z = Symbol.for("react.module.reference");
68
69
  function F(e) {
69
- return !!(typeof e == "string" || typeof e == "function" || e === a || e === u || P || e === c || e === y || e === w || _ || e === T || I || H || X || typeof e == "object" && e !== null && (e.$$typeof === E || e.$$typeof === m || e.$$typeof === g || e.$$typeof === p || e.$$typeof === f || // This needs to include all possible module reference object
70
+ return !!(typeof e == "string" || typeof e == "function" || e === s || e === g || O || e === u || e === y || e === w || _ || e === T || I || H || X || typeof e == "object" && e !== null && (e.$$typeof === E || e.$$typeof === h || e.$$typeof === p || e.$$typeof === v || e.$$typeof === c || // This needs to include all possible module reference object
70
71
  // types supported by any Flight configuration anywhere since
71
72
  // we don't know which Flight build this will end up being used
72
73
  // with.
73
74
  e.$$typeof === z || e.getModuleId !== void 0));
74
75
  }
75
- function ne(e, r, s) {
76
+ function ne(e, r, o) {
76
77
  var l = e.displayName;
77
78
  if (l)
78
79
  return l;
79
- var h = r.displayName || r.name || "";
80
- return h !== "" ? s + "(" + h + ")" : s;
80
+ var m = r.displayName || r.name || "";
81
+ return m !== "" ? o + "(" + m + ")" : o;
81
82
  }
82
- function Y(e) {
83
+ function U(e) {
83
84
  return e.displayName || "Context";
84
85
  }
85
86
  function W(e) {
@@ -90,13 +91,13 @@ function Ut() {
90
91
  if (typeof e == "string")
91
92
  return e;
92
93
  switch (e) {
93
- case a:
94
+ case s:
94
95
  return "Fragment";
95
- case o:
96
+ case a:
96
97
  return "Portal";
97
- case u:
98
+ case g:
98
99
  return "Profiler";
99
- case c:
100
+ case u:
100
101
  return "StrictMode";
101
102
  case y:
102
103
  return "Suspense";
@@ -105,21 +106,21 @@ function Ut() {
105
106
  }
106
107
  if (typeof e == "object")
107
108
  switch (e.$$typeof) {
108
- case p:
109
+ case v:
109
110
  var r = e;
110
- return Y(r) + ".Consumer";
111
- case g:
112
- var s = e;
113
- return Y(s._context) + ".Provider";
114
- case f:
111
+ return U(r) + ".Consumer";
112
+ case p:
113
+ var o = e;
114
+ return U(o._context) + ".Provider";
115
+ case c:
115
116
  return ne(e, e.render, "ForwardRef");
116
- case m:
117
+ case h:
117
118
  var l = e.displayName || null;
118
119
  return l !== null ? l : W(e.type) || "Memo";
119
120
  case E: {
120
- var h = e, x = h._payload, v = h._init;
121
+ var m = e, x = m._payload, d = m._init;
121
122
  try {
122
- return W(v(x));
123
+ return W(d(x));
123
124
  } catch {
124
125
  return null;
125
126
  }
@@ -127,18 +128,18 @@ function Ut() {
127
128
  }
128
129
  return null;
129
130
  }
130
- var B = Object.assign, Z = 0, _e, Se, Oe, Pe, ke, Ae, Ie;
131
- function Ne() {
131
+ var B = Object.assign, Z = 0, Re, Te, _e, Se, Pe, Oe, ke;
132
+ function Ae() {
132
133
  }
133
- Ne.__reactDisabledLog = !0;
134
- function dt() {
134
+ Ae.__reactDisabledLog = !0;
135
+ function ct() {
135
136
  {
136
137
  if (Z === 0) {
137
- _e = console.log, Se = console.info, Oe = console.warn, Pe = console.error, ke = console.group, Ae = console.groupCollapsed, Ie = console.groupEnd;
138
+ Re = console.log, Te = console.info, _e = console.warn, Se = console.error, Pe = console.group, Oe = console.groupCollapsed, ke = console.groupEnd;
138
139
  var e = {
139
140
  configurable: !0,
140
141
  enumerable: !0,
141
- value: Ne,
142
+ value: Ae,
142
143
  writable: !0
143
144
  };
144
145
  Object.defineProperties(console, {
@@ -154,7 +155,7 @@ function Ut() {
154
155
  Z++;
155
156
  }
156
157
  }
157
- function gt() {
158
+ function ut() {
158
159
  {
159
160
  if (Z--, Z === 0) {
160
161
  var e = {
@@ -164,87 +165,87 @@ function Ut() {
164
165
  };
165
166
  Object.defineProperties(console, {
166
167
  log: B({}, e, {
167
- value: _e
168
+ value: Re
168
169
  }),
169
170
  info: B({}, e, {
170
- value: Se
171
+ value: Te
171
172
  }),
172
173
  warn: B({}, e, {
173
- value: Oe
174
+ value: _e
174
175
  }),
175
176
  error: B({}, e, {
176
- value: Pe
177
+ value: Se
177
178
  }),
178
179
  group: B({}, e, {
179
- value: ke
180
+ value: Pe
180
181
  }),
181
182
  groupCollapsed: B({}, e, {
182
- value: Ae
183
+ value: Oe
183
184
  }),
184
185
  groupEnd: B({}, e, {
185
- value: Ie
186
+ value: ke
186
187
  })
187
188
  });
188
189
  }
189
190
  Z < 0 && j("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
190
191
  }
191
192
  }
192
- var he = b.ReactCurrentDispatcher, me;
193
- function oe(e, r, s) {
193
+ var pe = b.ReactCurrentDispatcher, me;
194
+ function ae(e, r, o) {
194
195
  {
195
196
  if (me === void 0)
196
197
  try {
197
198
  throw Error();
198
- } catch (h) {
199
- var l = h.stack.trim().match(/\n( *(at )?)/);
199
+ } catch (m) {
200
+ var l = m.stack.trim().match(/\n( *(at )?)/);
200
201
  me = l && l[1] || "";
201
202
  }
202
203
  return `
203
204
  ` + me + e;
204
205
  }
205
206
  }
206
- var be = !1, ae;
207
+ var he = !1, oe;
207
208
  {
208
- var vt = typeof WeakMap == "function" ? WeakMap : Map;
209
- ae = new vt();
209
+ var ft = typeof WeakMap == "function" ? WeakMap : Map;
210
+ oe = new ft();
210
211
  }
211
- function $e(e, r) {
212
- if (!e || be)
212
+ function Ie(e, r) {
213
+ if (!e || he)
213
214
  return "";
214
215
  {
215
- var s = ae.get(e);
216
- if (s !== void 0)
217
- return s;
216
+ var o = oe.get(e);
217
+ if (o !== void 0)
218
+ return o;
218
219
  }
219
220
  var l;
220
- be = !0;
221
- var h = Error.prepareStackTrace;
221
+ he = !0;
222
+ var m = Error.prepareStackTrace;
222
223
  Error.prepareStackTrace = void 0;
223
224
  var x;
224
- x = he.current, he.current = null, dt();
225
+ x = pe.current, pe.current = null, ct();
225
226
  try {
226
227
  if (r) {
227
- var v = function() {
228
+ var d = function() {
228
229
  throw Error();
229
230
  };
230
- if (Object.defineProperty(v.prototype, "props", {
231
+ if (Object.defineProperty(d.prototype, "props", {
231
232
  set: function() {
232
233
  throw Error();
233
234
  }
234
235
  }), typeof Reflect == "object" && Reflect.construct) {
235
236
  try {
236
- Reflect.construct(v, []);
237
+ Reflect.construct(d, []);
237
238
  } catch (k) {
238
239
  l = k;
239
240
  }
240
- Reflect.construct(e, [], v);
241
+ Reflect.construct(e, [], d);
241
242
  } else {
242
243
  try {
243
- v.call();
244
+ d.call();
244
245
  } catch (k) {
245
246
  l = k;
246
247
  }
247
- e.call(v.prototype);
248
+ e.call(d.prototype);
248
249
  }
249
250
  } else {
250
251
  try {
@@ -256,123 +257,123 @@ function Ut() {
256
257
  }
257
258
  } catch (k) {
258
259
  if (k && l && typeof k.stack == "string") {
259
- for (var d = k.stack.split(`
260
+ for (var f = k.stack.split(`
260
261
  `), S = l.stack.split(`
261
- `), C = d.length - 1, R = S.length - 1; C >= 1 && R >= 0 && d[C] !== S[R]; )
262
+ `), C = f.length - 1, R = S.length - 1; C >= 1 && R >= 0 && f[C] !== S[R]; )
262
263
  R--;
263
264
  for (; C >= 1 && R >= 0; C--, R--)
264
- if (d[C] !== S[R]) {
265
+ if (f[C] !== S[R]) {
265
266
  if (C !== 1 || R !== 1)
266
267
  do
267
- if (C--, R--, R < 0 || d[C] !== S[R]) {
268
+ if (C--, R--, R < 0 || f[C] !== S[R]) {
268
269
  var $ = `
269
- ` + d[C].replace(" at new ", " at ");
270
- return e.displayName && $.includes("<anonymous>") && ($ = $.replace("<anonymous>", e.displayName)), typeof e == "function" && ae.set(e, $), $;
270
+ ` + f[C].replace(" at new ", " at ");
271
+ return e.displayName && $.includes("<anonymous>") && ($ = $.replace("<anonymous>", e.displayName)), typeof e == "function" && oe.set(e, $), $;
271
272
  }
272
273
  while (C >= 1 && R >= 0);
273
274
  break;
274
275
  }
275
276
  }
276
277
  } finally {
277
- be = !1, he.current = x, gt(), Error.prepareStackTrace = h;
278
+ he = !1, pe.current = x, ut(), Error.prepareStackTrace = m;
278
279
  }
279
- var J = e ? e.displayName || e.name : "", U = J ? oe(J) : "";
280
- return typeof e == "function" && ae.set(e, U), U;
280
+ var J = e ? e.displayName || e.name : "", V = J ? ae(J) : "";
281
+ return typeof e == "function" && oe.set(e, V), V;
281
282
  }
282
- function pt(e, r, s) {
283
- return $e(e, !1);
283
+ function dt(e, r, o) {
284
+ return Ie(e, !1);
284
285
  }
285
- function ht(e) {
286
+ function gt(e) {
286
287
  var r = e.prototype;
287
288
  return !!(r && r.isReactComponent);
288
289
  }
289
- function se(e, r, s) {
290
+ function se(e, r, o) {
290
291
  if (e == null)
291
292
  return "";
292
293
  if (typeof e == "function")
293
- return $e(e, ht(e));
294
+ return Ie(e, gt(e));
294
295
  if (typeof e == "string")
295
- return oe(e);
296
+ return ae(e);
296
297
  switch (e) {
297
298
  case y:
298
- return oe("Suspense");
299
+ return ae("Suspense");
299
300
  case w:
300
- return oe("SuspenseList");
301
+ return ae("SuspenseList");
301
302
  }
302
303
  if (typeof e == "object")
303
304
  switch (e.$$typeof) {
304
- case f:
305
- return pt(e.render);
306
- case m:
307
- return se(e.type, r, s);
305
+ case c:
306
+ return dt(e.render);
307
+ case h:
308
+ return se(e.type, r, o);
308
309
  case E: {
309
- var l = e, h = l._payload, x = l._init;
310
+ var l = e, m = l._payload, x = l._init;
310
311
  try {
311
- return se(x(h), r, s);
312
+ return se(x(m), r, o);
312
313
  } catch {
313
314
  }
314
315
  }
315
316
  }
316
317
  return "";
317
318
  }
318
- var Q = Object.prototype.hasOwnProperty, De = {}, Le = b.ReactDebugCurrentFrame;
319
+ var Q = Object.prototype.hasOwnProperty, Ne = {}, $e = b.ReactDebugCurrentFrame;
319
320
  function ie(e) {
320
321
  if (e) {
321
- var r = e._owner, s = se(e.type, e._source, r ? r.type : null);
322
- Le.setExtraStackFrame(s);
322
+ var r = e._owner, o = se(e.type, e._source, r ? r.type : null);
323
+ $e.setExtraStackFrame(o);
323
324
  } else
324
- Le.setExtraStackFrame(null);
325
+ $e.setExtraStackFrame(null);
325
326
  }
326
- function mt(e, r, s, l, h) {
327
+ function vt(e, r, o, l, m) {
327
328
  {
328
329
  var x = Function.call.bind(Q);
329
- for (var v in e)
330
- if (x(e, v)) {
331
- var d = void 0;
330
+ for (var d in e)
331
+ if (x(e, d)) {
332
+ var f = void 0;
332
333
  try {
333
- if (typeof e[v] != "function") {
334
- var S = Error((l || "React class") + ": " + s + " type `" + v + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[v] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
334
+ if (typeof e[d] != "function") {
335
+ var S = Error((l || "React class") + ": " + o + " type `" + d + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[d] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
335
336
  throw S.name = "Invariant Violation", S;
336
337
  }
337
- d = e[v](r, v, l, s, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
338
+ f = e[d](r, d, l, o, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
338
339
  } catch (C) {
339
- d = C;
340
+ f = C;
340
341
  }
341
- d && !(d instanceof Error) && (ie(h), j("%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).", l || "React class", s, v, typeof d), ie(null)), d instanceof Error && !(d.message in De) && (De[d.message] = !0, ie(h), j("Failed %s type: %s", s, d.message), ie(null));
342
+ f && !(f instanceof Error) && (ie(m), j("%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).", l || "React class", o, d, typeof f), ie(null)), f instanceof Error && !(f.message in Ne) && (Ne[f.message] = !0, ie(m), j("Failed %s type: %s", o, f.message), ie(null));
342
343
  }
343
344
  }
344
345
  }
345
- var bt = Array.isArray;
346
- function xe(e) {
347
- return bt(e);
346
+ var pt = Array.isArray;
347
+ function be(e) {
348
+ return pt(e);
348
349
  }
349
- function xt(e) {
350
+ function mt(e) {
350
351
  {
351
- var r = typeof Symbol == "function" && Symbol.toStringTag, s = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
352
- return s;
352
+ var r = typeof Symbol == "function" && Symbol.toStringTag, o = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
353
+ return o;
353
354
  }
354
355
  }
355
- function yt(e) {
356
+ function ht(e) {
356
357
  try {
357
- return Fe(e), !1;
358
+ return De(e), !1;
358
359
  } catch {
359
360
  return !0;
360
361
  }
361
362
  }
362
- function Fe(e) {
363
+ function De(e) {
363
364
  return "" + e;
364
365
  }
365
- function Me(e) {
366
- if (yt(e))
367
- return j("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", xt(e)), Fe(e);
366
+ function Le(e) {
367
+ if (ht(e))
368
+ return j("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", mt(e)), De(e);
368
369
  }
369
- var ze = b.ReactCurrentOwner, wt = {
370
+ var Fe = b.ReactCurrentOwner, bt = {
370
371
  key: !0,
371
372
  ref: !0,
372
373
  __self: !0,
373
374
  __source: !0
374
- }, We, Be;
375
- function jt(e) {
375
+ }, Me, ze;
376
+ function xt(e) {
376
377
  if (Q.call(e, "ref")) {
377
378
  var r = Object.getOwnPropertyDescriptor(e, "ref").get;
378
379
  if (r && r.isReactWarning)
@@ -380,7 +381,7 @@ function Ut() {
380
381
  }
381
382
  return e.ref !== void 0;
382
383
  }
383
- function Et(e) {
384
+ function yt(e) {
384
385
  if (Q.call(e, "key")) {
385
386
  var r = Object.getOwnPropertyDescriptor(e, "key").get;
386
387
  if (r && r.isReactWarning)
@@ -388,95 +389,95 @@ function Ut() {
388
389
  }
389
390
  return e.key !== void 0;
390
391
  }
391
- function Ct(e, r) {
392
- typeof e.ref == "string" && ze.current;
392
+ function wt(e, r) {
393
+ typeof e.ref == "string" && Fe.current;
393
394
  }
394
- function Rt(e, r) {
395
+ function jt(e, r) {
395
396
  {
396
- var s = function() {
397
- We || (We = !0, j("%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)", r));
397
+ var o = function() {
398
+ Me || (Me = !0, j("%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)", r));
398
399
  };
399
- s.isReactWarning = !0, Object.defineProperty(e, "key", {
400
- get: s,
400
+ o.isReactWarning = !0, Object.defineProperty(e, "key", {
401
+ get: o,
401
402
  configurable: !0
402
403
  });
403
404
  }
404
405
  }
405
- function Tt(e, r) {
406
+ function Et(e, r) {
406
407
  {
407
- var s = function() {
408
- Be || (Be = !0, j("%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)", r));
408
+ var o = function() {
409
+ ze || (ze = !0, j("%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)", r));
409
410
  };
410
- s.isReactWarning = !0, Object.defineProperty(e, "ref", {
411
- get: s,
411
+ o.isReactWarning = !0, Object.defineProperty(e, "ref", {
412
+ get: o,
412
413
  configurable: !0
413
414
  });
414
415
  }
415
416
  }
416
- var _t = function(e, r, s, l, h, x, v) {
417
- var d = {
417
+ var Ct = function(e, r, o, l, m, x, d) {
418
+ var f = {
418
419
  // This tag allows us to uniquely identify this as a React Element
419
420
  $$typeof: n,
420
421
  // Built-in properties that belong on the element
421
422
  type: e,
422
423
  key: r,
423
- ref: s,
424
- props: v,
424
+ ref: o,
425
+ props: d,
425
426
  // Record the component responsible for creating this element.
426
427
  _owner: x
427
428
  };
428
- return d._store = {}, Object.defineProperty(d._store, "validated", {
429
+ return f._store = {}, Object.defineProperty(f._store, "validated", {
429
430
  configurable: !1,
430
431
  enumerable: !1,
431
432
  writable: !0,
432
433
  value: !1
433
- }), Object.defineProperty(d, "_self", {
434
+ }), Object.defineProperty(f, "_self", {
434
435
  configurable: !1,
435
436
  enumerable: !1,
436
437
  writable: !1,
437
438
  value: l
438
- }), Object.defineProperty(d, "_source", {
439
+ }), Object.defineProperty(f, "_source", {
439
440
  configurable: !1,
440
441
  enumerable: !1,
441
442
  writable: !1,
442
- value: h
443
- }), Object.freeze && (Object.freeze(d.props), Object.freeze(d)), d;
443
+ value: m
444
+ }), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
444
445
  };
445
- function St(e, r, s, l, h) {
446
+ function Rt(e, r, o, l, m) {
446
447
  {
447
- var x, v = {}, d = null, S = null;
448
- s !== void 0 && (Me(s), d = "" + s), Et(r) && (Me(r.key), d = "" + r.key), jt(r) && (S = r.ref, Ct(r, h));
448
+ var x, d = {}, f = null, S = null;
449
+ o !== void 0 && (Le(o), f = "" + o), yt(r) && (Le(r.key), f = "" + r.key), xt(r) && (S = r.ref, wt(r, m));
449
450
  for (x in r)
450
- Q.call(r, x) && !wt.hasOwnProperty(x) && (v[x] = r[x]);
451
+ Q.call(r, x) && !bt.hasOwnProperty(x) && (d[x] = r[x]);
451
452
  if (e && e.defaultProps) {
452
453
  var C = e.defaultProps;
453
454
  for (x in C)
454
- v[x] === void 0 && (v[x] = C[x]);
455
+ d[x] === void 0 && (d[x] = C[x]);
455
456
  }
456
- if (d || S) {
457
+ if (f || S) {
457
458
  var R = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
458
- d && Rt(v, R), S && Tt(v, R);
459
+ f && jt(d, R), S && Et(d, R);
459
460
  }
460
- return _t(e, d, S, h, l, ze.current, v);
461
+ return Ct(e, f, S, m, l, Fe.current, d);
461
462
  }
462
463
  }
463
- var ye = b.ReactCurrentOwner, Ue = b.ReactDebugCurrentFrame;
464
+ var xe = b.ReactCurrentOwner, We = b.ReactDebugCurrentFrame;
464
465
  function q(e) {
465
466
  if (e) {
466
- var r = e._owner, s = se(e.type, e._source, r ? r.type : null);
467
- Ue.setExtraStackFrame(s);
467
+ var r = e._owner, o = se(e.type, e._source, r ? r.type : null);
468
+ We.setExtraStackFrame(o);
468
469
  } else
469
- Ue.setExtraStackFrame(null);
470
+ We.setExtraStackFrame(null);
470
471
  }
471
- var we;
472
- we = !1;
473
- function je(e) {
472
+ var ye;
473
+ ye = !1;
474
+ function we(e) {
474
475
  return typeof e == "object" && e !== null && e.$$typeof === n;
475
476
  }
476
- function Ve() {
477
+ function Be() {
477
478
  {
478
- if (ye.current) {
479
- var e = W(ye.current.type);
479
+ if (xe.current) {
480
+ var e = W(xe.current.type);
480
481
  if (e)
481
482
  return `
482
483
 
@@ -485,83 +486,83 @@ Check the render method of \`` + e + "`.";
485
486
  return "";
486
487
  }
487
488
  }
488
- function Ot(e) {
489
+ function Tt(e) {
489
490
  return "";
490
491
  }
491
- var Ye = {};
492
- function Pt(e) {
492
+ var Ve = {};
493
+ function _t(e) {
493
494
  {
494
- var r = Ve();
495
+ var r = Be();
495
496
  if (!r) {
496
- var s = typeof e == "string" ? e : e.displayName || e.name;
497
- s && (r = `
497
+ var o = typeof e == "string" ? e : e.displayName || e.name;
498
+ o && (r = `
498
499
 
499
- Check the top-level render call using <` + s + ">.");
500
+ Check the top-level render call using <` + o + ">.");
500
501
  }
501
502
  return r;
502
503
  }
503
504
  }
504
- function qe(e, r) {
505
+ function Ye(e, r) {
505
506
  {
506
507
  if (!e._store || e._store.validated || e.key != null)
507
508
  return;
508
509
  e._store.validated = !0;
509
- var s = Pt(r);
510
- if (Ye[s])
510
+ var o = _t(r);
511
+ if (Ve[o])
511
512
  return;
512
- Ye[s] = !0;
513
+ Ve[o] = !0;
513
514
  var l = "";
514
- e && e._owner && e._owner !== ye.current && (l = " It was passed a child from " + W(e._owner.type) + "."), q(e), j('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', s, l), q(null);
515
+ e && e._owner && e._owner !== xe.current && (l = " It was passed a child from " + W(e._owner.type) + "."), q(e), j('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', o, l), q(null);
515
516
  }
516
517
  }
517
- function Je(e, r) {
518
+ function Ue(e, r) {
518
519
  {
519
520
  if (typeof e != "object")
520
521
  return;
521
- if (xe(e))
522
- for (var s = 0; s < e.length; s++) {
523
- var l = e[s];
524
- je(l) && qe(l, r);
522
+ if (be(e))
523
+ for (var o = 0; o < e.length; o++) {
524
+ var l = e[o];
525
+ we(l) && Ye(l, r);
525
526
  }
526
- else if (je(e))
527
+ else if (we(e))
527
528
  e._store && (e._store.validated = !0);
528
529
  else if (e) {
529
- var h = O(e);
530
- if (typeof h == "function" && h !== e.entries)
531
- for (var x = h.call(e), v; !(v = x.next()).done; )
532
- je(v.value) && qe(v.value, r);
530
+ var m = P(e);
531
+ if (typeof m == "function" && m !== e.entries)
532
+ for (var x = m.call(e), d; !(d = x.next()).done; )
533
+ we(d.value) && Ye(d.value, r);
533
534
  }
534
535
  }
535
536
  }
536
- function kt(e) {
537
+ function St(e) {
537
538
  {
538
539
  var r = e.type;
539
540
  if (r == null || typeof r == "string")
540
541
  return;
541
- var s;
542
+ var o;
542
543
  if (typeof r == "function")
543
- s = r.propTypes;
544
- else if (typeof r == "object" && (r.$$typeof === f || // Note: Memo only checks outer props here.
544
+ o = r.propTypes;
545
+ else if (typeof r == "object" && (r.$$typeof === c || // Note: Memo only checks outer props here.
545
546
  // Inner props are checked in the reconciler.
546
- r.$$typeof === m))
547
- s = r.propTypes;
547
+ r.$$typeof === h))
548
+ o = r.propTypes;
548
549
  else
549
550
  return;
550
- if (s) {
551
+ if (o) {
551
552
  var l = W(r);
552
- mt(s, e.props, "prop", l, e);
553
- } else if (r.PropTypes !== void 0 && !we) {
554
- we = !0;
555
- var h = W(r);
556
- j("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", h || "Unknown");
553
+ vt(o, e.props, "prop", l, e);
554
+ } else if (r.PropTypes !== void 0 && !ye) {
555
+ ye = !0;
556
+ var m = W(r);
557
+ j("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", m || "Unknown");
557
558
  }
558
559
  typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && j("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
559
560
  }
560
561
  }
561
- function At(e) {
562
+ function Pt(e) {
562
563
  {
563
- for (var r = Object.keys(e.props), s = 0; s < r.length; s++) {
564
- var l = r[s];
564
+ for (var r = Object.keys(e.props), o = 0; o < r.length; o++) {
565
+ var l = r[o];
565
566
  if (l !== "children" && l !== "key") {
566
567
  q(e), j("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", l), q(null);
567
568
  break;
@@ -570,159 +571,111 @@ Check the top-level render call using <` + s + ">.");
570
571
  e.ref !== null && (q(e), j("Invalid attribute `ref` supplied to `React.Fragment`."), q(null));
571
572
  }
572
573
  }
573
- var Ke = {};
574
- function Ge(e, r, s, l, h, x) {
574
+ var qe = {};
575
+ function Je(e, r, o, l, m, x) {
575
576
  {
576
- var v = F(e);
577
- if (!v) {
578
- var d = "";
579
- (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (d += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
580
- var S = Ot();
581
- S ? d += S : d += Ve();
577
+ var d = F(e);
578
+ if (!d) {
579
+ var f = "";
580
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (f += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
581
+ var S = Tt();
582
+ S ? f += S : f += Be();
582
583
  var C;
583
- e === null ? C = "null" : xe(e) ? C = "array" : e !== void 0 && e.$$typeof === n ? (C = "<" + (W(e.type) || "Unknown") + " />", d = " Did you accidentally export a JSX literal instead of a component?") : C = typeof e, j("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", C, d);
584
+ e === null ? C = "null" : be(e) ? C = "array" : e !== void 0 && e.$$typeof === n ? (C = "<" + (W(e.type) || "Unknown") + " />", f = " Did you accidentally export a JSX literal instead of a component?") : C = typeof e, j("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", C, f);
584
585
  }
585
- var R = St(e, r, s, h, x);
586
+ var R = Rt(e, r, o, m, x);
586
587
  if (R == null)
587
588
  return R;
588
- if (v) {
589
+ if (d) {
589
590
  var $ = r.children;
590
591
  if ($ !== void 0)
591
592
  if (l)
592
- if (xe($)) {
593
+ if (be($)) {
593
594
  for (var J = 0; J < $.length; J++)
594
- Je($[J], e);
595
+ Ue($[J], e);
595
596
  Object.freeze && Object.freeze($);
596
597
  } else
597
598
  j("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
598
599
  else
599
- Je($, e);
600
+ Ue($, e);
600
601
  }
601
602
  if (Q.call(r, "key")) {
602
- var U = W(e), k = Object.keys(r).filter(function(Ft) {
603
- return Ft !== "key";
604
- }), Ee = k.length > 0 ? "{key: someKey, " + k.join(": ..., ") + ": ...}" : "{key: someKey}";
605
- if (!Ke[U + Ee]) {
606
- var Lt = k.length > 0 ? "{" + k.join(": ..., ") + ": ...}" : "{}";
603
+ var V = W(e), k = Object.keys(r).filter(function($t) {
604
+ return $t !== "key";
605
+ }), je = k.length > 0 ? "{key: someKey, " + k.join(": ..., ") + ": ...}" : "{key: someKey}";
606
+ if (!qe[V + je]) {
607
+ var Nt = k.length > 0 ? "{" + k.join(": ..., ") + ": ...}" : "{}";
607
608
  j(`A props object containing a "key" prop is being spread into JSX:
608
609
  let props = %s;
609
610
  <%s {...props} />
610
611
  React keys must be passed directly to JSX without using spread:
611
612
  let props = %s;
612
- <%s key={someKey} {...props} />`, Ee, U, Lt, U), Ke[U + Ee] = !0;
613
+ <%s key={someKey} {...props} />`, je, V, Nt, V), qe[V + je] = !0;
613
614
  }
614
615
  }
615
- return e === a ? At(R) : kt(R), R;
616
+ return e === s ? Pt(R) : St(R), R;
616
617
  }
617
618
  }
618
- function It(e, r, s) {
619
- return Ge(e, r, s, !0);
619
+ function Ot(e, r, o) {
620
+ return Je(e, r, o, !0);
620
621
  }
621
- function Nt(e, r, s) {
622
- return Ge(e, r, s, !1);
622
+ function kt(e, r, o) {
623
+ return Je(e, r, o, !1);
623
624
  }
624
- var $t = Nt, Dt = It;
625
- te.Fragment = a, te.jsx = $t, te.jsxs = Dt;
625
+ var At = kt, It = Ot;
626
+ te.Fragment = s, te.jsx = At, te.jsxs = It;
626
627
  }()), te;
627
628
  }
628
- var Ze;
629
- function Vt() {
630
- return Ze || (Ze = 1, process.env.NODE_ENV === "production" ? le.exports = Bt() : le.exports = Ut()), le.exports;
629
+ var He;
630
+ function Bt() {
631
+ return He || (He = 1, process.env.NODE_ENV === "production" ? le.exports = zt() : le.exports = Wt()), le.exports;
631
632
  }
632
- var i = Vt();
633
- const st = ge(), fr = ({ children: t }) => {
634
- const [n, o] = A(!1);
635
- return /* @__PURE__ */ i.jsx(st.Provider, { value: { isLoading: n, setIsLoading: o }, children: t });
636
- }, Re = () => {
637
- const t = ve(st);
633
+ var i = Bt();
634
+ const nt = de(), lr = ({ children: t }) => {
635
+ const [n, a] = A(!1);
636
+ return /* @__PURE__ */ i.jsx(nt.Provider, { value: { isLoading: n, setIsLoading: a }, children: t });
637
+ }, Ee = () => {
638
+ const t = ge(nt);
638
639
  if (t === void 0) throw new Error("Non puoi settare il loading");
639
640
  return t;
640
- }, it = ge(), dr = ({ children: t }) => {
641
- const [n, o] = A({}), a = async () => {
641
+ }, at = de(), cr = ({ children: t }) => {
642
+ const [n, a] = A({}), s = async () => {
642
643
  try {
643
- const u = await (await fetch("/config.json")).json();
644
- o(u);
645
- } catch (c) {
646
- console.error(c);
644
+ const g = await (await fetch("/config.json")).json();
645
+ a(g);
646
+ } catch (u) {
647
+ console.error(u);
647
648
  }
648
649
  };
649
- return V(() => {
650
- a();
651
- }, []), Object.keys(n).length === 0 ? null : /* @__PURE__ */ i.jsx(it.Provider, { value: n, children: t });
652
- }, pe = () => {
653
- const t = ve(it);
650
+ return Y(() => {
651
+ s();
652
+ }, []), Object.keys(n).length === 0 ? null : /* @__PURE__ */ i.jsx(at.Provider, { value: n, children: t });
653
+ }, ve = () => {
654
+ const t = ge(at);
654
655
  if (t === void 0) throw new Error("Non puoi leggere i config");
655
656
  return t;
656
- }, lt = ge(), gr = ({ children: t }) => {
657
- const [n, o] = A(!1), [a, c] = A(), [u, g] = A(), p = {
657
+ }, ot = de(), ur = ({ children: t }) => {
658
+ const [n, a] = A(!1), [s, u] = A(), [g, p] = A(), v = {
658
659
  showAlert: n,
659
- setShowAlert: o,
660
- typeAlert: a,
661
- setTypeAlert: c,
662
- messageAlert: u,
663
- setMessageAlert: g
660
+ setShowAlert: a,
661
+ typeAlert: s,
662
+ setTypeAlert: u,
663
+ messageAlert: g,
664
+ setMessageAlert: p
664
665
  };
665
- return /* @__PURE__ */ i.jsx(lt.Provider, { value: p, children: t });
666
+ return /* @__PURE__ */ i.jsx(ot.Provider, { value: v, children: t });
666
667
  }, G = () => {
667
- const t = ve(lt);
668
+ const t = ge(ot);
668
669
  if (t === void 0) throw new Error("Non puoi modificare l'alert");
669
670
  return t;
670
671
  };
671
- function Ce(t) {
672
- this.message = t;
673
- }
674
- Ce.prototype = new Error(), Ce.prototype.name = "InvalidCharacterError";
675
- var Qe = typeof window < "u" && window.atob && window.atob.bind(window) || function(t) {
676
- var n = String(t).replace(/=+$/, "");
677
- if (n.length % 4 == 1) throw new Ce("'atob' failed: The string to be decoded is not correctly encoded.");
678
- for (var o, a, c = 0, u = 0, g = ""; a = n.charAt(u++); ~a && (o = c % 4 ? 64 * o + a : a, c++ % 4) ? g += String.fromCharCode(255 & o >> (-2 * c & 6)) : 0) a = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a);
679
- return g;
680
- };
681
- function Yt(t) {
682
- var n = t.replace(/-/g, "+").replace(/_/g, "/");
683
- switch (n.length % 4) {
684
- case 0:
685
- break;
686
- case 2:
687
- n += "==";
688
- break;
689
- case 3:
690
- n += "=";
691
- break;
692
- default:
693
- throw "Illegal base64url string!";
694
- }
695
- try {
696
- return function(o) {
697
- return decodeURIComponent(Qe(o).replace(/(.)/g, function(a, c) {
698
- var u = c.charCodeAt(0).toString(16).toUpperCase();
699
- return u.length < 2 && (u = "0" + u), "%" + u;
700
- }));
701
- }(n);
702
- } catch {
703
- return Qe(n);
704
- }
705
- }
706
- function ce(t) {
707
- this.message = t;
708
- }
709
- function qt(t, n) {
710
- if (typeof t != "string") throw new ce("Invalid token specified");
711
- var o = (n = n || {}).header === !0 ? 0 : 1;
712
- try {
713
- return JSON.parse(Yt(t.split(".")[o]));
714
- } catch (a) {
715
- throw new ce("Invalid token specified: " + a.message);
716
- }
717
- }
718
- ce.prototype = new Error(), ce.prototype.name = "InvalidTokenError";
719
672
  let K;
720
- const ue = async (t, n, o) => {
673
+ const ce = async (t, n, a) => {
721
674
  if (K) return K;
722
675
  try {
723
- const c = await (await fetch("/config.json")).json(), u = c.baseUri, { unauthorized: g, notFound: p, defaultMessage: f } = c.axiosErrors;
724
- return K = Wt.create({
725
- baseURL: u,
676
+ const u = await (await fetch("/config.json")).json(), g = u.baseUri, { unauthorized: p, notFound: v, defaultMessage: c } = u.axiosErrors;
677
+ return K = Mt.create({
678
+ baseURL: g,
726
679
  timeout: 3e3
727
680
  }), K.interceptors.request.use(
728
681
  (y) => y
@@ -732,37 +685,37 @@ const ue = async (t, n, o) => {
732
685
  if (y.response)
733
686
  switch (t(!0), n("danger"), y.response.status) {
734
687
  case 401:
735
- localStorage.removeItem("accessToken"), o(g);
688
+ localStorage.removeItem("accessToken"), a(p);
736
689
  break;
737
690
  case 404:
738
- o(p);
691
+ a(v);
739
692
  break;
740
693
  default:
741
- o(`${f} ${y.response.status} ${y.response.data.error}`);
694
+ a(`${c} ${y.response.status} ${y.response.data.error}`);
742
695
  }
743
696
  return Promise.reject(y);
744
697
  }
745
698
  ), K;
746
- } catch (a) {
747
- console.error(a);
699
+ } catch (s) {
700
+ console.error(s);
748
701
  }
749
- }, ct = ge(), vr = ({ children: t }) => {
750
- const { heartbeatEndpoint: n, infiniteSession: o, timeDeducted: a, authenticatedEndpoint: c } = pe(), { setIsLoading: u } = Re(), { setShowAlert: g, setMessageAlert: p, setTypeAlert: f } = G(), y = ot(), [w, m] = A(null), [E, T] = A(), [N, L] = A(), [O, b] = A(), j = async (_, P) => {
702
+ }, st = de(), fr = ({ children: t }) => {
703
+ const { heartbeatEndpoint: n, infiniteSession: a, timeDeducted: s, authenticatedEndpoint: u } = ve(), { setIsLoading: g } = Ee(), { setShowAlert: p, setMessageAlert: v, setTypeAlert: c } = G(), y = tt(), [w, h] = A(null), [E, T] = A(), [N, L] = A(), [P, b] = A(), j = async (_, O) => {
751
704
  _.preventDefault();
752
705
  try {
753
- u(!0), g(!1);
754
- const F = await (await ue(g, f, p)).post(c, {
755
- auth: P
756
- }), ne = F.data.id, Y = F.headers.token;
757
- Y && (localStorage.setItem("accessToken", Y), localStorage.setItem("id", ne), m(!0), T(Y), y(`/dashboard/${ne}`));
706
+ g(!0), p(!1);
707
+ const F = await (await ce(p, c, v)).post(u, {
708
+ auth: O
709
+ }), ne = F.data.id, U = F.headers.token;
710
+ U && (localStorage.setItem("accessToken", U), localStorage.setItem("id", ne), h(!0), T(U), y(`/dashboard/${ne}`));
758
711
  } catch (z) {
759
- console.error(z), u(!1);
712
+ console.error(z), g(!1);
760
713
  }
761
714
  }, D = () => {
762
- localStorage.removeItem("accessToken"), localStorage.removeItem("id"), m(!1), T(null);
715
+ localStorage.removeItem("accessToken"), localStorage.removeItem("id"), h(!1), T(null);
763
716
  }, I = async () => {
764
717
  try {
765
- const _ = localStorage.getItem("accessToken"), F = (await (await ue(g, f, p)).get(
718
+ const _ = localStorage.getItem("accessToken"), F = (await (await ce(p, c, v)).get(
766
719
  `${n}`,
767
720
  { headers: {
768
721
  Authorization: _
@@ -775,176 +728,176 @@ const ue = async (t, n, o) => {
775
728
  }, H = () => {
776
729
  if (!E)
777
730
  return;
778
- const P = qt(E).exp, z = Math.floor(Date.now() / 1e3), F = (P - z) * 1e3;
779
- b(F), L(F - a);
731
+ const O = Dt(E).exp, z = Math.floor(Date.now() / 1e3), F = (O - z) * 1e3;
732
+ b(F), L(F - s);
780
733
  };
781
- V(() => {
734
+ Y(() => {
782
735
  if (localStorage.getItem("accessToken"))
783
- m(!0);
736
+ h(!0);
784
737
  else {
785
- m(!1);
738
+ h(!1);
786
739
  return;
787
740
  }
788
- }, []), V(() => {
741
+ }, []), Y(() => {
789
742
  H();
790
743
  let _;
791
- o && E && N && (_ = setInterval(() => {
744
+ a && E && N && (_ = setInterval(() => {
792
745
  I();
793
746
  }, N));
794
- let P;
795
- return !o && E && O && (P = setTimeout(() => {
796
- D(), g(!0), f("danger"), p("Sessione scaduta");
797
- }, O)), () => {
798
- _ && clearInterval(_), P && clearTimeout(P);
747
+ let O;
748
+ return !a && E && P && (O = setTimeout(() => {
749
+ D(), p(!0), c("danger"), v("Sessione scaduta");
750
+ }, P)), () => {
751
+ _ && clearInterval(_), O && clearTimeout(O);
799
752
  };
800
753
  }, [E, N]);
801
754
  const X = {
802
755
  isAuthenticated: w,
803
- setIsAuthenticated: m,
756
+ setIsAuthenticated: h,
804
757
  login: j,
805
758
  logout: D,
806
759
  setCurrentToken: T
807
760
  };
808
- return /* @__PURE__ */ i.jsx(ct.Provider, { value: X, children: t });
809
- }, Te = () => {
810
- const t = ve(ct);
761
+ return /* @__PURE__ */ i.jsx(st.Provider, { value: X, children: t });
762
+ }, Ce = () => {
763
+ const t = ge(st);
811
764
  if (t === void 0) throw new Error("Non sei dentro al Auth Provider");
812
765
  return t;
813
- }, pr = () => {
814
- const { isAuthenticated: t } = Te(), { setShowAlert: n, setTypeAlert: o, setMessageAlert: a } = G(), c = localStorage.getItem("accessToken");
815
- return V(() => {
816
- !t && !c && (n(!0), o("danger"), a("Non sei autorizzato"));
817
- }, []), t === null ? null : t ? /* @__PURE__ */ i.jsx(at, {}) : /* @__PURE__ */ i.jsx(Mt, { to: "/" });
766
+ }, dr = () => {
767
+ const { isAuthenticated: t } = Ce(), { setShowAlert: n, setTypeAlert: a, setMessageAlert: s } = G(), u = localStorage.getItem("accessToken");
768
+ return Y(() => {
769
+ !t && !u && (n(!0), a("danger"), s("Non sei autorizzato"));
770
+ }, []), t === null ? null : t ? /* @__PURE__ */ i.jsx(rt, {}) : /* @__PURE__ */ i.jsx(Lt, { to: "/" });
818
771
  };
819
- var ut = {
772
+ var it = {
820
773
  color: void 0,
821
774
  size: void 0,
822
775
  className: void 0,
823
776
  style: void 0,
824
777
  attr: void 0
825
- }, et = M.createContext && /* @__PURE__ */ M.createContext(ut), Jt = ["attr", "size", "title"];
826
- function Kt(t, n) {
778
+ }, Xe = M.createContext && /* @__PURE__ */ M.createContext(it), Vt = ["attr", "size", "title"];
779
+ function Yt(t, n) {
827
780
  if (t == null) return {};
828
- var o = Gt(t, n), a, c;
781
+ var a = Ut(t, n), s, u;
829
782
  if (Object.getOwnPropertySymbols) {
830
- var u = Object.getOwnPropertySymbols(t);
831
- for (c = 0; c < u.length; c++)
832
- a = u[c], !(n.indexOf(a) >= 0) && Object.prototype.propertyIsEnumerable.call(t, a) && (o[a] = t[a]);
783
+ var g = Object.getOwnPropertySymbols(t);
784
+ for (u = 0; u < g.length; u++)
785
+ s = g[u], !(n.indexOf(s) >= 0) && Object.prototype.propertyIsEnumerable.call(t, s) && (a[s] = t[s]);
833
786
  }
834
- return o;
787
+ return a;
835
788
  }
836
- function Gt(t, n) {
789
+ function Ut(t, n) {
837
790
  if (t == null) return {};
838
- var o = {};
839
- for (var a in t)
840
- if (Object.prototype.hasOwnProperty.call(t, a)) {
841
- if (n.indexOf(a) >= 0) continue;
842
- o[a] = t[a];
791
+ var a = {};
792
+ for (var s in t)
793
+ if (Object.prototype.hasOwnProperty.call(t, s)) {
794
+ if (n.indexOf(s) >= 0) continue;
795
+ a[s] = t[s];
843
796
  }
844
- return o;
797
+ return a;
845
798
  }
846
- function fe() {
847
- return fe = Object.assign ? Object.assign.bind() : function(t) {
799
+ function ue() {
800
+ return ue = Object.assign ? Object.assign.bind() : function(t) {
848
801
  for (var n = 1; n < arguments.length; n++) {
849
- var o = arguments[n];
850
- for (var a in o)
851
- Object.prototype.hasOwnProperty.call(o, a) && (t[a] = o[a]);
802
+ var a = arguments[n];
803
+ for (var s in a)
804
+ Object.prototype.hasOwnProperty.call(a, s) && (t[s] = a[s]);
852
805
  }
853
806
  return t;
854
- }, fe.apply(this, arguments);
807
+ }, ue.apply(this, arguments);
855
808
  }
856
- function tt(t, n) {
857
- var o = Object.keys(t);
809
+ function Ze(t, n) {
810
+ var a = Object.keys(t);
858
811
  if (Object.getOwnPropertySymbols) {
859
- var a = Object.getOwnPropertySymbols(t);
860
- n && (a = a.filter(function(c) {
861
- return Object.getOwnPropertyDescriptor(t, c).enumerable;
862
- })), o.push.apply(o, a);
812
+ var s = Object.getOwnPropertySymbols(t);
813
+ n && (s = s.filter(function(u) {
814
+ return Object.getOwnPropertyDescriptor(t, u).enumerable;
815
+ })), a.push.apply(a, s);
863
816
  }
864
- return o;
817
+ return a;
865
818
  }
866
- function de(t) {
819
+ function fe(t) {
867
820
  for (var n = 1; n < arguments.length; n++) {
868
- var o = arguments[n] != null ? arguments[n] : {};
869
- n % 2 ? tt(Object(o), !0).forEach(function(a) {
870
- Ht(t, a, o[a]);
871
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(o)) : tt(Object(o)).forEach(function(a) {
872
- Object.defineProperty(t, a, Object.getOwnPropertyDescriptor(o, a));
821
+ var a = arguments[n] != null ? arguments[n] : {};
822
+ n % 2 ? Ze(Object(a), !0).forEach(function(s) {
823
+ qt(t, s, a[s]);
824
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(a)) : Ze(Object(a)).forEach(function(s) {
825
+ Object.defineProperty(t, s, Object.getOwnPropertyDescriptor(a, s));
873
826
  });
874
827
  }
875
828
  return t;
876
829
  }
877
- function Ht(t, n, o) {
878
- return n = Xt(n), n in t ? Object.defineProperty(t, n, { value: o, enumerable: !0, configurable: !0, writable: !0 }) : t[n] = o, t;
830
+ function qt(t, n, a) {
831
+ return n = Jt(n), n in t ? Object.defineProperty(t, n, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : t[n] = a, t;
879
832
  }
880
- function Xt(t) {
881
- var n = Zt(t, "string");
833
+ function Jt(t) {
834
+ var n = Kt(t, "string");
882
835
  return typeof n == "symbol" ? n : n + "";
883
836
  }
884
- function Zt(t, n) {
837
+ function Kt(t, n) {
885
838
  if (typeof t != "object" || !t) return t;
886
- var o = t[Symbol.toPrimitive];
887
- if (o !== void 0) {
888
- var a = o.call(t, n || "default");
889
- if (typeof a != "object") return a;
839
+ var a = t[Symbol.toPrimitive];
840
+ if (a !== void 0) {
841
+ var s = a.call(t, n || "default");
842
+ if (typeof s != "object") return s;
890
843
  throw new TypeError("@@toPrimitive must return a primitive value.");
891
844
  }
892
845
  return (n === "string" ? String : Number)(t);
893
846
  }
894
- function ft(t) {
895
- return t && t.map((n, o) => /* @__PURE__ */ M.createElement(n.tag, de({
896
- key: o
897
- }, n.attr), ft(n.child)));
847
+ function lt(t) {
848
+ return t && t.map((n, a) => /* @__PURE__ */ M.createElement(n.tag, fe({
849
+ key: a
850
+ }, n.attr), lt(n.child)));
898
851
  }
899
852
  function re(t) {
900
- return (n) => /* @__PURE__ */ M.createElement(Qt, fe({
901
- attr: de({}, t.attr)
902
- }, n), ft(t.child));
853
+ return (n) => /* @__PURE__ */ M.createElement(Gt, ue({
854
+ attr: fe({}, t.attr)
855
+ }, n), lt(t.child));
903
856
  }
904
- function Qt(t) {
905
- var n = (o) => {
857
+ function Gt(t) {
858
+ var n = (a) => {
906
859
  var {
907
- attr: a,
908
- size: c,
909
- title: u
910
- } = t, g = Kt(t, Jt), p = c || o.size || "1em", f;
911
- return o.className && (f = o.className), t.className && (f = (f ? f + " " : "") + t.className), /* @__PURE__ */ M.createElement("svg", fe({
860
+ attr: s,
861
+ size: u,
862
+ title: g
863
+ } = t, p = Yt(t, Vt), v = u || a.size || "1em", c;
864
+ return a.className && (c = a.className), t.className && (c = (c ? c + " " : "") + t.className), /* @__PURE__ */ M.createElement("svg", ue({
912
865
  stroke: "currentColor",
913
866
  fill: "currentColor",
914
867
  strokeWidth: "0"
915
- }, o.attr, a, g, {
916
- className: f,
917
- style: de(de({
918
- color: t.color || o.color
919
- }, o.style), t.style),
920
- height: p,
921
- width: p,
868
+ }, a.attr, s, p, {
869
+ className: c,
870
+ style: fe(fe({
871
+ color: t.color || a.color
872
+ }, a.style), t.style),
873
+ height: v,
874
+ width: v,
922
875
  xmlns: "http://www.w3.org/2000/svg"
923
- }), u && /* @__PURE__ */ M.createElement("title", null, u), t.children);
876
+ }), g && /* @__PURE__ */ M.createElement("title", null, g), t.children);
924
877
  };
925
- return et !== void 0 ? /* @__PURE__ */ M.createElement(et.Consumer, null, (o) => n(o)) : n(ut);
878
+ return Xe !== void 0 ? /* @__PURE__ */ M.createElement(Xe.Consumer, null, (a) => n(a)) : n(it);
926
879
  }
927
- function er(t) {
880
+ function Ht(t) {
928
881
  return re({ tag: "svg", attr: { version: "1.1", viewBox: "0 0 16 16" }, child: [{ tag: "path", attr: { d: "M8 0c-4.355 0-7.898 3.481-7.998 7.812 0.092-3.779 2.966-6.812 6.498-6.812 3.59 0 6.5 3.134 6.5 7 0 0.828 0.672 1.5 1.5 1.5s1.5-0.672 1.5-1.5c0-4.418-3.582-8-8-8zM8 16c4.355 0 7.898-3.481 7.998-7.812-0.092 3.779-2.966 6.812-6.498 6.812-3.59 0-6.5-3.134-6.5-7 0-0.828-0.672-1.5-1.5-1.5s-1.5 0.672-1.5 1.5c0 4.418 3.582 8 8 8z" }, child: [] }] })(t);
929
882
  }
930
- const tr = () => /* @__PURE__ */ i.jsxs("div", { className: "fixed top-0 bottom-0 left-0 right-0 flex items-center justify-center bg-[#00000080]", children: [
931
- /* @__PURE__ */ i.jsx(er, { className: "text-[20rem] relative animate-spin text-white" }),
883
+ const Xt = () => /* @__PURE__ */ i.jsxs("div", { className: "fixed top-0 bottom-0 left-0 right-0 flex items-center justify-center bg-[#00000080]", children: [
884
+ /* @__PURE__ */ i.jsx(Ht, { className: "text-[20rem] relative animate-spin text-white" }),
932
885
  /* @__PURE__ */ i.jsx("p", { className: "text-white text-2xl select-none absolute", children: "Loading..." })
933
886
  ] });
934
- function rr(t) {
887
+ function Zt(t) {
935
888
  return re({ 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: [] }] })(t);
936
889
  }
937
- function nr(t) {
890
+ function Qt(t) {
938
891
  return re({ tag: "svg", attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 0 1 0-96 48.01 48.01 0 0 1 0 96z" }, child: [] }] })(t);
939
892
  }
940
- function or(t) {
893
+ function er(t) {
941
894
  return re({ tag: "svg", attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M955.7 856l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zM480 416c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v184c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V416zm32 352a48.01 48.01 0 0 1 0-96 48.01 48.01 0 0 1 0 96z" }, child: [] }] })(t);
942
895
  }
943
- function ar(t) {
896
+ function tr(t) {
944
897
  return re({ 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: [] }] })(t);
945
898
  }
946
- const sr = () => {
947
- const { showAlert: t, setShowAlert: n, messageAlert: o, typeAlert: a } = G(), { alertTimeout: c } = pe(), [u, g] = A(0), p = {
899
+ const rr = () => {
900
+ const { showAlert: t, setShowAlert: n, messageAlert: a, typeAlert: s } = G(), { alertTimeout: u } = ve(), [g, p] = A(0), v = {
948
901
  danger: {
949
902
  bgColor: "bg-red-50",
950
903
  textColor: "text-red-700",
@@ -969,98 +922,98 @@ const sr = () => {
969
922
  focusRing: "focus:ring-green-400",
970
923
  progressColor: "bg-green-400"
971
924
  }
972
- }, { bgColor: f, textColor: y, buttonBg: w, hoverBg: m, focusRing: E, progressColor: T } = p[a], N = (O) => {
973
- switch (O) {
925
+ }, { bgColor: c, textColor: y, buttonBg: w, hoverBg: h, focusRing: E, progressColor: T } = v[s], N = (P) => {
926
+ switch (P) {
974
927
  case "danger":
975
- return /* @__PURE__ */ i.jsx(or, { className: "text-xl" });
928
+ return /* @__PURE__ */ i.jsx(er, { className: "text-xl" });
976
929
  case "info":
977
- return /* @__PURE__ */ i.jsx(nr, { className: "text-xl" });
930
+ return /* @__PURE__ */ i.jsx(Qt, { className: "text-xl" });
978
931
  case "success":
979
- return /* @__PURE__ */ i.jsx(ar, { className: "text-xl" });
932
+ return /* @__PURE__ */ i.jsx(tr, { className: "text-xl" });
980
933
  }
981
934
  }, L = () => {
982
935
  n(!t);
983
936
  };
984
- return V(() => {
985
- let O;
986
- const j = 100 / (c / 100);
987
- O = setInterval(() => {
988
- g((I) => I >= 100 ? (clearInterval(O), 100) : I + j);
937
+ return Y(() => {
938
+ let P;
939
+ const j = 100 / (u / 100);
940
+ P = setInterval(() => {
941
+ p((I) => I >= 100 ? (clearInterval(P), 100) : I + j);
989
942
  }, 100);
990
943
  const D = setTimeout(() => {
991
944
  L();
992
- }, c);
945
+ }, u);
993
946
  return () => {
994
- clearTimeout(D), clearInterval(O);
947
+ clearTimeout(D), clearInterval(P);
995
948
  };
996
- }, []), /* @__PURE__ */ i.jsxs("div", { className: `flex items-center p-4 pt-6 ${y} rounded-lg ${f} mx-auto fixed top-[calc(100vh-100px)] right-10`, role: "alert", children: [
997
- /* @__PURE__ */ i.jsx("div", { className: "w-full bg-gray-200 rounded-t-lg overflow-hidden h-2.5 dark:bg-gray-700 absolute top-0 left-0 right-0", children: /* @__PURE__ */ i.jsx("div", { className: `${T} h-2.5 rounded-t-lg`, style: { width: `${u}%` } }) }),
998
- N(a),
999
- /* @__PURE__ */ i.jsx("div", { className: "px-4 text-sm font-medium", children: o }),
949
+ }, []), /* @__PURE__ */ i.jsxs("div", { className: `flex items-center p-4 pt-6 ${y} rounded-lg ${c} mx-auto fixed top-[calc(100vh-100px)] right-10`, role: "alert", children: [
950
+ /* @__PURE__ */ i.jsx("div", { className: "w-full bg-gray-200 rounded-t-lg overflow-hidden h-2.5 dark:bg-gray-700 absolute top-0 left-0 right-0", children: /* @__PURE__ */ i.jsx("div", { className: `${T} h-2.5 rounded-t-lg`, style: { width: `${g}%` } }) }),
951
+ N(s),
952
+ /* @__PURE__ */ i.jsx("div", { className: "px-4 text-sm font-medium", children: a }),
1000
953
  /* @__PURE__ */ i.jsx(
1001
954
  "button",
1002
955
  {
1003
956
  type: "button",
1004
- className: `ms-auto ${w} rounded-lg focus:ring-2 ${E} p-1.5 ${m} inline-flex items-center justify-center h-8 w-8`,
957
+ className: `ms-auto ${w} rounded-lg focus:ring-2 ${E} p-1.5 ${h} inline-flex items-center justify-center h-8 w-8`,
1005
958
  title: "Close",
1006
959
  onClick: L,
1007
- children: /* @__PURE__ */ i.jsx(rr, { className: "text-xl" })
960
+ children: /* @__PURE__ */ i.jsx(Zt, { className: "text-xl" })
1008
961
  }
1009
962
  )
1010
963
  ] });
1011
- }, hr = () => {
1012
- const { isLoading: t } = Re(), { showAlert: n } = G();
964
+ }, gr = () => {
965
+ const { isLoading: t } = Ee(), { showAlert: n } = G();
1013
966
  return /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
1014
- t && /* @__PURE__ */ i.jsx(tr, {}),
967
+ t && /* @__PURE__ */ i.jsx(Xt, {}),
1015
968
  /* @__PURE__ */ i.jsxs("main", { className: t ? "hidden" : "", children: [
1016
- n && /* @__PURE__ */ i.jsx(sr, {}),
1017
- /* @__PURE__ */ i.jsx(at, {})
969
+ n && /* @__PURE__ */ i.jsx(rr, {}),
970
+ /* @__PURE__ */ i.jsx(rt, {})
1018
971
  ] })
1019
972
  ] });
1020
- }, rt = (t) => {
973
+ }, Qe = (t) => {
1021
974
  const {
1022
975
  inputType: n,
1023
- inputId: o,
1024
- inputPlaceholder: a,
1025
- inputRequired: c,
1026
- inputValue: u,
1027
- inputChange: g
1028
- } = t, f = ["text", "email", "password", "search", "tel", "url"].includes(n) ? n : "text";
976
+ inputId: a,
977
+ inputPlaceholder: s,
978
+ inputRequired: u,
979
+ inputValue: g,
980
+ inputChange: p
981
+ } = t, c = ["text", "email", "password", "search", "tel", "url"].includes(n) ? n : "text";
1029
982
  return /* @__PURE__ */ i.jsx(
1030
983
  "input",
1031
984
  {
1032
- type: f,
1033
- id: o,
985
+ type: c,
986
+ id: a,
1034
987
  className: "bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5",
1035
- placeholder: a,
1036
- required: c ?? !0,
1037
- value: u,
1038
- onChange: g
988
+ placeholder: s,
989
+ required: u ?? !0,
990
+ value: g,
991
+ onChange: p
1039
992
  }
1040
993
  );
1041
- }, nt = ({ label: t, labelId: n, labelStyle: o }) => /* @__PURE__ */ i.jsx("label", { htmlFor: n, className: `${o ?? "block mb-2 text-sm font-medium text-gray-900"}`, children: t }), ir = (t) => {
994
+ }, et = ({ label: t, labelId: n, labelStyle: a }) => /* @__PURE__ */ i.jsx("label", { htmlFor: n, className: `${a ?? "block mb-2 text-sm font-medium text-gray-900"}`, children: t }), nr = (t) => {
1042
995
  const {
1043
996
  // Variabili funzionamento della Login
1044
997
  submitForm: n,
1045
- formData: o,
1046
- changeValue: a,
998
+ formData: a,
999
+ changeValue: s,
1047
1000
  // Stile form
1048
- formSize: c = "w-[800px]",
1049
- formBgColor: u = "bg-slate-50",
1050
- formRounded: g = "rounded-lg",
1051
- formShadow: p = "shadow-lg",
1001
+ formSize: u = "w-[800px]",
1002
+ formBgColor: g = "bg-slate-50",
1003
+ formRounded: p = "rounded-lg",
1004
+ formShadow: v = "shadow-lg",
1052
1005
  // Input email/username
1053
- userData: f,
1006
+ userData: c,
1054
1007
  userLabel: y = "Email",
1055
1008
  userType: w = "email",
1056
- userPlaceholder: m = "email@email.it",
1009
+ userPlaceholder: h = "email@email.it",
1057
1010
  // Titolo
1058
1011
  formTitle: E = "Login",
1059
1012
  titleSize: T = "text-4xl",
1060
1013
  titlePosition: N = "text-center",
1061
1014
  titleSpacing: L = "my-12",
1062
1015
  // Bottone
1063
- buttonPosition: O = "justify-center",
1016
+ buttonPosition: P = "justify-center",
1064
1017
  buttonSpacing: b = "my-12",
1065
1018
  buttonColor: j = "bg-blue-500",
1066
1019
  buttonHoverColor: D = "hoverbg-blue-700",
@@ -1069,113 +1022,113 @@ const sr = () => {
1069
1022
  buttonRounded: X = "rounded-full",
1070
1023
  buttonText: _ = "Login"
1071
1024
  } = t;
1072
- return /* @__PURE__ */ i.jsxs("form", { onSubmit: n, className: `${c} ${g} ${p} ${u}`, children: [
1025
+ return /* @__PURE__ */ i.jsxs("form", { onSubmit: n, className: `${u} ${p} ${v} ${g}`, children: [
1073
1026
  /* @__PURE__ */ i.jsx("h1", { className: `${T} ${N} ${L}`, children: E }),
1074
1027
  /* @__PURE__ */ i.jsxs("div", { className: "flex justify-center flex-col gap-1 my-4 w-1/2 mx-auto", children: [
1075
- /* @__PURE__ */ i.jsx(nt, { labelId: "user-email", label: y }),
1028
+ /* @__PURE__ */ i.jsx(et, { labelId: "user-email", label: y }),
1076
1029
  /* @__PURE__ */ i.jsx(
1077
- rt,
1030
+ Qe,
1078
1031
  {
1079
1032
  inputType: w,
1080
1033
  inputId: "user-email",
1081
- inputPlaceholder: m,
1082
- inputValue: f ? o[f] : o.email,
1083
- inputChange: (P) => {
1084
- a(f || "email", P.target.value);
1034
+ inputPlaceholder: h,
1035
+ inputValue: c ? a[c] : a.email,
1036
+ inputChange: (O) => {
1037
+ s(c || "email", O.target.value);
1085
1038
  }
1086
1039
  }
1087
1040
  )
1088
1041
  ] }),
1089
1042
  /* @__PURE__ */ i.jsxs("div", { className: "flex justify-center flex-col gap-1 my-4 w-1/2 mx-auto", children: [
1090
- /* @__PURE__ */ i.jsx(nt, { labelId: "password", label: "Password" }),
1043
+ /* @__PURE__ */ i.jsx(et, { labelId: "password", label: "Password" }),
1091
1044
  /* @__PURE__ */ i.jsx(
1092
- rt,
1045
+ Qe,
1093
1046
  {
1094
1047
  inputType: "password",
1095
1048
  inputId: "password",
1096
1049
  inputPlaceholder: "Password",
1097
- inputValue: o.password,
1098
- inputChange: (P) => {
1099
- a("password", P.target.value);
1050
+ inputValue: a.password,
1051
+ inputChange: (O) => {
1052
+ s("password", O.target.value);
1100
1053
  }
1101
1054
  }
1102
1055
  )
1103
1056
  ] }),
1104
- /* @__PURE__ */ i.jsx("div", { className: `flex ${O} items-center ${b}`, children: /* @__PURE__ */ i.jsx("button", { className: `${j} ${D} ${I} font-bold ${H} ${X}`, children: _ }) })
1057
+ /* @__PURE__ */ i.jsx("div", { className: `flex ${P} items-center ${b}`, children: /* @__PURE__ */ i.jsx("button", { className: `${j} ${D} ${I} font-bold ${H} ${X}`, children: _ }) })
1105
1058
  ] });
1106
- }, mr = () => {
1107
- const { login: t } = Te(), { setShowAlert: n, setTypeAlert: o, setMessageAlert: a } = G(), { clearLoginFormOnError: c } = pe(), u = ot(), g = {
1059
+ }, vr = () => {
1060
+ const { login: t } = Ce(), { setShowAlert: n, setTypeAlert: a, setMessageAlert: s } = G(), { clearLoginFormOnError: u } = ve(), g = tt(), p = {
1108
1061
  email: "",
1109
1062
  password: ""
1110
- }, [p, f] = A(g), y = (m, E) => {
1111
- f((T) => ({ ...T, [m]: E }));
1112
- }, w = (m) => {
1113
- t(m, p), c && f(g);
1063
+ }, [v, c] = A(p), y = (h, E) => {
1064
+ c((T) => ({ ...T, [h]: E }));
1065
+ }, w = (h) => {
1066
+ t(h, v), u && c(p);
1114
1067
  };
1115
- return V(() => {
1116
- const m = localStorage.getItem("id");
1117
- localStorage.getItem("accessToken") && m && (u(`/dashboard/${m}`), n(!0), o("info"), a("Sei già loggato"));
1068
+ return Y(() => {
1069
+ const h = localStorage.getItem("id");
1070
+ localStorage.getItem("accessToken") && h && (g(`/dashboard/${h}`), n(!0), a("info"), s("Sei già loggato"));
1118
1071
  }, []), /* @__PURE__ */ i.jsx("section", { children: /* @__PURE__ */ i.jsx("div", { className: "container mx-auto flex items-center justify-center h-screen", children: /* @__PURE__ */ i.jsx(
1119
- ir,
1072
+ nr,
1120
1073
  {
1121
1074
  submitForm: w,
1122
- formData: p,
1075
+ formData: v,
1123
1076
  changeValue: y
1124
1077
  }
1125
1078
  ) }) });
1126
- }, br = () => {
1127
- const { id: t } = zt(), { logout: n, setCurrentToken: o } = Te(), { usersEndpoint: a } = pe(), { setIsLoading: c } = Re(), { setShowAlert: u, setTypeAlert: g, setMessageAlert: p } = G(), [f, y] = A({}), [w, m] = A(null), [E, T] = A(!1), N = async () => {
1079
+ }, pr = () => {
1080
+ const { id: t } = Ft(), { logout: n, setCurrentToken: a } = Ce(), { usersEndpoint: s } = ve(), { setIsLoading: u } = Ee(), { setShowAlert: g, setTypeAlert: p, setMessageAlert: v } = G(), [c, y] = A({}), [w, h] = A(null), [E, T] = A(!1), N = async () => {
1128
1081
  try {
1129
- c(!0);
1082
+ u(!0);
1130
1083
  const b = localStorage.getItem("accessToken");
1131
1084
  if (!b) {
1132
- n(), u(!0), g("danger"), p("Sessione scaduta");
1085
+ n(), g(!0), p("danger"), v("Sessione scaduta");
1133
1086
  return;
1134
1087
  }
1135
- o(b);
1136
- const I = (await (await ue(u, g, p)).get(
1137
- `${a}${t}`,
1088
+ a(b);
1089
+ const I = (await (await ce(g, p, v)).get(
1090
+ `${s}${t}`,
1138
1091
  { headers: {
1139
1092
  Authorization: b
1140
1093
  } }
1141
1094
  )).data;
1142
- y(I), c(!1);
1095
+ y(I), u(!1);
1143
1096
  } catch (b) {
1144
- console.error(b), c(!1), n();
1097
+ console.error(b), u(!1), n();
1145
1098
  }
1146
1099
  }, L = async () => {
1147
1100
  try {
1148
1101
  T(!0);
1149
1102
  const b = localStorage.getItem("accessToken");
1150
1103
  if (!b) {
1151
- n(), u(!0), g("danger"), p("Sessione scaduta");
1104
+ n(), g(!0), p("danger"), v("Sessione scaduta");
1152
1105
  return;
1153
1106
  }
1154
- const I = (await (await ue(u, g, p)).get(
1155
- `${a}`,
1107
+ const I = (await (await ce(g, p, v)).get(
1108
+ `${s}`,
1156
1109
  { headers: {
1157
1110
  Authorization: b
1158
1111
  } }
1159
1112
  )).data;
1160
- m(I), I && T(!1);
1113
+ h(I), I && T(!1);
1161
1114
  } catch (b) {
1162
- console.error(b), c(!1), b.status === 401 && n(), T(!1);
1115
+ console.error(b), u(!1), b.status === 401 && n(), T(!1);
1163
1116
  }
1164
- }, O = () => {
1165
- n(), u(!0), g("info"), p("Hai effettuato il logout");
1117
+ }, P = () => {
1118
+ n(), g(!0), p("info"), v("Hai effettuato il logout");
1166
1119
  };
1167
- return V(() => {
1120
+ return Y(() => {
1168
1121
  N();
1169
1122
  }, []), /* @__PURE__ */ i.jsx("section", { children: /* @__PURE__ */ i.jsxs("div", { className: "container mx-auto py-8", children: [
1170
1123
  /* @__PURE__ */ i.jsxs("div", { className: "flex items-center justify-center gap-8 h-20", children: [
1171
1124
  /* @__PURE__ */ i.jsxs("h1", { className: "text-4xl text-center text-slate-800", children: [
1172
1125
  "Email: ",
1173
- f.email
1126
+ c.email
1174
1127
  ] }),
1175
1128
  /* @__PURE__ */ i.jsx(
1176
1129
  "button",
1177
1130
  {
1178
- onClick: O,
1131
+ onClick: P,
1179
1132
  className: "bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded-full",
1180
1133
  children: "Logout"
1181
1134
  }
@@ -1198,18 +1151,18 @@ const sr = () => {
1198
1151
  ] }) });
1199
1152
  };
1200
1153
  export {
1201
- sr as Alert,
1202
- gr as AlertProvider,
1203
- pr as AuthPage,
1204
- vr as AuthProvider,
1205
- dr as ConfigProvider,
1206
- br as Dashboard,
1207
- hr as DefaultLayout,
1208
- rt as Input,
1209
- nt as InputLabel,
1210
- tr as Loading,
1211
- fr as LoadingProvider,
1212
- mr as Login,
1213
- ir as LoginForm,
1214
- ue as fetchAxiosConfig
1154
+ rr as Alert,
1155
+ ur as AlertProvider,
1156
+ dr as AuthPage,
1157
+ fr as AuthProvider,
1158
+ cr as ConfigProvider,
1159
+ pr as Dashboard,
1160
+ gr as DefaultLayout,
1161
+ Qe as Input,
1162
+ et as InputLabel,
1163
+ Xt as Loading,
1164
+ lr as LoadingProvider,
1165
+ vr as Login,
1166
+ nr as LoginForm,
1167
+ ce as fetchAxiosConfig
1215
1168
  };