PageSourceSearch

https://escortadvisor-b4fe68rl.manus.space/assets/VerificaIdentitaPage-CCphhXor.js

js escortadvisor-b4fe68rl.manus.space collected 2026-10-03 05:02:37 UTC 8,688 bytes, 6 lines download raw bytes

1import{c as E,Q as R,f as T,r as o,ab as V,t as b,q as a,j as e,N as A,m as N,P as y,as as C,B as h,ah as S,az as L}from"./index-cscxoOf9.js";import{A as O}from"./arrow-left-B9FPhhoq.js";import{C as k}from"./circle-check-so_R1iP7.js";import{R as M}from"./refresh-cw-D0KbhpJJ.js";/**
2 * @license lucide-react v0.453.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const q=E("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);function $(){const[,u]=R(),{isAuthenticated:l,loading:f}=T(),[i,c]=o.useState("phone"),[s,I]=o.useState(""),[d,p]=o.useState(""),[n,v]=o.useState(0);o.useEffect(()=>{!f&&!l&&(window.location.href=V("/verifica-identita"))},[f,l]),o.useEffect(()=>{if(n<=0)return;const t=setTimeout(()=>v(x=>x-1),1e3);return()=>clearTimeout(t)},[n]);const{data:g,refetch:P}=b.verification.getMyStatus.useQuery(void 0,{enabled:l,retry:!1});o.useEffect(()=>{g?.level1Status==="verified"&&c("done")},[g]);const r=b.verification.requestOtp.useMutation({onSuccess:()=>{c("otp"),v(60),a.success("Codice OTP inviato!",{description:"Controlla i tuoi messaggi. Il codice è valido per 10 minuti."})},onError:t=>{a.error("Errore nell'invio del codice",{description:t.message})}}),m=b.verification.verifyOtp.useMutation({onSuccess:()=>{c("done"),P(),a.success("🎉 Numero verificato!",{description:"Il tuo profilo ora mostra il badge di verifica telefono.",duration:5e3})},onError:t=>{a.error("Codice non valido",{description:t.message}),p("")}}),w=()=>
6{if(!s.trim()){a.error("Inserisci un numero di telefono valido");return}r.mutate({phoneNumber:s.trim()})},j=()=>{if(d.length!==6){a.error("Il codice OTP deve essere di 6 cifre");return}m.mutate({code:d})};return!l&&!f?null:e.jsxs("div",{className:"min-h-screen bg-[oklch(0.10_0.015_280)] pt-[94px]",children:[e.jsx(A,{}),e.jsxs("main",{className:"container max-w-md py-10 pt-24 pb-20",children:[e.jsxs("button",{onClick:()=>u("/onboarding"),className:"flex items-center gap-2 text-sm text-white/40 hover:text-white/70 font-['Outfit'] mb-8 transition-colors",children:[e.jsx(O,{className:"w-4 h-4"}),"Torna all'onboarding"]}),e.jsxs("div",{className:"text-center mb-10",children:[e.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-violet-500/15 border border-violet-500/25 mb-5 mx-auto",children:e.jsx(N,{className:"w-8 h-8 text-violet-400"})}),e.jsx("h1",{className:"font-['Syne'] font-extrabold text-2xl text-white mb-2",children:"Verifica il numero di telefono"}),e.jsx("p",{className:"text-white/50 font-['Outfit'] text-sm max-w-xs mx-auto",children:"Aggiungi il badge 🔐 al tuo profilo e aumenta la fiducia degli utenti."})]}),e.jsx("div",{className:"flex items-center gap-2 mb-8",children:["phone","otp","done"].map((t,x)=>e.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[e.jsx("div",{className:`w-7 h-7 rounded-full flex items-center justify-center text-xs font-['Syne'] font-bold transition-all ${i===t?"bg-violet-500 text-white":i==="otp"&&t==="phone"||i==="done"?"bg-emerald-500/20 text-emerald-400 border border-emerald-500/30":"bg-white/5 text-white/30"}`,children:i==="otp"&&t==="phone"||i==="done"&&t!=="done"?e.jsx(k,{className:"w-3.5 h-3.5"}):x+1}),e.jsx("span",{className:`text-xs font-['Outfit'] ${i===t?"text-white/70":"text-white/25"}`,children:t==="phone"?"Numero":t==="otp"?"Codice":"Verificato"}),x<2&&e.jsx("div",{className:"flex-1 h-px bg-white/10"})]},t))}),i==="phone"&&e.jsxs("div",{className:"bg-[#111118] border border-white/10 rounded-2xl p-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-5",children:[e.jsx(y,{className:"w-4 h-4 text-violet-400"}),e.jsx("h2",{className:"font-['Syne'] font-bold text-sm text-white",children:"Inserisci il tuo numero"})]}),e.jsx("p",{className:"text-xs text-white/40 font-['Outfit'] mb-4 leading-relaxed",children:"Riceverai un codice OTP a 6 cifre via SMS per confermare il numero. Il numero non sarà visibile pubblicamente."}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(C,{type:"tel",placeholder:"+39 333 123 4567",value:s,onChange:t=>I(t.target.value),onKeyDown:t=>t.key==="Enter"&&w(),className:"h-12 bg-white/5 border-white/10 text-white placeholder:text-white/25 font-['Outfit'] focus-visible:ring-violet-500/50 focus-visible:border-violet-500/50"}),e.jsx(h,{onClick:w,disabled:r.isPending||!s.trim(),className:"w-full h-12 bg-gradient-to-r from-violet-500 to-violet-600 hover:from-violet-400 hover:to-violet-500 text-white font-['Syne'] font-bold rounded-xl gap-2 disabled:opacity-50",children:r.isPending?e.jsxs(e.Fragment,{children:[e.jsx(S,{className:"w-4 h-4 animate-spin"})," Invio in corso..."]}):e.jsxs(e.Fragment,{children:[e.jsx(y,{className:"w-4 h-4"})," Invia codice OTP"]})})]})]}),i==="otp"&&e.jsxs("div",{className:"bg-[#111118] border border-white/10 rounded-2xl p-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-5",children:[e.jsx(q,{className:"w-4 h-4 text-violet-400"}),e.jsx("h2",{className:"font-['Syne'] font-bold text-sm text-white",children:"Inserisci il codice OTP"})]}),e.jsx("p",{className:"text-xs text-white/40 font-['Outfit'] mb-1 leading-relaxed",children:"Abbiamo inviato un codice a 6 cifre al numero"}),e.jsx("p",{className:"text-sm text-white/70 font-['Syne'] font-semibold mb-5",children:s}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(C,{type:"text",inputMode:"numeric",maxLength:6,placeholder:"000000",value:d,onChange:t=>p(t.target.value.replace(/\D/g,"").slice(0,6)),onKeyDown:t=>t.key==="Enter"&&j(),className:"h-14 bg-white/5 border-white/10 text-white text-center text-2xl tracking-[0.5em] placeholder:text-white/15 font-['Syne'] font-bold focus-visible:ring-violet-500/50 focus-visible:border-violet-500/50"}),m.isError&&e.jsxs("div",{className:"flex items-center gap-2 text-rose-400 text-xs font-['Outfit']",children:[e.jsx(L,{className:"w-3.5 h-3.5"}),"Codice non valido o scaduto. Riprova."]}),e.jsx(h,{onClick:j,disabled:m.isPending||d.length!==6,className:"w-full h-12 bg-gradient-to-r from-violet-500 to-violet-600 hover:from-violet-400 hover:to-violet-500 text-white font-['Syne'] font-bold rounded-xl gap-2 disabled:opacity-50",children:m.isPending?e.jsxs(e.Fragment,{children:[e.jsx(S,{className:"w-4 h-4 animate-spin"})," Verifica in corso..."]}):e.jsxs(e.Fragment,{children:[e.jsx(N,{className:"w-4 h-4"})," Verifica numero"]})}),e.jsxs("div",{className:"flex items-center justify-between pt-2",children:[e.jsx("button",{onClick:()=>c("phone"),className:"text-xs text-white/30 hover:text-white/60 font-['Outfit'] transition-colors",children:"Cambia numero"}),e.jsxs("button",{onClick:()=>{r.mutate({phoneNumber:s})},disabled:n>0||r.isPending,className:"flex items-center gap-1.5 text-xs text-violet-400 hover:text-violet-300 font-['Outfit'] transition-colors disabled:text-white/20 disabled:cursor-not-allowed",children:[e.jsx(M,{className:"w-3 h-3"}),n>0?`Rinvia tra ${n}s`:"Rinvia codice"]})]})]})]}),i==="done"&&e.jsxs("div",{className:"bg-emerald-500/8 border border-emerald-500/25 rounded-2xl p-8 text-center",children:[e.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-emerald-500/20 border border-emerald-500/30 mb-5 mx-auto",children:e.jsx(k,{className:"w-8 h-8 text-emerald-400"})}),e.jsx("h2",{className:"font-['Syne'] font-extrabold text-xl text-white mb-2",children:"Numero verificato! 🔐"}),e.jsx("p",{className:"text-white/50 font-['Outfit'] text-sm mb-6",children:"Il tuo profilo ora mostra il badge di verifica telefono. Gli utenti possono fidarsi di più del tuo annuncio."}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs(h,{onClick:()=>u("/onboarding"),className:"h-11 bg-gradient-to-r from-emerald-500 to-emerald-600 hover:from-emerald-400 hover:to-emerald-500 text-white font-['Syne'] font-bold rounded-xl gap-2",children:[e.jsx(O,{className:"w-4 h-4"}),"Torna all'onboarding"]}),e.jsx(h,{onClick:()=>u("/dashboard"),variant:"outline",className:"h-11 bg-transparent border-white/10 hover:border-white/20 text-white/60 hover:text-white font-['Syne'] font-semibold rounded-xl",children:"Vai alla dashboard"})]})]}),i!=="done"&&e.jsx("p",{className:"text-center text-xs text-white/25 font-['Outfit'] mt-6 leading-relaxed",children:"🔒 Il numero di telefono non sarà mai mostrato pubblicamente sul tuo profilo. Viene utilizzato esclusivamente per la verifica dell'identità."})]})]})}export{$ as default};

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.