thecore-auth 0.0.145 → 0.0.147

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.
@@ -14,21 +14,21 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var $e;function pt(){return $e||($e=1,process.env.NODE_ENV!=="production"&&function(){function e(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===le?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case M:return"Fragment";case R:return"Portal";case $:return"Profiler";case W:return"StrictMode";case ae:return"Suspense";case J:return"SuspenseList"}if(typeof t=="object")switch(typeof t.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),t.$$typeof){case H:return(t.displayName||"Context")+".Provider";case q:return(t._context.displayName||"Context")+".Consumer";case Y:var f=t.render;return t=t.displayName,t||(t=f.displayName||f.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case D:return f=t.displayName||null,f!==null?f:e(t.type)||"Memo";case _:f=t._payload,t=t._init;try{return e(t(f))}catch{}}return null}function a(t){return""+t}function n(t){try{a(t);var f=!1}catch{f=!0}if(f){f=console;var m=f.error,L=typeof Symbol=="function"&&Symbol.toStringTag&&t[Symbol.toStringTag]||t.constructor.name||"Object";return m.call(f,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",L),a(t)}}function s(){}function l(){if(N===0){T=console.log,G=console.info,I=console.warn,re=console.error,V=console.group,pe=console.groupCollapsed,Ee=console.groupEnd;var t={configurable:!0,enumerable:!0,value:s,writable:!0};Object.defineProperties(console,{info:t,log:t,warn:t,error:t,group:t,groupCollapsed:t,groupEnd:t})}N++}function c(){if(N--,N===0){var t={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:U({},t,{value:T}),info:U({},t,{value:G}),warn:U({},t,{value:I}),error:U({},t,{value:re}),group:U({},t,{value:V}),groupCollapsed:U({},t,{value:pe}),groupEnd:U({},t,{value:Ee})})}0>N&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function d(t){if(he===void 0)try{throw Error()}catch(m){var f=m.stack.trim().match(/\n( *(at )?)/);he=f&&f[1]||"",Ae=-1<m.stack.indexOf(`
17
+ */var $e;function pt(){return $e||($e=1,process.env.NODE_ENV!=="production"&&function(){function e(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===le?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case M:return"Fragment";case N:return"Portal";case $:return"Profiler";case W:return"StrictMode";case ae:return"Suspense";case J:return"SuspenseList"}if(typeof t=="object")switch(typeof t.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),t.$$typeof){case Y:return(t.displayName||"Context")+".Provider";case H:return(t._context.displayName||"Context")+".Consumer";case Z:var f=t.render;return t=t.displayName,t||(t=f.displayName||f.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case D:return f=t.displayName||null,f!==null?f:e(t.type)||"Memo";case _:f=t._payload,t=t._init;try{return e(t(f))}catch{}}return null}function a(t){return""+t}function n(t){try{a(t);var f=!1}catch{f=!0}if(f){f=console;var m=f.error,L=typeof Symbol=="function"&&Symbol.toStringTag&&t[Symbol.toStringTag]||t.constructor.name||"Object";return m.call(f,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",L),a(t)}}function s(){}function l(){if(R===0){T=console.log,G=console.info,I=console.warn,re=console.error,V=console.group,pe=console.groupCollapsed,Ee=console.groupEnd;var t={configurable:!0,enumerable:!0,value:s,writable:!0};Object.defineProperties(console,{info:t,log:t,warn:t,error:t,group:t,groupCollapsed:t,groupEnd:t})}R++}function c(){if(R--,R===0){var t={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:U({},t,{value:T}),info:U({},t,{value:G}),warn:U({},t,{value:I}),error:U({},t,{value:re}),group:U({},t,{value:V}),groupCollapsed:U({},t,{value:pe}),groupEnd:U({},t,{value:Ee})})}0>R&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function d(t){if(he===void 0)try{throw Error()}catch(m){var f=m.stack.trim().match(/\n( *(at )?)/);he=f&&f[1]||"",Ae=-1<m.stack.indexOf(`
18
18
  at`)?" (<anonymous>)":-1<m.stack.indexOf("@")?"@unknown:0:0":""}return`
19
- `+he+t+Ae}function h(t,f){if(!t||Le)return"";var m=Pe.get(t);if(m!==void 0)return m;Le=!0,m=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var L=null;L=Z.H,Z.H=null,l();try{var z={DetermineComponentFrameRoot:function(){try{if(f){var oe=function(){throw Error()};if(Object.defineProperty(oe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(oe,[])}catch(Q){var we=Q}Reflect.construct(t,[],oe)}else{try{oe.call()}catch(Q){we=Q}t.call(oe.prototype)}}else{try{throw Error()}catch(Q){we=Q}(oe=t())&&typeof oe.catch=="function"&&oe.catch(function(){})}}catch(Q){if(Q&&we&&typeof Q.stack=="string")return[Q.stack,we.stack]}return[null,null]}};z.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var A=Object.getOwnPropertyDescriptor(z.DetermineComponentFrameRoot,"name");A&&A.configurable&&Object.defineProperty(z.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=z.DetermineComponentFrameRoot(),K=w[0],ue=w[1];if(K&&ue){var F=K.split(`
19
+ `+he+t+Ae}function h(t,f){if(!t||Le)return"";var m=Pe.get(t);if(m!==void 0)return m;Le=!0,m=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var L=null;L=q.H,q.H=null,l();try{var z={DetermineComponentFrameRoot:function(){try{if(f){var oe=function(){throw Error()};if(Object.defineProperty(oe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(oe,[])}catch(Q){var we=Q}Reflect.construct(t,[],oe)}else{try{oe.call()}catch(Q){we=Q}t.call(oe.prototype)}}else{try{throw Error()}catch(Q){we=Q}(oe=t())&&typeof oe.catch=="function"&&oe.catch(function(){})}}catch(Q){if(Q&&we&&typeof Q.stack=="string")return[Q.stack,we.stack]}return[null,null]}};z.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var A=Object.getOwnPropertyDescriptor(z.DetermineComponentFrameRoot,"name");A&&A.configurable&&Object.defineProperty(z.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=z.DetermineComponentFrameRoot(),K=w[0],ue=w[1];if(K&&ue){var F=K.split(`
20
20
  `),se=ue.split(`
21
21
  `);for(w=A=0;A<F.length&&!F[A].includes("DetermineComponentFrameRoot");)A++;for(;w<se.length&&!se[w].includes("DetermineComponentFrameRoot");)w++;if(A===F.length||w===se.length)for(A=F.length-1,w=se.length-1;1<=A&&0<=w&&F[A]!==se[w];)w--;for(;1<=A&&0<=w;A--,w--)if(F[A]!==se[w]){if(A!==1||w!==1)do if(A--,w--,0>w||F[A]!==se[w]){var ge=`
22
- `+F[A].replace(" at new "," at ");return t.displayName&&ge.includes("<anonymous>")&&(ge=ge.replace("<anonymous>",t.displayName)),typeof t=="function"&&Pe.set(t,ge),ge}while(1<=A&&0<=w);break}}}finally{Le=!1,Z.H=L,c(),Error.prepareStackTrace=m}return F=(F=t?t.displayName||t.name:"")?d(F):"",typeof t=="function"&&Pe.set(t,F),F}function p(t){if(t==null)return"";if(typeof t=="function"){var f=t.prototype;return h(t,!(!f||!f.isReactComponent))}if(typeof t=="string")return d(t);switch(t){case ae:return d("Suspense");case J:return d("SuspenseList")}if(typeof t=="object")switch(t.$$typeof){case Y:return t=h(t.render,!1),t;case D:return p(t.type);case _:f=t._payload,t=t._init;try{return p(t(f))}catch{}}return""}function x(){var t=Z.A;return t===null?null:t.getOwner()}function j(t){if(te.call(t,"key")){var f=Object.getOwnPropertyDescriptor(t,"key").get;if(f&&f.isReactWarning)return!1}return t.key!==void 0}function S(t,f){function m(){Me||(Me=!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)",f))}m.isReactWarning=!0,Object.defineProperty(t,"key",{get:m,configurable:!0})}function b(){var t=e(this.type);return Ge[t]||(Ge[t]=!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.")),t=this.props.ref,t!==void 0?t:null}function u(t,f,m,L,z,A){return m=A.ref,t={$$typeof:E,type:t,key:f,props:A,_owner:z},(m!==void 0?m:null)!==null?Object.defineProperty(t,"ref",{enumerable:!1,get:b}):Object.defineProperty(t,"ref",{enumerable:!1,value:null}),t._store={},Object.defineProperty(t._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(t,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t}function g(t,f,m,L,z,A){if(typeof t=="string"||typeof t=="function"||t===M||t===$||t===W||t===ae||t===J||t===X||typeof t=="object"&&t!==null&&(t.$$typeof===_||t.$$typeof===D||t.$$typeof===H||t.$$typeof===q||t.$$typeof===Y||t.$$typeof===ce||t.getModuleId!==void 0)){var w=f.children;if(w!==void 0)if(L)if(me(w)){for(L=0;L<w.length;L++)y(w[L],t);Object.freeze&&Object.freeze(w)}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 y(w,t)}else w="",(t===void 0||typeof t=="object"&&t!==null&&Object.keys(t).length===0)&&(w+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),t===null?L="null":me(t)?L="array":t!==void 0&&t.$$typeof===E?(L="<"+(e(t.type)||"Unknown")+" />",w=" Did you accidentally export a JSX literal instead of a component?"):L=typeof t,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",L,w);if(te.call(f,"key")){w=e(t);var K=Object.keys(f).filter(function(F){return F!=="key"});L=0<K.length?"{key: someKey, "+K.join(": ..., ")+": ...}":"{key: someKey}",Ie[w+L]||(K=0<K.length?"{"+K.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
22
+ `+F[A].replace(" at new "," at ");return t.displayName&&ge.includes("<anonymous>")&&(ge=ge.replace("<anonymous>",t.displayName)),typeof t=="function"&&Pe.set(t,ge),ge}while(1<=A&&0<=w);break}}}finally{Le=!1,q.H=L,c(),Error.prepareStackTrace=m}return F=(F=t?t.displayName||t.name:"")?d(F):"",typeof t=="function"&&Pe.set(t,F),F}function p(t){if(t==null)return"";if(typeof t=="function"){var f=t.prototype;return h(t,!(!f||!f.isReactComponent))}if(typeof t=="string")return d(t);switch(t){case ae:return d("Suspense");case J:return d("SuspenseList")}if(typeof t=="object")switch(t.$$typeof){case Z:return t=h(t.render,!1),t;case D:return p(t.type);case _:f=t._payload,t=t._init;try{return p(t(f))}catch{}}return""}function x(){var t=q.A;return t===null?null:t.getOwner()}function j(t){if(te.call(t,"key")){var f=Object.getOwnPropertyDescriptor(t,"key").get;if(f&&f.isReactWarning)return!1}return t.key!==void 0}function S(t,f){function m(){Me||(Me=!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)",f))}m.isReactWarning=!0,Object.defineProperty(t,"key",{get:m,configurable:!0})}function b(){var t=e(this.type);return Ge[t]||(Ge[t]=!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.")),t=this.props.ref,t!==void 0?t:null}function u(t,f,m,L,z,A){return m=A.ref,t={$$typeof:E,type:t,key:f,props:A,_owner:z},(m!==void 0?m:null)!==null?Object.defineProperty(t,"ref",{enumerable:!1,get:b}):Object.defineProperty(t,"ref",{enumerable:!1,value:null}),t._store={},Object.defineProperty(t._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(t,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t}function g(t,f,m,L,z,A){if(typeof t=="string"||typeof t=="function"||t===M||t===$||t===W||t===ae||t===J||t===X||typeof t=="object"&&t!==null&&(t.$$typeof===_||t.$$typeof===D||t.$$typeof===Y||t.$$typeof===H||t.$$typeof===Z||t.$$typeof===ce||t.getModuleId!==void 0)){var w=f.children;if(w!==void 0)if(L)if(me(w)){for(L=0;L<w.length;L++)y(w[L],t);Object.freeze&&Object.freeze(w)}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 y(w,t)}else w="",(t===void 0||typeof t=="object"&&t!==null&&Object.keys(t).length===0)&&(w+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),t===null?L="null":me(t)?L="array":t!==void 0&&t.$$typeof===E?(L="<"+(e(t.type)||"Unknown")+" />",w=" Did you accidentally export a JSX literal instead of a component?"):L=typeof t,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",L,w);if(te.call(f,"key")){w=e(t);var K=Object.keys(f).filter(function(F){return F!=="key"});L=0<K.length?"{key: someKey, "+K.join(": ..., ")+": ...}":"{key: someKey}",Ie[w+L]||(K=0<K.length?"{"+K.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} />`,L,w,K,w),Ie[w+L]=!0)}if(w=null,m!==void 0&&(n(m),w=""+m),j(f)&&(n(f.key),w=""+f.key),"key"in f){m={};for(var ue in f)ue!=="key"&&(m[ue]=f[ue])}else m=f;return w&&S(m,typeof t=="function"?t.displayName||t.name||"Unknown":t),u(t,w,A,z,x(),m)}function y(t,f){if(typeof t=="object"&&t&&t.$$typeof!==dt){if(me(t))for(var m=0;m<t.length;m++){var L=t[m];v(L)&&O(L,f)}else if(v(t))t._store&&(t._store.validated=1);else if(t===null||typeof t!="object"?m=null:(m=B&&t[B]||t["@@iterator"],m=typeof m=="function"?m:null),typeof m=="function"&&m!==t.entries&&(m=m.call(t),m!==t))for(;!(t=m.next()).done;)v(t.value)&&O(t.value,f)}}function v(t){return typeof t=="object"&&t!==null&&t.$$typeof===E}function O(t,f){if(t._store&&!t._store.validated&&t.key==null&&(t._store.validated=1,f=k(f),!Be[f])){Be[f]=!0;var m="";t&&t._owner!=null&&t._owner!==x()&&(m=null,typeof t._owner.tag=="number"?m=e(t._owner.type):typeof t._owner.name=="string"&&(m=t._owner.name),m=" It was passed a child from "+m+".");var L=Z.getCurrentStack;Z.getCurrentStack=function(){var z=p(t.type);return L&&(z+=L()||""),z},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.',f,m),Z.getCurrentStack=L}}function k(t){var f="",m=x();return m&&(m=e(m.type))&&(f=`
27
+ <%s key={someKey} {...props} />`,L,w,K,w),Ie[w+L]=!0)}if(w=null,m!==void 0&&(n(m),w=""+m),j(f)&&(n(f.key),w=""+f.key),"key"in f){m={};for(var ue in f)ue!=="key"&&(m[ue]=f[ue])}else m=f;return w&&S(m,typeof t=="function"?t.displayName||t.name||"Unknown":t),u(t,w,A,z,x(),m)}function y(t,f){if(typeof t=="object"&&t&&t.$$typeof!==dt){if(me(t))for(var m=0;m<t.length;m++){var L=t[m];v(L)&&O(L,f)}else if(v(t))t._store&&(t._store.validated=1);else if(t===null||typeof t!="object"?m=null:(m=B&&t[B]||t["@@iterator"],m=typeof m=="function"?m:null),typeof m=="function"&&m!==t.entries&&(m=m.call(t),m!==t))for(;!(t=m.next()).done;)v(t.value)&&O(t.value,f)}}function v(t){return typeof t=="object"&&t!==null&&t.$$typeof===E}function O(t,f){if(t._store&&!t._store.validated&&t.key==null&&(t._store.validated=1,f=k(f),!Be[f])){Be[f]=!0;var m="";t&&t._owner!=null&&t._owner!==x()&&(m=null,typeof t._owner.tag=="number"?m=e(t._owner.type):typeof t._owner.name=="string"&&(m=t._owner.name),m=" It was passed a child from "+m+".");var L=q.getCurrentStack;q.getCurrentStack=function(){var z=p(t.type);return L&&(z+=L()||""),z},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.',f,m),q.getCurrentStack=L}}function k(t){var f="",m=x();return m&&(m=e(m.type))&&(f=`
28
28
 
29
29
  Check the render method of \``+m+"`."),f||(t=e(t))&&(f=`
30
30
 
31
- Check the top-level render call using <`+t+">."),f}var P=i,E=Symbol.for("react.transitional.element"),R=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),W=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),q=Symbol.for("react.consumer"),H=Symbol.for("react.context"),Y=Symbol.for("react.forward_ref"),ae=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),X=Symbol.for("react.offscreen"),B=Symbol.iterator,le=Symbol.for("react.client.reference"),Z=P.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te=Object.prototype.hasOwnProperty,U=Object.assign,ce=Symbol.for("react.client.reference"),me=Array.isArray,N=0,T,G,I,re,V,pe,Ee;s.__reactDisabledLog=!0;var he,Ae,Le=!1,Pe=new(typeof WeakMap=="function"?WeakMap:Map),dt=Symbol.for("react.client.reference"),Me,Ge={},Ie={},Be={};ve.Fragment=M,ve.jsx=function(t,f,m,L,z){return g(t,f,m,!1,L,z)},ve.jsxs=function(t,f,m,L,z){return g(t,f,m,!0,L,z)}}()),ve}var Fe;function ht(){return Fe||(Fe=1,process.env.NODE_ENV==="production"?Ce.exports=mt():Ce.exports=pt()),Ce.exports}var o=ht();const Ze=i.createContext(),gt=({children:e,defaultComponent:a})=>{const[n,s]=i.useState(!1),[l,c]=i.useState({}),[d,h]=i.useState(a),x={isLoading:n,setIsLoading:s,loadingProps:l,setLoadingProps:c,loadingComponent:d,setLoadingComponent:h,showLoadingFor:(j=2e3,S={})=>{c(S),s(!0),setTimeout(()=>{s(!1)},j)}};return o.jsx(Ze.Provider,{value:x,children:e})},fe=()=>{const e=i.useContext(Ze);if(e===void 0)throw new Error("Non puoi settare il loading");return e},xt="0.0.145",qe=({errorMessage:e,errorShow:a})=>o.jsx("section",{className:a?"":"hidden",children:o.jsxs("div",{className:"container mx-auto",children:[o.jsx("h1",{className:"text-center text-8xl my-12",children:"Errore"}),o.jsx("pre",{className:"text-xl",children:e})]})}),Ue=i.createContext(),vt=({children:e})=>{const[a,n]=i.useState({}),[s,l]=i.useState(!1),c=`Creare un file config.json in public per il corretto funzionamento
31
+ Check the top-level render call using <`+t+">."),f}var P=i,E=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),W=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),H=Symbol.for("react.consumer"),Y=Symbol.for("react.context"),Z=Symbol.for("react.forward_ref"),ae=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),X=Symbol.for("react.offscreen"),B=Symbol.iterator,le=Symbol.for("react.client.reference"),q=P.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te=Object.prototype.hasOwnProperty,U=Object.assign,ce=Symbol.for("react.client.reference"),me=Array.isArray,R=0,T,G,I,re,V,pe,Ee;s.__reactDisabledLog=!0;var he,Ae,Le=!1,Pe=new(typeof WeakMap=="function"?WeakMap:Map),dt=Symbol.for("react.client.reference"),Me,Ge={},Ie={},Be={};ve.Fragment=M,ve.jsx=function(t,f,m,L,z){return g(t,f,m,!1,L,z)},ve.jsxs=function(t,f,m,L,z){return g(t,f,m,!0,L,z)}}()),ve}var Fe;function ht(){return Fe||(Fe=1,process.env.NODE_ENV==="production"?Ce.exports=mt():Ce.exports=pt()),Ce.exports}var o=ht();const Ze=i.createContext(),gt=({children:e,defaultComponent:a})=>{const[n,s]=i.useState(!1),[l,c]=i.useState({}),[d,h]=i.useState(a),x={isLoading:n,setIsLoading:s,loadingProps:l,setLoadingProps:c,loadingComponent:d,setLoadingComponent:h,showLoadingFor:(j=2e3,S={})=>{c(S),s(!0),setTimeout(()=>{s(!1)},j)}};return o.jsx(Ze.Provider,{value:x,children:e})},fe=()=>{const e=i.useContext(Ze);if(e===void 0)throw new Error("Non puoi settare il loading");return e},xt="0.0.147",qe=({errorMessage:e,errorShow:a})=>o.jsx("section",{className:a?"":"hidden",children:o.jsxs("div",{className:"container mx-auto",children:[o.jsx("h1",{className:"text-center text-8xl my-12",children:"Errore"}),o.jsx("pre",{className:"text-xl",children:e})]})}),Ue=i.createContext(),vt=({children:e})=>{const[a,n]=i.useState({}),[s,l]=i.useState(!1),c=`Creare un file config.json in public per il corretto funzionamento
32
32
  Esempio di config.json:
33
33
 
34
34
  {
@@ -55,7 +55,7 @@ Esempio di config.json:
55
55
  "backendToken": "",
56
56
  "isDebug": "",
57
57
  "showHeaderButton": ""
58
- }`,d=()=>{const u=new Date,g=String(u.getDate()).padStart(2,"0"),y=String(u.getMonth()+1).padStart(2,"0"),v=u.getFullYear(),O=String(u.getHours()).padStart(2,"0"),k=String(u.getMinutes()).padStart(2,"0"),P=String(u.getSeconds()).padStart(2,"0");return`${g}/${y}/${v} ${O}:${k}:${P}`},h=(u,g)=>new Promise((y,v)=>{const O=indexedDB.open(u,1);O.onupgradeneeded=k=>{const P=k.target.result;P.objectStoreNames.contains(g)||P.createObjectStore(g,{keyPath:"id"})},O.onsuccess=k=>y(k.target.result),O.onerror=k=>v(k.target.error)}),p=async(u,g,y)=>{const v=await h(u,g);return new Promise((O,k)=>{if(!v){k("Errore: DB non disponibile");return}const P=v==null?void 0:v.transaction(g,"readonly"),E=P==null?void 0:P.objectStore(g),R=E==null?void 0:E.get(y);R.onsuccess=()=>O(R.result),R.onerror=M=>k(M.target.error)})},x=async(u,g,y)=>{const v=await h(u,g);return new Promise((O,k)=>{if(!v){k("Errore: DB non disponibile");return}const P=v==null?void 0:v.transaction(g,"readwrite"),E=P==null?void 0:P.objectStore(g),R=E==null?void 0:E.put(y);R.onsuccess=()=>O(R.result),R.onerror=M=>k(M.target.error)})},j=async(u,g)=>{let y=Date.now(),v;do v=await p(u,g,y),v&&y++;while(v);return y},S=async(u,g,y)=>{y.id||(y.id=await j(u,g)),await x(u,g,y)},b=async()=>{try{const g=await(await fetch("/config.json")).json();let y;g.isDevelopment?y=xt:y=(await(await fetch("/package.json")).json()).version;const v={...g,version:y,openIndexedDB:h,getDataIndexedDB:p,setDataIndexedDB:x,generateUniqueId:j,setDataWithAutoId:S,setCurrentDate:d};n(v)}catch(u){console.error(u),l(!0)}};return i.useEffect(()=>{b()},[]),Object.keys(a).length===0?o.jsx(qe,{errorShow:s,errorMessage:c}):o.jsx(Ue.Provider,{value:a,children:e})},ee=()=>{const e=i.useContext(Ue);if(e===void 0)throw new Error("Non puoi leggere i config");return e},bt=e=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:500,zoomAndPan:"magnify",viewBox:"0 0 375 374.999991",height:500,preserveAspectRatio:"xMidYMid meet",...e},r.createElement("defs",null,r.createElement("g",null),r.createElement("clipPath",{id:"6ca7e2bf04"},r.createElement("path",{d:"M 265.136719 0 L 375 109.863281 L 375 265.136719 L 265.136719 375 L 109.863281 375 L 0 265.136719 L 0 109.863281 L 109.863281 0 Z M 265.136719 0 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"2c77c820c6"},r.createElement("path",{d:"M 12.878906 12.878906 L 362.121094 12.878906 L 362.121094 362.121094 L 12.878906 362.121094 Z M 12.878906 12.878906 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"3d94df7d66"},r.createElement("path",{d:"M 259.804688 12.878906 L 362.121094 115.195312 L 362.121094 259.804688 L 259.804688 362.121094 L 115.195312 362.121094 L 12.878906 259.804688 L 12.878906 115.195312 L 115.195312 12.878906 Z M 259.804688 12.878906 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"8793709a64"},r.createElement("path",{d:"M 12.878906 12.878906 L 362.109375 12.878906 L 362.109375 362.109375 L 12.878906 362.109375 Z M 12.878906 12.878906 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"fdb3fe29d8"},r.createElement("path",{d:"M 259.796875 12.878906 L 362.109375 115.191406 L 362.109375 259.796875 L 259.796875 362.109375 L 115.191406 362.109375 L 12.878906 259.796875 L 12.878906 115.191406 L 115.191406 12.878906 Z M 259.796875 12.878906 ",clipRule:"nonzero"}))),r.createElement("g",{clipPath:"url(#6ca7e2bf04)"},r.createElement("rect",{x:-37.5,width:450,fill:"#b91c1c",y:-37.499999,height:449.999989,fillOpacity:1})),r.createElement("g",{clipPath:"url(#2c77c820c6)"},r.createElement("g",{clipPath:"url(#3d94df7d66)"},r.createElement("path",{fill:"#b91c1c",d:"M 12.878906 12.878906 L 362.121094 12.878906 L 362.121094 362.121094 L 12.878906 362.121094 Z M 12.878906 12.878906 ",fillOpacity:1,fillRule:"nonzero"}))),r.createElement("g",{clipPath:"url(#8793709a64)"},r.createElement("g",{clipPath:"url(#fdb3fe29d8)"},r.createElement("path",{strokeLinecap:"butt",transform:"matrix(0.75, 0, 0, 0.75, 12.879396, 12.879392)",fill:"none",strokeLinejoin:"miter",d:"M 329.223327 -0.000647072 L 465.640003 136.416029 L 465.640003 329.223333 L 329.223327 465.640009 L 136.416023 465.640009 L -0.000653072 329.223333 L -0.000653072 136.416029 L 136.416023 -0.000647072 Z M 329.223327 -0.000647072 ",stroke:"#ffffff",strokeWidth:34,strokeOpacity:1,strokeMiterlimit:4}))),r.createElement("g",{fill:"#ffffff",fillOpacity:1},r.createElement("g",{transform:"translate(111.648432, 267.442446)"},r.createElement("g",null,r.createElement("path",{d:"M 2.828125 0 L 56.25 -79.859375 L 3.046875 -159.609375 L 37.28125 -159.609375 L 75.90625 -98.046875 L 114.53125 -159.609375 L 148.765625 -159.609375 L 95.5625 -79.859375 L 148.984375 0 L 114.765625 0 L 75.671875 -60.65625 L 37.046875 0 Z M 2.828125 0 "}))))),yt=e=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:500,zoomAndPan:"magnify",viewBox:"0 0 375 374.999991",height:500,preserveAspectRatio:"xMidYMid meet",...e},r.createElement("defs",null,r.createElement("g",null),r.createElement("clipPath",{id:"30562604dd"},r.createElement("path",{d:"M 187.5 0 C 83.945312 0 0 83.945312 0 187.5 C 0 291.054688 83.945312 375 187.5 375 C 291.054688 375 375 291.054688 375 187.5 C 375 83.945312 291.054688 0 187.5 0 Z M 187.5 0 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"971fcd5f72"},r.createElement("path",{d:"M 18.570312 18.570312 L 356.429688 18.570312 L 356.429688 356.429688 L 18.570312 356.429688 Z M 18.570312 18.570312 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"e891a7f57e"},r.createElement("path",{d:"M 187.5 18.570312 C 94.203125 18.570312 18.570312 94.203125 18.570312 187.5 C 18.570312 280.796875 94.203125 356.429688 187.5 356.429688 C 280.796875 356.429688 356.429688 280.796875 356.429688 187.5 C 356.429688 94.203125 280.796875 18.570312 187.5 18.570312 Z M 187.5 18.570312 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"19a9ddc130"},r.createElement("path",{d:"M 18.570312 18.570312 L 356.070312 18.570312 L 356.070312 356.070312 L 18.570312 356.070312 Z M 18.570312 18.570312 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"5e650d5bd0"},r.createElement("path",{d:"M 187.496094 18.570312 C 94.199219 18.570312 18.570312 94.199219 18.570312 187.496094 C 18.570312 280.792969 94.199219 356.421875 187.496094 356.421875 C 280.792969 356.421875 356.421875 280.792969 356.421875 187.496094 C 356.421875 94.199219 280.792969 18.570312 187.496094 18.570312 Z M 187.496094 18.570312 ",clipRule:"nonzero"}))),r.createElement("g",{clipPath:"url(#30562604dd)"},r.createElement("rect",{x:-37.5,width:450,fill:"#1d4ed8",y:-37.499999,height:449.999989,fillOpacity:1})),r.createElement("g",{clipPath:"url(#971fcd5f72)"},r.createElement("g",{clipPath:"url(#e891a7f57e)"},r.createElement("path",{fill:"#1d4ed8",d:"M 18.570312 18.570312 L 356.429688 18.570312 L 356.429688 356.429688 L 18.570312 356.429688 Z M 18.570312 18.570312 ",fillOpacity:1,fillRule:"nonzero"}))),r.createElement("g",{clipPath:"url(#19a9ddc130)"},r.createElement("g",{clipPath:"url(#5e650d5bd0)"},r.createElement("path",{strokeLinecap:"butt",transform:"matrix(0.75, 0, 0, 0.75, 18.570291, 18.570286)",fill:"none",strokeLinejoin:"miter",d:"M 225.234419 0.0000349326 C 100.838577 0.0000349326 0.0000289326 100.838583 0.0000289326 225.234425 C 0.0000289326 349.630266 100.838577 450.468815 225.234419 450.468815 C 349.63026 450.468815 450.468809 349.630266 450.468809 225.234425 C 450.468809 100.838583 349.63026 0.0000349326 225.234419 0.0000349326 Z M 225.234419 0.0000349326 ",stroke:"#ffffff",strokeWidth:34,strokeOpacity:1,strokeMiterlimit:4}))),r.createElement("g",{fill:"#ffffff",fillOpacity:1},r.createElement("g",{transform:"translate(136.121787, 300.837436)"},r.createElement("g",null,r.createElement("path",{d:"M 60 -193.78125 C 54.707031 -193.78125 50.109375 -195.734375 46.203125 -199.640625 C 42.296875 -203.554688 40.34375 -208.15625 40.34375 -213.4375 C 40.34375 -218.726562 42.296875 -223.328125 46.203125 -227.234375 C 50.109375 -231.140625 54.707031 -233.09375 60 -233.09375 C 65.28125 -233.09375 69.875 -231.140625 73.78125 -227.234375 C 77.695312 -223.328125 79.65625 -218.726562 79.65625 -213.4375 C 79.65625 -208.15625 77.695312 -203.554688 73.78125 -199.640625 C 69.875 -195.734375 65.28125 -193.78125 60 -193.78125 Z M 45.171875 4.828125 C 39.191406 4.828125 35.28125 2.414062 33.4375 -2.40625 C 31.601562 -7.238281 30.6875 -13.675781 30.6875 -21.71875 C 30.6875 -34.59375 31.773438 -47.234375 33.953125 -59.640625 C 36.140625 -72.054688 38.328125 -83.894531 40.515625 -95.15625 C 42.703125 -106.425781 43.796875 -116.890625 43.796875 -126.546875 C 43.796875 -129.078125 43.675781 -131.832031 43.4375 -134.8125 C 43.207031 -137.800781 42.632812 -140.101562 41.71875 -141.71875 C 38.039062 -139.414062 33.269531 -135.617188 27.40625 -130.328125 C 21.550781 -125.046875 16.898438 -119.1875 13.453125 -112.75 C 11.835938 -114.363281 11.03125 -116.550781 11.03125 -119.3125 C 11.03125 -123.21875 12.582031 -127.46875 15.6875 -132.0625 C 18.789062 -136.65625 22.925781 -141.078125 28.09375 -145.328125 C 33.269531 -149.585938 38.847656 -153.097656 44.828125 -155.859375 C 50.804688 -158.617188 56.664062 -160 62.40625 -160 C 67.695312 -160 71.085938 -158.734375 72.578125 -156.203125 C 74.078125 -153.671875 74.828125 -150.453125 74.828125 -146.546875 C 74.828125 -140.796875 74.078125 -133.378906 72.578125 -124.296875 C 71.085938 -115.222656 69.363281 -105.515625 67.40625 -95.171875 C 65.457031 -84.828125 63.734375 -74.484375 62.234375 -64.140625 C 60.742188 -53.796875 60 -44.367188 60 -35.859375 C 60 -31.492188 60.226562 -27.414062 60.6875 -23.625 C 61.144531 -19.832031 61.71875 -16.671875 62.40625 -14.140625 C 68.15625 -16.671875 73.613281 -20.40625 78.78125 -25.34375 C 83.957031 -30.28125 87.8125 -34.9375 90.34375 -39.3125 C 91.71875 -37.238281 92.40625 -35.050781 92.40625 -32.75 C 92.40625 -29.070312 90.796875 -25.050781 87.578125 -20.6875 C 84.359375 -16.320312 80.332031 -12.179688 75.5 -8.265625 C 70.675781 -4.359375 65.5625 -1.203125 60.15625 1.203125 C 54.757812 3.617188 49.765625 4.828125 45.171875 4.828125 Z M 45.171875 4.828125 "}))))),Et=e=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:500,zoomAndPan:"magnify",viewBox:"0 0 375 374.999991",height:500,preserveAspectRatio:"xMidYMid meet",...e},r.createElement("defs",null,r.createElement("g",null),r.createElement("clipPath",{id:"59a10ac27a"},r.createElement("path",{d:"M 17.179688 32.695312 L 360 32.695312 L 360 337.5 L 17.179688 337.5 Z M 17.179688 32.695312 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"664b27481e"},r.createElement("path",{d:"M 207.042969 43.574219 L 356.394531 304.941406 C 360.242188 311.675781 360.214844 319.953125 356.324219 326.660156 C 352.429688 333.371094 345.257812 337.5 337.5 337.5 L 39.375 337.5 C 31.617188 337.5 24.445312 333.371094 20.554688 326.660156 C 16.660156 319.953125 16.632812 311.675781 20.480469 304.941406 L 169.832031 43.574219 C 173.648438 36.898438 180.746094 32.777344 188.4375 32.777344 C 196.128906 32.777344 203.226562 36.898438 207.042969 43.574219 Z M 207.042969 43.574219 ",clipRule:"nonzero"}))),r.createElement("g",{clipPath:"url(#59a10ac27a)"},r.createElement("g",{clipPath:"url(#664b27481e)"},r.createElement("path",{fill:"#d97706",d:"M 1.875 11.015625 L 375.546875 11.015625 L 375.546875 337.5 L 1.875 337.5 Z M 1.875 11.015625 ",fillOpacity:1,fillRule:"nonzero"}))),r.createElement("g",{fill:"#ffffff",fillOpacity:1},r.createElement("g",{transform:"translate(158.410439, 295.655517)"},r.createElement("g",null,r.createElement("path",{d:"M 46.890625 -63.21875 C 46.890625 -63.21875 46.890625 -64.445312 46.890625 -66.90625 L 46.890625 -176.46875 C 46.890625 -178.925781 46.1875 -180.859375 44.78125 -182.265625 C 43.375 -183.671875 41.441406 -184.375 38.984375 -184.375 L 21.078125 -184.375 C 18.617188 -184.375 16.6875 -183.671875 15.28125 -182.265625 C 13.875 -180.859375 13.171875 -178.925781 13.171875 -176.46875 L 13.171875 -66.90625 C 13.171875 -64.445312 13.875 -62.515625 15.28125 -61.109375 C 16.6875 -59.703125 18.617188 -59 21.078125 -59 L 38.984375 -59 C 41.441406 -59 43.375 -59.703125 44.78125 -61.109375 C 46.1875 -62.515625 46.890625 -63.21875 46.890625 -63.21875 Z M 46.890625 -4.21875 C 46.890625 -4.21875 46.890625 -5.445312 46.890625 -7.90625 L 46.890625 -25.546875 C 46.890625 -28.003906 46.1875 -29.9375 44.78125 -31.34375 C 43.375 -32.75 41.441406 -33.453125 38.984375 -33.453125 L 21.078125 -33.453125 C 18.617188 -33.453125 16.6875 -32.75 15.28125 -31.34375 C 13.875 -29.9375 13.171875 -28.003906 13.171875 -25.546875 L 13.171875 -7.90625 C 13.171875 -5.445312 13.875 -3.515625 15.28125 -2.109375 C 16.6875 -0.703125 18.617188 0 21.078125 0 L 38.984375 0 C 41.441406 0 43.375 -0.703125 44.78125 -2.109375 C 46.1875 -3.515625 46.890625 -4.21875 46.890625 -4.21875 Z M 46.890625 -4.21875 "})))));var Ve={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},De=i.createContext&&i.createContext(Ve),wt=["attr","size","title"];function Ct(e,a){if(e==null)return{};var n=jt(e,a),s,l;if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(l=0;l<c.length;l++)s=c[l],!(a.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(n[s]=e[s])}return n}function jt(e,a){if(e==null)return{};var n={};for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){if(a.indexOf(s)>=0)continue;n[s]=e[s]}return n}function je(){return je=Object.assign?Object.assign.bind():function(e){for(var a=1;a<arguments.length;a++){var n=arguments[a];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},je.apply(this,arguments)}function We(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);a&&(s=s.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,s)}return n}function Se(e){for(var a=1;a<arguments.length;a++){var n=arguments[a]!=null?arguments[a]:{};a%2?We(Object(n),!0).forEach(function(s){St(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):We(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function St(e,a,n){return a=Ot(a),a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function Ot(e){var a=kt(e,"string");return typeof a=="symbol"?a:a+""}function kt(e,a){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,a||"default");if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(e)}function Je(e){return e&&e.map((a,n)=>i.createElement(a.tag,Se({key:n},a.attr),Je(a.child)))}function ie(e){return a=>i.createElement(Lt,je({attr:Se({},e.attr)},a),Je(e.child))}function Lt(e){var a=n=>{var{attr:s,size:l,title:c}=e,d=Ct(e,wt),h=l||n.size||"1em",p;return n.className&&(p=n.className),e.className&&(p=(p?p+" ":"")+e.className),i.createElement("svg",je({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,s,d,{className:p,style:Se(Se({color:e.color||n.color},n.style),e.style),height:h,width:h,xmlns:"http://www.w3.org/2000/svg"}),c&&i.createElement("title",null,c),e.children)};return De!==void 0?i.createElement(De.Consumer,null,n=>a(n)):a(Ve)}function Pt(e){return ie({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M17.47 250.9C88.82 328.1 158 397.6 224.5 485.5c72.3-143.8 146.3-288.1 268.4-444.37L460 26.06C356.9 135.4 276.8 238.9 207.2 361.9c-48.4-43.6-126.62-105.3-174.38-137z"},child:[]}]})(e)}const Xe=i.createContext(),Rt=({children:e})=>{const[a,n]=i.useState(!1),[s,l]=i.useState(),[c,d]=i.useState(),S={showAlert:a,setShowAlert:n,typeAlert:s,setTypeAlert:l,messageAlert:c,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:b=>{switch(b){case"danger":return o.jsx(bt,{className:"w-[20px] h-[20px]"});case"info":return o.jsx(yt,{className:"w-[20px] h-[20px]"});case"success":return o.jsx(Pt,{className:"text-xl"});case"warning":return o.jsx(Et,{className:"w-[20px] h-[20px]"})}},closeAlert:()=>{n(!a)},activeAlert:(b,u)=>{n(!1),setTimeout(()=>{l(b),d(u),n(!0)},50)}};return o.jsx(Xe.Provider,{value:S,children:e})},ne=()=>{const e=i.useContext(Xe);if(e===void 0)throw new Error("Non puoi modificare l'alert");return e};let de;const Ke=async(e,a,n,s,l,c)=>{if(de)return de;try{const h=await(await fetch("/config.json")).json(),p=h.baseUri,{unauthorized:x,notFound:j,defaultMessage:S}=h.axiosErrors,b=h.axiosTimeout;return de=He.create({baseURL:p,timeout:b}),de.interceptors.request.use(u=>u),de.interceptors.response.use(u=>u,u=>{if(u.response)switch(e==null||e(!0),a==null||a("danger"),u.response.status){case 401:localStorage.removeItem("accessToken"),n==null||n(x),s==null||s();break;case 404:n==null||n(j),l==null||l(u);break;default:n==null||n(`${S} ${u.response.status||""} ${u.response.data.error||""}`),c==null||c(u)}return Promise.reject(u)}),de}catch(d){console.error(d)}},Qe=i.createContext(),Nt=({children:e})=>{const{heartbeatEndpoint:a,firstPrivatePath:n,infiniteSession:s,timeDeducted:l,authenticatedEndpoint:c,autoLogin:d,setCurrentDate:h,isDebug:p,backendToken:x,useCustomLoginTimeout:j,customLoginTimeout:S,tokenLog:b,timerInfiniteSession:u}=ee(),{setIsLoading:g,showLoadingFor:y}=fe(),{setShowAlert:v,setMessageAlert:O,setTypeAlert:k,activeAlert:P}=ne(),E=C.useNavigate(),[R,M]=i.useState(null),[W,$]=i.useState(),[q,H]=i.useState(),[Y,ae]=i.useState(),[J,D]=i.useState(!1),_=async(N=B,T,G)=>await Ke(v,k,O,N,T,G),X=async(N=null,T)=>{N&&N.preventDefault(),D(!0);try{j||g(!0),y(S),v(!1);const I=await(await _()).post(c,{auth:T}),re=I.headers.token,V=I.data;re&&(localStorage.setItem("accessToken",re),localStorage.setItem("user",JSON.stringify(V)),M(!0),$(re),E(`${n}${V.id}`))}catch(G){console.error(G)}finally{D(!1),j||g(!1)}},B=()=>{localStorage.removeItem("accessToken"),localStorage.removeItem("id"),localStorage.removeItem("user"),M(!1),$(null)},le=async()=>{try{const N=localStorage.getItem("accessToken"),I=(await(await _()).get(`${a}`,{headers:{Authorization:N}})).headers.token;localStorage.setItem("accessToken",I),$(I),b&&console.log("[Auth]: Nuovo token: ",I,"Data:",h())}catch(N){console.error(N),B()}},Z=N=>{const T=N||W;if(!T)return;const G="Token non valido";try{const I=_e(T);if(!I.exp){b&&console.warn("[Auth]: Token senza data di scadenza, eseguo logout."),B(),P("danger",G);return}const re=Math.floor(Date.now()/1e3),V=(I.exp-re)*1e3;if(V<=0){b&&console.warn("[Auth]: Token scaduto, eseguo logout."),B(),P("danger",G);return}if(ae(V),H(V-l),b){const pe=Math.floor(V/1e3),Ee=Math.floor(pe/60),he=pe%60;b&&(console.log(`[Auth]: Token valido per ancora: ${Ee} minuti e ${he} secondi`),console.log("[Auth]: Token:",T))}}catch(I){b&&console.error("[Auth]: Errore nella decodifica del token:",I),B(),P("danger",G)}},te=N=>{if(!N)return!1;try{const T=_e(N),G=Math.floor(Date.now()/1e3);return!T.exp||T.exp<G?(console.warn("[Auth]: Token scaduto o non valido"),!1):!0}catch(T){return console.error("[Auth]: Token non valido o corrotto",T),!1}},U=async N=>{try{const I=(await(await _()).get(a,{headers:{Authorization:N}})).data;I&&(localStorage.setItem("user",JSON.stringify(I)),localStorage.setItem("accessToken",N),M(!0),E(`${n}${I.id}`))}catch(T){console.error(T)}},ce=()=>{const N=localStorage.getItem("accessToken");te(N)?(b&&console.log("[Auth]: Ricarico pagina → controllo scadenza token"),Z(N)):(b&&console.warn("[Auth]: Token non valido al reload, eseguo logout"),B())};i.useEffect(()=>{const N=localStorage.getItem("accessToken");if(!te(N)){B();return}M(!0)},[]),i.useEffect(()=>{d&&!R&&!J&&(b&&console.log("[Auth]: Tentativo di autologin con backendToken"),U(x))},[d,R,J]),i.useEffect(()=>{if(document.readyState==="complete")ce();else return window.addEventListener("load",ce),()=>window.removeEventListener("load",ce)},[]),i.useEffect(()=>{if(d)return;Z(),b&&console.log("[Auth]: Entrato dentro lo useEffect di controllo");const N=u||q;let T;s&&W&&q&&(b&&console.log("[Auth]: Entrato dentro il timer della sessione infinita"),T=setInterval(()=>{le()},N));let G;return!s&&W&&Y&&(b&&console.log("[Auth]: Entrato dentro il timer della sessione con scadenza del token"),G=setTimeout(()=>{B(),P("danger","Sessione scaduta")},Y)),()=>{T&&clearInterval(T),G&&clearTimeout(G)}},[W,q]);const me={isAuthenticated:R,setIsAuthenticated:M,login:X,logout:B,setCurrentToken:$,createAxiosInstances:_,fetchHeartbeat:le,getTokenExpiry:Z,checkTokenValidity:te,fetchUser:U,handleLoad:ce};return o.jsx(Qe.Provider,{value:me,children:e})},ye=()=>{const e=i.useContext(Qe);if(e===void 0)throw new Error("Non sei dentro al Auth Provider");return e},et=i.createContext(),Tt=({children:e,publicRoutes:a=[],privateRoutes:n=[]})=>o.jsx(et.Provider,{value:{publicRoutes:a,privateRoutes:n},children:e}),tt=()=>{const e=i.useContext(et);if(e===void 0)throw new Error(`Errore: Le rotte non sono state inizializzate correttamente.
58
+ }`,d=()=>{const u=new Date,g=String(u.getDate()).padStart(2,"0"),y=String(u.getMonth()+1).padStart(2,"0"),v=u.getFullYear(),O=String(u.getHours()).padStart(2,"0"),k=String(u.getMinutes()).padStart(2,"0"),P=String(u.getSeconds()).padStart(2,"0");return`${g}/${y}/${v} ${O}:${k}:${P}`},h=(u,g)=>new Promise((y,v)=>{const O=indexedDB.open(u,1);O.onupgradeneeded=k=>{const P=k.target.result;P.objectStoreNames.contains(g)||P.createObjectStore(g,{keyPath:"id"})},O.onsuccess=k=>y(k.target.result),O.onerror=k=>v(k.target.error)}),p=async(u,g,y)=>{const v=await h(u,g);return new Promise((O,k)=>{if(!v){k("Errore: DB non disponibile");return}const P=v==null?void 0:v.transaction(g,"readonly"),E=P==null?void 0:P.objectStore(g),N=E==null?void 0:E.get(y);N.onsuccess=()=>O(N.result),N.onerror=M=>k(M.target.error)})},x=async(u,g,y)=>{const v=await h(u,g);return new Promise((O,k)=>{if(!v){k("Errore: DB non disponibile");return}const P=v==null?void 0:v.transaction(g,"readwrite"),E=P==null?void 0:P.objectStore(g),N=E==null?void 0:E.put(y);N.onsuccess=()=>O(N.result),N.onerror=M=>k(M.target.error)})},j=async(u,g)=>{let y=Date.now(),v;do v=await p(u,g,y),v&&y++;while(v);return y},S=async(u,g,y)=>{y.id||(y.id=await j(u,g)),await x(u,g,y)},b=async()=>{try{const g=await(await fetch("/config.json")).json();let y;g.isDevelopment?y=xt:y=(await(await fetch("/package.json")).json()).version;const v={...g,version:y,openIndexedDB:h,getDataIndexedDB:p,setDataIndexedDB:x,generateUniqueId:j,setDataWithAutoId:S,setCurrentDate:d};n(v)}catch(u){console.error(u),l(!0)}};return i.useEffect(()=>{b()},[]),Object.keys(a).length===0?o.jsx(qe,{errorShow:s,errorMessage:c}):o.jsx(Ue.Provider,{value:a,children:e})},ee=()=>{const e=i.useContext(Ue);if(e===void 0)throw new Error("Non puoi leggere i config");return e},bt=e=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:500,zoomAndPan:"magnify",viewBox:"0 0 375 374.999991",height:500,preserveAspectRatio:"xMidYMid meet",...e},r.createElement("defs",null,r.createElement("g",null),r.createElement("clipPath",{id:"6ca7e2bf04"},r.createElement("path",{d:"M 265.136719 0 L 375 109.863281 L 375 265.136719 L 265.136719 375 L 109.863281 375 L 0 265.136719 L 0 109.863281 L 109.863281 0 Z M 265.136719 0 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"2c77c820c6"},r.createElement("path",{d:"M 12.878906 12.878906 L 362.121094 12.878906 L 362.121094 362.121094 L 12.878906 362.121094 Z M 12.878906 12.878906 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"3d94df7d66"},r.createElement("path",{d:"M 259.804688 12.878906 L 362.121094 115.195312 L 362.121094 259.804688 L 259.804688 362.121094 L 115.195312 362.121094 L 12.878906 259.804688 L 12.878906 115.195312 L 115.195312 12.878906 Z M 259.804688 12.878906 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"8793709a64"},r.createElement("path",{d:"M 12.878906 12.878906 L 362.109375 12.878906 L 362.109375 362.109375 L 12.878906 362.109375 Z M 12.878906 12.878906 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"fdb3fe29d8"},r.createElement("path",{d:"M 259.796875 12.878906 L 362.109375 115.191406 L 362.109375 259.796875 L 259.796875 362.109375 L 115.191406 362.109375 L 12.878906 259.796875 L 12.878906 115.191406 L 115.191406 12.878906 Z M 259.796875 12.878906 ",clipRule:"nonzero"}))),r.createElement("g",{clipPath:"url(#6ca7e2bf04)"},r.createElement("rect",{x:-37.5,width:450,fill:"#b91c1c",y:-37.499999,height:449.999989,fillOpacity:1})),r.createElement("g",{clipPath:"url(#2c77c820c6)"},r.createElement("g",{clipPath:"url(#3d94df7d66)"},r.createElement("path",{fill:"#b91c1c",d:"M 12.878906 12.878906 L 362.121094 12.878906 L 362.121094 362.121094 L 12.878906 362.121094 Z M 12.878906 12.878906 ",fillOpacity:1,fillRule:"nonzero"}))),r.createElement("g",{clipPath:"url(#8793709a64)"},r.createElement("g",{clipPath:"url(#fdb3fe29d8)"},r.createElement("path",{strokeLinecap:"butt",transform:"matrix(0.75, 0, 0, 0.75, 12.879396, 12.879392)",fill:"none",strokeLinejoin:"miter",d:"M 329.223327 -0.000647072 L 465.640003 136.416029 L 465.640003 329.223333 L 329.223327 465.640009 L 136.416023 465.640009 L -0.000653072 329.223333 L -0.000653072 136.416029 L 136.416023 -0.000647072 Z M 329.223327 -0.000647072 ",stroke:"#ffffff",strokeWidth:34,strokeOpacity:1,strokeMiterlimit:4}))),r.createElement("g",{fill:"#ffffff",fillOpacity:1},r.createElement("g",{transform:"translate(111.648432, 267.442446)"},r.createElement("g",null,r.createElement("path",{d:"M 2.828125 0 L 56.25 -79.859375 L 3.046875 -159.609375 L 37.28125 -159.609375 L 75.90625 -98.046875 L 114.53125 -159.609375 L 148.765625 -159.609375 L 95.5625 -79.859375 L 148.984375 0 L 114.765625 0 L 75.671875 -60.65625 L 37.046875 0 Z M 2.828125 0 "}))))),yt=e=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:500,zoomAndPan:"magnify",viewBox:"0 0 375 374.999991",height:500,preserveAspectRatio:"xMidYMid meet",...e},r.createElement("defs",null,r.createElement("g",null),r.createElement("clipPath",{id:"30562604dd"},r.createElement("path",{d:"M 187.5 0 C 83.945312 0 0 83.945312 0 187.5 C 0 291.054688 83.945312 375 187.5 375 C 291.054688 375 375 291.054688 375 187.5 C 375 83.945312 291.054688 0 187.5 0 Z M 187.5 0 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"971fcd5f72"},r.createElement("path",{d:"M 18.570312 18.570312 L 356.429688 18.570312 L 356.429688 356.429688 L 18.570312 356.429688 Z M 18.570312 18.570312 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"e891a7f57e"},r.createElement("path",{d:"M 187.5 18.570312 C 94.203125 18.570312 18.570312 94.203125 18.570312 187.5 C 18.570312 280.796875 94.203125 356.429688 187.5 356.429688 C 280.796875 356.429688 356.429688 280.796875 356.429688 187.5 C 356.429688 94.203125 280.796875 18.570312 187.5 18.570312 Z M 187.5 18.570312 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"19a9ddc130"},r.createElement("path",{d:"M 18.570312 18.570312 L 356.070312 18.570312 L 356.070312 356.070312 L 18.570312 356.070312 Z M 18.570312 18.570312 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"5e650d5bd0"},r.createElement("path",{d:"M 187.496094 18.570312 C 94.199219 18.570312 18.570312 94.199219 18.570312 187.496094 C 18.570312 280.792969 94.199219 356.421875 187.496094 356.421875 C 280.792969 356.421875 356.421875 280.792969 356.421875 187.496094 C 356.421875 94.199219 280.792969 18.570312 187.496094 18.570312 Z M 187.496094 18.570312 ",clipRule:"nonzero"}))),r.createElement("g",{clipPath:"url(#30562604dd)"},r.createElement("rect",{x:-37.5,width:450,fill:"#1d4ed8",y:-37.499999,height:449.999989,fillOpacity:1})),r.createElement("g",{clipPath:"url(#971fcd5f72)"},r.createElement("g",{clipPath:"url(#e891a7f57e)"},r.createElement("path",{fill:"#1d4ed8",d:"M 18.570312 18.570312 L 356.429688 18.570312 L 356.429688 356.429688 L 18.570312 356.429688 Z M 18.570312 18.570312 ",fillOpacity:1,fillRule:"nonzero"}))),r.createElement("g",{clipPath:"url(#19a9ddc130)"},r.createElement("g",{clipPath:"url(#5e650d5bd0)"},r.createElement("path",{strokeLinecap:"butt",transform:"matrix(0.75, 0, 0, 0.75, 18.570291, 18.570286)",fill:"none",strokeLinejoin:"miter",d:"M 225.234419 0.0000349326 C 100.838577 0.0000349326 0.0000289326 100.838583 0.0000289326 225.234425 C 0.0000289326 349.630266 100.838577 450.468815 225.234419 450.468815 C 349.63026 450.468815 450.468809 349.630266 450.468809 225.234425 C 450.468809 100.838583 349.63026 0.0000349326 225.234419 0.0000349326 Z M 225.234419 0.0000349326 ",stroke:"#ffffff",strokeWidth:34,strokeOpacity:1,strokeMiterlimit:4}))),r.createElement("g",{fill:"#ffffff",fillOpacity:1},r.createElement("g",{transform:"translate(136.121787, 300.837436)"},r.createElement("g",null,r.createElement("path",{d:"M 60 -193.78125 C 54.707031 -193.78125 50.109375 -195.734375 46.203125 -199.640625 C 42.296875 -203.554688 40.34375 -208.15625 40.34375 -213.4375 C 40.34375 -218.726562 42.296875 -223.328125 46.203125 -227.234375 C 50.109375 -231.140625 54.707031 -233.09375 60 -233.09375 C 65.28125 -233.09375 69.875 -231.140625 73.78125 -227.234375 C 77.695312 -223.328125 79.65625 -218.726562 79.65625 -213.4375 C 79.65625 -208.15625 77.695312 -203.554688 73.78125 -199.640625 C 69.875 -195.734375 65.28125 -193.78125 60 -193.78125 Z M 45.171875 4.828125 C 39.191406 4.828125 35.28125 2.414062 33.4375 -2.40625 C 31.601562 -7.238281 30.6875 -13.675781 30.6875 -21.71875 C 30.6875 -34.59375 31.773438 -47.234375 33.953125 -59.640625 C 36.140625 -72.054688 38.328125 -83.894531 40.515625 -95.15625 C 42.703125 -106.425781 43.796875 -116.890625 43.796875 -126.546875 C 43.796875 -129.078125 43.675781 -131.832031 43.4375 -134.8125 C 43.207031 -137.800781 42.632812 -140.101562 41.71875 -141.71875 C 38.039062 -139.414062 33.269531 -135.617188 27.40625 -130.328125 C 21.550781 -125.046875 16.898438 -119.1875 13.453125 -112.75 C 11.835938 -114.363281 11.03125 -116.550781 11.03125 -119.3125 C 11.03125 -123.21875 12.582031 -127.46875 15.6875 -132.0625 C 18.789062 -136.65625 22.925781 -141.078125 28.09375 -145.328125 C 33.269531 -149.585938 38.847656 -153.097656 44.828125 -155.859375 C 50.804688 -158.617188 56.664062 -160 62.40625 -160 C 67.695312 -160 71.085938 -158.734375 72.578125 -156.203125 C 74.078125 -153.671875 74.828125 -150.453125 74.828125 -146.546875 C 74.828125 -140.796875 74.078125 -133.378906 72.578125 -124.296875 C 71.085938 -115.222656 69.363281 -105.515625 67.40625 -95.171875 C 65.457031 -84.828125 63.734375 -74.484375 62.234375 -64.140625 C 60.742188 -53.796875 60 -44.367188 60 -35.859375 C 60 -31.492188 60.226562 -27.414062 60.6875 -23.625 C 61.144531 -19.832031 61.71875 -16.671875 62.40625 -14.140625 C 68.15625 -16.671875 73.613281 -20.40625 78.78125 -25.34375 C 83.957031 -30.28125 87.8125 -34.9375 90.34375 -39.3125 C 91.71875 -37.238281 92.40625 -35.050781 92.40625 -32.75 C 92.40625 -29.070312 90.796875 -25.050781 87.578125 -20.6875 C 84.359375 -16.320312 80.332031 -12.179688 75.5 -8.265625 C 70.675781 -4.359375 65.5625 -1.203125 60.15625 1.203125 C 54.757812 3.617188 49.765625 4.828125 45.171875 4.828125 Z M 45.171875 4.828125 "}))))),Et=e=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:500,zoomAndPan:"magnify",viewBox:"0 0 375 374.999991",height:500,preserveAspectRatio:"xMidYMid meet",...e},r.createElement("defs",null,r.createElement("g",null),r.createElement("clipPath",{id:"59a10ac27a"},r.createElement("path",{d:"M 17.179688 32.695312 L 360 32.695312 L 360 337.5 L 17.179688 337.5 Z M 17.179688 32.695312 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"664b27481e"},r.createElement("path",{d:"M 207.042969 43.574219 L 356.394531 304.941406 C 360.242188 311.675781 360.214844 319.953125 356.324219 326.660156 C 352.429688 333.371094 345.257812 337.5 337.5 337.5 L 39.375 337.5 C 31.617188 337.5 24.445312 333.371094 20.554688 326.660156 C 16.660156 319.953125 16.632812 311.675781 20.480469 304.941406 L 169.832031 43.574219 C 173.648438 36.898438 180.746094 32.777344 188.4375 32.777344 C 196.128906 32.777344 203.226562 36.898438 207.042969 43.574219 Z M 207.042969 43.574219 ",clipRule:"nonzero"}))),r.createElement("g",{clipPath:"url(#59a10ac27a)"},r.createElement("g",{clipPath:"url(#664b27481e)"},r.createElement("path",{fill:"#d97706",d:"M 1.875 11.015625 L 375.546875 11.015625 L 375.546875 337.5 L 1.875 337.5 Z M 1.875 11.015625 ",fillOpacity:1,fillRule:"nonzero"}))),r.createElement("g",{fill:"#ffffff",fillOpacity:1},r.createElement("g",{transform:"translate(158.410439, 295.655517)"},r.createElement("g",null,r.createElement("path",{d:"M 46.890625 -63.21875 C 46.890625 -63.21875 46.890625 -64.445312 46.890625 -66.90625 L 46.890625 -176.46875 C 46.890625 -178.925781 46.1875 -180.859375 44.78125 -182.265625 C 43.375 -183.671875 41.441406 -184.375 38.984375 -184.375 L 21.078125 -184.375 C 18.617188 -184.375 16.6875 -183.671875 15.28125 -182.265625 C 13.875 -180.859375 13.171875 -178.925781 13.171875 -176.46875 L 13.171875 -66.90625 C 13.171875 -64.445312 13.875 -62.515625 15.28125 -61.109375 C 16.6875 -59.703125 18.617188 -59 21.078125 -59 L 38.984375 -59 C 41.441406 -59 43.375 -59.703125 44.78125 -61.109375 C 46.1875 -62.515625 46.890625 -63.21875 46.890625 -63.21875 Z M 46.890625 -4.21875 C 46.890625 -4.21875 46.890625 -5.445312 46.890625 -7.90625 L 46.890625 -25.546875 C 46.890625 -28.003906 46.1875 -29.9375 44.78125 -31.34375 C 43.375 -32.75 41.441406 -33.453125 38.984375 -33.453125 L 21.078125 -33.453125 C 18.617188 -33.453125 16.6875 -32.75 15.28125 -31.34375 C 13.875 -29.9375 13.171875 -28.003906 13.171875 -25.546875 L 13.171875 -7.90625 C 13.171875 -5.445312 13.875 -3.515625 15.28125 -2.109375 C 16.6875 -0.703125 18.617188 0 21.078125 0 L 38.984375 0 C 41.441406 0 43.375 -0.703125 44.78125 -2.109375 C 46.1875 -3.515625 46.890625 -4.21875 46.890625 -4.21875 Z M 46.890625 -4.21875 "})))));var Ve={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},De=i.createContext&&i.createContext(Ve),wt=["attr","size","title"];function Ct(e,a){if(e==null)return{};var n=jt(e,a),s,l;if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(l=0;l<c.length;l++)s=c[l],!(a.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(n[s]=e[s])}return n}function jt(e,a){if(e==null)return{};var n={};for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){if(a.indexOf(s)>=0)continue;n[s]=e[s]}return n}function je(){return je=Object.assign?Object.assign.bind():function(e){for(var a=1;a<arguments.length;a++){var n=arguments[a];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},je.apply(this,arguments)}function We(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);a&&(s=s.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,s)}return n}function Se(e){for(var a=1;a<arguments.length;a++){var n=arguments[a]!=null?arguments[a]:{};a%2?We(Object(n),!0).forEach(function(s){St(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):We(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function St(e,a,n){return a=Ot(a),a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function Ot(e){var a=kt(e,"string");return typeof a=="symbol"?a:a+""}function kt(e,a){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,a||"default");if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(e)}function Je(e){return e&&e.map((a,n)=>i.createElement(a.tag,Se({key:n},a.attr),Je(a.child)))}function ie(e){return a=>i.createElement(Lt,je({attr:Se({},e.attr)},a),Je(e.child))}function Lt(e){var a=n=>{var{attr:s,size:l,title:c}=e,d=Ct(e,wt),h=l||n.size||"1em",p;return n.className&&(p=n.className),e.className&&(p=(p?p+" ":"")+e.className),i.createElement("svg",je({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,s,d,{className:p,style:Se(Se({color:e.color||n.color},n.style),e.style),height:h,width:h,xmlns:"http://www.w3.org/2000/svg"}),c&&i.createElement("title",null,c),e.children)};return De!==void 0?i.createElement(De.Consumer,null,n=>a(n)):a(Ve)}function Pt(e){return ie({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M17.47 250.9C88.82 328.1 158 397.6 224.5 485.5c72.3-143.8 146.3-288.1 268.4-444.37L460 26.06C356.9 135.4 276.8 238.9 207.2 361.9c-48.4-43.6-126.62-105.3-174.38-137z"},child:[]}]})(e)}const Xe=i.createContext(),Rt=({children:e})=>{const[a,n]=i.useState(!1),[s,l]=i.useState(),[c,d]=i.useState(),S={showAlert:a,setShowAlert:n,typeAlert:s,setTypeAlert:l,messageAlert:c,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:b=>{switch(b){case"danger":return o.jsx(bt,{className:"w-[20px] h-[20px]"});case"info":return o.jsx(yt,{className:"w-[20px] h-[20px]"});case"success":return o.jsx(Pt,{className:"text-xl"});case"warning":return o.jsx(Et,{className:"w-[20px] h-[20px]"})}},closeAlert:()=>{n(!a)},activeAlert:(b,u)=>{n(!1),setTimeout(()=>{l(b),d(u),n(!0)},50)}};return o.jsx(Xe.Provider,{value:S,children:e})},ne=()=>{const e=i.useContext(Xe);if(e===void 0)throw new Error("Non puoi modificare l'alert");return e};let de;const Ke=async(e,a,n,s,l,c)=>{if(de)return de;try{const h=await(await fetch("/config.json")).json(),p=h.baseUri,{unauthorized:x,notFound:j,defaultMessage:S}=h.axiosErrors,b=h.axiosTimeout;return de=He.create({baseURL:p,timeout:b}),de.interceptors.request.use(u=>u),de.interceptors.response.use(u=>u,u=>{if(u.response)switch(e==null||e(!0),a==null||a("danger"),u.response.status){case 401:localStorage.removeItem("accessToken"),n==null||n(x),s==null||s();break;case 404:n==null||n(j),l==null||l(u);break;default:n==null||n(`${S} ${u.response.status||""} ${u.response.data.error||""}`),c==null||c(u)}return Promise.reject(u)}),de}catch(d){console.error(d)}},Qe=i.createContext(),Nt=({children:e})=>{const{heartbeatEndpoint:a,firstPrivatePath:n,infiniteSession:s,timeDeducted:l,authenticatedEndpoint:c,autoLogin:d,setCurrentDate:h,isDebug:p,backendToken:x,useCustomLoginTimeout:j,customLoginTimeout:S,tokenLog:b,timerInfiniteSession:u}=ee(),{setIsLoading:g,showLoadingFor:y}=fe(),{setShowAlert:v,setMessageAlert:O,setTypeAlert:k,activeAlert:P}=ne(),E=C.useNavigate(),[N,M]=i.useState(null),[W,$]=i.useState(),[H,Y]=i.useState(),[Z,ae]=i.useState(),[J,D]=i.useState(!1),_=async(R=B,T,G)=>await Ke(v,k,O,R,T,G),X=async(R=null,T)=>{R&&R.preventDefault(),D(!0);try{j||g(!0),y(S),v(!1);const I=await(await _()).post(c,{auth:T}),re=I.headers.token,V=I.data;re&&(localStorage.setItem("accessToken",re),localStorage.setItem("user",JSON.stringify(V)),M(!0),$(re),E(`${n}${V.id}`))}catch(G){console.error(G)}finally{D(!1),j||g(!1)}},B=()=>{localStorage.removeItem("accessToken"),localStorage.removeItem("id"),localStorage.removeItem("user"),M(!1),$(null)},le=async()=>{try{const R=localStorage.getItem("accessToken"),I=(await(await _()).get(`${a}`,{headers:{Authorization:R}})).headers.token;localStorage.setItem("accessToken",I),$(I),b&&console.log("[Auth]: Nuovo token: ",I,"Data:",h())}catch(R){console.error(R),B()}},q=R=>{const T=R||W;if(!T)return;const G="Token non valido";try{const I=_e(T);if(!I.exp){b&&console.warn("[Auth]: Token senza data di scadenza, eseguo logout."),B(),P("danger",G);return}const re=Math.floor(Date.now()/1e3),V=(I.exp-re)*1e3;if(V<=0){b&&console.warn("[Auth]: Token scaduto, eseguo logout."),B(),P("danger",G);return}if(ae(V),Y(V-l),b){const pe=Math.floor(V/1e3),Ee=Math.floor(pe/60),he=pe%60;console.log(`[Auth]: Token valido per ancora: ${Ee} minuti e ${he} secondi`),console.log("[Auth]: Token:",T)}}catch(I){b&&console.error("[Auth]: Errore nella decodifica del token:",I),B(),P("danger",G)}},te=R=>{if(!R)return!1;try{const T=_e(R),G=Math.floor(Date.now()/1e3);return!T.exp||T.exp<G?(console.warn("[Auth]: Token scaduto o non valido"),!1):!0}catch(T){return console.error("[Auth]: Token non valido o corrotto",T),!1}},U=async R=>{try{const I=(await(await _()).get(a,{headers:{Authorization:R}})).data;I&&(localStorage.setItem("user",JSON.stringify(I)),localStorage.setItem("accessToken",R),M(!0),E(`${n}${I.id}`))}catch(T){console.error(T)}},ce=()=>{const R=localStorage.getItem("accessToken");te(R)?(b&&console.log("[Auth]: Ricarico pagina → controllo scadenza token"),q(R)):(b&&console.warn("[Auth]: Token non valido al reload, eseguo logout"),B())};i.useEffect(()=>{const R=localStorage.getItem("accessToken");if(!te(R)){B();return}M(!0)},[]),i.useEffect(()=>{d&&!N&&!J&&(b&&console.log("[Auth]: Tentativo di autologin con backendToken"),U(x))},[d,N,J]),i.useEffect(()=>{if(document.readyState==="complete")ce();else return window.addEventListener("load",ce),()=>window.removeEventListener("load",ce)},[]),i.useEffect(()=>{if(b&&console.log("timeoutToken:",H),d)return;q();const R=u||H;b&&console.log("[Auth]: intervallo per il prossimo token:",R);let T;s&&W&&H&&(b&&console.log("[Auth]: Entrato dentro il timer della sessione infinita"),T=setInterval(()=>{le()},R));let G;return!s&&W&&Z&&(b&&console.log("[Auth]: Entrato dentro il timer della sessione con scadenza del token"),G=setTimeout(()=>{B(),P("danger","Sessione scaduta")},Z)),()=>{T&&clearInterval(T),G&&clearTimeout(G)}},[W,H]);const me={isAuthenticated:N,setIsAuthenticated:M,login:X,logout:B,setCurrentToken:$,createAxiosInstances:_,fetchHeartbeat:le,getTokenExpiry:q,checkTokenValidity:te,fetchUser:U,handleLoad:ce};return o.jsx(Qe.Provider,{value:me,children:e})},ye=()=>{const e=i.useContext(Qe);if(e===void 0)throw new Error("Non sei dentro al Auth Provider");return e},et=i.createContext(),Tt=({children:e,publicRoutes:a=[],privateRoutes:n=[]})=>o.jsx(et.Provider,{value:{publicRoutes:a,privateRoutes:n},children:e}),tt=()=>{const e=i.useContext(et);if(e===void 0)throw new Error(`Errore: Le rotte non sono state inizializzate correttamente.
59
59
 
60
60
  Soluzione: Assicurati di avvolgere il tuo componente con <RouteProvider>.
61
61
 
@@ -63,4 +63,4 @@ Esempio:
63
63
 
64
64
  <RouteProvider publicRoutes={[]} privateRoutes={[]}>
65
65
  <MyPackageRoutes />
66
- </RouteProvider>`);return e},rt=i.createContext(),At=({children:e})=>{const{login:a}=ye(),{clearLoginFormOnError:n}=ee(),s={email:"",password:""},[l,c]=i.useState("Accedi"),[d,h]=i.useState("Email"),[p,x]=i.useState("email"),[j,S]=i.useState("example@example.it"),[b,u]=i.useState("Accedi"),[g,y]=i.useState(s),[v,O]=i.useState(),[k,P]=i.useState(),[E,R]=i.useState(),[M,W]=i.useState(),[$,q]=i.useState({}),[H,Y]=i.useState(null),D={overrideStyle:$,setOverrideStyle:q,title:l,setTitle:c,label:d,setLabel:h,type:p,setType:x,placeholder:j,setPlaceholder:S,buttonText:b,setButtonText:u,formData:g,setFormData:y,LogoImg:v,setLogoImg:O,styleCardForm:k,setStyleCardForm:P,styleContainerLogo:E,setStyleContainerLogo:R,styleLogo:M,setStyleLogo:W,changeData:(_,X)=>{y(B=>({...B,[_]:X}))},handleLogin:_=>{a(_,g),n&&y(s)},customVersion:H,setCustomVersion:Y};return o.jsx(rt.Provider,{value:D,children:e})},Te=()=>{const e=i.useContext(rt);if(e===void 0)throw new Error("Non puoi modificare La login");return e},ot=i.createContext(),Mt=({children:e})=>{const[a,n]=i.useState(!1),[s,l]=i.useState(null),[c,d]=i.useState(""),[h,p]=i.useState(null),[x,j]=i.useState(null),[S,b]=i.useState(null),[u,g]=i.useState("modal-form"),[y,v]=i.useState("submit"),[O,k]=i.useState({}),[P,E]=i.useState(null),[R,M]=i.useState(null),[W,$]=i.useState(null),q=({modalData:D,component:_,title:X="",onConfirm:B=null,type:le="submit",formId:Z="modal-form",item:te=null,style:U})=>{E(D),l(()=>_),d(X),p(()=>B),v(le),g(Z),b(te),k(U),n(!0)},H=()=>{l(null),d(""),p(null),v("submit"),g("modal-form"),b(null),k({}),n(!1),E(null)},J={isOpen:a,openModal:q,closeModal:H,content:s,title:c,onConfirm:h,type:y,item:S,formId:u,style:O,modalData:P,setModalData:E,handleChange:D=>{const{name:_,value:X}=D.target;E(B=>({...B,[_]:X}))},handleSubmit:D=>{D.preventDefault(),h&&(h(P),H())},headerContent:R,setHeaderContent:M,footerContent:W,setFooterContent:$,onCancel:x,setOnCancel:j};return o.jsx(ot.Provider,{value:J,children:e})},nt=()=>{const e=i.useContext(ot);if(e===void 0)throw new Error("Non sei all'interno del ModalProvider");return e};function at(e){return ie({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:[]}]})(e)}const st=()=>{const{loadingProps:e,loadingComponent:a}=fe(),{spinner:n=!0,spinnerStyle:s,text:l,textStyle:c,children:d,containerStyle:h,overrideStyle:p={}}=e;return a||o.jsxs("div",{className:p.container||`fixed top-0 bottom-0 left-0 right-0 flex items-center justify-center bg-loading-bg z-[999] ${h}`,children:[n&&o.jsx(at,{className:p.spinner||`text-[20rem] relative animate-spin text-spinner ${s}`}),d||o.jsx("p",{className:p.text||`text-white text-2xl select-none absolute ${c}`,children:l||"Loading..."})]})};function Gt(e){return ie({tag:"svg",attr:{viewBox:"0 0 15 15",fill:"none"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor"},child:[]}]})(e)}const Re=()=>{const{messageAlert:e,typeAlert:a,alertConfig:n,getIcon:s,closeAlert:l}=ne(),{alertTimeout:c}=ee(),[d,h]=i.useState(0),{bgColor:p,textColor:x,buttonBg:j,hoverBg:S,focusRing:b,progressColor:u}=n[a];return i.useEffect(()=>{let g;const v=100/(c/100);g=setInterval(()=>{h(k=>k>=100?(clearInterval(g),100):k+v)},100);const O=setTimeout(()=>{l()},c);return()=>{clearTimeout(O),clearInterval(g)}},[]),o.jsxs("div",{className:`flex items-center p-4 pt-6 ${x} rounded-lg ${p} 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:[o.jsx("div",{className:"w-full bg-gray-200 rounded-t-lg overflow-hidden h-2.5 absolute top-0 left-0 right-0",children:o.jsx("div",{className:`${u} h-2.5 rounded-t-lg`,style:{width:`${d}%`}})}),s(a),o.jsx("div",{className:"px-4 text-sm font-medium",children:e}),o.jsx("button",{type:"button",className:`ms-auto ${j} rounded-lg focus:ring-2 ${b} p-1.5 ${S} inline-flex items-center justify-center h-8 w-8 cursor-pointer`,title:"Close",onClick:l,children:o.jsx(Gt,{className:"text-xl"})})]})},It=({onClose:e,onConfirm:a,onCancel:n,type:s,formId:l,style:c})=>{const d=c.resetButton??!0,h=c.confirmButtonText??(s==="delete"?"Elimina":"Salva"),p=c.cancelButtonText??"Annulla",x=c.bgSaveButton??"bg-indigo-600 rounded-lg shadow-md hover:bg-indigo-700 hover:shadow-lg active:bg-indigo-800 text-white",j=c.bgDeleteButton??"bg-rose-500 rounded-lg shadow-md hover:bg-rose-600 hover:shadow-lg active:bg-rose-700 text-white",S=c.bgResetButton??"bg-rose-500 rounded-lg shadow-md hover:bg-rose-600 hover:shadow-lg active:bg-rose-700 text-white",b=c.bgCancelButton??"text-gray-800 bg-gray-300 rounded-lg shadow-md hover:bg-gray-400 hover:shadow-lg active:bg-gray-500",u=s==="custom"?c.customButtonStyle:null,g={delete:()=>{a==null||a(),e==null||e()},custom:()=>{a==null||a()}};return o.jsxs("footer",{className:"flex items-center justify-between mt-4",children:[o.jsx("button",{onClick:n||e,className:`${b} px-4 py-2 cursor-pointer text-sm font-medium active:shadow-sm transition-all duration-150 ease-in-out hover:opacity-90 active:scale-95 active:opacity-70`,children:p}),o.jsxs("div",{className:"flex items-center gap-4",children:[s!=="delete"&&d&&o.jsx("button",{type:"reset",form:l,className:`px-4 py-2 cursor-pointer text-sm font-medium ${S} active:shadow-sm transition-all duration-150 ease-in-out hover:opacity-90 active:scale-95 active:opacity-70`,children:"Reset"}),o.jsx("button",{type:s==="submit"?"submit":"button",form:s==="submit"?l:void 0,onClick:()=>{var y;return(y=g[s])==null?void 0:y.call(g)},className:u||`${s==="delete"?j:x} px-4 py-2 cursor-pointer text-sm font-medium active:shadow-sm transition-all duration-150 ease-in-out hover:opacity-90 active:scale-95 active:opacity-70`,children:h})]})]})};function Bt(e){return ie({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"18",y1:"6",x2:"6",y2:"18"},child:[]},{tag:"line",attr:{x1:"6",y1:"6",x2:"18",y2:"18"},child:[]}]})(e)}const _t=({onClose:e,type:a,title:n,name:s,onCancel:l})=>o.jsxs("header",{className:`flex items-center justify-between mb-4 ${a==="delete"?"gap-8":""}`,children:[a==="delete"&&s?o.jsxs("h2",{className:"text-2xl",children:["Sei sicuro di volere eliminare: ",o.jsx("strong",{children:s}),"?"]}):o.jsx("h2",{className:"text-2xl",children:n||"Conferma operazione"}),o.jsx("button",{onClick:l||e,className:"text-gray-500 hover:text-gray-700 cursor-pointer transition-transform duration-150 ease-in-out hover:scale-110 hover:opacity-80 active:scale-95 active:opacity-60","aria-label":"Chiudi modale",children:o.jsx(Bt,{className:"text-2xl"})})]}),zt=({type:e,children:a,item:n,overrideStyle:s})=>o.jsx(o.Fragment,{children:e!=="delete"&&o.jsx("main",{className:s||"my-8 max-h-[600px] overflow-y-auto overflow-x-hidden",children:e==="delete"&&!n?o.jsx("div",{className:"text-red-600 font-semibold",children:"Errore: nessun item selezionato per l'operazione."}):a})}),$t=({isOpen:e,onClose:a,onCancel:n,title:s,formId:l,children:c,item:d,onConfirm:h,type:p="submit",style:x={},headerContent:j,footerContent:S})=>{const b=i.useRef(null),[u,g]=i.useState(e),y=()=>{e||g(!1)},v=x.width??(p==="delete"?"max-w-md w-auto":"w-full max-w-4xl"),O=x.bgModal??"bg-white",k=x.bgOverlay??"bg-black/50",P=x.zIndex??"z-50";return i.useEffect(()=>{e&&g(!0)},[e]),i.useEffect(()=>{const E=R=>{R.key==="Escape"&&(n?n():a())};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[a,n]),i.useEffect(()=>{var E;if(e){const R=document.activeElement;return(E=b.current)==null||E.focus(),()=>R==null?void 0:R.focus()}},[e]),u?Ye.createPortal(o.jsx("div",{className:`fixed inset-0 ${P} flex items-center justify-center transition-opacity duration-200 ${e?`${k} opacity-100`:"opacity-0"}`,onClick:n||a,onTransitionEnd:y,children:o.jsxs("div",{ref:b,className:`relative ${O} rounded-lg p-6 shadow-xl ${v} transform transition-transform duration-200 ${e?"scale-100 opacity-100":"scale-95 opacity-0"}`,onClick:E=>E.stopPropagation(),role:"dialog","aria-modal":"true",tabIndex:-1,children:[j||o.jsx(_t,{onClose:a,onCancel:n,type:p,title:s,name:d==null?void 0:d.name}),o.jsx(zt,{type:p,item:d,overrideStyle:x.overrideStyle,children:c}),S||o.jsx(It,{onClose:a,onCancel:n,onConfirm:h,type:p,formId:l,style:x})]})}),document.body):null},it=e=>{const{isLoading:a}=fe(),{showAlert:n}=ne(),{isOpen:s,closeModal:l,onCancel:c,content:d,title:h,onConfirm:p,item:x,type:j,formId:S,style:b,headerContent:u,footerContent:g}=nt(),y=C.useLocation(),{isMain:v=!0,headerComponent:O=null,showHeaderOnLogin:k=!1,headerExcludedRoutes:P=[],footerComponent:E=null,showFooterOnLogin:R=!1,footerExcludedRoutes:M=[]}=e,W=P.some(Y=>C.matchPath(Y,y.pathname));let $;y.pathname==="/"?$=O&&k:$=O&&!W;const q=M.some(Y=>C.matchPath(Y,y.pathname));let H;return y.pathname==="/"?H=E&&R:H=E&&!q,o.jsxs(o.Fragment,{children:[a&&o.jsx(st,{}),n&&o.jsx(Re,{}),o.jsx($t,{isOpen:s,onClose:l,onCancel:c,title:h,formId:S,onConfirm:p,type:j,item:x,style:b,headerContent:u,footerContent:g,children:d}),$&&O,v?o.jsxs("main",{className:a?"hidden":"",children:[n&&o.jsx(Re,{}),o.jsx(C.Outlet,{})]}):o.jsx(C.Outlet,{}),H&&E]})},Oe=e=>{const{inputType:a,inputId:n,inputPlaceholder:s,inputRequired:l,inputValue:c,inputChange:d,inputName:h,autoFocus:p,inputStyle:x,overrideStyle:j,disabled:S}=e,u=["text","email","password","search","tel","url"].includes(a)?a:"text";return o.jsx("input",{type:u,autoFocus:p,id:n,className:j||`bg-input-bg border border-input-border text-input-text text-input-placeholder input-rounded focus:ring focus:ring-primary focus:border-primary focus:outline-none focus:shadow-(--shadow-primary-input) block w-full p-input ${x}`,placeholder:s,required:l??!0,value:c,onChange:d,disabled:S,name:h})},ke=({label:e,labelId:a,labelStyle:n,overrideStyle:s})=>o.jsx("label",{htmlFor:a,className:s||`show-label mb-1 sm:mb-2 text-input-label font-medium text-color-label ${n}`,children:e}),lt=()=>{const{title:e,label:a,type:n,placeholder:s,buttonText:l,formData:c,changeData:d,handleLogin:h,overrideStyle:p}=Te();return o.jsxs("form",{onSubmit:h,className:p.form||"form-size",children:[o.jsx("h1",{className:p.title||"text-form-title-size show-title title-position m-form-title",children:e}),o.jsxs("div",{className:p.containerEmail||"flex justify-center flex-col gap-1 m-input-form input-size mx-auto",children:[o.jsx(ke,{labelId:"user-email",label:a}),o.jsx(Oe,{inputType:n,inputId:"user-email",inputPlaceholder:s,inputValue:c.email,inputChange:x=>{d("email",x.target.value)},autoFocus:!0})]}),o.jsxs("div",{className:p.containerPassword||"flex justify-center flex-col gap-1 my-4 input-size mx-auto",children:[o.jsx(ke,{labelId:"password",label:"Password"}),o.jsx(Oe,{inputType:"password",inputId:"password",inputPlaceholder:"Password",inputValue:c.password,inputChange:x=>{d("password",x.target.value)}})]}),o.jsx("div",{className:p.containerButton||"flex button-position items-center m-primary-button",children:o.jsx("button",{className:p.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:l})})]})},ct=({Logo:e})=>{const{styleCardForm:a,styleContainerLogo:n,styleLogo:s,overrideStyle:l,customVersion:c}=Te(),{firstPrivatePath:d,version:h}=ee(),p=C.useNavigate();return i.useEffect(()=>{const x=JSON.parse(localStorage.getItem("user"));localStorage.getItem("accessToken")&&x.id&&p(`${d}${x.id}`)},[]),o.jsxs("section",{id:"login-page",children:[(h||c)&&o.jsx("div",{className:"text-md text-primary absolute top-4 left-4",children:c||h}),o.jsx("div",{className:l.container||"container mx-auto flex items-center justify-center h-screen",children:o.jsxs("div",{className:l.cardForm||`bg-form card-style card-size flex flex-col sm:flex-row sm:items-center justify-center ${a}`,children:[o.jsx("div",{className:l.containerLogo||`basis-1/2 flex items-center justify-center ${n}`,children:e&&o.jsx(e,{className:l.logo||`login-logo h-full sm:h-auto ${s}`})}),o.jsx(lt,{})]})})]})},be=()=>{const{isAuthenticated:e}=ye(),{activeAlert:a}=ne(),{autoLogin:n}=ee();return i.useEffect(()=>{const s=localStorage.getItem("accessToken");!e&&!s&&!n&&a("danger","Non sei autorizzato")},[]),e===null?null:e?o.jsx(C.Outlet,{}):o.jsx(C.Navigate,{to:"/",replace:!0})},ut=()=>{const{logout:e,setCurrentToken:a,createAxiosInstances:n}=ye(),{usersEndpoint:s}=ee(),{setIsLoading:l}=fe(),{activeAlert:c}=ne(),[d,h]=i.useState(null),[p,x]=i.useState(!1),j=JSON.parse(localStorage.getItem("user")),S=async()=>{try{x(!0);const u=localStorage.getItem("accessToken");if(!u){e(),c("danger","Sessione Scaduta");return}const v=(await(await n()).get(`${s}`,{headers:{Authorization:`Bearer ${u}`}})).data;h(v)}catch(u){console.error(u),l(!1)}finally{x(!1)}},b=()=>{e(),c("info","Hai effettuato il logout")};return i.useEffect(()=>{const u=localStorage.getItem("accessToken");u&&a(u)},[]),o.jsx("section",{children:o.jsxs("div",{className:"container mx-auto py-8",children:[o.jsxs("div",{className:"flex items-center justify-center gap-8 h-20",children:[o.jsxs("h1",{className:"text-4xl text-center text-slate-800",children:["Email: ",j.email]}),o.jsx("button",{onClick:b,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"})]}),o.jsx("div",{className:"flex justify-center items-center my-12 gap-8",children:o.jsx("button",{onClick:S,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:p,children:"Lista degli utenti"})}),o.jsx("div",{className:"flex justify-center items-center",children:d&&o.jsx("ul",{children:d.map(u=>o.jsxs("li",{className:"text-xl my-4",children:[u.id," - ",u.email]},`user-${u.id}`))})})]})})},Ft=e=>r.createElement("svg",{width:"108.41262mm",height:"108.41262mm",viewBox:"0 0 108.41262 108.41262",id:"svg1",xmlSpace:"preserve",xmlnsXlink:"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/svg","xmlns:svg":"http://www.w3.org/2000/svg",...e},r.createElement("defs",{id:"defs1"},r.createElement("linearGradient",{id:"linearGradient27"},r.createElement("stop",{style:{stopColor:"#ff0000",stopOpacity:1},offset:0,id:"stop27"}),r.createElement("stop",{style:{stopColor:"#ffca00",stopOpacity:.96862745},offset:1,id:"stop28"})),r.createElement("linearGradient",{xlinkHref:"#linearGradient27",id:"linearGradient28",x1:35.001785,y1:192.35495,x2:143.4144,y2:83.942337,gradientUnits:"userSpaceOnUse"}),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter90",x:-.059506074,y:-.12477839,width:1.1465613,height:1.3073246},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:1,floodColor:"rgb(0,0,0)",id:"feFlood89"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:.9,id:"feGaussianBlur89"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset89"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite89"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite90"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter147",x:-.31473854,y:-.27257434,width:1.6432813,height:1.5822092},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(255,255,255)",id:"feFlood146"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:9.5,id:"feGaussianBlur146"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:3.1,id:"feOffset146"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite146"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite147"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter385",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood384"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur384"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset384"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite384"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite385"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter387",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood385"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur385"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset385"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite386"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite387"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter389",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood387"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur387"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset387"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite388"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite389"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter391",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood389"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur389"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset389"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite390"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite391"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter393",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood391"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur391"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset391"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite392"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite393"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter395",x:0,y:0,width:1.0112203,height:1.010137},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood393"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur393"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset393"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite394"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite395"}))),r.createElement("g",{id:"layer1",transform:"translate(-35.001785,-83.942337)"},r.createElement("rect",{style:{fill:"url(#linearGradient28)",fillOpacity:1,fillRule:"evenodd",stroke:"#ff9b01",strokeWidth:0,strokeOpacity:1,paintOrder:"stroke markers fill"},id:"rect26",width:108.41262,height:108.41262,x:35.001785,y:83.942337,rx:30,ry:30}),r.createElement("g",{id:"g1",transform:"matrix(0.90701349,0,0,0.90701349,9.3696997,14.003172)",style:{strokeWidth:1.10252}},r.createElement("path",{id:"path272",style:{fill:"#000000",strokeWidth:1.10252},d:"m 103.62373,105.0137 c -0.2695,0.002 -0.78905,0.20889 -1.00345,0.40037 -0.0723,0.0646 -0.21317,0.24236 -0.313,0.39478 l -0.18141,0.27703 -0.0181,18.06409 -0.0178,18.06382 h -1.52343 -1.523699 l -2.7e-4,-9.75061 c -5.1e-4,-10.41143 -0.004,-10.51883 -0.34443,-11.94691 -1.39786,-5.8616 -6.2432,-10.12876 -12.21276,-10.75566 -1.515814,-0.1589 -19.83671,-0.16023 -20.462316,-0.003 l -0.0017,-0.004 -19.984159,3.5751 18.852043,2.16035 v 6.07801 l -17.36031,3.10307 17.360304,1.98933 v 6.52314 l -17.360304,3.10307 14.274817,1.63584 -0.01572,4.90514 -0.01864,5.72665 -0.63026,0.1252 c -1.586894,0.3153 -3.197032,1.06826 -4.528475,2.1172 -2.205268,1.73733 -3.741586,4.44584 -4.052716,7.1446 -0.370335,3.21237 0.552005,6.19841 2.657413,8.60144 1.687848,1.92642 4.173186,3.25989 6.695215,3.59241 v -5.2e-4 c 0.823968,0.10864 2.933749,0.0318 3.671522,-0.13399 0.932239,-0.20951 1.790163,-0.51486 2.636639,-0.93819 2.065707,-1.03314 3.823794,-2.77572 4.827084,-4.78447 0.504382,-1.00984 0.910162,-2.2066 1.026636,-3.02875 l 0.04632,-0.32925 h 9.414169 9.413628 v 0.21364 c 0,0.11749 0.0641,0.46829 0.14251,0.77944 0.90405,3.58952 3.50881,6.4605 6.974649,7.68694 1.34306,0.47527 1.94661,0.56832 3.65554,0.56367 1.31935,-0.003 1.6122,-0.0248 2.18192,-0.1577 3.36735,-0.785 6.02631,-2.86016 7.51461,-5.86464 0.44078,-0.88981 0.88236,-2.20383 0.97202,-2.8921 l 0.0429,-0.32925 7.18349,-0.002 c 7.08058,-0.002 7.18734,-0.003 7.49462,-0.14278 0.6474,-0.29351 0.90064,-0.70316 0.90064,-1.45738 0,-0.56862 -0.16856,-0.94445 -0.54982,-1.22508 -0.50606,-0.37245 -0.22593,-0.35988 -7.89979,-0.35988 h -7.11582 l -0.11721,-0.59669 c -0.2611,-1.32878 -0.84786,-2.70966 -1.68167,-3.95762 -0.57002,-0.85316 -2.01938,-2.29531 -2.86466,-2.85108 -1.21392,-0.79816 -2.80463,-1.46394 -3.99997,-1.6734 l -0.5016,-0.0876 -0.0181,-21.17061 -0.0178,-21.17036 -0.15424,-0.31167 c -0.25804,-0.52106 -0.8796,-0.9025 -1.46482,-0.8993 z m 9.34091,0.76079 c -1.96193,0 -3.68713,1.06774 -4.53247,2.80552 -0.53635,1.10262 -0.53017,1.02648 -0.50719,6.44296 l 0.0203,4.7802 0.18834,0.55566 c 0.62086,1.83041 2.22554,3.17608 4.08307,3.42406 0.24153,0.0323 2.71506,0.0532 5.4965,0.0458 5.70515,-0.0145 5.3423,0.0172 6.54658,-0.57378 0.54778,-0.26881 0.75708,-0.42234 1.25039,-0.91741 0.48917,-0.4909 0.64889,-0.70949 0.91635,-1.25279 0.53896,-1.09564 0.53516,-1.04438 0.53516,-6.26129 0,-4.84593 -0.0122,-5.0614 -0.32764,-5.86224 -0.76424,-1.94014 -2.6134,-3.18671 -4.72693,-3.18671 h -0.55701 l -0.003,4.13929 -0.003,4.13902 -1.87799,1.48961 c -1.03267,0.8192 -1.9166,1.51251 -1.96429,1.54074 -0.0554,0.0327 -0.79171,-0.51293 -2.03382,-1.50745 l -1.94697,-1.55885 v -4.12119 -4.12117 z m 2.28928,0.5522 v 3.46322 3.46375 l 1.08417,0.86973 c 0.59637,0.47836 1.10581,0.86085 1.13185,0.85003 0.0261,-0.0108 0.53535,-0.40918 1.13212,-0.88546 l 1.08497,-0.866 -0.0171,-3.42912 -0.0168,-3.42939 -2.19977,-0.0184 z m -47.246903,6.50849 9.196533,0.0248 c 9.138394,0.0246 9.200727,0.0256 9.88912,0.17528 2.276157,0.49507 4.008841,1.42496 5.576421,2.99252 1.56294,1.56292 2.49402,3.26009 3.00157,5.47254 0.15094,0.65777 0.15069,0.6637 0.16943,10.68613 l 0.0189,10.02763 -1.19632,-2.6e-4 -1.19658,-2.6e-4 -2.909674,-2.90889 c -2.148162,-2.14765 -2.999001,-2.95439 -3.251981,-3.08256 l -0.342815,-0.17367 h -9.477299 -9.477299 v -11.60676 z m 44.869453,16.35471 c -0.8458,0 -1.3552,0.0997 -1.97601,0.38599 -1.35181,0.62342 -2.29671,1.66611 -2.77169,3.05885 l -0.18354,0.53889 -0.0203,4.74531 c -0.0228,5.40031 -0.0234,5.39175 0.50346,6.47758 0.5061,1.04314 1.24312,1.77945 2.29621,2.29407 0.34744,0.1698 0.83013,0.35177 1.07325,0.40464 h 5.1e-4 c 0.35322,0.0766 1.47942,0.0968 5.60252,0.10015 5.81748,0.004 5.68307,0.0148 6.74876,-0.50692 1.37728,-0.67421 2.29905,-1.80091 2.67474,-3.26982 0.12915,-0.50539 0.13665,-0.78389 0.13665,-5.22267 0,-4.44771 -0.007,-4.7167 -0.13746,-5.23651 -0.23263,-0.92645 -0.63571,-1.63668 -1.31912,-2.32417 -0.51589,-0.519 -0.69084,-0.64491 -1.31831,-0.94858 -0.81757,-0.39568 -1.26328,-0.49681 -2.19099,-0.49681 h -0.64544 v 4.11159 4.11159 l -1.90888,1.51757 c -1.04987,0.83448 -1.93862,1.52747 -1.97495,1.54022 -0.0363,0.0129 -0.93815,-0.6732 -2.00425,-1.52423 l -1.93845,-1.54714 -2.7e-4,-4.10467 -5.1e-4,-4.10493 z m 2.37718,0.55434 0.004,3.44644 0.004,3.4467 1.05221,0.84416 h 5.1e-4 c 0.57884,0.46404 1.07893,0.84576 1.1116,0.84843 0.0327,0.003 0.55455,-0.39065 1.1601,-0.87373 l 1.10122,-0.87826 v -3.41687 -3.41687 h -2.21709 z m -50.294829,9.49115 h 10.511122 10.511121 l 3.015165,3.00185 c 2.567942,2.55652 3.057622,3.01393 3.300462,3.08282 0.2049,0.0582 1.62307,0.0807 5.03966,0.0807 h 4.754629 v 1.5799 1.57938 l -0.53676,0.0938 c -1.12048,0.19566 -2.647899,0.80928 -3.728799,1.49786 -1.68955,1.07633 -3.11899,2.69978 -3.99411,4.53647 -0.44366,0.93112 -0.88466,2.34132 -0.88466,2.82896 v 0.21524 H 83.533023 74.11886 l -0.04632,-0.32925 c -0.173141,-1.22207 -0.843416,-2.86149 -1.706703,-4.17392 -0.532033,-0.80881 -1.995609,-2.29178 -2.799129,-2.83643 -1.322594,-0.89646 -2.959014,-1.5737 -4.282866,-1.77223 l -0.324987,-0.0488 v -4.66833 z"}),r.createElement("path",{id:"path268",style:{fill:"#ffffff",strokeWidth:1.10252},d:"m 103.6238,103.56164 c -0.26951,0.002 -0.78905,0.20888 -1.00346,0.40036 -0.0723,0.0646 -0.21316,0.24236 -0.313,0.39478 l -0.1814,0.27703 -0.0181,18.06409 -0.0178,18.06382 h -1.52344 -1.523699 l -2.6e-4,-9.7506 c -5.1e-4,-10.41144 -0.004,-10.51884 -0.34443,-11.94692 -1.39786,-5.86159 -6.2432,-10.12876 -12.212765,-10.75566 -1.515813,-0.1589 -19.836715,-0.16022 -20.46231,-0.003 l -0.0017,-0.004 -19.984159,3.5751 18.852043,2.16035 v 6.07801 l -17.36031,3.10307 17.36031,1.98934 v 6.52313 l -17.36031,3.10307 14.274823,1.63584 -0.01572,4.90514 -0.01864,5.72666 -0.630261,0.12519 c -1.586888,0.3153 -3.19702,1.06826 -4.528463,2.1172 -2.205268,1.73733 -3.741592,4.44584 -4.052721,7.1446 -0.370335,3.21237 0.55201,6.19842 2.657412,8.60144 1.687849,1.92642 4.173187,3.25989 6.695216,3.59241 v -5.2e-4 c 0.823962,0.10864 2.933749,0.0318 3.671527,-0.13398 0.932233,-0.20952 1.790157,-0.51486 2.636639,-0.9382 2.065707,-1.03313 3.823794,-2.77572 4.82709,-4.78447 0.504371,-1.00983 0.910151,-2.2066 1.026624,-3.02874 l 0.04632,-0.32925 h 9.414164 9.413621 v 0.21363 c 0,0.11749 0.0641,0.46829 0.14252,0.77944 0.90405,3.58952 3.50882,6.4605 6.974649,7.68695 1.34307,0.47527 1.94662,0.56831 3.65555,0.56366 1.31934,-0.003 1.6122,-0.0248 2.18192,-0.1577 3.36734,-0.785 6.0263,-2.86016 7.51461,-5.86464 0.44078,-0.88981 0.88236,-2.20383 0.97202,-2.89209 l 0.0429,-0.32925 7.18349,-0.002 c 7.08058,-0.002 7.18734,-0.003 7.49463,-0.14278 0.6474,-0.29351 0.90063,-0.70316 0.90063,-1.45737 0,-0.56863 -0.16856,-0.94446 -0.54981,-1.22508 -0.50607,-0.37246 -0.22593,-0.35988 -7.89979,-0.35988 h -7.11583 l -0.11721,-0.5967 c -0.2611,-1.32878 -0.84786,-2.70966 -1.68166,-3.95762 -0.57003,-0.85315 -2.01939,-2.29531 -2.86466,-2.85107 -1.21393,-0.79817 -2.80464,-1.46395 -3.99997,-1.6734 l -0.50159,-0.0876 -0.0181,-21.17061 -0.0179,-21.17036 -0.15424,-0.31166 c -0.25804,-0.52107 -0.8796,-0.90251 -1.46482,-0.8993 z m 9.34091,0.76078 c -1.96194,0 -3.68714,1.06774 -4.53248,2.80552 -0.53635,1.10263 -0.53017,1.02648 -0.50719,6.44296 l 0.0203,4.7802 0.18834,0.55567 c 0.62086,1.8304 2.22555,3.17607 4.08308,3.42406 0.24152,0.0323 2.71505,0.0532 5.4965,0.0458 5.70514,-0.0145 5.34229,0.0172 6.54658,-0.57378 0.54778,-0.2688 0.75707,-0.42233 1.25039,-0.91741 0.48917,-0.4909 0.64889,-0.70948 0.91635,-1.25279 0.53896,-1.09564 0.53516,-1.04438 0.53516,-6.26128 0,-4.84594 -0.0122,-5.06141 -0.32765,-5.86225 -0.76423,-1.94014 -2.6134,-3.18671 -4.72692,-3.18671 h -0.55701 l -0.003,4.13929 -0.003,4.13902 -1.87798,1.48961 c -1.03268,0.8192 -1.9166,1.51252 -1.96429,1.54074 -0.0554,0.0327 -0.79171,-0.51293 -2.03382,-1.50745 l -1.94698,-1.55886 v -4.12117 -4.12118 z m 2.28927,0.55221 v 3.46321 3.46375 l 1.08417,0.86974 c 0.59637,0.47835 1.10582,0.86085 1.13185,0.85002 0.0261,-0.0108 0.53535,-0.40918 1.13213,-0.88545 l 1.08496,-0.86601 -0.0171,-3.42912 -0.0168,-3.42939 -2.19978,-0.0184 z m -47.246901,6.50848 9.196533,0.0248 c 9.138394,0.0247 9.200727,0.0256 9.889125,0.17528 2.276152,0.49507 4.008834,1.42496 5.576414,2.99253 1.56294,1.56292 2.49402,3.26009 3.00158,5.47253 0.15094,0.65777 0.15069,0.6637 0.16942,10.68613 l 0.0189,10.02764 -1.19632,-2.7e-4 -1.19658,-2.6e-4 -2.909672,-2.90888 c -2.148163,-2.14765 -2.999001,-2.9544 -3.251981,-3.08256 l -0.342835,-0.17368 H 77.484375 68.00707 v -11.60675 z m 44.869461,16.35472 c -0.84581,0 -1.35521,0.0997 -1.97602,0.38599 -1.35181,0.62342 -2.29671,1.6661 -2.77169,3.05885 l -0.18354,0.53888 -0.0203,4.74531 c -0.0229,5.40032 -0.0234,5.39175 0.50346,6.47758 0.50611,1.04314 1.24312,1.77945 2.29621,2.29408 0.34744,0.1698 0.83013,0.35177 1.07325,0.40463 h 5.1e-4 c 0.35322,0.0766 1.47942,0.0968 5.60252,0.10015 5.81748,0.005 5.68308,0.0148 6.74876,-0.50692 1.37729,-0.67421 2.29905,-1.8009 2.67474,-3.26982 0.12916,-0.50539 0.13665,-0.78389 0.13665,-5.22266 0,-4.44771 -0.007,-4.7167 -0.13745,-5.23652 -0.23264,-0.92645 -0.63572,-1.63668 -1.31912,-2.32417 -0.5159,-0.519 -0.69084,-0.64491 -1.31832,-0.94858 -0.81757,-0.39568 -1.26328,-0.4968 -2.19098,-0.4968 h -0.64545 v 4.11159 4.11159 l -1.90888,1.51756 c -1.04987,0.83448 -1.93862,1.52747 -1.97495,1.54022 -0.0363,0.0129 -0.93815,-0.6732 -2.00425,-1.52423 l -1.93845,-1.54714 -2.6e-4,-4.10466 -5.2e-4,-4.10493 z m 2.37718,0.55434 0.004,3.44643 0.004,3.4467 1.0522,0.84416 h 5.2e-4 c 0.57883,0.46405 1.07893,0.84577 1.1116,0.84843 0.0327,0.003 0.55454,-0.39065 1.16009,-0.87374 l 1.10122,-0.87825 v -3.41686 -3.41687 h -2.21709 z m -50.294837,9.49114 H 75.47001 85.981126 l 3.015165,3.00185 c 2.56794,2.55652 3.05762,3.01393 3.30046,3.08283 0.20491,0.0582 1.62308,0.0807 5.03966,0.0807 h 4.754639 v 1.5799 1.57938 l -0.53676,0.0938 c -1.12049,0.19566 -2.647909,0.80928 -3.728809,1.49786 -1.68955,1.07634 -3.11898,2.69979 -3.99411,4.53647 -0.44366,0.93112 -0.88465,2.34132 -0.88465,2.82897 v 0.21523 h -9.413636 -9.414164 l -0.04632,-0.32925 c -0.173136,-1.22207 -0.843417,-2.86149 -1.706697,-4.17392 -0.53204,-0.80881 -1.995616,-2.29178 -2.799129,-2.83642 -1.322601,-0.89647 -2.959015,-1.57371 -4.282873,-1.77224 l -0.324986,-0.0487 v -4.66833 z"})),r.createElement("path",{style:{fill:"#ffffff",fillOpacity:1,fillRule:"evenodd",stroke:"#ff9b01",strokeWidth:0,strokeOpacity:1,paintOrder:"stroke markers fill"},d:"",id:"path40",transform:"scale(0.26458333)"}))),Dt=e=>{const{publicRoutes:a,privateRoutes:n}=tt(),{firstPrivatePath:s}=ee(),{logoImg:l=Ft,pathImg:c="./src/assets/MyWarehouse.svg",firstPrivateElement:d=o.jsx(ut,{}),globalLayout:h,isMain:p,headerComponent:x,showHeaderOnLogin:j,headerExcludedRoutes:S,footerComponent:b,showFooterOnLogin:u,footerExcludedRoutes:g,privateProvider:y,customProvider:v}=e;let O;h==="none"?O=null:i.isValidElement(h)?O=h:O=o.jsx(it,{isMain:p,headerComponent:x,showHeaderOnLogin:j,headerExcludedRoutes:S,footerComponent:b,showFooterOnLogin:u,footerExcludedRoutes:g});const k=y?i.cloneElement(y,{},v?i.createElement(v.type,v.props,o.jsx(be,{children:o.jsx(C.Outlet,{})})):o.jsx(be,{children:o.jsx(C.Outlet,{})})):v?i.createElement(v.type,v.props,o.jsx(be,{children:o.jsx(C.Outlet,{})})):o.jsx(be,{children:o.jsx(C.Outlet,{})}),P=()=>{const E=document.querySelector("link[rel='icon']");c&&(E.href=c)};return i.useEffect(()=>{P()},[]),o.jsx(C.Routes,{children:o.jsxs(C.Route,{element:O,children:[o.jsxs(C.Route,{path:"/",children:[o.jsx(C.Route,{index:!0,element:o.jsx(ct,{Logo:l})}),a.map((E,R)=>o.jsx(C.Route,{path:E.path,element:E.element},`public-${R}`))]}),o.jsxs(C.Route,{element:k,children:[o.jsx(C.Route,{path:`${s??"/dashboard/"}:id`,element:d}),n.map((E,R)=>o.jsx(C.Route,{path:E.path,element:E.element},`private-${R}`))]})]})})},Wt=({children:e})=>{var l;const a=C.useLocation(),{activeAlert:n}=ne(),s=JSON.parse(localStorage.getItem("user"));return i.useEffect(()=>{(!s||!s.admin)&&n("warning","Non puoi accedere a questa pagina")},[s]),!s||!s.admin?o.jsx(C.Navigate,{to:((l=a.state)==null?void 0:l.from)||"/",replace:!0}):e},Ht=({spinner:e=!0,spinnerStyle:a,text:n,textStyle:s,children:l,containerStyle:c,overrideStyle:d={}})=>o.jsxs("div",{className:d.container||`w-full h-full relative flex items-center justify-center ${c}`,children:[e&&o.jsx(at,{className:d.spinner||`text-[20rem] animate-spin text-black ${a}`}),l||o.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 ${s}`,children:n||"Loading..."})]}),Ne=({isTag:e=!1,value:a,label:n,placeholder:s,id:l,onChange:c,error:d=null})=>o.jsxs("div",{className:`flex items-center justify-center relative ${e?"gap-4 mb-2":"gap-1 m-4"}`,children:[o.jsx(ke,{labelId:l,label:n,overrideStyle:`text-xl font-bold text-color-label ${e?"":"basis-1/3"}`}),o.jsx(Oe,{type:"text",inputId:l,inputPlaceholder:s,inputValue:a||"",disabled:e,inputChange:c,overrideStyle:`${e?"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-focus-ring focus:border-spot-rfid-input-border focus:outline-none focus:shadow-spot-rfid-input block w-full p-input`}),d&&o.jsx("p",{className:"text-red-600 text-[13px] absolute bottom-0 left-26 translate-y-[20px]",children:d})]}),Yt=({title:e,showTag:a,value:n,tag:s,showButton:l,handleClick:c})=>o.jsxs("div",{className:`border border-slate-300 rounded-xl p-2 m-2 shadow-xl transition-all duration-700 transform ${e==="TAG B"?"delay-200":"mb-4"} ${a?"opacity-100 translate-y-0":"opacity-0 translate-y-10"}`,children:[o.jsx("h2",{className:"text-center mb-2 text-2xl",children:e}),o.jsx(Ne,{label:"TID",placeholder:`Leggi ${e}`,id:s?`tid-${s}`:"tid",isTag:!0,value:(n==null?void 0:n.valueTID)||""}),o.jsx(Ne,{label:"EPC",placeholder:`Leggi ${e}`,id:s?`epc-${s}`:"epc",isTag:!0,value:(n==null?void 0:n.valueEPC)||""}),!l&&o.jsx("div",{className:"flex items-center justify-center",children:o.jsx("button",{onClick:c,disabled:!(n!=null&&n.valueTID)&&!(n!=null&&n.valueEPC),className:"my-1 bg-write-button disabled:bg-write-button/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 Zt(e){return ie({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:[]}]})(e)}const qt=({minReadingPower:e,maxReadingPower:a,stepRangePower:n,rangeValue:s,setRangeValue:l,show:c,handleClick:d})=>{const h=(s-e)/(a-e)*100;return o.jsxs("div",{className:`border border-slate-300 rounded-xl p-2 m-2 shadow-xl transition-all duration-700 transform ${c?"opacity-100 translate-y-0":"opacity-0 translate-y-10"}`,children:[o.jsx("h2",{className:"text-center my-4 text-2xl",children:"Configurazione Potenza"}),o.jsxs("div",{className:"relative my-12 w-[90%] mx-auto",children:[o.jsx("input",{id:"power",type:"range",min:e,max:a,step:n,value:s,onChange:p=>l(Number(p.target.value)),className:"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer accent-primary-accent"}),o.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:`${h}%`},children:s})]}),o.jsx("div",{className:"flex items-center justify-center my-4",children:o.jsxs("button",{onClick:()=>d(s),className:"py-2 px-4 flex items-center justify-center gap-1 bg-save-button text-white rounded-lg shadow-md transition duration-200 ease-in-out transform active:translate-y-[2px] cursor-pointer",children:["Salva",o.jsx(Zt,{})]})})]})},Ut=({show:e,isConfigPage:a,handleSelectFile:n})=>o.jsxs("div",{className:`${a?`${e?"opacity-100 translate-y-0 delay-200":"opacity-0 translate-y-10"}`:""} p-4 text-center transition-all duration-700 transform`,children:[o.jsxs("h2",{className:"text-xl my-4",children:["Seleziona il file ",o.jsx("strong",{children:"config.json"})," per recuperare le chiavi univoche del dispositivo"]}),o.jsx("button",{onClick:n,className:"my-4 bg-blue-500 text-white px-4 py-2 rounded-lg",children:"Seleziona file"})]});function Vt(e){return ie({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:[]}]})(e)}function Jt(e){return ie({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:[]}]})(e)}const Xt=e=>r.createElement("svg",{width:"108.41262mm",height:"108.41262mm",viewBox:"0 0 108.41262 108.41262",id:"svg1",xmlSpace:"preserve",xmlnsXlink:"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/svg","xmlns:svg":"http://www.w3.org/2000/svg",...e},r.createElement("defs",{id:"defs1"},r.createElement("linearGradient",{id:"linearGradient27"},r.createElement("stop",{style:{stopColor:"#ff0000",stopOpacity:1},offset:0,id:"stop27"}),r.createElement("stop",{style:{stopColor:"#ffca00",stopOpacity:.96862745},offset:1,id:"stop28"})),r.createElement("linearGradient",{xlinkHref:"#linearGradient27",id:"linearGradient28",x1:35.001785,y1:192.35495,x2:143.4144,y2:83.942337,gradientUnits:"userSpaceOnUse"}),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter90",x:-.059506074,y:-.12477839,width:1.1465613,height:1.3073246},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:1,floodColor:"rgb(0,0,0)",id:"feFlood89"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:.9,id:"feGaussianBlur89"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset89"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite89"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite90"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter147",x:-.31473854,y:-.27257434,width:1.6432813,height:1.5822092},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(255,255,255)",id:"feFlood146"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:9.5,id:"feGaussianBlur146"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:3.1,id:"feOffset146"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite146"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite147"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter385",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood384"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur384"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset384"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite384"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite385"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter387",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood385"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur385"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset385"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite386"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite387"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter389",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood387"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur387"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset387"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite388"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite389"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter391",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood389"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur389"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset389"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite390"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite391"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter393",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood391"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur391"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset391"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite392"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite393"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter395",x:0,y:0,width:1.0112203,height:1.010137},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood393"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur393"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset393"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite394"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite395"}))),r.createElement("g",{id:"layer1",transform:"translate(-35.001785,-83.942337)"},r.createElement("rect",{style:{fill:"url(#linearGradient28)",fillOpacity:1,fillRule:"evenodd",stroke:"#ff9b01",strokeWidth:0,strokeOpacity:1,paintOrder:"stroke markers fill"},id:"rect26",width:108.41262,height:108.41262,x:35.001785,y:83.942337,rx:30,ry:30}),r.createElement("g",{id:"g1",transform:"matrix(1.0833532,0,0,1.1590115,-13.020803,-26.50933)",style:{strokeWidth:.892424}},r.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"}),r.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"}),r.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)"}),r.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)"})),r.createElement("path",{style:{fill:"#ffffff",fillOpacity:1,fillRule:"evenodd",stroke:"#ff9b01",strokeWidth:0,strokeOpacity:1,paintOrder:"stroke markers fill"},d:"",id:"path40",transform:"scale(0.26458333)"}))),Kt=({Logo:e,logo:a})=>{const{logout:n}=ye(),{activeAlert:s}=ne(),{autoLogin:l,configRoutes:c,firstPrivateTitle:d,showHeaderButton:h}=ee(),{isLoading:p}=fe(),x=C.useLocation(),j=C.useNavigate(),S=()=>{n(),s("info","Hai effettuato il logout")},b=c.find(g=>g.path===x.pathname),u=C.useMatch("home/:id");return o.jsx("header",{className:p?"hidden":"",children:o.jsxs("nav",{className:"header-size flex items-center justify-between px-2 shadow-lg border-b gap-2 border-b-gray-300",children:[o.jsx("figure",{children:e&&typeof e=="function"?o.jsx(e,{className:"header-logo-size"}):a?o.jsx("img",{src:a,alt:"Logo",className:"header-logo-size"}):o.jsx(Xt,{className:"header-logo-size"})}),o.jsx("div",{children:o.jsx("p",{children:(b==null?void 0:b.title)||d})}),o.jsxs("div",{children:[!l&&u&&o.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:S,children:o.jsx(Vt,{className:"text-4xl w-full"})}),!u&&h&&o.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:()=>j(-1),children:o.jsx(Jt,{className:"text-4xl w-full"})})]})]})})};Object.defineProperty(exports,"BrowserRouter",{enumerable:!0,get:()=>C.BrowserRouter});Object.defineProperty(exports,"Link",{enumerable:!0,get:()=>C.Link});Object.defineProperty(exports,"NavLink",{enumerable:!0,get:()=>C.NavLink});Object.defineProperty(exports,"Outlet",{enumerable:!0,get:()=>C.Outlet});Object.defineProperty(exports,"Route",{enumerable:!0,get:()=>C.Route});Object.defineProperty(exports,"Routes",{enumerable:!0,get:()=>C.Routes});Object.defineProperty(exports,"useLocation",{enumerable:!0,get:()=>C.useLocation});Object.defineProperty(exports,"useMatch",{enumerable:!0,get:()=>C.useMatch});Object.defineProperty(exports,"useNavigate",{enumerable:!0,get:()=>C.useNavigate});Object.defineProperty(exports,"useParams",{enumerable:!0,get:()=>C.useParams});exports.axios=He;exports.ReactDOM=Ye;exports.Alert=Re;exports.AlertProvider=Rt;exports.AuthAdmin=Wt;exports.AuthPage=be;exports.AuthProvider=Nt;exports.CardInputRange=qt;exports.CardInputTag=Yt;exports.ConfigFileReader=Ut;exports.ConfigProvider=vt;exports.Dashboard=ut;exports.DefaultLayout=it;exports.ErrorPage=qe;exports.Header=Kt;exports.Input=Oe;exports.InputGroup=Ne;exports.InputLabel=ke;exports.Loading=st;exports.LoadingComponent=Ht;exports.LoadingProvider=gt;exports.Login=ct;exports.LoginForm=lt;exports.LoginFormProvider=At;exports.ModalProvider=Mt;exports.PackageRoutes=Dt;exports.RouteProvider=Tt;exports.fetchAxiosConfig=Ke;exports.useAlert=ne;exports.useAuth=ye;exports.useConfig=ee;exports.useLoading=fe;exports.useLoginForm=Te;exports.useModal=nt;exports.useRoutesInjection=tt;
66
+ </RouteProvider>`);return e},rt=i.createContext(),At=({children:e})=>{const{login:a}=ye(),{clearLoginFormOnError:n}=ee(),s={email:"",password:""},[l,c]=i.useState("Accedi"),[d,h]=i.useState("Email"),[p,x]=i.useState("email"),[j,S]=i.useState("example@example.it"),[b,u]=i.useState("Accedi"),[g,y]=i.useState(s),[v,O]=i.useState(),[k,P]=i.useState(),[E,N]=i.useState(),[M,W]=i.useState(),[$,H]=i.useState({}),[Y,Z]=i.useState(null),D={overrideStyle:$,setOverrideStyle:H,title:l,setTitle:c,label:d,setLabel:h,type:p,setType:x,placeholder:j,setPlaceholder:S,buttonText:b,setButtonText:u,formData:g,setFormData:y,LogoImg:v,setLogoImg:O,styleCardForm:k,setStyleCardForm:P,styleContainerLogo:E,setStyleContainerLogo:N,styleLogo:M,setStyleLogo:W,changeData:(_,X)=>{y(B=>({...B,[_]:X}))},handleLogin:_=>{a(_,g),n&&y(s)},customVersion:Y,setCustomVersion:Z};return o.jsx(rt.Provider,{value:D,children:e})},Te=()=>{const e=i.useContext(rt);if(e===void 0)throw new Error("Non puoi modificare La login");return e},ot=i.createContext(),Mt=({children:e})=>{const[a,n]=i.useState(!1),[s,l]=i.useState(null),[c,d]=i.useState(""),[h,p]=i.useState(null),[x,j]=i.useState(null),[S,b]=i.useState(null),[u,g]=i.useState("modal-form"),[y,v]=i.useState("submit"),[O,k]=i.useState({}),[P,E]=i.useState(null),[N,M]=i.useState(null),[W,$]=i.useState(null),H=({modalData:D,component:_,title:X="",onConfirm:B=null,type:le="submit",formId:q="modal-form",item:te=null,style:U})=>{E(D),l(()=>_),d(X),p(()=>B),v(le),g(q),b(te),k(U),n(!0)},Y=()=>{l(null),d(""),p(null),v("submit"),g("modal-form"),b(null),k({}),n(!1),E(null)},J={isOpen:a,openModal:H,closeModal:Y,content:s,title:c,onConfirm:h,type:y,item:S,formId:u,style:O,modalData:P,setModalData:E,handleChange:D=>{const{name:_,value:X}=D.target;E(B=>({...B,[_]:X}))},handleSubmit:D=>{D.preventDefault(),h&&(h(P),Y())},headerContent:N,setHeaderContent:M,footerContent:W,setFooterContent:$,onCancel:x,setOnCancel:j};return o.jsx(ot.Provider,{value:J,children:e})},nt=()=>{const e=i.useContext(ot);if(e===void 0)throw new Error("Non sei all'interno del ModalProvider");return e};function at(e){return ie({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:[]}]})(e)}const st=()=>{const{loadingProps:e,loadingComponent:a}=fe(),{spinner:n=!0,spinnerStyle:s,text:l,textStyle:c,children:d,containerStyle:h,overrideStyle:p={}}=e;return a||o.jsxs("div",{className:p.container||`fixed top-0 bottom-0 left-0 right-0 flex items-center justify-center bg-loading-bg z-[999] ${h}`,children:[n&&o.jsx(at,{className:p.spinner||`text-[20rem] relative animate-spin text-spinner ${s}`}),d||o.jsx("p",{className:p.text||`text-white text-2xl select-none absolute ${c}`,children:l||"Loading..."})]})};function Gt(e){return ie({tag:"svg",attr:{viewBox:"0 0 15 15",fill:"none"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor"},child:[]}]})(e)}const Re=()=>{const{messageAlert:e,typeAlert:a,alertConfig:n,getIcon:s,closeAlert:l}=ne(),{alertTimeout:c}=ee(),[d,h]=i.useState(0),{bgColor:p,textColor:x,buttonBg:j,hoverBg:S,focusRing:b,progressColor:u}=n[a];return i.useEffect(()=>{let g;const v=100/(c/100);g=setInterval(()=>{h(k=>k>=100?(clearInterval(g),100):k+v)},100);const O=setTimeout(()=>{l()},c);return()=>{clearTimeout(O),clearInterval(g)}},[]),o.jsxs("div",{className:`flex items-center p-4 pt-6 ${x} rounded-lg ${p} 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:[o.jsx("div",{className:"w-full bg-gray-200 rounded-t-lg overflow-hidden h-2.5 absolute top-0 left-0 right-0",children:o.jsx("div",{className:`${u} h-2.5 rounded-t-lg`,style:{width:`${d}%`}})}),s(a),o.jsx("div",{className:"px-4 text-sm font-medium",children:e}),o.jsx("button",{type:"button",className:`ms-auto ${j} rounded-lg focus:ring-2 ${b} p-1.5 ${S} inline-flex items-center justify-center h-8 w-8 cursor-pointer`,title:"Close",onClick:l,children:o.jsx(Gt,{className:"text-xl"})})]})},It=({onClose:e,onConfirm:a,onCancel:n,type:s,formId:l,style:c})=>{const d=c.resetButton??!0,h=c.confirmButtonText??(s==="delete"?"Elimina":"Salva"),p=c.cancelButtonText??"Annulla",x=c.bgSaveButton??"bg-indigo-600 rounded-lg shadow-md hover:bg-indigo-700 hover:shadow-lg active:bg-indigo-800 text-white",j=c.bgDeleteButton??"bg-rose-500 rounded-lg shadow-md hover:bg-rose-600 hover:shadow-lg active:bg-rose-700 text-white",S=c.bgResetButton??"bg-rose-500 rounded-lg shadow-md hover:bg-rose-600 hover:shadow-lg active:bg-rose-700 text-white",b=c.bgCancelButton??"text-gray-800 bg-gray-300 rounded-lg shadow-md hover:bg-gray-400 hover:shadow-lg active:bg-gray-500",u=s==="custom"?c.customButtonStyle:null,g={delete:()=>{a==null||a(),e==null||e()},custom:()=>{a==null||a()}};return o.jsxs("footer",{className:"flex items-center justify-between mt-4",children:[o.jsx("button",{onClick:n||e,className:`${b} px-4 py-2 cursor-pointer text-sm font-medium active:shadow-sm transition-all duration-150 ease-in-out hover:opacity-90 active:scale-95 active:opacity-70`,children:p}),o.jsxs("div",{className:"flex items-center gap-4",children:[s!=="delete"&&d&&o.jsx("button",{type:"reset",form:l,className:`px-4 py-2 cursor-pointer text-sm font-medium ${S} active:shadow-sm transition-all duration-150 ease-in-out hover:opacity-90 active:scale-95 active:opacity-70`,children:"Reset"}),o.jsx("button",{type:s==="submit"?"submit":"button",form:s==="submit"?l:void 0,onClick:()=>{var y;return(y=g[s])==null?void 0:y.call(g)},className:u||`${s==="delete"?j:x} px-4 py-2 cursor-pointer text-sm font-medium active:shadow-sm transition-all duration-150 ease-in-out hover:opacity-90 active:scale-95 active:opacity-70`,children:h})]})]})};function Bt(e){return ie({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"18",y1:"6",x2:"6",y2:"18"},child:[]},{tag:"line",attr:{x1:"6",y1:"6",x2:"18",y2:"18"},child:[]}]})(e)}const _t=({onClose:e,type:a,title:n,name:s,onCancel:l})=>o.jsxs("header",{className:`flex items-center justify-between mb-4 ${a==="delete"?"gap-8":""}`,children:[a==="delete"&&s?o.jsxs("h2",{className:"text-2xl",children:["Sei sicuro di volere eliminare: ",o.jsx("strong",{children:s}),"?"]}):o.jsx("h2",{className:"text-2xl",children:n||"Conferma operazione"}),o.jsx("button",{onClick:l||e,className:"text-gray-500 hover:text-gray-700 cursor-pointer transition-transform duration-150 ease-in-out hover:scale-110 hover:opacity-80 active:scale-95 active:opacity-60","aria-label":"Chiudi modale",children:o.jsx(Bt,{className:"text-2xl"})})]}),zt=({type:e,children:a,item:n,overrideStyle:s})=>o.jsx(o.Fragment,{children:e!=="delete"&&o.jsx("main",{className:s||"my-8 max-h-[600px] overflow-y-auto overflow-x-hidden",children:e==="delete"&&!n?o.jsx("div",{className:"text-red-600 font-semibold",children:"Errore: nessun item selezionato per l'operazione."}):a})}),$t=({isOpen:e,onClose:a,onCancel:n,title:s,formId:l,children:c,item:d,onConfirm:h,type:p="submit",style:x={},headerContent:j,footerContent:S})=>{const b=i.useRef(null),[u,g]=i.useState(e),y=()=>{e||g(!1)},v=x.width??(p==="delete"?"max-w-md w-auto":"w-full max-w-4xl"),O=x.bgModal??"bg-white",k=x.bgOverlay??"bg-black/50",P=x.zIndex??"z-50";return i.useEffect(()=>{e&&g(!0)},[e]),i.useEffect(()=>{const E=N=>{N.key==="Escape"&&(n?n():a())};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[a,n]),i.useEffect(()=>{var E;if(e){const N=document.activeElement;return(E=b.current)==null||E.focus(),()=>N==null?void 0:N.focus()}},[e]),u?Ye.createPortal(o.jsx("div",{className:`fixed inset-0 ${P} flex items-center justify-center transition-opacity duration-200 ${e?`${k} opacity-100`:"opacity-0"}`,onClick:n||a,onTransitionEnd:y,children:o.jsxs("div",{ref:b,className:`relative ${O} rounded-lg p-6 shadow-xl ${v} transform transition-transform duration-200 ${e?"scale-100 opacity-100":"scale-95 opacity-0"}`,onClick:E=>E.stopPropagation(),role:"dialog","aria-modal":"true",tabIndex:-1,children:[j||o.jsx(_t,{onClose:a,onCancel:n,type:p,title:s,name:d==null?void 0:d.name}),o.jsx(zt,{type:p,item:d,overrideStyle:x.overrideStyle,children:c}),S||o.jsx(It,{onClose:a,onCancel:n,onConfirm:h,type:p,formId:l,style:x})]})}),document.body):null},it=e=>{const{isLoading:a}=fe(),{showAlert:n}=ne(),{isOpen:s,closeModal:l,onCancel:c,content:d,title:h,onConfirm:p,item:x,type:j,formId:S,style:b,headerContent:u,footerContent:g}=nt(),y=C.useLocation(),{isMain:v=!0,headerComponent:O=null,showHeaderOnLogin:k=!1,headerExcludedRoutes:P=[],footerComponent:E=null,showFooterOnLogin:N=!1,footerExcludedRoutes:M=[]}=e,W=P.some(Z=>C.matchPath(Z,y.pathname));let $;y.pathname==="/"?$=O&&k:$=O&&!W;const H=M.some(Z=>C.matchPath(Z,y.pathname));let Y;return y.pathname==="/"?Y=E&&N:Y=E&&!H,o.jsxs(o.Fragment,{children:[a&&o.jsx(st,{}),n&&o.jsx(Re,{}),o.jsx($t,{isOpen:s,onClose:l,onCancel:c,title:h,formId:S,onConfirm:p,type:j,item:x,style:b,headerContent:u,footerContent:g,children:d}),$&&O,v?o.jsxs("main",{className:a?"hidden":"",children:[n&&o.jsx(Re,{}),o.jsx(C.Outlet,{})]}):o.jsx(C.Outlet,{}),Y&&E]})},Oe=e=>{const{inputType:a,inputId:n,inputPlaceholder:s,inputRequired:l,inputValue:c,inputChange:d,inputName:h,autoFocus:p,inputStyle:x,overrideStyle:j,disabled:S}=e,u=["text","email","password","search","tel","url"].includes(a)?a:"text";return o.jsx("input",{type:u,autoFocus:p,id:n,className:j||`bg-input-bg border border-input-border text-input-text text-input-placeholder input-rounded focus:ring focus:ring-primary focus:border-primary focus:outline-none focus:shadow-(--shadow-primary-input) block w-full p-input ${x}`,placeholder:s,required:l??!0,value:c,onChange:d,disabled:S,name:h})},ke=({label:e,labelId:a,labelStyle:n,overrideStyle:s})=>o.jsx("label",{htmlFor:a,className:s||`show-label mb-1 sm:mb-2 text-input-label font-medium text-color-label ${n}`,children:e}),lt=()=>{const{title:e,label:a,type:n,placeholder:s,buttonText:l,formData:c,changeData:d,handleLogin:h,overrideStyle:p}=Te();return o.jsxs("form",{onSubmit:h,className:p.form||"form-size",children:[o.jsx("h1",{className:p.title||"text-form-title-size show-title title-position m-form-title",children:e}),o.jsxs("div",{className:p.containerEmail||"flex justify-center flex-col gap-1 m-input-form input-size mx-auto",children:[o.jsx(ke,{labelId:"user-email",label:a}),o.jsx(Oe,{inputType:n,inputId:"user-email",inputPlaceholder:s,inputValue:c.email,inputChange:x=>{d("email",x.target.value)},autoFocus:!0})]}),o.jsxs("div",{className:p.containerPassword||"flex justify-center flex-col gap-1 my-4 input-size mx-auto",children:[o.jsx(ke,{labelId:"password",label:"Password"}),o.jsx(Oe,{inputType:"password",inputId:"password",inputPlaceholder:"Password",inputValue:c.password,inputChange:x=>{d("password",x.target.value)}})]}),o.jsx("div",{className:p.containerButton||"flex button-position items-center m-primary-button",children:o.jsx("button",{className:p.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:l})})]})},ct=({Logo:e})=>{const{styleCardForm:a,styleContainerLogo:n,styleLogo:s,overrideStyle:l,customVersion:c}=Te(),{firstPrivatePath:d,version:h}=ee(),p=C.useNavigate();return i.useEffect(()=>{const x=JSON.parse(localStorage.getItem("user"));localStorage.getItem("accessToken")&&(x!=null&&x.id)&&p(`${d}${x.id}`)},[]),o.jsxs("section",{id:"login-page",children:[(h||c)&&o.jsx("div",{className:"text-md text-primary absolute top-4 left-4",children:c||h}),o.jsx("div",{className:l.container||"container mx-auto flex items-center justify-center h-screen",children:o.jsxs("div",{className:l.cardForm||`bg-form card-style card-size flex flex-col sm:flex-row sm:items-center justify-center ${a}`,children:[o.jsx("div",{className:l.containerLogo||`basis-1/2 flex items-center justify-center ${n}`,children:e&&o.jsx(e,{className:l.logo||`login-logo h-full sm:h-auto ${s}`})}),o.jsx(lt,{})]})})]})},be=()=>{const{isAuthenticated:e}=ye(),{activeAlert:a}=ne(),{autoLogin:n}=ee();return i.useEffect(()=>{const s=localStorage.getItem("accessToken");!e&&!s&&!n&&a("danger","Non sei autorizzato")},[]),e===null?null:e?o.jsx(C.Outlet,{}):o.jsx(C.Navigate,{to:"/",replace:!0})},ut=()=>{const{logout:e,setCurrentToken:a,createAxiosInstances:n}=ye(),{usersEndpoint:s}=ee(),{setIsLoading:l}=fe(),{activeAlert:c}=ne(),[d,h]=i.useState(null),[p,x]=i.useState(!1),j=JSON.parse(localStorage.getItem("user")),S=async()=>{try{x(!0);const u=localStorage.getItem("accessToken");if(!u){e(),c("danger","Sessione Scaduta");return}const v=(await(await n()).get(`${s}`,{headers:{Authorization:`Bearer ${u}`}})).data;h(v)}catch(u){console.error(u),l(!1)}finally{x(!1)}},b=()=>{e(),c("info","Hai effettuato il logout")};return i.useEffect(()=>{const u=localStorage.getItem("accessToken");u&&a(u)},[]),o.jsx("section",{children:o.jsxs("div",{className:"container mx-auto py-8",children:[o.jsxs("div",{className:"flex items-center justify-center gap-8 h-20",children:[o.jsxs("h1",{className:"text-4xl text-center text-slate-800",children:["Email: ",j.email]}),o.jsx("button",{onClick:b,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"})]}),o.jsx("div",{className:"flex justify-center items-center my-12 gap-8",children:o.jsx("button",{onClick:S,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:p,children:"Lista degli utenti"})}),o.jsx("div",{className:"flex justify-center items-center",children:d&&o.jsx("ul",{children:d.map(u=>o.jsxs("li",{className:"text-xl my-4",children:[u.id," - ",u.email]},`user-${u.id}`))})})]})})},Ft=e=>r.createElement("svg",{width:"108.41262mm",height:"108.41262mm",viewBox:"0 0 108.41262 108.41262",id:"svg1",xmlSpace:"preserve",xmlnsXlink:"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/svg","xmlns:svg":"http://www.w3.org/2000/svg",...e},r.createElement("defs",{id:"defs1"},r.createElement("linearGradient",{id:"linearGradient27"},r.createElement("stop",{style:{stopColor:"#ff0000",stopOpacity:1},offset:0,id:"stop27"}),r.createElement("stop",{style:{stopColor:"#ffca00",stopOpacity:.96862745},offset:1,id:"stop28"})),r.createElement("linearGradient",{xlinkHref:"#linearGradient27",id:"linearGradient28",x1:35.001785,y1:192.35495,x2:143.4144,y2:83.942337,gradientUnits:"userSpaceOnUse"}),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter90",x:-.059506074,y:-.12477839,width:1.1465613,height:1.3073246},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:1,floodColor:"rgb(0,0,0)",id:"feFlood89"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:.9,id:"feGaussianBlur89"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset89"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite89"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite90"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter147",x:-.31473854,y:-.27257434,width:1.6432813,height:1.5822092},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(255,255,255)",id:"feFlood146"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:9.5,id:"feGaussianBlur146"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:3.1,id:"feOffset146"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite146"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite147"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter385",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood384"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur384"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset384"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite384"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite385"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter387",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood385"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur385"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset385"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite386"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite387"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter389",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood387"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur387"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset387"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite388"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite389"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter391",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood389"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur389"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset389"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite390"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite391"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter393",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood391"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur391"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset391"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite392"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite393"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter395",x:0,y:0,width:1.0112203,height:1.010137},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood393"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur393"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset393"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite394"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite395"}))),r.createElement("g",{id:"layer1",transform:"translate(-35.001785,-83.942337)"},r.createElement("rect",{style:{fill:"url(#linearGradient28)",fillOpacity:1,fillRule:"evenodd",stroke:"#ff9b01",strokeWidth:0,strokeOpacity:1,paintOrder:"stroke markers fill"},id:"rect26",width:108.41262,height:108.41262,x:35.001785,y:83.942337,rx:30,ry:30}),r.createElement("g",{id:"g1",transform:"matrix(0.90701349,0,0,0.90701349,9.3696997,14.003172)",style:{strokeWidth:1.10252}},r.createElement("path",{id:"path272",style:{fill:"#000000",strokeWidth:1.10252},d:"m 103.62373,105.0137 c -0.2695,0.002 -0.78905,0.20889 -1.00345,0.40037 -0.0723,0.0646 -0.21317,0.24236 -0.313,0.39478 l -0.18141,0.27703 -0.0181,18.06409 -0.0178,18.06382 h -1.52343 -1.523699 l -2.7e-4,-9.75061 c -5.1e-4,-10.41143 -0.004,-10.51883 -0.34443,-11.94691 -1.39786,-5.8616 -6.2432,-10.12876 -12.21276,-10.75566 -1.515814,-0.1589 -19.83671,-0.16023 -20.462316,-0.003 l -0.0017,-0.004 -19.984159,3.5751 18.852043,2.16035 v 6.07801 l -17.36031,3.10307 17.360304,1.98933 v 6.52314 l -17.360304,3.10307 14.274817,1.63584 -0.01572,4.90514 -0.01864,5.72665 -0.63026,0.1252 c -1.586894,0.3153 -3.197032,1.06826 -4.528475,2.1172 -2.205268,1.73733 -3.741586,4.44584 -4.052716,7.1446 -0.370335,3.21237 0.552005,6.19841 2.657413,8.60144 1.687848,1.92642 4.173186,3.25989 6.695215,3.59241 v -5.2e-4 c 0.823968,0.10864 2.933749,0.0318 3.671522,-0.13399 0.932239,-0.20951 1.790163,-0.51486 2.636639,-0.93819 2.065707,-1.03314 3.823794,-2.77572 4.827084,-4.78447 0.504382,-1.00984 0.910162,-2.2066 1.026636,-3.02875 l 0.04632,-0.32925 h 9.414169 9.413628 v 0.21364 c 0,0.11749 0.0641,0.46829 0.14251,0.77944 0.90405,3.58952 3.50881,6.4605 6.974649,7.68694 1.34306,0.47527 1.94661,0.56832 3.65554,0.56367 1.31935,-0.003 1.6122,-0.0248 2.18192,-0.1577 3.36735,-0.785 6.02631,-2.86016 7.51461,-5.86464 0.44078,-0.88981 0.88236,-2.20383 0.97202,-2.8921 l 0.0429,-0.32925 7.18349,-0.002 c 7.08058,-0.002 7.18734,-0.003 7.49462,-0.14278 0.6474,-0.29351 0.90064,-0.70316 0.90064,-1.45738 0,-0.56862 -0.16856,-0.94445 -0.54982,-1.22508 -0.50606,-0.37245 -0.22593,-0.35988 -7.89979,-0.35988 h -7.11582 l -0.11721,-0.59669 c -0.2611,-1.32878 -0.84786,-2.70966 -1.68167,-3.95762 -0.57002,-0.85316 -2.01938,-2.29531 -2.86466,-2.85108 -1.21392,-0.79816 -2.80463,-1.46394 -3.99997,-1.6734 l -0.5016,-0.0876 -0.0181,-21.17061 -0.0178,-21.17036 -0.15424,-0.31167 c -0.25804,-0.52106 -0.8796,-0.9025 -1.46482,-0.8993 z m 9.34091,0.76079 c -1.96193,0 -3.68713,1.06774 -4.53247,2.80552 -0.53635,1.10262 -0.53017,1.02648 -0.50719,6.44296 l 0.0203,4.7802 0.18834,0.55566 c 0.62086,1.83041 2.22554,3.17608 4.08307,3.42406 0.24153,0.0323 2.71506,0.0532 5.4965,0.0458 5.70515,-0.0145 5.3423,0.0172 6.54658,-0.57378 0.54778,-0.26881 0.75708,-0.42234 1.25039,-0.91741 0.48917,-0.4909 0.64889,-0.70949 0.91635,-1.25279 0.53896,-1.09564 0.53516,-1.04438 0.53516,-6.26129 0,-4.84593 -0.0122,-5.0614 -0.32764,-5.86224 -0.76424,-1.94014 -2.6134,-3.18671 -4.72693,-3.18671 h -0.55701 l -0.003,4.13929 -0.003,4.13902 -1.87799,1.48961 c -1.03267,0.8192 -1.9166,1.51251 -1.96429,1.54074 -0.0554,0.0327 -0.79171,-0.51293 -2.03382,-1.50745 l -1.94697,-1.55885 v -4.12119 -4.12117 z m 2.28928,0.5522 v 3.46322 3.46375 l 1.08417,0.86973 c 0.59637,0.47836 1.10581,0.86085 1.13185,0.85003 0.0261,-0.0108 0.53535,-0.40918 1.13212,-0.88546 l 1.08497,-0.866 -0.0171,-3.42912 -0.0168,-3.42939 -2.19977,-0.0184 z m -47.246903,6.50849 9.196533,0.0248 c 9.138394,0.0246 9.200727,0.0256 9.88912,0.17528 2.276157,0.49507 4.008841,1.42496 5.576421,2.99252 1.56294,1.56292 2.49402,3.26009 3.00157,5.47254 0.15094,0.65777 0.15069,0.6637 0.16943,10.68613 l 0.0189,10.02763 -1.19632,-2.6e-4 -1.19658,-2.6e-4 -2.909674,-2.90889 c -2.148162,-2.14765 -2.999001,-2.95439 -3.251981,-3.08256 l -0.342815,-0.17367 h -9.477299 -9.477299 v -11.60676 z m 44.869453,16.35471 c -0.8458,0 -1.3552,0.0997 -1.97601,0.38599 -1.35181,0.62342 -2.29671,1.66611 -2.77169,3.05885 l -0.18354,0.53889 -0.0203,4.74531 c -0.0228,5.40031 -0.0234,5.39175 0.50346,6.47758 0.5061,1.04314 1.24312,1.77945 2.29621,2.29407 0.34744,0.1698 0.83013,0.35177 1.07325,0.40464 h 5.1e-4 c 0.35322,0.0766 1.47942,0.0968 5.60252,0.10015 5.81748,0.004 5.68307,0.0148 6.74876,-0.50692 1.37728,-0.67421 2.29905,-1.80091 2.67474,-3.26982 0.12915,-0.50539 0.13665,-0.78389 0.13665,-5.22267 0,-4.44771 -0.007,-4.7167 -0.13746,-5.23651 -0.23263,-0.92645 -0.63571,-1.63668 -1.31912,-2.32417 -0.51589,-0.519 -0.69084,-0.64491 -1.31831,-0.94858 -0.81757,-0.39568 -1.26328,-0.49681 -2.19099,-0.49681 h -0.64544 v 4.11159 4.11159 l -1.90888,1.51757 c -1.04987,0.83448 -1.93862,1.52747 -1.97495,1.54022 -0.0363,0.0129 -0.93815,-0.6732 -2.00425,-1.52423 l -1.93845,-1.54714 -2.7e-4,-4.10467 -5.1e-4,-4.10493 z m 2.37718,0.55434 0.004,3.44644 0.004,3.4467 1.05221,0.84416 h 5.1e-4 c 0.57884,0.46404 1.07893,0.84576 1.1116,0.84843 0.0327,0.003 0.55455,-0.39065 1.1601,-0.87373 l 1.10122,-0.87826 v -3.41687 -3.41687 h -2.21709 z m -50.294829,9.49115 h 10.511122 10.511121 l 3.015165,3.00185 c 2.567942,2.55652 3.057622,3.01393 3.300462,3.08282 0.2049,0.0582 1.62307,0.0807 5.03966,0.0807 h 4.754629 v 1.5799 1.57938 l -0.53676,0.0938 c -1.12048,0.19566 -2.647899,0.80928 -3.728799,1.49786 -1.68955,1.07633 -3.11899,2.69978 -3.99411,4.53647 -0.44366,0.93112 -0.88466,2.34132 -0.88466,2.82896 v 0.21524 H 83.533023 74.11886 l -0.04632,-0.32925 c -0.173141,-1.22207 -0.843416,-2.86149 -1.706703,-4.17392 -0.532033,-0.80881 -1.995609,-2.29178 -2.799129,-2.83643 -1.322594,-0.89646 -2.959014,-1.5737 -4.282866,-1.77223 l -0.324987,-0.0488 v -4.66833 z"}),r.createElement("path",{id:"path268",style:{fill:"#ffffff",strokeWidth:1.10252},d:"m 103.6238,103.56164 c -0.26951,0.002 -0.78905,0.20888 -1.00346,0.40036 -0.0723,0.0646 -0.21316,0.24236 -0.313,0.39478 l -0.1814,0.27703 -0.0181,18.06409 -0.0178,18.06382 h -1.52344 -1.523699 l -2.6e-4,-9.7506 c -5.1e-4,-10.41144 -0.004,-10.51884 -0.34443,-11.94692 -1.39786,-5.86159 -6.2432,-10.12876 -12.212765,-10.75566 -1.515813,-0.1589 -19.836715,-0.16022 -20.46231,-0.003 l -0.0017,-0.004 -19.984159,3.5751 18.852043,2.16035 v 6.07801 l -17.36031,3.10307 17.36031,1.98934 v 6.52313 l -17.36031,3.10307 14.274823,1.63584 -0.01572,4.90514 -0.01864,5.72666 -0.630261,0.12519 c -1.586888,0.3153 -3.19702,1.06826 -4.528463,2.1172 -2.205268,1.73733 -3.741592,4.44584 -4.052721,7.1446 -0.370335,3.21237 0.55201,6.19842 2.657412,8.60144 1.687849,1.92642 4.173187,3.25989 6.695216,3.59241 v -5.2e-4 c 0.823962,0.10864 2.933749,0.0318 3.671527,-0.13398 0.932233,-0.20952 1.790157,-0.51486 2.636639,-0.9382 2.065707,-1.03313 3.823794,-2.77572 4.82709,-4.78447 0.504371,-1.00983 0.910151,-2.2066 1.026624,-3.02874 l 0.04632,-0.32925 h 9.414164 9.413621 v 0.21363 c 0,0.11749 0.0641,0.46829 0.14252,0.77944 0.90405,3.58952 3.50882,6.4605 6.974649,7.68695 1.34307,0.47527 1.94662,0.56831 3.65555,0.56366 1.31934,-0.003 1.6122,-0.0248 2.18192,-0.1577 3.36734,-0.785 6.0263,-2.86016 7.51461,-5.86464 0.44078,-0.88981 0.88236,-2.20383 0.97202,-2.89209 l 0.0429,-0.32925 7.18349,-0.002 c 7.08058,-0.002 7.18734,-0.003 7.49463,-0.14278 0.6474,-0.29351 0.90063,-0.70316 0.90063,-1.45737 0,-0.56863 -0.16856,-0.94446 -0.54981,-1.22508 -0.50607,-0.37246 -0.22593,-0.35988 -7.89979,-0.35988 h -7.11583 l -0.11721,-0.5967 c -0.2611,-1.32878 -0.84786,-2.70966 -1.68166,-3.95762 -0.57003,-0.85315 -2.01939,-2.29531 -2.86466,-2.85107 -1.21393,-0.79817 -2.80464,-1.46395 -3.99997,-1.6734 l -0.50159,-0.0876 -0.0181,-21.17061 -0.0179,-21.17036 -0.15424,-0.31166 c -0.25804,-0.52107 -0.8796,-0.90251 -1.46482,-0.8993 z m 9.34091,0.76078 c -1.96194,0 -3.68714,1.06774 -4.53248,2.80552 -0.53635,1.10263 -0.53017,1.02648 -0.50719,6.44296 l 0.0203,4.7802 0.18834,0.55567 c 0.62086,1.8304 2.22555,3.17607 4.08308,3.42406 0.24152,0.0323 2.71505,0.0532 5.4965,0.0458 5.70514,-0.0145 5.34229,0.0172 6.54658,-0.57378 0.54778,-0.2688 0.75707,-0.42233 1.25039,-0.91741 0.48917,-0.4909 0.64889,-0.70948 0.91635,-1.25279 0.53896,-1.09564 0.53516,-1.04438 0.53516,-6.26128 0,-4.84594 -0.0122,-5.06141 -0.32765,-5.86225 -0.76423,-1.94014 -2.6134,-3.18671 -4.72692,-3.18671 h -0.55701 l -0.003,4.13929 -0.003,4.13902 -1.87798,1.48961 c -1.03268,0.8192 -1.9166,1.51252 -1.96429,1.54074 -0.0554,0.0327 -0.79171,-0.51293 -2.03382,-1.50745 l -1.94698,-1.55886 v -4.12117 -4.12118 z m 2.28927,0.55221 v 3.46321 3.46375 l 1.08417,0.86974 c 0.59637,0.47835 1.10582,0.86085 1.13185,0.85002 0.0261,-0.0108 0.53535,-0.40918 1.13213,-0.88545 l 1.08496,-0.86601 -0.0171,-3.42912 -0.0168,-3.42939 -2.19978,-0.0184 z m -47.246901,6.50848 9.196533,0.0248 c 9.138394,0.0247 9.200727,0.0256 9.889125,0.17528 2.276152,0.49507 4.008834,1.42496 5.576414,2.99253 1.56294,1.56292 2.49402,3.26009 3.00158,5.47253 0.15094,0.65777 0.15069,0.6637 0.16942,10.68613 l 0.0189,10.02764 -1.19632,-2.7e-4 -1.19658,-2.6e-4 -2.909672,-2.90888 c -2.148163,-2.14765 -2.999001,-2.9544 -3.251981,-3.08256 l -0.342835,-0.17368 H 77.484375 68.00707 v -11.60675 z m 44.869461,16.35472 c -0.84581,0 -1.35521,0.0997 -1.97602,0.38599 -1.35181,0.62342 -2.29671,1.6661 -2.77169,3.05885 l -0.18354,0.53888 -0.0203,4.74531 c -0.0229,5.40032 -0.0234,5.39175 0.50346,6.47758 0.50611,1.04314 1.24312,1.77945 2.29621,2.29408 0.34744,0.1698 0.83013,0.35177 1.07325,0.40463 h 5.1e-4 c 0.35322,0.0766 1.47942,0.0968 5.60252,0.10015 5.81748,0.005 5.68308,0.0148 6.74876,-0.50692 1.37729,-0.67421 2.29905,-1.8009 2.67474,-3.26982 0.12916,-0.50539 0.13665,-0.78389 0.13665,-5.22266 0,-4.44771 -0.007,-4.7167 -0.13745,-5.23652 -0.23264,-0.92645 -0.63572,-1.63668 -1.31912,-2.32417 -0.5159,-0.519 -0.69084,-0.64491 -1.31832,-0.94858 -0.81757,-0.39568 -1.26328,-0.4968 -2.19098,-0.4968 h -0.64545 v 4.11159 4.11159 l -1.90888,1.51756 c -1.04987,0.83448 -1.93862,1.52747 -1.97495,1.54022 -0.0363,0.0129 -0.93815,-0.6732 -2.00425,-1.52423 l -1.93845,-1.54714 -2.6e-4,-4.10466 -5.2e-4,-4.10493 z m 2.37718,0.55434 0.004,3.44643 0.004,3.4467 1.0522,0.84416 h 5.2e-4 c 0.57883,0.46405 1.07893,0.84577 1.1116,0.84843 0.0327,0.003 0.55454,-0.39065 1.16009,-0.87374 l 1.10122,-0.87825 v -3.41686 -3.41687 h -2.21709 z m -50.294837,9.49114 H 75.47001 85.981126 l 3.015165,3.00185 c 2.56794,2.55652 3.05762,3.01393 3.30046,3.08283 0.20491,0.0582 1.62308,0.0807 5.03966,0.0807 h 4.754639 v 1.5799 1.57938 l -0.53676,0.0938 c -1.12049,0.19566 -2.647909,0.80928 -3.728809,1.49786 -1.68955,1.07634 -3.11898,2.69979 -3.99411,4.53647 -0.44366,0.93112 -0.88465,2.34132 -0.88465,2.82897 v 0.21523 h -9.413636 -9.414164 l -0.04632,-0.32925 c -0.173136,-1.22207 -0.843417,-2.86149 -1.706697,-4.17392 -0.53204,-0.80881 -1.995616,-2.29178 -2.799129,-2.83642 -1.322601,-0.89647 -2.959015,-1.57371 -4.282873,-1.77224 l -0.324986,-0.0487 v -4.66833 z"})),r.createElement("path",{style:{fill:"#ffffff",fillOpacity:1,fillRule:"evenodd",stroke:"#ff9b01",strokeWidth:0,strokeOpacity:1,paintOrder:"stroke markers fill"},d:"",id:"path40",transform:"scale(0.26458333)"}))),Dt=e=>{const{publicRoutes:a,privateRoutes:n}=tt(),{firstPrivatePath:s}=ee(),{logoImg:l=Ft,pathImg:c="./src/assets/MyWarehouse.svg",firstPrivateElement:d=o.jsx(ut,{}),globalLayout:h,isMain:p,headerComponent:x,showHeaderOnLogin:j,headerExcludedRoutes:S,footerComponent:b,showFooterOnLogin:u,footerExcludedRoutes:g,privateProvider:y,customProvider:v}=e;let O;h==="none"?O=null:i.isValidElement(h)?O=h:O=o.jsx(it,{isMain:p,headerComponent:x,showHeaderOnLogin:j,headerExcludedRoutes:S,footerComponent:b,showFooterOnLogin:u,footerExcludedRoutes:g});const k=y?i.cloneElement(y,{},v?i.createElement(v.type,v.props,o.jsx(be,{children:o.jsx(C.Outlet,{})})):o.jsx(be,{children:o.jsx(C.Outlet,{})})):v?i.createElement(v.type,v.props,o.jsx(be,{children:o.jsx(C.Outlet,{})})):o.jsx(be,{children:o.jsx(C.Outlet,{})}),P=()=>{const E=document.querySelector("link[rel='icon']");c&&(E.href=c)};return i.useEffect(()=>{P()},[]),o.jsx(C.Routes,{children:o.jsxs(C.Route,{element:O,children:[o.jsxs(C.Route,{path:"/",children:[o.jsx(C.Route,{index:!0,element:o.jsx(ct,{Logo:l})}),a.map((E,N)=>o.jsx(C.Route,{path:E.path,element:E.element},`public-${N}`))]}),o.jsxs(C.Route,{element:k,children:[o.jsx(C.Route,{path:`${s??"/dashboard/"}:id`,element:d}),n.map((E,N)=>o.jsx(C.Route,{path:E.path,element:E.element},`private-${N}`))]})]})})},Wt=({children:e})=>{var l;const a=C.useLocation(),{activeAlert:n}=ne(),s=JSON.parse(localStorage.getItem("user"));return i.useEffect(()=>{(!s||!s.admin)&&n("warning","Non puoi accedere a questa pagina")},[s]),!s||!s.admin?o.jsx(C.Navigate,{to:((l=a.state)==null?void 0:l.from)||"/",replace:!0}):e},Ht=({spinner:e=!0,spinnerStyle:a,text:n,textStyle:s,children:l,containerStyle:c,overrideStyle:d={}})=>o.jsxs("div",{className:d.container||`w-full h-full relative flex items-center justify-center ${c}`,children:[e&&o.jsx(at,{className:d.spinner||`text-[20rem] animate-spin text-black ${a}`}),l||o.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 ${s}`,children:n||"Loading..."})]}),Ne=({isTag:e=!1,value:a,label:n,placeholder:s,id:l,onChange:c,error:d=null})=>o.jsxs("div",{className:`flex items-center justify-center relative ${e?"gap-4 mb-2":"gap-1 m-4"}`,children:[o.jsx(ke,{labelId:l,label:n,overrideStyle:`text-xl font-bold text-color-label ${e?"":"basis-1/3"}`}),o.jsx(Oe,{type:"text",inputId:l,inputPlaceholder:s,inputValue:a||"",disabled:e,inputChange:c,overrideStyle:`${e?"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-focus-ring focus:border-spot-rfid-input-border focus:outline-none focus:shadow-spot-rfid-input block w-full p-input`}),d&&o.jsx("p",{className:"text-red-600 text-[13px] absolute bottom-0 left-26 translate-y-[20px]",children:d})]}),Yt=({title:e,showTag:a,value:n,tag:s,showButton:l,handleClick:c})=>o.jsxs("div",{className:`border border-slate-300 rounded-xl p-2 m-2 shadow-xl transition-all duration-700 transform ${e==="TAG B"?"delay-200":"mb-4"} ${a?"opacity-100 translate-y-0":"opacity-0 translate-y-10"}`,children:[o.jsx("h2",{className:"text-center mb-2 text-2xl",children:e}),o.jsx(Ne,{label:"TID",placeholder:`Leggi ${e}`,id:s?`tid-${s}`:"tid",isTag:!0,value:(n==null?void 0:n.valueTID)||""}),o.jsx(Ne,{label:"EPC",placeholder:`Leggi ${e}`,id:s?`epc-${s}`:"epc",isTag:!0,value:(n==null?void 0:n.valueEPC)||""}),!l&&o.jsx("div",{className:"flex items-center justify-center",children:o.jsx("button",{onClick:c,disabled:!(n!=null&&n.valueTID)&&!(n!=null&&n.valueEPC),className:"my-1 bg-write-button disabled:bg-write-button/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 Zt(e){return ie({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:[]}]})(e)}const qt=({minReadingPower:e,maxReadingPower:a,stepRangePower:n,rangeValue:s,setRangeValue:l,show:c,handleClick:d})=>{const h=(s-e)/(a-e)*100;return o.jsxs("div",{className:`border border-slate-300 rounded-xl p-2 m-2 shadow-xl transition-all duration-700 transform ${c?"opacity-100 translate-y-0":"opacity-0 translate-y-10"}`,children:[o.jsx("h2",{className:"text-center my-4 text-2xl",children:"Configurazione Potenza"}),o.jsxs("div",{className:"relative my-12 w-[90%] mx-auto",children:[o.jsx("input",{id:"power",type:"range",min:e,max:a,step:n,value:s,onChange:p=>l(Number(p.target.value)),className:"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer accent-primary-accent"}),o.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:`${h}%`},children:s})]}),o.jsx("div",{className:"flex items-center justify-center my-4",children:o.jsxs("button",{onClick:()=>d(s),className:"py-2 px-4 flex items-center justify-center gap-1 bg-save-button text-white rounded-lg shadow-md transition duration-200 ease-in-out transform active:translate-y-[2px] cursor-pointer",children:["Salva",o.jsx(Zt,{})]})})]})},Ut=({show:e,isConfigPage:a,handleSelectFile:n})=>o.jsxs("div",{className:`${a?`${e?"opacity-100 translate-y-0 delay-200":"opacity-0 translate-y-10"}`:""} p-4 text-center transition-all duration-700 transform`,children:[o.jsxs("h2",{className:"text-xl my-4",children:["Seleziona il file ",o.jsx("strong",{children:"config.json"})," per recuperare le chiavi univoche del dispositivo"]}),o.jsx("button",{onClick:n,className:"my-4 bg-blue-500 text-white px-4 py-2 rounded-lg",children:"Seleziona file"})]});function Vt(e){return ie({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:[]}]})(e)}function Jt(e){return ie({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:[]}]})(e)}const Xt=e=>r.createElement("svg",{width:"108.41262mm",height:"108.41262mm",viewBox:"0 0 108.41262 108.41262",id:"svg1",xmlSpace:"preserve",xmlnsXlink:"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/svg","xmlns:svg":"http://www.w3.org/2000/svg",...e},r.createElement("defs",{id:"defs1"},r.createElement("linearGradient",{id:"linearGradient27"},r.createElement("stop",{style:{stopColor:"#ff0000",stopOpacity:1},offset:0,id:"stop27"}),r.createElement("stop",{style:{stopColor:"#ffca00",stopOpacity:.96862745},offset:1,id:"stop28"})),r.createElement("linearGradient",{xlinkHref:"#linearGradient27",id:"linearGradient28",x1:35.001785,y1:192.35495,x2:143.4144,y2:83.942337,gradientUnits:"userSpaceOnUse"}),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter90",x:-.059506074,y:-.12477839,width:1.1465613,height:1.3073246},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:1,floodColor:"rgb(0,0,0)",id:"feFlood89"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:.9,id:"feGaussianBlur89"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset89"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite89"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite90"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter147",x:-.31473854,y:-.27257434,width:1.6432813,height:1.5822092},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(255,255,255)",id:"feFlood146"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:9.5,id:"feGaussianBlur146"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:3.1,id:"feOffset146"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite146"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite147"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter385",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood384"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur384"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset384"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite384"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite385"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter387",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood385"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur385"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset385"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite386"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite387"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter389",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood387"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur387"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset387"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite388"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite389"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter391",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood389"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur389"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset389"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite390"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite391"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter393",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood391"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur391"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset391"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite392"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite393"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter395",x:0,y:0,width:1.0112203,height:1.010137},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood393"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur393"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset393"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite394"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite395"}))),r.createElement("g",{id:"layer1",transform:"translate(-35.001785,-83.942337)"},r.createElement("rect",{style:{fill:"url(#linearGradient28)",fillOpacity:1,fillRule:"evenodd",stroke:"#ff9b01",strokeWidth:0,strokeOpacity:1,paintOrder:"stroke markers fill"},id:"rect26",width:108.41262,height:108.41262,x:35.001785,y:83.942337,rx:30,ry:30}),r.createElement("g",{id:"g1",transform:"matrix(1.0833532,0,0,1.1590115,-13.020803,-26.50933)",style:{strokeWidth:.892424}},r.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"}),r.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"}),r.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)"}),r.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)"})),r.createElement("path",{style:{fill:"#ffffff",fillOpacity:1,fillRule:"evenodd",stroke:"#ff9b01",strokeWidth:0,strokeOpacity:1,paintOrder:"stroke markers fill"},d:"",id:"path40",transform:"scale(0.26458333)"}))),Kt=({Logo:e,logo:a})=>{const{logout:n}=ye(),{activeAlert:s}=ne(),{autoLogin:l,configRoutes:c,firstPrivateTitle:d,showHeaderButton:h}=ee(),{isLoading:p}=fe(),x=C.useLocation(),j=C.useNavigate(),S=()=>{n(),s("info","Hai effettuato il logout")},b=c.find(g=>g.path===x.pathname),u=C.useMatch("home/:id");return o.jsx("header",{className:p?"hidden":"",children:o.jsxs("nav",{className:"header-size flex items-center justify-between px-2 shadow-lg border-b gap-2 border-b-gray-300",children:[o.jsx("figure",{children:e&&typeof e=="function"?o.jsx(e,{className:"header-logo-size"}):a?o.jsx("img",{src:a,alt:"Logo",className:"header-logo-size"}):o.jsx(Xt,{className:"header-logo-size"})}),o.jsx("div",{children:o.jsx("p",{children:(b==null?void 0:b.title)||d})}),o.jsxs("div",{children:[!l&&u&&o.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:S,children:o.jsx(Vt,{className:"text-4xl w-full"})}),!u&&h&&o.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:()=>j(-1),children:o.jsx(Jt,{className:"text-4xl w-full"})})]})]})})};Object.defineProperty(exports,"BrowserRouter",{enumerable:!0,get:()=>C.BrowserRouter});Object.defineProperty(exports,"Link",{enumerable:!0,get:()=>C.Link});Object.defineProperty(exports,"NavLink",{enumerable:!0,get:()=>C.NavLink});Object.defineProperty(exports,"Outlet",{enumerable:!0,get:()=>C.Outlet});Object.defineProperty(exports,"Route",{enumerable:!0,get:()=>C.Route});Object.defineProperty(exports,"Routes",{enumerable:!0,get:()=>C.Routes});Object.defineProperty(exports,"useLocation",{enumerable:!0,get:()=>C.useLocation});Object.defineProperty(exports,"useMatch",{enumerable:!0,get:()=>C.useMatch});Object.defineProperty(exports,"useNavigate",{enumerable:!0,get:()=>C.useNavigate});Object.defineProperty(exports,"useParams",{enumerable:!0,get:()=>C.useParams});exports.axios=He;exports.ReactDOM=Ye;exports.Alert=Re;exports.AlertProvider=Rt;exports.AuthAdmin=Wt;exports.AuthPage=be;exports.AuthProvider=Nt;exports.CardInputRange=qt;exports.CardInputTag=Yt;exports.ConfigFileReader=Ut;exports.ConfigProvider=vt;exports.Dashboard=ut;exports.DefaultLayout=it;exports.ErrorPage=qe;exports.Header=Kt;exports.Input=Oe;exports.InputGroup=Ne;exports.InputLabel=ke;exports.Loading=st;exports.LoadingComponent=Ht;exports.LoadingProvider=gt;exports.Login=ct;exports.LoginForm=lt;exports.LoginFormProvider=At;exports.ModalProvider=Mt;exports.PackageRoutes=Dt;exports.RouteProvider=Tt;exports.fetchAxiosConfig=Ke;exports.useAlert=ne;exports.useAuth=ye;exports.useConfig=ee;exports.useLoading=fe;exports.useLoginForm=Te;exports.useModal=nt;exports.useRoutesInjection=tt;
@@ -60,7 +60,7 @@ function gt() {
60
60
  switch (t) {
61
61
  case G:
62
62
  return "Fragment";
63
- case N:
63
+ case T:
64
64
  return "Portal";
65
65
  case z:
66
66
  return "Profiler";
@@ -75,11 +75,11 @@ function gt() {
75
75
  switch (typeof t.tag == "number" && console.error(
76
76
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
77
77
  ), t.$$typeof) {
78
- case H:
78
+ case Y:
79
79
  return (t.displayName || "Context") + ".Provider";
80
- case U:
80
+ case H:
81
81
  return (t._context.displayName || "Context") + ".Consumer";
82
- case Y:
82
+ case Z:
83
83
  var d = t.render;
84
84
  return t = t.displayName, t || (t = d.displayName || d.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
85
85
  case F:
@@ -116,7 +116,7 @@ function gt() {
116
116
  function i() {
117
117
  }
118
118
  function a() {
119
- if (T === 0) {
119
+ if (N === 0) {
120
120
  R = console.log, M = console.info, A = console.warn, re = console.error, J = console.group, ve = console.groupCollapsed, je = console.groupEnd;
121
121
  var t = {
122
122
  configurable: !0,
@@ -134,10 +134,10 @@ function gt() {
134
134
  groupEnd: t
135
135
  });
136
136
  }
137
- T++;
137
+ N++;
138
138
  }
139
139
  function l() {
140
- if (T--, T === 0) {
140
+ if (N--, N === 0) {
141
141
  var t = { configurable: !0, enumerable: !0, writable: !0 };
142
142
  Object.defineProperties(console, {
143
143
  log: q({}, t, { value: R }),
@@ -149,7 +149,7 @@ function gt() {
149
149
  groupEnd: q({}, t, { value: je })
150
150
  });
151
151
  }
152
- 0 > T && console.error(
152
+ 0 > N && console.error(
153
153
  "disabledDepth fell below zero. This is a bug in React. Please file an issue."
154
154
  );
155
155
  }
@@ -171,7 +171,7 @@ function gt() {
171
171
  if (f !== void 0) return f;
172
172
  Re = !0, f = Error.prepareStackTrace, Error.prepareStackTrace = void 0;
173
173
  var O = null;
174
- O = Z.H, Z.H = null, a();
174
+ O = U.H, U.H = null, a();
175
175
  try {
176
176
  var _ = {
177
177
  DetermineComponentFrameRoot: function() {
@@ -258,7 +258,7 @@ function gt() {
258
258
  }
259
259
  }
260
260
  } finally {
261
- Re = !1, Z.H = O, l(), Error.prepareStackTrace = f;
261
+ Re = !1, U.H = O, l(), Error.prepareStackTrace = f;
262
262
  }
263
263
  return $ = ($ = t ? t.displayName || t.name : "") ? u($) : "", typeof t == "function" && Pe.set(t, $), $;
264
264
  }
@@ -280,7 +280,7 @@ function gt() {
280
280
  }
281
281
  if (typeof t == "object")
282
282
  switch (t.$$typeof) {
283
- case Y:
283
+ case Z:
284
284
  return t = p(t.render, !1), t;
285
285
  case F:
286
286
  return m(t.type);
@@ -294,7 +294,7 @@ function gt() {
294
294
  return "";
295
295
  }
296
296
  function g() {
297
- var t = Z.A;
297
+ var t = U.A;
298
298
  return t === null ? null : t.getOwner();
299
299
  }
300
300
  function C(t) {
@@ -345,7 +345,7 @@ function gt() {
345
345
  }), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
346
346
  }
347
347
  function h(t, d, f, O, _, P) {
348
- if (typeof t == "string" || typeof t == "function" || t === G || t === z || t === W || t === se || t === X || t === K || typeof t == "object" && t !== null && (t.$$typeof === I || t.$$typeof === F || t.$$typeof === H || t.$$typeof === U || t.$$typeof === Y || t.$$typeof === pe || t.getModuleId !== void 0)) {
348
+ if (typeof t == "string" || typeof t == "function" || t === G || t === z || t === W || t === se || t === X || t === K || typeof t == "object" && t !== null && (t.$$typeof === I || t.$$typeof === F || t.$$typeof === Y || t.$$typeof === H || t.$$typeof === Z || t.$$typeof === pe || t.getModuleId !== void 0)) {
349
349
  var w = d.children;
350
350
  if (w !== void 0)
351
351
  if (O)
@@ -414,15 +414,15 @@ React keys must be passed directly to JSX without using spread:
414
414
  Fe[d] = !0;
415
415
  var f = "";
416
416
  t && t._owner != null && t._owner !== g() && (f = null, typeof t._owner.tag == "number" ? f = e(t._owner.type) : typeof t._owner.name == "string" && (f = t._owner.name), f = " It was passed a child from " + f + ".");
417
- var O = Z.getCurrentStack;
418
- Z.getCurrentStack = function() {
417
+ var O = U.getCurrentStack;
418
+ U.getCurrentStack = function() {
419
419
  var _ = m(t.type);
420
420
  return O && (_ += O() || ""), _;
421
421
  }, console.error(
422
422
  'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',
423
423
  d,
424
424
  f
425
- ), Z.getCurrentStack = O;
425
+ ), U.getCurrentStack = O;
426
426
  }
427
427
  }
428
428
  function k(t) {
@@ -433,7 +433,7 @@ Check the render method of \`` + f + "`."), d || (t = e(t)) && (d = `
433
433
 
434
434
  Check the top-level render call using <` + t + ">."), d;
435
435
  }
436
- var L = V, y = Symbol.for("react.transitional.element"), N = Symbol.for("react.portal"), G = Symbol.for("react.fragment"), W = Symbol.for("react.strict_mode"), z = Symbol.for("react.profiler"), U = Symbol.for("react.consumer"), H = Symbol.for("react.context"), Y = Symbol.for("react.forward_ref"), se = Symbol.for("react.suspense"), X = Symbol.for("react.suspense_list"), F = Symbol.for("react.memo"), I = Symbol.for("react.lazy"), K = Symbol.for("react.offscreen"), B = Symbol.iterator, me = Symbol.for("react.client.reference"), Z = L.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, te = Object.prototype.hasOwnProperty, q = Object.assign, pe = Symbol.for("react.client.reference"), xe = Array.isArray, T = 0, R, M, A, re, J, ve, je;
436
+ var L = V, y = Symbol.for("react.transitional.element"), T = Symbol.for("react.portal"), G = Symbol.for("react.fragment"), W = Symbol.for("react.strict_mode"), z = Symbol.for("react.profiler"), H = Symbol.for("react.consumer"), Y = Symbol.for("react.context"), Z = Symbol.for("react.forward_ref"), se = Symbol.for("react.suspense"), X = Symbol.for("react.suspense_list"), F = Symbol.for("react.memo"), I = Symbol.for("react.lazy"), K = Symbol.for("react.offscreen"), B = Symbol.iterator, me = Symbol.for("react.client.reference"), U = L.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, te = Object.prototype.hasOwnProperty, q = Object.assign, pe = Symbol.for("react.client.reference"), xe = Array.isArray, N = 0, R, M, A, re, J, ve, je;
437
437
  i.__reactDisabledLog = !0;
438
438
  var be, Ie, Re = !1, Pe = new (typeof WeakMap == "function" ? WeakMap : Map)(), ct = Symbol.for("react.client.reference"), _e, ze = {}, $e = {}, Fe = {};
439
439
  we.Fragment = G, we.jsx = function(t, d, f, O, _) {
@@ -459,7 +459,7 @@ const Ke = ce(), t0 = ({ children: e, defaultComponent: s }) => {
459
459
  const e = ue(Ke);
460
460
  if (e === void 0) throw new Error("Non puoi settare il loading");
461
461
  return e;
462
- }, vt = "0.0.145", bt = ({ errorMessage: e, errorShow: s }) => /* @__PURE__ */ o.jsx("section", { className: s ? "" : "hidden", children: /* @__PURE__ */ o.jsxs("div", { className: "container mx-auto", children: [
462
+ }, vt = "0.0.147", bt = ({ errorMessage: e, errorShow: s }) => /* @__PURE__ */ o.jsx("section", { className: s ? "" : "hidden", children: /* @__PURE__ */ o.jsxs("div", { className: "container mx-auto", children: [
463
463
  /* @__PURE__ */ o.jsx("h1", { className: "text-center text-8xl my-12", children: "Errore" }),
464
464
  /* @__PURE__ */ o.jsx("pre", { className: "text-xl", children: e })
465
465
  ] }) }), Qe = ce(), r0 = ({ children: e }) => {
@@ -506,8 +506,8 @@ Esempio di config.json:
506
506
  k("Errore: DB non disponibile");
507
507
  return;
508
508
  }
509
- const L = x == null ? void 0 : x.transaction(h, "readonly"), y = L == null ? void 0 : L.objectStore(h), N = y == null ? void 0 : y.get(b);
510
- N.onsuccess = () => S(N.result), N.onerror = (G) => k(G.target.error);
509
+ const L = x == null ? void 0 : x.transaction(h, "readonly"), y = L == null ? void 0 : L.objectStore(h), T = y == null ? void 0 : y.get(b);
510
+ T.onsuccess = () => S(T.result), T.onerror = (G) => k(G.target.error);
511
511
  });
512
512
  }, g = async (c, h, b) => {
513
513
  const x = await p(c, h);
@@ -516,8 +516,8 @@ Esempio di config.json:
516
516
  k("Errore: DB non disponibile");
517
517
  return;
518
518
  }
519
- const L = x == null ? void 0 : x.transaction(h, "readwrite"), y = L == null ? void 0 : L.objectStore(h), N = y == null ? void 0 : y.put(b);
520
- N.onsuccess = () => S(N.result), N.onerror = (G) => k(G.target.error);
519
+ const L = x == null ? void 0 : x.transaction(h, "readwrite"), y = L == null ? void 0 : L.objectStore(h), T = y == null ? void 0 : y.put(b);
520
+ T.onsuccess = () => S(T.result), T.onerror = (G) => k(G.target.error);
521
521
  });
522
522
  }, C = async (c, h) => {
523
523
  let b = Date.now(), x;
@@ -766,8 +766,8 @@ const Rt = async (e, s, n, i, a, l) => {
766
766
  console.error(u);
767
767
  }
768
768
  }, ot = ce(), n0 = ({ children: e }) => {
769
- const { heartbeatEndpoint: s, firstPrivatePath: n, infiniteSession: i, timeDeducted: a, authenticatedEndpoint: l, autoLogin: u, setCurrentDate: p, isDebug: m, backendToken: g, useCustomLoginTimeout: C, customLoginTimeout: j, tokenLog: v, timerInfiniteSession: c } = ne(), { setIsLoading: h, showLoadingFor: b } = Ce(), { setShowAlert: x, setMessageAlert: S, setTypeAlert: k, activeAlert: L } = fe(), y = Ae(), [N, G] = E(null), [W, z] = E(), [U, H] = E(), [Y, se] = E(), [X, F] = E(!1), I = async (T = B, R, M) => await Rt(x, k, S, T, R, M), K = async (T = null, R) => {
770
- T && T.preventDefault(), F(!0);
769
+ const { heartbeatEndpoint: s, firstPrivatePath: n, infiniteSession: i, timeDeducted: a, authenticatedEndpoint: l, autoLogin: u, setCurrentDate: p, isDebug: m, backendToken: g, useCustomLoginTimeout: C, customLoginTimeout: j, tokenLog: v, timerInfiniteSession: c } = ne(), { setIsLoading: h, showLoadingFor: b } = Ce(), { setShowAlert: x, setMessageAlert: S, setTypeAlert: k, activeAlert: L } = fe(), y = Ae(), [T, G] = E(null), [W, z] = E(), [H, Y] = E(), [Z, se] = E(), [X, F] = E(!1), I = async (N = B, R, M) => await Rt(x, k, S, N, R, M), K = async (N = null, R) => {
770
+ N && N.preventDefault(), F(!0);
771
771
  try {
772
772
  C || h(!0), b(j), x(!1);
773
773
  const A = await (await I()).post(l, {
@@ -783,20 +783,20 @@ const Rt = async (e, s, n, i, a, l) => {
783
783
  localStorage.removeItem("accessToken"), localStorage.removeItem("id"), localStorage.removeItem("user"), G(!1), z(null);
784
784
  }, me = async () => {
785
785
  try {
786
- const T = localStorage.getItem("accessToken"), A = (await (await I()).get(
786
+ const N = localStorage.getItem("accessToken"), A = (await (await I()).get(
787
787
  `${s}`,
788
788
  {
789
789
  headers: {
790
- Authorization: T
790
+ Authorization: N
791
791
  }
792
792
  }
793
793
  )).headers.token;
794
794
  localStorage.setItem("accessToken", A), z(A), v && console.log("[Auth]: Nuovo token: ", A, "Data:", p());
795
- } catch (T) {
796
- console.error(T), B();
795
+ } catch (N) {
796
+ console.error(N), B();
797
797
  }
798
- }, Z = (T) => {
799
- const R = T || W;
798
+ }, U = (N) => {
799
+ const R = N || W;
800
800
  if (!R) return;
801
801
  const M = "Token non valido";
802
802
  try {
@@ -810,77 +810,78 @@ const Rt = async (e, s, n, i, a, l) => {
810
810
  v && console.warn("[Auth]: Token scaduto, eseguo logout."), B(), L("danger", M);
811
811
  return;
812
812
  }
813
- if (se(J), H(J - a), v) {
813
+ if (se(J), Y(J - a), v) {
814
814
  const ve = Math.floor(J / 1e3), je = Math.floor(ve / 60), be = ve % 60;
815
- v && (console.log(`[Auth]: Token valido per ancora: ${je} minuti e ${be} secondi`), console.log("[Auth]: Token:", R));
815
+ console.log(`[Auth]: Token valido per ancora: ${je} minuti e ${be} secondi`), console.log("[Auth]: Token:", R);
816
816
  }
817
817
  } catch (A) {
818
818
  v && console.error("[Auth]: Errore nella decodifica del token:", A), B(), L("danger", M);
819
819
  }
820
- }, te = (T) => {
821
- if (!T) return !1;
820
+ }, te = (N) => {
821
+ if (!N) return !1;
822
822
  try {
823
- const R = De(T), M = Math.floor(Date.now() / 1e3);
823
+ const R = De(N), M = Math.floor(Date.now() / 1e3);
824
824
  return !R.exp || R.exp < M ? (console.warn("[Auth]: Token scaduto o non valido"), !1) : !0;
825
825
  } catch (R) {
826
826
  return console.error("[Auth]: Token non valido o corrotto", R), !1;
827
827
  }
828
- }, q = async (T) => {
828
+ }, q = async (N) => {
829
829
  try {
830
830
  const A = (await (await I()).get(
831
831
  s,
832
832
  {
833
833
  headers: {
834
- Authorization: T
834
+ Authorization: N
835
835
  }
836
836
  }
837
837
  )).data;
838
- A && (localStorage.setItem("user", JSON.stringify(A)), localStorage.setItem("accessToken", T), G(!0), y(`${n}${A.id}`));
838
+ A && (localStorage.setItem("user", JSON.stringify(A)), localStorage.setItem("accessToken", N), G(!0), y(`${n}${A.id}`));
839
839
  } catch (R) {
840
840
  console.error(R);
841
841
  }
842
842
  }, pe = () => {
843
- const T = localStorage.getItem("accessToken");
844
- te(T) ? (v && console.log("[Auth]: Ricarico pagina → controllo scadenza token"), Z(T)) : (v && console.warn("[Auth]: Token non valido al reload, eseguo logout"), B());
843
+ const N = localStorage.getItem("accessToken");
844
+ te(N) ? (v && console.log("[Auth]: Ricarico pagina → controllo scadenza token"), U(N)) : (v && console.warn("[Auth]: Token non valido al reload, eseguo logout"), B());
845
845
  };
846
846
  D(() => {
847
- const T = localStorage.getItem("accessToken");
848
- if (!te(T)) {
847
+ const N = localStorage.getItem("accessToken");
848
+ if (!te(N)) {
849
849
  B();
850
850
  return;
851
851
  }
852
852
  G(!0);
853
853
  }, []), D(() => {
854
- u && !N && !X && (v && console.log("[Auth]: Tentativo di autologin con backendToken"), q(g));
855
- }, [u, N, X]), D(() => {
854
+ u && !T && !X && (v && console.log("[Auth]: Tentativo di autologin con backendToken"), q(g));
855
+ }, [u, T, X]), D(() => {
856
856
  if (document.readyState === "complete")
857
857
  pe();
858
858
  else
859
859
  return window.addEventListener("load", pe), () => window.removeEventListener("load", pe);
860
860
  }, []), D(() => {
861
- if (u) return;
862
- Z(), v && console.log("[Auth]: Entrato dentro lo useEffect di controllo");
863
- const T = c || U;
861
+ if (v && console.log("timeoutToken:", H), u) return;
862
+ U();
863
+ const N = c || H;
864
+ v && console.log("[Auth]: intervallo per il prossimo token:", N);
864
865
  let R;
865
- i && W && U && (v && console.log("[Auth]: Entrato dentro il timer della sessione infinita"), R = setInterval(() => {
866
+ i && W && H && (v && console.log("[Auth]: Entrato dentro il timer della sessione infinita"), R = setInterval(() => {
866
867
  me();
867
- }, T));
868
+ }, N));
868
869
  let M;
869
- return !i && W && Y && (v && console.log("[Auth]: Entrato dentro il timer della sessione con scadenza del token"), M = setTimeout(() => {
870
+ return !i && W && Z && (v && console.log("[Auth]: Entrato dentro il timer della sessione con scadenza del token"), M = setTimeout(() => {
870
871
  B(), L("danger", "Sessione scaduta");
871
- }, Y)), () => {
872
+ }, Z)), () => {
872
873
  R && clearInterval(R), M && clearTimeout(M);
873
874
  };
874
- }, [W, U]);
875
+ }, [W, H]);
875
876
  const xe = {
876
- isAuthenticated: N,
877
+ isAuthenticated: T,
877
878
  setIsAuthenticated: G,
878
879
  login: K,
879
880
  logout: B,
880
881
  setCurrentToken: z,
881
882
  createAxiosInstances: I,
882
883
  fetchHeartbeat: me,
883
- getTokenExpiry: Z,
884
+ getTokenExpiry: U,
884
885
  checkTokenValidity: te,
885
886
  fetchUser: q,
886
887
  handleLoad: pe
@@ -909,9 +910,9 @@ Esempio:
909
910
  const { login: s } = Te(), { clearLoginFormOnError: n } = ne(), i = {
910
911
  email: "",
911
912
  password: ""
912
- }, [a, l] = E("Accedi"), [u, p] = E("Email"), [m, g] = E("email"), [C, j] = E("example@example.it"), [v, c] = E("Accedi"), [h, b] = E(i), [x, S] = E(), [k, L] = E(), [y, N] = E(), [G, W] = E(), [z, U] = E({}), [H, Y] = E(null), F = {
913
+ }, [a, l] = E("Accedi"), [u, p] = E("Email"), [m, g] = E("email"), [C, j] = E("example@example.it"), [v, c] = E("Accedi"), [h, b] = E(i), [x, S] = E(), [k, L] = E(), [y, T] = E(), [G, W] = E(), [z, H] = E({}), [Y, Z] = E(null), F = {
913
914
  overrideStyle: z,
914
- setOverrideStyle: U,
915
+ setOverrideStyle: H,
915
916
  title: a,
916
917
  setTitle: l,
917
918
  label: u,
@@ -929,7 +930,7 @@ Esempio:
929
930
  styleCardForm: k,
930
931
  setStyleCardForm: L,
931
932
  styleContainerLogo: y,
932
- setStyleContainerLogo: N,
933
+ setStyleContainerLogo: T,
933
934
  styleLogo: G,
934
935
  setStyleLogo: W,
935
936
  changeData: (I, K) => {
@@ -938,8 +939,8 @@ Esempio:
938
939
  handleLogin: (I) => {
939
940
  s(I, h), n && b(i);
940
941
  },
941
- customVersion: H,
942
- setCustomVersion: Y
942
+ customVersion: Y,
943
+ setCustomVersion: Z
943
944
  };
944
945
  return /* @__PURE__ */ o.jsx(st.Provider, { value: F, children: e });
945
946
  }, it = () => {
@@ -947,14 +948,14 @@ Esempio:
947
948
  if (e === void 0) throw new Error("Non puoi modificare La login");
948
949
  return e;
949
950
  }, at = ce(), a0 = ({ children: e }) => {
950
- const [s, n] = E(!1), [i, a] = E(null), [l, u] = E(""), [p, m] = E(null), [g, C] = E(null), [j, v] = E(null), [c, h] = E("modal-form"), [b, x] = E("submit"), [S, k] = E({}), [L, y] = E(null), [N, G] = E(null), [W, z] = E(null), U = ({ modalData: F, component: I, title: K = "", onConfirm: B = null, type: me = "submit", formId: Z = "modal-form", item: te = null, style: q }) => {
951
- y(F), a(() => I), u(K), m(() => B), x(me), h(Z), v(te), k(q), n(!0);
952
- }, H = () => {
951
+ const [s, n] = E(!1), [i, a] = E(null), [l, u] = E(""), [p, m] = E(null), [g, C] = E(null), [j, v] = E(null), [c, h] = E("modal-form"), [b, x] = E("submit"), [S, k] = E({}), [L, y] = E(null), [T, G] = E(null), [W, z] = E(null), H = ({ modalData: F, component: I, title: K = "", onConfirm: B = null, type: me = "submit", formId: U = "modal-form", item: te = null, style: q }) => {
952
+ y(F), a(() => I), u(K), m(() => B), x(me), h(U), v(te), k(q), n(!0);
953
+ }, Y = () => {
953
954
  a(null), u(""), m(null), x("submit"), h("modal-form"), v(null), k({}), n(!1), y(null);
954
955
  }, X = {
955
956
  isOpen: s,
956
- openModal: U,
957
- closeModal: H,
957
+ openModal: H,
958
+ closeModal: Y,
958
959
  content: i,
959
960
  title: l,
960
961
  onConfirm: p,
@@ -972,9 +973,9 @@ Esempio:
972
973
  }));
973
974
  },
974
975
  handleSubmit: (F) => {
975
- F.preventDefault(), p && (p(L), H());
976
+ F.preventDefault(), p && (p(L), Y());
976
977
  },
977
- headerContent: N,
978
+ headerContent: T,
978
979
  setHeaderContent: G,
979
980
  footerContent: W,
980
981
  setFooterContent: z,
@@ -1098,15 +1099,15 @@ const _t = ({ onClose: e, type: s, title: n, name: i, onCancel: a }) => /* @__PU
1098
1099
  return D(() => {
1099
1100
  e && h(!0);
1100
1101
  }, [e]), D(() => {
1101
- const y = (N) => {
1102
- N.key === "Escape" && (n ? n() : s());
1102
+ const y = (T) => {
1103
+ T.key === "Escape" && (n ? n() : s());
1103
1104
  };
1104
1105
  return document.addEventListener("keydown", y), () => document.removeEventListener("keydown", y);
1105
1106
  }, [s, n]), D(() => {
1106
1107
  var y;
1107
1108
  if (e) {
1108
- const N = document.activeElement;
1109
- return (y = v.current) == null || y.focus(), () => N == null ? void 0 : N.focus();
1109
+ const T = document.activeElement;
1110
+ return (y = v.current) == null || y.focus(), () => T == null ? void 0 : T.focus();
1110
1111
  }
1111
1112
  }, [e]), c ? pt.createPortal(
1112
1113
  /* @__PURE__ */ o.jsx(
@@ -1169,14 +1170,14 @@ const _t = ({ onClose: e, type: s, title: n, name: i, onCancel: a }) => /* @__PU
1169
1170
  showHeaderOnLogin: k = !1,
1170
1171
  headerExcludedRoutes: L = [],
1171
1172
  footerComponent: y = null,
1172
- showFooterOnLogin: N = !1,
1173
+ showFooterOnLogin: T = !1,
1173
1174
  footerExcludedRoutes: G = []
1174
- } = e, W = L.some((Y) => We(Y, b.pathname));
1175
+ } = e, W = L.some((Z) => We(Z, b.pathname));
1175
1176
  let z;
1176
1177
  b.pathname === "/" ? z = S && k : z = S && !W;
1177
- const U = G.some((Y) => We(Y, b.pathname));
1178
- let H;
1179
- return b.pathname === "/" ? H = y && N : H = y && !U, /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
1178
+ const H = G.some((Z) => We(Z, b.pathname));
1179
+ let Y;
1180
+ return b.pathname === "/" ? Y = y && T : Y = y && !H, /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
1180
1181
  s && /* @__PURE__ */ o.jsx(Mt, {}),
1181
1182
  n && /* @__PURE__ */ o.jsx(Ve, {}),
1182
1183
  /* @__PURE__ */ o.jsx(
@@ -1201,7 +1202,7 @@ const _t = ({ onClose: e, type: s, title: n, name: i, onCancel: a }) => /* @__PU
1201
1202
  n && /* @__PURE__ */ o.jsx(Ve, {}),
1202
1203
  /* @__PURE__ */ o.jsx(le, {})
1203
1204
  ] }) : /* @__PURE__ */ o.jsx(le, {}),
1204
- H && y
1205
+ Y && y
1205
1206
  ] });
1206
1207
  }, Ge = (e) => {
1207
1208
  const {
@@ -1280,7 +1281,7 @@ const _t = ({ onClose: e, type: s, title: n, name: i, onCancel: a }) => /* @__PU
1280
1281
  const { styleCardForm: s, styleContainerLogo: n, styleLogo: i, overrideStyle: a, customVersion: l } = it(), { firstPrivatePath: u, version: p } = ne(), m = Ae();
1281
1282
  return D(() => {
1282
1283
  const g = JSON.parse(localStorage.getItem("user"));
1283
- localStorage.getItem("accessToken") && g.id && m(`${u}${g.id}`);
1284
+ localStorage.getItem("accessToken") && (g != null && g.id) && m(`${u}${g.id}`);
1284
1285
  }, []), /* @__PURE__ */ o.jsxs("section", { id: "login-page", children: [
1285
1286
  (p || l) && /* @__PURE__ */ o.jsx("div", { className: "text-md text-primary absolute top-4 left-4", children: l || p }),
1286
1287
  /* @__PURE__ */ o.jsx("div", { className: a.container || "container mx-auto flex items-center justify-center h-screen", children: /* @__PURE__ */ o.jsxs("div", { className: a.cardForm || `bg-form card-style card-size flex flex-col sm:flex-row sm:items-center justify-center ${s}`, children: [
@@ -1449,11 +1450,11 @@ const _t = ({ onClose: e, type: s, title: n, name: i, onCancel: a }) => /* @__PU
1449
1450
  }, []), /* @__PURE__ */ o.jsx(dt, { children: /* @__PURE__ */ o.jsxs(ae, { element: S, children: [
1450
1451
  /* @__PURE__ */ o.jsxs(ae, { path: "/", children: [
1451
1452
  /* @__PURE__ */ o.jsx(ae, { index: !0, element: /* @__PURE__ */ o.jsx(Wt, { Logo: a }) }),
1452
- s.map((y, N) => /* @__PURE__ */ o.jsx(ae, { path: y.path, element: y.element }, `public-${N}`))
1453
+ s.map((y, T) => /* @__PURE__ */ o.jsx(ae, { path: y.path, element: y.element }, `public-${T}`))
1453
1454
  ] }),
1454
1455
  /* @__PURE__ */ o.jsxs(ae, { element: k, children: [
1455
1456
  /* @__PURE__ */ o.jsx(ae, { path: `${i ?? "/dashboard/"}:id`, element: u }),
1456
- n.map((y, N) => /* @__PURE__ */ o.jsx(ae, { path: y.path, element: y.element }, `private-${N}`))
1457
+ n.map((y, T) => /* @__PURE__ */ o.jsx(ae, { path: y.path, element: y.element }, `private-${T}`))
1457
1458
  ] })
1458
1459
  ] }) });
1459
1460
  }, c0 = ({ children: e }) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "thecore-auth",
3
3
  "private": false,
4
- "version": "0.0.145",
4
+ "version": "0.0.147",
5
5
  "type": "module",
6
6
  "main": "dist/thecore-auth.cjs.js",
7
7
  "style": "dist/thecore-auth.css",