PageSourceSearch

https://fusion-scaled-offers.lovable.app/assets/Account-DMDDSfAs.js

js fusion-scaled-offers.lovable.app collected 2026-10-03 05:35:51 UTC 3,946 bytes, 1 lines download raw bytes

1import{r as i,j as e}from"./index-CoRPa_GW.js";import{D as y}from"./DynamicAdminLayout-Bf5kpZa5.js";import{u as C,a as A,S as P,i as k,s as f,t}from"./App-CnbRrfid.js";import{C as n,B as L}from"./card-BTapF3ZV.js";import{B as d}from"./button-DV39FNbu.js";import{I as o}from"./input-CHWDhEVC.js";import{L as l}from"./label-D7wrxlL-.js";import{S as E}from"./save-BBAZWDah.js";import{L as B}from"./lock-Djtij_cN.js";import"./ClientLayout-BXQeVWGI.js";import"./separator-DWyThSUJ.js";import"./textarea-CDtAhSsa.js";import"./loader-circle-b9AoQWIo.js";import"./circle-check-C-78IGai.js";import"./video-BiVugTSr.js";import"./image-C6vcOOYn.js";import"./useCoins-AlX_X59Z.js";import"./index-1ZKsPIKv.js";import"./check-CNxG2g7T.js";import"./caktoPlans-22zHpc9a.js";import"./index-CitIWBdz.js";import"./zap-CMHg2pi5.js";import"./bug-C6VCqrk5.js";import"./image-plus-xXXm-yA9.js";import"./clock-ToC92w5Y.js";import"./eye-8CNtrYkx.js";import"./mail-cRzXfCa5.js";import"./mic-P5TiG5SV.js";import"./layers-B6kKoSqO.js";import"./ChunkLoadErrorBoundary-BcQkPOhI.js";const ne=()=>{const{user:a,logout:j,isSuperAdmin:m}=C(),g=A(),[c,N]=i.useState((a==null?void 0:a.name)||""),[p,h]=i.useState(!1),[r,u]=i.useState(""),[x,v]=i.useState(!1),S=async()=>{await j(),g("/login")},w=async()=>{if(!a)return;h(!0);const{error:s}=await f.from("profiles").update({name:c}).eq("id",a.id);h(!1),s?t({title:"Erro ao salvar",description:s.message,variant:"destructive"}):t({title:"Perfil atualizado",description:"Seu nome foi salvo com sucesso."})},b=async()=>{if(!r||r.length<6){t({title:"Senha inválida",description:"A senha deve ter pelo menos 6 caracteres.",variant:"destructive"});return}v(!0);const{error:s}=await f.auth.updateUser({password:r});v(!1),s?t({title:"Erro ao alterar senha",description:s.message,variant:"destructive"}):(u(""),t({title:"Senha alterada",description:"Sua senha foi atualizada com sucesso."}))};return e.jsx(y,{children:e.jsxs("div",{className:"space-y-6 max-w-2xl",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:"Conta"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Configurações da sua conta"})]}),e.jsxs(n,{className:"p-5 space-y-4",children:[e.jsx("h2",{className:"font-semibold",children:"Informações do Perfil"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx(l,{children:"Nome"}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx(o,{value:c,onChange:s=>N(s.target.value),placeholder:"Seu nome"}),e.jsxs(d,{onClick:w,disabled:p,className:"gap-2 shrink-0",children:[e.jsx(E,{className:"h-4 w-4"}),p?"Salvando...":"Salvar"]})]})]}),e.jsxs("div",{children:[e.jsx(l,{children:"Email"}),e.jsx(o,{value:(a==null?void 0:a.email)||"",readOnly:!0,className:"bg-muted cursor-not-allowed mt-1"})]}),e.jsxs("div",{children:[e.jsx(l,{children:"Função"}),e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsx(o,{value:m?"Super Administrador":"Administrador",readOnly:!0,className:"bg-muted cursor-not-allowed"}),m&&e.jsxs(L,{className:"bg-gradient-to-r from-amber-500 to-orange-500 text-white border-0 font-semibold gap-1 shrink-0",children:[e.jsx(P,{className:"h-3 w-3"}),"Super Admin"]})]})]})]})]}),e.jsxs(n,{className:"p-5 space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(B,{className:"h-4 w-4 text-primary"}),e.jsx("h2",{className:"font-semibold",children:"Alterar Senha"})]}),e.jsxs("div",{children:[e.jsx(l,{children:"Nova Senha"}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx(o,{type:"password",value:r,onChange:s=>u(s.target.value),placeholder:"••••••••"}),e.jsx(d,{onClick:b,disabled:x,variant:"outline",className:"shrink-0",children:x?"Salvando...":"Alterar"})]})]})]}),e.jsx(n,{className:"p-5",children:e.jsxs(d,{variant:"destructive",onClick:S,className:"gap-2",children:[e.jsx(k,{className:"h-4 w-4"}),"Sair da Conta"]})})]})})};export{ne 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.