1import{e as q,f as B,u as O,t as i,r as C,g as o,j as a,L as h}from"./index-DG8YForO.js";import{t as Q,e as D,d as V}from"./dateUtils-B1EXsZDh.js";import{S as u}from"./SocialLayout-_VJIUROR.js";import{S as $}from"./SocialSidebars-CRr23sKO.js";import{B as c}from"./button-BCi1_mRF.js";import{C as S,a as P}from"./card-D94XGjEe.js";import{T as G,a as H,b as j,c as b}from"./tabs-BLaF2X7F.js";import{L as U}from"./loader-circle-DGCQiY8t.js";import{C as n}from"./circle-user-BG42yKJj.js";import{C as M}from"./clock-ocDpN0Yv.js";import{M as W}from"./map-pin-xI0_FNNu.js";import{G as J}from"./globe-CgXMmtNz.js";import{C as X}from"./calendar-C_7BkO6y.js";import{S as Y}from"./square-pen-Bg5w1ONP.js";import{M as K}from"./message-circle-UBoyu4cz.js";import{F as Z}from"./file-text-B92_4zbK.js";import{U as aa}from"./users-DsX8IvdE.js";import{U as I}from"./user-check-ZINbAr1S.js";import{U as ea}from"./user-x-LAEOaQBJ.js";import{U as sa}from"./user-plus-Byezjmqi.js";import"./chevron-down-eDSqsBGr.js";import"./chevron-up-jUvwn1AA.js";import"./minus-DxiP7DNx.js";import"./x-cO8Rb8LL.js";import"./send-BKQAGlBG.js";import"./house-BH5ZnHSw.js";import"./bell-oLVisEfR.js";import"./log-out-CsFMSO7w.js";import"./newspaper-Cy553zR4.js";import"./radio--9ZStgv-.js";import"./headphones-UNkbmuoB.js";import"./wifi-BgyMp9KY.js";import"./cake-D9XfddpY.js";import"./index-_8fghGh5.js";import"./index-Y5OkxtNi.js";function Ra(){const[,A]=q("/clube-atlantida/perfil/:username"),t=A?.username||"",{member:l,isAuthenticated:N}=B(),[,F]=O(),{data:e,isLoading:k}=i.community.getProfile.useQuery({username:t},{enabled:!!t}),{data:d}=i.community.getFeed.useQuery({memberId:e?.id,page:1,limit:10},{enabled:!!e?.id}),{data:m}=i.community.getFriends.useQuery({memberId:e?.id??0,limit:12},{enabled:!!e?.id}),z=C.useMemo(()=>l?.id??0,[l?.id]),L=C.useMemo(()=>e?.id??0,[e?.id]),{data:x,refetch:v}=i.community.getFriendshipStatus.useQuery({memberAId:z,memberBId:L},{enabled:!!l&&!!e&&l.username!==t}),T=i.useUtils(),p=i.community.sendFriendRequest.useMutation({onSuccess:()=>{o.success("Pedido de amizade enviado!"),v()},onError:s=>o.error(s.message||"Erro ao enviar pedido")}),r=i.community.respondFriendRequest.useMutation({onSuccess:(s,f)=>{o.success(f.accept?"Amizade aceite!":"Pedido recusado."),v(),T.community.getFriends.invalidate()},onError:s=>o.error(s.message||"Erro")}),_=()=>{!l||!e||p.mutate({fromMemberId:l.id,toMemberId:e.id})},E=async()=>{!l||!e||F(`/clube-atlantida/mensagens?with=${e.id}`)},y=l?.username===t;if(k)return a.jsx(u,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:81",children:a.jsx("div",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:82",className:"flex items-center justify-center py-20",children:a.jsx(U,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:83",className:"w-8 h-8 animate-spin text-[#1a1a5e]"})})});if(!e)return a.jsx(u,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:91",children:a.jsxs("div",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:92",className:"text-center py-20",children:[a.jsx(n,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:93",className:"w-16 h-16 mx-auto text-gray-300 mb-4"}),a.jsx("h2",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:94",className:"text-xl font-semibold text-gray-700",children:"Membro não encontrado"}),a.jsx("p",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:95",className:"text-gray-500 mt-2",children:"Este perfil não existe ou foi removido."}),a.jsx(h,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:96",href:"/clube-atlantida/membros",children:a.jsx(c,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:97",className:"mt-4",children:"Ver Membros"})})]})});const w=e.interests?JSON.parse(e.interests):[],g=x?.status??"none",R=()=>y||!N?null:g==="friends"?a.jsxs(c,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:112",variant:"outline",size:"sm",disabled:!0,children:[a.jsx(I,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:113",className:"w-4 h-4 mr-2 text-green-600"}),"Amigos"]}):g==="pending_sent"?a.jsxs(c,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:121",variant:"outline",size:"sm",disabled:!0,children:[a.jsx(M,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:122",className:"w-4 h-4 mr-2 text-amber-500"}
1),"Pedido enviado"]}):g==="pending_received"?a.jsxs("div",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:130",className:"flex gap-2",children:[a.jsxs(c,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:131",size:"sm",className:"bg-green-600 hover:bg-green-700",onClick:()=>r.mutate({friendshipId:x.friendshipId,memberId:l.id,accept:!0}),disabled:r.isPending,children:[a.jsx(I,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:137",className:"w-4 h-4 mr-2"}),"Aceitar"]}),a.jsxs(c,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:140",variant:"outline",size:"sm",onClick:()=>r.mutate({friendshipId:x.friendshipId,memberId:l.id,accept:!1}),disabled:r.isPending,children:[a.jsx(ea,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:146",className:"w-4 h-4 mr-2"}),"Recusar"]})]}):a.jsxs(c,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:154",size:"sm",className:"bg-[#1a1a5e] hover:bg-[#2d2d8a]",onClick:_,disabled:p.isPending,children:[p.isPending?a.jsx(U,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:161",className:"w-4 h-4 mr-2 animate-spin"}):a.jsx(sa,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:163",className:"w-4 h-4 mr-2"}),"Adicionar Amigo"]});return a.jsx(u,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:171",children:a.jsx($,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:172",children:a.jsxs("div",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:173",children:[a.jsxs("div",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:175",className:"relative rounded-xl overflow-visible mb-4",children:[a.jsx("div",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:177",className:"h-48 md:h-56 rounded-xl bg-gradient-to-r from-[#1a1a5e] to-[#4a4ab0] overflow-hidden",style:e.coverUrl?{backgroundImage:`url(${e.coverUrl})`,backgroundSize:"cover",backgroundPosition:"center"}:{}}),a.jsx("div",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:182",className:"absolute left-6",style:{bottom:"-3rem"},children:e.avatarUrl?a.jsx("img",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:184",src:e.avatarUrl,alt:e.displayName,className:"w-24 h-24 md:w-28 md:h-28 rounded-full border-4 border-white object-cover shadow-lg"}):a.jsx("div",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:190",className:"w-24 h-24 md:w-28 md:h-28 rounded-full border-4 border-white bg-gray-200 flex items-center justify-center shadow-lg",children:a.jsx(n,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:191",className:"w-16 h-16 text-gray-400"})})})]}),a.jsx("div",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:198",className:"mt-14 px-2",children:a.jsxs("div",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:199",className:"flex flex-col md:flex-row md:items-start md:justify-between gap-4",children:[a.jsxs("div",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:200",children:[a.jsxs("div",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:201",className:"flex items-center gap-2",children:[a.jsx("h1",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:202",className:"text-2xl font-bold text-gray-900",children:e.displayName}),e.isOnline?a.jsxs("span",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:205",className:"flex items-center gap-1 text-xs font-medium text-green-600 bg-green-50 border border-green-200 rounded-full px-2 py-0.5",children:[a.jsx("span",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:206",className:"w-1.5 h-1.5 bg-green-500 rounded-full animate-pulse"}),"Online"]}):e.lastSeen?a.jsxs("span",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:210",className:"flex items-center gap-1 text-xs text-gray-400",children:[a.jsx(M,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:211",className:"w-3 h-3"}),"Visto ",Q(e.lastSeen)]}):null]}),a.jsxs("p",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:216",className:"text-gray-500",children:["@",e.username]}),e.bio&&a.jsx("p",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:217",className:"mt-2 text-gray-700 max-w-lg",dangerouslySetInnerHTML:{__html:e.bio}}),a.jsxs("div",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:219",className:"flex flex-wrap items-center gap-4 mt-3 text-sm text-gray-500",children:[e.location&&a.jsxs("span",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:221",className:"flex items-center gap-1",children:[a.jsx(W,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:222",className:"w-4 h-4"}),e.location]}),e.website&&a.jsxs("a",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:227",href:e.website,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-[#1a1a5e] hover:underline",children:[a.jsx(J,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:228",className:"w-4 h-4"}),"Website"]}),a.jsxs("span",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:232",className:"flex items-center gap-1",children:[a.jsx(X,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:233",className:"w-4 h-4"}),"Membro desde ",D(e.createdAt)]})]}),a.jsxs("div",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:238",className:"flex items-center gap-6 mt-3",children:[a.jsxs("span",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:239",className:"text-sm",children:[a.jsx("strong",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:240",className:"text-gray-900",children:e.friendCount})," ",a.jsx("span",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:241",className:"text-gray-500",children:"amigos"})]}),a.jsxs("span",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:243",className:"text-sm",children:[a.jsx("strong",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:244",className:"text-gray-900",children:e.postCount})," ",a.jsx("span",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:245",className:"text-gray-500",children:"publicações"})]})]})]}),a.jsx("div",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:251",className:"flex items-center gap-2 flex-wrap",children:y?a.jsx(h,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:253",href:"/clube-atlantida/definicoes",children:a.jsxs(c,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:254",variant:"outline",size:"sm",children:[a.jsx(Y,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:255",className:"w-4 h-4 mr-2"}),"Editar Perfil"]}
1)}):N?a.jsxs(a.Fragment,{children:[R(),a.jsxs(c,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:262",variant:"outline",size:"sm",onClick:E,children:[a.jsx(K,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:267",className:"w-4 h-4 mr-2"}),"Mensagem"]})]}):null})]})}),a.jsxs(G,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:277",defaultValue:"actividade",className:"mt-6",children:[a.jsxs(H,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:278",className:"w-full justify-start",children:[a.jsx(j,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:279",value:"actividade",children:"Actividade"}),a.jsxs(j,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:280",value:"amigos",children:["Amigos (",e.friendCount,")"]}),a.jsx(j,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:281",value:"sobre",children:"Sobre"})]}),a.jsx(b,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:284",value:"actividade",className:"mt-4",children:d?.activities&&d.activities.length>0?a.jsx("div",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:286",className:"space-y-4",children:d.activities.map(s=>a.jsx(S,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:288",children:a.jsx(P,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:289",className:"p-4",children:a.jsxs("div",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:290",className:"flex items-start gap-3",children:[e.avatarUrl?a.jsx("img",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:292",src:e.avatarUrl,alt:"",className:"w-10 h-10 rounded-full object-cover"}):a.jsx(n,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:294",className:"w-10 h-10 text-gray-300"}),a.jsxs("div",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:296",className:"flex-1",children:[a.jsx("p",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:297",className:"font-semibold text-sm",children:e.displayName}),a.jsx("p",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:298",className:"text-gray-700 mt-1",children:s.content}),s.imageUrl&&a.jsx("img",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:300",src:s.imageUrl,alt:"",className:"mt-2 rounded-lg max-h-64 object-cover"}),a.jsx("p",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:302",className:"text-xs text-gray-400 mt-2",children:V(s.createdAt)})]})]})})},s.id))}):a.jsxs("div",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:312",className:"text-center py-10 text-gray-500",children:[a.jsx(Z,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:313",className:"w-12 h-12 mx-auto text-gray-300 mb-3"}),a.jsx("p",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:314",children:"Sem publicações ainda."})]})}),a.jsx(b,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:319",value:"amigos",className:"mt-4",children:m&&m.length>0?a.jsx("div",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:321",className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:m.map(s=>a.jsx(h,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:323",href:`/clube-atlantida/perfil/${s.username}`,children:a.jsx(S,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:324",className:"hover:shadow-md transition-shadow cursor-pointer",children:a.jsxs(P,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:325",className:"p-4 text-center",children:[s.avatarUrl?a.jsx("img",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:327",src:s.avatarUrl,alt:"",className:"w-16 h-16 rounded-full mx-auto object-cover"}):a.jsx(n,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:329",className:"w-16 h-16 mx-auto text-gray-300"}),a.jsx("p",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:331",className:"font-semibold text-sm mt-2 truncate",children:s.displayName}),a.jsxs("p",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:332",className:"text-xs text-gray-500 truncate",children:["@",s.username]})]})})},s.id))}):a.jsxs("div",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:339",className:"text-center py-10 text-gray-500",children:[a.jsx(aa,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:340",className:"w-12 h-12 mx-auto text-gray-300 mb-3"}),a.jsx("p",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:341",children:"Sem amigos adicionados ainda."})]})}),a.jsx(b,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:346",value:"sobre",className:"mt-4",children:a.jsx(S,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:347",children:a.jsxs(P,{"data-loc":"client/src/pages/social/SocialPerfil.tsx:348",className:"p-6 space-y-4",children:[e.bio&&a.jsxs("div",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:350",children:[a.jsx("h3",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:351",className:"font-semibold text-gray-900 mb-1",children:"Sobre mim"}),a.jsx("p",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:352",className:"text-gray-700",dangerouslySetInnerHTML:{__html:e.bio}})]}),e.location&&a.jsxs("div",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:356",children:[a.jsx("h3",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:357",className:"font-semibold text-gray-900 mb-1",children:"Localização"}),a.jsx("p",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:358",className:"text-gray-700",children:e.location})]}),e.website&&a.jsxs("div",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:362",children:[a.jsx("h3",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:363",className:"font-semibold text-gray-900 mb-1",children:"Website"}),a.jsx("a",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:364",href:e.website,target:"_blank",rel:"noopener noreferrer",className:"text-[#1a1a5e] hover:underline",children:e.website})]}),w.length>0&&a.jsxs("div",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:370",children:[a.jsx("h3",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:371",className:"font-semibold text-gray-900 mb-2",children:"Interesses"}),a.jsx("div",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:372",className:"flex flex-wrap gap-2",children:w.map((s,f)=>a.jsx("span",{"data-loc":"client/src/pages/social/SocialPerfil.tsx:374",className:"px-3 py-1 bg-[#1a1a5e]/10 text-[#1a1a5e] rounded-full text-sm",children:s},f))})]})]})})})]})]})})})}export{Ra 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.