thecore-auth 0.0.89 → 0.0.90

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.
@@ -16,15 +16,15 @@
16
16
  * LICENSE file in the root directory of this source tree.
17
17
  */var ze;function ft(){return ze||(ze=1,process.env.NODE_ENV!=="production"&&function(){function r(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ve?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case B:return"Fragment";case G:return"Portal";case q:return"Profiler";case Q:return"StrictMode";case z:return"Suspense";case F: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 se:return(e.displayName||"Context")+".Provider";case ee:return(e._context.displayName||"Context")+".Consumer";case J:var u=e.render;return e=e.displayName,e||(e=u.displayName||u.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case $:return u=e.displayName||null,u!==null?u:r(e.type)||"Memo";case V:u=e._payload,e=e._init;try{return r(e(u))}catch{}}return null}function s(e){return""+e}function o(e){try{s(e);var u=!1}catch{u=!0}if(u){u=console;var f=u.error,y=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return f.call(u,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",y),s(e)}}function a(){}function i(){if(Y===0){Se=console.log,Oe=console.info,Le=console.warn,ke=console.error,Pe=console.group,Re=console.groupCollapsed,Ne=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 l(){if(Y--,Y===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:M({},e,{value:Se}),info:M({},e,{value:Oe}),warn:M({},e,{value:Le}),error:M({},e,{value:ke}),group:M({},e,{value:Pe}),groupCollapsed:M({},e,{value:Re}),groupEnd:M({},e,{value:Ne})})}0>Y&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function d(e){if(be===void 0)try{throw Error()}catch(f){var u=f.stack.trim().match(/\n( *(at )?)/);be=u&&u[1]||"",Ge=-1<f.stack.indexOf(`
18
18
  at`)?" (<anonymous>)":-1<f.stack.indexOf("@")?"@unknown:0:0":""}return`
19
- `+be+e+Ge}function p(e,u){if(!e||ye)return"";var f=Ee.get(e);if(f!==void 0)return f;ye=!0,f=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var y=null;y=k.H,k.H=null,i();try{var T={DetermineComponentFrameRoot:function(){try{if(u){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 fe=W}Reflect.construct(e,[],Z)}else{try{Z.call()}catch(W){fe=W}e.call(Z.prototype)}}else{try{throw Error()}catch(W){fe=W}(Z=e())&&typeof Z.catch=="function"&&Z.catch(function(){})}}catch(W){if(W&&fe&&typeof W.stack=="string")return[W.stack,fe.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(),D=h[0],te=h[1];if(D&&te){var A=D.split(`
19
+ `+be+e+Ge}function p(e,u){if(!e||ye)return"";var f=Ee.get(e);if(f!==void 0)return f;ye=!0,f=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var y=null;y=k.H,k.H=null,i();try{var T={DetermineComponentFrameRoot:function(){try{if(u){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 fe=W}Reflect.construct(e,[],Z)}else{try{Z.call()}catch(W){fe=W}e.call(Z.prototype)}}else{try{throw Error()}catch(W){fe=W}(Z=e())&&typeof Z.catch=="function"&&Z.catch(function(){})}}catch(W){if(W&&fe&&typeof W.stack=="string")return[W.stack,fe.stack]}return[null,null]}};T.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var R=Object.getOwnPropertyDescriptor(T.DetermineComponentFrameRoot,"name");R&&R.configurable&&Object.defineProperty(T.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=T.DetermineComponentFrameRoot(),D=h[0],te=h[1];if(D&&te){var A=D.split(`
20
20
  `),K=te.split(`
21
- `);for(h=P=0;P<A.length&&!A[P].includes("DetermineComponentFrameRoot");)P++;for(;h<K.length&&!K[h].includes("DetermineComponentFrameRoot");)h++;if(P===A.length||h===K.length)for(P=A.length-1,h=K.length-1;1<=P&&0<=h&&A[P]!==K[h];)h--;for(;1<=P&&0<=h;P--,h--)if(A[P]!==K[h]){if(P!==1||h!==1)do if(P--,h--,0>h||A[P]!==K[h]){var ie=`
22
- `+A[P].replace(" at new "," at ");return e.displayName&&ie.includes("<anonymous>")&&(ie=ie.replace("<anonymous>",e.displayName)),typeof e=="function"&&Ee.set(e,ie),ie}while(1<=P&&0<=h);break}}}finally{ye=!1,k.H=y,l(),Error.prepareStackTrace=f}return A=(A=e?e.displayName||e.name:"")?d(A):"",typeof e=="function"&&Ee.set(e,A),A}function g(e){if(e==null)return"";if(typeof e=="function"){var u=e.prototype;return p(e,!(!u||!u.isReactComponent))}if(typeof e=="string")return d(e);switch(e){case z:return d("Suspense");case F:return d("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case J:return e=p(e.render,!1),e;case $:return g(e.type);case V:u=e._payload,e=e._init;try{return g(e(u))}catch{}}return""}function C(){var e=k.A;return e===null?null:e.getOwner()}function b(e){if(I.call(e,"key")){var u=Object.getOwnPropertyDescriptor(e,"key").get;if(u&&u.isReactWarning)return!1}return e.key!==void 0}function R(e,u){function f(){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)",u))}f.isReactWarning=!0,Object.defineProperty(e,"key",{get:f,configurable:!0})}function j(){var e=r(this.type);return _e[e]||(_e[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,u,f,y,T,P){return f=P.ref,e={$$typeof:w,type:e,key:u,props:P,_owner:T},(f!==void 0?f:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:j}):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,u,f,y,T,P){if(typeof e=="string"||typeof e=="function"||e===B||e===q||e===Q||e===z||e===F||e===xe||typeof e=="object"&&e!==null&&(e.$$typeof===V||e.$$typeof===$||e.$$typeof===se||e.$$typeof===ee||e.$$typeof===J||e.$$typeof===_||e.getModuleId!==void 0)){var h=u.children;if(h!==void 0)if(y)if(X(h)){for(y=0;y<h.length;y++)x(h[y],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?y="null":X(e)?y="array":e!==void 0&&e.$$typeof===w?(y="<"+(r(e.type)||"Unknown")+" />",h=" Did you accidentally export a JSX literal instead of a component?"):y=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",y,h);if(I.call(u,"key")){h=r(e);var D=Object.keys(u).filter(function(A){return A!=="key"});y=0<D.length?"{key: someKey, "+D.join(": ..., ")+": ...}":"{key: someKey}",Ae[h+y]||(D=0<D.length?"{"+D.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
21
+ `);for(h=R=0;R<A.length&&!A[R].includes("DetermineComponentFrameRoot");)R++;for(;h<K.length&&!K[h].includes("DetermineComponentFrameRoot");)h++;if(R===A.length||h===K.length)for(R=A.length-1,h=K.length-1;1<=R&&0<=h&&A[R]!==K[h];)h--;for(;1<=R&&0<=h;R--,h--)if(A[R]!==K[h]){if(R!==1||h!==1)do if(R--,h--,0>h||A[R]!==K[h]){var ie=`
22
+ `+A[R].replace(" at new "," at ");return e.displayName&&ie.includes("<anonymous>")&&(ie=ie.replace("<anonymous>",e.displayName)),typeof e=="function"&&Ee.set(e,ie),ie}while(1<=R&&0<=h);break}}}finally{ye=!1,k.H=y,l(),Error.prepareStackTrace=f}return A=(A=e?e.displayName||e.name:"")?d(A):"",typeof e=="function"&&Ee.set(e,A),A}function g(e){if(e==null)return"";if(typeof e=="function"){var u=e.prototype;return p(e,!(!u||!u.isReactComponent))}if(typeof e=="string")return d(e);switch(e){case z:return d("Suspense");case F:return d("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case J:return e=p(e.render,!1),e;case $:return g(e.type);case V:u=e._payload,e=e._init;try{return g(e(u))}catch{}}return""}function C(){var e=k.A;return e===null?null:e.getOwner()}function b(e){if(I.call(e,"key")){var u=Object.getOwnPropertyDescriptor(e,"key").get;if(u&&u.isReactWarning)return!1}return e.key!==void 0}function P(e,u){function f(){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)",u))}f.isReactWarning=!0,Object.defineProperty(e,"key",{get:f,configurable:!0})}function j(){var e=r(this.type);return _e[e]||(_e[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,u,f,y,T,R){return f=R.ref,e={$$typeof:w,type:e,key:u,props:R,_owner:T},(f!==void 0?f:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:j}):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,u,f,y,T,R){if(typeof e=="string"||typeof e=="function"||e===B||e===q||e===Q||e===z||e===F||e===xe||typeof e=="object"&&e!==null&&(e.$$typeof===V||e.$$typeof===$||e.$$typeof===se||e.$$typeof===ee||e.$$typeof===J||e.$$typeof===_||e.getModuleId!==void 0)){var h=u.children;if(h!==void 0)if(y)if(X(h)){for(y=0;y<h.length;y++)x(h[y],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?y="null":X(e)?y="array":e!==void 0&&e.$$typeof===w?(y="<"+(r(e.type)||"Unknown")+" />",h=" Did you accidentally export a JSX literal instead of a component?"):y=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",y,h);if(I.call(u,"key")){h=r(e);var D=Object.keys(u).filter(function(A){return A!=="key"});y=0<D.length?"{key: someKey, "+D.join(": ..., ")+": ...}":"{key: someKey}",Ae[h+y]||(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} />`,y,h,D,h),Ae[h+y]=!0)}if(h=null,f!==void 0&&(o(f),h=""+f),b(u)&&(o(u.key),h=""+u.key),"key"in u){f={};for(var te in u)te!=="key"&&(f[te]=u[te])}else f=u;return h&&R(f,typeof e=="function"?e.displayName||e.name||"Unknown":e),m(e,h,P,T,C(),f)}function x(e,u){if(typeof e=="object"&&e&&e.$$typeof!==it){if(X(e))for(var f=0;f<e.length;f++){var y=e[f];L(y)&&S(y,u)}else if(L(e))e._store&&(e._store.validated=1);else if(e===null||typeof e!="object"?f=null:(f=ae&&e[ae]||e["@@iterator"],f=typeof f=="function"?f:null),typeof f=="function"&&f!==e.entries&&(f=f.call(e),f!==e))for(;!(e=f.next()).done;)L(e.value)&&S(e.value,u)}}function L(e){return typeof e=="object"&&e!==null&&e.$$typeof===w}function S(e,u){if(e._store&&!e._store.validated&&e.key==null&&(e._store.validated=1,u=O(u),!Ie[u])){Ie[u]=!0;var f="";e&&e._owner!=null&&e._owner!==C()&&(f=null,typeof e._owner.tag=="number"?f=r(e._owner.type):typeof e._owner.name=="string"&&(f=e._owner.name),f=" It was passed a child from "+f+".");var y=k.getCurrentStack;k.getCurrentStack=function(){var T=g(e.type);return y&&(T+=y()||""),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.',u,f),k.getCurrentStack=y}}function O(e){var u="",f=C();return f&&(f=r(f.type))&&(u=`
27
+ <%s key={someKey} {...props} />`,y,h,D,h),Ae[h+y]=!0)}if(h=null,f!==void 0&&(o(f),h=""+f),b(u)&&(o(u.key),h=""+u.key),"key"in u){f={};for(var te in u)te!=="key"&&(f[te]=u[te])}else f=u;return h&&P(f,typeof e=="function"?e.displayName||e.name||"Unknown":e),m(e,h,R,T,C(),f)}function x(e,u){if(typeof e=="object"&&e&&e.$$typeof!==it){if(X(e))for(var f=0;f<e.length;f++){var y=e[f];L(y)&&S(y,u)}else if(L(e))e._store&&(e._store.validated=1);else if(e===null||typeof e!="object"?f=null:(f=ae&&e[ae]||e["@@iterator"],f=typeof f=="function"?f:null),typeof f=="function"&&f!==e.entries&&(f=f.call(e),f!==e))for(;!(e=f.next()).done;)L(e.value)&&S(e.value,u)}}function L(e){return typeof e=="object"&&e!==null&&e.$$typeof===w}function S(e,u){if(e._store&&!e._store.validated&&e.key==null&&(e._store.validated=1,u=O(u),!Ie[u])){Ie[u]=!0;var f="";e&&e._owner!=null&&e._owner!==C()&&(f=null,typeof e._owner.tag=="number"?f=r(e._owner.type):typeof e._owner.name=="string"&&(f=e._owner.name),f=" It was passed a child from "+f+".");var y=k.getCurrentStack;k.getCurrentStack=function(){var T=g(e.type);return y&&(T+=y()||""),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.',u,f),k.getCurrentStack=y}}function O(e){var u="",f=C();return f&&(f=r(f.type))&&(u=`
28
28
 
29
29
  Check the render method of \``+f+"`."),u||(e=r(e))&&(u=`
30
30
 
@@ -41,20 +41,21 @@ 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": " ,
53
+ "clearLoginFormOnError": "" ,
54
+ "autoLogin": "" ,
55
55
  "backendToken": "",
56
- "isDebug": ""
57
- }`,d=()=>{const m=new Date,v=String(m.getDate()).padStart(2,"0"),x=String(m.getMonth()+1).padStart(2,"0"),L=m.getFullYear(),S=String(m.getHours()).padStart(2,"0"),O=String(m.getMinutes()).padStart(2,"0"),N=String(m.getSeconds()).padStart(2,"0");return`${v}/${x}/${L} ${S}:${O}:${N}`},p=m=>new Promise((v,x)=>{const L=indexedDB.open("configDatabase",1);L.onupgradeneeded=S=>{const O=S.target.result;O.objectStoreNames.contains(m)||O.createObjectStore(m,{keyPath:"id"})},L.onsuccess=S=>v(S.target.result),L.onerror=S=>x(S.target.error)}),g=async(m,v)=>{let x=await p(m);return new Promise((L,S)=>{if(!x){S("Errore: DB non disponibile");return}const O=x==null?void 0:x.transaction(m,"readonly"),N=O==null?void 0:O.objectStore(m),w=N==null?void 0:N.get(v);w.onsuccess=()=>L(w.result),w.onerror=G=>S(G.target.error)})},C=async(m,v)=>{let x=await p(m);return new Promise((L,S)=>{if(!x){S("Errore: DB non disponibile");return}const O=x==null?void 0:x.transaction(m,"readwrite"),N=O==null?void 0:O.objectStore(m),w=N==null?void 0:N.put(v);w.onsuccess=()=>L(w.result),w.onerror=G=>S(G.target.error)})},b=async m=>{let v=Date.now(),x;do x=await g(m,v),x&&v++;while(x);return v},R=async(m,v)=>{v.id||(v.id=await b(m)),await C(m,v)},j=async()=>{try{const x={...await(await fetch("/config.json")).json(),openIndexedDB:p,getDataIndexedDB:g,setDataIndexedDB:C,generateUniqueId:b,setDataWithAutoId:R,setCurrentDate:d};o(x)}catch(m){console.error(m),i(!0)}};return c.useEffect(()=>{j()},[]),Object.keys(s).length===0?n.jsx(He,{errorShow:a,errorMessage:l}):n.jsx(Ye.Provider,{value:s,children:r})},H=()=>{const r=c.useContext(Ye);if(r===void 0)throw new Error("Non puoi leggere i config");return r},gt=r=>t.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",...r},t.createElement("defs",null,t.createElement("g",null),t.createElement("clipPath",{id:"6ca7e2bf04"},t.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"})),t.createElement("clipPath",{id:"2c77c820c6"},t.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"})),t.createElement("clipPath",{id:"3d94df7d66"},t.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"})),t.createElement("clipPath",{id:"8793709a64"},t.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"})),t.createElement("clipPath",{id:"fdb3fe29d8"},t.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"}))),t.createElement("g",{clipPath:"url(#6ca7e2bf04)"},t.createElement("rect",{x:-37.5,width:450,fill:"#b91c1c",y:-37.499999,height:449.999989,fillOpacity:1})),t.createElement("g",{clipPath:"url(#2c77c820c6)"},t.createElement("g",{clipPath:"url(#3d94df7d66)"},t.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"}))),t.createElement("g",{clipPath:"url(#8793709a64)"},t.createElement("g",{clipPath:"url(#fdb3fe29d8)"},t.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}))),t.createElement("g",{fill:"#ffffff",fillOpacity:1},t.createElement("g",{transform:"translate(111.648432, 267.442446)"},t.createElement("g",null,t.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 "}))))),ht=r=>t.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",...r},t.createElement("defs",null,t.createElement("g",null),t.createElement("clipPath",{id:"30562604dd"},t.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"})),t.createElement("clipPath",{id:"971fcd5f72"},t.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"})),t.createElement("clipPath",{id:"e891a7f57e"},t.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"})),t.createElement("clipPath",{id:"19a9ddc130"},t.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"})),t.createElement("clipPath",{id:"5e650d5bd0"},t.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"}))),t.createElement("g",{clipPath:"url(#30562604dd)"},t.createElement("rect",{x:-37.5,width:450,fill:"#1d4ed8",y:-37.499999,height:449.999989,fillOpacity:1})),t.createElement("g",{clipPath:"url(#971fcd5f72)"},t.createElement("g",{clipPath:"url(#e891a7f57e)"},t.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"}))),t.createElement("g",{clipPath:"url(#19a9ddc130)"},t.createElement("g",{clipPath:"url(#5e650d5bd0)"},t.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}))),t.createElement("g",{fill:"#ffffff",fillOpacity:1},t.createElement("g",{transform:"translate(136.121787, 300.837436)"},t.createElement("g",null,t.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 "}))))),xt=r=>t.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",...r},t.createElement("defs",null,t.createElement("g",null),t.createElement("clipPath",{id:"59a10ac27a"},t.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"})),t.createElement("clipPath",{id:"664b27481e"},t.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"}))),t.createElement("g",{clipPath:"url(#59a10ac27a)"},t.createElement("g",{clipPath:"url(#664b27481e)"},t.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"}))),t.createElement("g",{fill:"#ffffff",fillOpacity:1},t.createElement("g",{transform:"translate(158.410439, 295.655517)"},t.createElement("g",null,t.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},Fe=c.createContext&&c.createContext(Ze),vt=["attr","size","title"];function bt(r,s){if(r==null)return{};var o=yt(r,s),a,i;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(r);for(i=0;i<l.length;i++)a=l[i],!(s.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(r,a)&&(o[a]=r[a])}return o}function yt(r,s){if(r==null)return{};var o={};for(var a in r)if(Object.prototype.hasOwnProperty.call(r,a)){if(s.indexOf(a)>=0)continue;o[a]=r[a]}return o}function me(){return me=Object.assign?Object.assign.bind():function(r){for(var s=1;s<arguments.length;s++){var o=arguments[s];for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(r[a]=o[a])}return r},me.apply(this,arguments)}function $e(r,s){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);s&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),o.push.apply(o,a)}return o}function pe(r){for(var s=1;s<arguments.length;s++){var o=arguments[s]!=null?arguments[s]:{};s%2?$e(Object(o),!0).forEach(function(a){Et(r,a,o[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):$e(Object(o)).forEach(function(a){Object.defineProperty(r,a,Object.getOwnPropertyDescriptor(o,a))})}return r}function Et(r,s,o){return s=Ct(s),s in r?Object.defineProperty(r,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[s]=o,r}function Ct(r){var s=wt(r,"string");return typeof s=="symbol"?s:s+""}function wt(r,s){if(typeof r!="object"||!r)return r;var o=r[Symbol.toPrimitive];if(o!==void 0){var a=o.call(r,s||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(r)}function Ue(r){return r&&r.map((s,o)=>c.createElement(s.tag,pe({key:o},s.attr),Ue(s.child)))}function ne(r){return s=>c.createElement(jt,me({attr:pe({},r.attr)},s),Ue(r.child))}function jt(r){var s=o=>{var{attr:a,size:i,title:l}=r,d=bt(r,vt),p=i||o.size||"1em",g;return o.className&&(g=o.className),r.className&&(g=(g?g+" ":"")+r.className),c.createElement("svg",me({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},o.attr,a,d,{className:g,style:pe(pe({color:r.color||o.color},o.style),r.style),height:p,width:p,xmlns:"http://www.w3.org/2000/svg"}),l&&c.createElement("title",null,l),r.children)};return Fe!==void 0?c.createElement(Fe.Consumer,null,o=>s(o)):s(Ze)}function St(r){return ne({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:[]}]})(r)}const qe=c.createContext(),Ot=({children:r})=>{const[s,o]=c.useState(!1),[a,i]=c.useState(),[l,d]=c.useState(),R={showAlert:s,setShowAlert:o,typeAlert:a,setTypeAlert:i,messageAlert:l,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:j=>{switch(j){case"danger":return n.jsx(gt,{className:"w-[20px] h-[20px]"});case"info":return n.jsx(ht,{className:"w-[20px] h-[20px]"});case"success":return n.jsx(St,{className:"text-xl"});case"warning":return n.jsx(xt,{className:"w-[20px] h-[20px]"})}},closeAlert:()=>{o(!s)},activeAlert:(j,m)=>{o(!1),setTimeout(()=>{i(j),d(m),o(!0)},50)}};return n.jsx(qe.Provider,{value:R,children:r})},U=()=>{const r=c.useContext(qe);if(r===void 0)throw new Error("Non puoi modificare l'alert");return r};let re;const Je=async(r,s,o)=>{if(re)return re;try{const i=await(await fetch("/config.json")).json(),l=i.baseUri,{unauthorized:d,notFound:p,defaultMessage:g}=i.axiosErrors,C=i.axiosTimeout;return re=De.create({baseURL:l,timeout:C}),re.interceptors.request.use(b=>b),re.interceptors.response.use(b=>b,b=>{if(b.response)switch(r(!0),s("danger"),b.response.status){case 401:localStorage.removeItem("accessToken"),o(d);break;case 404:o(p);break;default:o(`${g} ${b.response.status||""} ${b.response.data.error||""}`)}return Promise.reject(b)}),re}catch(a){console.error(a)}},Ve=c.createContext(),Lt=({children:r})=>{const{heartbeatEndpoint:s,firstPrivatePath:o,infiniteSession:a,timeDeducted:i,authenticatedEndpoint:l,autoLogin:d,autoLoginEmail:p,autoLoginPassword:g,setCurrentDate:C,isDebug:b,backendToken:R}=H(),{setIsLoading:j}=oe(),{setShowAlert:m,setMessageAlert:v,setTypeAlert:x,activeAlert:L}=U(),S=E.useNavigate(),[O,N]=c.useState(null),[w,G]=c.useState(),[B,Q]=c.useState(),[q,ee]=c.useState(),[se,J]=c.useState(!1),z=async()=>await Je(m,x,v),F=async(k=null,I)=>{k&&k.preventDefault(),J(!0);try{j(!0),m(!1);const _=await(await z()).post(l,{auth:I}),X=_.headers.token,Y=_.data;X&&(localStorage.setItem("accessToken",X),localStorage.setItem("user",JSON.stringify(Y)),N(!0),G(X),S(`${o}${Y.id}`))}catch(M){console.error(M)}finally{J(!1),j(!1)}},$=()=>{localStorage.removeItem("accessToken"),localStorage.removeItem("id"),localStorage.removeItem("user"),N(!1),G(null)},V=async()=>{try{const k=localStorage.getItem("accessToken"),_=(await(await z()).get(`${s}`,{headers:{Authorization:k}})).headers.token;localStorage.setItem("accessToken",_),G(_),b&&console.log("nuovo token: ",_,"Data:",C())}catch(k){console.error(k),$()}},xe=()=>{if(!w)return;const I=lt(w).exp,M=Math.floor(Date.now()/1e3),_=(I-M)*1e3;ee(_),Q(_-i)},ae=async k=>{try{const _=(await(await z()).get(s,{headers:{Authorization:k}})).data;_&&(localStorage.setItem("user",JSON.stringify(_)),localStorage.setItem("accessToken",k),N(!0),S(`${o}${_.id}`))}catch(I){console.error(I)}};c.useEffect(()=>{if(localStorage.getItem("accessToken"))N(!0);else{N(!1);return}},[]),c.useEffect(()=>{d&&ae(R)},[d]),c.useEffect(()=>{O||d&&!se&&ae(R)},[O]),c.useEffect(()=>{if(d)return;xe();let k;a&&w&&B&&(k=setInterval(()=>{V()},B));let I;return!a&&w&&q&&(I=setTimeout(()=>{$(),L("danger","Sessione scaduta")},q)),()=>{k&&clearInterval(k),I&&clearTimeout(I)}},[w,B]);const ve={isAuthenticated:O,setIsAuthenticated:N,login:F,logout:$,setCurrentToken:G,createAxiosInstances:z};return n.jsx(Ve.Provider,{value:ve,children:r})},ue=()=>{const r=c.useContext(Ve);if(r===void 0)throw new Error("Non sei dentro al Auth Provider");return r},Xe=c.createContext(),kt=({children:r,publicRoutes:s=[],privateRoutes:o=[]})=>n.jsx(Xe.Provider,{value:{publicRoutes:s,privateRoutes:o},children:r}),Ke=()=>{const r=c.useContext(Xe);if(r===void 0)throw new Error(`Errore: Le rotte non sono state inizializzate correttamente.
56
+ "isDebug": "",
57
+ "showHeaderButton": ""
58
+ }`,d=()=>{const m=new Date,v=String(m.getDate()).padStart(2,"0"),x=String(m.getMonth()+1).padStart(2,"0"),L=m.getFullYear(),S=String(m.getHours()).padStart(2,"0"),O=String(m.getMinutes()).padStart(2,"0"),N=String(m.getSeconds()).padStart(2,"0");return`${v}/${x}/${L} ${S}:${O}:${N}`},p=m=>new Promise((v,x)=>{const L=indexedDB.open("configDatabase",1);L.onupgradeneeded=S=>{const O=S.target.result;O.objectStoreNames.contains(m)||O.createObjectStore(m,{keyPath:"id"})},L.onsuccess=S=>v(S.target.result),L.onerror=S=>x(S.target.error)}),g=async(m,v)=>{let x=await p(m);return new Promise((L,S)=>{if(!x){S("Errore: DB non disponibile");return}const O=x==null?void 0:x.transaction(m,"readonly"),N=O==null?void 0:O.objectStore(m),w=N==null?void 0:N.get(v);w.onsuccess=()=>L(w.result),w.onerror=G=>S(G.target.error)})},C=async(m,v)=>{let x=await p(m);return new Promise((L,S)=>{if(!x){S("Errore: DB non disponibile");return}const O=x==null?void 0:x.transaction(m,"readwrite"),N=O==null?void 0:O.objectStore(m),w=N==null?void 0:N.put(v);w.onsuccess=()=>L(w.result),w.onerror=G=>S(G.target.error)})},b=async m=>{let v=Date.now(),x;do x=await g(m,v),x&&v++;while(x);return v},P=async(m,v)=>{v.id||(v.id=await b(m)),await C(m,v)},j=async()=>{try{const x={...await(await fetch("/config.json")).json(),openIndexedDB:p,getDataIndexedDB:g,setDataIndexedDB:C,generateUniqueId:b,setDataWithAutoId:P,setCurrentDate:d};o(x)}catch(m){console.error(m),i(!0)}};return c.useEffect(()=>{j()},[]),Object.keys(s).length===0?n.jsx(He,{errorShow:a,errorMessage:l}):n.jsx(Ye.Provider,{value:s,children:r})},H=()=>{const r=c.useContext(Ye);if(r===void 0)throw new Error("Non puoi leggere i config");return r},gt=r=>t.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",...r},t.createElement("defs",null,t.createElement("g",null),t.createElement("clipPath",{id:"6ca7e2bf04"},t.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"})),t.createElement("clipPath",{id:"2c77c820c6"},t.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"})),t.createElement("clipPath",{id:"3d94df7d66"},t.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"})),t.createElement("clipPath",{id:"8793709a64"},t.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"})),t.createElement("clipPath",{id:"fdb3fe29d8"},t.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"}))),t.createElement("g",{clipPath:"url(#6ca7e2bf04)"},t.createElement("rect",{x:-37.5,width:450,fill:"#b91c1c",y:-37.499999,height:449.999989,fillOpacity:1})),t.createElement("g",{clipPath:"url(#2c77c820c6)"},t.createElement("g",{clipPath:"url(#3d94df7d66)"},t.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"}))),t.createElement("g",{clipPath:"url(#8793709a64)"},t.createElement("g",{clipPath:"url(#fdb3fe29d8)"},t.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}))),t.createElement("g",{fill:"#ffffff",fillOpacity:1},t.createElement("g",{transform:"translate(111.648432, 267.442446)"},t.createElement("g",null,t.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 "}))))),ht=r=>t.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",...r},t.createElement("defs",null,t.createElement("g",null),t.createElement("clipPath",{id:"30562604dd"},t.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"})),t.createElement("clipPath",{id:"971fcd5f72"},t.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"})),t.createElement("clipPath",{id:"e891a7f57e"},t.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"})),t.createElement("clipPath",{id:"19a9ddc130"},t.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"})),t.createElement("clipPath",{id:"5e650d5bd0"},t.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"}))),t.createElement("g",{clipPath:"url(#30562604dd)"},t.createElement("rect",{x:-37.5,width:450,fill:"#1d4ed8",y:-37.499999,height:449.999989,fillOpacity:1})),t.createElement("g",{clipPath:"url(#971fcd5f72)"},t.createElement("g",{clipPath:"url(#e891a7f57e)"},t.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"}))),t.createElement("g",{clipPath:"url(#19a9ddc130)"},t.createElement("g",{clipPath:"url(#5e650d5bd0)"},t.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}))),t.createElement("g",{fill:"#ffffff",fillOpacity:1},t.createElement("g",{transform:"translate(136.121787, 300.837436)"},t.createElement("g",null,t.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 "}))))),xt=r=>t.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",...r},t.createElement("defs",null,t.createElement("g",null),t.createElement("clipPath",{id:"59a10ac27a"},t.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"})),t.createElement("clipPath",{id:"664b27481e"},t.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"}))),t.createElement("g",{clipPath:"url(#59a10ac27a)"},t.createElement("g",{clipPath:"url(#664b27481e)"},t.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"}))),t.createElement("g",{fill:"#ffffff",fillOpacity:1},t.createElement("g",{transform:"translate(158.410439, 295.655517)"},t.createElement("g",null,t.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},Fe=c.createContext&&c.createContext(Ze),vt=["attr","size","title"];function bt(r,s){if(r==null)return{};var o=yt(r,s),a,i;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(r);for(i=0;i<l.length;i++)a=l[i],!(s.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(r,a)&&(o[a]=r[a])}return o}function yt(r,s){if(r==null)return{};var o={};for(var a in r)if(Object.prototype.hasOwnProperty.call(r,a)){if(s.indexOf(a)>=0)continue;o[a]=r[a]}return o}function me(){return me=Object.assign?Object.assign.bind():function(r){for(var s=1;s<arguments.length;s++){var o=arguments[s];for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(r[a]=o[a])}return r},me.apply(this,arguments)}function $e(r,s){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);s&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),o.push.apply(o,a)}return o}function pe(r){for(var s=1;s<arguments.length;s++){var o=arguments[s]!=null?arguments[s]:{};s%2?$e(Object(o),!0).forEach(function(a){Et(r,a,o[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):$e(Object(o)).forEach(function(a){Object.defineProperty(r,a,Object.getOwnPropertyDescriptor(o,a))})}return r}function Et(r,s,o){return s=Ct(s),s in r?Object.defineProperty(r,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[s]=o,r}function Ct(r){var s=wt(r,"string");return typeof s=="symbol"?s:s+""}function wt(r,s){if(typeof r!="object"||!r)return r;var o=r[Symbol.toPrimitive];if(o!==void 0){var a=o.call(r,s||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(r)}function Ue(r){return r&&r.map((s,o)=>c.createElement(s.tag,pe({key:o},s.attr),Ue(s.child)))}function ne(r){return s=>c.createElement(jt,me({attr:pe({},r.attr)},s),Ue(r.child))}function jt(r){var s=o=>{var{attr:a,size:i,title:l}=r,d=bt(r,vt),p=i||o.size||"1em",g;return o.className&&(g=o.className),r.className&&(g=(g?g+" ":"")+r.className),c.createElement("svg",me({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},o.attr,a,d,{className:g,style:pe(pe({color:r.color||o.color},o.style),r.style),height:p,width:p,xmlns:"http://www.w3.org/2000/svg"}),l&&c.createElement("title",null,l),r.children)};return Fe!==void 0?c.createElement(Fe.Consumer,null,o=>s(o)):s(Ze)}function St(r){return ne({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:[]}]})(r)}const qe=c.createContext(),Ot=({children:r})=>{const[s,o]=c.useState(!1),[a,i]=c.useState(),[l,d]=c.useState(),P={showAlert:s,setShowAlert:o,typeAlert:a,setTypeAlert:i,messageAlert:l,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:j=>{switch(j){case"danger":return n.jsx(gt,{className:"w-[20px] h-[20px]"});case"info":return n.jsx(ht,{className:"w-[20px] h-[20px]"});case"success":return n.jsx(St,{className:"text-xl"});case"warning":return n.jsx(xt,{className:"w-[20px] h-[20px]"})}},closeAlert:()=>{o(!s)},activeAlert:(j,m)=>{o(!1),setTimeout(()=>{i(j),d(m),o(!0)},50)}};return n.jsx(qe.Provider,{value:P,children:r})},U=()=>{const r=c.useContext(qe);if(r===void 0)throw new Error("Non puoi modificare l'alert");return r};let re;const Je=async(r,s,o)=>{if(re)return re;try{const i=await(await fetch("/config.json")).json(),l=i.baseUri,{unauthorized:d,notFound:p,defaultMessage:g}=i.axiosErrors,C=i.axiosTimeout;return re=De.create({baseURL:l,timeout:C}),re.interceptors.request.use(b=>b),re.interceptors.response.use(b=>b,b=>{if(b.response)switch(r(!0),s("danger"),b.response.status){case 401:localStorage.removeItem("accessToken"),o(d);break;case 404:o(p);break;default:o(`${g} ${b.response.status||""} ${b.response.data.error||""}`)}return Promise.reject(b)}),re}catch(a){console.error(a)}},Ve=c.createContext(),Lt=({children:r})=>{const{heartbeatEndpoint:s,firstPrivatePath:o,infiniteSession:a,timeDeducted:i,authenticatedEndpoint:l,autoLogin:d,autoLoginEmail:p,autoLoginPassword:g,setCurrentDate:C,isDebug:b,backendToken:P}=H(),{setIsLoading:j}=oe(),{setShowAlert:m,setMessageAlert:v,setTypeAlert:x,activeAlert:L}=U(),S=E.useNavigate(),[O,N]=c.useState(null),[w,G]=c.useState(),[B,Q]=c.useState(),[q,ee]=c.useState(),[se,J]=c.useState(!1),z=async()=>await Je(m,x,v),F=async(k=null,I)=>{k&&k.preventDefault(),J(!0);try{j(!0),m(!1);const _=await(await z()).post(l,{auth:I}),X=_.headers.token,Y=_.data;X&&(localStorage.setItem("accessToken",X),localStorage.setItem("user",JSON.stringify(Y)),N(!0),G(X),S(`${o}${Y.id}`))}catch(M){console.error(M)}finally{J(!1),j(!1)}},$=()=>{localStorage.removeItem("accessToken"),localStorage.removeItem("id"),localStorage.removeItem("user"),N(!1),G(null)},V=async()=>{try{const k=localStorage.getItem("accessToken"),_=(await(await z()).get(`${s}`,{headers:{Authorization:k}})).headers.token;localStorage.setItem("accessToken",_),G(_),b&&console.log("nuovo token: ",_,"Data:",C())}catch(k){console.error(k),$()}},xe=()=>{if(!w)return;const I=lt(w).exp,M=Math.floor(Date.now()/1e3),_=(I-M)*1e3;ee(_),Q(_-i)},ae=async k=>{try{const _=(await(await z()).get(s,{headers:{Authorization:k}})).data;_&&(localStorage.setItem("user",JSON.stringify(_)),localStorage.setItem("accessToken",k),N(!0),S(`${o}${_.id}`))}catch(I){console.error(I)}};c.useEffect(()=>{if(localStorage.getItem("accessToken"))N(!0);else{N(!1);return}},[]),c.useEffect(()=>{d&&ae(P)},[d]),c.useEffect(()=>{O||d&&!se&&ae(P)},[O]),c.useEffect(()=>{if(d)return;xe();let k;a&&w&&B&&(k=setInterval(()=>{V()},B));let I;return!a&&w&&q&&(I=setTimeout(()=>{$(),L("danger","Sessione scaduta")},q)),()=>{k&&clearInterval(k),I&&clearTimeout(I)}},[w,B]);const ve={isAuthenticated:O,setIsAuthenticated:N,login:F,logout:$,setCurrentToken:G,createAxiosInstances:z};return n.jsx(Ve.Provider,{value:ve,children:r})},ue=()=>{const r=c.useContext(Ve);if(r===void 0)throw new Error("Non sei dentro al Auth Provider");return r},Xe=c.createContext(),kt=({children:r,publicRoutes:s=[],privateRoutes:o=[]})=>n.jsx(Xe.Provider,{value:{publicRoutes:s,privateRoutes:o},children:r}),Ke=()=>{const r=c.useContext(Xe);if(r===void 0)throw new Error(`Errore: Le rotte non sono state inizializzate correttamente.
58
59
 
59
60
  Soluzione: Assicurati di avvolgere il tuo componente con <RouteProvider>.
60
61
 
@@ -62,4 +63,4 @@ Esempio:
62
63
 
63
64
  <RouteProvider publicRoutes={[]} privateRoutes={[]}>
64
65
  <MyPackageRoutes />
65
- </RouteProvider>`);return r},Qe=c.createContext(),Pt=({children:r})=>{const{login:s}=ue(),{clearLoginFormOnError:o}=H(),a={email:"",password:""},[i,l]=c.useState("Accedi"),[d,p]=c.useState("Email"),[g,C]=c.useState("email"),[b,R]=c.useState("example@example.it"),[j,m]=c.useState("Accedi"),[v,x]=c.useState(a),[L,S]=c.useState(),[O,N]=c.useState(),[w,G]=c.useState(),[B,Q]=c.useState(),[q,ee]=c.useState({}),z={overrideStyle:q,setOverrideStyle:ee,title:i,setTitle:l,label:d,setLabel:p,type:g,setType:C,placeholder:b,setPlaceholder:R,buttonText:j,setButtonText:m,formData:v,setFormData:x,LogoImg:L,setLogoImg:S,styleCardForm:O,setStyleCardForm:N,styleContainerLogo:w,setStyleContainerLogo:G,styleLogo:B,setStyleLogo:Q,changeData:(F,$)=>{x(V=>({...V,[F]:$}))},handleLogin:F=>{s(F,v),o&&x(a)}};return n.jsx(Qe.Provider,{value:z,children:r})},je=()=>{const r=c.useContext(Qe);if(r===void 0)throw new Error("Non puoi modificare La login");return r};function et(r){return ne({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:[]}]})(r)}const tt=()=>{const{loadingProps:r}=oe(),{spinner:s=!0,spinnerStyle:o,text:a,textStyle:i,children:l,containerStyle:d,overrideStyle:p={}}=r;return n.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:[s&&n.jsx(et,{className:p.spinner||`text-[20rem] relative animate-spin text-spinner ${o}`}),l||n.jsx("p",{className:p.text||`text-white text-2xl select-none absolute ${i}`,children:a||"Loading..."})]})};function Rt(r){return ne({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:[]}]})(r)}const Ce=()=>{const{messageAlert:r,typeAlert:s,alertConfig:o,getIcon:a,closeAlert:i}=U(),{alertTimeout:l}=H(),[d,p]=c.useState(0),{bgColor:g,textColor:C,buttonBg:b,hoverBg:R,focusRing:j,progressColor:m}=o[s];return c.useEffect(()=>{let v;const L=100/(l/100);v=setInterval(()=>{p(O=>O>=100?(clearInterval(v),100):O+L)},100);const S=setTimeout(()=>{i()},l);return()=>{clearTimeout(S),clearInterval(v)}},[]),n.jsxs("div",{className:`flex items-center p-4 pt-6 ${C} 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:[n.jsx("div",{className:"w-full bg-gray-200 rounded-t-lg overflow-hidden h-2.5 absolute top-0 left-0 right-0",children:n.jsx("div",{className:`${m} h-2.5 rounded-t-lg`,style:{width:`${d}%`}})}),a(s),n.jsx("div",{className:"px-4 text-sm font-medium",children:r}),n.jsx("button",{type:"button",className:`ms-auto ${b} rounded-lg focus:ring-2 ${j} p-1.5 ${R} inline-flex items-center justify-center h-8 w-8 cursor-pointer`,title:"Close",onClick:i,children:n.jsx(Rt,{className:"text-xl"})})]})},rt=r=>{const{isLoading:s}=oe(),{showAlert:o}=U(),a=E.useLocation(),{isMain:i=!0,headerComponent:l=null,showHeaderOnLogin:d=!1,headerExcludedRoutes:p=[],footerComponent:g=null,showFooterOnLogin:C=!1,footerExcludedRoutes:b=[]}=r,R=p.some(x=>E.matchPath(x,a.pathname));let j;a.pathname==="/"?j=l&&d:j=l&&!R;const m=b.some(x=>E.matchPath(x,a.pathname));let v;return a.pathname==="/"?v=g&&C:v=g&&!m,n.jsxs(n.Fragment,{children:[s&&n.jsx(tt,{}),o&&n.jsx(Ce,{}),j&&l,i?n.jsxs("main",{className:s?"hidden":"",children:[o&&n.jsx(Ce,{}),n.jsx(E.Outlet,{})]}):n.jsx(E.Outlet,{}),v&&g]})},ge=r=>{const{inputType:s,inputId:o,inputPlaceholder:a,inputRequired:i,inputValue:l,inputChange:d,autoFocus:p,inputStyle:g,overrideStyle:C,disabled:b}=r,j=["text","email","password","search","tel","url"].includes(s)?s:"text";return n.jsx("input",{type:j,autoFocus:p,id:o,className:C||`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:l,onChange:d,disabled:b})},he=({label:r,labelId:s,labelStyle:o,overrideStyle:a})=>n.jsx("label",{htmlFor:s,className:a||`show-label mb-2 text-input-label font-medium text-color-label ${o}`,children:r}),ot=()=>{const{title:r,label:s,type:o,placeholder:a,buttonText:i,formData:l,changeData:d,handleLogin:p,overrideStyle:g}=je();return n.jsxs("form",{onSubmit:p,className:g.form||"form-size",children:[n.jsx("h1",{className:g.title||"text-form-title-size show-title title-position m-form-title",children:r}),n.jsxs("div",{className:g.containerEmail||"flex justify-center flex-col gap-1 m-input-form input-size mx-auto",children:[n.jsx(he,{labelId:"user-email",label:s}),n.jsx(ge,{inputType:o,inputId:"user-email",inputPlaceholder:a,inputValue:l.email,inputChange:C=>{d("email",C.target.value)},autoFocus:!0})]}),n.jsxs("div",{className:g.containerPassword||"flex justify-center flex-col gap-1 my-4 input-size mx-auto",children:[n.jsx(he,{labelId:"password",label:"Password"}),n.jsx(ge,{inputType:"password",inputId:"password",inputPlaceholder:"Password",inputValue:l.password,inputChange:C=>{d("password",C.target.value)}})]}),n.jsx("div",{className:g.containerButton||"flex button-position items-center m-primary-button",children:n.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})})]})},nt=({Logo:r})=>{const{styleCardForm:s,styleContainerLogo:o,styleLogo:a,overrideStyle:i}=je(),{firstPrivatePath:l}=H(),d=E.useNavigate();return c.useEffect(()=>{const p=JSON.parse(localStorage.getItem("user"));localStorage.getItem("accessToken")&&p.id&&d(`${l}${p.id}`)},[]),n.jsx("section",{id:"login-page",children:n.jsx("div",{className:i.container||"container mx-auto flex items-center justify-center h-screen",children:n.jsxs("div",{className:i.cardForm||`bg-form card-style card-size flex flex-col sm:flex-row sm:items-center justify-center ${s}`,children:[n.jsx("div",{className:i.containerLogo||`basis-1/2 flex items-center justify-center ${o}`,children:r&&n.jsx(r,{className:i.logo||`login-logo h-full sm:h-auto ${a}`})}),n.jsx(ot,{})]})})})},st=()=>{const{isAuthenticated:r}=ue(),{activeAlert:s}=U(),{autoLogin:o}=H();return c.useEffect(()=>{const a=localStorage.getItem("accessToken");!r&&!a&&!o&&s("danger","Non sei autorizzato")},[]),r===null?null:r?n.jsx(E.Outlet,{}):n.jsx(E.Navigate,{to:"/",replace:!0})},at=()=>{const{logout:r,setCurrentToken:s,createAxiosInstances:o}=ue(),{usersEndpoint:a}=H(),{setIsLoading:i}=oe(),{activeAlert:l}=U(),[d,p]=c.useState(null),[g,C]=c.useState(!1),b=JSON.parse(localStorage.getItem("user")),R=async()=>{try{C(!0);const m=localStorage.getItem("accessToken");if(!m){r(),l("danger","Sessione Scaduta");return}const L=(await(await o()).get(`${a}`,{headers:{Authorization:`Bearer ${m}`}})).data;p(L)}catch(m){console.error(m),i(!1)}finally{C(!1)}},j=()=>{r(),l("info","Hai effettuato il logout")};return c.useEffect(()=>{const m=localStorage.getItem("accessToken");m&&s(m)},[]),n.jsx("section",{children:n.jsxs("div",{className:"container mx-auto py-8",children:[n.jsxs("div",{className:"flex items-center justify-center gap-8 h-20",children:[n.jsxs("h1",{className:"text-4xl text-center text-slate-800",children:["Email: ",b.email]}),n.jsx("button",{onClick:j,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"})]}),n.jsx("div",{className:"flex justify-center items-center my-12 gap-8",children:n.jsx("button",{onClick:R,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:g,children:"Lista degli utenti"})}),n.jsx("div",{className:"flex justify-center items-center",children:d&&n.jsx("ul",{children:d.map(m=>n.jsxs("li",{className:"text-xl my-4",children:[m.id," - ",m.email]},`user-${m.id}`))})})]})})},Nt=r=>t.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",...r},t.createElement("defs",{id:"defs1"},t.createElement("linearGradient",{id:"linearGradient27"},t.createElement("stop",{style:{stopColor:"#ff0000",stopOpacity:1},offset:0,id:"stop27"}),t.createElement("stop",{style:{stopColor:"#ffca00",stopOpacity:.96862745},offset:1,id:"stop28"})),t.createElement("linearGradient",{xlinkHref:"#linearGradient27",id:"linearGradient28",x1:35.001785,y1:192.35495,x2:143.4144,y2:83.942337,gradientUnits:"userSpaceOnUse"}),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter90",x:-.059506074,y:-.12477839,width:1.1465613,height:1.3073246},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:1,floodColor:"rgb(0,0,0)",id:"feFlood89"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:.9,id:"feGaussianBlur89"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset89"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite89"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite90"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter147",x:-.31473854,y:-.27257434,width:1.6432813,height:1.5822092},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(255,255,255)",id:"feFlood146"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:9.5,id:"feGaussianBlur146"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:3.1,id:"feOffset146"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite146"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite147"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter385",x:0,y:0,width:1.0518825,height:1.0518825},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood384"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur384"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset384"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite384"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite385"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter387",x:0,y:0,width:1.0518825,height:1.0518825},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood385"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur385"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset385"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite386"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite387"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter389",x:0,y:0,width:1.0518825,height:1.0518825},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood387"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur387"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset387"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite388"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite389"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter391",x:0,y:0,width:1.0518825,height:1.0518825},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood389"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur389"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset389"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite390"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite391"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter393",x:0,y:0,width:1.0518825,height:1.0518825},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood391"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur391"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset391"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite392"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite393"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter395",x:0,y:0,width:1.0112203,height:1.010137},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood393"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur393"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset393"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite394"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite395"}))),t.createElement("g",{id:"layer1",transform:"translate(-35.001785,-83.942337)"},t.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}),t.createElement("g",{id:"g1",transform:"matrix(0.90701349,0,0,0.90701349,9.3696997,14.003172)",style:{strokeWidth:1.10252}},t.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"}),t.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"})),t.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)"}))),Gt=r=>{const{publicRoutes:s,privateRoutes:o}=Ke(),{firstPrivatePath:a}=H(),{logoImg:i=Nt,pathImg:l="./src/assets/MyWarehouse.svg",firstPrivateElement:d=n.jsx(at,{}),globalLayout:p,isMain:g,headerComponent:C,showHeaderOnLogin:b,headerExcludedRoutes:R,footerComponent:j,showFooterOnLogin:m,footerExcludedRoutes:v,privateProvider:x,customProvider:L}=r,S=p||n.jsx(rt,{isMain:g,headerComponent:C,showHeaderOnLogin:b,headerExcludedRoutes:R,footerComponent:j,showFooterOnLogin:m,footerExcludedRoutes:v}),O=x?c.cloneElement(x,{},L):n.jsx(st,{children:L}),N=()=>{const w=document.querySelector("link[rel='icon']");l&&(w.href=l)};return c.useEffect(()=>{N()},[]),n.jsx(E.Routes,{children:n.jsxs(E.Route,{element:p==="none"?null:S,children:[n.jsxs(E.Route,{path:"/",children:[n.jsx(E.Route,{index:!0,element:n.jsx(nt,{Logo:i})}),s.map((w,G)=>n.jsx(E.Route,{path:w.path,element:w.element},`public-${G}`))]}),n.jsxs(E.Route,{element:O,children:[n.jsx(E.Route,{path:`${a??"/dashboard/"}:id`,element:d}),o.map((w,G)=>n.jsx(E.Route,{path:w.path,element:w.element},`private-${G}`))]})]})})},Tt=({children:r})=>{var i;const s=E.useLocation(),{activeAlert:o}=U(),a=JSON.parse(localStorage.getItem("user"));return c.useEffect(()=>{(!a||!a.admin)&&o("warning","Non puoi accedere a questa pagina")},[a]),!a||!a.admin?n.jsx(E.Navigate,{to:((i=s.state)==null?void 0:i.from)||"/",replace:!0}):r},_t=({spinner:r=!0,spinnerStyle:s,text:o,textStyle:a,children:i,containerStyle:l,overrideStyle:d={}})=>n.jsxs("div",{className:d.container||`w-full h-full relative flex items-center justify-center ${l}`,children:[r&&n.jsx(et,{className:d.spinner||`text-[20rem] animate-spin text-black ${s}`}),i||n.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:o||"Loading..."})]}),we=({isTag:r=!1,value:s,label:o,placeholder:a,id:i,onChange:l,error:d=null})=>n.jsxs("div",{className:`flex items-center justify-center relative ${r?"gap-4 mb-2":"gap-1 m-4"}`,children:[n.jsx(he,{labelId:i,label:o,overrideStyle:`text-xl font-bold text-color-label ${r?"":"basis-1/3"}`}),n.jsx(ge,{type:"text",inputId:i,inputPlaceholder:a,inputValue:s||"",disabled:r,inputChange:l,overrideStyle:`${r?"w-full":"basis-2/3"} ${d?"border-red-600 focus:ring focus:ring-red-600 focus:border-red-600 focus:shadow-[0_0_0_4px_rgba(255,0,0,0.5)]":""} bg-input-bg border border-input-border text-input-text text-input-placeholder input-rounded focus:ring focus:ring-[#16693880] focus:border-[#166938] focus:outline-none focus:shadow-[0_0_0_4px_#16693880] block w-full p-input`}),d&&n.jsx("p",{className:"text-red-600 text-[13px] absolute bottom-0 left-26 translate-y-[20px]",children:d})]}),At=({title:r,showTag:s,value:o,tag:a,showButton:i,handleClick:l})=>n.jsxs("div",{className:`border border-slate-300 rounded-xl p-2 m-2 shadow-xl transition-all duration-700 transform ${r==="TAG B"?"delay-200":"mb-4"} ${s?"opacity-100 translate-y-0":"opacity-0 translate-y-10"}`,children:[n.jsx("h2",{className:"text-center mb-2 text-2xl",children:r}),n.jsx(we,{label:"TID",placeholder:`Leggi ${r}`,id:a?`tid-${a}`:"tid",isTag:!0,value:(o==null?void 0:o.valueTID)||""}),n.jsx(we,{label:"EPC",placeholder:`Leggi ${r}`,id:a?`epc-${a}`:"epc",isTag:!0,value:(o==null?void 0:o.valueEPC)||""}),!i&&n.jsx("div",{className:"flex items-center justify-center",children:n.jsx("button",{onClick:l,disabled:!(o!=null&&o.valueTID)&&!(o!=null&&o.valueEPC),className:"my-1 bg-sky-600 disabled:bg-sky-600/40 text-white px-4 py-2 rounded-lg shadow-md disabled:transition-none disabled:active:translate-y-0 transition-all duration-200 ease-in-out transform active:translate-y-[2px] cursor-pointer uppercase",children:"Scrivi tag"})})]});function It(r){return ne({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M11.04 1.33L12.71 3l.29.71v.33h-.5l-.5.5v-.83l-1.67-1.67H10v4H4v-4H2v10h3l-.5 1H2l-1-1v-10l1-1h8.33l.71.29zM7 5h2V2H7v3zm6.5 0L15 6.5l-.02.69-5.5 5.5-.13.12-.37.37-.1.09-3 1.5-.67-.67 1.5-3 .09-.1.37-.37.12-.13 5.5-5.5h.71zm-6.22 7.24l-.52 1 1.04-.48-.52-.52zm.69-1.03l.79.79 5.15-5.15-.79-.79-5.15 5.15z"},child:[]}]})(r)}const Mt=({minReadingPower:r,maxReadingPower:s,stepRangePower:o,rangeValue:a,setRangeValue:i,show:l,handleClick:d})=>{const p=(a-r)/(s-r)*100;return n.jsxs("div",{className:`border border-slate-300 rounded-xl p-2 m-2 shadow-xl transition-all duration-700 transform ${l?"opacity-100 translate-y-0":"opacity-0 translate-y-10"}`,children:[n.jsx("h2",{className:"text-center my-4 text-2xl",children:"Configurazione Potenza"}),n.jsxs("div",{className:"relative my-12 w-[90%] mx-auto",children:[n.jsx("input",{id:"power",type:"range",min:r,max:s,step:o,value:a,onChange:g=>i(Number(g.target.value)),className:"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer accent-[#16693880]"}),n.jsx("div",{className:"absolute bottom-8 transform -translate-x-1/2 bg-white border border-gray-200 text-sm text-gray-800 py-1 px-2 rounded-lg shadow-md transition-opacity",style:{left:`${p}%`},children:a})]}),n.jsx("div",{className:"flex items-center justify-center my-4",children:n.jsxs("button",{onClick:()=>d(a),className:"py-2 px-4 flex items-center justify-center gap-1 bg-green-600 text-white rounded-lg shadow-md transition duration-200 ease-in-out transform active:translate-y-[2px] cursor-pointer",children:["Salva",n.jsx(It,{})]})})]})},zt=({show:r,isConfigPage:s,handleSelectFile:o})=>n.jsxs("div",{className:`${s?`${r?"opacity-100 translate-y-0 delay-200":"opacity-0 translate-y-10"}`:""} p-4 text-center transition-all duration-700 transform`,children:[n.jsxs("h2",{className:"text-xl my-4",children:["Seleziona il file ",n.jsx("strong",{children:"config.json"})," per recuperare le chiavi univoche del dispositivo"]}),n.jsx("button",{onClick:o,className:"my-4 bg-blue-500 text-white px-4 py-2 rounded-lg",children:"Seleziona file"})]});function Bt(r){return ne({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M312 372c-7.7 0-14 6.3-14 14 0 9.9-8.1 18-18 18H94c-9.9 0-18-8.1-18-18V126c0-9.9 8.1-18 18-18h186c9.9 0 18 8.1 18 18 0 7.7 6.3 14 14 14s14-6.3 14-14c0-25.4-20.6-46-46-46H94c-25.4 0-46 20.6-46 46v260c0 25.4 20.6 46 46 46h186c25.4 0 46-20.6 46-46 0-7.7-6.3-14-14-14z"},child:[]},{tag:"path",attr:{d:"M372.9 158.1c-2.6-2.6-6.1-4.1-9.9-4.1-3.7 0-7.3 1.4-9.9 4.1-5.5 5.5-5.5 14.3 0 19.8l65.2 64.2H162c-7.7 0-14 6.3-14 14s6.3 14 14 14h256.6L355 334.2c-5.4 5.4-5.4 14.3 0 19.8l.1.1c2.7 2.5 6.2 3.9 9.8 3.9 3.8 0 7.3-1.4 9.9-4.1l82.6-82.4c4.3-4.3 6.5-9.3 6.5-14.7 0-5.3-2.3-10.3-6.5-14.5l-84.5-84.2z"},child:[]}]})(r)}function Ft(r){return ne({tag:"svg",attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 9.059v-2.559c0-.256-.098-.512-.293-.708-.195-.195-.451-.292-.707-.292s-.512.097-.707.292l-6.293 6.208 6.293 6.207c.195.195.451.293.707.293s.512-.098.707-.293.293-.452.293-.707v-2.489c2.75.068 5.755.566 8 3.989v-1c0-4.633-3.5-8.443-8-8.941z"},child:[]}]})(r)}const $t=r=>t.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",...r},t.createElement("defs",{id:"defs1"},t.createElement("linearGradient",{id:"linearGradient27"},t.createElement("stop",{style:{stopColor:"#ff0000",stopOpacity:1},offset:0,id:"stop27"}),t.createElement("stop",{style:{stopColor:"#ffca00",stopOpacity:.96862745},offset:1,id:"stop28"})),t.createElement("linearGradient",{xlinkHref:"#linearGradient27",id:"linearGradient28",x1:35.001785,y1:192.35495,x2:143.4144,y2:83.942337,gradientUnits:"userSpaceOnUse"}),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter90",x:-.059506074,y:-.12477839,width:1.1465613,height:1.3073246},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:1,floodColor:"rgb(0,0,0)",id:"feFlood89"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:.9,id:"feGaussianBlur89"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset89"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite89"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite90"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter147",x:-.31473854,y:-.27257434,width:1.6432813,height:1.5822092},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(255,255,255)",id:"feFlood146"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:9.5,id:"feGaussianBlur146"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:3.1,id:"feOffset146"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite146"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite147"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter385",x:0,y:0,width:1.0518825,height:1.0518825},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood384"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur384"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset384"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite384"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite385"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter387",x:0,y:0,width:1.0518825,height:1.0518825},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood385"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur385"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset385"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite386"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite387"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter389",x:0,y:0,width:1.0518825,height:1.0518825},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood387"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur387"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset387"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite388"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite389"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter391",x:0,y:0,width:1.0518825,height:1.0518825},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood389"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur389"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset389"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite390"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite391"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter393",x:0,y:0,width:1.0518825,height:1.0518825},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood391"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur391"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset391"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite392"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite393"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter395",x:0,y:0,width:1.0112203,height:1.010137},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood393"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur393"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset393"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite394"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite395"}))),t.createElement("g",{id:"layer1",transform:"translate(-35.001785,-83.942337)"},t.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}),t.createElement("g",{id:"g1",transform:"matrix(1.0833532,0,0,1.1590115,-13.020803,-26.50933)",style:{strokeWidth:.892424}},t.createElement("path",{style:{fill:"#ffffff",fillOpacity:1,strokeWidth:0,strokeDasharray:"none"},d:"m 93.82567,176.60265 c -0.16819,-0.0337 -1.83675,-0.44258 -3.70792,-0.90862 -1.87115,-0.46603 -6.89404,-1.70738 -11.16196,-2.75855 -4.26793,-1.05118 -7.88422,-1.94532 -8.03621,-1.98697 -0.38441,-0.10533 -0.67366,-0.35309 -0.84014,-0.71961 -0.13464,-0.29646 -0.14169,-0.67022 -0.14329,-7.58613 l -0.002,-7.27432 -1.58638,-0.3886 c -0.8725,-0.21372 -2.73139,-0.66288 -4.13086,-0.99814 -1.66387,-0.39859 -2.62074,-0.66385 -2.76482,-0.76643 -0.45114,-0.32125 -0.67287,-1.17785 -0.44025,-1.70084 0.0507,-0.11391 1.34784,-1.54136 2.88261,-3.17212 1.53477,-1.63075 3.54737,-3.76898 4.47243,-4.75162 0.92507,-0.98264 1.68195,-1.81314 1.68195,-1.84557 0,-0.0324 -2.0126,-2.19745 -4.47244,-4.81117 -2.45984,-2.61372 -4.51389,-4.8454 -4.56455,-4.95928 -0.12411,-0.27898 -0.12207,-0.80663 0.005,-1.10902 0.1372,-0.32836 0.59041,-0.71699 0.94692,-0.81198 0.15823,-0.0422 1.52621,-0.37262 3.03996,-0.73436 4.23151,-1.01121 12.80468,-3.07938 16.20779,-3.90995 3.11435,-0.76008 3.63105,-0.84103 4.02851,-0.63116 0.11325,0.0598 1.10839,1.07202 2.21144,2.24939 1.10304,1.17736 3.10699,3.30654 4.45322,4.73153 l 2.44769,2.59088 0.578,-0.60313 c 0.73001,-0.76177 7.41013,-7.89063 7.89815,-8.42872 0.53305,-0.58777 1.16446,-0.82568 1.67671,-0.6318 0.0974,0.0368 1.94877,0.48807 4.11427,1.00273 2.1655,0.51466 5.55423,1.32534 7.53051,1.80149 1.97627,0.47615 5.17578,1.24703 7.11002,1.71306 1.93424,0.46603 3.61155,0.88516 3.72738,0.93144 0.43966,0.17561 0.81987,0.81095 0.82108,1.37204 2.3e-4,0.10902 -0.077,0.33848 -0.17159,0.50991 -0.14542,0.26349 -2.63982,2.95379 -7.91983,8.54181 -0.59557,0.63032 -1.07365,1.1737 -1.06238,1.20751 0.0113,0.0338 2.01538,2.1792 4.45357,4.76756 2.43818,2.58836 4.49238,4.83165 4.56486,4.9851 0.23209,0.49134 0.12362,1.1068 -0.26923,1.52754 -0.24489,0.26229 -0.46525,0.35629 -1.27692,0.54472 -0.39945,0.0927 -2.13682,0.50971 -3.86082,0.92658 -1.72399,0.41689 -3.21193,0.77599 -3.30654,0.79802 l -0.17202,0.0401 v 7.21184 c 0,5.18025 -0.0245,7.28504 -0.0869,7.4717 -0.0478,0.14293 -0.17678,0.35764 -0.2867,0.47713 -0.21143,0.22984 -0.69257,0.50905 -0.87722,0.50905 -0.0605,0 -4.19891,1.01172 -9.19638,2.24827 -12.94173,3.20224 -13.80448,3.41153 -14.01743,3.4002 -0.10512,-0.005 -0.32874,-0.0378 -0.49695,-0.0714 z m -0.11468,-14.06316 c 0,-6.93801 -0.0266,-12.61456 -0.059,-12.61456 -0.0324,0 -1.13014,1.1439 -2.43938,2.54202 -5.28868,5.6477 -5.75841,6.13463 -6.04581,6.26705 -0.47758,0.22003 0.50027,0.42347 -8.92509,-1.85672 -2.27062,-0.5493 -4.32623,-1.04513 -4.568,-1.10183 l -0.43961,-0.10308 v 6.97711 6.97712 l 0.97477,0.24011 c 6.05221,1.49085 19.20592,4.74159 20.12595,4.97382 0.65175,0.16452 1.22801,0.30235 1.28057,0.30631 0.0761,0.005 0.0956,-2.56285 0.0956,-12.60735 z m 12.57633,9.85252 c 5.92884,-1.46667 10.85676,-2.68431 10.95094,-2.70586 l 0.17122,-0.0392 0.02,-6.99318 c 0.0176,-6.18688 0.006,-6.98914 -0.0948,-6.95814 -0.0631,0.0192 -1.69723,0.41672 -3.63146,0.88324 -1.93423,0.46652 -4.7209,1.1404 -6.1926,1.49752 -3.65266,0.88632 -3.40635,0.8392 -3.78841,0.72474 -0.18605,-0.0557 -0.46352,-0.23294 -0.65085,-0.41565 -0.17959,-0.17516 -2.03807,-2.14184 -4.12994,-4.37042 -2.09186,-2.22857 -3.83203,-4.06342 -3.86703,-4.07743 -0.035,-0.014 -0.0637,5.65667 -0.0637,12.60152 v 12.627 l 0.24846,-0.0537 c 0.13666,-0.0296 5.09935,-1.25375 11.02819,-2.72042 z M 85.323,156.74825 c 0.88524,-0.91925 7.62622,-8.10235 8.03426,-8.56119 0.16287,-0.18314 0.28328,-0.34442 0.26759,-0.35841 -0.03,-0.0267 -1.29081,-0.3341 -7.0621,-1.72171 -1.93424,-0.46507 -6.15811,-1.48175 -9.38639,-2.25933 l -5.8696,-1.41376 -0.51316,0.55367 c -0.28223,0.30453 -0.80894,0.86331 -1.17046,1.24174 -0.52801,0.55274 -4.33277,4.60748 -6.87086,7.32232 -0.2664,0.28496 -0.46871,0.53377 -0.44956,0.55291 0.0191,0.0191 1.89033,0.48037 4.15819,1.02495 9.93967,2.38676 16.93345,4.07196 17.46425,4.20814 0.31536,0.0809 0.59738,0.14912 0.62671,0.15159 0.0293,0.003 0.37634,-0.33095 0.77113,-0.74092 z m 20.23487,0.40117 c 0.77963,-0.18934 3.86015,-0.93125 6.8456,-1.6487 12.24203,-2.94198 13.98307,-3.36382 14.01498,-3.39573 0.0184,-0.0184 -0.23762,-0.32105 -0.56885,-0.67267 -0.33122,-0.35161 -2.18125,-2.32256 -4.11118,-4.37989 -1.92994,-2.05733 -3.69458,-3.93741 -3.92146,-4.17796 l -0.41248,-0.43738 -6.82004,1.63769 c -3.75102,0.90074 -8.29937,1.99733 -10.10746,2.43686 -1.80808,0.43955 -3.76047,0.911 -4.33864,1.04768 -0.57817,0.13668 -1.05122,0.27733 -1.05122,0.31258 0,0.0599 1.97276,2.17716 6.91891,7.42581 1.1353,1.20474 2.07997,2.19169 2.09925,2.1932 0.0193,0.002 0.67295,-0.15217 1.45259,-0.34149 z m -9.33771,-11.00163 c 0.95365,-0.22729 3.67769,-0.88483 6.05344,-1.46119 4.87911,-1.18367 10.14405,-2.45535 11.25754,-2.7191 0.40997,-0.0971 0.7454,-0.19673 0.7454,-0.22138 0,-0.0412 -2.28027,-0.59973 -11.88826,-2.91197 -1.93424,-0.46549 -4.51448,-1.08925 -5.73389,-1.38617 -1.21941,-0.29689 -2.26871,-0.53817 -2.33178,-0.53618 -0.0631,0.002 -1.3876,0.31307 -2.9434,0.69126 -1.55579,0.37819 -4.05004,0.98158 -5.54275,1.34086 -1.49273,0.35928 -4.43422,1.06949 -6.53664,1.57826 -2.10243,0.50877 -4.07201,0.98326 -4.37687,1.05442 -0.30485,0.0712 -0.55427,0.14798 -0.55427,0.17071 0,0.0227 0.61066,0.18561 1.35702,0.36195 0.74636,0.17635 4.83175,1.16061 9.07865,2.18726 4.2469,1.02663 8.08287,1.95378 8.52439,2.06033 0.4415,0.10653 0.88256,0.19606 0.98013,0.19894 0.0976,0.003 0.95764,-0.18071 1.91129,-0.408 z m -23.17527,-5.5068 c 1.61572,-0.38489 15.1372,-3.64431 18.92683,-4.56241 0.91455,-0.22156 1.66283,-0.42236 1.66283,-0.44621 0,-0.0436 -2.17511,-2.37359 -6.49352,-6.95578 -1.28517,-1.36367 -2.37292,-2.52792 -2.41721,-2.58723 -0.0681,-0.0912 -0.25681,-0.0653 -1.22322,0.16776 -2.15241,0.51909 -10.69795,2.57488 -15.92927,3.83208 -2.87653,0.69131 -5.24697,1.27382 -5.26762,1.29447 -0.0458,0.0458 -0.20983,-0.13182 4.76121,5.15371 2.23,2.37108 4.08206,4.35788 4.11569,4.4151 0.0336,0.0572 0.0744,0.10403 0.0906,0.10403 0.0161,0 0.81435,-0.18698 1.7737,-0.41552 z m 44.72625,0.0168 c 0.66764,-0.72696 2.63332,-2.82289 4.6092,-4.91467 3.5914,-3.80204 4.07433,-4.32272 4.04059,-4.35646 -0.0185,-0.0184 -0.89212,-0.23938 -1.94146,-0.49094 -4.03823,-0.96807 -15.40558,-3.70468 -17.84516,-4.29611 l -2.55819,-0.62019 -0.2247,0.25651 c -0.12359,0.14108 -0.76319,0.82417 -1.42134,1.51797 -0.65816,0.6938 -2.25926,2.39677 -3.55803,3.78436 -1.29877,1.38761 -2.68169,2.85649 -3.07316,3.26419 -0.39148,0.40769 -0.71177,0.77302 -0.71177,0.81184 0,0.081 1.22124,0.38162 13.25883,3.26372 4.83252,1.15702 8.80323,2.1205 8.82382,2.14109 0.10179,0.1018 0.26744,0.003 0.60137,-0.36131 z",id:"path1"}),t.createElement("path",{style:{fill:"#d30000",fillOpacity:1,strokeWidth:.892424},d:"m 94.23704,147.39738 c -0.18923,-0.0768 -0.53591,-0.44038 -0.83007,-0.87064 -0.13792,-0.20172 -0.97955,-1.55209 -1.87028,-3.00083 -6.42775,-10.45449 -9.51471,-15.54702 -9.94927,-16.41318 -0.45927,-0.91546 -0.98193,-2.46434 -1.17845,-3.49236 -0.47774,-2.49897 -0.33475,-4.87936 0.43464,-7.23535 1.18651,-3.63329 3.71304,-6.57746 7.14475,-8.32579 1.32203,-0.67352 2.76073,-1.13624 4.31579,-1.38807 1.01828,-0.16489 3.18289,-0.16489 4.20118,0 2.16477,0.35056 4.09681,1.1098 5.90163,2.31918 3.0314,2.03129 5.22702,5.32107 5.95891,8.92844 0.6233,3.07215 0.29346,6.03826 -0.98629,8.86914 -0.35811,0.79216 -3.66707,6.34467 -7.57053,12.70353 -1.14824,1.87052 -2.60138,4.23855 -3.2292,5.2623 -0.78819,1.28523 -1.26572,1.99215 -1.54284,2.28396 -0.39825,0.41935 -0.51902,0.47365 -0.79997,0.35967 z m 1.26593,-20.98125 c 2.28056,-0.3989 4.20147,-2.0406 4.94879,-4.22949 0.29427,-0.86192 0.38048,-1.47914 0.33067,-2.36733 -0.0986,-1.75805 -0.74937,-3.16136 -2.02879,-4.37485 -1.21602,-1.15336 -2.65543,-1.72396 -4.3489,-1.72396 -1.69143,0 -3.13312,0.57083 -4.34528,1.72052 -0.96303,0.91339 -1.53452,1.85482 -1.86842,3.07793 -0.13092,0.47957 -0.1542,0.7208 -0.15122,1.5671 0.003,0.87328 0.0263,1.08366 0.18354,1.65699 0.55902,2.03928 1.99215,3.61954 3.96302,4.36987 1.03786,0.39512 2.18932,0.5004 3.31659,0.30322 z",id:"path2"}),t.createElement("rect",{style:{fill:"#ffffff",fillOpacity:1,fillRule:"evenodd",stroke:"#ff9b01",strokeWidth:0,strokeDasharray:"none",paintOrder:"stroke markers fill"},id:"rect2",width:3.538805,height:1.3867109,x:158.63237,y:137.74451,transform:"matrix(0.98806246,0.1540538,-0.46962192,0.88286763,0,0)"}),t.createElement("rect",{style:{fill:"#ffffff",fillOpacity:1,fillRule:"evenodd",stroke:"#ff9b01",strokeWidth:0,strokeDasharray:"none",paintOrder:"stroke markers fill"},id:"rect3",width:3.1665602,height:1.2219434,x:120.62843,y:170.94601,transform:"matrix(0.98237657,-0.18691248,-0.14496758,0.98943641,0,0)"})),t.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)"}))),Dt=({Logo:r})=>{const{logout:s}=ue(),{activeAlert:o}=U(),{autoLogin:a,configRoutes:i,firstPrivateTitle:l}=H(),{isLoading:d}=oe(),p=E.useLocation(),g=E.useNavigate(),C=()=>{s(),o("info","Hai effettuato il logout")},b=i.find(j=>j.path===p.pathname),R=E.useMatch("home/:id");return n.jsx("header",{className:d?"hidden":"",children:n.jsxs("nav",{className:"h-[60px] flex items-center justify-between px-2 shadow-lg border-b gap-2 border-b-gray-300",children:[n.jsx("figure",{children:r?n.jsx(r,{className:"w-12"}):n.jsx($t,{className:"w-12"})}),n.jsx("div",{children:n.jsx("p",{children:(b==null?void 0:b.title)||l})}),n.jsxs("div",{children:[!a&&R&&n.jsx("button",{className:"h-[48px] w-[48px] flex items-center justify-center bg-red-600 text-white rounded-lg shadow-md transition duration-200 ease-in-out transform active:translate-y-[2px] cursor-pointer",type:"button",onClick:C,children:n.jsx(Bt,{className:"text-4xl w-full"})}),!R&&n.jsx("button",{className:"h-[48px] w-[48px] flex items-center justify-center bg-sky-600 text-white rounded-lg shadow-md transition duration-200 ease-in-out transform active:translate-y-[2px] cursor-pointer",type:"button",onClick:()=>g(-1),children:n.jsx(Ft,{className:"text-4xl w-full"})})]})]})})};Object.defineProperty(exports,"BrowserRouter",{enumerable:!0,get:()=>E.BrowserRouter});Object.defineProperty(exports,"Link",{enumerable:!0,get:()=>E.Link});Object.defineProperty(exports,"NavLink",{enumerable:!0,get:()=>E.NavLink});Object.defineProperty(exports,"Outlet",{enumerable:!0,get:()=>E.Outlet});Object.defineProperty(exports,"Route",{enumerable:!0,get:()=>E.Route});Object.defineProperty(exports,"Routes",{enumerable:!0,get:()=>E.Routes});Object.defineProperty(exports,"useLocation",{enumerable:!0,get:()=>E.useLocation});Object.defineProperty(exports,"useMatch",{enumerable:!0,get:()=>E.useMatch});Object.defineProperty(exports,"useNavigate",{enumerable:!0,get:()=>E.useNavigate});exports.axios=De;exports.Alert=Ce;exports.AlertProvider=Ot;exports.AuthAdmin=Tt;exports.AuthPage=st;exports.AuthProvider=Lt;exports.CardInputRange=Mt;exports.CardInputTag=At;exports.ConfigFileReader=zt;exports.ConfigProvider=pt;exports.Dashboard=at;exports.DefaultLayout=rt;exports.ErrorPage=He;exports.Header=Dt;exports.Input=ge;exports.InputGroup=we;exports.InputLabel=he;exports.Loading=tt;exports.LoadingComponent=_t;exports.LoadingProvider=mt;exports.Login=nt;exports.LoginForm=ot;exports.LoginFormProvider=Pt;exports.PackageRoutes=Gt;exports.RouteProvider=kt;exports.fetchAxiosConfig=Je;exports.useAlert=U;exports.useAuth=ue;exports.useConfig=H;exports.useLoading=oe;exports.useLoginForm=je;exports.useRoutesInjection=Ke;
66
+ </RouteProvider>`);return r},Qe=c.createContext(),Pt=({children:r})=>{const{login:s}=ue(),{clearLoginFormOnError:o}=H(),a={email:"",password:""},[i,l]=c.useState("Accedi"),[d,p]=c.useState("Email"),[g,C]=c.useState("email"),[b,P]=c.useState("example@example.it"),[j,m]=c.useState("Accedi"),[v,x]=c.useState(a),[L,S]=c.useState(),[O,N]=c.useState(),[w,G]=c.useState(),[B,Q]=c.useState(),[q,ee]=c.useState({}),z={overrideStyle:q,setOverrideStyle:ee,title:i,setTitle:l,label:d,setLabel:p,type:g,setType:C,placeholder:b,setPlaceholder:P,buttonText:j,setButtonText:m,formData:v,setFormData:x,LogoImg:L,setLogoImg:S,styleCardForm:O,setStyleCardForm:N,styleContainerLogo:w,setStyleContainerLogo:G,styleLogo:B,setStyleLogo:Q,changeData:(F,$)=>{x(V=>({...V,[F]:$}))},handleLogin:F=>{s(F,v),o&&x(a)}};return n.jsx(Qe.Provider,{value:z,children:r})},je=()=>{const r=c.useContext(Qe);if(r===void 0)throw new Error("Non puoi modificare La login");return r};function et(r){return ne({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:[]}]})(r)}const tt=()=>{const{loadingProps:r}=oe(),{spinner:s=!0,spinnerStyle:o,text:a,textStyle:i,children:l,containerStyle:d,overrideStyle:p={}}=r;return n.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:[s&&n.jsx(et,{className:p.spinner||`text-[20rem] relative animate-spin text-spinner ${o}`}),l||n.jsx("p",{className:p.text||`text-white text-2xl select-none absolute ${i}`,children:a||"Loading..."})]})};function Rt(r){return ne({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:[]}]})(r)}const Ce=()=>{const{messageAlert:r,typeAlert:s,alertConfig:o,getIcon:a,closeAlert:i}=U(),{alertTimeout:l}=H(),[d,p]=c.useState(0),{bgColor:g,textColor:C,buttonBg:b,hoverBg:P,focusRing:j,progressColor:m}=o[s];return c.useEffect(()=>{let v;const L=100/(l/100);v=setInterval(()=>{p(O=>O>=100?(clearInterval(v),100):O+L)},100);const S=setTimeout(()=>{i()},l);return()=>{clearTimeout(S),clearInterval(v)}},[]),n.jsxs("div",{className:`flex items-center p-4 pt-6 ${C} 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:[n.jsx("div",{className:"w-full bg-gray-200 rounded-t-lg overflow-hidden h-2.5 absolute top-0 left-0 right-0",children:n.jsx("div",{className:`${m} h-2.5 rounded-t-lg`,style:{width:`${d}%`}})}),a(s),n.jsx("div",{className:"px-4 text-sm font-medium",children:r}),n.jsx("button",{type:"button",className:`ms-auto ${b} rounded-lg focus:ring-2 ${j} p-1.5 ${P} inline-flex items-center justify-center h-8 w-8 cursor-pointer`,title:"Close",onClick:i,children:n.jsx(Rt,{className:"text-xl"})})]})},rt=r=>{const{isLoading:s}=oe(),{showAlert:o}=U(),a=E.useLocation(),{isMain:i=!0,headerComponent:l=null,showHeaderOnLogin:d=!1,headerExcludedRoutes:p=[],footerComponent:g=null,showFooterOnLogin:C=!1,footerExcludedRoutes:b=[]}=r,P=p.some(x=>E.matchPath(x,a.pathname));let j;a.pathname==="/"?j=l&&d:j=l&&!P;const m=b.some(x=>E.matchPath(x,a.pathname));let v;return a.pathname==="/"?v=g&&C:v=g&&!m,n.jsxs(n.Fragment,{children:[s&&n.jsx(tt,{}),o&&n.jsx(Ce,{}),j&&l,i?n.jsxs("main",{className:s?"hidden":"",children:[o&&n.jsx(Ce,{}),n.jsx(E.Outlet,{})]}):n.jsx(E.Outlet,{}),v&&g]})},ge=r=>{const{inputType:s,inputId:o,inputPlaceholder:a,inputRequired:i,inputValue:l,inputChange:d,autoFocus:p,inputStyle:g,overrideStyle:C,disabled:b}=r,j=["text","email","password","search","tel","url"].includes(s)?s:"text";return n.jsx("input",{type:j,autoFocus:p,id:o,className:C||`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:l,onChange:d,disabled:b})},he=({label:r,labelId:s,labelStyle:o,overrideStyle:a})=>n.jsx("label",{htmlFor:s,className:a||`show-label mb-2 text-input-label font-medium text-color-label ${o}`,children:r}),ot=()=>{const{title:r,label:s,type:o,placeholder:a,buttonText:i,formData:l,changeData:d,handleLogin:p,overrideStyle:g}=je();return n.jsxs("form",{onSubmit:p,className:g.form||"form-size",children:[n.jsx("h1",{className:g.title||"text-form-title-size show-title title-position m-form-title",children:r}),n.jsxs("div",{className:g.containerEmail||"flex justify-center flex-col gap-1 m-input-form input-size mx-auto",children:[n.jsx(he,{labelId:"user-email",label:s}),n.jsx(ge,{inputType:o,inputId:"user-email",inputPlaceholder:a,inputValue:l.email,inputChange:C=>{d("email",C.target.value)},autoFocus:!0})]}),n.jsxs("div",{className:g.containerPassword||"flex justify-center flex-col gap-1 my-4 input-size mx-auto",children:[n.jsx(he,{labelId:"password",label:"Password"}),n.jsx(ge,{inputType:"password",inputId:"password",inputPlaceholder:"Password",inputValue:l.password,inputChange:C=>{d("password",C.target.value)}})]}),n.jsx("div",{className:g.containerButton||"flex button-position items-center m-primary-button",children:n.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})})]})},nt=({Logo:r})=>{const{styleCardForm:s,styleContainerLogo:o,styleLogo:a,overrideStyle:i}=je(),{firstPrivatePath:l}=H(),d=E.useNavigate();return c.useEffect(()=>{const p=JSON.parse(localStorage.getItem("user"));localStorage.getItem("accessToken")&&p.id&&d(`${l}${p.id}`)},[]),n.jsx("section",{id:"login-page",children:n.jsx("div",{className:i.container||"container mx-auto flex items-center justify-center h-screen",children:n.jsxs("div",{className:i.cardForm||`bg-form card-style card-size flex flex-col sm:flex-row sm:items-center justify-center ${s}`,children:[n.jsx("div",{className:i.containerLogo||`basis-1/2 flex items-center justify-center ${o}`,children:r&&n.jsx(r,{className:i.logo||`login-logo h-full sm:h-auto ${a}`})}),n.jsx(ot,{})]})})})},st=()=>{const{isAuthenticated:r}=ue(),{activeAlert:s}=U(),{autoLogin:o}=H();return c.useEffect(()=>{const a=localStorage.getItem("accessToken");!r&&!a&&!o&&s("danger","Non sei autorizzato")},[]),r===null?null:r?n.jsx(E.Outlet,{}):n.jsx(E.Navigate,{to:"/",replace:!0})},at=()=>{const{logout:r,setCurrentToken:s,createAxiosInstances:o}=ue(),{usersEndpoint:a}=H(),{setIsLoading:i}=oe(),{activeAlert:l}=U(),[d,p]=c.useState(null),[g,C]=c.useState(!1),b=JSON.parse(localStorage.getItem("user")),P=async()=>{try{C(!0);const m=localStorage.getItem("accessToken");if(!m){r(),l("danger","Sessione Scaduta");return}const L=(await(await o()).get(`${a}`,{headers:{Authorization:`Bearer ${m}`}})).data;p(L)}catch(m){console.error(m),i(!1)}finally{C(!1)}},j=()=>{r(),l("info","Hai effettuato il logout")};return c.useEffect(()=>{const m=localStorage.getItem("accessToken");m&&s(m)},[]),n.jsx("section",{children:n.jsxs("div",{className:"container mx-auto py-8",children:[n.jsxs("div",{className:"flex items-center justify-center gap-8 h-20",children:[n.jsxs("h1",{className:"text-4xl text-center text-slate-800",children:["Email: ",b.email]}),n.jsx("button",{onClick:j,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"})]}),n.jsx("div",{className:"flex justify-center items-center my-12 gap-8",children:n.jsx("button",{onClick:P,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:g,children:"Lista degli utenti"})}),n.jsx("div",{className:"flex justify-center items-center",children:d&&n.jsx("ul",{children:d.map(m=>n.jsxs("li",{className:"text-xl my-4",children:[m.id," - ",m.email]},`user-${m.id}`))})})]})})},Nt=r=>t.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",...r},t.createElement("defs",{id:"defs1"},t.createElement("linearGradient",{id:"linearGradient27"},t.createElement("stop",{style:{stopColor:"#ff0000",stopOpacity:1},offset:0,id:"stop27"}),t.createElement("stop",{style:{stopColor:"#ffca00",stopOpacity:.96862745},offset:1,id:"stop28"})),t.createElement("linearGradient",{xlinkHref:"#linearGradient27",id:"linearGradient28",x1:35.001785,y1:192.35495,x2:143.4144,y2:83.942337,gradientUnits:"userSpaceOnUse"}),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter90",x:-.059506074,y:-.12477839,width:1.1465613,height:1.3073246},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:1,floodColor:"rgb(0,0,0)",id:"feFlood89"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:.9,id:"feGaussianBlur89"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset89"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite89"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite90"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter147",x:-.31473854,y:-.27257434,width:1.6432813,height:1.5822092},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(255,255,255)",id:"feFlood146"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:9.5,id:"feGaussianBlur146"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:3.1,id:"feOffset146"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite146"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite147"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter385",x:0,y:0,width:1.0518825,height:1.0518825},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood384"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur384"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset384"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite384"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite385"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter387",x:0,y:0,width:1.0518825,height:1.0518825},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood385"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur385"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset385"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite386"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite387"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter389",x:0,y:0,width:1.0518825,height:1.0518825},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood387"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur387"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset387"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite388"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite389"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter391",x:0,y:0,width:1.0518825,height:1.0518825},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood389"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur389"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset389"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite390"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite391"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter393",x:0,y:0,width:1.0518825,height:1.0518825},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood391"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur391"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset391"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite392"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite393"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter395",x:0,y:0,width:1.0112203,height:1.010137},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood393"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur393"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset393"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite394"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite395"}))),t.createElement("g",{id:"layer1",transform:"translate(-35.001785,-83.942337)"},t.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}),t.createElement("g",{id:"g1",transform:"matrix(0.90701349,0,0,0.90701349,9.3696997,14.003172)",style:{strokeWidth:1.10252}},t.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"}),t.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"})),t.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)"}))),Gt=r=>{const{publicRoutes:s,privateRoutes:o}=Ke(),{firstPrivatePath:a}=H(),{logoImg:i=Nt,pathImg:l="./src/assets/MyWarehouse.svg",firstPrivateElement:d=n.jsx(at,{}),globalLayout:p,isMain:g,headerComponent:C,showHeaderOnLogin:b,headerExcludedRoutes:P,footerComponent:j,showFooterOnLogin:m,footerExcludedRoutes:v,privateProvider:x,customProvider:L}=r,S=p||n.jsx(rt,{isMain:g,headerComponent:C,showHeaderOnLogin:b,headerExcludedRoutes:P,footerComponent:j,showFooterOnLogin:m,footerExcludedRoutes:v}),O=x?c.cloneElement(x,{},L):n.jsx(st,{children:L}),N=()=>{const w=document.querySelector("link[rel='icon']");l&&(w.href=l)};return c.useEffect(()=>{N()},[]),n.jsx(E.Routes,{children:n.jsxs(E.Route,{element:p==="none"?null:S,children:[n.jsxs(E.Route,{path:"/",children:[n.jsx(E.Route,{index:!0,element:n.jsx(nt,{Logo:i})}),s.map((w,G)=>n.jsx(E.Route,{path:w.path,element:w.element},`public-${G}`))]}),n.jsxs(E.Route,{element:O,children:[n.jsx(E.Route,{path:`${a??"/dashboard/"}:id`,element:d}),o.map((w,G)=>n.jsx(E.Route,{path:w.path,element:w.element},`private-${G}`))]})]})})},Tt=({children:r})=>{var i;const s=E.useLocation(),{activeAlert:o}=U(),a=JSON.parse(localStorage.getItem("user"));return c.useEffect(()=>{(!a||!a.admin)&&o("warning","Non puoi accedere a questa pagina")},[a]),!a||!a.admin?n.jsx(E.Navigate,{to:((i=s.state)==null?void 0:i.from)||"/",replace:!0}):r},_t=({spinner:r=!0,spinnerStyle:s,text:o,textStyle:a,children:i,containerStyle:l,overrideStyle:d={}})=>n.jsxs("div",{className:d.container||`w-full h-full relative flex items-center justify-center ${l}`,children:[r&&n.jsx(et,{className:d.spinner||`text-[20rem] animate-spin text-black ${s}`}),i||n.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:o||"Loading..."})]}),we=({isTag:r=!1,value:s,label:o,placeholder:a,id:i,onChange:l,error:d=null})=>n.jsxs("div",{className:`flex items-center justify-center relative ${r?"gap-4 mb-2":"gap-1 m-4"}`,children:[n.jsx(he,{labelId:i,label:o,overrideStyle:`text-xl font-bold text-color-label ${r?"":"basis-1/3"}`}),n.jsx(ge,{type:"text",inputId:i,inputPlaceholder:a,inputValue:s||"",disabled:r,inputChange:l,overrideStyle:`${r?"w-full":"basis-2/3"} ${d?"border-red-600 focus:ring focus:ring-red-600 focus:border-red-600 focus:shadow-[0_0_0_4px_rgba(255,0,0,0.5)]":""} bg-input-bg border border-input-border text-input-text text-input-placeholder input-rounded focus:ring focus:ring-[#16693880] focus:border-[#166938] focus:outline-none focus:shadow-[0_0_0_4px_#16693880] block w-full p-input`}),d&&n.jsx("p",{className:"text-red-600 text-[13px] absolute bottom-0 left-26 translate-y-[20px]",children:d})]}),At=({title:r,showTag:s,value:o,tag:a,showButton:i,handleClick:l})=>n.jsxs("div",{className:`border border-slate-300 rounded-xl p-2 m-2 shadow-xl transition-all duration-700 transform ${r==="TAG B"?"delay-200":"mb-4"} ${s?"opacity-100 translate-y-0":"opacity-0 translate-y-10"}`,children:[n.jsx("h2",{className:"text-center mb-2 text-2xl",children:r}),n.jsx(we,{label:"TID",placeholder:`Leggi ${r}`,id:a?`tid-${a}`:"tid",isTag:!0,value:(o==null?void 0:o.valueTID)||""}),n.jsx(we,{label:"EPC",placeholder:`Leggi ${r}`,id:a?`epc-${a}`:"epc",isTag:!0,value:(o==null?void 0:o.valueEPC)||""}),!i&&n.jsx("div",{className:"flex items-center justify-center",children:n.jsx("button",{onClick:l,disabled:!(o!=null&&o.valueTID)&&!(o!=null&&o.valueEPC),className:"my-1 bg-sky-600 disabled:bg-sky-600/40 text-white px-4 py-2 rounded-lg shadow-md disabled:transition-none disabled:active:translate-y-0 transition-all duration-200 ease-in-out transform active:translate-y-[2px] cursor-pointer uppercase",children:"Scrivi tag"})})]});function It(r){return ne({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M11.04 1.33L12.71 3l.29.71v.33h-.5l-.5.5v-.83l-1.67-1.67H10v4H4v-4H2v10h3l-.5 1H2l-1-1v-10l1-1h8.33l.71.29zM7 5h2V2H7v3zm6.5 0L15 6.5l-.02.69-5.5 5.5-.13.12-.37.37-.1.09-3 1.5-.67-.67 1.5-3 .09-.1.37-.37.12-.13 5.5-5.5h.71zm-6.22 7.24l-.52 1 1.04-.48-.52-.52zm.69-1.03l.79.79 5.15-5.15-.79-.79-5.15 5.15z"},child:[]}]})(r)}const Mt=({minReadingPower:r,maxReadingPower:s,stepRangePower:o,rangeValue:a,setRangeValue:i,show:l,handleClick:d})=>{const p=(a-r)/(s-r)*100;return n.jsxs("div",{className:`border border-slate-300 rounded-xl p-2 m-2 shadow-xl transition-all duration-700 transform ${l?"opacity-100 translate-y-0":"opacity-0 translate-y-10"}`,children:[n.jsx("h2",{className:"text-center my-4 text-2xl",children:"Configurazione Potenza"}),n.jsxs("div",{className:"relative my-12 w-[90%] mx-auto",children:[n.jsx("input",{id:"power",type:"range",min:r,max:s,step:o,value:a,onChange:g=>i(Number(g.target.value)),className:"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer accent-[#16693880]"}),n.jsx("div",{className:"absolute bottom-8 transform -translate-x-1/2 bg-white border border-gray-200 text-sm text-gray-800 py-1 px-2 rounded-lg shadow-md transition-opacity",style:{left:`${p}%`},children:a})]}),n.jsx("div",{className:"flex items-center justify-center my-4",children:n.jsxs("button",{onClick:()=>d(a),className:"py-2 px-4 flex items-center justify-center gap-1 bg-green-600 text-white rounded-lg shadow-md transition duration-200 ease-in-out transform active:translate-y-[2px] cursor-pointer",children:["Salva",n.jsx(It,{})]})})]})},zt=({show:r,isConfigPage:s,handleSelectFile:o})=>n.jsxs("div",{className:`${s?`${r?"opacity-100 translate-y-0 delay-200":"opacity-0 translate-y-10"}`:""} p-4 text-center transition-all duration-700 transform`,children:[n.jsxs("h2",{className:"text-xl my-4",children:["Seleziona il file ",n.jsx("strong",{children:"config.json"})," per recuperare le chiavi univoche del dispositivo"]}),n.jsx("button",{onClick:o,className:"my-4 bg-blue-500 text-white px-4 py-2 rounded-lg",children:"Seleziona file"})]});function Bt(r){return ne({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M312 372c-7.7 0-14 6.3-14 14 0 9.9-8.1 18-18 18H94c-9.9 0-18-8.1-18-18V126c0-9.9 8.1-18 18-18h186c9.9 0 18 8.1 18 18 0 7.7 6.3 14 14 14s14-6.3 14-14c0-25.4-20.6-46-46-46H94c-25.4 0-46 20.6-46 46v260c0 25.4 20.6 46 46 46h186c25.4 0 46-20.6 46-46 0-7.7-6.3-14-14-14z"},child:[]},{tag:"path",attr:{d:"M372.9 158.1c-2.6-2.6-6.1-4.1-9.9-4.1-3.7 0-7.3 1.4-9.9 4.1-5.5 5.5-5.5 14.3 0 19.8l65.2 64.2H162c-7.7 0-14 6.3-14 14s6.3 14 14 14h256.6L355 334.2c-5.4 5.4-5.4 14.3 0 19.8l.1.1c2.7 2.5 6.2 3.9 9.8 3.9 3.8 0 7.3-1.4 9.9-4.1l82.6-82.4c4.3-4.3 6.5-9.3 6.5-14.7 0-5.3-2.3-10.3-6.5-14.5l-84.5-84.2z"},child:[]}]})(r)}function Ft(r){return ne({tag:"svg",attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 9.059v-2.559c0-.256-.098-.512-.293-.708-.195-.195-.451-.292-.707-.292s-.512.097-.707.292l-6.293 6.208 6.293 6.207c.195.195.451.293.707.293s.512-.098.707-.293.293-.452.293-.707v-2.489c2.75.068 5.755.566 8 3.989v-1c0-4.633-3.5-8.443-8-8.941z"},child:[]}]})(r)}const $t=r=>t.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",...r},t.createElement("defs",{id:"defs1"},t.createElement("linearGradient",{id:"linearGradient27"},t.createElement("stop",{style:{stopColor:"#ff0000",stopOpacity:1},offset:0,id:"stop27"}),t.createElement("stop",{style:{stopColor:"#ffca00",stopOpacity:.96862745},offset:1,id:"stop28"})),t.createElement("linearGradient",{xlinkHref:"#linearGradient27",id:"linearGradient28",x1:35.001785,y1:192.35495,x2:143.4144,y2:83.942337,gradientUnits:"userSpaceOnUse"}),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter90",x:-.059506074,y:-.12477839,width:1.1465613,height:1.3073246},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:1,floodColor:"rgb(0,0,0)",id:"feFlood89"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:.9,id:"feGaussianBlur89"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset89"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite89"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite90"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter147",x:-.31473854,y:-.27257434,width:1.6432813,height:1.5822092},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(255,255,255)",id:"feFlood146"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:9.5,id:"feGaussianBlur146"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:3.1,id:"feOffset146"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite146"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite147"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter385",x:0,y:0,width:1.0518825,height:1.0518825},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood384"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur384"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset384"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite384"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite385"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter387",x:0,y:0,width:1.0518825,height:1.0518825},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood385"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur385"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset385"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite386"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite387"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter389",x:0,y:0,width:1.0518825,height:1.0518825},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood387"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur387"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset387"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite388"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite389"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter391",x:0,y:0,width:1.0518825,height:1.0518825},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood389"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur389"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset389"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite390"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite391"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter393",x:0,y:0,width:1.0518825,height:1.0518825},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood391"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur391"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset391"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite392"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite393"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter395",x:0,y:0,width:1.0112203,height:1.010137},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood393"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur393"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset393"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite394"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite395"}))),t.createElement("g",{id:"layer1",transform:"translate(-35.001785,-83.942337)"},t.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}),t.createElement("g",{id:"g1",transform:"matrix(1.0833532,0,0,1.1590115,-13.020803,-26.50933)",style:{strokeWidth:.892424}},t.createElement("path",{style:{fill:"#ffffff",fillOpacity:1,strokeWidth:0,strokeDasharray:"none"},d:"m 93.82567,176.60265 c -0.16819,-0.0337 -1.83675,-0.44258 -3.70792,-0.90862 -1.87115,-0.46603 -6.89404,-1.70738 -11.16196,-2.75855 -4.26793,-1.05118 -7.88422,-1.94532 -8.03621,-1.98697 -0.38441,-0.10533 -0.67366,-0.35309 -0.84014,-0.71961 -0.13464,-0.29646 -0.14169,-0.67022 -0.14329,-7.58613 l -0.002,-7.27432 -1.58638,-0.3886 c -0.8725,-0.21372 -2.73139,-0.66288 -4.13086,-0.99814 -1.66387,-0.39859 -2.62074,-0.66385 -2.76482,-0.76643 -0.45114,-0.32125 -0.67287,-1.17785 -0.44025,-1.70084 0.0507,-0.11391 1.34784,-1.54136 2.88261,-3.17212 1.53477,-1.63075 3.54737,-3.76898 4.47243,-4.75162 0.92507,-0.98264 1.68195,-1.81314 1.68195,-1.84557 0,-0.0324 -2.0126,-2.19745 -4.47244,-4.81117 -2.45984,-2.61372 -4.51389,-4.8454 -4.56455,-4.95928 -0.12411,-0.27898 -0.12207,-0.80663 0.005,-1.10902 0.1372,-0.32836 0.59041,-0.71699 0.94692,-0.81198 0.15823,-0.0422 1.52621,-0.37262 3.03996,-0.73436 4.23151,-1.01121 12.80468,-3.07938 16.20779,-3.90995 3.11435,-0.76008 3.63105,-0.84103 4.02851,-0.63116 0.11325,0.0598 1.10839,1.07202 2.21144,2.24939 1.10304,1.17736 3.10699,3.30654 4.45322,4.73153 l 2.44769,2.59088 0.578,-0.60313 c 0.73001,-0.76177 7.41013,-7.89063 7.89815,-8.42872 0.53305,-0.58777 1.16446,-0.82568 1.67671,-0.6318 0.0974,0.0368 1.94877,0.48807 4.11427,1.00273 2.1655,0.51466 5.55423,1.32534 7.53051,1.80149 1.97627,0.47615 5.17578,1.24703 7.11002,1.71306 1.93424,0.46603 3.61155,0.88516 3.72738,0.93144 0.43966,0.17561 0.81987,0.81095 0.82108,1.37204 2.3e-4,0.10902 -0.077,0.33848 -0.17159,0.50991 -0.14542,0.26349 -2.63982,2.95379 -7.91983,8.54181 -0.59557,0.63032 -1.07365,1.1737 -1.06238,1.20751 0.0113,0.0338 2.01538,2.1792 4.45357,4.76756 2.43818,2.58836 4.49238,4.83165 4.56486,4.9851 0.23209,0.49134 0.12362,1.1068 -0.26923,1.52754 -0.24489,0.26229 -0.46525,0.35629 -1.27692,0.54472 -0.39945,0.0927 -2.13682,0.50971 -3.86082,0.92658 -1.72399,0.41689 -3.21193,0.77599 -3.30654,0.79802 l -0.17202,0.0401 v 7.21184 c 0,5.18025 -0.0245,7.28504 -0.0869,7.4717 -0.0478,0.14293 -0.17678,0.35764 -0.2867,0.47713 -0.21143,0.22984 -0.69257,0.50905 -0.87722,0.50905 -0.0605,0 -4.19891,1.01172 -9.19638,2.24827 -12.94173,3.20224 -13.80448,3.41153 -14.01743,3.4002 -0.10512,-0.005 -0.32874,-0.0378 -0.49695,-0.0714 z m -0.11468,-14.06316 c 0,-6.93801 -0.0266,-12.61456 -0.059,-12.61456 -0.0324,0 -1.13014,1.1439 -2.43938,2.54202 -5.28868,5.6477 -5.75841,6.13463 -6.04581,6.26705 -0.47758,0.22003 0.50027,0.42347 -8.92509,-1.85672 -2.27062,-0.5493 -4.32623,-1.04513 -4.568,-1.10183 l -0.43961,-0.10308 v 6.97711 6.97712 l 0.97477,0.24011 c 6.05221,1.49085 19.20592,4.74159 20.12595,4.97382 0.65175,0.16452 1.22801,0.30235 1.28057,0.30631 0.0761,0.005 0.0956,-2.56285 0.0956,-12.60735 z m 12.57633,9.85252 c 5.92884,-1.46667 10.85676,-2.68431 10.95094,-2.70586 l 0.17122,-0.0392 0.02,-6.99318 c 0.0176,-6.18688 0.006,-6.98914 -0.0948,-6.95814 -0.0631,0.0192 -1.69723,0.41672 -3.63146,0.88324 -1.93423,0.46652 -4.7209,1.1404 -6.1926,1.49752 -3.65266,0.88632 -3.40635,0.8392 -3.78841,0.72474 -0.18605,-0.0557 -0.46352,-0.23294 -0.65085,-0.41565 -0.17959,-0.17516 -2.03807,-2.14184 -4.12994,-4.37042 -2.09186,-2.22857 -3.83203,-4.06342 -3.86703,-4.07743 -0.035,-0.014 -0.0637,5.65667 -0.0637,12.60152 v 12.627 l 0.24846,-0.0537 c 0.13666,-0.0296 5.09935,-1.25375 11.02819,-2.72042 z M 85.323,156.74825 c 0.88524,-0.91925 7.62622,-8.10235 8.03426,-8.56119 0.16287,-0.18314 0.28328,-0.34442 0.26759,-0.35841 -0.03,-0.0267 -1.29081,-0.3341 -7.0621,-1.72171 -1.93424,-0.46507 -6.15811,-1.48175 -9.38639,-2.25933 l -5.8696,-1.41376 -0.51316,0.55367 c -0.28223,0.30453 -0.80894,0.86331 -1.17046,1.24174 -0.52801,0.55274 -4.33277,4.60748 -6.87086,7.32232 -0.2664,0.28496 -0.46871,0.53377 -0.44956,0.55291 0.0191,0.0191 1.89033,0.48037 4.15819,1.02495 9.93967,2.38676 16.93345,4.07196 17.46425,4.20814 0.31536,0.0809 0.59738,0.14912 0.62671,0.15159 0.0293,0.003 0.37634,-0.33095 0.77113,-0.74092 z m 20.23487,0.40117 c 0.77963,-0.18934 3.86015,-0.93125 6.8456,-1.6487 12.24203,-2.94198 13.98307,-3.36382 14.01498,-3.39573 0.0184,-0.0184 -0.23762,-0.32105 -0.56885,-0.67267 -0.33122,-0.35161 -2.18125,-2.32256 -4.11118,-4.37989 -1.92994,-2.05733 -3.69458,-3.93741 -3.92146,-4.17796 l -0.41248,-0.43738 -6.82004,1.63769 c -3.75102,0.90074 -8.29937,1.99733 -10.10746,2.43686 -1.80808,0.43955 -3.76047,0.911 -4.33864,1.04768 -0.57817,0.13668 -1.05122,0.27733 -1.05122,0.31258 0,0.0599 1.97276,2.17716 6.91891,7.42581 1.1353,1.20474 2.07997,2.19169 2.09925,2.1932 0.0193,0.002 0.67295,-0.15217 1.45259,-0.34149 z m -9.33771,-11.00163 c 0.95365,-0.22729 3.67769,-0.88483 6.05344,-1.46119 4.87911,-1.18367 10.14405,-2.45535 11.25754,-2.7191 0.40997,-0.0971 0.7454,-0.19673 0.7454,-0.22138 0,-0.0412 -2.28027,-0.59973 -11.88826,-2.91197 -1.93424,-0.46549 -4.51448,-1.08925 -5.73389,-1.38617 -1.21941,-0.29689 -2.26871,-0.53817 -2.33178,-0.53618 -0.0631,0.002 -1.3876,0.31307 -2.9434,0.69126 -1.55579,0.37819 -4.05004,0.98158 -5.54275,1.34086 -1.49273,0.35928 -4.43422,1.06949 -6.53664,1.57826 -2.10243,0.50877 -4.07201,0.98326 -4.37687,1.05442 -0.30485,0.0712 -0.55427,0.14798 -0.55427,0.17071 0,0.0227 0.61066,0.18561 1.35702,0.36195 0.74636,0.17635 4.83175,1.16061 9.07865,2.18726 4.2469,1.02663 8.08287,1.95378 8.52439,2.06033 0.4415,0.10653 0.88256,0.19606 0.98013,0.19894 0.0976,0.003 0.95764,-0.18071 1.91129,-0.408 z m -23.17527,-5.5068 c 1.61572,-0.38489 15.1372,-3.64431 18.92683,-4.56241 0.91455,-0.22156 1.66283,-0.42236 1.66283,-0.44621 0,-0.0436 -2.17511,-2.37359 -6.49352,-6.95578 -1.28517,-1.36367 -2.37292,-2.52792 -2.41721,-2.58723 -0.0681,-0.0912 -0.25681,-0.0653 -1.22322,0.16776 -2.15241,0.51909 -10.69795,2.57488 -15.92927,3.83208 -2.87653,0.69131 -5.24697,1.27382 -5.26762,1.29447 -0.0458,0.0458 -0.20983,-0.13182 4.76121,5.15371 2.23,2.37108 4.08206,4.35788 4.11569,4.4151 0.0336,0.0572 0.0744,0.10403 0.0906,0.10403 0.0161,0 0.81435,-0.18698 1.7737,-0.41552 z m 44.72625,0.0168 c 0.66764,-0.72696 2.63332,-2.82289 4.6092,-4.91467 3.5914,-3.80204 4.07433,-4.32272 4.04059,-4.35646 -0.0185,-0.0184 -0.89212,-0.23938 -1.94146,-0.49094 -4.03823,-0.96807 -15.40558,-3.70468 -17.84516,-4.29611 l -2.55819,-0.62019 -0.2247,0.25651 c -0.12359,0.14108 -0.76319,0.82417 -1.42134,1.51797 -0.65816,0.6938 -2.25926,2.39677 -3.55803,3.78436 -1.29877,1.38761 -2.68169,2.85649 -3.07316,3.26419 -0.39148,0.40769 -0.71177,0.77302 -0.71177,0.81184 0,0.081 1.22124,0.38162 13.25883,3.26372 4.83252,1.15702 8.80323,2.1205 8.82382,2.14109 0.10179,0.1018 0.26744,0.003 0.60137,-0.36131 z",id:"path1"}),t.createElement("path",{style:{fill:"#d30000",fillOpacity:1,strokeWidth:.892424},d:"m 94.23704,147.39738 c -0.18923,-0.0768 -0.53591,-0.44038 -0.83007,-0.87064 -0.13792,-0.20172 -0.97955,-1.55209 -1.87028,-3.00083 -6.42775,-10.45449 -9.51471,-15.54702 -9.94927,-16.41318 -0.45927,-0.91546 -0.98193,-2.46434 -1.17845,-3.49236 -0.47774,-2.49897 -0.33475,-4.87936 0.43464,-7.23535 1.18651,-3.63329 3.71304,-6.57746 7.14475,-8.32579 1.32203,-0.67352 2.76073,-1.13624 4.31579,-1.38807 1.01828,-0.16489 3.18289,-0.16489 4.20118,0 2.16477,0.35056 4.09681,1.1098 5.90163,2.31918 3.0314,2.03129 5.22702,5.32107 5.95891,8.92844 0.6233,3.07215 0.29346,6.03826 -0.98629,8.86914 -0.35811,0.79216 -3.66707,6.34467 -7.57053,12.70353 -1.14824,1.87052 -2.60138,4.23855 -3.2292,5.2623 -0.78819,1.28523 -1.26572,1.99215 -1.54284,2.28396 -0.39825,0.41935 -0.51902,0.47365 -0.79997,0.35967 z m 1.26593,-20.98125 c 2.28056,-0.3989 4.20147,-2.0406 4.94879,-4.22949 0.29427,-0.86192 0.38048,-1.47914 0.33067,-2.36733 -0.0986,-1.75805 -0.74937,-3.16136 -2.02879,-4.37485 -1.21602,-1.15336 -2.65543,-1.72396 -4.3489,-1.72396 -1.69143,0 -3.13312,0.57083 -4.34528,1.72052 -0.96303,0.91339 -1.53452,1.85482 -1.86842,3.07793 -0.13092,0.47957 -0.1542,0.7208 -0.15122,1.5671 0.003,0.87328 0.0263,1.08366 0.18354,1.65699 0.55902,2.03928 1.99215,3.61954 3.96302,4.36987 1.03786,0.39512 2.18932,0.5004 3.31659,0.30322 z",id:"path2"}),t.createElement("rect",{style:{fill:"#ffffff",fillOpacity:1,fillRule:"evenodd",stroke:"#ff9b01",strokeWidth:0,strokeDasharray:"none",paintOrder:"stroke markers fill"},id:"rect2",width:3.538805,height:1.3867109,x:158.63237,y:137.74451,transform:"matrix(0.98806246,0.1540538,-0.46962192,0.88286763,0,0)"}),t.createElement("rect",{style:{fill:"#ffffff",fillOpacity:1,fillRule:"evenodd",stroke:"#ff9b01",strokeWidth:0,strokeDasharray:"none",paintOrder:"stroke markers fill"},id:"rect3",width:3.1665602,height:1.2219434,x:120.62843,y:170.94601,transform:"matrix(0.98237657,-0.18691248,-0.14496758,0.98943641,0,0)"})),t.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)"}))),Dt=({Logo:r})=>{const{logout:s}=ue(),{activeAlert:o}=U(),{autoLogin:a,configRoutes:i,firstPrivateTitle:l,showHeaderButton:d}=H(),{isLoading:p}=oe(),g=E.useLocation(),C=E.useNavigate(),b=()=>{s(),o("info","Hai effettuato il logout")},P=i.find(m=>m.path===g.pathname),j=E.useMatch("home/:id");return n.jsx("header",{className:p?"hidden":"",children:n.jsxs("nav",{className:"h-[60px] flex items-center justify-between px-2 shadow-lg border-b gap-2 border-b-gray-300",children:[n.jsx("figure",{children:r?n.jsx(r,{className:"w-12"}):n.jsx($t,{className:"w-12"})}),n.jsx("div",{children:n.jsx("p",{children:(P==null?void 0:P.title)||l})}),n.jsxs("div",{children:[!a&&j&&n.jsx("button",{className:"h-[48px] w-[48px] flex items-center justify-center bg-red-600 text-white rounded-lg shadow-md transition duration-200 ease-in-out transform active:translate-y-[2px] cursor-pointer",type:"button",onClick:b,children:n.jsx(Bt,{className:"text-4xl w-full"})}),!j&&d&&n.jsx("button",{className:"h-[48px] w-[48px] flex items-center justify-center bg-sky-600 text-white rounded-lg shadow-md transition duration-200 ease-in-out transform active:translate-y-[2px] cursor-pointer",type:"button",onClick:()=>C(-1),children:n.jsx(Ft,{className:"text-4xl w-full"})})]})]})})};Object.defineProperty(exports,"BrowserRouter",{enumerable:!0,get:()=>E.BrowserRouter});Object.defineProperty(exports,"Link",{enumerable:!0,get:()=>E.Link});Object.defineProperty(exports,"NavLink",{enumerable:!0,get:()=>E.NavLink});Object.defineProperty(exports,"Outlet",{enumerable:!0,get:()=>E.Outlet});Object.defineProperty(exports,"Route",{enumerable:!0,get:()=>E.Route});Object.defineProperty(exports,"Routes",{enumerable:!0,get:()=>E.Routes});Object.defineProperty(exports,"useLocation",{enumerable:!0,get:()=>E.useLocation});Object.defineProperty(exports,"useMatch",{enumerable:!0,get:()=>E.useMatch});Object.defineProperty(exports,"useNavigate",{enumerable:!0,get:()=>E.useNavigate});exports.axios=De;exports.Alert=Ce;exports.AlertProvider=Ot;exports.AuthAdmin=Tt;exports.AuthPage=st;exports.AuthProvider=Lt;exports.CardInputRange=Mt;exports.CardInputTag=At;exports.ConfigFileReader=zt;exports.ConfigProvider=pt;exports.Dashboard=at;exports.DefaultLayout=rt;exports.ErrorPage=He;exports.Header=Dt;exports.Input=ge;exports.InputGroup=we;exports.InputLabel=he;exports.Loading=tt;exports.LoadingComponent=_t;exports.LoadingProvider=mt;exports.Login=nt;exports.LoginForm=ot;exports.LoginFormProvider=Pt;exports.PackageRoutes=Gt;exports.RouteProvider=kt;exports.fetchAxiosConfig=Je;exports.useAlert=U;exports.useAuth=ue;exports.useConfig=H;exports.useLoading=oe;exports.useLoginForm=je;exports.useRoutesInjection=Ke;
@@ -1,5 +1,5 @@
1
1
  import * as t from "react";
2
- import H, { createContext as ie, useState as C, useContext as se, useEffect as M } from "react";
2
+ import H, { createContext as ie, useState as w, useContext as se, useEffect as M } from "react";
3
3
  import at from "jwt-decode";
4
4
  import { useNavigate as ke, useLocation as Le, matchPath as $e, Outlet as je, Navigate as Je, Routes as lt, Route as Q, useMatch as ct } from "react-router-dom";
5
5
  import { BrowserRouter as i0, Link as s0, NavLink as a0, Outlet as l0, Route as c0, Routes as f0, useLocation as u0, useMatch as d0, useNavigate as m0 } from "react-router-dom";
@@ -214,11 +214,11 @@ function dt() {
214
214
  }
215
215
  };
216
216
  G.DetermineComponentFrameRoot.displayName = "DetermineComponentFrameRoot";
217
- var L = Object.getOwnPropertyDescriptor(
217
+ var P = Object.getOwnPropertyDescriptor(
218
218
  G.DetermineComponentFrameRoot,
219
219
  "name"
220
220
  );
221
- L && L.configurable && Object.defineProperty(
221
+ P && P.configurable && Object.defineProperty(
222
222
  G.DetermineComponentFrameRoot,
223
223
  "name",
224
224
  { value: "DetermineComponentFrameRoot" }
@@ -228,30 +228,30 @@ function dt() {
228
228
  var _ = D.split(`
229
229
  `), K = oe.split(`
230
230
  `);
231
- for (h = L = 0; L < _.length && !_[L].includes(
231
+ for (h = P = 0; P < _.length && !_[P].includes(
232
232
  "DetermineComponentFrameRoot"
233
233
  ); )
234
- L++;
234
+ P++;
235
235
  for (; h < K.length && !K[h].includes(
236
236
  "DetermineComponentFrameRoot"
237
237
  ); )
238
238
  h++;
239
- if (L === _.length || h === K.length)
240
- for (L = _.length - 1, h = K.length - 1; 1 <= L && 0 <= h && _[L] !== K[h]; )
239
+ if (P === _.length || h === K.length)
240
+ for (P = _.length - 1, h = K.length - 1; 1 <= P && 0 <= h && _[P] !== K[h]; )
241
241
  h--;
242
- for (; 1 <= L && 0 <= h; L--, h--)
243
- if (_[L] !== K[h]) {
244
- if (L !== 1 || h !== 1)
242
+ for (; 1 <= P && 0 <= h; P--, h--)
243
+ if (_[P] !== K[h]) {
244
+ if (P !== 1 || h !== 1)
245
245
  do
246
- if (L--, h--, 0 > h || _[L] !== K[h]) {
246
+ if (P--, h--, 0 > h || _[P] !== K[h]) {
247
247
  var fe = `
248
- ` + _[L].replace(
248
+ ` + _[P].replace(
249
249
  " at new ",
250
250
  " at "
251
251
  );
252
252
  return e.displayName && fe.includes("<anonymous>") && (fe = fe.replace("<anonymous>", e.displayName)), typeof e == "function" && we.set(e, fe), fe;
253
253
  }
254
- while (1 <= L && 0 <= h);
254
+ while (1 <= P && 0 <= h);
255
255
  break;
256
256
  }
257
257
  }
@@ -302,7 +302,7 @@ function dt() {
302
302
  }
303
303
  return e.key !== void 0;
304
304
  }
305
- function P(e, c) {
305
+ function L(e, c) {
306
306
  function f() {
307
307
  Me || (Me = !0, console.error(
308
308
  "%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)",
@@ -314,22 +314,22 @@ function dt() {
314
314
  configurable: !0
315
315
  });
316
316
  }
317
- function w() {
317
+ function C() {
318
318
  var e = r(this.type);
319
319
  return ze[e] || (ze[e] = !0, console.error(
320
320
  "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."
321
321
  )), e = this.props.ref, e !== void 0 ? e : null;
322
322
  }
323
- function d(e, c, f, b, G, L) {
324
- return f = L.ref, e = {
323
+ function d(e, c, f, b, G, P) {
324
+ return f = P.ref, e = {
325
325
  $$typeof: E,
326
326
  type: e,
327
327
  key: c,
328
- props: L,
328
+ props: P,
329
329
  _owner: G
330
330
  }, (f !== void 0 ? f : null) !== null ? Object.defineProperty(e, "ref", {
331
331
  enumerable: !1,
332
- get: w
332
+ get: C
333
333
  }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
334
334
  configurable: !1,
335
335
  enumerable: !1,
@@ -342,7 +342,7 @@ function dt() {
342
342
  value: null
343
343
  }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
344
344
  }
345
- function x(e, c, f, b, G, L) {
345
+ function x(e, c, f, b, G, P) {
346
346
  if (typeof e == "string" || typeof e == "function" || e === B || e === q || e === te || e === z || e === F || e === be || typeof e == "object" && e !== null && (e.$$typeof === V || e.$$typeof === $ || e.$$typeof === le || e.$$typeof === re || e.$$typeof === J || e.$$typeof === T || e.getModuleId !== void 0)) {
347
347
  var h = c.children;
348
348
  if (h !== void 0)
@@ -385,10 +385,10 @@ React keys must be passed directly to JSX without using spread:
385
385
  for (var oe in c)
386
386
  oe !== "key" && (f[oe] = c[oe]);
387
387
  } else f = c;
388
- return h && P(
388
+ return h && L(
389
389
  f,
390
390
  typeof e == "function" ? e.displayName || e.name || "Unknown" : e
391
- ), d(e, h, L, G, y(), f);
391
+ ), d(e, h, P, G, y(), f);
392
392
  }
393
393
  function g(e, c) {
394
394
  if (typeof e == "object" && e && e.$$typeof !== st) {
@@ -447,7 +447,7 @@ function mt() {
447
447
  }
448
448
  var o = mt();
449
449
  const Ve = ie(), Ht = ({ children: r }) => {
450
- const [i, n] = C(!1), [s, a] = C(!1), [l, u] = C({});
450
+ const [i, n] = w(!1), [s, a] = w(!1), [l, u] = w({});
451
451
  return /* @__PURE__ */ o.jsx(Ve.Provider, { value: { isLoading: i, setIsLoading: n, isLoadingComponent: s, setIsLoadingComponent: a, loadingProps: l, setLoadingProps: u }, children: r });
452
452
  }, me = () => {
453
453
  const r = se(Ve);
@@ -457,7 +457,7 @@ const Ve = ie(), Ht = ({ children: r }) => {
457
457
  /* @__PURE__ */ o.jsx("h1", { className: "text-center text-8xl my-12", children: "Errore" }),
458
458
  /* @__PURE__ */ o.jsx("pre", { className: "text-xl", children: r })
459
459
  ] }) }), Xe = ie(), Yt = ({ children: r }) => {
460
- const [i, n] = C({}), [s, a] = C(!1), l = `Creare un file config.json in public per il corretto funzionamento
460
+ const [i, n] = w({}), [s, a] = w(!1), l = `Creare un file config.json in public per il corretto funzionamento
461
461
  Esempio di config.json:
462
462
 
463
463
  {
@@ -470,19 +470,20 @@ Esempio di config.json:
470
470
  "configRoutes": [
471
471
  {"path": "", "title": "", "element": ""}
472
472
  ],
473
- "infiniteSession": " ,
474
- "timeDeducted": " ,
475
- "alertTimeout": " ,
476
- "axiosTimeout": " ,
473
+ "infiniteSession": "" ,
474
+ "timeDeducted": "" ,
475
+ "alertTimeout": "",
476
+ "axiosTimeout": "" ,
477
477
  "axiosErrors": {
478
478
  "unauthorized":"",
479
479
  "notFound": "",
480
480
  "defaultMessage": ""
481
481
  },
482
- "clearLoginFormOnError": " ,
483
- "autoLogin": " ,
482
+ "clearLoginFormOnError": "" ,
483
+ "autoLogin": "" ,
484
484
  "backendToken": "",
485
- "isDebug": ""
485
+ "isDebug": "",
486
+ "showHeaderButton": ""
486
487
  }`, u = () => {
487
488
  const d = /* @__PURE__ */ new Date(), x = String(d.getDate()).padStart(2, "0"), g = 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");
488
489
  return `${x}/${g}/${O} ${j}:${S}:${R}`;
@@ -518,9 +519,9 @@ Esempio di config.json:
518
519
  g = await p(d, x), g && x++;
519
520
  while (g);
520
521
  return x;
521
- }, P = async (d, x) => {
522
+ }, L = async (d, x) => {
522
523
  x.id || (x.id = await v(d)), await y(d, x);
523
- }, w = async () => {
524
+ }, C = async () => {
524
525
  try {
525
526
  const g = {
526
527
  ...await (await fetch("/config.json")).json(),
@@ -528,7 +529,7 @@ Esempio di config.json:
528
529
  getDataIndexedDB: p,
529
530
  setDataIndexedDB: y,
530
531
  generateUniqueId: v,
531
- setDataWithAutoId: P,
532
+ setDataWithAutoId: L,
532
533
  setCurrentDate: u
533
534
  };
534
535
  n(g);
@@ -537,7 +538,7 @@ Esempio di config.json:
537
538
  }
538
539
  };
539
540
  return M(() => {
540
- w();
541
+ C();
541
542
  }, []), Object.keys(i).length === 0 ? /* @__PURE__ */ o.jsx(pt, { errorShow: s, errorMessage: l }) : /* @__PURE__ */ o.jsx(Xe.Provider, { value: i, children: r });
542
543
  }, U = () => {
543
544
  const r = se(Xe);
@@ -656,7 +657,7 @@ function St(r) {
656
657
  return ae({ 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: [] }] })(r);
657
658
  }
658
659
  const et = ie(), Zt = ({ children: r }) => {
659
- const [i, n] = C(!1), [s, a] = C(), [l, u] = C(), P = {
660
+ const [i, n] = w(!1), [s, a] = w(), [l, u] = w(), L = {
660
661
  showAlert: i,
661
662
  setShowAlert: n,
662
663
  typeAlert: s,
@@ -697,8 +698,8 @@ const et = ie(), Zt = ({ children: r }) => {
697
698
  progressColor: "bg-warning-progress"
698
699
  }
699
700
  },
700
- getIcon: (w) => {
701
- switch (w) {
701
+ getIcon: (C) => {
702
+ switch (C) {
702
703
  case "danger":
703
704
  return /* @__PURE__ */ o.jsx(ht, { className: "w-[20px] h-[20px]" });
704
705
  case "info":
@@ -712,13 +713,13 @@ const et = ie(), Zt = ({ children: r }) => {
712
713
  closeAlert: () => {
713
714
  n(!i);
714
715
  },
715
- activeAlert: (w, d) => {
716
+ activeAlert: (C, d) => {
716
717
  n(!1), setTimeout(() => {
717
- a(w), u(d), n(!0);
718
+ a(C), u(d), n(!0);
718
719
  }, 50);
719
720
  }
720
721
  };
721
- return /* @__PURE__ */ o.jsx(et.Provider, { value: P, children: r });
722
+ return /* @__PURE__ */ o.jsx(et.Provider, { value: L, children: r });
722
723
  }, ee = () => {
723
724
  const r = se(et);
724
725
  if (r === void 0) throw new Error("Non puoi modificare l'alert");
@@ -755,10 +756,10 @@ const Ot = async (r, i, n) => {
755
756
  console.error(s);
756
757
  }
757
758
  }, tt = ie(), Ut = ({ children: r }) => {
758
- const { heartbeatEndpoint: i, firstPrivatePath: n, infiniteSession: s, timeDeducted: a, authenticatedEndpoint: l, autoLogin: u, autoLoginEmail: m, autoLoginPassword: p, setCurrentDate: y, isDebug: v, backendToken: P } = U(), { setIsLoading: w } = me(), { setShowAlert: d, setMessageAlert: x, setTypeAlert: g, activeAlert: O } = ee(), j = ke(), [S, R] = C(null), [E, N] = C(), [B, te] = C(), [q, re] = C(), [le, J] = C(!1), z = async () => await Ot(d, g, x), F = async (k = null, I) => {
759
+ const { heartbeatEndpoint: i, firstPrivatePath: n, infiniteSession: s, timeDeducted: a, authenticatedEndpoint: l, autoLogin: u, autoLoginEmail: m, autoLoginPassword: p, setCurrentDate: y, isDebug: v, backendToken: L } = U(), { setIsLoading: C } = me(), { setShowAlert: d, setMessageAlert: x, setTypeAlert: g, activeAlert: O } = ee(), j = ke(), [S, R] = w(null), [E, N] = w(), [B, te] = w(), [q, re] = w(), [le, J] = w(!1), z = async () => await Ot(d, g, x), F = async (k = null, I) => {
759
760
  k && k.preventDefault(), J(!0);
760
761
  try {
761
- w(!0), d(!1);
762
+ C(!0), d(!1);
762
763
  const T = await (await z()).post(l, {
763
764
  auth: I
764
765
  }), X = T.headers.token, Y = T.data;
@@ -766,7 +767,7 @@ const Ot = async (r, i, n) => {
766
767
  } catch (A) {
767
768
  console.error(A);
768
769
  } finally {
769
- J(!1), w(!1);
770
+ J(!1), C(!1);
770
771
  }
771
772
  }, $ = () => {
772
773
  localStorage.removeItem("accessToken"), localStorage.removeItem("id"), localStorage.removeItem("user"), R(!1), N(null);
@@ -812,9 +813,9 @@ const Ot = async (r, i, n) => {
812
813
  return;
813
814
  }
814
815
  }, []), M(() => {
815
- u && ce(P);
816
+ u && ce(L);
816
817
  }, [u]), M(() => {
817
- S || u && !le && ce(P);
818
+ S || u && !le && ce(L);
818
819
  }, [S]), M(() => {
819
820
  if (u) return;
820
821
  be();
@@ -861,7 +862,7 @@ Esempio:
861
862
  const { login: i } = ve(), { clearLoginFormOnError: n } = U(), s = {
862
863
  email: "",
863
864
  password: ""
864
- }, [a, l] = C("Accedi"), [u, m] = C("Email"), [p, y] = C("email"), [v, P] = C("example@example.it"), [w, d] = C("Accedi"), [x, g] = C(s), [O, j] = C(), [S, R] = C(), [E, N] = C(), [B, te] = C(), [q, re] = C({}), z = {
865
+ }, [a, l] = w("Accedi"), [u, m] = w("Email"), [p, y] = w("email"), [v, L] = w("example@example.it"), [C, d] = w("Accedi"), [x, g] = w(s), [O, j] = w(), [S, R] = w(), [E, N] = w(), [B, te] = w(), [q, re] = w({}), z = {
865
866
  overrideStyle: q,
866
867
  setOverrideStyle: re,
867
868
  title: a,
@@ -871,8 +872,8 @@ Esempio:
871
872
  type: p,
872
873
  setType: y,
873
874
  placeholder: v,
874
- setPlaceholder: P,
875
- buttonText: w,
875
+ setPlaceholder: L,
876
+ buttonText: C,
876
877
  setButtonText: d,
877
878
  formData: x,
878
879
  setFormData: g,
@@ -911,7 +912,7 @@ function Pt(r) {
911
912
  return ae({ 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: [] }] })(r);
912
913
  }
913
914
  const Ue = () => {
914
- const { messageAlert: r, typeAlert: i, alertConfig: n, getIcon: s, closeAlert: a } = ee(), { alertTimeout: l } = U(), [u, m] = C(0), { bgColor: p, textColor: y, buttonBg: v, hoverBg: P, focusRing: w, progressColor: d } = n[i];
915
+ const { messageAlert: r, typeAlert: i, alertConfig: n, getIcon: s, closeAlert: a } = ee(), { alertTimeout: l } = U(), [u, m] = w(0), { bgColor: p, textColor: y, buttonBg: v, hoverBg: L, focusRing: C, progressColor: d } = n[i];
915
916
  return M(() => {
916
917
  let x;
917
918
  const O = 100 / (l / 100);
@@ -932,7 +933,7 @@ const Ue = () => {
932
933
  "button",
933
934
  {
934
935
  type: "button",
935
- className: `ms-auto ${v} rounded-lg focus:ring-2 ${w} p-1.5 ${P} inline-flex items-center justify-center h-8 w-8 cursor-pointer`,
936
+ className: `ms-auto ${v} rounded-lg focus:ring-2 ${C} p-1.5 ${L} inline-flex items-center justify-center h-8 w-8 cursor-pointer`,
936
937
  title: "Close",
937
938
  onClick: a,
938
939
  children: /* @__PURE__ */ o.jsx(Pt, { className: "text-xl" })
@@ -948,15 +949,15 @@ const Ue = () => {
948
949
  footerComponent: p = null,
949
950
  showFooterOnLogin: y = !1,
950
951
  footerExcludedRoutes: v = []
951
- } = r, P = m.some((g) => $e(g, s.pathname));
952
- let w;
953
- s.pathname === "/" ? w = l && u : w = l && !P;
952
+ } = r, L = m.some((g) => $e(g, s.pathname));
953
+ let C;
954
+ s.pathname === "/" ? C = l && u : C = l && !L;
954
955
  const d = v.some((g) => $e(g, s.pathname));
955
956
  let x;
956
957
  return s.pathname === "/" ? x = p && y : x = p && !d, /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
957
958
  i && /* @__PURE__ */ o.jsx(Lt, {}),
958
959
  n && /* @__PURE__ */ o.jsx(Ue, {}),
959
- w && l,
960
+ C && l,
960
961
  a ? /* @__PURE__ */ o.jsxs("main", { className: i ? "hidden" : "", children: [
961
962
  n && /* @__PURE__ */ o.jsx(Ue, {}),
962
963
  /* @__PURE__ */ o.jsx(je, {})
@@ -975,11 +976,11 @@ const Ue = () => {
975
976
  inputStyle: p,
976
977
  overrideStyle: y,
977
978
  disabled: v
978
- } = r, w = ["text", "email", "password", "search", "tel", "url"].includes(i) ? i : "text";
979
+ } = r, C = ["text", "email", "password", "search", "tel", "url"].includes(i) ? i : "text";
979
980
  return /* @__PURE__ */ o.jsx(
980
981
  "input",
981
982
  {
982
- type: w,
983
+ type: C,
983
984
  autoFocus: m,
984
985
  id: n,
985
986
  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 ${p}`,
@@ -1043,7 +1044,7 @@ const Ue = () => {
1043
1044
  !r && !s && !n && i("danger", "Non sei autorizzato");
1044
1045
  }, []), r === null ? null : r ? /* @__PURE__ */ o.jsx(je, {}) : /* @__PURE__ */ o.jsx(Je, { to: "/", replace: !0 });
1045
1046
  }, _t = () => {
1046
- const { logout: r, setCurrentToken: i, createAxiosInstances: n } = ve(), { usersEndpoint: s } = U(), { setIsLoading: a } = me(), { activeAlert: l } = ee(), [u, m] = C(null), [p, y] = C(!1), v = JSON.parse(localStorage.getItem("user")), P = async () => {
1047
+ const { logout: r, setCurrentToken: i, createAxiosInstances: n } = ve(), { usersEndpoint: s } = U(), { setIsLoading: a } = me(), { activeAlert: l } = ee(), [u, m] = w(null), [p, y] = w(!1), v = JSON.parse(localStorage.getItem("user")), L = async () => {
1047
1048
  try {
1048
1049
  y(!0);
1049
1050
  const d = localStorage.getItem("accessToken");
@@ -1065,7 +1066,7 @@ const Ue = () => {
1065
1066
  } finally {
1066
1067
  y(!1);
1067
1068
  }
1068
- }, w = () => {
1069
+ }, C = () => {
1069
1070
  r(), l("info", "Hai effettuato il logout");
1070
1071
  };
1071
1072
  return M(() => {
@@ -1080,7 +1081,7 @@ const Ue = () => {
1080
1081
  /* @__PURE__ */ o.jsx(
1081
1082
  "button",
1082
1083
  {
1083
- onClick: w,
1084
+ onClick: C,
1084
1085
  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]",
1085
1086
  children: "Logout"
1086
1087
  }
@@ -1089,7 +1090,7 @@ const Ue = () => {
1089
1090
  /* @__PURE__ */ o.jsx("div", { className: "flex justify-center items-center my-12 gap-8", children: /* @__PURE__ */ o.jsx(
1090
1091
  "button",
1091
1092
  {
1092
- onClick: P,
1093
+ onClick: L,
1093
1094
  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)]",
1094
1095
  disabled: p,
1095
1096
  children: "Lista degli utenti"
@@ -1156,8 +1157,8 @@ const Ue = () => {
1156
1157
  isMain: p,
1157
1158
  headerComponent: y,
1158
1159
  showHeaderOnLogin: v,
1159
- headerExcludedRoutes: P,
1160
- footerComponent: w,
1160
+ headerExcludedRoutes: L,
1161
+ footerComponent: C,
1161
1162
  showFooterOnLogin: d,
1162
1163
  footerExcludedRoutes: x,
1163
1164
  privateProvider: g,
@@ -1168,8 +1169,8 @@ const Ue = () => {
1168
1169
  isMain: p,
1169
1170
  headerComponent: y,
1170
1171
  showHeaderOnLogin: v,
1171
- headerExcludedRoutes: P,
1172
- footerComponent: w,
1172
+ headerExcludedRoutes: L,
1173
+ footerComponent: C,
1173
1174
  showFooterOnLogin: d,
1174
1175
  footerExcludedRoutes: x
1175
1176
  }
@@ -1367,28 +1368,28 @@ const Bt = (r) => /* @__PURE__ */ t.createElement("svg", { width: "108.41262mm",
1367
1368
  strokeOpacity: 1,
1368
1369
  paintOrder: "stroke markers fill"
1369
1370
  }, d: "", id: "path40", transform: "scale(0.26458333)" }))), r0 = ({ Logo: r }) => {
1370
- const { logout: i } = ve(), { activeAlert: n } = ee(), { autoLogin: s, configRoutes: a, firstPrivateTitle: l } = U(), { isLoading: u } = me(), m = Le(), p = ke(), y = () => {
1371
+ const { logout: i } = ve(), { activeAlert: n } = ee(), { autoLogin: s, configRoutes: a, firstPrivateTitle: l, showHeaderButton: u } = U(), { isLoading: m } = me(), p = Le(), y = ke(), v = () => {
1371
1372
  i(), n("info", "Hai effettuato il logout");
1372
- }, v = a.find((w) => w.path === m.pathname), P = ct("home/:id");
1373
- return /* @__PURE__ */ o.jsx("header", { className: u ? "hidden" : "", children: /* @__PURE__ */ o.jsxs("nav", { className: "h-[60px] flex items-center justify-between px-2 shadow-lg border-b gap-2 border-b-gray-300", children: [
1373
+ }, L = a.find((d) => d.path === p.pathname), C = ct("home/:id");
1374
+ return /* @__PURE__ */ o.jsx("header", { className: m ? "hidden" : "", children: /* @__PURE__ */ o.jsxs("nav", { className: "h-[60px] flex items-center justify-between px-2 shadow-lg border-b gap-2 border-b-gray-300", children: [
1374
1375
  /* @__PURE__ */ o.jsx("figure", { children: r ? /* @__PURE__ */ o.jsx(r, { className: "w-12" }) : /* @__PURE__ */ o.jsx(Bt, { className: "w-12" }) }),
1375
- /* @__PURE__ */ o.jsx("div", { children: /* @__PURE__ */ o.jsx("p", { children: (v == null ? void 0 : v.title) || l }) }),
1376
+ /* @__PURE__ */ o.jsx("div", { children: /* @__PURE__ */ o.jsx("p", { children: (L == null ? void 0 : L.title) || l }) }),
1376
1377
  /* @__PURE__ */ o.jsxs("div", { children: [
1377
- !s && P && /* @__PURE__ */ o.jsx(
1378
+ !s && C && /* @__PURE__ */ o.jsx(
1378
1379
  "button",
1379
1380
  {
1380
1381
  className: "h-[48px] w-[48px] flex items-center justify-center bg-red-600 text-white rounded-lg shadow-md transition duration-200 ease-in-out transform active:translate-y-[2px] cursor-pointer",
1381
1382
  type: "button",
1382
- onClick: y,
1383
+ onClick: v,
1383
1384
  children: /* @__PURE__ */ o.jsx(Mt, { className: "text-4xl w-full" })
1384
1385
  }
1385
1386
  ),
1386
- !P && /* @__PURE__ */ o.jsx(
1387
+ !C && u && /* @__PURE__ */ o.jsx(
1387
1388
  "button",
1388
1389
  {
1389
1390
  className: "h-[48px] w-[48px] flex items-center justify-center bg-sky-600 text-white rounded-lg shadow-md transition duration-200 ease-in-out transform active:translate-y-[2px] cursor-pointer",
1390
1391
  type: "button",
1391
- onClick: () => p(-1),
1392
+ onClick: () => y(-1),
1392
1393
  children: /* @__PURE__ */ o.jsx(zt, { className: "text-4xl w-full" })
1393
1394
  }
1394
1395
  )
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "thecore-auth",
3
3
  "private": false,
4
- "version": "0.0.89",
4
+ "version": "0.0.90",
5
5
  "type": "module",
6
6
  "main": "dist/thecore-auth.cjs.js",
7
7
  "style": "dist/thecore-auth.css",