1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4763],{4763:(e,t,n)=>{"use strict";n.d(t,{LiveActivity:()=>u});var a=n(95155);n(11858);var i=n(12115),c=n(52619),s=n.n(c),l=n(20063),o=n(28768),r=n(12453),m=n(57989);function u(e){let{scopeLabel:t,viewSlug:n,hrefBase:c}=e,[u,d]=(0,i.useState)(null),[h,y]=(0,i.useState)(null),[v,p]=(0,i.useState)(null),x=(0,i.useCallback)(async()=>{try{let[e,n]=await Promise.all([(0,o.f0)(t,{sort:"recent",limit:5}),(0,o.Ty)(t)]);d(e.threads),y(n.leaderboard.slice(0,5))}catch(e){p(e instanceof Error?e.message:String(e))}},[t]);(0,i.useEffect)(()=>{x()},[x]);let g=(0,l.usePathname)()||"/",j="/".concat(g.split("/")[1]||"").replace(/\/$/,"")||"/",f=c||(n?"".concat(j,"/").concat(n,"/community"):"".concat(j,"/community"));return(0,a.jsxs)("section",{className:"community-section community-live",children:[(0,a.jsx)("h2",{className:"community-section-title",children:"Live community"}),(0,a.jsx)("p",{className:"community-section-subtitle",children:"Happening right now â every post ledgered, every upvote mints COIN."}),v&&(0,a.jsxs)("div",{className:"community-live-error",children:["Couldnât load live activity \xb7 ",v]}),(0,a.jsxs)("div",{className:"community-live-grid",children:[(0,a.jsxs)("div",{className:"community-live-threads",children:[(0,a.jsxs)("div",{className:"community-live-heading",children:[(0,a.jsx)("span",{children:"Recent threads"}),(0,a.jsx)(s(),{href:f,className:"community-live-all",children:"View all â"})]}),null===u&&!v&&(0,a.jsx)("div",{className:"community-live-skel",children:"Loadingâ¦"}),u&&0===u.length&&(0,a.jsxs)("div",{className:"community-live-empty",children:["No threads yet."," ",(0,a.jsx)(s(),{href:f,className:"community-live-cta",children:"Start the first one â"})]}),(0,a.jsx)("ul",{className:"community-live-list",children:null==u?void 0:u.map(e=>{let i;return(0,a.jsx)("li",{className:"community-live-thread",children:(0,a.jsxs)(s(),{href:(i=e.id,c?"".concat(c,"/").concat(encodeURIComponent(i)):n?"".concat(j,"/").concat(n,"/community/").concat(encodeURIComponent(i)):"".concat(j,"/community/").concat(encodeURIComponent(i))),className:"community-live-thread-link",children:[(0,a.jsxs)("div",{className:"community-live-thread-head",children:[(0,a.jsx)("span",{className:"community-live-author",children:e.author_display_name||e.author_username}),(0,a.jsx)(r.I,{rank:e.author_rank}),e.tag&&(0,a.jsx)("span",{className:"community-live-tag",children:e.tag}),e.origin_scope!==t&&(0,a.jsx)("span",{className:"community-live-origin",children:e.origin_scope})]}),e.title&&(0,a.jsx)("div",{className:"community-live-title",children:(0,a.jsx)(m.W,{body:e.title,viewSlug:n})}),(0,a.jsx)("p",{className:"community-live-body",children:(0,a.jsx)(m.W,{body:e.body,viewSlug:n})}),(0,a.jsxs)("div",{className:"community-live-meta",children:[(0,a.jsxs)("span",{children:["â² ",e.upvotes]}),(0,a.jsx)("span",{children:"\xb7"}),(0,a.jsxs)("span",{children:[e.reply_count," replies"]}),(0,a.jsx)("span",{children:"\xb7"}),(0,a.jsx)("time",{children:new Date(e.created_at).toLocaleDateString()})]})]})},e.id)})})]}),(0,a.jsxs)("div",{className:"community-live-leaders",children:[(0,a.jsx)("div",{className:"community-live-heading",children:(0,a.jsx)("span",{children:"Top contributors"})}),null===h&&!v&&(0,a.jsx)("div",{className:"community-live-skel",children:"Loadingâ¦"}),h&&0===h.length&&(0,a.jsx)("div",{className:"community-live-empty",children:"Every upvote builds someone up. Be the first."}),(0,a.jsx)("ul",{className:"community-live-leaderlist",children:null==h?void 0:h.map(e=>(0,a.jsxs)("li",{className:"community-live-leader",children:[(0,a.jsx)("div",{className:"community-live-leader-name",children:e.display_name||e.username}),(0,a.jsx)(r.I,{rank:e.rank}),(0,a.jsxs)("span",{className:"community-live-leader-balance",children:[e.coin_balance," â"]})]},e.id))})]})]})]})}},11858:()=>{},12453:(e,t,n)=>{"use strict";n.d(t,{I:()=>c});var a=n(95155);let i={listener:"listener",selector:"selector",curator:"curator",archivist:"archivist",elder:"elder"};function c(e){let{rank:t}=e,n=t||"listener",c=i[n]||String(n);return(0,a.jsx)("span",{className:"inline-flex items-center rounded-full border border-border bg-muted px-2 py-0.5 text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:c})}},20063:(e,t,n)=>{"use strict";var a=n(47260);n.o(a,"useParams")&&n.d(t,{useParams:function(){return a.useParams}}),n.o(a,"usePathname")&&n.d(t,{usePathname:function(){return a.usePathname}}),n.o(a,"useRouter")&&n.d(t,{useRouter:function(){return a.useRouter}}),n.o(a,"useSearchParams")&&n.d(t,{useSearchParams:function(){return a.useSearchParams}})},28768:(e,t,n)=>{"use strict";async function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{body:n,method:a=n?"POST":"GET"}=t,i=await fetch("".concat("/api").concat(e),{method:a,headers:{"Content-Type":"application/json"},body:n?JSON.stringify(n):void 0,credentials:"include"});if(!i.ok){let e=await i.text().catch(()=>i.statusText);throw Error("community ".concat(i.status,": ").concat(e))}return i.json()}function i(e){return e.toLowerCase()}async function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new URLSearchParams;t.sort&&n.set("sort",t.sort),t.tag&&n.set("tag",t.tag),t.limit&&n.set("limit",String(t.limit));let c=n.toString()?"?".concat(n.toString()):"";return a("/talk/".concat(i(e),"/community/threads").concat(c))}async function s(e,t){return a("/talk/".concat(i(e),"/community/threads"),{body:t})}async function l(e,t){return a("/talk/".concat(i(e),"/community/threads/").concat(encodeURIComponent(t)))}async function o(e,t,n){return a("/talk/".concat(i(e),"/community/threads/").concat(encodeURIComponent(t),"/replies"),{body:n})}async function r(e,t,n){return a("/talk/".concat(i(e),"/community/vote"),{body:{target_type:t,target_id:n}})}async function m(e){return a("/talk/".concat(i(e),"/community/leaderboard"))}n.d(t,{EO:()=>o,MG:()=>s,Om:()=>l,Ty:()=>m,f0:()=>c,hm:()=>r})}
1,57989:(e,t,n)=>{"use strict";n.d(t,{W:()=>m});var a=n(95155);n(11858);var i=n(52619),c=n.n(i),s=n(20063);let l=/#([a-z][a-z0-9_]{1,40})/gi,o=/@([A-Za-z][A-Za-z0-9_-]{0,38})/g,r=new Set(["canonic"]);function m(e){let{body:t,viewSlug:n}=e,i=function(e){let t=null==e?"":String(e),n=RegExp(l.source+"|"+o.source,"gi"),a=[],i=0;for(let e of t.matchAll(n)){var c;let n=null!=(c=e.index)?c:0;n>i&&a.push({kind:"text",value:t.slice(i,n)});let s=e[0];if(s.startsWith("#"))a.push({kind:"hashtag",value:s.slice(1).toLowerCase()});else{let e=s.slice(1),t=e.toLowerCase();r.has(t)?a.push({kind:"canonic",value:e}):a.push({kind:"mention",value:e})}i=n+s.length}return i<t.length&&a.push({kind:"text",value:t.slice(i)}),a}(t),m=(0,s.usePathname)()||"/",u="/".concat(m.split("/")[1]||"").replace(/\/$/,"")||"/";return(0,a.jsx)(a.Fragment,{children:i.map((e,t)=>(function(e,t,n,i){if("text"===e.kind)return(0,a.jsx)("span",{children:e.value},t);if("hashtag"===e.kind){let s=n?"".concat(i,"/").concat(n,"/community?tag=").concat(encodeURIComponent(e.value)):"".concat(i,"/community?tag=").concat(encodeURIComponent(e.value));return(0,a.jsxs)(c(),{href:s,className:"community-mention community-mention-hashtag",children:["#",e.value]},t)}return"mention"===e.kind?(0,a.jsxs)(c(),{href:"/users/".concat(encodeURIComponent(e.value)),className:"community-mention community-mention-user",children:["@",e.value]},t):(0,a.jsxs)("span",{className:"community-mention community-mention-canonic",title:"Governed AI layer (summoned by this post)",children:["@",e.value]},t)})(e,t,null!=n?n:"",u))})}}}]);
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.