module.exports=[13207,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(50944),e=a.i(38246),f=a.i(43310);a.s(["default",0,function(){let a=(0,d.useRouter)(),[g,h]=(0,c.useState)({name:"",email:"",password:"",password_confirmation:""}),[i,j]=(0,c.useState)(""),[k,l]=(0,c.useState)(""),[m,n]=(0,c.useState)(!1),o=a=>{h({...g,[a.target.name]:a.target.value})},p=async b=>{b.preventDefault(),j(""),l(""),n(!0);try{await f.api.get("/sanctum/csrf-cookie"),await f.api.post("/api/landlord/register",g),l("Registo efetuado com sucesso! Redirecionando..."),setTimeout(()=>{a.push("/landlord/login")},2e3)}catch(c){let a=c.response?.data?.message||"Erro ao registar",b=c.response?.data?.errors;b?j(Object.values(b)[0]?.[0]||a):j(a)}finally{n(!1)}};return(0,b.jsx)("div",{className:"flex min-h-screen items-center justify-center bg-gray-50",children:(0,b.jsxs)("form",{onSubmit:p,className:"w-full max-w-md space-y-4 rounded-lg bg-white p-8 shadow-md",children:[(0,b.jsx)("h1",{className:"text-2xl font-bold text-center text-gray-800",children:"Registo Super Admin"}),i&&(0,b.jsx)("div",{className:"rounded-md bg-red-50 p-3 text-sm text-red-600",children:i}),k&&(0,b.jsx)("div",{className:"rounded-md bg-green-50 p-3 text-sm text-green-600",children:k}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:"Nome"}),(0,b.jsx)("input",{type:"text",name:"name",value:g.name,onChange:o,className:"mt-1 w-full rounded-md border border-gray-300 p-2",required:!0,disabled:m})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:"Email"}),(0,b.jsx)("input",{type:"email",name:"email",value:g.email,onChange:o,className:"mt-1 w-full rounded-md border border-gray-300 p-2",required:!0,disabled:m})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:"Password"}),(0,b.jsx)("input",{type:"password",name:"password",value:g.password,onChange:o,className:"mt-1 w-full rounded-md border border-gray-300 p-2",required:!0,disabled:m,minLength:8})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:"Confirmar Password"}),(0,b.jsx)("input",{type:"password",name:"password_confirmation",value:g.password_confirmation,onChange:o,className:"mt-1 w-full rounded-md border border-gray-300 p-2",required:!0,disabled:m})]}),(0,b.jsx)("button",{type:"submit",disabled:m,className:"w-full rounded-md bg-green-600 py-2 text-white font-semibold hover:bg-green-700 disabled:opacity-50",children:m?"A registar...":"Registar"}),(0,b.jsxs)("p",{className:"text-center text-sm text-gray-600",children:["Já tem conta?"," ",(0,b.jsx)(e.default,{href:"/landlord/login",className:"text-blue-600 hover:underline",children:"Faça login"})]})]})})}])}];

//# sourceMappingURL=app_landlord_register_page_tsx_0zokw-1._.js.map