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-BwtvA4mj.js → AiDeadlinesView-BG7IjWh-.js} +1 -1
- assets/{AuthorDetailView-DqSLqx3G.js → AuthorDetailView-BT0wFF7e.js} +1 -1
- assets/{BenchmarkDetailView-CiTO_8pR.js → BenchmarkDetailView-CJEQANf-.js} +1 -1
- assets/{BenchmarkTrendSparkline-DhsyiXV-.js → BenchmarkTrendSparkline-DAxMFKnm.js} +1 -1
- assets/{ChatMessage-BpHxh3F9.js → ChatMessage-BqPqQClr.js} +1 -1
- assets/{ChatView-DoJkTSvB.js → ChatView-DRCYIPi4.js} +1 -1
- assets/{ConferenceDetailView-DN7gXurn.js → ConferenceDetailView-BP5drqUx.js} +1 -1
- assets/{ConferenceTaskView-DpBnKlUj.js → ConferenceTaskView-DeQ10q-x.js} +1 -1
- assets/ConferencesIndexView-ESNh5pHs.js +1 -0
- assets/ConferencesIndexView-hGYdSmIN.js +0 -1
- assets/{CronDashboard-CI9A83xA.js → CronDashboard-Bo73phUc.js} +2 -2
- assets/{FeedView-DG4EYyZw.js → FeedView-Dv7Ll2yq.js} +1 -1
- assets/{FrameworksIndexView-BvfoULdV.js → FrameworksIndexView-CJh-2Pow.js} +1 -1
- assets/{LatexTitle-CqAJNaLC.js → LatexTitle-B1FyT_-3.js} +1 -1
- assets/{MarkdownText-DngbvuDx.js → MarkdownText-mvLqNfwe.js} +1 -1
- assets/{MethodDetailView-AvD5Dqkf.js → MethodDetailView-CkUzVx0g.js} +1 -1
- assets/{MethodsIndexView-Ccm7hy_H.js → MethodsIndexView-BlcIa_fS.js} +2 -2
- assets/{NotFound-ByhKYbf2.js → NotFound-B6qYFFtn.js} +1 -1
- assets/{OrganizationContributionGraph-Ubnek6oO.js → OrganizationContributionGraph-CBDgtzLe.js} +1 -1
- assets/OrganizationDetailView-BbrTMC2j.js +1 -0
- assets/OrganizationDetailView-CxyrG7tq.js +0 -1
- assets/{OrganizationPaperFeed-D99Kpwxe.js → OrganizationPaperFeed-BPCfQF2i.js} +1 -1
- assets/OrganizationTaskView-CFdQxMtl.js +1 -0
- assets/OrganizationTaskView-DiQWNfUD.js +0 -1
- assets/{OrganizationsIndexView-ve-bfvwo.js → OrganizationsIndexView-DN3ysr-g.js} +1 -1
- assets/{PaperDetailView-BGxKbhUm.js → PaperDetailView-BEjlwQbA.js} +0 -0
- assets/{PaperPreviewLink-CLIb-QQ9.js → PaperPreviewLink-DAFhnDhq.js} +1 -1
- assets/{PapersListView-X2HfX-75.js → PapersListView-DpeQT2iM.js} +1 -1
- assets/{PrivacyView-Dyd02vlP.js → PrivacyView-CIEmHSbN.js} +1 -1
- assets/{RateLimitsView-DykXcmrc.js → RateLimitsView-C-wgjf0f.js} +1 -1
- assets/{SavedPapersView-BxAOxEQB.js → SavedPapersView-CKKGXgM6.js} +1 -1
- assets/{SearchOverlay-CE9Hc9me.js → SearchOverlay-hqfeEBSl.js} +1 -1
- assets/{SettingsView-C8SJDomY.js → SettingsView-CwSxZOuD.js} +2 -2
- assets/{SharedChatView-ZXWbiyaq.js → SharedChatView-DUG-nNC-.js} +1 -1
- assets/SignInToEditDialog-BrFD0zbL.js +0 -11
- assets/SignInToEditDialog-ByW2mx_A.js +11 -0
- assets/{StagingAccessRequestView-DaUzokUN.js → StagingAccessRequestView-DPg61I7V.js} +1 -1
- assets/SubmissionsDashboard-CkociQ8D.js +0 -6
- assets/SubmissionsDashboard-bmyAR3Ji.js +6 -0
- assets/SubmitView-D9hURKw9.js +0 -1
- assets/SubmitView-oLTX5Nai.js +1 -0
- assets/{TagBrowseView-DaUDpp12.js → TagBrowseView-Dwwqp3GC.js} +1 -1
- assets/TagsIndexView-DVV95VtR.js +0 -1
- assets/TagsIndexView-Dnvf32XM.js +1 -0
- assets/{TaxonomySuggestionTile-BQyzbk_b.js → TaxonomySuggestionTile-DPjYd5AL.js} +1 -1
- assets/{TrendsView-Bpx3luAe.js → TrendsView-Dse5C7fn.js} +1 -1
- assets/{UserProfileView-sHCROYK8.js → UserProfileView-DLYWBFmP.js} +1 -1
- assets/{alert-DtuWH5Uh.js → alert-CV1yu6Q5.js} +1 -1
- assets/{button-Daj2z1wQ.js → button-Cb-e5tHG.js} +1 -1
- assets/catalog-Cs0CZbdz.js +0 -1
assets/{AiDeadlinesView-BwtvA4mj.js → AiDeadlinesView-BG7IjWh-.js}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
-
import{r as x,j as t}from"./index-
|
| 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)})})]})},ue=()=>{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=A({queryKey:["conference-deadlines"],queryFn:()=>B.conferenceDeadlines(),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{ue as default};
|
|
|
|
| 1 |
+
import{r as x,j as t}from"./index-CnNiludC.js";import{u as A}from"./useQuery-C87uSz9p.js";import{c as B}from"./catalog-D7qk7tAG.js";import{S as U}from"./switch-BmJwxg75.js";import{S as W}from"./skeleton-BU3tw6-C.js";import{A as O,a as V}from"./alert-CV1yu6Q5.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-COYv9g-7.js";import"./index-D0hHQwos.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)})})]})},ue=()=>{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=A({queryKey:["conference-deadlines"],queryFn:()=>B.conferenceDeadlines(),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{ue as default};
|
assets/{AuthorDetailView-DqSLqx3G.js → AuthorDetailView-BT0wFF7e.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{f as m,j as e,L as x,p as h}from"./index-
|
|
|
|
| 1 |
+
import{f as m,j as e,L as x,p as h}from"./index-CnNiludC.js";import{u as d}from"./useQuery-C87uSz9p.js";import{S as c}from"./skeleton-BU3tw6-C.js";import g from"./NotFound-B6qYFFtn.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.authorPapers(a,{page:1,page_size:20}),enabled:!!a});return((l=r.error)==null?void 0:l.status)===404?e.jsx(g,{}):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(x,{to:`/paper/${p}`,children:s.title})},s.id)})})]})]})};export{N as default};
|
assets/{BenchmarkDetailView-CiTO_8pR.js → BenchmarkDetailView-CJEQANf-.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
| 1 |
-
import{u as vt,r as w,j as n,N as se,h as jt,f as _t,a as kt,F as St,L as ue}from"./index-DKw1mejm.js";import{u as ee}from"./useQuery-DkXMNuGa.js";import{c as me}from"./catalog-Cs0CZbdz.js";import{C as Ct,E as Et,e as Nt}from"./evaluations-jTnbLWlD.js";import{S as xe}from"./skeleton-CnS6y9lc.js";import{S as Je}from"./switch-BZtNOz-8.js";import{A as Rt,a as $t}from"./alert-DtuWH5Uh.js";import{L as ye}from"./LatexTitle-CqAJNaLC.js";import{B as Tt}from"./BenchmarkTrendSparkline-DhsyiXV-.js";import{I as Mt}from"./components-Cxl7U1Qh.js";import{s as Ft}from"./safeExternalHref-CkBrsh84.js";import"./hover-card-NZ1AKoGQ.js";import"./index-cAwlSiKl.js";import"./katex.min-BSBacQyE.js";import"./transform-DnfrBiik.js";function Lt(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 It(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 At=({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,ne=i-l-u,L=c-p-f,T=e.map(o=>Ze(o.date)),z=Math.min(...T),I=Math.max(...T),ae=I-z||1,Y=o=>z===I?l+ne/2:l+(o-z)/ae*ne,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,P=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}},ie=[],b=N.length>0?P(N[N.length-1]):null;let _e=-1/0;for(let o=0;o<N.length-1;o++){const m=P(N[o]);m&&(m.left<_e+fe||b&&m.right>b.left-fe||(_e=m.right,ie.push({x:m.x,y:m.y,text:m.text,anchor:m.anchor})))}b&&ie.push({x:b.x,y:b.y,text:b.text,anchor:b.anchor});const K=It(z,I),W=5,ce=o=>a(m=>m===o?null:m),le=o=>{o&&r(`/paper/${o}`)},pe=(o,m)=>{const v=`${o.data.modelName||o.data.paperTitle||"Unknown model"}: ${se(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:()=>ce(o.idx),onFocus:()=>a(o.idx),onBlur:()=>ce(o.idx),onClick:()=>le(o.data.paperRouteId),onKeyDown:C=>{M&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),le(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:se(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"}}))}),ie.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}: ${se(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 Dt=(()=>{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 te=null;function dt(e={}){return te||(e.includeStyleProperties?(te=e.includeStyleProperties,te):(te=q(window.getComputedStyle(document.documentElement)),te))}function we(e,t){const s=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return s?parseFloat(s.replace("px","")):0}function Bt(e){const t=we(e,"border-left-width"),r=we(e,"border-right-width");return e.clientWidth+t+r}function Ht(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||Bt(e),s=t.height||Ht(e);return{width:r,height:s}}function Vt(){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 Ot(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 Ut(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 Wt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function qt(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),Wt(a)}const A=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||A(r,t)};function zt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Gt(e,t){return dt(t).map(r=>{const s=e.getPropertyValue(r),a=e.getPropertyPriority(r);return`${r}: ${s}${a?" !important":""};`}).join(" ")}function Kt(e,t,r,s){const a=`.${e}:${t}`,i=r.cssText?zt(r):Gt(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=Dt();try{t.className=`${t.className} ${c}`}catch{return}const l=document.createElement("style");l.appendChild(Kt(c,r,a,s)),t.appendChild(l)}function Qt(e,t,r){et(e,t,":before",r),et(e,t,":after",r)}const tt="application/font-woff",rt="image/jpeg",Xt={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 Yt(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Te(e){const t=Yt(e).toLowerCase();return Xt[t]||""}function Jt(e){return e.split(/,/)[1]}function Re(e){return e.search(/^(data:)/)!==-1}function Zt(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 er(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=er(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")||""),Jt(l)));a=Zt(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 tr(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ve(t)}async function rr(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=Te(r),a=await Me(r,s,t);return ve(a)}async function sr(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 nr(e,t){return A(e,HTMLCanvasElement)?tr(e):A(e,HTMLVideoElement)?rr(e,t):A(e,HTMLIFrameElement)?sr(e,t):e.cloneNode(ht(e))}const ar=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",ht=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function ir(e,t,r){var s,a;if(ht(t))return t;let i=[];return ar(e)&&e.assignedNodes?i=q(e.assignedNodes()):A(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||A(e,HTMLVideoElement)||await i.reduce((c,l)=>c.then(()=>je(l,r)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function cr(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`),A(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 lr(e,t){A(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),A(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function or(e,t){if(A(e,HTMLSelectElement)){const r=t,s=Array.from(r.children).find(a=>e.value===a.getAttribute("value"));s&&s.setAttribute("selected","")}}function dr(e,t,r){return A(t,Element)&&(cr(e,t,r),Qt(e,t,r),lr(e,t),or(e,t)),t}async function ur(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=>nr(s,t)).then(s=>ir(e,s,t)).then(s=>dr(e,s,t)).then(s=>ur(s,t))}const ft=/url\((['"]?)([^'"]+?)\1\)/g,mr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,hr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function fr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function pr(e){const t=[];return e.replace(ft,(r,s,a)=>(t.push(a),r)),t.filter(r=>!Re(r))}async function gr(e,t,r,s,a){try{const i=r?Pt(t,r):t,c=Te(t);let l;return a||(l=await Me(i,c,s)),e.replace(fr(t),`$1${l}$3`)}catch{}return e}function xr(e,{preferredFontFormat:t}){return t?e.replace(hr,r=>{for(;;){const[s,,a]=mr.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=xr(e,r);return pr(s).reduce((i,c)=>i.then(l=>gr(l,c,t,r)),Promise.resolve(s))}async function re(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 br(e,t){await re("background",e,t)||await re("background-image",e,t),await re("mask",e,t)||await re("-webkit-mask",e,t)||await re("mask-image",e,t)||await re("-webkit-mask-image",e,t)}async function yr(e,t){const r=A(e,HTMLImageElement);if(!(r&&!Re(e.src))&&!(A(e,SVGImageElement)&&!Re(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,a=await Me(s,Te(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 wr(e,t){const s=q(e.childNodes).map(a=>xt(a,t));await Promise.all(s).then(()=>e)}async function xt(e,t){A(e,Element)&&(await br(e,t),await yr(e,t),await wr(e,t))}function vr(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 jr(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 _r(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>pt(t.style.getPropertyValue("src")))}async function kr(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=q(e.ownerDocument.styleSheets),s=await jr(r,t);return _r(s)}function bt(e){return e.trim().replace(/["']/g,"")}function Sr(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 Cr(e,t){const r=await kr(e,t),s=Sr(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 Er(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Cr(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 Nr(e,t={}){const{width:r,height:s}=ut(e,t),a=await je(e,t,!0);return await Er(a,t),await xt(a,t),vr(a,t),await qt(a,r,s)}async function Rr(e,t={}){const{width:r,height:s}=ut(e,t),a=await Nr(e,t),i=await ve(a),c=document.createElement("canvas"),l=c.getContext("2d"),u=t.pixelRatio||Vt(),p=t.canvasWidth||r,f=t.canvasHeight||s;return c.width=p*u,c.height=f*u,t.skipAutoScale||Ot(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 $r(e,t={}){const r=await Rr(e,t);return await Ut(r)}const $e="#ffffff";function Tr(){return typeof window>"u"?$e:window.getComputedStyle(document.documentElement).getPropertyValue("--bg-elevated").trim()||$e}function Mr(e){if(typeof window>"u")return $e;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Tr():t}async function Fr(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 $r(e,{pixelRatio:2,cacheBust:!0,backgroundColor:Mr(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 Fr(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(Mt,{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 Lr(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function Ir(e){const t=new Map;for(const r of e){const s=Lr(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 Ar(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 Dr(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 es=()=>{var Le,Ie,Ae,Pe,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=ee({queryKey:["dataset",e,"with-paper",r,a.hide_closed_source_evals?"open":"all"],queryFn:()=>me.getDatasetBySlug(e,{include_paper:!0,task:r,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!e,staleTime:10*60*1e3}),E=ee({queryKey:["dataset-evals",(Le=x.data)==null?void 0:Le.id],queryFn:()=>Nt.byDataset(x.data.id),enabled:!!((Ie=x.data)!=null&&Ie.id),staleTime:5*60*1e3}),U=ee({queryKey:["dataset-tasks",(Ae=x.data)==null?void 0:Ae.id],queryFn:()=>me.datasetTasks(x.data.id),enabled:!!((Pe=x.data)!=null&&Pe.id),staleTime:10*60*1e3}),ne=ee({queryKey:["metric-directions"],queryFn:()=>me.metricDirections(),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]),T=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,$=-1;for(const j of d){const de=h.get(j.id)||0;de>$&&($=de,S=j.id)}if(S)return S}return d[0].id},[U.data,E.data,r,L]),z=ee({queryKey:["task-benchmark-trends",T,a.hide_closed_source_evals?!0:void 0],queryFn:()=>me.trendingBenchmarks(T,{limit:100,min_recent_papers:0,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!T&&!!((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]),ae=ee({queryKey:["leaderboard-metrics",(He=x.data)==null?void 0:He.id,T],queryFn:()=>me.leaderboardMetrics(x.data.id,T),enabled:!!((Ve=x.data)!=null&&Ve.id)&&!!T,staleTime:10*60*1e3}),Y=w.useMemo(()=>Lt(E.data,T,a.hide_closed_source_evals),[E.data,T,a.hide_closed_source_evals]),G=Y.visible,N=Y.hiddenClosed,O=Y.topHiddenClosed,H=w.useMemo(()=>Ir(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(()=>(ae.data||[]).map(d=>d.metric_name),[ae.data]),P=J.length?J:fe,ie=w.useMemo(()=>{var S;if(H.length===0)return P[0]||"";const d=new Map;for(const $ of H)for(const j of Object.keys($.metrics||{}))J.length&&!P.includes(j)||d.set(j,(d.get(j)||0)+1);let g=null,h=0;for(const[$,j]of d)j>h&&(h=j,g=$);return g||P[0]||((S=H[0])==null?void 0:S.best_metric)||""},[H,P,J]),b=c||(L==null?void 0:L.best_metric)||ie,K=(((Ue=(Oe=ne.data)==null?void 0:Oe.directions)==null?void 0:Ue[b])||"higher_is_better")==="lower_is_better"?"↓":"↑",W=w.useMemo(()=>!b||!P.includes(b)?P:[b,...P.filter(d=>d!==b)],[P,b]),ce=w.useMemo(()=>W.length===0?b?[b]:[]:W.slice(0,Pr),[W,b]),{points:le,sota:pe,sotaModel:o}=w.useMemo(()=>Ar(H,b,K),[H,b,K]),m=(We=x.data)==null?void 0:We.leaderboard_summary,k=E.isSuccess&&U.isSuccess&&ne.isSuccess&&(!T||ae.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 T?d.find(g=>g.id===T)||d[0]||null:d[0]||null},[U.data,T]);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(Rt,{variant:"destructive",children:n.jsx($t,{children:"Benchmark not found."})})});const _=x.data,Q=H.slice().sort((d,g)=>{var $,j;const h=he(($=d.metrics)==null?void 0:$[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,oe=(F==null?void 0:F.arxiv_id)||(F==null?void 0:F.id)||Dr(_.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=!!oe||!!_.paper_url||!!X,wt=F!=null&&F.arxiv_id||(ze=_.paper_url)!=null&&ze.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${oe}`:`Paper ${oe}`;return n.jsx("div",{className:"page",children:n.jsxs("div",{className:"bm-page",children:[n.jsxs("div",{className:"breadcrumb",children:[n.jsx(ue,{to:"/tasks",children:"Tasks"}),B&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"sep",children:"/"}),n.jsx(ue,{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:se(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"}),oe?n.jsxs(ue,{to:`/paper/${oe}`,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:Ft(_.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})]})]}),le.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:[P.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(At,{points:le,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 $,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&&(($=R.metrics)==null?void 0:$[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,": ",se(S),g?" · ":""]}):null,d?n.jsx(ue,{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:[P.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"}),ce.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 $=he((Ke=h.metrics)==null?void 0:Ke[b]);let j=null;$!==null&&((d===null||$!==d)&&(g=S+1,d=$),j=g);const de=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(Ct,{}),(h.external??h.is_external)&&n.jsx(Et,{sourceUrl:h.source_url||h.external_source_url||h.result_url})]}),Fe&&n.jsx("td",{className:"col-harness",children:h.harness||"—"}),ce.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!==""?se(ge):"—"},Se)}),n.jsx("td",{className:"col-paper",children:de?n.jsx(ue,{to:`/paper/${de}`,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{es as default};
|
|
|
|
| 1 |
+
import{u as vt,r as w,j as n,O as se,h as jt,f as _t,a as kt,G as St,L as ue}from"./index-CnNiludC.js";import{u as ee}from"./useQuery-C87uSz9p.js";import{c as me}from"./catalog-D7qk7tAG.js";import{C as Ct,E as Et,e as Nt}from"./evaluations-imurwG7D.js";import{S as xe}from"./skeleton-BU3tw6-C.js";import{S as Je}from"./switch-BmJwxg75.js";import{A as Rt,a as $t}from"./alert-CV1yu6Q5.js";import{L as ye}from"./LatexTitle-B1FyT_-3.js";import{B as Tt}from"./BenchmarkTrendSparkline-DAxMFKnm.js";import{I as Mt}from"./components-skIcbldg.js";import{s as Ft}from"./safeExternalHref-CkBrsh84.js";import"./hover-card-CDhcGwFp.js";import"./index-D0hHQwos.js";import"./katex.min-BSBacQyE.js";import"./transform-zlVHQ5aE.js";function Lt(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 It(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 At=({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,ne=i-l-u,L=c-p-f,T=e.map(o=>Ze(o.date)),z=Math.min(...T),I=Math.max(...T),ae=I-z||1,Y=o=>z===I?l+ne/2:l+(o-z)/ae*ne,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,P=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}},ie=[],b=N.length>0?P(N[N.length-1]):null;let _e=-1/0;for(let o=0;o<N.length-1;o++){const m=P(N[o]);m&&(m.left<_e+fe||b&&m.right>b.left-fe||(_e=m.right,ie.push({x:m.x,y:m.y,text:m.text,anchor:m.anchor})))}b&&ie.push({x:b.x,y:b.y,text:b.text,anchor:b.anchor});const K=It(z,I),W=5,ce=o=>a(m=>m===o?null:m),le=o=>{o&&r(`/paper/${o}`)},pe=(o,m)=>{const v=`${o.data.modelName||o.data.paperTitle||"Unknown model"}: ${se(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:()=>ce(o.idx),onFocus:()=>a(o.idx),onBlur:()=>ce(o.idx),onClick:()=>le(o.data.paperRouteId),onKeyDown:C=>{M&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),le(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:se(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"}}))}),ie.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}: ${se(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 Dt=(()=>{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 te=null;function dt(e={}){return te||(e.includeStyleProperties?(te=e.includeStyleProperties,te):(te=q(window.getComputedStyle(document.documentElement)),te))}function we(e,t){const s=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return s?parseFloat(s.replace("px","")):0}function Bt(e){const t=we(e,"border-left-width"),r=we(e,"border-right-width");return e.clientWidth+t+r}function Ht(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||Bt(e),s=t.height||Ht(e);return{width:r,height:s}}function Vt(){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 Ot(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 Ut(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 Wt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function qt(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),Wt(a)}const A=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||A(r,t)};function zt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Gt(e,t){return dt(t).map(r=>{const s=e.getPropertyValue(r),a=e.getPropertyPriority(r);return`${r}: ${s}${a?" !important":""};`}).join(" ")}function Kt(e,t,r,s){const a=`.${e}:${t}`,i=r.cssText?zt(r):Gt(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=Dt();try{t.className=`${t.className} ${c}`}catch{return}const l=document.createElement("style");l.appendChild(Kt(c,r,a,s)),t.appendChild(l)}function Qt(e,t,r){et(e,t,":before",r),et(e,t,":after",r)}const tt="application/font-woff",rt="image/jpeg",Xt={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 Yt(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Te(e){const t=Yt(e).toLowerCase();return Xt[t]||""}function Jt(e){return e.split(/,/)[1]}function Re(e){return e.search(/^(data:)/)!==-1}function Zt(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 er(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=er(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")||""),Jt(l)));a=Zt(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 tr(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ve(t)}async function rr(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=Te(r),a=await Me(r,s,t);return ve(a)}async function sr(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 nr(e,t){return A(e,HTMLCanvasElement)?tr(e):A(e,HTMLVideoElement)?rr(e,t):A(e,HTMLIFrameElement)?sr(e,t):e.cloneNode(ht(e))}const ar=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",ht=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function ir(e,t,r){var s,a;if(ht(t))return t;let i=[];return ar(e)&&e.assignedNodes?i=q(e.assignedNodes()):A(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||A(e,HTMLVideoElement)||await i.reduce((c,l)=>c.then(()=>je(l,r)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function cr(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`),A(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 lr(e,t){A(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),A(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function or(e,t){if(A(e,HTMLSelectElement)){const r=t,s=Array.from(r.children).find(a=>e.value===a.getAttribute("value"));s&&s.setAttribute("selected","")}}function dr(e,t,r){return A(t,Element)&&(cr(e,t,r),Qt(e,t,r),lr(e,t),or(e,t)),t}async function ur(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=>nr(s,t)).then(s=>ir(e,s,t)).then(s=>dr(e,s,t)).then(s=>ur(s,t))}const ft=/url\((['"]?)([^'"]+?)\1\)/g,mr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,hr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function fr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function pr(e){const t=[];return e.replace(ft,(r,s,a)=>(t.push(a),r)),t.filter(r=>!Re(r))}async function gr(e,t,r,s,a){try{const i=r?Pt(t,r):t,c=Te(t);let l;return a||(l=await Me(i,c,s)),e.replace(fr(t),`$1${l}$3`)}catch{}return e}function xr(e,{preferredFontFormat:t}){return t?e.replace(hr,r=>{for(;;){const[s,,a]=mr.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=xr(e,r);return pr(s).reduce((i,c)=>i.then(l=>gr(l,c,t,r)),Promise.resolve(s))}async function re(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 br(e,t){await re("background",e,t)||await re("background-image",e,t),await re("mask",e,t)||await re("-webkit-mask",e,t)||await re("mask-image",e,t)||await re("-webkit-mask-image",e,t)}async function yr(e,t){const r=A(e,HTMLImageElement);if(!(r&&!Re(e.src))&&!(A(e,SVGImageElement)&&!Re(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,a=await Me(s,Te(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 wr(e,t){const s=q(e.childNodes).map(a=>xt(a,t));await Promise.all(s).then(()=>e)}async function xt(e,t){A(e,Element)&&(await br(e,t),await yr(e,t),await wr(e,t))}function vr(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 jr(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 _r(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>pt(t.style.getPropertyValue("src")))}async function kr(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=q(e.ownerDocument.styleSheets),s=await jr(r,t);return _r(s)}function bt(e){return e.trim().replace(/["']/g,"")}function Sr(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 Cr(e,t){const r=await kr(e,t),s=Sr(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 Er(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Cr(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 Nr(e,t={}){const{width:r,height:s}=ut(e,t),a=await je(e,t,!0);return await Er(a,t),await xt(a,t),vr(a,t),await qt(a,r,s)}async function Rr(e,t={}){const{width:r,height:s}=ut(e,t),a=await Nr(e,t),i=await ve(a),c=document.createElement("canvas"),l=c.getContext("2d"),u=t.pixelRatio||Vt(),p=t.canvasWidth||r,f=t.canvasHeight||s;return c.width=p*u,c.height=f*u,t.skipAutoScale||Ot(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 $r(e,t={}){const r=await Rr(e,t);return await Ut(r)}const $e="#ffffff";function Tr(){return typeof window>"u"?$e:window.getComputedStyle(document.documentElement).getPropertyValue("--bg-elevated").trim()||$e}function Mr(e){if(typeof window>"u")return $e;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Tr():t}async function Fr(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 $r(e,{pixelRatio:2,cacheBust:!0,backgroundColor:Mr(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 Fr(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(Mt,{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 Lr(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function Ir(e){const t=new Map;for(const r of e){const s=Lr(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 Ar(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 Dr(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 es=()=>{var Le,Ie,Ae,Pe,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=ee({queryKey:["dataset",e,"with-paper",r,a.hide_closed_source_evals?"open":"all"],queryFn:()=>me.getDatasetBySlug(e,{include_paper:!0,task:r,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!e,staleTime:10*60*1e3}),E=ee({queryKey:["dataset-evals",(Le=x.data)==null?void 0:Le.id],queryFn:()=>Nt.byDataset(x.data.id),enabled:!!((Ie=x.data)!=null&&Ie.id),staleTime:5*60*1e3}),U=ee({queryKey:["dataset-tasks",(Ae=x.data)==null?void 0:Ae.id],queryFn:()=>me.datasetTasks(x.data.id),enabled:!!((Pe=x.data)!=null&&Pe.id),staleTime:10*60*1e3}),ne=ee({queryKey:["metric-directions"],queryFn:()=>me.metricDirections(),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]),T=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,$=-1;for(const j of d){const de=h.get(j.id)||0;de>$&&($=de,S=j.id)}if(S)return S}return d[0].id},[U.data,E.data,r,L]),z=ee({queryKey:["task-benchmark-trends",T,a.hide_closed_source_evals?!0:void 0],queryFn:()=>me.trendingBenchmarks(T,{limit:100,min_recent_papers:0,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!T&&!!((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]),ae=ee({queryKey:["leaderboard-metrics",(He=x.data)==null?void 0:He.id,T],queryFn:()=>me.leaderboardMetrics(x.data.id,T),enabled:!!((Ve=x.data)!=null&&Ve.id)&&!!T,staleTime:10*60*1e3}),Y=w.useMemo(()=>Lt(E.data,T,a.hide_closed_source_evals),[E.data,T,a.hide_closed_source_evals]),G=Y.visible,N=Y.hiddenClosed,O=Y.topHiddenClosed,H=w.useMemo(()=>Ir(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(()=>(ae.data||[]).map(d=>d.metric_name),[ae.data]),P=J.length?J:fe,ie=w.useMemo(()=>{var S;if(H.length===0)return P[0]||"";const d=new Map;for(const $ of H)for(const j of Object.keys($.metrics||{}))J.length&&!P.includes(j)||d.set(j,(d.get(j)||0)+1);let g=null,h=0;for(const[$,j]of d)j>h&&(h=j,g=$);return g||P[0]||((S=H[0])==null?void 0:S.best_metric)||""},[H,P,J]),b=c||(L==null?void 0:L.best_metric)||ie,K=(((Ue=(Oe=ne.data)==null?void 0:Oe.directions)==null?void 0:Ue[b])||"higher_is_better")==="lower_is_better"?"↓":"↑",W=w.useMemo(()=>!b||!P.includes(b)?P:[b,...P.filter(d=>d!==b)],[P,b]),ce=w.useMemo(()=>W.length===0?b?[b]:[]:W.slice(0,Pr),[W,b]),{points:le,sota:pe,sotaModel:o}=w.useMemo(()=>Ar(H,b,K),[H,b,K]),m=(We=x.data)==null?void 0:We.leaderboard_summary,k=E.isSuccess&&U.isSuccess&&ne.isSuccess&&(!T||ae.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 T?d.find(g=>g.id===T)||d[0]||null:d[0]||null},[U.data,T]);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(Rt,{variant:"destructive",children:n.jsx($t,{children:"Benchmark not found."})})});const _=x.data,Q=H.slice().sort((d,g)=>{var $,j;const h=he(($=d.metrics)==null?void 0:$[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,oe=(F==null?void 0:F.arxiv_id)||(F==null?void 0:F.id)||Dr(_.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=!!oe||!!_.paper_url||!!X,wt=F!=null&&F.arxiv_id||(ze=_.paper_url)!=null&&ze.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${oe}`:`Paper ${oe}`;return n.jsx("div",{className:"page",children:n.jsxs("div",{className:"bm-page",children:[n.jsxs("div",{className:"breadcrumb",children:[n.jsx(ue,{to:"/tasks",children:"Tasks"}),B&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"sep",children:"/"}),n.jsx(ue,{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:se(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"}),oe?n.jsxs(ue,{to:`/paper/${oe}`,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:Ft(_.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})]})]}),le.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:[P.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(At,{points:le,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 $,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&&(($=R.metrics)==null?void 0:$[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,": ",se(S),g?" · ":""]}):null,d?n.jsx(ue,{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:[P.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"}),ce.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 $=he((Ke=h.metrics)==null?void 0:Ke[b]);let j=null;$!==null&&((d===null||$!==d)&&(g=S+1,d=$),j=g);const de=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(Ct,{}),(h.external??h.is_external)&&n.jsx(Et,{sourceUrl:h.source_url||h.external_source_url||h.result_url})]}),Fe&&n.jsx("td",{className:"col-harness",children:h.harness||"—"}),ce.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!==""?se(ge):"—"},Se)}),n.jsx("td",{className:"col-paper",children:de?n.jsx(ue,{to:`/paper/${de}`,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{es as default};
|
assets/{BenchmarkTrendSparkline-DhsyiXV-.js → BenchmarkTrendSparkline-DAxMFKnm.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as C,j as t}from"./index-
|
|
|
|
| 1 |
+
import{r as C,j as t}from"./index-CnNiludC.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-BpHxh3F9.js → ChatMessage-BqPqQClr.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{d as L,r as C,j as e,R as f,C as B}from"./index-
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{d as L,r as C,j as e,R as f,C as B}from"./index-CnNiludC.js";import{u as O,a as q,b as D,M as J,R as Q,W as Z,p as F,A as ee,F as te,G as A,H as se}from"./chatSessions-B5wJO74B.js";import"./katex.min-BSBacQyE.js";import{H as R,a as M,b as H}from"./hover-card-CDhcGwFp.js";import{u as ae}from"./useQuery-C87uSz9p.js";import{f as re,p as ne}from"./github-6FmJETBJ.js";import{G as U}from"./github-CRO5e-fY.js";import{r as ie,a as oe,P as G}from"./PaperPreviewLink-DAFhnDhq.js";import{M as ce,r as le,d as de}from"./index-B8BJTSsG.js";import{F as ue}from"./file-text-CzoH1JKN.js";/**
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{ChatView-DoJkTSvB.js → ChatView-DRCYIPi4.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{d as qt,e as Ze,r as c,j as r,f as Bt,u as Ht,a as Wt,g as Gt,h as Kt,k as $t,l as Vt,b as zt,X as Qt,c as Jt}from"./index-
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{d as qt,e as Ze,r as c,j as r,f as Bt,u as Ht,a as Wt,g as Gt,h as Kt,k as $t,l as Vt,b as zt,X as Qt,c as Jt}from"./index-CnNiludC.js";import{u as Xt}from"./useQuery-C87uSz9p.js";import{C as St,U as Et,A as Zt}from"./ChatMessage-BqPqQClr.js";import{d as en,g as ct,t as Lt,r as tn,S as nn,P as rn,D as sn,l as an,C as Xe,e as ze,f as on,h as Qe,i as Je,j as cn,k as ln,m as un,n as Ct,o as dn,T as hn,p as kt,s as it,v as fn,w as pn,x as mn,y as gn}from"./chatSessions-B5wJO74B.js";import{S as yn}from"./chatPrompts-CDY3UGU1.js";import{u as bn,r as vn,a as _n,O as wn,b as xn}from"./openrouter-CSA2RSTl.js";import"./katex.min-BSBacQyE.js";import"./hover-card-CDhcGwFp.js";import"./github-6FmJETBJ.js";import"./github-CRO5e-fY.js";import"./PaperPreviewLink-DAFhnDhq.js";import"./index-B8BJTSsG.js";import"./file-text-CzoH1JKN.js";import"./chevron-down-Bjm5Iw9B.js";/**
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{ConferenceDetailView-DN7gXurn.js → ConferenceDetailView-BP5drqUx.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{f as L,r as D,j as e,L as p}from"./index-
|
|
|
|
| 1 |
+
import{f as L,r as D,j as e,L as p}from"./index-CnNiludC.js";import{u as T}from"./useQuery-C87uSz9p.js";import{M as F}from"./MarkdownText-mvLqNfwe.js";import{c as A}from"./catalog-D7qk7tAG.js";import{c as B,h as C,d as E}from"./transform-zlVHQ5aE.js";import{S as f}from"./skeleton-BU3tw6-C.js";import{A as P,a as z}from"./alert-CV1yu6Q5.js";import{s as M}from"./safeExternalHref-CkBrsh84.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-DAFhnDhq.js";import"./index-B8BJTSsG.js";import"./hover-card-CDhcGwFp.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}`},Z=()=>{var k,S,b,_,$,w;const{confSlug:a}=L(),t=T({queryKey:["conference-areas-with-tasks",a],queryFn:()=>A.conferenceAreasWithTasks(a),enabled:!!a,staleTime:10*60*1e3}),i=D.useMemo(()=>{if(!t.data)return[];const n={general:0,vision:1,video:2,language:3,audio:4,other:5},r=o=>n[R(o)]??999;return[...t.data.results].sort((o,l)=>{const d=r(o.name),x=r(l.name);return d!==x?d-x:o.name.localeCompare(l.name)})},[t.data]),s=(k=t.data)==null?void 0:k.conference,c=((S=t.data)==null?void 0:S.total_paper_count)??0,m=((b=t.data)==null?void 0:b.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((n,r)=>n+r.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:n=>{var r,o;(o=(r=n.currentTarget.parentElement)==null?void 0:r.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((n,r)=>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))})]},r))}):i.map(n=>{const r=n.tasks;if(r.length===0)return null;const o=r.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:n.name}),n.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:n.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[r.length," ",r.length===1?"task":"tasks"," · ",o.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:r.map(l=>{const d=l.slug||"",x=B(C(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)})})]},n.id)}),v>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[v," tasks across ",i.filter(n=>n.tasks.length>0).length," areas."]})]})};export{Z as default};
|
assets/{ConferenceTaskView-DpBnKlUj.js → ConferenceTaskView-DeQ10q-x.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{f as $,a as D,r as x,j as e,L as b,R as W}from"./index-
|
|
|
|
| 1 |
+
import{f as $,a as D,r as x,j as e,L as b,R as W}from"./index-CnNiludC.js";import{u as M}from"./useQuery-C87uSz9p.js";import{P as G}from"./components-skIcbldg.js";import{u as J,P as X}from"./useIntersectionObserver-BUxW5ZLf.js";import{M as h}from"./MarkdownText-mvLqNfwe.js";import{c as z}from"./catalog-D7qk7tAG.js";import{t as Y,d as Z}from"./transform-zlVHQ5aE.js";import{c as ee}from"./usePapers-C15Wpgxo.js";import{S as se}from"./skeleton-BU3tw6-C.js";import{A as ae,a as te}from"./alert-CV1yu6Q5.js";import"./LatexTitle-B1FyT_-3.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";import"./PaperPreviewLink-DAFhnDhq.js";import"./index-B8BJTSsG.js";import"./hover-card-CDhcGwFp.js";import"./useInfiniteQuery-DulZ-zOj.js";const re=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ne=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",be=()=>{var A,F,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=M({queryKey:["conference",a],queryFn:()=>z.getConference(a),enabled:!!a,staleTime:10*60*1e3}),f=M({queryKey:["task",n],queryFn:()=>z.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:R}=J({rootMargin:"200px"});x.useEffect(()=>{R&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[R,i.hasNextPage,i.isFetchingNextPage]),x.useEffect(()=>{window.scrollTo(0,0)},[a,n]);const _=x.useMemo(()=>{var s;return(((s=i.data)==null?void 0:s.pages)??[]).flatMap(o=>o.results)},[i.data]),v=x.useMemo(()=>_.map(Y),[_]),g=k?"All papers":P?"Oral papers":N?"Spotlight papers":l?"Outstanding papers":d?"Best paper finalists":Z(((A=f.data)==null?void 0:A.name)||n||"",((F=f.data)==null?void 0:F.slug)||n),C=((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=f.data;return m.error||f.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:C.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:["[",C.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{be as default};
|
assets/ConferencesIndexView-ESNh5pHs.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{r as u,j as e,L as d}from"./index-CnNiludC.js";import{u as p}from"./useQuery-C87uSz9p.js";import{c as f}from"./catalog-D7qk7tAG.js";import{S as m}from"./skeleton-BU3tw6-C.js";import{A as h,a as g}from"./alert-CV1yu6Q5.js";import{T as x}from"./TaxonomySuggestionTile-DPjYd5AL.js";import"./SignInToEditDialog-ByW2mx_A.js";import"./button-Cb-e5tHG.js";import"./textarea-DuxG42Qe.js";import"./dialog-COYv9g-7.js";import"./useMutation-CZOEaG9X.js";import"./loader-circle-3AJg82rJ.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=p({queryKey:["conferences"],queryFn:()=>f.conferences(),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(h,{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-hGYdSmIN.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{r as u,j as e,L as d}from"./index-DKw1mejm.js";import{u as p}from"./useQuery-DkXMNuGa.js";import{c as f}from"./catalog-Cs0CZbdz.js";import{S as m}from"./skeleton-CnS6y9lc.js";import{A as h,a as g}from"./alert-DtuWH5Uh.js";import{T as x}from"./TaxonomySuggestionTile-BQyzbk_b.js";import"./SignInToEditDialog-BrFD0zbL.js";import"./button-Daj2z1wQ.js";import"./textarea-VTzc6fCU.js";import"./dialog-B9CPIS7M.js";import"./useMutation-B1PI2Fhg.js";import"./submissions-DGtBhb0o.js";import"./loader-circle-A0brRFET.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)"},M=()=>{const r=p({queryKey:["conferences"],queryFn:()=>f.conferences(),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(h,{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{M as default};
|
|
|
|
|
|
assets/{CronDashboard-CI9A83xA.js → CronDashboard-Bo73phUc.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{d as k,r as x,j as e,v as b,
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
@@ -53,4 +53,4 @@ import{d as k,r as x,j as e,v as b,x as Oe,n as He,m as W,O as We,y as Be,I as U
|
|
| 53 |
*
|
| 54 |
* This source code is licensed under the ISC license.
|
| 55 |
* See the LICENSE file in the root directory of this source tree.
|
| 56 |
-
*/const pe=k("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"}]]),u=x.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:b("rounded-lg border bg-card text-card-foreground shadow-sm",s),...a}));u.displayName="Card";const v=x.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:b("flex flex-col space-y-1.5 p-6",s),...a}));v.displayName="CardHeader";const N=x.forwardRef(({className:s,...a},r)=>e.jsx("h3",{ref:r,className:b("text-2xl font-semibold leading-none tracking-tight",s),...a}));N.displayName="CardTitle";const w=x.forwardRef(({className:s,...a},r)=>e.jsx("p",{ref:r,className:b("text-sm text-muted-foreground",s),...a}));w.displayName="CardDescription";const p=x.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:b("p-6 pt-0",s),...a}));p.displayName="CardContent";const os=x.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:b("flex items-center p-6 pt-0",s),...a}));os.displayName="CardFooter";var B="Tabs",[ds]=Ke(B,[xe]),ge=xe(),[ms,V]=ds(B),je=x.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,onValueChange:l,defaultValue:m,orientation:h="horizontal",dir:o,activationMode:c="automatic",...j}=s,g=Oe(o),[i,d]=He({prop:n,onChange:l,defaultProp:m??"",caller:B});return e.jsx(ms,{scope:r,baseId:We(),value:i,onValueChange:d,orientation:h,dir:g,activationMode:c,children:e.jsx(W.div,{dir:g,"data-orientation":h,...j,ref:a})})});je.displayName=B;var fe="TabsList",ve=x.forwardRef((s,a)=>{const{__scopeTabs:r,loop:n=!0,...l}=s,m=V(fe,r),h=ge(r);return e.jsx(Be,{asChild:!0,...h,orientation:m.orientation,dir:m.dir,loop:n,children:e.jsx(W.div,{role:"tablist","aria-orientation":m.orientation,...l,ref:a})})});ve.displayName=fe;var Ne="TabsTrigger",be=x.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,disabled:l=!1,...m}=s,h=V(Ne,r),o=ge(r),c=we(h.baseId,n),j=ke(h.baseId,n),g=n===h.value;return e.jsx(Ue,{asChild:!0,...o,focusable:!l,active:g,children:e.jsx(W.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":j,"data-state":g?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:c,...m,ref:a,onMouseDown:z(s.onMouseDown,i=>{!l&&i.button===0&&i.ctrlKey===!1?h.onValueChange(n):i.preventDefault()}),onKeyDown:z(s.onKeyDown,i=>{[" ","Enter"].includes(i.key)&&h.onValueChange(n)}),onFocus:z(s.onFocus,()=>{const i=h.activationMode!=="manual";!g&&!l&&i&&h.onValueChange(n)})})})});be.displayName=Ne;var ye="TabsContent",_e=x.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,forceMount:l,children:m,...h}=s,o=V(ye,r),c=we(o.baseId,n),j=ke(o.baseId,n),g=n===o.value,i=x.useRef(g);return x.useEffect(()=>{const d=requestAnimationFrame(()=>i.current=!1);return()=>cancelAnimationFrame(d)},[]),e.jsx(ze,{present:l||g,children:({present:d})=>e.jsx(W.div,{"data-state":g?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":c,hidden:!d,id:j,tabIndex:0,...h,ref:a,style:{...s.style,animationDuration:i.current?"0s":void 0},children:d&&m})})});_e.displayName=ye;function we(s,a){return`${s}-trigger-${a}`}function ke(s,a){return`${s}-content-${a}`}var xs=je,Ce=ve,Se=be,$e=_e;const hs=xs,Te=x.forwardRef(({className:s,...a},r)=>e.jsx(Ce,{ref:r,className:b("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),...a}));Te.displayName=Ce.displayName;const L=x.forwardRef(({className:s,...a},r)=>e.jsx(Se,{ref:r,className:b("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}));L.displayName=Se.displayName;const R=x.forwardRef(({className:s,...a},r)=>e.jsx($e,{ref:r,className:b("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...a}));R.displayName=$e.displayName;function f(s){if(!s)return"Never";const a=new Date(s);if(Number.isNaN(a.getTime()))return s;const r=Date.now()-a.getTime(),n=Math.floor(r/6e4),l=Math.floor(r/36e5),m=Math.floor(r/864e5);return n<1?"Just now":n<60?`${n}m ago`:l<24?`${l}h ago`:m<7?`${m}d ago`:a.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Le(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 Re(s){return s.available?s.status==="completed"?s.conclusion??"completed":s.status??"unknown":"Unavailable"}function X(s){return s.replace(/_/g," ").replace(/\b\w/g,a=>a.toUpperCase())}const us={healthy:Q,degraded:pe,broken:E,running:C,stuck:E,unknown:rs};function ps({status:s,isRunning:a}){const r=a?"running":s,n=us[r];return e.jsx(n,{className:`cron-status-icon cron-status--${r}${r==="running"?" animate-spin":""}`})}function oe({label:s,axis:a}){return e.jsxs(_,{variant:"outline",className:`cron-status--${a.status}`,title:a.reason,children:[s,": ",a.status]})}function de({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(([n,l])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:X(n)}),e.jsx("div",{className:"text-lg font-semibold",children:typeof l=="number"?l.toLocaleString():l})]},n))})]})}function gs({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",Re(s)],...s.updated_at?[["Updated",f(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 js(s){return s==="COMPLETED"?"cron-status--healthy":s==="ERROR"||s==="CANCELED"?"cron-status--broken":s==="RUNNING"?"cron-status--running":"cron-status--unknown"}function fs({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:js(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(he,{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 ",f(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(n=>e.jsxs("div",{children:[e.jsx("span",{className:"font-mono",children:n.arxiv_id}),": ",n.error]},`${n.arxiv_id}:${n.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 ",f(s.created_at)]}),s.duration_seconds!=null&&e.jsxs("span",{children:["Duration ",Le(s.duration_seconds)]})]}),s.stage_message&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.stage_message})]})}function vs({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(cs,{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(C,{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(([n,l])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:X(n)}),e.jsx("div",{className:"text-lg font-semibold",children:l.toLocaleString()})]},n))}),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(n=>e.jsx(fs,{job:n},n.id))})]})]})}function Ns({job:s,expanded:a,onToggle:r,paperMarkdownJobs:n,paperMarkdownJobsLoading:l=!1,paperMarkdownJobsError:m=null}){const h=!!(s.work_metrics&&Object.keys(s.work_metrics).length),o=!!(s.db_metrics&&Object.keys(s.db_metrics).length),c=s.job_name==="paper_markdown_backfill";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(ps,{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:"Held lock"}),e.jsx(oe,{label:"Execution",axis:s.execution_health}),e.jsx(oe,{label:"Output",axis:s.output_health}),a?e.jsx(as,{className:"h-4 w-4 cron-muted"}):e.jsx(Ze,{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(ue,{}),"Log: ",f(s.last_run)]}),e.jsxs("span",{className:"cron-fact",children:[e.jsx(ne,{}),"DB: ",f(s.last_db_write)]}),s.recent_write_count!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(ls,{}),"Recent writes: ",s.recent_write_count.toLocaleString()]}),s.duration!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(H,{}),"Duration: ",Le(s.duration)]}),s.schedule&&e.jsxs("span",{className:"cron-fact md:col-span-2",children:[e.jsx(le,{}),e.jsx("span",{className:"font-mono text-xs",children:s.schedule})]}),s.log_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(te,{}),"Log status: ",s.log_status]}),s.workflow_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(H,{}),"Actions: ",Re(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&&!0&&e.jsx("div",{className:"cron-job-details",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(le,{className:"h-4 w-4"}),e.jsx("h4",{children:"Scheduler evidence"})]}),e.jsx("div",{className:"cron-metric-card space-y-2 text-sm",children:[["Scheduler",s.execution_health.scheduler??"unknown"],["Last expected",f(s.execution_health.last_expected_at??null)],["Last started",f(s.execution_health.last_started_at??null)],["Last completed",f(s.execution_health.last_completed_at??null)],["Next expected",f(s.execution_health.next_expected_at??null)]].map(([g,i])=>e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"cron-label",children:g}),e.jsx("span",{children:i})]},g))})]}),s.work_metrics&&h&&e.jsx(de,{icon:te,title:"Log Metrics",metrics:s.work_metrics}),s.db_metrics&&o&&e.jsx(de,{icon:ne,title:"Database Metrics",metrics:s.db_metrics}),s.workflow_status&&e.jsx(gs,{workflow:s.workflow_status}),c&&e.jsx(vs,{monitor:n,loading:l,error:m}),s.diagnostic_groups&&Object.values(s.diagnostic_groups).some(g=>g.length>0)&&e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(pe,{className:"h-4 w-4"}),e.jsx("h4",{children:"Diagnostics by cause"})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:Object.entries(s.diagnostic_groups).filter(([,g])=>g.length>0).map(([g,i])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label mb-1",children:X(g)}),e.jsx("ul",{className:"list-disc pl-4 text-sm space-y-1",children:i.map(d=>e.jsx("li",{children:d},d))})]},g))})]})]})})]})}const Fe=x.forwardRef(({className:s,...a},r)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:r,className:b("w-full caption-bottom text-sm",s),...a})}));Fe.displayName="Table";const Pe=x.forwardRef(({className:s,...a},r)=>e.jsx("thead",{ref:r,className:b("[&_tr]:border-b",s),...a}));Pe.displayName="TableHeader";const Me=x.forwardRef(({className:s,...a},r)=>e.jsx("tbody",{ref:r,className:b("[&_tr:last-child]:border-0",s),...a}));Me.displayName="TableBody";const bs=x.forwardRef(({className:s,...a},r)=>e.jsx("tfoot",{ref:r,className:b("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...a}));bs.displayName="TableFooter";const G=x.forwardRef(({className:s,...a},r)=>e.jsx("tr",{ref:r,className:b("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",s),...a}));G.displayName="TableRow";const F=x.forwardRef(({className:s,...a},r)=>e.jsx("th",{ref:r,className:b("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",s),...a}));F.displayName="TableHead";const P=x.forwardRef(({className:s,...a},r)=>e.jsx("td",{ref:r,className:b("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...a}));P.displayName="TableCell";const ys=x.forwardRef(({className:s,...a},r)=>e.jsx("caption",{ref:r,className:b("mt-4 text-sm text-muted-foreground",s),...a}));ys.displayName="TableCaption";const _s={queued:"cron-status--unknown",dispatching:"cron-status--running",running:"cron-status--running",completed:"cron-status--healthy",failed:"cron-status--broken",canceled:"cron-status--unknown"},ws={"add-evals":"Add evals","enrich-paper":"Enrich paper"},ks={queued:is,dispatching:C,running:ns,completed:Q,failed:E,canceled:ts};function Cs({status:s}){const a=ks[s];return e.jsxs(_,{variant:"outline",className:_s[s],children:[e.jsx(a,{className:`mr-1 h-3.5 w-3.5 ${s==="dispatching"?"animate-spin":""}`}),s]})}function Ss(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 $s({autoRefresh:s,refreshToken:a}){const{data:r,isLoading:n,isFetching:l,error:m}=A({queryKey:["codexPaperJobs",a],queryFn:()=>Ye(100),refetchInterval:s?1e4:!1,retry:!1}),h=m&&typeof m=="object"&&"status"in m?m.status:void 0;return e.jsxs(u,{className:"mb-8",children:[e.jsx(v,{children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(N,{className:"text-xl",children:"Codex paper jobs"}),e.jsx(w,{children:"Durable queue and execution history for admin-triggered Hugging Face Jobs"})]}),l&&!n&&e.jsxs("span",{className:"flex items-center gap-2 text-xs cron-muted",children:[e.jsx(C,{className:"h-3.5 w-3.5 animate-spin"})," Syncing with Hugging Face"]})]})}),e.jsxs(p,{children:[n&&e.jsxs("div",{className:"flex items-center justify-center py-10 cron-muted",children:[e.jsx(C,{className:"mr-2 h-5 w-5 animate-spin"})," Loading paper jobs…"]}),m&&h!==404&&e.jsx("div",{className:"cron-message cron-message--error mb-4",children:m instanceof Error?m.message:"Could not load Codex paper jobs."}),h===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(o=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label capitalize",children:o}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:r.summary[o]})]},o)),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(Fe,{children:[e.jsx(Pe,{children:e.jsxs(G,{children:[e.jsx(F,{children:"Status"}),e.jsx(F,{children:"Paper"}),e.jsx(F,{children:"Action"}),e.jsx(F,{children:"Requested"}),e.jsx(F,{children:"Execution"})]})}),e.jsx(Me,{children:r.jobs.map(o=>{const c=Ss(o);return e.jsxs(G,{children:[e.jsx(P,{className:"align-top",children:e.jsx(Cs,{status:o.status})}),e.jsxs(P,{className:"min-w-[260px] align-top",children:[e.jsx(Ge,{to:`/paper/${encodeURIComponent(o.paper_route)}`,className:"font-medium hover:underline",children:o.paper_title}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Paper #",o.paper_id]})]}),e.jsxs(P,{className:"whitespace-nowrap align-top",children:[ws[o.kind],o.applied_at&&e.jsxs("div",{className:"mt-1 flex items-center gap-1 text-xs cron-status--healthy",children:[e.jsx(Q,{className:"h-3.5 w-3.5"})," Applied"]})]}),e.jsxs(P,{className:"whitespace-nowrap align-top",children:[e.jsx("div",{children:f(o.created_at)}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["@",o.requested_by]})]}),e.jsxs(P,{className:"max-w-[360px] align-top",children:[o.hf_job_url?e.jsxs("a",{href:o.hf_job_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 hover:underline",children:["Hugging Face Job ",e.jsx(he,{className:"h-3.5 w-3.5"})]}):e.jsx("span",{className:"cron-muted",children:"Waiting to dispatch"}),c&&e.jsx("p",{className:`mt-2 line-clamp-3 text-xs ${o.error?"text-red-700":"cron-muted"}`,title:c,children:c})]})]},o.id)})})]}),e.jsxs("p",{className:"mt-4 text-xs cron-muted",children:["Showing the 100 most recent jobs · Queue totals include full history · Updated ",f(r.timestamp)]})]})]})]})}const Ts=()=>{var m,h,o;const s=Qe(),a=ss({queryKey:["catalog-audit"],queryFn:({pageParam:c})=>K.audit(c),initialPageParam:void 0,getNextPageParam:c=>c.next_cursor??void 0}),r=((m=a.data)==null?void 0:m.pages.flatMap(c=>c.events))??[],n=ce({mutationFn:()=>K.acknowledgeAudit(),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})}),l=ce({mutationFn:c=>K.rollbackEvent(c),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})});return e.jsx("div",{className:"space-y-4",children:e.jsxs(u,{children:[e.jsxs(v,{className:"flex-row items-center justify-between",children:[e.jsx(N,{children:"Catalog mutation audit"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm font-medium",children:[((o=(h=a.data)==null?void 0:h.pages[0])==null?void 0:o.unread_contributor_count)??0," unread contributor changes"]}),e.jsx(M,{variant:"outline",size:"sm",onClick:()=>n.mutate(),disabled:n.isPending,children:"Mark read"})]})]}),e.jsxs(p,{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(c=>e.jsxs("article",{className:`rounded-md border p-3 ${c.operation==="delete"||c.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:[c.operation," ",c.entity_type," ",c.entity_id]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["@",c.actor_username??c.actor_role," ·"," ",new Date(c.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:c.before,after:c.after},null,2)})]}),!c.rollback_of_event_id&&e.jsx(M,{className:"mt-3",variant:"outline",size:"sm",onClick:()=>l.mutate(c.id),disabled:l.isPending||c.rollback_eligible===!1,children:c.rollback_eligible===!1?"Rollback conflict":"Roll back if unchanged"})]},c.id)),a.hasNextPage&&e.jsx(M,{variant:"outline",onClick:()=>a.fetchNextPage(),disabled:a.isFetchingNextPage,children:a.isFetchingNextPage?"Loading…":"Load older events"})]})]})})},me={hourly:"cron-status--running",daily:"cron-status--healthy",weekly:"cron-status--degraded",systemd:"cron-status--running"},y=s=>`$${(s/1e6).toFixed(2)}`,Ls=({data:s,loading:a,error:r})=>{const[n,l]=x.useState("staging-current"),m={"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(C,{className:"h-6 w-6 animate-spin mr-3"}),"Loading chat compute…"]});if(r||!s)return e.jsx(u,{className:"cron-status--broken",children:e.jsx(p,{className:"pt-6",children:"Chat compute accounting is unavailable."})});const h=Math.min(100,s.effective_microusd/s.application_cap_microusd*100),o=s.circuit_state==="tripped"?"Chat disabled":s.circuit_state==="warning"?"Operator warning":"Enabled",c=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(u,{className:s.circuit_state==="tripped"?"cron-status--broken":s.circuit_state==="warning"?"cron-status--degraded":"",children:[e.jsx(v,{children:e.jsx(N,{className:"text-sm",children:"Circuit"})}),e.jsxs(p,{children:[e.jsx("div",{className:"text-2xl font-bold",children:o}),e.jsx("p",{className:"text-xs cron-muted",children:s.trip_reason??"Policy armed"})]})]}),e.jsxs(u,{children:[e.jsx(v,{children:e.jsx(N,{className:"text-sm",children:"Month to date"})}),e.jsxs(p,{children:[e.jsx("div",{className:"text-2xl font-bold",children:y(s.effective_microusd)}),e.jsx("div",{role:"progressbar","aria-label":"Application cap used","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(h),className:"h-2 rounded bg-muted mt-3",children:e.jsx("div",{className:"h-2 rounded bg-primary",style:{width:`${h}%`}})})]})]}),e.jsxs(u,{children:[e.jsx(v,{children:e.jsx(N,{className:"text-sm",children:"Application headroom"})}),e.jsxs(p,{children:[e.jsx("div",{className:"text-2xl font-bold",children:y(s.remaining_microusd)}),e.jsxs("p",{className:"text-xs cron-muted",children:["Cap ",y(s.application_cap_microusd)]})]})]}),e.jsxs(u,{children:[e.jsx(v,{children:e.jsx(N,{className:"text-sm",children:"Live compute"})}),e.jsxs(p,{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(u,{children:[e.jsxs(v,{children:[e.jsx(N,{children:"Accounting and policy"}),e.jsxs(w,{children:[s.environment," · cycle ",s.billing_cycle]})]}),e.jsxs(p,{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:n,onChange:j=>l(j.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:[m[n]," · Workspace $250"]})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Conservative estimate"}),e.jsx("br",{}),y(s.estimated_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider-reported floor"}),e.jsx("br",{}),y(s.provider_floor_microusd)," · ",e.jsx(_,{children:c})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider backstops"}),e.jsx("br",{}),s.environment_cap_microusd===null?"Starter: no Environment cap":`Environment ${y(s.environment_cap_microusd)}`," · Workspace ",y(s.workspace_cap_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Active thresholds"}),e.jsx("br",{}),"Warning ",y(s.warning_microusd)," · trip ",y(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",{}),f(s.cycle_end_at)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Last metered"}),e.jsx("br",{}),s.last_metered_at?f(s.last_metered_at):"Unavailable"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider reconciliation"}),e.jsx("br",{}),s.last_reconciled_at?f(s.last_reconciled_at):"Unavailable",s.last_reconciliation_attempt_at?` · attempted ${f(s.last_reconciliation_attempt_at)}`:"",s.next_reconciliation_at?` · next ${f(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":`${y(s.burn_rate_microusd_per_hour)}/hour${s.projected_cap_hit_at?` · cap ${f(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} · ${y(s.prior_cycle.effective_microusd)}`:"Not enough data"]})]})]}),e.jsxs(u,{children:[e.jsx(v,{children:e.jsx(N,{children:"Live lifecycle"})}),e.jsx(p,{className:"text-sm",children:Object.entries(s.live_states).map(([j,g])=>e.jsxs("span",{className:"mr-4",children:[j,": ",g]},j))})]}),e.jsxs(u,{children:[e.jsx(v,{children:e.jsx(N,{children:"Daily spend"})}),e.jsx(p,{children:s.daily_spend.length?e.jsx("ul",{className:"space-y-1 text-sm",children:s.daily_spend.map(j=>e.jsxs("li",{children:[j.date,": blank ",y(j.blank_pool_microusd)," · assigned ",y(j.assigned_microusd)]},j.date))}):e.jsx("p",{className:"cron-muted",children:"No compute recorded in this cycle."})})]}),e.jsxs(u,{children:[e.jsxs(v,{children:[e.jsx(N,{children:"Recent circuit events"}),e.jsx(w,{children:"Runbook: docs/chat-sandbox-spend-runbook.md"})]}),e.jsx(p,{children:s.events.length?e.jsx("ul",{className:"space-y-2 text-sm",children:s.events.map(j=>e.jsxs("li",{children:[e.jsx(_,{children:j.severity})," ",j.type," · ",f(j.created_at)]},j.id))}):e.jsx("p",{className:"cron-muted",children:"No events in this cycle."})})]})]})},Rs=({data:s,loading:a,error:r})=>{if(a)return e.jsxs("div",{className:"flex items-center py-8",children:[e.jsx(C,{className:"h-5 w-5 animate-spin mr-3"}),"Loading web-search budget…"]});if(r||!s)return e.jsx(u,{className:"cron-status--broken",children:e.jsx(p,{className:"pt-6",children:"Web-search budget accounting is unavailable."})});const n=Math.min(100,s.call_count/s.hard_limit_calls*100);return e.jsxs(u,{className:s.circuit_state==="tripped"?"cron-status--broken":s.circuit_state==="warning"||s.circuit_state==="cooldown"?"cron-status--degraded":"",children:[e.jsxs(v,{children:[e.jsx(N,{children:"Web search"}),e.jsxs(w,{children:[s.environment," · UTC cycle ",s.billing_cycle," · provider details are admin-only"]})]}),e.jsxs(p,{className:"space-y-4",children:[e.jsxs("div",{className:"grid md:grid-cols-4 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Circuit"}),e.jsx("br",{}),s.circuit_state,s.trip_reason?` · ${s.trip_reason}`:""]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Calls"}),e.jsx("br",{}),s.call_count," / ",s.hard_limit_calls," · ",s.success_count," successful"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Remaining"}),e.jsx("br",{}),s.remaining_calls]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Warning"}),e.jsx("br",{}),s.warning_calls," calls"]})]}),e.jsx("div",{role:"progressbar","aria-label":"Web-search monthly budget used","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(n),className:"h-2 rounded bg-muted",children:e.jsx("div",{className:"h-2 rounded bg-primary",style:{width:`${n}%`}})}),e.jsxs("p",{className:"text-xs cron-muted",children:["Cycle ends ",f(s.cycle_end_at)," · provider-reported cost $",(s.provider_cost_microusd/1e6).toFixed(4),s.last_latency_ms!==null?` · last ${s.last_latency_ms} ms / ${s.last_result_count??0} results`:"",s.cooldown_until?` · cooldown until ${f(s.cooldown_until)}`:"",s.last_provider_error_class?` · last provider error ${s.last_provider_error_class}`:""]}),s.events.length>0&&e.jsx("ul",{className:"space-y-1 text-sm",children:s.events.map(l=>e.jsxs("li",{children:[l.type," · ",f(l.created_at),l.error_class?` · ${l.error_class}`:""]},l.id))})]})]})},zs=()=>{const s=Xe(),[a,r]=x.useState(!0),[n,l]=x.useState(0),[m,h]=x.useState(""),[o,c]=x.useState(""),[j,g]=x.useState(new Set),{user:i}=Ve(),{data:d,isLoading:Y,isFetching:Z,error:S,refetch:Ae}=A({queryKey:["cronStatus",i==null?void 0:i.username],queryFn:()=>O.getCronStatus(),enabled:!!(i!=null&&i.is_admin),refetchInterval:a?3e4:!1,retry:!1}),D=A({queryKey:["paperMarkdownJobs",i==null?void 0:i.username],queryFn:()=>O.getPaperMarkdownJobs(),enabled:!!(i!=null&&i.is_admin),refetchInterval:a?3e4:!1,retry:!1}),I=A({queryKey:["chatSandboxSpend",i==null?void 0:i.username,o],queryFn:()=>O.getChatSandboxSpend(o||void 0),enabled:!!(i!=null&&i.is_admin),refetchInterval:a?3e4:!1,retry:!1}),U=A({queryKey:["chatWebSearchBudget",i==null?void 0:i.username],queryFn:()=>O.getChatWebSearchBudget(),enabled:!!(i!=null&&i.is_admin)&&s,refetchInterval:a?3e4:!1,retry:!1}),ee=(S&&typeof S=="object"&&"status"in S?S.status:void 0)===401?"Unauthorized. Sign in with an allowlisted Hugging Face admin account.":S instanceof Error?S.message:void 0,Ee=t=>{g($=>{const T=new Set($);return T.has(t)?T.delete(t):T.add(t),T})},se=(d==null?void 0:d.jobs.filter(t=>t.dashboard_group==="leaderboard_sync"))??[],ae=(d==null?void 0:d.jobs.filter(t=>t.category!=="manual"&&t.dashboard_group!=="leaderboard_sync"))??[],De=ae.filter(t=>t.critical),Ie=ae.filter(t=>!t.critical),re=(d==null?void 0:d.manual_operations)??[],q=Ie.reduce((t,$)=>(t[$.category]||(t[$.category]=[]),t[$.category].push($),t),{}),qe=Object.keys(q).sort((t,$)=>{const T=["systemd","hourly","daily","weekly","backfill"];return T.indexOf(t)-T.indexOf($)}),J=t=>e.jsx(Ns,{job:t,expanded:j.has(t.job_name),onToggle:()=>Ee(t.job_name),paperMarkdownJobs:t.job_name==="paper_markdown_backfill"?D.data:void 0,paperMarkdownJobsLoading:t.job_name==="paper_markdown_backfill"?D.isLoading:!1,paperMarkdownJobsError:t.job_name==="paper_markdown_backfill"?D.error:null},t.job_name),Je=()=>{l(t=>t+1),Ae(),D.refetch(),I.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(M,{variant:"outline",size:"sm",onClick:()=>r(!a),className:a?"cron-status--running":"",children:[e.jsx(ie,{className:`h-4 w-4 mr-2 ${a?"animate-spin":""}`}),"Auto-refresh ",a?"ON":"OFF"]}),e.jsxs(M,{variant:"outline",size:"sm",onClick:Je,disabled:Z,children:[e.jsx(ie,{className:`h-4 w-4 mr-2 ${Z?"animate-spin":""}`}),"Refresh"]})]})]})}),e.jsx(u,{className:"mb-6",children:e.jsx(p,{className:"pt-6",children:e.jsxs("p",{className:"text-sm cron-muted",children:["Signed in as ",e.jsxs("span",{className:"font-semibold",children:["@",i==null?void 0:i.username]}),". Health checks prefer database freshness over log completion so silent no-work failures surface as degraded or broken."]})})}),e.jsxs(hs,{defaultValue:"critical-jobs",children:[e.jsxs(Te,{className:"grid h-auto w-full grid-cols-2 sm:w-auto sm:grid-cols-5",children:[e.jsx(L,{value:"critical-jobs",children:"Critical Jobs"}),e.jsx(L,{value:"leaderboard-syncs",children:"Leaderboard Syncs"}),e.jsx(L,{value:"codex-paper-jobs",children:"Codex Paper Jobs"}),e.jsx(L,{value:"catalog-audit",children:"Catalog Audit"}),e.jsx(L,{value:"chat-compute",children:"Chat Compute"})]}),e.jsxs(R,{value:"critical-jobs",className:"mt-6",children:[Y&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(C,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading CRON jobs status..."})]}),S&&e.jsx(u,{className:"cron-status--broken",children:e.jsx(p,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(E,{className:"h-5 w-5"}),e.jsx("p",{children:ee??"Failed to load CRON jobs status. Please try again."})]})})}),d&&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(t=>e.jsxs(u,{children:[e.jsx(v,{className:"pb-2",children:e.jsx(N,{className:"text-sm font-medium cron-muted capitalize",children:t})}),e.jsx(p,{children:e.jsx("div",{className:"text-2xl font-bold",children:d.summary[t]})})]},t))}),d.summary.critical_issues.length>0&&e.jsxs(u,{className:"mb-6 cron-status--broken",children:[e.jsx(v,{children:e.jsxs(N,{className:"flex items-center gap-2",children:[e.jsx(es,{className:"h-5 w-5"}),"Critical job issues"]})}),e.jsx(p,{children:e.jsx("ul",{className:"list-disc pl-5 space-y-1 text-sm",children:d.summary.critical_issues.map(t=>e.jsx("li",{children:t},t))})})]}),e.jsxs(u,{className:"mb-8",children:[e.jsx(v,{children:e.jsx(N,{className:"text-base",children:"What to check next"})}),e.jsxs(p,{children:[e.jsx("p",{className:"text-sm cron-muted",children:d.summary.what_to_check_next}),e.jsxs("p",{className:"mt-2 text-xs cron-muted flex items-center gap-2",children:[e.jsx(ue,{className:"h-4 w-4"}),"Last updated: ",f(d.timestamp)," · Health score:"," ",d.summary.health_score.toFixed(0),"%"]})]})]}),e.jsxs(u,{className:`mb-8 ${d.summary.coverage.coverage_gaps?"cron-status--broken":""}`,children:[e.jsxs(v,{children:[e.jsx(N,{className:"text-base",children:"Coverage"}),e.jsx(w,{children:"Registry and deployed scheduler inventory"})]}),e.jsxs(p,{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Registered"}),e.jsx("div",{className:"text-2xl font-bold",children:d.summary.coverage.registered_scheduled_duties})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Discovered"}),e.jsx("div",{className:"text-2xl font-bold",children:d.summary.coverage.discovered_scheduled_duties})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Monitored"}),e.jsx("div",{className:"text-2xl font-bold",children:d.summary.coverage.monitored_duties})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Gaps"}),e.jsx("div",{className:"text-2xl font-bold",children:d.summary.coverage.coverage_gaps})]})]})]}),e.jsxs(u,{className:"mb-8",children:[e.jsxs(v,{children:[e.jsx(N,{className:"text-xl",children:"Critical jobs"}),e.jsx(w,{children:"Writers whose stale output breaks the live site"})]}),e.jsx(p,{className:"space-y-4",children:De.map(J)})]}),e.jsx("div",{className:"space-y-6",children:qe.map(t=>e.jsxs(u,{children:[e.jsx(v,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(N,{className:"text-xl capitalize flex items-center gap-2",children:[e.jsx(_,{className:me[t]??me.hourly,children:t}),e.jsx("span",{children:"Supporting jobs"})]}),e.jsxs(w,{children:[q[t].length," job",q[t].length!==1?"s":""]})]})}),e.jsx(p,{className:"space-y-4",children:q[t].map(J)})]},t))}),re.length>0&&e.jsxs(u,{className:"mt-6",children:[e.jsxs(v,{children:[e.jsx(N,{className:"text-xl",children:"Manual operations"}),e.jsx(w,{children:"Visible invocation history; excluded from scheduled health and coverage"})]}),e.jsx(p,{className:"space-y-4",children:re.map(J)})]})]})]}),e.jsxs(R,{value:"leaderboard-syncs",className:"mt-6",children:[Y&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(C,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading leaderboard sync status..."})]}),S&&e.jsx(u,{className:"cron-status--broken",children:e.jsx(p,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(E,{className:"h-5 w-5"}),e.jsx("p",{children:ee??"Failed to load leaderboard sync status. Please try again."})]})})}),d&&e.jsxs(u,{children:[e.jsx(v,{children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx(N,{className:"text-xl",children:"Leaderboard syncs"}),e.jsx(w,{children:"Recurring imports from externally maintained benchmark leaderboards"})]}),e.jsxs(_,{children:[se.length," jobs"]})]})}),e.jsx(p,{className:"space-y-4",children:se.map(J)})]})]}),e.jsx(R,{value:"codex-paper-jobs",className:"mt-6",children:e.jsx($s,{autoRefresh:a,refreshToken:n})}),e.jsx(R,{value:"catalog-audit",className:"mt-6",children:e.jsx(Ts,{})}),e.jsxs(R,{value:"chat-compute",className:"mt-6",children:[e.jsxs(u,{className:"mb-6",children:[e.jsxs(v,{children:[e.jsx(N,{children:"Environment record"}),e.jsx(w,{children:"Leave blank for live staging, or enter the isolated environment printed by the spend qualification command."})]}),e.jsxs(p,{className:"flex gap-2",children:[e.jsx("input",{"aria-label":"Chat compute environment record",value:m,onChange:t=>h(t.target.value),placeholder:"staging-q-example",className:"flex-1 rounded border px-3 py-2"}),e.jsx(M,{onClick:()=>c(m.trim()),children:"Load"})]})]}),e.jsx(Ls,{data:I.data,loading:I.isLoading,error:I.error}),s&&e.jsx("div",{className:"mt-6",children:e.jsx(Rs,{data:U.data,loading:U.isLoading,error:U.error})})]})]})]})})};export{Ls as ChatComputePanel,Rs as WebSearchBudgetPanel,zs as default};
|
|
|
|
| 1 |
+
import{d as k,r as x,j as e,v as b,y as Oe,n as He,m as B,Q as Be,z as We,I as Ue,q as z,P as ze,t as Ke,B as xe,L as Qe,k as Ge,g as Ve,b as Xe,c as O}from"./index-CnNiludC.js";import{u as A}from"./useQuery-C87uSz9p.js";import{B as _,D as ne,f as Ye}from"./codexAddEvals-DIZEZyhj.js";import{B as M}from"./button-Cb-e5tHG.js";import{C as Ze}from"./chevron-down-Bjm5Iw9B.js";import{F as te}from"./file-text-CzoH1JKN.js";import{C as E,R as ie,S as es}from"./shield-alert-BRQa4qRa.js";import{L as C}from"./loader-circle-3AJg82rJ.js";import{C as G}from"./circle-check-BO6NSWAF.js";import{E as he}from"./external-link-05AgYo3a.js";import{u as ce}from"./useMutation-CZOEaG9X.js";import{u as ss}from"./useInfiniteQuery-DulZ-zOj.js";import{c as K}from"./catalog-D7qk7tAG.js";/**
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 53 |
*
|
| 54 |
* This source code is licensed under the ISC license.
|
| 55 |
* See the LICENSE file in the root directory of this source tree.
|
| 56 |
+
*/const pe=k("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"}]]),u=x.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:b("rounded-lg border bg-card text-card-foreground shadow-sm",s),...a}));u.displayName="Card";const v=x.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:b("flex flex-col space-y-1.5 p-6",s),...a}));v.displayName="CardHeader";const N=x.forwardRef(({className:s,...a},r)=>e.jsx("h3",{ref:r,className:b("text-2xl font-semibold leading-none tracking-tight",s),...a}));N.displayName="CardTitle";const w=x.forwardRef(({className:s,...a},r)=>e.jsx("p",{ref:r,className:b("text-sm text-muted-foreground",s),...a}));w.displayName="CardDescription";const p=x.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:b("p-6 pt-0",s),...a}));p.displayName="CardContent";const os=x.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:b("flex items-center p-6 pt-0",s),...a}));os.displayName="CardFooter";var W="Tabs",[ds]=Ke(W,[xe]),ge=xe(),[ms,V]=ds(W),je=x.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,onValueChange:l,defaultValue:m,orientation:h="horizontal",dir:o,activationMode:c="automatic",...j}=s,g=Oe(o),[i,d]=He({prop:n,onChange:l,defaultProp:m??"",caller:W});return e.jsx(ms,{scope:r,baseId:Be(),value:i,onValueChange:d,orientation:h,dir:g,activationMode:c,children:e.jsx(B.div,{dir:g,"data-orientation":h,...j,ref:a})})});je.displayName=W;var fe="TabsList",ve=x.forwardRef((s,a)=>{const{__scopeTabs:r,loop:n=!0,...l}=s,m=V(fe,r),h=ge(r);return e.jsx(We,{asChild:!0,...h,orientation:m.orientation,dir:m.dir,loop:n,children:e.jsx(B.div,{role:"tablist","aria-orientation":m.orientation,...l,ref:a})})});ve.displayName=fe;var Ne="TabsTrigger",be=x.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,disabled:l=!1,...m}=s,h=V(Ne,r),o=ge(r),c=we(h.baseId,n),j=ke(h.baseId,n),g=n===h.value;return e.jsx(Ue,{asChild:!0,...o,focusable:!l,active:g,children:e.jsx(B.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":j,"data-state":g?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:c,...m,ref:a,onMouseDown:z(s.onMouseDown,i=>{!l&&i.button===0&&i.ctrlKey===!1?h.onValueChange(n):i.preventDefault()}),onKeyDown:z(s.onKeyDown,i=>{[" ","Enter"].includes(i.key)&&h.onValueChange(n)}),onFocus:z(s.onFocus,()=>{const i=h.activationMode!=="manual";!g&&!l&&i&&h.onValueChange(n)})})})});be.displayName=Ne;var ye="TabsContent",_e=x.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,forceMount:l,children:m,...h}=s,o=V(ye,r),c=we(o.baseId,n),j=ke(o.baseId,n),g=n===o.value,i=x.useRef(g);return x.useEffect(()=>{const d=requestAnimationFrame(()=>i.current=!1);return()=>cancelAnimationFrame(d)},[]),e.jsx(ze,{present:l||g,children:({present:d})=>e.jsx(B.div,{"data-state":g?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":c,hidden:!d,id:j,tabIndex:0,...h,ref:a,style:{...s.style,animationDuration:i.current?"0s":void 0},children:d&&m})})});_e.displayName=ye;function we(s,a){return`${s}-trigger-${a}`}function ke(s,a){return`${s}-content-${a}`}var xs=je,Ce=ve,Se=be,$e=_e;const hs=xs,Te=x.forwardRef(({className:s,...a},r)=>e.jsx(Ce,{ref:r,className:b("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),...a}));Te.displayName=Ce.displayName;const L=x.forwardRef(({className:s,...a},r)=>e.jsx(Se,{ref:r,className:b("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}));L.displayName=Se.displayName;const R=x.forwardRef(({className:s,...a},r)=>e.jsx($e,{ref:r,className:b("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...a}));R.displayName=$e.displayName;function f(s){if(!s)return"Never";const a=new Date(s);if(Number.isNaN(a.getTime()))return s;const r=Date.now()-a.getTime(),n=Math.floor(r/6e4),l=Math.floor(r/36e5),m=Math.floor(r/864e5);return n<1?"Just now":n<60?`${n}m ago`:l<24?`${l}h ago`:m<7?`${m}d ago`:a.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Le(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 Re(s){return s.available?s.status==="completed"?s.conclusion??"completed":s.status??"unknown":"Unavailable"}function X(s){return s.replace(/_/g," ").replace(/\b\w/g,a=>a.toUpperCase())}const us={healthy:G,degraded:pe,broken:E,running:C,stuck:E,unknown:rs};function ps({status:s,isRunning:a}){const r=a?"running":s,n=us[r];return e.jsx(n,{className:`cron-status-icon cron-status--${r}${r==="running"?" animate-spin":""}`})}function oe({label:s,axis:a}){return e.jsxs(_,{variant:"outline",className:`cron-status--${a.status}`,title:a.reason,children:[s,": ",a.status]})}function de({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(([n,l])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:X(n)}),e.jsx("div",{className:"text-lg font-semibold",children:typeof l=="number"?l.toLocaleString():l})]},n))})]})}function gs({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",Re(s)],...s.updated_at?[["Updated",f(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 js(s){return s==="COMPLETED"?"cron-status--healthy":s==="ERROR"||s==="CANCELED"?"cron-status--broken":s==="RUNNING"?"cron-status--running":"cron-status--unknown"}function fs({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:js(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(he,{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 ",f(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(n=>e.jsxs("div",{children:[e.jsx("span",{className:"font-mono",children:n.arxiv_id}),": ",n.error]},`${n.arxiv_id}:${n.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 ",f(s.created_at)]}),s.duration_seconds!=null&&e.jsxs("span",{children:["Duration ",Le(s.duration_seconds)]})]}),s.stage_message&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.stage_message})]})}function vs({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(cs,{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(C,{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(([n,l])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:X(n)}),e.jsx("div",{className:"text-lg font-semibold",children:l.toLocaleString()})]},n))}),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(n=>e.jsx(fs,{job:n},n.id))})]})]})}function Ns({job:s,expanded:a,onToggle:r,paperMarkdownJobs:n,paperMarkdownJobsLoading:l=!1,paperMarkdownJobsError:m=null}){const h=!!(s.work_metrics&&Object.keys(s.work_metrics).length),o=!!(s.db_metrics&&Object.keys(s.db_metrics).length),c=s.job_name==="paper_markdown_backfill";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(ps,{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:"Held lock"}),e.jsx(oe,{label:"Execution",axis:s.execution_health}),e.jsx(oe,{label:"Output",axis:s.output_health}),a?e.jsx(as,{className:"h-4 w-4 cron-muted"}):e.jsx(Ze,{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(ue,{}),"Log: ",f(s.last_run)]}),e.jsxs("span",{className:"cron-fact",children:[e.jsx(ne,{}),"DB: ",f(s.last_db_write)]}),s.recent_write_count!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(ls,{}),"Recent writes: ",s.recent_write_count.toLocaleString()]}),s.duration!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(H,{}),"Duration: ",Le(s.duration)]}),s.schedule&&e.jsxs("span",{className:"cron-fact md:col-span-2",children:[e.jsx(le,{}),e.jsx("span",{className:"font-mono text-xs",children:s.schedule})]}),s.log_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(te,{}),"Log status: ",s.log_status]}),s.workflow_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(H,{}),"Actions: ",Re(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&&!0&&e.jsx("div",{className:"cron-job-details",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(le,{className:"h-4 w-4"}),e.jsx("h4",{children:"Scheduler evidence"})]}),e.jsx("div",{className:"cron-metric-card space-y-2 text-sm",children:[["Scheduler",s.execution_health.scheduler??"unknown"],["Last expected",f(s.execution_health.last_expected_at??null)],["Last started",f(s.execution_health.last_started_at??null)],["Last completed",f(s.execution_health.last_completed_at??null)],["Next expected",f(s.execution_health.next_expected_at??null)]].map(([g,i])=>e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"cron-label",children:g}),e.jsx("span",{children:i})]},g))})]}),s.work_metrics&&h&&e.jsx(de,{icon:te,title:"Log Metrics",metrics:s.work_metrics}),s.db_metrics&&o&&e.jsx(de,{icon:ne,title:"Database Metrics",metrics:s.db_metrics}),s.workflow_status&&e.jsx(gs,{workflow:s.workflow_status}),c&&e.jsx(vs,{monitor:n,loading:l,error:m}),s.diagnostic_groups&&Object.values(s.diagnostic_groups).some(g=>g.length>0)&&e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(pe,{className:"h-4 w-4"}),e.jsx("h4",{children:"Diagnostics by cause"})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:Object.entries(s.diagnostic_groups).filter(([,g])=>g.length>0).map(([g,i])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label mb-1",children:X(g)}),e.jsx("ul",{className:"list-disc pl-4 text-sm space-y-1",children:i.map(d=>e.jsx("li",{children:d},d))})]},g))})]})]})})]})}const Fe=x.forwardRef(({className:s,...a},r)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:r,className:b("w-full caption-bottom text-sm",s),...a})}));Fe.displayName="Table";const Pe=x.forwardRef(({className:s,...a},r)=>e.jsx("thead",{ref:r,className:b("[&_tr]:border-b",s),...a}));Pe.displayName="TableHeader";const Me=x.forwardRef(({className:s,...a},r)=>e.jsx("tbody",{ref:r,className:b("[&_tr:last-child]:border-0",s),...a}));Me.displayName="TableBody";const bs=x.forwardRef(({className:s,...a},r)=>e.jsx("tfoot",{ref:r,className:b("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...a}));bs.displayName="TableFooter";const Q=x.forwardRef(({className:s,...a},r)=>e.jsx("tr",{ref:r,className:b("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",s),...a}));Q.displayName="TableRow";const F=x.forwardRef(({className:s,...a},r)=>e.jsx("th",{ref:r,className:b("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",s),...a}));F.displayName="TableHead";const P=x.forwardRef(({className:s,...a},r)=>e.jsx("td",{ref:r,className:b("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...a}));P.displayName="TableCell";const ys=x.forwardRef(({className:s,...a},r)=>e.jsx("caption",{ref:r,className:b("mt-4 text-sm text-muted-foreground",s),...a}));ys.displayName="TableCaption";const _s={queued:"cron-status--unknown",dispatching:"cron-status--running",running:"cron-status--running",completed:"cron-status--healthy",failed:"cron-status--broken",canceled:"cron-status--unknown"},ws={"add-evals":"Add evals","enrich-paper":"Enrich paper"},ks={queued:is,dispatching:C,running:ns,completed:G,failed:E,canceled:ts};function Cs({status:s}){const a=ks[s];return e.jsxs(_,{variant:"outline",className:_s[s],children:[e.jsx(a,{className:`mr-1 h-3.5 w-3.5 ${s==="dispatching"?"animate-spin":""}`}),s]})}function Ss(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 $s({autoRefresh:s,refreshToken:a}){const{data:r,isLoading:n,isFetching:l,error:m}=A({queryKey:["codexPaperJobs",a],queryFn:()=>Ye(100),refetchInterval:s?1e4:!1,retry:!1}),h=m&&typeof m=="object"&&"status"in m?m.status:void 0;return e.jsxs(u,{className:"mb-8",children:[e.jsx(v,{children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(N,{className:"text-xl",children:"Codex paper jobs"}),e.jsx(w,{children:"Durable queue and execution history for admin-triggered Hugging Face Jobs"})]}),l&&!n&&e.jsxs("span",{className:"flex items-center gap-2 text-xs cron-muted",children:[e.jsx(C,{className:"h-3.5 w-3.5 animate-spin"})," Syncing with Hugging Face"]})]})}),e.jsxs(p,{children:[n&&e.jsxs("div",{className:"flex items-center justify-center py-10 cron-muted",children:[e.jsx(C,{className:"mr-2 h-5 w-5 animate-spin"})," Loading paper jobs…"]}),m&&h!==404&&e.jsx("div",{className:"cron-message cron-message--error mb-4",children:m instanceof Error?m.message:"Could not load Codex paper jobs."}),h===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(o=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label capitalize",children:o}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:r.summary[o]})]},o)),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(Fe,{children:[e.jsx(Pe,{children:e.jsxs(Q,{children:[e.jsx(F,{children:"Status"}),e.jsx(F,{children:"Paper"}),e.jsx(F,{children:"Action"}),e.jsx(F,{children:"Requested"}),e.jsx(F,{children:"Execution"})]})}),e.jsx(Me,{children:r.jobs.map(o=>{const c=Ss(o);return e.jsxs(Q,{children:[e.jsx(P,{className:"align-top",children:e.jsx(Cs,{status:o.status})}),e.jsxs(P,{className:"min-w-[260px] align-top",children:[e.jsx(Qe,{to:`/paper/${encodeURIComponent(o.paper_route)}`,className:"font-medium hover:underline",children:o.paper_title}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Paper #",o.paper_id]})]}),e.jsxs(P,{className:"whitespace-nowrap align-top",children:[ws[o.kind],o.applied_at&&e.jsxs("div",{className:"mt-1 flex items-center gap-1 text-xs cron-status--healthy",children:[e.jsx(G,{className:"h-3.5 w-3.5"})," Applied"]})]}),e.jsxs(P,{className:"whitespace-nowrap align-top",children:[e.jsx("div",{children:f(o.created_at)}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["@",o.requested_by]})]}),e.jsxs(P,{className:"max-w-[360px] align-top",children:[o.hf_job_url?e.jsxs("a",{href:o.hf_job_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 hover:underline",children:["Hugging Face Job ",e.jsx(he,{className:"h-3.5 w-3.5"})]}):e.jsx("span",{className:"cron-muted",children:"Waiting to dispatch"}),c&&e.jsx("p",{className:`mt-2 line-clamp-3 text-xs ${o.error?"text-red-700":"cron-muted"}`,title:c,children:c})]})]},o.id)})})]}),e.jsxs("p",{className:"mt-4 text-xs cron-muted",children:["Showing the 100 most recent jobs · Queue totals include full history · Updated ",f(r.timestamp)]})]})]})]})}const Ts=()=>{var m,h,o;const s=Ge(),a=ss({queryKey:["catalog-audit"],queryFn:({pageParam:c})=>K.audit(c),initialPageParam:void 0,getNextPageParam:c=>c.next_cursor??void 0}),r=((m=a.data)==null?void 0:m.pages.flatMap(c=>c.events))??[],n=ce({mutationFn:()=>K.acknowledgeAudit(),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})}),l=ce({mutationFn:c=>K.rollbackEvent(c),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})});return e.jsx("div",{className:"space-y-4",children:e.jsxs(u,{children:[e.jsxs(v,{className:"flex-row items-center justify-between",children:[e.jsx(N,{children:"Catalog mutation audit"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm font-medium",children:[((o=(h=a.data)==null?void 0:h.pages[0])==null?void 0:o.unread_contributor_count)??0," unread contributor changes"]}),e.jsx(M,{variant:"outline",size:"sm",onClick:()=>n.mutate(),disabled:n.isPending,children:"Mark read"})]})]}),e.jsxs(p,{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(c=>e.jsxs("article",{className:`rounded-md border p-3 ${c.operation==="delete"||c.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:[c.operation," ",c.entity_type," ",c.entity_id]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["@",c.actor_username??c.actor_role," ·"," ",new Date(c.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:c.before,after:c.after},null,2)})]}),!c.rollback_of_event_id&&e.jsx(M,{className:"mt-3",variant:"outline",size:"sm",onClick:()=>l.mutate(c.id),disabled:l.isPending||c.rollback_eligible===!1,children:c.rollback_eligible===!1?"Rollback conflict":"Roll back if unchanged"})]},c.id)),a.hasNextPage&&e.jsx(M,{variant:"outline",onClick:()=>a.fetchNextPage(),disabled:a.isFetchingNextPage,children:a.isFetchingNextPage?"Loading…":"Load older events"})]})]})})},me={hourly:"cron-status--running",daily:"cron-status--healthy",weekly:"cron-status--degraded",systemd:"cron-status--running"},y=s=>`$${(s/1e6).toFixed(2)}`,Ls=({data:s,loading:a,error:r})=>{const[n,l]=x.useState("staging-current"),m={"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(C,{className:"h-6 w-6 animate-spin mr-3"}),"Loading chat compute…"]});if(r||!s)return e.jsx(u,{className:"cron-status--broken",children:e.jsx(p,{className:"pt-6",children:"Chat compute accounting is unavailable."})});const h=Math.min(100,s.effective_microusd/s.application_cap_microusd*100),o=s.circuit_state==="tripped"?"Chat disabled":s.circuit_state==="warning"?"Operator warning":"Enabled",c=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(u,{className:s.circuit_state==="tripped"?"cron-status--broken":s.circuit_state==="warning"?"cron-status--degraded":"",children:[e.jsx(v,{children:e.jsx(N,{className:"text-sm",children:"Circuit"})}),e.jsxs(p,{children:[e.jsx("div",{className:"text-2xl font-bold",children:o}),e.jsx("p",{className:"text-xs cron-muted",children:s.trip_reason??"Policy armed"})]})]}),e.jsxs(u,{children:[e.jsx(v,{children:e.jsx(N,{className:"text-sm",children:"Month to date"})}),e.jsxs(p,{children:[e.jsx("div",{className:"text-2xl font-bold",children:y(s.effective_microusd)}),e.jsx("div",{role:"progressbar","aria-label":"Application cap used","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(h),className:"h-2 rounded bg-muted mt-3",children:e.jsx("div",{className:"h-2 rounded bg-primary",style:{width:`${h}%`}})})]})]}),e.jsxs(u,{children:[e.jsx(v,{children:e.jsx(N,{className:"text-sm",children:"Application headroom"})}),e.jsxs(p,{children:[e.jsx("div",{className:"text-2xl font-bold",children:y(s.remaining_microusd)}),e.jsxs("p",{className:"text-xs cron-muted",children:["Cap ",y(s.application_cap_microusd)]})]})]}),e.jsxs(u,{children:[e.jsx(v,{children:e.jsx(N,{className:"text-sm",children:"Live compute"})}),e.jsxs(p,{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(u,{children:[e.jsxs(v,{children:[e.jsx(N,{children:"Accounting and policy"}),e.jsxs(w,{children:[s.environment," · cycle ",s.billing_cycle]})]}),e.jsxs(p,{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:n,onChange:j=>l(j.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:[m[n]," · Workspace $250"]})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Conservative estimate"}),e.jsx("br",{}),y(s.estimated_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider-reported floor"}),e.jsx("br",{}),y(s.provider_floor_microusd)," · ",e.jsx(_,{children:c})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider backstops"}),e.jsx("br",{}),s.environment_cap_microusd===null?"Starter: no Environment cap":`Environment ${y(s.environment_cap_microusd)}`," · Workspace ",y(s.workspace_cap_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Active thresholds"}),e.jsx("br",{}),"Warning ",y(s.warning_microusd)," · trip ",y(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",{}),f(s.cycle_end_at)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Last metered"}),e.jsx("br",{}),s.last_metered_at?f(s.last_metered_at):"Unavailable"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider reconciliation"}),e.jsx("br",{}),s.last_reconciled_at?f(s.last_reconciled_at):"Unavailable",s.last_reconciliation_attempt_at?` · attempted ${f(s.last_reconciliation_attempt_at)}`:"",s.next_reconciliation_at?` · next ${f(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":`${y(s.burn_rate_microusd_per_hour)}/hour${s.projected_cap_hit_at?` · cap ${f(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} · ${y(s.prior_cycle.effective_microusd)}`:"Not enough data"]})]})]}),e.jsxs(u,{children:[e.jsx(v,{children:e.jsx(N,{children:"Live lifecycle"})}),e.jsx(p,{className:"text-sm",children:Object.entries(s.live_states).map(([j,g])=>e.jsxs("span",{className:"mr-4",children:[j,": ",g]},j))})]}),e.jsxs(u,{children:[e.jsx(v,{children:e.jsx(N,{children:"Daily spend"})}),e.jsx(p,{children:s.daily_spend.length?e.jsx("ul",{className:"space-y-1 text-sm",children:s.daily_spend.map(j=>e.jsxs("li",{children:[j.date,": blank ",y(j.blank_pool_microusd)," · assigned ",y(j.assigned_microusd)]},j.date))}):e.jsx("p",{className:"cron-muted",children:"No compute recorded in this cycle."})})]}),e.jsxs(u,{children:[e.jsxs(v,{children:[e.jsx(N,{children:"Recent circuit events"}),e.jsx(w,{children:"Runbook: docs/chat-sandbox-spend-runbook.md"})]}),e.jsx(p,{children:s.events.length?e.jsx("ul",{className:"space-y-2 text-sm",children:s.events.map(j=>e.jsxs("li",{children:[e.jsx(_,{children:j.severity})," ",j.type," · ",f(j.created_at)]},j.id))}):e.jsx("p",{className:"cron-muted",children:"No events in this cycle."})})]})]})},Rs=({data:s,loading:a,error:r})=>{if(a)return e.jsxs("div",{className:"flex items-center py-8",children:[e.jsx(C,{className:"h-5 w-5 animate-spin mr-3"}),"Loading web-search budget…"]});if(r||!s)return e.jsx(u,{className:"cron-status--broken",children:e.jsx(p,{className:"pt-6",children:"Web-search budget accounting is unavailable."})});const n=Math.min(100,s.call_count/s.hard_limit_calls*100);return e.jsxs(u,{className:s.circuit_state==="tripped"?"cron-status--broken":s.circuit_state==="warning"||s.circuit_state==="cooldown"?"cron-status--degraded":"",children:[e.jsxs(v,{children:[e.jsx(N,{children:"Web search"}),e.jsxs(w,{children:[s.environment," · UTC cycle ",s.billing_cycle," · provider details are admin-only"]})]}),e.jsxs(p,{className:"space-y-4",children:[e.jsxs("div",{className:"grid md:grid-cols-4 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Circuit"}),e.jsx("br",{}),s.circuit_state,s.trip_reason?` · ${s.trip_reason}`:""]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Calls"}),e.jsx("br",{}),s.call_count," / ",s.hard_limit_calls," · ",s.success_count," successful"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Remaining"}),e.jsx("br",{}),s.remaining_calls]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Warning"}),e.jsx("br",{}),s.warning_calls," calls"]})]}),e.jsx("div",{role:"progressbar","aria-label":"Web-search monthly budget used","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(n),className:"h-2 rounded bg-muted",children:e.jsx("div",{className:"h-2 rounded bg-primary",style:{width:`${n}%`}})}),e.jsxs("p",{className:"text-xs cron-muted",children:["Cycle ends ",f(s.cycle_end_at)," · provider-reported cost $",(s.provider_cost_microusd/1e6).toFixed(4),s.last_latency_ms!==null?` · last ${s.last_latency_ms} ms / ${s.last_result_count??0} results`:"",s.cooldown_until?` · cooldown until ${f(s.cooldown_until)}`:"",s.last_provider_error_class?` · last provider error ${s.last_provider_error_class}`:""]}),s.events.length>0&&e.jsx("ul",{className:"space-y-1 text-sm",children:s.events.map(l=>e.jsxs("li",{children:[l.type," · ",f(l.created_at),l.error_class?` · ${l.error_class}`:""]},l.id))})]})]})},zs=()=>{const s=Xe(),[a,r]=x.useState(!0),[n,l]=x.useState(0),[m,h]=x.useState(""),[o,c]=x.useState(""),[j,g]=x.useState(new Set),{user:i}=Ve(),{data:d,isLoading:Y,isFetching:Z,error:S,refetch:Ae}=A({queryKey:["cronStatus",i==null?void 0:i.username],queryFn:()=>O.getCronStatus(),enabled:!!(i!=null&&i.is_admin),refetchInterval:a?3e4:!1,retry:!1}),D=A({queryKey:["paperMarkdownJobs",i==null?void 0:i.username],queryFn:()=>O.getPaperMarkdownJobs(),enabled:!!(i!=null&&i.is_admin),refetchInterval:a?3e4:!1,retry:!1}),I=A({queryKey:["chatSandboxSpend",i==null?void 0:i.username,o],queryFn:()=>O.getChatSandboxSpend(o||void 0),enabled:!!(i!=null&&i.is_admin),refetchInterval:a?3e4:!1,retry:!1}),U=A({queryKey:["chatWebSearchBudget",i==null?void 0:i.username],queryFn:()=>O.getChatWebSearchBudget(),enabled:!!(i!=null&&i.is_admin)&&s,refetchInterval:a?3e4:!1,retry:!1}),ee=(S&&typeof S=="object"&&"status"in S?S.status:void 0)===401?"Unauthorized. Sign in with an allowlisted Hugging Face admin account.":S instanceof Error?S.message:void 0,Ee=t=>{g($=>{const T=new Set($);return T.has(t)?T.delete(t):T.add(t),T})},se=(d==null?void 0:d.jobs.filter(t=>t.dashboard_group==="leaderboard_sync"))??[],ae=(d==null?void 0:d.jobs.filter(t=>t.category!=="manual"&&t.dashboard_group!=="leaderboard_sync"))??[],De=ae.filter(t=>t.critical),Ie=ae.filter(t=>!t.critical),re=(d==null?void 0:d.manual_operations)??[],q=Ie.reduce((t,$)=>(t[$.category]||(t[$.category]=[]),t[$.category].push($),t),{}),qe=Object.keys(q).sort((t,$)=>{const T=["systemd","hourly","daily","weekly","backfill"];return T.indexOf(t)-T.indexOf($)}),J=t=>e.jsx(Ns,{job:t,expanded:j.has(t.job_name),onToggle:()=>Ee(t.job_name),paperMarkdownJobs:t.job_name==="paper_markdown_backfill"?D.data:void 0,paperMarkdownJobsLoading:t.job_name==="paper_markdown_backfill"?D.isLoading:!1,paperMarkdownJobsError:t.job_name==="paper_markdown_backfill"?D.error:null},t.job_name),Je=()=>{l(t=>t+1),Ae(),D.refetch(),I.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(M,{variant:"outline",size:"sm",onClick:()=>r(!a),className:a?"cron-status--running":"",children:[e.jsx(ie,{className:`h-4 w-4 mr-2 ${a?"animate-spin":""}`}),"Auto-refresh ",a?"ON":"OFF"]}),e.jsxs(M,{variant:"outline",size:"sm",onClick:Je,disabled:Z,children:[e.jsx(ie,{className:`h-4 w-4 mr-2 ${Z?"animate-spin":""}`}),"Refresh"]})]})]})}),e.jsx(u,{className:"mb-6",children:e.jsx(p,{className:"pt-6",children:e.jsxs("p",{className:"text-sm cron-muted",children:["Signed in as ",e.jsxs("span",{className:"font-semibold",children:["@",i==null?void 0:i.username]}),". Health checks prefer database freshness over log completion so silent no-work failures surface as degraded or broken."]})})}),e.jsxs(hs,{defaultValue:"critical-jobs",children:[e.jsxs(Te,{className:"grid h-auto w-full grid-cols-2 sm:w-auto sm:grid-cols-5",children:[e.jsx(L,{value:"critical-jobs",children:"Critical Jobs"}),e.jsx(L,{value:"leaderboard-syncs",children:"Leaderboard Syncs"}),e.jsx(L,{value:"codex-paper-jobs",children:"Codex Paper Jobs"}),e.jsx(L,{value:"catalog-audit",children:"Catalog Audit"}),e.jsx(L,{value:"chat-compute",children:"Chat Compute"})]}),e.jsxs(R,{value:"critical-jobs",className:"mt-6",children:[Y&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(C,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading CRON jobs status..."})]}),S&&e.jsx(u,{className:"cron-status--broken",children:e.jsx(p,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(E,{className:"h-5 w-5"}),e.jsx("p",{children:ee??"Failed to load CRON jobs status. Please try again."})]})})}),d&&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(t=>e.jsxs(u,{children:[e.jsx(v,{className:"pb-2",children:e.jsx(N,{className:"text-sm font-medium cron-muted capitalize",children:t})}),e.jsx(p,{children:e.jsx("div",{className:"text-2xl font-bold",children:d.summary[t]})})]},t))}),d.summary.critical_issues.length>0&&e.jsxs(u,{className:"mb-6 cron-status--broken",children:[e.jsx(v,{children:e.jsxs(N,{className:"flex items-center gap-2",children:[e.jsx(es,{className:"h-5 w-5"}),"Critical job issues"]})}),e.jsx(p,{children:e.jsx("ul",{className:"list-disc pl-5 space-y-1 text-sm",children:d.summary.critical_issues.map(t=>e.jsx("li",{children:t},t))})})]}),e.jsxs(u,{className:"mb-8",children:[e.jsx(v,{children:e.jsx(N,{className:"text-base",children:"What to check next"})}),e.jsxs(p,{children:[e.jsx("p",{className:"text-sm cron-muted",children:d.summary.what_to_check_next}),e.jsxs("p",{className:"mt-2 text-xs cron-muted flex items-center gap-2",children:[e.jsx(ue,{className:"h-4 w-4"}),"Last updated: ",f(d.timestamp)," · Health score:"," ",d.summary.health_score.toFixed(0),"%"]})]})]}),e.jsxs(u,{className:`mb-8 ${d.summary.coverage.coverage_gaps?"cron-status--broken":""}`,children:[e.jsxs(v,{children:[e.jsx(N,{className:"text-base",children:"Coverage"}),e.jsx(w,{children:"Registry and deployed scheduler inventory"})]}),e.jsxs(p,{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Registered"}),e.jsx("div",{className:"text-2xl font-bold",children:d.summary.coverage.registered_scheduled_duties})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Discovered"}),e.jsx("div",{className:"text-2xl font-bold",children:d.summary.coverage.discovered_scheduled_duties})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Monitored"}),e.jsx("div",{className:"text-2xl font-bold",children:d.summary.coverage.monitored_duties})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Gaps"}),e.jsx("div",{className:"text-2xl font-bold",children:d.summary.coverage.coverage_gaps})]})]})]}),e.jsxs(u,{className:"mb-8",children:[e.jsxs(v,{children:[e.jsx(N,{className:"text-xl",children:"Critical jobs"}),e.jsx(w,{children:"Writers whose stale output breaks the live site"})]}),e.jsx(p,{className:"space-y-4",children:De.map(J)})]}),e.jsx("div",{className:"space-y-6",children:qe.map(t=>e.jsxs(u,{children:[e.jsx(v,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(N,{className:"text-xl capitalize flex items-center gap-2",children:[e.jsx(_,{className:me[t]??me.hourly,children:t}),e.jsx("span",{children:"Supporting jobs"})]}),e.jsxs(w,{children:[q[t].length," job",q[t].length!==1?"s":""]})]})}),e.jsx(p,{className:"space-y-4",children:q[t].map(J)})]},t))}),re.length>0&&e.jsxs(u,{className:"mt-6",children:[e.jsxs(v,{children:[e.jsx(N,{className:"text-xl",children:"Manual operations"}),e.jsx(w,{children:"Visible invocation history; excluded from scheduled health and coverage"})]}),e.jsx(p,{className:"space-y-4",children:re.map(J)})]})]})]}),e.jsxs(R,{value:"leaderboard-syncs",className:"mt-6",children:[Y&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(C,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading leaderboard sync status..."})]}),S&&e.jsx(u,{className:"cron-status--broken",children:e.jsx(p,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(E,{className:"h-5 w-5"}),e.jsx("p",{children:ee??"Failed to load leaderboard sync status. Please try again."})]})})}),d&&e.jsxs(u,{children:[e.jsx(v,{children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx(N,{className:"text-xl",children:"Leaderboard syncs"}),e.jsx(w,{children:"Recurring imports from externally maintained benchmark leaderboards"})]}),e.jsxs(_,{children:[se.length," jobs"]})]})}),e.jsx(p,{className:"space-y-4",children:se.map(J)})]})]}),e.jsx(R,{value:"codex-paper-jobs",className:"mt-6",children:e.jsx($s,{autoRefresh:a,refreshToken:n})}),e.jsx(R,{value:"catalog-audit",className:"mt-6",children:e.jsx(Ts,{})}),e.jsxs(R,{value:"chat-compute",className:"mt-6",children:[e.jsxs(u,{className:"mb-6",children:[e.jsxs(v,{children:[e.jsx(N,{children:"Environment record"}),e.jsx(w,{children:"Leave blank for live staging, or enter the isolated environment printed by the spend qualification command."})]}),e.jsxs(p,{className:"flex gap-2",children:[e.jsx("input",{"aria-label":"Chat compute environment record",value:m,onChange:t=>h(t.target.value),placeholder:"staging-q-example",className:"flex-1 rounded border px-3 py-2"}),e.jsx(M,{onClick:()=>c(m.trim()),children:"Load"})]})]}),e.jsx(Ls,{data:I.data,loading:I.isLoading,error:I.error}),s&&e.jsx("div",{className:"mt-6",children:e.jsx(Rs,{data:U.data,loading:U.isLoading,error:U.error})})]})]})]})})};export{Ls as ChatComputePanel,Rs as WebSearchBudgetPanel,zs as default};
|
assets/{FeedView-DG4EYyZw.js → FeedView-Dv7Ll2yq.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{u as F,r as d,i as R,j as e,a as q,L as M,b as $,c as U}from"./index-
|
|
|
|
| 1 |
+
import{u as F,r as d,i as R,j as e,a as q,L as M,b as $,c as U}from"./index-CnNiludC.js";import{P as B}from"./components-skIcbldg.js";import{u as K,P as W}from"./useIntersectionObserver-BUxW5ZLf.js";import{D as G,S as z,P as Q,u as V,a as X,M as Y,R as J,W as Z,A as ee,b as se,q as ae,c as te}from"./chatSessions-B5wJO74B.js";import{c as I}from"./catalog-D7qk7tAG.js";import{S}from"./chatPrompts-CDY3UGU1.js";import{t as re,d as O}from"./transform-zlVHQ5aE.js";import{u as ie}from"./usePapers-C15Wpgxo.js";import{P as ne}from"./usePeriodFilter-CAw9mrm9.js";import{S as v}from"./skeleton-BU3tw6-C.js";import{A as oe,a as le}from"./alert-CV1yu6Q5.js";import{u as D}from"./useQuery-C87uSz9p.js";import"./LatexTitle-B1FyT_-3.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";import"./chevron-down-Bjm5Iw9B.js";import"./useInfiniteQuery-DulZ-zOj.js";const ce=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],de={Today:"today","This Week":"week","This Month":"month","All Time":"all_time"},me={today:"Today",week:"This Week",month:"This Month",all_time:"All Time"},H=45,he=1800,pe=25,ue=350,fe=i=>{const[h,o]=d.useState(S[0].slice(0,1));return d.useEffect(()=>{var j,_;if(!i)return;if((_=(j=window.matchMedia)==null?void 0:j.call(window,"(prefers-reduced-motion: reduce)"))!=null&&_.matches){o(S[0]);return}let p=0,n=1,u=!1,m;o(S[0].slice(0,n));const l=()=>{const f=S[p];if(!u){if(n+=1,o(f.slice(0,n)),n===f.length){u=!0,m=window.setTimeout(l,he);return}m=window.setTimeout(l,H);return}if(n-=1,o(f.slice(0,n)),n===0){u=!1,p=(p+1)%S.length,m=window.setTimeout(l,ue);return}m=window.setTimeout(l,pe)};return m=window.setTimeout(l,H),()=>window.clearTimeout(m)},[i]),h},xe=i=>i==="trending"||i==="date_published"||i==="citation_count"?i:"trending",ge=i=>i==="today"||i==="week"||i==="month"||i==="all_time"?i:"all_time",be=()=>{var w,s,a;const i=F(),h=$()?z:Q,[o,p]=d.useState({text:"",paperMentions:[]}),n=o.text,[u,m]=d.useState(0),[l,j]=d.useState(G),_=(w=h.find(r=>r.id===l))==null?void 0:w.provider,[f,k]=d.useState(!1),[x,c]=d.useState("low"),[g,L]=d.useState(!1),A=fe(!n),y=d.useRef(null),E=D({queryKey:["chatAvailability"],queryFn:()=>U.getChatAvailability(),retry:!1,enabled:R()}),N=!!((s=E.data)!=null&&s.web_search_available),b=R()&&((a=E.data)==null?void 0:a.paper_mentions_enabled)!==!1,t=V({draft:o,onChange:p,enabled:b,textareaRef:y});d.useEffect(()=>{const r=y.current;r&&(r.style.height="auto",r.style.height=`${Math.min(r.scrollHeight,160)}px`)},[n]);const T=async(r=o)=>{if(!(!r.text.trim()||g)){L(!0),ae(r,l,{webSearchEnabled:N&&f,reasoningEffort:x});try{const C=await te(l,x);i(`/chat/${C.id}`)}catch{i("/chat")}}};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"ask-home-new",children:"Hint: type @ to bring papers into context"}),e.jsxs("div",{className:"ask-home",children:[e.jsxs("div",{className:"ask-home-textarea-wrap",children:[e.jsx(X,{text:o.text,mentions:o.paperMentions,scrollTop:u,variant:"home"}),e.jsx("textarea",{ref:y,rows:1,value:n,placeholder:A,"aria-label":"Ask the assistant",disabled:g,onChange:r=>t.updateText(r.target.value,r.target.selectionStart),onSelect:r=>t.refresh(r.currentTarget.selectionStart),onClick:r=>t.refresh(r.currentTarget.selectionStart),onScroll:r=>m(r.currentTarget.scrollTop),onBlur:r=>{var P,C;(C=(P=r.relatedTarget)==null?void 0:P.closest)!=null&&C.call(P,".chat-paper-picker")||window.setTimeout(t.close,0)},onKeyDown:r=>{t.keyDown(r)||r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),T())},role:b?"combobox":void 0,"aria-expanded":b?t.open:void 0,"aria-controls":t.open?t.pickerId:void 0,"aria-activedescendant":t.open&&t.results.length?`${t.optionIdPrefix}-${t.activeIndex}`:void 0,"aria-autocomplete":b?"list":void 0,"aria-describedby":t.message?"ask-home-paper-mention-message":void 0})]}),t.message&&e.jsx("div",{id:"ask-home-paper-mention-message",className:"chat-paper-mention-message",role:"alert",children:t.message}),e.jsxs("div",{className:"ask-home-foot",children:[e.jsxs("div",{className:"ask-home-provider-tools",children:[e.jsx(Y,{models:h,selectedModel:l,onModelChange:j}),e.jsx(J,{value:x,onChange:c,disabled:g}),N&&e.jsx(Z,{enabled:f,onChange:k,disabled:g}),_!=="openrouter"&&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${n.trim()?" chat-send-on":""}`,onClick:()=>void T(),disabled:!n.trim()||g,"aria-label":"Ask the assistant",children:e.jsx(ee,{})})]}),e.jsx(se,{open:t.open,query:t.query,results:t.results,activeIndex:t.activeIndex,loading:t.loading,error:t.error,onSelect:t.select,id:t.pickerId,optionIdPrefix:t.optionIdPrefix})]})]})},Ie=()=>{var N,b,t,T,w;const[i,h]=q(),o=xe(i.get("order_by")),p=ge(i.get("time")),n=i.get("has_code")==="true",u=i.get("has_hf_artifacts")==="true",m=me[p],l=s=>{const a=new URLSearchParams(i);a.set("order_by",s),h(a)},j=s=>{const a=new URLSearchParams(i);a.set("time",de[s]),h(a)},_=s=>{const a=new URLSearchParams(i);s?a.set("has_code","true"):a.delete("has_code"),h(a)},f=s=>{const a=new URLSearchParams(i);s?a.set("has_hf_artifacts","true"):a.delete("has_hf_artifacts"),h(a)},k=D({queryKey:["top-tasks-sidebar"],queryFn:()=>I.topTasks(8),staleTime:10*60*1e3}),x=D({queryKey:["trending-tasks-sidebar"],queryFn:()=>I.trendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),c=ie({page_size:30,order_by:o,order_dir:"desc",time:p,include_resources:!0,has_code:n,has_hf_artifacts:u}),g=d.useMemo(()=>{var a;return(((a=c.data)==null?void 0:a.pages.flatMap(r=>r.results))||[]).map(re)},[c.data]),{targetRef:L,isIntersecting:A}=K({rootMargin:"400px"});d.useEffect(()=>{A&&c.hasNextPage&&!c.isFetchingNextPage&&c.fetchNextPage()},[A,c.hasNextPage,c.isFetchingNextPage]);const y=c.isLoading,E=c.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"}),k.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(v,{className:"h-5 w-full"},a))}),(N=k.data)==null?void 0:N.map(s=>e.jsxs(M,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[O(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(M,{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,a)=>e.jsx(v,{className:"h-5 w-full"},a))}),((t=(b=x.data)==null?void 0:b.results)==null?void 0:t.length)===0&&!x.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(w=(T=x.data)==null?void 0:T.results)==null?void 0:w.map(s=>e.jsxs(M,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[O(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]})]}),e.jsxs("div",{children:[R()&&e.jsx(be,{}),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:ce.map(([s,a])=>e.jsx("button",{className:`sort-btn ${o===s?"active":""}`,onClick:()=>l(s),children:a},s))}),e.jsx(W,{hasCode:n,hasHfArtifacts:u,onHasCodeChange:_,onHasHfArtifactsChange:f})]}),e.jsx("div",{className:"sort-options sort-options-time",children:ne.map(s=>e.jsx("button",{className:`sort-btn sort-btn-time ${m===s?"active":""}`,onClick:()=>j(s),children:s},s))})]}),E&&e.jsx(oe,{variant:"destructive",className:"mb-4",children:e.jsx(le,{children:"Failed to load papers. Please try again."})}),y?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,a)=>e.jsxs("div",{className:"paper-card",children:[e.jsx("div",{className:"paper-thumb-wrap",children:e.jsx(v,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(v,{className:"h-6 w-3/4"}),e.jsx(v,{className:"h-4 w-1/2"}),e.jsx(v,{className:"h-12 w-full"})]})]},a))}):g.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:g.map((s,a)=>e.jsx(B,{paper:s,rank:a+1},s.id))}),e.jsx("div",{ref:L,style:{height:1}}),c.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})};export{be as AskAssistant,Ie as default};
|
assets/{FrameworksIndexView-BvfoULdV.js → FrameworksIndexView-CJh-2Pow.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{u as d,j as e,L as o,R as m}from"./index-
|
|
|
|
| 1 |
+
import{u as d,j as e,L as o,R as m}from"./index-CnNiludC.js";import{u as p}from"./useQuery-C87uSz9p.js";import{I as h}from"./components-skIcbldg.js";import{c as u}from"./catalog-D7qk7tAG.js";import{c as g,h as f}from"./transform-zlVHQ5aE.js";import"./LatexTitle-B1FyT_-3.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(h,{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"})]})]})},L=()=>{var a;const r=p({queryKey:["framework-catalog"],queryFn:()=>u.frameworkCatalog()}),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,L as default};
|
assets/{LatexTitle-CqAJNaLC.js → LatexTitle-B1FyT_-3.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{j as o,r as g}from"./index-
|
|
|
|
| 1 |
+
import{j as o,r as g}from"./index-CnNiludC.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-DngbvuDx.js → MarkdownText-mvLqNfwe.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{
|
|
|
|
| 1 |
+
import{F as l,j as s,L as u}from"./index-CnNiludC.js";import"./katex.min-BSBacQyE.js";import{r as p,a as m,P as h}from"./PaperPreviewLink-DAFhnDhq.js";import{M as d,r as w}from"./index-B8BJTSsG.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,f as r};
|
assets/{MethodDetailView-AvD5Dqkf.js → MethodDetailView-CkUzVx0g.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{j as e,r as L,f as W,a as Z,L as C,a9 as V,p as X}from"./index-DKw1mejm.js";import{u as M}from"./useQuery-DkXMNuGa.js";import{u as Y}from"./useInfiniteQuery-h1eyEnde.js";import{M as J,P as ee}from"./components-Cxl7U1Qh.js";import{u as te,P as se}from"./useIntersectionObserver-BekGFBzl.js";import{r as ae,M as O}from"./MarkdownText-DngbvuDx.js";import{c as b}from"./catalog-Cs0CZbdz.js";import{s as re}from"./slug-BpH-Nkvz.js";import{t as ne}from"./transform-DnfrBiik.js";import{S as A}from"./skeleton-CnS6y9lc.js";import{A as ie,a as le}from"./alert-DtuWH5Uh.js";import{s as oe}from"./safeExternalHref-CkBrsh84.js";import"./LatexTitle-CqAJNaLC.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-CLIb-QQ9.js";import"./index-CpeLXkpt.js";import"./hover-card-NZ1AKoGQ.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:n,w:o,h:l,fill:f,stroke:g,label:u,fontSize:c=10,multiline:_})=>e.jsxs("g",{children:[e.jsx("rect",{x:t,y:n,width:o,height:l,rx:"3",ry:"3",fill:f,stroke:g,strokeWidth:"1"}),_?e.jsxs(e.Fragment,{children:[e.jsx("text",{x:t+o/2,y:n+l/2-2,fontSize:c,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:_[0]}),e.jsx("text",{x:t+o/2,y:n+l/2+c-1,fontSize:c,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:_[1]})]}):e.jsx("text",{x:t+o/2,y:n+l/2,fontSize:c,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:u})]}),ce=()=>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"]})]}),de=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],me=()=>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"}),de.map(([t,n],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}),n?e.jsx("text",{x:"138",y:l,fontSize:"8.5",fontFamily:"var(--mono)",fill:s.faint,dominantBaseline:"middle",children:n}):null]},t)})]}),he={attention:ce,"agent-skills":me},pe=({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})]}),ue=({method:t})=>{const n=(t.slug||"").toLowerCase(),o=he[n];if(o)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(o,{})});if(t.image_url){const l=n==="transformer"||n==="gpt-4"||n==="gpt-4o"||n==="multi-head-attention"?" method-figure-svg--compact":n==="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(pe,{method:t})})},D=720,B=138,x={top:8,right:10,bottom:25,left:36},K=56,xe=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),ge=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),E=t=>xe.format(new Date(`${t}T00:00:00Z`)),fe=(t,n)=>{if(t===0)return new Set;const o=t>48?12:t>36?6:t>18?3:2,l=Math.max(1,Math.ceil(K/n)),f=Math.max(o,l),g=t-1,u=new Set([0,g]);for(let c=f;c<g;c+=f)(g-c)*n>=K&&u.add(c);return u},Q=t=>{if(t.coverage_status===void 0||["complete","not_applicable"].includes(t.coverage_status))return null;const n=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"}${n}`},je=({history:t,methodName:n})=>{const[o,l]=L.useState(null),f=Math.max(1,...t.map(i=>i.paper_count)),g=D-x.left-x.right,u=B-x.top-x.bottom,c=t.length?g/t.length:g,_=Math.max(2,c*.68),h=fe(t.length,c),P=Array.from(new Set([0,Math.ceil(f/2),f])),m=o==null?null:t[o],y=m?Q(m):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${D} ${B}`,role:"group","aria-label":`${n}: papers mentioning this method by publication month`,children:[e.jsxs("title",{children:[n,": papers mentioning this method by publication month"]}),P.map(i=>{const p=x.top+u-i/f*u;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:x.left,x2:D-x.right,y1:p,y2:p}),e.jsx("text",{className:"method-usage-y-label",x:x.left-8,y:p+3,textAnchor:"end",children:i})]},i)}),t.map((i,p)=>{const v=i.paper_count/f*u,w=i.paper_count>0?Math.max(1,v):0,F=x.left+c*p+(c-_)/2,a=x.top+u-w,N=o===p,S=p===t.length-1,k=Q(i);return e.jsxs("g",{className:`method-usage-bar${N?" is-active":""}${S?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${E(i.start_date)}: ${i.paper_count} ${i.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:x.left+c*p,y:x.top,width:c,height:u}),e.jsx("rect",{className:"method-usage-bar-mark",x:F,y:a,width:_,height:w,rx:"1.5"})]},i.start_date)}),t.map((i,p)=>h.has(p)?e.jsx("text",{className:"method-usage-x-label",x:x.left+c*(p+.5),y:B-11,textAnchor:"middle",children:t.length>48?ge.format(new Date(`${i.start_date}T00:00:00Z`)):E(i.start_date)},i.start_date):null)]}),m&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:E(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"]}),y&&e.jsx("span",{children:y})]})]})},_e=[["trending","trending"],["new","newest"],["cited","most cited"]],U={"on-policy-distillation":["fine-tuning","post-training","rlvr","rlhf","direct-preference-optimization-dpo"],mcp:["agent-skills"],"agent-skills":["mcp"]},Te=()=>{var I,T,z,$,H,R;const{methodSlug:t}=W(),[n,o]=Z(),[l,f]=L.useState("trending"),g=n.get("has_code")==="true",u=n.get("has_hf_artifacts")==="true",c=r=>{const d=new URLSearchParams(n);r?d.set("has_code","true"):d.delete("has_code"),o(d)},_=r=>{const d=new URLSearchParams(n);r?d.set("has_hf_artifacts","true"):d.delete("has_hf_artifacts"),o(d)},h=M({queryKey:["method",t],queryFn:()=>b.getMethod(t),enabled:!!t,staleTime:10*60*1e3}),P=M({queryKey:["areas-all"],queryFn:()=>b.listAreas({page_size:50,ordering:"name"}),enabled:!!((I=h.data)!=null&&I.area_id),staleTime:10*60*1e3}),m=M({queryKey:["method-trend",t],queryFn:()=>b.methodTrend(t),enabled:!!t&&!!h.data,staleTime:10*60*1e3}),y=l==="trending"?"trending":l==="cited"?"citation_count":"date_published",i=Y({queryKey:["method-papers-infinite",t,y,g,u],queryFn:({pageParam:r=1})=>X.forMethod(t,{page:r,page_size:20,order_by:y,order_dir:"desc",include_resources:!0,has_code:g,has_hf_artifacts:u}),getNextPageParam:r=>r.next_page,initialPageParam:1,enabled:!!t,staleTime:5*60*1e3,placeholderData:V}),p=M({queryKey:["related-methods",(T=h.data)==null?void 0:T.slug,(z=h.data)==null?void 0:z.area_id,($=h.data)==null?void 0:$.id],queryFn:async()=>{const r=h.data;if(!r)return[];const d=r.slug?U[r.slug]:void 0;return d?Promise.all(d.map(G=>b.getMethod(G))):r.area_id?(await b.listMethods({area_id:r.area_id,exclude_id:r.id,ordering:"-paper_count",page_size:8})).results:[]},enabled:!!(h.data&&(h.data.slug&&U[h.data.slug]||h.data.area_id)),staleTime:10*60*1e3}),v=L.useMemo(()=>{var d;return(((d=i.data)==null?void 0:d.pages.flatMap(q=>q.results))||[]).map(ne)},[i.data]),{targetRef:w,isIntersecting:F}=te({rootMargin:"200px"});if(L.useEffect(()=>{F&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[F,i.hasNextPage,i.isFetchingNextPage]),h.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(h.error||!h.data)return e.jsx("div",{className:"page",children:e.jsx(ie,{variant:"destructive",children:e.jsx(le,{children:"Method not found."})})});const a=h.data,N=(H=P.data)==null?void 0:H.results.find(r=>r.id===a.area_id),S=ae(a.source_url),k=S?null:oe(a.source_url);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(C,{to:"/methods",children:"Methods"}),N&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(C,{to:`/methods#area-${re(N.name)}`,children:N.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:a.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${a.slug==="grokking"||a.slug==="latent-reasoning"||a.slug==="world-action-models"?" 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:a.name}),a.full_name&&a.full_name!==a.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:a.full_name}),a.description&&e.jsx(O,{className:"method-description",text:a.description}),a.source_url&&a.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),S?e.jsxs(C,{className:"method-source-link",to:S,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):k?e.jsxs("a",{className:"method-source-link",href:k,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):e.jsxs("div",{className:"method-source-link is-static",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.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:(a.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"})]}),a.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:a.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(je,{history:m.data.history,methodName:a.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(ue,{method:a}),a.image_credit&&e.jsx("figcaption",{children:e.jsx(O,{className:"method-image-credit",text:a.image_credit})})]})]}),(((R=p.data)==null?void 0:R.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),p.data.map(r=>e.jsx(J,{method:{slug:r.slug,name:r.name}},r.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:_e.map(([r,d])=>e.jsx("button",{className:`sort-btn ${l===r?"active":""}`,onClick:()=>f(r),children:d},r))}),e.jsx(se,{hasCode:g,hasHfArtifacts:u,onHasCodeChange:c,onHasHfArtifactsChange:_})]}),e.jsxs("div",{className:"results-count",children:[v.length," papers mentioning ",a.name]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((r,d)=>e.jsx(A,{className:"h-40 w-full"},d))}):v.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:v.map((r,d)=>e.jsx(ee,{paper:r,rank:d+1},r.id))}),e.jsx("div",{ref:w,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{Te as default};
|
|
|
|
| 1 |
+
import{j as e,r as L,f as W,a as Z,L as C,ab as V,p as X}from"./index-CnNiludC.js";import{u as M}from"./useQuery-C87uSz9p.js";import{u as Y}from"./useInfiniteQuery-DulZ-zOj.js";import{M as J,P as ee}from"./components-skIcbldg.js";import{u as te,P as se}from"./useIntersectionObserver-BUxW5ZLf.js";import{r as ae,M as O}from"./MarkdownText-mvLqNfwe.js";import{c as b}from"./catalog-D7qk7tAG.js";import{s as re}from"./slug-BpH-Nkvz.js";import{t as ne}from"./transform-zlVHQ5aE.js";import{S as A}from"./skeleton-BU3tw6-C.js";import{A as ie,a as le}from"./alert-CV1yu6Q5.js";import{s as oe}from"./safeExternalHref-CkBrsh84.js";import"./LatexTitle-B1FyT_-3.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-DAFhnDhq.js";import"./index-B8BJTSsG.js";import"./hover-card-CDhcGwFp.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:n,w:o,h:l,fill:f,stroke:g,label:u,fontSize:c=10,multiline:_})=>e.jsxs("g",{children:[e.jsx("rect",{x:t,y:n,width:o,height:l,rx:"3",ry:"3",fill:f,stroke:g,strokeWidth:"1"}),_?e.jsxs(e.Fragment,{children:[e.jsx("text",{x:t+o/2,y:n+l/2-2,fontSize:c,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:_[0]}),e.jsx("text",{x:t+o/2,y:n+l/2+c-1,fontSize:c,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:_[1]})]}):e.jsx("text",{x:t+o/2,y:n+l/2,fontSize:c,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:u})]}),ce=()=>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"]})]}),de=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],me=()=>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"}),de.map(([t,n],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}),n?e.jsx("text",{x:"138",y:l,fontSize:"8.5",fontFamily:"var(--mono)",fill:s.faint,dominantBaseline:"middle",children:n}):null]},t)})]}),he={attention:ce,"agent-skills":me},pe=({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})]}),ue=({method:t})=>{const n=(t.slug||"").toLowerCase(),o=he[n];if(o)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(o,{})});if(t.image_url){const l=n==="transformer"||n==="gpt-4"||n==="gpt-4o"||n==="multi-head-attention"?" method-figure-svg--compact":n==="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(pe,{method:t})})},D=720,B=138,x={top:8,right:10,bottom:25,left:36},K=56,xe=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),ge=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),E=t=>xe.format(new Date(`${t}T00:00:00Z`)),fe=(t,n)=>{if(t===0)return new Set;const o=t>48?12:t>36?6:t>18?3:2,l=Math.max(1,Math.ceil(K/n)),f=Math.max(o,l),g=t-1,u=new Set([0,g]);for(let c=f;c<g;c+=f)(g-c)*n>=K&&u.add(c);return u},Q=t=>{if(t.coverage_status===void 0||["complete","not_applicable"].includes(t.coverage_status))return null;const n=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"}${n}`},je=({history:t,methodName:n})=>{const[o,l]=L.useState(null),f=Math.max(1,...t.map(i=>i.paper_count)),g=D-x.left-x.right,u=B-x.top-x.bottom,c=t.length?g/t.length:g,_=Math.max(2,c*.68),h=fe(t.length,c),P=Array.from(new Set([0,Math.ceil(f/2),f])),m=o==null?null:t[o],y=m?Q(m):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${D} ${B}`,role:"group","aria-label":`${n}: papers mentioning this method by publication month`,children:[e.jsxs("title",{children:[n,": papers mentioning this method by publication month"]}),P.map(i=>{const p=x.top+u-i/f*u;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:x.left,x2:D-x.right,y1:p,y2:p}),e.jsx("text",{className:"method-usage-y-label",x:x.left-8,y:p+3,textAnchor:"end",children:i})]},i)}),t.map((i,p)=>{const v=i.paper_count/f*u,w=i.paper_count>0?Math.max(1,v):0,F=x.left+c*p+(c-_)/2,a=x.top+u-w,N=o===p,S=p===t.length-1,k=Q(i);return e.jsxs("g",{className:`method-usage-bar${N?" is-active":""}${S?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${E(i.start_date)}: ${i.paper_count} ${i.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:x.left+c*p,y:x.top,width:c,height:u}),e.jsx("rect",{className:"method-usage-bar-mark",x:F,y:a,width:_,height:w,rx:"1.5"})]},i.start_date)}),t.map((i,p)=>h.has(p)?e.jsx("text",{className:"method-usage-x-label",x:x.left+c*(p+.5),y:B-11,textAnchor:"middle",children:t.length>48?ge.format(new Date(`${i.start_date}T00:00:00Z`)):E(i.start_date)},i.start_date):null)]}),m&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:E(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"]}),y&&e.jsx("span",{children:y})]})]})},_e=[["trending","trending"],["new","newest"],["cited","most cited"]],U={"on-policy-distillation":["fine-tuning","post-training","rlvr","rlhf","direct-preference-optimization-dpo"],mcp:["agent-skills"],"agent-skills":["mcp"]},Te=()=>{var I,T,z,$,H,R;const{methodSlug:t}=W(),[n,o]=Z(),[l,f]=L.useState("trending"),g=n.get("has_code")==="true",u=n.get("has_hf_artifacts")==="true",c=r=>{const d=new URLSearchParams(n);r?d.set("has_code","true"):d.delete("has_code"),o(d)},_=r=>{const d=new URLSearchParams(n);r?d.set("has_hf_artifacts","true"):d.delete("has_hf_artifacts"),o(d)},h=M({queryKey:["method",t],queryFn:()=>b.getMethod(t),enabled:!!t,staleTime:10*60*1e3}),P=M({queryKey:["areas-all"],queryFn:()=>b.listAreas({page_size:50,ordering:"name"}),enabled:!!((I=h.data)!=null&&I.area_id),staleTime:10*60*1e3}),m=M({queryKey:["method-trend",t],queryFn:()=>b.methodTrend(t),enabled:!!t&&!!h.data,staleTime:10*60*1e3}),y=l==="trending"?"trending":l==="cited"?"citation_count":"date_published",i=Y({queryKey:["method-papers-infinite",t,y,g,u],queryFn:({pageParam:r=1})=>X.forMethod(t,{page:r,page_size:20,order_by:y,order_dir:"desc",include_resources:!0,has_code:g,has_hf_artifacts:u}),getNextPageParam:r=>r.next_page,initialPageParam:1,enabled:!!t,staleTime:5*60*1e3,placeholderData:V}),p=M({queryKey:["related-methods",(T=h.data)==null?void 0:T.slug,(z=h.data)==null?void 0:z.area_id,($=h.data)==null?void 0:$.id],queryFn:async()=>{const r=h.data;if(!r)return[];const d=r.slug?U[r.slug]:void 0;return d?Promise.all(d.map(G=>b.getMethod(G))):r.area_id?(await b.listMethods({area_id:r.area_id,exclude_id:r.id,ordering:"-paper_count",page_size:8})).results:[]},enabled:!!(h.data&&(h.data.slug&&U[h.data.slug]||h.data.area_id)),staleTime:10*60*1e3}),v=L.useMemo(()=>{var d;return(((d=i.data)==null?void 0:d.pages.flatMap(q=>q.results))||[]).map(ne)},[i.data]),{targetRef:w,isIntersecting:F}=te({rootMargin:"200px"});if(L.useEffect(()=>{F&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[F,i.hasNextPage,i.isFetchingNextPage]),h.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(h.error||!h.data)return e.jsx("div",{className:"page",children:e.jsx(ie,{variant:"destructive",children:e.jsx(le,{children:"Method not found."})})});const a=h.data,N=(H=P.data)==null?void 0:H.results.find(r=>r.id===a.area_id),S=ae(a.source_url),k=S?null:oe(a.source_url);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(C,{to:"/methods",children:"Methods"}),N&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(C,{to:`/methods#area-${re(N.name)}`,children:N.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:a.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${a.slug==="grokking"||a.slug==="latent-reasoning"||a.slug==="world-action-models"?" 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:a.name}),a.full_name&&a.full_name!==a.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:a.full_name}),a.description&&e.jsx(O,{className:"method-description",text:a.description}),a.source_url&&a.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),S?e.jsxs(C,{className:"method-source-link",to:S,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):k?e.jsxs("a",{className:"method-source-link",href:k,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):e.jsxs("div",{className:"method-source-link is-static",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.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:(a.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"})]}),a.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:a.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(je,{history:m.data.history,methodName:a.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(ue,{method:a}),a.image_credit&&e.jsx("figcaption",{children:e.jsx(O,{className:"method-image-credit",text:a.image_credit})})]})]}),(((R=p.data)==null?void 0:R.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),p.data.map(r=>e.jsx(J,{method:{slug:r.slug,name:r.name}},r.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:_e.map(([r,d])=>e.jsx("button",{className:`sort-btn ${l===r?"active":""}`,onClick:()=>f(r),children:d},r))}),e.jsx(se,{hasCode:g,hasHfArtifacts:u,onHasCodeChange:c,onHasHfArtifactsChange:_})]}),e.jsxs("div",{className:"results-count",children:[v.length," papers mentioning ",a.name]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((r,d)=>e.jsx(A,{className:"h-40 w-full"},d))}):v.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:v.map((r,d)=>e.jsx(ee,{paper:r,rank:d+1},r.id))}),e.jsx("div",{ref:w,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{Te as default};
|
assets/{MethodsIndexView-Ccm7hy_H.js → MethodsIndexView-BlcIa_fS.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
-
import{d as g,r as d,j as e,L as f}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{d as g,r as d,j as e,L as f}from"./index-CnNiludC.js";import{u as m}from"./useQuery-C87uSz9p.js";import{c as h}from"./catalog-D7qk7tAG.js";import{s as j}from"./slug-BpH-Nkvz.js";import{S as p}from"./skeleton-BU3tw6-C.js";import{A as y,a as v}from"./alert-CV1yu6Q5.js";import{T as _}from"./TaxonomySuggestionTile-DPjYd5AL.js";import"./SignInToEditDialog-ByW2mx_A.js";import"./button-Cb-e5tHG.js";import"./textarea-DuxG42Qe.js";import"./dialog-COYv9g-7.js";import"./useMutation-CZOEaG9X.js";import"./loader-circle-3AJg82rJ.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"}]]),B=()=>{var l,c;const i=m({queryKey:["areas-all"],queryFn:()=>h.listAreas({page_size:50,ordering:"name"}),staleTime:6e5}),n=m({queryKey:["methods-all"],queryFn:async()=>(await h.listMethods({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-${j(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(f,{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{B as default};
|
assets/{NotFound-ByhKYbf2.js → NotFound-B6qYFFtn.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{
|
|
|
|
| 1 |
+
import{aw as o,r as a,j as t,L as s}from"./index-CnNiludC.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-Ubnek6oO.js → OrganizationContributionGraph-CBDgtzLe.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as b,j as o}from"./index-
|
|
|
|
| 1 |
+
import{r as b,j as o}from"./index-CnNiludC.js";import{u as z}from"./useQuery-C87uSz9p.js";import{S as T}from"./skeleton-BU3tw6-C.js";import{c as w}from"./catalog-D7qk7tAG.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,m)=>e-m),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 m=new Date(e),d=N(m),g=e>=r.getTime()&&e<=i.getTime(),C=g?p.get(d)??0:0;l.push({key:d,date:m,count:C,inRange:g,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(g=>g.inRange&&(e===0||g.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"})]})]})},A=({organizationSlug:n,organizationName:r})=>{const i=z({queryKey:["organization-contributions",n],queryFn:()=>w.organizationContributions(n),staleTime:6e5});return i.isLoading?o.jsx(T,{className:"organization-contributions-skeleton"}):i.data?o.jsx(L,{data:i.data,organizationName:r}):null};export{L as C,A as O};
|
assets/OrganizationDetailView-BbrTMC2j.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{f as t,j as r}from"./index-CnNiludC.js";import{O as i}from"./OrganizationPaperFeed-BPCfQF2i.js";import m from"./NotFound-B6qYFFtn.js";import"./useQuery-C87uSz9p.js";import"./components-skIcbldg.js";import"./LatexTitle-B1FyT_-3.js";import"./katex.min-BSBacQyE.js";import"./transform-zlVHQ5aE.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-mvLqNfwe.js";import"./PaperPreviewLink-DAFhnDhq.js";import"./index-B8BJTSsG.js";import"./hover-card-CDhcGwFp.js";import"./OrganizationContributionGraph-CBDgtzLe.js";import"./skeleton-BU3tw6-C.js";import"./catalog-D7qk7tAG.js";import"./useIntersectionObserver-BUxW5ZLf.js";import"./alert-CV1yu6Q5.js";import"./searchable-select-BV8KO0OB.js";import"./button-Cb-e5tHG.js";import"./dialog-COYv9g-7.js";import"./loader-circle-3AJg82rJ.js";import"./usePapers-C15Wpgxo.js";import"./useInfiniteQuery-DulZ-zOj.js";const b=()=>{const{orgSlug:o}=t();return o?r.jsx(i,{organizationSlug:o}):r.jsx(m,{})};export{b as default};
|
assets/OrganizationDetailView-CxyrG7tq.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{f as t,j as r}from"./index-DKw1mejm.js";import{O as i}from"./OrganizationPaperFeed-D99Kpwxe.js";import m from"./NotFound-ByhKYbf2.js";import"./useQuery-DkXMNuGa.js";import"./components-Cxl7U1Qh.js";import"./LatexTitle-CqAJNaLC.js";import"./katex.min-BSBacQyE.js";import"./transform-DnfrBiik.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-DngbvuDx.js";import"./PaperPreviewLink-CLIb-QQ9.js";import"./index-CpeLXkpt.js";import"./hover-card-NZ1AKoGQ.js";import"./OrganizationContributionGraph-Ubnek6oO.js";import"./skeleton-CnS6y9lc.js";import"./catalog-Cs0CZbdz.js";import"./useIntersectionObserver-BekGFBzl.js";import"./alert-DtuWH5Uh.js";import"./searchable-select-vLNaJnxj.js";import"./button-Daj2z1wQ.js";import"./dialog-B9CPIS7M.js";import"./loader-circle-A0brRFET.js";import"./usePapers-DL9kxd4C.js";import"./useInfiniteQuery-h1eyEnde.js";const b=()=>{const{orgSlug:o}=t();return o?r.jsx(i,{organizationSlug:o}):r.jsx(m,{})};export{b as default};
|
|
|
|
|
|
assets/{OrganizationPaperFeed-D99Kpwxe.js → OrganizationPaperFeed-BPCfQF2i.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{u as E,a as Q,r as d,j as e,L as w}from"./index-
|
|
|
|
| 1 |
+
import{u as E,a as Q,r as d,j as e,L as w}from"./index-CnNiludC.js";import{u as A}from"./useQuery-C87uSz9p.js";import{P as U}from"./components-skIcbldg.js";import{M as B}from"./MarkdownText-mvLqNfwe.js";import{O as G}from"./OrganizationContributionGraph-CBDgtzLe.js";import{u as K,P as W}from"./useIntersectionObserver-BUxW5ZLf.js";import{A as D,a as Z}from"./alert-CV1yu6Q5.js";import{a as z}from"./searchable-select-BV8KO0OB.js";import{S as C}from"./skeleton-BU3tw6-C.js";import{d as J}from"./usePapers-C15Wpgxo.js";import{c as $}from"./catalog-D7qk7tAG.js";import{d as T,t as V}from"./transform-zlVHQ5aE.js";import X from"./NotFound-B6qYFFtn.js";const Y=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ee=n=>n==="date_published"||n==="citation_count"?n:"trending",ue=({organizationSlug:n,taskSlug:p})=>{var N,y,v,P,L,F,k,O;const I=E(),[l,h]=Q(),[M,m]=d.useState(!1),u=ee(l.get("order_by")),g=l.get("has_code")==="true",f=l.get("has_hf_artifacts")==="true",_=A({queryKey:["organization",n],queryFn:()=>$.getOrganization(n),staleTime:10*60*1e3}),c=A({queryKey:["organization-areas-with-tasks",n],queryFn:()=>$.organizationAreasWithTasks(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:f,enabled:!!n}),{targetRef:H,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=_.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=_.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();I({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&&!M?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(C,{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:f,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(C,{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,showInstitution:!1},a.id))}),e.jsx("div",{ref:H,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center"},children:"Loading more…"})]})]})};export{ue as O};
|
assets/OrganizationTaskView-CFdQxMtl.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{f as i,j as t}from"./index-CnNiludC.js";import{O as m}from"./OrganizationPaperFeed-BPCfQF2i.js";import p from"./NotFound-B6qYFFtn.js";import"./useQuery-C87uSz9p.js";import"./components-skIcbldg.js";import"./LatexTitle-B1FyT_-3.js";import"./katex.min-BSBacQyE.js";import"./transform-zlVHQ5aE.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-mvLqNfwe.js";import"./PaperPreviewLink-DAFhnDhq.js";import"./index-B8BJTSsG.js";import"./hover-card-CDhcGwFp.js";import"./OrganizationContributionGraph-CBDgtzLe.js";import"./skeleton-BU3tw6-C.js";import"./catalog-D7qk7tAG.js";import"./useIntersectionObserver-BUxW5ZLf.js";import"./alert-CV1yu6Q5.js";import"./searchable-select-BV8KO0OB.js";import"./button-Cb-e5tHG.js";import"./dialog-COYv9g-7.js";import"./loader-circle-3AJg82rJ.js";import"./usePapers-C15Wpgxo.js";import"./useInfiniteQuery-DulZ-zOj.js";const b=()=>{const{orgSlug:o,taskSlug:r}=i();return o&&r?t.jsx(m,{organizationSlug:o,taskSlug:r}):t.jsx(p,{})};export{b as default};
|
assets/OrganizationTaskView-DiQWNfUD.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{f as i,j as t}from"./index-DKw1mejm.js";import{O as m}from"./OrganizationPaperFeed-D99Kpwxe.js";import p from"./NotFound-ByhKYbf2.js";import"./useQuery-DkXMNuGa.js";import"./components-Cxl7U1Qh.js";import"./LatexTitle-CqAJNaLC.js";import"./katex.min-BSBacQyE.js";import"./transform-DnfrBiik.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-DngbvuDx.js";import"./PaperPreviewLink-CLIb-QQ9.js";import"./index-CpeLXkpt.js";import"./hover-card-NZ1AKoGQ.js";import"./OrganizationContributionGraph-Ubnek6oO.js";import"./skeleton-CnS6y9lc.js";import"./catalog-Cs0CZbdz.js";import"./useIntersectionObserver-BekGFBzl.js";import"./alert-DtuWH5Uh.js";import"./searchable-select-vLNaJnxj.js";import"./button-Daj2z1wQ.js";import"./dialog-B9CPIS7M.js";import"./loader-circle-A0brRFET.js";import"./usePapers-DL9kxd4C.js";import"./useInfiniteQuery-h1eyEnde.js";const b=()=>{const{orgSlug:o,taskSlug:r}=i();return o&&r?t.jsx(m,{organizationSlug:o,taskSlug:r}):t.jsx(p,{})};export{b as default};
|
|
|
|
|
|
assets/{OrganizationsIndexView-ve-bfvwo.js → OrganizationsIndexView-DN3ysr-g.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{a as u,r as g,j as e,L as x}from"./index-
|
|
|
|
| 1 |
+
import{a as u,r as g,j as e,L as x}from"./index-CnNiludC.js";import{u as j}from"./useQuery-C87uSz9p.js";import{A as y,a as f}from"./alert-CV1yu6Q5.js";import{S as _}from"./skeleton-BU3tw6-C.js";import{c as N}from"./catalog-D7qk7tAG.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)})})},A=()=>{var h;const[n,d]=u(),t=v(n.get("sort")),c=n.get("q")??"",o=j({queryKey:["organizations","featured"],queryFn:()=>N.organizations(!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(_,{className:"organization-card-skeleton"},a))}):o.error?e.jsx(y,{variant:"destructive",children:e.jsxs(f,{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{A as default};
|
assets/{PaperDetailView-BGxKbhUm.js → PaperDetailView-BEjlwQbA.js}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
assets/{PaperPreviewLink-CLIb-QQ9.js → PaperPreviewLink-DAFhnDhq.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-B8BJTSsG.js";import{k as z}from"./katex.min-BSBacQyE.js";import{j as f,R as T,N as ce,F as ue,L as he,p as pe}from"./index-CnNiludC.js";import{u as me}from"./useQuery-C87uSz9p.js";import{H as fe,a as de,b as ge}from"./hover-card-CDhcGwFp.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-X2HfX-75.js → PapersListView-DpeQT2iM.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{a as q,r as m,A as z,j as e,L as x}from"./index-
|
|
|
|
| 1 |
+
import{a as q,r as m,A as z,j as e,L as x}from"./index-CnNiludC.js";import{I as E,T as G,P as Q}from"./components-skIcbldg.js";import{c as U}from"./catalog-D7qk7tAG.js";import{t as W,d as K}from"./transform-zlVHQ5aE.js";import{u as V}from"./usePapers-C15Wpgxo.js";import{u as J}from"./useDebounce-tmUrFXv0.js";import{P as X}from"./usePeriodFilter-CAw9mrm9.js";import{u as Y,P as Z}from"./useIntersectionObserver-BUxW5ZLf.js";import{S as p}from"./skeleton-BU3tw6-C.js";import{A as ee,a as se}from"./alert-CV1yu6Q5.js";import{u as ae}from"./useQuery-C87uSz9p.js";import"./LatexTitle-B1FyT_-3.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";import"./useInfiniteQuery-DulZ-zOj.js";const re=[["trending","trending"],["new","newest"],["cited","most cited"]],te=r=>new Intl.NumberFormat("en",{notation:r>=1e3?"compact":"standard",maximumFractionDigits:1}).format(r),_e=()=>{var T,A,C,I,L,R,H;const[r,_]=q(),h=r.get("framework")||void 0,g=r.get("repository")||void 0,n=!!(h||g),u=r.get("search")||"",[b,k]=m.useState(u),d=J(b,300);m.useEffect(()=>k(u),[u]),m.useEffect(()=>{if(d===u)return;const s=new URLSearchParams(r);d?s.set("search",d):s.delete("search"),_(s,{replace:!0})},[d]);const j=r.get("order_by"),N=j==="citation_count"?"cited":j==="trending"||!j&&n?"trending":"new",o=r.get("time"),$=o==="today"?"Today":o==="week"?"This Week":o==="month"?"This Month":"All Time",y=r.get("has_hf_artifacts")==="true",w=!n&&r.get("has_code")==="true",f=(s,i)=>{const l=new URLSearchParams(r);i?l.set(s,i):l.delete(s),_(l)},B=s=>{f("time",s==="Today"?"today":s==="This Week"?"week":s==="This Month"?"month":void 0)},D=s=>{f("order_by",s==="cited"?"citation_count":s==="new"?"date_published":"trending")},t=V({page_size:20,order_by:N==="trending"?"trending":N==="cited"?"citation_count":"date_published",order_dir:"desc",search:d||void 0,time:o==="today"||o==="week"||o==="month"?o:"all_time",include_resources:!0,published_after:r.get("published_after")||void 0,published_before:r.get("published_before")||void 0,conference:r.get("conference")||void 0,latest_only:r.get("latest_only")!=="false",has_code:w,has_hf_artifacts:y,framework:h,repository:g}),P=ae({queryKey:["top-tasks-sidebar"],queryFn:()=>U.topTasks(8),enabled:!n,staleTime:10*60*1e3}),v=m.useMemo(()=>{var i;return(((i=t.data)==null?void 0:i.pages.flatMap(l=>l.results))||[]).map(W)},[t.data]),{targetRef:O,isIntersecting:F}=Y({rootMargin:"200px"});m.useEffect(()=>{F&&t.hasNextPage&&!t.isFetchingNextPage&&t.fetchNextPage()},[F,t.hasNextPage,t.isFetchingNextPage]);const c=((C=(A=(T=t.data)==null?void 0:T.pages)==null?void 0:A[0])==null?void 0:C.count)??0,a=(R=(L=(I=t.data)==null?void 0:I.pages)==null?void 0:L[0])==null?void 0:R.scope,S=h&&t.error instanceof z&&t.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(x,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(x,{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?void 0:a.kind)==="framework"?c>0&&`${c.toLocaleString()} papers.`:a!=null&&a.repository?e.jsxs(e.Fragment,{children:["GitHub repository ",e.jsx("strong",{children:a.repository}),". ",c>0&&`${c.toLocaleString()} papers.`]}):"Repository-scoped paper feed.":e.jsxs(e.Fragment,{children:["Search the full corpus. ",c>0&&`${c.toLocaleString()} papers indexed.`]})}),n&&a&&e.jsxs("div",{className:"paper-feed-scope-links",children:[e.jsxs("div",{className:"paper-feed-primary-links",children:[a.github_url&&e.jsxs("a",{href:a.github_url,target:"_blank",rel:"noopener noreferrer",className:a.kind==="framework"?"task-framework-link":"framework-link",children:[e.jsx(E,{name:"github",size:13}),a.kind==="framework"?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:a.repository||"GitHub"}),a.num_stars!=null&&e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",te(a.num_stars)]})]}):"GitHub"]}),a.kind==="framework"&&a.introducing_paper_arxiv_id&&e.jsx(x,{to:`/paper/${a.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"})]}),a.kind==="framework"&&a.recommended_tasks&&a.recommended_tasks.length>0&&e.jsx("div",{className:"paper-feed-task-tags",children:a.recommended_tasks.map(s=>s.slug?e.jsx(G,{slug:s.slug,label:s.name},s.id):null)})]})]}),e.jsx("div",{className:"period-switch",children:X.map(s=>e.jsx("button",{className:`period-btn ${$===s?"active":""}`,onClick:()=>B(s),children:s},s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(E,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:b,onChange:s=>k(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,i)=>e.jsx(p,{className:"h-5 w-full"},i))}),(H=P.data)==null?void 0:H.map(s=>e.jsxs(x,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[K(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:re.map(([s,i])=>e.jsx("button",{className:`sort-btn ${N===s?"active":""}`,onClick:()=>D(s),children:i},s))}),e.jsx(Z,{hasCode:w,hasHfArtifacts:y,onHasCodeChange:s=>f("has_code",s?"true":void 0),onHasHfArtifactsChange:s=>f("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."}):t.error&&e.jsx(ee,{variant:"destructive",className:"mb-4",children:e.jsx(se,{children:"Failed to load papers. Please try again."})}),!S&&(t.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,i)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(p,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(p,{className:"h-6 w-3/4"}),e.jsx(p,{className:"h-4 w-1/2"}),e.jsx(p,{className:"h-12 w-full"})]})]},i))}):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,i)=>e.jsx(Q,{paper:s,rank:i+1},s.id))}),e.jsx("div",{ref:O,style:{height:1}}),t.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]}))]})]})]})};export{_e as default};
|
assets/{PrivacyView-Dyd02vlP.js → PrivacyView-CIEmHSbN.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{R as s,j as e}from"./index-
|
|
|
|
| 1 |
+
import{R as s,j as e}from"./index-CnNiludC.js";import{f as i,D as r}from"./latexPlainText-DI8YEXVe.js";const n=()=>(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 11, 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. If you request contributor access, we also receive and retain the verified email address associated with your Hugging Face account so we can review and communicate about your request."]}),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:"Private chats are retained until you delete them, subject to limits of 100 active chats and 100 MB of chat data per user. Archiving hides a chat and frees active-chat quota but does not delete it. You may deliberately share an unlisted snapshot; deleting its private chat removes the durable transcript, workspace reference, and share link after deletion is verified. No dedicated private-chat export format is currently offered."}),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{n as default};
|
assets/{RateLimitsView-DykXcmrc.js → RateLimitsView-C-wgjf0f.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{j as e,e as s}from"./index-
|
|
|
|
| 1 |
+
import{j as e,e as s}from"./index-CnNiludC.js";import{u as r}from"./useQuery-C87uSz9p.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-BxAOxEQB.js → SavedPapersView-CKKGXgM6.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{g as h,A as g,j as e,
|
|
|
|
| 1 |
+
import{g as h,A as g,j as e,Z as v,L as x,c as j}from"./index-CnNiludC.js";import{u as N}from"./useQuery-C87uSz9p.js";import{T as b,P as f}from"./components-skIcbldg.js";import{S as r}from"./skeleton-BU3tw6-C.js";import{A as k,a as y}from"./alert-CV1yu6Q5.js";import{t as w}from"./transform-zlVHQ5aE.js";import{s as A}from"./savedPapersAuth-BGaR1VbQ.js";import"./LatexTitle-B1FyT_-3.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";const T=()=>{var d,o;const{user:t,isLoading:u}=h(),a=N({queryKey:["my-bookmarks"],queryFn:()=>j.getMyBookmarks(),enabled:!!t,staleTime:30*1e3,refetchOnWindowFocus:!1}),n=a.error instanceof g&&a.error.code==="saved_papers_bucket_authorization_required",m=!!a.data&&!a.data.bucket_connected,c=()=>{window.location.assign(A())};return u?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"})]}):t?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=a.data)!=null&&d.count?`${a.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain.",(o=a.data)!=null&&o.bucket_connected?e.jsxs(e.Fragment,{children:[" · ",e.jsx("a",{href:`https://huggingface.co/buckets/${t.username}/pwc-saved-papers`,target:"_blank",rel:"noopener noreferrer",children:"Open your Hugging Face Bucket"})]}):null]})]})}),n?e.jsxs("div",{className:"saved-bucket-migration",children:[e.jsx("p",{children:"Your saved papers are still safe in Papers With Code. Approve Bucket access to copy them into a private Hugging Face Bucket that belongs to you."}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:c,children:"Approve and migrate saved papers"})]}):a.error?e.jsx(k,{variant:"destructive",className:"mb-4",children:e.jsx(y,{children:"Failed to load your saved papers. Please try again."})}):null,m?e.jsxs("div",{className:"saved-bucket-migration",children:[e.jsxs("p",{children:[a.data.count?`Your ${a.data.count.toLocaleString()} saved ${a.data.count===1?"paper is":"papers are"} still available below. `:"When you save your first paper, ","Approve Bucket access to copy saved papers into a private Hugging Face Bucket that belongs to you. The existing data is kept until the copy is verified."]}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:c,children:a.data.count?"Approve and migrate saved papers":"Use a Hugging Face Bucket"})]}):null,n||a.error?null:a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,s)=>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"})]})]},s))}):!a.data||a.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 →"})]}):a.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(s=>{const l=s.papers.length;return e.jsxs("div",{className:"saved-task-block",children:[e.jsxs("div",{className:"saved-task-row",children:[s.slug?e.jsx(b,{slug:s.slug,label:s.name}):e.jsx("span",{className:"tag-chip",style:{background:"var(--surface)"},children:s.name}),e.jsxs("span",{className:"saved-task-count",children:[l," ",l===1?"paper":"papers"]})]}),e.jsx("div",{className:"paper-list",children:s.papers.map(p=>e.jsx(f,{paper:w(p),rank:1},p.id))})]},`task-${i.id??"other"}-${s.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(v,{returnTo:"/saved"})})]})};export{T as default};
|
assets/{SearchOverlay-CE9Hc9me.js → SearchOverlay-hqfeEBSl.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as C,u as K,R as T,i as L,j as s,p as $}from"./index-
|
|
|
|
| 1 |
+
import{r as C,u as K,R as T,i as L,j as s,p as $}from"./index-CnNiludC.js";import{u as m}from"./useQuery-C87uSz9p.js";import{L as D}from"./LatexTitle-B1FyT_-3.js";import{c as j}from"./catalog-D7qk7tAG.js";import{u as z}from"./useDebounce-tmUrFXv0.js";import{c as M,h as B,d as I}from"./transform-zlVHQ5aE.js";import"./katex.min-BSBacQyE.js";const X=10,V=({open:n,onClose:l})=>{var f,_,F,q,E,P;const v=C.useRef(null),w=K(),[c,R]=T.useState(""),[h,p]=T.useState(1),a=z(c,200),g=L();C.useEffect(()=>{var r;if(!n)return;(r=v.current)==null||r.focus();const e=A=>{A.key==="Escape"&&l()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n,l]);const t=m({queryKey:["search-papers",a,h],queryFn:()=>$.search(a,h,X),enabled:n&&a.length>=2,staleTime:6e4}),k=m({queryKey:["search-tasks",a],queryFn:()=>j.listTasks({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),y=m({queryKey:["search-methods",a],queryFn:()=>j.listMethods({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),N=m({queryKey:["search-benchmarks",a],queryFn:()=>j.listDatasets({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)||[],x=((q=t.data)==null?void 0:q.results)||[],Q=t.isFetching||k.isFetching||y.isFetching||N.isFetching,S=o.length||x.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),p(1)},onKeyDown:e=>{g&&e.key==="Enter"&&(e.preventDefault(),b())}}),s.jsxs("div",{className:"search-results",children:[g&&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.",g&&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=M(B(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:I(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))]}),x.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Papers · page ",h]}),x.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(D,{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 p(((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&&p(t.data.next_page)},children:"Next"})]})]})]})]})})};export{V as default};
|
assets/{SettingsView-C8SJDomY.js → SettingsView-CwSxZOuD.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{d as j,g as
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
@@ -13,4 +13,4 @@ import{d as j,g as F,F as q,ae as Y,i as U,R as u,k as W,j as e,W as x,c as y,A
|
|
| 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 G=j("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"}]]),X="https://openrouter.ai/settings/keys";function Z(t,o){if(t instanceof O){if(typeof t.detail=="string")return t.detail;if(typeof t.detail=="object"&&t.detail!==null&&"message"in t.detail&&typeof t.detail.message=="string")return t.detail.message}return t instanceof Error&&!t.message.startsWith("API request failed:")?t.message:o}const re=()=>{const{user:t,isLoading:o}=F(),{preferences:S,setHideClosedSourceEvals:P,canPersist:M}=q(),{theme:A,setTheme:T}=Y(),I=A??"system",r=U(),[f,l]=u.useState(""),[k,c]=u.useState(""),[d,N]=u.useState(""),h=W(),R=B(r&&!!t),D=H(r&&!!t),n=R.data,i=D.data,a=n?K(n.resets_at):null,m=(s,g)=>{l(Z(s,g)),c(s instanceof O?s.code??"":"")},p=v({mutationFn:s=>y.connectOpenRouterCredential(s),onSuccess:s=>{h.setQueryData(b,s),N(""),l(""),c("")},onError:s=>m(s,"Could not connect the OpenRouter key.")}),w=v({mutationFn:s=>y.setOpenRouterFallback(s),onSuccess:s=>{h.setQueryData(b,s),l(""),c("")},onError:s=>m(s,"Could not change paid fallback.")}),C=v({mutationFn:()=>y.disconnectOpenRouterCredential(),onSuccess:()=>{h.setQueryData(b,{connected:!1,verified_at:null,fallback_enabled:!1}),l(""),c("")},onError:s=>m(s,"Could not disconnect the OpenRouter key.")});return u.useEffect(()=>(document.title=$("Settings"),()=>{document.title=Q}),[]),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."})]})}),t&&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:t.role??"community member"}),"."," ",t.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.",t.is_admin?" You can also review submissions and use administrative maintenance tools.":" Submission review and maintenance tools remain admin-only."]})})]}),r&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Chat usage & billing"}),o&&!t?e.jsx("div",{className:"settings-billing-loading",role:"status","aria-live":"polite",children:"Checking account…"}):t?e.jsx("div",{className:"settings-provider-grid",children: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"})]}),(i==null?void 0:i.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."}),n?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 ",a==null?void 0:a.local," ",e.jsxs("span",{"aria-label":"UTC reset time",children:["(",a==null?void 0:a.utc,")"]})]})]}),e.jsx("strong",{children:n.available?`${n.remaining_percent}% left`:"Unavailable"})]}),e.jsx("div",{className:"settings-usage-track",role:"progressbar","aria-label":`${n.remaining_percent}% remaining; resets ${a==null?void 0:a.local}; ${a==null?void 0:a.utc}`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":n.remaining_percent,children:e.jsx("span",{style:{width:`${n.remaining_percent}%`}})}),!n.available&&e.jsxs("p",{className:"settings-limit-note",children:[n.unavailable_reason==="personal_allowance_exhausted"?"Your free monthly allowance is depleted.":`The shared OpenRouter credits are currently unavailable. ${n.remaining_percent}% of your personal allowance remains.`," DeepSeek V4 Flash is temporarily unavailable unless you enable your own key below."]})]}):e.jsx("div",{className:"settings-billing-loading",children:R.isError||n?"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"}),i!=null&&i.connected?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"settings-row-desc",children:["Connected",i.verified_at?` · Last verified ${new Date(i.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(_,{checked:i.fallback_enabled,disabled:w.isPending,onCheckedChange:s=>w.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:C.isPending,onClick:()=>C.mutate(),children:"Disconnect"}),e.jsxs("a",{className:"button",href:X,target:"_blank",rel:"noreferrer",children:["Revoke or rotate at OpenRouter ",e.jsx(L,{"aria-hidden":"true"})]})]})]}):e.jsxs("form",{onSubmit:s=>{s.preventDefault(),d.trim()&&p.mutate(d.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:d,onChange:s=>N(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:!d.trim()||p.isPending,children:p.isPending?"Verifying…":"Connect key"})})]}),f&&e.jsxs("div",{className:"settings-token-error",children:[e.jsx("p",{children:k==="fresh_auth_required"?"Your account is signed in, but adding or enabling an API key requires a Hugging Face sign-in from the last 15 minutes.":f}),k==="fresh_auth_required"&&e.jsx("div",{className:"settings-billing-actions",children:e.jsx(x,{returnTo:"/settings#openrouter-byok",label:"Re-authenticate with Hugging Face"})})]})]})]})}):e.jsxs("div",{className:"settings-note settings-note-flush",children:[e.jsx("span",{children:"Sign in to use the Papers With Code-funded OpenRouter allowance for research chat."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(x,{returnTo:"/settings"})})]})]}),r&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Chat privacy & retention"}),e.jsx("div",{className:"settings-note settings-note-flush",children:e.jsx("span",{children:"Chats are private and retained until you delete them. You can keep up to 100 active chats and 100 MB of chat data. Archiving removes chats from the active list and frees active-chat quota, but does not delete them. Deleting a chat permanently removes its durable transcript, workspace reference, and any public share link after deletion is verified. You can deliberately share an unlisted snapshot, but no dedicated private-chat export format is currently offered."})})]}),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:z},{value:"light",label:"Light",description:"Always use light mode",icon:G},{value:"dark",label:"Dark",description:"Always use dark mode",icon:V}].map(s=>{const g=s.icon,E=I===s.value;return e.jsxs("button",{type:"button",className:`theme-option ${E?"is-selected":""}`,"aria-pressed":E,onClick:()=>T(s.value),children:[e.jsx(g,{"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(_,{id:"hide-closed-source-evals",checked:S.hide_closed_source_evals,onCheckedChange:s=>{P(!!s)}})]}),!o&&!M&&!t&&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(x,{returnTo:"/settings"})})]})]})]})};export{re as default};
|
|
|
|
| 1 |
+
import{d as j,g as q,G as F,ag as Y,i as U,R as u,k as $,j as e,Z as x,c as y,A as O}from"./index-CnNiludC.js";import{u as v}from"./useMutation-CZOEaG9X.js";import{S as _}from"./switch-BmJwxg75.js";import{f as Q,D as W}from"./latexPlainText-DI8YEXVe.js";import{u as B,a as H,r as K,b}from"./openrouter-CSA2RSTl.js";import{E as L}from"./external-link-05AgYo3a.js";import"./index-D0hHQwos.js";import"./useQuery-C87uSz9p.js";/**
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 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 G=j("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"}]]),Z="https://openrouter.ai/settings/keys";function X(t,o){if(t instanceof O){if(typeof t.detail=="string")return t.detail;if(typeof t.detail=="object"&&t.detail!==null&&"message"in t.detail&&typeof t.detail.message=="string")return t.detail.message}return t instanceof Error&&!t.message.startsWith("API request failed:")?t.message:o}const re=()=>{const{user:t,isLoading:o}=q(),{preferences:S,setHideClosedSourceEvals:P,canPersist:M}=F(),{theme:A,setTheme:T}=Y(),I=A??"system",r=U(),[f,l]=u.useState(""),[k,c]=u.useState(""),[d,N]=u.useState(""),h=$(),R=B(r&&!!t),D=H(r&&!!t),n=R.data,i=D.data,a=n?K(n.resets_at):null,m=(s,g)=>{l(X(s,g)),c(s instanceof O?s.code??"":"")},p=v({mutationFn:s=>y.connectOpenRouterCredential(s),onSuccess:s=>{h.setQueryData(b,s),N(""),l(""),c("")},onError:s=>m(s,"Could not connect the OpenRouter key.")}),w=v({mutationFn:s=>y.setOpenRouterFallback(s),onSuccess:s=>{h.setQueryData(b,s),l(""),c("")},onError:s=>m(s,"Could not change paid fallback.")}),C=v({mutationFn:()=>y.disconnectOpenRouterCredential(),onSuccess:()=>{h.setQueryData(b,{connected:!1,verified_at:null,fallback_enabled:!1}),l(""),c("")},onError:s=>m(s,"Could not disconnect the OpenRouter key.")});return u.useEffect(()=>(document.title=Q("Settings"),()=>{document.title=W}),[]),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."})]})}),t&&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:t.role??"community member"}),"."," ",t.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.",t.is_admin?" You can also review submissions and use administrative maintenance tools.":" Submission review and maintenance tools remain admin-only."]})})]}),r&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Chat usage & billing"}),o&&!t?e.jsx("div",{className:"settings-billing-loading",role:"status","aria-live":"polite",children:"Checking account…"}):t?e.jsx("div",{className:"settings-provider-grid",children: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"})]}),(i==null?void 0:i.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."}),n?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 ",a==null?void 0:a.local," ",e.jsxs("span",{"aria-label":"UTC reset time",children:["(",a==null?void 0:a.utc,")"]})]})]}),e.jsx("strong",{children:n.available?`${n.remaining_percent}% left`:"Unavailable"})]}),e.jsx("div",{className:"settings-usage-track",role:"progressbar","aria-label":`${n.remaining_percent}% remaining; resets ${a==null?void 0:a.local}; ${a==null?void 0:a.utc}`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":n.remaining_percent,children:e.jsx("span",{style:{width:`${n.remaining_percent}%`}})}),!n.available&&e.jsxs("p",{className:"settings-limit-note",children:[n.unavailable_reason==="personal_allowance_exhausted"?"Your free monthly allowance is depleted.":`The shared OpenRouter credits are currently unavailable. ${n.remaining_percent}% of your personal allowance remains.`," DeepSeek V4 Flash is temporarily unavailable unless you enable your own key below."]})]}):e.jsx("div",{className:"settings-billing-loading",children:R.isError||n?"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"}),i!=null&&i.connected?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"settings-row-desc",children:["Connected",i.verified_at?` · Last verified ${new Date(i.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(_,{checked:i.fallback_enabled,disabled:w.isPending,onCheckedChange:s=>w.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:C.isPending,onClick:()=>C.mutate(),children:"Disconnect"}),e.jsxs("a",{className:"button",href:Z,target:"_blank",rel:"noreferrer",children:["Revoke or rotate at OpenRouter ",e.jsx(L,{"aria-hidden":"true"})]})]})]}):e.jsxs("form",{onSubmit:s=>{s.preventDefault(),d.trim()&&p.mutate(d.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:d,onChange:s=>N(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:!d.trim()||p.isPending,children:p.isPending?"Verifying…":"Connect key"})})]}),f&&e.jsxs("div",{className:"settings-token-error",children:[e.jsx("p",{children:k==="fresh_auth_required"?"Your account is signed in, but adding or enabling an API key requires a Hugging Face sign-in from the last 15 minutes.":f}),k==="fresh_auth_required"&&e.jsx("div",{className:"settings-billing-actions",children:e.jsx(x,{returnTo:"/settings#openrouter-byok",label:"Re-authenticate with Hugging Face"})})]})]})]})}):e.jsxs("div",{className:"settings-note settings-note-flush",children:[e.jsx("span",{children:"Sign in to use the Papers With Code-funded OpenRouter allowance for research chat."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(x,{returnTo:"/settings"})})]})]}),r&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Chat privacy & retention"}),e.jsx("div",{className:"settings-note settings-note-flush",children:e.jsx("span",{children:"Chats are private and retained until you delete them. You can keep up to 100 active chats and 100 MB of chat data. Archiving removes chats from the active list and frees active-chat quota, but does not delete them. Deleting a chat permanently removes its durable transcript, workspace reference, and any public share link after deletion is verified. You can deliberately share an unlisted snapshot, but no dedicated private-chat export format is currently offered."})})]}),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:z},{value:"light",label:"Light",description:"Always use light mode",icon:G},{value:"dark",label:"Dark",description:"Always use dark mode",icon:V}].map(s=>{const g=s.icon,E=I===s.value;return e.jsxs("button",{type:"button",className:`theme-option ${E?"is-selected":""}`,"aria-pressed":E,onClick:()=>T(s.value),children:[e.jsx(g,{"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(_,{id:"hide-closed-source-evals",checked:S.hide_closed_source_evals,onCheckedChange:s=>{P(!!s)}})]}),!o&&!M&&!t&&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(x,{returnTo:"/settings"})})]})]})]})};export{re as default};
|
assets/{SharedChatView-ZXWbiyaq.js → SharedChatView-DUG-nNC-.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{f as x,u as f,r as u,j as e,b as g}from"./index-
|
|
|
|
| 1 |
+
import{f as x,u as f,r as u,j as e,b as g}from"./index-CnNiludC.js";import{u as j}from"./useQuery-C87uSz9p.js";import{C as v,U as b,A as y}from"./ChatMessage-BqPqQClr.js";import{z as p,p as S,B as N,q as k,E as w}from"./chatSessions-B5wJO74B.js";import"./katex.min-BSBacQyE.js";import"./hover-card-CDhcGwFp.js";import"./github-6FmJETBJ.js";import"./github-CRO5e-fY.js";import"./PaperPreviewLink-DAFhnDhq.js";import"./index-B8BJTSsG.js";import"./file-text-CzoH1JKN.js";import"./chevron-down-Bjm5Iw9B.js";const C=({detail:c})=>{const[i,h]=u.useState(()=>N(c)),s=u.useMemo(()=>{const a={};for(const r of i)for(const t of r.blocks??[])if(t.kind==="tool")for(const n of t.results??[])a[n.route_id]=n;return a},[i]),l=(a,r)=>{h(t=>t.map(n=>{var o;return n.id!==a?n:{...n,blocks:(o=n.blocks)==null?void 0:o.map((d,m)=>m===r&&(d.kind==="reasoning"||d.kind==="tool")?{...d,open:!d.open}:d)}}))};return e.jsx("div",{className:"shared-chat-transcript",children:i.map(a=>a.role==="user"?e.jsx(b,{id:a.id,text:a.text??"",paperMentions:a.paperMentions??[]},a.id):e.jsx(y,{msg:a,papers:s,onToggleBlock:l},a.id))})},I=()=>{const{shareId:c=""}=x(),i=f(),h=g(),s=j({queryKey:["shared-chat",c],queryFn:()=>w(c),retry:(r,t)=>!(t instanceof p&&t.status===404)&&r<1});u.useEffect(()=>{const r=document.title,t=document.head.querySelector('meta[name="robots"]'),n=t==null?void 0:t.content,o=t??document.createElement("meta");return o.name="robots",o.content="noindex,nofollow",t||document.head.appendChild(o),document.title="Shared conversation",()=>{document.title=r,t?t.content=n??"":o.remove()}},[]);const l=r=>{k(r,void 0,{autoSend:!1}),i("/chat")},a=s.error instanceof p&&s.error.status===404;return s.isLoading?e.jsxs("div",{className:"shared-chat-state",role:"status",children:[e.jsx(S,{})," Loading shared conversation…"]}):a?e.jsxs("div",{className:"shared-chat-state shared-chat-not-found",children:[e.jsx("h1",{children:"Shared conversation not found"}),e.jsx("p",{children:"This link is invalid or is no longer available."})]}):s.isError||!s.data?e.jsxs("div",{className:"shared-chat-state",role:"alert",children:[e.jsx("h1",{children:"Couldn’t load this conversation"}),e.jsx("p",{children:"Please check your connection and try again."}),e.jsx("button",{type:"button",onClick:()=>void s.refetch(),children:"Try again"})]}):e.jsxs("div",{className:"shared-chat-page",children:[e.jsxs("div",{className:"shared-chat-heading",children:[e.jsx("h1",{children:"Shared conversation"}),h&&e.jsx("span",{className:"chat-staging-badge",children:"Staging"})]}),e.jsxs("div",{className:"shared-chat-content",children:[e.jsx(C,{detail:s.data},s.data.updated_at),s.data.model_label&&e.jsxs("div",{className:"shared-chat-attribution",children:[e.jsxs("span",{children:["Generated with ",s.data.model_label]}),s.data.model_provider==="huggingface"&&e.jsxs("span",{children:["Powered by ",e.jsx("span",{"aria-hidden":"true",children:"🤗"})," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]}),s.data.model_provider==="openrouter"&&e.jsxs("span",{children:["Powered by ",e.jsx("a",{href:"https://openrouter.ai/",target:"_blank",rel:"noreferrer",children:"OpenRouter"})]})]}),e.jsxs("section",{className:"shared-chat-fresh","aria-labelledby":"shared-chat-fresh-title",children:[e.jsx("h2",{id:"shared-chat-fresh-title",children:"Start a new conversation"}),e.jsx("p",{children:"Your new question starts with an empty context."}),h&&e.jsxs("div",{className:"shared-chat-access-note",role:"note",children:[e.jsx("strong",{children:"Limited staging preview."})," Starting a chat is available only to approved Hugging Face users."]}),e.jsx(v,{onSend:r=>l(r.text),placeholder:"Ask a new research question…"})]})]})]})};export{I as default};
|
assets/SignInToEditDialog-BrFD0zbL.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
| 1 |
-
import{d as ie,r as a,j as e,U as pe,v as xe,V as fe,h as ve,X as je,C as be,W as ye}from"./index-DKw1mejm.js";import{B as M}from"./button-Daj2z1wQ.js";import{I as c,T as Ne}from"./textarea-VTzc6fCU.js";import{D as ne,a as oe,b as le,c as ce,d as de,e as we}from"./dialog-B9CPIS7M.js";import{u as Ie}from"./useMutation-B1PI2Fhg.js";import{s as Se}from"./submissions-DGtBhb0o.js";import{L as De}from"./loader-circle-A0brRFET.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 _e=ie("ImagePlus",[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]);/**
|
| 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 Ye=ie("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);var Ce=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ee=Ce.reduce((i,n)=>{const o=pe(`Primitive.${n}`),s=a.forwardRef((u,f)=>{const{asChild:g,...v}=u,h=g?o:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(h,{...v,ref:f})});return s.displayName=`Primitive.${n}`,{...i,[n]:s}},{}),Pe="Label",me=a.forwardRef((i,n)=>e.jsx(Ee.label,{...i,ref:n,onMouseDown:o=>{var u;o.target.closest("button, input, select, textarea")||((u=i.onMouseDown)==null||u.call(i,o),!o.defaultPrevented&&o.detail>1&&o.preventDefault())}}));me.displayName=Pe;var ue=me;const ke=fe("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),d=a.forwardRef(({className:i,...n},o)=>e.jsx(ue,{ref:o,className:xe(ke(),i),...n}));d.displayName=ue.displayName;const Me=200,Le=2e3,Ae=300,Fe=500,ae=1e3,Re=2*1024*1024,re=["image/jpeg","image/png","image/webp","image/gif"],Be={task:"new_task",method:"new_method",benchmark:"new_benchmark",metric:"new_metric",conference:"new_conference"},Te={task:"e.g. Long-context Retrieval",method:"e.g. Rotary Position Embedding",benchmark:"e.g. ImageNet (ReaL)",metric:"e.g. Top-5 Accuracy",conference:"e.g. International Conference on Machine Learning 2026"},Ge={task:"Briefly describe this task and what it covers.",method:"Briefly describe this method and what it covers.",benchmark:"Briefly describe this benchmark, the task it belongs to, and where it comes from.",metric:"Briefly describe this metric and whether higher or lower is better.",conference:"Briefly describe this conference, including its research focus and edition."};function ze({open:i,onOpenChange:n,paperId:o,kind:s}){const[u,f]=a.useState(""),[g,v]=a.useState(""),[h,L]=a.useState(""),[A,F]=a.useState(""),[R,B]=a.useState(""),[T,G]=a.useState(""),[N,U]=a.useState(""),[x,w]=a.useState(null),[I,H]=a.useState(""),[j,V]=a.useState(""),[S,O]=a.useState(""),[D,X]=a.useState(""),[_,$]=a.useState(""),[C,K]=a.useState(""),[E,Y]=a.useState(""),[P,z]=a.useState(""),[J,W]=a.useState("higher_is_better"),[q,p]=a.useState(""),b=a.useRef(null),{toast:Q}=ve(),y=s,Z=s==="task"||s==="method";a.useEffect(()=>{i||(f(""),v(""),L(""),F(""),B(""),G(""),U(""),w(null),H(""),V(""),O(""),X(""),$(""),K(""),Y(""),z(""),W("higher_is_better"),p(""))},[i]);const ee=t=>{if(!t)return;if(p(""),!re.includes(t.type)){p("Choose a JPEG, PNG, WebP, or GIF image.");return}if(t.size>Re){p("Image must be 2 MB or smaller.");return}const r=new FileReader;r.onload=()=>{if(typeof r.result!="string"){p("Could not read that image.");return}w({file_name:t.name,mime_type:t.type,data_url:r.result})},r.onerror=()=>p("Could not read that image."),r.readAsDataURL(t)},ge=t=>{t.preventDefault(),ee(t.dataTransfer.files[0])},k=Ie({mutationFn:async()=>{const t={name:u.trim()};if(s==="conference")Object.entries({description:g.trim(),year:h?Number(h):void 0,start_date:A,end_date:R,venue:T.trim(),url:N.trim()}).forEach(([r,m])=>{m&&(t[r]=m)});else{const r=g.trim();r&&(t.description=r),Z&&(x&&(t.image=x),I.trim()&&(t.image_credit=I.trim())),s==="method"&&j.trim()&&(t.source_url=j.trim()),s==="task"&&(S.trim()&&(t.keywords=S.trim()),D&&(t.parent_id=Number(D)),_&&(t.area_id=Number(_))),s==="benchmark"&&(t.task_ids=C.split(",").map(m=>Number(m.trim())).filter(m=>Number.isInteger(m)&&m>0)),s==="metric"&&(t.direction=J,t.task_id=Number(E),t.dataset_id=Number(P))}return Se.submit({paper_id:o?parseInt(o):null,edit_type:Be[s],proposed_payload:t})},onSuccess:()=>{Q({title:"Suggestion submitted for review",description:`Thanks! An admin will review your suggested ${y} shortly.`}),n(!1)},onError:t=>{var te,se;const r=t;let m=r.message||`Failed to submit your ${y} suggestion.`;if(r.response)try{const l=JSON.parse(r.response);typeof(l==null?void 0:l.detail)=="string"?m=l.detail:(te=l==null?void 0:l.detail)!=null&&te.message?m=`${l.detail.message} See ${l.detail.help||"/rate-limits"} for help.`:Array.isArray(l==null?void 0:l.detail)&&((se=l.detail[0])!=null&&se.msg)&&(m=l.detail[0].msg)}catch{m=r.response}Q({title:"Could not submit suggestion",description:m,variant:"destructive"})}}),he=u.trim().length>0&&(s==="task"||s==="method"&&!!j.trim()||s==="conference"&&!!h&&!!N.trim()||s==="benchmark"&&!!C.trim()&&!!g.trim()||s==="metric"&&!!E&&!!P&&!!g.trim());return e.jsx(ne,{open:i,onOpenChange:n,children:e.jsxs(oe,{className:"max-w-lg max-h-[90vh] overflow-y-auto",children:[e.jsxs(le,{children:[e.jsxs(ce,{children:["Suggest a new ",y]}),e.jsxs(de,{children:["Propose a ",y," that isn't in the list yet. An admin will review your suggestion before it's added."]})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"suggest-name",children:"Name"}),e.jsx(c,{id:"suggest-name",value:u,maxLength:Me,placeholder:Te[s],onChange:t=>f(t.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(d,{htmlFor:"suggest-description",children:["Description",s==="task"||s==="method"||s==="conference"?" (optional)":""]}),e.jsx(Ne,{id:"suggest-description",value:g,maxLength:Le,placeholder:Ge[s],onChange:t=>v(t.target.value)})]}),s==="task"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"suggest-keywords",children:"Keywords (optional)"}),e.jsx(c,{id:"suggest-keywords",value:S,onChange:t=>O(t.target.value),placeholder:"comma-separated matching terms"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(c,{type:"number",min:"1",value:D,onChange:t=>X(t.target.value),placeholder:"Parent task ID (optional)"}),e.jsx(c,{type:"number",min:"1",value:_,onChange:t=>$(t.target.value),placeholder:"Area ID (optional)"})]})]}),s==="benchmark"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"suggest-task-ids",children:"Intended task IDs"}),e.jsx(c,{id:"suggest-task-ids",value:C,onChange:t=>K(t.target.value),placeholder:"e.g. 9, 14"})]}),s==="metric"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(d,{children:"Intended leaderboard"}),e.jsxs("select",{className:"w-full rounded-md border bg-background p-2",value:J,onChange:t=>W(t.target.value),children:[e.jsx("option",{value:"higher_is_better",children:"Higher is better"}),e.jsx("option",{value:"lower_is_better",children:"Lower is better"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(c,{type:"number",min:"1",value:E,onChange:t=>Y(t.target.value),placeholder:"Task ID"}),e.jsx(c,{type:"number",min:"1",value:P,onChange:t=>z(t.target.value),placeholder:"Benchmark ID"})]})]}),Z&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{children:"Image (optional)"}),e.jsx("input",{ref:b,className:"sr-only",type:"file",accept:re.join(","),onChange:t=>{var r;return ee((r=t.target.files)==null?void 0:r[0])}}),x?e.jsxs("div",{className:"relative overflow-hidden rounded-md border border-border bg-muted/30",children:[e.jsx("img",{src:x.data_url,alt:"Selected suggestion",className:"max-h-48 w-full object-contain"}),e.jsxs(M,{type:"button",variant:"secondary",size:"sm",className:"absolute right-2 top-2 h-8 px-2",onClick:()=>{w(null),b.current&&(b.current.value="")},children:[e.jsx(je,{className:"mr-1 h-4 w-4"}),"Remove"]}),e.jsx("div",{className:"truncate border-t border-border px-3 py-2 text-xs text-muted-foreground",children:x.file_name})]}):e.jsxs("button",{type:"button",className:"flex w-full flex-col items-center justify-center rounded-md border border-dashed border-border px-4 py-6 text-center text-sm text-muted-foreground transition-colors hover:border-foreground/50 hover:text-foreground",onClick:()=>{var t;return(t=b.current)==null?void 0:t.click()},onDragOver:t=>t.preventDefault(),onDrop:ge,children:[e.jsx(_e,{className:"mb-2 h-6 w-6"}),e.jsx("span",{children:"Drop an image here, or click to choose one"}),e.jsx("span",{className:"mt-1 text-xs",children:"JPEG, PNG, WebP, or GIF · max 2 MB"})]}),q&&e.jsx("p",{className:"text-sm text-destructive",role:"alert",children:q})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"suggest-image-source",children:"Image source (optional)"}),e.jsx(c,{id:"suggest-image-source",value:I,maxLength:ae,placeholder:"Creator, publication, or source URL",onChange:t=>H(t.target.value)})]}),s==="method"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"suggest-method-source",children:"Source URL (optional)"}),e.jsx(c,{id:"suggest-method-source",value:j,maxLength:ae,placeholder:"https://arxiv.org/abs/...",onChange:t=>V(t.target.value)})]})]}),s==="conference"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"suggest-year",children:"Edition year"}),e.jsx(c,{id:"suggest-year",type:"number",min:"1900",max:"2200",value:h,placeholder:"2026",onChange:t=>L(t.target.value)})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(d,{htmlFor:"suggest-start-date",children:"Start date (optional)"}),e.jsx(c,{id:"suggest-start-date",type:"date",value:A,onChange:t=>F(t.target.value)})]}),e.jsxs("div",{children:[e.jsx(d,{htmlFor:"suggest-end-date",children:"End date (optional)"}),e.jsx(c,{id:"suggest-end-date",type:"date",value:R,onChange:t=>B(t.target.value)})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"suggest-venue",children:"Venue (optional)"}),e.jsx(c,{id:"suggest-venue",value:T,maxLength:Ae,placeholder:"e.g. Vancouver Convention Centre, Canada",onChange:t=>G(t.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"suggest-url",children:"URL (optional)"}),e.jsx(c,{id:"suggest-url",type:"url",inputMode:"url",value:N,maxLength:Fe,placeholder:"https://example.org/conference",onChange:t=>U(t.target.value)})]})]})]}),e.jsxs(we,{children:[e.jsx(M,{variant:"outline",onClick:()=>n(!1),children:"Cancel"}),e.jsx(M,{onClick:()=>k.mutate(),disabled:k.isPending||!he,children:k.isPending?e.jsxs(e.Fragment,{children:[e.jsx(De,{className:"w-4 h-4 mr-2 animate-spin"}),"Submitting..."]}):e.jsxs(e.Fragment,{children:[e.jsx(be,{className:"w-4 h-4 mr-2"}),"Submit suggestion"]})})]})]})})}function Je({open:i,onOpenChange:n,sectionLabel:o,returnTo:s,taxonomySuggestion:u=!1}){return e.jsx(ne,{open:i,onOpenChange:n,children:e.jsxs(oe,{className:"max-w-md",children:[e.jsxs(le,{children:[e.jsxs(ce,{children:["Sign in to ",u?"suggest":"edit"," ",o]}),e.jsx(de,{children:u?"Sign in with your Hugging Face account so an admin can review your suggestion.":"Anyone can suggest edits to a paper page. Sign in with your Hugging Face account first so an admin can review your submission."})]}),e.jsx("div",{className:"flex justify-center pt-2",children:e.jsx(ye,{returnTo:s})})]})})}export{d as L,Ye as P,ze as S,Je as a};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/SignInToEditDialog-ByW2mx_A.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import{d as ne,r as a,j as e,V as ve,v as be,W as je,h as fe,w as v,Y as b,X as ye,C as Ne,Z as we}from"./index-CnNiludC.js";import{B as L}from"./button-Cb-e5tHG.js";import{I as d,T as Ie}from"./textarea-DuxG42Qe.js";import{D as oe,a as le,b as ce,c as de,d as me,e as Se}from"./dialog-COYv9g-7.js";import{u as _e}from"./useMutation-CZOEaG9X.js";import{L as De}from"./loader-circle-3AJg82rJ.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 Ce=ne("ImagePlus",[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]);/**
|
| 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 Ke=ne("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);var Ee=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ke=Ee.reduce((n,o)=>{const l=ve(`Primitive.${o}`),s=a.forwardRef((i,j)=>{const{asChild:g,...f}=i,p=g?l:o;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(p,{...f,ref:j})});return s.displayName=`Primitive.${o}`,{...n,[o]:s}},{}),Pe="Label",ue=a.forwardRef((n,o)=>e.jsx(ke.label,{...n,ref:o,onMouseDown:l=>{var i;l.target.closest("button, input, select, textarea")||((i=n.onMouseDown)==null||i.call(n,l),!l.defaultPrevented&&l.detail>1&&l.preventDefault())}}));ue.displayName=Pe;var ge=ue;const Me=je("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),m=a.forwardRef(({className:n,...o},l)=>e.jsx(ge,{ref:l,className:be(Me(),n),...o}));m.displayName=ge.displayName;const Le=200,Ae=2e3,Fe=300,Re=500,re=1e3,Be=2*1024*1024,ie=["image/jpeg","image/png","image/webp","image/gif"],Te={task:"e.g. Long-context Retrieval",method:"e.g. Rotary Position Embedding",benchmark:"e.g. ImageNet (ReaL)",metric:"e.g. Top-5 Accuracy",conference:"e.g. International Conference on Machine Learning 2026"},Ge={task:"Briefly describe this task and what it covers.",method:"Briefly describe this method and what it covers.",benchmark:"Briefly describe this benchmark, the task it belongs to, and where it comes from.",metric:"Briefly describe this metric and whether higher or lower is better.",conference:"Briefly describe this conference, including its research focus and edition."};function Ye({open:n,onOpenChange:o,paperId:l,kind:s}){const[i,j]=a.useState(""),[g,f]=a.useState(""),[p,A]=a.useState(""),[F,R]=a.useState(""),[B,T]=a.useState(""),[G,H]=a.useState(""),[w,U]=a.useState(""),[x,I]=a.useState(null),[S,V]=a.useState(""),[_,X]=a.useState(""),[$,O]=a.useState(""),[D,K]=a.useState(""),[C,Y]=a.useState(""),[E,z]=a.useState(""),[k,J]=a.useState(""),[P,W]=a.useState(""),[Z,q]=a.useState("higher_is_better"),[Q,h]=a.useState(""),y=a.useRef(null),{toast:ee}=fe(),N=s,he=s==="task"||s==="method";a.useEffect(()=>{n||(j(""),f(""),A(""),R(""),T(""),H(""),U(""),I(null),V(""),X(""),O(""),K(""),Y(""),z(""),J(""),W(""),q("higher_is_better"),h(""))},[n]);const te=t=>{if(!t)return;if(h(""),!ie.includes(t.type)){h("Choose a JPEG, PNG, WebP, or GIF image.");return}if(t.size>Be){h("Image must be 2 MB or smaller.");return}const r=new FileReader;r.onload=()=>{if(typeof r.result!="string"){h("Could not read that image.");return}I({file_name:t.name,mime_type:t.type,data_url:r.result})},r.onerror=()=>h("Could not read that image."),r.readAsDataURL(t)},pe=t=>{t.preventDefault(),te(t.dataTransfer.files[0])},M=_e({mutationFn:async()=>{const t=l?parseInt(l):null,r=g.trim()||void 0;switch(s){case"task":return v.submit(b(t,"new_task",{name:i.trim(),description:r,image:x??void 0,image_credit:S.trim()||void 0,keywords:$.trim()||void 0,parent_id:D?Number(D):void 0,area_id:C?Number(C):void 0}));case"method":return v.submit(b(t,"new_method",{name:i.trim(),description:r,image:x??void 0,image_credit:S.trim()||void 0,source_url:_.trim()||void 0}));case"benchmark":return v.submit(b(t,"new_benchmark",{name:i.trim(),description:g.trim(),task_ids:E.split(",").map(u=>Number(u.trim())).filter(u=>Number.isInteger(u)&&u>0)}));case"metric":return v.submit(b(t,"new_metric",{name:i.trim(),description:g.trim(),direction:Z==="lower_is_better"?"lower_is_better":"higher_is_better",task_id:Number(k),dataset_id:Number(P)}));case"conference":return v.submit(b(t,"new_conference",{name:i.trim(),description:r,year:Number(p),start_date:F||void 0,end_date:B||void 0,venue:G.trim()||void 0,url:w.trim()}))}},onSuccess:()=>{ee({title:"Suggestion submitted for review",description:`Thanks! An admin will review your suggested ${N} shortly.`}),o(!1)},onError:t=>{var se,ae;const r=t;let u=r.message||`Failed to submit your ${N} suggestion.`;if(r.response)try{const c=JSON.parse(r.response);typeof(c==null?void 0:c.detail)=="string"?u=c.detail:(se=c==null?void 0:c.detail)!=null&&se.message?u=`${c.detail.message} See ${c.detail.help||"/rate-limits"} for help.`:Array.isArray(c==null?void 0:c.detail)&&((ae=c.detail[0])!=null&&ae.msg)&&(u=c.detail[0].msg)}catch{u=r.response}ee({title:"Could not submit suggestion",description:u,variant:"destructive"})}}),xe=i.trim().length>0&&(s==="task"||s==="method"&&!!_.trim()||s==="conference"&&!!p&&!!w.trim()||s==="benchmark"&&!!E.trim()&&!!g.trim()||s==="metric"&&!!k&&!!P&&!!g.trim());return e.jsx(oe,{open:n,onOpenChange:o,children:e.jsxs(le,{className:"max-w-lg max-h-[90vh] overflow-y-auto",children:[e.jsxs(ce,{children:[e.jsxs(de,{children:["Suggest a new ",N]}),e.jsxs(me,{children:["Propose a ",N," that isn't in the list yet. An admin will review your suggestion before it's added."]})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-name",children:"Name"}),e.jsx(d,{id:"suggest-name",value:i,maxLength:Le,placeholder:Te[s],onChange:t=>j(t.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(m,{htmlFor:"suggest-description",children:["Description",s==="task"||s==="method"||s==="conference"?" (optional)":""]}),e.jsx(Ie,{id:"suggest-description",value:g,maxLength:Ae,placeholder:Ge[s],onChange:t=>f(t.target.value)})]}),s==="task"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-keywords",children:"Keywords (optional)"}),e.jsx(d,{id:"suggest-keywords",value:$,onChange:t=>O(t.target.value),placeholder:"comma-separated matching terms"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(d,{type:"number",min:"1",value:D,onChange:t=>K(t.target.value),placeholder:"Parent task ID (optional)"}),e.jsx(d,{type:"number",min:"1",value:C,onChange:t=>Y(t.target.value),placeholder:"Area ID (optional)"})]})]}),s==="benchmark"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-task-ids",children:"Intended task IDs"}),e.jsx(d,{id:"suggest-task-ids",value:E,onChange:t=>z(t.target.value),placeholder:"e.g. 9, 14"})]}),s==="metric"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(m,{children:"Intended leaderboard"}),e.jsxs("select",{className:"w-full rounded-md border bg-background p-2",value:Z,onChange:t=>q(t.target.value),children:[e.jsx("option",{value:"higher_is_better",children:"Higher is better"}),e.jsx("option",{value:"lower_is_better",children:"Lower is better"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(d,{type:"number",min:"1",value:k,onChange:t=>J(t.target.value),placeholder:"Task ID"}),e.jsx(d,{type:"number",min:"1",value:P,onChange:t=>W(t.target.value),placeholder:"Benchmark ID"})]})]}),he&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{children:"Image (optional)"}),e.jsx("input",{ref:y,className:"sr-only",type:"file",accept:ie.join(","),onChange:t=>{var r;return te((r=t.target.files)==null?void 0:r[0])}}),x?e.jsxs("div",{className:"relative overflow-hidden rounded-md border border-border bg-muted/30",children:[e.jsx("img",{src:x.data_url,alt:"Selected suggestion",className:"max-h-48 w-full object-contain"}),e.jsxs(L,{type:"button",variant:"secondary",size:"sm",className:"absolute right-2 top-2 h-8 px-2",onClick:()=>{I(null),y.current&&(y.current.value="")},children:[e.jsx(ye,{className:"mr-1 h-4 w-4"}),"Remove"]}),e.jsx("div",{className:"truncate border-t border-border px-3 py-2 text-xs text-muted-foreground",children:x.file_name})]}):e.jsxs("button",{type:"button",className:"flex w-full flex-col items-center justify-center rounded-md border border-dashed border-border px-4 py-6 text-center text-sm text-muted-foreground transition-colors hover:border-foreground/50 hover:text-foreground",onClick:()=>{var t;return(t=y.current)==null?void 0:t.click()},onDragOver:t=>t.preventDefault(),onDrop:pe,children:[e.jsx(Ce,{className:"mb-2 h-6 w-6"}),e.jsx("span",{children:"Drop an image here, or click to choose one"}),e.jsx("span",{className:"mt-1 text-xs",children:"JPEG, PNG, WebP, or GIF · max 2 MB"})]}),Q&&e.jsx("p",{className:"text-sm text-destructive",role:"alert",children:Q})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-image-source",children:"Image source (optional)"}),e.jsx(d,{id:"suggest-image-source",value:S,maxLength:re,placeholder:"Creator, publication, or source URL",onChange:t=>V(t.target.value)})]}),s==="method"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-method-source",children:"Source URL (optional)"}),e.jsx(d,{id:"suggest-method-source",value:_,maxLength:re,placeholder:"https://arxiv.org/abs/...",onChange:t=>X(t.target.value)})]})]}),s==="conference"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-year",children:"Edition year"}),e.jsx(d,{id:"suggest-year",type:"number",min:"1900",max:"2200",value:p,placeholder:"2026",onChange:t=>A(t.target.value)})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(m,{htmlFor:"suggest-start-date",children:"Start date (optional)"}),e.jsx(d,{id:"suggest-start-date",type:"date",value:F,onChange:t=>R(t.target.value)})]}),e.jsxs("div",{children:[e.jsx(m,{htmlFor:"suggest-end-date",children:"End date (optional)"}),e.jsx(d,{id:"suggest-end-date",type:"date",value:B,onChange:t=>T(t.target.value)})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-venue",children:"Venue (optional)"}),e.jsx(d,{id:"suggest-venue",value:G,maxLength:Fe,placeholder:"e.g. Vancouver Convention Centre, Canada",onChange:t=>H(t.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"suggest-url",children:"URL (optional)"}),e.jsx(d,{id:"suggest-url",type:"url",inputMode:"url",value:w,maxLength:Re,placeholder:"https://example.org/conference",onChange:t=>U(t.target.value)})]})]})]}),e.jsxs(Se,{children:[e.jsx(L,{variant:"outline",onClick:()=>o(!1),children:"Cancel"}),e.jsx(L,{onClick:()=>M.mutate(),disabled:M.isPending||!xe,children:M.isPending?e.jsxs(e.Fragment,{children:[e.jsx(De,{className:"w-4 h-4 mr-2 animate-spin"}),"Submitting..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Ne,{className:"w-4 h-4 mr-2"}),"Submit suggestion"]})})]})]})})}function ze({open:n,onOpenChange:o,sectionLabel:l,returnTo:s,taxonomySuggestion:i=!1}){return e.jsx(oe,{open:n,onOpenChange:o,children:e.jsxs(le,{className:"max-w-md",children:[e.jsxs(ce,{children:[e.jsxs(de,{children:["Sign in to ",i?"suggest":"edit"," ",l]}),e.jsx(me,{children:i?"Sign in with your Hugging Face account so an admin can review your suggestion.":"Anyone can suggest edits to a paper page. Sign in with your Hugging Face account first so an admin can review your submission."})]}),e.jsx("div",{className:"flex justify-center pt-2",children:e.jsx(we,{returnTo:s})})]})})}export{m as L,Ke as P,Ye as S,ze as a};
|
assets/{StagingAccessRequestView-DaUzokUN.js → StagingAccessRequestView-DPg61I7V.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{g,R as t,j as e,
|
|
|
|
| 1 |
+
import{g,R as t,j as e,Z as p,e as j}from"./index-CnNiludC.js";import{C as x}from"./circle-check-BO6NSWAF.js";const b=()=>{const{user:s,isLoading:l}=g(),[o,d]=t.useState(!1),[c,i]=t.useState(!1),[n,u]=t.useState(null),h=async m=>{m.preventDefault(),i(!0),u(null);try{const a=await fetch(j("/api/v1/staging-access-request"),{method:"POST",credentials:"include"});if(!a.ok){const r=await a.json().catch(()=>null);throw new Error((r==null?void 0:r.detail)||"Could not submit your request. Please try again.")}d(!0)}catch(a){u(a instanceof Error?a.message:"Could not submit your request.")}finally{i(!1)}};return e.jsx("main",{className:"access-request-page",children:e.jsxs("section",{className:"access-request-card","aria-labelledby":"access-request-title",children:[e.jsxs("a",{className:"access-request-brand",href:"https://paperswithcode.co",children:[e.jsx("span",{className:"brand-mark","aria-hidden":"true"}),e.jsxs("span",{className:"brand-name",children:["Papers ",e.jsx("em",{children:"with"})," Code"]})]}),o?e.jsxs("div",{className:"access-request-success",role:"status",children:[e.jsx(x,{size:34,strokeWidth:1.6,"aria-hidden":"true"}),e.jsx("h1",{id:"access-request-title",children:"Request received"}),e.jsxs("p",{children:["Thanks, @",s==null?void 0:s.username,". We’ll review your contributor access request."]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"access-request-heading",children:[e.jsx("p",{className:"access-request-eyebrow",children:"Staging preview"}),e.jsx("h1",{id:"access-request-title",children:"Request access"}),e.jsx("p",{children:"This preview is limited to project contributors. Send us your verified Hugging Face username and email address to request access."})]}),l?e.jsx("p",{className:"access-request-status",role:"status",children:"Checking your Hugging Face account…"}):s?e.jsxs("form",{className:"access-request-form",onSubmit:h,children:[e.jsx("label",{htmlFor:"hf-username",children:"Hugging Face username"}),e.jsxs("div",{className:"access-request-input-wrap",children:[e.jsx("span",{"aria-hidden":"true",children:"@"}),e.jsx("input",{id:"hf-username",name:"hf_username",value:s.username,readOnly:!0,autoComplete:"username"})]}),e.jsxs("p",{className:"access-request-verified",children:["Username and email verified through Hugging Face sign-in. See our"," ",e.jsx("a",{href:"https://paperswithcode.co/privacy",children:"Privacy Policy"}),"."]}),n&&e.jsx("p",{className:"access-request-error",role:"alert",children:n}),e.jsx("button",{className:"access-request-submit",type:"submit",disabled:c,children:c?"Sending…":"Request access"})]}):e.jsxs("div",{className:"access-request-signin",children:[e.jsx("p",{children:"Sign in first so we can verify the account you’re requesting access for."}),e.jsx(p,{returnTo:"/request-access",label:"Sign in with Hugging Face",collectEmail:!0})]})]})]})})};export{b as default};
|
assets/SubmissionsDashboard-CkociQ8D.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
| 1 |
-
var ge=s=>{throw TypeError(s)};var se=(s,t,i)=>t.has(s)||ge("Cannot "+i);var f=(s,t,i)=>(se(s,t,"read from private field"),i?i.call(s):t.get(s)),R=(s,t,i)=>t.has(s)?ge("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,i),y=(s,t,i,n)=>(se(s,t,"write to private field"),n?n.call(s,i):t.set(s,i),i),C=(s,t,i)=>(se(s,t,"access private method"),i);import{ai as Oe,aj as ie,ak as Me,al as Fe,k as Se,r as B,am as Ie,d as Qe,j as e,R as w,v as Q,M as qe,g as Le,h as Ee,p as Ue,an as De,ao as $e,ap as Te}from"./index-DKw1mejm.js";import{Q as Re,b as Be,c as He,e as ze,d as Je,f as Ke,s as be,g as Ge,h as We,u as je}from"./useQuery-DkXMNuGa.js";import{u as xe}from"./useMutation-B1PI2Fhg.js";import{c as U}from"./catalog-Cs0CZbdz.js";import{s as T}from"./safeExternalHref-CkBrsh84.js";import{s as z}from"./submissions-DGtBhb0o.js";import{R as Ye,S as Ve,C as Xe}from"./shield-alert-BbMZdJiA.js";import{L as J}from"./loader-circle-A0brRFET.js";import{C as Ze}from"./circle-check-TyHgfYGZ.js";function ve(s,t){const i=new Set(t);return s.filter(n=>!i.has(n))}function Pe(s,t,i){const n=s.slice(0);return n[t]=i,n}var D,S,$,L,E,I,K,G,W,Y,_,ne,re,Ce,ae,le,ce,we,es=(we=class extends Oe{constructor(t,i,n){super();R(this,_);R(this,D);R(this,S);R(this,$);R(this,L);R(this,E);R(this,I);R(this,K);R(this,G);R(this,W);R(this,Y,[]);y(this,D,t),y(this,L,n),y(this,$,[]),y(this,E,[]),y(this,S,[]),this.setQueries(i)}onSubscribe(){this.listeners.size===1&&f(this,E).forEach(t=>{t.subscribe(i=>{C(this,_,le).call(this,t,i)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,f(this,E).forEach(t=>{t.destroy()})}setQueries(t,i){y(this,$,t),y(this,L,i),ie.batch(()=>{const n=f(this,E),r=C(this,_,ae).call(this,f(this,$));r.forEach(a=>a.observer.setOptions(a.defaultedQueryOptions));const l=r.map(a=>a.observer),c=l.map(a=>a.getCurrentResult()),u=n.length!==l.length,m=l.some((a,o)=>a!==n[o]),b=u||m,x=b?!0:c.some((a,o)=>{const d=f(this,S)[o];return!d||!Me(a,d)});!b&&!x||(b&&(y(this,Y,r),y(this,E,l)),y(this,S,c),this.hasListeners()&&(b&&(ve(n,l).forEach(a=>{a.destroy()}),ve(l,n).forEach(a=>{a.subscribe(o=>{C(this,_,le).call(this,a,o)})})),C(this,_,ce).call(this)))})}getCurrentResult(){return f(this,S)}getQueries(){return f(this,E).map(t=>t.getCurrentQuery())}getObservers(){return f(this,E)}getOptimisticResult(t,i){const n=C(this,_,ae).call(this,t),r=n.map(c=>c.observer.getOptimisticResult(c.defaultedQueryOptions)),l=n.map(c=>c.defaultedQueryOptions.queryHash);return[r,c=>C(this,_,re).call(this,c??r,i,l),()=>C(this,_,ne).call(this,r,n)]}},D=new WeakMap,S=new WeakMap,$=new WeakMap,L=new WeakMap,E=new WeakMap,I=new WeakMap,K=new WeakMap,G=new WeakMap,W=new WeakMap,Y=new WeakMap,_=new WeakSet,ne=function(t,i){return i.map((n,r)=>{const l=t[r];return n.defaultedQueryOptions.notifyOnChangeProps?l:n.observer.trackResult(l,c=>{i.forEach(u=>{u.observer.trackProp(c)})})})},re=function(t,i,n){if(i){const r=f(this,W),l=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((c,u)=>c!==r[u]));return(!f(this,I)||f(this,S)!==f(this,G)||l||i!==f(this,K))&&(y(this,K,i),y(this,G,f(this,S)),n!==void 0&&y(this,W,n),y(this,I,Fe(f(this,I),i(t)))),f(this,I)}return t},Ce=function(){var t;return((t=f(this,L))==null?void 0:t.combine)!==void 0&&f(this,E).some((i,n)=>{var r;return i.options.suspense&&((r=f(this,S)[n])==null?void 0:r.data)===void 0})},ae=function(t){const i=new Map;f(this,E).forEach(r=>{const l=r.options.queryHash;if(!l)return;const c=i.get(l);c?c.push(r):i.set(l,[r])});const n=[];return t.forEach(r=>{var m;const l=f(this,D).defaultQueryOptions(r),u=((m=i.get(l.queryHash))==null?void 0:m.shift())??new Re(f(this,D),l);n.push({defaultedQueryOptions:l,observer:u})}),n},le=function(t,i){const n=f(this,E).indexOf(t);n!==-1&&(y(this,S,Pe(f(this,S),n,i)),C(this,_,ce).call(this))},ce=function(){var t;if(this.hasListeners()){const i=C(this,_,ne).call(this,f(this,S),f(this,Y)),n=C(this,_,Ce).call(this),r=f(this,I),l=n?r:C(this,_,re).call(this,i,(t=f(this,L))==null?void 0:t.combine);(n||r!==l)&&ie.batch(()=>{this.listeners.forEach(c=>{c(f(this,S))})})}},we);function P({queries:s,...t},i){const n=Se(),r=Be(),l=He(),c=B.useMemo(()=>s.map(h=>{const k=n.defaultQueryOptions(h);return k._optimisticResults=r?"isRestoring":"optimistic",k}),[s,n,r]);c.forEach(h=>{ze(h);const k=n.getQueryCache().get(h.queryHash);Je(h,l,k)}),Ke(l);const[u]=B.useState(()=>new es(n,c,t)),[m,b,x]=u.getOptimisticResult(c,t.combine),a=!r&&t.subscribed!==!1;B.useSyncExternalStore(B.useCallback(h=>a?u.subscribe(ie.batchCalls(h)):Ie,[u,a]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),B.useEffect(()=>{u.setQueries(c,t)},[c,t,u]);const d=m.some((h,k)=>be(c[k],h))?m.flatMap((h,k)=>{const j=c[k];if(j&&be(j,h)){const q=new Re(n,j);return Ge(j,q,l)}return[]}):[];if(d.length>0)throw Promise.all(d);const p=m.find((h,k)=>{const j=c[k];return j&&We({result:h,errorResetBoundary:l,throwOnError:j.throwOnError,query:n.getQueryCache().get(j.queryHash),suspense:j.suspense})});if(p!=null&&p.error)throw p.error;return b(x())}/**
|
| 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 ss=Qe("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]),M=s=>s&&typeof s=="object"&&!Array.isArray(s)?s:{},Ne=s=>Array.isArray(s)?s.map(t=>{const i=M(t),n=Number(i.id);return Number.isFinite(n)?{id:n,name:typeof i.name=="string"?i.name:`#${n}`,slug:typeof i.slug=="string"?i.slug:void 0}:null}).filter(t=>t!==null):[],_e=s=>Array.isArray(s)?s.map(Number).filter(t=>Number.isFinite(t)):[],X=s=>Array.isArray(s)?s.map(t=>{const i=M(t);return typeof i.url!="string"?null:{url:i.url,is_official:!!i.is_official}}).filter(t=>!!t):[],ts=s=>Array.isArray(s)?s.map(t=>M(t)):[],is=s=>Array.isArray(s)?s.map(t=>M(t)):[],ns=s=>s.replace(/_/g," ");function rs({currentPayload:s,proposedPayload:t}){const[i,n]=w.useState(!1);return e.jsxs("div",{className:"submission-raw-toggle",children:[e.jsx("button",{type:"button",className:"raw-json-btn",onClick:()=>n(r=>!r),children:i?"Hide raw JSON":"Show raw JSON"}),i&&e.jsxs("div",{className:"submission-json-grid",children:[e.jsx(oe,{title:"Current payload",value:s??{}}),e.jsx(oe,{title:"Proposed payload",value:t})]})]})}function oe({title:s,value:t}){return e.jsxs("div",{className:"submission-json-block",children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("pre",{children:JSON.stringify(t,null,2)})]})}function ye({currentItems:s,proposedIds:t,queryPrefix:i,fetchEntity:n}){const r=w.useMemo(()=>Array.from(new Set([...s.map(o=>o.id),...t])).sort((o,d)=>o-d),[s,t]),l=P({queries:r.map(o=>({queryKey:[i,String(o)],queryFn:()=>n(String(o)),staleTime:5*60*1e3}))}),c=w.useMemo(()=>{const o=new Map;return s.forEach(d=>o.set(d.id,d.name)),l.forEach(d=>{const p=d.data;if(!p)return;const h=Number(p.id);Number.isFinite(h)&&o.set(h,p.name)}),o},[s,l]),u=new Set(s.map(o=>o.id)),m=new Set(t),b=r.filter(o=>u.has(o)&&!m.has(o)),x=r.filter(o=>!u.has(o)&&m.has(o)),a=(o,d)=>{const p=d==="current"&&b.includes(o),h=d==="proposed"&&x.includes(o);return e.jsx("span",{className:Q("submission-diff-pill",p&&"removed",h&&"added"),children:c.get(o)??`#${o}`},o)};return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(v,{title:"Currently tagged",children:s.length>0?s.map(o=>a(o.id,"current")):e.jsx(N,{children:"No current tags"})}),e.jsx(v,{title:"Will be tagged",children:t.length>0?t.map(o=>a(o,"proposed")):e.jsx(N,{children:"No proposed tags"})})]})}function de({label:s,currentItems:t,proposedItems:i}){const n=new Map(t.map(c=>[c.url,c])),r=new Map(i.map(c=>[c.url,c])),l=Array.from(new Set([...n.keys(),...r.keys()])).sort();return l.length===0?e.jsxs(N,{children:["No ",s," in this submission."]}):e.jsx("div",{className:"submission-url-list",children:l.map(c=>{var o;const u=n.get(c),m=r.get(c),b=!u&&m,x=u&&!m,a=u&&m&&u.is_official!==m.is_official;return e.jsx("div",{className:Q("submission-url-row",b&&"added",x&&"removed",a&&"changed"),children:e.jsxs("div",{className:"submission-url-content",children:[e.jsx("a",{href:T(c)??void 0,target:"_blank",rel:"noopener noreferrer",className:Q("submission-url-link",x&&"removed"),children:c}),b&&e.jsx("span",{className:"submission-pill status approved",children:"Added"}),x&&e.jsx("span",{className:"submission-pill status rejected",children:"Removed"}),a&&e.jsxs("span",{className:"submission-pill changed",children:["Official: ",String(u.is_official)," ","->"," ",String(m.is_official)]}),((o=m??u)==null?void 0:o.is_official)&&e.jsx("span",{className:"submission-pill",children:"Official"})]})},c)})})}function as({currentPayload:s,proposedPayload:t}){const i=ts(M(s).evaluations),n=is(t.operations),r=w.useMemo(()=>{const a=new Set;return i.forEach(o=>{o.task_id&&a.add(Number(o.task_id))}),n.forEach(o=>{const d=o.data;d!=null&&d.task_id&&a.add(Number(d.task_id))}),Array.from(a).filter(o=>Number.isFinite(o))},[i,n]),l=w.useMemo(()=>{const a=new Set;return i.forEach(o=>{o.dataset_id&&a.add(Number(o.dataset_id))}),n.forEach(o=>{const d=o.data;d!=null&&d.dataset_id&&a.add(Number(d.dataset_id))}),Array.from(a).filter(o=>Number.isFinite(o))},[i,n]),c=P({queries:r.map(a=>({queryKey:["task",String(a)],queryFn:()=>U.getTask(String(a)),staleTime:5*60*1e3}))}),u=P({queries:l.map(a=>({queryKey:["dataset",String(a)],queryFn:()=>U.getDataset(String(a)),staleTime:5*60*1e3}))}),m=w.useMemo(()=>{const a=new Map;return c.forEach(o=>{const d=o.data;if(!d)return;const p=Number(d.id);Number.isFinite(p)&&a.set(p,d.name)}),a},[c]),b=w.useMemo(()=>{const a=new Map;return u.forEach(o=>{const d=o.data;if(!d)return;const p=Number(d.id);Number.isFinite(p)&&a.set(p,d.name)}),a},[u]),x=new Map(i.filter(a=>a.id!=null).map(a=>[Number(a.id),a]));return n.length===0?e.jsx(N,{children:"No evaluation operations in this payload."}):e.jsx("div",{className:"submission-eval-list",children:n.map((a,o)=>{const d=a.evaluation_id?x.get(a.evaluation_id):void 0,h=(a.op==="update"?{...d,...a.data}:a.data??d)??{};return e.jsxs("div",{className:"submission-eval-op",children:[e.jsxs("div",{className:"submission-eval-op-header",children:[e.jsx("span",{className:Q("submission-pill status",a.op==="create"&&"approved",a.op==="update"&&"changed",a.op==="delete"&&"rejected"),children:a.op??"unknown"}),a.evaluation_id&&e.jsxs("span",{className:"submission-meta",children:["Evaluation #",a.evaluation_id]})]}),a.op&&["create","update","delete"].includes(a.op)?e.jsx(ls,{evaluation:h,taskNames:m,datasetNames:b}):e.jsx(oe,{title:"Unsupported operation",value:a})]},`${a.op}-${a.evaluation_id??o}`)})})}function ls({evaluation:s,taskNames:t,datasetNames:i}){const n=s.task_id?Number(s.task_id):void 0,r=s.dataset_id?Number(s.dataset_id):void 0,l=s.metrics??{};return e.jsxs("div",{className:"submission-eval-fields",children:[e.jsx(F,{label:"Task",value:n?t.get(n)??`#${n}`:null}),e.jsx(F,{label:"Dataset",value:r?i.get(r)??`#${r}`:null}),e.jsx(F,{label:"Model",value:s.model_name||null}),e.jsx(F,{label:"Harness",value:s.harness||null}),e.jsx(F,{label:"Best rank",value:s.best_rank??null}),e.jsx(F,{label:"Parameters",value:s.num_parameters??null}),e.jsx(F,{label:"HF model URL",value:s.hf_model_url||null}),e.jsx(F,{label:"Open source",value:s.is_open===void 0?null:s.is_open?"Yes":"No"}),e.jsxs("div",{className:"submission-eval-metrics",children:[e.jsx("div",{className:"submission-diff-label",children:"Metrics"}),Object.keys(l).length>0?e.jsx("div",{className:"submission-metric-list",children:Object.entries(l).map(([c,u])=>e.jsxs("span",{className:"submission-metric-pill",children:[c,": ",String(u)]},c))}):e.jsx(N,{children:"No metrics"})]})]})}function F({label:s,value:t}){return e.jsxs("div",{children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("div",{className:"submission-field-value",children:t??e.jsx("span",{className:"submission-muted",children:"Not set"})})]})}function cs({currentPayload:s,proposedPayload:t}){const i=M(s).source_url,n=t.source_url;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(v,{title:"Current source URL",children:typeof i=="string"&&i?e.jsx("a",{className:"submission-url-link",href:T(i)??void 0,target:"_blank",rel:"noopener noreferrer",children:i}):e.jsx(N,{children:"No current URL"})}),e.jsx(v,{title:"Proposed source URL",children:typeof n=="string"&&n?e.jsx("a",{className:"submission-url-link",href:T(n)??void 0,target:"_blank",rel:"noopener noreferrer",children:n}):e.jsx(N,{children:"No proposed URL"})})]})}function os({proposedPayload:s}){const t=typeof s.title=="string"?s.title:"",i=typeof s.source_url=="string"?s.source_url:"",n=typeof s.abstract=="string"?s.abstract:"",r=typeof s.date_published=="string"?s.date_published:"",l=Array.isArray(s.authors)?s.authors.filter(c=>typeof c=="string"):[];return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(v,{title:"Title",children:t?e.jsx("span",{className:"submission-field-value",children:t}):e.jsx(N,{children:"No title provided"})}),e.jsx(v,{title:"Publication date",children:r||e.jsx(N,{children:"No publication date provided"})}),e.jsx(v,{title:"Authors",children:l.length>0?l.map((c,u)=>e.jsx("span",{className:"submission-diff-pill added",children:c},`${c}-${u}`)):e.jsx(N,{children:"No authors provided"})}),e.jsx(v,{title:"Source URL",children:i?e.jsx("a",{className:"submission-url-link",href:T(i)??void 0,target:"_blank",rel:"noopener noreferrer",children:i}):e.jsx(N,{children:"No source URL provided"})}),e.jsx(v,{title:"Abstract",children:n?e.jsx("span",{className:"submission-field-value",children:n}):e.jsx(N,{children:"No abstract provided"})})]})}function H({kind:s,proposedPayload:t}){const i=typeof t.name=="string"?t.name:"",n=typeof t.description=="string"?t.description:"",r=typeof t.year=="number"?t.year:null,l=typeof t.start_date=="string"?t.start_date:"",c=typeof t.end_date=="string"?t.end_date:"",u=typeof t.venue=="string"?t.venue:"",m=typeof t.url=="string"?t.url:"",b=M(t.image),x=typeof b.data_url=="string"&&b.data_url.startsWith("data:image/")?b.data_url:"",a=typeof b.url=="string"?qe(b.url)??"":x,o=typeof b.file_name=="string"?b.file_name:"Suggested image",d=typeof t.image_credit=="string"?t.image_credit:"",p=typeof t.source_url=="string"?t.source_url:"";return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(v,{title:`Suggested ${s} name`,children:i?e.jsx("span",{className:"submission-diff-pill added",children:i}):e.jsx(N,{children:"No name provided"})}),e.jsx(v,{title:"Description",children:n?e.jsx("span",{className:"submission-field-value",children:n}):e.jsx(N,{children:"No description provided"})}),(s==="task"||s==="method")&&e.jsxs(e.Fragment,{children:[e.jsx(v,{title:"Image",children:a?e.jsx("img",{src:a,alt:o,className:"max-h-64 max-w-full rounded-md border border-border object-contain"}):e.jsx(N,{children:"No image provided"})}),e.jsx(v,{title:"Image source",children:d||e.jsx(N,{children:"No image source provided"})})]}),s==="task"&&e.jsx(v,{title:"Placement and keywords",children:e.jsx("span",{className:"submission-field-value",children:JSON.stringify({parent_id:t.parent_id??null,area_id:t.area_id??null,keywords:t.keywords??null})})}),s==="benchmark"&&e.jsx(v,{title:"Intended task IDs",children:e.jsx("span",{className:"submission-field-value",children:JSON.stringify(t.task_ids??[])})}),s==="metric"&&e.jsx(v,{title:"Metric and leaderboard definition",children:e.jsx("span",{className:"submission-field-value",children:JSON.stringify({direction:t.direction,scale:t.scale,task_id:t.task_id,dataset_id:t.dataset_id})})}),s==="method"&&e.jsx(v,{title:"Source",children:p?p.startsWith("http://")||p.startsWith("https://")?e.jsx("a",{className:"submission-url-link",href:T(p)??void 0,target:"_blank",rel:"noopener noreferrer",children:p}):e.jsx("span",{className:"submission-field-value",children:p}):e.jsx(N,{children:"No source provided"})}),s==="conference"&&e.jsxs(e.Fragment,{children:[e.jsx(v,{title:"Edition and dates",children:r?`${r}${l?` · ${l}${c?` – ${c}`:""}`:""}`:e.jsx(N,{children:"No edition provided"})}),e.jsx(v,{title:"Venue",children:u||e.jsx(N,{children:"No venue provided"})}),e.jsx(v,{title:"URL",children:m?e.jsx("a",{className:"submission-url-link",href:T(m)??void 0,target:"_blank",rel:"noopener noreferrer",children:m}):e.jsx(N,{children:"No URL provided"})})]})]})}function v({title:s,children:t}){return e.jsxs("div",{className:"submission-diff-column",children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("div",{className:"submission-diff-pills",children:t})]})}function N({children:s}){return e.jsx("span",{className:"submission-muted",children:s})}function ds({currentPayload:s,proposedPayload:t}){const i=M(s),n=[{key:"hf_models",label:"Models"},{key:"hf_datasets",label:"Datasets"},{key:"hf_spaces",label:"Spaces"}];return e.jsx("div",{className:"submission-hf-artifacts-diff",children:n.map(({key:r,label:l})=>{const c=Array.isArray(i[r])?i[r].filter(m=>typeof m=="string"):[],u=Array.isArray(t[r])?t[r].filter(m=>typeof m=="string"):[];return e.jsxs("div",{className:"submission-hf-artifacts-section",children:[e.jsx("div",{className:"submission-diff-label",children:l}),e.jsx(de,{label:l.toLowerCase(),currentItems:c.map(m=>({url:m,is_official:!1})),proposedItems:u.map(m=>({url:m,is_official:!1}))})]},r)})})}function us({editType:s,currentPayload:t,proposedPayload:i}){const n=M(t);let r;return s==="tasks"?r=e.jsx(ye,{currentItems:Ne(n.tasks),proposedIds:_e(i.task_ids),queryPrefix:"task",fetchEntity:U.getTask.bind(U)}):s==="methods"?r=e.jsx(ye,{currentItems:Ne(n.methods),proposedIds:_e(i.method_ids),queryPrefix:"method",fetchEntity:U.getMethod.bind(U)}):s==="repositories"?r=e.jsx(de,{label:"repositories",currentItems:X(n.repositories),proposedItems:X(i.repositories)}):s==="project_pages"?r=e.jsx(de,{label:"project pages",currentItems:X(n.project_pages),proposedItems:X(i.project_pages)}):s==="evaluations"?r=e.jsx(as,{currentPayload:t,proposedPayload:i}):s==="source_url"?r=e.jsx(cs,{currentPayload:t,proposedPayload:i}):s==="hf_artifacts"?r=e.jsx(ds,{currentPayload:t,proposedPayload:i}):s==="new_task"?r=e.jsx(H,{kind:"task",proposedPayload:i}):s==="new_method"?r=e.jsx(H,{kind:"method",proposedPayload:i}):s==="new_benchmark"?r=e.jsx(H,{kind:"benchmark",proposedPayload:i}):s==="new_metric"?r=e.jsx(H,{kind:"metric",proposedPayload:i}):s==="new_conference"?r=e.jsx(H,{kind:"conference",proposedPayload:i}):s==="new_external_paper"?r=e.jsx(os,{proposedPayload:i}):r=e.jsxs("div",{className:"submission-empty submission-empty-warn",children:["No custom renderer exists yet for ",ns(s),"."]}),e.jsxs("div",{className:"submission-diff-body",children:[r,e.jsx(rs,{currentPayload:t,proposedPayload:i})]})}const te=25,ms=["pending","approved","rejected","all"],hs=["all","tasks","methods","evaluations","repositories","project_pages","source_url","new_task","new_method","new_benchmark","new_metric","new_conference","new_external_paper"],ue=["pending","approved","rejected"];function fs(s){return s.slice(0,2).toUpperCase()}function Z(s){return s.replace(/_/g," ")}function ps(s){return s==="new_external_paper"?"external paper":Z(s)}const gs={new_task:{title:"New task",subtitle:"Task suggestion"},new_method:{title:"New method",subtitle:"Method suggestion"},new_benchmark:{title:"New benchmark",subtitle:"Benchmark suggestion"},new_metric:{title:"New metric",subtitle:"Metric suggestion"},new_conference:{title:"New conference",subtitle:"Conference suggestion"},new_external_paper:{title:"External paper",subtitle:"External paper submission"}};function ke(s){if(!s)return"unknown time";const t=new Date(s);if(Number.isNaN(t.getTime()))return s;const i=Date.now()-t.getTime(),n=Math.floor(i/6e4),r=Math.floor(i/36e5),l=Math.floor(i/864e5);return n<1?"just now":n<60?`${n}m ago`:r<24?`${r}h ago`:l<14?`${l}d ago`:t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function me(s,t){var n;const i=s;if(i.response)try{const r=JSON.parse(i.response);if(typeof(r==null?void 0:r.detail)=="string")return r.detail;if(Array.isArray(r==null?void 0:r.detail)&&((n=r.detail[0])!=null&&n.msg))return r.detail[0].msg}catch{return i.response}return i.message||t}function bs(s){return s==="approved"?"approved":s==="rejected"?"rejected":"pending"}function js(s,t){return(s==null?void 0:s.arxiv_id)||(s==null?void 0:s.id)||String(t)}function xs(s){return[...s].sort((t,i)=>new Date(i.created_at).getTime()-new Date(t.created_at).getTime())}async function vs(s,t,i){const n=t==="all"?void 0:t;if(s!=="all")return z.list({status:s,edit_type:n,limit:i,offset:0});const r=await Promise.all(ue.map(l=>z.list({status:l,edit_type:n,limit:i,offset:0})));return{count:r.reduce((l,c)=>l+c.count,0),results:xs(r.flatMap(l=>l.results)).slice(0,i)}}function Ns(){return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"submission-empty submission-empty-warn",children:[e.jsx(Ve,{size:22}),e.jsx("h1",{children:"Admin access required"}),e.jsx("p",{children:"Sign in with an allowlisted Hugging Face admin account to review paper edit submissions."})]})})}function _s(){return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"submission-loading",children:[e.jsx(J,{className:"spin",size:18}),e.jsx("span",{children:"Checking admin session..."})]})})}function ys({submission:s,paper:t}){const i=Se(),{toast:n}=Ee(),r=s.paper_id,l=r===null,c=gs[s.edit_type]??{title:"Taxonomy directory",subtitle:"Directory suggestion"},u=l?null:js(t,r),m=l?c.title:(t==null?void 0:t.title)||`Paper #${r}`,b=`https://huggingface.co/${encodeURIComponent(s.hf_username)}/avatar`,x=s.status==="pending",a=w.useCallback(j=>{i.invalidateQueries({queryKey:["pendingPaperEdits"]}),i.invalidateQueries({queryKey:["pendingPaperEdit",j.id]}),j.paper_id!=null&&(i.invalidateQueries({queryKey:["paper",String(j.paper_id)]}),i.invalidateQueries({queryKey:["paper-summary",String(j.paper_id)]})),t!=null&&t.arxiv_id&&i.invalidateQueries({queryKey:["paper-arxiv",t.arxiv_id]}),j.edit_type==="evaluations"&&j.paper_id!=null&&i.invalidateQueries({queryKey:["evaluations","paper",String(j.paper_id)]})},[t==null?void 0:t.arxiv_id,i]),o=xe({mutationFn:()=>z.approve(s.id),onSuccess:j=>{a(j),n({title:"Submission approved",description:`Applied ${Z(s.edit_type)} changes for ${m}.`})},onError:j=>{n({title:"Could not approve submission",description:me(j,"Approval failed. Please try again."),variant:"destructive"})}}),d=xe({mutationFn:()=>z.reject(s.id),onSuccess:j=>{a(j),n({title:"Submission rejected",description:`Rejected ${Z(s.edit_type)} changes for ${m}.`})},onError:j=>{n({title:"Could not reject submission",description:me(j,"Rejection failed. Please try again."),variant:"destructive"})}}),p=o.isPending,h=d.isPending,k=p||h;return e.jsxs("article",{id:`submission-${s.id}`,className:"submission-card",children:[e.jsxs("header",{className:"submission-card-header",children:[e.jsxs("div",{className:"submission-card-top",children:[e.jsxs("div",{children:[u?e.jsx("a",{href:`/paper/${encodeURIComponent(u)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-title",children:m}):e.jsx("div",{className:"submission-title",children:m}),e.jsxs("div",{className:"submission-meta",children:[e.jsxs("span",{children:["#",s.id]}),e.jsx("span",{children:l?c.subtitle:`Paper #${s.paper_id}`}),e.jsx("span",{children:ke(s.created_at)})]})]}),e.jsxs("div",{className:"submission-badges",children:[e.jsx("span",{className:"submission-pill",children:Z(s.edit_type)}),s.is_author&&e.jsx("span",{className:"submission-pill author",children:"Linked author"}),e.jsx("span",{className:Q("submission-pill status",bs(s.status)),children:s.status})]})]}),e.jsxs("a",{href:`https://huggingface.co/${encodeURIComponent(s.hf_username)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-user",children:[e.jsxs(De,{className:"h-6 w-6",children:[e.jsx($e,{src:b,alt:s.hf_username}),e.jsx(Te,{className:"text-[10px]",children:fs(s.hf_username)})]}),e.jsxs("span",{children:["@",s.hf_username]})]})]}),e.jsx("div",{className:"submission-diff",children:e.jsx(us,{editType:s.edit_type,currentPayload:s.current_payload,proposedPayload:s.proposed_payload})}),s.conflict_payload&&e.jsxs("div",{className:"submission-empty submission-empty-warn",children:["Canonical state changed after this submission. Review the conflict before deciding.",e.jsx("pre",{children:JSON.stringify(s.conflict_payload,null,2)})]}),s.review_evidence&&e.jsxs("details",{className:"submission-diff",open:!0,children:[e.jsx("summary",{children:"Codex review artifact"}),e.jsx("pre",{children:JSON.stringify(s.review_evidence,null,2)})]}),e.jsx("footer",{className:"submission-actions",children:x?e.jsx(e.Fragment,{children:e.jsxs("div",{className:"submission-action-buttons",children:[e.jsxs("button",{type:"button",onClick:()=>d.mutate(),disabled:k,className:"submission-action-btn reject",children:[h?e.jsx(J,{className:"spin",size:14}):e.jsx(Xe,{size:14}),"Reject"]}),e.jsxs("button",{type:"button",onClick:()=>o.mutate(),disabled:k,className:"submission-action-btn approve",children:[p?e.jsx(J,{className:"spin",size:14}):e.jsx(Ze,{size:14}),"Approve"]})]})}):e.jsxs("div",{className:"submission-reviewed",children:[e.jsxs("span",{children:["Reviewed by ",e.jsx("strong",{children:s.reviewed_by||"unknown"}),s.reviewed_at?` ${ke(s.reviewed_at)}`:""]}),s.admin_note&&e.jsxs("span",{children:["Admin note: ",e.jsx("strong",{children:s.admin_note})]}),s.user_review_reason&&e.jsxs("span",{children:["Submitter-visible reason: ",e.jsx("strong",{children:s.user_review_reason})]}),s.applied_payload&&e.jsxs("details",{children:[e.jsx("summary",{children:"Applied payload"}),e.jsx("pre",{children:JSON.stringify(s.applied_payload,null,2)})]}),s.result_entity_type&&e.jsxs("span",{children:["Created/applied: ",e.jsxs("strong",{children:[s.result_entity_type," #",s.result_entity_id]})]})]})})]})}function Is(){var he,fe,pe;const{user:s,isLoading:t}=Le(),{toast:i}=Ee(),[n,r]=w.useState("pending"),[l,c]=w.useState("all"),[u,m]=w.useState(te),b=!!(s!=null&&s.is_admin);w.useEffect(()=>{m(te)},[n,l]);const x=je({queryKey:["pendingPaperEdits","counts",l],queryFn:async()=>{const g=l==="all"?void 0:l,A=await Promise.all(ue.map(O=>z.list({status:O,edit_type:g,limit:1,offset:0})));return Object.fromEntries(A.map((O,V)=>[ue[V],O.count]))},enabled:b,staleTime:30*1e3}),a=je({queryKey:["pendingPaperEdits",{status:n,editType:l,visibleLimit:u}],queryFn:()=>vs(n,l,u),enabled:b,retry:!1}),o=w.useMemo(()=>{var g;return Array.from(new Set((((g=a.data)==null?void 0:g.results)??[]).map(A=>A.paper_id).filter(A=>A!=null))).sort((A,O)=>A-O)},[(he=a.data)==null?void 0:he.results]),d=P({queries:o.map(g=>({queryKey:["paper-summary",String(g)],queryFn:()=>Ue.get(String(g),!1),enabled:b,staleTime:5*60*1e3}))}),p=w.useMemo(()=>{const g=new Map;return d.forEach(A=>{const O=A.data;if(!O)return;const V=Number(O.id);Number.isFinite(V)&&g.set(V,O)}),g},[d]);if(w.useEffect(()=>{a.error&&i({title:"Could not load submissions",description:me(a.error,"Failed to load pending paper edits."),variant:"destructive"})},[a.error,i]),t)return e.jsx(_s,{});if(!b)return e.jsx(Ns,{});const h=x.data,k=h?h.pending+h.approved+h.rejected:void 0,j={pending:h==null?void 0:h.pending,approved:h==null?void 0:h.approved,rejected:h==null?void 0:h.rejected,all:k},q=((fe=a.data)==null?void 0:fe.results)??[],ee=((pe=a.data)==null?void 0:pe.count)??0,Ae=q.length<ee;return e.jsxs("div",{className:"page submissions-page",children:[e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Pending ",e.jsx("em",{children:"Edits"})]}),e.jsx("div",{className:"feed-subtitle",children:"Review submitted changes to paper metadata and benchmark results"})]}),e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>{x.refetch(),a.refetch()},disabled:a.isFetching||x.isFetching,children:[e.jsx(Ye,{className:Q((a.isFetching||x.isFetching)&&"spin"),size:14}),"Refresh"]})]}),e.jsxs("div",{className:"submissions-filter-panel",children:[e.jsxs("div",{className:"submission-filter-block",children:[e.jsx("div",{className:"sidebar-label",children:"Status"}),e.jsx("div",{className:"period-switch",children:ms.map(g=>e.jsxs("button",{type:"button",className:Q("period-btn",n===g&&"active"),onClick:()=>r(g),children:[g,j[g]!=null&&e.jsx("span",{className:"submission-count",children:j[g]})]},g))})]}),e.jsxs("div",{className:"submission-filter-block",children:[e.jsx("div",{className:"sidebar-label",children:"Edit Type"}),e.jsx("div",{className:"sort-options submissions-type-options",children:hs.map(g=>e.jsx("button",{type:"button",className:Q("sort-btn",l===g&&"active"),onClick:()=>c(g),children:ps(g)},g))})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"sort-bar submissions-sort-bar",children:e.jsx("div",{children:e.jsx("div",{className:"sort-options",children:e.jsx("span",{className:"results-count",children:a.isFetching?"refreshing":`${ee} submissions`})})})}),a.isLoading?e.jsxs("div",{className:"submission-loading",children:[e.jsx(J,{className:"spin",size:18}),e.jsx("span",{children:"Loading submissions..."})]}):q.length===0?e.jsxs("div",{className:"submission-empty",children:[e.jsx(ss,{size:28}),e.jsx("h2",{children:"No pending submissions."}),e.jsxs("p",{children:["The SQL and curl fallback is still documented in"," ",e.jsx("a",{href:"https://github.com/huggingface/paperswithcode/blob/main/docs/operations.md",target:"_blank",rel:"noopener noreferrer",children:"operations.md"}),"."]})]}):e.jsx("div",{className:"submission-list",children:q.map(g=>e.jsx(ys,{submission:g,paper:g.paper_id==null?void 0:p.get(g.paper_id)},g.id))}),q.length>0&&e.jsxs("div",{className:"submission-pagination",children:[e.jsxs("p",{children:["Showing ",q.length," of ",ee," submissions"]}),Ae&&e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>m(g=>g+te),disabled:a.isFetching,children:[a.isFetching&&e.jsx(J,{className:"spin",size:14}),"Load more"]})]})]})]})}export{Is as default};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/SubmissionsDashboard-bmyAR3Ji.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
var be=s=>{throw TypeError(s)};var ee=(s,t,i)=>t.has(s)||be("Cannot "+i);var f=(s,t,i)=>(ee(s,t,"read from private field"),i?i.call(s):t.get(s)),C=(s,t,i)=>t.has(s)?be("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,i),k=(s,t,i,n)=>(ee(s,t,"write to private field"),n?n.call(s,i):t.set(s,i),i),R=(s,t,i)=>(ee(s,t,"access private method"),i);import{ak as Ce,al as te,am as Re,an as Oe,k as Ne,r as $,ao as Me,d as qe,j as e,N as Ae,R as w,v as T,g as Te,h as ke,p as Fe,ap as Ie,aq as Qe,ar as Le,w as B}from"./index-CnNiludC.js";import{Q as we,b as Ue,c as De,e as $e,d as ze,f as Be,s as xe,g as He,h as Je,u as ie}from"./useQuery-C87uSz9p.js";import{u as ge}from"./useMutation-CZOEaG9X.js";import{c as I}from"./catalog-D7qk7tAG.js";import{s as D}from"./safeExternalHref-CkBrsh84.js";import{R as Ke,S as Pe,C as Ge}from"./shield-alert-BRQa4qRa.js";import{L as H}from"./loader-circle-3AJg82rJ.js";import{C as We}from"./circle-check-BO6NSWAF.js";function je(s,t){const i=new Set(t);return s.filter(n=>!i.has(n))}function Ye(s,t,i){const n=s.slice(0);return n[t]=i,n}var L,S,U,Q,E,A,J,K,P,G,N,ne,re,Se,ae,oe,le,_e,Ve=(_e=class extends Ce{constructor(t,i,n){super();C(this,N);C(this,L);C(this,S);C(this,U);C(this,Q);C(this,E);C(this,A);C(this,J);C(this,K);C(this,P);C(this,G,[]);k(this,L,t),k(this,Q,n),k(this,U,[]),k(this,E,[]),k(this,S,[]),this.setQueries(i)}onSubscribe(){this.listeners.size===1&&f(this,E).forEach(t=>{t.subscribe(i=>{R(this,N,oe).call(this,t,i)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,f(this,E).forEach(t=>{t.destroy()})}setQueries(t,i){k(this,U,t),k(this,Q,i),te.batch(()=>{const n=f(this,E),a=R(this,N,ae).call(this,f(this,U));a.forEach(r=>r.observer.setOptions(r.defaultedQueryOptions));const l=a.map(r=>r.observer),o=l.map(r=>r.getCurrentResult()),d=n.length!==l.length,h=l.some((r,m)=>r!==n[m]),b=d||h,j=b?!0:o.some((r,m)=>{const c=f(this,S)[m];return!c||!Re(r,c)});!b&&!j||(b&&(k(this,G,a),k(this,E,l)),k(this,S,o),this.hasListeners()&&(b&&(je(n,l).forEach(r=>{r.destroy()}),je(l,n).forEach(r=>{r.subscribe(m=>{R(this,N,oe).call(this,r,m)})})),R(this,N,le).call(this)))})}getCurrentResult(){return f(this,S)}getQueries(){return f(this,E).map(t=>t.getCurrentQuery())}getObservers(){return f(this,E)}getOptimisticResult(t,i){const n=R(this,N,ae).call(this,t),a=n.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),l=n.map(o=>o.defaultedQueryOptions.queryHash);return[a,o=>R(this,N,re).call(this,o??a,i,l),()=>R(this,N,ne).call(this,a,n)]}},L=new WeakMap,S=new WeakMap,U=new WeakMap,Q=new WeakMap,E=new WeakMap,A=new WeakMap,J=new WeakMap,K=new WeakMap,P=new WeakMap,G=new WeakMap,N=new WeakSet,ne=function(t,i){return i.map((n,a)=>{const l=t[a];return n.defaultedQueryOptions.notifyOnChangeProps?l:n.observer.trackResult(l,o=>{i.forEach(d=>{d.observer.trackProp(o)})})})},re=function(t,i,n){if(i){const a=f(this,P),l=n!==void 0&&a!==void 0&&(a.length!==n.length||n.some((o,d)=>o!==a[d]));return(!f(this,A)||f(this,S)!==f(this,K)||l||i!==f(this,J))&&(k(this,J,i),k(this,K,f(this,S)),n!==void 0&&k(this,P,n),k(this,A,Oe(f(this,A),i(t)))),f(this,A)}return t},Se=function(){var t;return((t=f(this,Q))==null?void 0:t.combine)!==void 0&&f(this,E).some((i,n)=>{var a;return i.options.suspense&&((a=f(this,S)[n])==null?void 0:a.data)===void 0})},ae=function(t){const i=new Map;f(this,E).forEach(a=>{const l=a.options.queryHash;if(!l)return;const o=i.get(l);o?o.push(a):i.set(l,[a])});const n=[];return t.forEach(a=>{var h;const l=f(this,L).defaultQueryOptions(a),d=((h=i.get(l.queryHash))==null?void 0:h.shift())??new we(f(this,L),l);n.push({defaultedQueryOptions:l,observer:d})}),n},oe=function(t,i){const n=f(this,E).indexOf(t);n!==-1&&(k(this,S,Ye(f(this,S),n,i)),R(this,N,le).call(this))},le=function(){var t;if(this.hasListeners()){const i=R(this,N,ne).call(this,f(this,S),f(this,G)),n=R(this,N,Se).call(this),a=f(this,A),l=n?a:R(this,N,re).call(this,i,(t=f(this,Q))==null?void 0:t.combine);(n||a!==l)&&te.batch(()=>{this.listeners.forEach(o=>{o(f(this,S))})})}},_e);function V({queries:s,...t},i){const n=Ne(),a=Ue(),l=De(),o=$.useMemo(()=>s.map(u=>{const v=n.defaultQueryOptions(u);return v._optimisticResults=a?"isRestoring":"optimistic",v}),[s,n,a]);o.forEach(u=>{$e(u);const v=n.getQueryCache().get(u.queryHash);ze(u,l,v)}),Be(l);const[d]=$.useState(()=>new Ve(n,o,t)),[h,b,j]=d.getOptimisticResult(o,t.combine),r=!a&&t.subscribed!==!1;$.useSyncExternalStore($.useCallback(u=>r?d.subscribe(te.batchCalls(u)):Me,[d,r]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),$.useEffect(()=>{d.setQueries(o,t)},[o,t,d]);const c=h.some((u,v)=>xe(o[v],u))?h.flatMap((u,v)=>{const g=o[v];if(g&&xe(g,u)){const F=new we(n,g);return He(g,F,l)}return[]}):[];if(c.length>0)throw Promise.all(c);const p=h.find((u,v)=>{const g=o[v];return g&&Je({result:u,errorResetBoundary:l,throwOnError:g.throwOnError,query:n.getQueryCache().get(g.queryHash),suspense:g.suspense})});if(p!=null&&p.error)throw p.error;return b(j())}/**
|
| 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 ve=qe("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);function Xe({currentPayload:s,proposedPayload:t}){const[i,n]=w.useState(!1);return e.jsxs("div",{className:"submission-raw-toggle",children:[e.jsx("button",{type:"button",className:"raw-json-btn",onClick:()=>n(a=>!a),children:i?"Hide raw JSON":"Show raw JSON"}),i&&e.jsxs("div",{className:"submission-json-grid",children:[e.jsx(ce,{title:"Current payload",value:s??{}}),e.jsx(ce,{title:"Proposed payload",value:t})]})]})}function ce({title:s,value:t}){return e.jsxs("div",{className:"submission-json-block",children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("pre",{children:JSON.stringify(t,null,2)})]})}function de({currentItems:s,proposedIds:t,queryPrefix:i,fetchEntity:n,knownNames:a}){const l=w.useMemo(()=>Array.from(new Set([...s.map(c=>c.id),...t])).sort((c,p)=>c-p),[s,t]),o=V({queries:n?l.map(c=>({queryKey:[i,String(c)],queryFn:()=>n(String(c)),staleTime:5*60*1e3})):[]}),d=w.useMemo(()=>{const c=new Map;return s.forEach(p=>c.set(p.id,p.name)),a==null||a.forEach((p,u)=>c.set(u,p)),o.forEach(p=>{const u=p.data;if(!u)return;const v=Number(u.id);Number.isFinite(v)&&c.set(v,u.name)}),c},[s,o,a]),h=new Set(s.map(c=>c.id)),b=new Set(t),j=l.filter(c=>h.has(c)&&!b.has(c)),r=l.filter(c=>!h.has(c)&&b.has(c)),m=(c,p)=>{const u=p==="current"&&j.includes(c),v=p==="proposed"&&r.includes(c);return e.jsx("span",{className:T("submission-diff-pill",u&&"removed",v&&"added"),children:d.get(c)??`#${c}`},c)};return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(y,{title:"Currently tagged",children:s.length>0?s.map(c=>m(c.id,"current")):e.jsx(_,{children:"No current tags"})}),e.jsx(y,{title:"Will be tagged",children:t.length>0?t.map(c=>m(c,"proposed")):e.jsx(_,{children:"No proposed tags"})})]})}function Ze({currentItems:s,proposedIds:t}){var l;const i=ie({queryKey:["organizations","submission-diff"],queryFn:()=>I.organizations(),staleTime:3e5}),n=new Map(s.map(o=>[o.id,o.name]));(l=i.data)==null||l.results.forEach(o=>{const d=Number(o.id);Number.isFinite(d)&&n.set(d,o.name)});const a=s.map(o=>({...o,name:n.get(o.id)??o.name}));return e.jsx(de,{currentItems:a,proposedIds:t,queryPrefix:"organization",knownNames:n})}function ue({label:s,currentItems:t,proposedItems:i}){const n=new Map(t.map(o=>[o.url,o])),a=new Map(i.map(o=>[o.url,o])),l=Array.from(new Set([...n.keys(),...a.keys()])).sort();return l.length===0?e.jsxs(_,{children:["No ",s," in this submission."]}):e.jsx("div",{className:"submission-url-list",children:l.map(o=>{var m;const d=n.get(o),h=a.get(o),b=!d&&h,j=d&&!h,r=d&&h&&d.is_official!==h.is_official;return e.jsx("div",{className:T("submission-url-row",b&&"added",j&&"removed",r&&"changed"),children:e.jsxs("div",{className:"submission-url-content",children:[e.jsx("a",{href:D(o)??void 0,target:"_blank",rel:"noopener noreferrer",className:T("submission-url-link",j&&"removed"),children:o}),b&&e.jsx("span",{className:"submission-pill status approved",children:"Added"}),j&&e.jsx("span",{className:"submission-pill status rejected",children:"Removed"}),r&&e.jsxs("span",{className:"submission-pill changed",children:["Official: ",String(d.is_official)," ","->"," ",String(h.is_official)]}),((m=h??d)==null?void 0:m.is_official)&&e.jsx("span",{className:"submission-pill",children:"Official"})]})},o)})})}function es({currentPayload:s,proposedPayload:t}){const i=w.useMemo(()=>(s==null?void 0:s.evaluations)??[],[s]),n=t.operations,a=w.useMemo(()=>{const r=new Set;return i.forEach(m=>{m.task_id&&r.add(Number(m.task_id))}),n.forEach(m=>{const c=m.data;c!=null&&c.task_id&&r.add(Number(c.task_id))}),Array.from(r).filter(m=>Number.isFinite(m))},[i,n]),l=w.useMemo(()=>{const r=new Set;return i.forEach(m=>{m.dataset_id&&r.add(Number(m.dataset_id))}),n.forEach(m=>{const c=m.data;c!=null&&c.dataset_id&&r.add(Number(c.dataset_id))}),Array.from(r).filter(m=>Number.isFinite(m))},[i,n]),o=V({queries:a.map(r=>({queryKey:["task",String(r)],queryFn:()=>I.getTask(String(r)),staleTime:5*60*1e3}))}),d=V({queries:l.map(r=>({queryKey:["dataset",String(r)],queryFn:()=>I.getDataset(String(r)),staleTime:5*60*1e3}))}),h=w.useMemo(()=>{const r=new Map;return o.forEach(m=>{const c=m.data;if(!c)return;const p=Number(c.id);Number.isFinite(p)&&r.set(p,c.name)}),r},[o]),b=w.useMemo(()=>{const r=new Map;return d.forEach(m=>{const c=m.data;if(!c)return;const p=Number(c.id);Number.isFinite(p)&&r.set(p,c.name)}),r},[d]),j=new Map(i.filter(r=>r.id!=null).map(r=>[Number(r.id),r]));return n.length===0?e.jsx(_,{children:"No evaluation operations in this payload."}):e.jsx("div",{className:"submission-eval-list",children:n.map((r,m)=>{const c=r.evaluation_id?j.get(r.evaluation_id):void 0,u=(r.op==="update"?{...c,...r.data}:r.data??c)??{};return e.jsxs("div",{className:"submission-eval-op",children:[e.jsxs("div",{className:"submission-eval-op-header",children:[e.jsx("span",{className:T("submission-pill status",r.op==="create"&&"approved",r.op==="update"&&"changed",r.op==="delete"&&"rejected"),children:r.op??"unknown"}),r.evaluation_id&&e.jsxs("span",{className:"submission-meta",children:["Evaluation #",r.evaluation_id]})]}),r.op&&["create","update","delete"].includes(r.op)?e.jsx(ss,{evaluation:u,taskNames:h,datasetNames:b}):e.jsx(ce,{title:"Unsupported operation",value:r})]},`${r.op}-${r.evaluation_id??m}`)})})}function ss({evaluation:s,taskNames:t,datasetNames:i}){const n=s.task_id?Number(s.task_id):void 0,a=s.dataset_id?Number(s.dataset_id):void 0,l=s.metrics??{};return e.jsxs("div",{className:"submission-eval-fields",children:[e.jsx(q,{label:"Task",value:n?t.get(n)??`#${n}`:null}),e.jsx(q,{label:"Dataset",value:a?i.get(a)??`#${a}`:null}),e.jsx(q,{label:"Model",value:s.model_name||null}),e.jsx(q,{label:"Harness",value:s.harness||null}),e.jsx(q,{label:"Best rank",value:s.best_rank??null}),e.jsx(q,{label:"Parameters",value:s.num_parameters??null}),e.jsx(q,{label:"HF model URL",value:s.hf_model_url||null}),e.jsx(q,{label:"Open source",value:s.is_open===void 0?null:s.is_open?"Yes":"No"}),e.jsxs("div",{className:"submission-eval-metrics",children:[e.jsx("div",{className:"submission-diff-label",children:"Metrics"}),Object.keys(l).length>0?e.jsx("div",{className:"submission-metric-list",children:Object.entries(l).map(([o,d])=>e.jsxs("span",{className:"submission-metric-pill",children:[o,": ",String(d)]},o))}):e.jsx(_,{children:"No metrics"})]})]})}function q({label:s,value:t}){return e.jsxs("div",{children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("div",{className:"submission-field-value",children:t??e.jsx("span",{className:"submission-muted",children:"Not set"})})]})}function ts({currentPayload:s,proposedPayload:t}){const i=s==null?void 0:s.source_url,n=t.source_url;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(y,{title:"Current source URL",children:typeof i=="string"&&i?e.jsx("a",{className:"submission-url-link",href:D(i)??void 0,target:"_blank",rel:"noopener noreferrer",children:i}):e.jsx(_,{children:"No current URL"})}),e.jsx(y,{title:"Proposed source URL",children:typeof n=="string"&&n?e.jsx("a",{className:"submission-url-link",href:D(n)??void 0,target:"_blank",rel:"noopener noreferrer",children:n}):e.jsx(_,{children:"No proposed URL"})})]})}function is({proposedPayload:s}){const{title:t,source_url:i,abstract:n="",date_published:a,authors:l}=s;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(y,{title:"Title",children:t?e.jsx("span",{className:"submission-field-value",children:t}):e.jsx(_,{children:"No title provided"})}),e.jsx(y,{title:"Publication date",children:a||e.jsx(_,{children:"No publication date provided"})}),e.jsx(y,{title:"Authors",children:l.length>0?l.map((o,d)=>e.jsx("span",{className:"submission-diff-pill added",children:o},`${o}-${d}`)):e.jsx(_,{children:"No authors provided"})}),e.jsx(y,{title:"Source URL",children:i?e.jsx("a",{className:"submission-url-link",href:D(i)??void 0,target:"_blank",rel:"noopener noreferrer",children:i}):e.jsx(_,{children:"No source URL provided"})}),e.jsx(y,{title:"Abstract",children:n?e.jsx("span",{className:"submission-field-value",children:n}):e.jsx(_,{children:"No abstract provided"})})]})}function z({kind:s,proposedPayload:t}){const i=typeof t.name=="string"?t.name:"",n=typeof t.description=="string"?t.description:"",a=typeof t.year=="number"?t.year:null,l=typeof t.start_date=="string"?t.start_date:"",o=typeof t.end_date=="string"?t.end_date:"",d=typeof t.venue=="string"?t.venue:"",h=typeof t.url=="string"?t.url:"",b=t.image??{},j=typeof b.data_url=="string"&&b.data_url.startsWith("data:image/")?b.data_url:"",r=typeof b.url=="string"?Ae(b.url)??"":j,m=typeof b.file_name=="string"?b.file_name:"Suggested image",c=typeof t.image_credit=="string"?t.image_credit:"",p=typeof t.source_url=="string"?t.source_url:"";return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(y,{title:`Suggested ${s} name`,children:i?e.jsx("span",{className:"submission-diff-pill added",children:i}):e.jsx(_,{children:"No name provided"})}),e.jsx(y,{title:"Description",children:n?e.jsx("span",{className:"submission-field-value",children:n}):e.jsx(_,{children:"No description provided"})}),(s==="task"||s==="method")&&e.jsxs(e.Fragment,{children:[e.jsx(y,{title:"Image",children:r?e.jsx("img",{src:r,alt:m,className:"max-h-64 max-w-full rounded-md border border-border object-contain"}):e.jsx(_,{children:"No image provided"})}),e.jsx(y,{title:"Image source",children:c||e.jsx(_,{children:"No image source provided"})})]}),s==="task"&&e.jsx(y,{title:"Placement and keywords",children:e.jsx("span",{className:"submission-field-value",children:JSON.stringify({parent_id:t.parent_id??null,area_id:t.area_id??null,keywords:t.keywords??null})})}),s==="benchmark"&&e.jsx(y,{title:"Intended task IDs",children:e.jsx("span",{className:"submission-field-value",children:JSON.stringify(t.task_ids??[])})}),s==="metric"&&e.jsx(y,{title:"Metric and leaderboard definition",children:e.jsx("span",{className:"submission-field-value",children:JSON.stringify({direction:t.direction,scale:t.scale,task_id:t.task_id,dataset_id:t.dataset_id})})}),s==="method"&&e.jsx(y,{title:"Source",children:p?p.startsWith("http://")||p.startsWith("https://")?e.jsx("a",{className:"submission-url-link",href:D(p)??void 0,target:"_blank",rel:"noopener noreferrer",children:p}):e.jsx("span",{className:"submission-field-value",children:p}):e.jsx(_,{children:"No source provided"})}),s==="conference"&&e.jsxs(e.Fragment,{children:[e.jsx(y,{title:"Edition and dates",children:a?`${a}${l?` · ${l}${o?` – ${o}`:""}`:""}`:e.jsx(_,{children:"No edition provided"})}),e.jsx(y,{title:"Venue",children:d||e.jsx(_,{children:"No venue provided"})}),e.jsx(y,{title:"URL",children:h?e.jsx("a",{className:"submission-url-link",href:D(h)??void 0,target:"_blank",rel:"noopener noreferrer",children:h}):e.jsx(_,{children:"No URL provided"})})]})]})}function y({title:s,children:t}){return e.jsxs("div",{className:"submission-diff-column",children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("div",{className:"submission-diff-pills",children:t})]})}function _({children:s}){return e.jsx("span",{className:"submission-muted",children:s})}function ns({currentPayload:s,proposedPayload:t}){const i=s,n=[{key:"hf_models",label:"Models"},{key:"hf_datasets",label:"Datasets"},{key:"hf_spaces",label:"Spaces"}];return e.jsx("div",{className:"submission-hf-artifacts-diff",children:n.map(({key:a,label:l})=>{const o=(i==null?void 0:i[a])??[],d=t[a];return e.jsxs("div",{className:"submission-hf-artifacts-section",children:[e.jsx("div",{className:"submission-diff-label",children:l}),e.jsx(ue,{label:l.toLowerCase(),currentItems:o.map(h=>({url:h,is_official:!1})),proposedItems:d.map(h=>({url:h,is_official:!1}))})]},a)})})}function rs(s){throw new Error(`Unhandled pending edit: ${JSON.stringify(s)}`)}function as({edit:s}){var i,n,a,l,o;let t;switch(s.edit_type){case"tasks":t=e.jsx(de,{currentItems:((i=s.current_payload)==null?void 0:i.tasks)??[],proposedIds:s.proposed_payload.task_ids,queryPrefix:"task",fetchEntity:I.getTask.bind(I)});break;case"methods":t=e.jsx(de,{currentItems:((n=s.current_payload)==null?void 0:n.methods)??[],proposedIds:s.proposed_payload.method_ids,queryPrefix:"method",fetchEntity:I.getMethod.bind(I)});break;case"organizations":t=e.jsx(Ze,{currentItems:((a=s.current_payload)==null?void 0:a.organizations)??[],proposedIds:s.proposed_payload.organization_ids});break;case"repositories":t=e.jsx(ue,{label:"repositories",currentItems:((l=s.current_payload)==null?void 0:l.repositories)??[],proposedItems:s.proposed_payload.repositories});break;case"project_pages":t=e.jsx(ue,{label:"project pages",currentItems:((o=s.current_payload)==null?void 0:o.project_pages)??[],proposedItems:s.proposed_payload.project_pages});break;case"evaluations":t=e.jsx(es,{currentPayload:s.current_payload,proposedPayload:s.proposed_payload});break;case"source_url":t=e.jsx(ts,{currentPayload:s.current_payload,proposedPayload:s.proposed_payload});break;case"hf_artifacts":t=e.jsx(ns,{currentPayload:s.current_payload,proposedPayload:s.proposed_payload});break;case"new_task":t=e.jsx(z,{kind:"task",proposedPayload:s.proposed_payload});break;case"new_method":t=e.jsx(z,{kind:"method",proposedPayload:s.proposed_payload});break;case"new_benchmark":t=e.jsx(z,{kind:"benchmark",proposedPayload:s.proposed_payload});break;case"new_metric":t=e.jsx(z,{kind:"metric",proposedPayload:s.proposed_payload});break;case"new_conference":t=e.jsx(z,{kind:"conference",proposedPayload:s.proposed_payload});break;case"new_external_paper":t=e.jsx(is,{proposedPayload:s.proposed_payload});break;default:rs(s)}return e.jsxs("div",{className:"submission-diff-body",children:[t,e.jsx(Xe,{currentPayload:s.current_payload,proposedPayload:s.proposed_payload})]})}const se=25,os=["pending","approved","rejected","all"],ls=["all","tasks","methods","evaluations","repositories","project_pages","source_url","new_task","new_method","new_benchmark","new_metric","new_conference","new_external_paper"],me=["pending","approved","rejected"];function cs(s){return s.slice(0,2).toUpperCase()}function Y(s){return s.replace(/_/g," ")}function ds(s){return s==="new_external_paper"?"external paper":Y(s)}const us={new_task:{title:"New task",subtitle:"Task suggestion"},new_method:{title:"New method",subtitle:"Method suggestion"},new_benchmark:{title:"New benchmark",subtitle:"Benchmark suggestion"},new_metric:{title:"New metric",subtitle:"Metric suggestion"},new_conference:{title:"New conference",subtitle:"Conference suggestion"},new_external_paper:{title:"External paper",subtitle:"External paper submission"}};function ye(s){if(!s)return"unknown time";const t=new Date(s);if(Number.isNaN(t.getTime()))return s;const i=Date.now()-t.getTime(),n=Math.floor(i/6e4),a=Math.floor(i/36e5),l=Math.floor(i/864e5);return n<1?"just now":n<60?`${n}m ago`:a<24?`${a}h ago`:l<14?`${l}d ago`:t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function X(s,t){var n;const i=s;if(i.response)try{const a=JSON.parse(i.response);if(typeof(a==null?void 0:a.detail)=="string")return a.detail;if(Array.isArray(a==null?void 0:a.detail)&&((n=a.detail[0])!=null&&n.msg))return a.detail[0].msg}catch{return i.response}return i.message||t}function ms(s){return s==="approved"?"approved":s==="rejected"?"rejected":"pending"}function hs(s,t){return(s==null?void 0:s.arxiv_id)||(s==null?void 0:s.id)||String(t)}function ps(s){return[...s].sort((t,i)=>new Date(i.created_at).getTime()-new Date(t.created_at).getTime())}async function fs(s,t,i){const n=t==="all"?void 0:t;if(s!=="all")return B.list({status:s,edit_type:n,limit:i,offset:0});const a=await Promise.all(me.map(l=>B.list({status:l,edit_type:n,limit:i,offset:0})));return{count:a.reduce((l,o)=>l+o.count,0),results:ps(a.flatMap(l=>l.results)).slice(0,i)}}function bs(){return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"submission-empty submission-empty-warn",children:[e.jsx(Pe,{size:22}),e.jsx("h1",{children:"Admin access required"}),e.jsx("p",{children:"Sign in with an allowlisted Hugging Face admin account to review paper edit submissions."})]})})}function xs(){return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"submission-loading",children:[e.jsx(H,{className:"spin",size:18}),e.jsx("span",{children:"Checking admin session..."})]})})}function gs({submission:s,paper:t}){const i=Ne(),{toast:n}=ke(),a=s.paper_id,l=a===null,o=us[s.edit_type]??{title:"Taxonomy directory",subtitle:"Directory suggestion"},d=l?null:hs(t,a),h=l?o.title:(t==null?void 0:t.title)||`Paper #${a}`,b=`https://huggingface.co/${encodeURIComponent(s.hf_username)}/avatar`,j=s.status==="pending",r=w.useCallback(g=>{i.invalidateQueries({queryKey:["pendingPaperEdits"]}),i.invalidateQueries({queryKey:["pendingPaperEdit",g.id]}),g.paper_id!=null&&(i.invalidateQueries({queryKey:["paper",String(g.paper_id)]}),i.invalidateQueries({queryKey:["paper-summary",String(g.paper_id)]})),t!=null&&t.arxiv_id&&i.invalidateQueries({queryKey:["paper-arxiv",t.arxiv_id]}),g.edit_type==="evaluations"&&g.paper_id!=null&&i.invalidateQueries({queryKey:["evaluations","paper",String(g.paper_id)]})},[t==null?void 0:t.arxiv_id,i]),m=ge({mutationFn:()=>B.approve(s.id),onSuccess:g=>{r(g),n({title:"Submission approved",description:`Applied ${Y(s.edit_type)} changes for ${h}.`})},onError:g=>{n({title:"Could not approve submission",description:X(g,"Approval failed. Please try again."),variant:"destructive"})}}),c=ge({mutationFn:()=>B.reject(s.id),onSuccess:g=>{r(g),n({title:"Submission rejected",description:`Rejected ${Y(s.edit_type)} changes for ${h}.`})},onError:g=>{n({title:"Could not reject submission",description:X(g,"Rejection failed. Please try again."),variant:"destructive"})}}),p=m.isPending,u=c.isPending,v=p||u;return e.jsxs("article",{id:`submission-${s.id}`,className:"submission-card",children:[e.jsxs("header",{className:"submission-card-header",children:[e.jsxs("div",{className:"submission-card-top",children:[e.jsxs("div",{children:[d?e.jsx("a",{href:`/paper/${encodeURIComponent(d)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-title",children:h}):e.jsx("div",{className:"submission-title",children:h}),e.jsxs("div",{className:"submission-meta",children:[e.jsxs("span",{children:["#",s.id]}),e.jsx("span",{children:l?o.subtitle:`Paper #${s.paper_id}`}),e.jsx("span",{children:ye(s.created_at)})]})]}),e.jsxs("div",{className:"submission-badges",children:[e.jsx("span",{className:"submission-pill",children:Y(s.edit_type)}),s.is_author&&e.jsx("span",{className:"submission-pill author",children:"Linked author"}),e.jsx("span",{className:T("submission-pill status",ms(s.status)),children:s.status})]})]}),e.jsxs("a",{href:`https://huggingface.co/${encodeURIComponent(s.hf_username)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-user",children:[e.jsxs(Ie,{className:"h-6 w-6",children:[e.jsx(Qe,{src:b,alt:s.hf_username}),e.jsx(Le,{className:"text-[10px]",children:cs(s.hf_username)})]}),e.jsxs("span",{children:["@",s.hf_username]})]})]}),e.jsx("div",{className:"submission-diff",children:e.jsx(as,{edit:s})}),s.conflict_payload&&e.jsxs("div",{className:"submission-empty submission-empty-warn",children:["Canonical state changed after this submission. Review the conflict before deciding.",e.jsx("pre",{children:JSON.stringify(s.conflict_payload,null,2)})]}),s.review_evidence&&e.jsxs("details",{className:"submission-diff",open:!0,children:[e.jsx("summary",{children:"Codex review artifact"}),e.jsx("pre",{children:JSON.stringify(s.review_evidence,null,2)})]}),e.jsx("footer",{className:"submission-actions",children:j?e.jsx(e.Fragment,{children:e.jsxs("div",{className:"submission-action-buttons",children:[e.jsxs("button",{type:"button",onClick:()=>c.mutate(),disabled:v,className:"submission-action-btn reject",children:[u?e.jsx(H,{className:"spin",size:14}):e.jsx(Ge,{size:14}),"Reject"]}),e.jsxs("button",{type:"button",onClick:()=>m.mutate(),disabled:v,className:"submission-action-btn approve",children:[p?e.jsx(H,{className:"spin",size:14}):e.jsx(We,{size:14}),"Approve"]})]})}):e.jsxs("div",{className:"submission-reviewed",children:[e.jsxs("span",{children:["Reviewed by ",e.jsx("strong",{children:s.reviewed_by||"unknown"}),s.reviewed_at?` ${ye(s.reviewed_at)}`:""]}),s.admin_note&&e.jsxs("span",{children:["Admin note: ",e.jsx("strong",{children:s.admin_note})]}),s.user_review_reason&&e.jsxs("span",{children:["Submitter-visible reason: ",e.jsx("strong",{children:s.user_review_reason})]}),s.applied_payload&&e.jsxs("details",{children:[e.jsx("summary",{children:"Applied payload"}),e.jsx("pre",{children:JSON.stringify(s.applied_payload,null,2)})]}),s.result_entity_type&&e.jsxs("span",{children:["Created/applied: ",e.jsxs("strong",{children:[s.result_entity_type," #",s.result_entity_id]})]})]})})]})}function Cs(){var he,pe,fe;const{user:s,isLoading:t}=Te(),{toast:i}=ke(),[n,a]=w.useState("pending"),[l,o]=w.useState("all"),[d,h]=w.useState(se),b=!!(s!=null&&s.is_admin);w.useEffect(()=>{h(se)},[n,l]);const j=ie({queryKey:["pendingPaperEdits","counts",l],queryFn:async()=>{const x=l==="all"?void 0:l,O=await Promise.all(me.map(M=>B.list({status:M,edit_type:x,limit:1,offset:0})));return Object.fromEntries(O.map((M,W)=>[me[W],M.count]))},enabled:b,staleTime:30*1e3}),r=ie({queryKey:["pendingPaperEdits",{status:n,editType:l,visibleLimit:d}],queryFn:()=>fs(n,l,d),enabled:b,retry:!1}),m=w.useMemo(()=>{var x;return Array.from(new Set((((x=r.data)==null?void 0:x.results)??[]).map(O=>O.paper_id).filter(O=>O!=null))).sort((O,M)=>O-M)},[(he=r.data)==null?void 0:he.results]),c=V({queries:m.map(x=>({queryKey:["paper-summary",String(x)],queryFn:()=>Fe.get(String(x),!1),enabled:b,staleTime:5*60*1e3}))}),p=w.useMemo(()=>{const x=new Map;return c.forEach(O=>{const M=O.data;if(!M)return;const W=Number(M.id);Number.isFinite(W)&&x.set(W,M)}),x},[c]);if(w.useEffect(()=>{r.error&&i({title:"Could not load submissions",description:X(r.error,"Failed to load pending paper edits."),variant:"destructive"})},[r.error,i]),t)return e.jsx(xs,{});if(!b)return e.jsx(bs,{});const u=j.data,v=u?u.pending+u.approved+u.rejected:void 0,g={pending:u==null?void 0:u.pending,approved:u==null?void 0:u.approved,rejected:u==null?void 0:u.rejected,all:v},F=((pe=r.data)==null?void 0:pe.results)??[],Z=((fe=r.data)==null?void 0:fe.count)??0,Ee=F.length<Z;return e.jsxs("div",{className:"page submissions-page",children:[e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Pending ",e.jsx("em",{children:"Edits"})]}),e.jsx("div",{className:"feed-subtitle",children:"Review submitted changes to paper metadata and benchmark results"})]}),e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>{j.refetch(),r.refetch()},disabled:r.isFetching||j.isFetching,children:[e.jsx(Ke,{className:T((r.isFetching||j.isFetching)&&"spin"),size:14}),"Refresh"]})]}),e.jsxs("div",{className:"submissions-filter-panel",children:[e.jsxs("div",{className:"submission-filter-block",children:[e.jsx("div",{className:"sidebar-label",children:"Status"}),e.jsx("div",{className:"period-switch",children:os.map(x=>e.jsxs("button",{type:"button",className:T("period-btn",n===x&&"active"),onClick:()=>a(x),children:[x,g[x]!=null&&e.jsx("span",{className:"submission-count",children:g[x]})]},x))})]}),e.jsxs("div",{className:"submission-filter-block",children:[e.jsx("div",{className:"sidebar-label",children:"Edit Type"}),e.jsx("div",{className:"sort-options submissions-type-options",children:ls.map(x=>e.jsx("button",{type:"button",className:T("sort-btn",l===x&&"active"),onClick:()=>o(x),children:ds(x)},x))})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"sort-bar submissions-sort-bar",children:e.jsx("div",{children:e.jsx("div",{className:"sort-options",children:e.jsx("span",{className:"results-count",children:r.isFetching?"refreshing":`${Z} submissions`})})})}),r.isLoading?e.jsxs("div",{className:"submission-loading",children:[e.jsx(H,{className:"spin",size:18}),e.jsx("span",{children:"Loading submissions..."})]}):r.isError?e.jsxs("div",{className:"submission-empty submission-empty-warn",role:"alert",children:[e.jsx(ve,{size:28}),e.jsx("h2",{children:"Could not display submissions."}),e.jsx("p",{children:X(r.error,"The submissions response was invalid.")})]}):F.length===0?e.jsxs("div",{className:"submission-empty",children:[e.jsx(ve,{size:28}),e.jsx("h2",{children:"No pending submissions."}),e.jsxs("p",{children:["The SQL and curl fallback is still documented in"," ",e.jsx("a",{href:"https://github.com/huggingface/paperswithcode/blob/main/docs/operations.md",target:"_blank",rel:"noopener noreferrer",children:"operations.md"}),"."]})]}):e.jsx("div",{className:"submission-list",children:F.map(x=>e.jsx(gs,{submission:x,paper:x.paper_id==null?void 0:p.get(x.paper_id)},x.id))}),F.length>0&&e.jsxs("div",{className:"submission-pagination",children:[e.jsxs("p",{children:["Showing ",F.length," of ",Z," submissions"]}),Ee&&e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>h(x=>x+se),disabled:r.isFetching,children:[r.isFetching&&e.jsx(H,{className:"spin",size:14}),"Load more"]})]})]})]})}export{Cs as default};
|
assets/SubmitView-D9hURKw9.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{u as P,k,h as C,g as E,R as d,j as e,D as L,p as z}from"./index-DKw1mejm.js";import{u as F}from"./useMutation-B1PI2Fhg.js";import{A as X,a as q}from"./alert-DtuWH5Uh.js";import{B as _}from"./button-Daj2z1wQ.js";import{I as g,T as N}from"./textarea-VTzc6fCU.js";const v="pwc:paper-submit-draft",U=/^\d{4}\.\d{4,5}(v\d+)?$/i,$=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,O=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function A(n){const i=n.trim();return i?U.test(i)||$.test(i)||O.test(i)?"arxiv":/^https?:\/\//i.test(i)?"external":"arxiv":"empty"}function B(n,i){const a=n.trim();if(A(a)==="arxiv")return/^https?:\/\//i.test(a)?{source_url:a}:{arxiv_id:a};const o={source_url:a},l=i.title.trim();l&&(o.title=l);const p=i.abstract.trim();p&&(o.abstract=p);const u=i.authors.split(/[,\n]/).map(h=>h.trim()).filter(Boolean);return u.length>0&&(o.authors=u),i.datePublished&&(o.date_published=i.datePublished),o}function J(n){var a;const i=n;if(!i)return"Submission failed";if(i.response)try{const s=JSON.parse(i.response);if(typeof s.detail=="string")return s.detail;if((a=s.detail)!=null&&a.message)return`${s.detail.message} See ${s.detail.help||"/rate-limits"} for help.`}catch{return i.response}return i.message||"Submission failed"}const W=()=>{const n=P(),i=k(),{toast:a}=C(),{user:s,isLoading:o}=E(),[l,p]=d.useState(""),[u,h]=d.useState(""),[f,S]=d.useState(""),[x,j]=d.useState(""),[b,w]=d.useState(""),[I,y]=d.useState(null);d.useEffect(()=>{const t=sessionStorage.getItem(v);if(t){sessionStorage.removeItem(v);try{const r=JSON.parse(t);p(r.input??""),h(r.title??""),S(r.abstract??""),j(r.authors??""),w(r.datePublished??"")}catch{}}},[]);const m=A(l),R=m==="external",c=F({mutationFn:t=>z.submit(t),onSuccess:t=>{if(t.pending_review){a({title:"Submission queued for review",description:"No source page was fetched and no catalog row was changed."}),c.reset();return}i.invalidateQueries({queryKey:["papers"],refetchType:"none"}),i.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),i.invalidateQueries({queryKey:["trending-papers"],refetchType:"none"});const r=t.refreshed&&t.created&&t.latest_version;a({title:r?`Paper updated to ${t.latest_version}`:t.created?"Paper submitted":"Paper already indexed",description:r?"Opening the updated paper page…":t.created?"Opening the paper page…":"Opening the existing paper page…"}),t.route_identifier&&n(`/paper/${t.route_identifier}`)},onError:t=>{y(J(t))}}),T=t=>{if(t.preventDefault(),y(null),m==="empty"){y("Enter an arXiv ID or a paper URL to submit.");return}if(!s){sessionStorage.setItem(v,JSON.stringify({input:l,title:u,abstract:f,authors:x,datePublished:b}));const D=L("/api/v1/auth/hf/login");window.location.assign(`${D}?return_to=${encodeURIComponent(window.location.href)}`);return}const r=B(l,{title:u,abstract:f,authors:x,datePublished:b});c.mutate(r)};return e.jsxs("div",{className:"page",style:{maxWidth:720},children:[e.jsx("h1",{className:"detail-title",children:"Submit a paper"}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:["Index an arXiv paper or propose a non-arXiv paper (blog post, technical report, model release page). External papers enter the submission queue and appear only after review."," ",e.jsx("a",{href:"/rate-limits",children:"Read the submission and rate-limit policy."})]}),e.jsxs("form",{onSubmit:T,style:{marginTop:28,display:"grid",gap:20},children:[e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-input",style:{fontWeight:600,fontSize:14},children:"arXiv ID or paper URL"}),e.jsx(g,{id:"submit-input",value:l,onChange:t=>p(t.target.value),placeholder:"2501.12345 · https://arxiv.org/abs/2501.12345 · https://blog.example.com/release",autoFocus:!0,required:!0}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)",minHeight:18},children:m==="arxiv"?"Detected: arXiv paper — metadata will be fetched automatically.":m==="external"?"Detected: external URL — we'll extract metadata and you can override below.":"Paste an arXiv ID like 2501.12345 or any paper/blog URL."})]}),R&&e.jsxs("fieldset",{style:{border:"1px solid var(--rule)",borderRadius:8,padding:"16px 20px 20px",display:"grid",gap:16},children:[e.jsx("legend",{style:{padding:"0 8px",fontSize:12,color:"var(--ink-soft)",textTransform:"uppercase",letterSpacing:.5},children:"External paper details (optional)"}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-title",style:{fontSize:13},children:"Title"}),e.jsx(g,{id:"submit-title",value:u,onChange:t=>h(t.target.value),placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-abstract",style:{fontSize:13},children:"Abstract or summary"}),e.jsx(N,{id:"submit-abstract",value:f,onChange:t=>S(t.target.value),rows:4,placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-authors",style:{fontSize:13},children:"Authors (comma-separated)"}),e.jsx(g,{id:"submit-authors",value:x,onChange:t=>j(t.target.value),placeholder:"Jane Smith, John Doe"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-date",style:{fontSize:13},children:"Publication date"}),e.jsx(g,{id:"submit-date",type:"date",value:b,onChange:t=>w(t.target.value),style:{maxWidth:220}}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)"},children:"Required only if we cannot infer a date from the page."})]})]}),I&&e.jsx(X,{variant:"destructive",children:e.jsx(q,{children:I})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(_,{type:"submit",disabled:c.isPending||o,children:o?"Checking sign-in…":c.isPending?"Submitting…":s?"Submit paper":"Sign in to submit"}),e.jsx(_,{type:"button",variant:"outline",onClick:()=>n(-1),disabled:c.isPending,children:"Cancel"})]})]})]})};export{W as default};
|
|
|
|
|
|
assets/SubmitView-oLTX5Nai.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{u as k,k as D,h as E,g as C,R as d,j as e,E as L,p as z}from"./index-CnNiludC.js";import{u as F}from"./useMutation-CZOEaG9X.js";import{A as X,a as q}from"./alert-CV1yu6Q5.js";import{B as _}from"./button-Cb-e5tHG.js";import{I as g,T as N}from"./textarea-DuxG42Qe.js";const v="pwc:paper-submit-draft",U=/^\d{4}\.\d{4,5}(v\d+)?$/i,$=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,O=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function A(n){const i=n.trim();return i?U.test(i)||$.test(i)||O.test(i)?"arxiv":/^https?:\/\//i.test(i)?"external":"arxiv":"empty"}function B(n,i){const a=n.trim();if(A(a)==="arxiv")return/^https?:\/\//i.test(a)?{source_url:a}:{arxiv_id:a};const o={source_url:a},l=i.title.trim();l&&(o.title=l);const p=i.abstract.trim();p&&(o.abstract=p);const u=i.authors.split(/[,\n]/).map(h=>h.trim()).filter(Boolean);return u.length>0&&(o.authors=u),i.datePublished&&(o.date_published=i.datePublished),o}function J(n){var a;const i=n;if(!i)return"Submission failed";if(i.response)try{const s=JSON.parse(i.response);if(typeof s.detail=="string")return s.detail;if((a=s.detail)!=null&&a.message)return`${s.detail.message} See ${s.detail.help||"/rate-limits"} for help.`}catch{return i.response}return i.message||"Submission failed"}const W=()=>{const n=k(),i=D(),{toast:a}=E(),{user:s,isLoading:o}=C(),[l,p]=d.useState(""),[u,h]=d.useState(""),[f,S]=d.useState(""),[x,j]=d.useState(""),[b,w]=d.useState(""),[I,y]=d.useState(null);d.useEffect(()=>{const t=sessionStorage.getItem(v);if(t){sessionStorage.removeItem(v);try{const r=JSON.parse(t);p(r.input??""),h(r.title??""),S(r.abstract??""),j(r.authors??""),w(r.datePublished??"")}catch{}}},[]);const m=A(l),R=m==="external",c=F({mutationFn:t=>z.submit(t),onSuccess:t=>{if(t.pending_review){a({title:"Submission queued for review",description:"No source page was fetched and no catalog row was changed."}),c.reset();return}i.invalidateQueries({queryKey:["papers"],refetchType:"none"}),i.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),i.invalidateQueries({queryKey:["trending-papers"],refetchType:"none"});const r=t.refreshed&&t.created&&t.latest_version;a({title:r?`Paper updated to ${t.latest_version}`:t.created?"Paper submitted":"Paper already indexed",description:r?"Opening the updated paper page…":t.created?"Opening the paper page…":"Opening the existing paper page…"}),t.route_identifier&&n(`/paper/${t.route_identifier}`)},onError:t=>{y(J(t))}}),T=t=>{if(t.preventDefault(),y(null),m==="empty"){y("Enter an arXiv ID or a paper URL to submit.");return}if(!s){sessionStorage.setItem(v,JSON.stringify({input:l,title:u,abstract:f,authors:x,datePublished:b}));const P=L("/api/v1/auth/hf/login");window.location.assign(`${P}?return_to=${encodeURIComponent(window.location.href)}`);return}const r=B(l,{title:u,abstract:f,authors:x,datePublished:b});c.mutate(r)};return e.jsxs("div",{className:"page",style:{maxWidth:720},children:[e.jsx("h1",{className:"detail-title",children:"Submit a paper"}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:["Index an arXiv paper or propose a non-arXiv paper (blog post, technical report, model release page). External papers enter the submission queue and appear only after review."," ",e.jsx("a",{href:"/rate-limits",children:"Read the submission and rate-limit policy."})]}),e.jsxs("form",{onSubmit:T,style:{marginTop:28,display:"grid",gap:20},children:[e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-input",style:{fontWeight:600,fontSize:14},children:"arXiv ID or paper URL"}),e.jsx(g,{id:"submit-input",value:l,onChange:t=>p(t.target.value),placeholder:"2501.12345 · https://arxiv.org/abs/2501.12345 · https://blog.example.com/release",autoFocus:!0,required:!0}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)",minHeight:18},children:m==="arxiv"?"Detected: arXiv paper — metadata will be fetched automatically.":m==="external"?"Detected: external URL — we'll extract metadata and you can override below.":"Paste an arXiv ID like 2501.12345 or any paper/blog URL."})]}),R&&e.jsxs("fieldset",{style:{border:"1px solid var(--rule)",borderRadius:8,padding:"16px 20px 20px",display:"grid",gap:16},children:[e.jsx("legend",{style:{padding:"0 8px",fontSize:12,color:"var(--ink-soft)",textTransform:"uppercase",letterSpacing:.5},children:"External paper details (optional)"}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-title",style:{fontSize:13},children:"Title"}),e.jsx(g,{id:"submit-title",value:u,onChange:t=>h(t.target.value),placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-abstract",style:{fontSize:13},children:"Abstract or summary"}),e.jsx(N,{id:"submit-abstract",value:f,onChange:t=>S(t.target.value),rows:4,placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-authors",style:{fontSize:13},children:"Authors (comma-separated)"}),e.jsx(g,{id:"submit-authors",value:x,onChange:t=>j(t.target.value),placeholder:"Jane Smith, John Doe"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-date",style:{fontSize:13},children:"Publication date"}),e.jsx(g,{id:"submit-date",type:"date",value:b,onChange:t=>w(t.target.value),style:{maxWidth:220}}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)"},children:"Required only if we cannot infer a date from the page."})]})]}),I&&e.jsx(X,{variant:"destructive",children:e.jsx(q,{children:I})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(_,{type:"submit",disabled:c.isPending||o,children:o?"Checking sign-in…":c.isPending?"Submitting…":s?"Submit paper":"Sign in to submit"}),e.jsx(_,{type:"button",variant:"outline",onClick:()=>n(-1),disabled:c.isPending,children:"Cancel"})]})]})]})};export{W as default};
|
assets/{TagBrowseView-DaUDpp12.js → TagBrowseView-Dwwqp3GC.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{d as fe,r as h,n as Z,j as e,m as F,
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{d as fe,r as h,n as Z,j as e,m as F,Q as be,q as je,P as Je,t as _e,o as ve,S as Xe,R as _,U as es,y as ss,v as J,L as A,f as as,u as ts,a as ns,G as rs,N as os}from"./index-CnNiludC.js";import{u as xe}from"./useQuery-C87uSz9p.js";import{P as cs,M as is}from"./components-skIcbldg.js";import{B as ls}from"./BenchmarkTrendSparkline-DAxMFKnm.js";import{u as ds,P as ms}from"./useIntersectionObserver-BUxW5ZLf.js";import{M as Q}from"./MarkdownText-mvLqNfwe.js";import{c as ge}from"./catalog-D7qk7tAG.js";import{t as ps,d as V}from"./transform-zlVHQ5aE.js";import{b as hs}from"./usePapers-C15Wpgxo.js";import{S as U}from"./skeleton-BU3tw6-C.js";import{A as us,a as xs}from"./alert-CV1yu6Q5.js";import{C as gs}from"./chevron-down-Bjm5Iw9B.js";import{G as fs}from"./github-CRO5e-fY.js";import"./LatexTitle-B1FyT_-3.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";import"./PaperPreviewLink-DAFhnDhq.js";import"./index-B8BJTSsG.js";import"./hover-card-CDhcGwFp.js";import"./useInfiniteQuery-DulZ-zOj.js";/**
|
| 2 |
* @license lucide-react v0.462.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/TagsIndexView-DVV95VtR.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{r as m,j as s,L as p}from"./index-DKw1mejm.js";import{u as h}from"./useQuery-DkXMNuGa.js";import{c as g}from"./catalog-Cs0CZbdz.js";import{c as x,h as f,d as u}from"./transform-DnfrBiik.js";import{S as d}from"./skeleton-CnS6y9lc.js";import{A as j,a as y}from"./alert-DtuWH5Uh.js";import{T as k}from"./TaxonomySuggestionTile-BQyzbk_b.js";import"./SignInToEditDialog-BrFD0zbL.js";import"./button-Daj2z1wQ.js";import"./textarea-VTzc6fCU.js";import"./dialog-B9CPIS7M.js";import"./useMutation-B1PI2Fhg.js";import"./submissions-DGtBhb0o.js";import"./loader-circle-A0brRFET.js";const v=r=>(r==null?void 0:r.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",R=()=>{const r=h({queryKey:["areas-with-tasks"],queryFn:()=>g.areasWithTasks(),staleTime:6e5}),o=m.useMemo(()=>{if(!r.data)return[];const e={general:0,vision:1,video:2,language:3,audio:4,other:5},t=n=>e[v(n)]??999;return[...r.data.results].sort((n,a)=>{const i=t(n.name),l=t(a.name);return i!==l?i-l:n.name.localeCompare(a.name)})},[r.data]),c=m.useMemo(()=>o.reduce((e,t)=>e+t.tasks.length,0),[o]);return r.error?s.jsx("div",{className:"page",children:s.jsx(j,{variant:"destructive",children:s.jsx(y,{children:"Failed to load taxonomy. Please try again."})})}):s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["All ",s.jsx("em",{children:"Domains"})]}),s.jsx("div",{className:"feed-subtitle",children:"Browse research by area. Click any task to see trending work."})]})}),r.isLoading?s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((e,t)=>s.jsxs("div",{children:[s.jsx(d,{className:"h-8 w-1/3 mb-4"}),s.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((n,a)=>s.jsx(d,{className:"h-24"},a))})]},t))}):o.map(e=>{const t=e.tasks;if(t.length===0)return null;const n=t.reduce((a,i)=>a+(i.paper_count||0),0);return s.jsxs("section",{style:{marginBottom:48},children:[s.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[s.jsxs("div",{children:[s.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:e.name}),e.description&&s.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:e.description})]}),s.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[t.length," ",t.length===1?"task":"tasks"," · ",n.toLocaleString()," papers"]})]}),s.jsxs("div",{className:"tag-grid",children:[t.map(a=>{const i=a.slug||"",l=x(f(i));return s.jsxs(p,{to:`/tasks/${i}`,className:"tag-cell",children:[s.jsxs("div",{className:"name",children:[s.jsx("span",{className:"dot",style:{background:l.dot}}),u(a.name,i)]}),s.jsx("div",{className:"meta",children:s.jsxs("span",{children:[(a.paper_count??0).toLocaleString()," papers"]})})]},a.id)}),s.jsx(k,{kind:"task"})]})]},e.id)}),c>0&&s.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[c," tasks across ",o.filter(e=>e.tasks.length>0).length," areas."]})]})};export{R as default};
|
|
|
|
|
|
assets/TagsIndexView-Dnvf32XM.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{r as m,j as s,L as p}from"./index-CnNiludC.js";import{u as h}from"./useQuery-C87uSz9p.js";import{c as g}from"./catalog-D7qk7tAG.js";import{c as x,h as f,d as u}from"./transform-zlVHQ5aE.js";import{S as d}from"./skeleton-BU3tw6-C.js";import{A as j,a as y}from"./alert-CV1yu6Q5.js";import{T as k}from"./TaxonomySuggestionTile-DPjYd5AL.js";import"./SignInToEditDialog-ByW2mx_A.js";import"./button-Cb-e5tHG.js";import"./textarea-DuxG42Qe.js";import"./dialog-COYv9g-7.js";import"./useMutation-CZOEaG9X.js";import"./loader-circle-3AJg82rJ.js";const v=r=>(r==null?void 0:r.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",E=()=>{const r=h({queryKey:["areas-with-tasks"],queryFn:()=>g.areasWithTasks(),staleTime:6e5}),o=m.useMemo(()=>{if(!r.data)return[];const e={general:0,vision:1,video:2,language:3,audio:4,other:5},a=n=>e[v(n)]??999;return[...r.data.results].sort((n,t)=>{const i=a(n.name),l=a(t.name);return i!==l?i-l:n.name.localeCompare(t.name)})},[r.data]),c=m.useMemo(()=>o.reduce((e,a)=>e+a.tasks.length,0),[o]);return r.error?s.jsx("div",{className:"page",children:s.jsx(j,{variant:"destructive",children:s.jsx(y,{children:"Failed to load taxonomy. Please try again."})})}):s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["All ",s.jsx("em",{children:"Domains"})]}),s.jsx("div",{className:"feed-subtitle",children:"Browse research by area. Click any task to see trending work."})]})}),r.isLoading?s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((e,a)=>s.jsxs("div",{children:[s.jsx(d,{className:"h-8 w-1/3 mb-4"}),s.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((n,t)=>s.jsx(d,{className:"h-24"},t))})]},a))}):o.map(e=>{const a=e.tasks;if(a.length===0)return null;const n=a.reduce((t,i)=>t+(i.paper_count||0),0);return s.jsxs("section",{style:{marginBottom:48},children:[s.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[s.jsxs("div",{children:[s.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:e.name}),e.description&&s.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:e.description})]}),s.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[a.length," ",a.length===1?"task":"tasks"," · ",n.toLocaleString()," papers"]})]}),s.jsxs("div",{className:"tag-grid",children:[a.map(t=>{const i=t.slug||"",l=x(f(i));return s.jsxs(p,{to:`/tasks/${i}`,className:"tag-cell",children:[s.jsxs("div",{className:"name",children:[s.jsx("span",{className:"dot",style:{background:l.dot}}),u(t.name,i)]}),s.jsx("div",{className:"meta",children:s.jsxs("span",{children:[(t.paper_count??0).toLocaleString()," papers"]})})]},t.id)}),s.jsx(k,{kind:"task"})]})]},e.id)}),c>0&&s.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[c," tasks across ",o.filter(e=>e.tasks.length>0).length," areas."]})]})};export{E as default};
|
assets/{TaxonomySuggestionTile-BQyzbk_b.js → TaxonomySuggestionTile-DPjYd5AL.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{g as u,r as o,j as e}from"./index-
|
|
|
|
| 1 |
+
import{g as u,r as o,j as e}from"./index-CnNiludC.js";import{P as c,S as m,a as p}from"./SignInToEditDialog-ByW2mx_A.js";function h({kind:s}){const{user:a}=u(),[i,n]=o.useState(!1),[l,t]=o.useState(!1),g=`Suggest a new ${s}...`,r=()=>{a?n(!0):t(!0)};return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"tag-cell taxonomy-suggestion-cell",onClick:r,children:[e.jsxs("div",{className:"name",children:[e.jsx(c,{className:"taxonomy-suggestion-icon","aria-hidden":"true"}),g]}),e.jsx("div",{className:"meta",children:e.jsx("span",{children:"Propose an addition"})})]}),e.jsx(m,{open:i,onOpenChange:n,kind:s}),e.jsx(p,{open:l,onOpenChange:t,sectionLabel:`${s}s`,returnTo:typeof window<"u"?window.location.pathname:`/${s}s`,taxonomySuggestion:!0})]})}export{h as T};
|
assets/{TrendsView-Bpx3luAe.js → TrendsView-Dse5C7fn.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{c as X,R as G,j as e}from"./index-
|
|
|
|
| 1 |
+
import{c as X,R as G,j as e}from"./index-CnNiludC.js";import{u as J}from"./useQuery-C87uSz9p.js";import{A as q,a as E}from"./alert-CV1yu6Q5.js";import{S as P}from"./skeleton-BU3tw6-C.js";const m=t=>{const i=/^(\d{4})-(0[1-9]|1[0-2])$/.exec(t);if(!i)return t;const[,r,l]=i;return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][Number(l)-1]} '${r.slice(2)}`},Q=()=>X.getResearchTrends(),f=980,j=400,x=62,R=26,g=30,V=58,u=f-x-R,F=j-g-V,v=g+F,Y=t=>{if(t.length<3)return t.map((r,l)=>`${l?"L":"M"}${r[0]} ${r[1]}`).join(" ");let i=`M${t[0][0]} ${t[0][1]}`;for(let r=0;r<t.length-1;r+=1){const l=t[r-1]??t[r],c=t[r],o=t[r+1],a=t[r+2]??o,y=c[0]+(o[0]-l[0])/6,s=c[1]+(o[1]-l[1])/6,b=o[0]-(a[0]-c[0])/6,d=o[1]-(a[1]-c[1])/6;i+=` C ${y} ${s} ${b} ${d} ${o[0]} ${o[1]}`}return i},W={fontFamily:"var(--mono)",fontSize:12,fill:"var(--ink-faint)"},z={fontFamily:"var(--mono)",fontSize:11,fontWeight:600,letterSpacing:"0.14em",fill:"var(--ink-faint)",textTransform:"uppercase"},C=({id:t,data:i,color:r,yTicks:l,yLabel:c,xLabel:o})=>{const[a,y]=G.useState(null),s=i.length,b=l[l.length-1],d=n=>x+u*(s===1?0:n/(s-1)),p=n=>g+F*(1-n/b);if(s===0)return null;const B=i.map((n,h)=>[d(h),p(n.percent)]),A=Y(B),_=`${A} L ${d(s-1)} ${v} L ${x} ${v} Z`,w=s<=12?1:Math.ceil(s/8),O=n=>{const h=n.currentTarget.getBoundingClientRect(),S=(n.clientX-h.left)/h.width*f,k=s>1?u/(s-1):u,I=Math.max(0,Math.min(s-1,Math.round((S-x)/k)));y(I)},H=`trend-gradient-${t}`;return e.jsxs("figure",{className:"trend-chart",children:[e.jsxs("div",{className:"trend-chart-visual",children:[e.jsxs("svg",{viewBox:`0 0 ${f} ${j}`,width:"100%",role:"img","aria-label":`${c} by ${o.toLowerCase()}, from ${m(i[0].month)} (${i[0].percent}%) to ${m(i[s-1].month)} (${i[s-1].percent}%)`,style:{display:"block",overflow:"visible",cursor:"crosshair"},onPointerMove:O,onPointerLeave:()=>y(null),children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:H,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",style:{stopColor:r,stopOpacity:.26}}),e.jsx("stop",{offset:"100%",style:{stopColor:r,stopOpacity:.02}})]})}),l.map(n=>e.jsxs("g",{children:[e.jsx("line",{x1:x,x2:f-R,y1:p(n),y2:p(n),stroke:"var(--hairline)",strokeWidth:1}),e.jsxs("text",{x:x-14,y:p(n)+4,textAnchor:"end",style:W,children:[n,"%"]})]},n)),e.jsx("path",{d:_,fill:`url(#${H})`}),e.jsx("path",{d:A,fill:"none",stroke:r,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}),i.map((n,h)=>{const S=h===s-1,k=h%w===0&&s-1-h>=w/2;return!S&&!k?null:e.jsx("text",{x:d(h),y:v+24,textAnchor:"middle",style:W,children:m(n.month)},n.month)}),e.jsx("text",{x:x+u/2,y:j-4,textAnchor:"middle",style:z,children:o}),e.jsx("text",{transform:`translate(16 ${g+F/2}) rotate(-90)`,textAnchor:"middle",style:z,children:c}),a!=null&&e.jsxs(e.Fragment,{children:[e.jsx("line",{x1:d(a),x2:d(a),y1:g,y2:v,stroke:r,strokeWidth:1,strokeDasharray:"3 4",opacity:.5}),e.jsx("circle",{cx:d(a),cy:p(i[a].percent),r:5,fill:"var(--bg)",stroke:r,strokeWidth:2})]})]}),a!=null&&e.jsxs("div",{style:{position:"absolute",left:`${d(a)/f*100}%`,top:`${p(i[a].percent)/j*100}%`,transform:"translate(-50%, calc(-100% - 14px))",background:"var(--bg-elevated)",border:"1px solid var(--hairline)",borderRadius:6,boxShadow:"0 8px 26px rgba(0,0,0,.13)",padding:"7px 12px",pointerEvents:"none",whiteSpace:"nowrap",zIndex:3},children:[e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-faint)",fontSize:13,marginBottom:2},children:m(i[a].month)}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:7,fontFamily:"var(--mono)",fontWeight:600,fontSize:15,color:"var(--ink)"},children:[e.jsx("span",{style:{width:8,height:8,borderRadius:2,background:r,display:"inline-block"}}),i[a].percent,"%"]})]})]}),e.jsxs("details",{className:"trend-chart-table",children:[e.jsx("summary",{style:{fontFamily:"var(--mono)",fontSize:11,letterSpacing:"0.04em",color:"var(--ink-faint)",cursor:"pointer"},children:"View data table"}),e.jsxs("table",{style:{marginTop:8,borderCollapse:"collapse",fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{style:{textAlign:"left",padding:"3px 18px 3px 0"},children:o}),e.jsx("th",{style:{textAlign:"right",padding:"3px 0"},children:c})]})}),e.jsx("tbody",{children:i.map(n=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 18px 2px 0"},children:m(n.month)}),e.jsxs("td",{style:{textAlign:"right",padding:"2px 0"},children:[n.percent,"%"]})]},n.month))})]})]})]})},$={maxWidth:960,padding:"48px 0 8px",borderTop:"1px solid var(--hairline)",marginTop:48},T={fontFamily:"var(--serif)",fontSize:34,fontWeight:500,letterSpacing:"-0.02em",margin:"0 0 10px",color:"var(--ink)"},L={fontFamily:"var(--serif)",fontSize:18,lineHeight:1.55,color:"var(--ink-soft)",maxWidth:620,margin:"0 0 8px"},M={fontFamily:"var(--mono)",fontSize:12,fontWeight:600,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--ink-faint)",marginBottom:8},N={fontFamily:"var(--serif)",fontSize:17,lineHeight:1.6,color:"var(--ink-soft)",margin:0},D={height:320,marginTop:26},te=()=>{const t=J({queryKey:["research-trends"],queryFn:Q,staleTime:36e5});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:["Research ",e.jsx("em",{children:"Trends"})]}),e.jsx("div",{className:"feed-subtitle",children:"How open science is changing across machine learning — tracked over time from arXiv and the Hugging Face Hub."})]})}),t.error&&e.jsx(q,{variant:"destructive",children:e.jsx(E,{children:"Failed to load research trends. Please try again."})}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Code Availability"}),e.jsx("p",{style:L,children:"The percentage of published papers that have at least one official code implementation on GitHub."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(C,{id:"code",data:t.data.code_availability,color:"var(--trend-code)",yTicks:[0,20,40,60,80],yLabel:"Code Availability",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Papers with Hugging Face artifacts"}),e.jsx("p",{style:L,children:"The percentage of published papers linked to at least one Hugging Face artifact — a model, dataset or Space — making the work directly runnable and reusable."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(C,{id:"hf",data:t.data.hf_artifacts,color:"var(--trend-hf)",yTicks:[0,10,20,30,40,50],yLabel:"HF Artifact Coverage",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:{...$,paddingBottom:72},children:[e.jsx("h2",{style:{...T,fontSize:27},children:"How the data is collected"}),e.jsxs("div",{style:{display:"grid",gap:24,maxWidth:680},children:[e.jsxs("div",{children:[e.jsx("div",{style:M,children:"Code Availability"}),e.jsx("p",{style:N,children:"For every open-access machine learning paper, we check whether an official code implementation is linked on GitHub. The date axis is the paper's publication date."})]}),e.jsxs("div",{children:[e.jsx("div",{style:M,children:"Hugging Face artifacts"}),e.jsx("p",{style:N,children:"We resolve links between papers and the Hugging Face Hub, counting a paper as covered when it references at least one model, dataset or Space. The date axis is the paper's publication date."})]}),e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,lineHeight:1.6,color:"var(--ink-faint)",margin:"8px 0 0",letterSpacing:"0.02em"},children:"Figures use complete publication months. Historical Hugging Face coverage reflects artifacts currently linked in the catalog."})]})]})]})};export{te as default};
|
assets/{UserProfileView-sHCROYK8.js → UserProfileView-DLYWBFmP.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{f as s,j as e,
|
|
|
|
| 1 |
+
import{f as s,j as e,av as i,e as o}from"./index-CnNiludC.js";import{u as d}from"./useQuery-C87uSz9p.js";import{C as l}from"./OrganizationContributionGraph-CBDgtzLe.js";import"./skeleton-BU3tw6-C.js";import"./catalog-D7qk7tAG.js";async function c(t){const a=await fetch(o(`/api/v1/profiles/${encodeURIComponent(t)}`),{credentials:"include"});if(!a.ok)throw new Error("Profile not found");const r=await a.json();if(a.redirected){const n=decodeURIComponent(new URL(a.url).pathname.split("/").pop()||r.username);return{...r,username:n,redirected_from_alias:!0}}return r}const f=()=>{const{username:t=""}=s(),a=d({queryKey:["user-profile",t.toLowerCase()],queryFn:()=>c(t)});return a.isLoading?e.jsx("div",{className:"page",children:"Loading profile…"}):a.data?a.data.redirected_from_alias?e.jsx(i,{to:`/${a.data.username}`,replace:!0}):e.jsxs("div",{className:"page",style:{maxWidth:960},children:[e.jsxs("h1",{children:["@",a.data.username]}),e.jsx("p",{children:"Canonical Papers with Code contributions"}),e.jsx(l,{data:a.data.calendar,organizationName:`@${a.data.username}`,title:"Canonical contributions",noun:"contribution"}),a.data.is_owner&&e.jsxs("section",{className:"mt-10",children:[e.jsx("h2",{children:"Your submissions"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Limits and duplicate behavior are documented on ",e.jsx("a",{href:"/rate-limits",children:"the policy page"}),"."]}),e.jsx("div",{className:"mt-4 space-y-3",children:a.data.submissions.map(r=>e.jsxs("article",{className:"rounded-md border p-4",children:[e.jsx("strong",{children:r.edit_type})," · ",r.status,e.jsxs("details",{className:"mt-2 text-xs",children:[e.jsx("summary",{children:"Original and applied payload"}),e.jsx("pre",{children:JSON.stringify({proposed:r.proposed_payload,applied:r.applied_payload},null,2)})]}),r.review_reason&&e.jsx("p",{children:r.review_reason})]},r.id))})]})]}):e.jsx("div",{className:"page",children:e.jsx("h1",{children:"Profile not found"})})};export{f as default};
|
assets/{alert-DtuWH5Uh.js → alert-CV1yu6Q5.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as a,j as s,v as l,
|
|
|
|
| 1 |
+
import{r as a,j as s,v as l,W as i}from"./index-CnNiludC.js";const o=i("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),n=a.forwardRef(({className:e,variant:t,...r},d)=>s.jsx("div",{ref:d,role:"alert",className:l(o({variant:t}),e),...r}));n.displayName="Alert";const v=a.forwardRef(({className:e,...t},r)=>s.jsx("h5",{ref:r,className:l("mb-1 font-medium leading-none tracking-tight",e),...t}));v.displayName="AlertTitle";const c=a.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:l("text-sm [&_p]:leading-relaxed",e),...t}));c.displayName="AlertDescription";export{n as A,c as a};
|
assets/{button-Daj2z1wQ.js → button-Cb-e5tHG.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as a,j as d,
|
|
|
|
| 1 |
+
import{r as a,j as d,aj as u,v as c,W as f}from"./index-CnNiludC.js";const g=f("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),v=a.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...o},s)=>{const i=n?u:"button";return d.jsx(i,{className:c(g({variant:t,size:r,className:e})),ref:s,...o})});v.displayName="Button";export{v as B};
|
assets/catalog-Cs0CZbdz.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{ac as o}from"./index-DKw1mejm.js";function s(n,t){const e=new URLSearchParams;for(const[i,a]of Object.entries(t??{}))a!==void 0&&a!==""&&e.set(i,String(a));const r=e.toString();return`${n}${r?`?${r}`:""}`}class u{constructor(t){this.request=t}listAreas(t){return this.request(s("/areas/",t))}getArea(t){return this.request(`/areas/${t}`)}areasWithTasks(){return this.request("/areas/with-tasks/")}listTasks(t){return this.request(s("/tasks/",t))}getTask(t){return this.request(`/tasks/${t}`)}topTasks(t){return this.request(s("/tasks/top",{limit:t}))}trendingTasks(t){return this.request(s("/tasks/trending",t))}taskChildren(t,e){return this.request(s(`/tasks/${t}/children`,e))}taskParents(t){return this.request(`/tasks/${t}/parents`)}taskPage(t,e){return this.request(s(`/tasks/${t}/page`,e))}trendingBenchmarks(t,e){return this.request(s(`/tasks/${encodeURIComponent(t)}/trending-benchmarks`,e))}frameworkCatalog(){return this.request("/frameworks/")}listMethods(t){return this.request(s("/methods/",t))}getMethod(t){return this.request(`/methods/${encodeURIComponent(t)}`)}methodTrend(t,e){return this.request(s(`/methods/${encodeURIComponent(t)}/trend`,e))}listDatasets(t){const{task_id:e,...r}=t??{};return this.request(s("/datasets/",{...r,task:r.task??e}))}getDataset(t){return this.request(`/datasets/${t}`)}getDatasetBySlug(t,e){return this.request(s(`/datasets/${t}`,e))}async datasetTasks(t){return(await this.request(`/datasets/${t}/tasks/`)).results}async leaderboardMetrics(t,e){return(await this.request(`/datasets/${t}/tasks/${e}/metrics`)).metrics}metricDirections(){return this.request("/metrics/directions")}conferences(){return this.request("/conferences/")}conferenceDeadlines(){return this.request("/conferences/deadlines")}getConference(t){return this.request(`/conferences/${t}`)}conferenceAreasWithTasks(t){return this.request(`/conferences/${t}/areas-with-tasks`)}organizations(t=!1){return this.request(`/organizations/${t?"?featured_only=true":""}`)}getOrganization(t){return this.request(`/organizations/${t}`)}organizationContributions(t){return this.request(`/organizations/${t}/contributions`)}organizationAreasWithTasks(t){return this.request(`/organizations/${t}/areas-with-tasks`)}audit(t){return this.request(s("/admin/catalog-audit",{cursor:t}))}acknowledgeAudit(){return this.request("/admin/catalog-audit/acknowledge",{method:"POST"})}rollbackEvent(t){return this.request(`/admin/catalog-audit/${t}/rollback`,{method:"POST"})}}const h=new u(o);export{h as c};
|
|
|
|
|
|