thecore-auth 0.0.36 → 0.0.37

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