1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{8698:function(e,t,n){Promise.resolve().then(n.bind(n,5133))},5133:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return x}});var i=n(7573);n(225),n(3590);var r=n(7659),s=n(7653),a=n(7754),o=n(4463),c=n(2745),l=n(3875),d=()=>{window.va||(window.va=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];(window.vaq=window.vaq||[]).push(t)})};function u(){return"undefined"!=typeof window}function h(){return"production"}function f(){return"development"===((u()?window.vam:h())||"production")}function p(e){return(0,s.useEffect)(()=>{var t;e.beforeSend&&(null==(t=window.va)||t.call(window,"beforeSend",e.beforeSend))},[e.beforeSend]),(0,s.useEffect)(()=>{var t;!function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{debug:!0};if(!u())return;(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"auto";if("auto"===e){window.vam=h();return}window.vam=e})(t.mode),d(),t.beforeSend&&(null==(e=window.va)||e.call(window,"beforeSend",t.beforeSend));let n=t.scriptSrc?t.scriptSrc:f()?"https://va.vercel-scripts.com/v1/script.debug.js":t.basePath?"".concat(t.basePath,"/insights/script.js"):"/_vercel/insights/script.js";if(document.head.querySelector('script[src*="'.concat(n,'"]')))return;let i=document.createElement("script");i.src=n,i.defer=!0,i.dataset.sdkn="@vercel/analytics"+(t.framework?"/".concat(t.framework):""),i.dataset.sdkv="1.6.1",t.disableAutoTrack&&(i.dataset.disableAutoTrack="1"),t.endpoint?i.dataset.endpoint=t.endpoint:t.basePath&&(i.dataset.endpoint="".concat(t.basePath,"/insights")),t.dsn&&(i.dataset.dsn=t.dsn),i.onerror=()=>{f()},f()&&!1===t.debug&&(i.dataset.debug="false"),document.head.appendChild(i)}({framework:e.framework||"react",basePath:null!==(t=e.basePath)&&void 0!==t?t:function(){if(void 0!==l&&void 0!==l.env)return l.env.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}(),...void 0!==e.route&&{disableAutoTrack:!0},...e})},[]),(0,s.useEffect)(()=>{e.route&&e.path&&function(e){var t;let{route:n,path:i}=e;null==(t=window.va)||t.call(window,"pageview",{route:n,path:i})}({route:e.route,path:e.path})},[e.route,e.path]),null}let m=()=>(0,i.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-slate-900 via-purple-900 to-slate-900 flex items-center justify-center",children:(0,i.jsxs)("div",{className:"text-center",children:[(0,i.jsx)("div",{className:"w-12 h-12 border-4 border-blue-400/30 border-t-blue-400 rounded-full animate-spin mx-auto mb-4"}),(0,i.jsx)("div",{className:"text-white text-lg",children:"Caricamento..."})]})});function x(e){var t,n;let{children:l}=e,d=(0,a.useRouter)(),u=(0,a.usePathname)(),[h,f]=(0,s.useState)(null),[x,b]=(0,s.useState)(!0),[w,v]=(0,s.useState)(!1),{shouldAnimate:g,animationClass:j}=function(){let[e,t]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{{let e=window.matchMedia("(prefers-reduced-motion: reduce)");t(e.matches);let n=()=>t(e.matches);return e.addEventListener("change",n),()=>e.removeEventListener("change",n)}},[]),{prefersReducedMotion:e,shouldAnimate:!e,animationClass:e?"":"transition-all duration-300"}}();!function(){(0,s.useEffect)(()=>()=>{window.gc&&window.gc()},[]);let[e,t]=(0,s.useState)({width:0,height:0});(0,s.useEffect)(()=>{let e=()=>{t({width:window.innerWidth,height:window.innerHeight})};return t({width:window.innerWidth,height:window.innerHeight}),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[])}();let y="/"===u||"/dashboard"===u||(null==u?void 0:u.startsWith("/suggestions"));(0,s.useEffect)(()=>{v(!0);let e=!0;(async()=>{try{let{data:t}=await o.OQ.auth.getUser();e&&(f(t.user),b(!1))}catch(t){e&&b(!1)}})();let{data:{subscription:t}}=o.OQ.auth.onAuthStateChange((t,n)=>{if(e){var i;f(null!==(i=null==n?void 0:n.user)&&void 0!==i?i:null),b(!1)}});return()=>{e=!1,t.unsubscribe()}},[]);let k=async()=>{try{await o.OQ.auth.signOut(),d.push("/sign-in")}catch(e){}};return w?(0,i.jsxs)("html",{lang:"it",children:[(0,i.jsxs)("head",{children:[(0,i.jsx)("meta",{charSet:"utf-8"}),(0,i.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1"}),(0,i.jsx)("meta",{name:"theme-color",content:"#0f172a"}),(0,i.jsx)("meta",{name:"description",content:"LifeOS - AI-powered personal wellness platform"}
1),(0,i.jsx)("link",{rel:"preconnect",href:"https://fonts.googleapis.com"}),(0,i.jsx)("link",{rel:"preconnect",href:"https://fonts.gstatic.com",crossOrigin:"anonymous"}),(0,i.jsx)("link",{rel:"dns-prefetch",href:"https://vzwplpljxdqmdejvzwuw.supabase.co"}),(0,i.jsx)("link",{rel:"icon",href:"/favicon.ico"}),(0,i.jsx)("title",{children:"LifeOS"}),(0,i.jsx)("script",{defer:!0,src:"https://analytics.tornoinforma.it/script.js","data-website-id":"66e51987-ce46-4a3e-ae92-f926abed660c"})]}),(0,i.jsxs)("body",{className:"optimized-text bg-gradient-to-br from-slate-900 via-purple-900 to-slate-900 min-h-screen",children:[!1,!y&&(0,i.jsx)("header",{className:"sticky top-0 z-50 bg-black/20 backdrop-blur-optimized border-b border-white/10",children:(0,i.jsx)("div",{className:"container mx-auto px-4 sm:px-6 py-3 sm:py-4",children:(0,i.jsxs)("div",{className:"flex items-center justify-between",children:[(0,i.jsx)(r.default,{href:"/",className:"text-xl sm:text-2xl font-bold bg-gradient-to-r from-blue-400 to-purple-500 bg-clip-text text-transparent hover-optimized ".concat(j),children:"LifeOS"}),(0,i.jsx)("nav",{className:"hidden lg:flex space-x-6 xl:space-x-8",children:[{href:"/",label:"Home"},{href:"/suggestions",label:"Esercizi"},{href:"/dashboard",label:"Dashboard"},{href:"/notifications",label:"Notifiche"},{href:"/settings",label:"Impostazioni"}].map(e=>(0,i.jsx)(r.default,{href:e.href,className:"text-white/80 hover:text-white transition-colors ".concat(j),children:e.label},e.href))}),(0,i.jsx)("div",{className:"flex items-center gap-4",children:x?(0,i.jsx)("div",{className:"w-6 h-6 border-2 border-white/30 border-t-white rounded-full animate-spin"}):h?(0,i.jsxs)("div",{className:"flex items-center gap-3",children:[(0,i.jsxs)("div",{className:"hidden sm:block text-right",children:[(0,i.jsx)("div",{className:"text-white text-sm font-medium",children:(null===(t=h.user_metadata)||void 0===t?void 0:t.full_name)||(null===(n=h.email)||void 0===n?void 0:n.split("@")[0])||"Utente"}),(0,i.jsx)("div",{className:"text-white/60 text-xs",children:h.email})]}),(0,i.jsx)("button",{onClick:k,className:"bg-gradient-to-r from-red-500 to-red-600 text-white px-4 py-2 rounded-lg font-medium hover:scale-105 transition-transform button-press ".concat(j),children:"Logout"})]}):(0,i.jsx)(r.default,{href:"/sign-in",className:"bg-gradient-to-r from-blue-500 to-purple-600 text-white px-4 sm:px-6 py-2 rounded-lg font-semibold hover:scale-105 transition-transform button-press ".concat(j),children:"Accedi"})})]})})}),(0,i.jsx)(c.Z,{children:(0,i.jsx)("main",{className:"contain-layout",children:(0,i.jsx)(s.Suspense,{fallback:(0,i.jsx)(m,{}),children:l})})}),(0,i.jsx)("footer",{className:"bg-black/20 backdrop-blur-lg border-t border-white/10 mt-auto",children:(0,i.jsx)("div",{className:"container mx-auto px-4 sm:px-6 py-6 sm:py-8",children:(0,i.jsxs)("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4",children:[(0,i.jsx)("div",{className:"text-white/60 text-sm",children:"\xa9 2026 LifeOS. Il tuo percorso di benessere inizia qui."}),(0,i.jsxs)("div",{className:"flex items-center gap-4 text-sm",children:[(0,i.jsx)(r.default,{href:"/privacy",className:"text-white/60 hover:text-white transition-colors",children:"Privacy"}),(0,i.jsx)(r.default,{href:"/terms",className:"text-white/60 hover:text-white transition-colors",children:"Terms"}),(0,i.jsx)(r.default,{href:"/support",className:"text-white/60 hover:text-white transition-colors",children:"Support"})]})]})})}),(0,i.jsx)("script",{dangerouslySetInnerHTML:{__html:"\n if ('serviceWorker' in navigator) {\n window.addEventListener('load', function() {\n navigator.serviceWorker.register('/sw.js');\n });\n }\n \n // Preload critical resources\n const preloadResources = [\n '".concat("https://vzwplpljxdqmdejvzwuw.supabase.co","',\n ];\n \n preloadResources.forEach(url => {\n const link = document.createElement('link');\n link.rel = 'dns-prefetch';\n link.href = url;\n document.head.appendChild(link);\n });\n ")}}),(0,i.jsx)(p,{})]})]}):(0,i.jsxs)("html",{lang:"it",children:[(0,i.jsxs)("head",{children:[(0,i.jsx)("meta",{charSet:"utf-8"}),(0,i.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1"}),(0,i.jsx)("meta",{name:"theme-color",content:"#0f172a"}),(0,i.jsx)("meta",{name:"description",content:"LifeOS - AI-powered personal wellness platform"}
1),(0,i.jsx)("link",{rel:"preconnect",href:"https://fonts.googleapis.com"}),(0,i.jsx)("link",{rel:"preconnect",href:"https://fonts.gstatic.com",crossOrigin:"anonymous"}),(0,i.jsx)("title",{children:"LifeOS"}),(0,i.jsx)("script",{defer:!0,src:"https://analytics.tornoinforma.it/script.js","data-website-id":"66e51987-ce46-4a3e-ae92-f926abed660c"})]}),(0,i.jsx)("body",{className:"optimized-text",children:(0,i.jsx)(m,{})})]})}},2745:function(e,t,n){"use strict";n.d(t,{Z:function(){return o},n:function(){return a}});var i=n(7573),r=n(7653);let s=(0,r.createContext)({show:()=>{},hide:()=>{}});function a(){return(0,r.useContext)(s)}function o(e){let{children:t}=e,[n,a]=(0,r.useState)(!1),[o,c]=(0,r.useState)(0),[l,d]=(0,r.useState)(1),u=(0,r.useCallback)(e=>{var t,n;c(null!==(t=null==e?void 0:e.balance)&&void 0!==t?t:0),d(null!==(n=null==e?void 0:e.cost)&&void 0!==n?n:1),a(!0)},[]),h=(0,r.useCallback)(()=>a(!1),[]);(0,r.useEffect)(()=>{let e=window.fetch;return window.fetch=async function(){for(var t,n,i,r,s=arguments.length,a=Array(s),o=0;o<s;o++)a[o]=arguments[o];let c=await e(...a);if(402===c.status){let e=c.clone();try{let s=await e.json();u({balance:null!==(i=null!==(n=null===(t=s.credits)||void 0===t?void 0:t.credits_remaining)&&void 0!==n?n:s.balance)&&void 0!==i?i:0,cost:null!==(r=s.cost)&&void 0!==r?r:1})}catch(e){u()}}return c},()=>{window.fetch=e}},[u]);let f="".concat("https://utilitylab-hub.vercel.app","/pricing?from=").concat("lifeos");return(0,i.jsxs)(s.Provider,{value:{show:u,hide:h},children:[t,n&&(0,i.jsxs)("div",{style:{position:"fixed",inset:0,zIndex:99999,display:"flex",alignItems:"center",justifyContent:"center",padding:16},children:[(0,i.jsx)("div",{onClick:h,style:{position:"absolute",inset:0,background:"rgba(0,0,0,0.75)",backdropFilter:"blur(8px)"}}),(0,i.jsxs)("div",{style:{position:"relative",width:"100%",maxWidth:420,borderRadius:20,background:"#0f1219",border:"1px solid rgba(255,255,255,0.08)",padding:32,textAlign:"center",boxShadow:"0 24px 48px rgba(0,0,0,0.5)"},children:[(0,i.jsx)("button",{onClick:h,style:{position:"absolute",top:16,right:16,background:"none",border:"none",color:"rgba(255,255,255,0.3)",cursor:"pointer",fontSize:20,lineHeight:1},children:"â"}),(0,i.jsx)("div",{style:{fontSize:48,marginBottom:16},children:"â¡"}),(0,i.jsx)("h2",{style:{fontSize:22,fontWeight:700,color:"#f1f5f9",margin:0},children:"Crediti esauriti"}),(0,i.jsx)("p",{style:{fontSize:14,color:"rgba(255,255,255,0.4)",marginTop:12,lineHeight:1.5},children:o<=0?"Hai finito i crediti. Ricarica o scegli un piano per continuare a usare LifeOS.":"Hai solo ".concat(o," crediti, ma questa azione ne richiede ").concat(l,".")}),(0,i.jsxs)("div",{style:{marginTop:24,display:"flex",flexDirection:"column",gap:10},children:[(0,i.jsx)("a",{href:f,style:{display:"block",padding:"14px 24px",background:"linear-gradient(135deg, #3b82f6, #f97316)",color:"white",fontSize:14,fontWeight:600,borderRadius:12,textDecoration:"none",textAlign:"center",transition:"opacity 0.2s"},children:"Vedi piani e prezzi"}),(0,i.jsx)("a",{href:"".concat(f,"&tab=packs"),style:{display:"block",padding:"12px 24px",border:"1px solid rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.5)",fontSize:13,fontWeight:500,borderRadius:12,textDecoration:"none",textAlign:"center",background:"transparent"},children:"Compra pacchetto crediti"}),(0,i.jsx)("button",{onClick:h,style:{padding:"10px 24px",background:"none",border:"none",color:"rgba(255,255,255,0.25)",fontSize:13,cursor:"pointer"},children:"Torna indietro"})]}),(0,i.jsx)("div",{style:{marginTop:20,fontSize:11,color:"rgba(255,255,255,0.15)"},children:"1 analisi AI â 1 credito \xb7 Pacchetti da â¬1.99"})]})]})]})}},4463:function(e,t,n){"use strict";n.d(t,{OQ:function(){return o},i1:function(){return l},ts:function(){return d}});var i=n(6945),r=n(3875);let s="https://vzwplpljxdqmdejvzwuw.supabase.co",a="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InZ6d3BscGxqeGRxbWRlanZ6d3V3Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzE0NDI2NDIsImV4cCI6MjA4NzAxODY0Mn0.qphtBWqokWxQR4bIXXROKZc7HpkFUEONNV0ykuev-20";if(!s||!a)throw Error("Missing Supabase environment variables");let o=(0,i.eI)(s,a,{auth:{autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0}}),c=r.env.SUPABASE_SERVICE_ROLE_KEY;c&&(0,i.eI)(s,c,{auth:{autoRefreshToken:!1,persistSession:!1}});let l=async(e,t)=>{try{let{data:{session:n},error:i}=await o.auth.getSession();if(i||!n)throw Error("Authentication required");let{data:r,error:s}=await o.functions.invoke(e,{body:t,headers:{Authorization:"Bearer ".concat(n.access_token),"Content-Type":"application/json"}});if(s)throw s;return r}catch(e){throw e}},d=async()=>{let{data:{user:e},error:t}=await o.auth.getUser();return t?null:e}},7754:function(e,t,n){"use strict";var i=n(534);n.o(i,"usePathname")&&n.d(t,{usePathname:function(){return i.usePathname}}),n.o(i,"useRouter")&&n.d(t,{useRouter:function(){return i.useRouter}})},225:function(){},3590:function(){}},function(e){e.O(0,[577,945,659,293,286,744],function(){return e(e.s=8698)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.