1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[72],{58996:(e,t,o)=>{Promise.resolve().then(o.bind(o,32420))},32420:(e,t,o)=>{"use strict";o.r(t),o.d(t,{default:()=>z});var i=o(46114),l=o(73645),n=o(9610),a=o(73442),s=o(90552),r=o(63838),c=o(5150),d=o(54980),u=o(91722),p=o(20978),f=o(51752),h=o(10417),m=o(81493),g=o(68400),b=o(3792),v=o(25335),x=o(10303),S=o(2514),y=o(99057),w=o(23597),k=o(19305),A=o(24336),I=o(78113),_=o(46090),j=o(18049),C=o(13515);function T(){var e,t;let o=(0,I.useTranslations)("auth"),f=(0,I.useLocale)(),[h,m]=n.useState(!1),g=_.Fc.find(e=>e.code===f);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(a.default,{component:"button",type:"button",onClick:()=>m(!0),sx:{mt:1.25,background:"rgba(0,147,139,0.06)",border:"1px solid rgba(0,147,139,0.18)",borderRadius:"20px",px:1.5,py:.6,display:"inline-flex",alignItems:"center",gap:.75,cursor:"pointer",transition:"all 0.15s","&:hover":{background:"rgba(0,147,139,0.10)"}},children:[(0,i.jsx)(s.default,{sx:{fontSize:l.ZN.size.body,lineHeight:1},children:null!==(e=null==g?void 0:g.flag)&&void 0!==e?e:"\uD83C\uDF10"}),(0,i.jsx)(s.default,{sx:{fontSize:l.ZN.size.small,fontWeight:600,color:"primary.main"},children:null!==(t=null==g?void 0:g.label)&&void 0!==t?t:f.toUpperCase()}),(0,i.jsx)(s.default,{sx:{fontSize:l.ZN.size.small,color:"text.secondary"},children:"â¾"})]}),(0,i.jsxs)(r.A,{open:h,onClose:()=>m(!1),PaperProps:{sx:{borderRadius:"20px",mx:2,maxWidth:340,width:"100%",background:"rgba(255,255,255,0.96)",backdropFilter:"blur(24px)",boxShadow:"0 8px 40px rgba(0,0,0,0.14)",maxHeight:"70vh",display:"flex",flexDirection:"column",overflow:"hidden"}},slotProps:{backdrop:{sx:{backdropFilter:"blur(6px)",background:"rgba(0,0,0,0.25)"}}},children:[(0,i.jsx)(a.default,{sx:{px:2.5,pt:2.5,pb:1,flexShrink:0},children:(0,i.jsx)(s.default,{sx:{fontSize:l.ZN.size.bodyLg,fontWeight:700,color:"text.primary"},children:o("chooseLanguage")})}),(0,i.jsx)(c.A,{sx:{px:1,pb:1.5,overflow:"auto",flex:1},children:_.Fc.filter(e=>!e.isRtl).map(e=>(0,i.jsxs)(d.A,{selected:e.code===f,onClick:()=>{m(!1),e.code!==f&&(0,j.A)(e.code)},sx:{borderRadius:"12px",mx:.5,mb:.25,"&.Mui-selected":{bgcolor:"rgba(0,147,139,0.08)","&:hover":{bgcolor:"rgba(0,147,139,0.12)"}}},children:[(0,i.jsx)(u.A,{sx:{minWidth:36,fontSize:l.ZN.size.subtitle},children:e.flag}),(0,i.jsx)(p.A,{primary:e.label,secondary:e.labelIt!==e.label?e.labelIt:void 0,primaryTypographyProps:{sx:{fontSize:l.ZN.size.small,fontWeight:500}},secondaryTypographyProps:{sx:{fontSize:l.ZN.size.caption,color:"text.disabled"}}}),!e.isAppSupported&&(0,i.jsx)(s.default,{sx:{fontSize:l.ZN.size.small,color:"text.disabled",mr:.5},children:"EN"}),e.code===f&&(0,i.jsx)(s.default,{sx:{fontSize:l.ZN.size.leadLg,color:"primary.main",lineHeight:1},children:"â"})]},e.code))})]})]})}function z(){let e=(0,I.useTranslations)("auth"),t=(0,S.useRouter)(),{open:o}=(0,y.Zz)(),r=(0,w.jE)(),c=(0,n.useMemo)(()=>new URLSearchParams(window.location.search).get("returnTo"),[]),d=(0,n.useMemo)(()=>{var e,t;let o=window.Capacitor;return(null==o?void 0:null===(e=o.isNativePlatform)||void 0===e?void 0:e.call(o))===!0&&(null==o?void 0:null===(t=o.getPlatform)||void 0===t?void 0:t.call(o))==="ios"},[]),[u,p]=(0,n.useState)({username:"",password:""}),[_,j]=(0,n.useState)(!1),[z,N]=(0,n.useState)(null),E=(e,t)=>{N(null),p(o=>({...o,[e]:t}))},P=async i=>{var l,n;i.preventDefault(),N(null),j(!0),(0,C.Qp)("login","started",{method:"password"});try{let i=(await v.R.signIn({userName:u.username,password:u.password})).data,n=(l="ri-hub",void 0!==l)?l:"ri-hub";document.cookie="".concat(n,"-accessToken=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=.ri-hub.it"),document.cookie="".concat(n,"-refreshToken=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=.ri-hub.it"),document.cookie="".concat(n,"-accessToken=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=ri-hub.it"),document.cookie="".concat(n,"-refreshToken=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=ri-hub.it"),x.j.setTokens(i),r.clear();let a=x.j.getDecodedAccessToken(),s=null==a?void 0:a.UserType;(0,C.Qp)("login","success",{method:"password",user_type:s}),o({message:e("loginSuccess"),severity:"success"}),c&&c.startsWith("/")?t.replace(c):"Customer"===s?t.replace("/hub"):"Physiotherapist"===s&&t.replace("/physiotherapist/appointments")}catch(l){let t=null==l?void 0:null===(n=l.response)||void 0===n?void 0:n.status;(0,C.Qp)("login","failed",{method:"password",status:t});let i=400===t?e("emailOrPasswordError"):e("connectionError");N(i),o({message:i,severity:"error"})}finally{j(!1)}};return(0,i.jsx)(a.default,{sx:{minHeight:"100dvh",bgcolor:"background.default",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,i.jsxs)(a.default,{sx:{width:"100%",maxWidth:420,minHeight:{xs:"100dvh",sm:"auto"},bgcolor:"background.paper",display:"flex",flexDirection:"column",px:3,pt:{xs:l.KL.topInsetAuth,sm:5},pb:{xs:l.KL.bottomInsetAuth,sm:5},overflowY:"auto",overflowX:"hidden",WebkitOverflowScrolling:"touch",borderRadius:{xs:0,sm:3},boxShadow:{xs:"none",sm:"0 8px 40px rgba(0,0,0,0.10)"}},children:[(0,i.jsxs)(a.default,{sx:{mb:3,display:"flex",flexDirection:"column",alignItems:"center"},children:[(0,i.jsx)(a.default,{component:"img",src:"/images/registered-black-logo.svg",alt:"Ri-Hub",sx:{height:44,mb:1.5}}),(0,i.jsx)(s.default,{sx:{fontSize:l.ZN.size.subtitle,fontWeight:600,letterSpacing:-.3,color:"text.primary",textAlign:"center"},children:e("welcomeBack")}),(0,i.jsx)(s.default,{sx:{fontSize:l.ZN.size.caption,color:"text.secondary",mt:.25,textAlign:"center"},children:e("loginSubtitle")}),(0,i.jsx)(T,{})]}),(0,i.jsxs)(a.default,{component:"form",onSubmit:P,sx:{flex:1,display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[(0,i.jsxs)(f.default,{spacing:1.25,children:[(0,i.jsx)(h.A,{fullWidth:!0,size:"small",label:"Email",type:"email",autoComplete:"email",error:!!z,value:u.username,onChange:e=>E("username",e.target.value),onFocus:e=>{let t=e.currentTarget;setTimeout(()=>null==t?void 0:t.scrollIntoView({block:"center",behavior:"smooth"}),250)}}),(0,i.jsx)(y.s3,{fullWidth:!0,size:"small",label:"Password",error:!!z,value:u.password,onChange:e=>E("password",e.target.value),onFocus:e=>{let t=e.currentTarget;setTimeout(()=>null==t?void 0:t.scrollIntoView({block:"center",behavior:"smooth"}),250)}}),z&&(0,i.jsx)(a.default,{sx:{px:1.5,py:1,borderRadius:"10px",background:"rgba(211, 47, 47, 0.06)",border:"1px solid rgba(211, 47, 47, 0.18)"},children:(0,i.jsx)(s.default,{sx:{fontSize:l.ZN.size.caption,fontWeight:500,color:"error.main"},children:z})}),(0,i.jsx)(a.default,{sx:{display:"flex",justifyContent:"flex-end",alignItems:"center"},children:(0,i.jsx)(m.A,{component:"button",type:"button",variant:"caption",underline:"always",sx:{color:"text.secondary","&:hover":{color:"primary.main"}},onClick:()=>t.push("/lost-password"),children:e("forgotPassword")})})]}),(0,i.jsxs)(f.default,{spacing:1.25,sx:{mt:2},children:[(0,i.jsx)(g.default,{fullWidth:!0,type:"submit",variant:"contained",loading:_,sx:{fontWeight:600},children:e("login")}),(0,i.jsx)(a.default,{sx:{textAlign:"center"},children:(0,i.jsxs)(s.default,{sx:{fontSize:l.ZN.size.caption,color:"text.secondary"},children:[e("noAccount")," ",(0,i.jsx)(m.A,{component:"button",type:"button",underline:"always",sx:{color:"primary.main",fontWeight:600,fontSize:l.ZN.size.caption,cursor:"pointer"},onClick:()=>t.push("/register"),children:e("register")})]})}
1),!d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(b.A,{sx:{color:"text.secondary",fontSize:l.ZN.size.small},children:e("or")}),(0,i.jsx)(A.z,{}),(0,i.jsx)(k._,{})]}),(0,i.jsx)(a.default,{component:"button",type:"button",onClick:()=>t.push("/hub"),sx:{width:"100%",py:1.25,background:"none",border:"none",cursor:"pointer",fontFamily:"inherit"},children:(0,i.jsx)(s.default,{sx:{fontSize:l.ZN.size.caption,fontWeight:600,color:"primary.main",textAlign:"center"},children:e("enterApp")})}),(0,i.jsxs)(s.default,{sx:{fontSize:l.ZN.size.caption,color:"text.secondary",textAlign:"center",lineHeight:1.5,mt:.5},children:[e("privacyNotice"),(0,i.jsx)("br",{}),(0,i.jsx)(m.A,{href:"/privacy",underline:"always",sx:{color:"primary.main",fontSize:l.ZN.size.caption,fontWeight:600},children:e("privacyLink")}),"."]})]})]})]})})}},24336:(e,t,o)=>{"use strict";o.d(t,{z:()=>g});var i=o(46114),l=o(73645),n=o(68400),a=o(25562),s=o(9610),r=o(25335),c=o(10303),d=o(23597),u=o(99057),p=o(2514),f=o(14587);function h(){return(0,i.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",style:{display:"block",flexShrink:0},children:(0,i.jsx)("path",{fill:"#000",d:"M14.39 9.55c-.02-2.13 1.74-3.16 1.82-3.21-1-1.45-2.55-1.66-3.1-1.68-1.32-.13-2.58.78-3.25.78-.68 0-1.71-.76-2.81-.74-1.45.02-2.78.84-3.52 2.13-1.5 2.6-.38 6.45 1.08 8.56.71 1.04 1.56 2.2 2.66 2.16 1.07-.04 1.47-.69 2.76-.69s1.66.69 2.79.67c1.15-.02 1.88-1.05 2.59-2.09.81-1.2 1.15-2.36 1.17-2.42-.03-.01-2.24-.86-2.26-3.42zM12.27 3.34c.59-.71 1-1.7.88-2.69-.85.04-1.88.57-2.49 1.28-.55.62-1.03 1.63-.9 2.6.95.07 1.92-.49 2.51-1.19z"})})}async function m(e,t){var o;let i=window;if(null===(o=i.AppleID)||void 0===o?void 0:o.auth){i.AppleID.auth.init({clientId:e,scope:"name email",redirectURI:t,state:"rihub-web-signin",usePopup:!0});return}await new Promise((o,i)=>{let l=document.createElement("script");l.src="https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js",l.async=!0,l.defer=!0,l.onload=()=>{var l;let n=window;if(!(null===(l=n.AppleID)||void 0===l?void 0:l.auth)){i(Error("Apple JS SDK non disponibile dopo il load"));return}n.AppleID.auth.init({clientId:e,scope:"name email",redirectURI:t,state:"rihub-web-signin",usePopup:!0}),o()},l.onerror=()=>i(Error("Impossibile caricare Apple JS SDK")),document.head.appendChild(l)})}function g(){let[e,t]=(0,s.useState)(!1),{open:g}=(0,u.Zz)(),b=(0,d.jE)(),v=(0,p.useRouter)(),x=async()=>{t(!0);try{var e,i,l,n,a,s,d,u,p,h,x,S,y,w,k,A,I,_,j,C,T,z;let t=window.Capacitor,N=null==t?void 0:null===(e=t.getPlatform)||void 0===e?void 0:e.call(t);if((null==t?void 0:null===(i=t.isNativePlatform)||void 0===i?void 0:i.call(t))&&"ios"===N){let{SignInWithApple:e}=await o.e(1272).then(o.bind(o,41272)),t=null!==(y=f.env.NEXT_PUBLIC_APPLE_SIGNIN_REDIRECT_URI)&&void 0!==y?y:"".concat(window.location.origin,"/auth/login"),i=await e.authorize({clientId:null!==(w=f.env.NEXT_PUBLIC_APPLE_SIGNIN_CLIENT_ID)&&void 0!==w?w:"rihub.ui",redirectURI:t,scopes:"email name",state:"rihub-signin"}),l=null===(p=i.response)||void 0===p?void 0:p.identityToken;if(!l){g({message:"Apple non ha restituito un token valido",severity:"error"});return}let n=await r.R.signInWithApple({identityToken:l,authorizationCode:null!==(k=null===(h=i.response)||void 0===h?void 0:h.authorizationCode)&&void 0!==k?k:void 0,firstName:null!==(A=null===(x=i.response)||void 0===x?void 0:x.givenName)&&void 0!==A?A:void 0,lastName:null!==(I=null===(S=i.response)||void 0===S?void 0:S.familyName)&&void 0!==I?I:void 0});c.j.setTokens(n.data),b.clear();let a=c.j.getDecodedAccessToken();(null==a?void 0:a.UserType)==="Customer"?v.push("/hub"):(null==a?void 0:a.UserType)==="Physiotherapist"&&v.push("/physiotherapist/appointments"),g({message:"Accesso effettuato con successo",severity:"success"});return}let E=(_="rihub.ui.web",void 0!==_)?_:"rihub.ui.web",P=(j="https://app.ri-hub.it/api/auth/sign-in-apple",void 0!==j)?j:"https://app.ri-hub.it/api/auth/sign-in-apple";await m(E,P);let R=window,D=await R.AppleID.auth.signIn(),M=null===(l=D.authorization)||void 0===l?void 0:l.id_token;if(!M){g({message:"Apple non ha restituito un token valido",severity:"error"});return}let U=await r.R.signInWithApple({identityToken:M,authorizationCode:null!==(C=null===(n=D.authorization)||void 0===n?void 0:n.code)&&void 0!==C?C:void 0,firstName:null!==(T=null===(s=D.user)||void 0===s?void 0:null===(a=s.name)||void 0===a?void 0:a.firstName)&&void 0!==T?T:void 0,lastName:null!==(z=null===(u=D.user)||void 0===u?void 0:null===(d=u.name)||void 0===d?void 0:d.lastName)&&void 0!==z?z:void 0});c.j.setTokens(U.data),b.clear();let W=c.j.getDecodedAccessToken();(null==W?void 0:W.UserType)==="Customer"?v.push("/hub"):(null==W?void 0:W.UserType)==="Physiotherapist"&&v.push("/physiotherapist/appointments"),g({message:"Accesso effettuato con successo",severity:"success"})}catch(t){let e=(null==t?void 0:t.code)==="ERR_CANCELED"||(null==t?void 0:t.error)==="popup_closed_by_user"||(null==t?void 0:t.error)==="user_cancelled_authorize";g({message:e?"Accesso Apple annullato":"Accesso Apple non riuscito",severity:e?"info":"error"})}finally{t(!1)}};return(0,i.jsx)(n.default,{fullWidth:!0,variant:"text",onClick:x,disabled:e,startIcon:e?(0,i.jsx)(a.default,{size:18,sx:{color:"#fff"}}):(0,i.jsx)(h,{}),sx:{height:46,bgcolor:"#000",border:"1.5px solid #000",borderRadius:"12px",color:"#fff",textTransform:"none",fontWeight:500,fontSize:l.ZN.size.small,letterSpacing:.1,boxSh
1adow:"0 1px 4px rgba(0,0,0,0.18)","& .MuiButton-startIcon svg path":{fill:"#fff"},"&:hover":{bgcolor:"#1a1a1a",border:"1.5px solid #1a1a1a",boxShadow:"0 2px 8px rgba(0,0,0,0.25)"},"&:active":{bgcolor:"#0d0d0d"},"&.Mui-disabled":{bgcolor:"#000",color:"#fff",border:"1.5px solid #000",opacity:.55}},children:"Continua con Apple"})}},19305:(e,t,o)=>{"use strict";o.d(t,{_:()=>g});var i=o(46114),l=o(73645),n=o(16638),a=o(68400),s=o(25562),r=o(9610),c=o(25335),d=o(10303),u=o(23597),p=o(99057),f=o(2514),h=o(63865);function m(){return(0,i.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",style:{display:"block",flexShrink:0},children:[(0,i.jsx)("path",{fill:"#4285F4",d:"M17.64 9.2c0-.637-.057-1.251-.164-1.84H9v3.481h4.844c-.209 1.125-.843 2.078-1.796 2.717v2.258h2.908c1.702-1.567 2.684-3.875 2.684-6.615z"}),(0,i.jsx)("path",{fill:"#34A853",d:"M9 18c2.43 0 4.467-.806 5.956-2.18l-2.908-2.259c-.806.54-1.837.86-3.048.86-2.344 0-4.328-1.584-5.036-3.711H.957v2.332A8.997 8.997 0 0 0 9 18z"}),(0,i.jsx)("path",{fill:"#FBBC05",d:"M3.964 10.71A5.41 5.41 0 0 1 3.682 9c0-.593.102-1.17.282-1.71V4.958H.957A8.996 8.996 0 0 0 0 9c0 1.452.348 2.827.957 4.042l3.007-2.332z"}),(0,i.jsx)("path",{fill:"#EA4335",d:"M9 3.58c1.321 0 2.508.454 3.44 1.345l2.582-2.58C13.463.891 11.426 0 9 0A8.997 8.997 0 0 0 .957 4.958L3.964 6.29C4.672 4.163 6.656 3.58 9 3.58z"})]})}function g(e){let{onSuccess:t}=e,[o,g]=(0,r.useState)(!1),{open:b}=(0,p.Zz)(),v=(0,u.jE)(),x=(0,f.useRouter)(),S=(0,r.useMemo)(()=>(function(){var e,t;let o=window.Capacitor;return(null==o?void 0:null===(e=o.isNativePlatform)||void 0===e?void 0:e.call(o))===!0&&(null==o?void 0:null===(t=o.getPlatform)||void 0===t?void 0:t.call(o))==="android"})(),[]);async function y(e){let o="ri-hub";document.cookie="".concat(o,"-accessToken=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=.ri-hub.it"),document.cookie="".concat(o,"-refreshToken=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=.ri-hub.it"),document.cookie="".concat(o,"-accessToken=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=ri-hub.it"),document.cookie="".concat(o,"-refreshToken=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=ri-hub.it");let i=await c.R.signInWithGoogle(e);d.j.setTokens(i.data),v.clear();let l=d.j.getDecodedAccessToken();(null==l?void 0:l.UserType)==="Customer"?x.push("/hub"):(null==l?void 0:l.UserType)==="Physiotherapist"&&x.push("/physiotherapist/appointments"),b({message:"Accesso effettuato con successo",severity:"success"}),null==t||t()}async function w(){g(!0);try{var e,t;await h.k.initialize({clientId:"435803480118-biioe561dvn2redev1475t9mcgk2qer9.apps.googleusercontent.com",scopes:["openid","email","profile"],grantOfflineAccess:!1});let o=await h.k.signIn(),i=null===(e=o.authentication)||void 0===e?void 0:e.idToken,l=null===(t=o.authentication)||void 0===t?void 0:t.accessToken;if(!i&&!l)throw Error("Google non ha restituito alcun token");await y({idToken:i,accessToken:l})}catch(t){let e=t instanceof Error?t.message:String(t);console.error("[GoogleSignIn Android] errore:",t),b({message:"Accesso Google non riuscito: ".concat(e),severity:"error"})}finally{g(!1)}}let k=(0,n.mg)({onSuccess:async e=>{g(!0);try{await y({accessToken:e.access_token})}catch(e){b({message:"Accesso Google non riuscito",severity:"error"})}finally{g(!1)}},onError:()=>{b({message:"Accesso Google annullato",severity:"error"})},scope:"openid email profile"});return(0,i.jsx)(a.default,{fullWidth:!0,variant:"text",onClick:()=>S?w():k(),disabled:o,startIcon:o?(0,i.jsx)(s.default,{size:18}):(0,i.jsx)(m,{}),sx:{height:46,bgcolor:"#fff",border:"1.5px solid #dadce0",borderRadius:"12px",color:"rgba(0,0,0,0.75)",textTransform:"none",fontWeight:500,fontSize:l.ZN.size.small,letterSpacing:.1,boxSh
1adow:"0 1px 4px rgba(0,0,0,0.08)","&:hover":{bgcolor:"#f8f9fa",border:"1.5px solid #c4c7cc",boxShadow:"0 2px 8px rgba(0,0,0,0.10)"},"&:active":{bgcolor:"#f1f3f4"},"&.Mui-disabled":{bgcolor:"#fff",border:"1.5px solid #dadce0",opacity:.65}},children:"Continua con Google"})}},25335:(e,t,o)=>{"use strict";o.d(t,{R:()=>n});class i extends Error{constructor(e,t){super("Auth request failed"),this.name="AuthProxyError",this.response={status:e,data:t}}}async function l(e,t){let o=await fetch("/api/auth/".concat(e),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t),cache:"no-store"}),l=await o.text(),n=null;if(l)try{n=JSON.parse(l)}catch(e){n=l}if(!o.ok)throw new i(o.status,n);return{data:n}}let n={signIn:e=>l("sign-in",e),signInWithGoogle:e=>l("sign-in-google",e),signInWithApple:e=>l("sign-in-apple",e),register:e=>l("register",e)}},13515:(e,t,o)=>{"use strict";o.d(t,{Cd:()=>d,Qp:()=>a,st:()=>c,sw:()=>r});var i=o(83075),l=o(97233);function n(e,t){try{i.Ay.capture(e,t)}catch(e){}}function a(e,t,o){n("flow_".concat(e,"_").concat(t),o)}let s=null;function r(e,t){n("visita_funnel_".concat(e),t);try{let o=(0,l.C_)(),i=(null==o?void 0:o.utmSource)&&String(o.utmSource)||"organic",n={};if(t)for(let e of["zona","field","missing","variant"])void 0!==t[e]&&(n[e]=t[e]);(null==o?void 0:o.utmCampaign)&&(n.campaign=String(o.utmCampaign).slice(0,80));try{let e=window.localStorage.getItem("ri_ab_intro");("on"===e||"off"===e)&&(n.ab_intro=e)}catch(e){}let a=JSON.stringify({step:e,source:i,sid:function(){if(!s)try{s=crypto.randomUUID()}catch(e){s="a"+Math.random().toString(36).slice(2)+Date.now().toString(36)}return s}(),meta:n});navigator.sendBeacon?navigator.sendBeacon("/api/funnel-beacon",new Blob([a],{type:"application/json"})):fetch("/api/funnel-beacon",{method:"POST",body:a,keepalive:!0,headers:{"Content-Type":"application/json"}}).catch(()=>{})}catch(e){}}function c(){return{imparaView(e){n("impara_view",{user_state:null!=e?e:"Guest"})},imparaScroll(e,t){n("impara_scroll",{depth:e,user_state:null!=t?t:"Guest"})},imparaClickFeatured(e,t,o){n("impara_click_featured",{slug:e,position:t,personalized:o})},vfStart(e){n("vf_start",{total_questions:e})},vfAnswer(e,t,o,i){n("vf_answer",{question_id:e,correct:t,index:o,total_questions:i})},vfComplete(e,t,o){n("vf_complete",{score:e,total_questions:t,accuracy:o})},vfCtaClick(e,t){n("vf_cta_click",{user_state:null!=e?e:"Guest",cta_type:t})},imparaClickFull(e,t){n("impara_click_full",{slug:e,started:t})},imparaClickQuick(e){n("impara_click_quick",{slug:e})},imparaClickFaq(e){n("impara_click_faq",{question_id:e})},imparaCtaClick(e,t){n("impara_cta_click",{user_state:null!=e?e:"Guest",cta_type:t})},imparaClickHero(e,t){n("impara_click_hero",{slug:e,progress_pct:t})},imparaTimeSpent(e,t){n("impara_time_spent",{seconds:e,user_state:null!=t?t:"Guest"})},percorsoView(e,t){n("percorso_view",{slug:e,source:t})},vfAbandon(e,t){n("vf_abandon",{index:e,total_questions:t})},vfTimeSpent(e,t){n("vf_time_spent",{seconds:e,completed:t})}}}function d(e){return"Active"===e||"InTreatment"===e?"continua":"CycleCompleted"===e?"rivedi":"Eligible"===e||"PendingPurchase"===e?"acquista":"AnamnesisBooked"===e||"AwaitingEvaluation"===e?"prenotazione":"prenota"}},18049:(e,t,o)=>{"use strict";o.d(t,{A:()=>c,w:()=>r});var i=o(9610),l=o(78113),n=o(81613),a=o(37163),s=o(46090);function r(e){let t=(0,l.useLocale)(),o=(0,n.useRouter)();(0,i.useEffect)(()=>{e&&s.pe.includes(e)&&t!==e&&(a.A.set("NEXT_LOCALE",e,{path:"/",sameSite:"lax"}),o.refresh())},[e,t,o])}function c(e){a.A.set("NEXT_LOCALE",e,{path:"/",sameSite:"lax"}),window.location.reload()}},97233:(e,t,o)=>{"use strict";o.d(t,{$H:()=>a,C_:()=>n,Ct:()=>s,RP:()=>r,vu:()=>l});let i="ri_utm";function l(){var e,t,o,l,n,a,s,r;let c=new URLSearchParams(window.location.search),d=null!==(e=c.get("utm_source"))&&void 0!==e?e:void 0,u=null!==(t=c.get("utm_medium"))&&void 0!==t?t:void 0,p=null!==(o=c.get("utm_campaign"))&&void 0!==o?o:void 0,f=null!==(l=c.get("utm_content"))&&void 0!==l?l:void 0,h=null!==(n=c.get("utm_term"))&&void 0!==n?n:void 0,m=null!==(a=c.get("fbclid"))&&void 0!==a?a:void 0,g=null!==(s=c.get("gclid"))&&void 0!==s?s:void 0,b=null!==(r=c.get("ttclid"))&&void 0!==r?r:void 0;if(![d,u,p,m,g,b].some(Boolean))return;let v={utmSource:d,utmMedium:u,utmCampaign:p,utmContent:f,utmTerm:h,fbclid:m,gclid:g,ttclid:b,referrer:document.referrer||void 0,capturedAt:Date.now()};
1Object.keys(v).forEach(e=>{void 0===v[e]&&delete v[e]});try{localStorage.setItem(i,JSON.stringify(v))}catch(e){}}function n(){try{var e;let t=null!==(e=function(){if("undefined"==typeof document)return null;let e=document.cookie.match(/(?:^|;\s*)ri_utm=([^;]+)/);return e?decodeURIComponent(e[1]):null}())&&void 0!==e?e:localStorage.getItem(i);if(!t)return null;let o=JSON.parse(t);if(Date.now()-o.capturedAt>2592e6)return localStorage.removeItem(i),null;let{capturedAt:l,...n}=o;return n}catch(e){return null}}function a(){return"undefined"!=typeof crypto&&"randomUUID"in crypto?crypto.randomUUID():"".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2))}function s(){if("undefined"==typeof document)return{};let e={},t=document.cookie.match(/(?:^|;\s*)_fbc=([^;]+)/),o=document.cookie.match(/(?:^|;\s*)_fbp=([^;]+)/);return t&&(e.fbc=decodeURIComponent(t[1])),o&&(e.fbp=decodeURIComponent(o[1])),e}function r(){let e=n();if(!e)return{};let t={};return e.utmSource&&(t.utmSource=e.utmSource),e.utmMedium&&(t.utmMedium=e.utmMedium),e.utmCampaign&&(t.utmCampaign=e.utmCampaign),e.utmContent&&(t.utmContent=e.utmContent),e.utmTerm&&(t.utmTerm=e.utmTerm),e.fbclid&&(t.fbclid=e.fbclid),e.gclid&&(t.gclid=e.gclid),t}},46090:(e,t,o)=>{"use strict";o.d(t,{Fc:()=>l,IB:()=>n,NS:()=>a,ZH:()=>s,pe:()=>i});let i=["it","en","fr","de","es","pt","nl","pl","ro","uk","ru","sq","zh","tr","el","sv","no","da","fi","hr","sr","bg","cs","sk","hu"],l=[{code:"it",flag:"\uD83C\uDDEE\uD83C\uDDF9",label:"Italiano",labelIt:"Italiano",isAppSupported:!0,isSessionSupported:!0},{code:"en",flag:"\uD83C\uDDEC\uD83C\uDDE7",label:"English",labelIt:"Inglese",isAppSupported:!0,isSessionSupported:!0},{code:"fr",flag:"\uD83C\uDDEB\uD83C\uDDF7",label:"Fran\xe7ais",labelIt:"Francese",isAppSupported:!0,isSessionSupported:!0},{code:"de",flag:"\uD83C\uDDE9\uD83C\uDDEA",label:"Deutsch",labelIt:"Tedesco",isAppSupported:!0,isSessionSupported:!0},{code:"es",flag:"\uD83C\uDDEA\uD83C\uDDF8",label:"Espa\xf1ol",labelIt:"Spagnolo",isAppSupported:!0,isSessionSupported:!0},{code:"pt",flag:"\uD83C\uDDF5\uD83C\uDDF9",label:"Portugu\xeas",labelIt:"Portoghese",isAppSupported:!0,isSessionSupported:!0},{code:"nl",flag:"\uD83C\uDDF3\uD83C\uDDF1",label:"Nederlands",labelIt:"Olandese",isAppSupported:!0,isSessionSupported:!0},{code:"pl",flag:"\uD83C\uDDF5\uD83C\uDDF1",label:"Polski",labelIt:"Polacco",isAppSupported:!0,isSessionSupported:!0},{code:"ro",flag:"\uD83C\uDDF7\uD83C\uDDF4",label:"Rom\xe2nÄ",labelIt:"Rumeno",isAppSupported:!0,isSessionSupported:!0},{code:"uk",flag:"\uD83C\uDDFA\uD83C\uDDE6",label:"УкÑаÑнÑÑка",labelIt:"Ucraino",isAppSupported:!0,isSessionSupported:!0},{code:"ru",flag:"\uD83C\uDDF7\uD83C\uDDFA",label:"Ð ÑÑÑкий",labelIt:"Russo",isAppSupported:!0,isSessionSupported:!0},{code:"sq",flag:"\uD83C\uDDE6\uD83C\uDDF1",label:"Shqip",labelIt:"Albanese",isAppSupported:!0,isSessionSupported:!0},{code:"ar",flag:"\uD83C\uDDF8\uD83C\uDDE6",label:"Ø§ÙØ¹Ø±Ø¨ÙØ©",labelIt:"Arabo",isAppSupported:!1,isSessionSupported:!0,isRtl:!0},{code:"zh",flag:"\uD83C\uDDE8\uD83C\uDDF3",label:"䏿",labelIt:"Cinese",isAppSupported:!0,isSessionSupported:!0},{code:"tr",flag:"\uD83C\uDDF9\uD83C\uDDF7",label:"T\xfcrk\xe7e",labelIt:"Turco",isAppSupported:!0,isSessionSupported:!0},{code:"el",flag:"\uD83C\uDDEC\uD83C\uDDF7",label:"Îλληνικά",labelIt:"Greco",isAppSupported:!0,isSessionSupported:!0},{code:"sv",flag:"\uD83C\uDDF8\uD83C\uDDEA",label:"Svenska",labelIt:"Svedese",isAppSupported:!0,isSessionSupported:!0},{code:"no",flag:"\uD83C\uDDF3\uD83C\uDDF4",label:"Norsk",labelIt:"Norvegese",isAppSupported:!0,isSessionSupported:!0},{code:"da",flag:"\uD83C\uDDE9\uD83C\uDDF0",label:"Dansk",labelIt:"Danese",isAppSupported:!0,isSessionSupported:!0},{code:"fi",flag:"\uD83C\uDDEB\uD83C\uDDEE",label:"Suomi",labelIt:"Finlandese",isAppSupported:!0,isSessionSupported:!0},{code:"hr",flag:"\uD83C\uDDED\uD83C\uDDF7",label:"Hrvatski",labelIt:"Croato",isAppSupported:!0,isSessionSupported:!0},{code:"sr",flag:"\uD83C\uDDF7\uD83C\uDDF8",label:"Srpski",labelIt:"Serbo",isAppSupported:!0,isSessionSupported:!0}
1,{code:"bg",flag:"\uD83C\uDDE7\uD83C\uDDEC",label:"ÐÑлгаÑÑки",labelIt:"Bulgaro",isAppSupported:!0,isSessionSupported:!0},{code:"cs",flag:"\uD83C\uDDE8\uD83C\uDDFF",label:"ÄeÅ¡tina",labelIt:"Ceco",isAppSupported:!0,isSessionSupported:!0},{code:"sk",flag:"\uD83C\uDDF8\uD83C\uDDF0",label:"SlovenÄina",labelIt:"Slovacco",isAppSupported:!0,isSessionSupported:!0},{code:"hu",flag:"\uD83C\uDDED\uD83C\uDDFA",label:"Magyar",labelIt:"Ungherese",isAppSupported:!0,isSessionSupported:!0}],n=l,a=Object.fromEntries(l.map(e=>[e.code,e.label])),s=Object.fromEntries(l.map(e=>[e.code,e.labelIt]))}},e=>{var t=t=>e(e.s=t);e.O(0,[5880,1829,5830,102,5143,4040,9465,5564,9294,8400,1831,3304,4596,1379,5648,417,8094,6140,9485,9430,899,3464,6187,7358],()=>t(58996)),_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.