1"use strict";(self.webpackChunkmy_app=self.webpackChunkmy_app||[]).push([[188],{129:(e,n,r)=>{r.d(n,{CF:()=>l,Hh:()=>s,_z:()=>d,ez:()=>p,iD:()=>i,z5:()=>c});var t=r(78);const a="".concat("https://pitiquito.net/ch1"),o=t.A.create({baseURL:a}),s=e=>o.post("/api/auth/register",e),i=e=>o.post("/api/auth/login",e),c=(e,n)=>o.post("/api/auth/setAvatar/".concat(e),{image:n}),l=e=>o.get("/api/auth/allUsers/".concat(e)),d=function(e,n,r){let t=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";o.post("/api/messages/addMessage",{from:e,to:n,message:r,image:t})},p=(e,n)=>o.post("api/messages/getMessages",{from:e,to:n})},146:(e,n,r)=>{r.d(n,{A:()=>i});var t,a=r(119),o=(r(405),r(12)),s=r(249);function i(e){let{width:n,height:r}=e;return(0,s.jsx)(c,{className:"spinner"})}const c=o.Ay.div(t||(t=(0,a.A)(["\n width: 20px;\n height: 20px;\n border: 2px solid #FFF;\n border-bottom-color: transparent;\n border-radius: 50%;\n display: inline-block;\n box-sizing: border-box;\n animation: rotation 1s linear infinite;\n\n @keyframes rotation {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n } \n "])))},188:(e,n,r)=>{r.r(n),r.d(n,{default:()=>f});var t,a=r(119),o=r(501),s=r(405),i=r(598),c=r(909),l=r(12),d=r(882),p=r(248),m=(r(966),r(146)),u=r(129),h=r(249);const g=l.Ay.div(t||(t=(0,a.A)(["\n height: 100vh;\n width: 100vw;\n display: flex;\n flex-direction: column;\n justify-content: center;\n gap: 1rem;\n align-items: center;\n background-color: #131324;\n .brand {\n display: flex;\n align-items: center;\n gap: 1rem;\n justify-content: center;\n img {\n height: 5rem;\n }\n h1 {\n color: white;\n text-transform: uppercase;\n }\n }\n form {\n display: flex;\n flex-direction: column;\n gap: 2rem;\n background-color: #00000076;\n border-radius: 0.8rem;\n padding: 3rem 5rem;\n }\n input {\n background-color: transparent;\n padding: 1rem;\n border: 0.1rem solid #4e0eff;\n border-radius: 0.4rem;\n color: white;\n width: 100%;\n font-size: 1rem;\n &:focus {\n border: 0.1rem solid #997af0;\n outline: none;\n }\n }\n button {\n background-color: #4e0eff;\n color: white;\n padding: 1rem 2rem;\n border: none;\n font-weight: bold;\n cursor: pointer;\n border-radius: 0.4rem;\n font-size: 1rem;\n text-transform: uppercase;\n &:hover {\n background-color: #4e0eff;\n }\n }\n span {\n color: white;\n text-transform: uppercase;\n a {\n color: #4e0eff;\n text-decoration: none;\n font-weight: bold;\n }\n }\n"]))),f=()=>
1{const e=(0,i.Zp)(),[n,r]=(0,s.useState)(!1),[t,a]=(0,s.useState)(!1),l={position:"bottom-right",autoClose:8e3,pauseOnHover:!0,draggable:!0,theme:"dark"},[f,b]=(0,s.useState)({username:"",email:"",password:"",confirmPassword:""});(0,s.useEffect)(()=>{localStorage.getItem("chat-app-user")&&e("/chat")},[e]);const x=()=>{const{password:e,confirmPassword:n,username:r,email:t}=f;return e!==n?(p.oR.error("No son iguales...",l),!1):r.length<4?(p.oR.error("Debe tener al - 4 caracteres",l),!1):e.length<8?(p.oR.error("Debe de tener al - 8 caracteres",l),!1):""!==t||(p.oR.error("Se ocupa el correo",l),!1)};return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(g,{children:(0,h.jsxs)("form",{onSubmit:t=>(async t=>{a(!0),t.preventDefault();try{if(x()){const{password:n,username:r,email:t}=f,{data:a}=await(0,u.Hh)({password:n,username:r,email:t});!1===a.status&&p.oR.error(a.msg,l),!0===a.status&&(localStorage.setItem("chat-app-user",JSON.stringify(a.user)),e("/setAvatar"))}}catch(n){r(!0),p.oR.error("Something went wrong.",l)}finally{a(!1)}})(t),children:[(0,h.jsx)("div",{className:"brand",children:(0,h.jsxs)("a",{href:"https://pitiquito.net/chat",children:[(0,h.jsx)("img",{src:d.A,alt:"logo"}),(0,h.jsx)("h1",{children:"Piti chat"})]})}),(0,h.jsx)("input",{type:"text",placeholder:"Usuario",name:"username",onChange:e=>b((0,o.A)((0,o.A)({},f),{},{username:e.target.value}))}),(0,h.jsx)("input",{type:"email",placeholder:"Correo",name:"email",onChange:e=>b((0,o.A)((0,o.A)({},f),{},{email:e.target.value}))}),(0,h.jsx)("input",{type:"password",placeholder:"Contrase\xf1a",name:"password",onChange:e=>b((0,o.A)((0,o.A)({},f),{},{password:e.target.value}))}),(0,h.jsx)("input",{type:"password",placeholder:"Confirma contrase\xf1a",name:"confirmPassword",onChange:e=>b((0,o.A)((0,o.A)({},f),{},{confirmPassword:e.target.value}))}),(0,h.jsx)("button",{type:"submit",children:t?(0,h.jsx)(m.A,{width:"50px",height:"50px"}):"Crear usuario"}),(0,h.jsxs)("span",{children:["Ya tienes cuenta ? ",(0,h.jsx)(c.N_,{to:"/login",children:"Entra al chat."})]})]})}),(0,h.jsx)(p.N9,{})]})}},882:(e,n,r)=>{r.d(n,{A:()=>t});r(405);const t=r.p+"static/media/Logo.67f68be327ef4e69f3ed8aadda1cb2af.svg"},966:()=>{}}]);
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.