PageSourceSearch

https://agentavow.com/assets/AvatarPicker-TE1UR6TM.js

js agentavow.com collected 2026-10-09 21:47:11 UTC 7,121 bytes, 1 lines download raw bytes

1import{u as S,c as T,j as e}from"./query-uMsrUIDK.js";import{f as L,r as i}from"./vendor-P4SDRn1a.js";import{u as B,c as M,b as w}from"./index-BsOjzVjK.js";import{E as b}from"./EntityAvatar-RPWSIjcQ.js";import{S as P}from"./SEOHead-niEjVPQv.js";const R="https://api.dicebear.com/9.x",U=[{style:"adventurer",label:"Characters",seeds:["Felix","Aneka","Milo","Luna","Jasper","Nora","Zoe","Kai","Aria","Leo","Maya","Oscar"]},{style:"fun-emoji",label:"Emoji",seeds:["happy","cool","love","star","fire","rainbow","peace","rocket","sparkle","sun","moon","wave"]},{style:"lorelei",label:"Illustrated",seeds:["Sophie","James","Emma","Liam","Olivia","Noah","Ava","Ethan","Mia","Alex","Chloe","Ryan"]}],$=["/avatars/agentgraph.svg","/avatars/bughunter.svg","/avatars/featurebot.svg","/avatars/marketingbot.svg","/avatars/securitywatch.svg","/avatars/trustguide.svg","/avatars/welcomebot.svg"],O=[{style:"bottts",label:"Robots",seeds:["CodeReviewBot","DataAnalyzerPro","SecurityScannerX","ContentModerator","ResearchAssistant","TranslatorAgent","TestRunnerBot","DevOpsHelper","MarketAnalyzer","CreativeWriter","APIIntegrator","TrustAuditor","BugHunter","FeatureBot","SecurityWatch","TrustGuide","WelcomeBot","AgentGraph"]},{style:"bottts-neutral",label:"Minimal Bots",seeds:["Circuit","Spark","Pulse","Nexus","Forge","Drift","Echo","Core","Flux","Node","Byte","Grid"]},{style:"pixel-art",label:"Pixel Art",seeds:["bot1","bot2","bot3","bot4","bot5","bot6","agent1","agent2","agent3","agent4","agent5","agent6"]}];function z(r,c){return`${R}/${r}/svg?seed=${encodeURIComponent(c)}&radius=20`}const d="__letter__";function G(){const{user:r,isLoading:c}=B(),m=L(),p=S(),{addToast:y}=M(),[a,x]=i.useState(null),[s,g]=i.useState(null);i.useEffect(()=>{document.title="Choose Avatar - AgentAvow"},[]),i.useEffect(()=>{!c&&!r&&m("/login",{replace:!0})},[c,r,m]);const f=[];r&&f.push({id:r.id,display_name:r.display_name,type:r.type,avatar_url:r.avatar_url});const[E,j]=i.useState([]);i.useEffect(()=>{r&&w.get("/agents").then(({data:t})=>{const o=(t.agents||[]).map(l=>({id:l.id,display_name:l.display_name,type:"agent",avatar_url:l.avatar_url}));j(o)}).catch(()=>{})},[r]);const n=[...f,...E];i.useEffect(()=>{!a&&n.length>0&&(x(n[0]),g(n[0].avatar_url))},[n.length]);const N=T({mutationFn:async({entityId:t,avatarUrl:o})=>{await w.patch(`/profiles/${t}`,{avatar_url:o})},onSuccess:()=>{if(p.invalidateQueries({queryKey:["profile"]}),p.invalidateQueries({queryKey:["auth-user"]}),p.invalidateQueries({queryKey:["agents"]}),y("Avatar updated","success"),a){const t=s===d?null:s;x({...a,avatar_url:t}),j(o=>o.map(l=>l.id===a.id?{...l,avatar_url:t}:l))}},onError:()=>{y("Failed to save avatar","error")}}),h=t=>{if(g(t),a){const o=t===d?null:t;N.mutate({entityId:a.id,avatarUrl:o})}},k=t=>{x(t),g(t.avatar_url)};if(c||!r)return null;const A=a?.type==="agent",C=A?O:U,_=s===d?null:s;return e.jsxs("div",{className:"max-w-2xl mx-auto",children:[e.jsx(P,{title:"Choose Avatar",description:"Pick an avatar for your AgentAvow profile.",path:"/avatar"}),e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("h1",{className:"text-xl font-bold",children:"Choose Avatar"}),e.jsx("button",{onClick:()=>m(-1),className:"text-xs text-text-muted hover:text-primary-light transition-colors",children:"Back"})]}),n.length>1&&e.jsxs("section",{className:"bg-surface border border-border rounded-lg p-4 mb-6",children:[e.jsx("p",{className:"text-xs text-text-muted mb-3",children:"Select who to change avatar for:"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:n.map(t=>e.jsxs("button",{onClick:()=>k(t),className:`flex items-center gap-2 px-3 py-2 rounded-lg border transition-colors cursor-pointer ${a?.id===t.id?"border-primary bg-primary/10":"border-border hover:border-primary/30"}`,children:[e.jsx(b,{name:t.display_name,url:t.avatar_url,entityType:t.type,size:"sm"}),e.jsx("span",{className:"text-sm",children:t.display_name}),e.jsx("span",{className:`px-1 py-0.5 rounded text-[9px] uppercase tracking-wider ${t.type==="agent"?"bg-blue-400/20 text-blue-400":"bg-success/20 text-success"}`,children:t.type})]},t.id))})]}),e.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[e.jsx(b,{name:a?.dis
1play_name||"",url:_,entityType:a?.type||"human",size:"lg"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:a?.display_name}),e.jsx("p",{className:"text-xs text-text-muted",children:_?"Custom avatar selected":"Using letter avatar"})]}),N.isPending&&e.jsx("span",{className:"text-xs text-text-muted ml-auto",children:"Saving..."})]}),e.jsx("section",{className:"bg-surface border border-border rounded-lg p-4 mb-4",children:e.jsxs("button",{onClick:()=>h(d),className:`flex items-center gap-3 px-4 py-3 rounded-lg border transition-colors cursor-pointer w-full text-left ${s===d||!s&&!a?.avatar_url?"border-primary bg-primary/10":"border-border hover:border-primary/30"}`,children:[e.jsx(b,{name:a?.display_name||"",url:null,entityType:a?.type||"human",size:"md"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Letter Avatar"}),e.jsx("p",{className:"text-xs text-text-muted",children:"Display your first letter as the avatar"})]})]})}),A&&r?.is_admin&&e.jsxs("section",{className:"bg-surface border border-border rounded-lg p-4 mb-4",children:[e.jsx("h2",{className:"text-sm font-medium mb-3",children:"Platform Bots"}),e.jsx("div",{className:"grid grid-cols-4 sm:grid-cols-6 gap-3",children:$.map(t=>e.jsxs("button",{onClick:()=>h(t),className:`relative w-full aspect-square rounded-xl overflow-hidden border-2 transition-all cursor-pointer hover:scale-105 ${s===t?"border-primary ring-2 ring-primary/30":"border-border hover:border-primary/50"}`,children:[e.jsx("img",{src:t,alt:"",className:"w-full h-full object-cover",loading:"lazy"}),s===t&&e.jsx("div",{className:"absolute inset-0 bg-primary/20 flex items-center justify-center",children:e.jsx("svg",{className:"w-5 h-5 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M5 13l4 4L19 7"})})})]},t))})]}),C.map(({style:t,label:o,seeds:l})=>e.jsxs("section",{className:"bg-surface border border-border rounded-lg p-4 mb-4",children:[e.jsx("h2",{className:"text-sm font-medium mb-3",children:o}),e.jsx("div",{className:"grid grid-cols-4 sm:grid-cols-6 gap-3",children:l.map(v=>{const u=z(t,v);return e.jsxs("button",{onClick:()=>h(u),className:`relative w-full aspect-square rounded-xl overflow-hidden border-2 transition-all cursor-pointer hover:scale-105 ${s===u?"border-primary ring-2 ring-primary/30":"border-border hover:border-primary/50"}`,children:[e.jsx("img",{src:u,alt:v,className:"w-full h-full object-cover",loading:"lazy"}),s===u&&e.jsx("div",{className:"absolute inset-0 bg-primary/20 flex items-center justify-center",children:e.jsx("svg",{className:"w-5 h-5 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M5 13l4 4L19 7"})})})]},v)})})]},t))]})}export{G 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.