PageSourceSearch

https://soulgraph.ai/assets/discovery-6FVRoYl8.js

js soulgraph.ai collected 2026-10-05 16:09:33 UTC 14,392 bytes, 1 lines download raw bytes

1import{s as e}from"./chunk-Bj-mKKzh.js";import{t}from"./jsx-runtime-9zIKqHjp.js";import{t as n}from"./react-lfn1e_wp.js";import{t as r}from"./react-dom-DFtjr_hy.js";import{t as i}from"./link-81Lv4y4q.js";import{t as a}from"./useInfiniteQuery-fmlUYjM8.js";import{t as o}from"./useSuspenseQuery-BAdSlok6.js";import{t as s}from"./utils-B-mp9Lbn.js";import{t as c}from"./skeleton-DUUiToE9.js";import{C as l,T as u,g as d,h as f,w as p}from"./main-D6NiRary.js";import{t as m}from"./button-hdicHEqj.js";import{a as h,i as g,n as _,r as v,t as y}from"./toggle-group-ZZBFMKEM.js";import{o as b,t as x}from"./user-avatar-C3DuUMQH.js";import{t as S}from"./icon-0M-qiG7o.js";var C=b(`shuffle`,[[`path`,{d:`m18 14 4 4-4 4`,key:`10pe0f`}],[`path`,{d:`m18 2 4 4-4 4`,key:`pucp1d`}],[`path`,{d:`M2 18h1.973a4 4 0 0 0 3.3-1.7l5.454-8.6a4 4 0 0 1 3.3-1.7H22`,key:`1ailkh`}],[`path`,{d:`M2 6h1.972a4 4 0 0 1 3.6 2.2`,key:`km57vx`}],[`path`,{d:`M22 18h-6.041a4 4 0 0 1-3.3-1.8l-.359-.45`,key:`os18l9`}]]),w=e(n(),1),T=t(),E=(0,w.memo)(function({creator:e,className:t}){return(0,T.jsx)(`article`,{className:s(`group relative w-[124px] flex-shrink-0 rounded-3xl md:w-[148px]`,t),children:(0,T.jsxs)(i,{to:`/profile/$username`,params:{username:e.username},preload:`intent`,className:`flex flex-col items-center gap-2 rounded-3xl border border-border/40 bg-card/40 p-3 text-center transition-colors duration-150 group-hover:border-border/70 group-hover:bg-card`,children:[(0,T.jsx)(x,{name:e.username,src:e.avatar_url,hasFounderBadge:e.has_founder_badge,className:`size-16 ring-1 ring-border/60 transition-[box-shadow] duration-150 group-hover:ring-border md:size-20`}),(0,T.jsxs)(`div`,{className:`flex min-w-0 flex-col items-center gap-1`,children:[(0,T.jsxs)(`span`,{className:`line-clamp-1 max-w-full text-sm font-semibold leading-tight text-foreground`,children:[`@`,e.username]}),(0,T.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] tabular-nums text-foreground/80`,children:[(0,T.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,T.jsx)(S,{name:`mode_comment`,size:14,fill:!0,className:`text-foreground/55`}),(0,T.jsx)(`span`,{className:`font-semibold`,children:h(e.total_messages)})]}),(0,T.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,T.jsx)(S,{name:`favorite`,size:14,fill:!0,className:`text-foreground/55`}),(0,T.jsx)(`span`,{className:`font-semibold`,children:h(e.total_likes)})]})]})]})]})})}),D=`happy`,O=(0,w.memo)(function({soul:e,index:t=0,className:n,hideCreator:r}){let a=(0,w.useRef)(null),o=(0,w.useRef)(null),c=(0,w.useRef)(null),d=(0,w.useRef)(null),[f,m]=(0,w.useState)(!1),[_,v]=(0,w.useState)(!1),[y,b]=(0,w.useState)(!1),[C,E]=(0,w.useState)(!1),O=(0,w.useMemo)(()=>l(e,`card`),[e.cf_image_id]),k=(0,w.useMemo)(()=>p(e),[e.idle_animation_url]),A=(0,w.useMemo)(()=>u(e),[e.reactions_json])[D],j=!!(e.animations_generated&&k),M=!!(e.reactions_json&&A),N=t<1,[P,F]=g();(0,w.useEffect)(()=>{let e=a.current;if(!e)return;if(N){m(!0);return}let t=new IntersectionObserver(([e])=>{e.isIntersecting&&(m(!0),t.disconnect())},{rootMargin:`100px`});return t.observe(e),()=>t.disconnect()},[N]),(0,w.useEffect)(()=>{let e=o.current;if(!e||!f||!j)return;let t=()=>{v(!0),e.play().catch(()=>{})};return e.addEventListener(`loadeddata`,t),e.readyState>=2&&t(),e.play().catch(()=>{}),()=>e.removeEventListener(`loadeddata`,t)},[f,j]);let I=(0,w.useCallback)(()=>{if(!M||!_||C)return;let e=c.current;if(!e)return;d.current?.abort();let t=new AbortController;d.current=t,e.currentTime=0,e.play().catch(()=>{}),e.addEventListener(`playing`,()=>{E(!0),b(!0)},{once:!0,signal:t.signal})},[M,_,C]),L=(0,w.useCallback)(()=>{d.current?.abort(),d.current=null,E(!1),b(!1)},[]),R=(0,w.useCallback)(()=>{let e=o.current,t=d.current?.signal;e?(e.currentTime=0,e.addEventListener(`seeked`,()=>{b(!1),E(!1)},{once:!0,...t?{signal:t}:{}})):(b(!1),E(!1))},[]);return(0,w.useEffect)(()=>()=>{d.current?.abort(),d.current=null},[]),(0,T.jsxs)(`article`,{ref:a,className:s(`group relative isolate w-[168px] flex-shrink-0 rounded-3xl md:w-[200px]`,n),onMouseEnter:I,onMouseLeave:L,children:[(0,T.jsx)(i,{to:`/souls/$soulId`,params:{soulId:e.id},preload:`intent`,className:`block`,children:(0,T.jsxs)(`div`,{className:`relative overflow-hidden rounded-2xl bg-muted`,style:{aspectRatio:`9 / 16`},children:[O&&f&&(0,T.jsx)(`img`,{src:O,alt:e.name,className:`absolute inset-0 h-full w-full object-cover`,loading:N?`eager`:`lazy`,fetchPriority:N?`high`:`auto`}),j&&f&&(0,T.jsx)(`video`,{ref:o,src:k,className:`absolute inset-0 h-full w-full object-cover`,style:{zIndex:1,opacity:_?1:0}
1,playsInline:!0,muted:!0,loop:!0,preload:`auto`}),M&&f&&(0,T.jsx)(`video`,{ref:c,src:A,className:`absolute inset-0 h-full w-full object-cover`,style:{zIndex:2,opacity:y?1:0},playsInline:!0,muted:!0,preload:`metadata`,onEnded:R}),(0,T.jsxs)(`div`,{className:s(`absolute bottom-2 right-2 z-10 flex items-center gap-2 rounded-md bg-black/75 px-1.5 py-0.5 backdrop-blur-sm transition-opacity duration-150 ease-out`,e.description&&`group-hover:opacity-0`),children:[(0,T.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,T.jsx)(S,{name:`mode_comment`,size:14,fill:!0,className:`text-white/90`}),(0,T.jsx)(`span`,{className:`text-[11px] font-medium text-white tabular-nums`,children:h(e.message_count)})]}),(0,T.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,T.jsx)(S,{name:`thumb_up`,size:14,fill:!0,className:`text-white/90`}),(0,T.jsx)(`span`,{className:`text-[11px] font-medium text-white tabular-nums`,children:h(e.like_count)})]})]}),e.description&&(0,T.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-x-0 bottom-0 z-[5] translate-y-1 bg-gradient-to-t from-black via-black/80 via-35% to-transparent px-3 pb-3 pt-14 opacity-0 transition-[opacity,transform] duration-[180ms] ease-[cubic-bezier(0.16,1,0.3,1)] group-hover:translate-y-0 group-hover:opacity-100`,style:{textWrap:`pretty`},children:(0,T.jsx)(`p`,{className:`line-clamp-3 text-[11.5px] leading-relaxed text-white/95`,children:e.description})})]})}),(0,T.jsx)(`div`,{className:`mt-2`,children:r?(0,T.jsx)(`h3`,{className:`truncate text-sm font-semibold text-foreground`,children:e.name}):(0,T.jsxs)(`div`,{className:`flex gap-2.5`,children:[e.creator&&(0,T.jsx)(i,{to:`/profile/$username`,params:{username:e.creator.username},className:`flex-shrink-0`,children:(0,T.jsx)(x,{className:`size-8`,name:e.creator.username,src:e.creator.avatar_url,hasFounderBadge:e.creator.has_founder_badge})}),(0,T.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,T.jsx)(i,{to:`/souls/$soulId`,params:{soulId:e.id},preload:`intent`,className:`block`,children:(0,T.jsx)(`h3`,{ref:P,title:F?e.name:void 0,className:`line-clamp-2 text-sm font-semibold leading-tight text-foreground`,children:e.name})}),e.creator&&(0,T.jsxs)(i,{to:`/profile/$username`,params:{username:e.creator.username},className:`mt-0.5 block truncate text-[11px] text-muted-foreground transition-colors duration-100 group-hover:text-foreground hover:text-foreground`,children:[`by @`,e.creator.username]})]})]})}),(0,T.jsx)(`span`,{"aria-hidden":!0,className:`pointer-events-none absolute -inset-2 -z-10 origin-center scale-90 rounded-[inherit] bg-foreground
1/[0.08] opacity-0 transition-all duration-100 ease-out group-hover:scale-100 group-hover:opacity-100`})]})}),k=(0,w.memo)(function({soul:e,index:t=0,className:n,hideCreator:r}){let a=(0,w.useMemo)(()=>l(e,`card`),[e.cf_image_id]),o=e.tags??[],c=t<4,[u,d]=g();return(0,T.jsx)(`article`,{className:s(`group relative w-[280px] flex-shrink-0 rounded-3xl md:w-[360px]`,n),children:(0,T.jsxs)(`div`,{className:`relative flex gap-3 rounded-3xl border border-border/40 bg-card/40 p-3 transition-colors duration-150 group-hover:border-border/70 group-hover:bg-card`,children:[(0,T.jsx)(`div`,{className:`relative w-24 aspect-[9/16] overflow-hidden rounded-xl bg-muted flex-shrink-0`,children:a&&(0,T.jsx)(`img`,{src:a,alt:e.name,className:`absolute inset-0 h-full w-full object-cover`,loading:c?`eager`:`lazy`,fetchPriority:c?`high`:`auto`})}),(0,T.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,T.jsx)(i,{to:`/souls/$soulId`,params:{soulId:e.id},preload:`intent`,className:`block before:absolute before:inset-0 before:rounded-2xl before:content-['']`,children:(0,T.jsx)(`h3`,{ref:u,title:d?e.name:void 0,className:`line-clamp-1 text-sm font-semibold leading-tight text-foreground`,children:e.name})}),(0,T.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 text-[11px]`,children:[!r&&e.creator&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(i,{to:`/profile/$username`,params:{username:e.creator.username},className:`relative z-10 min-w-0 truncate text-muted-foreground transition-colors duration-100 group-hover:text-foreground hover:text-foreground`,children:[`by @`,e.creator.username]}),(0,T.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 text-muted-foreground/50`,children:`·`})]}),(0,T.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 tabular-nums text-foreground/80`,children:[(0,T.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,T.jsx)(S,{name:`mode_comment`,size:14,fill:!0,className:`text-foreground/55`}),(0,T.jsx)(`span`,{className:`font-semibold`,children:h(e.message_count)})]}),(0,T.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,T.jsx)(S,{name:`favorite`,size:14,fill:!0,className:e.is_liked?`text-destructive`:`text-foreground/55`}),(0,T.jsx)(`span`,{className:`font-semibold`,children:h(e.like_count)})]})]})]}),e.description&&(0,T.jsx)(`p`,{className:`mt-1 line-clamp-4 text-[11px] leading-snug text-muted-foreground/90`,children:e.description}),o.length>0&&(0,T.jsx)(`div`,{className:`mt-auto flex flex-wrap gap-1 pt-1.5`,children:o.map(e=>(0,T.jsx)(v,{variant:`secondary`,className:`px-1.5 py-0 text-[10px] font-normal`,children:e},e))})]})]})})}),A=e(r(),1),j=`explore-random-seed`;function M(){return Math.floor(Math.random()*4294967295)+1}function N(){if(typeof window>`u`)return M();try{let e=sessionStorage.getItem(j);if(e){let t=Number.parseInt(e,10);if(Number.isFinite(t)&&t>0)return t}let t=M();return sessionStorage.setItem(j,String(t)),t}catch{return M()}}var P={label:`All souls`,value:``},F=`md:grid-cols-[repeat(auto-fill,minmax(180px,1fr))] md:max-w-[1320px]`,I=(0,w.memo)(function(){let{data:e}=o(f()),[t,n]=(0,w.useState)(P.value),[r,i]=(0,w.useState)(()=>N()),a=(0,w.useMemo)(()=>[P,...e.tags.map(e=>({label:e.tag,value:e.tag}))],[e.tags]),s=(0,w.useCallback)(()=>{let e=M();if(i(e),typeof window<`u`)try{sessionStorage.setItem(j,String(e))}catch{}},[]),c=t===P.value;return(0,T.jsxs)(`section`,{className:`space-y-3 md:pb-16`,children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,T.jsx)(`h2`,{className:`text-lg font-medium tracking-tight`,children:`Discover more souls`}),c&&(0,T.jsxs)(m,{type:`button`,variant:`ghost`,size:`sm`,onClick:s,className:`gap-1.5 text-muted-foreground hover:text-foreground`,"aria-label":`Shuffle souls`,children:[(0,T.jsx)(C,{className:`size-4`}),(0,T.jsx)(`span`,{className:`hidden sm:inline`,children:`Shuffle`})]})]}),(0,T.jsx)(z,{pills:a,selected:t,onSelect:n}),(0,T.jsx)(B,{tag:t,randomSeed:r})]})}),L=`__recommended__`,R=44;function z({pills:e,selected:t,onSelect:n}){let r=(0,w.useRef)(null),[i,a]=(0,w.useState)(!1),[o,c]=(0,w.useState)(null);(0,w.useEffect)(()=>{let e=r.current,t=document.getElementById(`header-slot`);if(!e||!t)return;let n=window.matchMedia(`(min-width: 768px)`);
1if(n.matches)return;c(t);let i=new IntersectionObserver(([e])=>{a(!e.isIntersecting&&e.boundingClientRect.top<56)},{rootMargin:`-56px 0px 0px 0px`});i.observe(e);let o=n=>{n.matches?(i.disconnect(),a(!1),c(null)):(c(t),i.observe(e))};return n.addEventListener(`change`,o),()=>{i.disconnect(),n.removeEventListener(`change`,o)}},[]);let l=(0,T.jsx)(`div`,{className:`no-scrollbar flex overflow-x-auto overflow-y-hidden overscroll-x-contain px-4 py-2`,children:(0,T.jsx)(y,{type:`single`,value:t||L,onValueChange:e=>{e&&n(e===L?``:e)},spacing:2,"aria-label":`Filter characters by tag`,children:e.map(e=>(0,T.jsx)(_,{value:e.value||L,size:`sm`,className:s(`shrink-0 rounded-full px-3.5`,`data-[state=on]:bg-foreground data-[state=on]:text-background data-[state=on]:hover:bg-foreground/90`,`data-[state=off]:bg-secondary data-[state=off]:text-secondary-foreground data-[state=off]:hover:bg-secondary/80`),children:e.label},e.value||L))})}),u=i&&o;return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`div`,{ref:r,className:`-mx-4 bg-background md:sticky md:top-[var(--header-height)] md:z-30`,style:u?{height:R}:void 0,children:!u&&l}),u&&(0,A.createPortal)((0,T.jsx)(`div`,{className:`bg-background`,children:l}),o)]})}function B({tag:e,randomSeed:t}){let n=e===``,{data:r,isFetching:i,isFetchingNextPage:o,hasNextPage:c,fetchNextPage:l,isPending:u}=a(d(e,n?`random`:`trending`,n?t:void 0)),f=(0,w.useRef)(null),p=(0,w.useRef)(o);p.current=o,(0,w.useEffect)(()=>{let e=f.current;if(!e||!c)return;let t=new IntersectionObserver(([e])=>{e.isIntersecting&&!p.current&&l()},{rootMargin:`600px`});return t.observe(e),()=>t.disconnect()},[c,l]);let m=(0,w.useMemo)(()=>r?.pages.flatMap(e=>e.souls)??[],[r]);return u?(0,T.jsx)(V,{}):m.length===0?(0,T.jsx)(`div`,{className:`py-12 text-center text-sm text-muted-foreground`,children:`No characters found for this tag yet.`}):(0,T.jsxs)(`div`,{className:`relative`,children:[(0,T.jsx)(`div`,{className:s(`grid gap-x-4 gap-y-6 transition-opacity md:gap-x-6`,`grid-cols-2 ${F}`,i&&!o?`opacity-60`:`opacity-100`),children:m.map((e,t)=>(0,T.jsx)(O,{soul:e,index:t,className:`w-full`},e.id))}),c&&(0,T.jsx)(`div`,{ref:f,className:`h-4`,"aria-hidden":`true`}),o&&(0,T.jsx)(`div`,{className:`mt-4 flex justify-center`,children:(0,T.jsx)(`div`,{className:`size-6 animate-spin rounded-full border-2 border-muted-foreground/30 border-t-foreground`})})]})}function V(){return(0,T.jsx)(`div`,{className:s(`grid grid-cols-2 gap-x-4 gap-y-6 md:gap-x-6`,F),children:Array.from({length:12}).map((e,t)=>(0,T.jsxs)(`div`,{className:`w-full p-2`,children:[(0,T.jsx)(c,{className:`aspect-[9/16] rounded-2xl`}),(0,T.jsxs)(`div`,{className:`mt-3 flex gap-2.5`,children:[(0,T.jsx)(c,{className:`size-8 rounded-full`}),(0,T.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,T.jsx)(c,{className:`h-4 w-3/4`}),(0,T.jsx)(c,{className:`h-3 w-1/2`})]})]})]},t))})}export{E as a,O as i,I as n,k as r,V as t};

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.