thecore-auth 0.0.78 → 0.0.79

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -10,30 +10,51 @@ After installation, create a `config.json` file inside the `public/` folder. Thi
10
10
  ### Example:
11
11
  ```json
12
12
  {
13
- "baseUri": "", // Back-end base URI
14
- "authenticatedEndpoint": "", // Authentication endpoint
15
- "usersEndpoint": "", // Users endpoint
16
- "heartbeatEndpoint": "", // Heartbeat endpoint for token renewal
17
- "firstPrivatePath": "/dashboard/", // Path of the first private route
18
- "firstPrivateTitle": "", // Title of the first private page
13
+ "baseUri": "",
14
+ "authenticatedEndpoint": "",
15
+ "usersEndpoint": "",
16
+ "heartbeatEndpoint": "",
17
+ "firstPrivatePath": "/dashboard/",
18
+ "firstPrivateTitle": "Dashboard",
19
19
  "configRoutes": [
20
- {"path": "", "title": "", "element": ""} // Adding new routes
20
+ {"path": "", "title": "", "element": ""}
21
21
  ],
22
- "infiniteSession": 60000, // Milliseconds subtracted from the token expiration time
23
- "alertTimeout": 5000, // Duration in milliseconds of the alert timeout
24
- "axiosTimeout": 3000, // Maximum duration in milliseconds of an axios call
22
+ "infiniteSession": 60000,
23
+ "alertTimeout": 5000,
24
+ "axiosTimeout": 3000,
25
25
  "axiosErrors": {
26
- "unauthorized": "Access denied", // Error message for authentication failure (401 error)
27
- "notFound": "Resource not found", // Error message for resource not found (404 error)
28
- "defaultMessage": "Unknown error" // Generic error message
26
+ "unauthorized": "Accesso negato",
27
+ "notFound": "Risorsa non trovata",
28
+ "defaultMessage": "Errore sconosciuto"
29
29
  },
30
- "clearLoginFormOnError": true, // Flag to clear login form data on error
31
- "autoLogin": false, // Flag for auto-login
32
- "autoLoginEmail": "example@mail.com", // Email for auto-login
33
- "autoLoginPassword": "password123" // Password for auto-login
30
+ "clearLoginFormOnError": true,
31
+ "autoLogin": false,
32
+ "backendToken": "token-machine-to-machine",
33
+ "isDebug": true
34
34
  }
35
35
  ```
36
36
 
37
+ #### Details of each key:
38
+
39
+ - `baseUri`: The base URI of the back-end, used to compose the API URLs. This is the fixed part of the server's URL.
40
+ - `authenticatedEndpoint`: The endpoint for user login and authentication. This URL is used to send the authentication request.
41
+ - `usersEndpoint`: The endpoint to retrieve user information, such as the user list or details of the authenticated user.
42
+ - `heartbeatEndpoint`: The endpoint for renewing the authentication token (heartbeat). This URL is used to keep the session active, preventing the token from expiring.
43
+ - `firstPrivatePath`: The path to the first private route that the user sees after logging in. For example, it might be a page like the dashboard.
44
+ - `firstPrivateTitle`: The title to display for the first private page, useful for defining the page name in the layout.
45
+ - `configRoutes`: A list of new customizable routes to add to the application. Each route contains a `path` (URL), a `title` (title to display on the page), and an `element` (the element defining the route content, such as a React component).
46
+ - `infiniteSession`: The number of milliseconds to subtract from the authentication token's expiration time to determine when the session should be considered expired and therefore renewed.
47
+ - `alertTimeout`: The time, in milliseconds, for how long an alert (e.g., an on-screen notification) should remain visible.
48
+ - `axiosTimeout`: The maximum duration (in milliseconds) that an Axios request can take before it times out.
49
+ - `axiosErrors`: An object containing custom messages to display for specific Axios errors:
50
+ - `unauthorized`: The message displayed when error code 401 (access denied) is returned from the request.
51
+ - `notFound`: The message displayed when error code 404 (resource not found) is returned from the request.
52
+ - `defaultMessage`: A generic message displayed for unspecified errors.
53
+ - `clearLoginFormOnError`: A flag that indicates whether the login form data should be cleared in case of an error.
54
+ - `autoLogin`: A flag that enables or disables auto-login. When set to true, the app will automatically log in with predefined credentials.
55
+ - `backendToken`: The token for auto-login, used for automatic login in "machine-to-machine" mode or without user interaction.
56
+ - `isDebug`: A flag that, when set to true, enables the display of debug logs (console.log) to assist with application debugging.
57
+
37
58
  Additional variables can be included and retrieved using the `useConfig` hook:
38
59
 
39
60
  ```jsx
@@ -157,7 +178,7 @@ useLayoutEffect(() => {
157
178
  To apply package styles, import the CSS into your main styles file:
158
179
 
159
180
  ```css
