1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[702],{1406:function(e,a,t){Promise.resolve().then(t.bind(t,441))},441:function(e,a,t){"use strict";t.r(a),t.d(a,{default:function(){return p}});var s=t(7437),r=t(2265),l=t(7648),n=t(9868),i=t(464);function o(e){let a=Date.now()-e;return a<6e4?"just now":a<36e5?"".concat(Math.floor(a/6e4),"m ago"):a<864e5?"".concat(Math.floor(a/36e5),"h ago"):new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function d(e){return"CKB"===e?"var(--primary)":"METAMASK"===e?"var(--warning)":"OKX"===e?"var(--accent)":"var(--text-muted)"}function c(e){let{post:a,index:t,isFork:r=!1}=e,n=a.backlinks.length+1,i=a.content.split(/\s+/).length,d=a.backlinks.length>0?a.backlinks[a.backlinks.length-1].checksum:a.metadata.created_at;return(0,s.jsxs)("div",{className:"dash-card anim-fade-up",style:{animationDelay:"".concat(60*t,"ms"),position:"relative"},children:[r&&(0,s.jsx)("div",{style:{position:"absolute",top:"12px",right:"12px",background:"rgba(124,111,255,0.12)",color:"var(--accent)",border:"1px solid rgba(124,111,255,0.2)",borderRadius:"var(--r-full)",padding:"2px 8px",fontSize:"0.65rem",fontWeight:700},children:"\uD83C\uDF74 FORK"}),a.metadata.tags&&a.metadata.tags.length>0&&(0,s.jsx)("div",{style:{display:"flex",gap:"5px",flexWrap:"wrap",marginBottom:"10px"},children:a.metadata.tags.slice(0,3).map(e=>(0,s.jsx)("span",{className:"tag",style:{fontSize:"0.7rem",padding:"2px 8px"},children:e},e))}),(0,s.jsx)("h3",{style:{fontSize:"1.05rem",fontWeight:700,marginBottom:"6px",color:"var(--text-primary)",lineHeight:1.3},children:a.metadata.title}),a.metadata.description&&(0,s.jsx)("p",{style:{fontSize:"0.83rem",color:"var(--text-secondary)",lineHeight:1.55,marginBottom:"10px",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:a.metadata.description}),(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"10px",fontSize:"0.78rem",color:"var(--text-muted)",marginBottom:"4px",flexWrap:"wrap"},children:[(0,s.jsx)("span",{children:o(a.metadata.created_at)}),(0,s.jsx)("span",{children:"\xb7"}),(0,s.jsxs)("span",{children:[Math.max(1,Math.round(i/200))," min read"]}),(0,s.jsx)("span",{children:"\xb7"}),(0,s.jsxs)("span",{className:"badge badge-append",style:{padding:"1px 8px",fontSize:"0.68rem"},children:["v",n]}),a.backlinks.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{children:"\xb7"}),(0,s.jsxs)("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.72rem"},children:[a.backlinks.length," backlink",1!==a.backlinks.length?"s":""]})]})]}),(0,s.jsxs)("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)",marginBottom:"12px"},children:[a.txHash.slice(0,22),"⦠\xb7 last: #",(d>>>0).toString(16).slice(-4)]}),(0,s.jsxs)("div",{className:"dash-actions",children:[(0,s.jsx)(l.default,{href:"/post/".concat(a.txHash),className:"btn btn-secondary btn-sm",id:"dash-view-".concat(a.txHash.slice(2,8)),children:"\uD83D\uDC41 View"}),(0,s.jsx)(l.default,{href:"/write?append=".concat(a.txHash),className:"btn btn-sm",id:"dash-append-".concat(a.txHash.slice(2,8)),style:{background:"rgba(124,111,255,0.1)",color:"var(--accent)",border:"1px solid rgba(124,111,255,0.2)"},children:"\uD83D\uDD17 Append"}),(0,s.jsx)("button",{className:"btn btn-sm",id:"dash-transfer-".concat(a.txHash.slice(2,8)),style:{background:"rgba(245,158,11,0.08)",color:"var(--warning)",border:"1px solid rgba(245,158,11,0.2)"},onClick:()=>{window.location.href="/post/".concat(a.txHash)},children:"\uD83D\uDCE4 Transfer"})]})]})}function x(e){let{posts:a}=e,t=[];for(let e of a)e.backlinks.forEach((a,s)=>{t.push({txHash:a.tx_hash,title:e.metadata.title,version:s+1,timestamp:e.metadata.created_at-(e.backlinks.length-s)*1e3,checksum:a.checksum,postTxHash:e.txHash})}),t.push({txHash:e.txHash,title:e.metadata.title,version:e.backlinks.length+1,timestamp:e.metadata.created_at,checksum:e.checksum,postTxHash:e.txHash});return(t.sort((e,a)=>a.timestamp-e.timestamp),0===t.length)?(0,s.jsxs)("div",{className:"empty-state card",children:[(0,s.jsx)("div",{className:"empty-icon",children:"\uD83D\uDD70"}),(0,s.jsx)("div",{className:"empty-title",children:"No version history yet"}),(0,s.jsx)("div",{className:"empty-sub",children:"Publish posts and append versions to see your version timeline here."})]}):(0,s.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"0"},children:t.map((e,a)=>(0,s.jsxs)("div",{style:{display:"flex",gap:"16px",alignItems:"flex-start"},children:[(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",flexShrink:0,width:"32px"},children:[(0,s.jsx)("div",{style:{width:"12px",height:"12px",borderRadius:"50%",background:1===e.version?"var(--primary)":"var(--accent)",border:"2px s
1olid var(--bg-card)",flexShrink:0,marginTop:"6px",boxShadow:"0 0 8px ".concat(1===e.version?"var(--primary-glow)":"rgba(124,111,255,0.4)")}}),a<t.length-1&&(0,s.jsx)("div",{style:{width:"2px",flex:1,minHeight:"24px",background:"var(--border)",margin:"4px 0"}})]}),(0,s.jsxs)("div",{style:{flex:1,paddingBottom:"20px"},children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"4px",flexWrap:"wrap"},children:[(0,s.jsx)(l.default,{href:"/post/".concat(e.postTxHash),style:{fontWeight:600,fontSize:"0.9rem",color:"var(--text-primary)"},children:e.title}),(0,s.jsxs)("span",{className:"badge ".concat(1===e.version?"badge-publish":"badge-append"),style:{fontSize:"0.65rem"},children:["v",e.version]})]}),(0,s.jsxs)("div",{style:{display:"flex",gap:"12px",fontSize:"0.75rem",color:"var(--text-muted)",flexWrap:"wrap"},children:[(0,s.jsx)("span",{children:o(e.timestamp)}),(0,s.jsx)("span",{children:"\xb7"}),(0,s.jsxs)("span",{style:{fontFamily:"var(--font-mono)"},children:[e.txHash.slice(0,16),"â¦"]}),(0,s.jsx)("span",{children:"\xb7"}),(0,s.jsxs)("span",{style:{fontFamily:"var(--font-mono)"},children:["Adler32: 0x",(e.checksum>>>0).toString(16).padStart(8,"0")]})]})]})]},"".concat(e.txHash,"-").concat(a)))})}function p(){var e,a;let{walletConnected:t,walletAddress:o,walletType:p,connectWallet:m,myPosts:h,loadMyPosts:u,userLoading:g,txLog:v,pushNotification:f,votes:y,loadVotes:b}=(0,n.o)(),[j,D]=(0,r.useState)("posts"),[k,N]=(0,r.useState)(!1),[S,C]=(0,r.useState)(new Map),[w,B]=(0,r.useState)([]),[z,F]=(0,r.useState)(null);(0,r.useEffect)(()=>{o&&(F(null),u(o).catch(e=>{F(e instanceof Error?e.message:"Failed to load your posts")}))},[o,u]),(0,r.useEffect)(()=>{b()},[b]),(0,r.useEffect)(()=>{h.length>0&&(C((0,i.HU)(h)),B(h.filter(e=>e.backlinks.some(a=>h.find(t=>t.txHash===a.tx_hash&&t.txHash!==e.txHash)))))},[h]);let H=(0,r.useCallback)(()=>{o&&navigator.clipboard.writeText(o).then(()=>{N(!0),f({type:"success",message:"Address copied!",duration:2e3}),setTimeout(()=>N(!1),2e3)})},[o,f]);if(!t)return(0,s.jsx)("div",{className:"page-content narrow",children:(0,s.jsxs)("div",{className:"empty-state",children:[(0,s.jsx)("div",{className:"empty-icon",children:"\uD83D\uDCCA"}),(0,s.jsx)("div",{className:"empty-title",children:"Connect Wallet to Access Dashboard"}),(0,s.jsx)("div",{className:"empty-sub",children:"Your dashboard shows all your CKBFS posts, version history, and quick actions."}),(0,s.jsx)("button",{className:"btn btn-primary btn-lg",onClick:()=>m(),id:"dashboard-connect-btn",children:"Connect Wallet"})]})});let W=v.filter(e=>"fork"===e.operation),T=h.reduce((e,a)=>e+a.backlinks.length+1,0),E=(e=h,a=W.length,10*e.length+3*e.reduce((e,a)=>e+a.backlinks.length,0)+15*a),R=Array.from(S.values()).flat().length,I=h.reduce((e,a)=>{var t,s,r,l;return e+((null!==(r=null===(t=y[a.txHash])||void 0===t?void 0:t.upvotes)&&void 0!==r?r:0)+(null!==(l=null===(s=y[a.txHash])||void 0===s?void 0:s.flags)&&void 0!==l?l:0))},0),A=[{id:"posts",label:"\uD83D\uDCDD My Blogs (".concat(h.length,")")},{id:"forks",label:"\uD83C\uDF74 Forked (".concat(w.length+W.length,")")},{id:"timeline",label:"\uD83D\uDD53 Version Timeline (".concat(T,")")},{id:"earnings",label:"\uD83D\uDCB0 Earnings"},{id:"governance",label:"\uD83D\uDDF3 Governance (".concat(I,")")}];return(0,s.jsxs)("div",{className:"page-content",style:{maxWidth:"1100px"},children:[(0,s.jsxs)("div",{className:"card anim-fade-up",style:{marginBottom:"28px",padding:"24px"},children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:"20px",flexWrap:"wrap"},children:[(0,s.jsx)("div",{style:{width:"64px",height:"64px",borderRadius:"var(--r-lg)",background:"linear-gradient(135deg, var(--primary), var(--accent))",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.5rem",fontWeight:800,color:"#000",flexShrink:0,boxShadow:"0 0 24px var(--primary-glow)"},children:o.slice(-2).toUpperCase()}),(0,s.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"10px",flexWrap:"wrap",marginBottom:"6px"},children:[(0,s.jsx)("h1",{className:"heading-lg",style:{marginBottom:0},children:"My Dashboard"}),p&&(0,s.jsx)("span",{style:{padding:"2px 10px",borderRadius:"var(--r-full)",fontSize:"0.7rem",fontWeight:700,background:"CKB"===p?"rgba(0,212,170,0.1)":"rgba(245,158,11,0.1)",color:d(p),border:"1px solid ".concat(d(p),"33")},children:"CKB"===p?"â JoyID (CKB)":"METAMASK"===p?"\uD83E\uDD8A MetaMask":"OKX"===p?"â OKX":"\uD83D\uDD10 Demo"})]}),(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"12px",flexWrap:"wrap"},children:[(0,s.jsx)("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.82rem",color:"var(--text-secondary)"},children:"".concat(o.slice(0,10),"...").concat(o.slice(-6))}),(0,s.jsx)("button",{className:"copy-btn ".concat(k?"copied":""),onClick:H,style:{fontSize:"0.72rem"},id:"dash-copy-addr",children:k?"â Copied!":"â Copy"})]}),(0,s.jsxs)("div",{style:{display:"flex",gap:"16px",flexWrap:"wrap"},children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px",padding:"6px 14px",background:"rgba(0,212,170,0.06)",border:"1px solid rgba(0,212,170,0.15)",borderRadius:"var(--r-full)"},children:[(0,s.jsx)("span",{style:{fontSize:"0.9rem"},children:"â"}),(0,s.jsxs)("span",{style:{fontSize:"0.8rem",fontWeight:700,color:"var(--primary)"},children:["Rep: ",E]})]}),(0,s.jsxs)("div",{style:{fontSize:"0.8rem",color:"var(--text-muted)",display:"flex",alignItems:"center",gap:"6px"},children:[(0,s.jsxs)("span",{children:["\uD83D\uDCDD ",h.length," posts"]}),(0,s.jsx)("span",{children:"\xb7"}),(0,s.jsxs)("span",{children:["\uD83D\uDD17 ",T," versions"]}),(0,s.jsx)("span",{children:"\xb7"}),(0,s.jsxs)("span",{children:["\uD83C\uDF74 ",R+W.length," forks"]})]})]})]}),(0,s.jsxs)("div",{style:{display:"flex",gap:"8px",flexShrink:0},children:[(0,s.jsx)(l.default,{href:"/write",className:"btn btn-primary btn-sm",id:"dashboard-write-btn",children:"âï¸ New Post"}),(0,s.jsx)(l.default,{href:"/profile",className:"btn btn-secondary btn-sm",id:"dashboard-profile-btn",children:"\uD83D\uDC64 Profile"}),(0,s.jsx)(l.default,{href:"/forks",className:"btn btn-secondary btn-sm",id:"dashboard-forks-btn",children:"\uD83C\uDF74 Fork Explorer"})]})]}),p&&"CKB"!==p&&(0,s.jsxs)("div",{style:{marginTop:"16px",background:"rgba(245,158,11,0.07)",border:"1px solid rgba(245,158,11,0.18)",borderRadius:"var(--r-md)",padding:"10px 16px",display:"flex",alignItems:"center",gap:"10px",fontSize:"0.825rem",color:"var(--warning)"},children:[(0,s.jsx)("span",{children:"â ï¸"}),(0,s.jsxs)("span",{children:[(0,s.jsx)("strong",{children:"Read-only mode."})," Switch to ",(0,s.jsx)("strong",{children:"JoyID (CKB)"})," to publish, append, fork, or transfer posts on CKBFS."]})]})]}),(0,s.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(150px, 1fr))",gap:"12px",marginBottom:"28px"},className:"anim-fade-up",children:[{icon:"\uD83D\uDCDD",label:"Total Posts",value:h.length,accent:"var(--primary)"},{icon:"\uD83D\uDD17",label:"Total Versions",value:T,accent:"var(--accent)"},{icon:"\uD83C\uDF74",label:"Forks",value:R+W.length,accent:"var(--success)"},{icon:"\uD83D\uDCE1",label:"Transactions",value:v.length,accent:"var(--warning)"},{icon:"â",label:"Rep Score",value:E,accent:"var(--primary)"}].map(e=>(0,s.jsxs)("div",{className:"card",style:{textAlign:"center",padding:"18px 14px"},children:[(0,s.jsx)("div",{style:{fontSize:"1.5rem",marginBottom:"4px"},children:e.icon}),(0,s.jsx)("div",{style:{fontSize:"1.65rem",fontWeight:800,color:e.accent,lineHeight:1},children:e.value}),(0,s.jsx)("div",{style:{fontSize:"0.76rem",color:"var(--text-muted)",marginTop:"4px"},children:e.label})]},e.label))}),(0,s.jsx)("div",{style:{display:"flex",gap:"4px",borderBottom:"1px solid var(--border)",marginBottom:"24px"},children:A.map(e=>(0,s.jsx)("button",{id:"dash-tab-".concat(e.id),className:"btn btn-ghost btn-sm",onClick:()=>D(e.id),style:{borderRadius:"var(--r-sm) var(--r-sm) 0 0",borderBottom:j===e.id?"2px solid var(--primary)":"2px solid transparent",color:j===e.id?"var(--primary)":"var(--text-muted)",paddingBottom:"10px",fontSize:"0.85rem"},children:e.label},e.id))}),"posts"===j&&(0,s.jsx)("div",{children:g?(0,s.jsx)("div",{className:"dashboard-grid",children:[1,2,3].map(e=>(0,s.jsx)("div",{className:"skeleton",style:{height:"200px"}},e))}):z?(0,s.jsxs)("div",{className:"error-state",children:[(0,s.jsx)("div",{className:"error-icon",children:"â¡"}),(0,s.jsx)("div",{className:"error-title",children:"Failed to load your posts"}),(0,s.jsx)("div",{className:"error-sub",children:z}),(0,s.jsx)("button",{className:"btn-retry",id:"dash-posts-retry-btn",onClick:()=>{F(null),o&&u(o).catch(e=>F(e instanceof Error?e.message:"Retry failed"))},children:"⺠Retry"})]}):0===h.length?(0,s.jsxs)("div",{className:"empty-state card",children:[(0,s.jsx)("div",{className:"empty-icon",children:"\uD83D\uDCED"}),(0,s.jsx)("div",{className:"empty-title",children:"No posts yet"}),(0,s.jsx)("div",{className:"empty-sub",children:"Start publishing on CKBFS â your posts live permanently on Nervos CKB."}),(0,s.jsx)(l.default,{href:"/write",className:"btn btn-primary",id:"dash-empty-write",children:"âï¸ Write First Post"})]}):(0,s.jsx)("div",{className:"dashboard-grid",children:h.map((e,a)=>(0,s.jsx)(c,{post:e,index:a},e.txHash))})}),"forks"===j&&(0,s.jsxs)("div",{children:[w.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h3",{className:"heading-sm",style:{marginBottom:"14px",color:"var(--text-secondary)"},children:"\uD83C\uDF74 My Fork Branches"}),(0,s.jsx)("div",{className:"dashboard-grid",style:{marginBottom:"28px"},children:w.map((e,a)=>(0,s.jsx)(c,{post:e,index:a,isFork:!0},e.txHash))})]}),W.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h3",{className:"heading-sm",style:{marginBottom:"14px",color:"var(--text-secondary)"},children:"\uD83D\uDCE1 Fork Transactions (On-Chain)"}),(0,s.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:W.map(e=>(0,s.jsx)("div",{className:"card anim-fade-up",style:{padding:"14px 18px"},children:(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"12px",flexWrap:"wrap"},children:[(0,s.jsx)("span",{className:"badge badge-fork",children:"\uD83C\uDF74 Forked"}),(0,s.jsx)("code",{style:{fontFamily:"var(--font-mono)",fontSize:"0.78rem",color:"var(--text-secondary)",flex:1,wordBreak:"break-all"},children:e.txHash}),(0,s.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--text-muted)",flexShrink:0}
1,children:new Date(e.timestamp).toLocaleString()}),(0,s.jsx)(l.default,{href:"/post/".concat(e.txHash),className:"btn btn-ghost btn-sm",style:{fontSize:"0.75rem"},children:"View â"})]})},e.txHash))})]}),S.size>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h3",{className:"heading-sm",style:{margin:"24px 0 14px",color:"var(--text-secondary)"},children:"\uD83C\uDF3F Branches From My Posts"}),Array.from(S.entries()).map(e=>{let[a,t]=e;return(0,s.jsxs)("div",{className:"card",style:{marginBottom:"12px",padding:"16px 20px"},children:[(0,s.jsxs)("div",{style:{fontSize:"0.78rem",color:"var(--text-muted)",marginBottom:"10px",fontFamily:"var(--font-mono)"},children:["Origin: ",a.slice(0,20),"â¦"]}),(0,s.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:t.map(e=>(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"10px",flexWrap:"wrap"},children:[(0,s.jsx)("span",{style:{fontSize:"0.9rem"},children:"\uD83C\uDF3F"}),(0,s.jsx)("span",{style:{fontWeight:600,fontSize:"0.88rem",flex:1},children:e.metadata.title}),(0,s.jsxs)("span",{style:{fontSize:"0.75rem",color:"var(--text-muted)",fontFamily:"var(--font-mono)"},children:[e.txHash.slice(0,14),"â¦"]}),(0,s.jsx)(l.default,{href:"/post/".concat(e.txHash),className:"btn btn-ghost btn-sm",children:"View â"})]},e.txHash))})]},a)})]}),0===w.length&&0===W.length&&0===S.size&&(0,s.jsxs)("div",{className:"empty-state card",children:[(0,s.jsx)("div",{className:"empty-icon",children:"\uD83C\uDF74"}),(0,s.jsx)("div",{className:"empty-title",children:"No forks yet"}),(0,s.jsx)("div",{className:"empty-sub",children:"Fork any post on the Feed to inherit its version history and create your own branch."}),(0,s.jsxs)("div",{style:{display:"flex",gap:"10px",justifyContent:"center"},children:[(0,s.jsx)(l.default,{href:"/",className:"btn btn-secondary",children:"Browse Feed"}),(0,s.jsx)(l.default,{href:"/forks",className:"btn btn-secondary",children:"Fork Explorer"})]})]})]}),"timeline"===j&&(0,s.jsx)("div",{children:g?(0,s.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"16px"},children:[1,2,3,4].map(e=>(0,s.jsx)("div",{className:"skeleton",style:{height:"60px"}},e))}):z?(0,s.jsxs)("div",{className:"error-state",children:[(0,s.jsx)("div",{className:"error-icon",children:"â¡"}),(0,s.jsx)("div",{className:"error-title",children:"Failed to load timeline"}),(0,s.jsx)("div",{className:"error-sub",children:z}),(0,s.jsx)("button",{className:"btn-retry",onClick:()=>{F(null),o&&u(o).catch(e=>F(e instanceof Error?e.message:"Retry failed"))},children:"⺠Retry"})]}):(0,s.jsx)(x,{posts:h})}),"earnings"===j&&(()=>{let e=v.filter(e=>"tip"===e.operation),a=h.filter(e=>!!e.metadata.is_paid),t=a.length,r=e.reduce((e,a)=>{var t;return e+(null!==(t=a.amount)&&void 0!==t?t:0)},0);return(0,s.jsxs)("div",{className:"anim-fade-in",children:[(0,s.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(160px, 1fr))",gap:"12px",marginBottom:"28px"},children:[{icon:"\uD83D\uDCB8",label:"Tips Received",value:"".concat(r.toFixed(0)," CKB"),accent:"var(--warning)"},{icon:"\uD83D\uDD12",label:"Paid Posts",value:t,accent:"var(--accent)"},{icon:"\uD83D\uDCC5",label:"Tip Events",value:e.length,accent:"var(--primary)"}].map(e=>(0,s.jsxs)("div",{className:"card",style:{textAlign:"center",padding:"18px 14px"},children:[(0,s.jsx)("div",{style:{fontSize:"1.5rem",marginBottom:"4px"},children:e.icon}),(0,s.jsx)("div",{style:{fontSize:"1.5rem",fontWeight:800,color:e.accent,lineHeight:1},children:e.value}),(0,s.jsx)("div",{style:{fontSize:"0.76rem",color:"var(--text-muted)",marginTop:"4px"},children:e.label})]},e.label))}),t>0?(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"heading-sm",style:{marginBottom:"14px",color:"var(--text-secondary)"},children:"\uD83D\uDD12 Your Paid Posts"}),(0,s.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:a.map(e=>{var a;let t=null!==(a=e.metadata.unlock_price)&&void 0!==a?a:10;return(0,s.jsx)("div",{className:"card",style:{padding:"14px 18px"},children:(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"12px",flexWrap:"wrap"},children:[(0,s.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,s.jsx)("div",{style:{fontWeight:600,fontSize:"0.95rem",marginBottom:"3px"},children:e.metadata.title}),(0,s.jsxs)("div",{style:{fontSize:"0.75rem",color:"var(--text-muted)",fontFamily:"var(--font-mono)"},children:[e.txHash.slice(0,22),"â¦"]})]}),(0,s.jsxs)("span",{style:{padding:"3px 12px",borderRadius:"var(--r-full)",background:"rgba(245,158,11,0.1)",color:"var(--warning)",border:"1px solid rgba(245,158,11,0.25)",fontSize:"0.82rem",fontWeight:700,flexShrink:0},children:["â¡ ",t," CKB unlock"]}),(0,s.jsx)(l.default,{href:"/post/".concat(e.txHash),className:"btn btn-ghost btn-sm",children:"View â"})]})},e.txHash)})})]}):(0,s.jsxs)("div",{className:"empty-state card",children:[(0,s.jsx)("div",{className:"empty-icon",children:"\uD83D\uDCB0"}),(0,s.jsx)("div",{className:"empty-title",children:"No paid posts yet"}),(0,s.jsx)("div",{className:"empty-sub",children:"Enable the paid toggle in the editor when writing a post to monetize your content on-chain."}),(0,s.jsx)(l.default,{href:"/write",className:"btn btn-primary",id:"earnings-write-btn",children:"âï¸ Write a Paid Post"})]}),e.length>0&&(0,s.jsxs)("div",{style:{marginTop:"28px"},children:[(0,s.jsx)("h3",{className:"heading-sm",style:{marginBottom:"14px",color:"var(--text-secondary)"},children:"\uD83D\uDCB8 Tip History"}),(0,s.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:e.map(e=>(0,s.jsxs)("div",{className:"card",style:{padding:"12px 16px",display:"flex",alignItems:"center",gap:"12px",flexWrap:"wrap"},children:[(0,s.jsx)("span",{className:"badge badge-publish",style:{fontSize:"0.65rem"},children:"\uD83D\uDCB8 Tip"}),(0,s.jsx)("code",{style:{fontFamily:"var(--font-mono)",fontSize:"0.76rem",color:"var(--text-secondary)",flex:1,wordBreak:"break-all"},children:e.txHash}),(0,s.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--text-muted)",flexShrink:0}
1,children:new Date(e.timestamp).toLocaleString()})]},e.txHash))})]})]})})(),"governance"===j&&(0,s.jsxs)("div",{className:"anim-fade-in",children:[(0,s.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(150px, 1fr))",gap:"12px",marginBottom:"28px"},children:[{icon:"\uD83D\uDC4D",label:"Total Upvotes",value:h.reduce((e,a)=>{var t,s;return e+(null!==(s=null===(t=y[a.txHash])||void 0===t?void 0:t.upvotes)&&void 0!==s?s:0)},0),color:"var(--primary)"},{icon:"\uD83D\uDEA9",label:"Total Flags",value:h.reduce((e,a)=>{var t,s;return e+(null!==(s=null===(t=y[a.txHash])||void 0===t?void 0:t.flags)&&void 0!==s?s:0)},0),color:"var(--error)"},{icon:"\uD83D\uDCCA",label:"Net Score",value:h.reduce((e,a)=>{var t;let s=null!==(t=y[a.txHash])&&void 0!==t?t:{upvotes:0,flags:0};return e+s.upvotes-s.flags+a.backlinks.length},0),color:"var(--accent)"}].map(e=>(0,s.jsxs)("div",{className:"card",style:{textAlign:"center",padding:"16px 12px"},children:[(0,s.jsx)("div",{style:{fontSize:"1.4rem",marginBottom:"4px"},children:e.icon}),(0,s.jsx)("div",{style:{fontSize:"1.4rem",fontWeight:800,color:e.color,lineHeight:1},children:e.value}),(0,s.jsx)("div",{style:{fontSize:"0.74rem",color:"var(--text-muted)",marginTop:"4px"},children:e.label})]},e.label))}),0===h.length?(0,s.jsxs)("div",{className:"empty-state card",children:[(0,s.jsx)("div",{className:"empty-icon",children:"\uD83D\uDDF3"}),(0,s.jsx)("div",{className:"empty-title",children:"No votes yet"}),(0,s.jsx)("div",{className:"empty-sub",children:"Publish posts to start receiving community votes."})]}):(0,s.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:h.map(e=>{var a;let t=null!==(a=y[e.txHash])&&void 0!==a?a:{upvotes:0,flags:0,userVote:null},s=t.upvotes-t.flags+e.backlinks.length;return{post:e,v:t,score:s}}).sort((e,a)=>a.score-e.score).map(e=>{let{post:a,v:t,score:r}=e,n=r>=3||t.upvotes>=2&&0===t.flags;return(0,s.jsx)("div",{className:"card",style:{padding:"14px 18px",border:n?"1px solid rgba(0,212,170,0.25)":void 0},children:(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"12px",flexWrap:"wrap"},children:[(0,s.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"4px",flexWrap:"wrap"},children:[n&&(0,s.jsx)("span",{style:{padding:"1px 8px",borderRadius:"var(--r-full)",background:"rgba(0,212,170,0.1)",color:"var(--primary)",border:"1px solid rgba(0,212,170,0.2)",fontSize:"0.62rem",fontWeight:700},children:"\uD83D\uDD25 TRENDING"}),(0,s.jsx)("span",{style:{fontWeight:600,fontSize:"0.95rem"},children:a.metadata.title})]}),(0,s.jsxs)("div",{style:{fontSize:"0.73rem",color:"var(--text-muted)",fontFamily:"var(--font-mono)"},children:[a.txHash.slice(0,22),"â¦"]})]}),(0,s.jsxs)("div",{style:{display:"flex",gap:"6px",alignItems:"center",flexShrink:0},children:[(0,s.jsxs)("span",{style:{padding:"3px 10px",borderRadius:"var(--r-full)",background:"rgba(0,212,170,0.08)",color:"var(--primary)",border:"1px solid rgba(0,212,170,0.15)",fontSize:"0.78rem",fontWeight:600},children:["\uD83D\uDC4D ",t.upvotes]}),(0,s.jsxs)("span",{style:{padding:"3px 10px",borderRadius:"var(--r-full)",background:t.flags>0?"rgba(239,68,68,0.07)":"var(--bg-elevated)",color:t.flags>0?"var(--error)":"var(--text-muted)",border:"1px solid ".concat(t.flags>0?"rgba(239,68,68,0.2)":"var(--border)"),fontSize:"0.78rem",fontWeight:600},children:["\uD83D\uDEA9 ",t.flags]}),(0,s.jsxs)("span",{style:{padding:"3px 10px",borderRadius:"var(--r-full)",background:r>0?"rgba(124,111,255,0.08)":"var(--bg-elevated)",color:r>0?"var(--accent)":"var(--text-muted)",border:"1px solid var(--border)",fontSize:"0.78rem",fontWeight:700},children:[r>0?"+":"",r]}),(0,s.jsx)(l.default,{href:"/post/".concat(a.txHash),className:"btn btn-ghost btn-sm",children:"View â"})]})]})},a.txHash)})})]})]})}}},function(e){e.O(0,[150,201,648,902,971,117,744],function(){return e(e.s=1406)}),_N_E=e.O()}]);
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.