(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[11],{7470:function(e,t,r){Promise.resolve().then(r.bind(r,564))},9376:function(e,t,r){"use strict";var n=r(5475);r.o(n,"useRouter")&&r.d(t,{useRouter:function(){return n.useRouter}})},257:function(e,t,r){"use strict";var n,o;e.exports=(null==(n=r.g.process)?void 0:n.env)&&"object"==typeof(null==(o=r.g.process)?void 0:o.env)?r.g.process:r(4227)},4227:function(e){!function(){var t={229:function(e){var t,r,n,o=e.exports={};function s(){throw Error("setTimeout has not been defined")}function a(){throw Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===s||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:s}catch(e){t=s}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var l=[],c=!1,u=-1;function d(){c&&n&&(c=!1,n.length?l=n.concat(l):u=-1,l.length&&f())}function f(){if(!c){var e=i(d);c=!0;for(var t=l.length;t;){for(n=l,l=[];++u1)for(var r=1;r{t.preventDefault(),p(!0),m("");try{let t=l.env.NEXT_PUBLIC_API_URL||"",n=await fetch("".concat(t,"/api/auth/register"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,email:r,password:u})}),o=await n.json();if(!n.ok)throw Error(o.detail||"Erro ao criar conta");g(o.access_token,o.user),x.push("/scan")}catch(e){m(e.message||"Erro ao criar conta")}finally{p(!1)}};return(0,n.jsxs)("div",{className:"min-h-screen bg-dark flex items-center justify-center px-4 relative overflow-hidden",children:[(0,n.jsx)("div",{className:"orb orb-primary w-[400px] h-[400px] -top-[150px] -left-[100px]"}),(0,n.jsx)("div",{className:"orb orb-accent w-[300px] h-[300px] bottom-[10%] -right-[100px]"}),(0,n.jsxs)("div",{className:"relative z-10 w-full max-w-md animate-fade-up",children:[(0,n.jsxs)("div",{className:"text-center mb-10",children:[(0,n.jsx)("div",{className:"w-16 h-16 rounded-2xl bg-gradient-to-br from-primary to-accent flex items-center justify-center mx-auto mb-4",children:(0,n.jsxs)("svg",{width:"30",height:"30",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"2.5",strokeLinecap:"round",children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,n.jsx)("circle",{cx:"12",cy:"12",r:"4"})]})}),(0,n.jsx)("h1",{className:"text-3xl font-black gradient-text",children:"ALETHEIA"}),(0,n.jsx)("p",{className:"text-gray-500 text-sm mt-1",children:"Comece a ver a verdade"})]}),(0,n.jsxs)("form",{onSubmit:b,className:"glass rounded-3xl p-10 space-y-5",children:[(0,n.jsx)("h2",{className:"text-xl font-bold",children:"Criar Conta Gr\xe1tis"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm text-gray-400 mb-2",children:"Nome"}),(0,n.jsx)("input",{type:"text",value:e,onChange:e=>t(e.target.value),required:!0,className:"w-full px-4 py-3.5 rounded-xl bg-dark border border-dark-border text-white placeholder-gray-600 focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary/30 transition",placeholder:"Seu nome"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm text-gray-400 mb-2",children:"Email"}),(0,n.jsx)("input",{type:"email",value:r,onChange:e=>c(e.target.value),required:!0,className:"w-full px-4 py-3.5 rounded-xl bg-dark border border-dark-border text-white placeholder-gray-600 focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary/30 transition",placeholder:"seu@email.com"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm text-gray-400 mb-2",children:"Senha"}),(0,n.jsx)("input",{type:"password",value:u,onChange:e=>d(e.target.value),required:!0,minLength:6,className:"w-full px-4 py-3.5 rounded-xl bg-dark border border-dark-border text-white placeholder-gray-600 focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary/30 transition",placeholder:"M\xednimo 6 caracteres"})]}),f&&(0,n.jsx)("p",{className:"text-danger text-sm",children:f}),(0,n.jsx)("button",{type:"submit",disabled:h,className:"btn-glow w-full !text-center disabled:opacity-50",children:h?"Criando...":"Criar Conta Gr\xe1tis →"}),(0,n.jsxs)("p",{className:"text-center text-gray-500 text-sm",children:["J\xe1 tem conta? ",(0,n.jsx)(a.default,{href:"/login",className:"text-primary hover:underline",children:"Entrar"})]})]}),(0,n.jsx)("p",{className:"text-center text-gray-600 text-xs mt-6",children:"\uD83D\uDD12 Seus dados s\xe3o protegidos. Sem spam, sem venda de dados."})]})]})}},1768:function(e,t,r){"use strict";let n;r.d(t,{t:function(){return c}});var o=r(2265);let s=e=>{let t;let r=new Set,n=(e,n)=>{let o="function"==typeof e?e(t):e;if(!Object.is(o,t)){let e=t;t=(null!=n?n:"object"!=typeof o||null===o)?o:Object.assign({},t,o),r.forEach(r=>r(t,e))}},o=()=>t,s={setState:n,getState:o,getInitialState:()=>a,subscribe:e=>(r.add(e),()=>r.delete(e))},a=t=e(n,o,s);return s},a=e=>e?s(e):s,i=e=>e,l=e=>{let t=a(e),r=e=>(function(e,t=i){let r=o.useSyncExternalStore(e.subscribe,o.useCallback(()=>t(e.getState()),[e,t]),o.useCallback(()=>t(e.getInitialState()),[e,t]));return o.useDebugValue(r),r})(t,e);return Object.assign(r,t),r},c=(n=e=>({user:null,token:null,setAuth:(t,r)=>{localStorage.setItem("token",t),localStorage.setItem("user",JSON.stringify(r)),e({token:t,user:r})},logout:()=>{localStorage.removeItem("token"),localStorage.removeItem("user"),e({token:null,user:null})},hydrate:()=>{let t=localStorage.getItem("token"),r=localStorage.getItem("user");t&&r&&e({token:t,user:JSON.parse(r)})}}))?l(n):l}},function(e){e.O(0,[648,971,117,744],function(){return e(e.s=7470)}),_N_E=e.O()}]);