160
- @import url(../node_modules/thecore-auth/dist/thecore-auth.css);
181
+ @import url(../node_modules/@dev/thecore-auth/dist/thecore-auth.css);
161
182
  ```
162
183
 
163
184
  For modifying the app’s appearance, we have implemented CSS variables that allow customization without creating new classes. For more details, see the [CSS Variables Documentation](CSS%20variables%20documentation.md)
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),it=require("jwt-decode"),C=require("react-router-dom"),Fe=require("axios");function lt(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const a=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(o,n,a.get?a:{enumerable:!0,get:()=>t[n]})}}return o.default=t,Object.freeze(o)}const r=lt(l);var ue={exports:{}},se={};/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),it=require("jwt-decode"),w=require("react-router-dom"),Fe=require("axios");function lt(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const a=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(o,n,a.get?a:{enumerable:!0,get:()=>t[n]})}}return o.default=t,Object.freeze(o)}const r=lt(l);var ue={exports:{}},se={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Ie;function ct(){if(Ie)return se;Ie=1;var t=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function n(a,i,f){var d=null;if(f!==void 0&&(d=""+f),i.key!==void 0&&(d=""+i.key),"key"in i){f={};for(var p in i)p!=="key"&&(f[p]=i[p])}else f=i;return i=f.ref,{$$typeof:t,type:a,key:d,ref:i!==void 0?i:null,props:f}}return se.Fragment=o,se.jsx=n,se.jsxs=n,se}var ie={};/**
9
+ */var Ie;function ct(){if(Ie)return se;Ie=1;var t=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function n(a,i,f){var m=null;if(f!==void 0&&(m=""+f),i.key!==void 0&&(m=""+i.key),"key"in i){f={};for(var p in i)p!=="key"&&(f[p]=i[p])}else f=i;return i=f.ref,{$$typeof:t,type:a,key:m,ref:i!==void 0?i:null,props:f}}return se.Fragment=o,se.jsx=n,se.jsxs=n,se}var ie={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,21 +14,21 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var ze;function ut(){return ze||(ze=1,process.env.NODE_ENV!=="production"&&function(){function t(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===M?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case D:return"Fragment";case A:return"Portal";case W:return"Profiler";case ee:return"StrictMode";case V:return"Suspense";case G:return"SuspenseList"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case J:return(e.displayName||"Context")+".Provider";case H:return(e._context.displayName||"Context")+".Consumer";case Y:var c=e.render;return e=e.displayName,e||(e=c.displayName||c.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case X:return c=e.displayName||null,c!==null?c:t(e.type)||"Memo";case R:c=e._payload,e=e._init;try{return t(e(c))}catch{}}return null}function o(e){return""+e}function n(e){try{o(e);var c=!1}catch{c=!0}if(c){c=console;var u=c.error,E=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return u.call(c,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",E),o(e)}}function a(){}function i(){if(ne===0){je=console.log,Se=console.info,Le=console.warn,Oe=console.error,Pe=console.group,ke=console.groupCollapsed,Re=console.groupEnd;var e={configurable:!0,enumerable:!0,value:a,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}ne++}function f(){if(ne--,ne===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:B({},e,{value:je}),info:B({},e,{value:Se}),warn:B({},e,{value:Le}),error:B({},e,{value:Oe}),group:B({},e,{value:Pe}),groupCollapsed:B({},e,{value:ke}),groupEnd:B({},e,{value:Re})})}0>ne&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function d(e){if(he===void 0)try{throw Error()}catch(u){var c=u.stack.trim().match(/\n( *(at )?)/);he=c&&c[1]||"",_e=-1<u.stack.indexOf(`
17
+ */var ze;function ut(){return ze||(ze=1,process.env.NODE_ENV!=="production"&&function(){function t(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ge?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case B:return"Fragment";case N:return"Portal";case U:return"Profiler";case Q:return"StrictMode";case G:return"Suspense";case $:return"SuspenseList"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case oe:return(e.displayName||"Context")+".Provider";case ee:return(e._context.displayName||"Context")+".Consumer";case H:var c=e.render;return e=e.displayName,e||(e=c.displayName||c.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case F:return c=e.displayName||null,c!==null?c:t(e.type)||"Memo";case J:c=e._payload,e=e._init;try{return t(e(c))}catch{}}return null}function o(e){return""+e}function n(e){try{o(e);var c=!1}catch{c=!0}if(c){c=console;var u=c.error,b=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return u.call(c,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",b),o(e)}}function a(){}function i(){if(Y===0){je=console.log,Se=console.info,Le=console.warn,Oe=console.error,Pe=console.group,ke=console.groupCollapsed,Re=console.groupEnd;var e={configurable:!0,enumerable:!0,value:a,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}Y++}function f(){if(Y--,Y===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:z({},e,{value:je}),info:z({},e,{value:Se}),warn:z({},e,{value:Le}),error:z({},e,{value:Oe}),group:z({},e,{value:Pe}),groupCollapsed:z({},e,{value:ke}),groupEnd:z({},e,{value:Re})})}0>Y&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function m(e){if(he===void 0)try{throw Error()}catch(u){var c=u.stack.trim().match(/\n( *(at )?)/);he=c&&c[1]||"",Te=-1<u.stack.indexOf(`
18
18
  at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
19
- `+he+e+_e}function p(e,c){if(!e||xe)return"";var u=ve.get(e);if(u!==void 0)return u;xe=!0,u=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var E=null;E=z.H,z.H=null,i();try{var T={DetermineComponentFrameRoot:function(){try{if(c){var q=function(){throw Error()};if(Object.defineProperty(q.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(q,[])}catch(F){var ce=F}Reflect.construct(e,[],q)}else{try{q.call()}catch(F){ce=F}e.call(q.prototype)}}else{try{throw Error()}catch(F){ce=F}(q=e())&&typeof q.catch=="function"&&q.catch(function(){})}}catch(F){if(F&&ce&&typeof F.stack=="string")return[F.stack,ce.stack]}return[null,null]}};T.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var P=Object.getOwnPropertyDescriptor(T.DetermineComponentFrameRoot,"name");P&&P.configurable&&Object.defineProperty(T.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=T.DetermineComponentFrameRoot(),$=h[0],re=h[1];if($&&re){var N=$.split(`
20
- `),K=re.split(`
21
- `);for(h=P=0;P<N.length&&!N[P].includes("DetermineComponentFrameRoot");)P++;for(;h<K.length&&!K[h].includes("DetermineComponentFrameRoot");)h++;if(P===N.length||h===K.length)for(P=N.length-1,h=K.length-1;1<=P&&0<=h&&N[P]!==K[h];)h--;for(;1<=P&&0<=h;P--,h--)if(N[P]!==K[h]){if(P!==1||h!==1)do if(P--,h--,0>h||N[P]!==K[h]){var ae=`
22
- `+N[P].replace(" at new "," at ");return e.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",e.displayName)),typeof e=="function"&&ve.set(e,ae),ae}while(1<=P&&0<=h);break}}}finally{xe=!1,z.H=E,f(),Error.prepareStackTrace=u}return N=(N=e?e.displayName||e.name:"")?d(N):"",typeof e=="function"&&ve.set(e,N),N}function g(e){if(e==null)return"";if(typeof e=="function"){var c=e.prototype;return p(e,!(!c||!c.isReactComponent))}if(typeof e=="string")return d(e);switch(e){case V:return d("Suspense");case G:return d("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case Y:return e=p(e.render,!1),e;case X:return g(e.type);case R:c=e._payload,e=e._init;try{return g(e(c))}catch{}}return""}function j(){var e=z.A;return e===null?null:e.getOwner()}function y(e){if(te.call(e,"key")){var c=Object.getOwnPropertyDescriptor(e,"key").get;if(c&&c.isReactWarning)return!1}return e.key!==void 0}function _(e,c){function u(){Te||(Te=!0,console.error("%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://react.dev/link/special-props)",c))}u.isReactWarning=!0,Object.defineProperty(e,"key",{get:u,configurable:!0})}function O(){var e=t(this.type);return Ne[e]||(Ne[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function m(e,c,u,E,T,P){return u=P.ref,e={$$typeof:L,type:e,key:c,props:P,_owner:T},(u!==void 0?u:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:O}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function v(e,c,u,E,T,P){if(typeof e=="string"||typeof e=="function"||e===D||e===W||e===ee||e===V||e===G||e===I||typeof e=="object"&&e!==null&&(e.$$typeof===R||e.$$typeof===X||e.$$typeof===J||e.$$typeof===H||e.$$typeof===Y||e.$$typeof===at||e.getModuleId!==void 0)){var h=c.children;if(h!==void 0)if(E)if(ge(h)){for(E=0;E<h.length;E++)x(h[E],e);Object.freeze&&Object.freeze(h)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else x(h,e)}else h="",(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(h+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),e===null?E="null":ge(e)?E="array":e!==void 0&&e.$$typeof===L?(E="<"+(t(e.type)||"Unknown")+" />",h=" Did you accidentally export a JSX literal instead of a component?"):E=typeof e,console.error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",E,h);if(te.call(c,"key")){h=t(e);var $=Object.keys(c).filter(function(N){return N!=="key"});E=0<$.length?"{key: someKey, "+$.join(": ..., ")+": ...}":"{key: someKey}",Ae[h+E]||($=0<$.length?"{"+$.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
19
+ `+he+e+Te}function p(e,c){if(!e||xe)return"";var u=ve.get(e);if(u!==void 0)return u;xe=!0,u=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var b=null;b=P.H,P.H=null,i();try{var A={DetermineComponentFrameRoot:function(){try{if(c){var Z=function(){throw Error()};if(Object.defineProperty(Z.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Z,[])}catch(W){var ce=W}Reflect.construct(e,[],Z)}else{try{Z.call()}catch(W){ce=W}e.call(Z.prototype)}}else{try{throw Error()}catch(W){ce=W}(Z=e())&&typeof Z.catch=="function"&&Z.catch(function(){})}}catch(W){if(W&&ce&&typeof W.stack=="string")return[W.stack,ce.stack]}return[null,null]}};A.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var k=Object.getOwnPropertyDescriptor(A.DetermineComponentFrameRoot,"name");k&&k.configurable&&Object.defineProperty(A.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=A.DetermineComponentFrameRoot(),D=g[0],te=g[1];if(D&&te){var M=D.split(`
20
+ `),X=te.split(`
21
+ `);for(g=k=0;k<M.length&&!M[k].includes("DetermineComponentFrameRoot");)k++;for(;g<X.length&&!X[g].includes("DetermineComponentFrameRoot");)g++;if(k===M.length||g===X.length)for(k=M.length-1,g=X.length-1;1<=k&&0<=g&&M[k]!==X[g];)g--;for(;1<=k&&0<=g;k--,g--)if(M[k]!==X[g]){if(k!==1||g!==1)do if(k--,g--,0>g||M[k]!==X[g]){var ae=`
22
+ `+M[k].replace(" at new "," at ");return e.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",e.displayName)),typeof e=="function"&&ve.set(e,ae),ae}while(1<=k&&0<=g);break}}}finally{xe=!1,P.H=b,f(),Error.prepareStackTrace=u}return M=(M=e?e.displayName||e.name:"")?m(M):"",typeof e=="function"&&ve.set(e,M),M}function h(e){if(e==null)return"";if(typeof e=="function"){var c=e.prototype;return p(e,!(!c||!c.isReactComponent))}if(typeof e=="string")return m(e);switch(e){case G:return m("Suspense");case $:return m("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case H:return e=p(e.render,!1),e;case F:return h(e.type);case J:c=e._payload,e=e._init;try{return h(e(c))}catch{}}return""}function y(){var e=P.A;return e===null?null:e.getOwner()}function E(e){if(I.call(e,"key")){var c=Object.getOwnPropertyDescriptor(e,"key").get;if(c&&c.isReactWarning)return!1}return e.key!==void 0}function T(e,c){function u(){Ne||(Ne=!0,console.error("%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://react.dev/link/special-props)",c))}u.isReactWarning=!0,Object.defineProperty(e,"key",{get:u,configurable:!0})}function L(){var e=t(this.type);return Ae[e]||(Ae[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function d(e,c,u,b,A,k){return u=k.ref,e={$$typeof:C,type:e,key:c,props:k,_owner:A},(u!==void 0?u:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:L}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function v(e,c,u,b,A,k){if(typeof e=="string"||typeof e=="function"||e===B||e===U||e===Q||e===G||e===$||e===pe||typeof e=="object"&&e!==null&&(e.$$typeof===J||e.$$typeof===F||e.$$typeof===oe||e.$$typeof===ee||e.$$typeof===H||e.$$typeof===_||e.getModuleId!==void 0)){var g=c.children;if(g!==void 0)if(b)if(V(g)){for(b=0;b<g.length;b++)x(g[b],e);Object.freeze&&Object.freeze(g)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else x(g,e)}else g="",(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(g+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),e===null?b="null":V(e)?b="array":e!==void 0&&e.$$typeof===C?(b="<"+(t(e.type)||"Unknown")+" />",g=" Did you accidentally export a JSX literal instead of a component?"):b=typeof e,console.error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",b,g);if(I.call(c,"key")){g=t(e);var D=Object.keys(c).filter(function(M){return M!=="key"});b=0<D.length?"{key: someKey, "+D.join(": ..., ")+": ...}":"{key: someKey}",_e[g+b]||(D=0<D.length?"{"+D.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
23
23
  let props = %s;
24
24
  <%s {...props} />
25
25
  React keys must be passed directly to JSX without using spread:
26
26
  let props = %s;
27
- <%s key={someKey} {...props} />`,E,h,$,h),Ae[h+E]=!0)}if(h=null,u!==void 0&&(n(u),h=""+u),y(c)&&(n(c.key),h=""+c.key),"key"in c){u={};for(var re in c)re!=="key"&&(u[re]=c[re])}else u=c;return h&&_(u,typeof e=="function"?e.displayName||e.name||"Unknown":e),m(e,h,P,T,j(),u)}function x(e,c){if(typeof e=="object"&&e&&e.$$typeof!==st){if(ge(e))for(var u=0;u<e.length;u++){var E=e[u];b(E)&&w(E,c)}else if(b(e))e._store&&(e._store.validated=1);else if(e===null||typeof e!="object"?u=null:(u=Z&&e[Z]||e["@@iterator"],u=typeof u=="function"?u:null),typeof u=="function"&&u!==e.entries&&(u=u.call(e),u!==e))for(;!(e=u.next()).done;)b(e.value)&&w(e.value,c)}}function b(e){return typeof e=="object"&&e!==null&&e.$$typeof===L}function w(e,c){if(e._store&&!e._store.validated&&e.key==null&&(e._store.validated=1,c=S(c),!Me[c])){Me[c]=!0;var u="";e&&e._owner!=null&&e._owner!==j()&&(u=null,typeof e._owner.tag=="number"?u=t(e._owner.type):typeof e._owner.name=="string"&&(u=e._owner.name),u=" It was passed a child from "+u+".");var E=z.getCurrentStack;z.getCurrentStack=function(){var T=g(e.type);return E&&(T+=E()||""),T},console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',c,u),z.getCurrentStack=E}}function S(e){var c="",u=j();return u&&(u=t(u.type))&&(c=`
27
+ <%s key={someKey} {...props} />`,b,g,D,g),_e[g+b]=!0)}if(g=null,u!==void 0&&(n(u),g=""+u),E(c)&&(n(c.key),g=""+c.key),"key"in c){u={};for(var te in c)te!=="key"&&(u[te]=c[te])}else u=c;return g&&T(u,typeof e=="function"?e.displayName||e.name||"Unknown":e),d(e,g,k,A,y(),u)}function x(e,c){if(typeof e=="object"&&e&&e.$$typeof!==st){if(V(e))for(var u=0;u<e.length;u++){var b=e[u];O(b)&&j(b,c)}else if(O(e))e._store&&(e._store.validated=1);else if(e===null||typeof e!="object"?u=null:(u=ne&&e[ne]||e["@@iterator"],u=typeof u=="function"?u:null),typeof u=="function"&&u!==e.entries&&(u=u.call(e),u!==e))for(;!(e=u.next()).done;)O(e.value)&&j(e.value,c)}}function O(e){return typeof e=="object"&&e!==null&&e.$$typeof===C}function j(e,c){if(e._store&&!e._store.validated&&e.key==null&&(e._store.validated=1,c=S(c),!Me[c])){Me[c]=!0;var u="";e&&e._owner!=null&&e._owner!==y()&&(u=null,typeof e._owner.tag=="number"?u=t(e._owner.type):typeof e._owner.name=="string"&&(u=e._owner.name),u=" It was passed a child from "+u+".");var b=P.getCurrentStack;P.getCurrentStack=function(){var A=h(e.type);return b&&(A+=b()||""),A},console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',c,u),P.getCurrentStack=b}}function S(e){var c="",u=y();return u&&(u=t(u.type))&&(c=`
28
28
 
29
29
  Check the render method of \``+u+"`."),c||(e=t(e))&&(c=`
30
30
 
31
- Check the top-level render call using <`+e+">."),c}var k=l,L=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),ee=Symbol.for("react.strict_mode"),W=Symbol.for("react.profiler"),H=Symbol.for("react.consumer"),J=Symbol.for("react.context"),Y=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),G=Symbol.for("react.suspense_list"),X=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),I=Symbol.for("react.offscreen"),Z=Symbol.iterator,M=Symbol.for("react.client.reference"),z=k.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te=Object.prototype.hasOwnProperty,B=Object.assign,at=Symbol.for("react.client.reference"),ge=Array.isArray,ne=0,je,Se,Le,Oe,Pe,ke,Re;a.__reactDisabledLog=!0;var he,_e,xe=!1,ve=new(typeof WeakMap=="function"?WeakMap:Map),st=Symbol.for("react.client.reference"),Te,Ne={},Ae={},Me={};ie.Fragment=D,ie.jsx=function(e,c,u,E,T){return v(e,c,u,!1,E,T)},ie.jsxs=function(e,c,u,E,T){return v(e,c,u,!0,E,T)}}()),ie}var Ge;function ft(){return Ge||(Ge=1,process.env.NODE_ENV==="production"?ue.exports=ct():ue.exports=ut()),ue.exports}var s=ft();const De=l.createContext(),dt=({children:t})=>{const[o,n]=l.useState(!1),[a,i]=l.useState(!1),[f,d]=l.useState({});return s.jsx(De.Provider,{value:{isLoading:o,setIsLoading:n,isLoadingComponent:a,setIsLoadingComponent:i,loadingProps:f,setLoadingProps:d},children:t})},le=()=>{const t=l.useContext(De);if(t===void 0)throw new Error("Non puoi settare il loading");return t},We=({errorMessage:t,errorShow:o})=>s.jsx("section",{className:o?"":"hidden",children:s.jsxs("div",{className:"container mx-auto",children:[s.jsx("h1",{className:"text-center text-8xl my-12",children:"Errore"}),s.jsx("pre",{className:"text-xl",children:t})]})}),Ye=l.createContext(),mt=({children:t})=>{const[o,n]=l.useState({}),[a,i]=l.useState(!1),f=`Creare un file config.json in public per il corretto funzionamento
31
+ Check the top-level render call using <`+e+">."),c}var R=l,C=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),B=Symbol.for("react.fragment"),Q=Symbol.for("react.strict_mode"),U=Symbol.for("react.profiler"),ee=Symbol.for("react.consumer"),oe=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),J=Symbol.for("react.lazy"),pe=Symbol.for("react.offscreen"),ne=Symbol.iterator,ge=Symbol.for("react.client.reference"),P=R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=Object.prototype.hasOwnProperty,z=Object.assign,_=Symbol.for("react.client.reference"),V=Array.isArray,Y=0,je,Se,Le,Oe,Pe,ke,Re;a.__reactDisabledLog=!0;var he,Te,xe=!1,ve=new(typeof WeakMap=="function"?WeakMap:Map),st=Symbol.for("react.client.reference"),Ne,Ae={},_e={},Me={};ie.Fragment=B,ie.jsx=function(e,c,u,b,A){return v(e,c,u,!1,b,A)},ie.jsxs=function(e,c,u,b,A){return v(e,c,u,!0,b,A)}}()),ie}var Ge;function ft(){return Ge||(Ge=1,process.env.NODE_ENV==="production"?ue.exports=ct():ue.exports=ut()),ue.exports}var s=ft();const De=l.createContext(),dt=({children:t})=>{const[o,n]=l.useState(!1),[a,i]=l.useState(!1),[f,m]=l.useState({});return s.jsx(De.Provider,{value:{isLoading:o,setIsLoading:n,isLoadingComponent:a,setIsLoadingComponent:i,loadingProps:f,setLoadingProps:m},children:t})},le=()=>{const t=l.useContext(De);if(t===void 0)throw new Error("Non puoi settare il loading");return t},We=({errorMessage:t,errorShow:o})=>s.jsx("section",{className:o?"":"hidden",children:s.jsxs("div",{className:"container mx-auto",children:[s.jsx("h1",{className:"text-center text-8xl my-12",children:"Errore"}),s.jsx("pre",{className:"text-xl",children:t})]})}),Ye=l.createContext(),mt=({children:t})=>{const[o,n]=l.useState({}),[a,i]=l.useState(!1),f=`Creare un file config.json in public per il corretto funzionamento
32
32
  Esempio di config.json:
33
33
 
34
34
  {
@@ -41,20 +41,20 @@ Esempio di config.json:
41
41
  "configRoutes": [
42
42
  {"path": "", "title": "", "element": ""}
43
43
  ],
44
- "infiniteSession": ,
45
- "timeDeducted": ,
46
- "alertTimeout": ,
47
- "axiosTimeout": ,
44
+ "infiniteSession": " ,
45
+ "timeDeducted": " ,
46
+ "alertTimeout": " ,
47
+ "axiosTimeout": " ,
48
48
  "axiosErrors": {
49
49
  "unauthorized":"",
50
50
  "notFound": "",
51
51
  "defaultMessage": ""
52
52
  },
53
- "clearLoginFormOnError": ,
54
- "autoLogin": ,
55
- "autoLoginEmail": ,
56
- "autoLoginPassword":
57
- }`,d=()=>{const m=new Date,v=String(m.getDate()).padStart(2,"0"),x=String(m.getMonth()+1).padStart(2,"0"),b=m.getFullYear(),w=String(m.getHours()).padStart(2,"0"),S=String(m.getMinutes()).padStart(2,"0"),k=String(m.getSeconds()).padStart(2,"0");return`${v}/${x}/${b} ${w}:${S}:${k}`},p=m=>new Promise((v,x)=>{const b=indexedDB.open("configDatabase",1);b.onupgradeneeded=w=>{const S=w.target.result;S.objectStoreNames.contains(m)||S.createObjectStore(m,{keyPath:"id"})},b.onsuccess=w=>v(w.target.result),b.onerror=w=>x(w.target.error)}),g=async(m,v)=>{let x=await p(m);return new Promise((b,w)=>{if(!x){w("Errore: DB non disponibile");return}const S=x==null?void 0:x.transaction(m,"readonly"),k=S==null?void 0:S.objectStore(m),L=k==null?void 0:k.get(v);L.onsuccess=()=>b(L.result),L.onerror=A=>w(A.target.error)})},j=async(m,v)=>{let x=await p(m);return new Promise((b,w)=>{if(!x){w("Errore: DB non disponibile");return}const S=x==null?void 0:x.transaction(m,"readwrite"),k=S==null?void 0:S.objectStore(m),L=k==null?void 0:k.put(v);L.onsuccess=()=>b(L.result),L.onerror=A=>w(A.target.error)})},y=async m=>{let v=Date.now(),x;do x=await g(m,v),x&&v++;while(x);return v},_=async(m,v)=>{v.id||(v.id=await y(m)),await j(m,v)},O=async()=>{try{const x={...await(await fetch("/config.json")).json(),openIndexedDB:p,getDataIndexedDB:g,setDataIndexedDB:j,generateUniqueId:y,setDataWithAutoId:_,setCurrentDate:d};n(x)}catch(m){console.error(m),i(!0)}};return l.useEffect(()=>{O()},[]),Object.keys(o).length===0?s.jsx(We,{errorShow:a,errorMessage:f}):s.jsx(Ye.Provider,{value:o,children:t})},U=()=>{const t=l.useContext(Ye);if(t===void 0)throw new Error("Non puoi leggere i config");return t},pt=t=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:500,zoomAndPan:"magnify",viewBox:"0 0 375 374.999991",height:500,preserveAspectRatio:"xMidYMid meet",...t},r.createElement("defs",null,r.createElement("g",null),r.createElement("clipPath",{id:"6ca7e2bf04"},r.createElement("path",{d:"M 265.136719 0 L 375 109.863281 L 375 265.136719 L 265.136719 375 L 109.863281 375 L 0 265.136719 L 0 109.863281 L 109.863281 0 Z M 265.136719 0 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"2c77c820c6"},r.createElement("path",{d:"M 12.878906 12.878906 L 362.121094 12.878906 L 362.121094 362.121094 L 12.878906 362.121094 Z M 12.878906 12.878906 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"3d94df7d66"},r.createElement("path",{d:"M 259.804688 12.878906 L 362.121094 115.195312 L 362.121094 259.804688 L 259.804688 362.121094 L 115.195312 362.121094 L 12.878906 259.804688 L 12.878906 115.195312 L 115.195312 12.878906 Z M 259.804688 12.878906 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"8793709a64"},r.createElement("path",{d:"M 12.878906 12.878906 L 362.109375 12.878906 L 362.109375 362.109375 L 12.878906 362.109375 Z M 12.878906 12.878906 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"fdb3fe29d8"},r.createElement("path",{d:"M 259.796875 12.878906 L 362.109375 115.191406 L 362.109375 259.796875 L 259.796875 362.109375 L 115.191406 362.109375 L 12.878906 259.796875 L 12.878906 115.191406 L 115.191406 12.878906 Z M 259.796875 12.878906 ",clipRule:"nonzero"}))),r.createElement("g",{clipPath:"url(#6ca7e2bf04)"},r.createElement("rect",{x:-37.5,width:450,fill:"#b91c1c",y:-37.499999,height:449.999989,fillOpacity:1})),r.createElement("g",{clipPath:"url(#2c77c820c6)"},r.createElement("g",{clipPath:"url(#3d94df7d66)"},r.createElement("path",{fill:"#b91c1c",d:"M 12.878906 12.878906 L 362.121094 12.878906 L 362.121094 362.121094 L 12.878906 362.121094 Z M 12.878906 12.878906 ",fillOpacity:1,fillRule:"nonzero"}))),r.createElement("g",{clipPath:"url(#8793709a64)"},r.createElement("g",{clipPath:"url(#fdb3fe29d8)"},r.createElement("path",{strokeLinecap:"butt",transform:"matrix(0.75, 0, 0, 0.75, 12.879396, 12.879392)",fill:"none",strokeLinejoin:"miter",d:"M 329.223327 -0.000647072 L 465.640003 136.416029 L 465.640003 329.223333 L 329.223327 465.640009 L 136.416023 465.640009 L -0.000653072 329.223333 L -0.000653072 136.416029 L 136.416023 -0.000647072 Z M 329.223327 -0.000647072 ",stroke:"#ffffff",strokeWidth:34,strokeOpacity:1,strokeMiterlimit:4}))),r.createElement("g",{fill:"#ffffff",fillOpacity:1},r.createElement("g",{transform:"translate(111.648432, 267.442446)"},r.createElement("g",null,r.createElement("path",{d:"M 2.828125 0 L 56.25 -79.859375 L 3.046875 -159.609375 L 37.28125 -159.609375 L 75.90625 -98.046875 L 114.53125 -159.609375 L 148.765625 -159.609375 L 95.5625 -79.859375 L 148.984375 0 L 114.765625 0 L 75.671875 -60.65625 L 37.046875 0 Z M 2.828125 0 "}))))),gt=t=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:500,zoomAndPan:"magnify",viewBox:"0 0 375 374.999991",height:500,preserveAspectRatio:"xMidYMid meet",...t},r.createElement("defs",null,r.createElement("g",null),r.createElement("clipPath",{id:"30562604dd"},r.createElement("path",{d:"M 187.5 0 C 83.945312 0 0 83.945312 0 187.5 C 0 291.054688 83.945312 375 187.5 375 C 291.054688 375 375 291.054688 375 187.5 C 375 83.945312 291.054688 0 187.5 0 Z M 187.5 0 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"971fcd5f72"},r.createElement("path",{d:"M 18.570312 18.570312 L 356.429688 18.570312 L 356.429688 356.429688 L 18.570312 356.429688 Z M 18.570312 18.570312 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"e891a7f57e"},r.createElement("path",{d:"M 187.5 18.570312 C 94.203125 18.570312 18.570312 94.203125 18.570312 187.5 C 18.570312 280.796875 94.203125 356.429688 187.5 356.429688 C 280.796875 356.429688 356.429688 280.796875 356.429688 187.5 C 356.429688 94.203125 280.796875 18.570312 187.5 18.570312 Z M 187.5 18.570312 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"19a9ddc130"},r.createElement("path",{d:"M 18.570312 18.570312 L 356.070312 18.570312 L 356.070312 356.070312 L 18.570312 356.070312 Z M 18.570312 18.570312 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"5e650d5bd0"},r.createElement("path",{d:"M 187.496094 18.570312 C 94.199219 18.570312 18.570312 94.199219 18.570312 187.496094 C 18.570312 280.792969 94.199219 356.421875 187.496094 356.421875 C 280.792969 356.421875 356.421875 280.792969 356.421875 187.496094 C 356.421875 94.199219 280.792969 18.570312 187.496094 18.570312 Z M 187.496094 18.570312 ",clipRule:"nonzero"}))),r.createElement("g",{clipPath:"url(#30562604dd)"},r.createElement("rect",{x:-37.5,width:450,fill:"#1d4ed8",y:-37.499999,height:449.999989,fillOpacity:1})),r.createElement("g",{clipPath:"url(#971fcd5f72)"},r.createElement("g",{clipPath:"url(#e891a7f57e)"},r.createElement("path",{fill:"#1d4ed8",d:"M 18.570312 18.570312 L 356.429688 18.570312 L 356.429688 356.429688 L 18.570312 356.429688 Z M 18.570312 18.570312 ",fillOpacity:1,fillRule:"nonzero"}))),r.createElement("g",{clipPath:"url(#19a9ddc130)"},r.createElement("g",{clipPath:"url(#5e650d5bd0)"},r.createElement("path",{strokeLinecap:"butt",transform:"matrix(0.75, 0, 0, 0.75, 18.570291, 18.570286)",fill:"none",strokeLinejoin:"miter",d:"M 225.234419 0.0000349326 C 100.838577 0.0000349326 0.0000289326 100.838583 0.0000289326 225.234425 C 0.0000289326 349.630266 100.838577 450.468815 225.234419 450.468815 C 349.63026 450.468815 450.468809 349.630266 450.468809 225.234425 C 450.468809 100.838583 349.63026 0.0000349326 225.234419 0.0000349326 Z M 225.234419 0.0000349326 ",stroke:"#ffffff",strokeWidth:34,strokeOpacity:1,strokeMiterlimit:4}))),r.createElement("g",{fill:"#ffffff",fillOpacity:1},r.createElement("g",{transform:"translate(136.121787, 300.837436)"},r.createElement("g",null,r.createElement("path",{d:"M 60 -193.78125 C 54.707031 -193.78125 50.109375 -195.734375 46.203125 -199.640625 C 42.296875 -203.554688 40.34375 -208.15625 40.34375 -213.4375 C 40.34375 -218.726562 42.296875 -223.328125 46.203125 -227.234375 C 50.109375 -231.140625 54.707031 -233.09375 60 -233.09375 C 65.28125 -233.09375 69.875 -231.140625 73.78125 -227.234375 C 77.695312 -223.328125 79.65625 -218.726562 79.65625 -213.4375 C 79.65625 -208.15625 77.695312 -203.554688 73.78125 -199.640625 C 69.875 -195.734375 65.28125 -193.78125 60 -193.78125 Z M 45.171875 4.828125 C 39.191406 4.828125 35.28125 2.414062 33.4375 -2.40625 C 31.601562 -7.238281 30.6875 -13.675781 30.6875 -21.71875 C 30.6875 -34.59375 31.773438 -47.234375 33.953125 -59.640625 C 36.140625 -72.054688 38.328125 -83.894531 40.515625 -95.15625 C 42.703125 -106.425781 43.796875 -116.890625 43.796875 -126.546875 C 43.796875 -129.078125 43.675781 -131.832031 43.4375 -134.8125 C 43.207031 -137.800781 42.632812 -140.101562 41.71875 -141.71875 C 38.039062 -139.414062 33.269531 -135.617188 27.40625 -130.328125 C 21.550781 -125.046875 16.898438 -119.1875 13.453125 -112.75 C 11.835938 -114.363281 11.03125 -116.550781 11.03125 -119.3125 C 11.03125 -123.21875 12.582031 -127.46875 15.6875 -132.0625 C 18.789062 -136.65625 22.925781 -141.078125 28.09375 -145.328125 C 33.269531 -149.585938 38.847656 -153.097656 44.828125 -155.859375 C 50.804688 -158.617188 56.664062 -160 62.40625 -160 C 67.695312 -160 71.085938 -158.734375 72.578125 -156.203125 C 74.078125 -153.671875 74.828125 -150.453125 74.828125 -146.546875 C 74.828125 -140.796875 74.078125 -133.378906 72.578125 -124.296875 C 71.085938 -115.222656 69.363281 -105.515625 67.40625 -95.171875 C 65.457031 -84.828125 63.734375 -74.484375 62.234375 -64.140625 C 60.742188 -53.796875 60 -44.367188 60 -35.859375 C 60 -31.492188 60.226562 -27.414062 60.6875 -23.625 C 61.144531 -19.832031 61.71875 -16.671875 62.40625 -14.140625 C 68.15625 -16.671875 73.613281 -20.40625 78.78125 -25.34375 C 83.957031 -30.28125 87.8125 -34.9375 90.34375 -39.3125 C 91.71875 -37.238281 92.40625 -35.050781 92.40625 -32.75 C 92.40625 -29.070312 90.796875 -25.050781 87.578125 -20.6875 C 84.359375 -16.320312 80.332031 -12.179688 75.5 -8.265625 C 70.675781 -4.359375 65.5625 -1.203125 60.15625 1.203125 C 54.757812 3.617188 49.765625 4.828125 45.171875 4.828125 Z M 45.171875 4.828125 "}))))),ht=t=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:500,zoomAndPan:"magnify",viewBox:"0 0 375 374.999991",height:500,preserveAspectRatio:"xMidYMid meet",...t},r.createElement("defs",null,r.createElement("g",null),r.createElement("clipPath",{id:"59a10ac27a"},r.createElement("path",{d:"M 17.179688 32.695312 L 360 32.695312 L 360 337.5 L 17.179688 337.5 Z M 17.179688 32.695312 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"664b27481e"},r.createElement("path",{d:"M 207.042969 43.574219 L 356.394531 304.941406 C 360.242188 311.675781 360.214844 319.953125 356.324219 326.660156 C 352.429688 333.371094 345.257812 337.5 337.5 337.5 L 39.375 337.5 C 31.617188 337.5 24.445312 333.371094 20.554688 326.660156 C 16.660156 319.953125 16.632812 311.675781 20.480469 304.941406 L 169.832031 43.574219 C 173.648438 36.898438 180.746094 32.777344 188.4375 32.777344 C 196.128906 32.777344 203.226562 36.898438 207.042969 43.574219 Z M 207.042969 43.574219 ",clipRule:"nonzero"}))),r.createElement("g",{clipPath:"url(#59a10ac27a)"},r.createElement("g",{clipPath:"url(#664b27481e)"},r.createElement("path",{fill:"#d97706",d:"M 1.875 11.015625 L 375.546875 11.015625 L 375.546875 337.5 L 1.875 337.5 Z M 1.875 11.015625 ",fillOpacity:1,fillRule:"nonzero"}))),r.createElement("g",{fill:"#ffffff",fillOpacity:1},r.createElement("g",{transform:"translate(158.410439, 295.655517)"},r.createElement("g",null,r.createElement("path",{d:"M 46.890625 -63.21875 C 46.890625 -63.21875 46.890625 -64.445312 46.890625 -66.90625 L 46.890625 -176.46875 C 46.890625 -178.925781 46.1875 -180.859375 44.78125 -182.265625 C 43.375 -183.671875 41.441406 -184.375 38.984375 -184.375 L 21.078125 -184.375 C 18.617188 -184.375 16.6875 -183.671875 15.28125 -182.265625 C 13.875 -180.859375 13.171875 -178.925781 13.171875 -176.46875 L 13.171875 -66.90625 C 13.171875 -64.445312 13.875 -62.515625 15.28125 -61.109375 C 16.6875 -59.703125 18.617188 -59 21.078125 -59 L 38.984375 -59 C 41.441406 -59 43.375 -59.703125 44.78125 -61.109375 C 46.1875 -62.515625 46.890625 -63.21875 46.890625 -63.21875 Z M 46.890625 -4.21875 C 46.890625 -4.21875 46.890625 -5.445312 46.890625 -7.90625 L 46.890625 -25.546875 C 46.890625 -28.003906 46.1875 -29.9375 44.78125 -31.34375 C 43.375 -32.75 41.441406 -33.453125 38.984375 -33.453125 L 21.078125 -33.453125 C 18.617188 -33.453125 16.6875 -32.75 15.28125 -31.34375 C 13.875 -29.9375 13.171875 -28.003906 13.171875 -25.546875 L 13.171875 -7.90625 C 13.171875 -5.445312 13.875 -3.515625 15.28125 -2.109375 C 16.6875 -0.703125 18.617188 0 21.078125 0 L 38.984375 0 C 41.441406 0 43.375 -0.703125 44.78125 -2.109375 C 46.1875 -3.515625 46.890625 -4.21875 46.890625 -4.21875 Z M 46.890625 -4.21875 "})))));var Ze={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Be=l.createContext&&l.createContext(Ze),xt=["attr","size","title"];function vt(t,o){if(t==null)return{};var n=bt(t,o),a,i;if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(t);for(i=0;i<f.length;i++)a=f[i],!(o.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(t,a)&&(n[a]=t[a])}return n}function bt(t,o){if(t==null)return{};var n={};for(var a in t)if(Object.prototype.hasOwnProperty.call(t,a)){if(o.indexOf(a)>=0)continue;n[a]=t[a]}return n}function fe(){return fe=Object.assign?Object.assign.bind():function(t){for(var o=1;o<arguments.length;o++){var n=arguments[o];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},fe.apply(this,arguments)}function $e(t,o){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);o&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,a)}return n}function de(t){for(var o=1;o<arguments.length;o++){var n=arguments[o]!=null?arguments[o]:{};o%2?$e(Object(n),!0).forEach(function(a){Et(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$e(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function Et(t,o,n){return o=yt(o),o in t?Object.defineProperty(t,o,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[o]=n,t}function yt(t){var o=Ct(t,"string");return typeof o=="symbol"?o:o+""}function Ct(t,o){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var a=n.call(t,o||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(t)}function qe(t){return t&&t.map((o,n)=>l.createElement(o.tag,de({key:n},o.attr),qe(o.child)))}function Ce(t){return o=>l.createElement(wt,fe({attr:de({},t.attr)},o),qe(t.child))}function wt(t){var o=n=>{var{attr:a,size:i,title:f}=t,d=vt(t,xt),p=i||n.size||"1em",g;return n.className&&(g=n.className),t.className&&(g=(g?g+" ":"")+t.className),l.createElement("svg",fe({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,a,d,{className:g,style:de(de({color:t.color||n.color},n.style),t.style),height:p,width:p,xmlns:"http://www.w3.org/2000/svg"}),f&&l.createElement("title",null,f),t.children)};return Be!==void 0?l.createElement(Be.Consumer,null,n=>o(n)):o(Ze)}function jt(t){return Ce({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)}const Ue=l.createContext(),St=({children:t})=>{const[o,n]=l.useState(!1),[a,i]=l.useState(),[f,d]=l.useState(),_={showAlert:o,setShowAlert:n,typeAlert:a,setTypeAlert:i,messageAlert:f,setMessageAlert:d,alertConfig:{danger:{bgColor:"bg-danger",textColor:"text-danger-text",buttonBg:"bg-danger",hoverBg:"hover:bg-danger-hover",focusRing:"focus:ring-danger-progress",progressColor:"bg-danger-progress"},info:{bgColor:"bg-info",textColor:"text-info-text",buttonBg:"bg-info",hoverBg:"hover:bg-info-hover",focusRing:"focus:ring-info-progress",progressColor:"bg-info-progress"},success:{bgColor:"bg-success",textColor:"text-success-text",buttonBg:"bg-success",hoverBg:"hover:bg-success-hover",focusRing:"focus:ring-success-progress",progressColor:"bg-success-progress"},warning:{bgColor:"bg-warning",textColor:"text-warning-text",buttonBg:"bg-warning",hoverBg:"hover:bg-warning-hover",focusRing:"focus:ring-warning-progress",progressColor:"bg-warning-progress"}},getIcon:O=>{switch(O){case"danger":return s.jsx(pt,{className:"w-[20px] h-[20px]"});case"info":return s.jsx(gt,{className:"w-[20px] h-[20px]"});case"success":return s.jsx(jt,{className:"text-xl"});case"warning":return s.jsx(ht,{className:"w-[20px] h-[20px]"})}},closeAlert:()=>{n(!o)},activeAlert:(O,m)=>{n(!1),setTimeout(()=>{i(O),d(m),n(!0)},50)}};return s.jsx(Ue.Provider,{value:_,children:t})},Q=()=>{const t=l.useContext(Ue);if(t===void 0)throw new Error("Non puoi modificare l'alert");return t};let oe;const me=async(t,o,n)=>{if(oe)return oe;try{const i=await(await fetch("/config.json")).json(),f=i.baseUri,{unauthorized:d,notFound:p,defaultMessage:g}=i.axiosErrors,j=i.axiosTimeout;return oe=Fe.create({baseURL:f,timeout:j}),oe.interceptors.request.use(y=>y),oe.interceptors.response.use(y=>y,y=>{if(y.response)switch(t(!0),o("danger"),y.response.status){case 401:localStorage.removeItem("accessToken"),n(d);break;case 404:n(p);break;default:n(`${g} ${y.response.status} ${y.response.data.error}`)}return Promise.reject(y)}),oe}catch(a){console.error(a)}},He=l.createContext(),Lt=({children:t})=>{const{heartbeatEndpoint:o,firstPrivatePath:n,infiniteSession:a,timeDeducted:i,authenticatedEndpoint:f,autoLogin:d,autoLoginEmail:p,autoLoginPassword:g,setCurrentDate:j}=U(),{setIsLoading:y}=le(),{setShowAlert:_,setMessageAlert:O,setTypeAlert:m,activeAlert:v}=Q(),x=C.useNavigate(),[b,w]=l.useState(null),[S,k]=l.useState(),[L,A]=l.useState(),[D,ee]=l.useState(),[W,H]=l.useState(!1),J=async(R=null,I)=>{R&&R.preventDefault(),H(!0);try{y(!0),_(!1);const M=await(await me(_,m,O)).post(f,{auth:I}),z=M.data.id,te=M.headers.token,B=M.data;te&&(localStorage.setItem("accessToken",te),localStorage.setItem("id",z),localStorage.setItem("user",JSON.stringify(B)),w(!0),k(te),x(`${n}${z}`))}catch(Z){console.error(Z)}finally{H(!1),y(!1)}},Y=()=>{localStorage.removeItem("accessToken"),localStorage.removeItem("id"),localStorage.removeItem("user"),w(!1),k(null)},V=async()=>{try{const R=localStorage.getItem("accessToken"),M=(await(await me(_,m,O)).get(`${o}`,{headers:{Authorization:R}})).headers.token;localStorage.setItem("accessToken",M),k(M),console.log("nuovo token: ",M,"Data:",j())}catch(R){console.error(R),Y()}},G=()=>{if(!S)return;const I=it(S).exp,Z=Math.floor(Date.now()/1e3),M=(I-Z)*1e3;ee(M),A(M-i)};l.useEffect(()=>{if(localStorage.getItem("accessToken"))w(!0);else{w(!1);return}},[]),l.useEffect(()=>{const R=localStorage.getItem("accessToken");d&&!R&&!W&&J(null,{email:p,password:g})},[d,W]),l.useEffect(()=>{G();let R;a&&S&&L&&(R=setInterval(()=>{V()},L));let I;return!a&&S&&D&&(I=setTimeout(()=>{Y(),v("danger","Sessione scaduta")},D)),()=>{R&&clearInterval(R),I&&clearTimeout(I)}},[S,L]),l.useEffect(()=>{b||d&&!W&&J(null,{email:p,password:g})},[b]);const X={isAuthenticated:b,setIsAuthenticated:w,login:J,logout:Y,setCurrentToken:k};return s.jsx(He.Provider,{value:X,children:t})},pe=()=>{const t=l.useContext(He);if(t===void 0)throw new Error("Non sei dentro al Auth Provider");return t},Je=l.createContext(),Ot=({children:t,publicRoutes:o=[],privateRoutes:n=[]})=>s.jsx(Je.Provider,{value:{publicRoutes:o,privateRoutes:n},children:t}),Ve=()=>{const t=l.useContext(Je);if(t===void 0)throw new Error(`Errore: Le rotte non sono state inizializzate correttamente.
53
+ "clearLoginFormOnError": " ,
54
+ "autoLogin": " ,
55
+ "backendToken": "",
56
+ "isDebug": ""
57
+ }`,m=()=>{const d=new Date,v=String(d.getDate()).padStart(2,"0"),x=String(d.getMonth()+1).padStart(2,"0"),O=d.getFullYear(),j=String(d.getHours()).padStart(2,"0"),S=String(d.getMinutes()).padStart(2,"0"),R=String(d.getSeconds()).padStart(2,"0");return`${v}/${x}/${O} ${j}:${S}:${R}`},p=d=>new Promise((v,x)=>{const O=indexedDB.open("configDatabase",1);O.onupgradeneeded=j=>{const S=j.target.result;S.objectStoreNames.contains(d)||S.createObjectStore(d,{keyPath:"id"})},O.onsuccess=j=>v(j.target.result),O.onerror=j=>x(j.target.error)}),h=async(d,v)=>{let x=await p(d);return new Promise((O,j)=>{if(!x){j("Errore: DB non disponibile");return}const S=x==null?void 0:x.transaction(d,"readonly"),R=S==null?void 0:S.objectStore(d),C=R==null?void 0:R.get(v);C.onsuccess=()=>O(C.result),C.onerror=N=>j(N.target.error)})},y=async(d,v)=>{let x=await p(d);return new Promise((O,j)=>{if(!x){j("Errore: DB non disponibile");return}const S=x==null?void 0:x.transaction(d,"readwrite"),R=S==null?void 0:S.objectStore(d),C=R==null?void 0:R.put(v);C.onsuccess=()=>O(C.result),C.onerror=N=>j(N.target.error)})},E=async d=>{let v=Date.now(),x;do x=await h(d,v),x&&v++;while(x);return v},T=async(d,v)=>{v.id||(v.id=await E(d)),await y(d,v)},L=async()=>{try{const x={...await(await fetch("/config.json")).json(),openIndexedDB:p,getDataIndexedDB:h,setDataIndexedDB:y,generateUniqueId:E,setDataWithAutoId:T,setCurrentDate:m};n(x)}catch(d){console.error(d),i(!0)}};return l.useEffect(()=>{L()},[]),Object.keys(o).length===0?s.jsx(We,{errorShow:a,errorMessage:f}):s.jsx(Ye.Provider,{value:o,children:t})},q=()=>{const t=l.useContext(Ye);if(t===void 0)throw new Error("Non puoi leggere i config");return t},pt=t=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:500,zoomAndPan:"magnify",viewBox:"0 0 375 374.999991",height:500,preserveAspectRatio:"xMidYMid meet",...t},r.createElement("defs",null,r.createElement("g",null),r.createElement("clipPath",{id:"6ca7e2bf04"},r.createElement("path",{d:"M 265.136719 0 L 375 109.863281 L 375 265.136719 L 265.136719 375 L 109.863281 375 L 0 265.136719 L 0 109.863281 L 109.863281 0 Z M 265.136719 0 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"2c77c820c6"},r.createElement("path",{d:"M 12.878906 12.878906 L 362.121094 12.878906 L 362.121094 362.121094 L 12.878906 362.121094 Z M 12.878906 12.878906 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"3d94df7d66"},r.createElement("path",{d:"M 259.804688 12.878906 L 362.121094 115.195312 L 362.121094 259.804688 L 259.804688 362.121094 L 115.195312 362.121094 L 12.878906 259.804688 L 12.878906 115.195312 L 115.195312 12.878906 Z M 259.804688 12.878906 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"8793709a64"},r.createElement("path",{d:"M 12.878906 12.878906 L 362.109375 12.878906 L 362.109375 362.109375 L 12.878906 362.109375 Z M 12.878906 12.878906 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"fdb3fe29d8"},r.createElement("path",{d:"M 259.796875 12.878906 L 362.109375 115.191406 L 362.109375 259.796875 L 259.796875 362.109375 L 115.191406 362.109375 L 12.878906 259.796875 L 12.878906 115.191406 L 115.191406 12.878906 Z M 259.796875 12.878906 ",clipRule:"nonzero"}))),r.createElement("g",{clipPath:"url(#6ca7e2bf04)"},r.createElement("rect",{x:-37.5,width:450,fill:"#b91c1c",y:-37.499999,height:449.999989,fillOpacity:1})),r.createElement("g",{clipPath:"url(#2c77c820c6)"},r.createElement("g",{clipPath:"url(#3d94df7d66)"},r.createElement("path",{fill:"#b91c1c",d:"M 12.878906 12.878906 L 362.121094 12.878906 L 362.121094 362.121094 L 12.878906 362.121094 Z M 12.878906 12.878906 ",fillOpacity:1,fillRule:"nonzero"}))),r.createElement("g",{clipPath:"url(#8793709a64)"},r.createElement("g",{clipPath:"url(#fdb3fe29d8)"},r.createElement("path",{strokeLinecap:"butt",transform:"matrix(0.75, 0, 0, 0.75, 12.879396, 12.879392)",fill:"none",strokeLinejoin:"miter",d:"M 329.223327 -0.000647072 L 465.640003 136.416029 L 465.640003 329.223333 L 329.223327 465.640009 L 136.416023 465.640009 L -0.000653072 329.223333 L -0.000653072 136.416029 L 136.416023 -0.000647072 Z M 329.223327 -0.000647072 ",stroke:"#ffffff",strokeWidth:34,strokeOpacity:1,strokeMiterlimit:4}))),r.createElement("g",{fill:"#ffffff",fillOpacity:1},r.createElement("g",{transform:"translate(111.648432, 267.442446)"},r.createElement("g",null,r.createElement("path",{d:"M 2.828125 0 L 56.25 -79.859375 L 3.046875 -159.609375 L 37.28125 -159.609375 L 75.90625 -98.046875 L 114.53125 -159.609375 L 148.765625 -159.609375 L 95.5625 -79.859375 L 148.984375 0 L 114.765625 0 L 75.671875 -60.65625 L 37.046875 0 Z M 2.828125 0 "}))))),gt=t=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:500,zoomAndPan:"magnify",viewBox:"0 0 375 374.999991",height:500,preserveAspectRatio:"xMidYMid meet",...t},r.createElement("defs",null,r.createElement("g",null),r.createElement("clipPath",{id:"30562604dd"},r.createElement("path",{d:"M 187.5 0 C 83.945312 0 0 83.945312 0 187.5 C 0 291.054688 83.945312 375 187.5 375 C 291.054688 375 375 291.054688 375 187.5 C 375 83.945312 291.054688 0 187.5 0 Z M 187.5 0 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"971fcd5f72"},r.createElement("path",{d:"M 18.570312 18.570312 L 356.429688 18.570312 L 356.429688 356.429688 L 18.570312 356.429688 Z M 18.570312 18.570312 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"e891a7f57e"},r.createElement("path",{d:"M 187.5 18.570312 C 94.203125 18.570312 18.570312 94.203125 18.570312 187.5 C 18.570312 280.796875 94.203125 356.429688 187.5 356.429688 C 280.796875 356.429688 356.429688 280.796875 356.429688 187.5 C 356.429688 94.203125 280.796875 18.570312 187.5 18.570312 Z M 187.5 18.570312 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"19a9ddc130"},r.createElement("path",{d:"M 18.570312 18.570312 L 356.070312 18.570312 L 356.070312 356.070312 L 18.570312 356.070312 Z M 18.570312 18.570312 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"5e650d5bd0"},r.createElement("path",{d:"M 187.496094 18.570312 C 94.199219 18.570312 18.570312 94.199219 18.570312 187.496094 C 18.570312 280.792969 94.199219 356.421875 187.496094 356.421875 C 280.792969 356.421875 356.421875 280.792969 356.421875 187.496094 C 356.421875 94.199219 280.792969 18.570312 187.496094 18.570312 Z M 187.496094 18.570312 ",clipRule:"nonzero"}))),r.createElement("g",{clipPath:"url(#30562604dd)"},r.createElement("rect",{x:-37.5,width:450,fill:"#1d4ed8",y:-37.499999,height:449.999989,fillOpacity:1})),r.createElement("g",{clipPath:"url(#971fcd5f72)"},r.createElement("g",{clipPath:"url(#e891a7f57e)"},r.createElement("path",{fill:"#1d4ed8",d:"M 18.570312 18.570312 L 356.429688 18.570312 L 356.429688 356.429688 L 18.570312 356.429688 Z M 18.570312 18.570312 ",fillOpacity:1,fillRule:"nonzero"}))),r.createElement("g",{clipPath:"url(#19a9ddc130)"},r.createElement("g",{clipPath:"url(#5e650d5bd0)"},r.createElement("path",{strokeLinecap:"butt",transform:"matrix(0.75, 0, 0, 0.75, 18.570291, 18.570286)",fill:"none",strokeLinejoin:"miter",d:"M 225.234419 0.0000349326 C 100.838577 0.0000349326 0.0000289326 100.838583 0.0000289326 225.234425 C 0.0000289326 349.630266 100.838577 450.468815 225.234419 450.468815 C 349.63026 450.468815 450.468809 349.630266 450.468809 225.234425 C 450.468809 100.838583 349.63026 0.0000349326 225.234419 0.0000349326 Z M 225.234419 0.0000349326 ",stroke:"#ffffff",strokeWidth:34,strokeOpacity:1,strokeMiterlimit:4}))),r.createElement("g",{fill:"#ffffff",fillOpacity:1},r.createElement("g",{transform:"translate(136.121787, 300.837436)"},r.createElement("g",null,r.createElement("path",{d:"M 60 -193.78125 C 54.707031 -193.78125 50.109375 -195.734375 46.203125 -199.640625 C 42.296875 -203.554688 40.34375 -208.15625 40.34375 -213.4375 C 40.34375 -218.726562 42.296875 -223.328125 46.203125 -227.234375 C 50.109375 -231.140625 54.707031 -233.09375 60 -233.09375 C 65.28125 -233.09375 69.875 -231.140625 73.78125 -227.234375 C 77.695312 -223.328125 79.65625 -218.726562 79.65625 -213.4375 C 79.65625 -208.15625 77.695312 -203.554688 73.78125 -199.640625 C 69.875 -195.734375 65.28125 -193.78125 60 -193.78125 Z M 45.171875 4.828125 C 39.191406 4.828125 35.28125 2.414062 33.4375 -2.40625 C 31.601562 -7.238281 30.6875 -13.675781 30.6875 -21.71875 C 30.6875 -34.59375 31.773438 -47.234375 33.953125 -59.640625 C 36.140625 -72.054688 38.328125 -83.894531 40.515625 -95.15625 C 42.703125 -106.425781 43.796875 -116.890625 43.796875 -126.546875 C 43.796875 -129.078125 43.675781 -131.832031 43.4375 -134.8125 C 43.207031 -137.800781 42.632812 -140.101562 41.71875 -141.71875 C 38.039062 -139.414062 33.269531 -135.617188 27.40625 -130.328125 C 21.550781 -125.046875 16.898438 -119.1875 13.453125 -112.75 C 11.835938 -114.363281 11.03125 -116.550781 11.03125 -119.3125 C 11.03125 -123.21875 12.582031 -127.46875 15.6875 -132.0625 C 18.789062 -136.65625 22.925781 -141.078125 28.09375 -145.328125 C 33.269531 -149.585938 38.847656 -153.097656 44.828125 -155.859375 C 50.804688 -158.617188 56.664062 -160 62.40625 -160 C 67.695312 -160 71.085938 -158.734375 72.578125 -156.203125 C 74.078125 -153.671875 74.828125 -150.453125 74.828125 -146.546875 C 74.828125 -140.796875 74.078125 -133.378906 72.578125 -124.296875 C 71.085938 -115.222656 69.363281 -105.515625 67.40625 -95.171875 C 65.457031 -84.828125 63.734375 -74.484375 62.234375 -64.140625 C 60.742188 -53.796875 60 -44.367188 60 -35.859375 C 60 -31.492188 60.226562 -27.414062 60.6875 -23.625 C 61.144531 -19.832031 61.71875 -16.671875 62.40625 -14.140625 C 68.15625 -16.671875 73.613281 -20.40625 78.78125 -25.34375 C 83.957031 -30.28125 87.8125 -34.9375 90.34375 -39.3125 C 91.71875 -37.238281 92.40625 -35.050781 92.40625 -32.75 C 92.40625 -29.070312 90.796875 -25.050781 87.578125 -20.6875 C 84.359375 -16.320312 80.332031 -12.179688 75.5 -8.265625 C 70.675781 -4.359375 65.5625 -1.203125 60.15625 1.203125 C 54.757812 3.617188 49.765625 4.828125 45.171875 4.828125 Z M 45.171875 4.828125 "}))))),ht=t=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:500,zoomAndPan:"magnify",viewBox:"0 0 375 374.999991",height:500,preserveAspectRatio:"xMidYMid meet",...t},r.createElement("defs",null,r.createElement("g",null),r.createElement("clipPath",{id:"59a10ac27a"},r.createElement("path",{d:"M 17.179688 32.695312 L 360 32.695312 L 360 337.5 L 17.179688 337.5 Z M 17.179688 32.695312 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"664b27481e"},r.createElement("path",{d:"M 207.042969 43.574219 L 356.394531 304.941406 C 360.242188 311.675781 360.214844 319.953125 356.324219 326.660156 C 352.429688 333.371094 345.257812 337.5 337.5 337.5 L 39.375 337.5 C 31.617188 337.5 24.445312 333.371094 20.554688 326.660156 C 16.660156 319.953125 16.632812 311.675781 20.480469 304.941406 L 169.832031 43.574219 C 173.648438 36.898438 180.746094 32.777344 188.4375 32.777344 C 196.128906 32.777344 203.226562 36.898438 207.042969 43.574219 Z M 207.042969 43.574219 ",clipRule:"nonzero"}))),r.createElement("g",{clipPath:"url(#59a10ac27a)"},r.createElement("g",{clipPath:"url(#664b27481e)"},r.createElement("path",{fill:"#d97706",d:"M 1.875 11.015625 L 375.546875 11.015625 L 375.546875 337.5 L 1.875 337.5 Z M 1.875 11.015625 ",fillOpacity:1,fillRule:"nonzero"}))),r.createElement("g",{fill:"#ffffff",fillOpacity:1},r.createElement("g",{transform:"translate(158.410439, 295.655517)"},r.createElement("g",null,r.createElement("path",{d:"M 46.890625 -63.21875 C 46.890625 -63.21875 46.890625 -64.445312 46.890625 -66.90625 L 46.890625 -176.46875 C 46.890625 -178.925781 46.1875 -180.859375 44.78125 -182.265625 C 43.375 -183.671875 41.441406 -184.375 38.984375 -184.375 L 21.078125 -184.375 C 18.617188 -184.375 16.6875 -183.671875 15.28125 -182.265625 C 13.875 -180.859375 13.171875 -178.925781 13.171875 -176.46875 L 13.171875 -66.90625 C 13.171875 -64.445312 13.875 -62.515625 15.28125 -61.109375 C 16.6875 -59.703125 18.617188 -59 21.078125 -59 L 38.984375 -59 C 41.441406 -59 43.375 -59.703125 44.78125 -61.109375 C 46.1875 -62.515625 46.890625 -63.21875 46.890625 -63.21875 Z M 46.890625 -4.21875 C 46.890625 -4.21875 46.890625 -5.445312 46.890625 -7.90625 L 46.890625 -25.546875 C 46.890625 -28.003906 46.1875 -29.9375 44.78125 -31.34375 C 43.375 -32.75 41.441406 -33.453125 38.984375 -33.453125 L 21.078125 -33.453125 C 18.617188 -33.453125 16.6875 -32.75 15.28125 -31.34375 C 13.875 -29.9375 13.171875 -28.003906 13.171875 -25.546875 L 13.171875 -7.90625 C 13.171875 -5.445312 13.875 -3.515625 15.28125 -2.109375 C 16.6875 -0.703125 18.617188 0 21.078125 0 L 38.984375 0 C 41.441406 0 43.375 -0.703125 44.78125 -2.109375 C 46.1875 -3.515625 46.890625 -4.21875 46.890625 -4.21875 Z M 46.890625 -4.21875 "})))));var Ze={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Be=l.createContext&&l.createContext(Ze),xt=["attr","size","title"];function vt(t,o){if(t==null)return{};var n=bt(t,o),a,i;if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(t);for(i=0;i<f.length;i++)a=f[i],!(o.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(t,a)&&(n[a]=t[a])}return n}function bt(t,o){if(t==null)return{};var n={};for(var a in t)if(Object.prototype.hasOwnProperty.call(t,a)){if(o.indexOf(a)>=0)continue;n[a]=t[a]}return n}function fe(){return fe=Object.assign?Object.assign.bind():function(t){for(var o=1;o<arguments.length;o++){var n=arguments[o];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},fe.apply(this,arguments)}function $e(t,o){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);o&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,a)}return n}function de(t){for(var o=1;o<arguments.length;o++){var n=arguments[o]!=null?arguments[o]:{};o%2?$e(Object(n),!0).forEach(function(a){Et(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$e(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function Et(t,o,n){return o=yt(o),o in t?Object.defineProperty(t,o,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[o]=n,t}function yt(t){var o=Ct(t,"string");return typeof o=="symbol"?o:o+""}function Ct(t,o){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var a=n.call(t,o||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(t)}function qe(t){return t&&t.map((o,n)=>l.createElement(o.tag,de({key:n},o.attr),qe(o.child)))}function Ce(t){return o=>l.createElement(wt,fe({attr:de({},t.attr)},o),qe(t.child))}function wt(t){var o=n=>{var{attr:a,size:i,title:f}=t,m=vt(t,xt),p=i||n.size||"1em",h;return n.className&&(h=n.className),t.className&&(h=(h?h+" ":"")+t.className),l.createElement("svg",fe({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,a,m,{className:h,style:de(de({color:t.color||n.color},n.style),t.style),height:p,width:p,xmlns:"http://www.w3.org/2000/svg"}),f&&l.createElement("title",null,f),t.children)};return Be!==void 0?l.createElement(Be.Consumer,null,n=>o(n)):o(Ze)}function jt(t){return Ce({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)}const Ue=l.createContext(),St=({children:t})=>{const[o,n]=l.useState(!1),[a,i]=l.useState(),[f,m]=l.useState(),T={showAlert:o,setShowAlert:n,typeAlert:a,setTypeAlert:i,messageAlert:f,setMessageAlert:m,alertConfig:{danger:{bgColor:"bg-danger",textColor:"text-danger-text",buttonBg:"bg-danger",hoverBg:"hover:bg-danger-hover",focusRing:"focus:ring-danger-progress",progressColor:"bg-danger-progress"},info:{bgColor:"bg-info",textColor:"text-info-text",buttonBg:"bg-info",hoverBg:"hover:bg-info-hover",focusRing:"focus:ring-info-progress",progressColor:"bg-info-progress"},success:{bgColor:"bg-success",textColor:"text-success-text",buttonBg:"bg-success",hoverBg:"hover:bg-success-hover",focusRing:"focus:ring-success-progress",progressColor:"bg-success-progress"},warning:{bgColor:"bg-warning",textColor:"text-warning-text",buttonBg:"bg-warning",hoverBg:"hover:bg-warning-hover",focusRing:"focus:ring-warning-progress",progressColor:"bg-warning-progress"}},getIcon:L=>{switch(L){case"danger":return s.jsx(pt,{className:"w-[20px] h-[20px]"});case"info":return s.jsx(gt,{className:"w-[20px] h-[20px]"});case"success":return s.jsx(jt,{className:"text-xl"});case"warning":return s.jsx(ht,{className:"w-[20px] h-[20px]"})}},closeAlert:()=>{n(!o)},activeAlert:(L,d)=>{n(!1),setTimeout(()=>{i(L),m(d),n(!0)},50)}};return s.jsx(Ue.Provider,{value:T,children:t})},K=()=>{const t=l.useContext(Ue);if(t===void 0)throw new Error("Non puoi modificare l'alert");return t};let re;const He=async(t,o,n)=>{if(re)return re;try{const i=await(await fetch("/config.json")).json(),f=i.baseUri,{unauthorized:m,notFound:p,defaultMessage:h}=i.axiosErrors,y=i.axiosTimeout;return re=Fe.create({baseURL:f,timeout:y}),re.interceptors.request.use(E=>E),re.interceptors.response.use(E=>E,E=>{if(E.response)switch(t(!0),o("danger"),E.response.status){case 401:localStorage.removeItem("accessToken"),n(m);break;case 404:n(p);break;default:n(`${h} ${E.response.status||""} ${E.response.data.error||""}`)}return Promise.reject(E)}),re}catch(a){console.error(a)}},Je=l.createContext(),Lt=({children:t})=>{const{heartbeatEndpoint:o,firstPrivatePath:n,infiniteSession:a,timeDeducted:i,authenticatedEndpoint:f,autoLogin:m,autoLoginEmail:p,autoLoginPassword:h,setCurrentDate:y,isDebug:E,backendToken:T}=q(),{setIsLoading:L}=le(),{setShowAlert:d,setMessageAlert:v,setTypeAlert:x,activeAlert:O}=K(),j=w.useNavigate(),[S,R]=l.useState(null),[C,N]=l.useState(),[B,Q]=l.useState(),[U,ee]=l.useState(),[oe,H]=l.useState(!1),G=async()=>await He(d,x,v),$=async(P=null,I)=>{P&&P.preventDefault(),H(!0);try{L(!0),d(!1);const _=await(await G()).post(f,{auth:I}),V=_.headers.token,Y=_.data;V&&(localStorage.setItem("accessToken",V),localStorage.setItem("user",JSON.stringify(Y)),R(!0),N(V),j(`${n}${Y.id}`))}catch(z){console.error(z)}finally{H(!1),L(!1)}},F=()=>{localStorage.removeItem("accessToken"),localStorage.removeItem("id"),localStorage.removeItem("user"),R(!1),N(null)},J=async()=>{try{const P=localStorage.getItem("accessToken"),_=(await(await G()).get(`${o}`,{headers:{Authorization:P}})).headers.token;localStorage.setItem("accessToken",_),N(_),E&&console.log("nuovo token: ",_,"Data:",y())}catch(P){console.error(P),F()}},pe=()=>{if(!C)return;const I=it(C).exp,z=Math.floor(Date.now()/1e3),_=(I-z)*1e3;ee(_),Q(_-i)},ne=async P=>{try{const _=(await(await G()).get(o,{headers:{Authorization:P}})).data;_&&(localStorage.setItem("user",JSON.stringify(_)),localStorage.setItem("accessToken",P),R(!0),j(`${n}${_.id}`))}catch(I){console.error(I)}};l.useEffect(()=>{if(localStorage.getItem("accessToken"))R(!0);else{R(!1);return}},[]),l.useEffect(()=>{m&&ne(T)},[m]),l.useEffect(()=>{S||m&&!oe&&ne(T)},[S]),l.useEffect(()=>{if(m)return;pe();let P;a&&C&&B&&(P=setInterval(()=>{J()},B));let I;return!a&&C&&U&&(I=setTimeout(()=>{F(),O("danger","Sessione scaduta")},U)),()=>{P&&clearInterval(P),I&&clearTimeout(I)}},[C,B]);const ge={isAuthenticated:S,setIsAuthenticated:R,login:$,logout:F,setCurrentToken:N,createAxiosInstances:G};return s.jsx(Je.Provider,{value:ge,children:t})},me=()=>{const t=l.useContext(Je);if(t===void 0)throw new Error("Non sei dentro al Auth Provider");return t},Ve=l.createContext(),Ot=({children:t,publicRoutes:o=[],privateRoutes:n=[]})=>s.jsx(Ve.Provider,{value:{publicRoutes:o,privateRoutes:n},children:t}),Xe=()=>{const t=l.useContext(Ve);if(t===void 0)throw new Error(`Errore: Le rotte non sono state inizializzate correttamente.
58
58
 
59
59
  Soluzione: Assicurati di avvolgere il tuo componente con <RouteProvider>.
60
60
 
@@ -62,4 +62,4 @@ Esempio:
62
62
 
63
63
  <RouteProvider publicRoutes={[]} privateRoutes={[]}>
64
64
  <MyPackageRoutes />
65
- </RouteProvider>`);return t},Xe=l.createContext(),Pt=({children:t})=>{const{login:o}=pe(),{clearLoginFormOnError:n}=U(),a={email:"",password:""},[i,f]=l.useState("Accedi"),[d,p]=l.useState("Email"),[g,j]=l.useState("email"),[y,_]=l.useState("example@example.it"),[O,m]=l.useState("Accedi"),[v,x]=l.useState(a),[b,w]=l.useState(),[S,k]=l.useState(),[L,A]=l.useState(),[D,ee]=l.useState(),[W,H]=l.useState({}),V={overrideStyle:W,setOverrideStyle:H,title:i,setTitle:f,label:d,setLabel:p,type:g,setType:j,placeholder:y,setPlaceholder:_,buttonText:O,setButtonText:m,formData:v,setFormData:x,LogoImg:b,setLogoImg:w,styleCardForm:S,setStyleCardForm:k,styleContainerLogo:L,setStyleContainerLogo:A,styleLogo:D,setStyleLogo:ee,changeData:(G,X)=>{x(R=>({...R,[G]:X}))},handleLogin:G=>{o(G,v),n&&x(a)}};return s.jsx(Xe.Provider,{value:V,children:t})},we=()=>{const t=l.useContext(Xe);if(t===void 0)throw new Error("Non puoi modificare La login");return t};function Ke(t){return Ce({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)}const Qe=()=>{const{loadingProps:t}=le(),{spinner:o=!0,spinnerStyle:n,text:a,textStyle:i,children:f,containerStyle:d,overrideStyle:p={}}=t;return s.jsxs("div",{className:p.container||`fixed top-0 bottom-0 left-0 right-0 flex items-center justify-center bg-loading-bg z-[999] ${d}`,children:[o&&s.jsx(Ke,{className:p.spinner||`text-[20rem] relative animate-spin text-spinner ${n}`}),f||s.jsx("p",{className:p.text||`text-white text-2xl select-none absolute ${i}`,children:a||"Loading..."})]})};function kt(t){return Ce({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)}const be=()=>{const{messageAlert:t,typeAlert:o,alertConfig:n,getIcon:a,closeAlert:i}=Q(),{alertTimeout:f}=U(),[d,p]=l.useState(0),{bgColor:g,textColor:j,buttonBg:y,hoverBg:_,focusRing:O,progressColor:m}=n[o];return l.useEffect(()=>{let v;const b=100/(f/100);v=setInterval(()=>{p(S=>S>=100?(clearInterval(v),100):S+b)},100);const w=setTimeout(()=>{i()},f);return()=>{clearTimeout(w),clearInterval(v)}},[]),s.jsxs("div",{className:`flex items-center p-4 pt-6 ${j} rounded-lg ${g} mx-auto max-sm:min-w-[280px] sm:max-w-1/3 fixed top-[calc(100vh-100px)] sm:right-10 right-1/2 translate-x-1/2 sm:translate-0 z-100`,role:"alert",children:[s.jsx("div",{className:"w-full bg-gray-200 rounded-t-lg overflow-hidden h-2.5 absolute top-0 left-0 right-0",children:s.jsx("div",{className:`${m} h-2.5 rounded-t-lg`,style:{width:`${d}%`}})}),a(o),s.jsx("div",{className:"px-4 text-sm font-medium",children:t}),s.jsx("button",{type:"button",className:`ms-auto ${y} rounded-lg focus:ring-2 ${O} p-1.5 ${_} inline-flex items-center justify-center h-8 w-8 cursor-pointer`,title:"Close",onClick:i,children:s.jsx(kt,{className:"text-xl"})})]})},et=t=>{const{isLoading:o}=le(),{showAlert:n}=Q(),a=C.useLocation(),{isMain:i=!0,headerComponent:f=null,showHeaderOnLogin:d=!1,headerExcludedRoutes:p=[],footerComponent:g=null,showFooterOnLogin:j=!1,footerExcludedRoutes:y=[]}=t,_=p.some(x=>C.matchPath(x,a.pathname));let O;a.pathname==="/"?O=f&&d:O=f&&!_;const m=y.some(x=>C.matchPath(x,a.pathname));let v;return a.pathname==="/"?v=g&&j:v=g&&!m,s.jsxs(s.Fragment,{children:[o&&s.jsx(Qe,{}),n&&s.jsx(be,{}),O&&f,i?s.jsxs("main",{className:o?"hidden":"",children:[n&&s.jsx(be,{}),s.jsx(C.Outlet,{})]}):s.jsx(C.Outlet,{}),v&&g]})},Ee=t=>{const{inputType:o,inputId:n,inputPlaceholder:a,inputRequired:i,inputValue:f,inputChange:d,autoFocus:p,inputStyle:g,overrideStyle:j,disabled:y}=t,O=["text","email","password","search","tel","url"].includes(o)?o:"text";return s.jsx("input",{type:O,autoFocus:p,id:n,className:j||`bg-input-bg border border-input-border text-input-text text-input-placeholder input-rounded focus:ring focus:ring-primary focus:border-primary focus:outline-none focus:shadow-(--shadow-primary-input) block w-full p-input ${g}`,placeholder:a,required:i??!0,value:f,onChange:d,disabled:y})},ye=({label:t,labelId:o,labelStyle:n,overrideStyle:a})=>s.jsx("label",{htmlFor:o,className:a||`show-label mb-2 text-input-label font-medium text-color-label ${n}`,children:t}),tt=()=>{const{title:t,label:o,type:n,placeholder:a,buttonText:i,formData:f,changeData:d,handleLogin:p,overrideStyle:g}=we();return s.jsxs("form",{onSubmit:p,className:g.form||"form-size",children:[s.jsx("h1",{className:g.title||"text-form-title-size show-title title-position m-form-title",children:t}),s.jsxs("div",{className:g.containerEmail||"flex justify-center flex-col gap-1 m-input-form input-size mx-auto",children:[s.jsx(ye,{labelId:"user-email",label:o}),s.jsx(Ee,{inputType:n,inputId:"user-email",inputPlaceholder:a,inputValue:f.email,inputChange:j=>{d("email",j.target.value)},autoFocus:!0})]}),s.jsxs("div",{className:g.containerPassword||"flex justify-center flex-col gap-1 my-4 input-size mx-auto",children:[s.jsx(ye,{labelId:"password",label:"Password"}),s.jsx(Ee,{inputType:"password",inputId:"password",inputPlaceholder:"Password",inputValue:f.password,inputChange:j=>{d("password",j.target.value)}})]}),s.jsx("div",{className:g.containerButton||"flex button-position items-center m-primary-button",children:s.jsx("button",{className:g.button||"font-bold cursor-pointer shadow-(--shadow-primary) transition-all duration-200 hover:shadow-(--shadow-primary-hover) active:shadow-(--shadow-primary-active) active:translate-y-[2px] p-primary-button rounded-primary-button bg-primary hover:bg-primary-hover text-primary-text",children:i})})]})},rt=({Logo:t})=>{const{styleCardForm:o,styleContainerLogo:n,styleLogo:a,overrideStyle:i}=we(),{firstPrivatePath:f}=U(),d=C.useNavigate();return l.useEffect(()=>{const p=localStorage.getItem("id");localStorage.getItem("accessToken")&&p&&d(`${f}${p}`)},[]),s.jsx("section",{id:"login-page",children:s.jsx("div",{className:i.container||"container mx-auto flex items-center justify-center h-screen",children:s.jsxs("div",{className:i.cardForm||`bg-form card-style card-size flex flex-col sm:flex-row sm:items-center justify-center ${o}`,children:[s.jsx("div",{className:i.containerLogo||`basis-1/2 flex items-center justify-center ${n}`,children:t&&s.jsx(t,{className:i.logo||`login-logo h-full sm:h-auto ${a}`})}),s.jsx(tt,{})]})})})},ot=()=>{const{isAuthenticated:t}=pe(),{activeAlert:o}=Q(),{autoLogin:n}=U();return l.useEffect(()=>{const a=localStorage.getItem("accessToken");!t&&!a&&!n&&o("danger","Non sei autorizzato")},[]),t===null?null:t?s.jsx(C.Outlet,{}):s.jsx(C.Navigate,{to:"/",replace:!0})},nt=()=>{const{id:t}=C.useParams(),{logout:o,setCurrentToken:n}=pe(),{usersEndpoint:a}=U(),{setIsLoading:i}=le(),{setShowAlert:f,setTypeAlert:d,setMessageAlert:p,activeAlert:g}=Q(),[j,y]=l.useState(null),[_,O]=l.useState(!1),m=JSON.parse(localStorage.getItem("user")),v=async()=>{try{O(!0);const b=localStorage.getItem("accessToken");if(!b){o(),g("danger","Sessione Scaduta");return}const k=(await(await me(f,d,p)).get(`${a}`,{headers:{Authorization:b}})).data;y(k)}catch(b){console.error(b),i(!1)}finally{O(!1)}},x=()=>{o(),g("info","Hai effettuato il logout")};return l.useEffect(()=>{const b=localStorage.getItem("accessToken");b&&n(b)},[]),s.jsx("section",{children:s.jsxs("div",{className:"container mx-auto py-8",children:[s.jsxs("div",{className:"flex items-center justify-center gap-8 h-20",children:[s.jsxs("h1",{className:"text-4xl text-center text-slate-800",children:["Email: ",m.email]}),s.jsx("button",{onClick:x,className:"bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded-full cursor-pointer shadow-[0_4px_10px_rgba(239,68,68,0.3),0_2px_4px_rgba(239,68,68,0.2)] hover:shadow-[0_6px_14px_rgba(185,28,28,0.4),0_3px_6px_rgba(185,28,28,0.3)] active:shadow-[0_2px_5px_rgba(239,68,68,0.3)] transition-all duration-200 active:translate-y-[2px]",children:"Logout"})]}),s.jsxs("div",{className:"flex justify-center items-center my-12 gap-8",children:[s.jsx("button",{onClick:v,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 cursor-pointer transition-all duration-200 active:translate-y-[2px] shadow-[0_4px_10px_rgba(59,130,246,0.3),0_2px_4px_rgba(59,130,246,0.2)] hover:shadow-[0_6px_14px_rgba(29,78,216,0.4),0_3px_6px_rgba(29,78,216,0.3)] active:shadow-[0_2px_5px_rgba(59,130,246,0.3)]",disabled:_,children:"Lista degli utenti"}),m.admin&&s.jsx(C.Link,{to:`/about/${t}`,className:"bg-green-500 hover:bg-green-700 text-white font-bold py-2 px-4 rounded-full disabled:bg-green-300 disabled:text-gray-500 disabled:cursor-not-allowed cursor-pointer transition-all duration-200 active:translate-y-[2px] shadow-[0_4px_10px_rgba(59,130,246,0.3),0_2px_4px_rgba(59,130,246,0.2)] hover:shadow-[0_6px_14px_rgba(29,78,216,0.4),0_3px_6px_rgba(29,78,216,0.3)] active:shadow-[0_2px_5px_rgba(59,130,246,0.3)]",children:"About Page"})]}),s.jsx("div",{className:"flex justify-center items-center",children:j&&s.jsx("ul",{children:j.map(b=>s.jsxs("li",{className:"text-xl my-4",children:[b.id," - ",b.email]},`user-${b.id}`))})})]})})},Rt=t=>r.createElement("svg",{width:"108.41262mm",height:"108.41262mm",viewBox:"0 0 108.41262 108.41262",id:"svg1",xmlSpace:"preserve",xmlnsXlink:"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/svg","xmlns:svg":"http://www.w3.org/2000/svg",...t},r.createElement("defs",{id:"defs1"},r.createElement("linearGradient",{id:"linearGradient27"},r.createElement("stop",{style:{stopColor:"#ff0000",stopOpacity:1},offset:0,id:"stop27"}),r.createElement("stop",{style:{stopColor:"#ffca00",stopOpacity:.96862745},offset:1,id:"stop28"})),r.createElement("linearGradient",{xlinkHref:"#linearGradient27",id:"linearGradient28",x1:35.001785,y1:192.35495,x2:143.4144,y2:83.942337,gradientUnits:"userSpaceOnUse"}),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter90",x:-.059506074,y:-.12477839,width:1.1465613,height:1.3073246},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:1,floodColor:"rgb(0,0,0)",id:"feFlood89"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:.9,id:"feGaussianBlur89"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset89"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite89"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite90"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter147",x:-.31473854,y:-.27257434,width:1.6432813,height:1.5822092},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(255,255,255)",id:"feFlood146"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:9.5,id:"feGaussianBlur146"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:3.1,id:"feOffset146"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite146"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite147"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter385",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood384"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur384"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset384"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite384"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite385"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter387",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood385"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur385"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset385"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite386"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite387"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter389",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood387"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur387"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset387"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite388"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite389"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter391",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood389"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur389"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset389"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite390"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite391"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter393",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood391"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur391"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset391"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite392"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite393"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter395",x:0,y:0,width:1.0112203,height:1.010137},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood393"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur393"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset393"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite394"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite395"}))),r.createElement("g",{id:"layer1",transform:"translate(-35.001785,-83.942337)"},r.createElement("rect",{style:{fill:"url(#linearGradient28)",fillOpacity:1,fillRule:"evenodd",stroke:"#ff9b01",strokeWidth:0,strokeOpacity:1,paintOrder:"stroke markers fill"},id:"rect26",width:108.41262,height:108.41262,x:35.001785,y:83.942337,rx:30,ry:30}),r.createElement("g",{id:"g1",transform:"matrix(0.90701349,0,0,0.90701349,9.3696997,14.003172)",style:{strokeWidth:1.10252}},r.createElement("path",{id:"path272",style:{fill:"#000000",strokeWidth:1.10252},d:"m 103.62373,105.0137 c -0.2695,0.002 -0.78905,0.20889 -1.00345,0.40037 -0.0723,0.0646 -0.21317,0.24236 -0.313,0.39478 l -0.18141,0.27703 -0.0181,18.06409 -0.0178,18.06382 h -1.52343 -1.523699 l -2.7e-4,-9.75061 c -5.1e-4,-10.41143 -0.004,-10.51883 -0.34443,-11.94691 -1.39786,-5.8616 -6.2432,-10.12876 -12.21276,-10.75566 -1.515814,-0.1589 -19.83671,-0.16023 -20.462316,-0.003 l -0.0017,-0.004 -19.984159,3.5751 18.852043,2.16035 v 6.07801 l -17.36031,3.10307 17.360304,1.98933 v 6.52314 l -17.360304,3.10307 14.274817,1.63584 -0.01572,4.90514 -0.01864,5.72665 -0.63026,0.1252 c -1.586894,0.3153 -3.197032,1.06826 -4.528475,2.1172 -2.205268,1.73733 -3.741586,4.44584 -4.052716,7.1446 -0.370335,3.21237 0.552005,6.19841 2.657413,8.60144 1.687848,1.92642 4.173186,3.25989 6.695215,3.59241 v -5.2e-4 c 0.823968,0.10864 2.933749,0.0318 3.671522,-0.13399 0.932239,-0.20951 1.790163,-0.51486 2.636639,-0.93819 2.065707,-1.03314 3.823794,-2.77572 4.827084,-4.78447 0.504382,-1.00984 0.910162,-2.2066 1.026636,-3.02875 l 0.04632,-0.32925 h 9.414169 9.413628 v 0.21364 c 0,0.11749 0.0641,0.46829 0.14251,0.77944 0.90405,3.58952 3.50881,6.4605 6.974649,7.68694 1.34306,0.47527 1.94661,0.56832 3.65554,0.56367 1.31935,-0.003 1.6122,-0.0248 2.18192,-0.1577 3.36735,-0.785 6.02631,-2.86016 7.51461,-5.86464 0.44078,-0.88981 0.88236,-2.20383 0.97202,-2.8921 l 0.0429,-0.32925 7.18349,-0.002 c 7.08058,-0.002 7.18734,-0.003 7.49462,-0.14278 0.6474,-0.29351 0.90064,-0.70316 0.90064,-1.45738 0,-0.56862 -0.16856,-0.94445 -0.54982,-1.22508 -0.50606,-0.37245 -0.22593,-0.35988 -7.89979,-0.35988 h -7.11582 l -0.11721,-0.59669 c -0.2611,-1.32878 -0.84786,-2.70966 -1.68167,-3.95762 -0.57002,-0.85316 -2.01938,-2.29531 -2.86466,-2.85108 -1.21392,-0.79816 -2.80463,-1.46394 -3.99997,-1.6734 l -0.5016,-0.0876 -0.0181,-21.17061 -0.0178,-21.17036 -0.15424,-0.31167 c -0.25804,-0.52106 -0.8796,-0.9025 -1.46482,-0.8993 z m 9.34091,0.76079 c -1.96193,0 -3.68713,1.06774 -4.53247,2.80552 -0.53635,1.10262 -0.53017,1.02648 -0.50719,6.44296 l 0.0203,4.7802 0.18834,0.55566 c 0.62086,1.83041 2.22554,3.17608 4.08307,3.42406 0.24153,0.0323 2.71506,0.0532 5.4965,0.0458 5.70515,-0.0145 5.3423,0.0172 6.54658,-0.57378 0.54778,-0.26881 0.75708,-0.42234 1.25039,-0.91741 0.48917,-0.4909 0.64889,-0.70949 0.91635,-1.25279 0.53896,-1.09564 0.53516,-1.04438 0.53516,-6.26129 0,-4.84593 -0.0122,-5.0614 -0.32764,-5.86224 -0.76424,-1.94014 -2.6134,-3.18671 -4.72693,-3.18671 h -0.55701 l -0.003,4.13929 -0.003,4.13902 -1.87799,1.48961 c -1.03267,0.8192 -1.9166,1.51251 -1.96429,1.54074 -0.0554,0.0327 -0.79171,-0.51293 -2.03382,-1.50745 l -1.94697,-1.55885 v -4.12119 -4.12117 z m 2.28928,0.5522 v 3.46322 3.46375 l 1.08417,0.86973 c 0.59637,0.47836 1.10581,0.86085 1.13185,0.85003 0.0261,-0.0108 0.53535,-0.40918 1.13212,-0.88546 l 1.08497,-0.866 -0.0171,-3.42912 -0.0168,-3.42939 -2.19977,-0.0184 z m -47.246903,6.50849 9.196533,0.0248 c 9.138394,0.0246 9.200727,0.0256 9.88912,0.17528 2.276157,0.49507 4.008841,1.42496 5.576421,2.99252 1.56294,1.56292 2.49402,3.26009 3.00157,5.47254 0.15094,0.65777 0.15069,0.6637 0.16943,10.68613 l 0.0189,10.02763 -1.19632,-2.6e-4 -1.19658,-2.6e-4 -2.909674,-2.90889 c -2.148162,-2.14765 -2.999001,-2.95439 -3.251981,-3.08256 l -0.342815,-0.17367 h -9.477299 -9.477299 v -11.60676 z m 44.869453,16.35471 c -0.8458,0 -1.3552,0.0997 -1.97601,0.38599 -1.35181,0.62342 -2.29671,1.66611 -2.77169,3.05885 l -0.18354,0.53889 -0.0203,4.74531 c -0.0228,5.40031 -0.0234,5.39175 0.50346,6.47758 0.5061,1.04314 1.24312,1.77945 2.29621,2.29407 0.34744,0.1698 0.83013,0.35177 1.07325,0.40464 h 5.1e-4 c 0.35322,0.0766 1.47942,0.0968 5.60252,0.10015 5.81748,0.004 5.68307,0.0148 6.74876,-0.50692 1.37728,-0.67421 2.29905,-1.80091 2.67474,-3.26982 0.12915,-0.50539 0.13665,-0.78389 0.13665,-5.22267 0,-4.44771 -0.007,-4.7167 -0.13746,-5.23651 -0.23263,-0.92645 -0.63571,-1.63668 -1.31912,-2.32417 -0.51589,-0.519 -0.69084,-0.64491 -1.31831,-0.94858 -0.81757,-0.39568 -1.26328,-0.49681 -2.19099,-0.49681 h -0.64544 v 4.11159 4.11159 l -1.90888,1.51757 c -1.04987,0.83448 -1.93862,1.52747 -1.97495,1.54022 -0.0363,0.0129 -0.93815,-0.6732 -2.00425,-1.52423 l -1.93845,-1.54714 -2.7e-4,-4.10467 -5.1e-4,-4.10493 z m 2.37718,0.55434 0.004,3.44644 0.004,3.4467 1.05221,0.84416 h 5.1e-4 c 0.57884,0.46404 1.07893,0.84576 1.1116,0.84843 0.0327,0.003 0.55455,-0.39065 1.1601,-0.87373 l 1.10122,-0.87826 v -3.41687 -3.41687 h -2.21709 z m -50.294829,9.49115 h 10.511122 10.511121 l 3.015165,3.00185 c 2.567942,2.55652 3.057622,3.01393 3.300462,3.08282 0.2049,0.0582 1.62307,0.0807 5.03966,0.0807 h 4.754629 v 1.5799 1.57938 l -0.53676,0.0938 c -1.12048,0.19566 -2.647899,0.80928 -3.728799,1.49786 -1.68955,1.07633 -3.11899,2.69978 -3.99411,4.53647 -0.44366,0.93112 -0.88466,2.34132 -0.88466,2.82896 v 0.21524 H 83.533023 74.11886 l -0.04632,-0.32925 c -0.173141,-1.22207 -0.843416,-2.86149 -1.706703,-4.17392 -0.532033,-0.80881 -1.995609,-2.29178 -2.799129,-2.83643 -1.322594,-0.89646 -2.959014,-1.5737 -4.282866,-1.77223 l -0.324987,-0.0488 v -4.66833 z"}),r.createElement("path",{id:"path268",style:{fill:"#ffffff",strokeWidth:1.10252},d:"m 103.6238,103.56164 c -0.26951,0.002 -0.78905,0.20888 -1.00346,0.40036 -0.0723,0.0646 -0.21316,0.24236 -0.313,0.39478 l -0.1814,0.27703 -0.0181,18.06409 -0.0178,18.06382 h -1.52344 -1.523699 l -2.6e-4,-9.7506 c -5.1e-4,-10.41144 -0.004,-10.51884 -0.34443,-11.94692 -1.39786,-5.86159 -6.2432,-10.12876 -12.212765,-10.75566 -1.515813,-0.1589 -19.836715,-0.16022 -20.46231,-0.003 l -0.0017,-0.004 -19.984159,3.5751 18.852043,2.16035 v 6.07801 l -17.36031,3.10307 17.36031,1.98934 v 6.52313 l -17.36031,3.10307 14.274823,1.63584 -0.01572,4.90514 -0.01864,5.72666 -0.630261,0.12519 c -1.586888,0.3153 -3.19702,1.06826 -4.528463,2.1172 -2.205268,1.73733 -3.741592,4.44584 -4.052721,7.1446 -0.370335,3.21237 0.55201,6.19842 2.657412,8.60144 1.687849,1.92642 4.173187,3.25989 6.695216,3.59241 v -5.2e-4 c 0.823962,0.10864 2.933749,0.0318 3.671527,-0.13398 0.932233,-0.20952 1.790157,-0.51486 2.636639,-0.9382 2.065707,-1.03313 3.823794,-2.77572 4.82709,-4.78447 0.504371,-1.00983 0.910151,-2.2066 1.026624,-3.02874 l 0.04632,-0.32925 h 9.414164 9.413621 v 0.21363 c 0,0.11749 0.0641,0.46829 0.14252,0.77944 0.90405,3.58952 3.50882,6.4605 6.974649,7.68695 1.34307,0.47527 1.94662,0.56831 3.65555,0.56366 1.31934,-0.003 1.6122,-0.0248 2.18192,-0.1577 3.36734,-0.785 6.0263,-2.86016 7.51461,-5.86464 0.44078,-0.88981 0.88236,-2.20383 0.97202,-2.89209 l 0.0429,-0.32925 7.18349,-0.002 c 7.08058,-0.002 7.18734,-0.003 7.49463,-0.14278 0.6474,-0.29351 0.90063,-0.70316 0.90063,-1.45737 0,-0.56863 -0.16856,-0.94446 -0.54981,-1.22508 -0.50607,-0.37246 -0.22593,-0.35988 -7.89979,-0.35988 h -7.11583 l -0.11721,-0.5967 c -0.2611,-1.32878 -0.84786,-2.70966 -1.68166,-3.95762 -0.57003,-0.85315 -2.01939,-2.29531 -2.86466,-2.85107 -1.21393,-0.79817 -2.80464,-1.46395 -3.99997,-1.6734 l -0.50159,-0.0876 -0.0181,-21.17061 -0.0179,-21.17036 -0.15424,-0.31166 c -0.25804,-0.52107 -0.8796,-0.90251 -1.46482,-0.8993 z m 9.34091,0.76078 c -1.96194,0 -3.68714,1.06774 -4.53248,2.80552 -0.53635,1.10263 -0.53017,1.02648 -0.50719,6.44296 l 0.0203,4.7802 0.18834,0.55567 c 0.62086,1.8304 2.22555,3.17607 4.08308,3.42406 0.24152,0.0323 2.71505,0.0532 5.4965,0.0458 5.70514,-0.0145 5.34229,0.0172 6.54658,-0.57378 0.54778,-0.2688 0.75707,-0.42233 1.25039,-0.91741 0.48917,-0.4909 0.64889,-0.70948 0.91635,-1.25279 0.53896,-1.09564 0.53516,-1.04438 0.53516,-6.26128 0,-4.84594 -0.0122,-5.06141 -0.32765,-5.86225 -0.76423,-1.94014 -2.6134,-3.18671 -4.72692,-3.18671 h -0.55701 l -0.003,4.13929 -0.003,4.13902 -1.87798,1.48961 c -1.03268,0.8192 -1.9166,1.51252 -1.96429,1.54074 -0.0554,0.0327 -0.79171,-0.51293 -2.03382,-1.50745 l -1.94698,-1.55886 v -4.12117 -4.12118 z m 2.28927,0.55221 v 3.46321 3.46375 l 1.08417,0.86974 c 0.59637,0.47835 1.10582,0.86085 1.13185,0.85002 0.0261,-0.0108 0.53535,-0.40918 1.13213,-0.88545 l 1.08496,-0.86601 -0.0171,-3.42912 -0.0168,-3.42939 -2.19978,-0.0184 z m -47.246901,6.50848 9.196533,0.0248 c 9.138394,0.0247 9.200727,0.0256 9.889125,0.17528 2.276152,0.49507 4.008834,1.42496 5.576414,2.99253 1.56294,1.56292 2.49402,3.26009 3.00158,5.47253 0.15094,0.65777 0.15069,0.6637 0.16942,10.68613 l 0.0189,10.02764 -1.19632,-2.7e-4 -1.19658,-2.6e-4 -2.909672,-2.90888 c -2.148163,-2.14765 -2.999001,-2.9544 -3.251981,-3.08256 l -0.342835,-0.17368 H 77.484375 68.00707 v -11.60675 z m 44.869461,16.35472 c -0.84581,0 -1.35521,0.0997 -1.97602,0.38599 -1.35181,0.62342 -2.29671,1.6661 -2.77169,3.05885 l -0.18354,0.53888 -0.0203,4.74531 c -0.0229,5.40032 -0.0234,5.39175 0.50346,6.47758 0.50611,1.04314 1.24312,1.77945 2.29621,2.29408 0.34744,0.1698 0.83013,0.35177 1.07325,0.40463 h 5.1e-4 c 0.35322,0.0766 1.47942,0.0968 5.60252,0.10015 5.81748,0.005 5.68308,0.0148 6.74876,-0.50692 1.37729,-0.67421 2.29905,-1.8009 2.67474,-3.26982 0.12916,-0.50539 0.13665,-0.78389 0.13665,-5.22266 0,-4.44771 -0.007,-4.7167 -0.13745,-5.23652 -0.23264,-0.92645 -0.63572,-1.63668 -1.31912,-2.32417 -0.5159,-0.519 -0.69084,-0.64491 -1.31832,-0.94858 -0.81757,-0.39568 -1.26328,-0.4968 -2.19098,-0.4968 h -0.64545 v 4.11159 4.11159 l -1.90888,1.51756 c -1.04987,0.83448 -1.93862,1.52747 -1.97495,1.54022 -0.0363,0.0129 -0.93815,-0.6732 -2.00425,-1.52423 l -1.93845,-1.54714 -2.6e-4,-4.10466 -5.2e-4,-4.10493 z m 2.37718,0.55434 0.004,3.44643 0.004,3.4467 1.0522,0.84416 h 5.2e-4 c 0.57883,0.46405 1.07893,0.84577 1.1116,0.84843 0.0327,0.003 0.55454,-0.39065 1.16009,-0.87374 l 1.10122,-0.87825 v -3.41686 -3.41687 h -2.21709 z m -50.294837,9.49114 H 75.47001 85.981126 l 3.015165,3.00185 c 2.56794,2.55652 3.05762,3.01393 3.30046,3.08283 0.20491,0.0582 1.62308,0.0807 5.03966,0.0807 h 4.754639 v 1.5799 1.57938 l -0.53676,0.0938 c -1.12049,0.19566 -2.647909,0.80928 -3.728809,1.49786 -1.68955,1.07634 -3.11898,2.69979 -3.99411,4.53647 -0.44366,0.93112 -0.88465,2.34132 -0.88465,2.82897 v 0.21523 h -9.413636 -9.414164 l -0.04632,-0.32925 c -0.173136,-1.22207 -0.843417,-2.86149 -1.706697,-4.17392 -0.53204,-0.80881 -1.995616,-2.29178 -2.799129,-2.83642 -1.322601,-0.89647 -2.959015,-1.57371 -4.282873,-1.77224 l -0.324986,-0.0487 v -4.66833 z"})),r.createElement("path",{style:{fill:"#ffffff",fillOpacity:1,fillRule:"evenodd",stroke:"#ff9b01",strokeWidth:0,strokeOpacity:1,paintOrder:"stroke markers fill"},d:"",id:"path40",transform:"scale(0.26458333)"}))),_t=t=>{const{publicRoutes:o,privateRoutes:n}=Ve(),{firstPrivatePath:a}=U(),{logoImg:i=Rt,pathImg:f="./src/assets/MyWarehouse.svg",firstPrivateElement:d=s.jsx(nt,{}),globalLayout:p,isMain:g,headerComponent:j,showHeaderOnLogin:y,headerExcludedRoutes:_,footerComponent:O,showFooterOnLogin:m,footerExcludedRoutes:v,privateProvider:x,customProvider:b}=t,w=p||s.jsx(et,{isMain:g,headerComponent:j,showHeaderOnLogin:y,headerExcludedRoutes:_,footerComponent:O,showFooterOnLogin:m,footerExcludedRoutes:v}),S=x?l.cloneElement(x,{},b):s.jsx(ot,{children:b}),k=()=>{const L=document.querySelector("link[rel='icon']");f&&(L.href=f)};return l.useEffect(()=>{k()},[]),s.jsx(C.Routes,{children:s.jsxs(C.Route,{element:p==="none"?null:w,children:[s.jsxs(C.Route,{path:"/",children:[s.jsx(C.Route,{index:!0,element:s.jsx(rt,{Logo:i})}),o.map((L,A)=>s.jsx(C.Route,{path:L.path,element:L.element},`public-${A}`))]}),s.jsxs(C.Route,{element:S,children:[s.jsx(C.Route,{path:`${a??"/dashboard/"}:id`,element:d}),n.map((L,A)=>s.jsx(C.Route,{path:L.path,element:L.element},`private-${A}`))]})]})})},Tt=({children:t})=>{var i;const o=C.useLocation(),{activeAlert:n}=Q(),a=JSON.parse(localStorage.getItem("user"));return l.useEffect(()=>{(!a||!a.admin)&&n("warning","Non puoi accedere a questa pagina")},[a]),!a||!a.admin?s.jsx(C.Navigate,{to:((i=o.state)==null?void 0:i.from)||"/",replace:!0}):t},Nt=({spinner:t=!0,spinnerStyle:o,text:n,textStyle:a,children:i,containerStyle:f,overrideStyle:d={}})=>s.jsxs("div",{className:d.container||`w-full h-full relative flex items-center justify-center ${f}`,children:[t&&s.jsx(Ke,{className:d.spinner||`text-[20rem] animate-spin text-black ${o}`}),i||s.jsx("p",{className:d.text||`text-black text-2xl select-none absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 ${a}`,children:n||"Loading..."})]});Object.defineProperty(exports,"BrowserRouter",{enumerable:!0,get:()=>C.BrowserRouter});Object.defineProperty(exports,"Link",{enumerable:!0,get:()=>C.Link});Object.defineProperty(exports,"NavLink",{enumerable:!0,get:()=>C.NavLink});Object.defineProperty(exports,"Outlet",{enumerable:!0,get:()=>C.Outlet});Object.defineProperty(exports,"Route",{enumerable:!0,get:()=>C.Route});Object.defineProperty(exports,"Routes",{enumerable:!0,get:()=>C.Routes});Object.defineProperty(exports,"useLocation",{enumerable:!0,get:()=>C.useLocation});Object.defineProperty(exports,"useMatch",{enumerable:!0,get:()=>C.useMatch});Object.defineProperty(exports,"useNavigate",{enumerable:!0,get:()=>C.useNavigate});exports.axios=Fe;exports.Alert=be;exports.AlertProvider=St;exports.AuthAdmin=Tt;exports.AuthPage=ot;exports.AuthProvider=Lt;exports.ConfigProvider=mt;exports.Dashboard=nt;exports.DefaultLayout=et;exports.ErrorPage=We;exports.Input=Ee;exports.InputLabel=ye;exports.Loading=Qe;exports.LoadingComponent=Nt;exports.LoadingProvider=dt;exports.Login=rt;exports.LoginForm=tt;exports.LoginFormProvider=Pt;exports.PackageRoutes=_t;exports.RouteProvider=Ot;exports.fetchAxiosConfig=me;exports.useAlert=Q;exports.useAuth=pe;exports.useConfig=U;exports.useLoading=le;exports.useLoginForm=we;exports.useRoutesInjection=Ve;
65
+ </RouteProvider>`);return t},Ke=l.createContext(),Pt=({children:t})=>{const{login:o}=me(),{clearLoginFormOnError:n}=q(),a={email:"",password:""},[i,f]=l.useState("Accedi"),[m,p]=l.useState("Email"),[h,y]=l.useState("email"),[E,T]=l.useState("example@example.it"),[L,d]=l.useState("Accedi"),[v,x]=l.useState(a),[O,j]=l.useState(),[S,R]=l.useState(),[C,N]=l.useState(),[B,Q]=l.useState(),[U,ee]=l.useState({}),G={overrideStyle:U,setOverrideStyle:ee,title:i,setTitle:f,label:m,setLabel:p,type:h,setType:y,placeholder:E,setPlaceholder:T,buttonText:L,setButtonText:d,formData:v,setFormData:x,LogoImg:O,setLogoImg:j,styleCardForm:S,setStyleCardForm:R,styleContainerLogo:C,setStyleContainerLogo:N,styleLogo:B,setStyleLogo:Q,changeData:($,F)=>{x(J=>({...J,[$]:F}))},handleLogin:$=>{o($,v),n&&x(a)}};return s.jsx(Ke.Provider,{value:G,children:t})},we=()=>{const t=l.useContext(Ke);if(t===void 0)throw new Error("Non puoi modificare La login");return t};function Qe(t){return Ce({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)}const et=()=>{const{loadingProps:t}=le(),{spinner:o=!0,spinnerStyle:n,text:a,textStyle:i,children:f,containerStyle:m,overrideStyle:p={}}=t;return s.jsxs("div",{className:p.container||`fixed top-0 bottom-0 left-0 right-0 flex items-center justify-center bg-loading-bg z-[999] ${m}`,children:[o&&s.jsx(Qe,{className:p.spinner||`text-[20rem] relative animate-spin text-spinner ${n}`}),f||s.jsx("p",{className:p.text||`text-white text-2xl select-none absolute ${i}`,children:a||"Loading..."})]})};function kt(t){return Ce({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)}const be=()=>{const{messageAlert:t,typeAlert:o,alertConfig:n,getIcon:a,closeAlert:i}=K(),{alertTimeout:f}=q(),[m,p]=l.useState(0),{bgColor:h,textColor:y,buttonBg:E,hoverBg:T,focusRing:L,progressColor:d}=n[o];return l.useEffect(()=>{let v;const O=100/(f/100);v=setInterval(()=>{p(S=>S>=100?(clearInterval(v),100):S+O)},100);const j=setTimeout(()=>{i()},f);return()=>{clearTimeout(j),clearInterval(v)}},[]),s.jsxs("div",{className:`flex items-center p-4 pt-6 ${y} rounded-lg ${h} mx-auto max-sm:min-w-[280px] sm:max-w-1/3 fixed top-[calc(100vh-100px)] sm:right-10 right-1/2 translate-x-1/2 sm:translate-0 z-100`,role:"alert",children:[s.jsx("div",{className:"w-full bg-gray-200 rounded-t-lg overflow-hidden h-2.5 absolute top-0 left-0 right-0",children:s.jsx("div",{className:`${d} h-2.5 rounded-t-lg`,style:{width:`${m}%`}})}),a(o),s.jsx("div",{className:"px-4 text-sm font-medium",children:t}),s.jsx("button",{type:"button",className:`ms-auto ${E} rounded-lg focus:ring-2 ${L} p-1.5 ${T} inline-flex items-center justify-center h-8 w-8 cursor-pointer`,title:"Close",onClick:i,children:s.jsx(kt,{className:"text-xl"})})]})},tt=t=>{const{isLoading:o}=le(),{showAlert:n}=K(),a=w.useLocation(),{isMain:i=!0,headerComponent:f=null,showHeaderOnLogin:m=!1,headerExcludedRoutes:p=[],footerComponent:h=null,showFooterOnLogin:y=!1,footerExcludedRoutes:E=[]}=t,T=p.some(x=>w.matchPath(x,a.pathname));let L;a.pathname==="/"?L=f&&m:L=f&&!T;const d=E.some(x=>w.matchPath(x,a.pathname));let v;return a.pathname==="/"?v=h&&y:v=h&&!d,s.jsxs(s.Fragment,{children:[o&&s.jsx(et,{}),n&&s.jsx(be,{}),L&&f,i?s.jsxs("main",{className:o?"hidden":"",children:[n&&s.jsx(be,{}),s.jsx(w.Outlet,{})]}):s.jsx(w.Outlet,{}),v&&h]})},Ee=t=>{const{inputType:o,inputId:n,inputPlaceholder:a,inputRequired:i,inputValue:f,inputChange:m,autoFocus:p,inputStyle:h,overrideStyle:y,disabled:E}=t,L=["text","email","password","search","tel","url"].includes(o)?o:"text";return s.jsx("input",{type:L,autoFocus:p,id:n,className:y||`bg-input-bg border border-input-border text-input-text text-input-placeholder input-rounded focus:ring focus:ring-primary focus:border-primary focus:outline-none focus:shadow-(--shadow-primary-input) block w-full p-input ${h}`,placeholder:a,required:i??!0,value:f,onChange:m,disabled:E})},ye=({label:t,labelId:o,labelStyle:n,overrideStyle:a})=>s.jsx("label",{htmlFor:o,className:a||`show-label mb-2 text-input-label font-medium text-color-label ${n}`,children:t}),rt=()=>{const{title:t,label:o,type:n,placeholder:a,buttonText:i,formData:f,changeData:m,handleLogin:p,overrideStyle:h}=we();return s.jsxs("form",{onSubmit:p,className:h.form||"form-size",children:[s.jsx("h1",{className:h.title||"text-form-title-size show-title title-position m-form-title",children:t}),s.jsxs("div",{className:h.containerEmail||"flex justify-center flex-col gap-1 m-input-form input-size mx-auto",children:[s.jsx(ye,{labelId:"user-email",label:o}),s.jsx(Ee,{inputType:n,inputId:"user-email",inputPlaceholder:a,inputValue:f.email,inputChange:y=>{m("email",y.target.value)},autoFocus:!0})]}),s.jsxs("div",{className:h.containerPassword||"flex justify-center flex-col gap-1 my-4 input-size mx-auto",children:[s.jsx(ye,{labelId:"password",label:"Password"}),s.jsx(Ee,{inputType:"password",inputId:"password",inputPlaceholder:"Password",inputValue:f.password,inputChange:y=>{m("password",y.target.value)}})]}),s.jsx("div",{className:h.containerButton||"flex button-position items-center m-primary-button",children:s.jsx("button",{className:h.button||"font-bold cursor-pointer shadow-(--shadow-primary) transition-all duration-200 hover:shadow-(--shadow-primary-hover) active:shadow-(--shadow-primary-active) active:translate-y-[2px] p-primary-button rounded-primary-button bg-primary hover:bg-primary-hover text-primary-text",children:i})})]})},ot=({Logo:t})=>{const{styleCardForm:o,styleContainerLogo:n,styleLogo:a,overrideStyle:i}=we(),{firstPrivatePath:f}=q(),m=w.useNavigate();return l.useEffect(()=>{const p=JSON.parse(localStorage.getItem("user"));localStorage.getItem("accessToken")&&p.id&&m(`${f}${p.id}`)},[]),s.jsx("section",{id:"login-page",children:s.jsx("div",{className:i.container||"container mx-auto flex items-center justify-center h-screen",children:s.jsxs("div",{className:i.cardForm||`bg-form card-style card-size flex flex-col sm:flex-row sm:items-center justify-center ${o}`,children:[s.jsx("div",{className:i.containerLogo||`basis-1/2 flex items-center justify-center ${n}`,children:t&&s.jsx(t,{className:i.logo||`login-logo h-full sm:h-auto ${a}`})}),s.jsx(rt,{})]})})})},nt=()=>{const{isAuthenticated:t}=me(),{activeAlert:o}=K(),{autoLogin:n}=q();return l.useEffect(()=>{const a=localStorage.getItem("accessToken");!t&&!a&&!n&&o("danger","Non sei autorizzato")},[]),t===null?null:t?s.jsx(w.Outlet,{}):s.jsx(w.Navigate,{to:"/",replace:!0})},at=()=>{const{logout:t,setCurrentToken:o,createAxiosInstances:n}=me(),{usersEndpoint:a}=q(),{setIsLoading:i}=le(),{activeAlert:f}=K(),[m,p]=l.useState(null),[h,y]=l.useState(!1),E=JSON.parse(localStorage.getItem("user")),T=async()=>{try{y(!0);const d=localStorage.getItem("accessToken");if(!d){t(),f("danger","Sessione Scaduta");return}const O=(await(await n()).get(`${a}`,{headers:{Authorization:`Bearer ${d}`}})).data;p(O)}catch(d){console.error(d),i(!1)}finally{y(!1)}},L=()=>{t(),f("info","Hai effettuato il logout")};return l.useEffect(()=>{const d=localStorage.getItem("accessToken");d&&o(d)},[]),s.jsx("section",{children:s.jsxs("div",{className:"container mx-auto py-8",children:[s.jsxs("div",{className:"flex items-center justify-center gap-8 h-20",children:[s.jsxs("h1",{className:"text-4xl text-center text-slate-800",children:["Email: ",E.email]}),s.jsx("button",{onClick:L,className:"bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded-full cursor-pointer shadow-[0_4px_10px_rgba(239,68,68,0.3),0_2px_4px_rgba(239,68,68,0.2)] hover:shadow-[0_6px_14px_rgba(185,28,28,0.4),0_3px_6px_rgba(185,28,28,0.3)] active:shadow-[0_2px_5px_rgba(239,68,68,0.3)] transition-all duration-200 active:translate-y-[2px]",children:"Logout"})]}),s.jsx("div",{className:"flex justify-center items-center my-12 gap-8",children:s.jsx("button",{onClick:T,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 cursor-pointer transition-all duration-200 active:translate-y-[2px] shadow-[0_4px_10px_rgba(59,130,246,0.3),0_2px_4px_rgba(59,130,246,0.2)] hover:shadow-[0_6px_14px_rgba(29,78,216,0.4),0_3px_6px_rgba(29,78,216,0.3)] active:shadow-[0_2px_5px_rgba(59,130,246,0.3)]",disabled:h,children:"Lista degli utenti"})}),s.jsx("div",{className:"flex justify-center items-center",children:m&&s.jsx("ul",{children:m.map(d=>s.jsxs("li",{className:"text-xl my-4",children:[d.id," - ",d.email]},`user-${d.id}`))})})]})})},Rt=t=>r.createElement("svg",{width:"108.41262mm",height:"108.41262mm",viewBox:"0 0 108.41262 108.41262",id:"svg1",xmlSpace:"preserve",xmlnsXlink:"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/svg","xmlns:svg":"http://www.w3.org/2000/svg",...t},r.createElement("defs",{id:"defs1"},r.createElement("linearGradient",{id:"linearGradient27"},r.createElement("stop",{style:{stopColor:"#ff0000",stopOpacity:1},offset:0,id:"stop27"}),r.createElement("stop",{style:{stopColor:"#ffca00",stopOpacity:.96862745},offset:1,id:"stop28"})),r.createElement("linearGradient",{xlinkHref:"#linearGradient27",id:"linearGradient28",x1:35.001785,y1:192.35495,x2:143.4144,y2:83.942337,gradientUnits:"userSpaceOnUse"}),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter90",x:-.059506074,y:-.12477839,width:1.1465613,height:1.3073246},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:1,floodColor:"rgb(0,0,0)",id:"feFlood89"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:.9,id:"feGaussianBlur89"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset89"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite89"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite90"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter147",x:-.31473854,y:-.27257434,width:1.6432813,height:1.5822092},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(255,255,255)",id:"feFlood146"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:9.5,id:"feGaussianBlur146"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:3.1,id:"feOffset146"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite146"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite147"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter385",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood384"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur384"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset384"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite384"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite385"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter387",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood385"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur385"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset385"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite386"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite387"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter389",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood387"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur387"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset387"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite388"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite389"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter391",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood389"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur389"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset389"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite390"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite391"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter393",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood391"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur391"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset391"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite392"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite393"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter395",x:0,y:0,width:1.0112203,height:1.010137},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood393"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur393"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset393"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite394"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite395"}))),r.createElement("g",{id:"layer1",transform:"translate(-35.001785,-83.942337)"},r.createElement("rect",{style:{fill:"url(#linearGradient28)",fillOpacity:1,fillRule:"evenodd",stroke:"#ff9b01",strokeWidth:0,strokeOpacity:1,paintOrder:"stroke markers fill"},id:"rect26",width:108.41262,height:108.41262,x:35.001785,y:83.942337,rx:30,ry:30}),r.createElement("g",{id:"g1",transform:"matrix(0.90701349,0,0,0.90701349,9.3696997,14.003172)",style:{strokeWidth:1.10252}},r.createElement("path",{id:"path272",style:{fill:"#000000",strokeWidth:1.10252},d:"m 103.62373,105.0137 c -0.2695,0.002 -0.78905,0.20889 -1.00345,0.40037 -0.0723,0.0646 -0.21317,0.24236 -0.313,0.39478 l -0.18141,0.27703 -0.0181,18.06409 -0.0178,18.06382 h -1.52343 -1.523699 l -2.7e-4,-9.75061 c -5.1e-4,-10.41143 -0.004,-10.51883 -0.34443,-11.94691 -1.39786,-5.8616 -6.2432,-10.12876 -12.21276,-10.75566 -1.515814,-0.1589 -19.83671,-0.16023 -20.462316,-0.003 l -0.0017,-0.004 -19.984159,3.5751 18.852043,2.16035 v 6.07801 l -17.36031,3.10307 17.360304,1.98933 v 6.52314 l -17.360304,3.10307 14.274817,1.63584 -0.01572,4.90514 -0.01864,5.72665 -0.63026,0.1252 c -1.586894,0.3153 -3.197032,1.06826 -4.528475,2.1172 -2.205268,1.73733 -3.741586,4.44584 -4.052716,7.1446 -0.370335,3.21237 0.552005,6.19841 2.657413,8.60144 1.687848,1.92642 4.173186,3.25989 6.695215,3.59241 v -5.2e-4 c 0.823968,0.10864 2.933749,0.0318 3.671522,-0.13399 0.932239,-0.20951 1.790163,-0.51486 2.636639,-0.93819 2.065707,-1.03314 3.823794,-2.77572 4.827084,-4.78447 0.504382,-1.00984 0.910162,-2.2066 1.026636,-3.02875 l 0.04632,-0.32925 h 9.414169 9.413628 v 0.21364 c 0,0.11749 0.0641,0.46829 0.14251,0.77944 0.90405,3.58952 3.50881,6.4605 6.974649,7.68694 1.34306,0.47527 1.94661,0.56832 3.65554,0.56367 1.31935,-0.003 1.6122,-0.0248 2.18192,-0.1577 3.36735,-0.785 6.02631,-2.86016 7.51461,-5.86464 0.44078,-0.88981 0.88236,-2.20383 0.97202,-2.8921 l 0.0429,-0.32925 7.18349,-0.002 c 7.08058,-0.002 7.18734,-0.003 7.49462,-0.14278 0.6474,-0.29351 0.90064,-0.70316 0.90064,-1.45738 0,-0.56862 -0.16856,-0.94445 -0.54982,-1.22508 -0.50606,-0.37245 -0.22593,-0.35988 -7.89979,-0.35988 h -7.11582 l -0.11721,-0.59669 c -0.2611,-1.32878 -0.84786,-2.70966 -1.68167,-3.95762 -0.57002,-0.85316 -2.01938,-2.29531 -2.86466,-2.85108 -1.21392,-0.79816 -2.80463,-1.46394 -3.99997,-1.6734 l -0.5016,-0.0876 -0.0181,-21.17061 -0.0178,-21.17036 -0.15424,-0.31167 c -0.25804,-0.52106 -0.8796,-0.9025 -1.46482,-0.8993 z m 9.34091,0.76079 c -1.96193,0 -3.68713,1.06774 -4.53247,2.80552 -0.53635,1.10262 -0.53017,1.02648 -0.50719,6.44296 l 0.0203,4.7802 0.18834,0.55566 c 0.62086,1.83041 2.22554,3.17608 4.08307,3.42406 0.24153,0.0323 2.71506,0.0532 5.4965,0.0458 5.70515,-0.0145 5.3423,0.0172 6.54658,-0.57378 0.54778,-0.26881 0.75708,-0.42234 1.25039,-0.91741 0.48917,-0.4909 0.64889,-0.70949 0.91635,-1.25279 0.53896,-1.09564 0.53516,-1.04438 0.53516,-6.26129 0,-4.84593 -0.0122,-5.0614 -0.32764,-5.86224 -0.76424,-1.94014 -2.6134,-3.18671 -4.72693,-3.18671 h -0.55701 l -0.003,4.13929 -0.003,4.13902 -1.87799,1.48961 c -1.03267,0.8192 -1.9166,1.51251 -1.96429,1.54074 -0.0554,0.0327 -0.79171,-0.51293 -2.03382,-1.50745 l -1.94697,-1.55885 v -4.12119 -4.12117 z m 2.28928,0.5522 v 3.46322 3.46375 l 1.08417,0.86973 c 0.59637,0.47836 1.10581,0.86085 1.13185,0.85003 0.0261,-0.0108 0.53535,-0.40918 1.13212,-0.88546 l 1.08497,-0.866 -0.0171,-3.42912 -0.0168,-3.42939 -2.19977,-0.0184 z m -47.246903,6.50849 9.196533,0.0248 c 9.138394,0.0246 9.200727,0.0256 9.88912,0.17528 2.276157,0.49507 4.008841,1.42496 5.576421,2.99252 1.56294,1.56292 2.49402,3.26009 3.00157,5.47254 0.15094,0.65777 0.15069,0.6637 0.16943,10.68613 l 0.0189,10.02763 -1.19632,-2.6e-4 -1.19658,-2.6e-4 -2.909674,-2.90889 c -2.148162,-2.14765 -2.999001,-2.95439 -3.251981,-3.08256 l -0.342815,-0.17367 h -9.477299 -9.477299 v -11.60676 z m 44.869453,16.35471 c -0.8458,0 -1.3552,0.0997 -1.97601,0.38599 -1.35181,0.62342 -2.29671,1.66611 -2.77169,3.05885 l -0.18354,0.53889 -0.0203,4.74531 c -0.0228,5.40031 -0.0234,5.39175 0.50346,6.47758 0.5061,1.04314 1.24312,1.77945 2.29621,2.29407 0.34744,0.1698 0.83013,0.35177 1.07325,0.40464 h 5.1e-4 c 0.35322,0.0766 1.47942,0.0968 5.60252,0.10015 5.81748,0.004 5.68307,0.0148 6.74876,-0.50692 1.37728,-0.67421 2.29905,-1.80091 2.67474,-3.26982 0.12915,-0.50539 0.13665,-0.78389 0.13665,-5.22267 0,-4.44771 -0.007,-4.7167 -0.13746,-5.23651 -0.23263,-0.92645 -0.63571,-1.63668 -1.31912,-2.32417 -0.51589,-0.519 -0.69084,-0.64491 -1.31831,-0.94858 -0.81757,-0.39568 -1.26328,-0.49681 -2.19099,-0.49681 h -0.64544 v 4.11159 4.11159 l -1.90888,1.51757 c -1.04987,0.83448 -1.93862,1.52747 -1.97495,1.54022 -0.0363,0.0129 -0.93815,-0.6732 -2.00425,-1.52423 l -1.93845,-1.54714 -2.7e-4,-4.10467 -5.1e-4,-4.10493 z m 2.37718,0.55434 0.004,3.44644 0.004,3.4467 1.05221,0.84416 h 5.1e-4 c 0.57884,0.46404 1.07893,0.84576 1.1116,0.84843 0.0327,0.003 0.55455,-0.39065 1.1601,-0.87373 l 1.10122,-0.87826 v -3.41687 -3.41687 h -2.21709 z m -50.294829,9.49115 h 10.511122 10.511121 l 3.015165,3.00185 c 2.567942,2.55652 3.057622,3.01393 3.300462,3.08282 0.2049,0.0582 1.62307,0.0807 5.03966,0.0807 h 4.754629 v 1.5799 1.57938 l -0.53676,0.0938 c -1.12048,0.19566 -2.647899,0.80928 -3.728799,1.49786 -1.68955,1.07633 -3.11899,2.69978 -3.99411,4.53647 -0.44366,0.93112 -0.88466,2.34132 -0.88466,2.82896 v 0.21524 H 83.533023 74.11886 l -0.04632,-0.32925 c -0.173141,-1.22207 -0.843416,-2.86149 -1.706703,-4.17392 -0.532033,-0.80881 -1.995609,-2.29178 -2.799129,-2.83643 -1.322594,-0.89646 -2.959014,-1.5737 -4.282866,-1.77223 l -0.324987,-0.0488 v -4.66833 z"}),r.createElement("path",{id:"path268",style:{fill:"#ffffff",strokeWidth:1.10252},d:"m 103.6238,103.56164 c -0.26951,0.002 -0.78905,0.20888 -1.00346,0.40036 -0.0723,0.0646 -0.21316,0.24236 -0.313,0.39478 l -0.1814,0.27703 -0.0181,18.06409 -0.0178,18.06382 h -1.52344 -1.523699 l -2.6e-4,-9.7506 c -5.1e-4,-10.41144 -0.004,-10.51884 -0.34443,-11.94692 -1.39786,-5.86159 -6.2432,-10.12876 -12.212765,-10.75566 -1.515813,-0.1589 -19.836715,-0.16022 -20.46231,-0.003 l -0.0017,-0.004 -19.984159,3.5751 18.852043,2.16035 v 6.07801 l -17.36031,3.10307 17.36031,1.98934 v 6.52313 l -17.36031,3.10307 14.274823,1.63584 -0.01572,4.90514 -0.01864,5.72666 -0.630261,0.12519 c -1.586888,0.3153 -3.19702,1.06826 -4.528463,2.1172 -2.205268,1.73733 -3.741592,4.44584 -4.052721,7.1446 -0.370335,3.21237 0.55201,6.19842 2.657412,8.60144 1.687849,1.92642 4.173187,3.25989 6.695216,3.59241 v -5.2e-4 c 0.823962,0.10864 2.933749,0.0318 3.671527,-0.13398 0.932233,-0.20952 1.790157,-0.51486 2.636639,-0.9382 2.065707,-1.03313 3.823794,-2.77572 4.82709,-4.78447 0.504371,-1.00983 0.910151,-2.2066 1.026624,-3.02874 l 0.04632,-0.32925 h 9.414164 9.413621 v 0.21363 c 0,0.11749 0.0641,0.46829 0.14252,0.77944 0.90405,3.58952 3.50882,6.4605 6.974649,7.68695 1.34307,0.47527 1.94662,0.56831 3.65555,0.56366 1.31934,-0.003 1.6122,-0.0248 2.18192,-0.1577 3.36734,-0.785 6.0263,-2.86016 7.51461,-5.86464 0.44078,-0.88981 0.88236,-2.20383 0.97202,-2.89209 l 0.0429,-0.32925 7.18349,-0.002 c 7.08058,-0.002 7.18734,-0.003 7.49463,-0.14278 0.6474,-0.29351 0.90063,-0.70316 0.90063,-1.45737 0,-0.56863 -0.16856,-0.94446 -0.54981,-1.22508 -0.50607,-0.37246 -0.22593,-0.35988 -7.89979,-0.35988 h -7.11583 l -0.11721,-0.5967 c -0.2611,-1.32878 -0.84786,-2.70966 -1.68166,-3.95762 -0.57003,-0.85315 -2.01939,-2.29531 -2.86466,-2.85107 -1.21393,-0.79817 -2.80464,-1.46395 -3.99997,-1.6734 l -0.50159,-0.0876 -0.0181,-21.17061 -0.0179,-21.17036 -0.15424,-0.31166 c -0.25804,-0.52107 -0.8796,-0.90251 -1.46482,-0.8993 z m 9.34091,0.76078 c -1.96194,0 -3.68714,1.06774 -4.53248,2.80552 -0.53635,1.10263 -0.53017,1.02648 -0.50719,6.44296 l 0.0203,4.7802 0.18834,0.55567 c 0.62086,1.8304 2.22555,3.17607 4.08308,3.42406 0.24152,0.0323 2.71505,0.0532 5.4965,0.0458 5.70514,-0.0145 5.34229,0.0172 6.54658,-0.57378 0.54778,-0.2688 0.75707,-0.42233 1.25039,-0.91741 0.48917,-0.4909 0.64889,-0.70948 0.91635,-1.25279 0.53896,-1.09564 0.53516,-1.04438 0.53516,-6.26128 0,-4.84594 -0.0122,-5.06141 -0.32765,-5.86225 -0.76423,-1.94014 -2.6134,-3.18671 -4.72692,-3.18671 h -0.55701 l -0.003,4.13929 -0.003,4.13902 -1.87798,1.48961 c -1.03268,0.8192 -1.9166,1.51252 -1.96429,1.54074 -0.0554,0.0327 -0.79171,-0.51293 -2.03382,-1.50745 l -1.94698,-1.55886 v -4.12117 -4.12118 z m 2.28927,0.55221 v 3.46321 3.46375 l 1.08417,0.86974 c 0.59637,0.47835 1.10582,0.86085 1.13185,0.85002 0.0261,-0.0108 0.53535,-0.40918 1.13213,-0.88545 l 1.08496,-0.86601 -0.0171,-3.42912 -0.0168,-3.42939 -2.19978,-0.0184 z m -47.246901,6.50848 9.196533,0.0248 c 9.138394,0.0247 9.200727,0.0256 9.889125,0.17528 2.276152,0.49507 4.008834,1.42496 5.576414,2.99253 1.56294,1.56292 2.49402,3.26009 3.00158,5.47253 0.15094,0.65777 0.15069,0.6637 0.16942,10.68613 l 0.0189,10.02764 -1.19632,-2.7e-4 -1.19658,-2.6e-4 -2.909672,-2.90888 c -2.148163,-2.14765 -2.999001,-2.9544 -3.251981,-3.08256 l -0.342835,-0.17368 H 77.484375 68.00707 v -11.60675 z m 44.869461,16.35472 c -0.84581,0 -1.35521,0.0997 -1.97602,0.38599 -1.35181,0.62342 -2.29671,1.6661 -2.77169,3.05885 l -0.18354,0.53888 -0.0203,4.74531 c -0.0229,5.40032 -0.0234,5.39175 0.50346,6.47758 0.50611,1.04314 1.24312,1.77945 2.29621,2.29408 0.34744,0.1698 0.83013,0.35177 1.07325,0.40463 h 5.1e-4 c 0.35322,0.0766 1.47942,0.0968 5.60252,0.10015 5.81748,0.005 5.68308,0.0148 6.74876,-0.50692 1.37729,-0.67421 2.29905,-1.8009 2.67474,-3.26982 0.12916,-0.50539 0.13665,-0.78389 0.13665,-5.22266 0,-4.44771 -0.007,-4.7167 -0.13745,-5.23652 -0.23264,-0.92645 -0.63572,-1.63668 -1.31912,-2.32417 -0.5159,-0.519 -0.69084,-0.64491 -1.31832,-0.94858 -0.81757,-0.39568 -1.26328,-0.4968 -2.19098,-0.4968 h -0.64545 v 4.11159 4.11159 l -1.90888,1.51756 c -1.04987,0.83448 -1.93862,1.52747 -1.97495,1.54022 -0.0363,0.0129 -0.93815,-0.6732 -2.00425,-1.52423 l -1.93845,-1.54714 -2.6e-4,-4.10466 -5.2e-4,-4.10493 z m 2.37718,0.55434 0.004,3.44643 0.004,3.4467 1.0522,0.84416 h 5.2e-4 c 0.57883,0.46405 1.07893,0.84577 1.1116,0.84843 0.0327,0.003 0.55454,-0.39065 1.16009,-0.87374 l 1.10122,-0.87825 v -3.41686 -3.41687 h -2.21709 z m -50.294837,9.49114 H 75.47001 85.981126 l 3.015165,3.00185 c 2.56794,2.55652 3.05762,3.01393 3.30046,3.08283 0.20491,0.0582 1.62308,0.0807 5.03966,0.0807 h 4.754639 v 1.5799 1.57938 l -0.53676,0.0938 c -1.12049,0.19566 -2.647909,0.80928 -3.728809,1.49786 -1.68955,1.07634 -3.11898,2.69979 -3.99411,4.53647 -0.44366,0.93112 -0.88465,2.34132 -0.88465,2.82897 v 0.21523 h -9.413636 -9.414164 l -0.04632,-0.32925 c -0.173136,-1.22207 -0.843417,-2.86149 -1.706697,-4.17392 -0.53204,-0.80881 -1.995616,-2.29178 -2.799129,-2.83642 -1.322601,-0.89647 -2.959015,-1.57371 -4.282873,-1.77224 l -0.324986,-0.0487 v -4.66833 z"})),r.createElement("path",{style:{fill:"#ffffff",fillOpacity:1,fillRule:"evenodd",stroke:"#ff9b01",strokeWidth:0,strokeOpacity:1,paintOrder:"stroke markers fill"},d:"",id:"path40",transform:"scale(0.26458333)"}))),Tt=t=>{const{publicRoutes:o,privateRoutes:n}=Xe(),{firstPrivatePath:a}=q(),{logoImg:i=Rt,pathImg:f="./src/assets/MyWarehouse.svg",firstPrivateElement:m=s.jsx(at,{}),globalLayout:p,isMain:h,headerComponent:y,showHeaderOnLogin:E,headerExcludedRoutes:T,footerComponent:L,showFooterOnLogin:d,footerExcludedRoutes:v,privateProvider:x,customProvider:O}=t,j=p||s.jsx(tt,{isMain:h,headerComponent:y,showHeaderOnLogin:E,headerExcludedRoutes:T,footerComponent:L,showFooterOnLogin:d,footerExcludedRoutes:v}),S=x?l.cloneElement(x,{},O):s.jsx(nt,{children:O}),R=()=>{const C=document.querySelector("link[rel='icon']");f&&(C.href=f)};return l.useEffect(()=>{R()},[]),s.jsx(w.Routes,{children:s.jsxs(w.Route,{element:p==="none"?null:j,children:[s.jsxs(w.Route,{path:"/",children:[s.jsx(w.Route,{index:!0,element:s.jsx(ot,{Logo:i})}),o.map((C,N)=>s.jsx(w.Route,{path:C.path,element:C.element},`public-${N}`))]}),s.jsxs(w.Route,{element:S,children:[s.jsx(w.Route,{path:`${a??"/dashboard/"}:id`,element:m}),n.map((C,N)=>s.jsx(w.Route,{path:C.path,element:C.element},`private-${N}`))]})]})})},Nt=({children:t})=>{var i;const o=w.useLocation(),{activeAlert:n}=K(),a=JSON.parse(localStorage.getItem("user"));return l.useEffect(()=>{(!a||!a.admin)&&n("warning","Non puoi accedere a questa pagina")},[a]),!a||!a.admin?s.jsx(w.Navigate,{to:((i=o.state)==null?void 0:i.from)||"/",replace:!0}):t},At=({spinner:t=!0,spinnerStyle:o,text:n,textStyle:a,children:i,containerStyle:f,overrideStyle:m={}})=>s.jsxs("div",{className:m.container||`w-full h-full relative flex items-center justify-center ${f}`,children:[t&&s.jsx(Qe,{className:m.spinner||`text-[20rem] animate-spin text-black ${o}`}),i||s.jsx("p",{className:m.text||`text-black text-2xl select-none absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 ${a}`,children:n||"Loading..."})]});Object.defineProperty(exports,"BrowserRouter",{enumerable:!0,get:()=>w.BrowserRouter});Object.defineProperty(exports,"Link",{enumerable:!0,get:()=>w.Link});Object.defineProperty(exports,"NavLink",{enumerable:!0,get:()=>w.NavLink});Object.defineProperty(exports,"Outlet",{enumerable:!0,get:()=>w.Outlet});Object.defineProperty(exports,"Route",{enumerable:!0,get:()=>w.Route});Object.defineProperty(exports,"Routes",{enumerable:!0,get:()=>w.Routes});Object.defineProperty(exports,"useLocation",{enumerable:!0,get:()=>w.useLocation});Object.defineProperty(exports,"useMatch",{enumerable:!0,get:()=>w.useMatch});Object.defineProperty(exports,"useNavigate",{enumerable:!0,get:()=>w.useNavigate});exports.axios=Fe;exports.Alert=be;exports.AlertProvider=St;exports.AuthAdmin=Nt;exports.AuthPage=nt;exports.AuthProvider=Lt;exports.ConfigProvider=mt;exports.Dashboard=at;exports.DefaultLayout=tt;exports.ErrorPage=We;exports.Input=Ee;exports.InputLabel=ye;exports.Loading=et;exports.LoadingComponent=At;exports.LoadingProvider=dt;exports.Login=ot;exports.LoginForm=rt;exports.LoginFormProvider=Pt;exports.PackageRoutes=Tt;exports.RouteProvider=Ot;exports.fetchAxiosConfig=He;exports.useAlert=K;exports.useAuth=me;exports.useConfig=q;exports.useLoading=le;exports.useLoginForm=we;exports.useRoutesInjection=Xe;