PageSourceSearch

https://the-lost-art.com/assets/chat-D0FVM7_2.js

js the-lost-art.com collected 2026-10-05 18:00:45 UTC 6,768 bytes, 1 lines download raw bytes

1import{r as i,j as e}from"./react-vendor-BS-Esnrx.js";import{H as v}from"./dj-feature-BhX2-AdB.js";import{A as S}from"./AdminLayout-DYPCWN3n.js";import{t as p}from"./community-feature-Cl3rwRT4.js";import{aC as w,av as C,q as R}from"./lucide-ke3X4oaS.js";import{m as x}from"./motion-BN_7uyJg.js";import"./dj-data-Dd6c-HdA.js";function W(){const[r,f]=i.useState([]),[d,y]=i.useState([]),[l,b]=i.useState([]),[u,m]=i.useState(!0),[s,j]=i.useState("messages"),[z,h]=i.useState(null);async function c(){m(!0);try{const n=await(await fetch("/api/admin/chat",{credentials:"include"})).json();f(n.rooms??[]),y(n.recentMessages??[]),b(n.bannedUsers??[])}catch{p.networkErr()}finally{m(!1)}}i.useEffect(()=>{c()},[]);async function g(t,n,o={}){h(`${t}:${n}`);try{const a=await fetch("/api/admin/chat",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:t,...o})}),A=await a.json();if(!a.ok)throw new Error(A.error);p.success("Done"),c()}catch{p.networkErr()}finally{h(null)}}const k=[{key:"messages",label:`Recent Messages (${d.length})`},{key:"rooms",label:`Rooms (${r.length})`},{key:"banned",label:`Banned (${l.length})`}];return e.jsxs(e.Fragment,{children:[e.jsxs(v,{children:[e.jsx("title",{children:"Chat Admin. TLA Admin"}),e.jsx("meta",{name:"robots",content:"noindex, nofollow"}),e.jsx("meta",{name:"description",content:"TLA Admin Chat Administration. restricted access"}),e.jsx("link",{rel:"canonical",href:"https://the-lost-art.com/admin/chat"}),e.jsx("meta",{property:"og:title",content:"Chat Admin. TLA Admin"}),e.jsx("meta",{property:"og:description",content:"TLA Admin Chat Administration. restricted access"}),e.jsx("meta",{property:"og:type",content:"website"}),e.jsx("meta",{property:"og:url",content:"https://the-lost-art.com/admin/chat"}),e.jsx("meta",{property:"og:image",content:"https://the-lost-art.com/og-default.png"}),e.jsx("meta",{name:"twitter:card",content:"summary"}),e.jsx("meta",{name:"twitter:title",content:"Chat Admin. TLA Admin"}),e.jsx("meta",{name:"twitter:image",content:"https://the-lost-art.com/og-default.png"})]}),e.jsx("h1",{style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap"},children:"TLA Admin Chat Administration"}),e.jsxs(S,{title:"Chat Administration",children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:20},children:[e.jsx("div",{style:{display:"flex",gap:6},children:k.map(t=>e.jsx("button",{type:"button",onClick:()=>j(t.key),style:{padding:"8px 14px",borderRadius:8,fontSize:13,fontWeight:600,cursor:"pointer",border:"1px solid",background:s===t.key?"rgba(0,204,255,0.1)":"#0d1117",borderColor:s===t.key?"rgba(0,204,255,0.3)":"#94a3b8",color:s===t.key?"#00ccff":"#e2e8f0"},children:t.label},t.key))}),e.jsx("button",{type:"button",onClick:c,style:{background:"#94a3b8",border:"1px solid #334155",color:"#e2e8f0",borderRadius:8,padding:"8px 12px",cursor:"pointer",display:"flex",alignItems:"center"},children:e.jsx(w,{size:14})})]}),u?Array.from({length:6}).map((t,n)=>e.jsx("div",{className:"tla-skeleton",style:{height:60,borderRadius:8,marginBottom:8}},n)):e.jsxs(e.Fragment,{children:[s==="messages"&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6},children:d.length===0?e.jsx("div",{style:{padding:"48px 24px",textAlign:"center",color:"#e2e8f0",background:"#0d1117",borderRadius:12,border:"1px solid #1e293b"},children:"No recent messages"}):d.map((t,n)=>{var o;return e.jsxs(x.div,{initial:{opacity:0}
1,animate:{opacity:1},transition:{delay:n*.02},style:{display:"flex",alignItems:"center",gap:12,background:"#0d1117",border:"1px solid #1e293b",borderRadius:8,padding:"10px 14px"},children:[e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:3},children:[e.jsx("span",{style:{fontSize:12,fontWeight:600,color:"#00ccff"},children:t.chatUsername??t.userName??"Unknown"}),e.jsx("span",{style:{fontSize:10,color:"#94a3b8"},children:((o=r.find(a=>a.id===t.roomId))==null?void 0:o.name)??t.roomId}),e.jsx("span",{style:{fontSize:10,color:"#94a3b8",marginLeft:"auto"},children:new Date(t.createdAt).toLocaleTimeString()})]}),e.jsx("div",{style:{fontSize:13,color:"#e2e8f0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.content})]}),e.jsx("button",{type:"button",onClick:()=>g("delete_message",t.id,{messageId:t.id}),title:"Delete message",style:{display:"flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:6,background:"rgba(239,68,68,0.1)",border:"1px solid rgba(239,68,68,0.2)",color:"#ef4444",cursor:"pointer",flexShrink:0},children:e.jsx(C,{size:12})})]},t.id)})}),s==="rooms"&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:r.map((t,n)=>e.jsxs(x.div,{initial:{opacity:0}
1,animate:{opacity:1},transition:{delay:n*.04},style:{display:"flex",alignItems:"center",gap:14,background:"#0d1117",border:"1px solid #1e293b",borderRadius:10,padding:"14px 16px"},children:[e.jsx("div",{style:{width:40,height:40,borderRadius:10,background:t.color+"20",border:`1px solid ${t.color}40`,display:"flex",alignItems:"center",justifyContent:"center",fontSize:20,flexShrink:0},children:t.icon}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{style:{fontSize:14,fontWeight:700,color:"#e2e8f0"},children:t.name}),t.description&&e.jsx("div",{style:{fontSize:12,color:"#e2e8f0"},children:t.description})]}),e.jsxs("div",{style:{fontSize:11,color:"#94a3b8"},children:["Order: ",t.sortOrder]})]},t.id))}),s==="banned"&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:l.length===0?e.jsx("div",{style:{padding:"48px 24px",textAlign:"center",color:"#e2e8f0",background:"#0d1117",borderRadius:12,border:"1px solid #1e293b"},children:"No banned users"}):l.map((t,n)=>e.jsxs(x.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:n*.04},style:{display:"flex",alignItems:"center",gap:12,background:"#0d1117",border:"1px solid rgba(239,68,68,0.2)",borderRadius:10,padding:"12px 16px"},children:[e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{style:{fontSize:13,fontWeight:600,color:"#e2e8f0"},children:t.name}),e.jsx("div",{style:{fontSize:11,color:"#e2e8f0"},children:t.email}),t.chatBannedReason&&e.jsxs("div",{style:{fontSize:11,color:"#ef4444",marginTop:2},children:["Reason: ",t.chatBannedReason]})]}),e.jsxs("button",{type:"button",onClick:()=>g("unban_from_chat",t.id,{userId:t.id}),style:{display:"flex",alignItems:"center",gap:5,padding:"7px 12px",borderRadius:7,background:"rgba(34,197,94,0.1)",border:"1px solid rgba(34,197,94,0.2)",color:"#22c55e",fontSize:12,fontWeight:600,cursor:"pointer"},children:[e.jsx(R,{size:13})," Unban"]})]},t.id))})]})]})]})}export{W 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.