PageSourceSearch

https://www.haylingua.am/assets/PublicUserPage-9e0a640a.js

js haylingua.am collected 2026-10-04 08:01:16 UTC 24,442 bytes, 2 lines download raw bytes

1import{j as e,u as de,r as f,L as g,z as O,bc as W,x as X,q as V,bd as xe,b4 as me,au as G,C as Z,X as H,am as ue,p as he,U as Q,ay as fe,aF as pe,o as ee,w as ge,G as se,av as A,m as te,aB as be,ac as je,as as ve,aa as Ne}from"./vendor-2be7022e.js";import{S as we}from"./motifs-d61be354.js";import{c as ye,s as ke,A as _e}from"./profileTheme-55687b96.js";import{S as b}from"./Skeleton-f89cfcee.js";import{A as re,C as Ce}from"./index-c61a06a9.js";import{N as ae}from"./nameTag-8b60a77f.js";import{T as Se,u as P,g as E,L as $e,b as ne,r as R,C as qe,d as T,p as _}from"./shared-d9b446ea.js";const Le={target:ve,crown:O,zap:Ne,flame:X,star:se},y=12,Fe="https://haylingua.am",k="btn3d btn3d-brand inline-flex items-center justify-center gap-2 text-sm disabled:opacity-60",w="inline-flex h-10 items-center justify-center gap-2 rounded-2xl px-4 text-sm font-extrabold text-slate-700 ring-1 ring-slate-200 transition hover:bg-slate-50 disabled:opacity-60 dark:text-stone-200 dark:ring-white/[0.08] dark:hover:bg-white/[0.04]";function Ae(s){const t=String(s||"none").toLowerCase();return["self","friends","incoming_pending","outgoing_pending"].includes(t)?t:"none"}function Re(s){if(!s)return"";const t=new Date(s);return Number.isNaN(t.getTime())?"":t.toLocaleDateString(void 0,{month:"long",year:"numeric"})}function Pe(s,t,a=`${t}s`){return`${Number(s).toLocaleString()} ${s===1?t:a}`}function es(s){return e.jsx(Se,{children:e.jsx(Ee,{...s})})}function Ee({token:s}){const{username:t=""}=de(),a=String(t).trim(),c=`/users/${encodeURIComponent(a)}`,[n,m]=f.useState(0),[r,l,i]=P(async()=>({...await E(s,c,"Couldn't load this profile."),__path:c}),[s,c]),d=!!r.data&&r.data.__path!==c,o=d?null:r.data;if(f.useEffect(()=>{window.scrollTo(0,0)},[a]),f.useEffect(()=>{if(!o)return;const u=document.title;return document.title=`${o.name||a} (@${o.username||a}) · Haylingua`,()=>{document.title=u}},[o,a]),r.loading||d&&!r.error)return e.jsx(Je,{});if(!o)return e.jsx(U,{children:r.error&&/not found/i.test(r.error)?e.jsx(He,{handle:a,token:s}):e.jsx($e,{title:"We couldn't load this profile",message:r.error,onRetry:l})});const v=u=>i(p=>({...p,data:{...p.data,...u}}));return e.jsx(Te,{token:s,data:o,path:c,version:n,patch:v,refresh:()=>{l(),m(u=>u+1)}},o.user_id)}function Te({token:s,data:t,path:a,version:c,patch:n,refresh:m}){var Y;const r=ne(),l=Ae(t.friendship),i=l==="self",d=l==="friends",o=t.name||t.username||"Learner",v=i||d||t.friends_public!==!1,u=R(t.avatar_url||""),p=R(t.banner_url||""),[j,x]=f.useState(!1),[S,B]=f.useState(""),[le,L]=f.useState(!1),$=Number(t.xp)||0,oe=Number(t.streak)||0,ce=Number(t.lessons_completed)||0,F=Number(t.global_rank)||0,I=Re(t.joined_at),M=Number(t.mutual_friends_count)||0;async function z(N){if(!S){B(N);try{if(N==="add"){const h=await _(s,"/friends/request",{user_id:t.user_id},"Couldn't send that request.");(h==null?void 0:h.status)==="already_friends"?(n({friendship:"friends",is_friend:!0,friend_request_id:null}),r(`You and ${o} are already friends.`)):(h==null?void 0:h.status)==="request_exists"&&Number(h.requester_id)===Number(t.user_id)?(n({friendship:"incoming_pending",friend_request_id:h.request_id}),r(`${o} already sent you a request. Accept it to become friends.`)):(n({friendship:"outgoing_pending",friend_request_id:(h==null?void 0:h.request_id)??null}),r(`Friend request sent to ${o}.`))}else N==="cancel"?(await _(s,`/friends/requests/${t.friend_request_id}/cancel`,void 0,"Couldn't cancel that request."),n({friendship:"none",friend_request_id:null}),r("Request cancelled.")):N==="accept"?(await _(s,`/friends/requests/${t.friend_request_id}/accept`,void 0,"Couldn't accept that request."),n({friendship:"friends",is_friend:!0,friend_request_id:null,friends_count:(Number(t.friends_count)||0)+1}),r(`You and ${o} are now friends.`)):N==="decline"?(await _(s,`/friends/requests/${t.friend_request_id}/reject`,void 0,"Couldn't decline that request."),n({friendship:"none",friend_request_id:null}),r("Request declined.")):N==="remove"&&(await _(s,`/friends/remove/${t.user_id}`,void 0,"Couldn't remove that friend."),n({friendship:"none",is_friend:!1,friends_count:Math.max(0,(Number(t.friends_count)||0)-1)}),r(`Removed ${o} from your friends.`));m()}catch(h){h.status===404&&N!=="add"?(r("That request is no longer there. We refreshed the profile.","error"),m()):r(h.message,"error")}finally{B(""),L(!1)}}}const D=[I&&`Joined ${I}`,v&&Pe(Number(t.friends_count)||0,"friend"),!i&&M>0&&`${M}
1 mutual`].filter(Boolean);return e.jsxs(U,{children:[i&&e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-2xl bg-slate-900 px-4 py-3 text-sm text-white dark:bg-white dark:text-slate-900",children:[e.jsx("span",{className:"font-semibold",children:"This is how other learners see your profile."}),e.jsx(g,{to:"/profile",className:"font-extrabold underline-offset-2 hover:underline",children:"Back to your profile"})]}),e.jsxs("section",{className:"overflow-hidden rounded-3xl bg-white ring-1 ring-slate-200 dark:bg-[#18181b] dark:ring-white/[0.08]",children:[e.jsx("div",{className:"relative h-28 sm:h-40 "+ye(p,t.active_theme_style),style:p?{backgroundImage:`url(${p})`}:void 0,children:ke(p,t.active_theme_style)&&e.jsxs("svg",{className:"absolute inset-0 h-full w-full text-brand-300/40 dark:text-brand-400/10","aria-hidden":"true",children:[e.jsx("defs",{children:e.jsx("pattern",{id:"hl-public-banner-dots",width:"22",height:"22",patternUnits:"userSpaceOnUse",children:e.jsx("circle",{cx:"2",cy:"2",r:"1.5",fill:"currentColor"})})}),e.jsx("rect",{width:"100%",height:"100%",fill:"url(#hl-public-banner-dots)"})]})}),e.jsxs("div",{className:"px-4 pb-5 sm:px-6",children:[e.jsxs("div",{className:"-mt-8 flex flex-col gap-4 sm:-mt-9 sm:flex-row sm:items-end sm:justify-between",children:[e.jsxs("div",{className:"flex min-w-0 items-end gap-4",children:[e.jsxs("div",{className:"relative shrink-0",children:[e.jsx(re,{frameStyle:t.active_frame_style,rarity:t.active_frame_rarity,size:96,radius:"1.5rem",thickness:3,idle:!0,children:e.jsx("div",{className:"h-full w-full overflow-hidden rounded-3xl bg-white dark:bg-[#18181b] "+(t.active_frame_style?"":t.is_premium?"ring-4 ring-gold-400":"ring-4 ring-white dark:ring-[#18181b]"),children:u&&!j?e.jsx("img",{src:u,alt:"",className:"h-full w-full object-cover",onError:()=>x(!0)}):e.jsx("div",{className:"grid h-full w-full place-items-center bg-brand-50 font-display text-3xl font-extrabold text-brand-600 dark:bg-brand-500/15 dark:text-brand-400",children:(Y=o[0])==null?void 0:Y.toUpperCase()})})}),t.is_premium&&e.jsx("span",{title:"Premium",className:"absolute -left-1 -top-1 grid h-7 w-7 place-items-center rounded-full bg-gold-500 text-white ring-2 ring-white dark:ring-[#18181b]",children:e.jsx(O,{className:"h-3.5 w-3.5"})})]}),e.jsxs("div",{className:"min-w-0 pb-1",children:[e.jsx("h1",{className:"truncate font-display text-2xl font-extrabold leading-tight text-slate-900 dark:text-white",children:e.jsx(ae,{renderKey:t.active_name_tag_style,rarity:t.active_name_tag_rarity,children:o})}),e.jsxs("div",{className:"mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-slate-500 dark:text-stone-400",children:[t.username&&e.jsxs("span",{className:"font-semibold",children:["@",t.username]}),e.jsxs("span",{className:"rounded-full bg-slate-100 px-2 py-0.5 text-[11px] font-extrabold text-slate-600 dark:bg-white/[0.06] dark:text-stone-300",children:["Level ",Number(t.level)||1]}),d&&e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-grass-50 px-2 py-0.5 text-[11px] font-extrabold text-grass-700 dark:bg-grass-500/15 dark:text-grass-400",children:[e.jsx(W,{className:"h-3 w-3"})," Friend"]})]})]})]}),e.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:[e.jsx(Ue,{token:s,friendship:l,busy:S,name:o,onAct:z,onRemove:()=>L(!0)}),t.username&&e.jsx(Ie,{url:`${Fe}/u/${encodeURIComponent(t.username)}`,name:o})]})]}),t.bio?e.jsx("p",{className:"mt-4 max-w-2xl whitespace-pre-line break-words text-sm text-slate-600 dark:text-stone-300",children:t.bio}):null,D.length>0&&e.jsx("p",{className:"mt-3 text-xs font-semibold text-slate-400 dark:text-stone-500",children:D.join(" · ")}),e.jsxs("div",{className:"mt-5 grid grid-cols-2 gap-2.5 sm:grid-cols-4",children:[e.jsx(q,{icon:X,iconClass:"text-orange-500",label:"Day streak",value:oe.toLocaleString()}),e.jsx(q,{icon:we,iconClass:"text-gold-500",label:"Total XP",value:$.toLocaleString()}),e.jsx(q,{icon:V,iconClass:"text-grass-500",label:"Lessons",value:ce.toLocaleString()}),e.jsx(q,{icon:xe,iconClass:"text-feather-500",label:"Global rank",value:F>0&&$>
10?`#${F.toLocaleString()}`:"—",to:F>0&&$>0&&s?"/leaderboard?tab=alltime":null})]})]})]}),e.jsx(Me,{token:s,path:a,name:o,xp:$,canSee:v,version:c}),e.jsxs("div",{className:"grid gap-5 lg:grid-cols-5",children:[e.jsx(ze,{items:Array.isArray(t.achievements)?t.achievements:[],name:o,isSelf:i,className:"lg:col-span-3"}),e.jsx(De,{token:s,path:a,name:o,isSelf:i,canSee:v,total:Number(t.friends_count)||0,version:c,className:"lg:col-span-2"})]}),!s&&e.jsx(Ge,{name:o}),e.jsx(qe,{open:le,title:`Remove ${o} from your friends?`,body:"You'll stop seeing each other in friend leaderboards and activity. You can send a new request any time.",confirmLabel:S==="remove"?"Removing…":"Remove friend",cancelLabel:"Keep friend",onCancel:()=>{S||L(!1)},onConfirm:()=>z("remove")})]})}function Ue({token:s,friendship:t,busy:a,name:c,onAct:n,onRemove:m}){const[r,l]=f.useState(!1),i=d=>a===d?e.jsx(te,{className:"h-4 w-4 animate-spin"}):null;return t==="self"?e.jsxs(g,{to:"/profile?tab=edit",className:w,children:[e.jsx(me,{className:"h-4 w-4"})," Edit profile"]}):s?t==="incoming_pending"?e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:()=>n("accept"),disabled:!!a,className:k,children:[i("accept")||e.jsx(Z,{className:"h-4 w-4"})," Accept request"]}),e.jsxs("button",{type:"button",onClick:()=>n("decline"),disabled:!!a,className:w+" w-10 px-0 sm:w-auto sm:px-4","aria-label":`Decline ${c}'s request`,children:[i("decline")||e.jsx(H,{className:"h-4 w-4"})," ",e.jsx("span",{className:"hidden sm:inline",children:"Decline"})]})]}):t==="outgoing_pending"?e.jsxs("button",{type:"button",onClick:()=>n("cancel"),disabled:!!a,className:w+" group",title:"Cancel request",children:[i("cancel")||e.jsx(ue,{className:"h-4 w-4 group-hover:hidden"}),!a&&e.jsx(H,{className:"hidden h-4 w-4 group-hover:block"}),e.jsx("span",{className:"group-hover:hidden",children:"Requested"}),e.jsx("span",{className:"hidden group-hover:inline",children:"Cancel request"})]}):t==="friends"?e.jsxs("div",{className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>l(d=>!d),disabled:!!a,"aria-haspopup":"menu","aria-expanded":r,className:w,children:[i("remove")||e.jsx(W,{className:"h-4 w-4 text-grass-600 dark:text-grass-400"})," Friends ",e.jsx(he,{className:"h-3.5 w-3.5 opacity-60"})]}),r&&e.jsxs(Be,{onClose:()=>l(!1),className:"left-0 top-12 w-52 sm:left-auto sm:right-0",children:[e.jsxs(g,{role:"menuitem",to:"/friends",className:J,children:[e.jsx(Q,{className:"h-4 w-4 text-slate-400"})," All your friends"]}),e.jsxs("button",{role:"menuitem",type:"button",onClick:()=>{l(!1),m()},className:J+" text-cardinal-600 hover:bg-cardinal-50 dark:text-cardinal-400 dark:hover:bg-cardinal-500/10",children:[e.jsx(fe,{className:"h-4 w-4"})," Remove friend"]})]})]}):e.jsxs("button",{type:"button",onClick:()=>n("add"),disabled:!!a,className:k,children:[i("add")||e.jsx(G,{className:"h-4 w-4"})," Add friend"]}):e.jsxs(g,{to:"/signup",className:k,children:[e.jsx(G,{className:"h-4 w-4"})," Add friend"]})}const J="flex w-full items-center gap-2.5 px-3.5 py-2 text-left text-sm font-semibold text-slate-700 hover:bg-slate-50 dark:text-stone-200 dark:hover:bg-white/[0.06]";function Be({onClose:s,className:t="",children:a}){const c=f.useRef(null);return f.useEffect(()=>{const n=l=>{c.current&&!c.current.contains(l.target)&&s()},m=l=>{l.key==="Escape"&&s()},r=setTimeout(()=>document.addEventListener("mousedown",n));return window.addEventListener("keydown",m),()=>{clearTimeout(r),document.removeEventListener("mousedown",n),window.removeEventListener("keydown",m)}},[s]),e.jsx("div",{ref:c,role:"menu",className:"absolute z-30 overflow-hidden rounded-2xl bg-white py-1.5 shadow-lg ring-1 ring-black/5 dark:bg-[#1f1f23] dark:ring-white/10 "+t,children:a})}function Ie({url:s,name:t}){const a=ne(),[c,n]=f.useState(!1);async function m(){var r;if(typeof navigator<"u"&&navigator.share&&((r=window.matchMedia)!=null&&r.call(window,"(pointer: coarse)").matches)){try{await navigator.share({title:`${t} on Haylingua`,url:s})}catch{}return}try{await navigator.clipboard.writeText(s),n(!0),a("Profile link copied."),setTimeout(()=>n(!1),1800)}catch{a(`Couldn't copy. The link is ${s}`,"error")}}return e.jsxs("button",{type:"button",onClick:m,className:w+" w-10 px-0 sm:w-auto 
1sm:px-4","aria-label":"Share profile",title:"Copy profile link",children:[c?e.jsx(Z,{className:"h-4 w-4 text-grass-600"}):e.jsx(pe,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:c?"Copied":"Share"})]})}function Me({token:s,path:t,name:a,xp:c,canSee:n,version:m}){const[r,l]=P(async()=>{if(!n)return{private:!0};try{const d=await E(s,`${t}/activity?days=371`,"Couldn't load activity.");return{days:Array.isArray(d==null?void 0:d.days)?d.days:[]}}catch(d){if(d.status===403)return{private:!0};throw d}},[s,t,n,m]),i=r.data;return e.jsx(T,{title:"Activity",children:r.error&&!i?e.jsx(ie,{message:r.error,onRetry:l}):i?i.private?e.jsx(C,{icon:ee,text:`${a} only shares their practice calendar with friends.`}):c===0&&i.days.every(d=>!Number(d==null?void 0:d.value))?e.jsx(C,{icon:V,text:`${a} hasn't practised yet.`}):e.jsx(_e,{days:i.days}):e.jsx(b,{className:"h-36 rounded-2xl"})})}function ze({items:s,name:t,isSelf:a,className:c}){const[n,m]=f.useState(!1),r=n?s:s.slice(0,6);return e.jsx(T,{title:"Achievements",className:c,action:s.length>0?e.jsxs("span",{className:"text-sm font-bold tabular-nums text-slate-400 dark:text-stone-500",children:[s.length," earned"]}):null,children:s.length===0?e.jsx(C,{icon:ge,text:a?"Your achievements will show up here.":`${t} hasn't earned an achievement yet.`}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:r.map(l=>{const i=Le[l.icon]||se;return e.jsxs("div",{className:"rounded-2xl bg-white p-3 ring-1 ring-slate-200 dark:bg-white/[0.03] dark:ring-white/[0.08]",title:l.desc,children:[e.jsx("div",{className:"grid h-10 w-10 place-items-center rounded-xl text-white",style:{backgroundColor:l.color||"#F59E0B"},children:e.jsx(i,{className:"h-5 w-5"})}),e.jsx("div",{className:"mt-2 truncate text-sm font-extrabold text-slate-900 dark:text-white",children:l.title}),l.desc&&e.jsx("div",{className:"line-clamp-2 text-[11px] text-slate-500 dark:text-stone-400",children:l.desc})]},l.id)})}),s.length>6&&e.jsx("button",{type:"button",onClick:()=>m(l=>!l),className:"mt-3 text-sm font-extrabold text-brand-600 hover:underline dark:text-brand-400",children:n?"Show fewer":`Show all ${s.length}`})]})})}function De({token:s,path:t,name:a,isSelf:c,canSee:n,total:m,version:r,className:l}){const[i,d]=f.useState(1),[o,v]=P(async()=>{if(!n)return{private:!0};try{const x=await E(s,`${t}/friends?page=${i}&page_size=${y}`,"Couldn't load friends.");return Array.isArray(x)?{items:x.slice((i-1)*y,i*y),total:x.length}:{items:Array.isArray(x==null?void 0:x.friends)?x.friends:[],total:Number(x==null?void 0:x.total)||0}}catch(x){if(x.status===403)return{private:!0};throw x}},[s,t,n,i,r]),u=o.data,p=u&&!u.private?u.total:m,j=Math.max(1,Math.ceil((p||0)/y));return f.useEffect(()=>{u&&!u.private&&i>j&&d(j)},[u,i,j]),e.jsx(T,{title:"Friends",className:l,action:n&&p>0?e.jsx("span",{className:"text-sm font-bold tabular-nums text-slate-400 dark:text-stone-500",children:p.toLocaleString()}):null,children:o.error&&!u?e.jsx(ie,{message:o.error,onRetry:v}):u?u.private?e.jsx(C,{icon:ee,text:`${a} keeps their friends list private.`}):u.items.length===0?c?e.jsxs("div",{className:"py-4 text-center",children:[e.jsx("p",{className:"text-sm text-slate-500 dark:text-stone-400",children:"You haven't added any friends yet."}),e.jsxs(g,{to:"/friends?tab=find",className:"mt-2 inline-flex items-center gap-1.5 text-sm font-extrabold text-brand-600 hover:underline dark:text-brand-400",children:[e.jsx(A,{className:"h-4 w-4"})," Find friends"]})]}):e.jsx(C,{icon:Q,text:`${a} hasn't added any friends yet.`}):e.jsxs(e.Fragment,{children:[e.jsx("ul",{className:"-mx-1 space-y-0.5 transition-opacity "+(o.refreshing?"opacity-60":""),children:u.items.map(x=>e.jsx(Ye,{friend:x},x.user_id??x.username))}),o.error&&e.jsx("p",{className:"mt-2 text-xs text-cardinal-600 dark:text-cardinal-400",children:o.error}),j>1&&e.jsxs("nav",{"aria-label":"Friends pages",className:"mt-3 flex items-center justify-between gap-3 border-t border-slate-100 pt-3 text-xs text-slate-500 dark:border-white/[0.06] dark:text-stone-400",children:[e.jsxs("span",{className:"tabular-nums",children:[(i-1)*y+1,"–",Math.min(p,i*y)," of ",p]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[o.refreshing&&e.jsx(te,{className:"h-3.5 w-3.5 animate-spin"}),e.jsx("button",{type:"button",onClick:()=>d(x=>
1x-1),disabled:i<=1,className:K,"aria-label":"Previous page",children:e.jsx(be,{className:"h-3.5 w-3.5"})}),e.jsxs("span",{className:"px-1 font-bold tabular-nums",children:[i," / ",j]}),e.jsx("button",{type:"button",onClick:()=>d(x=>x+1),disabled:i>=j,className:K,"aria-label":"Next page",children:e.jsx(je,{className:"h-3.5 w-3.5"})})]})]})]}):e.jsx("div",{className:"space-y-2",children:[0,1,2].map(x=>e.jsxs("div",{className:"flex items-center gap-3 p-1",children:[e.jsx(b,{className:"h-10 w-10 rounded-full"}),e.jsxs("div",{className:"flex-1 space-y-1.5",children:[e.jsx(b,{className:"h-4 w-32"}),e.jsx(b,{className:"h-3 w-20"})]})]},x))})})}const K="grid h-8 w-8 place-items-center rounded-xl ring-1 ring-slate-200 transition hover:bg-slate-50 disabled:opacity-40 dark:ring-white/[0.1] dark:hover:bg-white/[0.04]";function Ye({friend:s}){var l;const[t,a]=f.useState(!1),c=s.name||s.display_name||s.username||"Learner",n=R(s.avatar_url||""),m=s.is_you?"/profile":s.username?`/u/${encodeURIComponent(s.username)}`:null,r=e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"relative shrink-0",children:[e.jsx(re,{frameStyle:s.active_frame_style,rarity:s.active_frame_rarity,size:40,radius:"9999px",thickness:2.5,children:e.jsx("span",{className:"grid h-full w-full place-items-center overflow-hidden rounded-full bg-brand-50 font-display text-sm font-extrabold text-brand-600 dark:bg-brand-500/15 dark:text-brand-400 "+(!s.active_frame_style&&s.is_premium?"ring-2 ring-gold-400":""),children:n&&!t?e.jsx("img",{src:n,alt:"",className:"h-full w-full object-cover",onError:()=>a(!0)}):(l=c[0])==null?void 0:l.toUpperCase()})}),s.is_premium&&e.jsx(Ce,{size:"h-4 w-4",iconSize:"h-2.5 w-2.5"})]}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[e.jsx("span",{className:"truncate text-sm font-extrabold text-slate-900 group-hover:underline group-hover:decoration-slate-300 group-hover:underline-offset-2 dark:text-white",children:e.jsx(ae,{renderKey:s.active_name_tag_style,rarity:s.active_name_tag_rarity,children:c})}),s.is_you?e.jsx("span",{className:"shrink-0 rounded-full bg-slate-100 px-1.5 py-px text-[10px] font-extrabold text-slate-600 dark:bg-white/[0.08] dark:text-stone-300",children:"You"}):s.is_mutual?e.jsx("span",{className:"shrink-0 rounded-full bg-grass-50 px-1.5 py-px text-[10px] font-extrabold text-grass-700 dark:bg-grass-500/15 dark:text-grass-400",children:"Mutual"}):null]}),e.jsxs("span",{className:"block truncate text-xs text-slate-400 dark:text-stone-500",children:[s.username?`@${s.username} · `:"",(Number(s.xp)||0).toLocaleString()," XP"]})]})]});return e.jsx("li",{children:m?e.jsx(g,{to:m,className:"group flex items-center gap-3 rounded-2xl p-1.5 transition hover:bg-slate-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-400 dark:hover:bg-white/[0.03]",children:r}):e.jsx("div",{className:"flex items-center gap-3 p-1.5",children:r})})}function Ge({name:s}
1){return e.jsxs("section",{className:"flex flex-col gap-4 rounded-3xl bg-white p-5 ring-1 ring-slate-200 sm:flex-row sm:items-center sm:p-6 dark:bg-[#18181b] dark:ring-white/[0.08]",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("h2",{className:"font-display text-lg font-extrabold text-slate-900 dark:text-white",children:["Learn Armenian alongside ",s]}),e.jsx("p",{className:"mt-1 text-sm text-slate-500 dark:text-stone-400",children:"Short daily lessons, streaks and friendly leagues. Free to start."})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[e.jsx(g,{to:"/login",className:w,children:"Log in"}),e.jsx(g,{to:"/signup",className:k,children:"Start learning"})]})]})}function U({children:s}){return e.jsx("div",{className:"min-h-screen bg-slate-50/60 dark:bg-[#0d0d0f]",children:e.jsx("div",{className:"mx-auto max-w-5xl space-y-5 px-4 pb-32 pt-6 sm:pt-8",children:s})})}function q({icon:s,iconClass:t,label:a,value:c,to:n}){const m=e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-bold text-slate-500 dark:text-stone-400",children:[e.jsx(s,{className:"h-3.5 w-3.5 "+t})," ",a]}),e.jsx("div",{className:"mt-1 font-display text-2xl font-extrabold tabular-nums leading-tight text-slate-900 dark:text-white",children:c})]}),r="block rounded-2xl bg-slate-50 px-3.5 py-3 ring-1 ring-slate-100 dark:bg-white/[0.03] dark:ring-white/[0.06]";return n?e.jsx(g,{to:n,className:r+" transition hover:ring-slate-300 dark:hover:ring-white/[0.15]",children:m}):e.jsx("div",{className:r,children:m})}function C({icon:s,text:t}){return e.jsxs("div",{className:"flex flex-col items-center gap-2 py-8 text-center",children:[e.jsx("span",{className:"grid h-10 w-10 place-items-center rounded-2xl bg-slate-100 text-slate-400 dark:bg-white/[0.06] dark:text-stone-500",children:e.jsx(s,{className:"h-5 w-5"})}),e.jsx("p",{className:"max-w-xs text-sm text-slate-500 dark:text-stone-400",children:t})]})}function ie({message:s,onRetry:t}){return e.jsxs("div",{className:"flex flex-col items-center gap-2 py-8 text-center",children:[e.jsx("p",{className:"text-sm text-slate-500 dark:text-stone-400",children:s}),e.jsx("button",{type:"button",onClick:t,className:"text-sm font-extrabold text-brand-600 hover:underline dark:text-brand-400",children:"Try again"})]})}function He({handle:s,token:t}){return e.jsxs("section",{className:"rounded-3xl bg-white px-6 py-14 text-center ring-1 ring-slate-200 dark:bg-[#18181b] dark:ring-white/[0.08]",children:[e.jsx("div",{className:"mx-auto grid h-12 w-12 place-items-center rounded-2xl bg-slate-100 text-slate-400 dark:bg-white/[0.06] dark:text-stone-500",children:e.jsx(A,{className:"h-6 w-6"})}),e.jsxs("h1",{className:"mt-3 break-words font-display text-xl font-extrabold text-slate-900 dark:text-white",children:["We couldn't find ",s?`@${s}`:"that learner"]}),e.jsx("p",{className:"mx-auto mt-1 max-w-sm text-sm text-slate-500 dark:text-stone-400",children:"The username may have changed, or the profile is hidden."}),e.jsx("div",{className:"mt-5 flex flex-wrap justify-center gap-2",children:t?e.jsxs(e.Fragment,{children:[e.jsxs(g,{to:"/friends?tab=find",className:k,children:[e.jsx(A,{className:"h-4 w-4"})," Find friends"]}),e.jsx(g,{to:"/leaderboard",className:w,children:"Leaderboard"})]}):e.jsx(g,{to:"/",className:k,children:"Go to Haylingua"})})]})}function Je(){return e.jsxs(U,{children:[e.jsxs("div",{className:"overflow-hidden rounded-3xl bg-white ring-1 ring-slate-200 dark:bg-[#18181b] dark:ring-white/[0.08]",children:[e.jsx(b,{className:"h-28 w-full rounded-none sm:h-40"}),e.jsxs("div",{className:"px-4 pb-5 sm:px-6",children:[e.jsxs("div",{className:"-mt-10 flex items-end gap-4",children:[e.jsx(b,{className:"h-24 w-24 rounded-3xl ring-4 ring-white dark:ring-[#18181b]"}),e.jsxs("div",{className:"space-y-2 pb-1",children:[e.jsx(b,{className:"h-6 w-44"}),e.jsx(b,{className:"h-4 w-28"})]})]}),e.jsx("div",{className:"mt-5 grid grid-cols-2 gap-2.5 sm:grid-cols-4",children:[0,1,2,3].map(s=>e.jsx(b,{className:"h-20 rounded-2xl"},s))})]})]}),e.jsx(b,{className:"h-56 rounded-3xl"})]})}
1export{es as default};
2//# sourceMappingURL=PublicUserPage-9e0a640a.js.map

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.