Spaces:
Running
Running
Sync paperswithcode.co frontend
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- assets/AiDeadlinesView-DFIdl2-r.js +3 -0
- assets/AiDeadlinesView-jB2RCKBD.js +0 -3
- assets/AuthorDetailView-D9jotdn7.js +0 -1
- assets/AuthorDetailView-Dts5rRb7.js +1 -0
- assets/BenchmarkDetailView-DGhP-b56.js +0 -2
- assets/BenchmarkDetailView-DeWqlCgO.js +2 -0
- assets/{BenchmarkTrendSparkline-Dlqui5GJ.js → BenchmarkTrendSparkline-BuEjzb26.js} +1 -1
- assets/{ChatMessage-D_TPRkPx.js → ChatMessage-CAUQ_QtF.js} +1 -1
- assets/{ChatView-C0rvV3ZL.js → ChatView-DFvnOigo.js} +2 -2
- assets/ConferenceDetailView-COgeAJN1.js +1 -0
- assets/ConferenceDetailView-CX3GajW1.js +0 -1
- assets/ConferenceTaskView-B1Bvx50f.js +1 -0
- assets/ConferenceTaskView-ZWGgeN9m.js +0 -1
- assets/ConferencesIndexView-D-Jz9kvY.js +0 -1
- assets/ConferencesIndexView-fTTtkWk7.js +1 -0
- assets/ContributionsPage-C-0arJ2b.js +0 -1
- assets/{CronDashboard-BSuTDx3G.js → CronDashboard-BUZ6-TPS.js} +2 -2
- assets/ExternalSourceEvalBadge-B1HOv2kK.js +1 -0
- assets/ExternalSourceEvalBadge-Bj021N_r.js +0 -1
- assets/FeedView-BHzhLVDR.js +1 -0
- assets/FeedView-CCitzMti.js +0 -1
- assets/FrameworksIndexView-DFIr-ZfH.js +1 -0
- assets/FrameworksIndexView-cSMnT2di.js +0 -1
- assets/{LatexTitle-CTfnj_ow.js → LatexTitle-RPgzE218.js} +1 -1
- assets/{MarkdownText-BGIn3wwa.js → MarkdownText-DnDQoKAJ.js} +1 -1
- assets/MethodDetailView-DVg6tdK9.js +0 -1
- assets/MethodDetailView-Dt1BuIWd.js +1 -0
- assets/{MethodsIndexView-hjMJLx2t.js → MethodsIndexView-DOFTE224.js} +2 -2
- assets/{NotFound-O3oWHFDY.js → NotFound-CwXaMVr4.js} +1 -1
- assets/OrganizationContributionGraph-Cpz_9NUw.js +1 -0
- assets/OrganizationDetailView-956TUhPi.js +0 -1
- assets/OrganizationDetailView-C1Z_ST73.js +1 -0
- assets/OrganizationPaperFeed-96h3oCF6.js +0 -1
- assets/OrganizationPaperFeed-DqqJkZCx.js +1 -0
- assets/OrganizationTaskView-BKRzD2Ma.js +1 -0
- assets/OrganizationTaskView-DQN9i-k7.js +0 -1
- assets/OrganizationsIndexView-C4DiZhwT.js +1 -0
- assets/OrganizationsIndexView-C9OYrBKZ.js +0 -1
- assets/{PaperDetailView-Cuitl1mm.js → PaperDetailView-Cc0Jime0.js} +0 -0
- assets/{PaperPreviewLink-n0bYaW06.js → PaperPreviewLink-BPqigL3n.js} +1 -1
- assets/PapersListView-C9YHs8aI.js +1 -0
- assets/PapersListView-DaDEc__t.js +0 -1
- assets/{PrivacyView-COVowARX.js → PrivacyView-_LBl02c6.js} +1 -1
- assets/RateLimitsView-DWAityrz.js +1 -0
- assets/SavedPapersView-BI6TzWZp.js +1 -0
- assets/SavedPapersView-BX749Ydn.js +0 -1
- assets/SearchOverlay-ByX4_sGQ.js +0 -1
- assets/SearchOverlay-CkCAbsvr.js +1 -0
- assets/SettingsView-BpIZT3v2.js +16 -0
- assets/SettingsView-BsEFODI2.js +0 -16
assets/AiDeadlinesView-DFIdl2-r.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import{r as x,j as t,b as A}from"./index-ChUK4pXW.js";import{u as B}from"./useQuery-CKrTCSf-.js";import{S as U}from"./switch-CZapgTe1.js";import{S as W}from"./skeleton-qvDYp1rq.js";import{A as O,a as V}from"./alert-DNLHMDlv.js";import{s as z}from"./safeExternalHref-CkBrsh84.js";import{D as P,a as G,b as Y,c as H,d as K}from"./dialog-YQ7VJ-Bw.js";import"./index-0fPuHBwH.js";const b=1e3*60*60*24,S={urgent:"#c0392b",soon:"#b9770e",normal:"#3f7d3f",passed:"var(--ink-faint)"},k=e=>e.split("-").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "),q=new Set(["machine-learning","computer-vision","natural-language-processing","data-mining","robotics","computer-graphics","human-computer-interaction","web-search","signal-processing","representation-learning","reinforcement-learning","optimization-methods","large-language-models","information-retrieval","speech","mathematics"]),Q=e=>e.trim().toLowerCase().replace(/\s+/g,"-"),D=e=>Array.from(new Set((e.tags??[]).map(Q).filter(a=>q.has(a)))),F=e=>new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),I=(e,a)=>{if(!e)return null;const n=new Date(`${e}T00:00:00`),r=a?new Date(`${a}T00:00:00`):null,o=s=>s.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=n.getFullYear();return r&&r.getTime()!==n.getTime()?n.getMonth()===r.getMonth()?`${o(n).replace(/\d+$/,"").trim()} ${n.getDate()}–${r.getDate()}, ${i}`:`${o(n)} – ${o(r)}, ${i}`:`${o(n)}, ${i}`},M=e=>[...e.deadlines??[]].sort((a,n)=>new Date(a.deadline_at).getTime()-new Date(n.deadline_at).getTime()),T=(e,a)=>M(e).find(n=>new Date(n.deadline_at).getTime()>a)??null,L=e=>{const a=M(e);return a.length?a[a.length-1]:null},J=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b);if(r>=1){const s=Math.floor((n-r*b)/36e5);return`in ${r}d ${s}h`}const o=Math.floor(n/(1e3*60*60));return o>=1?`in ${o}h`:`in ${Math.max(1,Math.floor(n/(1e3*60)))}m`},X=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b),o=Math.floor(n%b/(1e3*60*60)),i=Math.floor(n%(1e3*60*60)/(1e3*60)),s=Math.floor(n%(1e3*60)/1e3);return`${r}d ${o}h ${i}m ${s}s`},_=(e,a)=>{if(e==null)return S.passed;const n=(e-a)/b;return n<=0?S.passed:n<=7?S.urgent:n<=30?S.soon:S.normal},$={fontFamily:"var(--mono)",fontSize:10,letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--ink-faint)"},Z=(e,a)=>{const n=Math.ceil((e-a)/b);return n<=0?"passed":`${n} ${n===1?"day":"days"}`},R=(e,a)=>{const n=I(e.start_date,e.end_date),r=e.venue||[e.city,e.country].filter(Boolean).join(", ");return[`${a.label||a.type||"Deadline"} for ${e.name}`,n?`Dates: ${n}`:null,r?`Location: ${r}`:null,e.url?`Website: ${e.url}`:null].filter(Boolean).join(`
|
| 2 |
+
`)},C=e=>e.toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,""),ee=(e,a)=>{const n=new Date(a.deadline_at),r=new Date(n.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${a.label||a.type||"deadline"}`,i=e.venue||[e.city,e.country].filter(Boolean).join(", "),s=`https://calendar.google.com/calendar/render?action=TEMPLATE&text=${encodeURIComponent(o)}&dates=${C(n)}/${C(r)}&details=${encodeURIComponent(R(e,a))}&location=${encodeURIComponent(i)}`,m=z(s);m&&window.open(m,"_blank","noopener,noreferrer")},te=(e,a)=>{const n=new Date(a.deadline_at),r=new Date(n.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${a.label||a.type||"deadline"}`,i=e.venue||[e.city,e.country].filter(Boolean).join(", "),s=["BEGIN:VCALENDAR","VERSION:2.0","BEGIN:VEVENT",e.url?`URL:${e.url}`:null,`DTSTART:${C(n)}`,`DTEND:${C(r)}`,`SUMMARY:${o}`,`DESCRIPTION:${R(e,a).replace(/\n/g,"\\n")}`,i?`LOCATION:${i}`:null,"END:VEVENT","END:VCALENDAR"].filter(Boolean).join(`
|
| 3 |
+
`),m=new Blob([s],{type:"text/calendar;charset=utf-8"}),c=document.createElement("a");c.href=URL.createObjectURL(m),c.download=`${(e.short_name||e.name).toLowerCase().replace(/\s+/g,"-")}-deadline.ics`,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(c.href)},ne=({conf:e,open:a,onOpenChange:n})=>{const[r,o]=x.useState(()=>Date.now());x.useEffect(()=>{if(!a)return;o(Date.now());const d=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(d)},[a]);const i=x.useMemo(()=>e?M(e):[],[e]),s=x.useMemo(()=>e?T(e,r):null,[e,r]),m=e?I(e.start_date,e.end_date):null,c=e?e.venue||[e.city,e.country].filter(Boolean).join(", ")||e.location:null,u=s?new Date(s.deadline_at).getTime():null;return t.jsx(P,{open:a,onOpenChange:n,children:t.jsx(G,{className:"max-w-xl",style:{background:"var(--bg-elevated)",maxHeight:"85vh",overflowY:"auto"},children:e&&t.jsxs(t.Fragment,{children:[t.jsxs(Y,{children:[t.jsx(H,{asChild:!0,children:t.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name})}),e.short_name&&e.name||e.description?t.jsx(K,{asChild:!0,children:t.jsx("span",{style:{fontFamily:"var(--serif)",fontSize:14,color:"var(--ink-soft)"},children:e.short_name?e.name:e.description})}):null]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:20,marginTop:4},children:[t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:24},children:[m&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:$,children:"Dates"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:m})]}),c&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:$,children:"Venue"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:c})]})]}),u!=null&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,padding:"12px 14px",borderRadius:8,background:"var(--bg-subtle)",border:"1px solid var(--hairline)"},children:[t.jsx("span",{style:$,children:"Next deadline in"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:22,fontWeight:600,color:_(u,r)},children:X(u,r)})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[t.jsx("span",{style:$,children:"Important deadlines"}),i.length===0?t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-faint)"},children:"No deadlines listed"}):i.map((d,p)=>{const y=new Date(d.deadline_at).getTime(),l=s!=null&&d.deadline_at===s.deadline_at&&d.type===s.type,h=y<=r;return t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,padding:"8px 12px",borderRadius:6,background:l?"var(--accent-soft)":"transparent",border:l?"1px solid var(--hairline-strong)":"1px solid var(--hairline)",opacity:h&&!l?.55:1},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink)",fontWeight:l?600:400},children:[d.label||k(d.type||"deadline"),l&&t.jsx("span",{style:{...$,marginLeft:8},children:"Next"})]}),t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:[F(d.deadline_at),d.timezone?` · ${d.timezone}`:""]})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,fontWeight:600,whiteSpace:"nowrap",color:_(h?null:y,r)},children:Z(y,r)})]},`${d.type??"deadline"}-${p}`)})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(d=>t.jsx("span",{className:"tag-chip",style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:k(d)},d))}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:16,paddingTop:12,borderTop:"1px solid var(--hairline)"},children:[e.url&&t.jsx("a",{href:z(e.url)??void 0,target:"_blank",rel:"noopener noreferrer",style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--accent-text)"},children:"Visit website ↗"}),s&&t.jsxs("div",{style:{display:"flex",gap:12,marginLeft:"auto"},children:[t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>ee(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Google Calendar"}),t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>te(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Apple / .ics"})]})]})]})]})})})},E=({id:e,label:a,checked:n,onChange:r})=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[t.jsx(U,{id:e,checked:n,onCheckedChange:r}),t.jsx("label",{htmlFor:e,style:{cursor:"pointer"},children:a})]}),ae=({conf:e,now:a,selectedDomains:n,onToggleDomain:r,onOpen:o})=>{const i=T(e,a),s=i??L(e),m=s?new Date(s.deadline_at).getTime():null,c=_(i?m:null,a),u=I(e.start_date,e.end_date),d=[e.city??null,e.country??null].filter(Boolean).join(", ");return t.jsxs("div",{role:"button",tabIndex:0,onClick:()=>o(e),onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),o(e))},style:{border:"1px solid var(--hairline)",borderRadius:8,padding:20,background:"var(--bg-elevated)",display:"flex",flexDirection:"column",gap:12,cursor:"pointer"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:12},children:[t.jsx("h3",{style:{fontFamily:"var(--serif)",fontSize:20,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name}),e.url&&t.jsx("a",{href:z(e.url)??void 0,target:"_blank",rel:"noopener noreferrer",onClick:p=>p.stopPropagation(),style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",whiteSpace:"nowrap"},children:"website ↗"})]}),t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,paddingBottom:12,borderBottom:"1px solid var(--hairline)"},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:(s==null?void 0:s.label)||(s==null?void 0:s.type)||"Deadline"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:s?`${F(s.deadline_at)}${s.timezone?` · ${s.timezone}`:""}`:"TBD"})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:14,fontWeight:600,color:c,whiteSpace:"nowrap"},children:m!=null?J(m,a):"TBD"})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:[u&&t.jsx("span",{children:u}),d&&t.jsx("span",{children:d})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(p=>{const y=n.has(p);return t.jsx("button",{className:"tag-chip",onClick:l=>{l.stopPropagation(),r(p)},style:{background:y?"var(--ink)":"var(--bg-subtle)",color:y?"var(--bg)":"var(--ink-soft)"},children:k(p)},p)})})]})},pe=()=>{const[e,a]=x.useState(!0),[n,r]=x.useState(!1),[o,i]=x.useState(new Set),[s,m]=x.useState(null),c=x.useMemo(()=>Date.now(),[]),u=B({queryKey:["conference-deadlines"],queryFn:()=>A.getConferenceDeadlines(),staleTime:10*60*1e3}),d=l=>{i(h=>{const g=new Set(h);return g.has(l)?g.delete(l):g.add(l),g})},p=x.useMemo(()=>{var h;const l=new Map;return(h=u.data)==null||h.results.forEach(g=>{D(g).forEach(j=>l.set(j,(l.get(j)??0)+1))}),Array.from(l.entries()).sort((g,j)=>j[1]-g[1]).map(([g])=>g)},[u.data]),y=x.useMemo(()=>{var j;const h=(((j=u.data)==null?void 0:j.results)??[]).filter(f=>!(e&&f.tier!=="a"||o.size>0&&!D(f).some(v=>o.has(v))||!n&&!T(f,c))),g=f=>{const w=T(f,c);if(w)return{group:0,time:new Date(w.deadline_at).getTime()};const v=L(f);return{group:1,time:-(v?new Date(v.deadline_at).getTime():0)}};return[...h].sort((f,w)=>{const v=g(f),N=g(w);return v.group!==N.group?v.group-N.group:v.time-N.time})},[u.data,e,n,o,c]);return u.error?t.jsx("div",{className:"page",children:t.jsx(O,{variant:"destructive",children:t.jsx(V,{children:"Failed to load conference deadlines. Please try again."})})}):t.jsxs("div",{className:"page",children:[t.jsx("div",{className:"feed-header",children:t.jsxs("div",{children:[t.jsxs("h1",{className:"feed-title",children:["AI Conference ",t.jsx("em",{children:"Deadlines"})]}),t.jsx("div",{className:"feed-subtitle",children:"Upcoming submission deadlines for major AI conferences, counting down."})]})}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:20,padding:"16px 0",borderBottom:"1px solid var(--hairline)",marginBottom:24},children:[t.jsx(E,{id:"top-tier-only",label:"Top tier only",checked:e,onChange:a}),t.jsx(E,{id:"show-past",label:"Show past conferences",checked:n,onChange:r})]}),p.length>0&&t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:24},children:[p.map(l=>{const h=o.has(l);return t.jsx("button",{className:"tag-chip",onClick:()=>d(l),style:{background:h?"var(--ink)":"var(--bg-subtle)",color:h?"var(--bg)":"var(--ink-soft)"},children:k(l)},l)}),o.size>0&&t.jsx("button",{className:"tag-chip",onClick:()=>i(new Set),style:{background:"transparent",color:"var(--ink-faint)"},children:"Clear ✕"})]}),t.jsx("div",{className:"sort-bar",children:t.jsx("div",{className:"results-count",children:u.isLoading?"…":`${y.length} conferences`})}),u.isLoading?t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:Array.from({length:6}).map((l,h)=>t.jsx(W,{className:"h-44"},h))}):y.length===0?t.jsxs("div",{className:"no-results",children:["No conferences match these filters",n?".":" — try enabling “Show past conferences”."]}):t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:y.map(l=>t.jsx(ae,{conf:l,now:c,selectedDomains:o,onToggleDomain:d,onOpen:m},l.id))}),t.jsx(ne,{conf:s,open:s!==null,onOpenChange:l=>{l||m(null)}})]})};export{pe as default};
|
assets/AiDeadlinesView-jB2RCKBD.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
import{r as x,j as t,b as E}from"./index-C--7Ookn.js";import{u as A}from"./useQuery-DFn3_KAa.js";import{S as B}from"./switch-bk-2H4XZ.js";import{S as U}from"./skeleton-r_i4hk58.js";import{A as W,a as O}from"./alert-CThmjBPy.js";import{D as V,a as P,b as G,c as Y,d as K}from"./dialog-DTAlnqKL.js";import"./useBaseQuery-CPtz5T_6.js";import"./index-B6Kbql8e.js";const b=1e3*60*60*24,S={urgent:"#c0392b",soon:"#b9770e",normal:"#3f7d3f",passed:"var(--ink-faint)"},k=e=>e.split("-").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "),q=new Set(["machine-learning","computer-vision","natural-language-processing","data-mining","robotics","computer-graphics","human-computer-interaction","web-search","signal-processing","representation-learning","reinforcement-learning","optimization-methods","large-language-models","information-retrieval","speech","mathematics"]),H=e=>e.trim().toLowerCase().replace(/\s+/g,"-"),D=e=>Array.from(new Set((e.tags??[]).map(H).filter(a=>q.has(a)))),F=e=>new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),z=(e,a)=>{if(!e)return null;const n=new Date(`${e}T00:00:00`),r=a?new Date(`${a}T00:00:00`):null,o=s=>s.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=n.getFullYear();return r&&r.getTime()!==n.getTime()?n.getMonth()===r.getMonth()?`${o(n).replace(/\d+$/,"").trim()} ${n.getDate()}–${r.getDate()}, ${i}`:`${o(n)} – ${o(r)}, ${i}`:`${o(n)}, ${i}`},I=e=>[...e.deadlines??[]].sort((a,n)=>new Date(a.deadline_at).getTime()-new Date(n.deadline_at).getTime()),T=(e,a)=>I(e).find(n=>new Date(n.deadline_at).getTime()>a)??null,L=e=>{const a=I(e);return a.length?a[a.length-1]:null},Q=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b);if(r>=1){const s=Math.floor((n-r*b)/36e5);return`in ${r}d ${s}h`}const o=Math.floor(n/(1e3*60*60));return o>=1?`in ${o}h`:`in ${Math.max(1,Math.floor(n/(1e3*60)))}m`},J=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b),o=Math.floor(n%b/(1e3*60*60)),i=Math.floor(n%(1e3*60*60)/(1e3*60)),s=Math.floor(n%(1e3*60)/1e3);return`${r}d ${o}h ${i}m ${s}s`},_=(e,a)=>{if(e==null)return S.passed;const n=(e-a)/b;return n<=0?S.passed:n<=7?S.urgent:n<=30?S.soon:S.normal},$={fontFamily:"var(--mono)",fontSize:10,letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--ink-faint)"},X=(e,a)=>{const n=Math.ceil((e-a)/b);return n<=0?"passed":`${n} ${n===1?"day":"days"}`},R=(e,a)=>{const n=z(e.start_date,e.end_date),r=e.venue||[e.city,e.country].filter(Boolean).join(", ");return[`${a.label||a.type||"Deadline"} for ${e.name}`,n?`Dates: ${n}`:null,r?`Location: ${r}`:null,e.url?`Website: ${e.url}`:null].filter(Boolean).join(`
|
| 2 |
-
`)},C=e=>e.toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,""),Z=(e,a)=>{const n=new Date(a.deadline_at),r=new Date(n.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${a.label||a.type||"deadline"}`,i=e.venue||[e.city,e.country].filter(Boolean).join(", "),s=`https://calendar.google.com/calendar/render?action=TEMPLATE&text=${encodeURIComponent(o)}&dates=${C(n)}/${C(r)}&details=${encodeURIComponent(R(e,a))}&location=${encodeURIComponent(i)}`;window.open(s,"_blank","noopener,noreferrer")},ee=(e,a)=>{const n=new Date(a.deadline_at),r=new Date(n.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${a.label||a.type||"deadline"}`,i=e.venue||[e.city,e.country].filter(Boolean).join(", "),s=["BEGIN:VCALENDAR","VERSION:2.0","BEGIN:VEVENT",e.url?`URL:${e.url}`:null,`DTSTART:${C(n)}`,`DTEND:${C(r)}`,`SUMMARY:${o}`,`DESCRIPTION:${R(e,a).replace(/\n/g,"\\n")}`,i?`LOCATION:${i}`:null,"END:VEVENT","END:VCALENDAR"].filter(Boolean).join(`
|
| 3 |
-
`),g=new Blob([s],{type:"text/calendar;charset=utf-8"}),c=document.createElement("a");c.href=URL.createObjectURL(g),c.download=`${(e.short_name||e.name).toLowerCase().replace(/\s+/g,"-")}-deadline.ics`,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(c.href)},te=({conf:e,open:a,onOpenChange:n})=>{const[r,o]=x.useState(()=>Date.now());x.useEffect(()=>{if(!a)return;o(Date.now());const d=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(d)},[a]);const i=x.useMemo(()=>e?I(e):[],[e]),s=x.useMemo(()=>e?T(e,r):null,[e,r]),g=e?z(e.start_date,e.end_date):null,c=e?e.venue||[e.city,e.country].filter(Boolean).join(", ")||e.location:null,p=s?new Date(s.deadline_at).getTime():null;return t.jsx(V,{open:a,onOpenChange:n,children:t.jsx(P,{className:"max-w-xl",style:{background:"var(--bg-elevated)",maxHeight:"85vh",overflowY:"auto"},children:e&&t.jsxs(t.Fragment,{children:[t.jsxs(G,{children:[t.jsx(Y,{asChild:!0,children:t.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name})}),e.short_name&&e.name||e.description?t.jsx(K,{asChild:!0,children:t.jsx("span",{style:{fontFamily:"var(--serif)",fontSize:14,color:"var(--ink-soft)"},children:e.short_name?e.name:e.description})}):null]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:20,marginTop:4},children:[t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:24},children:[g&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:$,children:"Dates"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:g})]}),c&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:$,children:"Venue"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:c})]})]}),p!=null&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,padding:"12px 14px",borderRadius:8,background:"var(--bg-subtle)",border:"1px solid var(--hairline)"},children:[t.jsx("span",{style:$,children:"Next deadline in"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:22,fontWeight:600,color:_(p,r)},children:J(p,r)})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[t.jsx("span",{style:$,children:"Important deadlines"}),i.length===0?t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-faint)"},children:"No deadlines listed"}):i.map((d,m)=>{const y=new Date(d.deadline_at).getTime(),l=s!=null&&d.deadline_at===s.deadline_at&&d.type===s.type,u=y<=r;return t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,padding:"8px 12px",borderRadius:6,background:l?"var(--accent-soft)":"transparent",border:l?"1px solid var(--hairline-strong)":"1px solid var(--hairline)",opacity:u&&!l?.55:1},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink)",fontWeight:l?600:400},children:[d.label||k(d.type||"deadline"),l&&t.jsx("span",{style:{...$,marginLeft:8},children:"Next"})]}),t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:[F(d.deadline_at),d.timezone?` · ${d.timezone}`:""]})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,fontWeight:600,whiteSpace:"nowrap",color:_(u?null:y,r)},children:X(y,r)})]},`${d.type??"deadline"}-${m}`)})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(d=>t.jsx("span",{className:"tag-chip",style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:k(d)},d))}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:16,paddingTop:12,borderTop:"1px solid var(--hairline)"},children:[e.url&&t.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--accent-text)"},children:"Visit website ↗"}),s&&t.jsxs("div",{style:{display:"flex",gap:12,marginLeft:"auto"},children:[t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>Z(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Google Calendar"}),t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>ee(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Apple / .ics"})]})]})]})]})})})},M=({id:e,label:a,checked:n,onChange:r})=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[t.jsx(B,{id:e,checked:n,onCheckedChange:r}),t.jsx("label",{htmlFor:e,style:{cursor:"pointer"},children:a})]}),ne=({conf:e,now:a,selectedDomains:n,onToggleDomain:r,onOpen:o})=>{const i=T(e,a),s=i??L(e),g=s?new Date(s.deadline_at).getTime():null,c=_(i?g:null,a),p=z(e.start_date,e.end_date),d=[e.city??null,e.country??null].filter(Boolean).join(", ");return t.jsxs("div",{role:"button",tabIndex:0,onClick:()=>o(e),onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),o(e))},style:{border:"1px solid var(--hairline)",borderRadius:8,padding:20,background:"var(--bg-elevated)",display:"flex",flexDirection:"column",gap:12,cursor:"pointer"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:12},children:[t.jsx("h3",{style:{fontFamily:"var(--serif)",fontSize:20,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name}),e.url&&t.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",onClick:m=>m.stopPropagation(),style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",whiteSpace:"nowrap"},children:"website ↗"})]}),t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,paddingBottom:12,borderBottom:"1px solid var(--hairline)"},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:(s==null?void 0:s.label)||(s==null?void 0:s.type)||"Deadline"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:s?`${F(s.deadline_at)}${s.timezone?` · ${s.timezone}`:""}`:"TBD"})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:14,fontWeight:600,color:c,whiteSpace:"nowrap"},children:g!=null?Q(g,a):"TBD"})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:[p&&t.jsx("span",{children:p}),d&&t.jsx("span",{children:d})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(m=>{const y=n.has(m);return t.jsx("button",{className:"tag-chip",onClick:l=>{l.stopPropagation(),r(m)},style:{background:y?"var(--ink)":"var(--bg-subtle)",color:y?"var(--bg)":"var(--ink-soft)"},children:k(m)},m)})})]})},me=()=>{const[e,a]=x.useState(!0),[n,r]=x.useState(!1),[o,i]=x.useState(new Set),[s,g]=x.useState(null),c=x.useMemo(()=>Date.now(),[]),p=A({queryKey:["conference-deadlines"],queryFn:()=>E.getConferenceDeadlines(),staleTime:10*60*1e3}),d=l=>{i(u=>{const h=new Set(u);return h.has(l)?h.delete(l):h.add(l),h})},m=x.useMemo(()=>{var u;const l=new Map;return(u=p.data)==null||u.results.forEach(h=>{D(h).forEach(j=>l.set(j,(l.get(j)??0)+1))}),Array.from(l.entries()).sort((h,j)=>j[1]-h[1]).map(([h])=>h)},[p.data]),y=x.useMemo(()=>{var j;const u=(((j=p.data)==null?void 0:j.results)??[]).filter(f=>!(e&&f.tier!=="a"||o.size>0&&!D(f).some(v=>o.has(v))||!n&&!T(f,c))),h=f=>{const w=T(f,c);if(w)return{group:0,time:new Date(w.deadline_at).getTime()};const v=L(f);return{group:1,time:-(v?new Date(v.deadline_at).getTime():0)}};return[...u].sort((f,w)=>{const v=h(f),N=h(w);return v.group!==N.group?v.group-N.group:v.time-N.time})},[p.data,e,n,o,c]);return p.error?t.jsx("div",{className:"page",children:t.jsx(W,{variant:"destructive",children:t.jsx(O,{children:"Failed to load conference deadlines. Please try again."})})}):t.jsxs("div",{className:"page",children:[t.jsx("div",{className:"feed-header",children:t.jsxs("div",{children:[t.jsxs("h1",{className:"feed-title",children:["AI Conference ",t.jsx("em",{children:"Deadlines"})]}),t.jsx("div",{className:"feed-subtitle",children:"Upcoming submission deadlines for major AI conferences, counting down."})]})}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:20,padding:"16px 0",borderBottom:"1px solid var(--hairline)",marginBottom:24},children:[t.jsx(M,{id:"top-tier-only",label:"Top tier only",checked:e,onChange:a}),t.jsx(M,{id:"show-past",label:"Show past conferences",checked:n,onChange:r})]}),m.length>0&&t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:24},children:[m.map(l=>{const u=o.has(l);return t.jsx("button",{className:"tag-chip",onClick:()=>d(l),style:{background:u?"var(--ink)":"var(--bg-subtle)",color:u?"var(--bg)":"var(--ink-soft)"},children:k(l)},l)}),o.size>0&&t.jsx("button",{className:"tag-chip",onClick:()=>i(new Set),style:{background:"transparent",color:"var(--ink-faint)"},children:"Clear ✕"})]}),t.jsx("div",{className:"sort-bar",children:t.jsx("div",{className:"results-count",children:p.isLoading?"…":`${y.length} conferences`})}),p.isLoading?t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:Array.from({length:6}).map((l,u)=>t.jsx(U,{className:"h-44"},u))}):y.length===0?t.jsxs("div",{className:"no-results",children:["No conferences match these filters",n?".":" — try enabling “Show past conferences”."]}):t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:y.map(l=>t.jsx(ne,{conf:l,now:c,selectedDomains:o,onToggleDomain:d,onOpen:g},l.id))}),t.jsx(te,{conf:s,open:s!==null,onOpenChange:l=>{l||g(null)}})]})};export{me as default};
|
|
|
|
|
|
|
|
|
|
|
|
assets/AuthorDetailView-D9jotdn7.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{e as m,j as e,L as g,b as h}from"./index-C--7Ookn.js";import{u as d}from"./useQuery-DFn3_KAa.js";import{S as c}from"./skeleton-r_i4hk58.js";import x from"./NotFound-O3oWHFDY.js";import"./useBaseQuery-CPtz5T_6.js";const _=()=>{var i,l,n,o,u;const{authorId:a}=m(),r=d({queryKey:["author",a],queryFn:()=>h.getAuthor(a),enabled:!!a}),t=d({queryKey:["author-papers",a],queryFn:()=>h.getAuthorPapers(a,{page:1,page_size:20}),enabled:!!a});return((i=r.error)==null?void 0:i.status)===404?e.jsx(x,{}):e.jsxs("div",{className:"page",children:[e.jsx("p",{className:"sidebar-label",children:"Author"}),e.jsx("h1",{className:"feed-title",children:((l=r.data)==null?void 0:l.full_name)??e.jsx(c,{className:"h-10 w-64 inline-block"})}),((n=r.data)==null?void 0:n.hf_username)&&e.jsxs("a",{href:`https://huggingface.co/${r.data.hf_username}`,target:"_blank",rel:"noopener noreferrer",children:["@",r.data.hf_username," on Hugging Face"]}),e.jsxs("section",{style:{marginTop:40},"aria-labelledby":"author-papers-heading",children:[e.jsx("h2",{id:"author-papers-heading",children:"Research papers"}),t.isLoading&&e.jsx(c,{className:"h-24 w-full mt-4"}),((o=t.data)==null?void 0:o.results.length)===0&&e.jsx("p",{children:"No public papers are available."}),e.jsx("ol",{className:"paper-list",children:(u=t.data)==null?void 0:u.results.map(s=>{const p=s.source==="external"?String(s.id):s.arxiv_id;return e.jsx("li",{children:e.jsx(g,{to:`/paper/${p}`,children:s.title})},s.id)})})]})]})};export{_ as default};
|
|
|
|
|
|
assets/AuthorDetailView-Dts5rRb7.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{e as m,j as e,L as g,b as h}from"./index-ChUK4pXW.js";import{u as d}from"./useQuery-CKrTCSf-.js";import{S as c}from"./skeleton-qvDYp1rq.js";import x from"./NotFound-CwXaMVr4.js";const N=()=>{var l,n,i,o,u;const{authorId:a}=m(),r=d({queryKey:["author",a],queryFn:()=>h.getAuthor(a),enabled:!!a}),t=d({queryKey:["author-papers",a],queryFn:()=>h.getAuthorPapers(a,{page:1,page_size:20}),enabled:!!a});return((l=r.error)==null?void 0:l.status)===404?e.jsx(x,{}):e.jsxs("div",{className:"page",children:[e.jsx("p",{className:"sidebar-label",children:"Author"}),e.jsx("h1",{className:"feed-title",children:((n=r.data)==null?void 0:n.full_name)??e.jsx(c,{className:"h-10 w-64 inline-block"})}),((i=r.data)==null?void 0:i.hf_username)&&e.jsxs("a",{href:`https://huggingface.co/${r.data.hf_username}`,target:"_blank",rel:"noopener noreferrer",children:["@",r.data.hf_username," on Hugging Face"]}),e.jsxs("section",{style:{marginTop:40},"aria-labelledby":"author-papers-heading",children:[e.jsx("h2",{id:"author-papers-heading",children:"Research papers"}),t.isLoading&&e.jsx(c,{className:"h-24 w-full mt-4"}),((o=t.data)==null?void 0:o.results.length)===0&&e.jsx("p",{children:"No public papers are available."}),e.jsx("ol",{className:"paper-list",children:(u=t.data)==null?void 0:u.results.map(s=>{const p=s.source==="external"?String(s.id):s.arxiv_id;return e.jsx("li",{children:e.jsx(g,{to:`/paper/${p}`,children:s.title})},s.id)})})]})]})};export{N as default};
|
assets/BenchmarkDetailView-DGhP-b56.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
| 1 |
-
import{u as vt,r as w,j as n,a3 as ne,g as jt,e as _t,a as kt,Z as St,L as me,b as ee}from"./index-C--7Ookn.js";import{u as te}from"./useQuery-DFn3_KAa.js";import{S as xe}from"./skeleton-r_i4hk58.js";import{S as Je}from"./switch-bk-2H4XZ.js";import{A as Ct,a as Et}from"./alert-CThmjBPy.js";import{L as ye}from"./LatexTitle-CTfnj_ow.js";import{C as Nt,E as Rt}from"./ExternalSourceEvalBadge-Bj021N_r.js";import{B as Tt}from"./BenchmarkTrendSparkline-Dlqui5GJ.js";import{I as $t}from"./components-KzuuRgbc.js";import"./useBaseQuery-CPtz5T_6.js";import"./index-B6Kbql8e.js";import"./katex.min-BSBacQyE.js";import"./hover-card-1g79nCeQ.js";import"./transform-BfLoZuxV.js";function Mt(e,t,r){const s=t?(e??[]).filter(c=>c.task_id===t):e??[],a=s.filter(c=>c.is_open===!1),i=a.reduce((c,l)=>c?(l.best_rank??Number.POSITIVE_INFINITY)<(c.best_rank??Number.POSITIVE_INFINITY)?l:c:l,null);return{visible:r?s.filter(c=>c.is_open!==!1):s,hiddenClosed:a,topHiddenClosed:i}}function Ze(e){const t=e.length===7?`${e}-01`:e,r=new Date(t).getTime();return Number.isFinite(r)?r:0}const Ce=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ee(e){const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()}}function Ft(e,t){if(e===t){const{year:u,month:p}=Ee(e);return[{timestamp:new Date(u,p,1).getTime(),key:`${u}-${p}`,label:`${Ce[p]} ${u}`}]}const r=Ee(e),s=Ee(t);if(r.year===s.year){const u=s.month-r.month+1;let p=1;const f=12;u>f&&(p=Math.ceil(u/f));const y=[];for(let x=r.month;x<=s.month;x+=p)y.push({timestamp:new Date(r.year,x,1).getTime(),key:`${r.year}-${x}`,label:u<=3?`${Ce[x]} ${r.year}`:Ce[x]});return y}const a=s.year-r.year+1;let i=1;const c=12;a>c&&(i=Math.ceil(a/c));const l=[];for(let u=r.year;u<=s.year;u+=i)l.push({timestamp:new Date(u,0,1).getTime(),key:String(u),label:String(u)});return l}const Lt=({points:e,metric:t})=>{const r=vt(),[s,a]=w.useState(null),i=880,c=320,l=60,u=30,p=40,f=50,y=e.map(o=>o.value),x=Math.min(...y),U=Math.max(...y)-x||1,ae=i-l-u,L=c-p-f,$=e.map(o=>Ze(o.date)),z=Math.min(...$),I=Math.max(...$),ie=I-z||1,Y=o=>z===I?l+ae/2:l+(o-z)/ie*ae,G=e.map((o,m)=>{const k=Y(Ze(o.date)),v=(o.value-x)/U,M=p+L*(1-v);return{x:k,y:M,data:o,idx:m}}),N=G.filter(o=>o.data.isSota);let O="";if(N.length>=2){O=`M${N[0].x},${N[0].y}`;for(let o=1;o<N.length;o++){const m=N[o-1],k=N[o],v=(m.x+k.x)/2;O+=` C${v},${m.y} ${v},${k.y} ${k.x},${k.y}`}}const H=5.4,fe=8,J=9,A=o=>{const m=o.data.modelName||o.data.paperTitle||"";if(!m)return null;const k=m.length>22?m.slice(0,21)+"…":m,v=k.length*H;let M=o.x-v/2,C=o.x+v/2,V="middle";return M<l?(M=l,C=l+v,V="start"):C>i-u&&(C=i-u,M=C-v,V="end"),{x:V==="start"?l:V==="end"?i-u:o.x,y:o.y-J,text:k,anchor:V,left:M,right:C}},ce=[],b=N.length>0?A(N[N.length-1]):null;let _e=-1/0;for(let o=0;o<N.length-1;o++){const m=A(N[o]);m&&(m.left<_e+fe||b&&m.right>b.left-fe||(_e=m.right,ce.push({x:m.x,y:m.y,text:m.text,anchor:m.anchor})))}b&&ce.push({x:b.x,y:b.y,text:b.text,anchor:b.anchor});const K=Ft(z,I),W=5,le=o=>a(m=>m===o?null:m),oe=o=>{o&&r(`/paper/${o}`)},pe=(o,m)=>{const v=`${o.data.modelName||o.data.paperTitle||"Unknown model"}: ${ne(o.data.value)} on ${o.data.dateLabel}`,M=!!o.data.paperRouteId;return n.jsxs("g",{children:[m,n.jsx("circle",{cx:o.x,cy:o.y,r:"10",fill:"transparent",style:{cursor:M?"pointer":"default",outline:"none"},tabIndex:0,role:M?"link":"img","aria-label":v,onMouseEnter:()=>a(o.idx),onMouseLeave:()=>le(o.idx),onFocus:()=>a(o.idx),onBlur:()=>le(o.idx),onClick:()=>oe(o.data.paperRouteId),onKeyDown:C=>{M&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),oe(o.data.paperRouteId))},children:n.jsx("title",{children:v})})]},o.idx)};return n.jsxs("svg",{width:"100%",viewBox:`0 0 ${i} ${c}`,style:{display:"block"},children:[n.jsx("text",{x:l-38,y:p+L/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${l-38} ${p+L/2})`,children:t}),Array.from({length:W}).map((o,m)=>{const k=m/(W-1),v=p+L*(1-k),M=x+U*k;return n.jsxs("g",{children:[n.jsx("line",{x1:l,y1:v,x2:i-u,y2:v,stroke:"var(--hairline)",strokeWidth:"1"}),n.jsx("text",{x:l-10,y:v+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:ne(M)})]},m)}),K.map(o=>{const m=Y(o.timestamp);return n.jsx("text",{x:m,y:c-f+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:o.label},o.key)}),G.filter(o=>!o.data.isSota).map(o=>{const m=s===o.idx;return pe(o,n.jsx("circle",{cx:o.x,cy:o.y,r:m?3:2,fill:"var(--ink-faint)",opacity:m?1:.45,style:{transition:"r 0.12s ease, opacity 0.12s ease"}}))}),O&&n.jsx("path",{d:O,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),N.map(o=>{const m=s===o.idx;return pe(o,n.jsx("circle",{cx:o.x,cy:o.y,r:m?4.5:3,fill:m?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"1.5",style:{transition:"r 0.12s ease, fill 0.12s ease"}}))}),ce.map((o,m)=>n.jsx("text",{x:o.x,y:o.y,fontSize:"9.5",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:o.anchor,pointerEvents:"none",style:{paintOrder:"stroke",stroke:"var(--bg-elevated)",strokeWidth:3,strokeLinejoin:"round"},children:o.text},`label-${m}`)),s!==null&&G[s]&&(()=>{const o=G[s],m=o.data.modelName||o.data.paperTitle||"Unknown model",v=`${m.length>40?m.slice(0,39)+"…":m}: ${ne(o.data.value)}`,C=Math.max(120,Math.min(340,v.length*6.6+24)),V=30;let B=o.x-C/2;B<l&&(B=l),B+C>i-u&&(B=i-u-C);const Q=o.y-V-14>=p?o.y-V-12:o.y+12;return n.jsxs("g",{pointerEvents:"none",children:[n.jsx("rect",{x:B,y:Q,width:C,height:V,rx:"6",ry:"6",fill:"var(--bg-elevated)",stroke:"var(--hairline-strong)",strokeWidth:"1",style:{filter:"drop-shadow(0 2px 6px rgba(0,0,0,0.08))"}}),n.jsx("text",{x:B+12,y:Q+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:v})]})})()]})};function It(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const r=document.implementation.createHTMLDocument(),s=r.createElement("base"),a=r.createElement("a");return r.head.appendChild(s),r.body.appendChild(a),t&&(s.href=t),a.href=e,a.href}const Pt=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function q(e){const t=[];for(let r=0,s=e.length;r<s;r++)t.push(e[r]);return t}let re=null;function dt(e={}){return re||(e.includeStyleProperties?(re=e.includeStyleProperties,re):(re=q(window.getComputedStyle(document.documentElement)),re))}function we(e,t){const s=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return s?parseFloat(s.replace("px","")):0}function At(e){const t=we(e,"border-left-width"),r=we(e,"border-right-width");return e.clientWidth+t+r}function Dt(e){const t=we(e,"border-top-width"),r=we(e,"border-bottom-width");return e.clientHeight+t+r}function ut(e,t={}){const r=t.width||At(e),s=t.height||Dt(e);return{width:r,height:s}}function Bt(){let e,t;try{t=process}catch{}const r=t&&t.env?t.env.devicePixelRatio:null;return r&&(e=parseInt(r,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const D=16384;function Ht(e){(e.width>D||e.height>D)&&(e.width>D&&e.height>D?e.width>e.height?(e.height*=D/e.width,e.width=D):(e.width*=D/e.height,e.height=D):e.width>D?(e.height*=D/e.width,e.width=D):(e.width*=D/e.height,e.height=D))}function Vt(e,t={}){return e.toBlob?new Promise(r=>{e.toBlob(r,t.type?t.type:"image/png",t.quality?t.quality:1)}):new Promise(r=>{const s=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),a=s.length,i=new Uint8Array(a);for(let c=0;c<a;c+=1)i[c]=s.charCodeAt(c);r(new Blob([i],{type:t.type?t.type:"image/png"}))})}function ve(e){return new Promise((t,r)=>{const s=new Image;s.onload=()=>{s.decode().then(()=>{requestAnimationFrame(()=>t(s))})},s.onerror=r,s.crossOrigin="anonymous",s.decoding="async",s.src=e})}async function Ot(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Ut(e,t,r){const s="http://www.w3.org/2000/svg",a=document.createElementNS(s,"svg"),i=document.createElementNS(s,"foreignObject");return a.setAttribute("width",`${t}`),a.setAttribute("height",`${r}`),a.setAttribute("viewBox",`0 0 ${t} ${r}`),i.setAttribute("width","100%"),i.setAttribute("height","100%"),i.setAttribute("x","0"),i.setAttribute("y","0"),i.setAttribute("externalResourcesRequired","true"),a.appendChild(i),i.appendChild(e),Ot(a)}const P=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||P(r,t)};function Wt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function qt(e,t){return dt(t).map(r=>{const s=e.getPropertyValue(r),a=e.getPropertyPriority(r);return`${r}: ${s}${a?" !important":""};`}).join(" ")}function zt(e,t,r,s){const a=`.${e}:${t}`,i=r.cssText?Wt(r):qt(r,s);return document.createTextNode(`${a}{${i}}`)}function et(e,t,r,s){const a=window.getComputedStyle(e,r),i=a.getPropertyValue("content");if(i===""||i==="none")return;const c=Pt();try{t.className=`${t.className} ${c}`}catch{return}const l=document.createElement("style");l.appendChild(zt(c,r,a,s)),t.appendChild(l)}function Gt(e,t,r){et(e,t,":before",r),et(e,t,":after",r)}const tt="application/font-woff",rt="image/jpeg",Kt={woff:tt,woff2:tt,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:rt,jpeg:rt,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Qt(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function $e(e){const t=Qt(e).toLowerCase();return Kt[t]||""}function Xt(e){return e.split(/,/)[1]}function Re(e){return e.search(/^(data:)/)!==-1}function Yt(e,t){return`data:${t};base64,${e}`}async function mt(e,t,r){const s=await fetch(e,t);if(s.status===404)throw new Error(`Resource "${s.url}" not found`);const a=await s.blob();return new Promise((i,c)=>{const l=new FileReader;l.onerror=c,l.onloadend=()=>{try{i(r({res:s,result:l.result}))}catch(u){c(u)}},l.readAsDataURL(a)})}const Ne={};function Jt(e,t,r){let s=e.replace(/\?.*/,"");return r&&(s=e),/ttf|otf|eot|woff2?/i.test(s)&&(s=s.replace(/.*\//,"")),t?`[${t}]${s}`:s}async function Me(e,t,r){const s=Jt(e,t,r.includeQueryParams);if(Ne[s]!=null)return Ne[s];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let a;try{const i=await mt(e,r.fetchRequestInit,({res:c,result:l})=>(t||(t=c.headers.get("Content-Type")||""),Xt(l)));a=Yt(i,t)}catch(i){a=r.imagePlaceholder||"";let c=`Failed to fetch resource: ${e}`;i&&(c=typeof i=="string"?i:i.message),c&&console.warn(c)}return Ne[s]=a,a}async function Zt(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ve(t)}async function er(e,t){if(e.currentSrc){const i=document.createElement("canvas"),c=i.getContext("2d");i.width=e.clientWidth,i.height=e.clientHeight,c==null||c.drawImage(e,0,0,i.width,i.height);const l=i.toDataURL();return ve(l)}const r=e.poster,s=$e(r),a=await Me(r,s,t);return ve(a)}async function tr(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await je(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function rr(e,t){return P(e,HTMLCanvasElement)?Zt(e):P(e,HTMLVideoElement)?er(e,t):P(e,HTMLIFrameElement)?tr(e,t):e.cloneNode(ht(e))}const sr=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",ht=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function nr(e,t,r){var s,a;if(ht(t))return t;let i=[];return sr(e)&&e.assignedNodes?i=q(e.assignedNodes()):P(e,HTMLIFrameElement)&&(!((s=e.contentDocument)===null||s===void 0)&&s.body)?i=q(e.contentDocument.body.childNodes):i=q(((a=e.shadowRoot)!==null&&a!==void 0?a:e).childNodes),i.length===0||P(e,HTMLVideoElement)||await i.reduce((c,l)=>c.then(()=>je(l,r)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function ar(e,t,r){const s=t.style;if(!s)return;const a=window.getComputedStyle(e);a.cssText?(s.cssText=a.cssText,s.transformOrigin=a.transformOrigin):dt(r).forEach(i=>{let c=a.getPropertyValue(i);i==="font-size"&&c.endsWith("px")&&(c=`${Math.floor(parseFloat(c.substring(0,c.length-2)))-.1}px`),P(e,HTMLIFrameElement)&&i==="display"&&c==="inline"&&(c="block"),i==="d"&&t.getAttribute("d")&&(c=`path(${t.getAttribute("d")})`),s.setProperty(i,c,a.getPropertyPriority(i))})}function ir(e,t){P(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),P(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function cr(e,t){if(P(e,HTMLSelectElement)){const r=t,s=Array.from(r.children).find(a=>e.value===a.getAttribute("value"));s&&s.setAttribute("selected","")}}function lr(e,t,r){return P(t,Element)&&(ar(e,t,r),Gt(e,t,r),ir(e,t),cr(e,t)),t}async function or(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const s={};for(let i=0;i<r.length;i++){const l=r[i].getAttribute("xlink:href");if(l){const u=e.querySelector(l),p=document.querySelector(l);!u&&p&&!s[l]&&(s[l]=await je(p,t,!0))}}const a=Object.values(s);if(a.length){const i="http://www.w3.org/1999/xhtml",c=document.createElementNS(i,"svg");c.setAttribute("xmlns",i),c.style.position="absolute",c.style.width="0",c.style.height="0",c.style.overflow="hidden",c.style.display="none";const l=document.createElementNS(i,"defs");c.appendChild(l);for(let u=0;u<a.length;u++)l.appendChild(a[u]);e.appendChild(c)}return e}async function je(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(s=>rr(s,t)).then(s=>nr(e,s,t)).then(s=>lr(e,s,t)).then(s=>or(s,t))}const ft=/url\((['"]?)([^'"]+?)\1\)/g,dr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,ur=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function mr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function hr(e){const t=[];return e.replace(ft,(r,s,a)=>(t.push(a),r)),t.filter(r=>!Re(r))}async function fr(e,t,r,s,a){try{const i=r?It(t,r):t,c=$e(t);let l;return a||(l=await Me(i,c,s)),e.replace(mr(t),`$1${l}$3`)}catch{}return e}function pr(e,{preferredFontFormat:t}){return t?e.replace(ur,r=>{for(;;){const[s,,a]=dr.exec(r)||[];if(!a)return"";if(a===t)return`src: ${s};`}}):e}function pt(e){return e.search(ft)!==-1}async function gt(e,t,r){if(!pt(e))return e;const s=pr(e,r);return hr(s).reduce((i,c)=>i.then(l=>fr(l,c,t,r)),Promise.resolve(s))}async function se(e,t,r){var s;const a=(s=t.style)===null||s===void 0?void 0:s.getPropertyValue(e);if(a){const i=await gt(a,null,r);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function gr(e,t){await se("background",e,t)||await se("background-image",e,t),await se("mask",e,t)||await se("-webkit-mask",e,t)||await se("mask-image",e,t)||await se("-webkit-mask-image",e,t)}async function xr(e,t){const r=P(e,HTMLImageElement);if(!(r&&!Re(e.src))&&!(P(e,SVGImageElement)&&!Re(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,a=await Me(s,$e(s),t);await new Promise((i,c)=>{e.onload=i,e.onerror=t.onImageErrorHandler?(...u)=>{try{i(t.onImageErrorHandler(...u))}catch(p){c(p)}}:c;const l=e;l.decode&&(l.decode=i),l.loading==="lazy"&&(l.loading="eager"),r?(e.srcset="",e.src=a):e.href.baseVal=a})}async function br(e,t){const s=q(e.childNodes).map(a=>xt(a,t));await Promise.all(s).then(()=>e)}async function xt(e,t){P(e,Element)&&(await gr(e,t),await xr(e,t),await br(e,t))}function yr(e,t){const{style:r}=e;t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.width&&(r.width=`${t.width}px`),t.height&&(r.height=`${t.height}px`);const s=t.style;return s!=null&&Object.keys(s).forEach(a=>{r[a]=s[a]}),e}const st={};async function nt(e){let t=st[e];if(t!=null)return t;const s=await(await fetch(e)).text();return t={url:e,cssText:s},st[e]=t,t}async function at(e,t){let r=e.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async c=>{let l=c.replace(s,"$1");return l.startsWith("https://")||(l=new URL(l,e.url).href),mt(l,t.fetchRequestInit,({result:u})=>(r=r.replace(c,`url(${u})`),[c,u]))});return Promise.all(i).then(()=>r)}function it(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let s=e.replace(r,"");const a=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const u=a.exec(s);if(u===null)break;t.push(u[0])}s=s.replace(a,"");const i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,c="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",l=new RegExp(c,"gi");for(;;){let u=i.exec(s);if(u===null){if(u=l.exec(s),u===null)break;i.lastIndex=l.lastIndex}else l.lastIndex=i.lastIndex;t.push(u[0])}return t}async function wr(e,t){const r=[],s=[];return e.forEach(a=>{if("cssRules"in a)try{q(a.cssRules||[]).forEach((i,c)=>{if(i.type===CSSRule.IMPORT_RULE){let l=c+1;const u=i.href,p=nt(u).then(f=>at(f,t)).then(f=>it(f).forEach(y=>{try{a.insertRule(y,y.startsWith("@import")?l+=1:a.cssRules.length)}catch(x){console.error("Error inserting rule from remote css",{rule:y,error:x})}})).catch(f=>{console.error("Error loading remote css",f.toString())});s.push(p)}})}catch(i){const c=e.find(l=>l.href==null)||document.styleSheets[0];a.href!=null&&s.push(nt(a.href).then(l=>at(l,t)).then(l=>it(l).forEach(u=>{c.insertRule(u,c.cssRules.length)})).catch(l=>{console.error("Error loading remote stylesheet",l)})),console.error("Error inlining remote css file",i)}}),Promise.all(s).then(()=>(e.forEach(a=>{if("cssRules"in a)try{q(a.cssRules||[]).forEach(i=>{r.push(i)})}catch(i){console.error(`Error while reading CSS rules from ${a.href}`,i)}}),r))}function vr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>pt(t.style.getPropertyValue("src")))}async function jr(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=q(e.ownerDocument.styleSheets),s=await wr(r,t);return vr(s)}function bt(e){return e.trim().replace(/["']/g,"")}function _r(e){const t=new Set;function r(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(i=>{t.add(bt(i))}),Array.from(s.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function kr(e,t){const r=await jr(e,t),s=_r(e);return(await Promise.all(r.filter(i=>s.has(bt(i.style.fontFamily))).map(i=>{const c=i.parentStyleSheet?i.parentStyleSheet.href:null;return gt(i.cssText,c,t)}))).join(`
|
| 2 |
-
`)}async function Sr(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await kr(e,t);if(r){const s=document.createElement("style"),a=document.createTextNode(r);s.appendChild(a),e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}}async function Cr(e,t={}){const{width:r,height:s}=ut(e,t),a=await je(e,t,!0);return await Sr(a,t),await xt(a,t),yr(a,t),await Ut(a,r,s)}async function Er(e,t={}){const{width:r,height:s}=ut(e,t),a=await Cr(e,t),i=await ve(a),c=document.createElement("canvas"),l=c.getContext("2d"),u=t.pixelRatio||Bt(),p=t.canvasWidth||r,f=t.canvasHeight||s;return c.width=p*u,c.height=f*u,t.skipAutoScale||Ht(c),c.style.width=`${p}`,c.style.height=`${f}`,t.backgroundColor&&(l.fillStyle=t.backgroundColor,l.fillRect(0,0,c.width,c.height)),l.drawImage(i,0,0,c.width,c.height),c}async function Nr(e,t={}){const r=await Er(e,t);return await Vt(r)}const Te="#ffffff";function Rr(){return typeof window>"u"?Te:window.getComputedStyle(document.documentElement).getPropertyValue("--bg-elevated").trim()||Te}function Tr(e){if(typeof window>"u")return Te;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Rr():t}async function $r(e){var r,s;if(typeof window>"u"||!((s=(r=window.navigator)==null?void 0:r.clipboard)!=null&&s.write))throw new Error("Clipboard image copy is not supported in this browser.");if(typeof window.ClipboardItem>"u")throw new Error("Clipboard image copy is not supported in this browser.");const t=await Nr(e,{pixelRatio:2,cacheBust:!0,backgroundColor:Tr(e)});if(!t)throw new Error("Failed to render screenshot.");await window.navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])}const ct=({targetRef:e,label:t})=>{const{toast:r}=jt(),[s,a]=w.useState("idle"),i=w.useRef(null);w.useEffect(()=>()=>{i.current!==null&&window.clearTimeout(i.current)},[]);const c=w.useCallback(async()=>{const u=e.current;if(u){a("copying"),u.classList.add("is-capturing"),u.offsetHeight,await new Promise(p=>window.requestAnimationFrame(()=>p()));try{await $r(u),a("copied"),r({title:"Screenshot copied",description:`Image of the ${t} copied to your clipboard.`}),i.current!==null&&window.clearTimeout(i.current),i.current=window.setTimeout(()=>a("idle"),1500)}catch(p){a("idle"),r({title:"Copy failed",description:p instanceof Error&&p.message?p.message:"Could not copy the screenshot to your clipboard.",variant:"destructive"})}finally{u.classList.remove("is-capturing")}}},[e,t,r]),l=s==="copied"?"Copied":s==="copying"?"Copying…":"Copy image";return n.jsxs("button",{type:"button",className:"bm-copy-btn",onClick:c,disabled:s==="copying","aria-label":`Copy ${t} screenshot to clipboard`,title:`Copy ${t} screenshot to clipboard`,children:[n.jsx($t,{name:"copy",size:11}),l]})};function he(e){if(e==null)return null;if(typeof e=="number")return Number.isFinite(e)?e:null;const t=e.includes("±")?e.split("±")[0].trim():e.trim(),r=parseFloat(t);return Number.isFinite(r)?r:null}function Mr(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function Fr(e){const t=new Map;for(const r of e){const s=Mr(r),a=t.get(s);if(!a){t.set(s,{...r,metrics:{...r.metrics||{}},sourceEvaluationIds:[r.id],ranksByMetric:r.best_metric&&r.best_rank!=null?{[r.best_metric]:r.best_rank}:{}});continue}a.metrics={...a.metrics,...r.metrics||{}},a.sourceEvaluationIds.push(r.id),r.best_metric&&r.best_rank!=null&&(a.ranksByMetric[r.best_metric]=r.best_rank)}return Array.from(t.values())}function lt(e,t){return t?e.id===t||e.sourceEvaluationIds.includes(t):!1}function ot(e,t){return e.ranksByMetric[t]??e.best_rank??9999}function Lr(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const s=e.map(f=>{var E;const y=he((E=f.metrics)==null?void 0:E[t]),x=f.paper_published_date||"";return{eval:f,value:y,date:x}}).filter(f=>f.value!==null&&!!f.date).sort((f,y)=>f.date.localeCompare(y.date)),a=[];let i=null;for(const f of s){const y=i==null?!0:r==="↓"?f.value<i:f.value>i;y&&(i=f.value),a.push({value:f.value,date:f.date,dateLabel:f.date.slice(0,7),modelName:f.eval.model_name||"",paperTitle:f.eval.paper_title||"",paperRouteId:f.eval.paper_arxiv_id||f.eval.paper_id||null,isSota:y})}const l=e.map(f=>{var y;return{eval:f,value:he((y=f.metrics)==null?void 0:y[t])}}).filter(f=>f.value!==null).sort((f,y)=>r==="↓"?f.value-y.value:y.value-f.value)[0],u=(l==null?void 0:l.value)??0,p=(l==null?void 0:l.eval.model_name)||(l==null?void 0:l.eval.paper_title)||"";return{points:a,sota:u,sotaModel:p}}const Ir=5;function Pr(e){if(!e)return null;const t=e.trim(),r=t.match(/^https?:\/\/(?:www\.)?arxiv\.org\/(?:abs|pdf)\/([^/?#]+)/i);if(r!=null&&r[1])return r[1].replace(/\.pdf$/i,"");const s=t.match(/^(?:https?:\/\/(?:www\.)?paperswithcode\.co)?\/paper\/([^/?#]+)/i);return(s==null?void 0:s[1])??null}function be(e,t){return e?n.jsx(ye,{title:e}):t||"—"}const Yr=()=>{var Le,Ie,Pe,Ae,De,Be,He,Ve,Oe,Ue,We,qe,ze;const{datasetSlug:e}=_t(),[t]=kt(),r=t.get("task")||void 0,s=t.get("eval")||void 0,{preferences:a,setHideClosedSourceEvals:i}=St(),[c,l]=w.useState(void 0),u=w.useRef(null),p=w.useRef(!1),f=w.useRef(null),y=w.useRef(null),x=te({queryKey:["dataset",e,"with-paper",r,a.hide_closed_source_evals?"open":"all"],queryFn:()=>ee.getDatasetBySlug(e,{include_paper:!0,task:r,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!e,staleTime:10*60*1e3}),E=te({queryKey:["dataset-evals",(Le=x.data)==null?void 0:Le.id],queryFn:()=>ee.getEvaluationsByDataset(x.data.id),enabled:!!((Ie=x.data)!=null&&Ie.id),staleTime:5*60*1e3}),U=te({queryKey:["dataset-tasks",(Pe=x.data)==null?void 0:Pe.id],queryFn:()=>ee.getDatasetTasks(x.data.id),enabled:!!((Ae=x.data)!=null&&Ae.id),staleTime:10*60*1e3}),ae=te({queryKey:["metric-directions"],queryFn:()=>ee.getMetricDirections(),staleTime:60*60*1e3}),L=w.useMemo(()=>{var d;return!s||!((d=E.data)!=null&&d.length)?null:E.data.find(g=>g.id===s)||null},[s,E.data]),$=w.useMemo(()=>{const d=U.data||[];if(d.length===0)return null;if(L!=null&&L.task_id&&d.some(h=>h.id===L.task_id))return L.task_id;if(r){const h=d.find(S=>S.slug===r);if(h)return h.id}if(d.length===1)return d[0].id;const g=E.data||[];if(g.length>0){const h=new Map;for(const j of g)h.set(j.task_id,(h.get(j.task_id)||0)+1);let S=null,T=-1;for(const j of d){const ue=h.get(j.id)||0;ue>T&&(T=ue,S=j.id)}if(S)return S}return d[0].id},[U.data,E.data,r,L]),z=te({queryKey:["task-benchmark-trends",$,a.hide_closed_source_evals?!0:void 0],queryFn:()=>ee.getTrendingBenchmarks($,{limit:100,min_recent_papers:0,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!$&&!!((De=x.data)!=null&&De.id),staleTime:10*60*1e3}),I=w.useMemo(()=>{var d;return(((d=z.data)==null?void 0:d.results)||[]).find(g=>{var h;return g.id===((h=x.data)==null?void 0:h.id)})||null},[z.data,(Be=x.data)==null?void 0:Be.id]),ie=te({queryKey:["leaderboard-metrics",(He=x.data)==null?void 0:He.id,$],queryFn:()=>ee.getLeaderboardMetrics(x.data.id,$),enabled:!!((Ve=x.data)!=null&&Ve.id)&&!!$,staleTime:10*60*1e3}),Y=w.useMemo(()=>Mt(E.data,$,a.hide_closed_source_evals),[E.data,$,a.hide_closed_source_evals]),G=Y.visible,N=Y.hiddenClosed,O=Y.topHiddenClosed,H=w.useMemo(()=>Fr(G),[G]),fe=w.useMemo(()=>{const d=new Set;return H.forEach(g=>{g.best_metric&&d.add(g.best_metric),Object.keys(g.metrics||{}).forEach(h=>d.add(h))}),Array.from(d)},[H]),J=w.useMemo(()=>(ie.data||[]).map(d=>d.metric_name),[ie.data]),A=J.length?J:fe,ce=w.useMemo(()=>{var S;if(H.length===0)return A[0]||"";const d=new Map;for(const T of H)for(const j of Object.keys(T.metrics||{}))J.length&&!A.includes(j)||d.set(j,(d.get(j)||0)+1);let g=null,h=0;for(const[T,j]of d)j>h&&(h=j,g=T);return g||A[0]||((S=H[0])==null?void 0:S.best_metric)||""},[H,A,J]),b=c||(L==null?void 0:L.best_metric)||ce,K=(((Ue=(Oe=ae.data)==null?void 0:Oe.directions)==null?void 0:Ue[b])||"higher_is_better")==="lower_is_better"?"↓":"↑",W=w.useMemo(()=>!b||!A.includes(b)?A:[b,...A.filter(d=>d!==b)],[A,b]),le=w.useMemo(()=>W.length===0?b?[b]:[]:W.slice(0,Ir),[W,b]),{points:oe,sota:pe,sotaModel:o}=w.useMemo(()=>Lr(H,b,K),[H,b,K]),m=(We=x.data)==null?void 0:We.leaderboard_summary,k=E.isSuccess&&U.isSuccess&&ae.isSuccess&&(!$||ie.isSuccess),v=k?b:m==null?void 0:m.metric,M=k?pe:m==null?void 0:m.value,C=k?o:m==null?void 0:m.model_name,V=!k&&!m;w.useEffect(()=>{if(p.current||!s||!E.data||E.data.length===0)return;const d=u.current;d&&(p.current=!0,d.scrollIntoView({behavior:"smooth",block:"start"}))},[s,E.data]);const B=w.useMemo(()=>{const d=U.data||[];return $?d.find(g=>g.id===$)||d[0]||null:d[0]||null},[U.data,$]);if(x.isLoading)return n.jsxs("div",{className:"page",children:[n.jsx(xe,{className:"h-12 w-1/2 mb-6"}),n.jsx(xe,{className:"h-64 w-full"})]});if(x.error||!x.data)return n.jsx("div",{className:"page",children:n.jsx(Ct,{variant:"destructive",children:n.jsx(Et,{children:"Benchmark not found."})})});const _=x.data,Q=H.slice().sort((d,g)=>{var T,j;const h=he((T=d.metrics)==null?void 0:T[b]),S=he((j=g.metrics)==null?void 0:j[b]);return h!==null&&S!==null?K==="↓"?h-S:S-h:h!==null?-1:S!==null?1:ot(d,b)-ot(g,b)}),Fe=!!_.supports_harness,R=s&&Q.find(d=>lt(d,s))||null,F=_.introducing_paper??void 0,de=(F==null?void 0:F.arxiv_id)||(F==null?void 0:F.id)||Pr(_.paper_url),X=(F==null?void 0:F.title)||_.introducing_paper_title||null,Z=((qe=F==null?void 0:F.published)==null?void 0:qe.slice(0,4))||_.introduced_year||null,yt=!!de||!!_.paper_url||!!X,wt=F!=null&&F.arxiv_id||(ze=_.paper_url)!=null&&ze.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${de}`:`Paper ${de}`;return n.jsx("div",{className:"page",children:n.jsxs("div",{className:"bm-page",children:[n.jsxs("div",{className:"breadcrumb",children:[n.jsx(me,{to:"/tasks",children:"Tasks"}),B&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"sep",children:"/"}),n.jsx(me,{to:`/tasks/${B.slug||B.id}`,children:B.name})]}),n.jsx("span",{className:"sep",children:"/"}),n.jsx("span",{style:{color:"var(--accent-text)"},children:_.name})]}),n.jsxs("div",{className:"bm-title-row",children:[n.jsx("h1",{className:"bm-title",children:_.name}),I&&n.jsxs("div",{className:"bm-title-trend","aria-label":`${_.name} reporting trend`,children:[n.jsx(Tt,{history:I.history,benchmarkName:I.name}),n.jsxs("span",{className:"bm-title-trend-summary",children:[n.jsx("strong",{children:I.recent_paper_count})," ",I.recent_paper_count===1?"paper":"papers",I.rate_change==null?I.recent_paper_count>0&&n.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):n.jsxs("span",{className:`benchmark-trend-change ${I.rate_change>=1?"is-up":"is-down"}`,children:[I.rate_change>=1?"↑":"↓"," ",I.rate_change.toFixed(1),"×"]})]})]})]}),n.jsxs("div",{className:"bm-subtitle",children:[V?n.jsx(xe,{className:"h-5 w-64 bm-summary-skeleton","aria-label":"Loading benchmark summary"}):n.jsxs("span",{children:[v&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"metric-tag",children:v}),n.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"·"})]}),C?n.jsxs("span",{children:["Best: ",n.jsx("span",{className:"best-name",children:ne(M)})," by ",n.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:C})]}):n.jsxs("span",{children:[Q.length," evaluations"]})]}),_.hf_url&&n.jsxs("a",{className:"bm-action-btn",href:_.hf_url,target:"_blank",rel:"noopener noreferrer",children:[n.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),_.description&&n.jsx("p",{className:"bm-description",children:_.description}),a.hide_closed_source_evals&&N.length>0&&n.jsxs("div",{className:"bm-hidden-closed-notice",children:[n.jsxs("span",{children:[N.length," closed-source ",N.length===1?"row is":"rows are"," hidden",O!=null&&O.model_name?n.jsxs(n.Fragment,{children:[", including ",n.jsx("strong",{children:O.model_name})]}):null,"."]}),n.jsx("button",{type:"button",className:"bm-hidden-closed-action",onClick:()=>{i(!1)},children:"Show closed-source"})]}),yt&&n.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[n.jsx("span",{className:"method-source-label",children:"Source"}),de?n.jsxs(me,{to:`/paper/${de}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):wt}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]}):_.paper_url?n.jsxs("a",{href:_.paper_url,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):_.paper_url}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]}):n.jsxs("div",{className:"method-source-link is-static",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):null}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]})]}),oe.filter(d=>d.isSota).length>=2&&n.jsxs("div",{className:"bm-card",ref:f,children:[n.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[n.jsxs("div",{className:"bm-card-screenshot-title",children:[n.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),n.jsx("span",{className:"bm-card-screenshot-name",children:_.name})]}),n.jsxs("div",{className:"bm-card-screenshot-brand",children:[n.jsxs("span",{className:"brand",children:[n.jsx("span",{className:"brand-mark"}),n.jsxs("span",{className:"brand-name",children:["Papers ",n.jsx("em",{children:"With Code"})]})]}),n.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),n.jsxs("div",{className:"bm-card-head",children:[n.jsx("div",{className:"bm-card-title",children:"SOTA progression"}),n.jsxs("div",{className:"bm-card-actions",children:[A.length>1&&n.jsxs("label",{className:"bm-view-select",children:[n.jsx("span",{className:"bm-view-select-label",children:"View"}),n.jsx("select",{value:b,onChange:d=>l(d.target.value),children:W.map(d=>n.jsx("option",{value:d,children:d},d))})]}),n.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[n.jsx(Je,{className:"bm-closed-toggle-switch",checked:!a.hide_closed_source_evals,onCheckedChange:d=>{i(!d)},"aria-label":"Show closed-source models"}),n.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),n.jsx(ct,{targetRef:f,label:"SOTA chart"})]})]}),n.jsx("div",{className:"bm-chart-wrap",children:n.jsx(Lt,{points:oe,metric:b})}),n.jsxs("div",{className:"bm-chart-foot",children:[n.jsx("span",{className:"legend-dot"}),"All models over time · highlighted dots track the running best · hover for the model · click to open the paper"]})]}),R&&(()=>{var T,j;const d=R.paper_arxiv_id||R.paper_id,g=R.paper_title||(R.paper_arxiv_id?`arXiv:${R.paper_arxiv_id}`:null),h=R.best_metric&&((T=R.metrics)==null?void 0:T[R.best_metric])!==void 0?R.best_metric:b,S=(j=R.metrics)==null?void 0:j[h];return n.jsxs("div",{className:"bm-highlight-banner",role:"status",children:[n.jsx("span",{className:"bm-highlight-dot","aria-hidden":"true"}),n.jsxs("div",{className:"bm-highlight-text",children:[n.jsx("span",{className:"bm-highlight-label",children:"Comparing result"}),n.jsxs("span",{className:"bm-highlight-paper",children:[R.model_name||g||"—",R.harness?` · ${R.harness}`:""]}),n.jsxs("span",{className:"bm-highlight-meta",children:[S!==void 0&&h?n.jsxs(n.Fragment,{children:[h,": ",ne(S),g?" · ":""]}):null,d?n.jsx(me,{to:`/paper/${d}`,children:be(R.paper_title,g)}):be(R.paper_title,g)]})]})]})})(),n.jsxs("div",{className:"bm-card",ref:y,children:[n.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[n.jsxs("div",{className:"bm-card-screenshot-title",children:[n.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),n.jsx("span",{className:"bm-card-screenshot-name",children:_.name})]}),n.jsxs("div",{className:"bm-card-screenshot-brand",children:[n.jsxs("span",{className:"brand",children:[n.jsx("span",{className:"brand-mark"}),n.jsxs("span",{className:"brand-name",children:["Papers ",n.jsx("em",{children:"With Code"})]})]}),n.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),n.jsxs("div",{className:"bm-card-head",children:[n.jsx("div",{className:"bm-card-title",children:"Leaderboard"}),n.jsxs("div",{className:"bm-card-actions",children:[A.length>1&&n.jsxs("label",{className:"bm-view-select",children:[n.jsx("span",{className:"bm-view-select-label",children:"View"}),n.jsx("select",{value:b,onChange:d=>l(d.target.value),children:W.map(d=>n.jsx("option",{value:d,children:d},d))})]}),n.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[n.jsx(Je,{className:"bm-closed-toggle-switch",checked:!a.hide_closed_source_evals,onCheckedChange:d=>{i(!d)},"aria-label":"Show closed-source models"}),n.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),n.jsx(ct,{targetRef:y,label:"leaderboard"})]})]}),E.isLoading?n.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((d,g)=>n.jsx(xe,{className:"h-10 w-full mb-2"},g))}):Q.length===0?n.jsx("div",{className:"no-results",children:"No evaluations submitted yet."}):n.jsx("div",{className:"bm-table-scroll",children:n.jsxs("table",{className:"bm-table",children:[n.jsx("thead",{children:n.jsxs("tr",{children:[n.jsx("th",{className:"col-rank",children:"Rank"}),n.jsx("th",{className:"col-model",children:"Model"}),Fe&&n.jsx("th",{className:"col-harness",children:"Harness"}),le.map(d=>{const g=d===b;return n.jsx("th",{className:`col-value ${g?"is-active":""}`,"aria-sort":g?K==="↓"?"ascending":"descending":"none",children:n.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>l(d),"aria-pressed":g,title:`Sort by ${d}`,children:[d,g?` ${K}`:""]})},d)}),n.jsx("th",{className:"col-paper",children:"Paper"}),n.jsx("th",{className:"col-year",children:"Year"})]})}),n.jsx("tbody",{children:(()=>{let d=null,g=0;return Q.map((h,S)=>{var Ke,Qe;const T=he((Ke=h.metrics)==null?void 0:Ke[b]);let j=null;T!==null&&((d===null||T!==d)&&(g=S+1,d=T),j=g);const ue=h.paper_arxiv_id||h.paper_id,Ge=h.paper_title||(h.paper_arxiv_id?`arXiv:${h.paper_arxiv_id}`:null),ke=lt(h,s);return n.jsxs("tr",{ref:ke?u:void 0,className:ke?"is-highlighted":void 0,children:[n.jsx("td",{className:"col-rank",children:j??"—"}),n.jsxs("td",{className:"col-model",children:[ke&&n.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),h.hf_model_url?n.jsx("a",{href:h.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"bm-model-link",title:`Open ${h.model_name||"model"} on Hugging Face`,children:h.model_name||"—"}):h.model_name||"—",h.is_open===!1&&n.jsx(Nt,{}),(h.external??h.is_external)&&n.jsx(Rt,{sourceUrl:h.source_url||h.external_source_url||h.result_url})]}),Fe&&n.jsx("td",{className:"col-harness",children:h.harness||"—"}),le.map(Se=>{var Ye;const Xe=Se===b,ge=(Ye=h.metrics)==null?void 0:Ye[Se];return n.jsx("td",{className:`col-value${Xe?" is-active":""}${Xe&&j===1?" is-best":""}`,children:ge!=null&&ge!==""?ne(ge):"—"},Se)}),n.jsx("td",{className:"col-paper",children:ue?n.jsx(me,{to:`/paper/${ue}`,children:be(h.paper_title,Ge)}):be(h.paper_title,Ge)}),n.jsx("td",{className:"col-year",children:((Qe=h.paper_published_date)==null?void 0:Qe.slice(0,4))||"—"})]},h.id)})})()})]})})]})]})})};export{Yr as default};
|
|
|
|
|
|
|
|
|
assets/BenchmarkDetailView-DeWqlCgO.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import{u as vt,r as w,j as n,a3 as ne,g as jt,e as _t,a as kt,Z as St,L as me,b as ee}from"./index-ChUK4pXW.js";import{u as te}from"./useQuery-CKrTCSf-.js";import{S as xe}from"./skeleton-qvDYp1rq.js";import{S as Je}from"./switch-CZapgTe1.js";import{A as Ct,a as Et}from"./alert-DNLHMDlv.js";import{L as ye}from"./LatexTitle-RPgzE218.js";import{C as Nt,E as Rt}from"./ExternalSourceEvalBadge-B1HOv2kK.js";import{B as Tt}from"./BenchmarkTrendSparkline-BuEjzb26.js";import{I as $t}from"./components-Oks99QHA.js";import{s as Mt}from"./safeExternalHref-CkBrsh84.js";import"./index-0fPuHBwH.js";import"./katex.min-BSBacQyE.js";import"./hover-card-D4KxxydT.js";import"./transform-CuJRPBDz.js";function Ft(e,t,r){const s=t?(e??[]).filter(c=>c.task_id===t):e??[],a=s.filter(c=>c.is_open===!1),i=a.reduce((c,l)=>c?(l.best_rank??Number.POSITIVE_INFINITY)<(c.best_rank??Number.POSITIVE_INFINITY)?l:c:l,null);return{visible:r?s.filter(c=>c.is_open!==!1):s,hiddenClosed:a,topHiddenClosed:i}}function Ze(e){const t=e.length===7?`${e}-01`:e,r=new Date(t).getTime();return Number.isFinite(r)?r:0}const Ce=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ee(e){const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()}}function Lt(e,t){if(e===t){const{year:u,month:p}=Ee(e);return[{timestamp:new Date(u,p,1).getTime(),key:`${u}-${p}`,label:`${Ce[p]} ${u}`}]}const r=Ee(e),s=Ee(t);if(r.year===s.year){const u=s.month-r.month+1;let p=1;const f=12;u>f&&(p=Math.ceil(u/f));const y=[];for(let x=r.month;x<=s.month;x+=p)y.push({timestamp:new Date(r.year,x,1).getTime(),key:`${r.year}-${x}`,label:u<=3?`${Ce[x]} ${r.year}`:Ce[x]});return y}const a=s.year-r.year+1;let i=1;const c=12;a>c&&(i=Math.ceil(a/c));const l=[];for(let u=r.year;u<=s.year;u+=i)l.push({timestamp:new Date(u,0,1).getTime(),key:String(u),label:String(u)});return l}const It=({points:e,metric:t})=>{const r=vt(),[s,a]=w.useState(null),i=880,c=320,l=60,u=30,p=40,f=50,y=e.map(o=>o.value),x=Math.min(...y),U=Math.max(...y)-x||1,ae=i-l-u,L=c-p-f,$=e.map(o=>Ze(o.date)),z=Math.min(...$),I=Math.max(...$),ie=I-z||1,Y=o=>z===I?l+ae/2:l+(o-z)/ie*ae,G=e.map((o,m)=>{const k=Y(Ze(o.date)),v=(o.value-x)/U,M=p+L*(1-v);return{x:k,y:M,data:o,idx:m}}),N=G.filter(o=>o.data.isSota);let O="";if(N.length>=2){O=`M${N[0].x},${N[0].y}`;for(let o=1;o<N.length;o++){const m=N[o-1],k=N[o],v=(m.x+k.x)/2;O+=` C${v},${m.y} ${v},${k.y} ${k.x},${k.y}`}}const H=5.4,fe=8,J=9,A=o=>{const m=o.data.modelName||o.data.paperTitle||"";if(!m)return null;const k=m.length>22?m.slice(0,21)+"…":m,v=k.length*H;let M=o.x-v/2,C=o.x+v/2,V="middle";return M<l?(M=l,C=l+v,V="start"):C>i-u&&(C=i-u,M=C-v,V="end"),{x:V==="start"?l:V==="end"?i-u:o.x,y:o.y-J,text:k,anchor:V,left:M,right:C}},ce=[],b=N.length>0?A(N[N.length-1]):null;let _e=-1/0;for(let o=0;o<N.length-1;o++){const m=A(N[o]);m&&(m.left<_e+fe||b&&m.right>b.left-fe||(_e=m.right,ce.push({x:m.x,y:m.y,text:m.text,anchor:m.anchor})))}b&&ce.push({x:b.x,y:b.y,text:b.text,anchor:b.anchor});const K=Lt(z,I),W=5,le=o=>a(m=>m===o?null:m),oe=o=>{o&&r(`/paper/${o}`)},pe=(o,m)=>{const v=`${o.data.modelName||o.data.paperTitle||"Unknown model"}: ${ne(o.data.value)} on ${o.data.dateLabel}`,M=!!o.data.paperRouteId;return n.jsxs("g",{children:[m,n.jsx("circle",{cx:o.x,cy:o.y,r:"10",fill:"transparent",style:{cursor:M?"pointer":"default",outline:"none"},tabIndex:0,role:M?"link":"img","aria-label":v,onMouseEnter:()=>a(o.idx),onMouseLeave:()=>le(o.idx),onFocus:()=>a(o.idx),onBlur:()=>le(o.idx),onClick:()=>oe(o.data.paperRouteId),onKeyDown:C=>{M&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),oe(o.data.paperRouteId))},children:n.jsx("title",{children:v})})]},o.idx)};return n.jsxs("svg",{width:"100%",viewBox:`0 0 ${i} ${c}`,style:{display:"block"},children:[n.jsx("text",{x:l-38,y:p+L/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${l-38} ${p+L/2})`,children:t}),Array.from({length:W}).map((o,m)=>{const k=m/(W-1),v=p+L*(1-k),M=x+U*k;return n.jsxs("g",{children:[n.jsx("line",{x1:l,y1:v,x2:i-u,y2:v,stroke:"var(--hairline)",strokeWidth:"1"}),n.jsx("text",{x:l-10,y:v+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:ne(M)})]},m)}),K.map(o=>{const m=Y(o.timestamp);return n.jsx("text",{x:m,y:c-f+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:o.label},o.key)}),G.filter(o=>!o.data.isSota).map(o=>{const m=s===o.idx;return pe(o,n.jsx("circle",{cx:o.x,cy:o.y,r:m?3:2,fill:"var(--ink-faint)",opacity:m?1:.45,style:{transition:"r 0.12s ease, opacity 0.12s ease"}}))}),O&&n.jsx("path",{d:O,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),N.map(o=>{const m=s===o.idx;return pe(o,n.jsx("circle",{cx:o.x,cy:o.y,r:m?4.5:3,fill:m?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"1.5",style:{transition:"r 0.12s ease, fill 0.12s ease"}}))}),ce.map((o,m)=>n.jsx("text",{x:o.x,y:o.y,fontSize:"9.5",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:o.anchor,pointerEvents:"none",style:{paintOrder:"stroke",stroke:"var(--bg-elevated)",strokeWidth:3,strokeLinejoin:"round"},children:o.text},`label-${m}`)),s!==null&&G[s]&&(()=>{const o=G[s],m=o.data.modelName||o.data.paperTitle||"Unknown model",v=`${m.length>40?m.slice(0,39)+"…":m}: ${ne(o.data.value)}`,C=Math.max(120,Math.min(340,v.length*6.6+24)),V=30;let B=o.x-C/2;B<l&&(B=l),B+C>i-u&&(B=i-u-C);const Q=o.y-V-14>=p?o.y-V-12:o.y+12;return n.jsxs("g",{pointerEvents:"none",children:[n.jsx("rect",{x:B,y:Q,width:C,height:V,rx:"6",ry:"6",fill:"var(--bg-elevated)",stroke:"var(--hairline-strong)",strokeWidth:"1",style:{filter:"drop-shadow(0 2px 6px rgba(0,0,0,0.08))"}}),n.jsx("text",{x:B+12,y:Q+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:v})]})})()]})};function Pt(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const r=document.implementation.createHTMLDocument(),s=r.createElement("base"),a=r.createElement("a");return r.head.appendChild(s),r.body.appendChild(a),t&&(s.href=t),a.href=e,a.href}const At=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function q(e){const t=[];for(let r=0,s=e.length;r<s;r++)t.push(e[r]);return t}let re=null;function dt(e={}){return re||(e.includeStyleProperties?(re=e.includeStyleProperties,re):(re=q(window.getComputedStyle(document.documentElement)),re))}function we(e,t){const s=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return s?parseFloat(s.replace("px","")):0}function Dt(e){const t=we(e,"border-left-width"),r=we(e,"border-right-width");return e.clientWidth+t+r}function Bt(e){const t=we(e,"border-top-width"),r=we(e,"border-bottom-width");return e.clientHeight+t+r}function ut(e,t={}){const r=t.width||Dt(e),s=t.height||Bt(e);return{width:r,height:s}}function Ht(){let e,t;try{t=process}catch{}const r=t&&t.env?t.env.devicePixelRatio:null;return r&&(e=parseInt(r,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const D=16384;function Vt(e){(e.width>D||e.height>D)&&(e.width>D&&e.height>D?e.width>e.height?(e.height*=D/e.width,e.width=D):(e.width*=D/e.height,e.height=D):e.width>D?(e.height*=D/e.width,e.width=D):(e.width*=D/e.height,e.height=D))}function Ot(e,t={}){return e.toBlob?new Promise(r=>{e.toBlob(r,t.type?t.type:"image/png",t.quality?t.quality:1)}):new Promise(r=>{const s=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),a=s.length,i=new Uint8Array(a);for(let c=0;c<a;c+=1)i[c]=s.charCodeAt(c);r(new Blob([i],{type:t.type?t.type:"image/png"}))})}function ve(e){return new Promise((t,r)=>{const s=new Image;s.onload=()=>{s.decode().then(()=>{requestAnimationFrame(()=>t(s))})},s.onerror=r,s.crossOrigin="anonymous",s.decoding="async",s.src=e})}async function Ut(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Wt(e,t,r){const s="http://www.w3.org/2000/svg",a=document.createElementNS(s,"svg"),i=document.createElementNS(s,"foreignObject");return a.setAttribute("width",`${t}`),a.setAttribute("height",`${r}`),a.setAttribute("viewBox",`0 0 ${t} ${r}`),i.setAttribute("width","100%"),i.setAttribute("height","100%"),i.setAttribute("x","0"),i.setAttribute("y","0"),i.setAttribute("externalResourcesRequired","true"),a.appendChild(i),i.appendChild(e),Ut(a)}const P=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||P(r,t)};function qt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function zt(e,t){return dt(t).map(r=>{const s=e.getPropertyValue(r),a=e.getPropertyPriority(r);return`${r}: ${s}${a?" !important":""};`}).join(" ")}function Gt(e,t,r,s){const a=`.${e}:${t}`,i=r.cssText?qt(r):zt(r,s);return document.createTextNode(`${a}{${i}}`)}function et(e,t,r,s){const a=window.getComputedStyle(e,r),i=a.getPropertyValue("content");if(i===""||i==="none")return;const c=At();try{t.className=`${t.className} ${c}`}catch{return}const l=document.createElement("style");l.appendChild(Gt(c,r,a,s)),t.appendChild(l)}function Kt(e,t,r){et(e,t,":before",r),et(e,t,":after",r)}const tt="application/font-woff",rt="image/jpeg",Qt={woff:tt,woff2:tt,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:rt,jpeg:rt,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Xt(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function $e(e){const t=Xt(e).toLowerCase();return Qt[t]||""}function Yt(e){return e.split(/,/)[1]}function Re(e){return e.search(/^(data:)/)!==-1}function Jt(e,t){return`data:${t};base64,${e}`}async function mt(e,t,r){const s=await fetch(e,t);if(s.status===404)throw new Error(`Resource "${s.url}" not found`);const a=await s.blob();return new Promise((i,c)=>{const l=new FileReader;l.onerror=c,l.onloadend=()=>{try{i(r({res:s,result:l.result}))}catch(u){c(u)}},l.readAsDataURL(a)})}const Ne={};function Zt(e,t,r){let s=e.replace(/\?.*/,"");return r&&(s=e),/ttf|otf|eot|woff2?/i.test(s)&&(s=s.replace(/.*\//,"")),t?`[${t}]${s}`:s}async function Me(e,t,r){const s=Zt(e,t,r.includeQueryParams);if(Ne[s]!=null)return Ne[s];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let a;try{const i=await mt(e,r.fetchRequestInit,({res:c,result:l})=>(t||(t=c.headers.get("Content-Type")||""),Yt(l)));a=Jt(i,t)}catch(i){a=r.imagePlaceholder||"";let c=`Failed to fetch resource: ${e}`;i&&(c=typeof i=="string"?i:i.message),c&&console.warn(c)}return Ne[s]=a,a}async function er(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ve(t)}async function tr(e,t){if(e.currentSrc){const i=document.createElement("canvas"),c=i.getContext("2d");i.width=e.clientWidth,i.height=e.clientHeight,c==null||c.drawImage(e,0,0,i.width,i.height);const l=i.toDataURL();return ve(l)}const r=e.poster,s=$e(r),a=await Me(r,s,t);return ve(a)}async function rr(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await je(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function sr(e,t){return P(e,HTMLCanvasElement)?er(e):P(e,HTMLVideoElement)?tr(e,t):P(e,HTMLIFrameElement)?rr(e,t):e.cloneNode(ht(e))}const nr=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",ht=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function ar(e,t,r){var s,a;if(ht(t))return t;let i=[];return nr(e)&&e.assignedNodes?i=q(e.assignedNodes()):P(e,HTMLIFrameElement)&&(!((s=e.contentDocument)===null||s===void 0)&&s.body)?i=q(e.contentDocument.body.childNodes):i=q(((a=e.shadowRoot)!==null&&a!==void 0?a:e).childNodes),i.length===0||P(e,HTMLVideoElement)||await i.reduce((c,l)=>c.then(()=>je(l,r)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function ir(e,t,r){const s=t.style;if(!s)return;const a=window.getComputedStyle(e);a.cssText?(s.cssText=a.cssText,s.transformOrigin=a.transformOrigin):dt(r).forEach(i=>{let c=a.getPropertyValue(i);i==="font-size"&&c.endsWith("px")&&(c=`${Math.floor(parseFloat(c.substring(0,c.length-2)))-.1}px`),P(e,HTMLIFrameElement)&&i==="display"&&c==="inline"&&(c="block"),i==="d"&&t.getAttribute("d")&&(c=`path(${t.getAttribute("d")})`),s.setProperty(i,c,a.getPropertyPriority(i))})}function cr(e,t){P(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),P(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function lr(e,t){if(P(e,HTMLSelectElement)){const r=t,s=Array.from(r.children).find(a=>e.value===a.getAttribute("value"));s&&s.setAttribute("selected","")}}function or(e,t,r){return P(t,Element)&&(ir(e,t,r),Kt(e,t,r),cr(e,t),lr(e,t)),t}async function dr(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const s={};for(let i=0;i<r.length;i++){const l=r[i].getAttribute("xlink:href");if(l){const u=e.querySelector(l),p=document.querySelector(l);!u&&p&&!s[l]&&(s[l]=await je(p,t,!0))}}const a=Object.values(s);if(a.length){const i="http://www.w3.org/1999/xhtml",c=document.createElementNS(i,"svg");c.setAttribute("xmlns",i),c.style.position="absolute",c.style.width="0",c.style.height="0",c.style.overflow="hidden",c.style.display="none";const l=document.createElementNS(i,"defs");c.appendChild(l);for(let u=0;u<a.length;u++)l.appendChild(a[u]);e.appendChild(c)}return e}async function je(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(s=>sr(s,t)).then(s=>ar(e,s,t)).then(s=>or(e,s,t)).then(s=>dr(s,t))}const ft=/url\((['"]?)([^'"]+?)\1\)/g,ur=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,mr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function hr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function fr(e){const t=[];return e.replace(ft,(r,s,a)=>(t.push(a),r)),t.filter(r=>!Re(r))}async function pr(e,t,r,s,a){try{const i=r?Pt(t,r):t,c=$e(t);let l;return a||(l=await Me(i,c,s)),e.replace(hr(t),`$1${l}$3`)}catch{}return e}function gr(e,{preferredFontFormat:t}){return t?e.replace(mr,r=>{for(;;){const[s,,a]=ur.exec(r)||[];if(!a)return"";if(a===t)return`src: ${s};`}}):e}function pt(e){return e.search(ft)!==-1}async function gt(e,t,r){if(!pt(e))return e;const s=gr(e,r);return fr(s).reduce((i,c)=>i.then(l=>pr(l,c,t,r)),Promise.resolve(s))}async function se(e,t,r){var s;const a=(s=t.style)===null||s===void 0?void 0:s.getPropertyValue(e);if(a){const i=await gt(a,null,r);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function xr(e,t){await se("background",e,t)||await se("background-image",e,t),await se("mask",e,t)||await se("-webkit-mask",e,t)||await se("mask-image",e,t)||await se("-webkit-mask-image",e,t)}async function br(e,t){const r=P(e,HTMLImageElement);if(!(r&&!Re(e.src))&&!(P(e,SVGImageElement)&&!Re(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,a=await Me(s,$e(s),t);await new Promise((i,c)=>{e.onload=i,e.onerror=t.onImageErrorHandler?(...u)=>{try{i(t.onImageErrorHandler(...u))}catch(p){c(p)}}:c;const l=e;l.decode&&(l.decode=i),l.loading==="lazy"&&(l.loading="eager"),r?(e.srcset="",e.src=a):e.href.baseVal=a})}async function yr(e,t){const s=q(e.childNodes).map(a=>xt(a,t));await Promise.all(s).then(()=>e)}async function xt(e,t){P(e,Element)&&(await xr(e,t),await br(e,t),await yr(e,t))}function wr(e,t){const{style:r}=e;t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.width&&(r.width=`${t.width}px`),t.height&&(r.height=`${t.height}px`);const s=t.style;return s!=null&&Object.keys(s).forEach(a=>{r[a]=s[a]}),e}const st={};async function nt(e){let t=st[e];if(t!=null)return t;const s=await(await fetch(e)).text();return t={url:e,cssText:s},st[e]=t,t}async function at(e,t){let r=e.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async c=>{let l=c.replace(s,"$1");return l.startsWith("https://")||(l=new URL(l,e.url).href),mt(l,t.fetchRequestInit,({result:u})=>(r=r.replace(c,`url(${u})`),[c,u]))});return Promise.all(i).then(()=>r)}function it(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let s=e.replace(r,"");const a=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const u=a.exec(s);if(u===null)break;t.push(u[0])}s=s.replace(a,"");const i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,c="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",l=new RegExp(c,"gi");for(;;){let u=i.exec(s);if(u===null){if(u=l.exec(s),u===null)break;i.lastIndex=l.lastIndex}else l.lastIndex=i.lastIndex;t.push(u[0])}return t}async function vr(e,t){const r=[],s=[];return e.forEach(a=>{if("cssRules"in a)try{q(a.cssRules||[]).forEach((i,c)=>{if(i.type===CSSRule.IMPORT_RULE){let l=c+1;const u=i.href,p=nt(u).then(f=>at(f,t)).then(f=>it(f).forEach(y=>{try{a.insertRule(y,y.startsWith("@import")?l+=1:a.cssRules.length)}catch(x){console.error("Error inserting rule from remote css",{rule:y,error:x})}})).catch(f=>{console.error("Error loading remote css",f.toString())});s.push(p)}})}catch(i){const c=e.find(l=>l.href==null)||document.styleSheets[0];a.href!=null&&s.push(nt(a.href).then(l=>at(l,t)).then(l=>it(l).forEach(u=>{c.insertRule(u,c.cssRules.length)})).catch(l=>{console.error("Error loading remote stylesheet",l)})),console.error("Error inlining remote css file",i)}}),Promise.all(s).then(()=>(e.forEach(a=>{if("cssRules"in a)try{q(a.cssRules||[]).forEach(i=>{r.push(i)})}catch(i){console.error(`Error while reading CSS rules from ${a.href}`,i)}}),r))}function jr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>pt(t.style.getPropertyValue("src")))}async function _r(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=q(e.ownerDocument.styleSheets),s=await vr(r,t);return jr(s)}function bt(e){return e.trim().replace(/["']/g,"")}function kr(e){const t=new Set;function r(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(i=>{t.add(bt(i))}),Array.from(s.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function Sr(e,t){const r=await _r(e,t),s=kr(e);return(await Promise.all(r.filter(i=>s.has(bt(i.style.fontFamily))).map(i=>{const c=i.parentStyleSheet?i.parentStyleSheet.href:null;return gt(i.cssText,c,t)}))).join(`
|
| 2 |
+
`)}async function Cr(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Sr(e,t);if(r){const s=document.createElement("style"),a=document.createTextNode(r);s.appendChild(a),e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}}async function Er(e,t={}){const{width:r,height:s}=ut(e,t),a=await je(e,t,!0);return await Cr(a,t),await xt(a,t),wr(a,t),await Wt(a,r,s)}async function Nr(e,t={}){const{width:r,height:s}=ut(e,t),a=await Er(e,t),i=await ve(a),c=document.createElement("canvas"),l=c.getContext("2d"),u=t.pixelRatio||Ht(),p=t.canvasWidth||r,f=t.canvasHeight||s;return c.width=p*u,c.height=f*u,t.skipAutoScale||Vt(c),c.style.width=`${p}`,c.style.height=`${f}`,t.backgroundColor&&(l.fillStyle=t.backgroundColor,l.fillRect(0,0,c.width,c.height)),l.drawImage(i,0,0,c.width,c.height),c}async function Rr(e,t={}){const r=await Nr(e,t);return await Ot(r)}const Te="#ffffff";function Tr(){return typeof window>"u"?Te:window.getComputedStyle(document.documentElement).getPropertyValue("--bg-elevated").trim()||Te}function $r(e){if(typeof window>"u")return Te;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Tr():t}async function Mr(e){var r,s;if(typeof window>"u"||!((s=(r=window.navigator)==null?void 0:r.clipboard)!=null&&s.write))throw new Error("Clipboard image copy is not supported in this browser.");if(typeof window.ClipboardItem>"u")throw new Error("Clipboard image copy is not supported in this browser.");const t=await Rr(e,{pixelRatio:2,cacheBust:!0,backgroundColor:$r(e)});if(!t)throw new Error("Failed to render screenshot.");await window.navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])}const ct=({targetRef:e,label:t})=>{const{toast:r}=jt(),[s,a]=w.useState("idle"),i=w.useRef(null);w.useEffect(()=>()=>{i.current!==null&&window.clearTimeout(i.current)},[]);const c=w.useCallback(async()=>{const u=e.current;if(u){a("copying"),u.classList.add("is-capturing"),u.offsetHeight,await new Promise(p=>window.requestAnimationFrame(()=>p()));try{await Mr(u),a("copied"),r({title:"Screenshot copied",description:`Image of the ${t} copied to your clipboard.`}),i.current!==null&&window.clearTimeout(i.current),i.current=window.setTimeout(()=>a("idle"),1500)}catch(p){a("idle"),r({title:"Copy failed",description:p instanceof Error&&p.message?p.message:"Could not copy the screenshot to your clipboard.",variant:"destructive"})}finally{u.classList.remove("is-capturing")}}},[e,t,r]),l=s==="copied"?"Copied":s==="copying"?"Copying…":"Copy image";return n.jsxs("button",{type:"button",className:"bm-copy-btn",onClick:c,disabled:s==="copying","aria-label":`Copy ${t} screenshot to clipboard`,title:`Copy ${t} screenshot to clipboard`,children:[n.jsx($t,{name:"copy",size:11}),l]})};function he(e){if(e==null)return null;if(typeof e=="number")return Number.isFinite(e)?e:null;const t=e.includes("±")?e.split("±")[0].trim():e.trim(),r=parseFloat(t);return Number.isFinite(r)?r:null}function Fr(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function Lr(e){const t=new Map;for(const r of e){const s=Fr(r),a=t.get(s);if(!a){t.set(s,{...r,metrics:{...r.metrics||{}},sourceEvaluationIds:[r.id],ranksByMetric:r.best_metric&&r.best_rank!=null?{[r.best_metric]:r.best_rank}:{}});continue}a.metrics={...a.metrics,...r.metrics||{}},a.sourceEvaluationIds.push(r.id),r.best_metric&&r.best_rank!=null&&(a.ranksByMetric[r.best_metric]=r.best_rank)}return Array.from(t.values())}function lt(e,t){return t?e.id===t||e.sourceEvaluationIds.includes(t):!1}function ot(e,t){return e.ranksByMetric[t]??e.best_rank??9999}function Ir(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const s=e.map(f=>{var E;const y=he((E=f.metrics)==null?void 0:E[t]),x=f.paper_published_date||"";return{eval:f,value:y,date:x}}).filter(f=>f.value!==null&&!!f.date).sort((f,y)=>f.date.localeCompare(y.date)),a=[];let i=null;for(const f of s){const y=i==null?!0:r==="↓"?f.value<i:f.value>i;y&&(i=f.value),a.push({value:f.value,date:f.date,dateLabel:f.date.slice(0,7),modelName:f.eval.model_name||"",paperTitle:f.eval.paper_title||"",paperRouteId:f.eval.paper_arxiv_id||f.eval.paper_id||null,isSota:y})}const l=e.map(f=>{var y;return{eval:f,value:he((y=f.metrics)==null?void 0:y[t])}}).filter(f=>f.value!==null).sort((f,y)=>r==="↓"?f.value-y.value:y.value-f.value)[0],u=(l==null?void 0:l.value)??0,p=(l==null?void 0:l.eval.model_name)||(l==null?void 0:l.eval.paper_title)||"";return{points:a,sota:u,sotaModel:p}}const Pr=5;function Ar(e){if(!e)return null;const t=e.trim(),r=t.match(/^https?:\/\/(?:www\.)?arxiv\.org\/(?:abs|pdf)\/([^/?#]+)/i);if(r!=null&&r[1])return r[1].replace(/\.pdf$/i,"");const s=t.match(/^(?:https?:\/\/(?:www\.)?paperswithcode\.co)?\/paper\/([^/?#]+)/i);return(s==null?void 0:s[1])??null}function be(e,t){return e?n.jsx(ye,{title:e}):t||"—"}const Jr=()=>{var Le,Ie,Pe,Ae,De,Be,He,Ve,Oe,Ue,We,qe,ze;const{datasetSlug:e}=_t(),[t]=kt(),r=t.get("task")||void 0,s=t.get("eval")||void 0,{preferences:a,setHideClosedSourceEvals:i}=St(),[c,l]=w.useState(void 0),u=w.useRef(null),p=w.useRef(!1),f=w.useRef(null),y=w.useRef(null),x=te({queryKey:["dataset",e,"with-paper",r,a.hide_closed_source_evals?"open":"all"],queryFn:()=>ee.getDatasetBySlug(e,{include_paper:!0,task:r,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!e,staleTime:10*60*1e3}),E=te({queryKey:["dataset-evals",(Le=x.data)==null?void 0:Le.id],queryFn:()=>ee.getEvaluationsByDataset(x.data.id),enabled:!!((Ie=x.data)!=null&&Ie.id),staleTime:5*60*1e3}),U=te({queryKey:["dataset-tasks",(Pe=x.data)==null?void 0:Pe.id],queryFn:()=>ee.getDatasetTasks(x.data.id),enabled:!!((Ae=x.data)!=null&&Ae.id),staleTime:10*60*1e3}),ae=te({queryKey:["metric-directions"],queryFn:()=>ee.getMetricDirections(),staleTime:60*60*1e3}),L=w.useMemo(()=>{var d;return!s||!((d=E.data)!=null&&d.length)?null:E.data.find(g=>g.id===s)||null},[s,E.data]),$=w.useMemo(()=>{const d=U.data||[];if(d.length===0)return null;if(L!=null&&L.task_id&&d.some(h=>h.id===L.task_id))return L.task_id;if(r){const h=d.find(S=>S.slug===r);if(h)return h.id}if(d.length===1)return d[0].id;const g=E.data||[];if(g.length>0){const h=new Map;for(const j of g)h.set(j.task_id,(h.get(j.task_id)||0)+1);let S=null,T=-1;for(const j of d){const ue=h.get(j.id)||0;ue>T&&(T=ue,S=j.id)}if(S)return S}return d[0].id},[U.data,E.data,r,L]),z=te({queryKey:["task-benchmark-trends",$,a.hide_closed_source_evals?!0:void 0],queryFn:()=>ee.getTrendingBenchmarks($,{limit:100,min_recent_papers:0,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!$&&!!((De=x.data)!=null&&De.id),staleTime:10*60*1e3}),I=w.useMemo(()=>{var d;return(((d=z.data)==null?void 0:d.results)||[]).find(g=>{var h;return g.id===((h=x.data)==null?void 0:h.id)})||null},[z.data,(Be=x.data)==null?void 0:Be.id]),ie=te({queryKey:["leaderboard-metrics",(He=x.data)==null?void 0:He.id,$],queryFn:()=>ee.getLeaderboardMetrics(x.data.id,$),enabled:!!((Ve=x.data)!=null&&Ve.id)&&!!$,staleTime:10*60*1e3}),Y=w.useMemo(()=>Ft(E.data,$,a.hide_closed_source_evals),[E.data,$,a.hide_closed_source_evals]),G=Y.visible,N=Y.hiddenClosed,O=Y.topHiddenClosed,H=w.useMemo(()=>Lr(G),[G]),fe=w.useMemo(()=>{const d=new Set;return H.forEach(g=>{g.best_metric&&d.add(g.best_metric),Object.keys(g.metrics||{}).forEach(h=>d.add(h))}),Array.from(d)},[H]),J=w.useMemo(()=>(ie.data||[]).map(d=>d.metric_name),[ie.data]),A=J.length?J:fe,ce=w.useMemo(()=>{var S;if(H.length===0)return A[0]||"";const d=new Map;for(const T of H)for(const j of Object.keys(T.metrics||{}))J.length&&!A.includes(j)||d.set(j,(d.get(j)||0)+1);let g=null,h=0;for(const[T,j]of d)j>h&&(h=j,g=T);return g||A[0]||((S=H[0])==null?void 0:S.best_metric)||""},[H,A,J]),b=c||(L==null?void 0:L.best_metric)||ce,K=(((Ue=(Oe=ae.data)==null?void 0:Oe.directions)==null?void 0:Ue[b])||"higher_is_better")==="lower_is_better"?"↓":"↑",W=w.useMemo(()=>!b||!A.includes(b)?A:[b,...A.filter(d=>d!==b)],[A,b]),le=w.useMemo(()=>W.length===0?b?[b]:[]:W.slice(0,Pr),[W,b]),{points:oe,sota:pe,sotaModel:o}=w.useMemo(()=>Ir(H,b,K),[H,b,K]),m=(We=x.data)==null?void 0:We.leaderboard_summary,k=E.isSuccess&&U.isSuccess&&ae.isSuccess&&(!$||ie.isSuccess),v=k?b:m==null?void 0:m.metric,M=k?pe:m==null?void 0:m.value,C=k?o:m==null?void 0:m.model_name,V=!k&&!m;w.useEffect(()=>{if(p.current||!s||!E.data||E.data.length===0)return;const d=u.current;d&&(p.current=!0,d.scrollIntoView({behavior:"smooth",block:"start"}))},[s,E.data]);const B=w.useMemo(()=>{const d=U.data||[];return $?d.find(g=>g.id===$)||d[0]||null:d[0]||null},[U.data,$]);if(x.isLoading)return n.jsxs("div",{className:"page",children:[n.jsx(xe,{className:"h-12 w-1/2 mb-6"}),n.jsx(xe,{className:"h-64 w-full"})]});if(x.error||!x.data)return n.jsx("div",{className:"page",children:n.jsx(Ct,{variant:"destructive",children:n.jsx(Et,{children:"Benchmark not found."})})});const _=x.data,Q=H.slice().sort((d,g)=>{var T,j;const h=he((T=d.metrics)==null?void 0:T[b]),S=he((j=g.metrics)==null?void 0:j[b]);return h!==null&&S!==null?K==="↓"?h-S:S-h:h!==null?-1:S!==null?1:ot(d,b)-ot(g,b)}),Fe=!!_.supports_harness,R=s&&Q.find(d=>lt(d,s))||null,F=_.introducing_paper??void 0,de=(F==null?void 0:F.arxiv_id)||(F==null?void 0:F.id)||Ar(_.paper_url),X=(F==null?void 0:F.title)||_.introducing_paper_title||null,Z=((qe=F==null?void 0:F.published)==null?void 0:qe.slice(0,4))||_.introduced_year||null,yt=!!de||!!_.paper_url||!!X,wt=F!=null&&F.arxiv_id||(ze=_.paper_url)!=null&&ze.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${de}`:`Paper ${de}`;return n.jsx("div",{className:"page",children:n.jsxs("div",{className:"bm-page",children:[n.jsxs("div",{className:"breadcrumb",children:[n.jsx(me,{to:"/tasks",children:"Tasks"}),B&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"sep",children:"/"}),n.jsx(me,{to:`/tasks/${B.slug||B.id}`,children:B.name})]}),n.jsx("span",{className:"sep",children:"/"}),n.jsx("span",{style:{color:"var(--accent-text)"},children:_.name})]}),n.jsxs("div",{className:"bm-title-row",children:[n.jsx("h1",{className:"bm-title",children:_.name}),I&&n.jsxs("div",{className:"bm-title-trend","aria-label":`${_.name} reporting trend`,children:[n.jsx(Tt,{history:I.history,benchmarkName:I.name}),n.jsxs("span",{className:"bm-title-trend-summary",children:[n.jsx("strong",{children:I.recent_paper_count})," ",I.recent_paper_count===1?"paper":"papers",I.rate_change==null?I.recent_paper_count>0&&n.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):n.jsxs("span",{className:`benchmark-trend-change ${I.rate_change>=1?"is-up":"is-down"}`,children:[I.rate_change>=1?"↑":"↓"," ",I.rate_change.toFixed(1),"×"]})]})]})]}),n.jsxs("div",{className:"bm-subtitle",children:[V?n.jsx(xe,{className:"h-5 w-64 bm-summary-skeleton","aria-label":"Loading benchmark summary"}):n.jsxs("span",{children:[v&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"metric-tag",children:v}),n.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"·"})]}),C?n.jsxs("span",{children:["Best: ",n.jsx("span",{className:"best-name",children:ne(M)})," by ",n.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:C})]}):n.jsxs("span",{children:[Q.length," evaluations"]})]}),_.hf_url&&n.jsxs("a",{className:"bm-action-btn",href:_.hf_url,target:"_blank",rel:"noopener noreferrer",children:[n.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),_.description&&n.jsx("p",{className:"bm-description",children:_.description}),a.hide_closed_source_evals&&N.length>0&&n.jsxs("div",{className:"bm-hidden-closed-notice",children:[n.jsxs("span",{children:[N.length," closed-source ",N.length===1?"row is":"rows are"," hidden",O!=null&&O.model_name?n.jsxs(n.Fragment,{children:[", including ",n.jsx("strong",{children:O.model_name})]}):null,"."]}),n.jsx("button",{type:"button",className:"bm-hidden-closed-action",onClick:()=>{i(!1)},children:"Show closed-source"})]}),yt&&n.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[n.jsx("span",{className:"method-source-label",children:"Source"}),de?n.jsxs(me,{to:`/paper/${de}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):wt}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]}):_.paper_url?n.jsxs("a",{href:Mt(_.paper_url)??void 0,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):_.paper_url}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]}):n.jsxs("div",{className:"method-source-link is-static",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):null}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]})]}),oe.filter(d=>d.isSota).length>=2&&n.jsxs("div",{className:"bm-card",ref:f,children:[n.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[n.jsxs("div",{className:"bm-card-screenshot-title",children:[n.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),n.jsx("span",{className:"bm-card-screenshot-name",children:_.name})]}),n.jsxs("div",{className:"bm-card-screenshot-brand",children:[n.jsxs("span",{className:"brand",children:[n.jsx("span",{className:"brand-mark"}),n.jsxs("span",{className:"brand-name",children:["Papers ",n.jsx("em",{children:"With Code"})]})]}),n.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),n.jsxs("div",{className:"bm-card-head",children:[n.jsx("div",{className:"bm-card-title",children:"SOTA progression"}),n.jsxs("div",{className:"bm-card-actions",children:[A.length>1&&n.jsxs("label",{className:"bm-view-select",children:[n.jsx("span",{className:"bm-view-select-label",children:"View"}),n.jsx("select",{value:b,onChange:d=>l(d.target.value),children:W.map(d=>n.jsx("option",{value:d,children:d},d))})]}),n.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[n.jsx(Je,{className:"bm-closed-toggle-switch",checked:!a.hide_closed_source_evals,onCheckedChange:d=>{i(!d)},"aria-label":"Show closed-source models"}),n.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),n.jsx(ct,{targetRef:f,label:"SOTA chart"})]})]}),n.jsx("div",{className:"bm-chart-wrap",children:n.jsx(It,{points:oe,metric:b})}),n.jsxs("div",{className:"bm-chart-foot",children:[n.jsx("span",{className:"legend-dot"}),"All models over time · highlighted dots track the running best · hover for the model · click to open the paper"]})]}),R&&(()=>{var T,j;const d=R.paper_arxiv_id||R.paper_id,g=R.paper_title||(R.paper_arxiv_id?`arXiv:${R.paper_arxiv_id}`:null),h=R.best_metric&&((T=R.metrics)==null?void 0:T[R.best_metric])!==void 0?R.best_metric:b,S=(j=R.metrics)==null?void 0:j[h];return n.jsxs("div",{className:"bm-highlight-banner",role:"status",children:[n.jsx("span",{className:"bm-highlight-dot","aria-hidden":"true"}),n.jsxs("div",{className:"bm-highlight-text",children:[n.jsx("span",{className:"bm-highlight-label",children:"Comparing result"}),n.jsxs("span",{className:"bm-highlight-paper",children:[R.model_name||g||"—",R.harness?` · ${R.harness}`:""]}),n.jsxs("span",{className:"bm-highlight-meta",children:[S!==void 0&&h?n.jsxs(n.Fragment,{children:[h,": ",ne(S),g?" · ":""]}):null,d?n.jsx(me,{to:`/paper/${d}`,children:be(R.paper_title,g)}):be(R.paper_title,g)]})]})]})})(),n.jsxs("div",{className:"bm-card",ref:y,children:[n.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[n.jsxs("div",{className:"bm-card-screenshot-title",children:[n.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),n.jsx("span",{className:"bm-card-screenshot-name",children:_.name})]}),n.jsxs("div",{className:"bm-card-screenshot-brand",children:[n.jsxs("span",{className:"brand",children:[n.jsx("span",{className:"brand-mark"}),n.jsxs("span",{className:"brand-name",children:["Papers ",n.jsx("em",{children:"With Code"})]})]}),n.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),n.jsxs("div",{className:"bm-card-head",children:[n.jsx("div",{className:"bm-card-title",children:"Leaderboard"}),n.jsxs("div",{className:"bm-card-actions",children:[A.length>1&&n.jsxs("label",{className:"bm-view-select",children:[n.jsx("span",{className:"bm-view-select-label",children:"View"}),n.jsx("select",{value:b,onChange:d=>l(d.target.value),children:W.map(d=>n.jsx("option",{value:d,children:d},d))})]}),n.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[n.jsx(Je,{className:"bm-closed-toggle-switch",checked:!a.hide_closed_source_evals,onCheckedChange:d=>{i(!d)},"aria-label":"Show closed-source models"}),n.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),n.jsx(ct,{targetRef:y,label:"leaderboard"})]})]}),E.isLoading?n.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((d,g)=>n.jsx(xe,{className:"h-10 w-full mb-2"},g))}):Q.length===0?n.jsx("div",{className:"no-results",children:"No evaluations submitted yet."}):n.jsx("div",{className:"bm-table-scroll",children:n.jsxs("table",{className:"bm-table",children:[n.jsx("thead",{children:n.jsxs("tr",{children:[n.jsx("th",{className:"col-rank",children:"Rank"}),n.jsx("th",{className:"col-model",children:"Model"}),Fe&&n.jsx("th",{className:"col-harness",children:"Harness"}),le.map(d=>{const g=d===b;return n.jsx("th",{className:`col-value ${g?"is-active":""}`,"aria-sort":g?K==="↓"?"ascending":"descending":"none",children:n.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>l(d),"aria-pressed":g,title:`Sort by ${d}`,children:[d,g?` ${K}`:""]})},d)}),n.jsx("th",{className:"col-paper",children:"Paper"}),n.jsx("th",{className:"col-year",children:"Year"})]})}),n.jsx("tbody",{children:(()=>{let d=null,g=0;return Q.map((h,S)=>{var Ke,Qe;const T=he((Ke=h.metrics)==null?void 0:Ke[b]);let j=null;T!==null&&((d===null||T!==d)&&(g=S+1,d=T),j=g);const ue=h.paper_arxiv_id||h.paper_id,Ge=h.paper_title||(h.paper_arxiv_id?`arXiv:${h.paper_arxiv_id}`:null),ke=lt(h,s);return n.jsxs("tr",{ref:ke?u:void 0,className:ke?"is-highlighted":void 0,children:[n.jsx("td",{className:"col-rank",children:j??"—"}),n.jsxs("td",{className:"col-model",children:[ke&&n.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),h.hf_model_url?n.jsx("a",{href:h.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"bm-model-link",title:`Open ${h.model_name||"model"} on Hugging Face`,children:h.model_name||"—"}):h.model_name||"—",h.is_open===!1&&n.jsx(Nt,{}),(h.external??h.is_external)&&n.jsx(Rt,{sourceUrl:h.source_url||h.external_source_url||h.result_url})]}),Fe&&n.jsx("td",{className:"col-harness",children:h.harness||"—"}),le.map(Se=>{var Ye;const Xe=Se===b,ge=(Ye=h.metrics)==null?void 0:Ye[Se];return n.jsx("td",{className:`col-value${Xe?" is-active":""}${Xe&&j===1?" is-best":""}`,children:ge!=null&&ge!==""?ne(ge):"—"},Se)}),n.jsx("td",{className:"col-paper",children:ue?n.jsx(me,{to:`/paper/${ue}`,children:be(h.paper_title,Ge)}):be(h.paper_title,Ge)}),n.jsx("td",{className:"col-year",children:((Qe=h.paper_published_date)==null?void 0:Qe.slice(0,4))||"—"})]},h.id)})})()})]})})]})]})})};export{Jr as default};
|
assets/{BenchmarkTrendSparkline-Dlqui5GJ.js → BenchmarkTrendSparkline-BuEjzb26.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as C,j as t}from"./index-
|
|
|
|
| 1 |
+
import{r as C,j as t}from"./index-ChUK4pXW.js";const g=112,p=42,o=5,m=5,b=new Intl.DateTimeFormat("en",{month:"short",timeZone:"UTC"}),y=(e,d)=>{const r=new Date(`${e}T00:00:00Z`),n=new Date(`${d}T00:00:00Z`);return r.getUTCMonth()===n.getUTCMonth()?`${b.format(r)} ${r.getUTCDate()}–${n.getUTCDate()}`:`${b.format(r)} ${r.getUTCDate()}–${b.format(n)} ${n.getUTCDate()}`},I=({history:e,benchmarkName:d,interactive:r=!1})=>{const[n,x]=C.useState(null),h=e.map(s=>s.paper_count),M=Math.max(1,...h),f=g-o*2,T=p-m*2,v=h.length>1?f/(h.length-1):0,a=h.map((s,c)=>({x:o+v*c,y:m+T-s/M*T})),$=a.map(({x:s,y:c})=>`${s},${c}`).join(" "),_=a.length?`${o},${p-m} ${$} ${a[a.length-1].x},${p-m}`:"",D=h.reduce((s,c)=>s+c,0),u=49,N=14,i=n==null?null:a[n],j=i?Math.min(g-o-u,Math.max(o,i.x-u/2)):0,k=i?i.y>p/2?i.y-N-3:i.y+3:0;return t.jsxs("svg",{className:`benchmark-trend-sparkline${r?" is-interactive":""}`,viewBox:`0 0 ${g} ${p}`,role:r?"group":"img","aria-label":`${d}: ${D} reporting papers across the displayed trend history`,children:[t.jsxs("title",{children:[d,": ",D," reporting papers across the displayed trend history"]}),t.jsx("line",{className:"benchmark-trend-axis",x1:o,y1:p-m,x2:g-o,y2:p-m}),t.jsx("line",{className:"benchmark-trend-axis",x1:o,y1:m,x2:o,y2:p-m}),_&&t.jsx("polygon",{className:"benchmark-trend-area",points:_}),$&&t.jsx("polyline",{className:"benchmark-trend-line",points:$}),r?a.map(({x:s,y:c},l)=>t.jsxs("g",{className:"benchmark-trend-point",tabIndex:0,role:"img","aria-label":`${y(e[l].start_date,e[l].end_date)}: ${e[l].paper_count} ${e[l].paper_count===1?"paper":"papers"}`,onMouseEnter:()=>x(l),onMouseLeave:()=>x(null),onFocus:()=>x(l),onBlur:()=>x(null),children:[t.jsx("circle",{className:"benchmark-trend-point-hit",cx:s,cy:c,r:"5"}),t.jsx("circle",{className:"benchmark-trend-point-mark",cx:s,cy:c,r:"1.8"})]},`${e[l].start_date}-${e[l].end_date}`)):a.length>0&&t.jsx("circle",{className:"benchmark-trend-dot",cx:a[a.length-1].x,cy:a[a.length-1].y,r:"2.6"}),i&&n!=null&&t.jsxs("g",{className:"benchmark-trend-tooltip",pointerEvents:"none",children:[t.jsx("rect",{x:j,y:k,width:u,height:N,rx:"2"}),t.jsx("text",{x:j+3,y:k+5.4,children:y(e[n].start_date,e[n].end_date)}),t.jsxs("text",{className:"benchmark-trend-tooltip-value",x:j+3,y:k+11,children:[e[n].paper_count," ",e[n].paper_count===1?"paper":"papers"]})]})]})};export{I as B};
|
assets/{ChatMessage-D_TPRkPx.js → ChatMessage-CAUQ_QtF.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{c as E,r as v,j as t,R as g}from"./index-
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{c as E,r as v,j as t,R as g}from"./index-ChUK4pXW.js";import{M as R,S as N,A as S,v as T,w as b,x as $}from"./chatSessions-DcYRJLQo.js";import"./katex.min-BSBacQyE.js";import{H as P,a as F,b as H}from"./hover-card-D4KxxydT.js";import{r as I,a as M,P as U}from"./PaperPreviewLink-BPqigL3n.js";import{M as L,r as B,d as O}from"./index-CW8TvXfJ.js";/**
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{ChatView-C0rvV3ZL.js → ChatView-DFvnOigo.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{c as Ot,d as Me,r as o,j as t,e as Et,u as Tt,a as jt,f as Nt,g as It,h as Lt,k as Dt,l as At,X as Pt,b as Yt}from"./index-
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
@@ -13,4 +13,4 @@ import{c as Ot,d as Me,r as o,j as t,e as Et,u as Tt,a as jt,f as Nt,g as It,h a
|
|
| 13 |
|
| 14 |
`))!==-1;){const R=E.slice(0,k);E=E.slice(k+2);const S=R.split(`
|
| 15 |
`).filter(T=>T.startsWith("data:")).map(T=>T.slice(5).trimStart()).join(`
|
| 16 |
-
`);!S||S==="[DONE]"||(yield JSON.parse(S))}}}finally{C.releaseLock()}}const bt="Preparing research workspace…",fr=750;function ve(l){if(l.status!==bt)return l;const{status:h,...u}=l;return u}function Pe(l,h){for(let u=l.length-1;u>=0;u-=1)if(h(l[u]))return u;return-1}function pr(l){const[h,u]=o.useState([]),[C,f]=o.useState(!1),[E,v]=o.useState(""),_=o.useRef(!1),k=o.useRef(null),R=o.useRef(null),S=o.useRef("cleared"),T=o.useRef(null),L=o.useRef(null),[ue,Q]=o.useState(null),[he,Y]=o.useState(null),w=o.useRef([]),x=o.useRef(l),Re=o.useRef(""),se=o.useRef(""),xe=o.useRef(0),N=o.useRef(0),B=o.useRef(l.sessionId),ke=o.useRef(l.sessionId);ke.current!==l.sessionId&&(ke.current=l.sessionId,B.current!==l.sessionId&&(N.current+=1,T.current=null)),x.current=l,w.current=h,o.useEffect(()=>()=>{var r;R.current!==null&&window.clearTimeout(R.current),(r=k.current)==null||r.abort(),L.current=null},[]),o.useEffect(()=>{_.current||(B.current=l.sessionId)},[l.sessionId]);const K=o.useMemo(()=>{const r={};for(const c of h)for(const a of c.blocks??[])if(a.kind==="tool")for(const d of a.results??[])r[d.route_id]=d;return r},[h]),V=()=>`m${++xe.current}_${Date.now().toString(36)}`,O=r=>u(c=>{if(!c.length)return c;const a=c.slice();return a[a.length-1]=r(a[a.length-1]),a}),Ce=r=>O(c=>{const a=ve(c);return{...a,blocks:[...a.blocks??[],r]}}),fe=(r,c)=>O(a=>{const d=ve(a);return{...d,blocks:(d.blocks??[]).map((p,m,g)=>r(p,m,g)?c(p):p)}}),Te=r=>(c,a,d)=>c.kind===r&&Pe(d,p=>p.kind===r)===a,F=r=>{if(k.current!==r||(R.current!==null&&(window.clearTimeout(R.current),R.current=null),S.current==="cleared"))return;const c=S.current==="shown";S.current="cleared",c&&O(ve)},$=(r,c)=>{r.requestId&&dr(r.requestId,c)},A=(r,c)=>{const a=T.current;!a||a.controller!==r||(a.requestId=c,a.streamStartReported||(a.streamStartReported=!0,$(a,{submission_to_stream_start_ms:Math.max(0,performance.now()-a.submittedAt)})),a.firstVisibleAt!==void 0&&!a.firstVisibleReported&&(a.firstVisibleReported=!0,$(a,{submission_to_first_visible_delta_ms:Math.max(0,a.firstVisibleAt-a.submittedAt)})))},U=(r,c)=>{const a=T.current;!a||a.controller!==r||a.terminalReported||(a.terminalReported=!0,$(a,{terminal_classification:c}))};o.useLayoutEffect(()=>{const r=T.current;if(!r||r.firstVisibleAt!==void 0)return;const c=h.at(-1);(c==null?void 0:c.role)!=="assistant"||!(c.blocks??[]).some(d=>d.kind==="tool"||d.kind==="reasoning"&&!!d.text.trim()||d.kind==="answer"&&!!d.text.trim())||(r.firstVisibleAt=performance.now(),r.requestId&&!r.firstVisibleReported&&(r.firstVisibleReported=!0,$(r,{submission_to_first_visible_delta_ms:Math.max(0,r.firstVisibleAt-r.submittedAt)})))},[h]);const ae=r=>{switch(r.type){case"stream_start":r.session_id&&(B.current=r.session_id,x.current.onSessionId(r.session_id));break;case"sandbox_start":case"sandbox_ready":case"workspace_ready":break;case"session_title_start":se.current="";break;case"session_title_delta":se.current+=r.text,x.current.onTitle(se.current.replace(/\s+/g," ").slice(0,80));break;case"session_title_done":se.current=r.title,x.current.onTitle(r.title);break;case"reasoning_start":O(c=>{const a=ve(c);return{...a,blocks:[...(a.blocks??[]).map(d=>d.kind==="reasoning"&&d.active?{...d,active:!1,open:!1}:d),{kind:"reasoning",text:"",active:!0,open:!0}]}});break;case"reasoning_delta":fe(Te("reasoning"),c=>c.kind==="reasoning"?{...c,text:c.text+r.text}:c);break;case"reasoning_end":O(c=>{const a=c.blocks??[],d=Pe(a,g=>g.kind==="reasoning"&&g.active);if(d<0)return c;const p=a[d];if(p.kind!=="reasoning")return c;const m=a[d-1];return(m==null?void 0:m.kind)==="reasoning"&&m.text===p.text?{...c,blocks:a.filter((g,y)=>y!==d)}:{...c,blocks:a.map((g,y)=>y===d?{...p,active:!1,open:!1}:g)}});break;case"tool_call":Ce({kind:"tool",id:r.id,name:r.name,args:r.args,status:"running",open:!1});break;case"tool_result":fe(c=>c.kind==="tool"&&c.id===r.id,c=>c.kind==="tool"?r.status?{...c,schema_version:2,status:r.status,took_ms:r.took_ms,content:r.content,metadata:r.metadata,open:r.status!=="success"}:{...c,status:"done",hits:r.hits,took_ms:r.took_ms,results:r.results}:c);break;case"answer_delta":O(c=>{const a=ve(c),d=a.blocks??[],p=d.at(-1);return(p==null?void 0:p.kind)==="answer"&&!p.done?{...a,blocks:[...d.slice(0,-1),{...p,text:p.text+r.text}]}:{...a,blocks:[...d,{kind:"answer",text:r.text,done:!1}]}});break;case"done":O(c=>({...c,streaming:!1,followups:r.followups,finishReason:r.finish_reason,citations:r.citations,blocks:(c.blocks??[]).map(a=>a.kind==="answer"?{...a,done:!0}:a.kind==="reasoning"&&a.active?{...a,active:!1,open:!1}:a)}));break;case"error":O(c=>({...c,streaming:!1,error:r.message,errorCode:r.code,blocks:(c.blocks??[]).map(a=>a.kind==="reasoning"&&a.active?{...a,active:!1,open:!1}:a)}));break}},re=async(r,c)=>{const a=await Ye(r),d=gt(a);return N.current!==c?null:(u(d),w.current=d,d)},ie=(r,c,a,d,p)=>{const m=++N.current;_.current=!0;const g=new AbortController;return k.current=g,Re.current=r,B.current=c.session_id,v(""),u(a),f(!0),T.current={controller:g,submittedAt:performance.now(),streamStartReported:!1,firstVisibleReported:!1,terminalReported:!1},R.current!==null&&window.clearTimeout(R.current),S.current="armed",R.current=window.setTimeout(()=>{R.current=null,!(S.current!=="armed"||k.current!==g||g.signal.aborted||N.current!==m)&&(S.current="shown",O(y=>{var P;return y.role==="assistant"&&y.streaming&&(((P=y.blocks)==null?void 0:P.length)??0)===0&&!y.error?{...y,status:bt}:y}))},fr),(async()=>{var le,X,W;let y=!1,P=!1,M=!1,J=!1,D=!1,H=!1;try{for await(const i of ur(c,{signal:g.signal})){i.type==="stream_start"&&(y=!0,P=i.provider_execution!==!1,A(g,i.request_id)),(i.type==="workspace_ready"||i.type==="reasoning_start"||i.type==="reasoning_delta"||i.type==="tool_call"||i.type==="answer_delta"||i.type==="done"||i.type==="error")&&F(g),(i.type==="done"||i.type==="error")&&(J=!0,D=i.type==="error",U(g,i.type==="error"?"error":"complete"),i.type==="error"&&["openrouter_monthly_budget_exhausted","openrouter_unavailable","openrouter_byok_credential_invalid","openrouter_byok_billing_error","openrouter_byok_rate_limit"].includes(i.code??"")&&(M=!0,x.current.onInterrupted(r)));const I=N.current===m;!g.signal.aborted&&(I||i.type==="stream_start"||i.type==="session_title_start"||i.type==="session_title_delta"||i.type==="session_title_done")&&ae(i)}}catch(i){if(D=!0,!g.signal.aborted){if(F(g),i instanceof we&&i.code==="chat_temporarily_disabled")H=!0,Y({question:r}),N.current===m&&(u(d),w.current=d,v(""));else if(i instanceof we&&i.code==="chat_capacity"){H=!0;const I=i.retryAfterSeconds??5,Z={question:r,request:c,optimistic:a,original:d,edit:p,retryAfterSeconds:I,retryAt:Date.now()+I*1e3};L.current=Z,Q({question:r,retryAt:Z.retryAt,retryAfterSeconds:I}),N.current===m&&(u(d),w.current=d,v(""))}else U(g,"network_error"),i instanceof we&&["openrouter_monthly_budget_exhausted","openrouter_unavailable","openrouter_byok_credential_invalid","openrouter_byok_billing_error","openrouter_byok_rate_limit"].includes(i.code??"")&&(M=!0,x.current.onInterrupted(r));!H&&N.current===m&&ae({type:"error",message:i instanceof Error?i.message:"The assistant stream failed.",code:i instanceof we?i.code:void 0})}}finally{if(k.current===g){if(F(g),!J&&!g.signal.aborted&&U(g,"network_error"),_.current=!1,f(!1),H)x.current.onSettled(c.session_id);else if(!g.signal.aborted){(y&&P||M)&&((X=(le=x.current).onProviderTerminal)==null||X.call(le));const i=B.current;if(p&&!y)N.current===m&&(u(p.snapshot),w.current=p.snapshot,v("Couldn’t resend this message. Your original conversation was restored."));else if(i){N.current===m&&p&&!p.first&&(D||!J)&&(u(p.snapshot),w.current=p.snapshot);try{const I=await re(i,m);I&&p&&!p.first&&I.some(Z=>Z.id===p.targetId)&&v("Couldn’t resend this message. Your original conversation was restored.")}catch{N.current===m&&O(I=>I.streaming?{...I,streaming:!1}:I)}}else N.current===m&&O(I=>I.streaming?{...I,streaming:!1}:I);x.current.onSettled(i)}((W=T.current)==null?void 0:W.controller)===g&&(T.current=null)}}})(),!0},pe=o.useCallback(r=>{const c=r.trim();if(!c||c.length>8e3||_.current||L.current)return!1;const a=w.current,d=[...a].reverse().find(M=>M.role==="user"),p=d!=null&&d.status&&d.status!=="complete"&&d.revision?{replace_message_id:d.id,prior_revision:d.revision}:null,m={id:V(),role:"user",text:c},g={id:V(),role:"assistant",streaming:!0,blocks:[]},y=p&&d?Pe(a,M=>M.id===d.id):-1,P=y<0?[...a,m,g]:[...a.slice(0,y),m,g];return ie(c,{message:c,session_id:x.current.sessionId,client_message_id:crypto.randomUUID(),...!x.current.sessionId&&x.current.initialModel?{initial_model:x.current.initialModel}:{},...p??{}},P,a)},[]),je=o.useCallback((r,c)=>{const a=c.trim();if(!a||a.length>8e3||_.current||L.current)return!1;const d=w.current.slice(),p=d.findIndex(D=>D.id===r&&D.role==="user");if(p<0)return!1;const m=d[p],g=d.findIndex(D=>D.role==="user"),y=p===g;if(!y&&(!x.current.sessionId||!m.revision))return!1;const P={id:m.id,role:"user",text:a,revision:y?void 0:m.revision+1,status:"generating"},M={id:V(),role:"assistant",streaming:!0,blocks:[]},J=y?[P,M]:[...d.slice(0,p),P,M];return ie(a,{message:a,session_id:y?null:x.current.sessionId,client_message_id:crypto.randomUUID(),...y&&x.current.initialModel?{initial_model:x.current.initialModel}:{},...y?{}:{replace_message_id:m.id,prior_revision:m.revision}},J,d,{targetId:m.id,snapshot:d,first:y})},[]),oe=o.useCallback(()=>{L.current=null,Q(null)},[]),Ne=o.useCallback(()=>{const r=L.current;return!r||Date.now()<r.retryAt||_.current?!1:(L.current=null,Q(null),ie(r.question,r.request,r.optimistic,r.original,r.edit))},[]),ce=o.useCallback(()=>{var d;if(!k.current)return;const r=k.current;F(r),U(r,"stopped"),r.abort(),k.current=null,((d=T.current)==null?void 0:d.controller)===r&&(T.current=null),_.current=!1,f(!1),u(p=>{const m=p.at(-1);if((m==null?void 0:m.role)!=="assistant")return p;const g=(m.blocks??[]).flatMap(y=>y.kind==="tool"&&y.status==="running"?[]:y.kind==="reasoning"&&y.active?[]:y.kind==="answer"?[{...y,done:!0}]:[y]);return[...p.slice(0,-1),{...m,blocks:g,streaming:!1,finishReason:"stopped"}]}),x.current.onInterrupted(Re.current);const c=B.current;c&&Ut(c).catch(()=>{});const a=++N.current;window.setTimeout(()=>{c&&N.current===a?re(c,a).catch(()=>{}).finally(()=>x.current.onSettled(c)):c||x.current.onSettled(null)},450)},[]),Se=o.useCallback((r,c)=>u(a=>a.map(d=>{var p;return d.id!==r?d:{...d,blocks:(p=d.blocks)==null?void 0:p.map((m,g)=>g===c&&(m.kind==="reasoning"||m.kind==="tool")?{...m,open:!m.open}:m)}})),[]),me=o.useCallback(()=>{var r;N.current+=1,R.current!==null&&(window.clearTimeout(R.current),R.current=null),S.current="cleared",(r=k.current)==null||r.abort(),k.current=null,T.current=null,L.current=null,Q(null),_.current=!1,B.current=null,u([]),f(!1),v("")},[]),z=o.useCallback(r=>{var c;N.current+=1,R.current!==null&&(window.clearTimeout(R.current),R.current=null),S.current="cleared",T.current=null,L.current=null,Q(null),_.current||((c=k.current)==null||c.abort(),k.current=null),u(r),_.current||f(!1),v("")},[]);return{messages:h,busy:C,papers:K,sessionError:E,capacityRequest:ue,disabledRequest:he,send:pe,editAndResend:je,retryCapacity:Ne,cancelCapacity:oe,dismissDisabled:()=>Y(null),stop:ce,toggleBlock:Se,reset:me,load:z}}const mr="https://huggingface.co/settings/inference-providers",ft="pwc.chat.billing-notice-dismissed.v1",pt=({provider:l})=>{const[h,u]=o.useState(()=>localStorage.getItem(ft)==="1");return!_e()||h||l!=="huggingface"?null:t.jsxs("div",{className:"chat-billing-notice",role:"note",children:[t.jsx("span",{children:"Hugging Face models use the inference permission granted when you start chatting. Included monthly credits are used first, then extra usage requires purchased credits. You can choose organization billing in Settings."}),t.jsxs("div",{className:"chat-billing-notice-actions",children:[t.jsx("a",{href:"/settings",children:"Review billing"}),t.jsx("a",{href:mr,target:"_blank",rel:"noreferrer",children:"Review usage"}),t.jsx("button",{type:"button",className:"chat-billing-notice-dismiss","aria-label":"Dismiss billing notice",title:"Dismiss",onClick:()=>{localStorage.setItem(ft,"1"),u(!0)},children:t.jsx(Pt,{size:15,"aria-hidden":"true"})})]})]})},mt=({enabled:l,fallbackEnabled:h,byokExpected:u})=>{const C=sr(l);if(!l||!C.data)return null;const f=C.data,E=ar(f.resets_at);return t.jsxs("div",{className:"chat-openrouter-usage",role:"status",children:[t.jsxs("span",{children:[t.jsxs("strong",{children:[f.remaining_percent,"% left"]})," this month · resets ",E.local]}),(f.remaining_percent===0||u)&&t.jsx("span",{children:h?"Your OpenRouter account will be billed on this explicit send.":t.jsxs(t.Fragment,{children:[t.jsx("a",{href:"/settings#openrouter-byok",children:"Connect your own key in Settings"})," to continue."]})})]})},gr=({retryAt:l,onRetry:h,onCancel:u})=>{const[C,f]=o.useState(()=>Math.max(0,Math.ceil((l-Date.now())/1e3))),E=o.useRef(null);return o.useEffect(()=>{var R;const v=document.activeElement instanceof HTMLElement?document.activeElement:null;(R=E.current)==null||R.focus();const _=()=>f(Math.max(0,Math.ceil((l-Date.now())/1e3)));_();const k=window.setInterval(_,250);return()=>{window.clearInterval(k),v==null||v.focus()}},[l]),t.jsx("div",{className:"chat-capacity-dialog-backdrop",role:"presentation",children:t.jsxs("div",{className:"chat-capacity-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-capacity-dialog-title","aria-describedby":"chat-capacity-dialog-description",onKeyDown:v=>{v.key==="Escape"&&(v.preventDefault(),u())},children:[t.jsx("h2",{id:"chat-capacity-dialog-title",children:"All research slots are currently in use"}),t.jsx("p",{id:"chat-capacity-dialog-description",children:"Your message was not sent or billed. Try again in a few seconds."}),t.jsx("p",{className:"chat-capacity-countdown","aria-live":"polite",children:C>0?`Try again available in ${C} second${C===1?"":"s"}.`:"You can try again now."}),t.jsxs("div",{className:"chat-capacity-dialog-actions",children:[t.jsx("button",{type:"button",className:"chat-capacity-cancel",ref:E,onClick:u,children:"Cancel"}),t.jsx("button",{type:"button",className:"chat-capacity-retry",disabled:C>0,onClick:h,children:"Try again"})]})]})})},yr=({onClose:l})=>{const h=o.useRef(null);return o.useEffect(()=>{var C;const u=document.activeElement instanceof HTMLElement?document.activeElement:null;return(C=h.current)==null||C.focus(),()=>u==null?void 0:u.focus()},[]),t.jsx("div",{className:"chat-capacity-dialog-backdrop",role:"presentation",children:t.jsxs("div",{className:"chat-capacity-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-disabled-title","aria-describedby":"chat-disabled-description",onKeyDown:u=>{u.key==="Escape"&&(u.preventDefault(),l())},children:[t.jsx("h2",{id:"chat-disabled-title",children:"Chat is temporarily disabled"}),t.jsx("p",{id:"chat-disabled-description",children:"We've temporarily paused new research runs. Your message wasn't sent, and your draft is still here. Please try again later."}),t.jsx("div",{className:"chat-capacity-dialog-actions",children:t.jsx("button",{ref:h,type:"button",className:"chat-capacity-cancel",onClick:l,children:"Keep editing"})})]})})},jr=()=>{var Ve,Ge,$e,Qe,ze,Je,Xe,Ze;const{sessionId:l}=Et(),h=Tt(),[u,C]=jt(),{user:f,isLoading:E}=Nt(),{toast:v}=It(),_=Lt(),k=At(),R=Mt({queryKey:["chatAvailability"],queryFn:()=>Yt.getChatAvailability(),refetchInterval:3e4,retry:!1,enabled:_e()&&k}),S=((Ve=R.data)==null?void 0:Ve.status)==="paused",[T,L]=o.useState([]),[ue,Q]=o.useState(!1),[he,Y]=o.useState(""),[w,x]=o.useState(()=>l?{id:l,status:"loading"}:null),[Re,se]=o.useState(0),xe=o.useRef(qt()),N=o.useRef(u.get("model")||((Ge=xe.current)==null?void 0:Ge.model)),[B,ke]=o.useState(Bt),[K,V]=o.useState(N.current||Ht),O=(($e=B.find(e=>e.id===K))==null?void 0:$e.provider)??"huggingface",Ce=tr(!!(f&&O==="openrouter")),fe=o.useRef(O);fe.current=O;const[Te,F]=o.useState(""),[$,A]=o.useState(""),[U,ae]=o.useState(()=>{var e,n;return((e=u.get("q"))==null?void 0:e.trim())||((n=xe.current)==null?void 0:n.prompt)||""}),re=o.useRef(!1),ie=o.useRef(!1),pe=o.useRef(!1),[je,oe]=o.useState(null),[Ne,ce]=o.useState(null),[Se,me]=o.useState(""),[z,r]=o.useState(null),[c,a]=o.useState(()=>typeof window>"u"||window.innerWidth>900),[d,p]=o.useState(!1),[m,g]=o.useState(null),[y,P]=o.useState(""),M=o.useRef(new Set),J=o.useRef(!1),D=o.useRef(l),H=o.useRef(null),le=o.useRef(null),X=o.useRef(null);D.current=l;const W=o.useCallback(async()=>{if(!f)return;const e=!J.current;e&&Q(!0);try{const n=await Wt();L(s=>{const b=H.current,j=b?s.find(be=>be.id===b):void 0;if(!j)return n;const G=n.find(be=>be.id===b);return[G?{...G,title:j.title,is_busy:!0}:j,...n.filter(be=>be.id!==b)]}),J.current=!0,Y("")}catch(n){Y(n instanceof Error?n.message:"Could not load chats")}finally{e&&Q(!1)}},[f]),i=pr({sessionId:l??null,initialModel:K,onSessionId:e=>{H.current=e;const n=e!==D.current,s=(D.current??null)===le.current,b=new Date().toISOString();L(j=>j.some(G=>G.id===e)?j.map(G=>G.id===e?{...G,is_busy:!0}:G):[{id:e,title:"New chat",selected_model:K,created_at:b,updated_at:b,message_count:1,is_busy:!0},...j]),n&&s&&F("New chat"),s&&(X.current=e,x({id:e,status:"loaded"}),n&&h(`/chat/${e}`,{replace:!0}))},onTitle:e=>{const n=H.current??D.current;n&&!M.current.has(n)&&(n===D.current&&F(e),L(s=>s.map(b=>b.id===n?{...b,title:e}:b)))},onSettled:e=>{e&&L(n=>n.map(s=>s.id===e?{...s,is_busy:!1}:s)),H.current=null,le.current=null,W()},onProviderTerminal:()=>{fe.current==="openrouter"&&(_.invalidateQueries({queryKey:rr}),_.invalidateQueries({queryKey:nr}))},onInterrupted:e=>{A(e)}});i.load;const I=i.send;o.useEffect(()=>{i.capacityRequest&&A(i.capacityRequest.question)},[i.capacityRequest]),o.useEffect(()=>{i.busy&&oe(null)},[i.busy]);const Z=o.useCallback(e=>{sessionStorage.setItem(rt,e),sessionStorage.setItem(nt,K),sessionStorage.setItem(st,"1"),window.location.href=Dt("/chat",!0)},[K]),ge=o.useCallback(async e=>{if(!f){Z(e);return}if(O==="huggingface"&&!ie.current){if(pe.current)return;pe.current=!0;try{const s=await fetch(Me("/api/v1/me/inference-billing"),{credentials:"include",cache:"no-store"});if(!s.ok)throw new Error("Could not check Hugging Face authorization.");if(!(await s.json()).connected){Z(e);return}ie.current=!0}catch(s){A(e),Y(s instanceof Error?s.message:"Could not check Hugging Face authorization.");return}finally{pe.current=!1}}const n=D.current??null;I(e)&&(le.current=n,H.current=n,Kt(),A(""))},[Z,O,I,f]);o.useEffect(()=>{if(E||!f)return;const e=sessionStorage.getItem(nt);e&&V(e),W(),Vt().then(b=>{if(ke(b.items),!D.current){const j=N.current||e;V(j&&b.items.some(G=>G.id===j)?j:b.default_model)}});const n=sessionStorage.getItem(rt),s=sessionStorage.getItem(st)==="1";n&&(s?ae(n):A(n))},[E,W,f]),o.useEffect(()=>{if(!l){X.current!==null&&(X.current=null,i.reset()),x(null);return}if(X.current===l||(x(n=>(n==null?void 0:n.id)===l&&n.status==="loading"?n:{id:l,status:"loading"}),E||!f))return;let e=!1;return Y(""),Ye(l).then(n=>{e||(i.load(gt(n)),V(n.selected_model),F(n.title),X.current=l,x({id:l,status:"loaded"}))}).catch(n=>{if(e)return;const s=n instanceof Error?n.message:"Chat not found";i.reset(),Y(s),x({id:l,status:"error",error:s})}),()=>{e=!0}},[E,l,f,i.busy,Re]),o.useEffect(()=>{var b;const e=(b=u.get("q"))==null?void 0:b.trim();if(!e)return;re.current=!1;const n=u.get("model");n&&V(n),ae(e);const s=new URLSearchParams(u);s.delete("q"),s.delete("model"),C(s,{replace:!0})},[u,C]),o.useEffect(()=>{if(E||i.busy||!U||re.current||l&&(w==null?void 0:w.status)!=="loaded")return;const e=window.setTimeout(()=>{if(re.current)return;re.current=!0,ge(U).finally(()=>ae(""))},0);return()=>window.clearTimeout(e)},[E,i.busy,U,l,w==null?void 0:w.status,ge]),o.useEffect(()=>{const e=()=>{!f||i.busy||W()};return window.addEventListener("focus",e),()=>window.removeEventListener("focus",e)},[i.busy,W,f]),o.useEffect(()=>{if(!z)return;const e=()=>r(null),n=s=>{s.key==="Escape"&&e()};return window.addEventListener("click",e),window.addEventListener("keydown",n),()=>{window.removeEventListener("click",e),window.removeEventListener("keydown",n)}},[z]);const Fe=()=>{H.current=null,i.reset(),A(""),F(""),h("/chat")},Ue=async e=>{const n=Se.trim();if(n)try{const s=await ot(e,{title:n});M.current.add(e),e===l&&F(s.title),L(b=>b.map(j=>j.id===e?s:j)),ce(null)}catch(s){Y(s instanceof Error?s.message:"Rename failed")}},vt=async e=>{const n=e===l&&i.busy;if(window.confirm(n?"Stop and delete this chat? This cannot be undone.":"Delete this chat? This cannot be undone.")){n&&i.stop();try{if(n){const s=Date.now()+3e3;for(;(await Ye(e)).is_busy;){if(Date.now()>=s)throw new Error("Generation is still stopping. The chat was not deleted.");await new Promise(j=>window.setTimeout(j,150))}}await zt(e),e===l&&Fe(),await W()}catch(s){Y(s instanceof Error?s.message:"Delete failed")}}},wt=async()=>{var e;if(m===null){g("old");try{const n=await Zt();if(await W(),n.archived_count===0){v({title:"No chats were archived",description:"There are no inactive chats older than 30 days."});return}const s=((e=[...i.messages].reverse().find(b=>b.role==="user"))==null?void 0:e.text)??"";i.reset(),A(s),F(""),v({title:`${n.archived_count} ${n.archived_count===1?"chat":"chats"} archived`,description:"Your question is ready to send again."})}catch(n){v({variant:"destructive",title:"Could not archive old chats",description:n instanceof Error?n.message:"Try again."})}finally{g(null)}}},_t=async()=>{var e;if(m===null){g("oldest");try{const n=await Xt();await W();const s=((e=[...i.messages].reverse().find(b=>b.role==="user"))==null?void 0:e.text)??"";i.reset(),A(s),F(""),v({title:`${n.archived_count} ${n.archived_count===1?"chat":"chats"} archived`,description:"Your question is ready to send again."})}catch(n){v({variant:"destructive",title:"Could not archive chats",description:n instanceof Error?n.message:"Try again."})}finally{g(null)}}},qe=async e=>{const n=K;if(V(e),!!l)try{const s=await ot(l,{selected_model:e});L(b=>b.map(j=>j.id===l?{...j,selected_model:s.selected_model}:j)),Y("")}catch(s){V(n),Y(s instanceof Error?s.message:"Model change failed")}},Rt=async()=>{var e;if(!(!l||i.busy||d)){p(!0);try{const n=await Jt(l),s=new URL(n.public_path,window.location.origin).toString();try{if(!((e=navigator.clipboard)!=null&&e.writeText))throw new Error("Clipboard unavailable");await navigator.clipboard.writeText(s),v({className:"chat-share-toast",duration:5e3,title:"Public link copied to your clipboard",description:"Anyone with this link can see this conversation."})}catch{P(s)}}catch(n){const s=n instanceof Error?n.message:"Could not share this conversation";Y(s),v({variant:"destructive",title:"Share failed",description:s})}finally{p(!1)}}},[xt,kt]=o.useState(60);o.useLayoutEffect(()=>{const e=document.querySelector(".app-header");if(!e)return;const n=()=>kt(e.offsetHeight);n();const s=new ResizeObserver(n);return s.observe(e),()=>s.disconnect()},[]);const Ie=o.useRef(null),Oe=o.useRef(null),ye=o.useRef(null);o.useEffect(()=>{i.busy||(ye.current=null)},[i.busy]);const Ct=(e,n)=>{var s;Oe.current=((s=Ie.current)==null?void 0:s.scrollTop)??null,i.toggleBlock(e,n)};o.useLayoutEffect(()=>{const e=Ie.current;if(e){if(Oe.current!==null){e.scrollTop=Oe.current,Oe.current=null;return}if(ye.current){const n=Array.from(e.querySelectorAll("[data-message-id]")).find(s=>s.dataset.messageId===ye.current);if(n){const s=e.getBoundingClientRect(),b=n.getBoundingClientRect();e.scrollTop+=b.top-s.top-24;return}}e.scrollTop=e.scrollHeight}},[i.messages]);const de=T.find(e=>e.id===l),Be=i.messages.filter(e=>e.role==="user"),Le=(Qe=Be[0])==null?void 0:Qe.id,St=(ze=Be.at(-1))==null?void 0:ze.id,Ee=i.messages.length===0,He=(Je=[...i.messages].reverse().find(e=>e.role==="assistant"&&e.errorCode))==null?void 0:Je.errorCode,We=He==="openrouter_unavailable"||He==="openrouter_monthly_budget_exhausted",De=(w==null?void 0:w.id)===l,Ae=!!(l&&(E||f&&(!De||(w==null?void 0:w.status)==="loading"))),Ke=De&&(w==null?void 0:w.status)==="error"?w.error:void 0;return t.jsxs("div",{className:"chat-page",style:{height:`calc(100dvh - ${xt}px)`},children:[t.jsxs("aside",{className:`chat-sidebar${c?"":" chat-sidebar-closed"}`,children:[t.jsxs("div",{className:"chat-sidebar-top",children:[t.jsxs("button",{type:"button",className:"chat-new-chat",onClick:Fe,children:[t.jsx(Gt,{})," New chat"]}),t.jsx("button",{type:"button",className:"icon-btn",onClick:()=>a(!1),title:"Collapse sidebar",children:t.jsx(at,{})})]}),t.jsxs("nav",{className:"chat-sessions","aria-label":"Chat history",children:[ue&&t.jsx("div",{className:"chat-sessions-empty",children:"Loading chats…"}),!ue&&he&&t.jsx("div",{className:"chat-sessions-empty",children:he}),!ue&&!he&&T.length===0&&t.jsx("div",{className:"chat-sessions-empty",children:"Conversations you start will show up here."}),$t(T).map(e=>t.jsxs("div",{className:"chat-session-group",children:[t.jsx("div",{className:"chat-session-group-label",children:e.label}),e.items.map(n=>t.jsxs("div",{className:`chat-session${n.id===l?" chat-session-active":""}`,role:"button",tabIndex:0,onClick:()=>h(`/chat/${n.id}`),onKeyDown:s=>{if(s.key==="Enter"&&h(`/chat/${n.id}`),s.key==="F2"&&(ce(n.id),me(n.title)),s.key==="ContextMenu"||s.shiftKey&&s.key==="F10"){s.preventDefault();const b=s.currentTarget.getBoundingClientRect();r({id:n.id,x:b.right-150,y:b.bottom})}},onContextMenu:s=>{s.preventDefault(),r({id:n.id,x:s.clientX,y:s.clientY})},children:[Ne===n.id?t.jsx("input",{className:"chat-session-title-input",value:Se,autoFocus:!0,maxLength:80,onClick:s=>s.stopPropagation(),onChange:s=>me(s.target.value),onBlur:()=>void Ue(n.id),onKeyDown:s=>{s.stopPropagation(),s.key==="Enter"&&Ue(n.id),s.key==="Escape"&&ce(null)}}):t.jsx("span",{className:"chat-session-title",children:n.title}),t.jsx("button",{type:"button",className:"chat-session-menu","aria-label":"Chat actions","aria-haspopup":"menu",title:"Chat actions",onClick:s=>{s.stopPropagation();const b=s.currentTarget.getBoundingClientRect();r({id:n.id,x:b.right-150,y:b.bottom})},children:"⋯"}),t.jsx("button",{type:"button",className:"chat-session-delete","aria-label":"Delete conversation",onClick:s=>{s.stopPropagation(),vt(n.id)},children:t.jsx(Qt,{})})]},n.id))]},e.label))]}),z&&t.jsx("div",{className:"chat-session-context-menu",role:"menu",style:{left:z.x,top:z.y},onClick:e=>e.stopPropagation(),children:t.jsx("button",{type:"button",role:"menuitem",autoFocus:!0,onClick:()=>{const e=T.find(n=>n.id===z.id);e&&(ce(e.id),me(e.title)),r(null)},children:"Rename chat"})})]}),t.jsxs("section",{className:"chat-main",children:[t.jsxs("div",{className:"chat-topbar",children:[!c&&t.jsx("button",{type:"button",className:"icon-btn",onClick:()=>a(!0),title:"Open sidebar",children:t.jsx(at,{})}),t.jsx("span",{className:"chat-topbar-title",children:Ae?(de==null?void 0:de.title)||"":Te||(de==null?void 0:de.title)||(Ee?"":"New chat")}),k&&t.jsx("span",{className:"chat-staging-badge",children:"Staging"}),l&&De&&(w==null?void 0:w.status)==="loaded"&&!Ee&&t.jsxs("button",{type:"button",className:"chat-share-button",onClick:()=>void Rt(),disabled:i.busy||d||Ae,"aria-label":"Share conversation",children:[d?t.jsx(it,{}):t.jsx(ir,{"aria-hidden":"true"}),t.jsx("span",{children:"Share"})]})]}),Ae&&!U?t.jsxs("div",{className:"chat-session-loading",role:"status","aria-live":"polite",children:[t.jsx(it,{}),t.jsx("span",{children:"Loading conversation…"})]}):Ke?t.jsxs("div",{className:"chat-session-load-error",role:"alert",children:[t.jsx("p",{children:Ke}),t.jsx("button",{type:"button",onClick:()=>{x({id:l,status:"loading"}),se(e=>e+1)},children:"Try again"})]}):Ee&&!U?t.jsx("div",{className:"chat-empty",children:t.jsxs("div",{className:"chat-empty-inner",children:[t.jsx("div",{className:"chat-empty-eyebrow",children:"AI research assistant · Staging preview"}),t.jsxs("h1",{className:"chat-empty-title",children:["Ask ",t.jsx("em",{children:"Papers With Code"})]}),t.jsx("p",{className:"chat-empty-sub",children:"Answers are grounded in a live hybrid search over papers, tasks, and benchmarks — with citations you can follow."}),k&&t.jsx("p",{className:"chat-staging-access-note",children:"This is a limited staging preview. Only approved Hugging Face users can start chats."}),t.jsx(pt,{provider:O}),t.jsx(mt,{enabled:O==="openrouter",fallbackEnabled:!!((Xe=Ce.data)!=null&&Xe.fallback_enabled),byokExpected:We}),S&&t.jsx("div",{id:"chat-paused-description",className:"chat-paused-banner",role:"status",children:"Chat is temporarily disabled. You can keep browsing and editing your conversations. New research runs will return when chat is restored."}),t.jsx(et,{onSend:ge,busy:i.busy,onStop:i.stop,autoFocus:!0,draft:$,onDraftChange:A,models:B,selectedModel:K,onModelChange:e=>void qe(e),disabled:S,describedBy:S?"chat-paused-description":void 0}),t.jsx("div",{className:"chat-examples",children:er.map(e=>t.jsx("button",{type:"button",className:"chat-example",disabled:S,onClick:()=>ge(e),children:e},e))})]})}):t.jsxs(t.Fragment,{children:[i.sessionError&&t.jsx("div",{className:"chat-session-error",role:"alert",children:i.sessionError}),t.jsx("div",{className:"chat-conversation",ref:Ie,children:t.jsxs("div",{className:"chat-conversation-inner",children:[Ee&&U&&t.jsx(tt,{id:"queued-launch-preview",text:U,isInitial:!0}),i.messages.map(e=>e.role==="user"?t.jsx(tt,{id:e.id,text:e.text??"",isInitial:e.id===Le,editingAllowed:!i.busy&&!!e.revision,editing:je===e.id,editNotice:e.id===Le?"Sending will start a new chat.":e.id===St?"Sending will replace the response.":"Sending will replace the response and all messages after it.",onEdit:()=>oe(e.id),onCancel:()=>oe(null),onResend:n=>{e.id!==Le&&(ye.current=e.id);const s=i.editAndResend(e.id,n);return s?oe(null):ye.current=null,s}},e.id):t.jsx(Ft,{msg:e,papers:i.papers,onToggleBlock:Ct,onArchiveOldChats:()=>void wt(),onArchiveOldestChats:()=>void _t(),archivePending:m},e.id))]})}),t.jsx("div",{className:"chat-composer-wrap",children:t.jsxs("div",{className:"chat-composer-inner",children:[t.jsx(pt,{provider:O}),t.jsx(mt,{enabled:O==="openrouter",fallbackEnabled:!!((Ze=Ce.data)!=null&&Ze.fallback_enabled),byokExpected:We}),S&&t.jsx("div",{id:"chat-paused-description",className:"chat-paused-banner",role:"status",children:"Chat is temporarily disabled. You can keep browsing and editing your conversations. New research runs will return when chat is restored."}),t.jsx(et,{onSend:ge,busy:i.busy,onStop:i.stop,placeholder:$?"Edit and send again…":"Ask a follow-up…",draft:$,onDraftChange:A,models:B,selectedModel:K,onModelChange:e=>void qe(e),disabled:S,describedBy:S?"chat-paused-description":void 0}),t.jsx("div",{className:"chat-composer-foot",children:_e()?t.jsxs(t.Fragment,{children:[O==="openrouter"?t.jsxs("span",{className:"chat-provider-attribution",children:["Powered by ",t.jsx("a",{href:"https://openrouter.ai",target:"_blank",rel:"noreferrer",children:"OpenRouter"}),"."]}):t.jsxs("span",{className:"chat-provider-attribution",children:["Powered by 🤗 ",t.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"}),"."]}),t.jsx("span",{children:"The AI assistant can make mistakes. Double-check responses."})]}):t.jsx(t.Fragment,{children:"Assistant preview — responses are simulated."})})]})})]})]}),y&&t.jsx("div",{className:"chat-share-dialog-backdrop",role:"presentation",onMouseDown:()=>P(""),children:t.jsxs("div",{className:"chat-share-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-share-dialog-title",onMouseDown:e=>e.stopPropagation(),children:[t.jsx("h2",{id:"chat-share-dialog-title",children:"Public link created"}),t.jsx("p",{children:"It could not be copied automatically. Copy this link manually:"}),t.jsx("input",{readOnly:!0,value:y,"aria-label":"Public conversation link",autoFocus:!0,onFocus:e=>e.currentTarget.select()}),t.jsx("button",{type:"button",onClick:()=>P(""),children:"Close"})]})}),i.capacityRequest&&t.jsx(gr,{retryAt:i.capacityRequest.retryAt,onCancel:i.cancelCapacity,onRetry:()=>{i.retryCapacity()&&A("")}}),i.disabledRequest&&t.jsx(yr,{onClose:()=>{var e;A(((e=i.disabledRequest)==null?void 0:e.question)??$),i.dismissDisabled(),R.refetch()}})]})};export{gr as ChatCapacityDialog,yr as ChatDisabledDialog,jr as default};
|
|
|
|
| 1 |
+
import{c as Ot,d as Me,r as o,j as t,e as Et,u as Tt,a as jt,f as Nt,g as It,h as Lt,k as Dt,l as At,X as Pt,b as Yt}from"./index-ChUK4pXW.js";import{u as Mt}from"./useQuery-CKrTCSf-.js";import{C as et,U as tt,A as Ft}from"./ChatMessage-CAUQ_QtF.js";import{a as Ut,g as Ye,t as gt,r as qt,F as Bt,D as Ht,l as Wt,C as rt,b as nt,d as st,e as Kt,f as Vt,P as Gt,h as at,i as $t,T as Qt,S as it,u as ot,j as zt,k as Jt,m as Xt,n as Zt}from"./chatSessions-DcYRJLQo.js";import{S as er}from"./chatPrompts-CDY3UGU1.js";import{u as tr,O as rr,a as nr,b as sr,r as ar}from"./openrouter-udlhTNlE.js";import"./katex.min-BSBacQyE.js";import"./hover-card-D4KxxydT.js";import"./PaperPreviewLink-BPqigL3n.js";import"./index-CW8TvXfJ.js";/**
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 13 |
|
| 14 |
`))!==-1;){const R=E.slice(0,k);E=E.slice(k+2);const S=R.split(`
|
| 15 |
`).filter(T=>T.startsWith("data:")).map(T=>T.slice(5).trimStart()).join(`
|
| 16 |
+
`);!S||S==="[DONE]"||(yield JSON.parse(S))}}}finally{C.releaseLock()}}const bt="Preparing research workspace…",fr=750;function ve(l){if(l.status!==bt)return l;const{status:h,...u}=l;return u}function Pe(l,h){for(let u=l.length-1;u>=0;u-=1)if(h(l[u]))return u;return-1}function pr(l){const[h,u]=o.useState([]),[C,f]=o.useState(!1),[E,v]=o.useState(""),_=o.useRef(!1),k=o.useRef(null),R=o.useRef(null),S=o.useRef("cleared"),T=o.useRef(null),L=o.useRef(null),[ue,Q]=o.useState(null),[he,Y]=o.useState(null),w=o.useRef([]),x=o.useRef(l),Re=o.useRef(""),se=o.useRef(""),xe=o.useRef(0),N=o.useRef(0),B=o.useRef(l.sessionId),ke=o.useRef(l.sessionId);ke.current!==l.sessionId&&(ke.current=l.sessionId,B.current!==l.sessionId&&(N.current+=1,T.current=null)),x.current=l,w.current=h,o.useEffect(()=>()=>{var r;R.current!==null&&window.clearTimeout(R.current),(r=k.current)==null||r.abort(),L.current=null},[]),o.useEffect(()=>{_.current||(B.current=l.sessionId)},[l.sessionId]);const K=o.useMemo(()=>{const r={};for(const c of h)for(const a of c.blocks??[])if(a.kind==="tool")for(const d of a.results??[])r[d.route_id]=d;return r},[h]),V=()=>`m${++xe.current}_${Date.now().toString(36)}`,O=r=>u(c=>{if(!c.length)return c;const a=c.slice();return a[a.length-1]=r(a[a.length-1]),a}),Ce=r=>O(c=>{const a=ve(c);return{...a,blocks:[...a.blocks??[],r]}}),fe=(r,c)=>O(a=>{const d=ve(a);return{...d,blocks:(d.blocks??[]).map((p,m,g)=>r(p,m,g)?c(p):p)}}),Te=r=>(c,a,d)=>c.kind===r&&Pe(d,p=>p.kind===r)===a,F=r=>{if(k.current!==r||(R.current!==null&&(window.clearTimeout(R.current),R.current=null),S.current==="cleared"))return;const c=S.current==="shown";S.current="cleared",c&&O(ve)},$=(r,c)=>{r.requestId&&dr(r.requestId,c)},A=(r,c)=>{const a=T.current;!a||a.controller!==r||(a.requestId=c,a.streamStartReported||(a.streamStartReported=!0,$(a,{submission_to_stream_start_ms:Math.max(0,performance.now()-a.submittedAt)})),a.firstVisibleAt!==void 0&&!a.firstVisibleReported&&(a.firstVisibleReported=!0,$(a,{submission_to_first_visible_delta_ms:Math.max(0,a.firstVisibleAt-a.submittedAt)})))},U=(r,c)=>{const a=T.current;!a||a.controller!==r||a.terminalReported||(a.terminalReported=!0,$(a,{terminal_classification:c}))};o.useLayoutEffect(()=>{const r=T.current;if(!r||r.firstVisibleAt!==void 0)return;const c=h.at(-1);(c==null?void 0:c.role)!=="assistant"||!(c.blocks??[]).some(d=>d.kind==="tool"||d.kind==="reasoning"&&!!d.text.trim()||d.kind==="answer"&&!!d.text.trim())||(r.firstVisibleAt=performance.now(),r.requestId&&!r.firstVisibleReported&&(r.firstVisibleReported=!0,$(r,{submission_to_first_visible_delta_ms:Math.max(0,r.firstVisibleAt-r.submittedAt)})))},[h]);const ae=r=>{switch(r.type){case"stream_start":r.session_id&&(B.current=r.session_id,x.current.onSessionId(r.session_id));break;case"sandbox_start":case"sandbox_ready":case"workspace_ready":break;case"session_title_start":se.current="";break;case"session_title_delta":se.current+=r.text,x.current.onTitle(se.current.replace(/\s+/g," ").slice(0,80));break;case"session_title_done":se.current=r.title,x.current.onTitle(r.title);break;case"reasoning_start":O(c=>{const a=ve(c);return{...a,blocks:[...(a.blocks??[]).map(d=>d.kind==="reasoning"&&d.active?{...d,active:!1,open:!1}:d),{kind:"reasoning",text:"",active:!0,open:!0}]}});break;case"reasoning_delta":fe(Te("reasoning"),c=>c.kind==="reasoning"?{...c,text:c.text+r.text}:c);break;case"reasoning_end":O(c=>{const a=c.blocks??[],d=Pe(a,g=>g.kind==="reasoning"&&g.active);if(d<0)return c;const p=a[d];if(p.kind!=="reasoning")return c;const m=a[d-1];return(m==null?void 0:m.kind)==="reasoning"&&m.text===p.text?{...c,blocks:a.filter((g,y)=>y!==d)}:{...c,blocks:a.map((g,y)=>y===d?{...p,active:!1,open:!1}:g)}});break;case"tool_call":Ce({kind:"tool",id:r.id,name:r.name,args:r.args,status:"running",open:!1});break;case"tool_result":fe(c=>c.kind==="tool"&&c.id===r.id,c=>c.kind==="tool"?r.status?{...c,schema_version:2,status:r.status,took_ms:r.took_ms,content:r.content,metadata:r.metadata,open:r.status!=="success"}:{...c,status:"done",hits:r.hits,took_ms:r.took_ms,results:r.results}:c);break;case"answer_delta":O(c=>{const a=ve(c),d=a.blocks??[],p=d.at(-1);return(p==null?void 0:p.kind)==="answer"&&!p.done?{...a,blocks:[...d.slice(0,-1),{...p,text:p.text+r.text}]}:{...a,blocks:[...d,{kind:"answer",text:r.text,done:!1}]}});break;case"done":O(c=>({...c,streaming:!1,followups:r.followups,finishReason:r.finish_reason,citations:r.citations,blocks:(c.blocks??[]).map(a=>a.kind==="answer"?{...a,done:!0}:a.kind==="reasoning"&&a.active?{...a,active:!1,open:!1}:a)}));break;case"error":O(c=>({...c,streaming:!1,error:r.message,errorCode:r.code,blocks:(c.blocks??[]).map(a=>a.kind==="reasoning"&&a.active?{...a,active:!1,open:!1}:a)}));break}},re=async(r,c)=>{const a=await Ye(r),d=gt(a);return N.current!==c?null:(u(d),w.current=d,d)},ie=(r,c,a,d,p)=>{const m=++N.current;_.current=!0;const g=new AbortController;return k.current=g,Re.current=r,B.current=c.session_id,v(""),u(a),f(!0),T.current={controller:g,submittedAt:performance.now(),streamStartReported:!1,firstVisibleReported:!1,terminalReported:!1},R.current!==null&&window.clearTimeout(R.current),S.current="armed",R.current=window.setTimeout(()=>{R.current=null,!(S.current!=="armed"||k.current!==g||g.signal.aborted||N.current!==m)&&(S.current="shown",O(y=>{var P;return y.role==="assistant"&&y.streaming&&(((P=y.blocks)==null?void 0:P.length)??0)===0&&!y.error?{...y,status:bt}:y}))},fr),(async()=>{var le,X,W;let y=!1,P=!1,M=!1,J=!1,D=!1,H=!1;try{for await(const i of ur(c,{signal:g.signal})){i.type==="stream_start"&&(y=!0,P=i.provider_execution!==!1,A(g,i.request_id)),(i.type==="workspace_ready"||i.type==="reasoning_start"||i.type==="reasoning_delta"||i.type==="tool_call"||i.type==="answer_delta"||i.type==="done"||i.type==="error")&&F(g),(i.type==="done"||i.type==="error")&&(J=!0,D=i.type==="error",U(g,i.type==="error"?"error":"complete"),i.type==="error"&&["openrouter_monthly_budget_exhausted","openrouter_unavailable","openrouter_byok_credential_invalid","openrouter_byok_billing_error","openrouter_byok_rate_limit"].includes(i.code??"")&&(M=!0,x.current.onInterrupted(r)));const I=N.current===m;!g.signal.aborted&&(I||i.type==="stream_start"||i.type==="session_title_start"||i.type==="session_title_delta"||i.type==="session_title_done")&&ae(i)}}catch(i){if(D=!0,!g.signal.aborted){if(F(g),i instanceof we&&i.code==="chat_temporarily_disabled")H=!0,Y({question:r}),N.current===m&&(u(d),w.current=d,v(""));else if(i instanceof we&&i.code==="chat_capacity"){H=!0;const I=i.retryAfterSeconds??5,Z={question:r,request:c,optimistic:a,original:d,edit:p,retryAfterSeconds:I,retryAt:Date.now()+I*1e3};L.current=Z,Q({question:r,retryAt:Z.retryAt,retryAfterSeconds:I}),N.current===m&&(u(d),w.current=d,v(""))}else U(g,"network_error"),i instanceof we&&["openrouter_monthly_budget_exhausted","openrouter_unavailable","openrouter_byok_credential_invalid","openrouter_byok_billing_error","openrouter_byok_rate_limit"].includes(i.code??"")&&(M=!0,x.current.onInterrupted(r));!H&&N.current===m&&ae({type:"error",message:i instanceof Error?i.message:"The assistant stream failed.",code:i instanceof we?i.code:void 0})}}finally{if(k.current===g){if(F(g),!J&&!g.signal.aborted&&U(g,"network_error"),_.current=!1,f(!1),H)x.current.onSettled(c.session_id);else if(!g.signal.aborted){(y&&P||M)&&((X=(le=x.current).onProviderTerminal)==null||X.call(le));const i=B.current;if(p&&!y)N.current===m&&(u(p.snapshot),w.current=p.snapshot,v("Couldn’t resend this message. Your original conversation was restored."));else if(i){N.current===m&&p&&!p.first&&(D||!J)&&(u(p.snapshot),w.current=p.snapshot);try{const I=await re(i,m);I&&p&&!p.first&&I.some(Z=>Z.id===p.targetId)&&v("Couldn’t resend this message. Your original conversation was restored.")}catch{N.current===m&&O(I=>I.streaming?{...I,streaming:!1}:I)}}else N.current===m&&O(I=>I.streaming?{...I,streaming:!1}:I);x.current.onSettled(i)}((W=T.current)==null?void 0:W.controller)===g&&(T.current=null)}}})(),!0},pe=o.useCallback(r=>{const c=r.trim();if(!c||c.length>8e3||_.current||L.current)return!1;const a=w.current,d=[...a].reverse().find(M=>M.role==="user"),p=d!=null&&d.status&&d.status!=="complete"&&d.revision?{replace_message_id:d.id,prior_revision:d.revision}:null,m={id:V(),role:"user",text:c},g={id:V(),role:"assistant",streaming:!0,blocks:[]},y=p&&d?Pe(a,M=>M.id===d.id):-1,P=y<0?[...a,m,g]:[...a.slice(0,y),m,g];return ie(c,{message:c,session_id:x.current.sessionId,client_message_id:crypto.randomUUID(),...!x.current.sessionId&&x.current.initialModel?{initial_model:x.current.initialModel}:{},...p??{}},P,a)},[]),je=o.useCallback((r,c)=>{const a=c.trim();if(!a||a.length>8e3||_.current||L.current)return!1;const d=w.current.slice(),p=d.findIndex(D=>D.id===r&&D.role==="user");if(p<0)return!1;const m=d[p],g=d.findIndex(D=>D.role==="user"),y=p===g;if(!y&&(!x.current.sessionId||!m.revision))return!1;const P={id:m.id,role:"user",text:a,revision:y?void 0:m.revision+1,status:"generating"},M={id:V(),role:"assistant",streaming:!0,blocks:[]},J=y?[P,M]:[...d.slice(0,p),P,M];return ie(a,{message:a,session_id:y?null:x.current.sessionId,client_message_id:crypto.randomUUID(),...y&&x.current.initialModel?{initial_model:x.current.initialModel}:{},...y?{}:{replace_message_id:m.id,prior_revision:m.revision}},J,d,{targetId:m.id,snapshot:d,first:y})},[]),oe=o.useCallback(()=>{L.current=null,Q(null)},[]),Ne=o.useCallback(()=>{const r=L.current;return!r||Date.now()<r.retryAt||_.current?!1:(L.current=null,Q(null),ie(r.question,r.request,r.optimistic,r.original,r.edit))},[]),ce=o.useCallback(()=>{var d;if(!k.current)return;const r=k.current;F(r),U(r,"stopped"),r.abort(),k.current=null,((d=T.current)==null?void 0:d.controller)===r&&(T.current=null),_.current=!1,f(!1),u(p=>{const m=p.at(-1);if((m==null?void 0:m.role)!=="assistant")return p;const g=(m.blocks??[]).flatMap(y=>y.kind==="tool"&&y.status==="running"?[]:y.kind==="reasoning"&&y.active?[]:y.kind==="answer"?[{...y,done:!0}]:[y]);return[...p.slice(0,-1),{...m,blocks:g,streaming:!1,finishReason:"stopped"}]}),x.current.onInterrupted(Re.current);const c=B.current;c&&Ut(c).catch(()=>{});const a=++N.current;window.setTimeout(()=>{c&&N.current===a?re(c,a).catch(()=>{}).finally(()=>x.current.onSettled(c)):c||x.current.onSettled(null)},450)},[]),Se=o.useCallback((r,c)=>u(a=>a.map(d=>{var p;return d.id!==r?d:{...d,blocks:(p=d.blocks)==null?void 0:p.map((m,g)=>g===c&&(m.kind==="reasoning"||m.kind==="tool")?{...m,open:!m.open}:m)}})),[]),me=o.useCallback(()=>{var r;N.current+=1,R.current!==null&&(window.clearTimeout(R.current),R.current=null),S.current="cleared",(r=k.current)==null||r.abort(),k.current=null,T.current=null,L.current=null,Q(null),_.current=!1,B.current=null,u([]),f(!1),v("")},[]),z=o.useCallback(r=>{var c;N.current+=1,R.current!==null&&(window.clearTimeout(R.current),R.current=null),S.current="cleared",T.current=null,L.current=null,Q(null),_.current||((c=k.current)==null||c.abort(),k.current=null),u(r),_.current||f(!1),v("")},[]);return{messages:h,busy:C,papers:K,sessionError:E,capacityRequest:ue,disabledRequest:he,send:pe,editAndResend:je,retryCapacity:Ne,cancelCapacity:oe,dismissDisabled:()=>Y(null),stop:ce,toggleBlock:Se,reset:me,load:z}}const mr="https://huggingface.co/settings/inference-providers",ft="pwc.chat.billing-notice-dismissed.v1",pt=({provider:l})=>{const[h,u]=o.useState(()=>localStorage.getItem(ft)==="1");return!_e()||h||l!=="huggingface"?null:t.jsxs("div",{className:"chat-billing-notice",role:"note",children:[t.jsx("span",{children:"Hugging Face models use the inference permission granted when you start chatting. Included monthly credits are used first, then extra usage requires purchased credits. You can choose organization billing in Settings."}),t.jsxs("div",{className:"chat-billing-notice-actions",children:[t.jsx("a",{href:"/settings",children:"Review billing"}),t.jsx("a",{href:mr,target:"_blank",rel:"noreferrer",children:"Review usage"}),t.jsx("button",{type:"button",className:"chat-billing-notice-dismiss","aria-label":"Dismiss billing notice",title:"Dismiss",onClick:()=>{localStorage.setItem(ft,"1"),u(!0)},children:t.jsx(Pt,{size:15,"aria-hidden":"true"})})]})]})},mt=({enabled:l,fallbackEnabled:h,byokExpected:u})=>{const C=sr(l);if(!l||!C.data)return null;const f=C.data,E=ar(f.resets_at);return t.jsxs("div",{className:"chat-openrouter-usage",role:"status",children:[t.jsxs("span",{children:[t.jsxs("strong",{children:[f.remaining_percent,"% left"]})," this month · resets ",E.local]}),(f.remaining_percent===0||u)&&t.jsx("span",{children:h?"Your OpenRouter account will be billed on this explicit send.":t.jsxs(t.Fragment,{children:[t.jsx("a",{href:"/settings#openrouter-byok",children:"Connect your own key in Settings"})," to continue."]})})]})},gr=({retryAt:l,onRetry:h,onCancel:u})=>{const[C,f]=o.useState(()=>Math.max(0,Math.ceil((l-Date.now())/1e3))),E=o.useRef(null);return o.useEffect(()=>{var R;const v=document.activeElement instanceof HTMLElement?document.activeElement:null;(R=E.current)==null||R.focus();const _=()=>f(Math.max(0,Math.ceil((l-Date.now())/1e3)));_();const k=window.setInterval(_,250);return()=>{window.clearInterval(k),v==null||v.focus()}},[l]),t.jsx("div",{className:"chat-capacity-dialog-backdrop",role:"presentation",children:t.jsxs("div",{className:"chat-capacity-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-capacity-dialog-title","aria-describedby":"chat-capacity-dialog-description",onKeyDown:v=>{v.key==="Escape"&&(v.preventDefault(),u())},children:[t.jsx("h2",{id:"chat-capacity-dialog-title",children:"All research slots are currently in use"}),t.jsx("p",{id:"chat-capacity-dialog-description",children:"Your message was not sent or billed. Try again in a few seconds."}),t.jsx("p",{className:"chat-capacity-countdown","aria-live":"polite",children:C>0?`Try again available in ${C} second${C===1?"":"s"}.`:"You can try again now."}),t.jsxs("div",{className:"chat-capacity-dialog-actions",children:[t.jsx("button",{type:"button",className:"chat-capacity-cancel",ref:E,onClick:u,children:"Cancel"}),t.jsx("button",{type:"button",className:"chat-capacity-retry",disabled:C>0,onClick:h,children:"Try again"})]})]})})},yr=({onClose:l})=>{const h=o.useRef(null);return o.useEffect(()=>{var C;const u=document.activeElement instanceof HTMLElement?document.activeElement:null;return(C=h.current)==null||C.focus(),()=>u==null?void 0:u.focus()},[]),t.jsx("div",{className:"chat-capacity-dialog-backdrop",role:"presentation",children:t.jsxs("div",{className:"chat-capacity-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-disabled-title","aria-describedby":"chat-disabled-description",onKeyDown:u=>{u.key==="Escape"&&(u.preventDefault(),l())},children:[t.jsx("h2",{id:"chat-disabled-title",children:"Chat is temporarily disabled"}),t.jsx("p",{id:"chat-disabled-description",children:"We've temporarily paused new research runs. Your message wasn't sent, and your draft is still here. Please try again later."}),t.jsx("div",{className:"chat-capacity-dialog-actions",children:t.jsx("button",{ref:h,type:"button",className:"chat-capacity-cancel",onClick:l,children:"Keep editing"})})]})})},Tr=()=>{var Ve,Ge,$e,Qe,ze,Je,Xe,Ze;const{sessionId:l}=Et(),h=Tt(),[u,C]=jt(),{user:f,isLoading:E}=Nt(),{toast:v}=It(),_=Lt(),k=At(),R=Mt({queryKey:["chatAvailability"],queryFn:()=>Yt.getChatAvailability(),refetchInterval:3e4,retry:!1,enabled:_e()&&k}),S=((Ve=R.data)==null?void 0:Ve.status)==="paused",[T,L]=o.useState([]),[ue,Q]=o.useState(!1),[he,Y]=o.useState(""),[w,x]=o.useState(()=>l?{id:l,status:"loading"}:null),[Re,se]=o.useState(0),xe=o.useRef(qt()),N=o.useRef(u.get("model")||((Ge=xe.current)==null?void 0:Ge.model)),[B,ke]=o.useState(Bt),[K,V]=o.useState(N.current||Ht),O=(($e=B.find(e=>e.id===K))==null?void 0:$e.provider)??"huggingface",Ce=tr(!!(f&&O==="openrouter")),fe=o.useRef(O);fe.current=O;const[Te,F]=o.useState(""),[$,A]=o.useState(""),[U,ae]=o.useState(()=>{var e,n;return((e=u.get("q"))==null?void 0:e.trim())||((n=xe.current)==null?void 0:n.prompt)||""}),re=o.useRef(!1),ie=o.useRef(!1),pe=o.useRef(!1),[je,oe]=o.useState(null),[Ne,ce]=o.useState(null),[Se,me]=o.useState(""),[z,r]=o.useState(null),[c,a]=o.useState(()=>typeof window>"u"||window.innerWidth>900),[d,p]=o.useState(!1),[m,g]=o.useState(null),[y,P]=o.useState(""),M=o.useRef(new Set),J=o.useRef(!1),D=o.useRef(l),H=o.useRef(null),le=o.useRef(null),X=o.useRef(null);D.current=l;const W=o.useCallback(async()=>{if(!f)return;const e=!J.current;e&&Q(!0);try{const n=await Wt();L(s=>{const b=H.current,j=b?s.find(be=>be.id===b):void 0;if(!j)return n;const G=n.find(be=>be.id===b);return[G?{...G,title:j.title,is_busy:!0}:j,...n.filter(be=>be.id!==b)]}),J.current=!0,Y("")}catch(n){Y(n instanceof Error?n.message:"Could not load chats")}finally{e&&Q(!1)}},[f]),i=pr({sessionId:l??null,initialModel:K,onSessionId:e=>{H.current=e;const n=e!==D.current,s=(D.current??null)===le.current,b=new Date().toISOString();L(j=>j.some(G=>G.id===e)?j.map(G=>G.id===e?{...G,is_busy:!0}:G):[{id:e,title:"New chat",selected_model:K,created_at:b,updated_at:b,message_count:1,is_busy:!0},...j]),n&&s&&F("New chat"),s&&(X.current=e,x({id:e,status:"loaded"}),n&&h(`/chat/${e}`,{replace:!0}))},onTitle:e=>{const n=H.current??D.current;n&&!M.current.has(n)&&(n===D.current&&F(e),L(s=>s.map(b=>b.id===n?{...b,title:e}:b)))},onSettled:e=>{e&&L(n=>n.map(s=>s.id===e?{...s,is_busy:!1}:s)),H.current=null,le.current=null,W()},onProviderTerminal:()=>{fe.current==="openrouter"&&(_.invalidateQueries({queryKey:rr}),_.invalidateQueries({queryKey:nr}))},onInterrupted:e=>{A(e)}});i.load;const I=i.send;o.useEffect(()=>{i.capacityRequest&&A(i.capacityRequest.question)},[i.capacityRequest]),o.useEffect(()=>{i.busy&&oe(null)},[i.busy]);const Z=o.useCallback(e=>{sessionStorage.setItem(rt,e),sessionStorage.setItem(nt,K),sessionStorage.setItem(st,"1"),window.location.href=Dt("/chat",!0)},[K]),ge=o.useCallback(async e=>{if(!f){Z(e);return}if(O==="huggingface"&&!ie.current){if(pe.current)return;pe.current=!0;try{const s=await fetch(Me("/api/v1/me/inference-billing"),{credentials:"include",cache:"no-store"});if(!s.ok)throw new Error("Could not check Hugging Face authorization.");if(!(await s.json()).connected){Z(e);return}ie.current=!0}catch(s){A(e),Y(s instanceof Error?s.message:"Could not check Hugging Face authorization.");return}finally{pe.current=!1}}const n=D.current??null;I(e)&&(le.current=n,H.current=n,Kt(),A(""))},[Z,O,I,f]);o.useEffect(()=>{if(E||!f)return;const e=sessionStorage.getItem(nt);e&&V(e),W(),Vt().then(b=>{if(ke(b.items),!D.current){const j=N.current||e;V(j&&b.items.some(G=>G.id===j)?j:b.default_model)}});const n=sessionStorage.getItem(rt),s=sessionStorage.getItem(st)==="1";n&&(s?ae(n):A(n))},[E,W,f]),o.useEffect(()=>{if(!l){X.current!==null&&(X.current=null,i.reset()),x(null);return}if(X.current===l||(x(n=>(n==null?void 0:n.id)===l&&n.status==="loading"?n:{id:l,status:"loading"}),E||!f))return;let e=!1;return Y(""),Ye(l).then(n=>{e||(i.load(gt(n)),V(n.selected_model),F(n.title),X.current=l,x({id:l,status:"loaded"}))}).catch(n=>{if(e)return;const s=n instanceof Error?n.message:"Chat not found";i.reset(),Y(s),x({id:l,status:"error",error:s})}),()=>{e=!0}},[E,l,f,i.busy,Re]),o.useEffect(()=>{var b;const e=(b=u.get("q"))==null?void 0:b.trim();if(!e)return;re.current=!1;const n=u.get("model");n&&V(n),ae(e);const s=new URLSearchParams(u);s.delete("q"),s.delete("model"),C(s,{replace:!0})},[u,C]),o.useEffect(()=>{if(E||i.busy||!U||re.current||l&&(w==null?void 0:w.status)!=="loaded")return;const e=window.setTimeout(()=>{if(re.current)return;re.current=!0,ge(U).finally(()=>ae(""))},0);return()=>window.clearTimeout(e)},[E,i.busy,U,l,w==null?void 0:w.status,ge]),o.useEffect(()=>{const e=()=>{!f||i.busy||W()};return window.addEventListener("focus",e),()=>window.removeEventListener("focus",e)},[i.busy,W,f]),o.useEffect(()=>{if(!z)return;const e=()=>r(null),n=s=>{s.key==="Escape"&&e()};return window.addEventListener("click",e),window.addEventListener("keydown",n),()=>{window.removeEventListener("click",e),window.removeEventListener("keydown",n)}},[z]);const Fe=()=>{H.current=null,i.reset(),A(""),F(""),h("/chat")},Ue=async e=>{const n=Se.trim();if(n)try{const s=await ot(e,{title:n});M.current.add(e),e===l&&F(s.title),L(b=>b.map(j=>j.id===e?s:j)),ce(null)}catch(s){Y(s instanceof Error?s.message:"Rename failed")}},vt=async e=>{const n=e===l&&i.busy;if(window.confirm(n?"Stop and delete this chat? This cannot be undone.":"Delete this chat? This cannot be undone.")){n&&i.stop();try{if(n){const s=Date.now()+3e3;for(;(await Ye(e)).is_busy;){if(Date.now()>=s)throw new Error("Generation is still stopping. The chat was not deleted.");await new Promise(j=>window.setTimeout(j,150))}}await zt(e),e===l&&Fe(),await W()}catch(s){Y(s instanceof Error?s.message:"Delete failed")}}},wt=async()=>{var e;if(m===null){g("old");try{const n=await Zt();if(await W(),n.archived_count===0){v({title:"No chats were archived",description:"There are no inactive chats older than 30 days."});return}const s=((e=[...i.messages].reverse().find(b=>b.role==="user"))==null?void 0:e.text)??"";i.reset(),A(s),F(""),v({title:`${n.archived_count} ${n.archived_count===1?"chat":"chats"} archived`,description:"Your question is ready to send again."})}catch(n){v({variant:"destructive",title:"Could not archive old chats",description:n instanceof Error?n.message:"Try again."})}finally{g(null)}}},_t=async()=>{var e;if(m===null){g("oldest");try{const n=await Xt();await W();const s=((e=[...i.messages].reverse().find(b=>b.role==="user"))==null?void 0:e.text)??"";i.reset(),A(s),F(""),v({title:`${n.archived_count} ${n.archived_count===1?"chat":"chats"} archived`,description:"Your question is ready to send again."})}catch(n){v({variant:"destructive",title:"Could not archive chats",description:n instanceof Error?n.message:"Try again."})}finally{g(null)}}},qe=async e=>{const n=K;if(V(e),!!l)try{const s=await ot(l,{selected_model:e});L(b=>b.map(j=>j.id===l?{...j,selected_model:s.selected_model}:j)),Y("")}catch(s){V(n),Y(s instanceof Error?s.message:"Model change failed")}},Rt=async()=>{var e;if(!(!l||i.busy||d)){p(!0);try{const n=await Jt(l),s=new URL(n.public_path,window.location.origin).toString();try{if(!((e=navigator.clipboard)!=null&&e.writeText))throw new Error("Clipboard unavailable");await navigator.clipboard.writeText(s),v({className:"chat-share-toast",duration:5e3,title:"Public link copied to your clipboard",description:"Anyone with this link can see this conversation."})}catch{P(s)}}catch(n){const s=n instanceof Error?n.message:"Could not share this conversation";Y(s),v({variant:"destructive",title:"Share failed",description:s})}finally{p(!1)}}},[xt,kt]=o.useState(60);o.useLayoutEffect(()=>{const e=document.querySelector(".app-header");if(!e)return;const n=()=>kt(e.offsetHeight);n();const s=new ResizeObserver(n);return s.observe(e),()=>s.disconnect()},[]);const Ie=o.useRef(null),Oe=o.useRef(null),ye=o.useRef(null);o.useEffect(()=>{i.busy||(ye.current=null)},[i.busy]);const Ct=(e,n)=>{var s;Oe.current=((s=Ie.current)==null?void 0:s.scrollTop)??null,i.toggleBlock(e,n)};o.useLayoutEffect(()=>{const e=Ie.current;if(e){if(Oe.current!==null){e.scrollTop=Oe.current,Oe.current=null;return}if(ye.current){const n=Array.from(e.querySelectorAll("[data-message-id]")).find(s=>s.dataset.messageId===ye.current);if(n){const s=e.getBoundingClientRect(),b=n.getBoundingClientRect();e.scrollTop+=b.top-s.top-24;return}}e.scrollTop=e.scrollHeight}},[i.messages]);const de=T.find(e=>e.id===l),Be=i.messages.filter(e=>e.role==="user"),Le=(Qe=Be[0])==null?void 0:Qe.id,St=(ze=Be.at(-1))==null?void 0:ze.id,Ee=i.messages.length===0,He=(Je=[...i.messages].reverse().find(e=>e.role==="assistant"&&e.errorCode))==null?void 0:Je.errorCode,We=He==="openrouter_unavailable"||He==="openrouter_monthly_budget_exhausted",De=(w==null?void 0:w.id)===l,Ae=!!(l&&(E||f&&(!De||(w==null?void 0:w.status)==="loading"))),Ke=De&&(w==null?void 0:w.status)==="error"?w.error:void 0;return t.jsxs("div",{className:"chat-page",style:{height:`calc(100dvh - ${xt}px)`},children:[t.jsxs("aside",{className:`chat-sidebar${c?"":" chat-sidebar-closed"}`,children:[t.jsxs("div",{className:"chat-sidebar-top",children:[t.jsxs("button",{type:"button",className:"chat-new-chat",onClick:Fe,children:[t.jsx(Gt,{})," New chat"]}),t.jsx("button",{type:"button",className:"icon-btn",onClick:()=>a(!1),title:"Collapse sidebar",children:t.jsx(at,{})})]}),t.jsxs("nav",{className:"chat-sessions","aria-label":"Chat history",children:[ue&&t.jsx("div",{className:"chat-sessions-empty",children:"Loading chats…"}),!ue&&he&&t.jsx("div",{className:"chat-sessions-empty",children:he}),!ue&&!he&&T.length===0&&t.jsx("div",{className:"chat-sessions-empty",children:"Conversations you start will show up here."}),$t(T).map(e=>t.jsxs("div",{className:"chat-session-group",children:[t.jsx("div",{className:"chat-session-group-label",children:e.label}),e.items.map(n=>t.jsxs("div",{className:`chat-session${n.id===l?" chat-session-active":""}`,role:"button",tabIndex:0,onClick:()=>h(`/chat/${n.id}`),onKeyDown:s=>{if(s.key==="Enter"&&h(`/chat/${n.id}`),s.key==="F2"&&(ce(n.id),me(n.title)),s.key==="ContextMenu"||s.shiftKey&&s.key==="F10"){s.preventDefault();const b=s.currentTarget.getBoundingClientRect();r({id:n.id,x:b.right-150,y:b.bottom})}},onContextMenu:s=>{s.preventDefault(),r({id:n.id,x:s.clientX,y:s.clientY})},children:[Ne===n.id?t.jsx("input",{className:"chat-session-title-input",value:Se,autoFocus:!0,maxLength:80,onClick:s=>s.stopPropagation(),onChange:s=>me(s.target.value),onBlur:()=>void Ue(n.id),onKeyDown:s=>{s.stopPropagation(),s.key==="Enter"&&Ue(n.id),s.key==="Escape"&&ce(null)}}):t.jsx("span",{className:"chat-session-title",children:n.title}),t.jsx("button",{type:"button",className:"chat-session-menu","aria-label":"Chat actions","aria-haspopup":"menu",title:"Chat actions",onClick:s=>{s.stopPropagation();const b=s.currentTarget.getBoundingClientRect();r({id:n.id,x:b.right-150,y:b.bottom})},children:"⋯"}),t.jsx("button",{type:"button",className:"chat-session-delete","aria-label":"Delete conversation",onClick:s=>{s.stopPropagation(),vt(n.id)},children:t.jsx(Qt,{})})]},n.id))]},e.label))]}),z&&t.jsx("div",{className:"chat-session-context-menu",role:"menu",style:{left:z.x,top:z.y},onClick:e=>e.stopPropagation(),children:t.jsx("button",{type:"button",role:"menuitem",autoFocus:!0,onClick:()=>{const e=T.find(n=>n.id===z.id);e&&(ce(e.id),me(e.title)),r(null)},children:"Rename chat"})})]}),t.jsxs("section",{className:"chat-main",children:[t.jsxs("div",{className:"chat-topbar",children:[!c&&t.jsx("button",{type:"button",className:"icon-btn",onClick:()=>a(!0),title:"Open sidebar",children:t.jsx(at,{})}),t.jsx("span",{className:"chat-topbar-title",children:Ae?(de==null?void 0:de.title)||"":Te||(de==null?void 0:de.title)||(Ee?"":"New chat")}),k&&t.jsx("span",{className:"chat-staging-badge",children:"Staging"}),l&&De&&(w==null?void 0:w.status)==="loaded"&&!Ee&&t.jsxs("button",{type:"button",className:"chat-share-button",onClick:()=>void Rt(),disabled:i.busy||d||Ae,"aria-label":"Share conversation",children:[d?t.jsx(it,{}):t.jsx(ir,{"aria-hidden":"true"}),t.jsx("span",{children:"Share"})]})]}),Ae&&!U?t.jsxs("div",{className:"chat-session-loading",role:"status","aria-live":"polite",children:[t.jsx(it,{}),t.jsx("span",{children:"Loading conversation…"})]}):Ke?t.jsxs("div",{className:"chat-session-load-error",role:"alert",children:[t.jsx("p",{children:Ke}),t.jsx("button",{type:"button",onClick:()=>{x({id:l,status:"loading"}),se(e=>e+1)},children:"Try again"})]}):Ee&&!U?t.jsx("div",{className:"chat-empty",children:t.jsxs("div",{className:"chat-empty-inner",children:[t.jsx("div",{className:"chat-empty-eyebrow",children:"AI research assistant · Staging preview"}),t.jsxs("h1",{className:"chat-empty-title",children:["Ask ",t.jsx("em",{children:"Papers With Code"})]}),t.jsx("p",{className:"chat-empty-sub",children:"Answers are grounded in a live hybrid search over papers, tasks, and benchmarks — with citations you can follow."}),k&&t.jsx("p",{className:"chat-staging-access-note",children:"This is a limited staging preview. Only approved Hugging Face users can start chats."}),t.jsx(pt,{provider:O}),t.jsx(mt,{enabled:O==="openrouter",fallbackEnabled:!!((Xe=Ce.data)!=null&&Xe.fallback_enabled),byokExpected:We}),S&&t.jsx("div",{id:"chat-paused-description",className:"chat-paused-banner",role:"status",children:"Chat is temporarily disabled. You can keep browsing and editing your conversations. New research runs will return when chat is restored."}),t.jsx(et,{onSend:ge,busy:i.busy,onStop:i.stop,autoFocus:!0,draft:$,onDraftChange:A,models:B,selectedModel:K,onModelChange:e=>void qe(e),disabled:S,describedBy:S?"chat-paused-description":void 0}),t.jsx("div",{className:"chat-examples",children:er.map(e=>t.jsx("button",{type:"button",className:"chat-example",disabled:S,onClick:()=>ge(e),children:e},e))})]})}):t.jsxs(t.Fragment,{children:[i.sessionError&&t.jsx("div",{className:"chat-session-error",role:"alert",children:i.sessionError}),t.jsx("div",{className:"chat-conversation",ref:Ie,children:t.jsxs("div",{className:"chat-conversation-inner",children:[Ee&&U&&t.jsx(tt,{id:"queued-launch-preview",text:U,isInitial:!0}),i.messages.map(e=>e.role==="user"?t.jsx(tt,{id:e.id,text:e.text??"",isInitial:e.id===Le,editingAllowed:!i.busy&&!!e.revision,editing:je===e.id,editNotice:e.id===Le?"Sending will start a new chat.":e.id===St?"Sending will replace the response.":"Sending will replace the response and all messages after it.",onEdit:()=>oe(e.id),onCancel:()=>oe(null),onResend:n=>{e.id!==Le&&(ye.current=e.id);const s=i.editAndResend(e.id,n);return s?oe(null):ye.current=null,s}},e.id):t.jsx(Ft,{msg:e,papers:i.papers,onToggleBlock:Ct,onArchiveOldChats:()=>void wt(),onArchiveOldestChats:()=>void _t(),archivePending:m},e.id))]})}),t.jsx("div",{className:"chat-composer-wrap",children:t.jsxs("div",{className:"chat-composer-inner",children:[t.jsx(pt,{provider:O}),t.jsx(mt,{enabled:O==="openrouter",fallbackEnabled:!!((Ze=Ce.data)!=null&&Ze.fallback_enabled),byokExpected:We}),S&&t.jsx("div",{id:"chat-paused-description",className:"chat-paused-banner",role:"status",children:"Chat is temporarily disabled. You can keep browsing and editing your conversations. New research runs will return when chat is restored."}),t.jsx(et,{onSend:ge,busy:i.busy,onStop:i.stop,placeholder:$?"Edit and send again…":"Ask a follow-up…",draft:$,onDraftChange:A,models:B,selectedModel:K,onModelChange:e=>void qe(e),disabled:S,describedBy:S?"chat-paused-description":void 0}),t.jsx("div",{className:"chat-composer-foot",children:_e()?t.jsxs(t.Fragment,{children:[O==="openrouter"?t.jsxs("span",{className:"chat-provider-attribution",children:["Powered by ",t.jsx("a",{href:"https://openrouter.ai",target:"_blank",rel:"noreferrer",children:"OpenRouter"}),"."]}):t.jsxs("span",{className:"chat-provider-attribution",children:["Powered by 🤗 ",t.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"}),"."]}),t.jsx("span",{children:"The AI assistant can make mistakes. Double-check responses."})]}):t.jsx(t.Fragment,{children:"Assistant preview — responses are simulated."})})]})})]})]}),y&&t.jsx("div",{className:"chat-share-dialog-backdrop",role:"presentation",onMouseDown:()=>P(""),children:t.jsxs("div",{className:"chat-share-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-share-dialog-title",onMouseDown:e=>e.stopPropagation(),children:[t.jsx("h2",{id:"chat-share-dialog-title",children:"Public link created"}),t.jsx("p",{children:"It could not be copied automatically. Copy this link manually:"}),t.jsx("input",{readOnly:!0,value:y,"aria-label":"Public conversation link",autoFocus:!0,onFocus:e=>e.currentTarget.select()}),t.jsx("button",{type:"button",onClick:()=>P(""),children:"Close"})]})}),i.capacityRequest&&t.jsx(gr,{retryAt:i.capacityRequest.retryAt,onCancel:i.cancelCapacity,onRetry:()=>{i.retryCapacity()&&A("")}}),i.disabledRequest&&t.jsx(yr,{onClose:()=>{var e;A(((e=i.disabledRequest)==null?void 0:e.question)??$),i.dismissDisabled(),R.refetch()}})]})};export{gr as ChatCapacityDialog,yr as ChatDisabledDialog,Tr as default};
|
assets/ConferenceDetailView-COgeAJN1.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{e as L,r as D,j as e,L as p,b as C}from"./index-ChUK4pXW.js";import{u as T}from"./useQuery-CKrTCSf-.js";import{M as F}from"./MarkdownText-DnDQoKAJ.js";import{c as B,h as A,d as E}from"./transform-CuJRPBDz.js";import{S as f}from"./skeleton-qvDYp1rq.js";import{A as P,a as z}from"./alert-DNLHMDlv.js";import{s as M}from"./safeExternalHref-CkBrsh84.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-BPqigL3n.js";import"./index-CW8TvXfJ.js";import"./hover-card-D4KxxydT.js";const R=a=>(a==null?void 0:a.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",O=(a,t)=>{if(!a)return null;const i=new Date(`${a}T00:00:00`),s=t?new Date(`${t}T00:00:00`):null,c=g=>g.toLocaleDateString("en-US",{month:"long",day:"numeric"}),m=i.getFullYear();return s&&s.getTime()!==i.getTime()?i.getMonth()===s.getMonth()?`${c(i).replace(/\d+$/,"").trim()} ${i.getDate()}–${s.getDate()}, ${m}`:`${c(i)} – ${c(s)}, ${m}`:`${c(i)}, ${m}`},X=()=>{var k,b,S,_,$,w;const{confSlug:a}=L(),t=T({queryKey:["conference-areas-with-tasks",a],queryFn:()=>C.getConferenceAreasWithTasks(a),enabled:!!a,staleTime:10*60*1e3}),i=D.useMemo(()=>{if(!t.data)return[];const r={general:0,vision:1,video:2,language:3,audio:4,other:5},n=o=>r[R(o)]??999;return[...t.data.results].sort((o,l)=>{const d=n(o.name),x=n(l.name);return d!==x?d-x:o.name.localeCompare(l.name)})},[t.data]),s=(k=t.data)==null?void 0:k.conference,c=((b=t.data)==null?void 0:b.total_paper_count)??0,m=((S=t.data)==null?void 0:S.oral_paper_count)??0,g=((_=t.data)==null?void 0:_.spotlight_paper_count)??0,u=(($=t.data)==null?void 0:$.outstanding_paper_count)??0,j=((w=t.data)==null?void 0:w.best_paper_finalist_paper_count)??0,v=i.reduce((r,n)=>r+n.tasks.length,0);if(t.error)return e.jsx("div",{className:"page",children:e.jsx(P,{variant:"destructive",children:e.jsx(z,{children:"Failed to load conference. Please try again."})})});const y=s?O(s.start_date,s.end_date):null,N=s?[s.venue,s.location].filter(Boolean).join(", "):null,h=s==null?void 0:s.name;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:s!=null&&s.image_url?"task-hero-grid":void 0,children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"CONFERENCE"}),e.jsx("h1",{className:"feed-title",children:h??e.jsx(f,{className:"h-10 w-64 inline-block"})}),e.jsxs("div",{className:"feed-subtitle",style:{display:"flex",flexDirection:"column",gap:4},children:[y&&e.jsx("span",{children:y}),N&&e.jsx("span",{children:N}),(s==null?void 0:s.url)&&e.jsx("a",{href:M(s.url)??void 0,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:s.url.replace(/^https?:\/\//,"")}),(s==null?void 0:s.hf_url)&&e.jsxs("a",{className:"bm-action-btn",href:s.hf_url,target:"_blank",rel:"noopener noreferrer",style:{alignSelf:"flex-start",marginTop:4},children:[e.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),(s==null?void 0:s.description)&&e.jsx(F,{className:"method-description",text:s.description})]}),(s==null?void 0:s.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:s.image_url,alt:h?`${h} visual`:"Conference visual",onError:r=>{var n,o;(o=(n=r.currentTarget.parentElement)==null?void 0:n.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",h??"Conference",s.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(F,{className:"task-image-credit",text:s.image_credit})]})]})]})]}),!t.isLoading&&c>0&&e.jsxs("section",{style:{marginTop:48,marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:"Browse papers"}),e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:"All accepted papers, plus oral, spotlight, outstanding, and best paper finalists."})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[c.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[e.jsxs(p,{to:`/conferences/${a}/all`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"var(--accent)"}}),"All papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[c.toLocaleString()," papers"]})})]}),m>0&&e.jsxs(p,{to:`/conferences/${a}/oral`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Oral papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[m.toLocaleString()," papers"]})})]}),g>0&&e.jsxs(p,{to:`/conferences/${a}/spotlight`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Spotlight papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[g.toLocaleString()," papers"]})})]}),u>0&&e.jsxs(p,{to:`/conferences/${a}/outstanding`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c45c26"}}),"Outstanding papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[u.toLocaleString()," papers"]})})]}),j>0&&e.jsxs(p,{to:`/conferences/${a}/best-paper-finalists`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c9a227"}}),"Best paper finalists"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[j.toLocaleString()," papers"]})})]})]})]}),t.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((r,n)=>e.jsxs("div",{children:[e.jsx(f,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((o,l)=>e.jsx(f,{className:"h-24"},l))})]},n))}):i.map(r=>{const n=r.tasks;if(n.length===0)return null;const o=n.reduce((l,d)=>l+(d.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:r.name}),r.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:r.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[n.length," ",n.length===1?"task":"tasks"," · ",o.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:n.map(l=>{const d=l.slug||"",x=B(A(d));return e.jsxs(p,{to:`/conferences/${a}/${d}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:x.dot}}),E(l.name,d)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(l.paper_count??0).toLocaleString()," papers"]})})]},l.id)})})]},r.id)}),v>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[v," tasks across ",i.filter(r=>r.tasks.length>0).length," areas."]})]})};export{X as default};
|
assets/ConferenceDetailView-CX3GajW1.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{e as L,r as D,j as e,L as p,b as C}from"./index-C--7Ookn.js";import{u as T}from"./useQuery-DFn3_KAa.js";import{M as F}from"./MarkdownText-BGIn3wwa.js";import{c as B,h as A,d as E}from"./transform-BfLoZuxV.js";import{S as f}from"./skeleton-r_i4hk58.js";import{A as P,a as z}from"./alert-CThmjBPy.js";import"./useBaseQuery-CPtz5T_6.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-n0bYaW06.js";import"./index-C0jd_q9w.js";import"./hover-card-1g79nCeQ.js";const M=a=>(a==null?void 0:a.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",R=(a,t)=>{if(!a)return null;const i=new Date(`${a}T00:00:00`),s=t?new Date(`${t}T00:00:00`):null,c=g=>g.toLocaleDateString("en-US",{month:"long",day:"numeric"}),m=i.getFullYear();return s&&s.getTime()!==i.getTime()?i.getMonth()===s.getMonth()?`${c(i).replace(/\d+$/,"").trim()} ${i.getDate()}–${s.getDate()}, ${m}`:`${c(i)} – ${c(s)}, ${m}`:`${c(i)}, ${m}`},J=()=>{var k,b,S,_,$,w;const{confSlug:a}=L(),t=T({queryKey:["conference-areas-with-tasks",a],queryFn:()=>C.getConferenceAreasWithTasks(a),enabled:!!a,staleTime:10*60*1e3}),i=D.useMemo(()=>{if(!t.data)return[];const r={general:0,vision:1,video:2,language:3,audio:4,other:5},n=o=>r[M(o)]??999;return[...t.data.results].sort((o,l)=>{const d=n(o.name),x=n(l.name);return d!==x?d-x:o.name.localeCompare(l.name)})},[t.data]),s=(k=t.data)==null?void 0:k.conference,c=((b=t.data)==null?void 0:b.total_paper_count)??0,m=((S=t.data)==null?void 0:S.oral_paper_count)??0,g=((_=t.data)==null?void 0:_.spotlight_paper_count)??0,u=(($=t.data)==null?void 0:$.outstanding_paper_count)??0,j=((w=t.data)==null?void 0:w.best_paper_finalist_paper_count)??0,v=i.reduce((r,n)=>r+n.tasks.length,0);if(t.error)return e.jsx("div",{className:"page",children:e.jsx(P,{variant:"destructive",children:e.jsx(z,{children:"Failed to load conference. Please try again."})})});const y=s?R(s.start_date,s.end_date):null,N=s?[s.venue,s.location].filter(Boolean).join(", "):null,h=s==null?void 0:s.name;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:s!=null&&s.image_url?"task-hero-grid":void 0,children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"CONFERENCE"}),e.jsx("h1",{className:"feed-title",children:h??e.jsx(f,{className:"h-10 w-64 inline-block"})}),e.jsxs("div",{className:"feed-subtitle",style:{display:"flex",flexDirection:"column",gap:4},children:[y&&e.jsx("span",{children:y}),N&&e.jsx("span",{children:N}),(s==null?void 0:s.url)&&e.jsx("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:s.url.replace(/^https?:\/\//,"")}),(s==null?void 0:s.hf_url)&&e.jsxs("a",{className:"bm-action-btn",href:s.hf_url,target:"_blank",rel:"noopener noreferrer",style:{alignSelf:"flex-start",marginTop:4},children:[e.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),(s==null?void 0:s.description)&&e.jsx(F,{className:"method-description",text:s.description})]}),(s==null?void 0:s.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:s.image_url,alt:h?`${h} visual`:"Conference visual",onError:r=>{var n,o;(o=(n=r.currentTarget.parentElement)==null?void 0:n.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",h??"Conference",s.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(F,{className:"task-image-credit",text:s.image_credit})]})]})]})]}),!t.isLoading&&c>0&&e.jsxs("section",{style:{marginTop:48,marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:"Browse papers"}),e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:"All accepted papers, plus oral, spotlight, outstanding, and best paper finalists."})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[c.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[e.jsxs(p,{to:`/conferences/${a}/all`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"var(--accent)"}}),"All papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[c.toLocaleString()," papers"]})})]}),m>0&&e.jsxs(p,{to:`/conferences/${a}/oral`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Oral papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[m.toLocaleString()," papers"]})})]}),g>0&&e.jsxs(p,{to:`/conferences/${a}/spotlight`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Spotlight papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[g.toLocaleString()," papers"]})})]}),u>0&&e.jsxs(p,{to:`/conferences/${a}/outstanding`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c45c26"}}),"Outstanding papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[u.toLocaleString()," papers"]})})]}),j>0&&e.jsxs(p,{to:`/conferences/${a}/best-paper-finalists`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c9a227"}}),"Best paper finalists"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[j.toLocaleString()," papers"]})})]})]})]}),t.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((r,n)=>e.jsxs("div",{children:[e.jsx(f,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((o,l)=>e.jsx(f,{className:"h-24"},l))})]},n))}):i.map(r=>{const n=r.tasks;if(n.length===0)return null;const o=n.reduce((l,d)=>l+(d.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:r.name}),r.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:r.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[n.length," ",n.length===1?"task":"tasks"," · ",o.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:n.map(l=>{const d=l.slug||"",x=B(A(d));return e.jsxs(p,{to:`/conferences/${a}/${d}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:x.dot}}),E(l.name,d)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(l.paper_count??0).toLocaleString()," papers"]})})]},l.id)})})]},r.id)}),v>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[v," tasks across ",i.filter(r=>r.tasks.length>0).length," areas."]})]})};export{J as default};
|
|
|
|
|
|
assets/ConferenceTaskView-B1Bvx50f.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{e as $,a as D,r as f,j as e,L as b,R as W,b as M}from"./index-ChUK4pXW.js";import{u as z}from"./useQuery-CKrTCSf-.js";import{P as G}from"./components-Oks99QHA.js";import{u as J,P as X}from"./useIntersectionObserver-Bm84xMAC.js";import{M as h}from"./MarkdownText-DnDQoKAJ.js";import{t as Y,d as Z}from"./transform-CuJRPBDz.js";import{c as ee}from"./usePapers-Bvgk8ZIt.js";import{S as se}from"./skeleton-qvDYp1rq.js";import{A as ae,a as te}from"./alert-DNLHMDlv.js";import"./LatexTitle-RPgzE218.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";import"./PaperPreviewLink-BPqigL3n.js";import"./index-CW8TvXfJ.js";import"./hover-card-D4KxxydT.js";import"./useInfiniteQuery-DflNwjnr.js";const re=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ne=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",ve=()=>{var F,A,L,O,T,B;const{confSlug:a,taskSlug:n}=$(),[c,j]=D(),y=ne(c.get("order_by")),S=c.get("has_code")==="true",w=c.get("has_hf_artifacts")==="true",I=t=>{const s=new URLSearchParams(c);s.set("order_by",t),j(s)},q=t=>{const s=new URLSearchParams(c);t?s.set("has_code","true"):s.delete("has_code"),j(s)},Q=t=>{const s=new URLSearchParams(c);t?s.set("has_hf_artifacts","true"):s.delete("has_hf_artifacts"),j(s)},k=n==="all",P=n==="oral",N=n==="spotlight",l=n==="outstanding",d=n==="best-paper-finalists",u=l||d,p=k||P||N||l||d,K=p?void 0:n,U=P?"oral":N?"spotlight":l?"outstanding":d?"best_paper_finalist":void 0,m=z({queryKey:["conference",a],queryFn:()=>M.getConference(a),enabled:!!a,staleTime:10*60*1e3}),x=z({queryKey:["task",n],queryFn:()=>M.getTask(n),enabled:!!n&&!p,staleTime:10*60*1e3}),i=ee({conferenceSlug:a||"",taskSlug:K,presentation:U,page_size:12,order_by:y,order_dir:"desc",include_resources:!0,has_code:S,has_hf_artifacts:w,enabled:!!a}),{targetRef:V,isIntersecting:C}=J({rootMargin:"200px"});f.useEffect(()=>{C&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[C,i.hasNextPage,i.isFetchingNextPage]),f.useEffect(()=>{window.scrollTo(0,0)},[a,n]);const _=f.useMemo(()=>{var s;return(((s=i.data)==null?void 0:s.pages)??[]).flatMap(o=>o.results)},[i.data]),v=f.useMemo(()=>_.map(Y),[_]),g=k?"All papers":P?"Oral papers":N?"Spotlight papers":l?"Outstanding papers":d?"Best paper finalists":Z(((F=x.data)==null?void 0:F.name)||n||"",((A=x.data)==null?void 0:A.slug)||n),R=((O=(L=i.data)==null?void 0:L.pages[0])==null?void 0:O.count)??((T=m.data)==null?void 0:T.paper_count)??0,r=x.data;return m.error||x.error||i.error?e.jsx("div",{className:"page",children:e.jsx(ae,{variant:"destructive",children:e.jsx(te,{children:"Failed to load conference papers. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(b,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(b,{to:"/conferences",children:"Conferences"}),e.jsx("span",{children:" / "}),e.jsx(b,{to:`/conferences/${a}`,children:((B=m.data)==null?void 0:B.name)??a}),e.jsx("span",{children:" / "}),e.jsx("span",{children:g})]}),e.jsxs("div",{className:!p&&(r!=null&&r.image_url)?"task-hero-grid":void 0,style:{marginTop:16,marginBottom:28},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:p?"BROWSE PAPERS":"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:g}),l&&a==="iclr-2026"&&e.jsx(h,{className:"task-explainer",text:"ICLR 2026 recognized two Outstanding Papers and one Honorable Mention. [Read the announcement](https://blog.iclr.cc/2026/04/23/announcing-the-iclr-2026-outstanding-papers/)."}),l&&a==="icml-2026"&&e.jsx(h,{className:"task-explainer",text:"ICML 2026 recognized two Outstanding Papers and five Honorable Mentions. [Read the announcement](https://blog.icml.cc/2026/07/05/announcing-the-icml-2026-awards/)."}),d&&a==="cvpr-2026"&&e.jsx(h,{className:"task-explainer",text:"CVPR 2026 recognized fifteen Best Paper Award finalists, including the winners. [Read the announcement](https://x.com/CVPR/status/2062912519522717978)."}),!p&&(r==null?void 0:r.description)&&e.jsx(h,{className:"task-explainer",text:r.description}),m.data&&e.jsxs("div",{className:"task-quickstats",style:{marginTop:12},children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:R.toLocaleString()}),"PAPERS"]}),e.jsx("span",{children:m.data.name})]})]}),!p&&(r==null?void 0:r.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:r.image_url,alt:`${g} schematic`,onError:t=>{var s,o;(o=(s=t.currentTarget.parentElement)==null?void 0:s.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",g,r.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(h,{className:"task-image-credit",text:r.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-section-head",children:[e.jsx("div",{className:"task-section-eyebrow",children:u?"Award papers":"Conference papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",R.toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[!u&&e.jsx("div",{className:"sort-options",children:re.map(([t,s])=>e.jsx("button",{className:`sort-btn ${y===t?"active":""}`,onClick:()=>I(t),children:s},t))}),e.jsx(X,{hasCode:S,hasHfArtifacts:w,onHasCodeChange:q,onHasHfArtifactsChange:Q,showDivider:!u})]}),!u&&e.jsxs("div",{className:"results-count",children:[v.length," loaded in ",e.jsx("span",{children:g})]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((t,s)=>e.jsx(se,{className:"h-40 w-full"},s))}):v.length===0?e.jsx("div",{className:"no-results",children:"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:v.map((t,s)=>{var E;const o=(E=_[s])==null?void 0:E.conference_award,H=o==="outstanding"?"Outstanding Paper":o==="honorable_mention"?"Honorable Mention":o==="best_paper_finalist"&&!d?"Best Paper Finalist":null;return e.jsxs(W.Fragment,{children:[H&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.08em",marginBottom:8},children:H}),e.jsx(G,{paper:t,rank:s+1})]},t.id)})}),e.jsx("div",{ref:V,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{ve as default};
|
assets/ConferenceTaskView-ZWGgeN9m.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{e as $,a as D,r as f,j as e,L as b,R as W,b as M}from"./index-C--7Ookn.js";import{u as z}from"./useQuery-DFn3_KAa.js";import{P as G}from"./components-KzuuRgbc.js";import{u as J,P as X}from"./useIntersectionObserver-BFYx46oo.js";import{M as h}from"./MarkdownText-BGIn3wwa.js";import{t as Y,d as Z}from"./transform-BfLoZuxV.js";import{c as ee}from"./usePapers-B1XrbsG4.js";import{S as se}from"./skeleton-r_i4hk58.js";import{A as ae,a as te}from"./alert-CThmjBPy.js";import"./useBaseQuery-CPtz5T_6.js";import"./LatexTitle-CTfnj_ow.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-n0bYaW06.js";import"./index-C0jd_q9w.js";import"./hover-card-1g79nCeQ.js";import"./useInfiniteQuery-DcxJ3elC.js";const re=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ne=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",ve=()=>{var F,A,L,O,T,B;const{confSlug:a,taskSlug:n}=$(),[c,j]=D(),y=ne(c.get("order_by")),S=c.get("has_code")==="true",w=c.get("has_hf_artifacts")==="true",I=t=>{const s=new URLSearchParams(c);s.set("order_by",t),j(s)},q=t=>{const s=new URLSearchParams(c);t?s.set("has_code","true"):s.delete("has_code"),j(s)},Q=t=>{const s=new URLSearchParams(c);t?s.set("has_hf_artifacts","true"):s.delete("has_hf_artifacts"),j(s)},k=n==="all",P=n==="oral",N=n==="spotlight",l=n==="outstanding",d=n==="best-paper-finalists",u=l||d,p=k||P||N||l||d,K=p?void 0:n,U=P?"oral":N?"spotlight":l?"outstanding":d?"best_paper_finalist":void 0,m=z({queryKey:["conference",a],queryFn:()=>M.getConference(a),enabled:!!a,staleTime:10*60*1e3}),x=z({queryKey:["task",n],queryFn:()=>M.getTask(n),enabled:!!n&&!p,staleTime:10*60*1e3}),i=ee({conferenceSlug:a||"",taskSlug:K,presentation:U,page_size:12,order_by:y,order_dir:"desc",include_resources:!0,has_code:S,has_hf_artifacts:w,enabled:!!a}),{targetRef:V,isIntersecting:C}=J({rootMargin:"200px"});f.useEffect(()=>{C&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[C,i.hasNextPage,i.isFetchingNextPage]),f.useEffect(()=>{window.scrollTo(0,0)},[a,n]);const _=f.useMemo(()=>{var s;return(((s=i.data)==null?void 0:s.pages)??[]).flatMap(o=>o.results)},[i.data]),v=f.useMemo(()=>_.map(Y),[_]),g=k?"All papers":P?"Oral papers":N?"Spotlight papers":l?"Outstanding papers":d?"Best paper finalists":Z(((F=x.data)==null?void 0:F.name)||n||"",((A=x.data)==null?void 0:A.slug)||n),R=((O=(L=i.data)==null?void 0:L.pages[0])==null?void 0:O.count)??((T=m.data)==null?void 0:T.paper_count)??0,r=x.data;return m.error||x.error||i.error?e.jsx("div",{className:"page",children:e.jsx(ae,{variant:"destructive",children:e.jsx(te,{children:"Failed to load conference papers. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(b,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(b,{to:"/conferences",children:"Conferences"}),e.jsx("span",{children:" / "}),e.jsx(b,{to:`/conferences/${a}`,children:((B=m.data)==null?void 0:B.name)??a}),e.jsx("span",{children:" / "}),e.jsx("span",{children:g})]}),e.jsxs("div",{className:!p&&(r!=null&&r.image_url)?"task-hero-grid":void 0,style:{marginTop:16,marginBottom:28},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:p?"BROWSE PAPERS":"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:g}),l&&a==="iclr-2026"&&e.jsx(h,{className:"task-explainer",text:"ICLR 2026 recognized two Outstanding Papers and one Honorable Mention. [Read the announcement](https://blog.iclr.cc/2026/04/23/announcing-the-iclr-2026-outstanding-papers/)."}),l&&a==="icml-2026"&&e.jsx(h,{className:"task-explainer",text:"ICML 2026 recognized two Outstanding Papers and five Honorable Mentions. [Read the announcement](https://blog.icml.cc/2026/07/05/announcing-the-icml-2026-awards/)."}),d&&a==="cvpr-2026"&&e.jsx(h,{className:"task-explainer",text:"CVPR 2026 recognized fifteen Best Paper Award finalists, including the winners. [Read the announcement](https://x.com/CVPR/status/2062912519522717978)."}),!p&&(r==null?void 0:r.description)&&e.jsx(h,{className:"task-explainer",text:r.description}),m.data&&e.jsxs("div",{className:"task-quickstats",style:{marginTop:12},children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:R.toLocaleString()}),"PAPERS"]}),e.jsx("span",{children:m.data.name})]})]}),!p&&(r==null?void 0:r.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:r.image_url,alt:`${g} schematic`,onError:t=>{var s,o;(o=(s=t.currentTarget.parentElement)==null?void 0:s.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",g,r.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(h,{className:"task-image-credit",text:r.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-section-head",children:[e.jsx("div",{className:"task-section-eyebrow",children:u?"Award papers":"Conference papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",R.toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[!u&&e.jsx("div",{className:"sort-options",children:re.map(([t,s])=>e.jsx("button",{className:`sort-btn ${y===t?"active":""}`,onClick:()=>I(t),children:s},t))}),e.jsx(X,{hasCode:S,hasHfArtifacts:w,onHasCodeChange:q,onHasHfArtifactsChange:Q,showDivider:!u})]}),!u&&e.jsxs("div",{className:"results-count",children:[v.length," loaded in ",e.jsx("span",{children:g})]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((t,s)=>e.jsx(se,{className:"h-40 w-full"},s))}):v.length===0?e.jsx("div",{className:"no-results",children:"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:v.map((t,s)=>{var E;const o=(E=_[s])==null?void 0:E.conference_award,H=o==="outstanding"?"Outstanding Paper":o==="honorable_mention"?"Honorable Mention":o==="best_paper_finalist"&&!d?"Best Paper Finalist":null;return e.jsxs(W.Fragment,{children:[H&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.08em",marginBottom:8},children:H}),e.jsx(G,{paper:t,rank:s+1})]},t.id)})}),e.jsx("div",{ref:V,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{ve as default};
|
|
|
|
|
|
assets/ConferencesIndexView-D-Jz9kvY.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{r as u,j as e,L as d,b as p}from"./index-C--7Ookn.js";import{u as h}from"./useQuery-DFn3_KAa.js";import{S as m}from"./skeleton-r_i4hk58.js";import{A as f,a as g}from"./alert-CThmjBPy.js";import{T as x}from"./TaxonomySuggestionTile-QPmmYmQz.js";import"./useBaseQuery-CPtz5T_6.js";import"./SignInToEditDialog-Htxc8Pb0.js";import"./button-BrPkQ8E2.js";import"./textarea-CWyb9M_6.js";import"./dialog-DTAlnqKL.js";import"./useMutation-BLE_nqBT.js";import"./loader-circle-D5QPn8lV.js";const j=(r,a)=>{if(!r)return null;const t=new Date(`${r}T00:00:00`),s=a?new Date(`${a}T00:00:00`):null,n=o=>o.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=t.getFullYear();return s&&s.getTime()!==t.getTime()?t.getMonth()===s.getMonth()?`${n(t).replace(/\d+$/,"").trim()} ${t.getDate()}–${s.getDate()}, ${i}`:`${n(t)} – ${n(s)}, ${i}`:`${n(t)}, ${i}`},v=r=>{var t;if(r.year!=null)return r.year;if(r.start_date)return Number(r.start_date.slice(0,4));const a=(t=r.slug.match(/-(\d{4})$/))==null?void 0:t[1];return a?Number(a):0},y=(r,a)=>{if(r.start_date&&a.start_date){const t=r.start_date.localeCompare(a.start_date);if(t!==0)return t}else{if(r.start_date)return-1;if(a.start_date)return 1}return r.name.localeCompare(a.name)},N={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},B=()=>{const r=h({queryKey:["conferences"],queryFn:()=>p.getConferences(),staleTime:6e5}),a=u.useMemo(()=>{var s;if(!((s=r.data)!=null&&s.results))return null;const t={};return r.data.results.forEach(n=>{const i=v(n);(t[i]||(t[i]=[])).push(n)}),Object.values(t).forEach(n=>n.sort(y)),Object.keys(t).map(Number).sort((n,i)=>i-n).map(n=>({year:n,conferences:t[n]}))},[r.data]);return r.error?e.jsx("div",{className:"page",children:e.jsx(f,{variant:"destructive",children:e.jsx(g,{children:"Failed to load conferences. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Conferences"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse accepted papers from major AI conferences, grouped by research area and task."}),e.jsxs("div",{className:"conference-deadlines-link",children:["Find deadlines for upcoming conferences"," ",e.jsx(d,{to:"/ai-deadlines",className:"underline underline-offset-2 hover:text-foreground",children:"here"}),". Conference information is based on"," ",e.jsx("a",{href:"https://huggingface.co/ai-conferences",target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:"Hugging Face AI Conferences"}),"."]})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:2}).map((t,s)=>e.jsxs("div",{children:[e.jsx(m,{className:"h-8 w-24 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:3}).map((n,i)=>e.jsx(m,{className:"h-32"},i))})]},s))}):a==null?void 0:a.map(({year:t,conferences:s})=>{const n=s.reduce((o,l)=>o+(l.paper_count??0),0),i=t>0?String(t):"Unknown year";return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:N,children:[e.jsx("div",{children:e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:i})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[s.length," ",s.length===1?"conference":"conferences"," ·"," ",n.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[s.map(o=>{const l=j(o.start_date,o.end_date),c=[o.venue,o.location].filter(Boolean).join(", ");return e.jsxs(d,{to:`/conferences/${o.slug}`,className:"tag-cell",children:[e.jsx("div",{className:"name",children:o.name}),e.jsxs("div",{className:"meta",style:{display:"flex",flexDirection:"column",gap:4},children:[l&&e.jsx("span",{children:l}),c&&e.jsx("span",{children:c}),e.jsxs("span",{children:[(o.paper_count??0).toLocaleString()," papers"]})]})]},o.id)}),e.jsx(x,{kind:"conference"})]})]},t)})]})};export{B as default};
|
|
|
|
|
|
assets/ConferencesIndexView-fTTtkWk7.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{r as u,j as e,L as d,b as p}from"./index-ChUK4pXW.js";import{u as h}from"./useQuery-CKrTCSf-.js";import{S as m}from"./skeleton-qvDYp1rq.js";import{A as f,a as g}from"./alert-DNLHMDlv.js";import{T as x}from"./TaxonomySuggestionTile-luNTTZ_I.js";import"./SignInToEditDialog-K442ZtDG.js";import"./button-349xR3H5.js";import"./textarea-CLwMrZMN.js";import"./dialog-YQ7VJ-Bw.js";import"./useMutation-BgE1BvtL.js";import"./loader-circle-DM3sTtAh.js";const j=(r,a)=>{if(!r)return null;const t=new Date(`${r}T00:00:00`),s=a?new Date(`${a}T00:00:00`):null,n=o=>o.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=t.getFullYear();return s&&s.getTime()!==t.getTime()?t.getMonth()===s.getMonth()?`${n(t).replace(/\d+$/,"").trim()} ${t.getDate()}–${s.getDate()}, ${i}`:`${n(t)} – ${n(s)}, ${i}`:`${n(t)}, ${i}`},v=r=>{var t;if(r.year!=null)return r.year;if(r.start_date)return Number(r.start_date.slice(0,4));const a=(t=r.slug.match(/-(\d{4})$/))==null?void 0:t[1];return a?Number(a):0},y=(r,a)=>{if(r.start_date&&a.start_date){const t=r.start_date.localeCompare(a.start_date);if(t!==0)return t}else{if(r.start_date)return-1;if(a.start_date)return 1}return r.name.localeCompare(a.name)},N={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},F=()=>{const r=h({queryKey:["conferences"],queryFn:()=>p.getConferences(),staleTime:6e5}),a=u.useMemo(()=>{var s;if(!((s=r.data)!=null&&s.results))return null;const t={};return r.data.results.forEach(n=>{const i=v(n);(t[i]||(t[i]=[])).push(n)}),Object.values(t).forEach(n=>n.sort(y)),Object.keys(t).map(Number).sort((n,i)=>i-n).map(n=>({year:n,conferences:t[n]}))},[r.data]);return r.error?e.jsx("div",{className:"page",children:e.jsx(f,{variant:"destructive",children:e.jsx(g,{children:"Failed to load conferences. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Conferences"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse accepted papers from major AI conferences, grouped by research area and task."}),e.jsxs("div",{className:"conference-deadlines-link",children:["Find deadlines for upcoming conferences"," ",e.jsx(d,{to:"/ai-deadlines",className:"underline underline-offset-2 hover:text-foreground",children:"here"}),". Conference information is based on"," ",e.jsx("a",{href:"https://huggingface.co/ai-conferences",target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:"Hugging Face AI Conferences"}),"."]})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:2}).map((t,s)=>e.jsxs("div",{children:[e.jsx(m,{className:"h-8 w-24 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:3}).map((n,i)=>e.jsx(m,{className:"h-32"},i))})]},s))}):a==null?void 0:a.map(({year:t,conferences:s})=>{const n=s.reduce((o,l)=>o+(l.paper_count??0),0),i=t>0?String(t):"Unknown year";return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:N,children:[e.jsx("div",{children:e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:i})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[s.length," ",s.length===1?"conference":"conferences"," ·"," ",n.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[s.map(o=>{const l=j(o.start_date,o.end_date),c=[o.venue,o.location].filter(Boolean).join(", ");return e.jsxs(d,{to:`/conferences/${o.slug}`,className:"tag-cell",children:[e.jsx("div",{className:"name",children:o.name}),e.jsxs("div",{className:"meta",style:{display:"flex",flexDirection:"column",gap:4},children:[l&&e.jsx("span",{children:l}),c&&e.jsx("span",{children:c}),e.jsxs("span",{children:[(o.paper_count??0).toLocaleString()," papers"]})]})]},o.id)}),e.jsx(x,{kind:"conference"})]})]},t)})]})};export{F as default};
|
assets/ContributionsPage-C-0arJ2b.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{f as o,j as t,b as n}from"./index-C--7Ookn.js";import{u as c}from"./useInfiniteQuery-DcxJ3elC.js";import{B as d}from"./button-BrPkQ8E2.js";import"./useBaseQuery-CPtz5T_6.js";const h=()=>{var r;const{user:s}=o(),a=c({queryKey:["contributions",s==null?void 0:s.username],queryFn:({pageParam:e})=>n.getMyContributions(e),initialPageParam:void 0,getNextPageParam:e=>e.next_cursor??void 0,enabled:!!(s!=null&&s.can_contribute)}),i=((r=a.data)==null?void 0:r.pages.flatMap(e=>e.events))??[];return s!=null&&s.can_contribute?t.jsxs("div",{className:"page max-w-5xl mx-auto px-4 py-8",children:[t.jsx("h1",{className:"text-3xl font-bold",children:"My contributions"}),t.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Private history for catalog changes made through your contributor account."}),a.isLoading&&t.jsx("p",{className:"mt-8",children:"Loading contributions…"}),a.error&&t.jsx("p",{className:"mt-8 text-destructive",children:"Could not load contribution history."}),t.jsxs("div",{className:"mt-6 space-y-3",children:[i.map(e=>t.jsxs("article",{className:"rounded-md border p-4",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t.jsxs("strong",{children:[e.operation," ",e.entity_type]}),t.jsx("time",{className:"text-xs text-muted-foreground",children:new Date(e.created_at).toLocaleString()})]}),t.jsxs("p",{className:"mt-1 font-mono text-xs text-muted-foreground",children:[e.entity_id," · ",e.id]}),t.jsxs("details",{className:"mt-3 text-xs",children:[t.jsx("summary",{children:"Before / after"}),t.jsx("pre",{className:"mt-2 overflow-auto rounded bg-muted p-3",children:JSON.stringify({before:e.before,after:e.after},null,2)})]})]},e.id)),a.data&&i.length===0&&t.jsx("p",{className:"text-sm text-muted-foreground",children:"No direct edits yet."}),a.hasNextPage&&t.jsx(d,{variant:"outline",onClick:()=>a.fetchNextPage(),disabled:a.isFetchingNextPage,children:a.isFetchingNextPage?"Loading…":"Load older contributions"})]})]}):t.jsxs("div",{className:"page",children:[t.jsx("h1",{children:"Contributions"}),t.jsx("p",{children:"This history is available to project contributors and admins."})]})};export{h as default};
|
|
|
|
|
|
assets/{CronDashboard-BSuTDx3G.js → CronDashboard-BUZ6-TPS.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{c as y,r as x,j as e,v,O as Le,o as Me,n as O,a5 as Pe,Q as Fe,S as Ae,q as z,P as Ee,t as De,T as ae,L as qe,h as Ie,b as M,f as Je}from"./index-
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
@@ -58,4 +58,4 @@ import{c as y,r as x,j as e,v,O as Le,o as Me,n as O,a5 as Pe,Q as Fe,S as Ae,q
|
|
| 58 |
*
|
| 59 |
* This source code is licensed under the ISC license.
|
| 60 |
* See the LICENSE file in the root directory of this source tree.
|
| 61 |
-
*/const Ye=y("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),p=x.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:v("rounded-lg border bg-card text-card-foreground shadow-sm",s),...a}));p.displayName="Card";const j=x.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:v("flex flex-col space-y-1.5 p-6",s),...a}));j.displayName="CardHeader";const f=x.forwardRef(({className:s,...a},r)=>e.jsx("h3",{ref:r,className:v("text-2xl font-semibold leading-none tracking-tight",s),...a}));f.displayName="CardTitle";const T=x.forwardRef(({className:s,...a},r)=>e.jsx("p",{ref:r,className:v("text-sm text-muted-foreground",s),...a}));T.displayName="CardDescription";const g=x.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:v("p-6 pt-0",s),...a}));g.displayName="CardContent";const es=x.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:v("flex items-center p-6 pt-0",s),...a}));es.displayName="CardFooter";var U="Tabs",[ss]=De(U,[ae]),ne=ae(),[as,K]=ss(U),ie=x.forwardRef((s,a)=>{const{__scopeTabs:r,value:t,onValueChange:o,defaultValue:d,orientation:m="horizontal",dir:c,activationMode:n="automatic",...u}=s,l=Le(c),[h,w]=Me({prop:t,onChange:o,defaultProp:d??"",caller:U});return e.jsx(as,{scope:r,baseId:Pe(),value:h,onValueChange:w,orientation:m,dir:l,activationMode:n,children:e.jsx(O.div,{dir:l,"data-orientation":m,...u,ref:a})})});ie.displayName=U;var ce="TabsList",le=x.forwardRef((s,a)=>{const{__scopeTabs:r,loop:t=!0,...o}=s,d=K(ce,r),m=ne(r);return e.jsx(Fe,{asChild:!0,...m,orientation:d.orientation,dir:d.dir,loop:t,children:e.jsx(O.div,{role:"tablist","aria-orientation":d.orientation,...o,ref:a})})});le.displayName=ce;var oe="TabsTrigger",de=x.forwardRef((s,a)=>{const{__scopeTabs:r,value:t,disabled:o=!1,...d}=s,m=K(oe,r),c=ne(r),n=he(m.baseId,t),u=ue(m.baseId,t),l=t===m.value;return e.jsx(Ae,{asChild:!0,...c,focusable:!o,active:l,children:e.jsx(O.button,{type:"button",role:"tab","aria-selected":l,"aria-controls":u,"data-state":l?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:n,...d,ref:a,onMouseDown:z(s.onMouseDown,h=>{!o&&h.button===0&&h.ctrlKey===!1?m.onValueChange(t):h.preventDefault()}),onKeyDown:z(s.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&m.onValueChange(t)}),onFocus:z(s.onFocus,()=>{const h=m.activationMode!=="manual";!l&&!o&&h&&m.onValueChange(t)})})})});de.displayName=oe;var me="TabsContent",xe=x.forwardRef((s,a)=>{const{__scopeTabs:r,value:t,forceMount:o,children:d,...m}=s,c=K(me,r),n=he(c.baseId,t),u=ue(c.baseId,t),l=t===c.value,h=x.useRef(l);return x.useEffect(()=>{const w=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(w)},[]),e.jsx(Ee,{present:o||l,children:({present:w})=>e.jsx(O.div,{"data-state":l?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":n,hidden:!w,id:u,tabIndex:0,...m,ref:a,style:{...s.style,animationDuration:h.current?"0s":void 0},children:w&&d})})});xe.displayName=me;function he(s,a){return`${s}-trigger-${a}`}function ue(s,a){return`${s}-content-${a}`}var rs=ie,pe=le,ge=de,je=xe;const ts=rs,fe=x.forwardRef(({className:s,...a},r)=>e.jsx(pe,{ref:r,className:v("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),...a}));fe.displayName=pe.displayName;const F=x.forwardRef(({className:s,...a},r)=>e.jsx(ge,{ref:r,className:v("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",s),...a}));F.displayName=ge.displayName;const A=x.forwardRef(({className:s,...a},r)=>e.jsx(je,{ref:r,className:v("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...a}));A.displayName=je.displayName;function N(s){if(!s)return"Never";const a=new Date(s);if(Number.isNaN(a.getTime()))return s;const r=Date.now()-a.getTime(),t=Math.floor(r/6e4),o=Math.floor(r/36e5),d=Math.floor(r/864e5);return t<1?"Just now":t<60?`${t}m ago`:o<24?`${o}h ago`:d<7?`${d}d ago`:a.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function ve(s){return s==null?"N/A":s<60?`${s.toFixed(1)}s`:s<3600?`${(s/60).toFixed(1)}m`:`${(s/3600).toFixed(1)}h`}function Ne(s){return s.available?s.status==="completed"?s.conclusion??"completed":s.status??"unknown":"Unavailable"}function be(s){return s.replace(/_/g," ").replace(/\b\w/g,a=>a.toUpperCase())}const ns={healthy:W,degraded:Ye,broken:J,running:R,stuck:J,unknown:Ke};function is({status:s,isRunning:a}){const r=a?"running":s,t=ns[r];return e.jsx(t,{className:`cron-status-icon cron-status--${r}${r==="running"?" animate-spin":""}`})}function ee({icon:s,title:a,metrics:r}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(s,{className:"h-4 w-4"}),e.jsx("h4",{children:a})]}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:Object.entries(r).map(([t,o])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:be(t)}),e.jsx("div",{className:"text-lg font-semibold",children:typeof o=="number"?o.toLocaleString():o})]},t))})]})}function cs({workflow:s}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(H,{className:"h-4 w-4"}),e.jsx("h4",{children:"GitHub Actions"})]}),e.jsxs("div",{className:"cron-metric-card space-y-2 text-sm",children:[[["Workflow",s.workflow_file],["Run",s.run_id??"N/A"],["Status",Ne(s)],...s.updated_at?[["Updated",N(s.updated_at)]]:[]].map(([a,r])=>e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"cron-label",children:a}),e.jsx("span",{className:a==="Workflow"?"font-mono text-xs":void 0,children:r})]},a)),s.failed_jobs&&s.failed_jobs.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cron-label mb-1",children:"Failed jobs"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:s.failed_jobs.map(a=>e.jsx(_,{variant:"outline",className:"cron-status--broken",children:a},a))})]}),s.job_conclusions&&Object.keys(s.job_conclusions).length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cron-label mb-1",children:"Job conclusions"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:Object.entries(s.job_conclusions).map(([a,r])=>e.jsxs(_,{variant:"outline",children:[a,": ",r??"running"]},a))})]}),(s.error||s.view_error)&&e.jsx("div",{className:"cron-message cron-message--error",children:s.error??s.view_error})]})]})}function ls(s){return s==="COMPLETED"?"cron-status--healthy":s==="ERROR"||s==="CANCELED"?"cron-status--broken":s==="RUNNING"?"cron-status--running":"cron-status--unknown"}function os({job:s}){const a=s.progress,r=a!=null&&a.total_papers?Math.min(100,a.processed_papers/a.total_papers*100):0;return e.jsxs("div",{className:"cron-metric-card space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"font-semibold",children:[s.mode??"unknown"," · shard ",s.shard_id??"N/A"]}),e.jsx("div",{className:"font-mono text-xs cron-muted truncate",children:s.id})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{variant:"outline",className:ls(s.stage),children:s.stage.toLowerCase()}),s.url&&e.jsx("a",{href:s.url,target:"_blank",rel:"noreferrer","aria-label":`Open Hugging Face Job ${s.id}`,className:"cron-info-text",children:e.jsx(re,{className:"h-4 w-4"})})]})]}),a?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between gap-3 text-xs cron-muted mb-1",children:[e.jsxs("span",{children:[a.processed_papers.toLocaleString()," / ",a.total_papers.toLocaleString()," papers"]}),e.jsxs("span",{children:[r.toFixed(0),"%"]})]}),e.jsx("div",{className:"cron-progress-track",children:e.jsx("div",{className:"cron-progress-value",style:{width:`${r}%`}})})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-sm",children:[e.jsxs("span",{children:[e.jsx("strong",{children:a.succeeded_papers.toLocaleString()})," succeeded"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.failed_papers.toLocaleString()})," failed"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.already_existed_papers.toLocaleString()})," skipped"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.extracted_images.toLocaleString()})," images"]})]}),a.updated_at&&e.jsxs("div",{className:"text-xs cron-muted",children:["Progress updated ",N(a.updated_at)]}),(a.fatal_error||a.error_samples.length>0)&&e.jsxs("div",{className:"cron-message cron-message--error space-y-1",children:[a.fatal_error&&e.jsx("div",{children:a.fatal_error}),a.error_samples.map(t=>e.jsxs("div",{children:[e.jsx("span",{className:"font-mono",children:t.arxiv_id}),": ",t.error]},`${t.arxiv_id}:${t.error}`))]})]}):e.jsx("div",{className:"text-sm cron-muted",children:"Waiting for the shard progress checkpoint."}),e.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs cron-muted",children:[s.hardware&&e.jsx("span",{children:s.hardware}),s.created_at&&e.jsxs("span",{children:["Created ",N(s.created_at)]}),s.duration_seconds!=null&&e.jsxs("span",{children:["Duration ",ve(s.duration_seconds)]})]}),s.stage_message&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.stage_message})]})}function ds({monitor:s,loading:a,error:r}){return e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(Xe,{className:"h-4 w-4"}),e.jsx("h4",{children:"Hugging Face OCR shards"})]}),a&&e.jsxs("div",{className:"cron-metric-card flex items-center gap-2 text-sm cron-muted",children:[e.jsx(R,{className:"h-4 w-4 animate-spin"})," Loading remote Jobs…"]}),r&&e.jsx("div",{className:"cron-message cron-message--error",children:"Could not load Hugging Face Jobs."}),s&&!s.available&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.error??"Hugging Face monitoring is unavailable."}),(s==null?void 0:s.available)&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-3",children:Object.entries(s.summary).map(([t,o])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:be(t)}),e.jsx("div",{className:"text-lg font-semibold",children:o.toLocaleString()})]},t))}),s.jobs.length===0?e.jsx("div",{className:"cron-metric-card text-sm cron-muted",children:"No OCR shards have been launched yet."}):e.jsx("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-3",children:s.jobs.map(t=>e.jsx(os,{job:t},t.id))})]})]})}function ms({job:s,expanded:a,onToggle:r,paperMarkdownJobs:t,paperMarkdownJobsLoading:o=!1,paperMarkdownJobsError:d=null}){const m=!!(s.work_metrics&&Object.keys(s.work_metrics).length),c=!!(s.db_metrics&&Object.keys(s.db_metrics).length),n=s.job_name==="paper_markdown_backfill",u=m||c||!!s.workflow_status||n;return e.jsxs("div",{className:"cron-job-card",children:[e.jsx("button",{type:"button",className:"cron-job-summary",onClick:r,"aria-expanded":a,children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[e.jsx(is,{status:s.status,isRunning:s.is_running}),e.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[e.jsx("h3",{className:"font-semibold",children:s.display_name}),s.critical&&e.jsx(_,{variant:"outline",className:"text-[10px] uppercase tracking-wide",children:"Critical"}),s.lock_stale&&e.jsx(_,{variant:"outline",className:"cron-status--broken",children:"Stale lock"}),u&&(a?e.jsx(We,{className:"h-4 w-4 cron-muted"}):e.jsx(Oe,{className:"h-4 w-4 cron-muted"}))]}),e.jsx("p",{className:"text-sm cron-muted mb-2",children:s.status_reason}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-2 text-sm cron-muted",children:[e.jsxs("span",{className:"cron-fact",children:[e.jsx(te,{}),"Log: ",N(s.last_run)]}),e.jsxs("span",{className:"cron-fact",children:[e.jsx(G,{}),"DB: ",N(s.last_db_write)]}),s.recent_write_count!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(Ze,{}),"Recent writes: ",s.recent_write_count.toLocaleString()]}),s.duration!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(H,{}),"Duration: ",ve(s.duration)]}),s.schedule&&e.jsxs("span",{className:"cron-fact md:col-span-2",children:[e.jsx(Be,{}),e.jsx("span",{className:"font-mono text-xs",children:s.schedule})]}),s.log_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(Y,{}),"Log status: ",s.log_status]}),s.workflow_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(H,{}),"Actions: ",Ne(s.workflow_status)]})]}),s.work_summary&&e.jsx("div",{className:"cron-message",children:s.work_summary}),s.error&&e.jsxs("div",{className:"cron-message cron-message--error",children:[e.jsx("strong",{children:"Error: "}),s.error]}),s.diagnostics&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.diagnostics})]})]}),e.jsx(_,{variant:"outline",className:`cron-status--${s.status}`,children:s.status})]})}),a&&u&&e.jsx("div",{className:"cron-job-details",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.work_metrics&&m&&e.jsx(ee,{icon:Y,title:"Log Metrics",metrics:s.work_metrics}),s.db_metrics&&c&&e.jsx(ee,{icon:G,title:"Database Metrics",metrics:s.db_metrics}),s.workflow_status&&e.jsx(cs,{workflow:s.workflow_status}),n&&e.jsx(ds,{monitor:t,loading:o,error:d})]})})]})}const ye=x.forwardRef(({className:s,...a},r)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:r,className:v("w-full caption-bottom text-sm",s),...a})}));ye.displayName="Table";const _e=x.forwardRef(({className:s,...a},r)=>e.jsx("thead",{ref:r,className:v("[&_tr]:border-b",s),...a}));_e.displayName="TableHeader";const we=x.forwardRef(({className:s,...a},r)=>e.jsx("tbody",{ref:r,className:v("[&_tr:last-child]:border-0",s),...a}));we.displayName="TableBody";const xs=x.forwardRef(({className:s,...a},r)=>e.jsx("tfoot",{ref:r,className:v("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...a}));xs.displayName="TableFooter";const B=x.forwardRef(({className:s,...a},r)=>e.jsx("tr",{ref:r,className:v("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",s),...a}));B.displayName="TableRow";const $=x.forwardRef(({className:s,...a},r)=>e.jsx("th",{ref:r,className:v("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",s),...a}));$.displayName="TableHead";const L=x.forwardRef(({className:s,...a},r)=>e.jsx("td",{ref:r,className:v("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...a}));L.displayName="TableCell";const hs=x.forwardRef(({className:s,...a},r)=>e.jsx("caption",{ref:r,className:v("mt-4 text-sm text-muted-foreground",s),...a}));hs.displayName="TableCaption";const us={queued:"cron-status--unknown",dispatching:"cron-status--running",running:"cron-status--running",completed:"cron-status--healthy",failed:"cron-status--broken",canceled:"cron-status--unknown"},ps={"add-evals":"Add evals","enrich-paper":"Enrich paper"},gs={queued:Ge,dispatching:R,running:Qe,completed:W,failed:J,canceled:Ve};function js({status:s}){const a=gs[s];return e.jsxs(_,{variant:"outline",className:us[s],children:[e.jsx(a,{className:`mr-1 h-3.5 w-3.5 ${s==="dispatching"?"animate-spin":""}`}),s]})}function fs(s){return s.error?s.error:s.report?s.report:s.status==="completed"&&s.applied_at?"Changes applied to the paper.":s.status==="completed"?"Completed without a recorded mutation.":null}function vs({autoRefresh:s,refreshToken:a}){const{data:r,isLoading:t,isFetching:o,error:d}=I({queryKey:["codexPaperJobs",a],queryFn:()=>He(100),refetchInterval:s?1e4:!1,retry:!1}),m=d&&typeof d=="object"&&"status"in d?d.status:void 0;return e.jsxs(p,{className:"mb-8",children:[e.jsx(j,{children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(f,{className:"text-xl",children:"Codex paper jobs"}),e.jsx(T,{children:"Durable queue and execution history for admin-triggered Hugging Face Jobs"})]}),o&&!t&&e.jsxs("span",{className:"flex items-center gap-2 text-xs cron-muted",children:[e.jsx(R,{className:"h-3.5 w-3.5 animate-spin"})," Syncing with Hugging Face"]})]})}),e.jsxs(g,{children:[t&&e.jsxs("div",{className:"flex items-center justify-center py-10 cron-muted",children:[e.jsx(R,{className:"mr-2 h-5 w-5 animate-spin"})," Loading paper jobs…"]}),d&&m!==404&&e.jsx("div",{className:"cron-message cron-message--error mb-4",children:d instanceof Error?d.message:"Could not load Codex paper jobs."}),m===404&&e.jsx("p",{className:"py-4 text-sm cron-muted",children:"Codex paper jobs are not enabled in this environment."}),r&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-5 grid grid-cols-2 gap-3 sm:grid-cols-4 lg:grid-cols-7",children:[["queued","dispatching","running","completed","failed","canceled"].map(c=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label capitalize",children:c}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:r.summary[c]})]},c)),e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:"Total"}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:r.summary.total})]})]}),r.jobs.length===0?e.jsx("p",{className:"py-8 text-center text-sm cron-muted",children:"No paper curation jobs have been submitted yet."}):e.jsxs(ye,{children:[e.jsx(_e,{children:e.jsxs(B,{children:[e.jsx($,{children:"Status"}),e.jsx($,{children:"Paper"}),e.jsx($,{children:"Action"}),e.jsx($,{children:"Requested"}),e.jsx($,{children:"Execution"})]})}),e.jsx(we,{children:r.jobs.map(c=>{const n=fs(c);return e.jsxs(B,{children:[e.jsx(L,{className:"align-top",children:e.jsx(js,{status:c.status})}),e.jsxs(L,{className:"min-w-[260px] align-top",children:[e.jsx(qe,{to:`/paper/${encodeURIComponent(c.paper_route)}`,className:"font-medium hover:underline",children:c.paper_title}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Paper #",c.paper_id]})]}),e.jsxs(L,{className:"whitespace-nowrap align-top",children:[ps[c.kind],c.applied_at&&e.jsxs("div",{className:"mt-1 flex items-center gap-1 text-xs cron-status--healthy",children:[e.jsx(W,{className:"h-3.5 w-3.5"})," Applied"]})]}),e.jsxs(L,{className:"whitespace-nowrap align-top",children:[e.jsx("div",{children:N(c.created_at)}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["@",c.requested_by]})]}),e.jsxs(L,{className:"max-w-[360px] align-top",children:[c.hf_job_url?e.jsxs("a",{href:c.hf_job_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 hover:underline",children:["Hugging Face Job ",e.jsx(re,{className:"h-3.5 w-3.5"})]}):e.jsx("span",{className:"cron-muted",children:"Waiting to dispatch"}),n&&e.jsx("p",{className:`mt-2 line-clamp-3 text-xs ${c.error?"text-red-700":"cron-muted"}`,title:n,children:n})]})]},c.id)})})]}),e.jsxs("p",{className:"mt-4 text-xs cron-muted",children:["Showing the 100 most recent jobs · Queue totals include full history · Updated ",N(r.timestamp)]})]})]})]})}const Ns=()=>{var d,m,c;const s=Ie(),a=ze({queryKey:["catalog-audit"],queryFn:({pageParam:n})=>M.getCatalogAudit(n),initialPageParam:void 0,getNextPageParam:n=>n.next_cursor??void 0}),r=((d=a.data)==null?void 0:d.pages.flatMap(n=>n.events))??[],t=Z({mutationFn:()=>M.acknowledgeCatalogAudit(),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})}),o=Z({mutationFn:n=>M.rollbackCatalogEvent(n),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})});return e.jsx("div",{className:"space-y-4",children:e.jsxs(p,{children:[e.jsxs(j,{className:"flex-row items-center justify-between",children:[e.jsx(f,{children:"Catalog mutation audit"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm font-medium",children:[((c=(m=a.data)==null?void 0:m.pages[0])==null?void 0:c.unread_contributor_count)??0," unread contributor changes"]}),e.jsx(P,{variant:"outline",size:"sm",onClick:()=>t.mutate(),disabled:t.isPending,children:"Mark read"})]})]}),e.jsxs(g,{className:"space-y-3",children:[a.isLoading&&e.jsx("p",{children:"Loading audit history…"}),a.error&&e.jsx("p",{className:"text-destructive",children:"Audit history unavailable."}),r.map(n=>e.jsxs("article",{className:`rounded-md border p-3 ${n.operation==="delete"||n.rollback_eligible===!1?"border-red-500 bg-red-50/50":""}`,children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("strong",{children:[n.operation," ",n.entity_type," ",n.entity_id]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["@",n.actor_username??n.actor_role," ·"," ",new Date(n.created_at).toLocaleString()]})]}),e.jsxs("details",{className:"mt-2 text-xs",children:[e.jsx("summary",{children:"Inspect snapshots"}),e.jsx("pre",{className:"mt-2 max-h-80 overflow-auto rounded bg-muted p-3",children:JSON.stringify({before:n.before,after:n.after},null,2)})]}),!n.rollback_of_event_id&&e.jsx(P,{className:"mt-3",variant:"outline",size:"sm",onClick:()=>o.mutate(n.id),disabled:o.isPending||n.rollback_eligible===!1,children:n.rollback_eligible===!1?"Rollback conflict":"Roll back if unchanged"})]},n.id)),a.hasNextPage&&e.jsx(P,{variant:"outline",onClick:()=>a.fetchNextPage(),disabled:a.isFetchingNextPage,children:a.isFetchingNextPage?"Loading…":"Load older events"})]})]})})},se={hourly:"cron-status--running",daily:"cron-status--healthy",weekly:"cron-status--degraded"},b=s=>`$${(s/1e6).toFixed(2)}`,bs=({data:s,loading:a,error:r})=>{const[t,o]=x.useState("staging-current"),d={"staging-current":"Starter staging · $75 warning / $100 trip / no Environment cap","staging-production-era":"Staging with production · $15 / $20 / $25",production:"Production · $175 / $200 / $225"};if(a)return e.jsxs("div",{className:"flex items-center py-12",children:[e.jsx(R,{className:"h-6 w-6 animate-spin mr-3"}),"Loading chat compute…"]});if(r||!s)return e.jsx(p,{className:"cron-status--broken",children:e.jsx(g,{className:"pt-6",children:"Chat compute accounting is unavailable."})});const m=Math.min(100,s.effective_microusd/s.application_cap_microusd*100),c=s.circuit_state==="tripped"?"Chat disabled":s.circuit_state==="warning"?"Operator warning":"Enabled",n=s.reconciliation_state==="fresh"?"Fresh":s.reconciliation_state==="stale"?"Stale":"Unavailable";return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid md:grid-cols-4 gap-4",children:[e.jsxs(p,{className:s.circuit_state==="tripped"?"cron-status--broken":s.circuit_state==="warning"?"cron-status--degraded":"",children:[e.jsx(j,{children:e.jsx(f,{className:"text-sm",children:"Circuit"})}),e.jsxs(g,{children:[e.jsx("div",{className:"text-2xl font-bold",children:c}),e.jsx("p",{className:"text-xs cron-muted",children:s.trip_reason??"Policy armed"})]})]}),e.jsxs(p,{children:[e.jsx(j,{children:e.jsx(f,{className:"text-sm",children:"Month to date"})}),e.jsxs(g,{children:[e.jsx("div",{className:"text-2xl font-bold",children:b(s.effective_microusd)}),e.jsx("div",{role:"progressbar","aria-label":"Application cap used","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(m),className:"h-2 rounded bg-muted mt-3",children:e.jsx("div",{className:"h-2 rounded bg-primary",style:{width:`${m}%`}})})]})]}),e.jsxs(p,{children:[e.jsx(j,{children:e.jsx(f,{className:"text-sm",children:"Application headroom"})}),e.jsxs(g,{children:[e.jsx("div",{className:"text-2xl font-bold",children:b(s.remaining_microusd)}),e.jsxs("p",{className:"text-xs cron-muted",children:["Cap ",b(s.application_cap_microusd)]})]})]}),e.jsxs(p,{children:[e.jsx(j,{children:e.jsx(f,{className:"text-sm",children:"Live compute"})}),e.jsxs(g,{children:[e.jsx("div",{className:"text-2xl font-bold",children:s.live_count}),e.jsxs("p",{className:"text-xs cron-muted",children:[s.termination_uncertain_count," termination uncertain"]})]})]})]}),e.jsxs(p,{children:[e.jsxs(j,{children:[e.jsx(f,{children:"Accounting and policy"}),e.jsxs(T,{children:[s.environment," · cycle ",s.billing_cycle]})]}),e.jsxs(g,{className:"grid md:grid-cols-3 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Environment record"}),e.jsx("br",{}),s.environment," · ",s.provider_mode==="starter_workspace"?"Starter Workspace":"Team isolated"]}),e.jsxs("label",{children:[e.jsx("strong",{children:"Policy profile"}),e.jsxs("select",{"aria-label":"Chat compute policy profile",value:t,onChange:u=>o(u.target.value),className:"block mt-1",children:[e.jsx("option",{value:"staging-current",children:"Staging now"}),e.jsx("option",{value:"staging-production-era",children:"Staging with production"}),e.jsx("option",{value:"production",children:"Production"})]}),e.jsxs("span",{className:"text-xs cron-muted",children:[d[t]," · Workspace $250"]})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Conservative estimate"}),e.jsx("br",{}),b(s.estimated_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider-reported floor"}),e.jsx("br",{}),b(s.provider_floor_microusd)," · ",e.jsx(_,{children:n})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider backstops"}),e.jsx("br",{}),s.environment_cap_microusd===null?"Starter: no Environment cap":`Environment ${b(s.environment_cap_microusd)}`," · Workspace ",b(s.workspace_cap_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Active thresholds"}),e.jsx("br",{}),"Warning ",b(s.warning_microusd)," · trip ",b(s.application_cap_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Policy allocation"}),e.jsx("br",{}),"Starter staging $75/$100 with no Environment cap · future Team staging $15/$20/$25 · production $175/$200/$225 · workspace $250"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Cycle end"}),e.jsx("br",{}),N(s.cycle_end_at)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Last metered"}),e.jsx("br",{}),s.last_metered_at?N(s.last_metered_at):"Unavailable"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider reconciliation"}),e.jsx("br",{}),s.last_reconciled_at?N(s.last_reconciled_at):"Unavailable",s.last_reconciliation_attempt_at?` · attempted ${N(s.last_reconciliation_attempt_at)}`:"",s.next_reconciliation_at?` · next ${N(s.next_reconciliation_at)}`:""]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Burn projection"}),e.jsx("br",{}),s.burn_rate_microusd_per_hour===null?"Not enough data":`${b(s.burn_rate_microusd_per_hour)}/hour${s.projected_cap_hit_at?` · cap ${N(s.projected_cap_hit_at)}`:""}`]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Prior cycle"}),e.jsx("br",{}),s.prior_cycle?`${s.prior_cycle.billing_cycle} · ${b(s.prior_cycle.effective_microusd)}`:"Not enough data"]})]})]}),e.jsxs(p,{children:[e.jsx(j,{children:e.jsx(f,{children:"Live lifecycle"})}),e.jsx(g,{className:"text-sm",children:Object.entries(s.live_states).map(([u,l])=>e.jsxs("span",{className:"mr-4",children:[u,": ",l]},u))})]}),e.jsxs(p,{children:[e.jsx(j,{children:e.jsx(f,{children:"Daily spend"})}),e.jsx(g,{children:s.daily_spend.length?e.jsx("ul",{className:"space-y-1 text-sm",children:s.daily_spend.map(u=>e.jsxs("li",{children:[u.date,": blank ",b(u.blank_pool_microusd)," · assigned ",b(u.assigned_microusd)]},u.date))}):e.jsx("p",{className:"cron-muted",children:"No compute recorded in this cycle."})})]}),e.jsxs(p,{children:[e.jsxs(j,{children:[e.jsx(f,{children:"Recent circuit events"}),e.jsx(T,{children:"Runbook: docs/chat-sandbox-spend-runbook.md"})]}),e.jsx(g,{children:s.events.length?e.jsx("ul",{className:"space-y-2 text-sm",children:s.events.map(u=>e.jsxs("li",{children:[e.jsx(_,{children:u.severity})," ",u.type," · ",N(u.created_at)]},u.id))}):e.jsx("p",{className:"cron-muted",children:"No events in this cycle."})})]})]})},As=()=>{const[s,a]=x.useState(!0),[r,t]=x.useState(0),[o,d]=x.useState(""),[m,c]=x.useState(""),[n,u]=x.useState(new Set),{user:l}=Je(),{data:h,isLoading:w,isFetching:Q,error:C,refetch:ke}=I({queryKey:["cronStatus",l==null?void 0:l.username],queryFn:()=>M.getCronStatus(),enabled:!!(l!=null&&l.is_admin),refetchInterval:s?3e4:!1,retry:!1}),E=I({queryKey:["paperMarkdownJobs",l==null?void 0:l.username],queryFn:()=>M.getPaperMarkdownJobs(),enabled:!!(l!=null&&l.is_admin),refetchInterval:s?3e4:!1,retry:!1}),D=I({queryKey:["chatSandboxSpend",l==null?void 0:l.username,m],queryFn:()=>M.getChatSandboxSpend(m||void 0),enabled:!!(l!=null&&l.is_admin),refetchInterval:s?3e4:!1,retry:!1}),Ce=(C&&typeof C=="object"&&"status"in C?C.status:void 0)===401?"Unauthorized. Sign in with an allowlisted Hugging Face admin account.":C instanceof Error?C.message:void 0,Se=i=>{u(k=>{const S=new Set(k);return S.has(i)?S.delete(i):S.add(i),S})},Te=(h==null?void 0:h.jobs.filter(i=>i.critical))??[],q=((h==null?void 0:h.jobs.filter(i=>!i.critical))??[]).reduce((i,k)=>(i[k.category]||(i[k.category]=[]),i[k.category].push(k),i),{}),Re=Object.keys(q).sort((i,k)=>{const S=["hourly","daily","weekly"];return S.indexOf(i)-S.indexOf(k)}),V=i=>e.jsx(ms,{job:i,expanded:n.has(i.job_name),onToggle:()=>Se(i.job_name),paperMarkdownJobs:i.job_name==="paper_markdown_backfill"?E.data:void 0,paperMarkdownJobsLoading:i.job_name==="paper_markdown_backfill"?E.isLoading:!1,paperMarkdownJobsError:i.job_name==="paper_markdown_backfill"?E.error:null},i.job_name),$e=()=>{t(i=>i+1),ke(),E.refetch(),D.refetch()};return e.jsx("div",{className:"cron-dashboard","data-shadcn":!0,children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[e.jsx("div",{className:"mb-8",children:e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-3xl font-bold flex items-center gap-3",children:[e.jsx(H,{className:"h-8 w-8 cron-info-text"}),"Admin Dashboard"]}),e.jsx("p",{className:"mt-2 cron-muted",children:"Paper curation queue and operational health for scheduled jobs"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(P,{variant:"outline",size:"sm",onClick:()=>a(!s),className:s?"cron-status--running":"",children:[e.jsx(X,{className:`h-4 w-4 mr-2 ${s?"animate-spin":""}`}),"Auto-refresh ",s?"ON":"OFF"]}),e.jsxs(P,{variant:"outline",size:"sm",onClick:$e,disabled:Q,children:[e.jsx(X,{className:`h-4 w-4 mr-2 ${Q?"animate-spin":""}`}),"Refresh"]})]})]})}),e.jsx(p,{className:"mb-6",children:e.jsx(g,{className:"pt-6",children:e.jsxs("p",{className:"text-sm cron-muted",children:["Signed in as ",e.jsxs("span",{className:"font-semibold",children:["@",l==null?void 0:l.username]}),". Health checks prefer database freshness over log completion so silent no-work failures surface as degraded or broken."]})})}),e.jsxs(ts,{defaultValue:"critical-jobs",children:[e.jsxs(fe,{className:"grid w-full grid-cols-4 sm:w-auto",children:[e.jsx(F,{value:"critical-jobs",children:"Critical Jobs"}),e.jsx(F,{value:"codex-paper-jobs",children:"Codex Paper Jobs"}),e.jsx(F,{value:"catalog-audit",children:"Catalog Audit"}),e.jsx(F,{value:"chat-compute",children:"Chat Compute"})]}),e.jsxs(A,{value:"critical-jobs",className:"mt-6",children:[w&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(R,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading CRON jobs status..."})]}),C&&e.jsx(p,{className:"cron-status--broken",children:e.jsx(g,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(J,{className:"h-5 w-5"}),e.jsx("p",{children:Ce??"Failed to load CRON jobs status. Please try again."})]})})}),h&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4 mb-6",children:["healthy","degraded","broken","running","stuck","unknown"].map(i=>e.jsxs(p,{children:[e.jsx(j,{className:"pb-2",children:e.jsx(f,{className:"text-sm font-medium cron-muted capitalize",children:i})}),e.jsx(g,{children:e.jsx("div",{className:"text-2xl font-bold",children:h.summary[i]})})]},i))}),h.summary.critical_issues.length>0&&e.jsxs(p,{className:"mb-6 cron-status--broken",children:[e.jsx(j,{children:e.jsxs(f,{className:"flex items-center gap-2",children:[e.jsx(Ue,{className:"h-5 w-5"}),"Critical job issues"]})}),e.jsx(g,{children:e.jsx("ul",{className:"list-disc pl-5 space-y-1 text-sm",children:h.summary.critical_issues.map(i=>e.jsx("li",{children:i},i))})})]}),e.jsxs(p,{className:"mb-8",children:[e.jsx(j,{children:e.jsx(f,{className:"text-base",children:"What to check next"})}),e.jsxs(g,{children:[e.jsx("p",{className:"text-sm cron-muted",children:h.summary.what_to_check_next}),e.jsxs("p",{className:"mt-2 text-xs cron-muted flex items-center gap-2",children:[e.jsx(te,{className:"h-4 w-4"}),"Last updated: ",N(h.timestamp)," · Health score:"," ",h.summary.health_score.toFixed(0),"%"]})]})]}),e.jsxs(p,{className:"mb-8",children:[e.jsxs(j,{children:[e.jsx(f,{className:"text-xl",children:"Critical jobs"}),e.jsx(T,{children:"Writers whose stale output breaks the live site"})]}),e.jsx(g,{className:"space-y-4",children:Te.map(V)})]}),e.jsx("div",{className:"space-y-6",children:Re.map(i=>e.jsxs(p,{children:[e.jsx(j,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(f,{className:"text-xl capitalize flex items-center gap-2",children:[e.jsx(_,{className:se[i]??se.hourly,children:i}),e.jsx("span",{children:"Supporting jobs"})]}),e.jsxs(T,{children:[q[i].length," job",q[i].length!==1?"s":""]})]})}),e.jsx(g,{className:"space-y-4",children:q[i].map(V)})]},i))})]})]}),e.jsx(A,{value:"codex-paper-jobs",className:"mt-6",children:e.jsx(vs,{autoRefresh:s,refreshToken:r})}),e.jsx(A,{value:"catalog-audit",className:"mt-6",children:e.jsx(Ns,{})}),e.jsxs(A,{value:"chat-compute",className:"mt-6",children:[e.jsxs(p,{className:"mb-6",children:[e.jsxs(j,{children:[e.jsx(f,{children:"Environment record"}),e.jsx(T,{children:"Leave blank for live staging, or enter the isolated environment printed by the spend qualification command."})]}),e.jsxs(g,{className:"flex gap-2",children:[e.jsx("input",{"aria-label":"Chat compute environment record",value:o,onChange:i=>d(i.target.value),placeholder:"staging-q-example",className:"flex-1 rounded border px-3 py-2"}),e.jsx(P,{onClick:()=>c(o.trim()),children:"Load"})]})]}),e.jsx(bs,{data:D.data,loading:D.isLoading,error:D.error})]})]})]})})};export{bs as ChatComputePanel,As as default};
|
|
|
|
| 1 |
+
import{c as y,r as x,j as e,v,O as Le,o as Me,n as O,a5 as Pe,Q as Fe,S as Ae,q as z,P as Ee,t as De,T as ae,L as qe,h as Ie,b as M,f as Je}from"./index-ChUK4pXW.js";import{u as I}from"./useQuery-CKrTCSf-.js";import{B as _,D as G,f as He}from"./codexAddEvals-CZQR6KmV.js";import{B as P}from"./button-349xR3H5.js";import{C as Oe}from"./chevron-down-D7P4cpJd.js";import{C as J,a as W,R as X,S as Ue}from"./shield-alert-DSwodPNj.js";import{L as R}from"./loader-circle-DM3sTtAh.js";import{E as re}from"./external-link-CF9iDKKZ.js";import{u as Z}from"./useMutation-BgE1BvtL.js";import{u as ze}from"./useInfiniteQuery-DflNwjnr.js";/**
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 58 |
*
|
| 59 |
* This source code is licensed under the ISC license.
|
| 60 |
* See the LICENSE file in the root directory of this source tree.
|
| 61 |
+
*/const Ye=y("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),p=x.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:v("rounded-lg border bg-card text-card-foreground shadow-sm",s),...a}));p.displayName="Card";const j=x.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:v("flex flex-col space-y-1.5 p-6",s),...a}));j.displayName="CardHeader";const f=x.forwardRef(({className:s,...a},r)=>e.jsx("h3",{ref:r,className:v("text-2xl font-semibold leading-none tracking-tight",s),...a}));f.displayName="CardTitle";const T=x.forwardRef(({className:s,...a},r)=>e.jsx("p",{ref:r,className:v("text-sm text-muted-foreground",s),...a}));T.displayName="CardDescription";const g=x.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:v("p-6 pt-0",s),...a}));g.displayName="CardContent";const es=x.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:v("flex items-center p-6 pt-0",s),...a}));es.displayName="CardFooter";var U="Tabs",[ss]=De(U,[ae]),ne=ae(),[as,K]=ss(U),ie=x.forwardRef((s,a)=>{const{__scopeTabs:r,value:t,onValueChange:o,defaultValue:d,orientation:m="horizontal",dir:c,activationMode:n="automatic",...u}=s,l=Le(c),[h,w]=Me({prop:t,onChange:o,defaultProp:d??"",caller:U});return e.jsx(as,{scope:r,baseId:Pe(),value:h,onValueChange:w,orientation:m,dir:l,activationMode:n,children:e.jsx(O.div,{dir:l,"data-orientation":m,...u,ref:a})})});ie.displayName=U;var ce="TabsList",le=x.forwardRef((s,a)=>{const{__scopeTabs:r,loop:t=!0,...o}=s,d=K(ce,r),m=ne(r);return e.jsx(Fe,{asChild:!0,...m,orientation:d.orientation,dir:d.dir,loop:t,children:e.jsx(O.div,{role:"tablist","aria-orientation":d.orientation,...o,ref:a})})});le.displayName=ce;var oe="TabsTrigger",de=x.forwardRef((s,a)=>{const{__scopeTabs:r,value:t,disabled:o=!1,...d}=s,m=K(oe,r),c=ne(r),n=he(m.baseId,t),u=ue(m.baseId,t),l=t===m.value;return e.jsx(Ae,{asChild:!0,...c,focusable:!o,active:l,children:e.jsx(O.button,{type:"button",role:"tab","aria-selected":l,"aria-controls":u,"data-state":l?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:n,...d,ref:a,onMouseDown:z(s.onMouseDown,h=>{!o&&h.button===0&&h.ctrlKey===!1?m.onValueChange(t):h.preventDefault()}),onKeyDown:z(s.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&m.onValueChange(t)}),onFocus:z(s.onFocus,()=>{const h=m.activationMode!=="manual";!l&&!o&&h&&m.onValueChange(t)})})})});de.displayName=oe;var me="TabsContent",xe=x.forwardRef((s,a)=>{const{__scopeTabs:r,value:t,forceMount:o,children:d,...m}=s,c=K(me,r),n=he(c.baseId,t),u=ue(c.baseId,t),l=t===c.value,h=x.useRef(l);return x.useEffect(()=>{const w=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(w)},[]),e.jsx(Ee,{present:o||l,children:({present:w})=>e.jsx(O.div,{"data-state":l?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":n,hidden:!w,id:u,tabIndex:0,...m,ref:a,style:{...s.style,animationDuration:h.current?"0s":void 0},children:w&&d})})});xe.displayName=me;function he(s,a){return`${s}-trigger-${a}`}function ue(s,a){return`${s}-content-${a}`}var rs=ie,pe=le,ge=de,je=xe;const ts=rs,fe=x.forwardRef(({className:s,...a},r)=>e.jsx(pe,{ref:r,className:v("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),...a}));fe.displayName=pe.displayName;const F=x.forwardRef(({className:s,...a},r)=>e.jsx(ge,{ref:r,className:v("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",s),...a}));F.displayName=ge.displayName;const A=x.forwardRef(({className:s,...a},r)=>e.jsx(je,{ref:r,className:v("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...a}));A.displayName=je.displayName;function N(s){if(!s)return"Never";const a=new Date(s);if(Number.isNaN(a.getTime()))return s;const r=Date.now()-a.getTime(),t=Math.floor(r/6e4),o=Math.floor(r/36e5),d=Math.floor(r/864e5);return t<1?"Just now":t<60?`${t}m ago`:o<24?`${o}h ago`:d<7?`${d}d ago`:a.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function ve(s){return s==null?"N/A":s<60?`${s.toFixed(1)}s`:s<3600?`${(s/60).toFixed(1)}m`:`${(s/3600).toFixed(1)}h`}function Ne(s){return s.available?s.status==="completed"?s.conclusion??"completed":s.status??"unknown":"Unavailable"}function be(s){return s.replace(/_/g," ").replace(/\b\w/g,a=>a.toUpperCase())}const ns={healthy:W,degraded:Ye,broken:J,running:R,stuck:J,unknown:Ke};function is({status:s,isRunning:a}){const r=a?"running":s,t=ns[r];return e.jsx(t,{className:`cron-status-icon cron-status--${r}${r==="running"?" animate-spin":""}`})}function ee({icon:s,title:a,metrics:r}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(s,{className:"h-4 w-4"}),e.jsx("h4",{children:a})]}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:Object.entries(r).map(([t,o])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:be(t)}),e.jsx("div",{className:"text-lg font-semibold",children:typeof o=="number"?o.toLocaleString():o})]},t))})]})}function cs({workflow:s}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(H,{className:"h-4 w-4"}),e.jsx("h4",{children:"GitHub Actions"})]}),e.jsxs("div",{className:"cron-metric-card space-y-2 text-sm",children:[[["Workflow",s.workflow_file],["Run",s.run_id??"N/A"],["Status",Ne(s)],...s.updated_at?[["Updated",N(s.updated_at)]]:[]].map(([a,r])=>e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"cron-label",children:a}),e.jsx("span",{className:a==="Workflow"?"font-mono text-xs":void 0,children:r})]},a)),s.failed_jobs&&s.failed_jobs.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cron-label mb-1",children:"Failed jobs"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:s.failed_jobs.map(a=>e.jsx(_,{variant:"outline",className:"cron-status--broken",children:a},a))})]}),s.job_conclusions&&Object.keys(s.job_conclusions).length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cron-label mb-1",children:"Job conclusions"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:Object.entries(s.job_conclusions).map(([a,r])=>e.jsxs(_,{variant:"outline",children:[a,": ",r??"running"]},a))})]}),(s.error||s.view_error)&&e.jsx("div",{className:"cron-message cron-message--error",children:s.error??s.view_error})]})]})}function ls(s){return s==="COMPLETED"?"cron-status--healthy":s==="ERROR"||s==="CANCELED"?"cron-status--broken":s==="RUNNING"?"cron-status--running":"cron-status--unknown"}function os({job:s}){const a=s.progress,r=a!=null&&a.total_papers?Math.min(100,a.processed_papers/a.total_papers*100):0;return e.jsxs("div",{className:"cron-metric-card space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"font-semibold",children:[s.mode??"unknown"," · shard ",s.shard_id??"N/A"]}),e.jsx("div",{className:"font-mono text-xs cron-muted truncate",children:s.id})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{variant:"outline",className:ls(s.stage),children:s.stage.toLowerCase()}),s.url&&e.jsx("a",{href:s.url,target:"_blank",rel:"noreferrer","aria-label":`Open Hugging Face Job ${s.id}`,className:"cron-info-text",children:e.jsx(re,{className:"h-4 w-4"})})]})]}),a?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between gap-3 text-xs cron-muted mb-1",children:[e.jsxs("span",{children:[a.processed_papers.toLocaleString()," / ",a.total_papers.toLocaleString()," papers"]}),e.jsxs("span",{children:[r.toFixed(0),"%"]})]}),e.jsx("div",{className:"cron-progress-track",children:e.jsx("div",{className:"cron-progress-value",style:{width:`${r}%`}})})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-sm",children:[e.jsxs("span",{children:[e.jsx("strong",{children:a.succeeded_papers.toLocaleString()})," succeeded"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.failed_papers.toLocaleString()})," failed"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.already_existed_papers.toLocaleString()})," skipped"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.extracted_images.toLocaleString()})," images"]})]}),a.updated_at&&e.jsxs("div",{className:"text-xs cron-muted",children:["Progress updated ",N(a.updated_at)]}),(a.fatal_error||a.error_samples.length>0)&&e.jsxs("div",{className:"cron-message cron-message--error space-y-1",children:[a.fatal_error&&e.jsx("div",{children:a.fatal_error}),a.error_samples.map(t=>e.jsxs("div",{children:[e.jsx("span",{className:"font-mono",children:t.arxiv_id}),": ",t.error]},`${t.arxiv_id}:${t.error}`))]})]}):e.jsx("div",{className:"text-sm cron-muted",children:"Waiting for the shard progress checkpoint."}),e.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs cron-muted",children:[s.hardware&&e.jsx("span",{children:s.hardware}),s.created_at&&e.jsxs("span",{children:["Created ",N(s.created_at)]}),s.duration_seconds!=null&&e.jsxs("span",{children:["Duration ",ve(s.duration_seconds)]})]}),s.stage_message&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.stage_message})]})}function ds({monitor:s,loading:a,error:r}){return e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(Xe,{className:"h-4 w-4"}),e.jsx("h4",{children:"Hugging Face OCR shards"})]}),a&&e.jsxs("div",{className:"cron-metric-card flex items-center gap-2 text-sm cron-muted",children:[e.jsx(R,{className:"h-4 w-4 animate-spin"})," Loading remote Jobs…"]}),r&&e.jsx("div",{className:"cron-message cron-message--error",children:"Could not load Hugging Face Jobs."}),s&&!s.available&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.error??"Hugging Face monitoring is unavailable."}),(s==null?void 0:s.available)&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-3",children:Object.entries(s.summary).map(([t,o])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:be(t)}),e.jsx("div",{className:"text-lg font-semibold",children:o.toLocaleString()})]},t))}),s.jobs.length===0?e.jsx("div",{className:"cron-metric-card text-sm cron-muted",children:"No OCR shards have been launched yet."}):e.jsx("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-3",children:s.jobs.map(t=>e.jsx(os,{job:t},t.id))})]})]})}function ms({job:s,expanded:a,onToggle:r,paperMarkdownJobs:t,paperMarkdownJobsLoading:o=!1,paperMarkdownJobsError:d=null}){const m=!!(s.work_metrics&&Object.keys(s.work_metrics).length),c=!!(s.db_metrics&&Object.keys(s.db_metrics).length),n=s.job_name==="paper_markdown_backfill",u=m||c||!!s.workflow_status||n;return e.jsxs("div",{className:"cron-job-card",children:[e.jsx("button",{type:"button",className:"cron-job-summary",onClick:r,"aria-expanded":a,children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[e.jsx(is,{status:s.status,isRunning:s.is_running}),e.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[e.jsx("h3",{className:"font-semibold",children:s.display_name}),s.critical&&e.jsx(_,{variant:"outline",className:"text-[10px] uppercase tracking-wide",children:"Critical"}),s.lock_stale&&e.jsx(_,{variant:"outline",className:"cron-status--broken",children:"Stale lock"}),u&&(a?e.jsx(We,{className:"h-4 w-4 cron-muted"}):e.jsx(Oe,{className:"h-4 w-4 cron-muted"}))]}),e.jsx("p",{className:"text-sm cron-muted mb-2",children:s.status_reason}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-2 text-sm cron-muted",children:[e.jsxs("span",{className:"cron-fact",children:[e.jsx(te,{}),"Log: ",N(s.last_run)]}),e.jsxs("span",{className:"cron-fact",children:[e.jsx(G,{}),"DB: ",N(s.last_db_write)]}),s.recent_write_count!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(Ze,{}),"Recent writes: ",s.recent_write_count.toLocaleString()]}),s.duration!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(H,{}),"Duration: ",ve(s.duration)]}),s.schedule&&e.jsxs("span",{className:"cron-fact md:col-span-2",children:[e.jsx(Be,{}),e.jsx("span",{className:"font-mono text-xs",children:s.schedule})]}),s.log_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(Y,{}),"Log status: ",s.log_status]}),s.workflow_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(H,{}),"Actions: ",Ne(s.workflow_status)]})]}),s.work_summary&&e.jsx("div",{className:"cron-message",children:s.work_summary}),s.error&&e.jsxs("div",{className:"cron-message cron-message--error",children:[e.jsx("strong",{children:"Error: "}),s.error]}),s.diagnostics&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.diagnostics})]})]}),e.jsx(_,{variant:"outline",className:`cron-status--${s.status}`,children:s.status})]})}),a&&u&&e.jsx("div",{className:"cron-job-details",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.work_metrics&&m&&e.jsx(ee,{icon:Y,title:"Log Metrics",metrics:s.work_metrics}),s.db_metrics&&c&&e.jsx(ee,{icon:G,title:"Database Metrics",metrics:s.db_metrics}),s.workflow_status&&e.jsx(cs,{workflow:s.workflow_status}),n&&e.jsx(ds,{monitor:t,loading:o,error:d})]})})]})}const ye=x.forwardRef(({className:s,...a},r)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:r,className:v("w-full caption-bottom text-sm",s),...a})}));ye.displayName="Table";const _e=x.forwardRef(({className:s,...a},r)=>e.jsx("thead",{ref:r,className:v("[&_tr]:border-b",s),...a}));_e.displayName="TableHeader";const we=x.forwardRef(({className:s,...a},r)=>e.jsx("tbody",{ref:r,className:v("[&_tr:last-child]:border-0",s),...a}));we.displayName="TableBody";const xs=x.forwardRef(({className:s,...a},r)=>e.jsx("tfoot",{ref:r,className:v("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...a}));xs.displayName="TableFooter";const B=x.forwardRef(({className:s,...a},r)=>e.jsx("tr",{ref:r,className:v("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",s),...a}));B.displayName="TableRow";const $=x.forwardRef(({className:s,...a},r)=>e.jsx("th",{ref:r,className:v("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",s),...a}));$.displayName="TableHead";const L=x.forwardRef(({className:s,...a},r)=>e.jsx("td",{ref:r,className:v("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...a}));L.displayName="TableCell";const hs=x.forwardRef(({className:s,...a},r)=>e.jsx("caption",{ref:r,className:v("mt-4 text-sm text-muted-foreground",s),...a}));hs.displayName="TableCaption";const us={queued:"cron-status--unknown",dispatching:"cron-status--running",running:"cron-status--running",completed:"cron-status--healthy",failed:"cron-status--broken",canceled:"cron-status--unknown"},ps={"add-evals":"Add evals","enrich-paper":"Enrich paper"},gs={queued:Ge,dispatching:R,running:Qe,completed:W,failed:J,canceled:Ve};function js({status:s}){const a=gs[s];return e.jsxs(_,{variant:"outline",className:us[s],children:[e.jsx(a,{className:`mr-1 h-3.5 w-3.5 ${s==="dispatching"?"animate-spin":""}`}),s]})}function fs(s){return s.error?s.error:s.report?s.report:s.status==="completed"&&s.applied_at?"Changes applied to the paper.":s.status==="completed"?"Completed without a recorded mutation.":null}function vs({autoRefresh:s,refreshToken:a}){const{data:r,isLoading:t,isFetching:o,error:d}=I({queryKey:["codexPaperJobs",a],queryFn:()=>He(100),refetchInterval:s?1e4:!1,retry:!1}),m=d&&typeof d=="object"&&"status"in d?d.status:void 0;return e.jsxs(p,{className:"mb-8",children:[e.jsx(j,{children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(f,{className:"text-xl",children:"Codex paper jobs"}),e.jsx(T,{children:"Durable queue and execution history for admin-triggered Hugging Face Jobs"})]}),o&&!t&&e.jsxs("span",{className:"flex items-center gap-2 text-xs cron-muted",children:[e.jsx(R,{className:"h-3.5 w-3.5 animate-spin"})," Syncing with Hugging Face"]})]})}),e.jsxs(g,{children:[t&&e.jsxs("div",{className:"flex items-center justify-center py-10 cron-muted",children:[e.jsx(R,{className:"mr-2 h-5 w-5 animate-spin"})," Loading paper jobs…"]}),d&&m!==404&&e.jsx("div",{className:"cron-message cron-message--error mb-4",children:d instanceof Error?d.message:"Could not load Codex paper jobs."}),m===404&&e.jsx("p",{className:"py-4 text-sm cron-muted",children:"Codex paper jobs are not enabled in this environment."}),r&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-5 grid grid-cols-2 gap-3 sm:grid-cols-4 lg:grid-cols-7",children:[["queued","dispatching","running","completed","failed","canceled"].map(c=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label capitalize",children:c}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:r.summary[c]})]},c)),e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:"Total"}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:r.summary.total})]})]}),r.jobs.length===0?e.jsx("p",{className:"py-8 text-center text-sm cron-muted",children:"No paper curation jobs have been submitted yet."}):e.jsxs(ye,{children:[e.jsx(_e,{children:e.jsxs(B,{children:[e.jsx($,{children:"Status"}),e.jsx($,{children:"Paper"}),e.jsx($,{children:"Action"}),e.jsx($,{children:"Requested"}),e.jsx($,{children:"Execution"})]})}),e.jsx(we,{children:r.jobs.map(c=>{const n=fs(c);return e.jsxs(B,{children:[e.jsx(L,{className:"align-top",children:e.jsx(js,{status:c.status})}),e.jsxs(L,{className:"min-w-[260px] align-top",children:[e.jsx(qe,{to:`/paper/${encodeURIComponent(c.paper_route)}`,className:"font-medium hover:underline",children:c.paper_title}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Paper #",c.paper_id]})]}),e.jsxs(L,{className:"whitespace-nowrap align-top",children:[ps[c.kind],c.applied_at&&e.jsxs("div",{className:"mt-1 flex items-center gap-1 text-xs cron-status--healthy",children:[e.jsx(W,{className:"h-3.5 w-3.5"})," Applied"]})]}),e.jsxs(L,{className:"whitespace-nowrap align-top",children:[e.jsx("div",{children:N(c.created_at)}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["@",c.requested_by]})]}),e.jsxs(L,{className:"max-w-[360px] align-top",children:[c.hf_job_url?e.jsxs("a",{href:c.hf_job_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 hover:underline",children:["Hugging Face Job ",e.jsx(re,{className:"h-3.5 w-3.5"})]}):e.jsx("span",{className:"cron-muted",children:"Waiting to dispatch"}),n&&e.jsx("p",{className:`mt-2 line-clamp-3 text-xs ${c.error?"text-red-700":"cron-muted"}`,title:n,children:n})]})]},c.id)})})]}),e.jsxs("p",{className:"mt-4 text-xs cron-muted",children:["Showing the 100 most recent jobs · Queue totals include full history · Updated ",N(r.timestamp)]})]})]})]})}const Ns=()=>{var d,m,c;const s=Ie(),a=ze({queryKey:["catalog-audit"],queryFn:({pageParam:n})=>M.getCatalogAudit(n),initialPageParam:void 0,getNextPageParam:n=>n.next_cursor??void 0}),r=((d=a.data)==null?void 0:d.pages.flatMap(n=>n.events))??[],t=Z({mutationFn:()=>M.acknowledgeCatalogAudit(),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})}),o=Z({mutationFn:n=>M.rollbackCatalogEvent(n),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})});return e.jsx("div",{className:"space-y-4",children:e.jsxs(p,{children:[e.jsxs(j,{className:"flex-row items-center justify-between",children:[e.jsx(f,{children:"Catalog mutation audit"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm font-medium",children:[((c=(m=a.data)==null?void 0:m.pages[0])==null?void 0:c.unread_contributor_count)??0," unread contributor changes"]}),e.jsx(P,{variant:"outline",size:"sm",onClick:()=>t.mutate(),disabled:t.isPending,children:"Mark read"})]})]}),e.jsxs(g,{className:"space-y-3",children:[a.isLoading&&e.jsx("p",{children:"Loading audit history…"}),a.error&&e.jsx("p",{className:"text-destructive",children:"Audit history unavailable."}),r.map(n=>e.jsxs("article",{className:`rounded-md border p-3 ${n.operation==="delete"||n.rollback_eligible===!1?"border-red-500 bg-red-50/50":""}`,children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("strong",{children:[n.operation," ",n.entity_type," ",n.entity_id]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["@",n.actor_username??n.actor_role," ·"," ",new Date(n.created_at).toLocaleString()]})]}),e.jsxs("details",{className:"mt-2 text-xs",children:[e.jsx("summary",{children:"Inspect snapshots"}),e.jsx("pre",{className:"mt-2 max-h-80 overflow-auto rounded bg-muted p-3",children:JSON.stringify({before:n.before,after:n.after},null,2)})]}),!n.rollback_of_event_id&&e.jsx(P,{className:"mt-3",variant:"outline",size:"sm",onClick:()=>o.mutate(n.id),disabled:o.isPending||n.rollback_eligible===!1,children:n.rollback_eligible===!1?"Rollback conflict":"Roll back if unchanged"})]},n.id)),a.hasNextPage&&e.jsx(P,{variant:"outline",onClick:()=>a.fetchNextPage(),disabled:a.isFetchingNextPage,children:a.isFetchingNextPage?"Loading…":"Load older events"})]})]})})},se={hourly:"cron-status--running",daily:"cron-status--healthy",weekly:"cron-status--degraded"},b=s=>`$${(s/1e6).toFixed(2)}`,bs=({data:s,loading:a,error:r})=>{const[t,o]=x.useState("staging-current"),d={"staging-current":"Starter staging · $75 warning / $100 trip / no Environment cap","staging-production-era":"Staging with production · $15 / $20 / $25",production:"Production · $175 / $200 / $225"};if(a)return e.jsxs("div",{className:"flex items-center py-12",children:[e.jsx(R,{className:"h-6 w-6 animate-spin mr-3"}),"Loading chat compute…"]});if(r||!s)return e.jsx(p,{className:"cron-status--broken",children:e.jsx(g,{className:"pt-6",children:"Chat compute accounting is unavailable."})});const m=Math.min(100,s.effective_microusd/s.application_cap_microusd*100),c=s.circuit_state==="tripped"?"Chat disabled":s.circuit_state==="warning"?"Operator warning":"Enabled",n=s.reconciliation_state==="fresh"?"Fresh":s.reconciliation_state==="stale"?"Stale":"Unavailable";return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid md:grid-cols-4 gap-4",children:[e.jsxs(p,{className:s.circuit_state==="tripped"?"cron-status--broken":s.circuit_state==="warning"?"cron-status--degraded":"",children:[e.jsx(j,{children:e.jsx(f,{className:"text-sm",children:"Circuit"})}),e.jsxs(g,{children:[e.jsx("div",{className:"text-2xl font-bold",children:c}),e.jsx("p",{className:"text-xs cron-muted",children:s.trip_reason??"Policy armed"})]})]}),e.jsxs(p,{children:[e.jsx(j,{children:e.jsx(f,{className:"text-sm",children:"Month to date"})}),e.jsxs(g,{children:[e.jsx("div",{className:"text-2xl font-bold",children:b(s.effective_microusd)}),e.jsx("div",{role:"progressbar","aria-label":"Application cap used","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(m),className:"h-2 rounded bg-muted mt-3",children:e.jsx("div",{className:"h-2 rounded bg-primary",style:{width:`${m}%`}})})]})]}),e.jsxs(p,{children:[e.jsx(j,{children:e.jsx(f,{className:"text-sm",children:"Application headroom"})}),e.jsxs(g,{children:[e.jsx("div",{className:"text-2xl font-bold",children:b(s.remaining_microusd)}),e.jsxs("p",{className:"text-xs cron-muted",children:["Cap ",b(s.application_cap_microusd)]})]})]}),e.jsxs(p,{children:[e.jsx(j,{children:e.jsx(f,{className:"text-sm",children:"Live compute"})}),e.jsxs(g,{children:[e.jsx("div",{className:"text-2xl font-bold",children:s.live_count}),e.jsxs("p",{className:"text-xs cron-muted",children:[s.termination_uncertain_count," termination uncertain"]})]})]})]}),e.jsxs(p,{children:[e.jsxs(j,{children:[e.jsx(f,{children:"Accounting and policy"}),e.jsxs(T,{children:[s.environment," · cycle ",s.billing_cycle]})]}),e.jsxs(g,{className:"grid md:grid-cols-3 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Environment record"}),e.jsx("br",{}),s.environment," · ",s.provider_mode==="starter_workspace"?"Starter Workspace":"Team isolated"]}),e.jsxs("label",{children:[e.jsx("strong",{children:"Policy profile"}),e.jsxs("select",{"aria-label":"Chat compute policy profile",value:t,onChange:u=>o(u.target.value),className:"block mt-1",children:[e.jsx("option",{value:"staging-current",children:"Staging now"}),e.jsx("option",{value:"staging-production-era",children:"Staging with production"}),e.jsx("option",{value:"production",children:"Production"})]}),e.jsxs("span",{className:"text-xs cron-muted",children:[d[t]," · Workspace $250"]})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Conservative estimate"}),e.jsx("br",{}),b(s.estimated_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider-reported floor"}),e.jsx("br",{}),b(s.provider_floor_microusd)," · ",e.jsx(_,{children:n})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider backstops"}),e.jsx("br",{}),s.environment_cap_microusd===null?"Starter: no Environment cap":`Environment ${b(s.environment_cap_microusd)}`," · Workspace ",b(s.workspace_cap_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Active thresholds"}),e.jsx("br",{}),"Warning ",b(s.warning_microusd)," · trip ",b(s.application_cap_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Policy allocation"}),e.jsx("br",{}),"Starter staging $75/$100 with no Environment cap · future Team staging $15/$20/$25 · production $175/$200/$225 · workspace $250"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Cycle end"}),e.jsx("br",{}),N(s.cycle_end_at)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Last metered"}),e.jsx("br",{}),s.last_metered_at?N(s.last_metered_at):"Unavailable"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider reconciliation"}),e.jsx("br",{}),s.last_reconciled_at?N(s.last_reconciled_at):"Unavailable",s.last_reconciliation_attempt_at?` · attempted ${N(s.last_reconciliation_attempt_at)}`:"",s.next_reconciliation_at?` · next ${N(s.next_reconciliation_at)}`:""]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Burn projection"}),e.jsx("br",{}),s.burn_rate_microusd_per_hour===null?"Not enough data":`${b(s.burn_rate_microusd_per_hour)}/hour${s.projected_cap_hit_at?` · cap ${N(s.projected_cap_hit_at)}`:""}`]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Prior cycle"}),e.jsx("br",{}),s.prior_cycle?`${s.prior_cycle.billing_cycle} · ${b(s.prior_cycle.effective_microusd)}`:"Not enough data"]})]})]}),e.jsxs(p,{children:[e.jsx(j,{children:e.jsx(f,{children:"Live lifecycle"})}),e.jsx(g,{className:"text-sm",children:Object.entries(s.live_states).map(([u,l])=>e.jsxs("span",{className:"mr-4",children:[u,": ",l]},u))})]}),e.jsxs(p,{children:[e.jsx(j,{children:e.jsx(f,{children:"Daily spend"})}),e.jsx(g,{children:s.daily_spend.length?e.jsx("ul",{className:"space-y-1 text-sm",children:s.daily_spend.map(u=>e.jsxs("li",{children:[u.date,": blank ",b(u.blank_pool_microusd)," · assigned ",b(u.assigned_microusd)]},u.date))}):e.jsx("p",{className:"cron-muted",children:"No compute recorded in this cycle."})})]}),e.jsxs(p,{children:[e.jsxs(j,{children:[e.jsx(f,{children:"Recent circuit events"}),e.jsx(T,{children:"Runbook: docs/chat-sandbox-spend-runbook.md"})]}),e.jsx(g,{children:s.events.length?e.jsx("ul",{className:"space-y-2 text-sm",children:s.events.map(u=>e.jsxs("li",{children:[e.jsx(_,{children:u.severity})," ",u.type," · ",N(u.created_at)]},u.id))}):e.jsx("p",{className:"cron-muted",children:"No events in this cycle."})})]})]})},Fs=()=>{const[s,a]=x.useState(!0),[r,t]=x.useState(0),[o,d]=x.useState(""),[m,c]=x.useState(""),[n,u]=x.useState(new Set),{user:l}=Je(),{data:h,isLoading:w,isFetching:Q,error:C,refetch:ke}=I({queryKey:["cronStatus",l==null?void 0:l.username],queryFn:()=>M.getCronStatus(),enabled:!!(l!=null&&l.is_admin),refetchInterval:s?3e4:!1,retry:!1}),E=I({queryKey:["paperMarkdownJobs",l==null?void 0:l.username],queryFn:()=>M.getPaperMarkdownJobs(),enabled:!!(l!=null&&l.is_admin),refetchInterval:s?3e4:!1,retry:!1}),D=I({queryKey:["chatSandboxSpend",l==null?void 0:l.username,m],queryFn:()=>M.getChatSandboxSpend(m||void 0),enabled:!!(l!=null&&l.is_admin),refetchInterval:s?3e4:!1,retry:!1}),Ce=(C&&typeof C=="object"&&"status"in C?C.status:void 0)===401?"Unauthorized. Sign in with an allowlisted Hugging Face admin account.":C instanceof Error?C.message:void 0,Se=i=>{u(k=>{const S=new Set(k);return S.has(i)?S.delete(i):S.add(i),S})},Te=(h==null?void 0:h.jobs.filter(i=>i.critical))??[],q=((h==null?void 0:h.jobs.filter(i=>!i.critical))??[]).reduce((i,k)=>(i[k.category]||(i[k.category]=[]),i[k.category].push(k),i),{}),Re=Object.keys(q).sort((i,k)=>{const S=["hourly","daily","weekly"];return S.indexOf(i)-S.indexOf(k)}),V=i=>e.jsx(ms,{job:i,expanded:n.has(i.job_name),onToggle:()=>Se(i.job_name),paperMarkdownJobs:i.job_name==="paper_markdown_backfill"?E.data:void 0,paperMarkdownJobsLoading:i.job_name==="paper_markdown_backfill"?E.isLoading:!1,paperMarkdownJobsError:i.job_name==="paper_markdown_backfill"?E.error:null},i.job_name),$e=()=>{t(i=>i+1),ke(),E.refetch(),D.refetch()};return e.jsx("div",{className:"cron-dashboard","data-shadcn":!0,children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[e.jsx("div",{className:"mb-8",children:e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-3xl font-bold flex items-center gap-3",children:[e.jsx(H,{className:"h-8 w-8 cron-info-text"}),"Admin Dashboard"]}),e.jsx("p",{className:"mt-2 cron-muted",children:"Paper curation queue and operational health for scheduled jobs"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(P,{variant:"outline",size:"sm",onClick:()=>a(!s),className:s?"cron-status--running":"",children:[e.jsx(X,{className:`h-4 w-4 mr-2 ${s?"animate-spin":""}`}),"Auto-refresh ",s?"ON":"OFF"]}),e.jsxs(P,{variant:"outline",size:"sm",onClick:$e,disabled:Q,children:[e.jsx(X,{className:`h-4 w-4 mr-2 ${Q?"animate-spin":""}`}),"Refresh"]})]})]})}),e.jsx(p,{className:"mb-6",children:e.jsx(g,{className:"pt-6",children:e.jsxs("p",{className:"text-sm cron-muted",children:["Signed in as ",e.jsxs("span",{className:"font-semibold",children:["@",l==null?void 0:l.username]}),". Health checks prefer database freshness over log completion so silent no-work failures surface as degraded or broken."]})})}),e.jsxs(ts,{defaultValue:"critical-jobs",children:[e.jsxs(fe,{className:"grid w-full grid-cols-4 sm:w-auto",children:[e.jsx(F,{value:"critical-jobs",children:"Critical Jobs"}),e.jsx(F,{value:"codex-paper-jobs",children:"Codex Paper Jobs"}),e.jsx(F,{value:"catalog-audit",children:"Catalog Audit"}),e.jsx(F,{value:"chat-compute",children:"Chat Compute"})]}),e.jsxs(A,{value:"critical-jobs",className:"mt-6",children:[w&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(R,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading CRON jobs status..."})]}),C&&e.jsx(p,{className:"cron-status--broken",children:e.jsx(g,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(J,{className:"h-5 w-5"}),e.jsx("p",{children:Ce??"Failed to load CRON jobs status. Please try again."})]})})}),h&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4 mb-6",children:["healthy","degraded","broken","running","stuck","unknown"].map(i=>e.jsxs(p,{children:[e.jsx(j,{className:"pb-2",children:e.jsx(f,{className:"text-sm font-medium cron-muted capitalize",children:i})}),e.jsx(g,{children:e.jsx("div",{className:"text-2xl font-bold",children:h.summary[i]})})]},i))}),h.summary.critical_issues.length>0&&e.jsxs(p,{className:"mb-6 cron-status--broken",children:[e.jsx(j,{children:e.jsxs(f,{className:"flex items-center gap-2",children:[e.jsx(Ue,{className:"h-5 w-5"}),"Critical job issues"]})}),e.jsx(g,{children:e.jsx("ul",{className:"list-disc pl-5 space-y-1 text-sm",children:h.summary.critical_issues.map(i=>e.jsx("li",{children:i},i))})})]}),e.jsxs(p,{className:"mb-8",children:[e.jsx(j,{children:e.jsx(f,{className:"text-base",children:"What to check next"})}),e.jsxs(g,{children:[e.jsx("p",{className:"text-sm cron-muted",children:h.summary.what_to_check_next}),e.jsxs("p",{className:"mt-2 text-xs cron-muted flex items-center gap-2",children:[e.jsx(te,{className:"h-4 w-4"}),"Last updated: ",N(h.timestamp)," · Health score:"," ",h.summary.health_score.toFixed(0),"%"]})]})]}),e.jsxs(p,{className:"mb-8",children:[e.jsxs(j,{children:[e.jsx(f,{className:"text-xl",children:"Critical jobs"}),e.jsx(T,{children:"Writers whose stale output breaks the live site"})]}),e.jsx(g,{className:"space-y-4",children:Te.map(V)})]}),e.jsx("div",{className:"space-y-6",children:Re.map(i=>e.jsxs(p,{children:[e.jsx(j,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(f,{className:"text-xl capitalize flex items-center gap-2",children:[e.jsx(_,{className:se[i]??se.hourly,children:i}),e.jsx("span",{children:"Supporting jobs"})]}),e.jsxs(T,{children:[q[i].length," job",q[i].length!==1?"s":""]})]})}),e.jsx(g,{className:"space-y-4",children:q[i].map(V)})]},i))})]})]}),e.jsx(A,{value:"codex-paper-jobs",className:"mt-6",children:e.jsx(vs,{autoRefresh:s,refreshToken:r})}),e.jsx(A,{value:"catalog-audit",className:"mt-6",children:e.jsx(Ns,{})}),e.jsxs(A,{value:"chat-compute",className:"mt-6",children:[e.jsxs(p,{className:"mb-6",children:[e.jsxs(j,{children:[e.jsx(f,{children:"Environment record"}),e.jsx(T,{children:"Leave blank for live staging, or enter the isolated environment printed by the spend qualification command."})]}),e.jsxs(g,{className:"flex gap-2",children:[e.jsx("input",{"aria-label":"Chat compute environment record",value:o,onChange:i=>d(i.target.value),placeholder:"staging-q-example",className:"flex-1 rounded border px-3 py-2"}),e.jsx(P,{onClick:()=>c(o.trim()),children:"Load"})]})]}),e.jsx(bs,{data:D.data,loading:D.isLoading,error:D.error})]})]})]})})};export{bs as ChatComputePanel,Fs as default};
|
assets/ExternalSourceEvalBadge-B1HOv2kK.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{j as e,L as l}from"./index-ChUK4pXW.js";import{H as t,a as n,b as o}from"./hover-card-D4KxxydT.js";import{s as i}from"./safeExternalHref-CkBrsh84.js";const x=()=>e.jsxs(t,{openDelay:120,closeDelay:120,children:[e.jsx(n,{asChild:!0,children:e.jsx("button",{type:"button",className:"bm-closed-source-tag","aria-label":"Closed-source model",children:"closed"})}),e.jsxs(o,{side:"top",align:"start",className:"w-auto max-w-[260px] p-3 text-sm leading-snug",children:["This is an evaluation of a closed-source model. You can disable viewing these in your"," ",e.jsx(l,{to:"/settings",className:"closed-eval-tooltip-link",children:"settings"}),"."]})]});function c(a){if(!a)return"Evaluation sourced outside this paper";const r=a.toLowerCase();if(r.includes("open-asr-leaderboard"))return"Open ASR Leaderboard";if(r.includes("arcprize.org"))return"ARC Prize Leaderboard";if(r.includes("frontierswe.com"))return"FrontierSWE";if(r.includes("deepswe.datacurve.ai"))return"DeepSWE";try{const s=new URL(a,"https://paperswithcode.co");return s.pathname.startsWith("/paper/")?"Source paper":s.hostname.replace(/^www\./,"")}catch{return a}}const h=({sourceUrl:a})=>{const r=i(a),s=c(a);return e.jsxs(t,{openDelay:120,closeDelay:120,children:[e.jsx(n,{asChild:!0,children:e.jsx("button",{type:"button",className:"bm-external-source-tag","aria-label":`Externally sourced evaluation: ${s}`,children:"External"})}),e.jsxs(o,{side:"top",align:"start",className:"w-auto max-w-[280px] p-3 text-sm leading-snug",children:["This score was sourced outside this paper.",a?e.jsxs(e.Fragment,{children:[" ",e.jsx("a",{href:r??void 0,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:s}),"."]}):e.jsxs(e.Fragment,{children:[" ",s,"."]})]})]})};export{x as C,h as E};
|
assets/ExternalSourceEvalBadge-Bj021N_r.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{j as e,L as l}from"./index-C--7Ookn.js";import{H as t,a as n,b as o}from"./hover-card-1g79nCeQ.js";const u=()=>e.jsxs(t,{openDelay:120,closeDelay:120,children:[e.jsx(n,{asChild:!0,children:e.jsx("button",{type:"button",className:"bm-closed-source-tag","aria-label":"Closed-source model",children:"closed"})}),e.jsxs(o,{side:"top",align:"start",className:"w-auto max-w-[260px] p-3 text-sm leading-snug",children:["This is an evaluation of a closed-source model. You can disable viewing these in your"," ",e.jsx(l,{to:"/settings",className:"closed-eval-tooltip-link",children:"settings"}),"."]})]});function i(a){if(!a)return"Evaluation sourced outside this paper";const r=a.toLowerCase();if(r.includes("open-asr-leaderboard"))return"Open ASR Leaderboard";if(r.includes("arcprize.org"))return"ARC Prize Leaderboard";if(r.includes("frontierswe.com"))return"FrontierSWE";if(r.includes("deepswe.datacurve.ai"))return"DeepSWE";try{const s=new URL(a,"https://paperswithcode.co");return s.pathname.startsWith("/paper/")?"Source paper":s.hostname.replace(/^www\./,"")}catch{return a}}const p=({sourceUrl:a})=>{const r=i(a);return e.jsxs(t,{openDelay:120,closeDelay:120,children:[e.jsx(n,{asChild:!0,children:e.jsx("button",{type:"button",className:"bm-external-source-tag","aria-label":`Externally sourced evaluation: ${r}`,children:"External"})}),e.jsxs(o,{side:"top",align:"start",className:"w-auto max-w-[280px] p-3 text-sm leading-snug",children:["This score was sourced outside this paper.",a?e.jsxs(e.Fragment,{children:[" ",e.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:r}),"."]}):e.jsxs(e.Fragment,{children:[" ",r,"."]})]})]})};export{u as C,p as E};
|
|
|
|
|
|
assets/FeedView-BHzhLVDR.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{u as O,r as u,j as e,a as H,L as N,i as F,b as S}from"./index-ChUK4pXW.js";import{P as I}from"./components-Oks99QHA.js";import{u as q,P as U}from"./useIntersectionObserver-Bm84xMAC.js";import{D as $,M as K,F as B,A as W,q as G,c as z}from"./chatSessions-DcYRJLQo.js";import{S as _}from"./chatPrompts-CDY3UGU1.js";import{t as Q,d as E}from"./transform-CuJRPBDz.js";import{u as V}from"./usePapers-Bvgk8ZIt.js";import{P as X}from"./usePeriodFilter-xR4UEu-8.js";import{S as g}from"./skeleton-qvDYp1rq.js";import{A as Y,a as J}from"./alert-DNLHMDlv.js";import{u as L}from"./useQuery-CKrTCSf-.js";import"./LatexTitle-RPgzE218.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";import"./useInfiniteQuery-DflNwjnr.js";const Z=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ee={Today:"today","This Week":"week","This Month":"month","All Time":"all_time"},se={today:"Today",week:"This Week",month:"This Month",all_time:"All Time"},k=45,te=1800,ae=25,ie=350,re=a=>{const[r,m]=u.useState(_[0].slice(0,1));return u.useEffect(()=>{var p,f;if(!a)return;if((f=(p=window.matchMedia)==null?void 0:p.call(window,"(prefers-reduced-motion: reduce)"))!=null&&f.matches){m(_[0]);return}let o=0,n=1,l=!1,c;m(_[0].slice(0,n));const h=()=>{const i=_[o];if(!l){if(n+=1,m(i.slice(0,n)),n===i.length){l=!0,c=window.setTimeout(h,te);return}c=window.setTimeout(h,k);return}if(n-=1,m(i.slice(0,n)),n===0){l=!1,o=(o+1)%_.length,c=window.setTimeout(h,ie);return}c=window.setTimeout(h,ae)};return c=window.setTimeout(h,k),()=>window.clearTimeout(c)},[a]),r},ne=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",oe=a=>a==="today"||a==="week"||a==="month"||a==="all_time"?a:"all_time",le=()=>{const a=O(),[r,m]=u.useState(""),[o,n]=u.useState($),[l,c]=u.useState(!1),h=re(!r),p=u.useRef(null);u.useEffect(()=>{const i=p.current;i&&(i.style.height="auto",i.style.height=`${Math.min(i.scrollHeight,160)}px`)},[r]);const f=async(i=r)=>{const j=i.trim();if(!(!j||l)){c(!0),G(j,o);try{const x=await z(o);a(`/chat/${x.id}`)}catch{a("/chat")}}};return e.jsxs("div",{className:"ask-home",children:[e.jsx("textarea",{ref:p,rows:1,value:r,placeholder:h,"aria-label":"Ask the assistant",disabled:l,onChange:i=>m(i.target.value),onKeyDown:i=>{i.key==="Enter"&&!i.shiftKey&&(i.preventDefault(),f())}}),e.jsxs("div",{className:"ask-home-foot",children:[e.jsxs("div",{className:"ask-home-provider-tools",children:[e.jsx(K,{models:B,selectedModel:o,onModelChange:n}),e.jsxs("span",{className:"ask-home-hint",children:["Via 🤗"," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]})]}),e.jsx("button",{type:"button",className:`chat-send${r.trim()?" chat-send-on":""}`,onClick:()=>f(),disabled:!r.trim()||l,"aria-label":"Ask the assistant",children:e.jsx(W,{})})]})]})},we=()=>{var T,w,v,P,A;const[a,r]=H(),m=ne(a.get("order_by")),o=oe(a.get("time")),n=a.get("has_code")==="true",l=a.get("has_hf_artifacts")==="true",c=se[o],h=s=>{const t=new URLSearchParams(a);t.set("order_by",s),r(t)},p=s=>{const t=new URLSearchParams(a);t.set("time",ee[s]),r(t)},f=s=>{const t=new URLSearchParams(a);s?t.set("has_code","true"):t.delete("has_code"),r(t)},i=s=>{const t=new URLSearchParams(a);s?t.set("has_hf_artifacts","true"):t.delete("has_hf_artifacts"),r(t)},j=L({queryKey:["top-tasks-sidebar"],queryFn:()=>S.getTopTasks({limit:8}),staleTime:10*60*1e3}),x=L({queryKey:["trending-tasks-sidebar"],queryFn:()=>S.getTrendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),d=V({page_size:30,order_by:m,order_dir:"desc",time:o,include_resources:!0,has_code:n,has_hf_artifacts:l}),y=u.useMemo(()=>{var t;return(((t=d.data)==null?void 0:t.pages.flatMap(R=>R.results))||[]).map(Q)},[d.data]),{targetRef:C,isIntersecting:b}=q({rootMargin:"400px"});u.useEffect(()=>{b&&d.hasNextPage&&!d.isFetchingNextPage&&d.fetchNextPage()},[b,d.hasNextPage,d.isFetchingNextPage]);const M=d.isLoading,D=d.error;return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Trending ",e.jsx("em",{children:"Research"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated daily from arXiv and Hugging Face"})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsxs("aside",{className:"sidebar",children:[e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),j.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,t)=>e.jsx(g,{className:"h-5 w-full"},t))}),(T=j.data)==null?void 0:T.map(s=>e.jsxs(N,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[E(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(N,{to:"/tasks",className:"sidebar-link",style:{marginTop:8,fontStyle:"italic"},children:"all domains →"})]}),e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),x.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,t)=>e.jsx(g,{className:"h-5 w-full"},t))}),((v=(w=x.data)==null?void 0:w.results)==null?void 0:v.length)===0&&!x.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(A=(P=x.data)==null?void 0:P.results)==null?void 0:A.map(s=>e.jsxs(N,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[E(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]})]}),e.jsxs("div",{children:[F()&&e.jsx(le,{}),e.jsxs("div",{className:"sort-bar home-feed-sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:Z.map(([s,t])=>e.jsx("button",{className:`sort-btn ${m===s?"active":""}`,onClick:()=>h(s),children:t},s))}),e.jsx(U,{hasCode:n,hasHfArtifacts:l,onHasCodeChange:f,onHasHfArtifactsChange:i})]}),e.jsx("div",{className:"sort-options sort-options-time",children:X.map(s=>e.jsx("button",{className:`sort-btn sort-btn-time ${c===s?"active":""}`,onClick:()=>p(s),children:s},s))})]}),D&&e.jsx(Y,{variant:"destructive",className:"mb-4",children:e.jsx(J,{children:"Failed to load papers. Please try again."})}),M?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,t)=>e.jsxs("div",{className:"paper-card",children:[e.jsx("div",{className:"paper-thumb-wrap",children:e.jsx(g,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(g,{className:"h-6 w-3/4"}),e.jsx(g,{className:"h-4 w-1/2"}),e.jsx(g,{className:"h-12 w-full"})]})]},t))}):y.length===0?e.jsx("div",{className:"no-results",children:"No papers in this window."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:y.map((s,t)=>e.jsx(I,{paper:s,rank:t+1},s.id))}),e.jsx("div",{ref:C,style:{height:1}}),d.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})};export{le as AskAssistant,we as default};
|
assets/FeedView-CCitzMti.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{u as O,r as u,j as e,a as H,L as N,i as F,b as S}from"./index-C--7Ookn.js";import{P as I}from"./components-KzuuRgbc.js";import{u as q,P as U}from"./useIntersectionObserver-BFYx46oo.js";import{D as $,M as K,F as B,A as W,q as G,c as z}from"./chatSessions-DgCxZyQo.js";import{S as _}from"./chatPrompts-CDY3UGU1.js";import{t as Q,d as E}from"./transform-BfLoZuxV.js";import{u as V}from"./usePapers-B1XrbsG4.js";import{P as X}from"./usePeriodFilter-tyR-fiQK.js";import{S as g}from"./skeleton-r_i4hk58.js";import{A as Y,a as J}from"./alert-CThmjBPy.js";import{u as L}from"./useQuery-DFn3_KAa.js";import"./LatexTitle-CTfnj_ow.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-DcxJ3elC.js";import"./useBaseQuery-CPtz5T_6.js";const Z=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ee={Today:"today","This Week":"week","This Month":"month","All Time":"all_time"},se={today:"Today",week:"This Week",month:"This Month",all_time:"All Time"},k=45,te=1800,ae=25,ie=350,re=a=>{const[r,m]=u.useState(_[0].slice(0,1));return u.useEffect(()=>{var p,f;if(!a)return;if((f=(p=window.matchMedia)==null?void 0:p.call(window,"(prefers-reduced-motion: reduce)"))!=null&&f.matches){m(_[0]);return}let o=0,n=1,l=!1,c;m(_[0].slice(0,n));const h=()=>{const i=_[o];if(!l){if(n+=1,m(i.slice(0,n)),n===i.length){l=!0,c=window.setTimeout(h,te);return}c=window.setTimeout(h,k);return}if(n-=1,m(i.slice(0,n)),n===0){l=!1,o=(o+1)%_.length,c=window.setTimeout(h,ie);return}c=window.setTimeout(h,ae)};return c=window.setTimeout(h,k),()=>window.clearTimeout(c)},[a]),r},ne=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",oe=a=>a==="today"||a==="week"||a==="month"||a==="all_time"?a:"all_time",le=()=>{const a=O(),[r,m]=u.useState(""),[o,n]=u.useState($),[l,c]=u.useState(!1),h=re(!r),p=u.useRef(null);u.useEffect(()=>{const i=p.current;i&&(i.style.height="auto",i.style.height=`${Math.min(i.scrollHeight,160)}px`)},[r]);const f=async(i=r)=>{const j=i.trim();if(!(!j||l)){c(!0),G(j,o);try{const x=await z(o);a(`/chat/${x.id}`)}catch{a("/chat")}}};return e.jsxs("div",{className:"ask-home",children:[e.jsx("textarea",{ref:p,rows:1,value:r,placeholder:h,"aria-label":"Ask the assistant",disabled:l,onChange:i=>m(i.target.value),onKeyDown:i=>{i.key==="Enter"&&!i.shiftKey&&(i.preventDefault(),f())}}),e.jsxs("div",{className:"ask-home-foot",children:[e.jsxs("div",{className:"ask-home-provider-tools",children:[e.jsx(K,{models:B,selectedModel:o,onModelChange:n}),e.jsxs("span",{className:"ask-home-hint",children:["Via 🤗"," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]})]}),e.jsx("button",{type:"button",className:`chat-send${r.trim()?" chat-send-on":""}`,onClick:()=>f(),disabled:!r.trim()||l,"aria-label":"Ask the assistant",children:e.jsx(W,{})})]})]})},we=()=>{var T,w,v,P,A;const[a,r]=H(),m=ne(a.get("order_by")),o=oe(a.get("time")),n=a.get("has_code")==="true",l=a.get("has_hf_artifacts")==="true",c=se[o],h=s=>{const t=new URLSearchParams(a);t.set("order_by",s),r(t)},p=s=>{const t=new URLSearchParams(a);t.set("time",ee[s]),r(t)},f=s=>{const t=new URLSearchParams(a);s?t.set("has_code","true"):t.delete("has_code"),r(t)},i=s=>{const t=new URLSearchParams(a);s?t.set("has_hf_artifacts","true"):t.delete("has_hf_artifacts"),r(t)},j=L({queryKey:["top-tasks-sidebar"],queryFn:()=>S.getTopTasks({limit:8}),staleTime:10*60*1e3}),x=L({queryKey:["trending-tasks-sidebar"],queryFn:()=>S.getTrendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),d=V({page_size:30,order_by:m,order_dir:"desc",time:o,include_resources:!0,has_code:n,has_hf_artifacts:l}),y=u.useMemo(()=>{var t;return(((t=d.data)==null?void 0:t.pages.flatMap(R=>R.results))||[]).map(Q)},[d.data]),{targetRef:C,isIntersecting:b}=q({rootMargin:"400px"});u.useEffect(()=>{b&&d.hasNextPage&&!d.isFetchingNextPage&&d.fetchNextPage()},[b,d.hasNextPage,d.isFetchingNextPage]);const M=d.isLoading,D=d.error;return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Trending ",e.jsx("em",{children:"Research"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated daily from arXiv and Hugging Face"})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsxs("aside",{className:"sidebar",children:[e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),j.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,t)=>e.jsx(g,{className:"h-5 w-full"},t))}),(T=j.data)==null?void 0:T.map(s=>e.jsxs(N,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[E(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(N,{to:"/tasks",className:"sidebar-link",style:{marginTop:8,fontStyle:"italic"},children:"all domains →"})]}),e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),x.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,t)=>e.jsx(g,{className:"h-5 w-full"},t))}),((v=(w=x.data)==null?void 0:w.results)==null?void 0:v.length)===0&&!x.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(A=(P=x.data)==null?void 0:P.results)==null?void 0:A.map(s=>e.jsxs(N,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[E(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]})]}),e.jsxs("div",{children:[F()&&e.jsx(le,{}),e.jsxs("div",{className:"sort-bar home-feed-sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:Z.map(([s,t])=>e.jsx("button",{className:`sort-btn ${m===s?"active":""}`,onClick:()=>h(s),children:t},s))}),e.jsx(U,{hasCode:n,hasHfArtifacts:l,onHasCodeChange:f,onHasHfArtifactsChange:i})]}),e.jsx("div",{className:"sort-options sort-options-time",children:X.map(s=>e.jsx("button",{className:`sort-btn sort-btn-time ${c===s?"active":""}`,onClick:()=>p(s),children:s},s))})]}),D&&e.jsx(Y,{variant:"destructive",className:"mb-4",children:e.jsx(J,{children:"Failed to load papers. Please try again."})}),M?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,t)=>e.jsxs("div",{className:"paper-card",children:[e.jsx("div",{className:"paper-thumb-wrap",children:e.jsx(g,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(g,{className:"h-6 w-3/4"}),e.jsx(g,{className:"h-4 w-1/2"}),e.jsx(g,{className:"h-12 w-full"})]})]},t))}):y.length===0?e.jsx("div",{className:"no-results",children:"No papers in this window."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:y.map((s,t)=>e.jsx(I,{paper:s,rank:t+1},s.id))}),e.jsx("div",{ref:C,style:{height:1}}),d.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})};export{le as AskAssistant,we as default};
|
|
|
|
|
|
assets/FrameworksIndexView-DFIr-ZfH.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{u as d,j as e,L as o,R as m,b as p}from"./index-ChUK4pXW.js";import{u as h}from"./useQuery-CKrTCSf-.js";import{I as u}from"./components-Oks99QHA.js";import{c as g,h as f}from"./transform-CuJRPBDz.js";import"./LatexTitle-RPgzE218.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";const x={gpu:"GPU",cpu:"CPU",apple:"Apple silicon"},j={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},k={fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},_={fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},v={fontFamily:"var(--mono)",fontSize:13,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--ink)",marginBottom:6},b=({platform:r})=>{const n=g(f(r));return e.jsx("span",{className:"framework-platform-chip",style:{background:n.bg,color:n.text},children:x[r]})},w=({framework:r})=>{const n=d(),l=`/papers?framework=${encodeURIComponent(r.slug)}`;return e.jsxs("article",{id:`framework-${r.slug}`,className:"framework-card framework-card-clickable",role:"link",tabIndex:0,"aria-label":`View papers implemented by ${r.name}`,onClick:a=>{a.target.closest("a, button")||n(l)},onKeyDown:a=>{a.target===a.currentTarget&&(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),n(l))},children:[e.jsxs("div",{className:"framework-card-head",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"framework-card-name",children:r.name}),r.organization_name&&e.jsx("div",{className:"framework-card-org",children:r.organization_name})]}),r.platforms&&r.platforms.length>0&&e.jsx("div",{className:"framework-platform-row",children:r.platforms.map(a=>e.jsx(b,{platform:a},a))})]}),e.jsx("p",{className:"framework-card-desc",children:r.description}),r.when_to_use&&e.jsxs("div",{className:"framework-card-when",children:[e.jsx("span",{className:"framework-card-when-label",children:"When to use"}),r.when_to_use]}),(r.github_url||r.docs_url||r.introducing_paper_arxiv_id)&&e.jsxs("div",{className:"framework-card-links",children:[r.introducing_paper_arxiv_id&&e.jsx(o,{to:`/paper/${r.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"}),r.github_url&&r.paper_count>0&&e.jsxs(o,{to:l,className:"framework-link",children:["Implements ",r.paper_count," ",r.paper_count===1?"paper":"papers"]}),r.github_url&&r.paper_count===0&&e.jsx("span",{className:"framework-link framework-link-disabled","aria-disabled":"true",children:"Implements 0 papers"}),r.github_url&&e.jsxs("a",{href:r.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(u,{name:"github",size:13}),"GitHub"]}),r.docs_url&&r.docs_url!==r.github_url&&e.jsx("a",{href:r.docs_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:"Docs"})]})]})},B=()=>{var a;const r=h({queryKey:["framework-catalog"],queryFn:()=>p.getFrameworkCatalog()}),n=((a=r.data)==null?void 0:a.domains)??[],l=n.reduce((i,s)=>i+s.categories.reduce((t,c)=>t+c.frameworks.length,0),0);return m.useEffect(()=>{var s;const i=window.location.hash.slice(1);i&&((s=document.getElementById(i))==null||s.scrollIntoView())},[r.data]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Frameworks"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated libraries and tools to run, serve, and train models — pick the right stack for your hardware and workload."})]})}),r.isLoading&&e.jsx("div",{className:"empty",children:"Loading frameworks…"}),r.isError&&e.jsx("div",{className:"empty",children:"Could not load frameworks."}),n.map(i=>e.jsxs("section",{style:{marginBottom:56},children:[e.jsxs("div",{style:j,children:[e.jsxs("div",{children:[e.jsx("h2",{style:k,children:i.name}),e.jsx("div",{style:_,children:i.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[i.categories.length," ",i.categories.length===1?"category":"categories"," ·"," ",i.categories.reduce((s,t)=>s+t.frameworks.length,0)," frameworks"]})]}),i.categories.map(s=>e.jsxs("div",{className:"framework-category",children:[e.jsxs("div",{className:"framework-category-head",children:[e.jsxs("div",{children:[e.jsx("h3",{style:v,children:s.name}),s.description&&e.jsx("p",{className:"framework-category-blurb",children:s.description}),s.guide_url&&e.jsxs("a",{href:s.guide_url,target:"_blank",rel:"noopener noreferrer",className:"framework-guide-link",children:[s.guide_label??"Read guide"," →"]})]}),e.jsxs("div",{className:"framework-category-meta",children:[s.frameworks.length," ",s.frameworks.length===1?"framework":"frameworks"]})]}),e.jsx("div",{className:"framework-grid",children:s.frameworks.map(t=>e.jsx(w,{framework:t},t.slug))})]},s.slug))]},i.slug)),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:8},children:[l," frameworks across ",n.length," ",n.length===1?"domain":"domains",". More areas coming soon."]})]})};export{w as FrameworkCard,B as default};
|
assets/FrameworksIndexView-cSMnT2di.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{u as d,j as e,L as o,R as m,b as p}from"./index-C--7Ookn.js";import{u as h}from"./useQuery-DFn3_KAa.js";import{I as u}from"./components-KzuuRgbc.js";import{c as g,h as f}from"./transform-BfLoZuxV.js";import"./useBaseQuery-CPtz5T_6.js";import"./LatexTitle-CTfnj_ow.js";import"./katex.min-BSBacQyE.js";const x={gpu:"GPU",cpu:"CPU",apple:"Apple silicon"},j={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},k={fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},_={fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},v={fontFamily:"var(--mono)",fontSize:13,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--ink)",marginBottom:6},b=({platform:r})=>{const n=g(f(r));return e.jsx("span",{className:"framework-platform-chip",style:{background:n.bg,color:n.text},children:x[r]})},w=({framework:r})=>{const n=d(),l=`/papers?framework=${encodeURIComponent(r.slug)}`;return e.jsxs("article",{id:`framework-${r.slug}`,className:"framework-card framework-card-clickable",role:"link",tabIndex:0,"aria-label":`View papers implemented by ${r.name}`,onClick:a=>{a.target.closest("a, button")||n(l)},onKeyDown:a=>{a.target===a.currentTarget&&(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),n(l))},children:[e.jsxs("div",{className:"framework-card-head",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"framework-card-name",children:r.name}),r.organization_name&&e.jsx("div",{className:"framework-card-org",children:r.organization_name})]}),r.platforms&&r.platforms.length>0&&e.jsx("div",{className:"framework-platform-row",children:r.platforms.map(a=>e.jsx(b,{platform:a},a))})]}),e.jsx("p",{className:"framework-card-desc",children:r.description}),r.when_to_use&&e.jsxs("div",{className:"framework-card-when",children:[e.jsx("span",{className:"framework-card-when-label",children:"When to use"}),r.when_to_use]}),(r.github_url||r.docs_url||r.introducing_paper_arxiv_id)&&e.jsxs("div",{className:"framework-card-links",children:[r.introducing_paper_arxiv_id&&e.jsx(o,{to:`/paper/${r.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"}),r.github_url&&r.paper_count>0&&e.jsxs(o,{to:l,className:"framework-link",children:["Implements ",r.paper_count," ",r.paper_count===1?"paper":"papers"]}),r.github_url&&r.paper_count===0&&e.jsx("span",{className:"framework-link framework-link-disabled","aria-disabled":"true",children:"Implements 0 papers"}),r.github_url&&e.jsxs("a",{href:r.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(u,{name:"github",size:13}),"GitHub"]}),r.docs_url&&r.docs_url!==r.github_url&&e.jsx("a",{href:r.docs_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:"Docs"})]})]})},B=()=>{var a;const r=h({queryKey:["framework-catalog"],queryFn:()=>p.getFrameworkCatalog()}),n=((a=r.data)==null?void 0:a.domains)??[],l=n.reduce((i,s)=>i+s.categories.reduce((t,c)=>t+c.frameworks.length,0),0);return m.useEffect(()=>{var s;const i=window.location.hash.slice(1);i&&((s=document.getElementById(i))==null||s.scrollIntoView())},[r.data]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Frameworks"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated libraries and tools to run, serve, and train models — pick the right stack for your hardware and workload."})]})}),r.isLoading&&e.jsx("div",{className:"empty",children:"Loading frameworks…"}),r.isError&&e.jsx("div",{className:"empty",children:"Could not load frameworks."}),n.map(i=>e.jsxs("section",{style:{marginBottom:56},children:[e.jsxs("div",{style:j,children:[e.jsxs("div",{children:[e.jsx("h2",{style:k,children:i.name}),e.jsx("div",{style:_,children:i.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[i.categories.length," ",i.categories.length===1?"category":"categories"," ·"," ",i.categories.reduce((s,t)=>s+t.frameworks.length,0)," frameworks"]})]}),i.categories.map(s=>e.jsxs("div",{className:"framework-category",children:[e.jsxs("div",{className:"framework-category-head",children:[e.jsxs("div",{children:[e.jsx("h3",{style:v,children:s.name}),s.description&&e.jsx("p",{className:"framework-category-blurb",children:s.description}),s.guide_url&&e.jsxs("a",{href:s.guide_url,target:"_blank",rel:"noopener noreferrer",className:"framework-guide-link",children:[s.guide_label??"Read guide"," →"]})]}),e.jsxs("div",{className:"framework-category-meta",children:[s.frameworks.length," ",s.frameworks.length===1?"framework":"frameworks"]})]}),e.jsx("div",{className:"framework-grid",children:s.frameworks.map(t=>e.jsx(w,{framework:t},t.slug))})]},s.slug))]},i.slug)),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:8},children:[l," frameworks across ",n.length," ",n.length===1?"domain":"domains",". More areas coming soon."]})]})};export{w as FrameworkCard,B as default};
|
|
|
|
|
|
assets/{LatexTitle-CTfnj_ow.js → LatexTitle-RPgzE218.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{j as o,r as g}from"./index-
|
|
|
|
| 1 |
+
import{j as o,r as g}from"./index-ChUK4pXW.js";import{k as T}from"./katex.min-BSBacQyE.js";const j=new Set([",",";",":","!"," ","quad","qquad","enspace","thinspace"]),C={a:"á",e:"é",i:"í",o:"ó",u:"ú",y:"ý",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú",Y:"Ý"},M={a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"},_={a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"},b={a:"ä",e:"ë",i:"ï",o:"ö",u:"ü",y:"ÿ",A:"Ä",E:"Ë",I:"Ï",O:"Ö",U:"Ü",Y:"Ÿ"},O={"'":C,"`":M,"^":_,'"':b,"~":{n:"ñ",N:"Ñ"}},E={ss:"ß",ae:"æ",AE:"Æ",oe:"œ",OE:"Œ",o:"ø",O:"Ø",l:"ł",L:"Ł"};function S(e,s){var n;return((n=O[e])==null?void 0:n[s])??null}function N(e){const s=[];let n=0,i="";const l=()=>{i&&(s.push({type:"text",content:i}),i="")};for(;n<e.length;){if(e[n]==="$"&&e[n+1]==="$"){l();const t=e.indexOf("$$",n+2);if(t===-1){i+=e.slice(n);break}s.push({type:"display",content:e.slice(n+2,t)}),n=t+2;continue}if(e[n]==="$"){l();const t=e.indexOf("$",n+1);if(t===-1){i+=e.slice(n);break}s.push({type:"inline",content:e.slice(n+1,t)}),n=t+1;continue}i+=e[n],n+=1}return l(),s}function d(e,s){if(e[s]!=="{")return null;let n=0;for(let i=s;i<e.length;i+=1)if(e[i]==="{")n+=1;else if(e[i]==="}"&&(n-=1,n===0))return{content:e.slice(s+1,i),end:i+1};return null}function $(e,s){let n=s+1;if(n>=e.length)return{name:"",end:n};if(!/[a-zA-Z]/.test(e[n]))return{name:e[n],end:n+1};const i=n;for(;n<e.length&&/[a-zA-Z]/.test(e[n]);)n+=1;return{name:e.slice(i,n),end:n}}function w(e,s){const n=e[s];if(n!=="^"&&n!=="_"||s+1>=e.length)return null;if(e[s+1]==="{"){const i=d(e,s+1);return i?{end:i.end}:null}return/[A-Za-z0-9+\-=.]/.test(e[s+1])?{end:s+2}:null}function y(e,s){let n=s;if(e[n]==="\\"){const{name:t,end:a}=$(e,n);if(!t)return null;if(n=a,e[n]==="{"){const f=d(e,n);f&&(n=f.end)}}else if(/[A-Za-z0-9]/.test(e[n])){let t=n+1;for(;t<e.length&&/[A-Za-z0-9]/.test(e[t]);)t+=1;if(e[t]!=="^"&&e[t]!=="_")return null;n=t}else return null;const i=s;let l=0;for(;n<e.length;){const t=w(e,n);if(!t)break;l+=1,n=t.end}return l===0?null:{latex:e.slice(i,n),end:n}}function p(e,s){const n=[];let i=0,l=0;const t=()=>`${s}-${l++}`,a=(f,u)=>f==="strong"?o.jsx("strong",{children:u},t()):o.jsx("em",{children:u},t());for(;i<e.length;){if(e[i]==="\\"){const{name:c,end:L}=$(e,i);if(i=L,E[c]){n.push(E[c]);continue}if(c.length===1&&i<e.length&&/[A-Za-z]/.test(e[i])){const r=S(c,e[i]);if(r){n.push(r),i+=1;continue}}if(c==="c"){const r=d(e,i);if((r==null?void 0:r.content.length)===1){const h={c:"ç",C:"Ç"}[r.content];if(h){n.push(h),i=r.end;continue}}}if(c==="textbf"||c==="mathbf"){const r=d(e,i);if(r){i=r.end,n.push(a("strong",p(r.content,t())));continue}}if(c==="emph"||c==="textit"||c==="textsl"||c==="texttt"){const r=d(e,i);if(r){i=r.end,n.push(a("em",p(r.content,t())));continue}}if(c==="color"||c==="textcolor"){const r=d(e,i);if(r){i=r.end;const h=d(e,i);h&&(i=h.end,n.push(...p(h.content,t())));continue}}if(j.has(c)){n.push(" ");continue}if(c==="~"){n.push(" ");continue}const m=d(e,i);if(m){i=m.end,n.push(...p(m.content,t()));continue}n.push(`\\${c}`);continue}if(e[i]==="~"){n.push(" "),i+=1;continue}const f=y(e,i);if(f){n.push(o.jsx(A,{latex:f.latex,display:!1},t())),i=f.end;continue}let u=i;for(;u<e.length&&e[u]!=="\\"&&e[u]!=="~"&&!y(e,u);)u+=1;u>i&&n.push(e.slice(i,u)),i=u}return n}function A({latex:e,display:s}){const n=g.useMemo(()=>{try{return T.renderToString(e.trim(),{displayMode:s,throwOnError:!1})}catch{return null}},[e,s]);return n?o.jsx("span",{className:s?"katex-display":void 0,dangerouslySetInnerHTML:{__html:n}}):o.jsx(o.Fragment,{children:s?`$$${e}$$`:`$${e}$`})}function k(e){const s=N(e),n=[];return s.forEach((i,l)=>{const t=`latex-${l}`;if(i.type==="text"){const a=p(i.content,t);a.length===1?n.push(a[0]):a.length>1&&n.push(o.jsx(g.Fragment,{children:a},t));return}if(i.type==="display"){n.push(o.jsx(A,{latex:i.content,display:!0},t));return}n.push(o.jsx(A,{latex:i.content,display:!1},t))}),n.length===1?n[0]:o.jsx(o.Fragment,{children:n})}const U=({text:e,className:s=""})=>{const n=g.useMemo(()=>k(e),[e]);return o.jsx("span",{className:s,children:n})},X=({title:e,className:s=""})=>o.jsx(U,{text:e,className:s});export{X as L,U as a};
|
assets/{MarkdownText-BGIn3wwa.js → MarkdownText-DnDQoKAJ.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{Y as l,j as s,L as u}from"./index-
|
|
|
|
| 1 |
+
import{Y as l,j as s,L as u}from"./index-ChUK4pXW.js";import"./katex.min-BSBacQyE.js";import{r as p,a as m,P as h}from"./PaperPreviewLink-BPqigL3n.js";import{M as d,r as w}from"./index-CW8TvXfJ.js";const x=new Set(["paperswithcode.co","www.paperswithcode.co","localhost","127.0.0.1","167.235.148.241"]),P=["/methods","/paper","/papers","/tasks","/benchmark","/conferences"];function f(n,o=window.location.origin){if(!n)return null;let t;if(n.startsWith("/"))t=n;else try{const r=new URL(n,o);if(!x.has(r.hostname))return null;t=`${r.pathname}${r.search}${r.hash}`}catch{return null}const e=t.split(/[?#]/,1)[0];return P.some(r=>e===r||e.startsWith(`${r}/`))?t:null}function k(n){const t=n.split(/[?#]/,1)[0].match(/^\/papers?\/([^/]+)$/);if(!t||t[1].includes("%"))return null;const e=t[1],r=/^\d{4}[.-]\d{4,5}(?:v\d+)?$/.test(e),a=/^[1-9]\d*$/.test(e);return!r&&!a?null:l(e)}const E=({text:n,className:o=""})=>s.jsx("div",{className:o,children:s.jsx(d,{remarkPlugins:[w,m],rehypePlugins:[p],components:{a:({href:t,children:e,node:r,...a})=>{const i=f(t);if(i){const c=k(i);return c?s.jsx(h,{routeId:c,to:i,...a,children:e}):s.jsx(u,{to:i,...a,children:e})}return s.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",...a,children:e})}},children:n})});export{E as M};
|
assets/MethodDetailView-DVg6tdK9.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{j as e,r as L,e as Q,a as U,L as H,b as y,ao as G}from"./index-C--7Ookn.js";import{u as M}from"./useQuery-DFn3_KAa.js";import{u as W}from"./useInfiniteQuery-DcxJ3elC.js";import{M as Z,P as V}from"./components-KzuuRgbc.js";import{u as X,P as Y}from"./useIntersectionObserver-BFYx46oo.js";import{M as R}from"./MarkdownText-BGIn3wwa.js";import{s as J}from"./slug-BpH-Nkvz.js";import{t as ee}from"./transform-BfLoZuxV.js";import{S as A}from"./skeleton-r_i4hk58.js";import{A as te,a as se}from"./alert-CThmjBPy.js";import"./useBaseQuery-CPtz5T_6.js";import"./LatexTitle-CTfnj_ow.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-n0bYaW06.js";import"./index-C0jd_q9w.js";import"./hover-card-1g79nCeQ.js";const s={pink:"#F8D7D9",pinkS:"#D9B0B3",yellow:"#FBEFC2",yellowS:"#C9B97D",orange:"#F8D7B3",orangeS:"#C99466",blue:"#CDE2EE",blueS:"#7FA4BA",purple:"#D4D2EA",purpleS:"#8E8AC0",green:"#CCE2C5",greenS:"#7DA475",ink:"#1A1814",faint:"#8E8678"},j=({x:t,y:a,w:o,h:l,fill:f,stroke:u,label:x,fontSize:d=10,multiline:_})=>e.jsxs("g",{children:[e.jsx("rect",{x:t,y:a,width:o,height:l,rx:"3",ry:"3",fill:f,stroke:u,strokeWidth:"1"}),_?e.jsxs(e.Fragment,{children:[e.jsx("text",{x:t+o/2,y:a+l/2-2,fontSize:d,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:_[0]}),e.jsx("text",{x:t+o/2,y:a+l/2+d-1,fontSize:d,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:_[1]})]}):e.jsx("text",{x:t+o/2,y:a+l/2,fontSize:d,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:x})]}),ae=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(j,{x:140,y:40,w:80,h:26,fill:s.yellow,stroke:s.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:s.ink}),e.jsx(j,{x:140,y:80,w:80,h:26,fill:s.green,stroke:s.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:s.ink}),e.jsx(j,{x:140,y:120,w:80,h:26,fill:s.purple,stroke:s.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:s.ink}),e.jsx(j,{x:140,y:160,w:80,h:26,fill:s.blue,stroke:s.blueS,label:"Scale ÷√dₖ",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:s.ink}),e.jsx(j,{x:140,y:200,w:80,h:26,fill:s.yellow,stroke:s.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:s.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:s.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:s.ink}),e.jsx(j,{x:100,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"Q",fontSize:13}),e.jsx(j,{x:160,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"K",fontSize:13}),e.jsx(j,{x:220,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),re=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],ne=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:s.faint,strokeWidth:"1"}),re.map(([t,a],o)=>{const l=92+o*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:l,fontSize:"11",fontFamily:"var(--mono)",fill:s.ink,dominantBaseline:"middle",children:t}),a?e.jsx("text",{x:"138",y:l,fontSize:"8.5",fontFamily:"var(--mono)",fill:s.faint,dominantBaseline:"middle",children:a}):null]},t)})]}),ie={attention:ae,"agent-skills":ne},le=({method:t})=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.faint,textAnchor:"middle",children:t.name||"method"}),e.jsx(j,{x:80,y:70,w:200,h:50,fill:s.blue,stroke:s.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:s.ink}),e.jsx(j,{x:80,y:150,w:200,h:70,fill:s.orange,stroke:s.orangeS,label:t.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:s.ink}),e.jsx(j,{x:80,y:250,w:200,h:50,fill:s.purple,stroke:s.purpleS,label:"Output",fontSize:12})]}),oe=({method:t})=>{const a=(t.slug||"").toLowerCase(),o=ie[a];if(o)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(o,{})});if(t.image_url){const l=a==="transformer"||a==="gpt-4"||a==="gpt-4o"||a==="multi-head-attention"?" method-figure-svg--compact":a==="rpn"?" method-figure-svg--scaled-80":"";return e.jsx("div",{className:`method-figure-svg method-figure-svg--image${l}`,children:e.jsx("img",{className:"method-figure-img",src:t.image_url,alt:`${t.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(le,{method:t})})},D=720,T=138,g={top:8,right:10,bottom:25,left:36},q=56,de=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),ce=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),B=t=>de.format(new Date(`${t}T00:00:00Z`)),me=(t,a)=>{if(t===0)return new Set;const o=t>48?12:t>36?6:t>18?3:2,l=Math.max(1,Math.ceil(q/a)),f=Math.max(o,l),u=t-1,x=new Set([0,u]);for(let d=f;d<u;d+=f)(u-d)*a>=q&&x.add(d);return x},O=t=>{if(t.coverage_status===void 0||["complete","not_applicable"].includes(t.coverage_status))return null;const a=t.processed_paper_count!==void 0&&t.eligible_paper_count!==void 0?`; ${t.processed_paper_count.toLocaleString()} of ${t.eligible_paper_count.toLocaleString()} eligible papers processed`:"";return`Historical tagging ${t.coverage_status==="failed"?"needs retry":"in progress"}${a}`},he=({history:t,methodName:a})=>{const[o,l]=L.useState(null),f=Math.max(1,...t.map(r=>r.paper_count)),u=D-g.left-g.right,x=T-g.top-g.bottom,d=t.length?u/t.length:u,_=Math.max(2,d*.68),c=me(t.length,d),P=Array.from(new Set([0,Math.ceil(f/2),f])),m=o==null?null:t[o],v=m?O(m):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${D} ${T}`,role:"group","aria-label":`${a}: papers mentioning this method by publication month`,children:[e.jsxs("title",{children:[a,": papers mentioning this method by publication month"]}),P.map(r=>{const p=g.top+x-r/f*x;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:g.left,x2:D-g.right,y1:p,y2:p}),e.jsx("text",{className:"method-usage-y-label",x:g.left-8,y:p+3,textAnchor:"end",children:r})]},r)}),t.map((r,p)=>{const S=r.paper_count/f*x,b=r.paper_count>0?Math.max(1,S):0,w=g.left+d*p+(d-_)/2,n=g.top+x-b,N=o===p,F=p===t.length-1,k=O(r);return e.jsxs("g",{className:`method-usage-bar${N?" is-active":""}${F?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${B(r.start_date)}: ${r.paper_count} ${r.paper_count===1?"paper":"papers"}${k?`. ${k}`:""}`,onMouseEnter:()=>l(p),onMouseLeave:()=>l(null),onFocus:()=>l(p),onBlur:()=>l(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:g.left+d*p,y:g.top,width:d,height:x}),e.jsx("rect",{className:"method-usage-bar-mark",x:w,y:n,width:_,height:b,rx:"1.5"})]},r.start_date)}),t.map((r,p)=>c.has(p)?e.jsx("text",{className:"method-usage-x-label",x:g.left+d*(p+.5),y:T-11,textAnchor:"middle",children:t.length>48?ce.format(new Date(`${r.start_date}T00:00:00Z`)):B(r.start_date)},r.start_date):null)]}),m&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:B(m.start_date)}),e.jsxs("span",{children:[m.paper_count," ",m.paper_count===1?"paper":"papers",o===t.length-1?" · month to date":""]}),e.jsxs("span",{children:[(m.catalog_share??0).toFixed(2),"% of"," ",(m.catalog_paper_count??0).toLocaleString()," catalog papers"]}),v&&e.jsx("span",{children:v})]})]})},pe=[["trending","trending"],["new","newest"],["cited","most cited"]],K={"on-policy-distillation":["fine-tuning","post-training","rlvr","rlhf","direct-preference-optimization-dpo"],mcp:["agent-skills"],"agent-skills":["mcp"]},Le=()=>{var F,k,E,I,z,$;const{methodSlug:t}=Q(),[a,o]=U(),[l,f]=L.useState("trending"),u=a.get("has_code")==="true",x=a.get("has_hf_artifacts")==="true",d=i=>{const h=new URLSearchParams(a);i?h.set("has_code","true"):h.delete("has_code"),o(h)},_=i=>{const h=new URLSearchParams(a);i?h.set("has_hf_artifacts","true"):h.delete("has_hf_artifacts"),o(h)},c=M({queryKey:["method",t],queryFn:()=>y.getMethod(t),enabled:!!t,staleTime:10*60*1e3}),P=M({queryKey:["areas-all"],queryFn:()=>y.getAreas({page_size:50,ordering:"name"}),enabled:!!((F=c.data)!=null&&F.area_id),staleTime:10*60*1e3}),m=M({queryKey:["method-trend",t],queryFn:()=>y.getMethodTrend(t),enabled:!!t&&!!c.data,staleTime:10*60*1e3}),v=l==="trending"?"trending":l==="cited"?"citation_count":"date_published",r=W({queryKey:["method-papers-infinite",t,v,u,x],queryFn:({pageParam:i=1})=>y.getMethodPapers(t,{page:i,page_size:20,order_by:v,order_dir:"desc",include_resources:!0,has_code:u,has_hf_artifacts:x}),getNextPageParam:i=>i.next_page,initialPageParam:1,enabled:!!t,staleTime:5*60*1e3,placeholderData:G}),p=M({queryKey:["related-methods",(k=c.data)==null?void 0:k.slug,(E=c.data)==null?void 0:E.area_id,(I=c.data)==null?void 0:I.id],queryFn:async()=>{const i=K[c.data.slug];return i?Promise.all(i.map(C=>y.getMethod(C))):(await y.getMethods({area_id:c.data.area_id,exclude_id:c.data.id,ordering:"-paper_count",page_size:8})).results},enabled:!!c.data&&(!!K[c.data.slug]||!!c.data.area_id),staleTime:10*60*1e3}),S=L.useMemo(()=>{var h;return(((h=r.data)==null?void 0:h.pages.flatMap(C=>C.results))||[]).map(ee)},[r.data]),{targetRef:b,isIntersecting:w}=X({rootMargin:"200px"});if(L.useEffect(()=>{w&&r.hasNextPage&&!r.isFetchingNextPage&&r.fetchNextPage()},[w,r.hasNextPage,r.isFetchingNextPage]),c.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(A,{className:"h-12 w-1/2 mb-4"}),e.jsx(A,{className:"h-64 w-full"})]});if(c.error||!c.data)return e.jsx("div",{className:"page",children:e.jsx(te,{variant:"destructive",children:e.jsx(se,{children:"Method not found."})})});const n=c.data,N=(z=P.data)==null?void 0:z.results.find(i=>i.id===n.area_id);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(H,{to:"/methods",children:"Methods"}),N&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(H,{to:`/methods#area-${J(N.name)}`,children:N.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:n.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${n.slug==="grokking"||n.slug==="latent-reasoning"?" method-hero-grid--wide-figure":""}`,children:[e.jsxs("div",{children:[e.jsx("div",{className:"tag-hero-eyebrow",children:"METHOD"}),e.jsx("h1",{className:"tag-hero-title method-hero-title",children:n.name}),n.full_name&&n.full_name!==n.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:n.full_name}),n.description&&e.jsx(R,{className:"method-description",text:n.description}),n.source_url&&n.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),e.jsxs("a",{className:"method-source-link",href:n.source_url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:n.source_title}),n.introduced_year&&e.jsx("span",{className:"method-source-meta",children:n.introduced_year})]})]}),e.jsxs("div",{className:"tag-hero-meta",children:[e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Papers mentioning"}),e.jsx("span",{className:"value",children:(n.paper_count??0).toLocaleString()})]}),m.data&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Recent mentions"}),e.jsx("span",{className:"value",children:m.data.comparison_complete?e.jsxs(e.Fragment,{children:[m.data.trend_score.toFixed(1),e.jsx("small",{children:"/mo"})]}):"Pending"})]}),n.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:n.introduced_year})]})]}),m.isLoading?e.jsx(A,{className:"h-36 w-full method-trend-skeleton"}):m.data?e.jsxs("section",{className:"method-trend-panel method-trend-panel--compact",children:[e.jsxs("div",{className:"method-trend-header",children:[e.jsx("div",{children:e.jsx("div",{className:"method-trend-eyebrow",children:"Usage trend"})}),e.jsxs("div",{className:"method-trend-summary",children:[e.jsx("strong",{children:m.data.recent_paper_count}),e.jsxs("span",{children:["papers / ",m.data.recent_days,"d"]})]})]}),e.jsx(he,{history:m.data.history,methodName:n.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(oe,{method:n}),n.image_credit&&e.jsx("figcaption",{children:e.jsx(R,{className:"method-image-credit",text:n.image_credit})})]})]}),((($=p.data)==null?void 0:$.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),p.data.map(i=>e.jsx(Z,{method:{slug:i.slug,name:i.name}},i.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:pe.map(([i,h])=>e.jsx("button",{className:`sort-btn ${l===i?"active":""}`,onClick:()=>f(i),children:h},i))}),e.jsx(Y,{hasCode:u,hasHfArtifacts:x,onHasCodeChange:d,onHasHfArtifactsChange:_})]}),e.jsxs("div",{className:"results-count",children:[S.length," papers mentioning ",n.name]})]}),r.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,h)=>e.jsx(A,{className:"h-40 w-full"},h))}):S.length===0?e.jsx("div",{className:"no-results",children:"No papers tagged with this method yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:S.map((i,h)=>e.jsx(V,{paper:i,rank:h+1},i.id))}),e.jsx("div",{ref:b,style:{height:1}}),r.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{Le as default};
|
|
|
|
|
|
assets/MethodDetailView-Dt1BuIWd.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{j as e,r as L,e as Q,a as U,L as H,b as y,ao as G}from"./index-ChUK4pXW.js";import{u as M}from"./useQuery-CKrTCSf-.js";import{u as W}from"./useInfiniteQuery-DflNwjnr.js";import{M as Z,P as V}from"./components-Oks99QHA.js";import{u as X,P as Y}from"./useIntersectionObserver-Bm84xMAC.js";import{M as R}from"./MarkdownText-DnDQoKAJ.js";import{s as J}from"./slug-BpH-Nkvz.js";import{t as ee}from"./transform-CuJRPBDz.js";import{S as A}from"./skeleton-qvDYp1rq.js";import{A as te,a as se}from"./alert-DNLHMDlv.js";import{s as ae}from"./safeExternalHref-CkBrsh84.js";import"./LatexTitle-RPgzE218.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-BPqigL3n.js";import"./index-CW8TvXfJ.js";import"./hover-card-D4KxxydT.js";const s={pink:"#F8D7D9",pinkS:"#D9B0B3",yellow:"#FBEFC2",yellowS:"#C9B97D",orange:"#F8D7B3",orangeS:"#C99466",blue:"#CDE2EE",blueS:"#7FA4BA",purple:"#D4D2EA",purpleS:"#8E8AC0",green:"#CCE2C5",greenS:"#7DA475",ink:"#1A1814",faint:"#8E8678"},j=({x:t,y:a,w:o,h:l,fill:f,stroke:u,label:x,fontSize:d=10,multiline:_})=>e.jsxs("g",{children:[e.jsx("rect",{x:t,y:a,width:o,height:l,rx:"3",ry:"3",fill:f,stroke:u,strokeWidth:"1"}),_?e.jsxs(e.Fragment,{children:[e.jsx("text",{x:t+o/2,y:a+l/2-2,fontSize:d,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:_[0]}),e.jsx("text",{x:t+o/2,y:a+l/2+d-1,fontSize:d,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:_[1]})]}):e.jsx("text",{x:t+o/2,y:a+l/2,fontSize:d,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:x})]}),re=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(j,{x:140,y:40,w:80,h:26,fill:s.yellow,stroke:s.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:s.ink}),e.jsx(j,{x:140,y:80,w:80,h:26,fill:s.green,stroke:s.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:s.ink}),e.jsx(j,{x:140,y:120,w:80,h:26,fill:s.purple,stroke:s.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:s.ink}),e.jsx(j,{x:140,y:160,w:80,h:26,fill:s.blue,stroke:s.blueS,label:"Scale ÷√dₖ",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:s.ink}),e.jsx(j,{x:140,y:200,w:80,h:26,fill:s.yellow,stroke:s.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:s.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:s.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:s.ink}),e.jsx(j,{x:100,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"Q",fontSize:13}),e.jsx(j,{x:160,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"K",fontSize:13}),e.jsx(j,{x:220,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),ne=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],ie=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:s.faint,strokeWidth:"1"}),ne.map(([t,a],o)=>{const l=92+o*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:l,fontSize:"11",fontFamily:"var(--mono)",fill:s.ink,dominantBaseline:"middle",children:t}),a?e.jsx("text",{x:"138",y:l,fontSize:"8.5",fontFamily:"var(--mono)",fill:s.faint,dominantBaseline:"middle",children:a}):null]},t)})]}),le={attention:re,"agent-skills":ie},oe=({method:t})=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.faint,textAnchor:"middle",children:t.name||"method"}),e.jsx(j,{x:80,y:70,w:200,h:50,fill:s.blue,stroke:s.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:s.ink}),e.jsx(j,{x:80,y:150,w:200,h:70,fill:s.orange,stroke:s.orangeS,label:t.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:s.ink}),e.jsx(j,{x:80,y:250,w:200,h:50,fill:s.purple,stroke:s.purpleS,label:"Output",fontSize:12})]}),de=({method:t})=>{const a=(t.slug||"").toLowerCase(),o=le[a];if(o)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(o,{})});if(t.image_url){const l=a==="transformer"||a==="gpt-4"||a==="gpt-4o"||a==="multi-head-attention"?" method-figure-svg--compact":a==="rpn"?" method-figure-svg--scaled-80":"";return e.jsx("div",{className:`method-figure-svg method-figure-svg--image${l}`,children:e.jsx("img",{className:"method-figure-img",src:t.image_url,alt:`${t.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(oe,{method:t})})},D=720,E=138,g={top:8,right:10,bottom:25,left:36},q=56,ce=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),me=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),T=t=>ce.format(new Date(`${t}T00:00:00Z`)),he=(t,a)=>{if(t===0)return new Set;const o=t>48?12:t>36?6:t>18?3:2,l=Math.max(1,Math.ceil(q/a)),f=Math.max(o,l),u=t-1,x=new Set([0,u]);for(let d=f;d<u;d+=f)(u-d)*a>=q&&x.add(d);return x},O=t=>{if(t.coverage_status===void 0||["complete","not_applicable"].includes(t.coverage_status))return null;const a=t.processed_paper_count!==void 0&&t.eligible_paper_count!==void 0?`; ${t.processed_paper_count.toLocaleString()} of ${t.eligible_paper_count.toLocaleString()} eligible papers processed`:"";return`Historical tagging ${t.coverage_status==="failed"?"needs retry":"in progress"}${a}`},pe=({history:t,methodName:a})=>{const[o,l]=L.useState(null),f=Math.max(1,...t.map(r=>r.paper_count)),u=D-g.left-g.right,x=E-g.top-g.bottom,d=t.length?u/t.length:u,_=Math.max(2,d*.68),c=he(t.length,d),P=Array.from(new Set([0,Math.ceil(f/2),f])),m=o==null?null:t[o],v=m?O(m):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${D} ${E}`,role:"group","aria-label":`${a}: papers mentioning this method by publication month`,children:[e.jsxs("title",{children:[a,": papers mentioning this method by publication month"]}),P.map(r=>{const p=g.top+x-r/f*x;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:g.left,x2:D-g.right,y1:p,y2:p}),e.jsx("text",{className:"method-usage-y-label",x:g.left-8,y:p+3,textAnchor:"end",children:r})]},r)}),t.map((r,p)=>{const S=r.paper_count/f*x,b=r.paper_count>0?Math.max(1,S):0,w=g.left+d*p+(d-_)/2,n=g.top+x-b,N=o===p,F=p===t.length-1,k=O(r);return e.jsxs("g",{className:`method-usage-bar${N?" is-active":""}${F?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${T(r.start_date)}: ${r.paper_count} ${r.paper_count===1?"paper":"papers"}${k?`. ${k}`:""}`,onMouseEnter:()=>l(p),onMouseLeave:()=>l(null),onFocus:()=>l(p),onBlur:()=>l(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:g.left+d*p,y:g.top,width:d,height:x}),e.jsx("rect",{className:"method-usage-bar-mark",x:w,y:n,width:_,height:b,rx:"1.5"})]},r.start_date)}),t.map((r,p)=>c.has(p)?e.jsx("text",{className:"method-usage-x-label",x:g.left+d*(p+.5),y:E-11,textAnchor:"middle",children:t.length>48?me.format(new Date(`${r.start_date}T00:00:00Z`)):T(r.start_date)},r.start_date):null)]}),m&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:T(m.start_date)}),e.jsxs("span",{children:[m.paper_count," ",m.paper_count===1?"paper":"papers",o===t.length-1?" · month to date":""]}),e.jsxs("span",{children:[(m.catalog_share??0).toFixed(2),"% of"," ",(m.catalog_paper_count??0).toLocaleString()," catalog papers"]}),v&&e.jsx("span",{children:v})]})]})},xe=[["trending","trending"],["new","newest"],["cited","most cited"]],K={"on-policy-distillation":["fine-tuning","post-training","rlvr","rlhf","direct-preference-optimization-dpo"],mcp:["agent-skills"],"agent-skills":["mcp"]},Pe=()=>{var F,k,B,I,z,$;const{methodSlug:t}=Q(),[a,o]=U(),[l,f]=L.useState("trending"),u=a.get("has_code")==="true",x=a.get("has_hf_artifacts")==="true",d=i=>{const h=new URLSearchParams(a);i?h.set("has_code","true"):h.delete("has_code"),o(h)},_=i=>{const h=new URLSearchParams(a);i?h.set("has_hf_artifacts","true"):h.delete("has_hf_artifacts"),o(h)},c=M({queryKey:["method",t],queryFn:()=>y.getMethod(t),enabled:!!t,staleTime:10*60*1e3}),P=M({queryKey:["areas-all"],queryFn:()=>y.getAreas({page_size:50,ordering:"name"}),enabled:!!((F=c.data)!=null&&F.area_id),staleTime:10*60*1e3}),m=M({queryKey:["method-trend",t],queryFn:()=>y.getMethodTrend(t),enabled:!!t&&!!c.data,staleTime:10*60*1e3}),v=l==="trending"?"trending":l==="cited"?"citation_count":"date_published",r=W({queryKey:["method-papers-infinite",t,v,u,x],queryFn:({pageParam:i=1})=>y.getMethodPapers(t,{page:i,page_size:20,order_by:v,order_dir:"desc",include_resources:!0,has_code:u,has_hf_artifacts:x}),getNextPageParam:i=>i.next_page,initialPageParam:1,enabled:!!t,staleTime:5*60*1e3,placeholderData:G}),p=M({queryKey:["related-methods",(k=c.data)==null?void 0:k.slug,(B=c.data)==null?void 0:B.area_id,(I=c.data)==null?void 0:I.id],queryFn:async()=>{const i=K[c.data.slug];return i?Promise.all(i.map(C=>y.getMethod(C))):(await y.getMethods({area_id:c.data.area_id,exclude_id:c.data.id,ordering:"-paper_count",page_size:8})).results},enabled:!!c.data&&(!!K[c.data.slug]||!!c.data.area_id),staleTime:10*60*1e3}),S=L.useMemo(()=>{var h;return(((h=r.data)==null?void 0:h.pages.flatMap(C=>C.results))||[]).map(ee)},[r.data]),{targetRef:b,isIntersecting:w}=X({rootMargin:"200px"});if(L.useEffect(()=>{w&&r.hasNextPage&&!r.isFetchingNextPage&&r.fetchNextPage()},[w,r.hasNextPage,r.isFetchingNextPage]),c.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(A,{className:"h-12 w-1/2 mb-4"}),e.jsx(A,{className:"h-64 w-full"})]});if(c.error||!c.data)return e.jsx("div",{className:"page",children:e.jsx(te,{variant:"destructive",children:e.jsx(se,{children:"Method not found."})})});const n=c.data,N=(z=P.data)==null?void 0:z.results.find(i=>i.id===n.area_id);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(H,{to:"/methods",children:"Methods"}),N&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(H,{to:`/methods#area-${J(N.name)}`,children:N.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:n.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${n.slug==="grokking"||n.slug==="latent-reasoning"?" method-hero-grid--wide-figure":""}`,children:[e.jsxs("div",{children:[e.jsx("div",{className:"tag-hero-eyebrow",children:"METHOD"}),e.jsx("h1",{className:"tag-hero-title method-hero-title",children:n.name}),n.full_name&&n.full_name!==n.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:n.full_name}),n.description&&e.jsx(R,{className:"method-description",text:n.description}),n.source_url&&n.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),e.jsxs("a",{className:"method-source-link",href:ae(n.source_url)??void 0,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:n.source_title}),n.introduced_year&&e.jsx("span",{className:"method-source-meta",children:n.introduced_year})]})]}),e.jsxs("div",{className:"tag-hero-meta",children:[e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Papers mentioning"}),e.jsx("span",{className:"value",children:(n.paper_count??0).toLocaleString()})]}),m.data&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Recent mentions"}),e.jsx("span",{className:"value",children:m.data.comparison_complete?e.jsxs(e.Fragment,{children:[m.data.trend_score.toFixed(1),e.jsx("small",{children:"/mo"})]}):"Pending"})]}),n.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:n.introduced_year})]})]}),m.isLoading?e.jsx(A,{className:"h-36 w-full method-trend-skeleton"}):m.data?e.jsxs("section",{className:"method-trend-panel method-trend-panel--compact",children:[e.jsxs("div",{className:"method-trend-header",children:[e.jsx("div",{children:e.jsx("div",{className:"method-trend-eyebrow",children:"Usage trend"})}),e.jsxs("div",{className:"method-trend-summary",children:[e.jsx("strong",{children:m.data.recent_paper_count}),e.jsxs("span",{children:["papers / ",m.data.recent_days,"d"]})]})]}),e.jsx(pe,{history:m.data.history,methodName:n.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(de,{method:n}),n.image_credit&&e.jsx("figcaption",{children:e.jsx(R,{className:"method-image-credit",text:n.image_credit})})]})]}),((($=p.data)==null?void 0:$.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),p.data.map(i=>e.jsx(Z,{method:{slug:i.slug,name:i.name}},i.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:xe.map(([i,h])=>e.jsx("button",{className:`sort-btn ${l===i?"active":""}`,onClick:()=>f(i),children:h},i))}),e.jsx(Y,{hasCode:u,hasHfArtifacts:x,onHasCodeChange:d,onHasHfArtifactsChange:_})]}),e.jsxs("div",{className:"results-count",children:[S.length," papers mentioning ",n.name]})]}),r.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,h)=>e.jsx(A,{className:"h-40 w-full"},h))}):S.length===0?e.jsx("div",{className:"no-results",children:"No papers tagged with this method yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:S.map((i,h)=>e.jsx(V,{paper:i,rank:h+1},i.id))}),e.jsx("div",{ref:b,style:{height:1}}),r.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{Pe as default};
|
assets/{MethodsIndexView-hjMJLx2t.js → MethodsIndexView-DOFTE224.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
-
import{c as g,r as d,j as e,L as j,b as m}from"./index-
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
| 5 |
* See the LICENSE file in the root directory of this source tree.
|
| 6 |
-
*/const N=g("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]),
|
|
|
|
| 1 |
+
import{c as g,r as d,j as e,L as j,b as m}from"./index-ChUK4pXW.js";import{u as h}from"./useQuery-CKrTCSf-.js";import{s as f}from"./slug-BpH-Nkvz.js";import{S as p}from"./skeleton-qvDYp1rq.js";import{A as y,a as v}from"./alert-DNLHMDlv.js";import{T as _}from"./TaxonomySuggestionTile-luNTTZ_I.js";import"./SignInToEditDialog-K442ZtDG.js";import"./button-349xR3H5.js";import"./textarea-CLwMrZMN.js";import"./dialog-YQ7VJ-Bw.js";import"./useMutation-BgE1BvtL.js";import"./loader-circle-DM3sTtAh.js";/**
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
| 5 |
* See the LICENSE file in the root directory of this source tree.
|
| 6 |
+
*/const N=g("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]),E=()=>{var l,c;const i=h({queryKey:["areas-all"],queryFn:()=>m.getAreas({page_size:50,ordering:"name"}),staleTime:6e5}),n=h({queryKey:["methods-all"],queryFn:async()=>(await m.getMethods({page:1,page_size:500,ordering:"-trend_score",include_trends:!0})).results,staleTime:10*60*1e3}),o=d.useMemo(()=>{if(!n.data||!i.data)return null;const t={};return n.data.forEach(r=>{const a=r.area_id??"_unassigned";(t[a]||(t[a]=[])).push(r)}),Object.values(t).forEach(r=>r.sort((a,s)=>(s.trend_score||0)-(a.trend_score||0)||(s.paper_count||0)-(a.paper_count||0)||a.name.localeCompare(s.name))),t},[n.data,i.data]),u=d.useMemo(()=>{const t=(n.data||[]).filter(a=>(a.trend_score||0)>0).sort((a,s)=>(s.trend_score||0)-(a.trend_score||0)),r=Math.ceil(t.length*.25);return new Set(t.slice(0,r).map(a=>a.id))},[n.data]);return d.useEffect(()=>{var t;!i.data||!n.data||!window.location.hash||(t=document.getElementById(window.location.hash.slice(1)))==null||t.scrollIntoView({block:"start"})},[i.data,n.data]),i.error||n.error?e.jsx("div",{className:"page",children:e.jsx(y,{variant:"destructive",children:e.jsx(v,{children:"Failed to load methods."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Methods ",e.jsx("em",{children:"library"})]}),e.jsx("div",{className:"feed-subtitle",children:"Common techniques used across AI research. Trend scores show papers using each method per 30 days, measured over the latest 90 days; the flame marks the top quartile."})]})}),i.isLoading||n.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((t,r)=>e.jsxs("div",{children:[e.jsx(p,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:8}).map((a,s)=>e.jsx(p,{className:"h-20"},s))})]},r))}):(c=(l=i.data)==null?void 0:l.results)==null?void 0:c.map(t=>{const r=(o==null?void 0:o[t.id])||[];if(r.length===0)return null;const a=r.reduce((s,x)=>s+(x.paper_count||0),0);return e.jsxs("section",{id:`area-${f(t.name)}`,style:{marginBottom:48,scrollMarginTop:80},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsx("div",{children:e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:t.name})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[r.length," methods · ",a.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[r.map(s=>e.jsxs(j,{to:`/methods/${s.slug||s.id}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",style:{fontFamily:"var(--mono)",fontSize:15},children:[s.name,u.has(s.id)&&e.jsx(N,{className:"method-trending-icon",size:15,"aria-label":"Top quartile by recent method mentions"})]}),e.jsxs("div",{className:"meta",children:[e.jsxs("span",{children:[(s.paper_count??0).toLocaleString()," papers"]}),(s.trend_score??0)>0&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{className:"method-trend-score",children:[(s.trend_score??0).toFixed(1),"/mo"]})]}),s.introduced_year!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:s.introduced_year})]})]})]},s.id)),e.jsx(_,{kind:"method"})]})]},t.id)})]})};export{E as default};
|
assets/{NotFound-O3oWHFDY.js → NotFound-CwXaMVr4.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{
|
|
|
|
| 1 |
+
import{aP as o,r as a,j as t,L as s}from"./index-ChUK4pXW.js";const r=()=>{const e=o();return a.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),t.jsxs("div",{className:"page",style:{textAlign:"center",paddingTop:96},children:[t.jsx("h1",{className:"detail-title",style:{fontSize:96,marginBottom:8},children:"404"}),t.jsx("p",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-soft)",marginBottom:24},children:"That route isn't on the map."}),t.jsx(s,{to:"/",className:"action-btn",children:"Return home"})]})};export{r as default};
|
assets/OrganizationContributionGraph-Cpz_9NUw.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{r as b,j as o,b as z}from"./index-ChUK4pXW.js";import{u as T}from"./useQuery-CKrTCSf-.js";import{S as w}from"./skeleton-qvDYp1rq.js";const x=24*60*60*1e3,f=12,y=3,v=new Map([[1,"Mon"],[3,"Wed"],[5,"Fri"]]),$=n=>new Date(`${n}T00:00:00Z`),N=n=>n.toISOString().slice(0,10),_=(n,r)=>{if(n===0)return 0;const i=r.findIndex(s=>n<=s);return i===-1?4:i+1},D=n=>{const r=$(n.start_date),i=$(n.end_date),s=new Date(r.getTime()-r.getUTCDay()*x),h=new Date(i.getTime()+(6-i.getUTCDay())*x),p=new Map(n.results.map(e=>[e.date,e.paper_count])),u=n.results.map(e=>e.paper_count).sort((e,g)=>e-g),c=[.25,.5,.75].map(e=>u[Math.min(u.length-1,Math.floor(u.length*e))]??1),l=[];for(let e=s.getTime();e<=h.getTime();e+=x){const g=new Date(e),d=N(g),m=e>=r.getTime()&&e<=i.getTime(),C=m?p.get(d)??0:0;l.push({key:d,date:g,count:C,inRange:m,level:_(C,c)})}const t=l.length/7,a=[];let j=-1;for(let e=0;e<t;e+=1){const d=l.slice(e*7,e*7+7).find(m=>m.inRange&&(e===0||m.date.getUTCDate()<=7));d&&d.date.getUTCMonth()!==j&&(j=d.date.getUTCMonth(),a.length>0&&e-a[a.length-1].column<3&&a.pop(),a.push({label:d.date.toLocaleString("en",{month:"short",timeZone:"UTC"}),column:e}))}return{days:l,months:a,weekCount:t}},L=({data:n,organizationName:r,title:i="Paper contributions",noun:s="paper"})=>{const h=b.useRef(null),{days:p,months:u,weekCount:c}=b.useMemo(()=>D(n),[n]),l=c*f+(c-1)*y;return b.useEffect(()=>{const t=h.current;t&&(t.scrollLeft=t.scrollWidth)},[c]),o.jsxs("section",{className:"organization-contributions","aria-labelledby":"organization-contributions-title",children:[o.jsxs("div",{className:"organization-contributions-header",children:[o.jsx("h2",{id:"organization-contributions-title",className:"organization-contributions-title",children:i}),o.jsxs("p",{className:"organization-contributions-summary",children:[n.total_count.toLocaleString()," ",n.total_count===1?s:`${s}s`," recorded in the last year"]})]}),o.jsx("div",{className:"organization-contributions-scroll",ref:h,children:o.jsxs("div",{className:"organization-contributions-plot",style:{width:l+34},role:"img","aria-label":`${r} recorded ${n.total_count} ${n.total_count===1?s:`${s}s`} in the last year`,children:[o.jsx("div",{className:"organization-contributions-weekdays","aria-hidden":"true",children:Array.from({length:7}).map((t,a)=>o.jsx("span",{children:v.get(a)??""},a))}),o.jsxs("div",{children:[o.jsx("div",{className:"organization-contributions-months",style:{width:l,gridTemplateColumns:`repeat(${c}, ${f}px)`},"aria-hidden":"true",children:u.map(t=>o.jsx("span",{style:{gridColumnStart:t.column+1},children:t.label},`${t.label}-${t.column}`))}),o.jsx("div",{className:"organization-contributions-grid",style:{width:l,gridTemplateColumns:`repeat(${c}, ${f}px)`},"aria-hidden":"true",children:p.map(t=>o.jsx("span",{className:`organization-contribution-cell ${t.inRange?`level-${t.level}`:"is-outside"}`,title:t.inRange?`${t.count} ${t.count===1?s:`${s}s`} on ${t.date.toLocaleDateString("en",{dateStyle:"long",timeZone:"UTC"})}`:void 0},t.key))})]})]})}),o.jsxs("div",{className:"organization-contributions-legend","aria-hidden":"true",children:[o.jsx("span",{children:"Fewer"}),[0,1,2,3,4].map(t=>o.jsx("span",{className:`organization-contribution-cell level-${t}`},t)),o.jsx("span",{children:"More"})]})]})},k=({organizationSlug:n,organizationName:r})=>{const i=T({queryKey:["organization-contributions",n],queryFn:()=>z.getOrganizationContributions(n),staleTime:6e5});return i.isLoading?o.jsx(w,{className:"organization-contributions-skeleton"}):i.data?o.jsx(L,{data:i.data,organizationName:r}):null};export{L as C,k as O};
|
assets/OrganizationDetailView-956TUhPi.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{e as t,j as r}from"./index-C--7Ookn.js";import{O as i}from"./OrganizationPaperFeed-96h3oCF6.js";import m from"./NotFound-O3oWHFDY.js";import"./useQuery-DFn3_KAa.js";import"./useBaseQuery-CPtz5T_6.js";import"./components-KzuuRgbc.js";import"./LatexTitle-CTfnj_ow.js";import"./katex.min-BSBacQyE.js";import"./transform-BfLoZuxV.js";import"./MarkdownText-BGIn3wwa.js";import"./PaperPreviewLink-n0bYaW06.js";import"./index-C0jd_q9w.js";import"./hover-card-1g79nCeQ.js";import"./skeleton-r_i4hk58.js";import"./useIntersectionObserver-BFYx46oo.js";import"./alert-CThmjBPy.js";import"./searchable-select-Dt27s6iC.js";import"./button-BrPkQ8E2.js";import"./dialog-DTAlnqKL.js";import"./loader-circle-D5QPn8lV.js";import"./usePapers-B1XrbsG4.js";import"./useInfiniteQuery-DcxJ3elC.js";const R=()=>{const{orgSlug:o}=t();return o?r.jsx(i,{organizationSlug:o}):r.jsx(m,{})};export{R as default};
|
|
|
|
|
|
assets/OrganizationDetailView-C1Z_ST73.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{e as t,j as r}from"./index-ChUK4pXW.js";import{O as i}from"./OrganizationPaperFeed-DqqJkZCx.js";import m from"./NotFound-CwXaMVr4.js";import"./useQuery-CKrTCSf-.js";import"./components-Oks99QHA.js";import"./LatexTitle-RPgzE218.js";import"./katex.min-BSBacQyE.js";import"./transform-CuJRPBDz.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-DnDQoKAJ.js";import"./PaperPreviewLink-BPqigL3n.js";import"./index-CW8TvXfJ.js";import"./hover-card-D4KxxydT.js";import"./OrganizationContributionGraph-Cpz_9NUw.js";import"./skeleton-qvDYp1rq.js";import"./useIntersectionObserver-Bm84xMAC.js";import"./alert-DNLHMDlv.js";import"./searchable-select-CE0gnZxu.js";import"./button-349xR3H5.js";import"./dialog-YQ7VJ-Bw.js";import"./loader-circle-DM3sTtAh.js";import"./usePapers-Bvgk8ZIt.js";import"./useInfiniteQuery-DflNwjnr.js";const V=()=>{const{orgSlug:o}=t();return o?r.jsx(i,{organizationSlug:o}):r.jsx(m,{})};export{V as default};
|
assets/OrganizationPaperFeed-96h3oCF6.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{j as e,r as b,b as L,u as H,a as W,L as D}from"./index-C--7Ookn.js";import{u as w}from"./useQuery-DFn3_KAa.js";import{P as G}from"./components-KzuuRgbc.js";import{M as K}from"./MarkdownText-BGIn3wwa.js";import{S as $}from"./skeleton-r_i4hk58.js";import{u as Q,P as Z}from"./useIntersectionObserver-BFYx46oo.js";import{A as B,a as Y}from"./alert-CThmjBPy.js";import{a as J}from"./searchable-select-Dt27s6iC.js";import{d as V}from"./usePapers-B1XrbsG4.js";import{d as E,t as X}from"./transform-BfLoZuxV.js";import ee from"./NotFound-O3oWHFDY.js";const v=24*60*60*1e3,C=12,te=3,se=new Map([[1,"Mon"],[3,"Wed"],[5,"Fri"]]),R=s=>new Date(`${s}T00:00:00Z`),ae=s=>s.toISOString().slice(0,10),re=(s,c)=>{if(s===0)return 0;const l=c.findIndex(d=>s<=d);return l===-1?4:l+1},ne=s=>{const c=R(s.start_date),l=R(s.end_date),d=new Date(c.getTime()-c.getUTCDay()*v),j=new Date(l.getTime()+(6-l.getUTCDay())*v),g=new Map(s.results.map(a=>[a.date,a.paper_count])),h=s.results.map(a=>a.paper_count).sort((a,N)=>a-N),n=[.25,.5,.75].map(a=>h[Math.min(h.length-1,Math.floor(h.length*a))]??1),u=[];for(let a=d.getTime();a<=j.getTime();a+=v){const N=new Date(a),m=ae(N),_=a>=c.getTime()&&a<=l.getTime(),p=_?g.get(m)??0:0;u.push({key:m,date:N,count:p,inRange:_,level:re(p,n)})}const y=u.length/7,x=[];let f=-1;for(let a=0;a<y;a+=1){const m=u.slice(a*7,a*7+7).find(_=>_.inRange&&(a===0||_.date.getUTCDate()<=7));m&&m.date.getUTCMonth()!==f&&(f=m.date.getUTCMonth(),x.length>0&&a-x[x.length-1].column<3&&x.pop(),x.push({label:m.date.toLocaleString("en",{month:"short",timeZone:"UTC"}),column:a}))}return{days:u,months:x,weekCount:y}},ie=({data:s,organizationName:c})=>{const l=b.useRef(null),{days:d,months:j,weekCount:g}=b.useMemo(()=>ne(s),[s]),h=g*C+(g-1)*te;return b.useEffect(()=>{const n=l.current;n&&(n.scrollLeft=n.scrollWidth)},[g]),e.jsxs("section",{className:"organization-contributions","aria-labelledby":"organization-contributions-title",children:[e.jsxs("div",{className:"organization-contributions-header",children:[e.jsx("h2",{id:"organization-contributions-title",className:"organization-contributions-title",children:"Paper contributions"}),e.jsxs("p",{className:"organization-contributions-summary",children:[s.total_count.toLocaleString()," ",s.total_count===1?"paper":"papers"," published in the last year"]})]}),e.jsx("div",{className:"organization-contributions-scroll",ref:l,children:e.jsxs("div",{className:"organization-contributions-plot",style:{width:h+34},role:"img","aria-label":`${c} published ${s.total_count} papers in the last year`,children:[e.jsx("div",{className:"organization-contributions-weekdays","aria-hidden":"true",children:Array.from({length:7}).map((n,u)=>e.jsx("span",{children:se.get(u)??""},u))}),e.jsxs("div",{children:[e.jsx("div",{className:"organization-contributions-months",style:{width:h,gridTemplateColumns:`repeat(${g}, ${C}px)`},"aria-hidden":"true",children:j.map(n=>e.jsx("span",{style:{gridColumnStart:n.column+1},children:n.label},`${n.label}-${n.column}`))}),e.jsx("div",{className:"organization-contributions-grid",style:{width:h,gridTemplateColumns:`repeat(${g}, ${C}px)`},"aria-hidden":"true",children:d.map(n=>e.jsx("span",{className:`organization-contribution-cell ${n.inRange?`level-${n.level}`:"is-outside"}`,title:n.inRange?`${n.count} ${n.count===1?"paper":"papers"} on ${n.date.toLocaleDateString("en",{dateStyle:"long",timeZone:"UTC"})}`:void 0},n.key))})]})]})}),e.jsxs("div",{className:"organization-contributions-legend","aria-hidden":"true",children:[e.jsx("span",{children:"Fewer"}),[0,1,2,3,4].map(n=>e.jsx("span",{className:`organization-contribution-cell level-${n}`},n)),e.jsx("span",{children:"More"})]})]})},oe=({organizationSlug:s,organizationName:c})=>{const l=w({queryKey:["organization-contributions",s],queryFn:()=>L.getOrganizationContributions(s),staleTime:6e5});return l.isLoading?e.jsx($,{className:"organization-contributions-skeleton"}):l.data?e.jsx(ie,{data:l.data,organizationName:c}):null},le=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ce=s=>s==="date_published"||s==="citation_count"?s:"trending",Ne=({organizationSlug:s,taskSlug:c})=>{var k,P,F,M,A,O,z,S;const l=H(),[d,j]=W(),[g,h]=b.useState(!1),n=ce(d.get("order_by")),u=d.get("has_code")==="true",y=d.get("has_hf_artifacts")==="true",x=w({queryKey:["organization",s],queryFn:()=>L.getOrganization(s),staleTime:10*60*1e3}),f=w({queryKey:["organization-areas-with-tasks",s],queryFn:()=>L.getOrganizationAreasWithTasks(s),staleTime:10*60*1e3}),a=V({organizationSlug:s,taskSlug:c,page_size:12,order_by:n,order_dir:"desc",include_resources:!0,has_code:u,has_hf_artifacts:y,enabled:!!s}),{targetRef:N,isIntersecting:m}=Q({rootMargin:"200px"});b.useEffect(()=>{m&&a.hasNextPage&&!a.isFetchingNextPage&&a.fetchNextPage()},[m,a.hasNextPage,a.isFetchingNextPage]),b.useEffect(()=>{h(!1)},[s,c]);const _=b.useMemo(()=>{var r;return(((r=f.data)==null?void 0:r.results)??[]).flatMap(i=>i.tasks.filter(o=>!!o.slug).map(o=>({...o,slug:o.slug,label:E(o.name,o.slug)})))},[f.data]),p=_.find(r=>r.slug===c),T=b.useMemo(()=>{var r;return(((r=a.data)==null?void 0:r.pages)??[]).flatMap(i=>i.results.map(X))},[a.data]),t=x.data??((k=f.data)==null?void 0:k.organization),I=((F=(P=a.data)==null?void 0:P.pages[0])==null?void 0:F.count)??0;if(((M=x.error)==null?void 0:M.status)===404||((A=f.error)==null?void 0:A.status)===404||((O=a.error)==null?void 0:O.status)===404)return e.jsx(ee,{});if(f.error||a.error)return e.jsx("div",{className:"page",children:e.jsx(B,{variant:"destructive",children:e.jsx(Y,{children:"Failed to load organization papers. Please try again."})})});const U=r=>{const i=r.trim().toLocaleLowerCase();return _.filter(o=>`${o.label} ${o.slug}`.toLocaleLowerCase().includes(i)).map(o=>({value:o.slug,label:o.label,description:`${o.paper_count.toLocaleString()} ${o.paper_count===1?"paper":"papers"}`}))},q=r=>{const i=r==="__all__"?`/orgs/${s}`:`/orgs/${s}/${r}`,o=d.toString();l({pathname:i,search:o?`?${o}`:""})};return e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(D,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(D,{to:"/organizations",children:"Organizations"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:(t==null?void 0:t.name)??s}),p&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:" / "}),e.jsx("span",{children:E(p.name,p.slug)})]})]}),e.jsxs("header",{className:"organization-hero",children:[e.jsxs("div",{className:"organization-hero-profile",children:[e.jsx("div",{className:"organizations-eyebrow",children:"ORGANIZATION"}),e.jsxs("h1",{className:"feed-title organization-hero-title",children:[t!=null&&t.logo_url&&!g?e.jsx("img",{src:t.logo_url,alt:"",width:58,height:58,onError:()=>h(!0)}):t?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:t.name.slice(0,1).toUpperCase()}):null,(t==null?void 0:t.name)??e.jsx($,{className:"h-12 w-64"})]}),t&&e.jsxs("div",{className:"feed-subtitle",children:[((z=t.paper_count)==null?void 0:z.toLocaleString())??0," papers",(t.organization_trending_score??0)>0&&t.trending_rank&&e.jsxs(e.Fragment,{children:[" · #",t.trending_rank," trending this month"]})]}),(t==null?void 0:t.description)&&e.jsx(K,{className:"method-description",text:t.description}),t&&e.jsxs("div",{className:"organization-hero-links",children:[t.website_url&&e.jsx("a",{href:t.website_url,target:"_blank",rel:"noreferrer",children:"Website ↗"}),t.hf_url&&e.jsx("a",{href:t.hf_url,target:"_blank",rel:"noreferrer",children:"Hugging Face ↗"}),t.github_url&&e.jsx("a",{href:t.github_url,target:"_blank",rel:"noreferrer",children:"GitHub ↗"})]})]}),t&&e.jsx(oe,{organizationSlug:s,organizationName:t.name})]}),e.jsxs("div",{className:"sort-bar",style:{alignItems:"center",gap:16},children:[e.jsx("div",{style:{minWidth:260},children:e.jsx(J,{value:c??"__all__",onChange:q,placeholder:"All tasks",searchPlaceholder:"Search organization tasks...",emptyMessage:"No matching tasks.",ariaLabel:"Filter papers by task",selectedOption:p?{value:p.slug,label:p.label,description:`${p.paper_count.toLocaleString()} ${p.paper_count===1?"paper":"papers"}`}:{value:"__all__",label:"All tasks",description:`${((S=t==null?void 0:t.paper_count)==null?void 0:S.toLocaleString())??0} papers`},queryKey:["organization-task-options",s],queryFn:async r=>{var i;return[{value:"__all__",label:"All tasks",description:`${((i=t==null?void 0:t.paper_count)==null?void 0:i.toLocaleString())??0} papers`},...U(r)]},enabled:!f.isLoading,className:"h-[38px]"})}),e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:le.map(([r,i])=>e.jsx("button",{type:"button",className:`sort-btn ${n===r?"active":""}`,onClick:()=>{const o=new URLSearchParams(d);r==="trending"?o.delete("order_by"):o.set("order_by",r),j(o)},children:i},r))}),e.jsx(Z,{hasCode:u,hasHfArtifacts:y,onHasCodeChange:r=>{const i=new URLSearchParams(d);r?i.set("has_code","true"):i.delete("has_code"),j(i)},onHasHfArtifactsChange:r=>{const i=new URLSearchParams(d);r?i.set("has_hf_artifacts","true"):i.delete("has_hf_artifacts"),j(i)}})]}),e.jsxs("div",{className:"results-count",children:[I.toLocaleString()," papers"]})]}),a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((r,i)=>e.jsx($,{className:"h-40 w-full"},i))}):T.length===0?e.jsx("div",{className:"no-results",children:(t==null?void 0:t.paper_count)===0?"No papers indexed yet":"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:T.map((r,i)=>e.jsx(G,{paper:r,rank:i+1},r.id))}),e.jsx("div",{ref:N,style:{height:1}}),a.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center"},children:"Loading more…"})]})]})};export{Ne as O};
|
|
|
|
|
|
assets/OrganizationPaperFeed-DqqJkZCx.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{u as E,a as Q,r as d,j as e,L as w,b as C}from"./index-ChUK4pXW.js";import{u as A}from"./useQuery-CKrTCSf-.js";import{P as U}from"./components-Oks99QHA.js";import{M as B}from"./MarkdownText-DnDQoKAJ.js";import{O as G}from"./OrganizationContributionGraph-Cpz_9NUw.js";import{u as K,P as W}from"./useIntersectionObserver-Bm84xMAC.js";import{A as D,a as Z}from"./alert-DNLHMDlv.js";import{a as z}from"./searchable-select-CE0gnZxu.js";import{S as $}from"./skeleton-qvDYp1rq.js";import{d as J}from"./usePapers-Bvgk8ZIt.js";import{d as T,t as V}from"./transform-CuJRPBDz.js";import X from"./NotFound-CwXaMVr4.js";const Y=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ee=n=>n==="date_published"||n==="citation_count"?n:"trending",me=({organizationSlug:n,taskSlug:p})=>{var N,y,v,P,L,F,k,O;const M=E(),[l,h]=Q(),[H,m]=d.useState(!1),u=ee(l.get("order_by")),g=l.get("has_code")==="true",_=l.get("has_hf_artifacts")==="true",f=A({queryKey:["organization",n],queryFn:()=>C.getOrganization(n),staleTime:10*60*1e3}),c=A({queryKey:["organization-areas-with-tasks",n],queryFn:()=>C.getOrganizationAreasWithTasks(n),staleTime:10*60*1e3}),i=J({organizationSlug:n,taskSlug:p,page_size:12,order_by:u,order_dir:"desc",include_resources:!0,has_code:g,has_hf_artifacts:_,enabled:!!n}),{targetRef:I,isIntersecting:x}=K({rootMargin:"200px"});d.useEffect(()=>{x&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[x,i.hasNextPage,i.isFetchingNextPage]),d.useEffect(()=>{m(!1)},[n,p]);const j=d.useMemo(()=>{var a;return(((a=c.data)==null?void 0:a.results)??[]).flatMap(r=>r.tasks.filter(t=>!!t.slug).map(t=>({...t,slug:t.slug,label:T(t.name,t.slug)})))},[c.data]),o=j.find(a=>a.slug===p),b=d.useMemo(()=>{var a;return(((a=i.data)==null?void 0:a.pages)??[]).flatMap(r=>r.results.map(V))},[i.data]),s=f.data??((N=c.data)==null?void 0:N.organization),R=((v=(y=i.data)==null?void 0:y.pages[0])==null?void 0:v.count)??0;if(((P=f.error)==null?void 0:P.status)===404||((L=c.error)==null?void 0:L.status)===404||((F=i.error)==null?void 0:F.status)===404)return e.jsx(X,{});if(c.error||i.error)return e.jsx("div",{className:"page",children:e.jsx(D,{variant:"destructive",children:e.jsx(Z,{children:"Failed to load organization papers. Please try again."})})});const q=a=>{const r=a.trim().toLocaleLowerCase();return j.filter(t=>`${t.label} ${t.slug}`.toLocaleLowerCase().includes(r)).map(t=>({value:t.slug,label:t.label,description:`${t.paper_count.toLocaleString()} ${t.paper_count===1?"paper":"papers"}`}))},S=a=>{const r=a==="__all__"?`/orgs/${n}`:`/orgs/${n}/${a}`,t=l.toString();M({pathname:r,search:t?`?${t}`:""})};return e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(w,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(w,{to:"/organizations",children:"Organizations"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:(s==null?void 0:s.name)??n}),o&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:" / "}),e.jsx("span",{children:T(o.name,o.slug)})]})]}),e.jsxs("header",{className:"organization-hero",children:[e.jsxs("div",{className:"organization-hero-profile",children:[e.jsx("div",{className:"organizations-eyebrow",children:"ORGANIZATION"}),e.jsxs("h1",{className:"feed-title organization-hero-title",children:[s!=null&&s.logo_url&&!H?e.jsx("img",{src:s.logo_url,alt:"",width:58,height:58,onError:()=>m(!0)}):s?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:s.name.slice(0,1).toUpperCase()}):null,(s==null?void 0:s.name)??e.jsx($,{className:"h-12 w-64"})]}),s&&e.jsxs("div",{className:"feed-subtitle",children:[((k=s.paper_count)==null?void 0:k.toLocaleString())??0," papers",(s.organization_trending_score??0)>0&&s.trending_rank&&e.jsxs(e.Fragment,{children:[" · #",s.trending_rank," trending this month"]})]}),(s==null?void 0:s.description)&&e.jsx(B,{className:"method-description",text:s.description}),s&&e.jsxs("div",{className:"organization-hero-links",children:[s.website_url&&e.jsx("a",{href:s.website_url,target:"_blank",rel:"noreferrer",children:"Website ↗"}),s.hf_url&&e.jsx("a",{href:s.hf_url,target:"_blank",rel:"noreferrer",children:"Hugging Face ↗"}),s.github_url&&e.jsx("a",{href:s.github_url,target:"_blank",rel:"noreferrer",children:"GitHub ↗"})]})]}),s&&e.jsx(G,{organizationSlug:n,organizationName:s.name})]}),e.jsxs("div",{className:"sort-bar",style:{alignItems:"center",gap:16},children:[e.jsx("div",{style:{minWidth:260},children:e.jsx(z,{value:p??"__all__",onChange:S,placeholder:"All tasks",searchPlaceholder:"Search organization tasks...",emptyMessage:"No matching tasks.",ariaLabel:"Filter papers by task",selectedOption:o?{value:o.slug,label:o.label,description:`${o.paper_count.toLocaleString()} ${o.paper_count===1?"paper":"papers"}`}:{value:"__all__",label:"All tasks",description:`${((O=s==null?void 0:s.paper_count)==null?void 0:O.toLocaleString())??0} papers`},queryKey:["organization-task-options",n],queryFn:async a=>{var r;return[{value:"__all__",label:"All tasks",description:`${((r=s==null?void 0:s.paper_count)==null?void 0:r.toLocaleString())??0} papers`},...q(a)]},enabled:!c.isLoading,className:"h-[38px]"})}),e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:Y.map(([a,r])=>e.jsx("button",{type:"button",className:`sort-btn ${u===a?"active":""}`,onClick:()=>{const t=new URLSearchParams(l);a==="trending"?t.delete("order_by"):t.set("order_by",a),h(t)},children:r},a))}),e.jsx(W,{hasCode:g,hasHfArtifacts:_,onHasCodeChange:a=>{const r=new URLSearchParams(l);a?r.set("has_code","true"):r.delete("has_code"),h(r)},onHasHfArtifactsChange:a=>{const r=new URLSearchParams(l);a?r.set("has_hf_artifacts","true"):r.delete("has_hf_artifacts"),h(r)}})]}),e.jsxs("div",{className:"results-count",children:[R.toLocaleString()," papers"]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,r)=>e.jsx($,{className:"h-40 w-full"},r))}):b.length===0?e.jsx("div",{className:"no-results",children:(s==null?void 0:s.paper_count)===0?"No papers indexed yet":"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:b.map((a,r)=>e.jsx(U,{paper:a,rank:r+1},a.id))}),e.jsx("div",{ref:I,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center"},children:"Loading more…"})]})]})};export{me as O};
|
assets/OrganizationTaskView-BKRzD2Ma.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{e as i,j as t}from"./index-ChUK4pXW.js";import{O as m}from"./OrganizationPaperFeed-DqqJkZCx.js";import p from"./NotFound-CwXaMVr4.js";import"./useQuery-CKrTCSf-.js";import"./components-Oks99QHA.js";import"./LatexTitle-RPgzE218.js";import"./katex.min-BSBacQyE.js";import"./transform-CuJRPBDz.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-DnDQoKAJ.js";import"./PaperPreviewLink-BPqigL3n.js";import"./index-CW8TvXfJ.js";import"./hover-card-D4KxxydT.js";import"./OrganizationContributionGraph-Cpz_9NUw.js";import"./skeleton-qvDYp1rq.js";import"./useIntersectionObserver-Bm84xMAC.js";import"./alert-DNLHMDlv.js";import"./searchable-select-CE0gnZxu.js";import"./button-349xR3H5.js";import"./dialog-YQ7VJ-Bw.js";import"./loader-circle-DM3sTtAh.js";import"./usePapers-Bvgk8ZIt.js";import"./useInfiniteQuery-DflNwjnr.js";const V=()=>{const{orgSlug:o,taskSlug:r}=i();return o&&r?t.jsx(m,{organizationSlug:o,taskSlug:r}):t.jsx(p,{})};export{V as default};
|
assets/OrganizationTaskView-DQN9i-k7.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{e as i,j as t}from"./index-C--7Ookn.js";import{O as m}from"./OrganizationPaperFeed-96h3oCF6.js";import p from"./NotFound-O3oWHFDY.js";import"./useQuery-DFn3_KAa.js";import"./useBaseQuery-CPtz5T_6.js";import"./components-KzuuRgbc.js";import"./LatexTitle-CTfnj_ow.js";import"./katex.min-BSBacQyE.js";import"./transform-BfLoZuxV.js";import"./MarkdownText-BGIn3wwa.js";import"./PaperPreviewLink-n0bYaW06.js";import"./index-C0jd_q9w.js";import"./hover-card-1g79nCeQ.js";import"./skeleton-r_i4hk58.js";import"./useIntersectionObserver-BFYx46oo.js";import"./alert-CThmjBPy.js";import"./searchable-select-Dt27s6iC.js";import"./button-BrPkQ8E2.js";import"./dialog-DTAlnqKL.js";import"./loader-circle-D5QPn8lV.js";import"./usePapers-B1XrbsG4.js";import"./useInfiniteQuery-DcxJ3elC.js";const T=()=>{const{orgSlug:o,taskSlug:r}=i();return o&&r?t.jsx(m,{organizationSlug:o,taskSlug:r}):t.jsx(p,{})};export{T as default};
|
|
|
|
|
|
assets/OrganizationsIndexView-C4DiZhwT.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{a as u,r as g,j as e,L as x,b as j}from"./index-ChUK4pXW.js";import{u as y}from"./useQuery-CKrTCSf-.js";import{A as f,a as _}from"./alert-DNLHMDlv.js";import{S as N}from"./skeleton-qvDYp1rq.js";const v=n=>n==="papers"||n==="name"?n:"trending",S=({organization:n})=>{const[d,t]=g.useState(!1);return!n.logo_url||d?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:n.name.slice(0,1).toUpperCase()}):e.jsx("span",{className:"organization-logo",children:e.jsx("img",{src:n.logo_url,alt:"",width:48,height:48,onError:()=>t(!0)})})},z=()=>{var h;const[n,d]=u(),t=v(n.get("sort")),c=n.get("q")??"",l=y({queryKey:["organizations","featured"],queryFn:()=>j.getOrganizations(!0),staleTime:10*60*1e3}),p=s=>{const a=new URLSearchParams(n),i=s.sort??t,r=s.query??c;i==="trending"?a.delete("sort"):a.set("sort",i),r.trim()?a.set("q",r):a.delete("q"),d(a)},m=g.useMemo(()=>{var i;const s=c.trim().toLocaleLowerCase(),a=(((i=l.data)==null?void 0:i.results)??[]).filter(r=>[r.name,r.slug,r.hf_slug??""].join(" ").toLocaleLowerCase().includes(s));return t==="papers"?[...a].sort((r,o)=>(o.paper_count??0)-(r.paper_count??0)||r.name.localeCompare(o.name)||r.slug.localeCompare(o.slug)):t==="name"?[...a].sort((r,o)=>r.name.localeCompare(o.name)||r.slug.localeCompare(o.slug)):a},[l.data,c,t]);return e.jsxs("div",{className:"page organizations-page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Organizations"})]}),e.jsx("div",{className:"feed-subtitle",children:"Explore papers from 21 leading AI organizations, ranked by sustained community momentum over the past 30 days."})]})}),e.jsxs("section",{"aria-labelledby":"organizations-heading",children:[e.jsxs("div",{className:"organizations-section-heading",children:[e.jsxs("h2",{id:"organizations-heading",children:[((h=l.data)==null?void 0:h.count)??21," organizations"]}),e.jsx("span",{children:t==="trending"?"Ranked by 30-day momentum":t==="papers"?"Sorted by linked papers":"Sorted A–Z"})]}),e.jsxs("div",{className:"organizations-controls",children:[e.jsxs("label",{children:[e.jsx("span",{className:"sr-only",children:"Search organizations"}),e.jsx("input",{type:"search",value:c,onChange:s=>p({query:s.target.value}),placeholder:"Search organizations"})]}),e.jsx("div",{className:"organizations-sort","aria-label":"Sort organizations",children:[["trending","Trending"],["papers","Most papers"],["name","A–Z"]].map(([s,a])=>e.jsx("button",{type:"button",className:t===s?"active":"","aria-pressed":t===s,onClick:()=>p({sort:s}),children:a},s))})]}),l.isLoading?e.jsx("div",{className:"organizations-grid","aria-busy":"true",children:Array.from({length:6}).map((s,a)=>e.jsx(N,{className:"organization-card-skeleton"},a))}):l.error?e.jsx(f,{variant:"destructive",children:e.jsxs(_,{children:["Failed to load organizations."," ",e.jsx("button",{type:"button",onClick:()=>l.refetch(),children:"Try again"})]})}):m.length===0?e.jsxs("div",{className:"organizations-empty",children:["No organizations match “",c,"”."]}):e.jsx("div",{className:"organizations-grid",children:m.map(s=>{var r;const a=s.paper_count??0,i=s.first_paper_year&&s.latest_paper_year?s.first_paper_year===s.latest_paper_year?String(s.first_paper_year):`${s.first_paper_year}–${s.latest_paper_year}`:null;return e.jsxs(x,{to:`/orgs/${s.slug}`,className:"organization-card","aria-label":a?`Browse ${a.toLocaleString()} ${s.name} papers`:`Browse ${s.name} papers`,children:[e.jsxs("div",{className:"organization-card-header",children:[e.jsx(S,{organization:s}),e.jsxs("div",{children:[e.jsx("h3",{children:s.name}),e.jsxs("span",{children:["@",s.hf_slug??s.slug]})]})]}),e.jsxs("div",{className:"organization-card-metrics",children:[e.jsx("strong",{children:a.toLocaleString()}),e.jsx("span",{children:a===1?"paper":"papers"}),t==="trending"&&s.trending_rank&&e.jsxs("span",{className:"organization-rank",children:["#",s.trending_rank]})]}),e.jsxs("div",{className:"organization-highlight",children:[e.jsx("span",{children:"Trending paper"}),e.jsx("strong",{children:((r=s.top_trending_paper)==null?void 0:r.title)??"No papers indexed yet"})]}),e.jsxs("div",{className:"organization-card-footer",children:[i?`Publishing ${i}`:"Research archive ready",e.jsx("span",{"aria-hidden":"true",children:"↗"})]})]},s.id)})})]})]})};export{z as default};
|
assets/OrganizationsIndexView-C9OYrBKZ.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{a as u,r as g,j as e,L as x,b as j}from"./index-C--7Ookn.js";import{u as y}from"./useQuery-DFn3_KAa.js";import{A as f,a as _}from"./alert-CThmjBPy.js";import{S as N}from"./skeleton-r_i4hk58.js";import"./useBaseQuery-CPtz5T_6.js";const v=n=>n==="papers"||n==="name"?n:"trending",S=({organization:n})=>{const[d,t]=g.useState(!1);return!n.logo_url||d?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:n.name.slice(0,1).toUpperCase()}):e.jsx("span",{className:"organization-logo",children:e.jsx("img",{src:n.logo_url,alt:"",width:48,height:48,onError:()=>t(!0)})})},q=()=>{var h;const[n,d]=u(),t=v(n.get("sort")),c=n.get("q")??"",o=y({queryKey:["organizations","featured"],queryFn:()=>j.getOrganizations(!0),staleTime:10*60*1e3}),p=s=>{const a=new URLSearchParams(n),i=s.sort??t,r=s.query??c;i==="trending"?a.delete("sort"):a.set("sort",i),r.trim()?a.set("q",r):a.delete("q"),d(a)},m=g.useMemo(()=>{var i;const s=c.trim().toLocaleLowerCase(),a=(((i=o.data)==null?void 0:i.results)??[]).filter(r=>[r.name,r.slug,r.hf_slug??""].join(" ").toLocaleLowerCase().includes(s));return t==="papers"?[...a].sort((r,l)=>(l.paper_count??0)-(r.paper_count??0)||r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):t==="name"?[...a].sort((r,l)=>r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):a},[o.data,c,t]);return e.jsxs("div",{className:"page organizations-page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Organizations"})]}),e.jsx("div",{className:"feed-subtitle",children:"Explore papers from 21 leading AI organizations, ranked by sustained community momentum over the past 30 days."})]})}),e.jsxs("section",{"aria-labelledby":"organizations-heading",children:[e.jsxs("div",{className:"organizations-section-heading",children:[e.jsxs("h2",{id:"organizations-heading",children:[((h=o.data)==null?void 0:h.count)??21," organizations"]}),e.jsx("span",{children:t==="trending"?"Ranked by 30-day momentum":t==="papers"?"Sorted by linked papers":"Sorted A–Z"})]}),e.jsxs("div",{className:"organizations-controls",children:[e.jsxs("label",{children:[e.jsx("span",{className:"sr-only",children:"Search organizations"}),e.jsx("input",{type:"search",value:c,onChange:s=>p({query:s.target.value}),placeholder:"Search organizations"})]}),e.jsx("div",{className:"organizations-sort","aria-label":"Sort organizations",children:[["trending","Trending"],["papers","Most papers"],["name","A–Z"]].map(([s,a])=>e.jsx("button",{type:"button",className:t===s?"active":"","aria-pressed":t===s,onClick:()=>p({sort:s}),children:a},s))})]}),o.isLoading?e.jsx("div",{className:"organizations-grid","aria-busy":"true",children:Array.from({length:6}).map((s,a)=>e.jsx(N,{className:"organization-card-skeleton"},a))}):o.error?e.jsx(f,{variant:"destructive",children:e.jsxs(_,{children:["Failed to load organizations."," ",e.jsx("button",{type:"button",onClick:()=>o.refetch(),children:"Try again"})]})}):m.length===0?e.jsxs("div",{className:"organizations-empty",children:["No organizations match “",c,"”."]}):e.jsx("div",{className:"organizations-grid",children:m.map(s=>{var r;const a=s.paper_count??0,i=s.first_paper_year&&s.latest_paper_year?s.first_paper_year===s.latest_paper_year?String(s.first_paper_year):`${s.first_paper_year}–${s.latest_paper_year}`:null;return e.jsxs(x,{to:`/orgs/${s.slug}`,className:"organization-card","aria-label":a?`Browse ${a.toLocaleString()} ${s.name} papers`:`Browse ${s.name} papers`,children:[e.jsxs("div",{className:"organization-card-header",children:[e.jsx(S,{organization:s}),e.jsxs("div",{children:[e.jsx("h3",{children:s.name}),e.jsxs("span",{children:["@",s.hf_slug??s.slug]})]})]}),e.jsxs("div",{className:"organization-card-metrics",children:[e.jsx("strong",{children:a.toLocaleString()}),e.jsx("span",{children:a===1?"paper":"papers"}),t==="trending"&&s.trending_rank&&e.jsxs("span",{className:"organization-rank",children:["#",s.trending_rank]})]}),e.jsxs("div",{className:"organization-highlight",children:[e.jsx("span",{children:"Trending paper"}),e.jsx("strong",{children:((r=s.top_trending_paper)==null?void 0:r.title)??"No papers indexed yet"})]}),e.jsxs("div",{className:"organization-card-footer",children:[i?`Publishing ${i}`:"Research archive ready",e.jsx("span",{"aria-hidden":"true",children:"↗"})]})]},s.id)})})]})]})};export{q as default};
|
|
|
|
|
|
assets/{PaperDetailView-Cuitl1mm.js → PaperDetailView-Cc0Jime0.js}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
assets/{PaperPreviewLink-n0bYaW06.js → PaperPreviewLink-BPqigL3n.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{o as F,l as ne,f as v,m as b,a as re,p as I,b as $,n as L,h as ie,s as ae,c as oe,v as se,S as le}from"./index-
|
| 2 |
`,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:r}};function n(o,s,l,a){const u=o.value||"",p=l.createTracker(a),m="$".repeat(Math.max(ne(u,"$")+1,2)),g=l.enter("mathFlow");let x=p.move(m);if(o.meta){const d=l.enter("mathFlowMeta");x+=p.move(l.safe(o.meta,{after:`
|
| 3 |
`,before:x,encode:["$"],...p.current()})),d()}return x+=p.move(`
|
| 4 |
`),u&&(x+=p.move(u+`
|
|
|
|
| 1 |
+
import{o as F,l as ne,f as v,m as b,a as re,p as I,b as $,n as L,h as ie,s as ae,c as oe,v as se,S as le}from"./index-CW8TvXfJ.js";import{k as z}from"./katex.min-BSBacQyE.js";import{j as f,R as T,a2 as ce,Y as ue,L as he,ap as pe}from"./index-ChUK4pXW.js";import{u as me}from"./useQuery-CKrTCSf-.js";import{H as fe,a as de,b as ge}from"./hover-card-D4KxxydT.js";function xe(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:o},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:l,mathText:s,mathTextData:l}};function e(a){const u={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[u]}},a)}function t(){this.buffer()}function n(){const a=this.resume(),u=this.stack[this.stack.length-1];F(u.type==="math"),u.meta=a}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(a){const u=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),p=this.stack[this.stack.length-1];F(p.type==="math"),this.exit(a),p.value=u;const m=p.data.hChildren[0];F(m.type==="element"),F(m.tagName==="code"),m.children.push({type:"text",value:u}),this.data.mathFlowInside=void 0}function o(a){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},a),this.buffer()}function s(a){const u=this.resume(),p=this.stack[this.stack.length-1];F(p.type==="inlineMath"),this.exit(a),p.value=u,p.data.hChildren.push({type:"text",value:u})}function l(a){this.config.enter.data.call(this,a),this.config.exit.data.call(this,a)}}function ye(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),r.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
|
| 2 |
`,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:r}};function n(o,s,l,a){const u=o.value||"",p=l.createTracker(a),m="$".repeat(Math.max(ne(u,"$")+1,2)),g=l.enter("mathFlow");let x=p.move(m);if(o.meta){const d=l.enter("mathFlowMeta");x+=p.move(l.safe(o.meta,{after:`
|
| 3 |
`,before:x,encode:["$"],...p.current()})),d()}return x+=p.move(`
|
| 4 |
`),u&&(x+=p.move(u+`
|
assets/PapersListView-C9YHs8aI.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{a as q,r as l,A as z,j as e,L as f,b as G}from"./index-ChUK4pXW.js";import{I as H,P as Q}from"./components-Oks99QHA.js";import{t as U,d as W}from"./transform-CuJRPBDz.js";import{u as K}from"./usePapers-Bvgk8ZIt.js";import{u as V}from"./useDebounce-DkM8rHsa.js";import{P as J}from"./usePeriodFilter-xR4UEu-8.js";import{u as X,P as Y}from"./useIntersectionObserver-Bm84xMAC.js";import{S as m}from"./skeleton-qvDYp1rq.js";import{A as Z,a as ee}from"./alert-DNLHMDlv.js";import{u as se}from"./useQuery-CKrTCSf-.js";import"./LatexTitle-RPgzE218.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";import"./useInfiniteQuery-DflNwjnr.js";const ae=[["trending","trending"],["new","newest"],["cited","most cited"]],je=()=>{var T,A,C,I,L,R,E;const[i,b]=q(),h=i.get("framework")||void 0,g=i.get("repository")||void 0,n=!!(h||g),p=i.get("search")||"",[_,y]=l.useState(p),c=V(_,300);l.useEffect(()=>y(p),[p]),l.useEffect(()=>{if(c===p)return;const s=new URLSearchParams(i);c?s.set("search",c):s.delete("search"),b(s,{replace:!0})},[c]);const j=i.get("order_by"),N=j==="citation_count"?"cited":j==="trending"||!j&&n?"trending":"new",o=i.get("time"),B=o==="today"?"Today":o==="week"?"This Week":o==="month"?"This Month":"All Time",w=i.get("has_hf_artifacts")==="true",k=!n&&i.get("has_code")==="true",u=(s,t)=>{const d=new URLSearchParams(i);t?d.set(s,t):d.delete(s),b(d)},O=s=>{u("time",s==="Today"?"today":s==="This Week"?"week":s==="This Month"?"month":void 0)},$=s=>{u("order_by",s==="cited"?"citation_count":s==="new"?"date_published":"trending")},r=K({page_size:20,order_by:N==="trending"?"trending":N==="cited"?"citation_count":"date_published",order_dir:"desc",search:c||void 0,time:o==="today"||o==="week"||o==="month"?o:"all_time",include_resources:!0,published_after:i.get("published_after")||void 0,published_before:i.get("published_before")||void 0,conference:i.get("conference")||void 0,latest_only:i.get("latest_only")!=="false",has_code:k,has_hf_artifacts:w,framework:h,repository:g}),P=se({queryKey:["top-tasks-sidebar"],queryFn:()=>G.getTopTasks({limit:8}),enabled:!n,staleTime:10*60*1e3}),v=l.useMemo(()=>{var t;return(((t=r.data)==null?void 0:t.pages.flatMap(d=>d.results))||[]).map(U)},[r.data]),{targetRef:D,isIntersecting:F}=X({rootMargin:"200px"});l.useEffect(()=>{F&&r.hasNextPage&&!r.isFetchingNextPage&&r.fetchNextPage()},[F,r.hasNextPage,r.isFetchingNextPage]);const x=((C=(A=(T=r.data)==null?void 0:T.pages)==null?void 0:A[0])==null?void 0:C.count)??0,a=(R=(L=(I=r.data)==null?void 0:I.pages)==null?void 0:L[0])==null?void 0:R.scope,S=h&&r.error instanceof z&&r.error.status===404,M=(a==null?void 0:a.kind)==="framework"?a.framework_name:a==null?void 0:a.repository;return e.jsxs("div",{className:"page",children:[(a==null?void 0:a.kind)==="framework"&&e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(f,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(f,{to:"/frameworks",children:"Frameworks"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:a.framework_name})]}),e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:n?e.jsxs(e.Fragment,{children:["Papers implemented by ",e.jsx("em",{children:M||h||g})]}):e.jsxs(e.Fragment,{children:["All ",e.jsx("em",{children:"Papers"})]})}),e.jsx("div",{className:"feed-subtitle",children:n?a!=null&&a.repository?e.jsxs(e.Fragment,{children:["GitHub repository ",e.jsx("strong",{children:a.repository}),". ",x>0&&`${x.toLocaleString()} papers.`]}):"Repository-scoped paper feed.":e.jsxs(e.Fragment,{children:["Search the full corpus. ",x>0&&`${x.toLocaleString()} papers indexed.`]})}),n&&a&&e.jsxs("div",{className:"framework-card-links paper-feed-scope-links",children:[a.github_url&&e.jsxs("a",{href:a.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(H,{name:"github",size:13}),"GitHub"]}),a.kind==="framework"&&a.introducing_paper_arxiv_id&&e.jsx(f,{to:`/paper/${a.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"})]})]}),e.jsx("div",{className:"period-switch",children:J.map(s=>e.jsx("button",{className:`period-btn ${B===s?"active":""}`,onClick:()=>O(s),children:s},s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(H,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:_,onChange:s=>y(s.target.value)})]})}),e.jsxs("div",{className:n?"papers-feed-layout-scoped":"layout-with-sidebar",children:[!n&&e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),P.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,t)=>e.jsx(m,{className:"h-5 w-full"},t))}),(E=P.data)==null?void 0:E.map(s=>e.jsxs(f,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[W(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id))]})}),e.jsxs("div",{children:[e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:ae.map(([s,t])=>e.jsx("button",{className:`sort-btn ${N===s?"active":""}`,onClick:()=>$(s),children:t},s))}),e.jsx(Y,{hasCode:k,hasHfArtifacts:w,onHasCodeChange:s=>u("has_code",s?"true":void 0),onHasHfArtifactsChange:s=>u("has_hf_artifacts",s?"true":void 0),showHasCode:!n})]}),e.jsxs("div",{className:"results-count",children:[v.length," loaded"]})]}),S?e.jsx("div",{className:"no-results",children:"Framework not found."}):r.error&&e.jsx(Z,{variant:"destructive",className:"mb-4",children:e.jsx(ee,{children:"Failed to load papers. Please try again."})}),!S&&(r.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,t)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(m,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(m,{className:"h-6 w-3/4"}),e.jsx(m,{className:"h-4 w-1/2"}),e.jsx(m,{className:"h-12 w-full"})]})]},t))}):v.length===0?e.jsx("div",{className:"no-results",children:"No matching papers."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:v.map((s,t)=>e.jsx(Q,{paper:s,rank:t+1},s.id))}),e.jsx("div",{ref:D,style:{height:1}}),r.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]}))]})]})]})};export{je as default};
|
assets/PapersListView-DaDEc__t.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{a as q,r as l,A as z,j as e,L as f,b as G}from"./index-C--7Ookn.js";import{I as H,P as Q}from"./components-KzuuRgbc.js";import{t as U,d as W}from"./transform-BfLoZuxV.js";import{u as K}from"./usePapers-B1XrbsG4.js";import{u as V}from"./useDebounce-DUBBXDNs.js";import{P as J}from"./usePeriodFilter-tyR-fiQK.js";import{u as X,P as Y}from"./useIntersectionObserver-BFYx46oo.js";import{S as m}from"./skeleton-r_i4hk58.js";import{A as Z,a as ee}from"./alert-CThmjBPy.js";import{u as se}from"./useQuery-DFn3_KAa.js";import"./LatexTitle-CTfnj_ow.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-DcxJ3elC.js";import"./useBaseQuery-CPtz5T_6.js";const ae=[["trending","trending"],["new","newest"],["cited","most cited"]],je=()=>{var T,A,C,I,L,R,E;const[i,b]=q(),h=i.get("framework")||void 0,g=i.get("repository")||void 0,n=!!(h||g),p=i.get("search")||"",[_,y]=l.useState(p),c=V(_,300);l.useEffect(()=>y(p),[p]),l.useEffect(()=>{if(c===p)return;const s=new URLSearchParams(i);c?s.set("search",c):s.delete("search"),b(s,{replace:!0})},[c]);const j=i.get("order_by"),N=j==="citation_count"?"cited":j==="trending"||!j&&n?"trending":"new",o=i.get("time"),B=o==="today"?"Today":o==="week"?"This Week":o==="month"?"This Month":"All Time",w=i.get("has_hf_artifacts")==="true",k=!n&&i.get("has_code")==="true",u=(s,t)=>{const d=new URLSearchParams(i);t?d.set(s,t):d.delete(s),b(d)},O=s=>{u("time",s==="Today"?"today":s==="This Week"?"week":s==="This Month"?"month":void 0)},$=s=>{u("order_by",s==="cited"?"citation_count":s==="new"?"date_published":"trending")},r=K({page_size:20,order_by:N==="trending"?"trending":N==="cited"?"citation_count":"date_published",order_dir:"desc",search:c||void 0,time:o==="today"||o==="week"||o==="month"?o:"all_time",include_resources:!0,published_after:i.get("published_after")||void 0,published_before:i.get("published_before")||void 0,conference:i.get("conference")||void 0,latest_only:i.get("latest_only")!=="false",has_code:k,has_hf_artifacts:w,framework:h,repository:g}),P=se({queryKey:["top-tasks-sidebar"],queryFn:()=>G.getTopTasks({limit:8}),enabled:!n,staleTime:10*60*1e3}),v=l.useMemo(()=>{var t;return(((t=r.data)==null?void 0:t.pages.flatMap(d=>d.results))||[]).map(U)},[r.data]),{targetRef:D,isIntersecting:F}=X({rootMargin:"200px"});l.useEffect(()=>{F&&r.hasNextPage&&!r.isFetchingNextPage&&r.fetchNextPage()},[F,r.hasNextPage,r.isFetchingNextPage]);const x=((C=(A=(T=r.data)==null?void 0:T.pages)==null?void 0:A[0])==null?void 0:C.count)??0,a=(R=(L=(I=r.data)==null?void 0:I.pages)==null?void 0:L[0])==null?void 0:R.scope,S=h&&r.error instanceof z&&r.error.status===404,M=(a==null?void 0:a.kind)==="framework"?a.framework_name:a==null?void 0:a.repository;return e.jsxs("div",{className:"page",children:[(a==null?void 0:a.kind)==="framework"&&e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(f,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(f,{to:"/frameworks",children:"Frameworks"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:a.framework_name})]}),e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:n?e.jsxs(e.Fragment,{children:["Papers implemented by ",e.jsx("em",{children:M||h||g})]}):e.jsxs(e.Fragment,{children:["All ",e.jsx("em",{children:"Papers"})]})}),e.jsx("div",{className:"feed-subtitle",children:n?a!=null&&a.repository?e.jsxs(e.Fragment,{children:["GitHub repository ",e.jsx("strong",{children:a.repository}),". ",x>0&&`${x.toLocaleString()} papers.`]}):"Repository-scoped paper feed.":e.jsxs(e.Fragment,{children:["Search the full corpus. ",x>0&&`${x.toLocaleString()} papers indexed.`]})}),n&&a&&e.jsxs("div",{className:"framework-card-links paper-feed-scope-links",children:[a.github_url&&e.jsxs("a",{href:a.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(H,{name:"github",size:13}),"GitHub"]}),a.kind==="framework"&&a.introducing_paper_arxiv_id&&e.jsx(f,{to:`/paper/${a.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"})]})]}),e.jsx("div",{className:"period-switch",children:J.map(s=>e.jsx("button",{className:`period-btn ${B===s?"active":""}`,onClick:()=>O(s),children:s},s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(H,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:_,onChange:s=>y(s.target.value)})]})}),e.jsxs("div",{className:n?"papers-feed-layout-scoped":"layout-with-sidebar",children:[!n&&e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),P.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,t)=>e.jsx(m,{className:"h-5 w-full"},t))}),(E=P.data)==null?void 0:E.map(s=>e.jsxs(f,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[W(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id))]})}),e.jsxs("div",{children:[e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:ae.map(([s,t])=>e.jsx("button",{className:`sort-btn ${N===s?"active":""}`,onClick:()=>$(s),children:t},s))}),e.jsx(Y,{hasCode:k,hasHfArtifacts:w,onHasCodeChange:s=>u("has_code",s?"true":void 0),onHasHfArtifactsChange:s=>u("has_hf_artifacts",s?"true":void 0),showHasCode:!n})]}),e.jsxs("div",{className:"results-count",children:[v.length," loaded"]})]}),S?e.jsx("div",{className:"no-results",children:"Framework not found."}):r.error&&e.jsx(Z,{variant:"destructive",className:"mb-4",children:e.jsx(ee,{children:"Failed to load papers. Please try again."})}),!S&&(r.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,t)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(m,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(m,{className:"h-6 w-3/4"}),e.jsx(m,{className:"h-4 w-1/2"}),e.jsx(m,{className:"h-12 w-full"})]})]},t))}):v.length===0?e.jsx("div",{className:"no-results",children:"No matching papers."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:v.map((s,t)=>e.jsx(Q,{paper:s,rank:t+1},s.id))}),e.jsx("div",{ref:D,style:{height:1}}),r.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]}))]})]})]})};export{je as default};
|
|
|
|
|
|
assets/{PrivacyView-COVowARX.js → PrivacyView-_LBl02c6.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{R as s,j as e}from"./index-
|
|
|
|
| 1 |
+
import{R as s,j as e}from"./index-ChUK4pXW.js";import{f as i,D as r}from"./latexPlainText-DI8YEXVe.js";const t=()=>(s.useEffect(()=>(document.title=i("Privacy Policy"),()=>{document.title=r}),[]),e.jsxs("article",{className:"page legal-page",children:[e.jsxs("header",{className:"legal-header",children:[e.jsx("p",{className:"legal-kicker",children:"Legal"}),e.jsx("h1",{children:"Privacy Policy"}),e.jsx("p",{className:"legal-effective-date",children:"Effective August 4, 2026"})]}),e.jsx("p",{children:"This Privacy Policy explains how Hugging Face, Inc. (“Hugging Face,” “we,” or “us”) collects, uses, and shares information when you use Papers With Code, including its website, research assistant, APIs, and related services (the “Service”)."}),e.jsxs("section",{children:[e.jsx("h2",{children:"1. Information we collect"}),e.jsx("h3",{children:"Information you provide"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Account information."})," If you sign in with Hugging Face, we receive account identifiers and profile details needed to authenticate you, such as your user ID, username, and avatar."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Contributions and preferences."})," We collect information you submit or save, such as paper submissions and edits, bookmarks, display preferences, feedback, and communications with us. Material you submit to a public research page may be publicly visible."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Research assistant content."})," We collect your questions, conversation history, generated answers, citations, tool calls and results, and feedback about answers. Chats are private to your account unless you choose to create a share link; anyone with that link may be able to view the shared chat."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Provider and billing information."})," If you enable a model provider, we process the authorization or API credentials needed to make requests on your behalf. Hugging Face or another provider processes its own billing information under its terms. Papers With Code does not collect your payment-card details."]})]}),e.jsx("h3",{children:"Information collected automatically"}),e.jsx("p",{children:"We collect technical and usage information such as IP address, browser and device type, operating system, pages or features used, dates and times, referring pages, request identifiers, cookies, logs, and diagnostic data. For research-assistant requests, this may include the selected model, token and cost details, latency, errors, and other operational metadata."}),e.jsx("h3",{children:"Research assistant tracing"}),e.jsxs("p",{children:["To evaluate, debug, secure, and improve the research assistant, we use Langfuse to record traces. A trace may contain the complete text of your question and the assistant's answer, as well as tool inputs, tool outputs, retrieved research material, model details, usage data, and related operational metadata.",e.jsx("strong",{children:" This trace content is not redacted before it is sent to Langfuse."})]}),e.jsx("p",{children:"Papers With Code is designed for questions about research literature. Do not put passwords, API keys, confidential information, health or financial data, or other sensitive personal information in research-assistant prompts."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"2. How we use information"}),e.jsx("p",{children:"We use information to:"}),e.jsxs("ul",{children:[e.jsx("li",{children:"provide, personalize, maintain, and operate the Service;"}),e.jsx("li",{children:"authenticate users and keep accounts and the Service secure;"}),e.jsx("li",{children:"run research-assistant requests and preserve conversation history;"}),e.jsx("li",{children:"measure performance, troubleshoot failures, and improve quality;"}),e.jsx("li",{children:"review contributions, prevent abuse, and enforce applicable terms;"}),e.jsx("li",{children:"communicate with you and respond to requests; and"}),e.jsx("li",{children:"comply with law and protect users, Hugging Face, and the public."})]})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"3. How we share information"}),e.jsx("p",{children:"We may share information in these circumstances:"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Service providers."})," Vendors process information for hosting, authentication, analytics, observability, security, and support. These include Hugging Face services, Langfuse for research-assistant tracing, Plausible for website analytics, and infrastructure providers."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Model providers."})," Research-assistant content is sent to the model provider you use, such as Hugging Face Inference Providers or OpenRouter, so it can generate a response. That provider's privacy terms also apply to its processing."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Public and shared content."})," Contributions intended for public pages are public. A chat is disclosed through the Service when you create and distribute a share link."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Legal, safety, and corporate events."})," We may disclose information when reasonably necessary to comply with law, protect rights and safety, investigate abuse, or complete a merger, acquisition, financing, or transfer of assets."]})]}),e.jsx("p",{children:"We do not sell your personal information."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"4. Cookies and analytics"}),e.jsx("p",{children:"We use cookies and similar storage when needed for sign-in, security, preferences, and operation of the Service. We also use Plausible to understand aggregate website usage. You can control cookies through your browser, but disabling necessary cookies may prevent account features from working."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"5. Legal bases"}),e.jsx("p",{children:"Where applicable law requires a legal basis, we process information as needed to perform our agreement with you, with your consent, to comply with legal obligations, and for legitimate interests such as operating, securing, and improving the Service. You may withdraw consent where consent is the basis for processing, without affecting earlier processing."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"6. Retention and deletion"}),e.jsx("p",{children:"We keep information for as long as reasonably needed for the purposes described here, including providing the Service, maintaining security and audit records, resolving disputes, and meeting legal obligations. Retention periods vary by data type and service provider. You can delete individual chats in the Service. Deletion may not immediately remove information from backups, security logs, or third-party systems where limited retention is required."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"7. Security and international transfers"}),e.jsx("p",{children:"We use reasonable administrative, technical, and organizational safeguards, but no internet service can guarantee absolute security. We and our service providers may process information in the United States and other countries, which may have different data-protection laws from your country. Where required, we use appropriate safeguards for international transfers."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"8. Your privacy rights"}),e.jsx("p",{children:"Depending on where you live, you may have rights to access, correct, delete, or receive a copy of your personal information; object to or restrict processing; withdraw consent; or appeal a decision about a request. You may also have the right to complain to a data-protection authority. We may need to verify your identity before fulfilling a request."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"9. Children"}),e.jsx("p",{children:"The Service is not directed to children under 13, and we do not knowingly collect personal information from children under 13. If you believe a child has provided personal information, please contact us."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"10. Changes to this policy"}),e.jsx("p",{children:"We may update this policy as the Service changes. We will post the revised policy here and update its effective date. If a change is material, we will provide additional notice when appropriate."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"11. Contact us"}),e.jsxs("p",{children:["For questions or privacy requests, contact"," ",e.jsx("a",{href:"mailto:privacy@huggingface.co",children:"privacy@huggingface.co"}),". Please do not include passwords, API keys, or other sensitive credentials in your message."]})]})]}));export{t as default};
|
assets/RateLimitsView-DWAityrz.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{j as e,d as s}from"./index-ChUK4pXW.js";import{u as r}from"./useQuery-CKrTCSf-.js";const c=()=>{const i=r({queryKey:["submission-rate-limit-policy"],queryFn:async()=>{const t=await fetch(s("/api/v1/rate-limits"));if(!t.ok)throw new Error("Policy unavailable");return t.json()}}).data;return e.jsxs("div",{className:"page",style:{maxWidth:760},children:[e.jsx("h1",{children:"Submission and rate-limit policy"}),i?e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Each account may have up to ",i.active_pending," active submissions."]}),e.jsxs("p",{children:["New submissions are limited to ",i.subject_per_hour," per account and ",i.ip_per_hour," per source network in a rolling hour."]})]}):e.jsx("p",{children:"Loading current limits…"}),e.jsx("p",{children:"Duplicate, no-op, and idempotently replayed requests do not consume creation quota."}),e.jsx("p",{children:"Rate-limited responses use HTTP 429 with Retry-After, RateLimit, and RateLimit-Policy headers."}),e.jsx("p",{children:"Good-faith contributors who are blocked should contact the Papers with Code maintainers with their Hugging Face username."})]})};export{c as default};
|
assets/SavedPapersView-BI6TzWZp.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{f as m,A as h,j as e,aa as u,L as x,b as v}from"./index-ChUK4pXW.js";import{u as g}from"./useQuery-CKrTCSf-.js";import{T as j,P as N}from"./components-Oks99QHA.js";import{S as r}from"./skeleton-qvDYp1rq.js";import{A as f,a as b}from"./alert-DNLHMDlv.js";import{t as y}from"./transform-CuJRPBDz.js";import{s as k}from"./savedPapersAuth-CwvxUiK0.js";import"./LatexTitle-RPgzE218.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";const $=()=>{var d;const{user:n,isLoading:o}=m(),s=g({queryKey:["my-bookmarks"],queryFn:()=>v.getMyBookmarks(),enabled:!!n,staleTime:30*1e3,refetchOnWindowFocus:!1}),t=s.error instanceof h&&s.error.code==="saved_papers_bucket_authorization_required",p=()=>{window.location.assign(k())};return o?e.jsxs("div",{className:"page",children:[e.jsx(r,{className:"h-10 w-1/3 mb-4"}),e.jsx(r,{className:"h-6 w-1/2 mb-8"})]}):n?e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:[(d=s.data)!=null&&d.count?`${s.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain."," · ",e.jsx("a",{href:`https://huggingface.co/buckets/${n.username}/pwc-saved-papers`,target:"_blank",rel:"noopener noreferrer",children:"Open your Hugging Face Bucket"})]})]})}),t?e.jsxs("div",{className:"saved-signin-panel",children:[e.jsx("p",{children:"Saved papers live in a private Hugging Face Bucket that belongs to you."}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:p,children:"Connect saved-papers Bucket"})]}):s.error?e.jsx(f,{variant:"destructive",className:"mb-4",children:e.jsx(b,{children:"Failed to load your saved papers. Please try again."})}):null,t||s.error?null:s.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,a)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(r,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(r,{className:"h-6 w-3/4"}),e.jsx(r,{className:"h-4 w-1/2"}),e.jsx(r,{className:"h-12 w-full"})]})]},a))}):!s.data||s.data.count===0?e.jsxs("div",{className:"no-results",children:["No saved papers yet."," ",e.jsx(x,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers →"})]}):s.data.areas.map(i=>e.jsxs("section",{className:"saved-area-section",children:[e.jsx("h2",{className:"saved-area-heading",children:i.name}),i.tasks.map(a=>{const l=a.papers.length;return e.jsxs("div",{className:"saved-task-block",children:[e.jsxs("div",{className:"saved-task-row",children:[a.slug?e.jsx(j,{slug:a.slug,label:a.name}):e.jsx("span",{className:"tag-chip",style:{background:"var(--surface)"},children:a.name}),e.jsxs("span",{className:"saved-task-count",children:[l," ",l===1?"paper":"papers"]})]}),e.jsx("div",{className:"paper-list",children:a.papers.map(c=>e.jsx(N,{paper:y(c),rank:1},c.id))})]},`task-${i.id??"other"}-${a.id??"untagged"}`)})]},`area-${i.id??"other"}`))]}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsx("div",{className:"feed-subtitle",children:"Sign in with Hugging Face to save papers and revisit them later."})]})}),e.jsx("div",{className:"saved-signin-panel",children:e.jsx(u,{returnTo:"/saved"})})]})};export{$ as default};
|
assets/SavedPapersView-BX749Ydn.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{f as m,A as h,j as e,aa as u,L as x,b as v}from"./index-C--7Ookn.js";import{u as g}from"./useQuery-DFn3_KAa.js";import{T as j,P as N}from"./components-KzuuRgbc.js";import{S as r}from"./skeleton-r_i4hk58.js";import{A as f,a as b}from"./alert-CThmjBPy.js";import{t as y}from"./transform-BfLoZuxV.js";import{s as k}from"./savedPapersAuth-ByDMJP74.js";import"./useBaseQuery-CPtz5T_6.js";import"./LatexTitle-CTfnj_ow.js";import"./katex.min-BSBacQyE.js";const $=()=>{var d;const{user:n,isLoading:o}=m(),s=g({queryKey:["my-bookmarks"],queryFn:()=>v.getMyBookmarks(),enabled:!!n,staleTime:30*1e3,refetchOnWindowFocus:!1}),t=s.error instanceof h&&s.error.code==="saved_papers_bucket_authorization_required",p=()=>{window.location.assign(k())};return o?e.jsxs("div",{className:"page",children:[e.jsx(r,{className:"h-10 w-1/3 mb-4"}),e.jsx(r,{className:"h-6 w-1/2 mb-8"})]}):n?e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:[(d=s.data)!=null&&d.count?`${s.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain."," · ",e.jsx("a",{href:`https://huggingface.co/buckets/${n.username}/pwc-saved-papers`,target:"_blank",rel:"noopener noreferrer",children:"Open your Hugging Face Bucket"})]})]})}),t?e.jsxs("div",{className:"saved-signin-panel",children:[e.jsx("p",{children:"Saved papers live in a private Hugging Face Bucket that belongs to you."}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:p,children:"Connect saved-papers Bucket"})]}):s.error?e.jsx(f,{variant:"destructive",className:"mb-4",children:e.jsx(b,{children:"Failed to load your saved papers. Please try again."})}):null,t||s.error?null:s.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,a)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(r,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(r,{className:"h-6 w-3/4"}),e.jsx(r,{className:"h-4 w-1/2"}),e.jsx(r,{className:"h-12 w-full"})]})]},a))}):!s.data||s.data.count===0?e.jsxs("div",{className:"no-results",children:["No saved papers yet."," ",e.jsx(x,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers →"})]}):s.data.areas.map(i=>e.jsxs("section",{className:"saved-area-section",children:[e.jsx("h2",{className:"saved-area-heading",children:i.name}),i.tasks.map(a=>{const l=a.papers.length;return e.jsxs("div",{className:"saved-task-block",children:[e.jsxs("div",{className:"saved-task-row",children:[a.slug?e.jsx(j,{slug:a.slug,label:a.name}):e.jsx("span",{className:"tag-chip",style:{background:"var(--surface)"},children:a.name}),e.jsxs("span",{className:"saved-task-count",children:[l," ",l===1?"paper":"papers"]})]}),e.jsx("div",{className:"paper-list",children:a.papers.map(c=>e.jsx(N,{paper:y(c),rank:1},c.id))})]},`task-${i.id??"other"}-${a.id??"untagged"}`)})]},`area-${i.id??"other"}`))]}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsx("div",{className:"feed-subtitle",children:"Sign in with Hugging Face to save papers and revisit them later."})]})}),e.jsx("div",{className:"saved-signin-panel",children:e.jsx(u,{returnTo:"/saved"})})]})};export{$ as default};
|
|
|
|
|
|
assets/SearchOverlay-ByX4_sGQ.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{r as C,u as L,R as T,i as $,j as s,b as m}from"./index-C--7Ookn.js";import{u as p}from"./useQuery-DFn3_KAa.js";import{L as A}from"./LatexTitle-CTfnj_ow.js";import{u as D}from"./useDebounce-DUBBXDNs.js";import{c as z,h as M,d as B}from"./transform-BfLoZuxV.js";import"./useBaseQuery-CPtz5T_6.js";import"./katex.min-BSBacQyE.js";const I=10,J=({open:n,onClose:l})=>{var f,_,F,q,E,P;const v=C.useRef(null),w=L(),[c,R]=T.useState(""),[h,g]=T.useState(1),a=D(c,200),x=$();C.useEffect(()=>{var r;if(!n)return;(r=v.current)==null||r.focus();const e=K=>{K.key==="Escape"&&l()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n,l]);const t=p({queryKey:["search-papers",a,h],queryFn:()=>m.searchPapers(a,h,I),enabled:n&&a.length>=2,staleTime:6e4}),k=p({queryKey:["search-tasks",a],queryFn:()=>m.getTasks({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),y=p({queryKey:["search-methods",a],queryFn:()=>m.getMethods({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),N=p({queryKey:["search-benchmarks",a],queryFn:()=>m.getDatasets({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4});if(!n)return null;const o=((f=k.data)==null?void 0:f.results)||[],d=((_=y.data)==null?void 0:_.results)||[],u=((F=N.data)==null?void 0:F.results)||[],j=((q=t.data)==null?void 0:q.results)||[],Q=t.isFetching||k.isFetching||y.isFetching||N.isFetching,S=o.length||j.length||d.length||u.length,i=e=>{l(),w(e)},b=()=>{const e=c.trim();e&&i(`/chat?q=${encodeURIComponent(e)}`)};return s.jsx("div",{className:"search-overlay",onClick:l,children:s.jsxs("div",{className:"search-modal",onClick:e=>e.stopPropagation(),children:[s.jsx("input",{ref:v,className:"search-modal-input",placeholder:"Search papers, tasks, methods, or benchmarks…",value:c,onChange:e=>{R(e.target.value),g(1)},onKeyDown:e=>{x&&e.key==="Enter"&&(e.preventDefault(),b())}}),s.jsxs("div",{className:"search-results",children:[x&&c.trim()&&s.jsxs("button",{type:"button",className:"search-ask-row",onClick:b,children:[s.jsx("span",{className:"search-ask-chip",children:"assistant"}),s.jsxs("span",{className:"search-ask-text",children:["Ask: “",c.trim(),"”"]}),s.jsx("kbd",{children:"↵"})]}),!a&&s.jsxs("div",{className:"search-empty",children:["Try “diffusion”, “object detection”, or an arXiv id.",x&&s.jsx("span",{className:"search-empty-sub",children:"Press Enter to ask the assistant"})]}),a&&!Q&&!S&&s.jsxs("div",{className:"search-empty",children:['No matches for "',c,'"']}),o.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Tasks · ",o.length]}),o.map(e=>{const r=z(M(e.slug||""));return s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/tasks/${e.slug}`),children:[s.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:r.dot}}),s.jsx("span",{className:"name",children:B(e.name,e.slug)}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id)})]}),d.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Methods · ",d.length]}),d.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/methods/${e.slug||e.id}`),children:[s.jsx("span",{style:{fontFamily:"var(--mono)",fontWeight:600},children:e.name}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id))]}),u.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Benchmarks · ",u.length]}),u.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/benchmark/${e.slug||e.id}`),children:[s.jsx("span",{className:"name",children:e.name}),e.paper_count!=null&&e.paper_count>0&&s.jsxs("span",{className:"count",children:[e.paper_count," entries"]})]},e.id))]}),j.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Papers · page ",h]}),j.map(e=>{var r;return s.jsxs("div",{className:"search-result",onClick:()=>i(`/paper/${e.arxiv_id||e.id}`),children:[s.jsx("div",{className:"search-result-title",children:s.jsx(A,{title:e.title})}),s.jsxs("div",{className:"search-result-meta",children:[s.jsx("span",{children:e.arxiv_id?`arXiv:${e.arxiv_id}`:"External resource"}),((r=e.authors)==null?void 0:r[0])&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:[e.authors[0],e.authors.length>1?" et al.":""]})]}),e.citation_count!=null&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:["↑ ",e.citation_count.toLocaleString()]})]})]})]},e.id)}),(((E=t.data)==null?void 0:E.previous_page)||((P=t.data)==null?void 0:P.next_page))&&s.jsxs("div",{className:"search-paper-pagination",children:[s.jsx("button",{type:"button",disabled:!t.data.previous_page||t.isFetching,onClick:()=>{var e;return g(((e=t.data)==null?void 0:e.previous_page)||1)},children:"Previous"}),s.jsxs("span",{children:["Page ",h]}),s.jsx("button",{type:"button",disabled:!t.data.next_page||t.isFetching,onClick:()=>{var e;(e=t.data)!=null&&e.next_page&&g(t.data.next_page)},children:"Next"})]})]})]})]})})};export{J as default};
|
|
|
|
|
|
assets/SearchOverlay-CkCAbsvr.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{r as C,u as L,R as T,i as $,j as s,b as m}from"./index-ChUK4pXW.js";import{u as p}from"./useQuery-CKrTCSf-.js";import{L as A}from"./LatexTitle-RPgzE218.js";import{u as D}from"./useDebounce-DkM8rHsa.js";import{c as z,h as M,d as B}from"./transform-CuJRPBDz.js";import"./katex.min-BSBacQyE.js";const I=10,H=({open:n,onClose:l})=>{var f,_,F,q,E,P;const v=C.useRef(null),w=L(),[c,R]=T.useState(""),[h,g]=T.useState(1),a=D(c,200),x=$();C.useEffect(()=>{var r;if(!n)return;(r=v.current)==null||r.focus();const e=K=>{K.key==="Escape"&&l()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n,l]);const t=p({queryKey:["search-papers",a,h],queryFn:()=>m.searchPapers(a,h,I),enabled:n&&a.length>=2,staleTime:6e4}),k=p({queryKey:["search-tasks",a],queryFn:()=>m.getTasks({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),y=p({queryKey:["search-methods",a],queryFn:()=>m.getMethods({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),N=p({queryKey:["search-benchmarks",a],queryFn:()=>m.getDatasets({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4});if(!n)return null;const o=((f=k.data)==null?void 0:f.results)||[],d=((_=y.data)==null?void 0:_.results)||[],u=((F=N.data)==null?void 0:F.results)||[],j=((q=t.data)==null?void 0:q.results)||[],Q=t.isFetching||k.isFetching||y.isFetching||N.isFetching,S=o.length||j.length||d.length||u.length,i=e=>{l(),w(e)},b=()=>{const e=c.trim();e&&i(`/chat?q=${encodeURIComponent(e)}`)};return s.jsx("div",{className:"search-overlay",onClick:l,children:s.jsxs("div",{className:"search-modal",onClick:e=>e.stopPropagation(),children:[s.jsx("input",{ref:v,className:"search-modal-input",placeholder:"Search papers, tasks, methods, or benchmarks…",value:c,onChange:e=>{R(e.target.value),g(1)},onKeyDown:e=>{x&&e.key==="Enter"&&(e.preventDefault(),b())}}),s.jsxs("div",{className:"search-results",children:[x&&c.trim()&&s.jsxs("button",{type:"button",className:"search-ask-row",onClick:b,children:[s.jsx("span",{className:"search-ask-chip",children:"assistant"}),s.jsxs("span",{className:"search-ask-text",children:["Ask: “",c.trim(),"”"]}),s.jsx("kbd",{children:"↵"})]}),!a&&s.jsxs("div",{className:"search-empty",children:["Try “diffusion”, “object detection”, or an arXiv id.",x&&s.jsx("span",{className:"search-empty-sub",children:"Press Enter to ask the assistant"})]}),a&&!Q&&!S&&s.jsxs("div",{className:"search-empty",children:['No matches for "',c,'"']}),o.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Tasks · ",o.length]}),o.map(e=>{const r=z(M(e.slug||""));return s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/tasks/${e.slug}`),children:[s.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:r.dot}}),s.jsx("span",{className:"name",children:B(e.name,e.slug)}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id)})]}),d.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Methods · ",d.length]}),d.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/methods/${e.slug||e.id}`),children:[s.jsx("span",{style:{fontFamily:"var(--mono)",fontWeight:600},children:e.name}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id))]}),u.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Benchmarks · ",u.length]}),u.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/benchmark/${e.slug||e.id}`),children:[s.jsx("span",{className:"name",children:e.name}),e.paper_count!=null&&e.paper_count>0&&s.jsxs("span",{className:"count",children:[e.paper_count," entries"]})]},e.id))]}),j.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Papers · page ",h]}),j.map(e=>{var r;return s.jsxs("div",{className:"search-result",onClick:()=>i(`/paper/${e.arxiv_id||e.id}`),children:[s.jsx("div",{className:"search-result-title",children:s.jsx(A,{title:e.title})}),s.jsxs("div",{className:"search-result-meta",children:[s.jsx("span",{children:e.arxiv_id?`arXiv:${e.arxiv_id}`:"External resource"}),((r=e.authors)==null?void 0:r[0])&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:[e.authors[0],e.authors.length>1?" et al.":""]})]}),e.citation_count!=null&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:["↑ ",e.citation_count.toLocaleString()]})]})]})]},e.id)}),(((E=t.data)==null?void 0:E.previous_page)||((P=t.data)==null?void 0:P.next_page))&&s.jsxs("div",{className:"search-paper-pagination",children:[s.jsx("button",{type:"button",disabled:!t.data.previous_page||t.isFetching,onClick:()=>{var e;return g(((e=t.data)==null?void 0:e.previous_page)||1)},children:"Previous"}),s.jsxs("span",{children:["Page ",h]}),s.jsx("button",{type:"button",disabled:!t.data.next_page||t.isFetching,onClick:()=>{var e;(e=t.data)!=null&&e.next_page&&g(t.data.next_page)},children:"Next"})]})]})]})]})})};export{H as default};
|
assets/SettingsView-BpIZT3v2.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import{c as N,f as Q,Z as B,as as z,i as W,R as m,h as $,j as e,aa as p,d as F,b as j,A as L}from"./index-ChUK4pXW.js";import{u as K}from"./useQuery-CKrTCSf-.js";import{u as b}from"./useMutation-BgE1BvtL.js";import{S as I}from"./switch-CZapgTe1.js";import{f as V,D as Z}from"./latexPlainText-DI8YEXVe.js";import{b as G,u as J,r as X,a as v}from"./openrouter-udlhTNlE.js";import{E as T}from"./external-link-CF9iDKKZ.js";import"./index-0fPuHBwH.js";/**
|
| 2 |
+
* @license lucide-react v0.462.0 - ISC
|
| 3 |
+
*
|
| 4 |
+
* This source code is licensed under the ISC license.
|
| 5 |
+
* See the LICENSE file in the root directory of this source tree.
|
| 6 |
+
*/const ee=N("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
|
| 7 |
+
* @license lucide-react v0.462.0 - ISC
|
| 8 |
+
*
|
| 9 |
+
* This source code is licensed under the ISC license.
|
| 10 |
+
* See the LICENSE file in the root directory of this source tree.
|
| 11 |
+
*/const se=N("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
| 12 |
+
* @license lucide-react v0.462.0 - ISC
|
| 13 |
+
*
|
| 14 |
+
* This source code is licensed under the ISC license.
|
| 15 |
+
* See the LICENSE file in the root directory of this source tree.
|
| 16 |
+
*/const ne=N("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),te="https://openrouter.ai/settings/keys";function f(n,c){if(n instanceof L){if(typeof n.detail=="string")return n.detail;if(typeof n.detail=="object"&&n.detail!==null&&"message"in n.detail&&typeof n.detail.message=="string")return n.detail.message}return n instanceof Error&&!n.message.startsWith("API request failed:")?n.message:c}const ge=()=>{const{user:n,isLoading:c}=Q(),{preferences:M,setHideClosedSourceEvals:A,canPersist:H}=B(),{theme:D,setTheme:q}=z(),U=D??"system",d=W(),[k,x]=m.useState(""),[w,o]=m.useState(""),[u,C]=m.useState(""),g=$(),R=K({queryKey:["inference-billing",n==null?void 0:n.hf_subject],enabled:d&&!!n,queryFn:async()=>{const s=await fetch(F("/api/v1/me/inference-billing"),{credentials:"include",cache:"no-store"});if(!s.ok)throw new Error("Could not load billing status.");return await s.json()}}),t=R.data??null,E=G(d&&!!n),Y=J(d&&!!n),a=E.data,l=Y.data,i=a?X(a.resets_at):null,_=b({mutationFn:async s=>{const h=await fetch(F("/api/v1/me/inference-billing"),{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({bill_to:s})}),r=await h.json();if(!h.ok)throw new Error(typeof r.detail=="string"?r.detail:"Could not change the billing account.");return r},onSuccess:s=>{g.setQueryData(["inference-billing",n==null?void 0:n.hf_subject],s),x("")},onError:s=>{x(s instanceof Error?s.message:"Could not change the billing account.")}}),O=R.isLoading||_.isPending,y=b({mutationFn:s=>j.connectOpenRouterCredential(s),onSuccess:s=>{g.setQueryData(v,s),C(""),o("")},onError:s=>o(f(s,"Could not connect the OpenRouter key."))}),S=b({mutationFn:s=>j.setOpenRouterFallback(s),onSuccess:s=>{g.setQueryData(v,s),o("")},onError:s=>o(f(s,"Could not change paid fallback."))}),P=b({mutationFn:()=>j.disconnectOpenRouterCredential(),onSuccess:()=>{g.setQueryData(v,{connected:!1,verified_at:null,fallback_enabled:!1}),o("")},onError:s=>o(f(s,"Could not disconnect the OpenRouter key."))});return m.useEffect(()=>(document.title=V("Settings"),()=>{document.title=Z}),[]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:e.jsx("em",{children:"Settings"})}),e.jsx("div",{className:"feed-subtitle",children:"Control how papers and benchmarks are displayed across the site."})]})}),n&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Catalog access"}),e.jsx("div",{className:"settings-note settings-note-flush",children:e.jsxs("span",{children:["Role: ",e.jsx("strong",{children:n.role??"community member"}),"."," ",n.can_directly_edit_catalog?"You can apply catalog edits directly. Destructive changes require a recent sign-in.":"Your catalog suggestions are sent to the submissions queue for review.",n.is_admin?" You can also review submissions and use administrative maintenance tools.":" Submission review and maintenance tools remain admin-only."]})})]}),d&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Chat usage & billing"}),c&&!n?e.jsx("div",{className:"settings-billing-loading",role:"status","aria-live":"polite",children:"Checking account…"}):n?e.jsxs("div",{className:"settings-provider-grid",children:[e.jsxs("section",{className:"settings-provider-card","aria-labelledby":"inference-providers-heading",children:[e.jsxs("div",{className:"settings-provider-heading",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"inference-providers-heading",children:"Inference Providers"}),e.jsx("p",{children:"Hugging Face-billed model usage"})]}),(t==null?void 0:t.connected)&&e.jsx("span",{className:"settings-connected-badge",children:"Connected"})]}),O&&!t?e.jsx("div",{className:"settings-billing-loading",children:"Checking Hugging Face billing…"}):t!=null&&t.connected?e.jsxs("div",{className:"settings-billing",children:[e.jsx("div",{className:"settings-row-label",children:t.bill_to?`Organization · ${t.bill_to}`:`Personal account · @${n.username}`}),e.jsx("p",{className:"settings-row-desc",children:"Usage for Hugging Face Inference Providers is billed by Hugging Face to your selected account. Your included Hugging Face usage is applied first; pay-as-you-go billing applies once it is depleted, according to your Hugging Face plan and billing settings. Papers With Code does not fund, meter, or reset these credits."}),e.jsx("label",{className:"settings-token-label",htmlFor:"hf-billing-account",children:"Bill chat usage to"}),e.jsxs("select",{id:"hf-billing-account",className:"settings-billing-select",value:t.bill_to??"",onChange:s=>{x(""),_.mutate(s.target.value||null)},disabled:O,children:[e.jsxs("option",{value:"",children:["Personal account (@",n.username,")"]}),t.organizations.map(s=>e.jsxs("option",{value:s.name,children:[s.display_name," (",s.name,")"]},s.name))]}),k&&e.jsx("div",{className:"settings-token-error",children:k}),e.jsxs("div",{className:"settings-billing-actions",children:[e.jsxs("a",{className:"button button-primary",href:t.usage_url,target:"_blank",rel:"noreferrer",children:["View Hugging Face usage & billing ",e.jsx(T,{"aria-hidden":"true"})]}),e.jsx(p,{returnTo:"/settings",label:"Refresh HF permissions",authorizeInference:!0})]})]}):e.jsxs("div",{className:"settings-billing-connect",children:[e.jsx("p",{className:"settings-row-desc",children:"Reconnect with Hugging Face to authorize Inference Providers. Hugging Face bills your personal account or the organization you select."}),e.jsx("div",{className:"settings-billing-actions",children:e.jsx(p,{returnTo:"/settings",label:"Authorize with Hugging Face",authorizeInference:!0})})]})]}),e.jsxs("section",{className:"settings-provider-card",id:"openrouter-byok","aria-labelledby":"openrouter-heading",children:[e.jsxs("div",{className:"settings-provider-heading",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"openrouter-heading",children:"OpenRouter"}),e.jsx("p",{children:"Papers With Code-funded allowance and optional fallback"})]}),(l==null?void 0:l.connected)&&e.jsx("span",{className:"settings-connected-badge",children:"Key connected"})]}),e.jsx("p",{className:"settings-row-desc",children:"Papers With Code pays for these OpenRouter requests and provides free but limited monthly usage. Your own key is available as an optional fallback."}),a&&(a.available||a.remaining_percent===0)?e.jsxs("div",{className:"settings-usage-row",children:[e.jsxs("div",{className:"settings-usage-heading",children:[e.jsxs("div",{children:[e.jsx("div",{className:"settings-row-label",children:"Monthly OpenRouter usage"}),e.jsxs("div",{className:"settings-row-desc",children:["Resets ",i==null?void 0:i.local," ",e.jsxs("span",{"aria-label":"UTC reset time",children:["(",i==null?void 0:i.utc,")"]})]})]}),e.jsxs("strong",{children:[a.remaining_percent,"% left"]})]}),e.jsx("div",{className:"settings-usage-track",role:"progressbar","aria-label":`${a.remaining_percent}% remaining; resets ${i==null?void 0:i.local}; ${i==null?void 0:i.utc}`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":a.remaining_percent,children:e.jsx("span",{style:{width:`${a.remaining_percent}%`}})}),a.remaining_percent===0&&e.jsx("p",{className:"settings-limit-note",children:"Your free monthly allowance is depleted. Luna and Terra are temporarily unavailable unless you enable your own key below."})]}):e.jsx("div",{className:"settings-billing-loading",children:E.isError||a?"OpenRouter usage is currently unavailable.":"Checking OpenRouter usage…"}),e.jsxs("div",{className:"settings-byok-controls",children:[e.jsx("div",{className:"settings-row-label",children:"Provide your own OpenRouter API key"}),l!=null&&l.connected?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"settings-row-desc",children:["Connected",l.verified_at?` · Last verified ${new Date(l.verified_at).toLocaleString()}`:"",". Your API key is stored securely using AES-256 encryption. It is never shown again."]}),e.jsxs("label",{className:"settings-fallback-control",children:[e.jsx(I,{checked:l.fallback_enabled,disabled:S.isPending,onCheckedChange:s=>S.mutate(!!s)}),e.jsxs("span",{children:[e.jsx("strong",{children:"Use my OpenRouter key when Papers With Code-funded OpenRouter access is unavailable"}),e.jsx("small",{children:"OpenRouter bills this usage to your own account. It is not covered by Papers With Code."})]})]}),e.jsx("p",{className:"settings-billing-help",children:"Disconnecting prevents new requests but cannot cancel a request already sent to OpenRouter."}),e.jsxs("div",{className:"settings-billing-actions",children:[e.jsx("button",{className:"button",type:"button",disabled:P.isPending,onClick:()=>P.mutate(),children:"Disconnect"}),e.jsxs("a",{className:"button",href:te,target:"_blank",rel:"noreferrer",children:["Revoke or rotate at OpenRouter ",e.jsx(T,{"aria-hidden":"true"})]})]})]}):e.jsxs("form",{onSubmit:s=>{s.preventDefault(),u.trim()&&y.mutate(u.trim())},children:[e.jsx("label",{className:"settings-token-label",htmlFor:"openrouter-api-key",children:"OpenRouter API key"}),e.jsx("input",{id:"openrouter-api-key",type:"password",autoComplete:"off",value:u,onChange:s=>C(s.target.value),placeholder:"sk-or-…"}),e.jsx("p",{className:"settings-billing-help",children:"Connecting stores the key but does not authorize paid fallback. Enable billing separately after it is verified."}),e.jsx("div",{className:"settings-billing-actions",children:e.jsx("button",{className:"button button-primary",type:"submit",disabled:!u.trim()||y.isPending,children:y.isPending?"Verifying…":"Connect key"})})]}),w&&e.jsx("div",{className:"settings-token-error",children:w})]})]})]}):e.jsxs("div",{className:"settings-note settings-note-flush",children:[e.jsx("span",{children:"Sign in to connect your Hugging Face account for research chat. Model usage is billed by Hugging Face, not Papers With Code."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(p,{returnTo:"/settings",authorizeInference:!0})})]})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Appearance"}),e.jsx("div",{className:"theme-options","aria-label":"Color theme",children:[{value:"system",label:"System",description:"Match your device",icon:ee},{value:"light",label:"Light",description:"Always use light mode",icon:ne},{value:"dark",label:"Dark",description:"Always use dark mode",icon:se}].map(s=>{const h=s.icon,r=U===s.value;return e.jsxs("button",{type:"button",className:`theme-option ${r?"is-selected":""}`,"aria-pressed":r,onClick:()=>q(s.value),children:[e.jsx(h,{"aria-hidden":"true"}),e.jsxs("span",{className:"theme-option-copy",children:[e.jsx("span",{className:"theme-option-label",children:s.label}),e.jsx("span",{className:"theme-option-desc",children:s.description})]})]},s.value)})})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Evaluations"}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("label",{className:"settings-row-text",htmlFor:"hide-closed-source-evals",children:[e.jsx("span",{className:"settings-row-label",children:"Hide closed-source models"}),e.jsx("span",{className:"settings-row-desc",children:"When enabled, evaluations of closed-source models (proprietary APIs and unreleased flagship models) are hidden from benchmark leaderboards and paper result tables."})]}),e.jsx(I,{id:"hide-closed-source-evals",checked:M.hide_closed_source_evals,onCheckedChange:s=>{A(!!s)}})]}),!c&&!H&&!n&&e.jsxs("div",{className:"settings-note",children:[e.jsx("span",{children:"You are browsing as a guest, so this choice only applies to the current session. Sign in to save it to your account."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(p,{returnTo:"/settings"})})]})]})]})};export{ge as default};
|
assets/SettingsView-BsEFODI2.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
| 1 |
-
import{c as N,f as B,Z as z,as as W,i as Y,R as m,h as $,j as e,aa as p,d as F,b as j,A as L}from"./index-C--7Ookn.js";import{u as K}from"./useQuery-DFn3_KAa.js";import{u as b}from"./useMutation-BLE_nqBT.js";import{S as I}from"./switch-bk-2H4XZ.js";import{f as V,D as Z}from"./latexPlainText-DI8YEXVe.js";import{b as G,u as J,r as X,a as f}from"./openrouter-DFtCKcFx.js";import{E as T}from"./external-link-lUGMp6q9.js";import"./useBaseQuery-CPtz5T_6.js";import"./index-B6Kbql8e.js";/**
|
| 2 |
-
* @license lucide-react v0.462.0 - ISC
|
| 3 |
-
*
|
| 4 |
-
* This source code is licensed under the ISC license.
|
| 5 |
-
* See the LICENSE file in the root directory of this source tree.
|
| 6 |
-
*/const ee=N("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
|
| 7 |
-
* @license lucide-react v0.462.0 - ISC
|
| 8 |
-
*
|
| 9 |
-
* This source code is licensed under the ISC license.
|
| 10 |
-
* See the LICENSE file in the root directory of this source tree.
|
| 11 |
-
*/const se=N("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
| 12 |
-
* @license lucide-react v0.462.0 - ISC
|
| 13 |
-
*
|
| 14 |
-
* This source code is licensed under the ISC license.
|
| 15 |
-
* See the LICENSE file in the root directory of this source tree.
|
| 16 |
-
*/const ne=N("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),te="https://openrouter.ai/settings/keys";function v(n,c){if(n instanceof L){if(typeof n.detail=="string")return n.detail;if(typeof n.detail=="object"&&n.detail!==null&&"message"in n.detail&&typeof n.detail.message=="string")return n.detail.message}return n instanceof Error&&!n.message.startsWith("API request failed:")?n.message:c}const he=()=>{const{user:n,isLoading:c}=B(),{preferences:M,setHideClosedSourceEvals:A,canPersist:H}=z(),{theme:D,setTheme:U}=W(),Q=D??"system",d=Y(),[k,x]=m.useState(""),[w,r]=m.useState(""),[u,C]=m.useState(""),g=$(),R=K({queryKey:["inference-billing",n==null?void 0:n.hf_subject],enabled:d&&!!n,queryFn:async()=>{const s=await fetch(F("/api/v1/me/inference-billing"),{credentials:"include",cache:"no-store"});if(!s.ok)throw new Error("Could not load billing status.");return await s.json()}}),t=R.data??null,E=G(d&&!!n),q=J(d&&!!n),a=E.data,l=q.data,i=a?X(a.resets_at):null,_=b({mutationFn:async s=>{const h=await fetch(F("/api/v1/me/inference-billing"),{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({bill_to:s})}),o=await h.json();if(!h.ok)throw new Error(typeof o.detail=="string"?o.detail:"Could not change the billing account.");return o},onSuccess:s=>{g.setQueryData(["inference-billing",n==null?void 0:n.hf_subject],s),x("")},onError:s=>{x(s instanceof Error?s.message:"Could not change the billing account.")}}),O=R.isLoading||_.isPending,y=b({mutationFn:s=>j.connectOpenRouterCredential(s),onSuccess:s=>{g.setQueryData(f,s),C(""),r("")},onError:s=>r(v(s,"Could not connect the OpenRouter key."))}),P=b({mutationFn:s=>j.setOpenRouterFallback(s),onSuccess:s=>{g.setQueryData(f,s),r("")},onError:s=>r(v(s,"Could not change paid fallback."))}),S=b({mutationFn:()=>j.disconnectOpenRouterCredential(),onSuccess:()=>{g.setQueryData(f,{connected:!1,verified_at:null,fallback_enabled:!1}),r("")},onError:s=>r(v(s,"Could not disconnect the OpenRouter key."))});return m.useEffect(()=>(document.title=V("Settings"),()=>{document.title=Z}),[]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:e.jsx("em",{children:"Settings"})}),e.jsx("div",{className:"feed-subtitle",children:"Control how papers and benchmarks are displayed across the site."})]})}),d&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Chat usage & billing"}),c&&!n?e.jsx("div",{className:"settings-billing-loading",role:"status","aria-live":"polite",children:"Checking account…"}):n?e.jsxs("div",{className:"settings-provider-grid",children:[e.jsxs("section",{className:"settings-provider-card","aria-labelledby":"inference-providers-heading",children:[e.jsxs("div",{className:"settings-provider-heading",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"inference-providers-heading",children:"Inference Providers"}),e.jsx("p",{children:"Hugging Face-billed model usage"})]}),(t==null?void 0:t.connected)&&e.jsx("span",{className:"settings-connected-badge",children:"Connected"})]}),O&&!t?e.jsx("div",{className:"settings-billing-loading",children:"Checking Hugging Face billing…"}):t!=null&&t.connected?e.jsxs("div",{className:"settings-billing",children:[e.jsx("div",{className:"settings-row-label",children:t.bill_to?`Organization · ${t.bill_to}`:`Personal account · @${n.username}`}),e.jsx("p",{className:"settings-row-desc",children:"Usage for Hugging Face Inference Providers is billed by Hugging Face to your selected account. Your included Hugging Face usage is applied first; pay-as-you-go billing applies once it is depleted, according to your Hugging Face plan and billing settings. Papers With Code does not fund, meter, or reset these credits."}),e.jsx("label",{className:"settings-token-label",htmlFor:"hf-billing-account",children:"Bill chat usage to"}),e.jsxs("select",{id:"hf-billing-account",className:"settings-billing-select",value:t.bill_to??"",onChange:s=>{x(""),_.mutate(s.target.value||null)},disabled:O,children:[e.jsxs("option",{value:"",children:["Personal account (@",n.username,")"]}),t.organizations.map(s=>e.jsxs("option",{value:s.name,children:[s.display_name," (",s.name,")"]},s.name))]}),k&&e.jsx("div",{className:"settings-token-error",children:k}),e.jsxs("div",{className:"settings-billing-actions",children:[e.jsxs("a",{className:"button button-primary",href:t.usage_url,target:"_blank",rel:"noreferrer",children:["View Hugging Face usage & billing ",e.jsx(T,{"aria-hidden":"true"})]}),e.jsx(p,{returnTo:"/settings",label:"Refresh HF permissions",authorizeInference:!0})]})]}):e.jsxs("div",{className:"settings-billing-connect",children:[e.jsx("p",{className:"settings-row-desc",children:"Reconnect with Hugging Face to authorize Inference Providers. Hugging Face bills your personal account or the organization you select."}),e.jsx("div",{className:"settings-billing-actions",children:e.jsx(p,{returnTo:"/settings",label:"Authorize with Hugging Face",authorizeInference:!0})})]})]}),e.jsxs("section",{className:"settings-provider-card",id:"openrouter-byok","aria-labelledby":"openrouter-heading",children:[e.jsxs("div",{className:"settings-provider-heading",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"openrouter-heading",children:"OpenRouter"}),e.jsx("p",{children:"Papers With Code-funded allowance and optional fallback"})]}),(l==null?void 0:l.connected)&&e.jsx("span",{className:"settings-connected-badge",children:"Key connected"})]}),e.jsx("p",{className:"settings-row-desc",children:"Papers With Code pays for these OpenRouter requests and provides free but limited monthly usage. Your own key is available as an optional fallback."}),a&&(a.available||a.remaining_percent===0)?e.jsxs("div",{className:"settings-usage-row",children:[e.jsxs("div",{className:"settings-usage-heading",children:[e.jsxs("div",{children:[e.jsx("div",{className:"settings-row-label",children:"Monthly OpenRouter usage"}),e.jsxs("div",{className:"settings-row-desc",children:["Resets ",i==null?void 0:i.local," ",e.jsxs("span",{"aria-label":"UTC reset time",children:["(",i==null?void 0:i.utc,")"]})]})]}),e.jsxs("strong",{children:[a.remaining_percent,"% left"]})]}),e.jsx("div",{className:"settings-usage-track",role:"progressbar","aria-label":`${a.remaining_percent}% remaining; resets ${i==null?void 0:i.local}; ${i==null?void 0:i.utc}`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":a.remaining_percent,children:e.jsx("span",{style:{width:`${a.remaining_percent}%`}})}),a.remaining_percent===0&&e.jsx("p",{className:"settings-limit-note",children:"Your free monthly allowance is depleted. Luna and Terra are temporarily unavailable unless you enable your own key below."})]}):e.jsx("div",{className:"settings-billing-loading",children:E.isError||a?"OpenRouter usage is currently unavailable.":"Checking OpenRouter usage…"}),e.jsxs("div",{className:"settings-byok-controls",children:[e.jsx("div",{className:"settings-row-label",children:"Provide your own OpenRouter API key"}),l!=null&&l.connected?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"settings-row-desc",children:["Connected",l.verified_at?` · Last verified ${new Date(l.verified_at).toLocaleString()}`:"",". Your API key is stored securely using AES-256 encryption. It is never shown again."]}),e.jsxs("label",{className:"settings-fallback-control",children:[e.jsx(I,{checked:l.fallback_enabled,disabled:P.isPending,onCheckedChange:s=>P.mutate(!!s)}),e.jsxs("span",{children:[e.jsx("strong",{children:"Use my OpenRouter key when Papers With Code-funded OpenRouter access is unavailable"}),e.jsx("small",{children:"OpenRouter bills this usage to your own account. It is not covered by Papers With Code."})]})]}),e.jsx("p",{className:"settings-billing-help",children:"Disconnecting prevents new requests but cannot cancel a request already sent to OpenRouter."}),e.jsxs("div",{className:"settings-billing-actions",children:[e.jsx("button",{className:"button",type:"button",disabled:S.isPending,onClick:()=>S.mutate(),children:"Disconnect"}),e.jsxs("a",{className:"button",href:te,target:"_blank",rel:"noreferrer",children:["Revoke or rotate at OpenRouter ",e.jsx(T,{"aria-hidden":"true"})]})]})]}):e.jsxs("form",{onSubmit:s=>{s.preventDefault(),u.trim()&&y.mutate(u.trim())},children:[e.jsx("label",{className:"settings-token-label",htmlFor:"openrouter-api-key",children:"OpenRouter API key"}),e.jsx("input",{id:"openrouter-api-key",type:"password",autoComplete:"off",value:u,onChange:s=>C(s.target.value),placeholder:"sk-or-…"}),e.jsx("p",{className:"settings-billing-help",children:"Connecting stores the key but does not authorize paid fallback. Enable billing separately after it is verified."}),e.jsx("div",{className:"settings-billing-actions",children:e.jsx("button",{className:"button button-primary",type:"submit",disabled:!u.trim()||y.isPending,children:y.isPending?"Verifying…":"Connect key"})})]}),w&&e.jsx("div",{className:"settings-token-error",children:w})]})]})]}):e.jsxs("div",{className:"settings-note settings-note-flush",children:[e.jsx("span",{children:"Sign in to connect your Hugging Face account for research chat. Model usage is billed by Hugging Face, not Papers With Code."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(p,{returnTo:"/settings",authorizeInference:!0})})]})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Appearance"}),e.jsx("div",{className:"theme-options","aria-label":"Color theme",children:[{value:"system",label:"System",description:"Match your device",icon:ee},{value:"light",label:"Light",description:"Always use light mode",icon:ne},{value:"dark",label:"Dark",description:"Always use dark mode",icon:se}].map(s=>{const h=s.icon,o=Q===s.value;return e.jsxs("button",{type:"button",className:`theme-option ${o?"is-selected":""}`,"aria-pressed":o,onClick:()=>U(s.value),children:[e.jsx(h,{"aria-hidden":"true"}),e.jsxs("span",{className:"theme-option-copy",children:[e.jsx("span",{className:"theme-option-label",children:s.label}),e.jsx("span",{className:"theme-option-desc",children:s.description})]})]},s.value)})})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Evaluations"}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("label",{className:"settings-row-text",htmlFor:"hide-closed-source-evals",children:[e.jsx("span",{className:"settings-row-label",children:"Hide closed-source models"}),e.jsx("span",{className:"settings-row-desc",children:"When enabled, evaluations of closed-source models (proprietary APIs and unreleased flagship models) are hidden from benchmark leaderboards and paper result tables."})]}),e.jsx(I,{id:"hide-closed-source-evals",checked:M.hide_closed_source_evals,onCheckedChange:s=>{A(!!s)}})]}),!c&&!H&&!n&&e.jsxs("div",{className:"settings-note",children:[e.jsx("span",{children:"You are browsing as a guest, so this choice only applies to the current session. Sign in to save it to your account."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(p,{returnTo:"/settings"})})]})]})]})};export{he as default};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|