nielsr HF Staff commited on
Commit
353e80e
·
verified ·
1 Parent(s): 761b00c

Sync paperswithcode.co frontend

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. assets/{AiDeadlinesView-BW_lv_KF.js → AiDeadlinesView-CMAJGG3X.js} +1 -1
  2. assets/{ApiDocsView-h05GLmUD.js → ApiDocsView-SEZXnMaD.js} +1 -1
  3. assets/{ArtifactWorkspace-DB5ujk-W.js → ArtifactWorkspace-BH6Hc7q-.js} +0 -0
  4. assets/AstraForRoboticsView-D_n_DgfT.js +1 -0
  5. assets/AstraForRoboticsView-rl6xWoM2.js +0 -1
  6. assets/AuthorDetailView-CgL14GKE.js +1 -0
  7. assets/AuthorDetailView-ZtosgsfW.js +0 -1
  8. assets/{AuthorizePaperEditView-C5tk0nzV.js → AuthorizePaperEditView-B7OCqKwd.js} +1 -1
  9. assets/{AutonomousOperations-DvIBbCjf.js → AutonomousOperations-BbZYUNrU.js} +1 -1
  10. assets/BenchmarkDetailView-BFyUPb4S.js +2 -0
  11. assets/BenchmarkDetailView-D6NploJl.js +0 -2
  12. assets/{BenchmarkTrendSparkline-D1ARsfPq.js → BenchmarkTrendSparkline-CIdyO4n1.js} +1 -1
  13. assets/ChatView-4qz_MwOa.js +0 -16
  14. assets/ChatView-C6KccNYj.js +16 -0
  15. assets/ConferenceDetailView-BHu9__gm.js +1 -0
  16. assets/ConferenceDetailView-fQMXPiiZ.js +0 -1
  17. assets/ConferenceTaskView-B0eGZQ3N.js +0 -1
  18. assets/ConferenceTaskView-D1RlMVvB.js +1 -0
  19. assets/{ConferencesIndexView-CAymeFPp.js → ConferencesIndexView-B10HZC6w.js} +1 -1
  20. assets/{CronDashboard-BnuBktOX.js → CronDashboard-C6qwAA5L.js} +1 -1
  21. assets/{ExternalSourceEvalBadge-CExXjvU3.js → ExternalSourceEvalBadge-Bq3xq4B1.js} +1 -1
  22. assets/FeedView-BchwnT7D.js +0 -1
  23. assets/FeedView-CiJI0out.js +1 -0
  24. assets/FrameworksIndexView-B246w2_2.js +1 -0
  25. assets/FrameworksIndexView-n11RduOV.js +0 -1
  26. assets/{LatexTitle-B0TwWoUu.js → LatexTitle-ih-jCKpS.js} +1 -1
  27. assets/{MarkdownText-D9cBh-rH.js → MarkdownText-kHUUjGAC.js} +1 -1
  28. assets/{McpView-DVdfRWWT.js → McpView-C3ocx0rR.js} +1 -1
  29. assets/MethodDetailView-Cw3qxOyE.js +1 -0
  30. assets/MethodDetailView-DBPaI5Ks.js +0 -1
  31. assets/{MethodsIndexView-DbwqEJrI.js → MethodsIndexView-D9UcmYcE.js} +1 -1
  32. assets/{NotFound-Db8yITOG.js → NotFound-rCpMdseu.js} +1 -1
  33. assets/{OrganizationContributionGraph-D1VOwcUX.js → OrganizationContributionGraph-MP2Tw68V.js} +1 -1
  34. assets/OrganizationDetailView-AlL95qKc.js +1 -0
  35. assets/OrganizationDetailView-a2Xbb6Ec.js +0 -1
  36. assets/{OrganizationPaperFeed-DL99kimS.js → OrganizationPaperFeed-Doln-moa.js} +1 -1
  37. assets/OrganizationTaskView-JLwOy4rM.js +1 -0
  38. assets/OrganizationTaskView-NJtPaCq0.js +0 -1
  39. assets/{OrganizationsIndexView-CM8wCqcx.js → OrganizationsIndexView-CSY2JM5r.js} +1 -1
  40. assets/{PaperDateFilter-BH56Is-x.js → PaperDateFilter-C9tnni-Y.js} +1 -1
  41. assets/PaperDetailView-BezkIl6P.js +0 -0
  42. assets/PaperDetailView-D1Y8eh6A.js +0 -0
  43. assets/{PaperPreviewLink-CpVn6ETd.js → PaperPreviewLink-CUTHdATo.js} +4 -4
  44. assets/PaperReaderView-C7w_8jdj.js +1 -0
  45. assets/PaperReaderView-WMNrI5KU.js +0 -1
  46. assets/PapersListView-BjIkvVD9.js +1 -0
  47. assets/PapersListView-g7JsSUEB.js +0 -1
  48. assets/{PrivacyView-B9McxXg9.js → PrivacyView-Dx303QiW.js} +1 -1
  49. assets/{RateLimitsView-DIlzUj6W.js → RateLimitsView-K0cHBNIJ.js} +1 -1
  50. assets/SavedPapersView-CzP8sHZl.js +1 -0
assets/{AiDeadlinesView-BW_lv_KF.js → AiDeadlinesView-CMAJGG3X.js} RENAMED
@@ -1,3 +1,3 @@
1
- import{r as x,j as t}from"./index-DVQGVzHu.js";import{u as A}from"./useQuery-tFDel9EL.js";import{c as B}from"./catalog-Da4k4qEI.js";import{S as U}from"./switch-0WHhdfPH.js";import{S as W}from"./skeleton-DJUh-5VW.js";import{A as O,a as V}from"./alert-7mO5HIuQ.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-8H_bvgui.js";import"./index-BMf_y6B1.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};
 
1
+ import{r as x,j as t}from"./index-CxdnHo9-.js";import{u as A}from"./useQuery-D8Q6gREv.js";import{c as B}from"./catalog-BRjI2ow6.js";import{S as U}from"./switch-dgYCGXB2.js";import{S as W}from"./skeleton-B_RgoAAL.js";import{A as O,a as V}from"./alert-BQ0_qoe3.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-CPQIZl1d.js";import"./index-5G8YmB7E.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/{ApiDocsView-h05GLmUD.js → ApiDocsView-SEZXnMaD.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{a0 as m,r as o,j as e}from"./index-DVQGVzHu.js";import{u as f}from"./useQuery-tFDel9EL.js";import{M as g}from"./index-VSogvUtt.js";const y={queryKey:["public-api-schema"],queryFn:()=>m("/openapi.json",{credentials:"omit"}),staleTime:5*60*1e3};function b(s,r){const n=new URLSearchParams;for(const[a,t]of Object.entries(r["x-example-parameters"]))s.includes(`{${a}}`)?s=s.replace(`{${a}}`,encodeURIComponent(String(t))):n.append(a,String(t));return`https://paperswithcode.co${s}${n.size?`?${n}`:""}`}function w(s,r){return r==="Python"?`import requests
2
 
3
  response = requests.get(${JSON.stringify(s)}, timeout=30)
4
  response.raise_for_status()
 
1
+ import{a0 as m,r as o,j as e}from"./index-CxdnHo9-.js";import{u as f}from"./useQuery-D8Q6gREv.js";import{M as g}from"./index-DFKsmHrq.js";const y={queryKey:["public-api-schema"],queryFn:()=>m("/openapi.json",{credentials:"omit"}),staleTime:5*60*1e3};function b(s,r){const n=new URLSearchParams;for(const[a,t]of Object.entries(r["x-example-parameters"]))s.includes(`{${a}}`)?s=s.replace(`{${a}}`,encodeURIComponent(String(t))):n.append(a,String(t));return`https://paperswithcode.co${s}${n.size?`?${n}`:""}`}function w(s,r){return r==="Python"?`import requests
2
 
3
  response = requests.get(${JSON.stringify(s)}, timeout=30)
4
  response.raise_for_status()
assets/{ArtifactWorkspace-DB5ujk-W.js → ArtifactWorkspace-BH6Hc7q-.js} RENAMED
The diff for this file is too large to render. See raw diff
 
assets/AstraForRoboticsView-D_n_DgfT.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{c as v,r as h,j as a,L as n}from"./index-CxdnHo9-.js";import{P as N}from"./components-BH6Cy8IX.js";import{u as P,P as k}from"./useIntersectionObserver-2PEjywgc.js";import{A,a as w}from"./alert-BQ0_qoe3.js";import{S}from"./skeleton-B_RgoAAL.js";import{u as R}from"./usePapers-CD7ebaIw.js";import{f as L,D as T}from"./latexPlainText-DI8YEXVe.js";import{t as F}from"./transform-CArGBSok.js";import"./paperQueryKeys-CcqbH5YG.js";import"./LatexTitle-ih-jCKpS.js";import"./katex.min-BSBacQyE.js";import"./papers-BwPS4QGO.js";import"./safeExternalHref-CkBrsh84.js";import"./useQuery-D8Q6gREv.js";import"./useInfiniteQuery-BUi2pe7X.js";const f="robotics",b="gpt-6-astra",I="https://x.com/YuXiang_IRVL/status/2100395131924840570",C=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],O=[{handle:"Frame_Robotics",author:"Frame Robotics",summary:"Real-arm control that fixes grip angle and carry height on the next try after a miss.",url:"https://x.com/Frame_Robotics/status/2099900836273090614"},{handle:"qineng_wang",author:"Qineng Wang",summary:"Dual-ALOHA spatial-constraint puzzles: unlocking interlocked parts and threading a rope through three rings.",url:"https://x.com/qineng_wang/status/2099893504658866561"},{handle:"__Rhodium__",author:"Lucas",summary:"In-context learning of the controls and the workspace, reaching the task goal in three tries.",url:"https://x.com/__Rhodium__/status/2099521054678925534"},{handle:"SuveenE",author:"Suveen Ellawela",summary:"Picking up a pipette and fitting a 5 mm tip on a MolmoAct2 real-world eval, using the free hand for a better view.",url:"https://x.com/SuveenE/status/2099448450341605672"},{handle:"cdngdev",author:"thijs",summary:"A robot arm with a paintbrush painting the Golden Gate Bridge, improving across attempts from camera feedback.",url:"https://x.com/cdngdev/status/2097339677128982873"},{handle:"IsaacSin12",author:"Isaac Sin",summary:"Zero-shot sorting of irregularly shaped blocks into cups by color.",url:"https://x.com/IsaacSin12/status/2096715382166098302"},{handle:"chooi_jeq",author:"Jay Chooi",summary:"Robocurve's robot-control comparison: 95% task completion versus 40% for Fable 5.1 at lower cost.",url:"https://x.com/chooi_jeq/status/2096064315115839904"}],G=[{handle:"Lingjun_Mao",author:"Lingjun Mao",summary:"Adapting to a new embodiment to put a cake into an air fryer through CuRobo motion-planning tool APIs.",url:"https://x.com/Lingjun_Mao/status/2100294902672462176"},{handle:"walterzhu8",author:"Wentao Zhu",summary:"A day-and-a-half autonomous run that builds and trains pen spinning on a Sharpa hand in Isaac Lab.",url:"https://x.com/walterzhu8/status/2100212420840989112"},{handle:"mishig25",author:"Mishig",summary:"Painting the Eiffel Tower in MuJoCo with an SO-101 and a brush, with the full experiment shared on Hugging Face.",url:"https://x.com/mishig25/status/2099611674793668676"},{handle:"RunpeiDong",author:"Runpei Dong",summary:"Getting a humanoid into a Tesla in MuJoCo: learning from feedback, then reusing that experience with egocentric perception.",url:"https://x.com/RunpeiDong/status/2099604536327614717"},{handle:"frankzydou",author:"Zhiyang (Frank) Dou",summary:"A LeRobot SO-101 real-world pickup from a third-person RGB camera, where the arm has to bend back to reach the pen.",url:"https://x.com/frankzydou/status/2099338127915512297"},{handle:"Parvkpr",author:"Parv Kapoor",summary:"Real-to-sim: building an interactive simulation environment from a single image or video.",url:"https://x.com/Parvkpr/status/2098847963867238597"},{handle:"z_code68632",author:"code_z",summary:"One demo per task: unscrewing a bottle cap, inserting a plug, clearing obstacles, and imitating a dance on a real robot.",url:"https://x.com/z_code68632/status/2098397364725895387"}],j=({posts:s,label:i})=>a.jsxs("div",{className:"astra-posts",children:[a.jsx("div",{className:"astra-posts-label",children:i}),a.jsx("ul",{children:s.map(o=>a.jsxs("li",{children:[a.jsxs("a",{href:o.url,target:"_blank",rel:"noreferrer",children:["@",o.handle]}),a.jsxs("span",{className:"astra-post-author",children:[" ",o.author]}),a.jsxs("span",{className:"astra-post-summary",children:[" — ",o.summary]})]},o.url))})]}),E=s=>s==="date_published"||s==="citation_count"?s:"trending",W=()=>{var g,x;const[s,i]=v(),o=E(s.get("order_by")),d=s.get("has_code")==="true",m=s.get("has_hf_artifacts")==="true",t=R({task:f,method:b,page_size:12,order_by:o,order_dir:"desc",include_resources:!0,has_code:d,has_hf_artifacts:m}),{targetRef:_,isIntersecting:u}=P({rootMargin:"200px"});h.useEffect(()=>(document.title=L("GPT-6 Astra for Robotics"),()=>{document.title=T}),[]),h.useEffect(()=>{u&&t.hasNextPage&&!t.isFetchingNextPage&&t.fetchNextPage()},[u,t.hasNextPage,t.isFetchingNextPage]);const p=h.useMemo(()=>{var e;return(((e=t.data)==null?void 0:e.pages)??[]).flatMap(r=>r.results.map(F))},[t.data]),y=((x=(g=t.data)==null?void 0:g.pages[0])==null?void 0:x.count)??0,c=(e,r)=>{const l=new URLSearchParams(s);r===null?l.delete(e):l.set(e,r),i(l)};return a.jsxs("div",{className:"page",children:[a.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[a.jsx(n,{to:"/",children:"Home"}),a.jsx("span",{children:" / "}),a.jsx("span",{children:"GPT-6 Astra for Robotics"})]}),a.jsx("header",{className:"feed-header",children:a.jsxs("div",{children:[a.jsx("div",{className:"astra-eyebrow",children:"Collection"}),a.jsxs("h1",{className:"feed-title",children:["GPT-6 Astra ",a.jsx("em",{children:"for Robotics"})]}),a.jsx("div",{className:"feed-subtitle",children:"Papers, technical reports, and evaluations that put OpenAI’s frontier model in control of real and simulated robots."}),a.jsxs("p",{className:"astra-lede",children:["The GPT-6 Astra launch never mentioned robots, yet within days the model was driving arms, hands, and humanoids. As"," ",a.jsx("a",{href:I,target:"_blank",rel:"noreferrer",children:"Yu Xiang"})," ","framed it, the work splits into two families: Astra acting as the robot policy itself, and Astra acting as an agent that orchestrates everything else."]})]})}),a.jsxs("section",{className:"astra-approaches","aria-label":"How GPT-6 Astra is used for robots",children:[a.jsxs("article",{className:"astra-approach",children:[a.jsx("div",{className:"astra-approach-num",children:"01 / Robot policy"}),a.jsx("h2",{children:"Astra as the policy, like a VLA"}),a.jsx("p",{children:"The model looks at camera frames and robot state and directly emits actions: end-effector poses, joint targets, or gripper commands, closing the control loop step by step with no task-specific training."}),a.jsx(j,{posts:O,label:"Seen on X"})]}),a.jsxs("article",{className:"astra-approach",children:[a.jsx("div",{className:"astra-approach-num",children:"02 / Agent"}),a.jsx("h2",{children:"Astra as the agent"}),a.jsx("p",{children:"The model reasons about the scene, writes and runs code, calls planners and tools, or delegates low-level motion to pretrained policies such as VLAs, and keeps the robot on task over long horizons."}),a.jsx(j,{posts:G,label:"Seen on X"})]})]}),a.jsxs("p",{className:"astra-note",children:["Listing is automatic: any paper tagged with both the"," ",a.jsx(n,{to:`/tasks/${f}`,children:"Robotics"})," task and the"," ",a.jsx(n,{to:`/methods/${b}`,children:"GPT-6 Astra"})," method appears here. Missing a report or preprint?"," ",a.jsx(n,{to:"/submit",children:"Submit it"}),"."]}),a.jsxs("div",{className:"task-section-head",style:{marginTop:36},children:[a.jsx("div",{className:"task-section-eyebrow",children:"Top trending · sort below"}),a.jsxs("div",{className:"task-section-title",children:["Papers ",a.jsxs("span",{className:"meta",children:["[",y.toLocaleString(),"]"]})]})]}),a.jsx("div",{className:"sort-bar",children:a.jsxs("div",{className:"paper-feed-toolbar-controls",children:[a.jsx("div",{className:"sort-options",children:C.map(([e,r])=>a.jsx("button",{type:"button",className:`sort-btn ${o===e?"active":""}`,onClick:()=>c("order_by",e==="trending"?null:e),children:r},e))}),a.jsx(k,{hasCode:d,hasHfArtifacts:m,onHasCodeChange:e=>c("has_code",e?"true":null),onHasHfArtifactsChange:e=>c("has_hf_artifacts",e?"true":null)})]})}),t.error?a.jsx(A,{variant:"destructive",children:a.jsx(w,{children:"Failed to load the collection. Please try again."})}):t.isLoading?a.jsx("div",{className:"paper-list",children:Array.from({length:3}).map((e,r)=>a.jsx(S,{className:"h-40 w-full"},r))}):p.length===0?a.jsx("div",{className:"no-results",children:"No papers match this selection yet."}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"paper-list",children:p.map((e,r)=>a.jsx(N,{paper:e,rank:r+1},e.id))}),a.jsx("div",{ref:_,style:{height:1}}),t.isFetchingNextPage&&a.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{W as default};
assets/AstraForRoboticsView-rl6xWoM2.js DELETED
@@ -1 +0,0 @@
1
- import{c as v,r as h,j as a,L as n}from"./index-DVQGVzHu.js";import{P as N}from"./components-_zRgatMC.js";import{u as P,P as k}from"./useIntersectionObserver-IRMyVQkj.js";import{A,a as w}from"./alert-7mO5HIuQ.js";import{S}from"./skeleton-DJUh-5VW.js";import{u as R}from"./usePapers-a_mp-Uw3.js";import{f as L,D as T}from"./latexPlainText-DI8YEXVe.js";import{t as F}from"./transform-PseCN9bN.js";import"./LatexTitle-B0TwWoUu.js";import"./katex.min-BSBacQyE.js";import"./papers-DlaCqfyl.js";import"./safeExternalHref-CkBrsh84.js";import"./useQuery-tFDel9EL.js";import"./useInfiniteQuery-CYdxlDgS.js";const f="robotics",b="gpt-6-astra",I="https://x.com/YuXiang_IRVL/status/2100395131924840570",C=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],O=[{handle:"Frame_Robotics",author:"Frame Robotics",summary:"Real-arm control that fixes grip angle and carry height on the next try after a miss.",url:"https://x.com/Frame_Robotics/status/2099900836273090614"},{handle:"qineng_wang",author:"Qineng Wang",summary:"Dual-ALOHA spatial-constraint puzzles: unlocking interlocked parts and threading a rope through three rings.",url:"https://x.com/qineng_wang/status/2099893504658866561"},{handle:"__Rhodium__",author:"Lucas",summary:"In-context learning of the controls and the workspace, reaching the task goal in three tries.",url:"https://x.com/__Rhodium__/status/2099521054678925534"},{handle:"SuveenE",author:"Suveen Ellawela",summary:"Picking up a pipette and fitting a 5 mm tip on a MolmoAct2 real-world eval, using the free hand for a better view.",url:"https://x.com/SuveenE/status/2099448450341605672"},{handle:"cdngdev",author:"thijs",summary:"A robot arm with a paintbrush painting the Golden Gate Bridge, improving across attempts from camera feedback.",url:"https://x.com/cdngdev/status/2097339677128982873"},{handle:"IsaacSin12",author:"Isaac Sin",summary:"Zero-shot sorting of irregularly shaped blocks into cups by color.",url:"https://x.com/IsaacSin12/status/2096715382166098302"},{handle:"chooi_jeq",author:"Jay Chooi",summary:"Robocurve's robot-control comparison: 95% task completion versus 40% for Fable 5.1 at lower cost.",url:"https://x.com/chooi_jeq/status/2096064315115839904"}],G=[{handle:"Lingjun_Mao",author:"Lingjun Mao",summary:"Adapting to a new embodiment to put a cake into an air fryer through CuRobo motion-planning tool APIs.",url:"https://x.com/Lingjun_Mao/status/2100294902672462176"},{handle:"walterzhu8",author:"Wentao Zhu",summary:"A day-and-a-half autonomous run that builds and trains pen spinning on a Sharpa hand in Isaac Lab.",url:"https://x.com/walterzhu8/status/2100212420840989112"},{handle:"mishig25",author:"Mishig",summary:"Painting the Eiffel Tower in MuJoCo with an SO-101 and a brush, with the full experiment shared on Hugging Face.",url:"https://x.com/mishig25/status/2099611674793668676"},{handle:"RunpeiDong",author:"Runpei Dong",summary:"Getting a humanoid into a Tesla in MuJoCo: learning from feedback, then reusing that experience with egocentric perception.",url:"https://x.com/RunpeiDong/status/2099604536327614717"},{handle:"frankzydou",author:"Zhiyang (Frank) Dou",summary:"A LeRobot SO-101 real-world pickup from a third-person RGB camera, where the arm has to bend back to reach the pen.",url:"https://x.com/frankzydou/status/2099338127915512297"},{handle:"Parvkpr",author:"Parv Kapoor",summary:"Real-to-sim: building an interactive simulation environment from a single image or video.",url:"https://x.com/Parvkpr/status/2098847963867238597"},{handle:"z_code68632",author:"code_z",summary:"One demo per task: unscrewing a bottle cap, inserting a plug, clearing obstacles, and imitating a dance on a real robot.",url:"https://x.com/z_code68632/status/2098397364725895387"}],j=({posts:s,label:i})=>a.jsxs("div",{className:"astra-posts",children:[a.jsx("div",{className:"astra-posts-label",children:i}),a.jsx("ul",{children:s.map(o=>a.jsxs("li",{children:[a.jsxs("a",{href:o.url,target:"_blank",rel:"noreferrer",children:["@",o.handle]}),a.jsxs("span",{className:"astra-post-author",children:[" ",o.author]}),a.jsxs("span",{className:"astra-post-summary",children:[" — ",o.summary]})]},o.url))})]}),E=s=>s==="date_published"||s==="citation_count"?s:"trending",Q=()=>{var g,x;const[s,i]=v(),o=E(s.get("order_by")),d=s.get("has_code")==="true",m=s.get("has_hf_artifacts")==="true",t=R({task:f,method:b,page_size:12,order_by:o,order_dir:"desc",include_resources:!0,has_code:d,has_hf_artifacts:m}),{targetRef:_,isIntersecting:u}=P({rootMargin:"200px"});h.useEffect(()=>(document.title=L("GPT-6 Astra for Robotics"),()=>{document.title=T}),[]),h.useEffect(()=>{u&&t.hasNextPage&&!t.isFetchingNextPage&&t.fetchNextPage()},[u,t.hasNextPage,t.isFetchingNextPage]);const p=h.useMemo(()=>{var e;return(((e=t.data)==null?void 0:e.pages)??[]).flatMap(r=>r.results.map(F))},[t.data]),y=((x=(g=t.data)==null?void 0:g.pages[0])==null?void 0:x.count)??0,c=(e,r)=>{const l=new URLSearchParams(s);r===null?l.delete(e):l.set(e,r),i(l)};return a.jsxs("div",{className:"page",children:[a.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[a.jsx(n,{to:"/",children:"Home"}),a.jsx("span",{children:" / "}),a.jsx("span",{children:"GPT-6 Astra for Robotics"})]}),a.jsx("header",{className:"feed-header",children:a.jsxs("div",{children:[a.jsx("div",{className:"astra-eyebrow",children:"Collection"}),a.jsxs("h1",{className:"feed-title",children:["GPT-6 Astra ",a.jsx("em",{children:"for Robotics"})]}),a.jsx("div",{className:"feed-subtitle",children:"Papers, technical reports, and evaluations that put OpenAI’s frontier model in control of real and simulated robots."}),a.jsxs("p",{className:"astra-lede",children:["The GPT-6 Astra launch never mentioned robots, yet within days the model was driving arms, hands, and humanoids. As"," ",a.jsx("a",{href:I,target:"_blank",rel:"noreferrer",children:"Yu Xiang"})," ","framed it, the work splits into two families: Astra acting as the robot policy itself, and Astra acting as an agent that orchestrates everything else."]})]})}),a.jsxs("section",{className:"astra-approaches","aria-label":"How GPT-6 Astra is used for robots",children:[a.jsxs("article",{className:"astra-approach",children:[a.jsx("div",{className:"astra-approach-num",children:"01 / Robot policy"}),a.jsx("h2",{children:"Astra as the policy, like a VLA"}),a.jsx("p",{children:"The model looks at camera frames and robot state and directly emits actions: end-effector poses, joint targets, or gripper commands, closing the control loop step by step with no task-specific training."}),a.jsx(j,{posts:O,label:"Seen on X"})]}),a.jsxs("article",{className:"astra-approach",children:[a.jsx("div",{className:"astra-approach-num",children:"02 / Agent"}),a.jsx("h2",{children:"Astra as the agent"}),a.jsx("p",{children:"The model reasons about the scene, writes and runs code, calls planners and tools, or delegates low-level motion to pretrained policies such as VLAs, and keeps the robot on task over long horizons."}),a.jsx(j,{posts:G,label:"Seen on X"})]})]}),a.jsxs("p",{className:"astra-note",children:["Listing is automatic: any paper tagged with both the"," ",a.jsx(n,{to:`/tasks/${f}`,children:"Robotics"})," task and the"," ",a.jsx(n,{to:`/methods/${b}`,children:"GPT-6 Astra"})," method appears here. Missing a report or preprint?"," ",a.jsx(n,{to:"/submit",children:"Submit it"}),"."]}),a.jsxs("div",{className:"task-section-head",style:{marginTop:36},children:[a.jsx("div",{className:"task-section-eyebrow",children:"Top trending · sort below"}),a.jsxs("div",{className:"task-section-title",children:["Papers ",a.jsxs("span",{className:"meta",children:["[",y.toLocaleString(),"]"]})]})]}),a.jsx("div",{className:"sort-bar",children:a.jsxs("div",{className:"paper-feed-toolbar-controls",children:[a.jsx("div",{className:"sort-options",children:C.map(([e,r])=>a.jsx("button",{type:"button",className:`sort-btn ${o===e?"active":""}`,onClick:()=>c("order_by",e==="trending"?null:e),children:r},e))}),a.jsx(k,{hasCode:d,hasHfArtifacts:m,onHasCodeChange:e=>c("has_code",e?"true":null),onHasHfArtifactsChange:e=>c("has_hf_artifacts",e?"true":null)})]})}),t.error?a.jsx(A,{variant:"destructive",children:a.jsx(w,{children:"Failed to load the collection. Please try again."})}):t.isLoading?a.jsx("div",{className:"paper-list",children:Array.from({length:3}).map((e,r)=>a.jsx(S,{className:"h-40 w-full"},r))}):p.length===0?a.jsx("div",{className:"no-results",children:"No papers match this selection yet."}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"paper-list",children:p.map((e,r)=>a.jsx(N,{paper:e,rank:r+1},e.id))}),a.jsx("div",{ref:_,style:{height:1}}),t.isFetchingNextPage&&a.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{Q as default};
 
 
assets/AuthorDetailView-CgL14GKE.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{u as m,j as e,L as f}from"./index-CxdnHo9-.js";import{p as x}from"./paperQueryKeys-CcqbH5YG.js";import{u as d}from"./useQuery-D8Q6gREv.js";import{p as h}from"./papers-BwPS4QGO.js";import{S as p}from"./skeleton-B_RgoAAL.js";import g from"./NotFound-rCpMdseu.js";const q=()=>{var i,l,n,o,u;const{authorId:a}=m(),r=d({queryKey:["author",a],queryFn:()=>h.getAuthor(a),enabled:!!a}),t=d({queryKey:[...x.feeds.author,a],queryFn:()=>h.authorPapers(a,{page:1,page_size:20}),enabled:!!a});return((i=r.error)==null?void 0:i.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:((l=r.data)==null?void 0:l.full_name)??e.jsx(p,{className:"h-10 w-64 inline-block"})}),((n=r.data)==null?void 0:n.hf_username)&&e.jsxs("a",{href:`https://huggingface.co/${r.data.hf_username}`,target:"_blank",rel:"noopener noreferrer",children:["@",r.data.hf_username," on Hugging Face"]}),e.jsxs("section",{style:{marginTop:40},"aria-labelledby":"author-papers-heading",children:[e.jsx("h2",{id:"author-papers-heading",children:"Research papers"}),t.isLoading&&e.jsx(p,{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 c=s.source==="external"?String(s.id):s.arxiv_id;return e.jsx("li",{children:e.jsx(f,{to:`/paper/${c}`,children:s.title})},s.id)})})]})]})};export{q as default};
assets/AuthorDetailView-ZtosgsfW.js DELETED
@@ -1 +0,0 @@
1
- import{u as m,j as e,L as x}from"./index-DVQGVzHu.js";import{u as h}from"./useQuery-tFDel9EL.js";import{p as d}from"./papers-DlaCqfyl.js";import{S as p}from"./skeleton-DJUh-5VW.js";import g from"./NotFound-Db8yITOG.js";const _=()=>{var i,l,n,o,u;const{authorId:a}=m(),r=h({queryKey:["author",a],queryFn:()=>d.getAuthor(a),enabled:!!a}),t=h({queryKey:["author-papers",a],queryFn:()=>d.authorPapers(a,{page:1,page_size:20}),enabled:!!a});return((i=r.error)==null?void 0:i.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:((l=r.data)==null?void 0:l.full_name)??e.jsx(p,{className:"h-10 w-64 inline-block"})}),((n=r.data)==null?void 0:n.hf_username)&&e.jsxs("a",{href:`https://huggingface.co/${r.data.hf_username}`,target:"_blank",rel:"noopener noreferrer",children:["@",r.data.hf_username," on Hugging Face"]}),e.jsxs("section",{style:{marginTop:40},"aria-labelledby":"author-papers-heading",children:[e.jsx("h2",{id:"author-papers-heading",children:"Research papers"}),t.isLoading&&e.jsx(p,{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 c=s.source==="external"?String(s.id):s.arxiv_id;return e.jsx("li",{children:e.jsx(x,{to:`/paper/${c}`,children:s.title})},s.id)})})]})]})};export{_ as default};
 
 
assets/{AuthorizePaperEditView-C5tk0nzV.js → AuthorizePaperEditView-B7OCqKwd.js} RENAMED
@@ -1 +1 @@
1
- import{u,a as d,j as e,L as l,H as p}from"./index-DVQGVzHu.js";import{u as c}from"./useQuery-tFDel9EL.js";import{u as h}from"./useMutation-Doe-Qh76.js";import{B as m}from"./button-CV3EZ-wD.js";import{p as n}from"./paperEdits-CKi6BZBP.js";function b(){const{authorizationId:t=""}=u(),{user:s,isLoading:o}=d(),i=c({queryKey:["paper-edit-authorization",t],queryFn:()=>n.authorization(t),retry:!1}),r=h({mutationFn:()=>n.approve(t)}),a=i.data;return e.jsxs("main",{className:"mx-auto max-w-xl space-y-5 px-6 py-12",children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"Authorize your agent to edit a paper"}),(i.isLoading||o)&&e.jsx("p",{children:"Loading authorization…"}),i.error&&e.jsx("p",{role:"alert",children:i.error.message}),a&&e.jsxs(e.Fragment,{children:[e.jsx(l,{className:"underline",to:`/paper/${a.paper_id}`,children:a.title}),e.jsxs("p",{children:["Check that your CLI shows this code: ",e.jsx("strong",{className:"font-mono",children:a.user_code})]}),e.jsx("p",{children:"Only approve a request you started. Your agent will be able to publish changes to this paper’s links, tags, and evaluation results for one hour, without further approval."}),e.jsx("p",{children:"Edits appear publicly under your Hugging Face username. You can edit up to 20 distinct papers per UTC day. Evaluation deletion and changes to shared benchmark definitions require an administrator."}),r.isSuccess||a.approved?e.jsx("p",{role:"status",children:"Access approved. Return to your CLI to continue."}):s?e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Signed in as ",e.jsxs("strong",{children:["@",s.username]})]}),e.jsx(m,{disabled:r.isPending||!s.can_directly_edit_catalog,onClick:()=>r.mutate(),children:r.isPending?"Authorizing…":"Authorize for one hour"}),!s.can_directly_edit_catalog&&e.jsx("p",{children:"Direct editing is unavailable for this session."})]}):e.jsx(p,{returnTo:`/authorize-paper-edit/${t}`,label:"Sign in with Hugging Face"}),r.error&&e.jsx("p",{role:"alert",children:r.error.message})]})]})}export{b as default};
 
1
+ import{u,a as d,j as e,L as l,H as p}from"./index-CxdnHo9-.js";import{u as c}from"./useQuery-D8Q6gREv.js";import{u as h}from"./useMutation-Be3gnlrL.js";import{B as m}from"./button-CdSuwKQi.js";import{p as n}from"./paperEdits-yZm35mG3.js";function b(){const{authorizationId:t=""}=u(),{user:s,isLoading:o}=d(),i=c({queryKey:["paper-edit-authorization",t],queryFn:()=>n.authorization(t),retry:!1}),r=h({mutationFn:()=>n.approve(t)}),a=i.data;return e.jsxs("main",{className:"mx-auto max-w-xl space-y-5 px-6 py-12",children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"Authorize your agent to edit a paper"}),(i.isLoading||o)&&e.jsx("p",{children:"Loading authorization…"}),i.error&&e.jsx("p",{role:"alert",children:i.error.message}),a&&e.jsxs(e.Fragment,{children:[e.jsx(l,{className:"underline",to:`/paper/${a.paper_id}`,children:a.title}),e.jsxs("p",{children:["Check that your CLI shows this code: ",e.jsx("strong",{className:"font-mono",children:a.user_code})]}),e.jsx("p",{children:"Only approve a request you started. Your agent will be able to publish changes to this paper’s links, tags, and evaluation results for one hour, without further approval."}),e.jsx("p",{children:"Edits appear publicly under your Hugging Face username. You can edit up to 20 distinct papers per UTC day. Evaluation deletion and changes to shared benchmark definitions require an administrator."}),r.isSuccess||a.approved?e.jsx("p",{role:"status",children:"Access approved. Return to your CLI to continue."}):s?e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Signed in as ",e.jsxs("strong",{children:["@",s.username]})]}),e.jsx(m,{disabled:r.isPending||!s.can_directly_edit_catalog,onClick:()=>r.mutate(),children:r.isPending?"Authorizing…":"Authorize for one hour"}),!s.can_directly_edit_catalog&&e.jsx("p",{children:"Direct editing is unavailable for this session."})]}):e.jsx(p,{returnTo:`/authorize-paper-edit/${t}`,label:"Sign in with Hugging Face"}),r.error&&e.jsx("p",{role:"alert",children:r.error.message})]})]})}export{b as default};
assets/{AutonomousOperations-DvIBbCjf.js → AutonomousOperations-BbZYUNrU.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{e as R,a as B,h as q,r as m,j as e,L as H}from"./index-DVQGVzHu.js";import{u as I}from"./useQuery-tFDel9EL.js";import{u as Q}from"./useMutation-Doe-Qh76.js";import{B as P}from"./badge-Bb6nkiIP.js";import{B as x}from"./button-CV3EZ-wD.js";import{A as D,C as n,d as i,a as t,b as r,f as h,o as u}from"./operations-y4vJd47K.js";import{I as j}from"./input-BAcBK79_.js";import{S as $}from"./shield-alert-Ca9ufK2K.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{e as R,a as B,h as q,r as m,j as e,L as H}from"./index-CxdnHo9-.js";import{u as I}from"./useQuery-D8Q6gREv.js";import{u as Q}from"./useMutation-Be3gnlrL.js";import{B as P}from"./badge-JnIJa4Y-.js";import{B as x}from"./button-CdSuwKQi.js";import{A as D,C as n,d as i,a as t,b as r,f as h,o as u}from"./operations-DS-P3qhn.js";import{I as j}from"./input-DDdJ1U-7.js";import{S as $}from"./shield-alert-WfGqRZ8o.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/BenchmarkDetailView-BFyUPb4S.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ import{r as M,j as a,t as se,L as re,b as nt,f as it,u as lt,c as ct,g as ot}from"./index-CxdnHo9-.js";import{u as J}from"./useQuery-D8Q6gREv.js";import{c as Z}from"./catalog-BRjI2ow6.js";import{C as dt,E as ut,e as mt}from"./ExternalSourceEvalBadge-Bq3xq4B1.js";import{L as ie}from"./LatexTitle-ih-jCKpS.js";import{S as ze}from"./switch-dgYCGXB2.js";import{I as ht}from"./components-BH6Cy8IX.js";import{S as ce}from"./skeleton-B_RgoAAL.js";import{A as ft,a as pt}from"./alert-BQ0_qoe3.js";import{B as gt}from"./BenchmarkTrendSparkline-CIdyO4n1.js";import{s as xt}from"./safeExternalHref-CkBrsh84.js";import{s as bt}from"./slug-BpH-Nkvz.js";import"./papers-BwPS4QGO.js";import"./hover-card-CdRF8g76.js";import"./katex.min-BSBacQyE.js";import"./index-5G8YmB7E.js";import"./paperQueryKeys-CcqbH5YG.js";import"./transform-CArGBSok.js";function yt(e,t,r){const s=t?(e??[]).filter(l=>l.task_id===t):e??[],i=s.filter(l=>l.is_open===!1),n=i.reduce((l,o)=>l?(o.best_rank??Number.POSITIVE_INFINITY)<(l.best_rank??Number.POSITIVE_INFINITY)?o:l:o,null);return{visible:r?s.filter(l=>l.is_open!==!1):s,hiddenClosed:i,topHiddenClosed:n}}function ae(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}const Ke=[{label:"All",maxParametersExclusive:void 0},{label:"<1B",maxParametersExclusive:1e9},{label:"<3B",maxParametersExclusive:3e9},{label:"<6B",maxParametersExclusive:6e9},{label:"<12B",maxParametersExclusive:12e9},{label:"<32B",maxParametersExclusive:32e9},{label:"<128B",maxParametersExclusive:128e9},{label:"<500B",maxParametersExclusive:5e11}];function wt(e){const t=e===null?void 0:Number(e);return Ke.some(r=>r.maxParametersExclusive===t)?t:void 0}function vt(e){return new Intl.NumberFormat("en",{notation:"compact",maximumSignificantDigits:3}).format(e)}function jt(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function _t(e){const t=new Map;for(const r of e){const s=jt(r),i=t.get(s);if(!i){t.set(s,{...r,metrics:{...r.metrics||{}},sourceEvaluationIds:[r.id],ranksByMetric:r.best_metric&&r.best_rank!=null?{[r.best_metric]:r.best_rank}:{},parameterCount:r.num_parameters??null,hasParameterConflict:!1});continue}i.metrics={...i.metrics,...r.metrics||{}},i.sourceEvaluationIds.push(r.id),r.best_metric&&r.best_rank!=null&&(i.ranksByMetric[r.best_metric]=r.best_rank),r.num_parameters!=null&&!i.hasParameterConflict&&(i.parameterCount===null?i.parameterCount=r.num_parameters:i.parameterCount!==r.num_parameters&&(i.parameterCount=null,i.hasParameterConflict=!0))}return Array.from(t.values())}function Le(e,t){return t===void 0?e:e.filter(r=>r.parameterCount!==null&&r.parameterCount<t)}function St(e,t){return t?e.id===t||e.sourceEvaluationIds.includes(t):!1}function Me(e,t){return e.ranksByMetric[t]??e.best_rank??9999}function kt(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const s=e.map(d=>{var A;const f=ae((A=d.metrics)==null?void 0:A[t]),g=d.paper_published_date||"";return{eval:d,value:f,date:g}}).filter(d=>d.value!==null&&!!d.date).sort((d,f)=>d.date.localeCompare(f.date)),i=[];let n=null;for(const d of s){const f=n==null?!0:r==="↓"?d.value<n:d.value>n;f&&(n=d.value),i.push({value:d.value,date:d.date,dateLabel:d.date.slice(0,7),modelName:d.eval.model_name||"",paperTitle:d.eval.paper_title||"",paperRouteId:d.eval.paper_arxiv_id||d.eval.paper_id||null,isSota:f})}const o=e.map(d=>{var f;return{eval:d,value:ae((f=d.metrics)==null?void 0:f[t])}}).filter(d=>d.value!==null).sort((d,f)=>r==="↓"?d.value-f.value:f.value-d.value)[0],u=(o==null?void 0:o.value)??0,h=(o==null?void 0:o.eval.model_name)||(o==null?void 0:o.eval.paper_title)||"";return{points:i,sota:u,sotaModel:h}}function Ge(e,t,r,s){const i=t.find(n=>n.id===s);if(e.length===0)return null;if(i!=null&&i.task_id&&e.some(n=>n.id===i.task_id))return i.task_id;if(r){const n=e.find(l=>l.slug===r);if(n)return n.id}if(e.length===1)return e[0].id;if(t.length>0){const n=new Map;for(const u of t)n.set(u.task_id,(n.get(u.task_id)||0)+1);let l=null,o=-1;for(const u of e){const h=n.get(u.id)||0;h>o&&(o=h,l=u.id)}if(l)return l}return e[0].id}function Ct(e){var K,G,O;const{evaluations:t,tasks:r,taskSlug:s,highlightEvalId:i,parameterBound:n,showMoreMetrics:l}=e,o=Ge(r,t,s,i),u=r.find(p=>p.id===o)||r[0]||null,h=t.find(p=>p.id===i),d=yt(t,o,e.hideClosed),f=_t(d.visible),g=Le(f,n),A=e.configuredMetrics.map(p=>p.metric_name),F=Array.from(new Set(f.flatMap(p=>[...p.best_metric?[p.best_metric]:[],...Object.keys(p.metrics||{})]))),x=A.length?A:F,S=new Map;for(const p of f){const c=p.best_metric;!c||ae(p.metrics[c])===null||A.length&&!x.includes(c)||S.set(c,(S.get(c)||0)+1)}const V=((K=[...S].sort((p,c)=>c[1]-p[1])[0])==null?void 0:K[0])||x[0]||"",b=x.find(p=>{var c;return p.toLocaleLowerCase()===((c=e.metric)==null?void 0:c.trim().toLocaleLowerCase())})||(h==null?void 0:h.best_metric)||V,W=((G=e.directions)==null?void 0:G.directions[b])==="lower_is_better"?"↓":"↑",R=b&&x.includes(b)?[b,...x.filter(p=>p!==b)]:x,q=R.length?l?R:R.slice(0,1):b?[b]:[],v=g.slice().sort((p,c)=>{const m=ae(p.metrics[b]),_=ae(c.metrics[b]);return m!==null&&_!==null?W==="↓"?m-_:_-m:m!==null?-1:_!==null?1:Me(p,b)-Me(c,b)});let N=null,z=0;const U=v.map((p,c)=>{const m=ae(p.metrics[b]);return m!==null&&m!==N&&(N=m,z=c+1),{evaluation:p,rank:m===null?null:z,isHighlighted:St(p,i)}}),{points:ne,sota:X,sotaModel:Y}=kt(g,b,W),k=n===void 0?e.initialSummary:void 0,H=e.ready.evaluations&&e.ready.tasks&&e.ready.directions&&(!o||e.ready.metrics),C={parameter_coverage_known:f.filter(p=>p.parameterCount!==null).length,parameter_coverage_total:f.length};return{currentTaskId:o,primaryTask:u,activeMetric:b,arrow:W,allowedMetrics:x,orderedMetrics:R,visibleMetrics:q,rows:U,chartPoints:ne,highlightedEval:((O=U.find(p=>p.isHighlighted))==null?void 0:O.evaluation)||null,hiddenClosedEvals:d.hiddenClosed,hiddenClosedTopEval:d.topHiddenClosed,parameterBound:n,parameterCoverage:C,hasParameterMetadata:C.parameter_coverage_known>0,parameterFilters:Ke.map(p=>({...p,selected:n===p.maxParametersExclusive,disabled:n!==p.maxParametersExclusive&&Le(f,p.maxParametersExclusive).length===0})),displayedMetric:H?b:k==null?void 0:k.metric,displayedSota:H?X:k==null?void 0:k.value,displayedSotaModel:H?Y:k==null?void 0:k.model_name,isSummaryLoading:!H&&!k,isInitialFilteredViewLoading:n!==void 0&&!H}}function Ie(e,t){return e?a.jsx(ie,{title:e}):t||"—"}function Et({model:e,showHarness:t,setMetric:r,highlightRowRef:s}){const{rows:i,visibleMetrics:n,activeMetric:l,arrow:o}=e,[u,h]=M.useState(null);return M.useEffect(()=>{if(!u)return;const d=()=>{u.classList.toggle("has-horizontal-overflow",u.scrollWidth>u.clientWidth)},f=new ResizeObserver(d);return f.observe(u),u.firstElementChild&&f.observe(u.firstElementChild),d(),()=>f.disconnect()},[u]),a.jsx("div",{ref:h,className:"bm-table-scroll",role:"region","aria-label":"Leaderboard metrics",tabIndex:0,children:a.jsxs("table",{id:"benchmark-leaderboard",className:"bm-table",style:{"--bm-metric-count":n.length,"--bm-harness-count":t?1:0},children:[a.jsxs("colgroup",{children:[a.jsx("col",{className:"bm-width-rank"}),a.jsx("col",{className:"bm-width-model"}),a.jsx("col",{className:"bm-width-parameters"}),t&&a.jsx("col",{className:"bm-width-harness"}),n.map(d=>a.jsx("col",{className:"bm-width-metric"},d)),a.jsx("col",{}),a.jsx("col",{className:"bm-width-year"})]}),a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{className:"col-rank",children:"Rank"}),a.jsx("th",{className:"col-model",children:"Model"}),a.jsx("th",{className:"col-parameters",children:"Parameters"}),t&&a.jsx("th",{className:"col-harness",children:"Harness"}),n.map(d=>{const f=d===l;return a.jsx("th",{className:`col-value ${f?"is-active":""}`,"aria-sort":f?o==="↓"?"ascending":"descending":"none",children:a.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>r(d),"aria-pressed":f,title:`Sort by ${d}`,children:[d,f?` ${o}`:""]})},d)}),a.jsx("th",{className:"col-paper",children:"Paper"}),a.jsx("th",{className:"col-year",children:"Year"})]})}),a.jsx("tbody",{children:i.map(({evaluation:d,rank:f,isHighlighted:g})=>{var x;const A=d.paper_arxiv_id||d.paper_id,F=d.paper_title||(d.paper_arxiv_id?`arXiv:${d.paper_arxiv_id}`:null);return a.jsxs("tr",{ref:g?s:void 0,className:g?"is-highlighted":void 0,children:[a.jsx("td",{className:"col-rank",children:f??"—"}),a.jsxs("td",{className:"col-model",children:[g&&a.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),d.hf_model_url?a.jsx("a",{href:d.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"bm-model-link",title:`Open ${d.model_name||"model"} on Hugging Face`,children:d.model_name||"—"}):d.model_name||"—",d.is_open===!1&&a.jsx(dt,{}),(d.external??d.is_external)&&a.jsx(ut,{sourceUrl:d.source_url||d.external_source_url||d.result_url})]}),a.jsx("td",{className:"col-parameters",title:d.parameterCount===null?void 0:d.parameterCount.toLocaleString("en-US"),"aria-label":d.parameterCount===null?"Parameters unknown":`${d.parameterCount.toLocaleString("en-US")} parameters`,children:d.parameterCount===null?"—":vt(d.parameterCount)}),t&&a.jsx("td",{className:"col-harness",children:d.harness||"—"}),n.map(S=>{var b;const V=S===l,B=(b=d.metrics)==null?void 0:b[S];return a.jsx("td",{className:`col-value${V?" is-active":""}${V&&f===1?" is-best":""}`,children:B!=null&&B!==""?se(B):"—"},S)}),a.jsx("td",{className:"col-paper",children:A?a.jsx(re,{to:`/paper/${A}`,title:d.paper_title||F||void 0,children:Ie(d.paper_title,F)}):Ie(d.paper_title,F)}),a.jsx("td",{className:"col-year",children:((x=d.evaluated_on||d.paper_published_date)==null?void 0:x.slice(0,4))||"—"})]},d.id)})})]})})}function Ae(e){const t=e.length===7?`${e}-01`:e,r=new Date(t).getTime();return Number.isFinite(r)?r:0}const me=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function he(e){const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()}}function Nt(e,t){if(e===t){const{year:u,month:h}=he(e);return[{timestamp:new Date(u,h,1).getTime(),key:`${u}-${h}`,label:`${me[h]} ${u}`}]}const r=he(e),s=he(t);if(r.year===s.year){const u=s.month-r.month+1;let h=1;const d=12;u>d&&(h=Math.ceil(u/d));const f=[];for(let g=r.month;g<=s.month;g+=h)f.push({timestamp:new Date(r.year,g,1).getTime(),key:`${r.year}-${g}`,label:u<=3?`${me[g]} ${r.year}`:me[g]});return f}const i=s.year-r.year+1;let n=1;const l=12;i>l&&(n=Math.ceil(i/l));const o=[];for(let u=r.year;u<=s.year;u+=n)o.push({timestamp:new Date(u,0,1).getTime(),key:String(u),label:String(u)});return o}const Rt=({points:e,metric:t})=>{const r=nt(),[s,i]=M.useState(null),n=880,l=320,o=60,u=30,h=40,d=50,f=e.map(c=>c.value),g=Math.min(...f),F=Math.max(...f)-g||1,x=n-o-u,S=l-h-d,V=e.map(c=>Ae(c.date)),B=Math.min(...V),b=Math.max(...V),W=b-B||1,R=c=>B===b?o+x/2:o+(c-B)/W*x,q=e.map((c,m)=>{const _=R(Ae(c.date)),j=(c.value-g)/F,y=h+S*(1-j);return{x:_,y,data:c,idx:m}}),v=q.filter(c=>c.data.isSota);let N="";if(v.length>=2){N=`M${v[0].x},${v[0].y}`;for(let c=1;c<v.length;c++){const m=v[c-1],_=v[c],j=(m.x+_.x)/2;N+=` C${j},${m.y} ${j},${_.y} ${_.x},${_.y}`}}const z=5.4,U=8,ne=9,X=c=>{const m=c.data.modelName||c.data.paperTitle||"";if(!m)return null;const _=m.length>22?m.slice(0,21)+"…":m,j=_.length*z;let y=c.x-j/2,E=c.x+j/2,$="middle";return y<o?(y=o,E=o+j,$="start"):E>n-u&&(E=n-u,y=E-j,$="end"),{x:$==="start"?o:$==="end"?n-u:c.x,y:c.y-ne,text:_,anchor:$,left:y,right:E}},Y=[],k=v.length>0?X(v[v.length-1]):null;let H=-1/0;for(let c=0;c<v.length-1;c++){const m=X(v[c]);m&&(m.left<H+U||k&&m.right>k.left-U||(H=m.right,Y.push({x:m.x,y:m.y,text:m.text,anchor:m.anchor})))}k&&Y.push({x:k.x,y:k.y,text:k.text,anchor:k.anchor});const C=Nt(B,b),K=5,G=c=>i(m=>m===c?null:m),O=c=>{c&&r(`/paper/${c}`)},p=(c,m)=>{const j=`${c.data.modelName||c.data.paperTitle||"Unknown model"}: ${se(c.data.value)} on ${c.data.dateLabel}`,y=!!c.data.paperRouteId;return a.jsxs("g",{children:[m,a.jsx("circle",{cx:c.x,cy:c.y,r:"10",fill:"transparent",style:{cursor:y?"pointer":"default",outline:"none"},tabIndex:0,role:y?"link":"img","aria-label":j,onMouseEnter:()=>i(c.idx),onMouseLeave:()=>G(c.idx),onFocus:()=>i(c.idx),onBlur:()=>G(c.idx),onClick:()=>O(c.data.paperRouteId),onKeyDown:E=>{y&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),O(c.data.paperRouteId))},children:a.jsx("title",{children:j})})]},c.idx)};return a.jsxs("svg",{width:"100%",viewBox:`0 0 ${n} ${l}`,style:{display:"block"},children:[a.jsx("text",{x:o-38,y:h+S/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${o-38} ${h+S/2})`,children:t}),Array.from({length:K}).map((c,m)=>{const _=m/(K-1),j=h+S*(1-_),y=g+F*_;return a.jsxs("g",{children:[a.jsx("line",{x1:o,y1:j,x2:n-u,y2:j,stroke:"var(--hairline)",strokeWidth:"1"}),a.jsx("text",{x:o-10,y:j+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:se(y)})]},m)}),C.map(c=>{const m=R(c.timestamp);return a.jsx("text",{x:m,y:l-d+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:c.label},c.key)}),q.filter(c=>!c.data.isSota).map(c=>{const m=s===c.idx;return p(c,a.jsx("circle",{cx:c.x,cy:c.y,r:m?3:2,fill:"var(--ink-faint)",opacity:m?1:.45,style:{transition:"r 0.12s ease, opacity 0.12s ease"}}))}),N&&a.jsx("path",{d:N,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),v.map(c=>{const m=s===c.idx;return p(c,a.jsx("circle",{cx:c.x,cy:c.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"}}))}),Y.map((c,m)=>a.jsx("text",{x:c.x,y:c.y,fontSize:"9.5",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:c.anchor,pointerEvents:"none",style:{paintOrder:"stroke",stroke:"var(--bg-elevated)",strokeWidth:3,strokeLinejoin:"round"},children:c.text},`label-${m}`)),s!==null&&q[s]&&(()=>{const c=q[s],m=c.data.modelName||c.data.paperTitle||"Unknown model",j=`${m.length>40?m.slice(0,39)+"…":m}: ${se(c.data.value)}`,E=Math.max(120,Math.min(340,j.length*6.6+24)),$=30;let L=c.x-E/2;L<o&&(L=o),L+E>n-u&&(L=n-u-E);const le=c.y-$-14>=h?c.y-$-12:c.y+12;return a.jsxs("g",{pointerEvents:"none",children:[a.jsx("rect",{x:L,y:le,width:E,height:$,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))"}}),a.jsx("text",{x:L+12,y:le+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:j})]})})()]})};function $t(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"),i=r.createElement("a");return r.head.appendChild(s),r.body.appendChild(i),t&&(s.href=t),i.href=e,i.href}const Pt=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function Q(e){const t=[];for(let r=0,s=e.length;r<s;r++)t.push(e[r]);return t}let ee=null;function Qe(e={}){return ee||(e.includeStyleProperties?(ee=e.includeStyleProperties,ee):(ee=Q(window.getComputedStyle(document.documentElement)),ee))}function oe(e,t){const s=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return s?parseFloat(s.replace("px","")):0}function Tt(e){const t=oe(e,"border-left-width"),r=oe(e,"border-right-width");return e.clientWidth+t+r}function Ft(e){const t=oe(e,"border-top-width"),r=oe(e,"border-bottom-width");return e.clientHeight+t+r}function Xe(e,t={}){const r=t.width||Tt(e),s=t.height||Ft(e);return{width:r,height:s}}function Lt(){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 Mt(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 It(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]),i=s.length,n=new Uint8Array(i);for(let l=0;l<i;l+=1)n[l]=s.charCodeAt(l);r(new Blob([n],{type:t.type?t.type:"image/png"}))})}function de(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 At(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Bt(e,t,r){const s="http://www.w3.org/2000/svg",i=document.createElementNS(s,"svg"),n=document.createElementNS(s,"foreignObject");return i.setAttribute("width",`${t}`),i.setAttribute("height",`${r}`),i.setAttribute("viewBox",`0 0 ${t} ${r}`),n.setAttribute("width","100%"),n.setAttribute("height","100%"),n.setAttribute("x","0"),n.setAttribute("y","0"),n.setAttribute("externalResourcesRequired","true"),i.appendChild(n),n.appendChild(e),At(i)}const I=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||I(r,t)};function Dt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Ht(e,t){return Qe(t).map(r=>{const s=e.getPropertyValue(r),i=e.getPropertyPriority(r);return`${r}: ${s}${i?" !important":""};`}).join(" ")}function Vt(e,t,r,s){const i=`.${e}:${t}`,n=r.cssText?Dt(r):Ht(r,s);return document.createTextNode(`${i}{${n}}`)}function Be(e,t,r,s){const i=window.getComputedStyle(e,r),n=i.getPropertyValue("content");if(n===""||n==="none")return;const l=Pt();try{t.className=`${t.className} ${l}`}catch{return}const o=document.createElement("style");o.appendChild(Vt(l,r,i,s)),t.appendChild(o)}function Ut(e,t,r){Be(e,t,":before",r),Be(e,t,":after",r)}const De="application/font-woff",He="image/jpeg",qt={woff:De,woff2:De,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:He,jpeg:He,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Ot(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function xe(e){const t=Ot(e).toLowerCase();return qt[t]||""}function Wt(e){return e.split(/,/)[1]}function pe(e){return e.search(/^(data:)/)!==-1}function zt(e,t){return`data:${t};base64,${e}`}async function Ye(e,t,r){const s=await fetch(e,t);if(s.status===404)throw new Error(`Resource "${s.url}" not found`);const i=await s.blob();return new Promise((n,l)=>{const o=new FileReader;o.onerror=l,o.onloadend=()=>{try{n(r({res:s,result:o.result}))}catch(u){l(u)}},o.readAsDataURL(i)})}const fe={};function Kt(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 be(e,t,r){const s=Kt(e,t,r.includeQueryParams);if(fe[s]!=null)return fe[s];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const n=await Ye(e,r.fetchRequestInit,({res:l,result:o})=>(t||(t=l.headers.get("Content-Type")||""),Wt(o)));i=zt(n,t)}catch(n){i=r.imagePlaceholder||"";let l=`Failed to fetch resource: ${e}`;n&&(l=typeof n=="string"?n:n.message),l&&console.warn(l)}return fe[s]=i,i}async function Gt(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):de(t)}async function Qt(e,t){if(e.currentSrc){const n=document.createElement("canvas"),l=n.getContext("2d");n.width=e.clientWidth,n.height=e.clientHeight,l==null||l.drawImage(e,0,0,n.width,n.height);const o=n.toDataURL();return de(o)}const r=e.poster,s=xe(r),i=await be(r,s,t);return de(i)}async function Xt(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await ue(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function Yt(e,t){return I(e,HTMLCanvasElement)?Gt(e):I(e,HTMLVideoElement)?Qt(e,t):I(e,HTMLIFrameElement)?Xt(e,t):e.cloneNode(Je(e))}const Jt=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Je=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function Zt(e,t,r){var s,i;if(Je(t))return t;let n=[];return Jt(e)&&e.assignedNodes?n=Q(e.assignedNodes()):I(e,HTMLIFrameElement)&&(!((s=e.contentDocument)===null||s===void 0)&&s.body)?n=Q(e.contentDocument.body.childNodes):n=Q(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),n.length===0||I(e,HTMLVideoElement)||await n.reduce((l,o)=>l.then(()=>ue(o,r)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function er(e,t,r){const s=t.style;if(!s)return;const i=window.getComputedStyle(e);i.cssText?(s.cssText=i.cssText,s.transformOrigin=i.transformOrigin):Qe(r).forEach(n=>{let l=i.getPropertyValue(n);n==="font-size"&&l.endsWith("px")&&(l=`${Math.floor(parseFloat(l.substring(0,l.length-2)))-.1}px`),I(e,HTMLIFrameElement)&&n==="display"&&l==="inline"&&(l="block"),n==="d"&&t.getAttribute("d")&&(l=`path(${t.getAttribute("d")})`),s.setProperty(n,l,i.getPropertyPriority(n))})}function tr(e,t){I(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),I(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function rr(e,t){if(I(e,HTMLSelectElement)){const r=t,s=Array.from(r.children).find(i=>e.value===i.getAttribute("value"));s&&s.setAttribute("selected","")}}function ar(e,t,r){return I(t,Element)&&(er(e,t,r),Ut(e,t,r),tr(e,t),rr(e,t)),t}async function sr(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const s={};for(let n=0;n<r.length;n++){const o=r[n].getAttribute("xlink:href");if(o){const u=e.querySelector(o),h=document.querySelector(o);!u&&h&&!s[o]&&(s[o]=await ue(h,t,!0))}}const i=Object.values(s);if(i.length){const n="http://www.w3.org/1999/xhtml",l=document.createElementNS(n,"svg");l.setAttribute("xmlns",n),l.style.position="absolute",l.style.width="0",l.style.height="0",l.style.overflow="hidden",l.style.display="none";const o=document.createElementNS(n,"defs");l.appendChild(o);for(let u=0;u<i.length;u++)o.appendChild(i[u]);e.appendChild(l)}return e}async function ue(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(s=>Yt(s,t)).then(s=>Zt(e,s,t)).then(s=>ar(e,s,t)).then(s=>sr(s,t))}const Ze=/url\((['"]?)([^'"]+?)\1\)/g,nr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,ir=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function lr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function cr(e){const t=[];return e.replace(Ze,(r,s,i)=>(t.push(i),r)),t.filter(r=>!pe(r))}async function or(e,t,r,s,i){try{const n=r?$t(t,r):t,l=xe(t);let o;return i||(o=await be(n,l,s)),e.replace(lr(t),`$1${o}$3`)}catch{}return e}function dr(e,{preferredFontFormat:t}){return t?e.replace(ir,r=>{for(;;){const[s,,i]=nr.exec(r)||[];if(!i)return"";if(i===t)return`src: ${s};`}}):e}function et(e){return e.search(Ze)!==-1}async function tt(e,t,r){if(!et(e))return e;const s=dr(e,r);return cr(s).reduce((n,l)=>n.then(o=>or(o,l,t,r)),Promise.resolve(s))}async function te(e,t,r){var s;const i=(s=t.style)===null||s===void 0?void 0:s.getPropertyValue(e);if(i){const n=await tt(i,null,r);return t.style.setProperty(e,n,t.style.getPropertyPriority(e)),!0}return!1}async function ur(e,t){await te("background",e,t)||await te("background-image",e,t),await te("mask",e,t)||await te("-webkit-mask",e,t)||await te("mask-image",e,t)||await te("-webkit-mask-image",e,t)}async function mr(e,t){const r=I(e,HTMLImageElement);if(!(r&&!pe(e.src))&&!(I(e,SVGImageElement)&&!pe(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,i=await be(s,xe(s),t);await new Promise((n,l)=>{e.onload=n,e.onerror=t.onImageErrorHandler?(...u)=>{try{n(t.onImageErrorHandler(...u))}catch(h){l(h)}}:l;const o=e;o.decode&&(o.decode=n),o.loading==="lazy"&&(o.loading="eager"),r?(e.srcset="",e.src=i):e.href.baseVal=i})}async function hr(e,t){const s=Q(e.childNodes).map(i=>rt(i,t));await Promise.all(s).then(()=>e)}async function rt(e,t){I(e,Element)&&(await ur(e,t),await mr(e,t),await hr(e,t))}function fr(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(i=>{r[i]=s[i]}),e}const Ve={};async function Ue(e){let t=Ve[e];if(t!=null)return t;const s=await(await fetch(e)).text();return t={url:e,cssText:s},Ve[e]=t,t}async function qe(e,t){let r=e.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,n=(r.match(/url\([^)]+\)/g)||[]).map(async l=>{let o=l.replace(s,"$1");return o.startsWith("https://")||(o=new URL(o,e.url).href),Ye(o,t.fetchRequestInit,({result:u})=>(r=r.replace(l,`url(${u})`),[l,u]))});return Promise.all(n).then(()=>r)}function Oe(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let s=e.replace(r,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const u=i.exec(s);if(u===null)break;t.push(u[0])}s=s.replace(i,"");const n=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,l="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",o=new RegExp(l,"gi");for(;;){let u=n.exec(s);if(u===null){if(u=o.exec(s),u===null)break;n.lastIndex=o.lastIndex}else o.lastIndex=n.lastIndex;t.push(u[0])}return t}async function pr(e,t){const r=[],s=[];return e.forEach(i=>{if("cssRules"in i)try{Q(i.cssRules||[]).forEach((n,l)=>{if(n.type===CSSRule.IMPORT_RULE){let o=l+1;const u=n.href,h=Ue(u).then(d=>qe(d,t)).then(d=>Oe(d).forEach(f=>{try{i.insertRule(f,f.startsWith("@import")?o+=1:i.cssRules.length)}catch(g){console.error("Error inserting rule from remote css",{rule:f,error:g})}})).catch(d=>{console.error("Error loading remote css",d.toString())});s.push(h)}})}catch(n){const l=e.find(o=>o.href==null)||document.styleSheets[0];i.href!=null&&s.push(Ue(i.href).then(o=>qe(o,t)).then(o=>Oe(o).forEach(u=>{l.insertRule(u,l.cssRules.length)})).catch(o=>{console.error("Error loading remote stylesheet",o)})),console.error("Error inlining remote css file",n)}}),Promise.all(s).then(()=>(e.forEach(i=>{if("cssRules"in i)try{Q(i.cssRules||[]).forEach(n=>{r.push(n)})}catch(n){console.error(`Error while reading CSS rules from ${i.href}`,n)}}),r))}function gr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>et(t.style.getPropertyValue("src")))}async function xr(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=Q(e.ownerDocument.styleSheets),s=await pr(r,t);return gr(s)}function at(e){return e.trim().replace(/["']/g,"")}function br(e){const t=new Set;function r(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(n=>{t.add(at(n))}),Array.from(s.children).forEach(n=>{n instanceof HTMLElement&&r(n)})}return r(e),t}async function yr(e,t){const r=await xr(e,t),s=br(e);return(await Promise.all(r.filter(n=>s.has(at(n.style.fontFamily))).map(n=>{const l=n.parentStyleSheet?n.parentStyleSheet.href:null;return tt(n.cssText,l,t)}))).join(`
2
+ `)}async function wr(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await yr(e,t);if(r){const s=document.createElement("style"),i=document.createTextNode(r);s.appendChild(i),e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}}async function vr(e,t={}){const{width:r,height:s}=Xe(e,t),i=await ue(e,t,!0);return await wr(i,t),await rt(i,t),fr(i,t),await Bt(i,r,s)}async function jr(e,t={}){const{width:r,height:s}=Xe(e,t),i=await vr(e,t),n=await de(i),l=document.createElement("canvas"),o=l.getContext("2d"),u=t.pixelRatio||Lt(),h=t.canvasWidth||r,d=t.canvasHeight||s;return l.width=h*u,l.height=d*u,t.skipAutoScale||Mt(l),l.style.width=`${h}`,l.style.height=`${d}`,t.backgroundColor&&(o.fillStyle=t.backgroundColor,o.fillRect(0,0,l.width,l.height)),o.drawImage(n,0,0,l.width,l.height),l}async function _r(e,t={}){const r=await jr(e,t);return await It(r)}const ge="#ffffff";function Sr(){return typeof window>"u"?ge:window.getComputedStyle(document.documentElement).getPropertyValue("--bg-elevated").trim()||ge}function kr(e){if(typeof window>"u")return ge;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Sr():t}async function Cr(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:kr(e)});if(!t)throw new Error("Failed to render screenshot.");await window.navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])}const st=({targetRef:e,label:t})=>{const{toast:r}=it(),[s,i]=M.useState("idle"),n=M.useRef(null);M.useEffect(()=>()=>{n.current!==null&&window.clearTimeout(n.current)},[]);const l=M.useCallback(async()=>{const u=e.current;if(u){i("copying"),u.classList.add("is-capturing"),u.offsetHeight,await new Promise(h=>window.requestAnimationFrame(()=>h()));try{await Cr(u),i("copied"),r({title:"Screenshot copied",description:`Image of the ${t} copied to your clipboard.`}),n.current!==null&&window.clearTimeout(n.current),n.current=window.setTimeout(()=>i("idle"),1500)}catch(h){i("idle"),r({title:"Copy failed",description:h instanceof Error&&h.message?h.message:"Could not copy the screenshot to your clipboard.",variant:"destructive"})}finally{u.classList.remove("is-capturing")}}},[e,t,r]),o=s==="copied"?"Copied":s==="copying"?"Copying…":"Copy image";return a.jsxs("button",{type:"button",className:"bm-copy-btn",onClick:l,disabled:s==="copying","aria-label":`Copy ${t} screenshot to clipboard`,title:`Copy ${t} screenshot to clipboard`,children:[a.jsx(ht,{name:"copy",size:11}),o]})};function Er({model:e,datasetName:t,hideClosed:r,setHideClosed:s,setMetric:i}){const n=M.useRef(null),{isInitialFilteredViewLoading:l,chartPoints:o,activeMetric:u,allowedMetrics:h,orderedMetrics:d,parameterBound:f}=e;return l||o.length===0?null:a.jsxs("div",{className:"bm-card",ref:n,children:[a.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[a.jsxs("div",{className:"bm-card-screenshot-title",children:[a.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),a.jsx("span",{className:"bm-card-screenshot-name",children:t})]}),a.jsxs("div",{className:"bm-card-screenshot-brand",children:[a.jsxs("span",{className:"brand",children:[a.jsx("span",{className:"brand-mark"}),a.jsxs("span",{className:"brand-name",children:["Papers ",a.jsx("em",{children:"With Code"})]})]}),a.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),a.jsxs("div",{className:"bm-card-head",children:[a.jsx("div",{className:"bm-card-title",children:"SOTA progression"}),a.jsxs("div",{className:"bm-card-actions",children:[h.length>1&&a.jsxs("label",{className:"bm-view-select",children:[a.jsx("span",{className:"bm-view-select-label",children:"View"}),a.jsx("select",{value:u,onChange:g=>i(g.target.value),children:d.map(g=>a.jsx("option",{value:g,children:g},g))})]}),a.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[a.jsx(ze,{className:"bm-closed-toggle-switch",checked:!r,onCheckedChange:g=>{s(!g)},"aria-label":"Show closed-source models"}),a.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),a.jsx(st,{targetRef:n,label:"SOTA chart"})]})]}),a.jsx("div",{className:"bm-chart-wrap",children:a.jsx(Rt,{points:o,metric:u})}),a.jsxs("div",{className:"bm-chart-foot",children:[a.jsx("span",{className:"legend-dot"}),f===void 0?"All models":"Filtered models"," over time · highlighted dots track the running best · hover for the model · click to open the paper"]})]})}function Nr(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 We(e,t){return e?a.jsx(ie,{title:e}):t||"—"}const Kr=()=>{var we,ve,je,_e,Se,ke,Ce,Ee,Ne,Re,$e;const{datasetSlug:e}=lt(),[t,r]=ct(),s=t.get("task")||void 0,i=t.get("eval")||void 0,n=wt(t.get("max_parameters_exclusive")),{preferences:l,setHideClosedSourceEvals:o}=ot(),u=M.useRef(null),h=M.useRef(!1),d=M.useRef(null),[f,g]=M.useState(null),A=`${e}:${s||""}`,F=f===A,x=J({queryKey:["dataset",e,"with-paper",s,l.hide_closed_source_evals?"open":"all"],queryFn:()=>Z.getDatasetBySlug(e,{include_paper:!0,task:s,is_open:l.hide_closed_source_evals?!0:void 0}),enabled:!!e,staleTime:10*60*1e3}),S=J({queryKey:["dataset-evals",(we=x.data)==null?void 0:we.id],queryFn:()=>mt.byDataset(x.data.id),enabled:!!((ve=x.data)!=null&&ve.id),staleTime:5*60*1e3}),V=J({queryKey:["dataset-tasks",(je=x.data)==null?void 0:je.id],queryFn:()=>Z.datasetTasks(x.data.id),enabled:!!((_e=x.data)!=null&&_e.id),staleTime:10*60*1e3}),B=J({queryKey:["metric-directions"],queryFn:()=>Z.metricDirections(),staleTime:60*60*1e3}),b=Ge(V.data||[],S.data||[],s,i),W=J({queryKey:["task-benchmark-trends",b,l.hide_closed_source_evals?!0:void 0],queryFn:()=>Z.trendingBenchmarks(b,{limit:100,min_recent_papers:0,is_open:l.hide_closed_source_evals?!0:void 0}),enabled:!!b&&!!((Se=x.data)!=null&&Se.id),staleTime:10*60*1e3}),R=M.useMemo(()=>{var w;return(((w=W.data)==null?void 0:w.results)||[]).find(P=>{var T;return P.id===((T=x.data)==null?void 0:T.id)})||null},[W.data,(ke=x.data)==null?void 0:ke.id]),q=J({queryKey:["leaderboard-metrics",(Ce=x.data)==null?void 0:Ce.id,b],queryFn:()=>Z.leaderboardMetrics(x.data.id,b),enabled:!!((Ee=x.data)!=null&&Ee.id)&&!!b,staleTime:10*60*1e3}),v=Ct({evaluations:S.data||[],tasks:V.data||[],configuredMetrics:q.data||[],directions:B.data,initialSummary:(Ne=x.data)==null?void 0:Ne.leaderboard_summary,taskSlug:s,highlightEvalId:i,metric:t.get("metric")||void 0,hideClosed:l.hide_closed_source_evals,parameterBound:n,showMoreMetrics:F,ready:{evaluations:S.isSuccess,tasks:V.isSuccess,directions:B.isSuccess,metrics:q.isSuccess}}),{primaryTask:N,hiddenClosedEvals:z,hiddenClosedTopEval:U,isSummaryLoading:ne,displayedMetric:X,displayedSota:Y,displayedSotaModel:k,isInitialFilteredViewLoading:H,highlightedEval:C,hasParameterMetadata:K,parameterCoverage:G,orderedMetrics:O}=v;M.useEffect(()=>{if(h.current||!i||!S.data||S.data.length===0)return;const w=u.current;w&&(h.current=!0,w.scrollIntoView({behavior:"smooth",block:"start"}))},[i,S.data]);const p=J({queryKey:["area",N==null?void 0:N.area_id],queryFn:()=>Z.getArea(N.area_id),enabled:!!(N!=null&&N.area_id),staleTime:10*60*1e3});if(x.isLoading)return a.jsxs("div",{className:"page",children:[a.jsx(ce,{className:"h-12 w-1/2 mb-6"}),a.jsx(ce,{className:"h-64 w-full"})]});if(x.error||!x.data)return a.jsx("div",{className:"page",children:a.jsx(ft,{variant:"destructive",children:a.jsx(pt,{children:"Benchmark not found."})})});const c=x.data,m=!!c.supports_harness,_=w=>{r(P=>{const T=new URLSearchParams(P);return w===void 0?T.delete("max_parameters_exclusive"):T.set("max_parameters_exclusive",String(w)),T})},j=w=>{r(P=>{const T=new URLSearchParams(P);return T.set("metric",w),T})},y=c.introducing_paper??void 0,E=(y==null?void 0:y.arxiv_id)||(y==null?void 0:y.id)||Nr(c.paper_url),$=(y==null?void 0:y.title)||c.introducing_paper_title||null,L=((Re=y==null?void 0:y.published)==null?void 0:Re.slice(0,4))||c.introduced_year||null,ye=!!E||!!c.paper_url||!!$,le=y!=null&&y.arxiv_id||($e=c.paper_url)!=null&&$e.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${E}`:`Paper ${E}`;return a.jsx("div",{className:"page",children:a.jsxs("div",{className:"bm-page",children:[a.jsxs("div",{className:"breadcrumb",children:[a.jsx(re,{to:"/tasks",children:"Tasks"}),p.data&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"sep",children:"/"}),a.jsx(re,{to:`/tasks#area-${bt(p.data.name)}`,children:p.data.name})]}),N&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"sep",children:"/"}),a.jsx(re,{to:`/tasks/${N.slug||N.id}`,children:N.name})]}),a.jsx("span",{className:"sep",children:"/"}),a.jsx("span",{style:{color:"var(--accent-text)"},children:c.name})]}),a.jsxs("div",{className:"bm-title-row",children:[a.jsx("h1",{className:"bm-title",children:c.name}),R&&a.jsxs("div",{className:"bm-title-trend","aria-label":`${c.name} reporting trend`,children:[a.jsx(gt,{history:R.history,benchmarkName:R.name}),a.jsxs("span",{className:"bm-title-trend-summary",children:[a.jsx("strong",{children:R.recent_paper_count})," ",R.recent_paper_count===1?"paper":"papers",R.rate_change==null?R.recent_paper_count>0&&a.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):a.jsxs("span",{className:`benchmark-trend-change ${R.rate_change>=1?"is-up":"is-down"}`,children:[R.rate_change>=1?"↑":"↓"," ",R.rate_change.toFixed(1),"×"]})]})]})]}),a.jsxs("div",{className:"bm-subtitle",children:[ne?a.jsx(ce,{className:"h-5 w-64 bm-summary-skeleton","aria-label":"Loading benchmark summary"}):a.jsxs("span",{children:[X&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"metric-tag",children:X}),a.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"·"})]}),k?a.jsxs("span",{children:["Best: ",a.jsx("span",{className:"best-name",children:se(Y)})," by ",a.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:k})]}):a.jsxs("span",{children:[v.rows.length," evaluations"]})]}),c.hf_url&&a.jsxs("a",{className:"bm-action-btn",href:c.hf_url,target:"_blank",rel:"noopener noreferrer",children:[a.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),c.description&&a.jsx("p",{className:"bm-description",children:c.description}),l.hide_closed_source_evals&&z.length>0&&a.jsxs("div",{className:"bm-hidden-closed-notice",children:[a.jsxs("span",{children:[z.length," closed-source ",z.length===1?"row is":"rows are"," hidden",U!=null&&U.model_name?a.jsxs(a.Fragment,{children:[", including ",a.jsx("strong",{children:U.model_name})]}):null,"."]}),a.jsx("button",{type:"button",className:"bm-hidden-closed-action",onClick:()=>{o(!1)},children:"Show closed-source"})]}),ye&&a.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[a.jsx("span",{className:"method-source-label",children:"Source"}),E?a.jsxs(re,{to:`/paper/${E}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[a.jsx("span",{className:"method-source-title",children:$?a.jsx(ie,{title:$}):le}),L&&a.jsx("span",{className:"method-source-meta",children:L})]}):c.paper_url?a.jsxs("a",{href:xt(c.paper_url)??void 0,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[a.jsx("span",{className:"method-source-title",children:$?a.jsx(ie,{title:$}):c.paper_url}),L&&a.jsx("span",{className:"method-source-meta",children:L})]}):a.jsxs("div",{className:"method-source-link is-static",children:[a.jsx("span",{className:"method-source-title",children:$?a.jsx(ie,{title:$}):null}),L&&a.jsx("span",{className:"method-source-meta",children:L})]})]}),a.jsx(Er,{model:v,datasetName:c.name,hideClosed:l.hide_closed_source_evals,setHideClosed:o,setMetric:j}),C&&(()=>{var Te,Fe;const w=C.paper_arxiv_id||C.paper_id,P=C.paper_title||(C.paper_arxiv_id?`arXiv:${C.paper_arxiv_id}`:null),T=C.best_metric&&((Te=C.metrics)==null?void 0:Te[C.best_metric])!==void 0?C.best_metric:v.activeMetric,Pe=(Fe=C.metrics)==null?void 0:Fe[T];return a.jsxs("div",{className:"bm-highlight-banner",role:"status",children:[a.jsx("span",{className:"bm-highlight-dot","aria-hidden":"true"}),a.jsxs("div",{className:"bm-highlight-text",children:[a.jsx("span",{className:"bm-highlight-label",children:"Comparing result"}),a.jsxs("span",{className:"bm-highlight-paper",children:[C.model_name||P||"—",C.harness?` · ${C.harness}`:""]}),a.jsxs("span",{className:"bm-highlight-meta",children:[Pe!==void 0&&T?a.jsxs(a.Fragment,{children:[T,": ",se(Pe),P?" · ":""]}):null,w?a.jsx(re,{to:`/paper/${w}`,children:We(C.paper_title,P)}):We(C.paper_title,P)]})]})]})})(),a.jsxs("div",{className:"bm-card",ref:d,children:[a.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[a.jsxs("div",{className:"bm-card-screenshot-title",children:[a.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),a.jsx("span",{className:"bm-card-screenshot-name",children:c.name})]}),a.jsxs("div",{className:"bm-card-screenshot-brand",children:[a.jsxs("span",{className:"brand",children:[a.jsx("span",{className:"brand-mark"}),a.jsxs("span",{className:"brand-name",children:["Papers ",a.jsx("em",{children:"With Code"})]})]}),a.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),a.jsxs("div",{className:"bm-card-head",children:[a.jsx("div",{className:"bm-card-title",children:"Leaderboard"}),a.jsxs("div",{className:"bm-card-actions",children:[v.allowedMetrics.length>1&&a.jsxs("label",{className:"bm-view-select",children:[a.jsx("span",{className:"bm-view-select-label",children:"View"}),a.jsx("select",{value:v.activeMetric,onChange:w=>j(w.target.value),children:O.map(w=>a.jsx("option",{value:w,children:w},w))})]}),a.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[a.jsx(ze,{className:"bm-closed-toggle-switch",checked:!l.hide_closed_source_evals,onCheckedChange:w=>{o(!w)},"aria-label":"Show closed-source models"}),a.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),!H&&!K&&S.isSuccess?a.jsx("span",{className:"bm-parameter-unavailable",children:"Parameter metadata unavailable"}):null,a.jsx(st,{targetRef:d,label:"leaderboard"})]})]}),!H&&K&&a.jsxs("div",{className:"bm-parameter-filter-bar",children:[a.jsx("span",{className:"bm-parameter-filter-label",children:"Parameters Size"}),a.jsx("div",{className:"bm-parameter-filter-options",role:"group","aria-label":"Filter leaderboard by parameter size",children:v.parameterFilters.map(w=>{const{selected:P,disabled:T}=w;return a.jsx("button",{type:"button",className:`bm-parameter-filter-option${P?" is-active":""}`,"aria-pressed":P,disabled:T,onClick:()=>_(w.maxParametersExclusive),children:w.label},w.label)})}),a.jsxs("span",{className:"bm-parameter-coverage",children:["Parameters known for ",G.parameter_coverage_known," of ",G.parameter_coverage_total," entries"]})]}),S.isLoading||H?a.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((w,P)=>a.jsx(ce,{className:"h-10 w-full mb-2"},P))}):v.rows.length===0?n?a.jsxs("div",{className:"no-results",children:["No known parameter counts match this filter. "," ",a.jsx("button",{type:"button",className:"bm-empty-filter-action",onClick:()=>_(void 0),children:"Show all"})]}):a.jsx("div",{className:"no-results",children:"No evaluations submitted yet."}):a.jsxs(a.Fragment,{children:[O.length>1&&a.jsxs("div",{className:"bm-metric-columns-control",children:[a.jsx("button",{type:"button",className:"bm-metric-columns-toggle","aria-expanded":F,"aria-controls":"benchmark-leaderboard",onClick:()=>g(F?null:A),children:F?"Show selected metric only":`Show more metrics (${O.length-1})`}),F&&a.jsx("span",{children:"Scroll metrics horizontally; model and paper details stay visible."})]}),a.jsx(Et,{model:v,showHarness:m,setMetric:j,highlightRowRef:u})]})]})]})})};export{Kr as default};
assets/BenchmarkDetailView-D6NploJl.js DELETED
@@ -1,2 +0,0 @@
1
- import{b as Ht,r as b,j as s,t as le,f as Vt,u as Ut,c as qt,g as Ot,L as re}from"./index-DVQGVzHu.js";import{u as Z}from"./useQuery-tFDel9EL.js";import{c as se}from"./catalog-Da4k4qEI.js";import{C as Wt,E as zt,e as Kt}from"./ExternalSourceEvalBadge-CExXjvU3.js";import{S as Se}from"./skeleton-DJUh-5VW.js";import{S as mt}from"./switch-0WHhdfPH.js";import{A as Gt,a as Qt}from"./alert-7mO5HIuQ.js";import{L as Ce}from"./LatexTitle-B0TwWoUu.js";import{B as Xt}from"./BenchmarkTrendSparkline-D1ARsfPq.js";import{I as Yt}from"./components-_zRgatMC.js";import{s as Jt}from"./safeExternalHref-CkBrsh84.js";import{s as Zt}from"./slug-BpH-Nkvz.js";import"./papers-DlaCqfyl.js";import"./hover-card-B-kPWoKE.js";import"./index-BMf_y6B1.js";import"./katex.min-BSBacQyE.js";import"./transform-PseCN9bN.js";function er(e,t,r){const a=t?(e??[]).filter(l=>l.task_id===t):e??[],n=a.filter(l=>l.is_open===!1),i=n.reduce((l,o)=>l?(o.best_rank??Number.POSITIVE_INFINITY)<(l.best_rank??Number.POSITIVE_INFINITY)?o:l:o,null);return{visible:r?a.filter(l=>l.is_open!==!1):a,hiddenClosed:n,topHiddenClosed:i}}function ht(e){const t=e.length===7?`${e}-01`:e,r=new Date(t).getTime();return Number.isFinite(r)?r:0}const Ie=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ae(e){const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()}}function tr(e,t){if(e===t){const{year:m,month:x}=Ae(e);return[{timestamp:new Date(m,x,1).getTime(),key:`${m}-${x}`,label:`${Ie[x]} ${m}`}]}const r=Ae(e),a=Ae(t);if(r.year===a.year){const m=a.month-r.month+1;let x=1;const h=12;m>h&&(x=Math.ceil(m/h));const y=[];for(let v=r.month;v<=a.month;v+=x)y.push({timestamp:new Date(r.year,v,1).getTime(),key:`${r.year}-${v}`,label:m<=3?`${Ie[v]} ${r.year}`:Ie[v]});return y}const n=a.year-r.year+1;let i=1;const l=12;n>l&&(i=Math.ceil(n/l));const o=[];for(let m=r.year;m<=a.year;m+=i)o.push({timestamp:new Date(m,0,1).getTime(),key:String(m),label:String(m)});return o}const rr=({points:e,metric:t})=>{const r=Ht(),[a,n]=b.useState(null),i=880,l=320,o=60,m=30,x=40,h=50,y=e.map(d=>d.value),v=Math.min(...y),pe=Math.max(...y)-v||1,ge=i-o-m,K=l-x-h,W=e.map(d=>ht(d.date)),_=Math.min(...W),R=Math.max(...W),G=R-_||1,ce=d=>_===R?o+ge/2:o+(d-_)/G*ge,F=e.map((d,p)=>{const g=ce(ht(d.date)),S=(d.value-v)/pe,C=x+K*(1-S);return{x:g,y:C,data:d,idx:p}}),w=F.filter(d=>d.data.isSota);let Q="";if(w.length>=2){Q=`M${w[0].x},${w[0].y}`;for(let d=1;d<w.length;d++){const p=w[d-1],g=w[d],S=(p.x+g.x)/2;Q+=` C${S},${p.y} ${S},${g.y} ${g.x},${g.y}`}}const H=5.4,ee=8,de=9,ue=d=>{const p=d.data.modelName||d.data.paperTitle||"";if(!p)return null;const g=p.length>22?p.slice(0,21)+"…":p,S=g.length*H;let C=d.x-S/2,j=d.x+S/2,I="middle";return C<o?(C=o,j=o+S,I="start"):j>i-m&&(j=i-m,C=j-S,I="end"),{x:I==="start"?o:I==="end"?i-m:d.x,y:d.y-de,text:g,anchor:I,left:C,right:j}},X=[],V=w.length>0?ue(w[w.length-1]):null;let L=-1/0;for(let d=0;d<w.length-1;d++){const p=ue(w[d]);p&&(p.left<L+ee||V&&p.right>V.left-ee||(L=p.right,X.push({x:p.x,y:p.y,text:p.text,anchor:p.anchor})))}V&&X.push({x:V.x,y:V.y,text:V.text,anchor:V.anchor});const me=tr(_,R),xe=5,Y=d=>n(p=>p===d?null:p),M=d=>{d&&r(`/paper/${d}`)},be=(d,p)=>{const S=`${d.data.modelName||d.data.paperTitle||"Unknown model"}: ${le(d.data.value)} on ${d.data.dateLabel}`,C=!!d.data.paperRouteId;return s.jsxs("g",{children:[p,s.jsx("circle",{cx:d.x,cy:d.y,r:"10",fill:"transparent",style:{cursor:C?"pointer":"default",outline:"none"},tabIndex:0,role:C?"link":"img","aria-label":S,onMouseEnter:()=>n(d.idx),onMouseLeave:()=>Y(d.idx),onFocus:()=>n(d.idx),onBlur:()=>Y(d.idx),onClick:()=>M(d.data.paperRouteId),onKeyDown:j=>{C&&(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),M(d.data.paperRouteId))},children:s.jsx("title",{children:S})})]},d.idx)};return s.jsxs("svg",{width:"100%",viewBox:`0 0 ${i} ${l}`,style:{display:"block"},children:[s.jsx("text",{x:o-38,y:x+K/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${o-38} ${x+K/2})`,children:t}),Array.from({length:xe}).map((d,p)=>{const g=p/(xe-1),S=x+K*(1-g),C=v+pe*g;return s.jsxs("g",{children:[s.jsx("line",{x1:o,y1:S,x2:i-m,y2:S,stroke:"var(--hairline)",strokeWidth:"1"}),s.jsx("text",{x:o-10,y:S+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:le(C)})]},p)}),me.map(d=>{const p=ce(d.timestamp);return s.jsx("text",{x:p,y:l-h+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:d.label},d.key)}),F.filter(d=>!d.data.isSota).map(d=>{const p=a===d.idx;return be(d,s.jsx("circle",{cx:d.x,cy:d.y,r:p?3:2,fill:"var(--ink-faint)",opacity:p?1:.45,style:{transition:"r 0.12s ease, opacity 0.12s ease"}}))}),Q&&s.jsx("path",{d:Q,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),w.map(d=>{const p=a===d.idx;return be(d,s.jsx("circle",{cx:d.x,cy:d.y,r:p?4.5:3,fill:p?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"1.5",style:{transition:"r 0.12s ease, fill 0.12s ease"}}))}),X.map((d,p)=>s.jsx("text",{x:d.x,y:d.y,fontSize:"9.5",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:d.anchor,pointerEvents:"none",style:{paintOrder:"stroke",stroke:"var(--bg-elevated)",strokeWidth:3,strokeLinejoin:"round"},children:d.text},`label-${p}`)),a!==null&&F[a]&&(()=>{const d=F[a],p=d.data.modelName||d.data.paperTitle||"Unknown model",S=`${p.length>40?p.slice(0,39)+"…":p}: ${le(d.data.value)}`,j=Math.max(120,Math.min(340,S.length*6.6+24)),I=30;let q=d.x-j/2;q<o&&(q=o),q+j>i-m&&(q=i-m-j);const ye=d.y-I-14>=x?d.y-I-12:d.y+12;return s.jsxs("g",{pointerEvents:"none",children:[s.jsx("rect",{x:q,y:ye,width:j,height:I,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))"}}),s.jsx("text",{x:q+12,y:ye+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:S})]})})()]})};function sr(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(),a=r.createElement("base"),n=r.createElement("a");return r.head.appendChild(a),r.body.appendChild(n),t&&(a.href=t),n.href=e,n.href}const ar=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function z(e){const t=[];for(let r=0,a=e.length;r<a;r++)t.push(e[r]);return t}let ae=null;function kt(e={}){return ae||(e.includeStyleProperties?(ae=e.includeStyleProperties,ae):(ae=z(window.getComputedStyle(document.documentElement)),ae))}function Ee(e,t){const a=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return a?parseFloat(a.replace("px","")):0}function nr(e){const t=Ee(e,"border-left-width"),r=Ee(e,"border-right-width");return e.clientWidth+t+r}function ir(e){const t=Ee(e,"border-top-width"),r=Ee(e,"border-bottom-width");return e.clientHeight+t+r}function Ct(e,t={}){const r=t.width||nr(e),a=t.height||ir(e);return{width:r,height:a}}function lr(){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 or(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 cr(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 a=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),n=a.length,i=new Uint8Array(n);for(let l=0;l<n;l+=1)i[l]=a.charCodeAt(l);r(new Blob([i],{type:t.type?t.type:"image/png"}))})}function Ne(e){return new Promise((t,r)=>{const a=new Image;a.onload=()=>{a.decode().then(()=>{requestAnimationFrame(()=>t(a))})},a.onerror=r,a.crossOrigin="anonymous",a.decoding="async",a.src=e})}async function dr(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function ur(e,t,r){const a="http://www.w3.org/2000/svg",n=document.createElementNS(a,"svg"),i=document.createElementNS(a,"foreignObject");return n.setAttribute("width",`${t}`),n.setAttribute("height",`${r}`),n.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"),n.appendChild(i),i.appendChild(e),dr(n)}const B=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||B(r,t)};function mr(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function hr(e,t){return kt(t).map(r=>{const a=e.getPropertyValue(r),n=e.getPropertyPriority(r);return`${r}: ${a}${n?" !important":""};`}).join(" ")}function fr(e,t,r,a){const n=`.${e}:${t}`,i=r.cssText?mr(r):hr(r,a);return document.createTextNode(`${n}{${i}}`)}function ft(e,t,r,a){const n=window.getComputedStyle(e,r),i=n.getPropertyValue("content");if(i===""||i==="none")return;const l=ar();try{t.className=`${t.className} ${l}`}catch{return}const o=document.createElement("style");o.appendChild(fr(l,r,n,a)),t.appendChild(o)}function pr(e,t,r){ft(e,t,":before",r),ft(e,t,":after",r)}const pt="application/font-woff",gt="image/jpeg",gr={woff:pt,woff2:pt,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:gt,jpeg:gt,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function xr(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Ve(e){const t=xr(e).toLowerCase();return gr[t]||""}function br(e){return e.split(/,/)[1]}function De(e){return e.search(/^(data:)/)!==-1}function yr(e,t){return`data:${t};base64,${e}`}async function Et(e,t,r){const a=await fetch(e,t);if(a.status===404)throw new Error(`Resource "${a.url}" not found`);const n=await a.blob();return new Promise((i,l)=>{const o=new FileReader;o.onerror=l,o.onloadend=()=>{try{i(r({res:a,result:o.result}))}catch(m){l(m)}},o.readAsDataURL(n)})}const Be={};function wr(e,t,r){let a=e.replace(/\?.*/,"");return r&&(a=e),/ttf|otf|eot|woff2?/i.test(a)&&(a=a.replace(/.*\//,"")),t?`[${t}]${a}`:a}async function Ue(e,t,r){const a=wr(e,t,r.includeQueryParams);if(Be[a]!=null)return Be[a];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let n;try{const i=await Et(e,r.fetchRequestInit,({res:l,result:o})=>(t||(t=l.headers.get("Content-Type")||""),br(o)));n=yr(i,t)}catch(i){n=r.imagePlaceholder||"";let l=`Failed to fetch resource: ${e}`;i&&(l=typeof i=="string"?i:i.message),l&&console.warn(l)}return Be[a]=n,n}async function vr(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):Ne(t)}async function jr(e,t){if(e.currentSrc){const i=document.createElement("canvas"),l=i.getContext("2d");i.width=e.clientWidth,i.height=e.clientHeight,l==null||l.drawImage(e,0,0,i.width,i.height);const o=i.toDataURL();return Ne(o)}const r=e.poster,a=Ve(r),n=await Ue(r,a,t);return Ne(n)}async function _r(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await Re(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function Sr(e,t){return B(e,HTMLCanvasElement)?vr(e):B(e,HTMLVideoElement)?jr(e,t):B(e,HTMLIFrameElement)?_r(e,t):e.cloneNode(Nt(e))}const kr=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Nt=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function Cr(e,t,r){var a,n;if(Nt(t))return t;let i=[];return kr(e)&&e.assignedNodes?i=z(e.assignedNodes()):B(e,HTMLIFrameElement)&&(!((a=e.contentDocument)===null||a===void 0)&&a.body)?i=z(e.contentDocument.body.childNodes):i=z(((n=e.shadowRoot)!==null&&n!==void 0?n:e).childNodes),i.length===0||B(e,HTMLVideoElement)||await i.reduce((l,o)=>l.then(()=>Re(o,r)).then(m=>{m&&t.appendChild(m)}),Promise.resolve()),t}function Er(e,t,r){const a=t.style;if(!a)return;const n=window.getComputedStyle(e);n.cssText?(a.cssText=n.cssText,a.transformOrigin=n.transformOrigin):kt(r).forEach(i=>{let l=n.getPropertyValue(i);i==="font-size"&&l.endsWith("px")&&(l=`${Math.floor(parseFloat(l.substring(0,l.length-2)))-.1}px`),B(e,HTMLIFrameElement)&&i==="display"&&l==="inline"&&(l="block"),i==="d"&&t.getAttribute("d")&&(l=`path(${t.getAttribute("d")})`),a.setProperty(i,l,n.getPropertyPriority(i))})}function Nr(e,t){B(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),B(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function Rr(e,t){if(B(e,HTMLSelectElement)){const r=t,a=Array.from(r.children).find(n=>e.value===n.getAttribute("value"));a&&a.setAttribute("selected","")}}function $r(e,t,r){return B(t,Element)&&(Er(e,t,r),pr(e,t,r),Nr(e,t),Rr(e,t)),t}async function Tr(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const a={};for(let i=0;i<r.length;i++){const o=r[i].getAttribute("xlink:href");if(o){const m=e.querySelector(o),x=document.querySelector(o);!m&&x&&!a[o]&&(a[o]=await Re(x,t,!0))}}const n=Object.values(a);if(n.length){const i="http://www.w3.org/1999/xhtml",l=document.createElementNS(i,"svg");l.setAttribute("xmlns",i),l.style.position="absolute",l.style.width="0",l.style.height="0",l.style.overflow="hidden",l.style.display="none";const o=document.createElementNS(i,"defs");l.appendChild(o);for(let m=0;m<n.length;m++)o.appendChild(n[m]);e.appendChild(l)}return e}async function Re(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(a=>Sr(a,t)).then(a=>Cr(e,a,t)).then(a=>$r(e,a,t)).then(a=>Tr(a,t))}const Rt=/url\((['"]?)([^'"]+?)\1\)/g,Pr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Fr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Lr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function Mr(e){const t=[];return e.replace(Rt,(r,a,n)=>(t.push(n),r)),t.filter(r=>!De(r))}async function Ir(e,t,r,a,n){try{const i=r?sr(t,r):t,l=Ve(t);let o;return n||(o=await Ue(i,l,a)),e.replace(Lr(t),`$1${o}$3`)}catch{}return e}function Ar(e,{preferredFontFormat:t}){return t?e.replace(Fr,r=>{for(;;){const[a,,n]=Pr.exec(r)||[];if(!n)return"";if(n===t)return`src: ${a};`}}):e}function $t(e){return e.search(Rt)!==-1}async function Tt(e,t,r){if(!$t(e))return e;const a=Ar(e,r);return Mr(a).reduce((i,l)=>i.then(o=>Ir(o,l,t,r)),Promise.resolve(a))}async function ne(e,t,r){var a;const n=(a=t.style)===null||a===void 0?void 0:a.getPropertyValue(e);if(n){const i=await Tt(n,null,r);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function Br(e,t){await ne("background",e,t)||await ne("background-image",e,t),await ne("mask",e,t)||await ne("-webkit-mask",e,t)||await ne("mask-image",e,t)||await ne("-webkit-mask-image",e,t)}async function Dr(e,t){const r=B(e,HTMLImageElement);if(!(r&&!De(e.src))&&!(B(e,SVGImageElement)&&!De(e.href.baseVal)))return;const a=r?e.src:e.href.baseVal,n=await Ue(a,Ve(a),t);await new Promise((i,l)=>{e.onload=i,e.onerror=t.onImageErrorHandler?(...m)=>{try{i(t.onImageErrorHandler(...m))}catch(x){l(x)}}:l;const o=e;o.decode&&(o.decode=i),o.loading==="lazy"&&(o.loading="eager"),r?(e.srcset="",e.src=n):e.href.baseVal=n})}async function Hr(e,t){const a=z(e.childNodes).map(n=>Pt(n,t));await Promise.all(a).then(()=>e)}async function Pt(e,t){B(e,Element)&&(await Br(e,t),await Dr(e,t),await Hr(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 a=t.style;return a!=null&&Object.keys(a).forEach(n=>{r[n]=a[n]}),e}const xt={};async function bt(e){let t=xt[e];if(t!=null)return t;const a=await(await fetch(e)).text();return t={url:e,cssText:a},xt[e]=t,t}async function yt(e,t){let r=e.cssText;const a=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async l=>{let o=l.replace(a,"$1");return o.startsWith("https://")||(o=new URL(o,e.url).href),Et(o,t.fetchRequestInit,({result:m})=>(r=r.replace(l,`url(${m})`),[l,m]))});return Promise.all(i).then(()=>r)}function wt(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let a=e.replace(r,"");const n=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const m=n.exec(a);if(m===null)break;t.push(m[0])}a=a.replace(n,"");const i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,l="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",o=new RegExp(l,"gi");for(;;){let m=i.exec(a);if(m===null){if(m=o.exec(a),m===null)break;i.lastIndex=o.lastIndex}else o.lastIndex=i.lastIndex;t.push(m[0])}return t}async function Ur(e,t){const r=[],a=[];return e.forEach(n=>{if("cssRules"in n)try{z(n.cssRules||[]).forEach((i,l)=>{if(i.type===CSSRule.IMPORT_RULE){let o=l+1;const m=i.href,x=bt(m).then(h=>yt(h,t)).then(h=>wt(h).forEach(y=>{try{n.insertRule(y,y.startsWith("@import")?o+=1:n.cssRules.length)}catch(v){console.error("Error inserting rule from remote css",{rule:y,error:v})}})).catch(h=>{console.error("Error loading remote css",h.toString())});a.push(x)}})}catch(i){const l=e.find(o=>o.href==null)||document.styleSheets[0];n.href!=null&&a.push(bt(n.href).then(o=>yt(o,t)).then(o=>wt(o).forEach(m=>{l.insertRule(m,l.cssRules.length)})).catch(o=>{console.error("Error loading remote stylesheet",o)})),console.error("Error inlining remote css file",i)}}),Promise.all(a).then(()=>(e.forEach(n=>{if("cssRules"in n)try{z(n.cssRules||[]).forEach(i=>{r.push(i)})}catch(i){console.error(`Error while reading CSS rules from ${n.href}`,i)}}),r))}function qr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>$t(t.style.getPropertyValue("src")))}async function Or(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=z(e.ownerDocument.styleSheets),a=await Ur(r,t);return qr(a)}function Ft(e){return e.trim().replace(/["']/g,"")}function Wr(e){const t=new Set;function r(a){(a.style.fontFamily||getComputedStyle(a).fontFamily).split(",").forEach(i=>{t.add(Ft(i))}),Array.from(a.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function zr(e,t){const r=await Or(e,t),a=Wr(e);return(await Promise.all(r.filter(i=>a.has(Ft(i.style.fontFamily))).map(i=>{const l=i.parentStyleSheet?i.parentStyleSheet.href:null;return Tt(i.cssText,l,t)}))).join(`
2
- `)}async function Kr(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await zr(e,t);if(r){const a=document.createElement("style"),n=document.createTextNode(r);a.appendChild(n),e.firstChild?e.insertBefore(a,e.firstChild):e.appendChild(a)}}async function Gr(e,t={}){const{width:r,height:a}=Ct(e,t),n=await Re(e,t,!0);return await Kr(n,t),await Pt(n,t),Vr(n,t),await ur(n,r,a)}async function Qr(e,t={}){const{width:r,height:a}=Ct(e,t),n=await Gr(e,t),i=await Ne(n),l=document.createElement("canvas"),o=l.getContext("2d"),m=t.pixelRatio||lr(),x=t.canvasWidth||r,h=t.canvasHeight||a;return l.width=x*m,l.height=h*m,t.skipAutoScale||or(l),l.style.width=`${x}`,l.style.height=`${h}`,t.backgroundColor&&(o.fillStyle=t.backgroundColor,o.fillRect(0,0,l.width,l.height)),o.drawImage(i,0,0,l.width,l.height),l}async function Xr(e,t={}){const r=await Qr(e,t);return await cr(r)}const He="#ffffff";function Yr(){return typeof window>"u"?He:window.getComputedStyle(document.documentElement).getPropertyValue("--bg-elevated").trim()||He}function Jr(e){if(typeof window>"u")return He;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Yr():t}async function Zr(e){var r,a;if(typeof window>"u"||!((a=(r=window.navigator)==null?void 0:r.clipboard)!=null&&a.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 Xr(e,{pixelRatio:2,cacheBust:!0,backgroundColor:Jr(e)});if(!t)throw new Error("Failed to render screenshot.");await window.navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])}const vt=({targetRef:e,label:t})=>{const{toast:r}=Vt(),[a,n]=b.useState("idle"),i=b.useRef(null);b.useEffect(()=>()=>{i.current!==null&&window.clearTimeout(i.current)},[]);const l=b.useCallback(async()=>{const m=e.current;if(m){n("copying"),m.classList.add("is-capturing"),m.offsetHeight,await new Promise(x=>window.requestAnimationFrame(()=>x()));try{await Zr(m),n("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(()=>n("idle"),1500)}catch(x){n("idle"),r({title:"Copy failed",description:x instanceof Error&&x.message?x.message:"Could not copy the screenshot to your clipboard.",variant:"destructive"})}finally{m.classList.remove("is-capturing")}}},[e,t,r]),o=a==="copied"?"Copied":a==="copying"?"Copying…":"Copy image";return s.jsxs("button",{type:"button",className:"bm-copy-btn",onClick:l,disabled:a==="copying","aria-label":`Copy ${t} screenshot to clipboard`,title:`Copy ${t} screenshot to clipboard`,children:[s.jsx(Yt,{name:"copy",size:11}),o]})};function ie(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}const Lt=[{label:"All",maxParametersExclusive:void 0},{label:"<1B",maxParametersExclusive:1e9},{label:"<3B",maxParametersExclusive:3e9},{label:"<6B",maxParametersExclusive:6e9},{label:"<12B",maxParametersExclusive:12e9},{label:"<32B",maxParametersExclusive:32e9},{label:"<128B",maxParametersExclusive:128e9},{label:"<500B",maxParametersExclusive:5e11}];function es(e){const t=e===null?void 0:Number(e);return Lt.some(r=>r.maxParametersExclusive===t)?t:void 0}function ts(e){return new Intl.NumberFormat("en",{notation:"compact",maximumSignificantDigits:3}).format(e)}function rs(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function ss(e){const t=new Map;for(const r of e){const a=rs(r),n=t.get(a);if(!n){t.set(a,{...r,metrics:{...r.metrics||{}},sourceEvaluationIds:[r.id],ranksByMetric:r.best_metric&&r.best_rank!=null?{[r.best_metric]:r.best_rank}:{},parameterCount:r.num_parameters??null,hasParameterConflict:!1});continue}n.metrics={...n.metrics,...r.metrics||{}},n.sourceEvaluationIds.push(r.id),r.best_metric&&r.best_rank!=null&&(n.ranksByMetric[r.best_metric]=r.best_rank),r.num_parameters!=null&&!n.hasParameterConflict&&(n.parameterCount===null?n.parameterCount=r.num_parameters:n.parameterCount!==r.num_parameters&&(n.parameterCount=null,n.hasParameterConflict=!0))}return Array.from(t.values())}function jt(e,t){return t===void 0?e:e.filter(r=>r.parameterCount!==null&&r.parameterCount<t)}function _t(e,t){return t?e.id===t||e.sourceEvaluationIds.includes(t):!1}function St(e,t){return e.ranksByMetric[t]??e.best_rank??9999}function as(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const a=e.map(h=>{var oe;const y=ie((oe=h.metrics)==null?void 0:oe[t]),v=h.paper_published_date||"";return{eval:h,value:y,date:v}}).filter(h=>h.value!==null&&!!h.date).sort((h,y)=>h.date.localeCompare(y.date)),n=[];let i=null;for(const h of a){const y=i==null?!0:r==="↓"?h.value<i:h.value>i;y&&(i=h.value),n.push({value:h.value,date:h.date,dateLabel:h.date.slice(0,7),modelName:h.eval.model_name||"",paperTitle:h.eval.paper_title||"",paperRouteId:h.eval.paper_arxiv_id||h.eval.paper_id||null,isSota:y})}const o=e.map(h=>{var y;return{eval:h,value:ie((y=h.metrics)==null?void 0:y[t])}}).filter(h=>h.value!==null).sort((h,y)=>r==="↓"?h.value-y.value:y.value-h.value)[0],m=(o==null?void 0:o.value)??0,x=(o==null?void 0:o.eval.model_name)||(o==null?void 0:o.eval.paper_title)||"";return{points:n,sota:m,sotaModel:x}}function ns(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 a=t.match(/^(?:https?:\/\/(?:www\.)?paperswithcode\.co)?\/paper\/([^/?#]+)/i);return(a==null?void 0:a[1])??null}function ke(e,t){return e?s.jsx(Ce,{title:e}):t||"—"}const Ss=()=>{var Ge,Qe,Xe,Ye,Je,Ze,et,tt,rt,st,at,nt,it,lt;const{datasetSlug:e}=Ut(),[t,r]=qt(),a=t.get("task")||void 0,n=t.get("eval")||void 0,i=es(t.get("max_parameters_exclusive")),{preferences:l,setHideClosedSourceEvals:o}=Ot(),m=b.useRef(null),x=b.useRef(!1),h=b.useRef(null),y=b.useRef(null),[v,oe]=b.useState(null);b.useEffect(()=>{if(!v)return;const c=()=>{v.classList.toggle("has-horizontal-overflow",v.scrollWidth>v.clientWidth)},f=new ResizeObserver(c);return f.observe(v),v.firstElementChild&&f.observe(v.firstElementChild),c(),()=>f.disconnect()},[v]);const[pe,ge]=b.useState(null),K=`${e}:${a||""}`,W=pe===K,_=Z({queryKey:["dataset",e,"with-paper",a,l.hide_closed_source_evals?"open":"all"],queryFn:()=>se.getDatasetBySlug(e,{include_paper:!0,task:a,is_open:l.hide_closed_source_evals?!0:void 0}),enabled:!!e,staleTime:10*60*1e3}),R=Z({queryKey:["dataset-evals",(Ge=_.data)==null?void 0:Ge.id],queryFn:()=>Kt.byDataset(_.data.id),enabled:!!((Qe=_.data)!=null&&Qe.id),staleTime:5*60*1e3}),G=Z({queryKey:["dataset-tasks",(Xe=_.data)==null?void 0:Xe.id],queryFn:()=>se.datasetTasks(_.data.id),enabled:!!((Ye=_.data)!=null&&Ye.id),staleTime:10*60*1e3}),ce=Z({queryKey:["metric-directions"],queryFn:()=>se.metricDirections(),staleTime:60*60*1e3}),F=b.useMemo(()=>{var c;return!n||!((c=R.data)!=null&&c.length)?null:R.data.find(f=>f.id===n)||null},[n,R.data]),w=b.useMemo(()=>{const c=G.data||[];if(c.length===0)return null;if(F!=null&&F.task_id&&c.some(u=>u.id===F.task_id))return F.task_id;if(a){const u=c.find(N=>N.slug===a);if(u)return u.id}if(c.length===1)return c[0].id;const f=R.data||[];if(f.length>0){const u=new Map;for(const k of f)u.set(k.task_id,(u.get(k.task_id)||0)+1);let N=null,P=-1;for(const k of c){const A=u.get(k.id)||0;A>P&&(P=A,N=k.id)}if(N)return N}return c[0].id},[G.data,R.data,a,F]),Q=Z({queryKey:["task-benchmark-trends",w,l.hide_closed_source_evals?!0:void 0],queryFn:()=>se.trendingBenchmarks(w,{limit:100,min_recent_papers:0,is_open:l.hide_closed_source_evals?!0:void 0}),enabled:!!w&&!!((Je=_.data)!=null&&Je.id),staleTime:10*60*1e3}),H=b.useMemo(()=>{var c;return(((c=Q.data)==null?void 0:c.results)||[]).find(f=>{var u;return f.id===((u=_.data)==null?void 0:u.id)})||null},[Q.data,(Ze=_.data)==null?void 0:Ze.id]),ee=Z({queryKey:["leaderboard-metrics",(et=_.data)==null?void 0:et.id,w],queryFn:()=>se.leaderboardMetrics(_.data.id,w),enabled:!!((tt=_.data)!=null&&tt.id)&&!!w,staleTime:10*60*1e3}),de=b.useMemo(()=>er(R.data,w,l.hide_closed_source_evals),[R.data,w,l.hide_closed_source_evals]),ue=de.visible,X=de.hiddenClosed,V=de.topHiddenClosed,L=b.useMemo(()=>ss(ue),[ue]),me=b.useMemo(()=>jt(L,i),[L,i]),xe=b.useMemo(()=>{const c=new Set;return L.forEach(f=>{f.best_metric&&c.add(f.best_metric),Object.keys(f.metrics||{}).forEach(u=>c.add(u))}),Array.from(c)},[L]),Y=b.useMemo(()=>(ee.data||[]).map(c=>c.metric_name),[ee.data]),M=Y.length?Y:xe,be=b.useMemo(()=>{var N,P;if(L.length===0)return M[0]||"";const c=new Map;for(const k of L){const A=k.best_metric;!A||ie((N=k.metrics)==null?void 0:N[A])===null||Y.length&&!M.includes(A)||c.set(A,(c.get(A)||0)+1)}let f=null,u=0;for(const[k,A]of c)A>u&&(u=A,f=k);return f||M[0]||((P=L[0])==null?void 0:P.best_metric)||""},[L,M,Y]),d=(rt=t.get("metric"))==null?void 0:rt.trim(),g=(d?M.find(c=>c.toLocaleLowerCase()===d.toLocaleLowerCase()):void 0)||(F==null?void 0:F.best_metric)||be,C=(((at=(st=ce.data)==null?void 0:st.directions)==null?void 0:at[g])||"higher_is_better")==="lower_is_better"?"↓":"↑",j=b.useMemo(()=>!g||!M.includes(g)?M:[g,...M.filter(c=>c!==g)],[M,g]),I=b.useMemo(()=>j.length===0?g?[g]:[]:W?j:j.slice(0,1),[j,g,W]),{points:q,sota:qe,sotaModel:ye}=b.useMemo(()=>as(me,g,C),[me,g,C]),O=i===void 0?(nt=_.data)==null?void 0:nt.leaderboard_summary:void 0,he=R.isSuccess&&G.isSuccess&&ce.isSuccess&&(!w||ee.isSuccess),Oe=he?g:O==null?void 0:O.metric,Mt=he?qe:O==null?void 0:O.value,We=he?ye:O==null?void 0:O.model_name,It=!he&&!O,we=i!==void 0&&!he;b.useEffect(()=>{if(x.current||!n||!R.data||R.data.length===0)return;const c=m.current;c&&(x.current=!0,c.scrollIntoView({behavior:"smooth",block:"start"}))},[n,R.data]);const U=b.useMemo(()=>{const c=G.data||[];return w?c.find(f=>f.id===w)||c[0]||null:c[0]||null},[G.data,w]),$e=Z({queryKey:["area",U==null?void 0:U.area_id],queryFn:()=>se.getArea(U.area_id),enabled:!!(U!=null&&U.area_id),staleTime:10*60*1e3});if(_.isLoading)return s.jsxs("div",{className:"page",children:[s.jsx(Se,{className:"h-12 w-1/2 mb-6"}),s.jsx(Se,{className:"h-64 w-full"})]});if(_.error||!_.data)return s.jsx("div",{className:"page",children:s.jsx(Gt,{variant:"destructive",children:s.jsx(Qt,{children:"Benchmark not found."})})});const E=_.data,ve=me.slice().sort((c,f)=>{var P,k;const u=ie((P=c.metrics)==null?void 0:P[g]),N=ie((k=f.metrics)==null?void 0:k[g]);return u!==null&&N!==null?C==="↓"?u-N:N-u:u!==null?-1:N!==null?1:St(c,g)-St(f,g)}),je=!!E.supports_harness,Te={parameter_coverage_known:L.filter(c=>c.parameterCount!==null).length,parameter_coverage_total:L.length},ze=Te.parameter_coverage_known>0,At=c=>jt(L,c).length>0,Ke=c=>{r(f=>{const u=new URLSearchParams(f);return c===void 0?u.delete("max_parameters_exclusive"):u.set("max_parameters_exclusive",String(c)),u})},Pe=c=>{r(f=>{const u=new URLSearchParams(f);return u.set("metric",c),u})},$=n&&ve.find(c=>_t(c,n))||null,T=E.introducing_paper??void 0,fe=(T==null?void 0:T.arxiv_id)||(T==null?void 0:T.id)||ns(E.paper_url),J=(T==null?void 0:T.title)||E.introducing_paper_title||null,te=((it=T==null?void 0:T.published)==null?void 0:it.slice(0,4))||E.introduced_year||null,Bt=!!fe||!!E.paper_url||!!J,Dt=T!=null&&T.arxiv_id||(lt=E.paper_url)!=null&&lt.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${fe}`:`Paper ${fe}`;return s.jsx("div",{className:"page",children:s.jsxs("div",{className:"bm-page",children:[s.jsxs("div",{className:"breadcrumb",children:[s.jsx(re,{to:"/tasks",children:"Tasks"}),$e.data&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"sep",children:"/"}),s.jsx(re,{to:`/tasks#area-${Zt($e.data.name)}`,children:$e.data.name})]}),U&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"sep",children:"/"}),s.jsx(re,{to:`/tasks/${U.slug||U.id}`,children:U.name})]}),s.jsx("span",{className:"sep",children:"/"}),s.jsx("span",{style:{color:"var(--accent-text)"},children:E.name})]}),s.jsxs("div",{className:"bm-title-row",children:[s.jsx("h1",{className:"bm-title",children:E.name}),H&&s.jsxs("div",{className:"bm-title-trend","aria-label":`${E.name} reporting trend`,children:[s.jsx(Xt,{history:H.history,benchmarkName:H.name}),s.jsxs("span",{className:"bm-title-trend-summary",children:[s.jsx("strong",{children:H.recent_paper_count})," ",H.recent_paper_count===1?"paper":"papers",H.rate_change==null?H.recent_paper_count>0&&s.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):s.jsxs("span",{className:`benchmark-trend-change ${H.rate_change>=1?"is-up":"is-down"}`,children:[H.rate_change>=1?"↑":"↓"," ",H.rate_change.toFixed(1),"×"]})]})]})]}),s.jsxs("div",{className:"bm-subtitle",children:[It?s.jsx(Se,{className:"h-5 w-64 bm-summary-skeleton","aria-label":"Loading benchmark summary"}):s.jsxs("span",{children:[Oe&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"metric-tag",children:Oe}),s.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"·"})]}),We?s.jsxs("span",{children:["Best: ",s.jsx("span",{className:"best-name",children:le(Mt)})," by ",s.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:We})]}):s.jsxs("span",{children:[ve.length," evaluations"]})]}),E.hf_url&&s.jsxs("a",{className:"bm-action-btn",href:E.hf_url,target:"_blank",rel:"noopener noreferrer",children:[s.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),E.description&&s.jsx("p",{className:"bm-description",children:E.description}),l.hide_closed_source_evals&&X.length>0&&s.jsxs("div",{className:"bm-hidden-closed-notice",children:[s.jsxs("span",{children:[X.length," closed-source ",X.length===1?"row is":"rows are"," hidden",V!=null&&V.model_name?s.jsxs(s.Fragment,{children:[", including ",s.jsx("strong",{children:V.model_name})]}):null,"."]}),s.jsx("button",{type:"button",className:"bm-hidden-closed-action",onClick:()=>{o(!1)},children:"Show closed-source"})]}),Bt&&s.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[s.jsx("span",{className:"method-source-label",children:"Source"}),fe?s.jsxs(re,{to:`/paper/${fe}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[s.jsx("span",{className:"method-source-title",children:J?s.jsx(Ce,{title:J}):Dt}),te&&s.jsx("span",{className:"method-source-meta",children:te})]}):E.paper_url?s.jsxs("a",{href:Jt(E.paper_url)??void 0,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[s.jsx("span",{className:"method-source-title",children:J?s.jsx(Ce,{title:J}):E.paper_url}),te&&s.jsx("span",{className:"method-source-meta",children:te})]}):s.jsxs("div",{className:"method-source-link is-static",children:[s.jsx("span",{className:"method-source-title",children:J?s.jsx(Ce,{title:J}):null}),te&&s.jsx("span",{className:"method-source-meta",children:te})]})]}),!we&&q.length>0&&s.jsxs("div",{className:"bm-card",ref:h,children:[s.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[s.jsxs("div",{className:"bm-card-screenshot-title",children:[s.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),s.jsx("span",{className:"bm-card-screenshot-name",children:E.name})]}),s.jsxs("div",{className:"bm-card-screenshot-brand",children:[s.jsxs("span",{className:"brand",children:[s.jsx("span",{className:"brand-mark"}),s.jsxs("span",{className:"brand-name",children:["Papers ",s.jsx("em",{children:"With Code"})]})]}),s.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),s.jsxs("div",{className:"bm-card-head",children:[s.jsx("div",{className:"bm-card-title",children:"SOTA progression"}),s.jsxs("div",{className:"bm-card-actions",children:[M.length>1&&s.jsxs("label",{className:"bm-view-select",children:[s.jsx("span",{className:"bm-view-select-label",children:"View"}),s.jsx("select",{value:g,onChange:c=>Pe(c.target.value),children:j.map(c=>s.jsx("option",{value:c,children:c},c))})]}),s.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[s.jsx(mt,{className:"bm-closed-toggle-switch",checked:!l.hide_closed_source_evals,onCheckedChange:c=>{o(!c)},"aria-label":"Show closed-source models"}),s.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),s.jsx(vt,{targetRef:h,label:"SOTA chart"})]})]}),s.jsx("div",{className:"bm-chart-wrap",children:s.jsx(rr,{points:q,metric:g})}),s.jsxs("div",{className:"bm-chart-foot",children:[s.jsx("span",{className:"legend-dot"}),i===void 0?"All models":"Filtered models"," over time · highlighted dots track the running best · hover for the model · click to open the paper"]})]}),$&&(()=>{var P,k;const c=$.paper_arxiv_id||$.paper_id,f=$.paper_title||($.paper_arxiv_id?`arXiv:${$.paper_arxiv_id}`:null),u=$.best_metric&&((P=$.metrics)==null?void 0:P[$.best_metric])!==void 0?$.best_metric:g,N=(k=$.metrics)==null?void 0:k[u];return s.jsxs("div",{className:"bm-highlight-banner",role:"status",children:[s.jsx("span",{className:"bm-highlight-dot","aria-hidden":"true"}),s.jsxs("div",{className:"bm-highlight-text",children:[s.jsx("span",{className:"bm-highlight-label",children:"Comparing result"}),s.jsxs("span",{className:"bm-highlight-paper",children:[$.model_name||f||"—",$.harness?` · ${$.harness}`:""]}),s.jsxs("span",{className:"bm-highlight-meta",children:[N!==void 0&&u?s.jsxs(s.Fragment,{children:[u,": ",le(N),f?" · ":""]}):null,c?s.jsx(re,{to:`/paper/${c}`,children:ke($.paper_title,f)}):ke($.paper_title,f)]})]})]})})(),s.jsxs("div",{className:"bm-card",ref:y,children:[s.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[s.jsxs("div",{className:"bm-card-screenshot-title",children:[s.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),s.jsx("span",{className:"bm-card-screenshot-name",children:E.name})]}),s.jsxs("div",{className:"bm-card-screenshot-brand",children:[s.jsxs("span",{className:"brand",children:[s.jsx("span",{className:"brand-mark"}),s.jsxs("span",{className:"brand-name",children:["Papers ",s.jsx("em",{children:"With Code"})]})]}),s.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),s.jsxs("div",{className:"bm-card-head",children:[s.jsx("div",{className:"bm-card-title",children:"Leaderboard"}),s.jsxs("div",{className:"bm-card-actions",children:[M.length>1&&s.jsxs("label",{className:"bm-view-select",children:[s.jsx("span",{className:"bm-view-select-label",children:"View"}),s.jsx("select",{value:g,onChange:c=>Pe(c.target.value),children:j.map(c=>s.jsx("option",{value:c,children:c},c))})]}),s.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[s.jsx(mt,{className:"bm-closed-toggle-switch",checked:!l.hide_closed_source_evals,onCheckedChange:c=>{o(!c)},"aria-label":"Show closed-source models"}),s.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),!we&&!ze&&R.isSuccess?s.jsx("span",{className:"bm-parameter-unavailable",children:"Parameter metadata unavailable"}):null,s.jsx(vt,{targetRef:y,label:"leaderboard"})]})]}),!we&&ze&&s.jsxs("div",{className:"bm-parameter-filter-bar",children:[s.jsx("span",{className:"bm-parameter-filter-label",children:"Parameters Size"}),s.jsx("div",{className:"bm-parameter-filter-options",role:"group","aria-label":"Filter leaderboard by parameter size",children:Lt.map(c=>{const f=i===c.maxParametersExclusive,u=!f&&!At(c.maxParametersExclusive);return s.jsx("button",{type:"button",className:`bm-parameter-filter-option${f?" is-active":""}`,"aria-pressed":f,disabled:u,onClick:()=>Ke(c.maxParametersExclusive),children:c.label},c.label)})}),s.jsxs("span",{className:"bm-parameter-coverage",children:["Parameters known for ",Te.parameter_coverage_known," of ",Te.parameter_coverage_total," entries"]})]}),R.isLoading||we?s.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((c,f)=>s.jsx(Se,{className:"h-10 w-full mb-2"},f))}):ve.length===0?i?s.jsxs("div",{className:"no-results",children:["No known parameter counts match this filter. "," ",s.jsx("button",{type:"button",className:"bm-empty-filter-action",onClick:()=>Ke(void 0),children:"Show all"})]}):s.jsx("div",{className:"no-results",children:"No evaluations submitted yet."}):s.jsxs(s.Fragment,{children:[j.length>1&&s.jsxs("div",{className:"bm-metric-columns-control",children:[s.jsx("button",{type:"button",className:"bm-metric-columns-toggle","aria-expanded":W,"aria-controls":"benchmark-leaderboard",onClick:()=>ge(W?null:K),children:W?"Show selected metric only":`Show more metrics (${j.length-1})`}),W&&s.jsx("span",{children:"Scroll metrics horizontally; model and paper details stay visible."})]}),s.jsx("div",{ref:oe,className:"bm-table-scroll",role:"region","aria-label":"Leaderboard metrics",tabIndex:0,children:s.jsxs("table",{id:"benchmark-leaderboard",className:"bm-table",style:{"--bm-metric-count":I.length,"--bm-harness-count":je?1:0},children:[s.jsxs("colgroup",{children:[s.jsx("col",{className:"bm-width-rank"}),s.jsx("col",{className:"bm-width-model"}),s.jsx("col",{className:"bm-width-parameters"}),je&&s.jsx("col",{className:"bm-width-harness"}),I.map(c=>s.jsx("col",{className:"bm-width-metric"},c)),s.jsx("col",{}),s.jsx("col",{className:"bm-width-year"})]}),s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"col-rank",children:"Rank"}),s.jsx("th",{className:"col-model",children:"Model"}),s.jsx("th",{className:"col-parameters",children:"Parameters"}),je&&s.jsx("th",{className:"col-harness",children:"Harness"}),I.map(c=>{const f=c===g;return s.jsx("th",{className:`col-value ${f?"is-active":""}`,"aria-sort":f?C==="↓"?"ascending":"descending":"none",children:s.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>Pe(c),"aria-pressed":f,title:`Sort by ${c}`,children:[c,f?` ${C}`:""]})},c)}),s.jsx("th",{className:"col-paper",children:"Paper"}),s.jsx("th",{className:"col-year",children:"Year"})]})}),s.jsx("tbody",{children:(()=>{let c=null,f=0;return ve.map((u,N)=>{var ot,ct;const P=ie((ot=u.metrics)==null?void 0:ot[g]);let k=null;P!==null&&((c===null||P!==c)&&(f=N+1,c=P),k=f);const A=u.paper_arxiv_id||u.paper_id,Fe=u.paper_title||(u.paper_arxiv_id?`arXiv:${u.paper_arxiv_id}`:null),Le=_t(u,n);return s.jsxs("tr",{ref:Le?m:void 0,className:Le?"is-highlighted":void 0,children:[s.jsx("td",{className:"col-rank",children:k??"—"}),s.jsxs("td",{className:"col-model",children:[Le&&s.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),u.hf_model_url?s.jsx("a",{href:u.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"bm-model-link",title:`Open ${u.model_name||"model"} on Hugging Face`,children:u.model_name||"—"}):u.model_name||"—",u.is_open===!1&&s.jsx(Wt,{}),(u.external??u.is_external)&&s.jsx(zt,{sourceUrl:u.source_url||u.external_source_url||u.result_url})]}),s.jsx("td",{className:"col-parameters",title:u.parameterCount===null?void 0:u.parameterCount.toLocaleString("en-US"),"aria-label":u.parameterCount===null?"Parameters unknown":`${u.parameterCount.toLocaleString("en-US")} parameters`,children:u.parameterCount===null?"—":ts(u.parameterCount)}),je&&s.jsx("td",{className:"col-harness",children:u.harness||"—"}),I.map(Me=>{var ut;const dt=Me===g,_e=(ut=u.metrics)==null?void 0:ut[Me];return s.jsx("td",{className:`col-value${dt?" is-active":""}${dt&&k===1?" is-best":""}`,children:_e!=null&&_e!==""?le(_e):"—"},Me)}),s.jsx("td",{className:"col-paper",children:A?s.jsx(re,{to:`/paper/${A}`,title:u.paper_title||Fe||void 0,children:ke(u.paper_title,Fe)}):ke(u.paper_title,Fe)}),s.jsx("td",{className:"col-year",children:((ct=u.evaluated_on||u.paper_published_date)==null?void 0:ct.slice(0,4))||"—"})]},u.id)})})()})]})})]})]})]})})};export{Ss as default};
 
 
 
assets/{BenchmarkTrendSparkline-D1ARsfPq.js → BenchmarkTrendSparkline-CIdyO4n1.js} RENAMED
@@ -1 +1 @@
1
- import{r as C,j as t}from"./index-DVQGVzHu.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};
 
1
+ import{r as C,j as t}from"./index-CxdnHo9-.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/ChatView-4qz_MwOa.js DELETED
@@ -1,16 +0,0 @@
1
- var nr=Object.defineProperty;var sr=(e,r,t)=>r in e?nr(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var Me=(e,r,t)=>sr(e,typeof r!="symbol"?r+"":r,t);import{e as ar,A as ir,Q as or,r as i,j as s,X as cr,f as Bt,z as ft,u as lr,b as ur,c as dr,a as fr,h as pr,S as hr,L as At,d as mr}from"./index-DVQGVzHu.js";import{u as Ut}from"./useQuery-tFDel9EL.js";import{C as gr,U as Ct,b as yr,c as ze,u as _r,d as br,A as wr,a as vr}from"./ArtifactWorkspace-DB5ujk-W.js";import{c as He}from"./chat-CSWYblIR.js";import{e as xr,f as Wt,h as Rr,T as Sr,d as Ht,i as Er,j as Tr,k as kr,l as Qe,m as Ir,t as Ot,n as ot,o as Kt,r as Ar,S as Cr,a as Or,D as Dr,s as jr,v as Nr,w as ct,x as st,y as Mr,z as at,B as it,E as Lr,F as Fr,G as Pr,H as pt,I as Yr}from"./chatLaunch-Ufg754YN.js";import{S as qr}from"./chatPrompts-CDY3UGU1.js";import{u as Br,O as Ur}from"./openrouter-CqZ6Mbgw.js";import"./katex.min-BSBacQyE.js";import"./hover-card-B-kPWoKE.js";import"./github-_b5ZsN76.js";import"./github-CUCDfz_P.js";import"./PaperPreviewLink-CpVn6ETd.js";import"./index-VSogvUtt.js";import"./index-B-ULOvtV.js";import"./papers-DlaCqfyl.js";import"./useMutation-Doe-Qh76.js";import"./copy-D4HOG4XE.js";import"./file-text-Ci1EH-su.js";import"./external-link-NJ-WhNGs.js";import"./chevron-down-BAd8ubvW.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 Wr=ar("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]),pe=(e,r)=>new Promise(t=>{const n=setTimeout(o,e);function o(){r==null||r.removeEventListener("abort",o),clearTimeout(n),t()}r==null||r.addEventListener("abort",o)}),Ee=e=>({arxiv_id:null,source:"arxiv",source_url:null,thumbnail_url:null,authors:[],published:null,conference:null,citation_count:null,tasks:[],methods:[],repositories:[],project_pages:[],...e}),Te={name:"Object Detection",slug:"object-detection"},Le={name:"Real-Time Object Detection",slug:"real-time-object-detection"},Hr={"2502.12524":{route_id:"2502.12524",title:"YOLOv12: Attention-Centric Real-Time Object Detectors",content:"Enhancing the network architecture of the YOLO framework has been crucial for a long time. This work introduces an attention-centric YOLO framework, namely YOLOv12, built around area attention and residual efficient layer aggregation networks (R-ELAN). YOLOv12-N reaches 40.6 mAP at 1.64 ms on a T4 GPU, closing the gap to attention-based detectors without the usual latency penalty and surpassing YOLOv10/YOLOv11 by +1.2–1.6 mAP at matched latency.",content_truncated:!1,metadata:Ee({arxiv_id:"2502.12524",authors:[{name:"Y. Tian"},{name:"Q. Ye"},{name:"D. Doermann"}],published:"2025-02-18",citation_count:412,tasks:[Te,Le],methods:[{name:"Area Attention",slug:"area-attention"}],repositories:[{url:"https://github.com/sunsmarterjie/yolov12",stars:18700}]})},"2407.17140":{route_id:"2407.17140",title:"RT-DETRv2: Improved Baseline with Bag-of-Freebies for Real-Time Detection",content:"RT-DETRv2 improves the real-time DETR baseline with selective multi-scale feature extraction, a discrete sampling operator to ease deployment, and training-only 'bag-of-freebies' that add no inference cost. RT-DETRv2-R18/R50/R101 reach 47.9 / 53.4 / 54.3 mAP on COCO at 217 / 108 / 74 FPS on T4 TensorRT FP16, remaining NMS-free end to end.",content_truncated:!1,metadata:Ee({arxiv_id:"2407.17140",authors:[{name:"W. Lv"},{name:"Y. Zhao"},{name:"J. Chang"}],published:"2024-07-24",citation_count:268,tasks:[Te,Le],methods:[{name:"DETR",slug:"detr"}],repositories:[{url:"https://github.com/lyuwenyu/RT-DETR",stars:9400}]})},"2410.13842":{route_id:"2410.13842",title:"D-FINE: Redefining Regression as Fine-grained Distribution Refinement",content:"D-FINE reformulates bounding-box regression in DETR-style detectors as iterative refinement of probability distributions (FDR) and adds a localization self-distillation scheme (GO-LSD). D-FINE-L reaches 54.0 mAP at ~9 ms and D-FINE-X 55.8 mAP on COCO while staying real-time on modern GPUs, dominating RT-DETRv2 and YOLOv10 on the accuracy–latency Pareto front.",content_truncated:!1,metadata:Ee({arxiv_id:"2410.13842",authors:[{name:"Y. Peng"},{name:"H. Li"},{name:"P. Wu"}],published:"2024-10-17",conference:"ICLR 2025",citation_count:187,tasks:[Te,Le],methods:[{name:"Knowledge Distillation",slug:"knowledge-distillation"}],repositories:[{url:"https://github.com/Peterande/D-FINE",stars:12100}]})},"2406.03459":{route_id:"2406.03459",title:"LW-DETR: A Transformer Replacement to YOLO for Real-Time Detection",content:"LW-DETR pairs a plain ViT encoder with a lightweight DETR decoder and shows the combination outperforms YOLOv8 and YOLO-NAS at comparable latency, arguing transformer detectors are viable even at the fast end of the accuracy–latency curve. Uses multi-level feature aggregation, window-attention interleaving, and IoU-aware classification.",content_truncated:!1,metadata:Ee({arxiv_id:"2406.03459",authors:[{name:"Q. Chen"},{name:"X. Su"},{name:"X. Zhang"}],published:"2024-06-05",citation_count:94,tasks:[Te,Le],methods:[{name:"Vision Transformer",slug:"vision-transformer"}],repositories:[{url:"https://github.com/Atten4Vis/LW-DETR",stars:5200}]})},"2304.08069":{route_id:"2304.08069",title:"DETRs Beat YOLOs on Real-time Object Detection",content:"RT-DETR is the first real-time end-to-end object detector, built on an efficient hybrid encoder that decouples intra-scale interaction and cross-scale fusion, plus IoU-aware query selection. RT-DETR-R50 achieves 53.1 mAP at 108 FPS on COCO, beating comparably sized YOLO detectors in both speed and accuracy while eliminating NMS entirely; its Figure 1 accuracy–latency plot became the reference for later real-time detectors.",content_truncated:!1,metadata:Ee({arxiv_id:"2304.08069",authors:[{name:"Y. Zhao"},{name:"W. Lv"},{name:"S. Xu"}],published:"2023-04-17",conference:"CVPR 2024",citation_count:2310,tasks:[Te,Le],methods:[{name:"DETR",slug:"detr"}],repositories:[{url:"https://github.com/lyuwenyu/RT-DETR",stars:9400}]})},"2405.14458":{route_id:"2405.14458",title:"YOLOv10: Real-Time End-to-End Object Detection",content:"YOLOv10 removes NMS from the YOLO pipeline via consistent dual assignments during training and applies a holistic efficiency–accuracy driven design across the architecture. YOLOv10-S is 1.8x faster than RT-DETR-R18 at similar COCO accuracy; the family spans 46.3–54.4 mAP with substantially lower end-to-end latency than prior YOLOs because post-processing disappears.",content_truncated:!1,metadata:Ee({arxiv_id:"2405.14458",authors:[{name:"A. Wang"},{name:"H. Chen"},{name:"L. Liu"}],published:"2024-05-23",conference:"NeurIPS 2024",citation_count:1650,tasks:[Te,Le],methods:[{name:"NMS-free Training",slug:"nms-free-training"}],repositories:[{url:"https://github.com/THU-MIG/yolov10",stars:44200}]})},"2401.17270":{route_id:"2401.17270",title:"YOLO-World: Real-Time Open-Vocabulary Object Detection",content:"YOLO-World extends the YOLO paradigm to open-vocabulary detection through vision-language modeling with a re-parameterizable vision-language path aggregation network (RepVL-PAN) and region-text contrastive pretraining. It detects categories never seen at training time while running at 35+ FPS, and its prompt-then-detect deployment re-parameterizes text embeddings for zero runtime text-encoder cost.",content_truncated:!1,metadata:Ee({arxiv_id:"2401.17270",authors:[{name:"T. Cheng"},{name:"L. Song"},{name:"Y. Ge"}],published:"2024-01-30",conference:"CVPR 2024",citation_count:890,tasks:[{name:"Open-Vocabulary Object Detection",slug:"open-vocabulary-object-detection"},Te],methods:[{name:"Contrastive Learning",slug:"contrastive-learning"}],repositories:[{url:"https://github.com/AILab-CVC/YOLO-World",stars:16800}]})},158342:{route_id:"158342",title:"Ultralytics YOLO: real-time detection framework and model zoo",content:"Official Ultralytics framework release covering YOLO11 and YOLOv12 deployment: pretrained COCO checkpoints from nano to x-large, TensorRT/ONNX/CoreML export paths, and reproducible latency benchmarks on T4, Jetson Orin, and CPU targets. Widely used as the practical baseline for real-time detection deployments.",content_truncated:!1,metadata:Ee({source:"external",source_url:"https://docs.ultralytics.com/models/",authors:[{name:"Ultralytics"}],published:"2025-01-02",tasks:[Te,Le],repositories:[{url:"https://github.com/ultralytics/ultralytics",stars:46e3}],project_pages:[{url:"https://docs.ultralytics.com"}]})}},Vt=e=>e.map(r=>Hr[r]),Dt=Vt(["2502.12524","2407.17140","2410.13842","2406.03459","2304.08069","2405.14458","2401.17270","158342"]),jt=Vt(["2410.13842","2502.12524","2407.17140","2405.14458","2304.08069"]),Nt="The user wants the current state-of-the-art for real-time object detection. That's a moving target split across two lineages — the YOLO family (fast CNN one-stage detectors) and the DETR family (transformer, end-to-end, NMS-free). I should ground the answer in recent papers benchmarked on COCO with reported latency or FPS, not just accuracy. Let me start with a broad hybrid search, see which papers surface, then run a second, narrower query to pin down the head-to-head COCO mAP vs latency trade-offs before I write anything.",Mt="Good — both lineages are well represented. YOLOv12, YOLOv10 and RT-DETRv2 / D-FINE keep coming up. To actually rank them I need the accuracy-vs-latency numbers side by side on the same COCO val2017 protocol, so let me narrow the query to the benchmark comparison specifically.",Lt=`There isn't a single winner — real-time object detection in 2026 is a two-horse race between the [YOLO family](paper:2502.12524) (fast one-stage CNNs) and the end-to-end [DETR family](paper:2304.08069) (NMS-free transformers). Which one is “SOTA” depends entirely on where you sit on the accuracy-vs-latency curve.
7
-
8
- **At the fast / edge end**, [YOLOv12](paper:2502.12524) is the current leader. Its area-attention design pushes attention into the YOLO backbone without the usual latency hit — YOLOv12-N reaches 40.6 mAP at ~1.6 ms on a T4, roughly +1.5 mAP over [YOLOv10](paper:2405.14458) at matched speed. [YOLOv10](paper:2405.14458) is still very relevant because it made the YOLO head NMS-free, cutting real end-to-end latency.
9
-
10
- **At the high-accuracy end**, the transformer detectors win. [D-FINE](paper:2410.13842) currently holds the accuracy-latency Pareto front, reporting 55.8 mAP by reformulating box regression as fine-grained distribution refinement with self-distillation. It builds on [RT-DETRv2](paper:2407.17140), which hardened the [original RT-DETR](paper:2304.08069) recipe (the paper that first showed DETRs beating YOLOs in real time) with training-only “bag-of-freebies” that add no inference cost.
11
-
12
- **My recommendation:** for edge or high-FPS deployment, start with [YOLOv12](paper:2502.12524) — the [Ultralytics framework](paper:158342) has ready-made checkpoints and export paths. If you have GPU headroom and want maximum accuracy while staying real-time, use [D-FINE](paper:2410.13842) or [RT-DETRv2](paper:2407.17140). And if you need open-vocabulary detection rather than fixed COCO classes, [YOLO-World](paper:2401.17270) is the one to look at.`,Kr=["How do these compare on edge devices like Jetson?","Show me open-vocabulary detectors","What about small-object detection?"];async function*Vr(e,r){const t=()=>(r==null?void 0:r.aborted)===!0,n=e.trim().slice(0,90)||"state-of-the-art real-time object detection";if(yield{type:"stream_start",request_id:"req_mock",session_id:null},await pe(350,r),!t()){yield{type:"reasoning_start"};for(let o=0;o<Nt.length;o+=6){if(await pe(14,r),t())return;yield{type:"reasoning_delta",text:Nt.slice(o,o+6)}}if(await pe(400,r),!t()&&(yield{type:"reasoning_end"},await pe(300,r),!t()&&(yield{type:"tool_call",id:"call_1",name:"search_papers",args:{query:n,top_k:8}},await pe(1100,r),!t()&&(yield{type:"tool_result",id:"call_1",hits:Dt.length,took_ms:214,results:Dt},await pe(350,r),!t())))){yield{type:"reasoning_start"};for(let o=0;o<Mt.length;o+=6){if(await pe(14,r),t())return;yield{type:"reasoning_delta",text:Mt.slice(o,o+6)}}if(await pe(350,r),!t()&&(yield{type:"reasoning_end"},await pe(300,r),!t()&&(yield{type:"tool_call",id:"call_2",name:"search_papers",args:{query:"RT-DETR vs YOLOv12 COCO mAP latency FPS T4 TensorRT comparison",top_k:5}},await pe(900,r),!t()&&(yield{type:"tool_result",id:"call_2",hits:jt.length,took_ms:176,results:jt},await pe(400,r),!t())))){for(let o=0;o<Lt.length;o+=4){if(await pe(11,r),t())return;yield{type:"answer_delta",text:Lt.slice(o,o+4)}}yield{type:"done",followups:Kr,finish_reason:"success"}}}}}const Pe=()=>{const r=String("0").trim().toLowerCase();return r==="1"||r==="true"||r==="yes"},$r=()=>!0;class xe extends Error{constructor(r,t,n,o){super(r),this.code=t,this.status=n,this.retryAfterSeconds=o,this.name="ChatStreamError"}}class lt extends Error{constructor(r="The assistant stream was interrupted."){super(r),this.name="ChatTransportError"}}function Gr(e,r){if(Pe())try{He.reportLatency(e,r).catch(()=>{})}catch{}}function zr(e,r={}){return Pe()?Qr(e,r):Vr(e.message,r.signal)}function $t(e,r={}){return Jr(e,r)}async function*Qr(e,r){try{const t=await He.stream(e,r.signal);yield*zt(t,r)}catch(t){throw Gt(t)}}async function*Jr(e,r){try{const t=await He.resumeStream(e,r.signal,r.afterSequence);yield*zt(t,r)}catch(t){throw Gt(t)}}function Gt(e){return e instanceof xe||e instanceof lt?e:e instanceof SyntaxError?new xe("The assistant returned an invalid stream event.","invalid_stream_event"):new lt(e instanceof Error?e.message:"The assistant stream was interrupted.")}function Xr(e){let r=null,t="message";const n=[];for(const o of e.split(`
13
- `))if(o.startsWith("id:")){const c=o.slice(3).trim();/^[1-9]\d*$/.test(c)&&(r=Number(c))}else o.startsWith("event:")?t=o.slice(6).trimStart():o.startsWith("data:")&&n.push(o.slice(5).trimStart());return{sequence:r,event:t,data:n.join(`
14
- `)}}async function*zt(e,r){var h;if(!e.ok||!e.body){const f=e.ok?null:new ir(e,await e.text());f&&or(f);const g=f==null?void 0:f.detail,C=typeof g=="object"&&g!==null?g:null,y=e.status===403&&!g,_=Number(e.headers.get("Retry-After")),I=Number.isFinite(_)&&_>=0?Math.min(300,Math.ceil(_)):void 0;throw new xe(y?"Chat on staging is limited to approved Hugging Face users. Sign in with an approved account and try again.":(f==null?void 0:f.message)||`Chat stream failed (${e.status})`,C&&"code"in C&&typeof C.code=="string"?C.code:y?"staging_access_required":void 0,e.status,I)}const t=e.body.getReader(),n=new TextDecoder;let o="",c=r.afterSequence&&r.afterSequence>0?r.afterSequence:0;try{for(;;){const{done:f,value:g}=await t.read();if(f)break;o+=n.decode(g,{stream:!0});let C;for(;(C=o.indexOf(`
15
-
16
- `))!==-1;){const y=o.slice(0,C);o=o.slice(C+2);const _=Xr(y);if(!_.data||_.data==="[DONE]"||_.sequence!==null&&_.sequence<=c)continue;const I=JSON.parse(_.data);_.sequence!==null&&(c=_.sequence,(h=r.onSequence)==null||h.call(r,_.sequence)),yield I}}}finally{t.releaseLock()}}const Zr="https://huggingface.co/settings/inference-providers",Ft="pwc.chat.billing-notice-dismissed.v1";function en({provider:e}){const[r,t]=i.useState(()=>localStorage.getItem(Ft)==="1");return!Pe()||r||e!=="huggingface"?null:s.jsxs("div",{className:"chat-billing-notice",role:"note",children:[s.jsx("span",{children:"Hugging Face models use the inference permission granted when you start chatting. Included monthly credits are used first, then extra usage requires purchased credits. You can choose organization billing in Settings."}),s.jsxs("div",{className:"chat-billing-notice-actions",children:[s.jsx("a",{href:"/settings",children:"Review billing"}),s.jsx("a",{href:Zr,target:"_blank",rel:"noreferrer",children:"Review usage"}),s.jsx("button",{type:"button",className:"chat-billing-notice-dismiss","aria-label":"Dismiss billing notice",title:"Dismiss",onClick:()=>{localStorage.setItem(Ft,"1"),t(!0)},children:s.jsx(cr,{size:15,"aria-hidden":"true"})})]})]})}function Pt({variant:e,composerProps:r,provider:t,paused:n,suggestions:o=[]}){var h;const c=s.jsxs(s.Fragment,{children:[s.jsx(en,{provider:t}),n&&s.jsx("div",{id:"chat-paused-description",className:"chat-paused-banner",role:"status",children:"Chat is temporarily disabled. You can keep browsing and editing your conversations. New research runs will return when chat is restored."}),s.jsx(gr,{...r,...e==="empty"?{autoFocus:!0}:{placeholder:(h=r.draft)!=null&&h.text?"Edit and send again…":"Ask a follow-up…"}}),e==="empty"&&s.jsx("div",{className:"chat-examples",children:o.map(f=>s.jsx("button",{type:"button",className:"chat-example",disabled:n,onClick:()=>{var g;return r.onSend({text:f,paperMentions:[],...(g=r.draft)!=null&&g.paperSelection?{paperSelection:r.draft.paperSelection}:{}})},children:f},f))})]});return e==="empty"?c:s.jsx("div",{className:"chat-composer-wrap",children:s.jsxs("div",{className:"chat-composer-inner",children:[c,s.jsx("div",{className:"chat-composer-foot",children:Pe()?s.jsxs(s.Fragment,{children:[t==="huggingface"&&s.jsxs("span",{className:"chat-provider-attribution",children:["Powered by 🤗 ",s.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"}),"."]}),t==="openrouter"&&s.jsxs("span",{className:"chat-provider-attribution",children:["Powered by ",s.jsx("a",{href:"https://openrouter.ai",target:"_blank",rel:"noreferrer",children:"OpenRouter"}),"."]}),t==="openai"&&s.jsx("span",{className:"chat-provider-attribution",children:"Powered by OpenAI."}),s.jsx("span",{children:"The AI assistant can make mistakes. Double-check responses."})]}):s.jsx(s.Fragment,{children:"Assistant preview — responses are simulated."})})]})})}function tn({messages:e,papers:r,busy:t,queuedDraft:n,paperMentionsEnabled:o,archivePending:c,openRouterFallbackEnabled:h,onToggleBlock:f,onEditAndResend:g,onRetryFromProgress:C,onArchiveOld:y,onArchiveOldest:_}){var se,H;const[I,q]=i.useState(null),A=i.useRef(null),M=i.useRef(null),N=i.useRef(null),$=i.useRef(!0),[V,Q]=i.useState(!0),ie=i.useRef(null),S=i.useCallback(m=>{$.current=m,Q(m)},[]),T=i.useRef(0),D=i.useRef(!1),F=e.filter(m=>m.role==="user"),P=F.length,u=(se=F[0])==null?void 0:se.id,d=(H=F.at(-1))==null?void 0:H.id;i.useEffect(()=>{t?q(null):N.current=null},[t]),i.useLayoutEffect(()=>{const m=A.current;if(m){if((P>T.current||t&&!D.current)&&S(!0),T.current=P,D.current=t,M.current!==null){m.scrollTop=M.current,M.current=null;return}if(N.current){const B=Array.from(m.querySelectorAll("[data-message-id]")).find(z=>z.dataset.messageId===N.current);if(N.current=null,B){const z=m.getBoundingClientRect(),Z=B.getBoundingClientRect();m.scrollTop+=Z.top-z.top-24,S(!1);return}}$.current&&(m.scrollTop=m.scrollHeight)}},[e,P,t,S]);const O=(m,B)=>{var z;M.current=((z=A.current)==null?void 0:z.scrollTop)??null,f(m,B)};return s.jsxs("div",{className:"chat-conversation-viewport",children:[s.jsx("div",{className:"chat-conversation",ref:A,tabIndex:0,role:"region","aria-label":"Conversation",onWheel:m=>{m.deltaY<0&&S(!1)},onTouchStart:m=>{var B;ie.current=((B=m.touches[0])==null?void 0:B.clientY)??null},onTouchMove:m=>{var z;const B=(z=m.touches[0])==null?void 0:z.clientY;B!==void 0&&ie.current!==null&&B>ie.current&&S(!1),ie.current=B??null},onKeyDown:m=>{m.target===m.currentTarget&&(["ArrowUp","PageUp","Home"].includes(m.key)||m.key===" "&&m.shiftKey)&&S(!1)},onScroll:m=>{const{scrollHeight:B,scrollTop:z,clientHeight:Z}=m.currentTarget;B-z-Z>1&&S(!1)},children:s.jsxs("div",{className:"chat-conversation-inner",children:[e.length===0&&(n==null?void 0:n.text)&&s.jsx(Ct,{id:"queued-launch-preview",text:n.text,paperMentions:n.paperMentions,paperSelection:n.paperSelection,isInitial:!0}),e.map(m=>{var B,z;return m.role==="user"?s.jsx(Ct,{id:m.id,text:m.text??"",paperMentions:m.paperMentions??[],paperSelection:m.paperSelection,paperMentionsEnabled:o,isInitial:m.id===u,editingAllowed:!t&&!!m.revision,editing:I===m.id,editNotice:m.id===u?"Sending will replace this conversation.":m.id===d?"Sending will replace the response.":"Sending will replace the response and all messages after it.",onEdit:()=>q(m.id),onCancel:()=>q(null),onResendDraft:Z=>{m.id!==u&&(N.current=m.id);const oe=g(m.id,Z);return oe?(m.id===u&&S(!0),q(null)):N.current=null,oe}},m.id):s.jsx(yr,{msg:m,papers:r,onToggleBlock:O,onRetryCompaction:!t&&m.id===((B=e.at(-1))==null?void 0:B.id)&&((z=F.at(-1))!=null&&z.revision)?C:void 0,onArchiveOldChats:y,onArchiveOldestChats:_,archivePending:c,hfBilling:null,openRouterFallbackEnabled:h,feedbackEnabled:!0},m.id)})]})}),!V&&s.jsx("button",{type:"button",className:"chat-jump-latest",onClick:()=>{S(!0);const m=A.current;m&&(m.focus({preventScroll:!0}),m.scrollTop=m.scrollHeight)},children:"Jump to latest"})]})}function rn({retryAt:e,onRetry:r,onCancel:t}){const[n,o]=i.useState(()=>Math.max(0,Math.ceil((e-Date.now())/1e3))),c=i.useRef(null);return i.useEffect(()=>{var C;const h=document.activeElement instanceof HTMLElement?document.activeElement:null;(C=c.current)==null||C.focus();const f=()=>o(Math.max(0,Math.ceil((e-Date.now())/1e3)));f();const g=window.setInterval(f,250);return()=>{window.clearInterval(g),h==null||h.focus()}},[e]),s.jsx("div",{className:"chat-capacity-dialog-backdrop",role:"presentation",children:s.jsxs("div",{className:"chat-capacity-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-capacity-dialog-title","aria-describedby":"chat-capacity-dialog-description",onKeyDown:h=>{h.key==="Escape"&&(h.preventDefault(),t())},children:[s.jsx("h2",{id:"chat-capacity-dialog-title",children:"All research slots are currently in use"}),s.jsx("p",{id:"chat-capacity-dialog-description",children:"Your message was not sent or billed. Try again in a few seconds."}),s.jsx("p",{className:"chat-capacity-countdown","aria-live":"polite",children:n>0?`Try again available in ${n} second${n===1?"":"s"}.`:"You can try again now."}),s.jsxs("div",{className:"chat-capacity-dialog-actions",children:[s.jsx("button",{type:"button",className:"chat-capacity-cancel",ref:c,onClick:t,children:"Cancel"}),s.jsx("button",{type:"button",className:"chat-capacity-retry",disabled:n>0,onClick:r,children:"Try again"})]})]})})}function nn({onClose:e}){const r=i.useRef(null);return i.useEffect(()=>{var n;const t=document.activeElement instanceof HTMLElement?document.activeElement:null;return(n=r.current)==null||n.focus(),()=>t==null?void 0:t.focus()},[]),s.jsx("div",{className:"chat-capacity-dialog-backdrop",role:"presentation",children:s.jsxs("div",{className:"chat-capacity-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-disabled-title","aria-describedby":"chat-disabled-description",onKeyDown:t=>{t.key==="Escape"&&(t.preventDefault(),e())},children:[s.jsx("h2",{id:"chat-disabled-title",children:"Chat is temporarily disabled"}),s.jsx("p",{id:"chat-disabled-description",children:"We've temporarily paused new research runs. Your message wasn't sent, and your draft is still here. Please try again later."}),s.jsx("div",{className:"chat-capacity-dialog-actions",children:s.jsx("button",{ref:r,type:"button",className:"chat-capacity-cancel",onClick:e,children:"Keep editing"})})]})})}function sn({url:e,onClose:r}){return e?s.jsx("div",{className:"chat-share-dialog-backdrop",role:"presentation",onMouseDown:r,children:s.jsxs("div",{className:"chat-share-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-share-dialog-title",onMouseDown:t=>t.stopPropagation(),children:[s.jsx("h2",{id:"chat-share-dialog-title",children:"Public link created"}),s.jsx("p",{children:"Anyone with this link can see this conversation. It could not be copied automatically, so copy it manually:"}),s.jsx("input",{readOnly:!0,value:e,"aria-label":"Public conversation link",autoFocus:!0,onFocus:t=>t.currentTarget.select()}),s.jsx("button",{type:"button",onClick:r,children:"Close"})]})}):null}const ht="pwc:chat:sidebar-width",mt=280,gt=200,yt=480,_t=e=>Math.max(gt,Math.min(yt,e)),an=()=>{if(typeof window>"u")return mt;const e=Number(localStorage.getItem(ht));return Number.isFinite(e)&&e>0?_t(e):mt};function on({sessions:e,activeSessionId:r,loading:t,error:n,open:o,onClose:c,onNew:h,onNavigate:f,onRename:g,onDelete:C}){const[y,_]=i.useState(an),I=i.useRef(null),q=i.useRef(y),[A,M]=i.useState(null),[N,$]=i.useState(""),[V,Q]=i.useState(null);i.useEffect(()=>{if(!V)return;const u=()=>Q(null),d=O=>{O.key==="Escape"&&u()};return window.addEventListener("click",u),window.addEventListener("keydown",d),()=>{window.removeEventListener("click",u),window.removeEventListener("keydown",d)}},[V]);const ie=u=>{M(u.id),$(u.title)},S=async u=>{const d=N.trim();d&&await g(u,d)&&M(null)},T=(u,d,O)=>Q({id:u,x:d,y:O}),D=u=>{if(!I.current)return;const d=_t(I.current.width+u-I.current.x);q.current=d,_(d)},F=()=>{I.current&&(I.current=null,localStorage.setItem(ht,String(q.current)))},P=u=>{const d=_t(u);q.current=d,_(d),localStorage.setItem(ht,String(d))};return s.jsxs("aside",{className:`chat-sidebar${o?"":" chat-sidebar-closed"}`,style:{"--chat-sidebar-width":`${y}px`},children:[s.jsxs("div",{className:"chat-sidebar-top",children:[s.jsxs("button",{type:"button",className:"chat-new-chat",onClick:()=>{ze()&&h()},children:[s.jsx(xr,{})," New chat"]}),s.jsx("button",{type:"button",className:"icon-btn",onClick:c,title:"Collapse sidebar",children:s.jsx(Wt,{})})]}),s.jsxs("nav",{className:"chat-sessions","aria-label":"Chat history",children:[t&&s.jsx("div",{className:"chat-sessions-empty",children:"Loading chats…"}),!t&&n&&s.jsx("div",{className:"chat-sessions-empty",children:n}),!t&&!n&&e.length===0&&s.jsx("div",{className:"chat-sessions-empty",children:"Conversations you start will show up here."}),Rr(e).map(u=>s.jsxs("div",{className:"chat-session-group",children:[s.jsx("div",{className:"chat-session-group-label",children:u.label}),u.items.map(d=>s.jsxs("div",{className:`chat-session${d.id===r?" chat-session-active":""}`,role:"button",tabIndex:0,onClick:()=>{ze()&&f(d.id)},onKeyDown:O=>{if(O.key==="Enter"&&ze()&&f(d.id),O.key==="F2"&&ie(d),O.key==="ContextMenu"||O.shiftKey&&O.key==="F10"){O.preventDefault();const se=O.currentTarget.getBoundingClientRect();T(d.id,se.right-150,se.bottom)}},onContextMenu:O=>{O.preventDefault(),T(d.id,O.clientX,O.clientY)},children:[A===d.id?s.jsx("input",{className:"chat-session-title-input",value:N,autoFocus:!0,maxLength:80,onClick:O=>O.stopPropagation(),onChange:O=>$(O.target.value),onBlur:()=>void S(d.id),onKeyDown:O=>{O.stopPropagation(),O.key==="Enter"&&S(d.id),O.key==="Escape"&&M(null)}}):s.jsx("span",{className:"chat-session-title",children:d.title}),s.jsx("button",{type:"button",className:"chat-session-menu","aria-label":"Chat actions","aria-haspopup":"menu",title:"Chat actions",onClick:O=>{O.stopPropagation();const se=O.currentTarget.getBoundingClientRect();T(d.id,se.right-150,se.bottom)},children:"⋯"}),s.jsx("button",{type:"button",className:"chat-session-delete","aria-label":"Delete conversation",onClick:O=>{O.stopPropagation(),ze()&&C(d.id)},children:s.jsx(Sr,{})})]},d.id))]},u.label))]}),s.jsx("div",{className:"chat-sidebar-resize-handle",role:"separator","aria-label":"Resize chat history","aria-orientation":"vertical","aria-valuemin":gt,"aria-valuemax":yt,"aria-valuenow":y,title:"Drag to resize; double-click to reset",tabIndex:0,onPointerDown:u=>{u.button===0&&(I.current={x:u.clientX,width:y},q.current=y,u.currentTarget.setPointerCapture(u.pointerId))},onPointerMove:u=>D(u.clientX),onPointerUp:F,onPointerCancel:F,onLostPointerCapture:F,onDoubleClick:()=>P(mt),onKeyDown:u=>{(u.key==="ArrowLeft"||u.key==="ArrowRight")&&(u.preventDefault(),P(y+(u.key==="ArrowRight"?10:-10))),(u.key==="Home"||u.key==="End")&&(u.preventDefault(),P(u.key==="Home"?gt:yt))}}),V&&s.jsx("div",{className:"chat-session-context-menu",role:"menu",style:{left:V.x,top:V.y},onClick:u=>u.stopPropagation(),children:s.jsx("button",{type:"button",role:"menuitem",autoFocus:!0,onClick:()=>{const u=e.find(d=>d.id===V.id);u&&ie(u),Q(null)},children:"Rename chat"})})]})}function cn({sessionId:e,busy:r,loading:t,hasPaperSelection:n=!1,onError:o}){const{toast:c}=Bt(),[h,f]=i.useState(!1),[g,C]=i.useState(""),y=async()=>{var _;if(!(r||h)&&!(n&&!window.confirm("This public link will include the selected paper passage. Anyone with the link can read that passage. Continue?"))){f(!0);try{const I=await Er(e),q=new URL(I.public_path,window.location.origin).toString();try{if(!((_=navigator.clipboard)!=null&&_.writeText))throw new Error("Clipboard unavailable");await navigator.clipboard.writeText(q),c({className:"chat-share-toast",duration:5e3,title:"Public link copied to your clipboard",description:"Anyone with this link can see this conversation."})}catch{C(q)}}catch(I){const q=I instanceof Error?I.message:"Could not share this conversation";o(q),c({variant:"destructive",title:"Share failed",description:q})}finally{f(!1)}}};return s.jsxs(s.Fragment,{children:[s.jsxs("button",{type:"button",className:"chat-share-button",onClick:()=>void y(),disabled:r||h||t,"aria-label":"Share conversation",children:[h?s.jsx(Ht,{}):s.jsx(Wr,{"aria-hidden":"true"}),s.jsx("span",{children:"Share"})]}),s.jsx(sn,{url:g,onClose:()=>C("")})]})}const ln=({descriptor:e})=>{const r=_r(),{open:t,register:n,unregister:o}=r,c=ft.useRef(null),h=e.source_head??e.preview_head,f=ft.useMemo(()=>h?{kind:"artifact",schema_version:1,scope:"owner",artifact_id:e.artifact_id,version_id:h.version_id,identifier:"latex-paper",version:h.version,artifact_kind:"latex_paper",title:e.title,status:"ready",preview_mime:"application/pdf",source_language:"latex",total_bytes:0}:null,[e.artifact_id,e.title,h]),g=f?br(f):null;return ft.useEffect(()=>{if(!(!f||!g))return n(f),c.current!==g&&(c.current=g,t(f)),()=>o(g)},[f,g,t,n,o]),null};function un({messages:e,refreshSessions:r,resetChat:t,restoreDraft:n,clearTitle:o}){const{toast:c}=Bt(),[h,f]=i.useState(null),g=()=>{const _=[...e].reverse().find(I=>I.role==="user");t(),n({text:(_==null?void 0:_.text)??"",paperMentions:(_==null?void 0:_.paperMentions)??[],..._!=null&&_.paperSelection?{paperSelection:_.paperSelection}:{}}),o()};return{pending:h,archiveOld:async()=>{if(h===null){f("old");try{const _=await kr();if(await r(),_.archived_count===0){c({title:"No chats were archived",description:"There are no inactive chats older than 30 days."});return}g(),c({title:`${_.archived_count} ${_.archived_count===1?"chat":"chats"} archived`,description:"Your question is ready to send again."})}catch(_){c({variant:"destructive",title:"Could not archive old chats",description:_ instanceof Error?_.message:"Try again."})}finally{f(null)}}},archiveOldest:async()=>{if(h===null){f("oldest");try{const _=await Tr();await r(),g(),c({title:`${_.archived_count} ${_.archived_count===1?"chat":"chats"} archived`,description:"Your question is ready to send again."})}catch(_){c({variant:"destructive",title:"Could not archive chats",description:_ instanceof Error?_.message:"Try again."})}finally{f(null)}}}}}class dn{constructor(r,t=Gr){Me(this,"requestId");Me(this,"firstVisibleAt");Me(this,"streamStartReported",!1);Me(this,"firstVisibleReported",!1);Me(this,"terminalReported",!1);Me(this,"semanticReported",new Set);this.submittedAt=r,this.report=t}recordStreamStart(r,t){this.requestId=r,this.streamStartReported||(this.streamStartReported=!0,this.send({submission_to_stream_start_ms:Math.max(0,t-this.submittedAt)})),this.reportFirstVisible()}recordFirstVisible(r){this.firstVisibleAt===void 0&&(this.firstVisibleAt=r,this.reportFirstVisible())}recordSemantic(r,t){if(this.semanticReported.has(r))return;this.semanticReported.add(r);const n=Math.max(0,t-this.submittedAt);this.send(r==="reasoning"?{submission_to_first_reasoning_delta_ms:n}:r==="tool"?{submission_to_first_tool_call_ms:n}:{submission_to_first_answer_delta_ms:n})}recordTerminal(r){this.terminalReported||(this.terminalReported=!0,this.send({terminal_classification:r}))}reportFirstVisible(){!this.requestId||this.firstVisibleAt===void 0||this.firstVisibleReported||(this.firstVisibleReported=!0,this.send({submission_to_first_visible_delta_ms:Math.max(0,this.firstVisibleAt-this.submittedAt)}))}send(r){this.requestId&&this.report(this.requestId,r)}}const Qt="Preparing research workspace…",Jt={preparing_workspace:"Preparing secure workspace…",starting_agent:"Starting research agent…",connecting_model:"Connecting to model…"},Xt=()=>({messages:[],sessionId:null,title:"",phase:"idle"});function Yt(e,r){for(let t=e.length-1;t>=0;t-=1)if(r(e[t]))return t;return-1}function Ie(e){if(e.status!==Qt&&!Object.values(Jt).includes(e.status))return e;const{status:r,...t}=e;return t}function te(e,r){if(!e.length)return e;const t=e.slice();return t[t.length-1]=r(t[t.length-1]),t}function Fe(e,r,t){return te(e,n=>{const o=Ie(n),c=o.blocks??[];return{...o,blocks:c.map((h,f)=>r(h,f,c)?t(h):h)}})}function fn(e,r){switch(r.type){case"stream_start":return r.session_id?{...e,sessionId:r.session_id}:e;case"sandbox_start":case"sandbox_ready":case"workspace_ready":return e;case"lifecycle":return{...e,messages:te(e.messages,t=>{var n;return t.role==="assistant"&&t.streaming&&(((n=t.blocks)==null?void 0:n.length)??0)===0?{...t,status:Jt[r.phase]}:t})};case"session_title_start":return{...e,title:""};case"session_title_delta":return{...e,title:`${e.title}${r.text}`.replace(/\s+/g," ").slice(0,80)};case"session_title_done":return{...e,title:r.title};case"compaction_status":return{...e,messages:te(e.messages,t=>({...t,compacting:!!(t.streaming&&r.state==="started")}))};case"reasoning_start":return{...e,messages:te(e.messages,t=>{const n=Ie(t);return{...n,blocks:[...(n.blocks??[]).map(o=>o.kind==="reasoning"&&o.active?{...o,active:!1,open:!1}:o),{kind:"reasoning",text:"",active:!0,open:!0}]}})};case"reasoning_delta":return{...e,messages:Fe(e.messages,(t,n,o)=>t.kind==="reasoning"&&Yt(o,c=>c.kind==="reasoning")===n,t=>t.kind==="reasoning"?{...t,text:t.text+r.text}:t)};case"reasoning_end":return{...e,messages:te(e.messages,t=>{const n=t.blocks??[],o=Yt(n,f=>f.kind==="reasoning"&&f.active);if(o<0)return t;const c=n[o];if(c.kind!=="reasoning")return t;const h=n[o-1];return(h==null?void 0:h.kind)==="reasoning"&&h.text===c.text?{...t,blocks:n.filter((f,g)=>g!==o)}:{...t,blocks:n.map((f,g)=>g===o?{...c,active:!1,open:!1}:f)}})};case"tool_call":return{...e,messages:te(e.messages,t=>{const n=Ie(t);return{...n,blocks:[...n.blocks??[],{kind:"tool",id:r.id,name:r.name,args:r.args,status:"running",open:!1}]}})};case"tool_call_start":return{...e,messages:te(e.messages,t=>{const n=Ie(t);return{...n,blocks:[...n.blocks??[],{kind:"tool",schema_version:2,id:r.id,name:r.name,args:{},argumentText:"",argumentState:"streaming",arguments_redacted:r.redacted,status:"running",open:!1}]}})};case"tool_call_arguments_delta":return{...e,messages:Fe(e.messages,t=>t.kind==="tool"&&t.id===r.id,t=>t.kind==="tool"?{...t,args:r.partial_args,argumentText:r.snapshot?r.delta:`${t.argumentText??""}${r.delta}`,arguments_redacted:t.arguments_redacted||r.redacted}:t)};case"tool_call_arguments_done":return{...e,messages:Fe(e.messages,t=>t.kind==="tool"&&t.id===r.id,t=>t.kind==="tool"?{...t,args:r.args,argumentText:JSON.stringify(r.args),argumentState:"done",arguments_redacted:t.arguments_redacted||r.redacted}:t)};case"app_start":return{...e,messages:te(e.messages,t=>{const n=Ie(t);return{...n,blocks:[...n.blocks??[],{kind:"app",schema_version:1,instance_id:r.instance_id,provider:r.provider,server:r.server,tool:r.tool,resource_uri:r.resource_uri,status:"loading",input:r.input,result:{content:[],structuredContent:{},isError:!1},csp:{},permissions:{clipboardWrite:!0},height:525}]}})};case"app_result":return{...e,messages:Fe(e.messages,t=>t.kind==="app"&&t.instance_id===r.id,t=>t.kind==="app"?{...t,status:r.status,result:r.result}:t)};case"tool_result":return{...e,messages:Fe(e.messages,t=>t.kind==="tool"&&t.id===r.id,t=>t.kind!=="tool"?t:r.status?{...t,schema_version:2,status:r.status,took_ms:r.took_ms,content:r.content,metadata:r.metadata,open:r.status!=="success"}:{...t,status:"done",hits:r.hits,took_ms:r.took_ms,results:r.results})};case"artifact_start":return{...e,messages:te(e.messages,t=>{const n=Ie(t);return{...n,blocks:[...n.blocks??[],{kind:"artifact",schema_version:1,scope:"owner",publication_id:r.publication_id,identifier:r.identifier,artifact_kind:"posterly",title:r.title,status:"generating",phase:"publishing_poster"}]}})};case"artifact_ready":return{...e,messages:Fe(e.messages,t=>t.kind==="artifact"&&t.publication_id===r.publication_id,t=>t.kind==="artifact"?{...t,artifact_id:r.artifact_id,version_id:r.version_id,identifier:r.identifier,version:r.version,title:r.title,status:"ready",preview_mime:r.preview_mime,source_language:r.source_language,gate_status:r.gate_status,total_bytes:r.total_bytes,phase:void 0}:t)};case"artifact_error":return{...e,messages:Fe(e.messages,t=>t.kind==="artifact"&&t.publication_id===r.publication_id,t=>t.kind==="artifact"?{...t,status:"error",phase:void 0,error_code:r.code,error_message:r.message}:t)};case"answer_delta":return{...e,messages:te(e.messages,t=>{const n=Ie(t),o=n.blocks??[],c=o.at(-1);return(c==null?void 0:c.kind)==="answer"&&!c.done?{...n,blocks:[...o.slice(0,-1),{...c,text:c.text+r.text}]}:{...n,blocks:[...o,{kind:"answer",text:r.text,done:!1}]}})};case"done":return{...e,phase:"complete",messages:te(e.messages,t=>({...t,streaming:!1,compacting:!1,followups:r.followups,finishReason:r.finish_reason,citations:r.citations,blocks:(t.blocks??[]).map(n=>n.kind==="answer"?{...n,done:!0}:n.kind==="reasoning"&&n.active?{...n,active:!1,open:!1}:n)}))};case"error":return{...e,phase:"failed",messages:te(e.messages,t=>({...t,streaming:!1,compacting:!1,error:r.message,errorCode:r.code,blocks:(t.blocks??[]).map(n=>n.kind==="reasoning"&&n.active?{...n,active:!1,open:!1}:n.kind==="tool"&&n.status==="running"?{...n,status:"error",open:!0}:n)}))};default:return e}}function pn(e){return te(e,r=>{if(r.role!=="assistant")return r;const t=(r.blocks??[]).flatMap(n=>n.kind==="tool"&&n.status==="running"?[{...n,status:"error",open:!0}]:n.kind==="reasoning"&&n.active?n.text?[{...n,active:!1,open:!1}]:[]:n.kind==="answer"?[{...n,done:!0}]:[n]);return{...r,blocks:t,streaming:!1,compacting:!1,finishReason:"stopped"}})}function Ge(e,r){switch(r.type){case"start":return{messages:r.messages,sessionId:r.sessionId,title:"",phase:"streaming"};case"event":return fn(e,r.event);case"load":return{messages:r.messages,sessionId:r.sessionId,title:e.title,phase:"idle"};case"workspace_status":return{...e,messages:te(e.messages,t=>{var n;return t.role==="assistant"&&t.streaming&&(((n=t.blocks)==null?void 0:n.length)??0)===0&&!t.error?{...t,status:Qt}:t})};case"clear_workspace_status":return{...e,messages:te(e.messages,Ie)};case"settle":return{...e,phase:"idle",messages:te(e.messages,t=>t.streaming?{...t,streaming:!1,compacting:!1}:t)};case"stop":return{...e,messages:pn(e.messages),phase:"stopped"};case"reset":return Xt()}}const ke={minDelayMs:5,maxDelayMs:80,minRateCharsPerMs:.3,maxBufferedMs:400,arrivalRateTauMs:1e3,arrivalRateHeadroom:1.1,maxPendingChars:64},hn={now:()=>performance.now(),sleep:(e,r)=>new Promise(t=>{if(r!=null&&r.aborted||e<=0){t();return}const n=window.setTimeout(o,e);function o(){r==null||r.removeEventListener("abort",o),window.clearTimeout(n),t()}r==null||r.addEventListener("abort",o,{once:!0})})};function mn(e){return!["stream_start","sandbox_start","sandbox_ready","workspace_ready","session_title_start","session_title_delta","session_title_done"].includes(e.type)}function gn(e,r=!1,t=ke.maxPendingChars){var o;if(!e)return{pieces:[],pending:""};if(r)return{pieces:[e],pending:""};const n=Intl.Segmenter;if(n){const h=[...new n(void 0,{granularity:"word"}).segment(e)].filter(g=>g.isWordLike);let f=0;if(h.length>1&&(f=h.at(-1).index),h.length&&/\s$/u.test(e)&&(f=e.length),f>0){const g=e.slice(0,f),C=[],_=[...new n(void 0,{granularity:"word"}).segment(g)].filter(I=>I.isWordLike);for(let I=0;I<_.length;I+=1){const q=I===0?0:_[I].index,A=((o=_[I+1])==null?void 0:o.index)??g.length;A>q&&C.push(g.slice(q,A))}return _.length||C.push(g),{pieces:C,pending:e.slice(f)}}}else{const c=[...e.matchAll(/\s+/gu)];if(c.length){const h=[];let f=0;for(const g of c){const C=g.index+g[0].length;h.push(e.slice(f,C)),f=C}return{pieces:h,pending:e.slice(f)}}}return e.length>=t?{pieces:[e.slice(0,t)],pending:e.slice(t)}:{pieces:[],pending:e}}function yn(e,r={}){const t={minDelayMs:r.minDelayMs??ke.minDelayMs,maxDelayMs:r.maxDelayMs??ke.maxDelayMs,minRateCharsPerMs:r.minRateCharsPerMs??ke.minRateCharsPerMs,maxBufferedMs:r.maxBufferedMs??ke.maxBufferedMs,arrivalRateTauMs:r.arrivalRateTauMs??ke.arrivalRateTauMs,arrivalRateHeadroom:r.arrivalRateHeadroom??ke.arrivalRateHeadroom,maxPendingChars:r.maxPendingChars??ke.maxPendingChars},n=r.clock??hn,o=[];let c="",h=null,f=0,g=!0,C=!1,y=null,_=0,I=n.now(),q=!1;const A=()=>{y==null||y(),y=null},M=(S,T)=>{const D=S.type==="reasoning_delta"||S.type==="answer_delta"?S.text.length:0;o.push({kind:"event",event:S,arrivedAt:T,chars:D}),A()},N=S=>{if(!h||!c)return;const T=gn(c,S,t.maxPendingChars);for(const D of T.pieces)D&&M({type:h,text:D},f),f=n.now();c=T.pending,c||(h=null)},$=S=>{if(!g)return;const T=n.now();if(S.type==="reasoning_delta"||S.type==="answer_delta"){const D=S.type;if(!S.text)return;if(!q){q=!0,_+=S.text.length,I=T;const P=Array.from(S.text)[0];M({type:D,text:P},T);const u=S.text.slice(P.length);if(u)for(h=D,c=u,f=T,N(!1);c.length>=t.maxPendingChars;)N(!1);return}h&&h!==D&&N(!0),h||(h=D,f=T),c+=S.text;const F=Math.max(0,T-I);for(_*=Math.exp(-F/t.arrivalRateTauMs),_+=S.text.length,I=T,N(!1);c.length>=t.maxPendingChars;)N(!1);return}mn(S)&&N(!0),M(S,T)},V=(async()=>{var S;try{for await(const T of e)$(T);g&&N(!0)}catch(T){g&&!((S=r.signal)!=null&&S.aborted)&&(N(!0),o.push({kind:"error",error:T,arrivedAt:n.now(),chars:0}))}finally{C=!0,A()}})(),Q=()=>o.length||C?Promise.resolve():new Promise(S=>{y=S});return{events:async function*(){var T,D,F,P;let S=Number.NEGATIVE_INFINITY;try{for(;;){if(await Q(),!o.length){if(C||!g)return;continue}const u=o[0];if(u.kind==="error")throw o.shift(),u.error;if(u.chars&&!((T=r.isHidden)!=null&&T.call(r))){const d=n.now(),O=o.reduce((ae,J)=>ae+J.chars,0),se=((D=o.find(ae=>ae.chars))==null?void 0:D.arrivedAt)??d,H=Math.max(0,t.maxBufferedMs-(d-se)),m=_*Math.exp(-Math.max(0,d-I)/t.arrivalRateTauMs)/t.arrivalRateTauMs,B=H>0?O/H:Number.POSITIVE_INFINITY,z=Math.max(t.minRateCharsPerMs,m*t.arrivalRateHeadroom,B),Z=Math.min(t.maxDelayMs,Math.max(t.minDelayMs,u.chars/z)),oe=Math.max(0,u.arrivedAt+t.maxBufferedMs-d),ee=Math.max(u.arrivedAt,S+Math.min(Z,oe));if(await n.sleep(Math.max(0,ee-n.now()),r.signal),!g||(F=r.signal)!=null&&F.aborted)return}o.shift(),S=n.now(),yield u.event}}finally{g&&(g=!1,A(),await((P=e.return)==null?void 0:P.call(e,void 0))),await V}}(),takeAcceptedForStop(){var T;if(!g)return[];g=!1,h&&c&&(M({type:h,text:c},f),c="",h=null);const S=o.flatMap(D=>D.kind==="event"&&D.event.type!=="done"&&D.event.type!=="error"?[D.event]:[]);return o.length=0,A(),(T=e.return)==null||T.call(e,void 0),S}}}const _n=750,qt=[250,500,1e3],bn=(e,r)=>new Promise(t=>{const n=()=>{window.clearTimeout(o),r.removeEventListener("abort",n),t()},o=window.setTimeout(n,e);r.addEventListener("abort",n,{once:!0})});async function*wn(e,r){let t=e,n=0;for(;;){let o=!1;try{for await(const c of t)(c.type==="done"||c.type==="error")&&(o=!0),yield c;if(o||r.signal.aborted)return;throw new lt}catch(c){r.onDisconnect();const h=r.getSessionId();if(r.signal.aborted||o||!(c instanceof lt)||!h||n>=qt.length)throw c;if(await bn(qt[n],r.signal),r.signal.aborted)return;n+=1,t=$t(h,{signal:r.signal,afterSequence:r.getAfterSequence(),onSequence:r.onSequence})}}}function vn(e,r){for(let t=e.length-1;t>=0;t-=1)if(r(e[t]))return t;return-1}function We(e){const r=i.useRef(e);return i.useLayoutEffect(()=>{r.current=e}),i.useCallback((...t)=>r.current(...t),[])}function xn(e){const[r,t]=i.useState([]),[n,o]=i.useState(!1),[c,h]=i.useState(""),f=i.useRef(!1),g=i.useRef(null),C=i.useRef(null),y=i.useRef(null),_=i.useRef(null),I=i.useRef(!1),q=i.useRef(null),A=i.useRef(null),M=i.useRef("cleared"),N=i.useRef(null),$=i.useRef(null),[V,Q]=i.useState(null),[ie,S]=i.useState(null),T=i.useRef([]),D=i.useRef(Xt()),F=i.useRef(null),P=i.useRef(null),u=i.useRef(!1),d=i.useRef(e),O=i.useRef(Qe()),se=i.useRef(0),H=i.useRef(0),m=i.useRef(e.sessionId),B=i.useRef(e.sessionId);B.current!==e.sessionId&&(B.current=e.sessionId,m.current!==e.sessionId&&(H.current+=1,N.current=null)),d.current=e,T.current=r,i.useEffect(()=>()=>{var l;A.current!==null&&window.clearTimeout(A.current),(l=g.current)==null||l.abort(),C.current=null,y.current!==null&&cancelAnimationFrame(y.current),_.current!==null&&window.clearTimeout(_.current),$.current=null},[]),i.useEffect(()=>{f.current||(m.current=e.sessionId)},[e.sessionId]),i.useEffect(()=>{const l=f.current&&e.sessionId===m.current?F.current:null;u.current=l!==null,l&&(t(l),T.current=l)},[e.sessionId]);const z=i.useMemo(()=>{const l={};for(const v of r)for(const x of v.blocks??[])if(x.kind==="tool")for(const b of x.results??[])l[b.route_id]=b;return l},[r]),Z=()=>`m${++se.current}_${Date.now().toString(36)}`,oe=(l,v=!0)=>{const x={...D.current,messages:F.current??T.current,sessionId:m.current},b=Ge(x,l);D.current=b,F.current&&(F.current=b.messages);const w=l.type==="event"&&l.event.type==="stream_start"?l.event.session_id:null;return w?(m.current=w,d.current.onSessionId(w)):b.sessionId&&b.sessionId!==x.sessionId&&(m.current=b.sessionId,d.current.onSessionId(b.sessionId)),b.title!==x.title&&d.current.onTitle(b.title),v&&(T.current=b.messages,t(b.messages)),b},ee=()=>P.current===H.current||u.current,ae=()=>{y.current!==null&&(cancelAnimationFrame(y.current),y.current=null),_.current!==null&&(window.clearTimeout(_.current),_.current=null)},J=()=>{ae(),document.visibilityState!=="hidden"&&(!u.current||!F.current||(I.current=!1,T.current=F.current,t(F.current)))},Je=()=>{if(!u.current||document.visibilityState==="hidden"||y.current!==null||_.current!==null)return;const l=()=>{y.current=null,_.current=null,J()};typeof requestAnimationFrame=="function"?y.current=requestAnimationFrame(l):_.current=window.setTimeout(l,0)};i.useEffect(()=>{const l=()=>{document.visibilityState==="visible"&&I.current&&Je()};return document.addEventListener("visibilitychange",l),()=>document.removeEventListener("visibilitychange",l)});const Ae=l=>{if(g.current!==l||(A.current!==null&&(window.clearTimeout(A.current),A.current=null),M.current==="cleared"))return;const v=M.current==="shown";M.current="cleared",v&&oe({type:"clear_workspace_status"},ee())},ut=(l,v)=>{A.current!==null&&window.clearTimeout(A.current),M.current="armed",A.current=window.setTimeout(()=>{A.current=null,!(M.current!=="armed"||g.current!==l||l.signal.aborted||H.current!==v)&&(M.current="shown",oe({type:"workspace_status"},ee()))},_n)},dt=(l,v)=>{const x=N.current;!x||x.controller!==l||x.tracker.recordStreamStart(v,performance.now())},ve=(l,v)=>{const x=N.current;!x||x.controller!==l||x.tracker.recordTerminal(v)};i.useLayoutEffect(()=>{const l=N.current;if(!l)return;const v=r.at(-1);if((v==null?void 0:v.role)!=="assistant"||!(v.blocks??[]).some(w=>w.kind==="tool"||w.kind==="reasoning"&&!!w.text.trim()||w.kind==="answer"&&!!w.text.trim()))return;const b=performance.now();l.tracker.recordFirstVisible(b);for(const w of v.blocks??[])w.kind==="reasoning"&&w.text.trim()?l.tracker.recordSemantic("reasoning",b):w.kind==="tool"?l.tracker.recordSemantic("tool",b):w.kind==="answer"&&w.text.trim()&&l.tracker.recordSemantic("answer",b)},[r]);const _e=(l,v=!0)=>{oe({type:"event",event:l},v)},Xe=async(l,v)=>{var w;const x=await ot(l);let b=Kt(x);return((w=q.current)==null?void 0:w.sessionId)===l&&(b=q.current.messages,q.current=null),H.current!==v&&!(P.current===v&&u.current&&d.current.sessionId===l)?null:(t(b),T.current=b,F.current=b,D.current=Ge(D.current,{type:"load",messages:b,sessionId:l}),b)},fe=(l,v,x,b,w,U)=>{const Y=++H.current;P.current=Y,u.current=!0,f.current=!0;const j=new AbortController;g.current=j;const he=l.text;return O.current=l,m.current=v.session_id,h(""),t(x),F.current=x,D.current=Ge(D.current,{type:"start",messages:x,sessionId:v.session_id}),o(!0),N.current=U?null:{controller:j,tracker:new dn(performance.now())},M.current="cleared",(async()=>{var je,Ne,qe,tt,rt,Be;let X=!1,re=!1,le=!1,ne=!1,G=!1,k=!1,be=0;const me=W=>{W>be&&(be=W)};try{const W=U?$t(U,{signal:j.signal,onSequence:me}):zr(v,{signal:j.signal,onSequence:me}),ge=wn(W,{signal:j.signal,getSessionId:()=>m.current,onDisconnect:()=>{ee()&&_e({type:"compaction_status",state:"finished"})},getAfterSequence:()=>be,onSequence:me}),ue=!U&&Pe()&&$r(),we=ue?yn(ge,{signal:j.signal,isHidden:()=>document.visibilityState==="hidden"}):null;we&&(C.current={controller:j,stream:we});for await(const R of(we==null?void 0:we.events)??ge){R.type==="paper_artifact"&&((Ne=(je=d.current).onPaperArtifact)==null||Ne.call(je,R)),R.type==="stream_start"&&(X=!0,re=R.provider_execution!==!1,dt(j,R.request_id)),R.type==="sandbox_start"&&ut(j,Y),(R.type==="sandbox_ready"||R.type==="workspace_ready"||R.type==="lifecycle")&&Ae(j),(R.type==="reasoning_start"||R.type==="reasoning_delta"||R.type==="tool_call"||R.type==="tool_call_start"||R.type==="tool_call_arguments_delta"||R.type==="tool_call_arguments_done"||R.type==="app_start"||R.type==="app_result"||R.type==="artifact_start"||R.type==="artifact_ready"||R.type==="artifact_error"||R.type==="answer_delta"||R.type==="done"||R.type==="error")&&Ae(j),(R.type==="done"||R.type==="error")&&(ne=!0,G=R.type==="error",ve(j,R.type==="error"?"error":"complete"),R.type==="error"&&["openrouter_monthly_budget_exhausted","openrouter_unavailable","openrouter_byok_credential_invalid","openrouter_byok_billing_error","openrouter_byok_rate_limit","hf_inference_billing_exhausted"].includes(R.code??"")&&(le=!0,d.current.onInterrupted(l)));const Se=ee(),Ue=Se&&!(ue&&document.visibilityState==="hidden"),Ve=R.type==="reasoning_delta"||R.type==="answer_delta"||R.type==="tool_call_arguments_delta",nt=!["stream_start","sandbox_start","sandbox_ready","workspace_ready","session_title_start","session_title_delta","session_title_done","reasoning_delta","answer_delta","tool_call_arguments_delta"].includes(R.type);ue&&nt&&J(),!j.signal.aborted&&(Se||R.type==="stream_start"||R.type==="session_title_start"||R.type==="session_title_delta"||R.type==="session_title_done")?ue&&Ve?(_e(R,!1),I.current=I.current||Se,Je()):(_e(R,Ue),ue&&Se&&!Ue&&(I.current=!0)):j.signal.aborted||_e(R,!1)}}catch(W){const ge=!!(U&&W instanceof xe&&W.code==="chat_not_busy");if(G=!ge,!j.signal.aborted){if(Ae(j),!ge)if(W instanceof xe&&W.code==="chat_temporarily_disabled")k=!0,S({question:he,draft:l}),H.current===Y&&(t(b),T.current=b,h(""));else if(W instanceof xe&&W.code==="chat_capacity"){k=!0;const ue=W.retryAfterSeconds??5,we={question:he,draft:l,request:v,optimistic:x,original:b,edit:w,retryAfterSeconds:ue,retryAt:Date.now()+ue*1e3};$.current=we,Q({question:he,draft:l,retryAt:we.retryAt,retryAfterSeconds:ue}),H.current===Y&&(t(b),T.current=b,h(""))}else ve(j,"network_error"),W instanceof xe&&["paper_context_unavailable","paper_mention_unavailable","paper_mentions_disabled","paper_selection_disabled","paper_selection_requires_reader","paper_selection_paper_mismatch","paper_selection_version_mismatch","paper_selection_page_invalid","paper_selection_too_large","chat_storage_quota_exceeded"].includes(W.code??"")&&(k=!0,d.current.onInterrupted(l),H.current===Y&&(t(b),T.current=b,h(W.message))),W instanceof xe&&["openrouter_monthly_budget_exhausted","openrouter_unavailable","openrouter_byok_credential_invalid","openrouter_byok_billing_error","openrouter_byok_rate_limit","hf_inference_billing_exhausted"].includes(W.code??"")&&(le=!0,d.current.onInterrupted(l));!ge&&!k&&H.current===Y&&_e({type:"error",message:W instanceof Error?W.message:"The assistant stream failed.",code:W instanceof xe?W.code:void 0})}}finally{if(g.current===j){if(((qe=C.current)==null?void 0:qe.controller)===j&&(J(),C.current=null),Ae(j),!ne&&!j.signal.aborted&&ve(j,"network_error"),f.current=!1,o(!1),k)d.current.onSettled(v.session_id);else if(!j.signal.aborted){(X&&re||le)&&((rt=(tt=d.current).onProviderTerminal)==null||rt.call(tt));const W=m.current;if(w&&!X)H.current===Y&&(t(w.snapshot),T.current=w.snapshot,h("Couldn’t resend this message. Your original conversation was restored."));else if(W){H.current===Y&&w&&(G||!ne)&&(t(w.snapshot),T.current=w.snapshot);try{const ge=await Xe(W,Y);ge&&w&&ge.some(ue=>ue.id===w.targetId)&&h("Couldn’t resend this message. Your original conversation was restored.")}catch{H.current===Y&&oe({type:"settle"})}}else H.current===Y&&oe({type:"settle"});d.current.onSettled(W)}((Be=N.current)==null?void 0:Be.controller)===j&&(N.current=null)}}})(),!0},Ze=We(l=>{var le,ne;const v=typeof l=="string"?Qe(l.trim()):l,x=v.text;if(!x||x.length>8e3||f.current||$.current)return!1;const b=T.current,w=[...b].reverse().find(G=>G.role==="user"),U=w!=null&&w.status&&w.status!=="complete"&&w.revision?{replace_message_id:w.id,prior_revision:w.revision}:null,Y={id:Z(),role:"user",text:x,paperMentions:v.paperMentions,paperSelection:v.paperSelection},j={id:Z(),role:"assistant",streaming:!0,blocks:[]},he=U&&w?vn(b,G=>G.id===w.id):-1,X=he<0?[...b,Y,j]:[...b.slice(0,he),Y,j],re=(ne=(le=d.current).viewerContext)==null?void 0:ne.call(le);return fe(v,{message:x,paper_mentions:v.paperMentions.map(({route_id:G,title:k,start:be,end:me})=>({route_id:G,title:k,start:be,end:me})),session_id:d.current.sessionId,client_message_id:crypto.randomUUID(),web_search_enabled:!!d.current.webSearchEnabled,reasoning_effort:d.current.reasoningEffort??"low",...d.current.primaryPaperRouteId?{primary_paper_route_id:d.current.primaryPaperRouteId}:{},...re?{viewer_context:re}:{},...v.paperSelection?{paper_selection:Ot(v.paperSelection)}:{},...!d.current.sessionId&&d.current.initialModel?{initial_model:d.current.initialModel}:{},...U??{}},X,b)}),Ke=We((l,v)=>{var le,ne;const x=typeof v=="string"?Qe(v.trim()):v,b=x.text;if(!b||b.length>8e3||f.current||$.current)return!1;const w=T.current.slice(),U=w.findIndex(G=>G.id===l&&G.role==="user");if(U<0)return!1;const Y=w[U];if(!d.current.sessionId||!Y.revision)return!1;const j={id:Y.id,role:"user",text:b,paperMentions:x.paperMentions,paperSelection:x.paperSelection,revision:Y.revision+1,status:"generating"},he={id:Z(),role:"assistant",streaming:!0,blocks:[]},X=[...w.slice(0,U),j,he],re=(ne=(le=d.current).viewerContext)==null?void 0:ne.call(le);return fe(x,{message:b,paper_mentions:x.paperMentions.map(({route_id:G,title:k,start:be,end:me})=>({route_id:G,title:k,start:be,end:me})),session_id:d.current.sessionId,client_message_id:crypto.randomUUID(),web_search_enabled:!!d.current.webSearchEnabled,reasoning_effort:d.current.reasoningEffort??"low",...d.current.primaryPaperRouteId?{primary_paper_route_id:d.current.primaryPaperRouteId}:{},...re?{viewer_context:re}:{},...x.paperSelection?{paper_selection:Ot(x.paperSelection)}:{},replace_message_id:Y.id,prior_revision:Y.revision},X,w,{targetId:Y.id,snapshot:w})}),Ce=We(()=>{const l=T.current.slice(),v=[...l].reverse().find(w=>w.role==="user");if(!d.current.sessionId||!(v!=null&&v.revision)||f.current||$.current)return!1;const x=Qe(v.text??"Continue the interrupted response from saved progress."),b=[...l,{id:Z(),role:"user",text:x.text,paperMentions:[]},{id:Z(),role:"assistant",streaming:!0,blocks:[]}];return fe(x,{message:x.text,session_id:d.current.sessionId,client_message_id:crypto.randomUUID(),retry_message_id:v.id,...d.current.primaryPaperRouteId?{primary_paper_route_id:d.current.primaryPaperRouteId}:{},web_search_enabled:!!d.current.webSearchEnabled,reasoning_effort:d.current.reasoningEffort??"low"},b,l)}),ce=i.useCallback(()=>{$.current=null,Q(null)},[]),Oe=We(()=>{const l=$.current;return!l||Date.now()<l.retryAt||f.current?!1:($.current=null,Q(null),fe(l.draft,l.request,l.optimistic,l.original,l.edit))}),Ye=We(()=>{var U,Y;if(!g.current)return;const l=g.current;Ae(l),ve(l,"stopped"),l.abort();const v=((U=C.current)==null?void 0:U.controller)===l?C.current.stream.takeAcceptedForStop():[];C.current=null;for(const j of v)_e(j,!1);J(),g.current=null,((Y=N.current)==null?void 0:Y.controller)===l&&(N.current=null),f.current=!1,o(!1);const x=oe({type:"stop"},!1).messages;F.current=x,T.current=x,t(x),d.current.onInterrupted(O.current);const b=m.current;b&&(q.current={sessionId:b,messages:x}),b&&Ir(b).catch(()=>{});const w=++H.current;window.setTimeout(()=>{b&&H.current===w?Xe(b,w).catch(()=>{}).finally(()=>d.current.onSettled(b)):b||d.current.onSettled(null)},450)}),Re=i.useCallback((l,v)=>t(x=>x.map(b=>{var w;return b.id!==l?b:{...b,blocks:(w=b.blocks)==null?void 0:w.map((U,Y)=>Y===v&&(U.kind==="reasoning"||U.kind==="tool")?{...U,open:!U.open}:U)}})),[]),De=i.useCallback(()=>{var l;H.current+=1,A.current!==null&&(window.clearTimeout(A.current),A.current=null),M.current="cleared",(l=g.current)==null||l.abort(),g.current=null,C.current=null,ae(),I.current=!1,q.current=null,N.current=null,$.current=null,Q(null),f.current=!1,m.current=null,F.current=null,D.current=Ge(D.current,{type:"reset"}),P.current=null,u.current=!1,t([]),o(!1),h("")},[]),et=We((l,v,x=!1)=>{var b;if(H.current+=1,A.current!==null&&(window.clearTimeout(A.current),A.current=null),M.current="cleared",ae(),I.current=!1,N.current=null,$.current=null,Q(null),f.current&&v!==void 0&&v===m.current&&F.current){u.current=!0,t(F.current),T.current=F.current,h("");return}if(u.current=!1,f.current||((b=g.current)==null||b.abort(),g.current=null,F.current=null,P.current=null,u.current=!1),x&&v){const w=[...l].reverse().find(U=>U.role==="user");if(w){const U={text:w.text??"",paperMentions:w.paperMentions??[],...w.paperSelection?{paperSelection:w.paperSelection}:{}},Y=[...l,{id:`${w.id}-active`,role:"assistant",streaming:!0,blocks:[]}];fe(U,{message:U.text,session_id:v,client_message_id:"reconnect",web_search_enabled:!!d.current.webSearchEnabled,reasoning_effort:d.current.reasoningEffort??"low"},Y,l,void 0,v);return}}t(l),T.current=l,D.current=Ge(D.current,{type:"load",messages:l,sessionId:v??d.current.sessionId}),f.current||o(!1),h("")});return{messages:r,busy:n,papers:z,sessionError:c,capacityRequest:V,disabledRequest:ie,send:Ze,editAndResend:Ke,retryFromProgress:Ce,retryCapacity:Oe,cancelCapacity:ce,dismissDisabled:()=>S(null),stop:Ye,toggleBlock:Re,reset:De,load:et}}const Zt=["chat","openai","usage"],Rn=90,er="pwc:chat:openai-credits-notice:dismissed";function Sn(e=!0){return Ut({queryKey:Zt,queryFn:()=>He.getOpenAIUsage(),enabled:e,staleTime:3e4,retry:!1,refetchOnWindowFocus:!0})}function En(e,r,t){if(!e||r!=="openai"||e.used_percent<Rn||t===e.resets_at)return null;const n=new Intl.DateTimeFormat(void 0,{month:"long",day:"numeric"}).format(new Date(e.resets_at));return{message:`You have ${e.remaining_percent}% left of your monthly OpenAI credits. They reset on ${n}.`,resetsAt:e.resets_at}}function Tn(){try{return localStorage.getItem(er)}catch{return null}}function kn(e){try{localStorage.setItem(er,e)}catch{}}const ye=Qe,In=["Summarize the main contributions","Explain in simple terms","Identify the main limitations"],An=()=>{const e=sessionStorage.getItem(ct);if(!e)return null;try{return Pr(JSON.parse(e),e)}catch{}return ye(e)},Cn=({enabled:e,workspaceKey:r,children:t,onAskAiFix:n})=>e?s.jsx(wr,{workspaceKey:r,onAskAiFix:n,children:t}):s.jsx(s.Fragment,{children:t}),On=({enabled:e,children:r})=>e?s.jsx(vr,{variant:"chat",children:r}):s.jsx(s.Fragment,{children:r}),Dn=({mode:e="general",routeSessionId:r,primaryPaper:t,currentPage:n,paperSelection:o,onPaperSelectionChange:c,onSessionId:h,onReaderSubmit:f,onReaderNewChat:g})=>{var wt,vt,xt,Rt,St,Et,Tt,kt,It;const{sessionId:C}=lr(),y=r??(e==="general"?C:void 0),_=ur(),[I,q]=dr(),{user:A,isLoading:M}=fr(),N=pr(),$=mr(),V=Ut({queryKey:["chatAvailability"],queryFn:()=>He.getAvailability(),refetchInterval:3e4,retry:!1,enabled:Pe()&&!!A}),Q=((wt=V.data)==null?void 0:wt.status)==="paused"||e==="paper"&&((vt=V.data)==null?void 0:vt.paper_reader_chat_enabled)===!1,[ie,S]=i.useState([]),[T,D]=i.useState(!1),[F,P]=i.useState(""),[u,d]=i.useState(()=>y?{id:y,status:"loading"}:null),[O,se]=i.useState(0),[H,m]=i.useState(null),B=i.useRef(Ar()),z=i.useRef(I.get("model")||((xt=B.current)==null?void 0:xt.model)),[Z,oe]=i.useState($?Cr:Or),[ee,ae]=i.useState(z.current||Dr),J=jr(Z,ee),Je=Br(!!(A&&J==="openrouter")),Ae=Sn(Pe()&&!!A&&J==="openai"),[ut,dt]=i.useState(()=>Tn()),ve=En(Ae.data,J,ut),_e=i.useRef(J);_e.current=J;const[Xe,fe]=i.useState(""),[Ze,Ke]=i.useState(null),[Ce,ce]=i.useState(()=>ye()),[Oe,Ye]=i.useState(()=>{var a;return((a=B.current)==null?void 0:a.webSearchEnabled)??!1}),[Re,De]=i.useState(()=>{var a;return((a=B.current)==null?void 0:a.reasoningEffort)??"low"}),et=!!((Rt=V.data)!=null&&Rt.web_search_available),[l,v]=i.useState(()=>{var p,E;const a=(p=I.get("q"))==null?void 0:p.trim();return a?ye(a):((E=B.current)==null?void 0:E.draft)??ye()}),x=i.useRef(!1),b=i.useRef(!1),w=i.useRef(!1),[U,Y]=i.useState(()=>typeof window>"u"||window.innerWidth>900),j=i.useRef(new Set),he=i.useRef(!1),X=i.useRef(y),re=i.useRef(null),le=i.useRef(null),ne=i.useRef(null);X.current=y;const G=i.useCallback(async()=>{if(!A)return;const a=!he.current;a&&D(!0);try{const p=await Nr();S(E=>{const L=re.current,K=L?E.find($e=>$e.id===L):void 0;if(!K)return p;const de=p.find($e=>$e.id===L);return[de?{...de,title:K.title,is_busy:!0}:K,...p.filter($e=>$e.id!==L)]}),he.current=!0,P("")}catch(p){P(p instanceof Error?p.message:"Could not load chats")}finally{a&&D(!1)}},[A]),k=xn({sessionId:y??null,initialModel:ee,webSearchEnabled:et&&Oe,reasoningEffort:Re,primaryPaperRouteId:e==="paper"?t==null?void 0:t.routeId:void 0,viewerContext:e==="paper"&&n?()=>({page:Math.max(1,Math.min(1e4,n()))}):void 0,onSessionId:a=>{re.current=a;const p=a!==X.current,E=(X.current??null)===le.current,L=new Date().toISOString();S(K=>K.some(de=>de.id===a)?K.map(de=>de.id===a?{...de,is_busy:!0}:de):[{id:a,title:"New chat",selected_model:ee,created_at:L,updated_at:L,message_count:1,is_busy:!0,web_search_enabled:Oe,reasoning_effort:Re},...K]),p&&E&&fe("New chat"),E&&(ne.current=a,d({id:a,status:"loaded"}),p&&(e==="paper"?h==null||h(a):_(`/chat/${a}`,{replace:!0})))},onTitle:a=>{const p=re.current??X.current;p&&!j.current.has(p)&&(p===X.current&&fe(a),S(E=>E.map(L=>L.id===p?{...L,title:a}:L)))},onSettled:a=>{a&&S(p=>p.map(E=>E.id===a?{...E,is_busy:!1}:E)),re.current=null,le.current=null,_e.current==="openai"&&N.invalidateQueries({queryKey:Zt}),a&&e==="general"&&ot(a).then(p=>{X.current===a&&m(p.latex_paper??null)}).catch(()=>{}),G()},onProviderTerminal:()=>{_e.current==="openrouter"&&N.invalidateQueries({queryKey:Ur})},onPaperArtifact:a=>{e==="general"&&m(a.descriptor)},onInterrupted:a=>{ce(a),c==null||c(a.paperSelection)}}),be=k.send;i.useEffect(()=>{k.capacityRequest&&(ce(k.capacityRequest.draft),c==null||c(k.capacityRequest.draft.paperSelection))},[k.capacityRequest,c]);const me=i.useCallback(a=>{sessionStorage.setItem(ct,JSON.stringify(a)),sessionStorage.setItem(st,ee),sessionStorage.setItem(Mr,Re),sessionStorage.setItem(at,"1"),sessionStorage.setItem(it,"1");const p=e==="paper"&&t?`/pdf/${t.routeId}`:X.current?`/chat/${X.current}`:"/chat";window.location.href=hr(p,J==="huggingface")},[e,t,Re,ee,J]),je=i.useCallback((a,p)=>{sessionStorage.setItem(ct,JSON.stringify(a)),sessionStorage.setItem(st,ee),sessionStorage.removeItem(at),sessionStorage.removeItem(it),v(ye()),ce(a),c==null||c(a.paperSelection),P(p)},[c,ee]),Ne=i.useCallback(async a=>{const p=c?o?{...a,paperSelection:o}:{text:a.text,paperMentions:a.paperMentions}:a;if(!A){me(p);return}if(J==="huggingface"&&!b.current){if(w.current)return;w.current=!0;try{if(!(await He.getInferenceBilling()).connected){if(sessionStorage.getItem(it)==="1"){je(p,"Hugging Face inference authorization was not completed. Your prompt is ready to retry.");return}me(p);return}b.current=!0}catch(L){je(p,L instanceof Error?L.message:"Could not check Hugging Face authorization.");return}finally{w.current=!1}}const E=X.current??null;if(sessionStorage.removeItem(at),!be(p)){je(p,"Your prompt was not sent. It is ready to retry.");return}le.current=E,re.current=E,sessionStorage.removeItem(ct),sessionStorage.removeItem(st),sessionStorage.removeItem(it),Lr(),ce(ye()),c==null||c(void 0),e==="paper"&&(f==null||f())},[me,e,c,f,o,je,J,be,A]);i.useEffect(()=>{if(M||!A)return;const a=sessionStorage.getItem(st);a&&ae(a),G(),Fr().then(L=>{if(oe(L.items),!X.current){const K=z.current||a;ae(K&&L.items.some(de=>de.id===K)?K:L.default_model)}});const p=An(),E=sessionStorage.getItem(at)==="1";p&&(c==null||c(p.paperSelection),E?v(p):ce(p))},[M,c,G,A]),i.useEffect(()=>{if(!y){ne.current!==null&&!k.busy&&(ne.current=null,k.reset(),Ye(!1),De("low")),d(null),Ke(null),m(null);return}if(ne.current===y||(Ke(null),d(p=>(p==null?void 0:p.id)===y&&p.status==="loading"?p:{id:y,status:"loading"}),M||!A))return;let a=!1;return P(""),ot(y).then(p=>{var L,K;if(a)return;k.load(Kt(p),y,p.is_busy),m(p.latex_paper??null),ae(p.selected_model),Ye(B.current&&p.messages.length===0?B.current.webSearchEnabled:p.web_search_enabled),De(B.current&&p.messages.length===0?B.current.reasoningEffort:p.reasoning_effort??"high"),fe(p.title);const E=(K=(L=[...p.messages].reverse().find(de=>de.role==="user"&&de.viewer_context))==null?void 0:L.viewer_context)==null?void 0:K.page;Ke(E??null),ne.current=y,d({id:y,status:"loaded"})}).catch(p=>{if(a)return;const E=p instanceof Error?p.message:"Chat not found";k.reset(),P(E),d({id:y,status:"error",error:E})}),()=>{a=!0}},[M,y,A,k.busy,O]),i.useEffect(()=>{var L;const a=(L=I.get("q"))==null?void 0:L.trim();if(!a)return;x.current=!1;const p=I.get("model");p&&ae(p),v(ye(a));const E=new URLSearchParams(I);E.delete("q"),E.delete("model"),q(E,{replace:!0})},[I,q]),i.useEffect(()=>{if(M||k.busy||!l.text||x.current||A&&Oe&&V.isFetching||y&&(u==null?void 0:u.status)!=="loaded")return;const a=window.setTimeout(()=>{if(x.current)return;x.current=!0,Ne(l).finally(()=>v(ye()))},0);return()=>window.clearTimeout(a)},[M,V.isFetching,k.busy,l,y,u==null?void 0:u.status,Ne,A,Oe]),i.useEffect(()=>{const a=()=>{!A||k.busy||G()};return window.addEventListener("focus",a),()=>window.removeEventListener("focus",a)},[k.busy,G,A]);const qe=()=>{re.current=null,k.reset(),ce(ye()),c==null||c(void 0),Ye(!1),De("low"),fe(""),e==="paper"?g==null||g():_("/chat")},tt=async(a,p)=>{try{const E=await pt(a,{title:p});return j.current.add(a),a===y&&fe(E.title),S(L=>L.map(K=>K.id===a?E:K)),!0}catch(E){return P(E instanceof Error?E.message:"Rename failed"),!1}},rt=async a=>{const p=a===y&&k.busy;if(window.confirm(p?"Stop and delete this chat? This cannot be undone.":"Delete this chat? This cannot be undone.")){p&&k.stop();try{if(p){const E=Date.now()+3e3;for(;(await ot(a)).is_busy;){if(Date.now()>=E)throw new Error("Generation is still stopping. The chat was not deleted.");await new Promise(K=>window.setTimeout(K,150))}}await Yr(a),a===y&&qe(),await G()}catch(E){P(E instanceof Error?E.message:"Delete failed")}}},Be=un({messages:k.messages,refreshSessions:G,resetChat:k.reset,restoreDraft:ce,clearTitle:()=>fe("")}),W=async a=>{const p=ee;if(ae(a),!!y)try{const E=await pt(y,{selected_model:a});S(L=>L.map(K=>K.id===y?{...K,selected_model:E.selected_model}:K)),P("")}catch(E){ae(p),P(E instanceof Error?E.message:"Model change failed")}},ge=async a=>{const p=Re;if(De(a),!!y)try{const E=await pt(y,{reasoning_effort:a});S(L=>L.map(K=>K.id===y?E:K))}catch(E){De(p),P(E instanceof Error?E.message:"Effort change failed")}},[ue,we]=i.useState(60);i.useLayoutEffect(()=>{const a=document.querySelector(".app-header");if(!a)return;const p=()=>we(a.offsetHeight);p();const E=new ResizeObserver(p);return E.observe(a),()=>E.disconnect()},[]);const R=ie.find(a=>a.id===y),Se=k.messages.length===0,Ue=(u==null?void 0:u.id)===y,Ve=!!(y&&(M||A&&(!Ue||(u==null?void 0:u.status)==="loading"))),nt=Ue&&(u==null?void 0:u.status)==="error"?u.error:void 0,tr=!!((St=Je.data)!=null&&St.fallback_enabled),rr=c?o?{...Ce,paperSelection:o}:{text:Ce.text,paperMentions:Ce.paperMentions}:Ce,bt={onSend:Ne,busy:k.busy,onStop:k.stop,draft:rr,onDraftChange:a=>{c?(ce({text:a.text,paperMentions:a.paperMentions}),a.paperSelection!==o&&c(a.paperSelection)):ce(a)},models:Z,selectedModel:ee,onModelChange:a=>void W(a),disabled:Q||M,describedBy:Q?"chat-paused-description":void 0,paperMentionsEnabled:!!((Et=V.data)!=null&&Et.paper_mentions_enabled),paperSelectionEnabled:((Tt=V.data)==null?void 0:Tt.paper_reader_selection_enabled)===!0,paperArtifactsEnabled:e==="general"&&((kt=V.data)==null?void 0:kt.paper_artifacts_enabled)===!0,webSearchAvailable:et,webSearchEnabled:Oe,onWebSearchChange:Ye,reasoningEffort:Re,onReasoningEffortChange:a=>void ge(a)};return s.jsx(Cn,{enabled:e==="general",workspaceKey:y??"new-chat",onAskAiFix:a=>{Ne(ye(a))},children:s.jsxs("div",{className:`chat-page${e==="paper"?" chat-page--reader":""}`,style:{height:e==="paper"?"100%":`calc(100dvh - ${ue}px)`},children:[e==="general"&&s.jsx(on,{sessions:ie,activeSessionId:y,loading:T,error:F,open:U,onClose:()=>Y(!1),onNew:qe,onNavigate:a=>_(`/chat/${a}`),onRename:tt,onDelete:a=>void rt(a)}),s.jsx(On,{enabled:e==="general",children:s.jsxs("section",{className:"chat-main","data-testid":"active-chat-pane",children:[s.jsxs("div",{className:"chat-topbar",children:[e==="general"&&!U&&s.jsx("button",{type:"button",className:"icon-btn",onClick:()=>Y(!0),title:"Open sidebar",children:s.jsx(Wt,{})}),e==="paper"&&s.jsx("button",{type:"button",className:"chat-reader-action",onClick:qe,children:"New chat"}),s.jsx("span",{className:"chat-topbar-title",children:Ve?(R==null?void 0:R.title)||"":Xe||(R==null?void 0:R.title)||(Se?"":"New chat")}),$&&s.jsx("span",{className:"chat-staging-badge",children:"Staging"}),e==="paper"&&s.jsx(At,{className:"chat-reader-action",to:"/chat",children:"All chats"}),e==="general"&&(R==null?void 0:R.primary_paper)&&s.jsx(At,{className:"chat-reader-action",to:`/pdf/${R.primary_paper.route_id}`,onClick:a=>{if(!ze()){a.preventDefault();return}const p=R.primary_paper.route_id;sessionStorage.setItem(`pwc:reader:session:${p}`,R.id),Ze&&sessionStorage.setItem(`pwc:reader:page:${p}`,String(Ze))},children:"Open reader"}),y&&Ue&&(u==null?void 0:u.status)==="loaded"&&!Se&&s.jsx(cn,{sessionId:y,busy:k.busy,loading:Ve,hasPaperSelection:k.messages.some(a=>!!a.paperSelection),onError:P})]}),ve&&s.jsxs("div",{className:"chat-credits-notice",role:"status",children:[s.jsx("span",{children:ve.message}),s.jsx("button",{type:"button",className:"chat-credits-notice-close","aria-label":"Dismiss credits notice",onClick:()=>{kn(ve.resetsAt),dt(ve.resetsAt)},children:"×"})]}),e==="general"&&H&&s.jsx(ln,{descriptor:H}),Ve&&!l.text?s.jsxs("div",{className:"chat-session-loading",role:"status","aria-live":"polite",children:[s.jsx(Ht,{}),s.jsx("span",{children:"Loading conversation…"})]}):nt?s.jsxs("div",{className:"chat-session-load-error",role:"alert",children:[s.jsx("p",{children:nt}),s.jsx("button",{type:"button",onClick:()=>{d({id:y,status:"loading"}),se(a=>a+1)},children:"Try again"})]}):Se&&!l.text?s.jsx("div",{className:"chat-empty",children:s.jsxs("div",{className:"chat-empty-inner",children:[s.jsx("div",{className:"chat-empty-eyebrow",children:e==="paper"?"Paper chat":"Research chat"}),s.jsx("h1",{className:"chat-empty-title",children:e==="paper"?"Ask about this paper":s.jsxs(s.Fragment,{children:["Ask ",s.jsx("em",{children:"Papers With Code"})]})}),s.jsx("p",{className:"chat-empty-sub",children:e==="paper"?"Questions are grounded in the open paper. Add up to three other papers with @.":"Answers are grounded in a live hybrid search over papers, tasks, and benchmarks — with citations you can follow."}),$&&s.jsx("p",{className:"chat-staging-access-note",children:"This is a limited staging preview. Only approved Hugging Face users can start chats."}),s.jsx(Pt,{variant:"empty",composerProps:bt,provider:J,paused:Q,suggestions:e==="paper"?In:qr})]})}):s.jsxs(s.Fragment,{children:[k.sessionError&&s.jsx("div",{className:"chat-session-error",role:"alert",children:k.sessionError}),s.jsx(tn,{messages:k.messages,papers:k.papers,busy:k.busy,queuedDraft:l.text?l:void 0,paperMentionsEnabled:!!((It=V.data)!=null&&It.paper_mentions_enabled),archivePending:Be.pending,openRouterFallbackEnabled:tr,onToggleBlock:k.toggleBlock,onEditAndResend:k.editAndResend,onRetryFromProgress:k.retryFromProgress,onArchiveOld:()=>void Be.archiveOld(),onArchiveOldest:()=>void Be.archiveOldest()}),s.jsx(Pt,{variant:"followup",composerProps:bt,provider:J,paused:Q})]})]})}),k.capacityRequest&&s.jsx(rn,{retryAt:k.capacityRequest.retryAt,onCancel:k.cancelCapacity,onRetry:()=>{k.retryCapacity()&&(ce(ye()),c==null||c(void 0))}}),k.disabledRequest&&s.jsx(nn,{onClose:()=>{var p;const a=((p=k.disabledRequest)==null?void 0:p.draft)??Ce;ce(a),c==null||c(a.paperSelection),k.dismissDisabled(),V.refetch()}})]})})},ts=()=>s.jsx(Dn,{});export{Dn as ChatExperience,ts as default};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/ChatView-C6KccNYj.js ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var sr=Object.defineProperty;var ar=(t,e,r)=>e in t?sr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var X=(t,e,r)=>ar(t,typeof e!="symbol"?e+"":e,r);import{e as ir,A as or,Q as cr,r as l,j as s,X as lr,f as Ft,z as it,u as ur,b as dr,c as fr,a as pr,h as hr,S as mr,L as Rt,d as gr}from"./index-CxdnHo9-.js";import{u as Pt}from"./useQuery-D8Q6gREv.js";import{C as yr,U as Et,b as _r,c as We,u as br,d as wr,A as vr,a as xr}from"./ArtifactWorkspace-BH6Hc7q-.js";import{c as Pe}from"./chat-Cj9116s7.js";import{e as Sr,f as Yt,h as Rr,T as Er,d as qt,i as Tr,j as kr,k as Cr,l as He,m as Ir,t as Tt,n as Qe,o as Bt,r as Ar,S as Or,a as jr,D as Dr,s as Nr,v as Mr,w as Je,x as $e,y as Lr,z as Ge,B as ze,E as Fr,F as Pr,G as Yr,H as ot,I as qr}from"./chatLaunch-5Omrgp_C.js";import{S as Br}from"./chatPrompts-CDY3UGU1.js";import{u as Ur,O as Wr}from"./openrouter-CtFTPs7F.js";import"./katex.min-BSBacQyE.js";import"./hover-card-CdRF8g76.js";import"./github-De9GLWXG.js";import"./github-BYB9vaDZ.js";import"./PaperPreviewLink-CUTHdATo.js";import"./index-DFKsmHrq.js";import"./index-B42pNGT3.js";import"./paperQueryKeys-CcqbH5YG.js";import"./papers-BwPS4QGO.js";import"./useMutation-Be3gnlrL.js";import"./copy-DN4hDnRX.js";import"./file-text-CqF2MZuA.js";import"./external-link-DZCSog7H.js";import"./chevron-down-BbZGSdxv.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 Hr=ir("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]),he=(t,e)=>new Promise(r=>{const n=setTimeout(i,t);function i(){e==null||e.removeEventListener("abort",i),clearTimeout(n),r()}e==null||e.addEventListener("abort",i)}),Se=t=>({arxiv_id:null,source:"arxiv",source_url:null,thumbnail_url:null,authors:[],published:null,conference:null,citation_count:null,tasks:[],methods:[],repositories:[],project_pages:[],...t}),Re={name:"Object Detection",slug:"object-detection"},Oe={name:"Real-Time Object Detection",slug:"real-time-object-detection"},Vr={"2502.12524":{route_id:"2502.12524",title:"YOLOv12: Attention-Centric Real-Time Object Detectors",content:"Enhancing the network architecture of the YOLO framework has been crucial for a long time. This work introduces an attention-centric YOLO framework, namely YOLOv12, built around area attention and residual efficient layer aggregation networks (R-ELAN). YOLOv12-N reaches 40.6 mAP at 1.64 ms on a T4 GPU, closing the gap to attention-based detectors without the usual latency penalty and surpassing YOLOv10/YOLOv11 by +1.2–1.6 mAP at matched latency.",content_truncated:!1,metadata:Se({arxiv_id:"2502.12524",authors:[{name:"Y. Tian"},{name:"Q. Ye"},{name:"D. Doermann"}],published:"2025-02-18",citation_count:412,tasks:[Re,Oe],methods:[{name:"Area Attention",slug:"area-attention"}],repositories:[{url:"https://github.com/sunsmarterjie/yolov12",stars:18700}]})},"2407.17140":{route_id:"2407.17140",title:"RT-DETRv2: Improved Baseline with Bag-of-Freebies for Real-Time Detection",content:"RT-DETRv2 improves the real-time DETR baseline with selective multi-scale feature extraction, a discrete sampling operator to ease deployment, and training-only 'bag-of-freebies' that add no inference cost. RT-DETRv2-R18/R50/R101 reach 47.9 / 53.4 / 54.3 mAP on COCO at 217 / 108 / 74 FPS on T4 TensorRT FP16, remaining NMS-free end to end.",content_truncated:!1,metadata:Se({arxiv_id:"2407.17140",authors:[{name:"W. Lv"},{name:"Y. Zhao"},{name:"J. Chang"}],published:"2024-07-24",citation_count:268,tasks:[Re,Oe],methods:[{name:"DETR",slug:"detr"}],repositories:[{url:"https://github.com/lyuwenyu/RT-DETR",stars:9400}]})},"2410.13842":{route_id:"2410.13842",title:"D-FINE: Redefining Regression as Fine-grained Distribution Refinement",content:"D-FINE reformulates bounding-box regression in DETR-style detectors as iterative refinement of probability distributions (FDR) and adds a localization self-distillation scheme (GO-LSD). D-FINE-L reaches 54.0 mAP at ~9 ms and D-FINE-X 55.8 mAP on COCO while staying real-time on modern GPUs, dominating RT-DETRv2 and YOLOv10 on the accuracy–latency Pareto front.",content_truncated:!1,metadata:Se({arxiv_id:"2410.13842",authors:[{name:"Y. Peng"},{name:"H. Li"},{name:"P. Wu"}],published:"2024-10-17",conference:"ICLR 2025",citation_count:187,tasks:[Re,Oe],methods:[{name:"Knowledge Distillation",slug:"knowledge-distillation"}],repositories:[{url:"https://github.com/Peterande/D-FINE",stars:12100}]})},"2406.03459":{route_id:"2406.03459",title:"LW-DETR: A Transformer Replacement to YOLO for Real-Time Detection",content:"LW-DETR pairs a plain ViT encoder with a lightweight DETR decoder and shows the combination outperforms YOLOv8 and YOLO-NAS at comparable latency, arguing transformer detectors are viable even at the fast end of the accuracy–latency curve. Uses multi-level feature aggregation, window-attention interleaving, and IoU-aware classification.",content_truncated:!1,metadata:Se({arxiv_id:"2406.03459",authors:[{name:"Q. Chen"},{name:"X. Su"},{name:"X. Zhang"}],published:"2024-06-05",citation_count:94,tasks:[Re,Oe],methods:[{name:"Vision Transformer",slug:"vision-transformer"}],repositories:[{url:"https://github.com/Atten4Vis/LW-DETR",stars:5200}]})},"2304.08069":{route_id:"2304.08069",title:"DETRs Beat YOLOs on Real-time Object Detection",content:"RT-DETR is the first real-time end-to-end object detector, built on an efficient hybrid encoder that decouples intra-scale interaction and cross-scale fusion, plus IoU-aware query selection. RT-DETR-R50 achieves 53.1 mAP at 108 FPS on COCO, beating comparably sized YOLO detectors in both speed and accuracy while eliminating NMS entirely; its Figure 1 accuracy–latency plot became the reference for later real-time detectors.",content_truncated:!1,metadata:Se({arxiv_id:"2304.08069",authors:[{name:"Y. Zhao"},{name:"W. Lv"},{name:"S. Xu"}],published:"2023-04-17",conference:"CVPR 2024",citation_count:2310,tasks:[Re,Oe],methods:[{name:"DETR",slug:"detr"}],repositories:[{url:"https://github.com/lyuwenyu/RT-DETR",stars:9400}]})},"2405.14458":{route_id:"2405.14458",title:"YOLOv10: Real-Time End-to-End Object Detection",content:"YOLOv10 removes NMS from the YOLO pipeline via consistent dual assignments during training and applies a holistic efficiency–accuracy driven design across the architecture. YOLOv10-S is 1.8x faster than RT-DETR-R18 at similar COCO accuracy; the family spans 46.3–54.4 mAP with substantially lower end-to-end latency than prior YOLOs because post-processing disappears.",content_truncated:!1,metadata:Se({arxiv_id:"2405.14458",authors:[{name:"A. Wang"},{name:"H. Chen"},{name:"L. Liu"}],published:"2024-05-23",conference:"NeurIPS 2024",citation_count:1650,tasks:[Re,Oe],methods:[{name:"NMS-free Training",slug:"nms-free-training"}],repositories:[{url:"https://github.com/THU-MIG/yolov10",stars:44200}]})},"2401.17270":{route_id:"2401.17270",title:"YOLO-World: Real-Time Open-Vocabulary Object Detection",content:"YOLO-World extends the YOLO paradigm to open-vocabulary detection through vision-language modeling with a re-parameterizable vision-language path aggregation network (RepVL-PAN) and region-text contrastive pretraining. It detects categories never seen at training time while running at 35+ FPS, and its prompt-then-detect deployment re-parameterizes text embeddings for zero runtime text-encoder cost.",content_truncated:!1,metadata:Se({arxiv_id:"2401.17270",authors:[{name:"T. Cheng"},{name:"L. Song"},{name:"Y. Ge"}],published:"2024-01-30",conference:"CVPR 2024",citation_count:890,tasks:[{name:"Open-Vocabulary Object Detection",slug:"open-vocabulary-object-detection"},Re],methods:[{name:"Contrastive Learning",slug:"contrastive-learning"}],repositories:[{url:"https://github.com/AILab-CVC/YOLO-World",stars:16800}]})},158342:{route_id:"158342",title:"Ultralytics YOLO: real-time detection framework and model zoo",content:"Official Ultralytics framework release covering YOLO11 and YOLOv12 deployment: pretrained COCO checkpoints from nano to x-large, TensorRT/ONNX/CoreML export paths, and reproducible latency benchmarks on T4, Jetson Orin, and CPU targets. Widely used as the practical baseline for real-time detection deployments.",content_truncated:!1,metadata:Se({source:"external",source_url:"https://docs.ultralytics.com/models/",authors:[{name:"Ultralytics"}],published:"2025-01-02",tasks:[Re,Oe],repositories:[{url:"https://github.com/ultralytics/ultralytics",stars:46e3}],project_pages:[{url:"https://docs.ultralytics.com"}]})}},Ut=t=>t.map(e=>Vr[e]),kt=Ut(["2502.12524","2407.17140","2410.13842","2406.03459","2304.08069","2405.14458","2401.17270","158342"]),Ct=Ut(["2410.13842","2502.12524","2407.17140","2405.14458","2304.08069"]),It="The user wants the current state-of-the-art for real-time object detection. That's a moving target split across two lineages — the YOLO family (fast CNN one-stage detectors) and the DETR family (transformer, end-to-end, NMS-free). I should ground the answer in recent papers benchmarked on COCO with reported latency or FPS, not just accuracy. Let me start with a broad hybrid search, see which papers surface, then run a second, narrower query to pin down the head-to-head COCO mAP vs latency trade-offs before I write anything.",At="Good — both lineages are well represented. YOLOv12, YOLOv10 and RT-DETRv2 / D-FINE keep coming up. To actually rank them I need the accuracy-vs-latency numbers side by side on the same COCO val2017 protocol, so let me narrow the query to the benchmark comparison specifically.",Ot=`There isn't a single winner — real-time object detection in 2026 is a two-horse race between the [YOLO family](paper:2502.12524) (fast one-stage CNNs) and the end-to-end [DETR family](paper:2304.08069) (NMS-free transformers). Which one is “SOTA” depends entirely on where you sit on the accuracy-vs-latency curve.
7
+
8
+ **At the fast / edge end**, [YOLOv12](paper:2502.12524) is the current leader. Its area-attention design pushes attention into the YOLO backbone without the usual latency hit — YOLOv12-N reaches 40.6 mAP at ~1.6 ms on a T4, roughly +1.5 mAP over [YOLOv10](paper:2405.14458) at matched speed. [YOLOv10](paper:2405.14458) is still very relevant because it made the YOLO head NMS-free, cutting real end-to-end latency.
9
+
10
+ **At the high-accuracy end**, the transformer detectors win. [D-FINE](paper:2410.13842) currently holds the accuracy-latency Pareto front, reporting 55.8 mAP by reformulating box regression as fine-grained distribution refinement with self-distillation. It builds on [RT-DETRv2](paper:2407.17140), which hardened the [original RT-DETR](paper:2304.08069) recipe (the paper that first showed DETRs beating YOLOs in real time) with training-only “bag-of-freebies” that add no inference cost.
11
+
12
+ **My recommendation:** for edge or high-FPS deployment, start with [YOLOv12](paper:2502.12524) — the [Ultralytics framework](paper:158342) has ready-made checkpoints and export paths. If you have GPU headroom and want maximum accuracy while staying real-time, use [D-FINE](paper:2410.13842) or [RT-DETRv2](paper:2407.17140). And if you need open-vocabulary detection rather than fixed COCO classes, [YOLO-World](paper:2401.17270) is the one to look at.`,Kr=["How do these compare on edge devices like Jetson?","Show me open-vocabulary detectors","What about small-object detection?"];async function*$r(t,e){const r=()=>(e==null?void 0:e.aborted)===!0,n=t.trim().slice(0,90)||"state-of-the-art real-time object detection";if(yield{type:"stream_start",request_id:"req_mock",session_id:null},await he(350,e),!r()){yield{type:"reasoning_start"};for(let i=0;i<It.length;i+=6){if(await he(14,e),r())return;yield{type:"reasoning_delta",text:It.slice(i,i+6)}}if(await he(400,e),!r()&&(yield{type:"reasoning_end"},await he(300,e),!r()&&(yield{type:"tool_call",id:"call_1",name:"search_papers",args:{query:n,top_k:8}},await he(1100,e),!r()&&(yield{type:"tool_result",id:"call_1",hits:kt.length,took_ms:214,results:kt},await he(350,e),!r())))){yield{type:"reasoning_start"};for(let i=0;i<At.length;i+=6){if(await he(14,e),r())return;yield{type:"reasoning_delta",text:At.slice(i,i+6)}}if(await he(350,e),!r()&&(yield{type:"reasoning_end"},await he(300,e),!r()&&(yield{type:"tool_call",id:"call_2",name:"search_papers",args:{query:"RT-DETR vs YOLOv12 COCO mAP latency FPS T4 TensorRT comparison",top_k:5}},await he(900,e),!r()&&(yield{type:"tool_result",id:"call_2",hits:Ct.length,took_ms:176,results:Ct},await he(400,e),!r())))){for(let i=0;i<Ot.length;i+=4){if(await he(11,e),r())return;yield{type:"answer_delta",text:Ot.slice(i,i+4)}}yield{type:"done",followups:Kr,finish_reason:"success"}}}}}const Ne=()=>{const e=String("0").trim().toLowerCase();return e==="1"||e==="true"||e==="yes"},Gr=()=>!0;class Ye extends Error{constructor(e,r,n,i){super(e),this.code=r,this.status=n,this.retryAfterSeconds=i,this.name="ChatStreamError"}}class Xe extends Error{constructor(e="The assistant stream was interrupted."){super(e),this.name="ChatTransportError"}}function zr(t,e){if(Ne())try{Pe.reportLatency(t,e).catch(()=>{})}catch{}}function Qr(t,e={}){return Ne()?Jr(t,e):$r(t.message,e.signal)}function Wt(t,e={}){return Xr(t,e)}async function*Jr(t,e){try{const r=await Pe.stream(t,e.signal);yield*Vt(r,e)}catch(r){throw Ht(r)}}async function*Xr(t,e){try{const r=await Pe.resumeStream(t,e.signal,e.afterSequence);yield*Vt(r,e)}catch(r){throw Ht(r)}}function Ht(t){return t instanceof Ye||t instanceof Xe?t:t instanceof SyntaxError?new Ye("The assistant returned an invalid stream event.","invalid_stream_event"):new Xe(t instanceof Error?t.message:"The assistant stream was interrupted.")}function Zr(t){let e=null,r="message";const n=[];for(const i of t.split(`
13
+ `))if(i.startsWith("id:")){const c=i.slice(3).trim();/^[1-9]\d*$/.test(c)&&(e=Number(c))}else i.startsWith("event:")?r=i.slice(6).trimStart():i.startsWith("data:")&&n.push(i.slice(5).trimStart());return{sequence:e,event:r,data:n.join(`
14
+ `)}}async function*Vt(t,e){var p;if(!t.ok||!t.body){const a=t.ok?null:new or(t,await t.text());a&&cr(a);const h=a==null?void 0:a.detail,I=typeof h=="object"&&h!==null?h:null,g=t.status===403&&!h,y=Number(t.headers.get("Retry-After")),k=Number.isFinite(y)&&y>=0?Math.min(300,Math.ceil(y)):void 0;throw new Ye(g?"Chat on staging is limited to approved Hugging Face users. Sign in with an approved account and try again.":(a==null?void 0:a.message)||`Chat stream failed (${t.status})`,I&&"code"in I&&typeof I.code=="string"?I.code:g?"staging_access_required":void 0,t.status,k)}const r=t.body.getReader(),n=new TextDecoder;let i="",c=e.afterSequence&&e.afterSequence>0?e.afterSequence:0;try{for(;;){const{done:a,value:h}=await r.read();if(a)break;i+=n.decode(h,{stream:!0});let I;for(;(I=i.indexOf(`
15
+
16
+ `))!==-1;){const g=i.slice(0,I);i=i.slice(I+2);const y=Zr(g);if(!y.data||y.data==="[DONE]"||y.sequence!==null&&y.sequence<=c)continue;const k=JSON.parse(y.data);y.sequence!==null&&(c=y.sequence,(p=e.onSequence)==null||p.call(e,y.sequence)),yield k}}}finally{r.releaseLock()}}const en="https://huggingface.co/settings/inference-providers",jt="pwc.chat.billing-notice-dismissed.v1";function tn({provider:t}){const[e,r]=l.useState(()=>localStorage.getItem(jt)==="1");return!Ne()||e||t!=="huggingface"?null:s.jsxs("div",{className:"chat-billing-notice",role:"note",children:[s.jsx("span",{children:"Hugging Face models use the inference permission granted when you start chatting. Included monthly credits are used first, then extra usage requires purchased credits. You can choose organization billing in Settings."}),s.jsxs("div",{className:"chat-billing-notice-actions",children:[s.jsx("a",{href:"/settings",children:"Review billing"}),s.jsx("a",{href:en,target:"_blank",rel:"noreferrer",children:"Review usage"}),s.jsx("button",{type:"button",className:"chat-billing-notice-dismiss","aria-label":"Dismiss billing notice",title:"Dismiss",onClick:()=>{localStorage.setItem(jt,"1"),r(!0)},children:s.jsx(lr,{size:15,"aria-hidden":"true"})})]})]})}function Dt({variant:t,composerProps:e,provider:r,paused:n,suggestions:i=[]}){var p;const c=s.jsxs(s.Fragment,{children:[s.jsx(tn,{provider:r}),n&&s.jsx("div",{id:"chat-paused-description",className:"chat-paused-banner",role:"status",children:"Chat is temporarily disabled. You can keep browsing and editing your conversations. New research runs will return when chat is restored."}),s.jsx(yr,{...e,...t==="empty"?{autoFocus:!0}:{placeholder:(p=e.draft)!=null&&p.text?"Edit and send again…":"Ask a follow-up…"}}),t==="empty"&&s.jsx("div",{className:"chat-examples",children:i.map(a=>s.jsx("button",{type:"button",className:"chat-example",disabled:n,onClick:()=>{var h;return e.onSend({text:a,paperMentions:[],...(h=e.draft)!=null&&h.paperSelection?{paperSelection:e.draft.paperSelection}:{}})},children:a},a))})]});return t==="empty"?c:s.jsx("div",{className:"chat-composer-wrap",children:s.jsxs("div",{className:"chat-composer-inner",children:[c,s.jsx("div",{className:"chat-composer-foot",children:Ne()?s.jsxs(s.Fragment,{children:[r==="huggingface"&&s.jsxs("span",{className:"chat-provider-attribution",children:["Powered by 🤗 ",s.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"}),"."]}),r==="openrouter"&&s.jsxs("span",{className:"chat-provider-attribution",children:["Powered by ",s.jsx("a",{href:"https://openrouter.ai",target:"_blank",rel:"noreferrer",children:"OpenRouter"}),"."]}),r==="openai"&&s.jsx("span",{className:"chat-provider-attribution",children:"Powered by OpenAI."}),s.jsx("span",{children:"The AI assistant can make mistakes. Double-check responses."})]}):s.jsx(s.Fragment,{children:"Assistant preview — responses are simulated."})})]})})}function rn({messages:t,papers:e,busy:r,queuedDraft:n,paperMentionsEnabled:i,archivePending:c,openRouterFallbackEnabled:p,onToggleBlock:a,onEditAndResend:h,onRetryFromProgress:I,onArchiveOld:g,onArchiveOldest:y}){var te,re;const[k,q]=l.useState(null),C=l.useRef(null),L=l.useRef(null),M=l.useRef(null),ne=l.useRef(!0),[U,Z]=l.useState(!0),ee=l.useRef(null),m=l.useCallback(_=>{ne.current=_,Z(_)},[]),j=l.useRef(0),D=l.useRef(!1),S=t.filter(_=>_.role==="user"),B=S.length,f=(te=S[0])==null?void 0:te.id,v=(re=S.at(-1))==null?void 0:re.id;l.useEffect(()=>{r?q(null):M.current=null},[r]),l.useLayoutEffect(()=>{const _=C.current;if(_){if((B>j.current||r&&!D.current)&&m(!0),j.current=B,D.current=r,L.current!==null){_.scrollTop=L.current,L.current=null;return}if(M.current){const F=Array.from(_.querySelectorAll("[data-message-id]")).find($=>$.dataset.messageId===M.current);if(M.current=null,F){const $=_.getBoundingClientRect(),Q=F.getBoundingClientRect();_.scrollTop+=Q.top-$.top-24,m(!1);return}}ne.current&&(_.scrollTop=_.scrollHeight)}},[t,B,r,m]);const N=(_,F)=>{var $;L.current=(($=C.current)==null?void 0:$.scrollTop)??null,a(_,F)};return s.jsxs("div",{className:"chat-conversation-viewport",children:[s.jsx("div",{className:"chat-conversation",ref:C,tabIndex:0,role:"region","aria-label":"Conversation",onWheel:_=>{_.deltaY<0&&m(!1)},onTouchStart:_=>{var F;ee.current=((F=_.touches[0])==null?void 0:F.clientY)??null},onTouchMove:_=>{var $;const F=($=_.touches[0])==null?void 0:$.clientY;F!==void 0&&ee.current!==null&&F>ee.current&&m(!1),ee.current=F??null},onKeyDown:_=>{_.target===_.currentTarget&&(["ArrowUp","PageUp","Home"].includes(_.key)||_.key===" "&&_.shiftKey)&&m(!1)},onScroll:_=>{const{scrollHeight:F,scrollTop:$,clientHeight:Q}=_.currentTarget;F-$-Q>1&&m(!1)},children:s.jsxs("div",{className:"chat-conversation-inner",children:[t.length===0&&(n==null?void 0:n.text)&&s.jsx(Et,{id:"queued-launch-preview",text:n.text,paperMentions:n.paperMentions,paperSelection:n.paperSelection,isInitial:!0}),t.map(_=>{var F,$;return _.role==="user"?s.jsx(Et,{id:_.id,text:_.text??"",paperMentions:_.paperMentions??[],paperSelection:_.paperSelection,paperMentionsEnabled:i,isInitial:_.id===f,editingAllowed:!r&&!!_.revision,editing:k===_.id,editNotice:_.id===f?"Sending will replace this conversation.":_.id===v?"Sending will replace the response.":"Sending will replace the response and all messages after it.",onEdit:()=>q(_.id),onCancel:()=>q(null),onResendDraft:Q=>{_.id!==f&&(M.current=_.id);const we=h(_.id,Q);return we?(_.id===f&&m(!0),q(null)):M.current=null,we}},_.id):s.jsx(_r,{msg:_,papers:e,onToggleBlock:N,onRetryCompaction:!r&&_.id===((F=t.at(-1))==null?void 0:F.id)&&(($=S.at(-1))!=null&&$.revision)?I:void 0,onArchiveOldChats:g,onArchiveOldestChats:y,archivePending:c,hfBilling:null,openRouterFallbackEnabled:p,feedbackEnabled:!0},_.id)})]})}),!U&&s.jsx("button",{type:"button",className:"chat-jump-latest",onClick:()=>{m(!0);const _=C.current;_&&(_.focus({preventScroll:!0}),_.scrollTop=_.scrollHeight)},children:"Jump to latest"})]})}function nn({retryAt:t,onRetry:e,onCancel:r}){const[n,i]=l.useState(()=>Math.max(0,Math.ceil((t-Date.now())/1e3))),c=l.useRef(null);return l.useEffect(()=>{var I;const p=document.activeElement instanceof HTMLElement?document.activeElement:null;(I=c.current)==null||I.focus();const a=()=>i(Math.max(0,Math.ceil((t-Date.now())/1e3)));a();const h=window.setInterval(a,250);return()=>{window.clearInterval(h),p==null||p.focus()}},[t]),s.jsx("div",{className:"chat-capacity-dialog-backdrop",role:"presentation",children:s.jsxs("div",{className:"chat-capacity-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-capacity-dialog-title","aria-describedby":"chat-capacity-dialog-description",onKeyDown:p=>{p.key==="Escape"&&(p.preventDefault(),r())},children:[s.jsx("h2",{id:"chat-capacity-dialog-title",children:"All research slots are currently in use"}),s.jsx("p",{id:"chat-capacity-dialog-description",children:"Your message was not sent or billed. Try again in a few seconds."}),s.jsx("p",{className:"chat-capacity-countdown","aria-live":"polite",children:n>0?`Try again available in ${n} second${n===1?"":"s"}.`:"You can try again now."}),s.jsxs("div",{className:"chat-capacity-dialog-actions",children:[s.jsx("button",{type:"button",className:"chat-capacity-cancel",ref:c,onClick:r,children:"Cancel"}),s.jsx("button",{type:"button",className:"chat-capacity-retry",disabled:n>0,onClick:e,children:"Try again"})]})]})})}function sn({onClose:t}){const e=l.useRef(null);return l.useEffect(()=>{var n;const r=document.activeElement instanceof HTMLElement?document.activeElement:null;return(n=e.current)==null||n.focus(),()=>r==null?void 0:r.focus()},[]),s.jsx("div",{className:"chat-capacity-dialog-backdrop",role:"presentation",children:s.jsxs("div",{className:"chat-capacity-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-disabled-title","aria-describedby":"chat-disabled-description",onKeyDown:r=>{r.key==="Escape"&&(r.preventDefault(),t())},children:[s.jsx("h2",{id:"chat-disabled-title",children:"Chat is temporarily disabled"}),s.jsx("p",{id:"chat-disabled-description",children:"We've temporarily paused new research runs. Your message wasn't sent, and your draft is still here. Please try again later."}),s.jsx("div",{className:"chat-capacity-dialog-actions",children:s.jsx("button",{ref:e,type:"button",className:"chat-capacity-cancel",onClick:t,children:"Keep editing"})})]})})}function an({url:t,onClose:e}){return t?s.jsx("div",{className:"chat-share-dialog-backdrop",role:"presentation",onMouseDown:e,children:s.jsxs("div",{className:"chat-share-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"chat-share-dialog-title",onMouseDown:r=>r.stopPropagation(),children:[s.jsx("h2",{id:"chat-share-dialog-title",children:"Public link created"}),s.jsx("p",{children:"Anyone with this link can see this conversation. It could not be copied automatically, so copy it manually:"}),s.jsx("input",{readOnly:!0,value:t,"aria-label":"Public conversation link",autoFocus:!0,onFocus:r=>r.currentTarget.select()}),s.jsx("button",{type:"button",onClick:e,children:"Close"})]})}):null}const ct="pwc:chat:sidebar-width",lt=280,ut=200,dt=480,ft=t=>Math.max(ut,Math.min(dt,t)),on=()=>{if(typeof window>"u")return lt;const t=Number(localStorage.getItem(ct));return Number.isFinite(t)&&t>0?ft(t):lt};function cn({sessions:t,activeSessionId:e,loading:r,error:n,open:i,onClose:c,onNew:p,onNavigate:a,onRename:h,onDelete:I}){const[g,y]=l.useState(on),k=l.useRef(null),q=l.useRef(g),[C,L]=l.useState(null),[M,ne]=l.useState(""),[U,Z]=l.useState(null);l.useEffect(()=>{if(!U)return;const f=()=>Z(null),v=N=>{N.key==="Escape"&&f()};return window.addEventListener("click",f),window.addEventListener("keydown",v),()=>{window.removeEventListener("click",f),window.removeEventListener("keydown",v)}},[U]);const ee=f=>{L(f.id),ne(f.title)},m=async f=>{const v=M.trim();v&&await h(f,v)&&L(null)},j=(f,v,N)=>Z({id:f,x:v,y:N}),D=f=>{if(!k.current)return;const v=ft(k.current.width+f-k.current.x);q.current=v,y(v)},S=()=>{k.current&&(k.current=null,localStorage.setItem(ct,String(q.current)))},B=f=>{const v=ft(f);q.current=v,y(v),localStorage.setItem(ct,String(v))};return s.jsxs("aside",{className:`chat-sidebar${i?"":" chat-sidebar-closed"}`,style:{"--chat-sidebar-width":`${g}px`},children:[s.jsxs("div",{className:"chat-sidebar-top",children:[s.jsxs("button",{type:"button",className:"chat-new-chat",onClick:()=>{We()&&p()},children:[s.jsx(Sr,{})," New chat"]}),s.jsx("button",{type:"button",className:"icon-btn",onClick:c,title:"Collapse sidebar",children:s.jsx(Yt,{})})]}),s.jsxs("nav",{className:"chat-sessions","aria-label":"Chat history",children:[r&&s.jsx("div",{className:"chat-sessions-empty",children:"Loading chats…"}),!r&&n&&s.jsx("div",{className:"chat-sessions-empty",children:n}),!r&&!n&&t.length===0&&s.jsx("div",{className:"chat-sessions-empty",children:"Conversations you start will show up here."}),Rr(t).map(f=>s.jsxs("div",{className:"chat-session-group",children:[s.jsx("div",{className:"chat-session-group-label",children:f.label}),f.items.map(v=>s.jsxs("div",{className:`chat-session${v.id===e?" chat-session-active":""}`,role:"button",tabIndex:0,onClick:()=>{We()&&a(v.id)},onKeyDown:N=>{if(N.key==="Enter"&&We()&&a(v.id),N.key==="F2"&&ee(v),N.key==="ContextMenu"||N.shiftKey&&N.key==="F10"){N.preventDefault();const te=N.currentTarget.getBoundingClientRect();j(v.id,te.right-150,te.bottom)}},onContextMenu:N=>{N.preventDefault(),j(v.id,N.clientX,N.clientY)},children:[C===v.id?s.jsx("input",{className:"chat-session-title-input",value:M,autoFocus:!0,maxLength:80,onClick:N=>N.stopPropagation(),onChange:N=>ne(N.target.value),onBlur:()=>void m(v.id),onKeyDown:N=>{N.stopPropagation(),N.key==="Enter"&&m(v.id),N.key==="Escape"&&L(null)}}):s.jsx("span",{className:"chat-session-title",children:v.title}),s.jsx("button",{type:"button",className:"chat-session-menu","aria-label":"Chat actions","aria-haspopup":"menu",title:"Chat actions",onClick:N=>{N.stopPropagation();const te=N.currentTarget.getBoundingClientRect();j(v.id,te.right-150,te.bottom)},children:"⋯"}),s.jsx("button",{type:"button",className:"chat-session-delete","aria-label":"Delete conversation",onClick:N=>{N.stopPropagation(),We()&&I(v.id)},children:s.jsx(Er,{})})]},v.id))]},f.label))]}),s.jsx("div",{className:"chat-sidebar-resize-handle",role:"separator","aria-label":"Resize chat history","aria-orientation":"vertical","aria-valuemin":ut,"aria-valuemax":dt,"aria-valuenow":g,title:"Drag to resize; double-click to reset",tabIndex:0,onPointerDown:f=>{f.button===0&&(k.current={x:f.clientX,width:g},q.current=g,f.currentTarget.setPointerCapture(f.pointerId))},onPointerMove:f=>D(f.clientX),onPointerUp:S,onPointerCancel:S,onLostPointerCapture:S,onDoubleClick:()=>B(lt),onKeyDown:f=>{(f.key==="ArrowLeft"||f.key==="ArrowRight")&&(f.preventDefault(),B(g+(f.key==="ArrowRight"?10:-10))),(f.key==="Home"||f.key==="End")&&(f.preventDefault(),B(f.key==="Home"?ut:dt))}}),U&&s.jsx("div",{className:"chat-session-context-menu",role:"menu",style:{left:U.x,top:U.y},onClick:f=>f.stopPropagation(),children:s.jsx("button",{type:"button",role:"menuitem",autoFocus:!0,onClick:()=>{const f=t.find(v=>v.id===U.id);f&&ee(f),Z(null)},children:"Rename chat"})})]})}function ln({sessionId:t,busy:e,loading:r,hasPaperSelection:n=!1,onError:i}){const{toast:c}=Ft(),[p,a]=l.useState(!1),[h,I]=l.useState(""),g=async()=>{var y;if(!(e||p)&&!(n&&!window.confirm("This public link will include the selected paper passage. Anyone with the link can read that passage. Continue?"))){a(!0);try{const k=await Tr(t),q=new URL(k.public_path,window.location.origin).toString();try{if(!((y=navigator.clipboard)!=null&&y.writeText))throw new Error("Clipboard unavailable");await navigator.clipboard.writeText(q),c({className:"chat-share-toast",duration:5e3,title:"Public link copied to your clipboard",description:"Anyone with this link can see this conversation."})}catch{I(q)}}catch(k){const q=k instanceof Error?k.message:"Could not share this conversation";i(q),c({variant:"destructive",title:"Share failed",description:q})}finally{a(!1)}}};return s.jsxs(s.Fragment,{children:[s.jsxs("button",{type:"button",className:"chat-share-button",onClick:()=>void g(),disabled:e||p||r,"aria-label":"Share conversation",children:[p?s.jsx(qt,{}):s.jsx(Hr,{"aria-hidden":"true"}),s.jsx("span",{children:"Share"})]}),s.jsx(an,{url:h,onClose:()=>I("")})]})}const un=({descriptor:t})=>{const e=br(),{open:r,register:n,unregister:i}=e,c=it.useRef(null),p=t.source_head??t.preview_head,a=it.useMemo(()=>p?{kind:"artifact",schema_version:1,scope:"owner",artifact_id:t.artifact_id,version_id:p.version_id,identifier:"latex-paper",version:p.version,artifact_kind:"latex_paper",title:t.title,status:"ready",preview_mime:"application/pdf",source_language:"latex",total_bytes:0}:null,[t.artifact_id,t.title,p]),h=a?wr(a):null;return it.useEffect(()=>{if(!(!a||!h))return n(a),c.current!==h&&(c.current=h,r(a)),()=>i(h)},[a,h,r,n,i]),null};function dn({messages:t,refreshSessions:e,resetChat:r,restoreDraft:n,clearTitle:i}){const{toast:c}=Ft(),[p,a]=l.useState(null),h=()=>{const y=[...t].reverse().find(k=>k.role==="user");r(),n({text:(y==null?void 0:y.text)??"",paperMentions:(y==null?void 0:y.paperMentions)??[],...y!=null&&y.paperSelection?{paperSelection:y.paperSelection}:{}}),i()};return{pending:p,archiveOld:async()=>{if(p===null){a("old");try{const y=await Cr();if(await e(),y.archived_count===0){c({title:"No chats were archived",description:"There are no inactive chats older than 30 days."});return}h(),c({title:`${y.archived_count} ${y.archived_count===1?"chat":"chats"} archived`,description:"Your question is ready to send again."})}catch(y){c({variant:"destructive",title:"Could not archive old chats",description:y instanceof Error?y.message:"Try again."})}finally{a(null)}}},archiveOldest:async()=>{if(p===null){a("oldest");try{const y=await kr();await e(),h(),c({title:`${y.archived_count} ${y.archived_count===1?"chat":"chats"} archived`,description:"Your question is ready to send again."})}catch(y){c({variant:"destructive",title:"Could not archive chats",description:y instanceof Error?y.message:"Try again."})}finally{a(null)}}}}}class fn{constructor(e,r=zr){X(this,"requestId");X(this,"firstVisibleAt");X(this,"streamStartReported",!1);X(this,"firstVisibleReported",!1);X(this,"terminalReported",!1);X(this,"semanticReported",new Set);this.submittedAt=e,this.report=r}recordStreamStart(e,r){this.requestId=e,this.streamStartReported||(this.streamStartReported=!0,this.send({submission_to_stream_start_ms:Math.max(0,r-this.submittedAt)})),this.reportFirstVisible()}recordFirstVisible(e){this.firstVisibleAt===void 0&&(this.firstVisibleAt=e,this.reportFirstVisible())}recordSemantic(e,r){if(this.semanticReported.has(e))return;this.semanticReported.add(e);const n=Math.max(0,r-this.submittedAt);this.send(e==="reasoning"?{submission_to_first_reasoning_delta_ms:n}:e==="tool"?{submission_to_first_tool_call_ms:n}:{submission_to_first_answer_delta_ms:n})}recordTerminal(e){this.terminalReported||(this.terminalReported=!0,this.send({terminal_classification:e}))}reportFirstVisible(){!this.requestId||this.firstVisibleAt===void 0||this.firstVisibleReported||(this.firstVisibleReported=!0,this.send({submission_to_first_visible_delta_ms:Math.max(0,this.firstVisibleAt-this.submittedAt)}))}send(e){this.requestId&&this.report(this.requestId,e)}}const Kt="Preparing research workspace…",$t={preparing_workspace:"Preparing secure workspace…",starting_agent:"Starting research agent…",connecting_model:"Connecting to model…"},Gt=()=>({messages:[],sessionId:null,title:"",phase:"idle"});function Nt(t,e){for(let r=t.length-1;r>=0;r-=1)if(e(t[r]))return r;return-1}function Te(t){if(t.status!==Kt&&!Object.values($t).includes(t.status))return t;const{status:e,...r}=t;return r}function z(t,e){if(!t.length)return t;const r=t.slice();return r[r.length-1]=e(r[r.length-1]),r}function je(t,e,r){return z(t,n=>{const i=Te(n),c=i.blocks??[];return{...i,blocks:c.map((p,a)=>e(p,a,c)?r(p):p)}})}function pn(t,e){switch(e.type){case"stream_start":return e.session_id?{...t,sessionId:e.session_id}:t;case"sandbox_start":case"sandbox_ready":case"workspace_ready":return t;case"lifecycle":return{...t,messages:z(t.messages,r=>{var n;return r.role==="assistant"&&r.streaming&&(((n=r.blocks)==null?void 0:n.length)??0)===0?{...r,status:$t[e.phase]}:r})};case"session_title_start":return{...t,title:""};case"session_title_delta":return{...t,title:`${t.title}${e.text}`.replace(/\s+/g," ").slice(0,80)};case"session_title_done":return{...t,title:e.title};case"compaction_status":return{...t,messages:z(t.messages,r=>({...r,compacting:!!(r.streaming&&e.state==="started")}))};case"reasoning_start":return{...t,messages:z(t.messages,r=>{const n=Te(r);return{...n,blocks:[...(n.blocks??[]).map(i=>i.kind==="reasoning"&&i.active?{...i,active:!1,open:!1}:i),{kind:"reasoning",text:"",active:!0,open:!0}]}})};case"reasoning_delta":return{...t,messages:je(t.messages,(r,n,i)=>r.kind==="reasoning"&&Nt(i,c=>c.kind==="reasoning")===n,r=>r.kind==="reasoning"?{...r,text:r.text+e.text}:r)};case"reasoning_end":return{...t,messages:z(t.messages,r=>{const n=r.blocks??[],i=Nt(n,a=>a.kind==="reasoning"&&a.active);if(i<0)return r;const c=n[i];if(c.kind!=="reasoning")return r;const p=n[i-1];return(p==null?void 0:p.kind)==="reasoning"&&p.text===c.text?{...r,blocks:n.filter((a,h)=>h!==i)}:{...r,blocks:n.map((a,h)=>h===i?{...c,active:!1,open:!1}:a)}})};case"tool_call":return{...t,messages:z(t.messages,r=>{const n=Te(r);return{...n,blocks:[...n.blocks??[],{kind:"tool",id:e.id,name:e.name,args:e.args,status:"running",open:!1}]}})};case"tool_call_start":return{...t,messages:z(t.messages,r=>{const n=Te(r);return{...n,blocks:[...n.blocks??[],{kind:"tool",schema_version:2,id:e.id,name:e.name,args:{},argumentText:"",argumentState:"streaming",arguments_redacted:e.redacted,status:"running",open:!1}]}})};case"tool_call_arguments_delta":return{...t,messages:je(t.messages,r=>r.kind==="tool"&&r.id===e.id,r=>r.kind==="tool"?{...r,args:e.partial_args,argumentText:e.snapshot?e.delta:`${r.argumentText??""}${e.delta}`,arguments_redacted:r.arguments_redacted||e.redacted}:r)};case"tool_call_arguments_done":return{...t,messages:je(t.messages,r=>r.kind==="tool"&&r.id===e.id,r=>r.kind==="tool"?{...r,args:e.args,argumentText:JSON.stringify(e.args),argumentState:"done",arguments_redacted:r.arguments_redacted||e.redacted}:r)};case"app_start":return{...t,messages:z(t.messages,r=>{const n=Te(r);return{...n,blocks:[...n.blocks??[],{kind:"app",schema_version:1,instance_id:e.instance_id,provider:e.provider,server:e.server,tool:e.tool,resource_uri:e.resource_uri,status:"loading",input:e.input,result:{content:[],structuredContent:{},isError:!1},csp:{},permissions:{clipboardWrite:!0},height:525}]}})};case"app_result":return{...t,messages:je(t.messages,r=>r.kind==="app"&&r.instance_id===e.id,r=>r.kind==="app"?{...r,status:e.status,result:e.result}:r)};case"tool_result":return{...t,messages:je(t.messages,r=>r.kind==="tool"&&r.id===e.id,r=>r.kind!=="tool"?r:e.status?{...r,schema_version:2,status:e.status,took_ms:e.took_ms,content:e.content,metadata:e.metadata,open:e.status!=="success"}:{...r,status:"done",hits:e.hits,took_ms:e.took_ms,results:e.results})};case"artifact_start":return{...t,messages:z(t.messages,r=>{const n=Te(r);return{...n,blocks:[...n.blocks??[],{kind:"artifact",schema_version:1,scope:"owner",publication_id:e.publication_id,identifier:e.identifier,artifact_kind:"posterly",title:e.title,status:"generating",phase:"publishing_poster"}]}})};case"artifact_ready":return{...t,messages:je(t.messages,r=>r.kind==="artifact"&&r.publication_id===e.publication_id,r=>r.kind==="artifact"?{...r,artifact_id:e.artifact_id,version_id:e.version_id,identifier:e.identifier,version:e.version,title:e.title,status:"ready",preview_mime:e.preview_mime,source_language:e.source_language,gate_status:e.gate_status,total_bytes:e.total_bytes,phase:void 0}:r)};case"artifact_error":return{...t,messages:je(t.messages,r=>r.kind==="artifact"&&r.publication_id===e.publication_id,r=>r.kind==="artifact"?{...r,status:"error",phase:void 0,error_code:e.code,error_message:e.message}:r)};case"answer_delta":return{...t,messages:z(t.messages,r=>{const n=Te(r),i=n.blocks??[],c=i.at(-1);return(c==null?void 0:c.kind)==="answer"&&!c.done?{...n,blocks:[...i.slice(0,-1),{...c,text:c.text+e.text}]}:{...n,blocks:[...i,{kind:"answer",text:e.text,done:!1}]}})};case"done":return{...t,phase:"complete",messages:z(t.messages,r=>({...r,streaming:!1,compacting:!1,followups:e.followups,finishReason:e.finish_reason,citations:e.citations,blocks:(r.blocks??[]).map(n=>n.kind==="answer"?{...n,done:!0}:n.kind==="reasoning"&&n.active?{...n,active:!1,open:!1}:n)}))};case"error":return{...t,phase:"failed",messages:z(t.messages,r=>({...r,streaming:!1,compacting:!1,error:e.message,errorCode:e.code,blocks:(r.blocks??[]).map(n=>n.kind==="reasoning"&&n.active?{...n,active:!1,open:!1}:n.kind==="tool"&&n.status==="running"?{...n,status:"error",open:!0}:n)}))};default:return t}}function hn(t){return z(t,e=>{if(e.role!=="assistant")return e;const r=(e.blocks??[]).flatMap(n=>n.kind==="tool"&&n.status==="running"?[{...n,status:"error",open:!0}]:n.kind==="reasoning"&&n.active?n.text?[{...n,active:!1,open:!1}]:[]:n.kind==="answer"?[{...n,done:!0}]:[n]);return{...e,blocks:r,streaming:!1,compacting:!1,finishReason:"stopped"}})}function mn(t,e){switch(e.type){case"start":return{messages:e.messages,sessionId:e.sessionId,title:"",phase:"streaming"};case"event":return pn(t,e.event);case"load":return{messages:e.messages,sessionId:e.sessionId,title:t.title,phase:"idle"};case"workspace_status":return{...t,messages:z(t.messages,r=>{var n;return r.role==="assistant"&&r.streaming&&(((n=r.blocks)==null?void 0:n.length)??0)===0&&!r.error?{...r,status:Kt}:r})};case"clear_workspace_status":return{...t,messages:z(t.messages,Te)};case"settle":return{...t,phase:"idle",messages:z(t.messages,r=>r.streaming?{...r,streaming:!1,compacting:!1}:r)};case"stop":return{...t,messages:hn(t.messages),phase:"stopped"};case"toggle_block":return{...t,messages:zt(t.messages,e.messageId,e.blockIndex)};case"reset":return Gt()}}function zt(t,e,r){return t.map(n=>{var i;return n.id!==e?n:{...n,blocks:(i=n.blocks)==null?void 0:i.map((c,p)=>p===r&&(c.kind==="reasoning"||c.kind==="tool")?{...c,open:!c.open}:c)}})}const Ee={minDelayMs:5,maxDelayMs:80,minRateCharsPerMs:.3,maxBufferedMs:400,arrivalRateTauMs:1e3,arrivalRateHeadroom:1.1,maxPendingChars:64},gn={now:()=>performance.now(),sleep:(t,e)=>new Promise(r=>{if(e!=null&&e.aborted||t<=0){r();return}const n=window.setTimeout(i,t);function i(){e==null||e.removeEventListener("abort",i),window.clearTimeout(n),r()}e==null||e.addEventListener("abort",i,{once:!0})})};function yn(t){return!["stream_start","sandbox_start","sandbox_ready","workspace_ready","session_title_start","session_title_delta","session_title_done"].includes(t.type)}function _n(t,e=!1,r=Ee.maxPendingChars){var i;if(!t)return{pieces:[],pending:""};if(e)return{pieces:[t],pending:""};const n=Intl.Segmenter;if(n){const p=[...new n(void 0,{granularity:"word"}).segment(t)].filter(h=>h.isWordLike);let a=0;if(p.length>1&&(a=p.at(-1).index),p.length&&/\s$/u.test(t)&&(a=t.length),a>0){const h=t.slice(0,a),I=[],y=[...new n(void 0,{granularity:"word"}).segment(h)].filter(k=>k.isWordLike);for(let k=0;k<y.length;k+=1){const q=k===0?0:y[k].index,C=((i=y[k+1])==null?void 0:i.index)??h.length;C>q&&I.push(h.slice(q,C))}return y.length||I.push(h),{pieces:I,pending:t.slice(a)}}}else{const c=[...t.matchAll(/\s+/gu)];if(c.length){const p=[];let a=0;for(const h of c){const I=h.index+h[0].length;p.push(t.slice(a,I)),a=I}return{pieces:p,pending:t.slice(a)}}}return t.length>=r?{pieces:[t.slice(0,r)],pending:t.slice(r)}:{pieces:[],pending:t}}function bn(t,e={}){const r={minDelayMs:e.minDelayMs??Ee.minDelayMs,maxDelayMs:e.maxDelayMs??Ee.maxDelayMs,minRateCharsPerMs:e.minRateCharsPerMs??Ee.minRateCharsPerMs,maxBufferedMs:e.maxBufferedMs??Ee.maxBufferedMs,arrivalRateTauMs:e.arrivalRateTauMs??Ee.arrivalRateTauMs,arrivalRateHeadroom:e.arrivalRateHeadroom??Ee.arrivalRateHeadroom,maxPendingChars:e.maxPendingChars??Ee.maxPendingChars},n=e.clock??gn,i=[];let c="",p=null,a=0,h=!0,I=!1,g=null,y=0,k=n.now(),q=!1;const C=()=>{g==null||g(),g=null},L=(m,j)=>{const D=m.type==="reasoning_delta"||m.type==="answer_delta"?m.text.length:0;i.push({kind:"event",event:m,arrivedAt:j,chars:D}),C()},M=m=>{if(!p||!c)return;const j=_n(c,m,r.maxPendingChars);for(const D of j.pieces)D&&L({type:p,text:D},a),a=n.now();c=j.pending,c||(p=null)},ne=m=>{if(!h)return;const j=n.now();if(m.type==="reasoning_delta"||m.type==="answer_delta"){const D=m.type;if(!m.text)return;if(!q){q=!0,y+=m.text.length,k=j;const B=Array.from(m.text)[0];L({type:D,text:B},j);const f=m.text.slice(B.length);if(f)for(p=D,c=f,a=j,M(!1);c.length>=r.maxPendingChars;)M(!1);return}p&&p!==D&&M(!0),p||(p=D,a=j),c+=m.text;const S=Math.max(0,j-k);for(y*=Math.exp(-S/r.arrivalRateTauMs),y+=m.text.length,k=j,M(!1);c.length>=r.maxPendingChars;)M(!1);return}yn(m)&&M(!0),L(m,j)},U=(async()=>{var m;try{for await(const j of t)ne(j);h&&M(!0)}catch(j){h&&!((m=e.signal)!=null&&m.aborted)&&(M(!0),i.push({kind:"error",error:j,arrivedAt:n.now(),chars:0}))}finally{I=!0,C()}})(),Z=()=>i.length||I?Promise.resolve():new Promise(m=>{g=m});return{events:async function*(){var j,D,S,B;let m=Number.NEGATIVE_INFINITY;try{for(;;){if(await Z(),!i.length){if(I||!h)return;continue}const f=i[0];if(f.kind==="error")throw i.shift(),f.error;if(f.chars&&!((j=e.isHidden)!=null&&j.call(e))){const v=n.now(),N=i.reduce((le,J)=>le+J.chars,0),te=((D=i.find(le=>le.chars))==null?void 0:D.arrivedAt)??v,re=Math.max(0,r.maxBufferedMs-(v-te)),_=y*Math.exp(-Math.max(0,v-k)/r.arrivalRateTauMs)/r.arrivalRateTauMs,F=re>0?N/re:Number.POSITIVE_INFINITY,$=Math.max(r.minRateCharsPerMs,_*r.arrivalRateHeadroom,F),Q=Math.min(r.maxDelayMs,Math.max(r.minDelayMs,f.chars/$)),we=Math.max(0,f.arrivedAt+r.maxBufferedMs-v),G=Math.max(f.arrivedAt,m+Math.min(Q,we));if(await n.sleep(Math.max(0,G-n.now()),e.signal),!h||(S=e.signal)!=null&&S.aborted)return}i.shift(),m=n.now(),yield f.event}}finally{h&&(h=!1,C(),await((B=t.return)==null?void 0:B.call(t,void 0))),await U}}(),takeAcceptedForStop(){var j;if(!h)return[];h=!1,p&&c&&(L({type:p,text:c},a),c="",p=null);const m=i.flatMap(D=>D.kind==="event"&&D.event.type!=="done"&&D.event.type!=="error"?[D.event]:[]);return i.length=0,C(),(j=t.return)==null||j.call(t,void 0),m}}}const Mt=[250,500,1e3],wn=(t,e)=>new Promise(r=>{const n=()=>{window.clearTimeout(i),e.removeEventListener("abort",n),r()},i=window.setTimeout(n,t);e.addEventListener("abort",n,{once:!0})});async function*vn(t,e){let r=t,n=0;for(;;){let i=!1;try{for await(const c of r)(c.type==="done"||c.type==="error")&&(i=!0),yield c;if(i||e.signal.aborted)return;throw new Xe}catch(c){e.onDisconnect();const p=e.getSessionId();if(e.signal.aborted||i||!(c instanceof Xe)||!p||n>=Mt.length)throw c;if(await wn(Mt[n],e.signal),e.signal.aborted)return;n+=1,r=Wt(p,{signal:e.signal,afterSequence:e.getAfterSequence(),onSequence:e.onSequence})}}}const Lt=new Set(["openrouter_monthly_budget_exhausted","openrouter_unavailable","openrouter_byok_credential_invalid","openrouter_byok_billing_error","openrouter_byok_rate_limit","hf_inference_billing_exhausted"]),xn=new Set(["paper_context_unavailable","paper_mention_unavailable","paper_mentions_disabled","paper_selection_disabled","paper_selection_requires_reader","paper_selection_paper_mismatch","paper_selection_version_mismatch","paper_selection_page_invalid","paper_selection_too_large","chat_storage_quota_exceeded"]);class Sn{constructor(){X(this,"lifecycle",Gt());X(this,"_busy",!1);X(this,"_pendingCapacity",null);X(this,"_sawStreamStart",!1);X(this,"_providerExecuted",!1);X(this,"_providerStatusChanged",!1);X(this,"terminal","pending");X(this,"rejection",null)}get busy(){return this._busy}get pendingCapacity(){return this._pendingCapacity}get sawStreamStart(){return this._sawStreamStart}get sawTerminalEvent(){return this.terminal==="complete"||this.terminal==="error"}get streamFailed(){return this.terminal==="error"||this.terminal==="transport_error"}get admissionRejected(){return this.rejection!==null}get shouldRefreshProvider(){return this._sawStreamStart&&this._providerExecuted||this._providerStatusChanged}finish(){this._busy=!1}queueCapacity(e){this._pendingCapacity=e}cancelCapacity(){this._pendingCapacity=null}projectSession(e){return this._busy&&e===this.sessionId?this.messages:null}get state(){return this.lifecycle}get messages(){return this.lifecycle.messages}get sessionId(){return this.lifecycle.sessionId}transition(e){return this.lifecycle=mn(this.lifecycle,e),this.lifecycle}start(e,r){this._busy=!0,this._sawStreamStart=this._providerExecuted=this._providerStatusChanged=!1,this.terminal="pending",this.rejection=null,this.transition({type:"start",messages:e,sessionId:r})}restore(e,r=this.sessionId){return this.transition({type:"load",messages:e,sessionId:r})}observe(e){return e.type==="stream_start"&&(this._sawStreamStart=!0,this._providerExecuted=e.provider_execution!==!1),(e.type==="done"||e.type==="error")&&(this.terminal=e.type==="done"?"complete":"error"),e.type==="error"&&Lt.has(e.code??"")?(this._providerStatusChanged=!0,!0):!1}reject(e,r){const n=e instanceof Ye?e.code:void 0,i=r&&n==="chat_not_busy"?"completed":n==="chat_temporarily_disabled"?"disabled":n==="chat_capacity"?"capacity":xn.has(n??"")?"draft":Lt.has(n??"")?"provider":"network";return this.terminal=i==="completed"?"already_complete":"transport_error",this.rejection=i==="disabled"||i==="capacity"||i==="draft"?i:null,this._providerStatusChanged||(this._providerStatusChanged=i==="provider"),i}reset(){this._busy=!1,this._pendingCapacity=null,this.transition({type:"reset"})}}const Rn=750;function En(t,e){for(let r=t.length-1;r>=0;r-=1)if(e(t[r]))return r;return-1}function De(t){const e=l.useRef(t);return l.useLayoutEffect(()=>{e.current=t}),l.useCallback((...r)=>e.current(...r),[])}function Tn(t){const[e,r]=l.useState([]),[n,i]=l.useState(!1),[c,p]=l.useState(""),[a]=l.useState(()=>new Sn),h=l.useRef(null),I=l.useRef(null),g=l.useRef(null),y=l.useRef(null),k=l.useRef(!1),q=l.useRef(null),C=l.useRef(null),L=l.useRef("cleared"),M=l.useRef(null),[ne,U]=l.useState(null),[Z,ee]=l.useState(null),m=l.useRef([]),j=l.useRef(null),D=l.useRef(!1),S=l.useRef(t),B=l.useRef(He()),f=l.useRef(0),v=l.useRef(0),N=l.useRef(t.sessionId);N.current!==t.sessionId&&(N.current=t.sessionId,a.sessionId!==t.sessionId&&(v.current+=1,M.current=null)),S.current=t,m.current=e,l.useEffect(()=>()=>{var u;C.current!==null&&window.clearTimeout(C.current),(u=h.current)==null||u.abort(),I.current=null,g.current!==null&&cancelAnimationFrame(g.current),y.current!==null&&window.clearTimeout(y.current),a.cancelCapacity()},[a]),l.useEffect(()=>{a.busy||a.restore(a.messages,t.sessionId)},[t.sessionId,a]),l.useEffect(()=>{const u=a.projectSession(t.sessionId);D.current=u!==null,u&&(r(u),m.current=u)},[t.sessionId,a]);const te=l.useMemo(()=>{const u={};for(const w of e)for(const R of w.blocks??[])if(R.kind==="tool")for(const x of R.results??[])u[x.route_id]=x;return u},[e]),re=()=>`m${++f.current}_${Date.now().toString(36)}`,_=(u,w=!0)=>{const R=a.state,x=a.transition(u),b=u.type==="event"&&u.event.type==="stream_start"?u.event.session_id:null;return b?S.current.onSessionId(b):x.sessionId&&x.sessionId!==R.sessionId&&S.current.onSessionId(x.sessionId),x.title!==R.title&&S.current.onTitle(x.title),w&&(m.current=x.messages,r(x.messages)),x},F=()=>j.current===v.current||D.current,$=()=>{g.current!==null&&(cancelAnimationFrame(g.current),g.current=null),y.current!==null&&(window.clearTimeout(y.current),y.current=null)},Q=()=>{$(),document.visibilityState!=="hidden"&&D.current&&(k.current=!1,m.current=a.messages,r(a.messages))},we=()=>{if(!D.current||document.visibilityState==="hidden"||g.current!==null||y.current!==null)return;const u=()=>{g.current=null,y.current=null,Q()};typeof requestAnimationFrame=="function"?g.current=requestAnimationFrame(u):y.current=window.setTimeout(u,0)};l.useEffect(()=>{const u=()=>{document.visibilityState==="visible"&&k.current&&we()};return document.addEventListener("visibilitychange",u),()=>document.removeEventListener("visibilitychange",u)});const G=u=>{if(h.current!==u||(C.current!==null&&(window.clearTimeout(C.current),C.current=null),L.current==="cleared"))return;const w=L.current==="shown";L.current="cleared",w&&_({type:"clear_workspace_status"},F())},le=(u,w)=>{C.current!==null&&window.clearTimeout(C.current),L.current="armed",C.current=window.setTimeout(()=>{C.current=null,!(L.current!=="armed"||h.current!==u||u.signal.aborted||v.current!==w)&&(L.current="shown",_({type:"workspace_status"},F()))},Rn)},J=(u,w)=>{const R=M.current;!R||R.controller!==u||R.tracker.recordStreamStart(w,performance.now())},Me=(u,w)=>{const R=M.current;!R||R.controller!==u||R.tracker.recordTerminal(w)};l.useLayoutEffect(()=>{const u=M.current;if(!u)return;const w=e.at(-1);if((w==null?void 0:w.role)!=="assistant"||!(w.blocks??[]).some(b=>b.kind==="tool"||b.kind==="reasoning"&&!!b.text.trim()||b.kind==="answer"&&!!b.text.trim()))return;const x=performance.now();u.tracker.recordFirstVisible(x);for(const b of w.blocks??[])b.kind==="reasoning"&&b.text.trim()?u.tracker.recordSemantic("reasoning",x):b.kind==="tool"?u.tracker.recordSemantic("tool",x):b.kind==="answer"&&b.text.trim()&&u.tracker.recordSemantic("answer",x)},[e]);const ke=(u,w=!0)=>{_({type:"event",event:u},w)},Ve=async(u,w)=>{var b;const R=await Qe(u);let x=Bt(R);return((b=q.current)==null?void 0:b.sessionId)===u&&(x=q.current.messages,q.current=null),v.current!==w&&!(j.current===w&&D.current&&S.current.sessionId===u)?null:(r(x),m.current=x,a.restore(x,u),x)},Ce=(u,w,R,x,b,V)=>{const Y=++v.current;j.current=Y,D.current=!0;const O=new AbortController;h.current=O;const ue=u.text;return B.current=u,p(""),r(R),a.start(R,w.session_id),i(!0),M.current=V?null:{controller:O,tracker:new fn(performance.now())},L.current="cleared",(async()=>{var me,ge,K,ae,be,fe;let _e=0;const de=W=>{W>_e&&(_e=W)};try{const W=V?Wt(V,{signal:O.signal,onSequence:de}):Qr(w,{signal:O.signal,onSequence:de}),E=vn(W,{signal:O.signal,getSessionId:()=>a.sessionId,onDisconnect:()=>{!O.signal.aborted&&h.current===O&&ke({type:"compaction_status",state:"finished"},F())},getAfterSequence:()=>_e,onSequence:de}),ie=!V&&Ne()&&Gr(),oe=ie?bn(E,{signal:O.signal,isHidden:()=>document.visibilityState==="hidden"}):null;oe&&(I.current={controller:O,stream:oe});for await(const A of(oe==null?void 0:oe.events)??E){if(O.signal.aborted||h.current!==O)break;A.type==="paper_artifact"&&((ge=(me=S.current).onPaperArtifact)==null||ge.call(me,A)),A.type==="stream_start"&&J(O,A.request_id),A.type==="sandbox_start"&&le(O,Y),(A.type==="sandbox_ready"||A.type==="workspace_ready"||A.type==="lifecycle")&&G(O),(A.type==="reasoning_start"||A.type==="reasoning_delta"||A.type==="tool_call"||A.type==="tool_call_start"||A.type==="tool_call_arguments_delta"||A.type==="tool_call_arguments_done"||A.type==="app_start"||A.type==="app_result"||A.type==="artifact_start"||A.type==="artifact_ready"||A.type==="artifact_error"||A.type==="answer_delta"||A.type==="done"||A.type==="error")&&G(O),a.observe(A)&&S.current.onInterrupted(u),(A.type==="done"||A.type==="error")&&Me(O,A.type==="error"?"error":"complete");const xe=F(),Fe=xe&&!(ie&&document.visibilityState==="hidden"),et=A.type==="reasoning_delta"||A.type==="answer_delta"||A.type==="tool_call_arguments_delta",tt=!["stream_start","sandbox_start","sandbox_ready","workspace_ready","session_title_start","session_title_delta","session_title_done","reasoning_delta","answer_delta","tool_call_arguments_delta"].includes(A.type);ie&&tt&&Q(),ie&&et?(ke(A,!1),k.current||(k.current=xe),we()):(ke(A,Fe),ie&&xe&&!Fe&&(k.current=!0))}}catch(W){if(!O.signal.aborted&&h.current===O){const E=a.reject(W,!!V),ie=E==="completed";if(G(O),!ie)if(E==="disabled")ee({question:ue,draft:u}),a.restore(x),v.current===Y&&(r(x),m.current=x,p(""));else if(E==="capacity"){const oe=W instanceof Ye?W.retryAfterSeconds??5:5,A={question:ue,draft:u,request:w,optimistic:R,original:x,edit:b,retryAfterSeconds:oe,retryAt:Date.now()+oe*1e3};a.queueCapacity(A),U({question:ue,draft:u,retryAt:A.retryAt,retryAfterSeconds:oe}),a.restore(x),v.current===Y&&(r(x),m.current=x,p(""))}else Me(O,"network_error"),E==="draft"&&(S.current.onInterrupted(u),a.restore(x),v.current===Y&&(r(x),m.current=x,p(W instanceof Error?W.message:"The assistant stream failed."))),E==="provider"&&S.current.onInterrupted(u);!ie&&!a.admissionRejected&&v.current===Y&&ke({type:"error",message:W instanceof Error?W.message:"The assistant stream failed.",code:W instanceof Ye?W.code:void 0})}}finally{if(h.current===O){if(((K=I.current)==null?void 0:K.controller)===O&&(Q(),I.current=null),G(O),!a.sawTerminalEvent&&!O.signal.aborted&&Me(O,"network_error"),a.finish(),i(!1),a.admissionRejected)S.current.onSettled(w.session_id);else if(!O.signal.aborted){a.shouldRefreshProvider&&((be=(ae=S.current).onProviderTerminal)==null||be.call(ae));const W=a.sessionId;if(b&&!a.sawStreamStart)a.restore(b.snapshot),v.current===Y&&(r(b.snapshot),m.current=b.snapshot,p("Couldn’t resend this message. Your original conversation was restored."));else if(W){v.current===Y&&b&&(a.streamFailed||!a.sawTerminalEvent)&&(a.restore(b.snapshot),r(b.snapshot),m.current=b.snapshot);try{const E=await Ve(W,Y);E&&b&&E.some(ie=>ie.id===b.targetId)&&p("Couldn’t resend this message. Your original conversation was restored.")}catch{v.current===Y&&_({type:"settle"})}}else v.current===Y&&_({type:"settle"});(!h.current||h.current===O)&&S.current.onSettled(W)}((fe=M.current)==null?void 0:fe.controller)===O&&(M.current=null)}}})(),!0},Le=De(u=>{var me,ge;const w=typeof u=="string"?He(u.trim()):u,R=w.text;if(!R||R.length>8e3||a.busy||a.pendingCapacity)return!1;const x=m.current,b=[...x].reverse().find(K=>K.role==="user"),V=b!=null&&b.status&&b.status!=="complete"&&b.revision?{replace_message_id:b.id,prior_revision:b.revision}:null,Y={id:re(),role:"user",text:R,paperMentions:w.paperMentions,paperSelection:w.paperSelection},O={id:re(),role:"assistant",streaming:!0,blocks:[]},ue=V&&b?En(x,K=>K.id===b.id):-1,_e=ue<0?[...x,Y,O]:[...x.slice(0,ue),Y,O],de=(ge=(me=S.current).viewerContext)==null?void 0:ge.call(me);return Ce(w,{message:R,paper_mentions:w.paperMentions.map(({route_id:K,title:ae,start:be,end:fe})=>({route_id:K,title:ae,start:be,end:fe})),session_id:S.current.sessionId,client_message_id:crypto.randomUUID(),web_search_enabled:!!S.current.webSearchEnabled,reasoning_effort:S.current.reasoningEffort??"low",...S.current.primaryPaperRouteId?{primary_paper_route_id:S.current.primaryPaperRouteId}:{},...de?{viewer_context:de}:{},...w.paperSelection?{paper_selection:Tt(w.paperSelection)}:{},...!S.current.sessionId&&S.current.initialModel?{initial_model:S.current.initialModel}:{},...V??{}},_e,x)}),qe=De((u,w)=>{var me,ge;const R=typeof w=="string"?He(w.trim()):w,x=R.text;if(!x||x.length>8e3||a.busy||a.pendingCapacity)return!1;const b=m.current.slice(),V=b.findIndex(K=>K.id===u&&K.role==="user");if(V<0)return!1;const Y=b[V];if(!S.current.sessionId||!Y.revision)return!1;const O={id:Y.id,role:"user",text:x,paperMentions:R.paperMentions,paperSelection:R.paperSelection,revision:Y.revision+1,status:"generating"},ue={id:re(),role:"assistant",streaming:!0,blocks:[]},_e=[...b.slice(0,V),O,ue],de=(ge=(me=S.current).viewerContext)==null?void 0:ge.call(me);return Ce(R,{message:x,paper_mentions:R.paperMentions.map(({route_id:K,title:ae,start:be,end:fe})=>({route_id:K,title:ae,start:be,end:fe})),session_id:S.current.sessionId,client_message_id:crypto.randomUUID(),web_search_enabled:!!S.current.webSearchEnabled,reasoning_effort:S.current.reasoningEffort??"low",...S.current.primaryPaperRouteId?{primary_paper_route_id:S.current.primaryPaperRouteId}:{},...de?{viewer_context:de}:{},...R.paperSelection?{paper_selection:Tt(R.paperSelection)}:{},replace_message_id:Y.id,prior_revision:Y.revision},_e,b,{targetId:Y.id,snapshot:b})}),Ze=De(()=>{const u=m.current.slice(),w=[...u].reverse().find(b=>b.role==="user");if(!S.current.sessionId||!(w!=null&&w.revision)||a.busy||a.pendingCapacity)return!1;const R=He(w.text??"Continue the interrupted response from saved progress."),x=[...u,{id:re(),role:"user",text:R.text,paperMentions:[]},{id:re(),role:"assistant",streaming:!0,blocks:[]}];return Ce(R,{message:R.text,session_id:S.current.sessionId,client_message_id:crypto.randomUUID(),retry_message_id:w.id,...S.current.primaryPaperRouteId?{primary_paper_route_id:S.current.primaryPaperRouteId}:{},web_search_enabled:!!S.current.webSearchEnabled,reasoning_effort:S.current.reasoningEffort??"low"},x,u)}),ve=l.useCallback(()=>{a.cancelCapacity(),U(null)},[a]),Ke=De(()=>{const u=a.pendingCapacity;return!u||Date.now()<u.retryAt||a.busy?!1:(a.cancelCapacity(),U(null),Ce(u.draft,u.request,u.optimistic,u.original,u.edit))}),Be=De(()=>{var V,Y;if(!h.current)return;const u=h.current;G(u),Me(u,"stopped"),u.abort();const w=((V=I.current)==null?void 0:V.controller)===u?I.current.stream.takeAcceptedForStop():[];I.current=null;for(const O of w)ke(O,!1);Q(),h.current=null,((Y=M.current)==null?void 0:Y.controller)===u&&(M.current=null),a.finish(),i(!1);const R=_({type:"stop"},!1).messages;m.current=R,r(R),S.current.onInterrupted(B.current);const x=a.sessionId;x&&(q.current={sessionId:x,messages:R}),x&&Ir(x).catch(()=>{});const b=++v.current;window.setTimeout(()=>{x&&v.current===b?Ve(x,b).catch(()=>{}).finally(()=>S.current.onSettled(x)):x||S.current.onSettled(null)},450)}),Ie=De((u,w)=>{const R=D.current?a.transition({type:"toggle_block",messageId:u,blockIndex:w}).messages:zt(m.current,u,w);m.current=R,r(R)}),se=l.useCallback(()=>{var u;v.current+=1,C.current!==null&&(window.clearTimeout(C.current),C.current=null),L.current="cleared",(u=h.current)==null||u.abort(),h.current=null,I.current=null,$(),k.current=!1,q.current=null,M.current=null,U(null),a.reset(),j.current=null,D.current=!1,r([]),i(!1),p("")},[a]),Ae=De((u,w,R=!1)=>{var x;if(v.current+=1,C.current!==null&&(window.clearTimeout(C.current),C.current=null),L.current="cleared",$(),k.current=!1,M.current=null,a.cancelCapacity(),U(null),a.busy&&w!==void 0&&w===a.sessionId){D.current=!0,r(a.messages),m.current=a.messages,p("");return}if(D.current=!1,a.busy||((x=h.current)==null||x.abort(),h.current=null,j.current=null,D.current=!1),R&&w){const b=[...u].reverse().find(V=>V.role==="user");if(b){const V={text:b.text??"",paperMentions:b.paperMentions??[],...b.paperSelection?{paperSelection:b.paperSelection}:{}},Y=[...u,{id:`${b.id}-active`,role:"assistant",streaming:!0,blocks:[]}];Ce(V,{message:V.text,session_id:w,client_message_id:"reconnect",web_search_enabled:!!S.current.webSearchEnabled,reasoning_effort:S.current.reasoningEffort??"low"},Y,u,void 0,w);return}}r(u),m.current=u,a.busy||a.restore(u,w??S.current.sessionId),a.busy||i(!1),p("")});return{messages:e,busy:n,papers:te,sessionError:c,capacityRequest:ne,disabledRequest:Z,send:Le,editAndResend:qe,retryFromProgress:Ze,retryCapacity:Ke,cancelCapacity:ve,dismissDisabled:()=>ee(null),stop:Be,toggleBlock:Ie,reset:se,load:Ae}}const Qt=["chat","openai","usage"],kn=90,Jt="pwc:chat:openai-credits-notice:dismissed";function Cn(t=!0){return Pt({queryKey:Qt,queryFn:()=>Pe.getOpenAIUsage(),enabled:t,staleTime:3e4,retry:!1,refetchOnWindowFocus:!0})}function In(t,e,r){if(!t||e!=="openai"||t.used_percent<kn||r===t.resets_at)return null;const n=new Intl.DateTimeFormat(void 0,{month:"long",day:"numeric"}).format(new Date(t.resets_at));return{message:`You have ${t.remaining_percent}% left of your monthly OpenAI credits. They reset on ${n}.`,resetsAt:t.resets_at}}function An(){try{return localStorage.getItem(Jt)}catch{return null}}function On(t){try{localStorage.setItem(Jt,t)}catch{}}const ye=He,jn=["Summarize the main contributions","Explain in simple terms","Identify the main limitations"],Dn=()=>{const t=sessionStorage.getItem(Je);if(!t)return null;try{return Yr(JSON.parse(t),t)}catch{}return ye(t)},Nn=({enabled:t,workspaceKey:e,children:r,onAskAiFix:n})=>t?s.jsx(vr,{workspaceKey:e,onAskAiFix:n,children:r}):s.jsx(s.Fragment,{children:r}),Mn=({enabled:t,children:e})=>t?s.jsx(xr,{variant:"chat",children:e}):s.jsx(s.Fragment,{children:e}),Ln=({mode:t="general",routeSessionId:e,primaryPaper:r,currentPage:n,paperSelection:i,onPaperSelectionChange:c,onSessionId:p,onReaderSubmit:a,onReaderNewChat:h})=>{var mt,gt,yt,_t,bt,wt,vt,xt,St;const{sessionId:I}=ur(),g=e??(t==="general"?I:void 0),y=dr(),[k,q]=fr(),{user:C,isLoading:L}=pr(),M=hr(),ne=gr(),U=Pt({queryKey:["chatAvailability"],queryFn:()=>Pe.getAvailability(),refetchInterval:3e4,retry:!1,enabled:Ne()&&!!C}),Z=((mt=U.data)==null?void 0:mt.status)==="paused"||t==="paper"&&((gt=U.data)==null?void 0:gt.paper_reader_chat_enabled)===!1,[ee,m]=l.useState([]),[j,D]=l.useState(!1),[S,B]=l.useState(""),[f,v]=l.useState(()=>g?{id:g,status:"loading"}:null),[N,te]=l.useState(0),[re,_]=l.useState(null),F=l.useRef(Ar()),$=l.useRef(k.get("model")||((yt=F.current)==null?void 0:yt.model)),[Q,we]=l.useState(ne?Or:jr),[G,le]=l.useState($.current||Dr),J=Nr(Q,G),Me=Ur(!!(C&&J==="openrouter")),ke=Cn(Ne()&&!!C&&J==="openai"),[Ve,Ce]=l.useState(()=>An()),Le=In(ke.data,J,Ve),qe=l.useRef(J);qe.current=J;const[Ze,ve]=l.useState(""),[Ke,Be]=l.useState(null),[Ie,se]=l.useState(()=>ye()),[Ae,u]=l.useState(()=>{var o;return((o=F.current)==null?void 0:o.webSearchEnabled)??!1}),[w,R]=l.useState(()=>{var o;return((o=F.current)==null?void 0:o.reasoningEffort)??"low"}),x=!!((_t=U.data)!=null&&_t.web_search_available),[b,V]=l.useState(()=>{var d,T;const o=(d=k.get("q"))==null?void 0:d.trim();return o?ye(o):((T=F.current)==null?void 0:T.draft)??ye()}),Y=l.useRef(!1),O=l.useRef(!1),ue=l.useRef(!1),[_e,de]=l.useState(()=>typeof window>"u"||window.innerWidth>900),me=l.useRef(new Set),ge=l.useRef(!1),K=l.useRef(g),ae=l.useRef(null),be=l.useRef(null),fe=l.useRef(null);K.current=g;const W=l.useCallback(async()=>{if(!C)return;const o=!ge.current;o&&D(!0);try{const d=await Mr();m(T=>{const P=ae.current,H=P?T.find(Ue=>Ue.id===P):void 0;if(!H)return d;const ce=d.find(Ue=>Ue.id===P);return[ce?{...ce,title:H.title,is_busy:!0}:H,...d.filter(Ue=>Ue.id!==P)]}),ge.current=!0,B("")}catch(d){B(d instanceof Error?d.message:"Could not load chats")}finally{o&&D(!1)}},[C]),E=Tn({sessionId:g??null,initialModel:G,webSearchEnabled:x&&Ae,reasoningEffort:w,primaryPaperRouteId:t==="paper"?r==null?void 0:r.routeId:void 0,viewerContext:t==="paper"&&n?()=>({page:Math.max(1,Math.min(1e4,n()))}):void 0,onSessionId:o=>{ae.current=o;const d=o!==K.current,T=(K.current??null)===be.current,P=new Date().toISOString();m(H=>H.some(ce=>ce.id===o)?H.map(ce=>ce.id===o?{...ce,is_busy:!0}:ce):[{id:o,title:"New chat",selected_model:G,created_at:P,updated_at:P,message_count:1,is_busy:!0,web_search_enabled:Ae,reasoning_effort:w},...H]),d&&T&&ve("New chat"),T&&(fe.current=o,v({id:o,status:"loaded"}),d&&(t==="paper"?p==null||p(o):y(`/chat/${o}`,{replace:!0})))},onTitle:o=>{const d=ae.current??K.current;d&&!me.current.has(d)&&(d===K.current&&ve(o),m(T=>T.map(P=>P.id===d?{...P,title:o}:P)))},onSettled:o=>{o&&m(d=>d.map(T=>T.id===o?{...T,is_busy:!1}:T)),ae.current=null,be.current=null,qe.current==="openai"&&M.invalidateQueries({queryKey:Qt}),o&&t==="general"&&Qe(o).then(d=>{K.current===o&&_(d.latex_paper??null)}).catch(()=>{}),W()},onProviderTerminal:()=>{qe.current==="openrouter"&&M.invalidateQueries({queryKey:Wr})},onPaperArtifact:o=>{t==="general"&&_(o.descriptor)},onInterrupted:o=>{se(o),c==null||c(o.paperSelection)}}),ie=E.send;l.useEffect(()=>{E.capacityRequest&&(se(E.capacityRequest.draft),c==null||c(E.capacityRequest.draft.paperSelection))},[E.capacityRequest,c]);const oe=l.useCallback(o=>{sessionStorage.setItem(Je,JSON.stringify(o)),sessionStorage.setItem($e,G),sessionStorage.setItem(Lr,w),sessionStorage.setItem(Ge,"1"),sessionStorage.setItem(ze,"1");const d=t==="paper"&&r?`/pdf/${r.routeId}`:K.current?`/chat/${K.current}`:"/chat";window.location.href=mr(d,J==="huggingface")},[t,r,w,G,J]),A=l.useCallback((o,d)=>{sessionStorage.setItem(Je,JSON.stringify(o)),sessionStorage.setItem($e,G),sessionStorage.removeItem(Ge),sessionStorage.removeItem(ze),V(ye()),se(o),c==null||c(o.paperSelection),B(d)},[c,G]),xe=l.useCallback(async o=>{const d=c?i?{...o,paperSelection:i}:{text:o.text,paperMentions:o.paperMentions}:o;if(!C){oe(d);return}if(J==="huggingface"&&!O.current){if(ue.current)return;ue.current=!0;try{if(!(await Pe.getInferenceBilling()).connected){if(sessionStorage.getItem(ze)==="1"){A(d,"Hugging Face inference authorization was not completed. Your prompt is ready to retry.");return}oe(d);return}O.current=!0}catch(P){A(d,P instanceof Error?P.message:"Could not check Hugging Face authorization.");return}finally{ue.current=!1}}const T=K.current??null;if(sessionStorage.removeItem(Ge),!ie(d)){A(d,"Your prompt was not sent. It is ready to retry.");return}be.current=T,ae.current=T,sessionStorage.removeItem(Je),sessionStorage.removeItem($e),sessionStorage.removeItem(ze),Fr(),se(ye()),c==null||c(void 0),t==="paper"&&(a==null||a())},[oe,t,c,a,i,A,J,ie,C]);l.useEffect(()=>{if(L||!C)return;const o=sessionStorage.getItem($e);o&&le(o),W(),Pr().then(P=>{if(we(P.items),!K.current){const H=$.current||o;le(H&&P.items.some(ce=>ce.id===H)?H:P.default_model)}});const d=Dn(),T=sessionStorage.getItem(Ge)==="1";d&&(c==null||c(d.paperSelection),T?V(d):se(d))},[L,c,W,C]),l.useEffect(()=>{if(!g){fe.current!==null&&!E.busy&&(fe.current=null,E.reset(),u(!1),R("low")),v(null),Be(null),_(null);return}if(fe.current===g||(Be(null),v(d=>(d==null?void 0:d.id)===g&&d.status==="loading"?d:{id:g,status:"loading"}),L||!C))return;let o=!1;return B(""),Qe(g).then(d=>{var P,H;if(o)return;E.load(Bt(d),g,d.is_busy),_(d.latex_paper??null),le(d.selected_model),u(F.current&&d.messages.length===0?F.current.webSearchEnabled:d.web_search_enabled),R(F.current&&d.messages.length===0?F.current.reasoningEffort:d.reasoning_effort??"high"),ve(d.title);const T=(H=(P=[...d.messages].reverse().find(ce=>ce.role==="user"&&ce.viewer_context))==null?void 0:P.viewer_context)==null?void 0:H.page;Be(T??null),fe.current=g,v({id:g,status:"loaded"})}).catch(d=>{if(o)return;const T=d instanceof Error?d.message:"Chat not found";E.reset(),B(T),v({id:g,status:"error",error:T})}),()=>{o=!0}},[L,g,C,E.busy,N]),l.useEffect(()=>{var P;const o=(P=k.get("q"))==null?void 0:P.trim();if(!o)return;Y.current=!1;const d=k.get("model");d&&le(d),V(ye(o));const T=new URLSearchParams(k);T.delete("q"),T.delete("model"),q(T,{replace:!0})},[k,q]),l.useEffect(()=>{if(L||E.busy||!b.text||Y.current||C&&Ae&&U.isFetching||g&&(f==null?void 0:f.status)!=="loaded")return;const o=window.setTimeout(()=>{if(Y.current)return;Y.current=!0,xe(b).finally(()=>V(ye()))},0);return()=>window.clearTimeout(o)},[L,U.isFetching,E.busy,b,g,f==null?void 0:f.status,xe,C,Ae]),l.useEffect(()=>{const o=()=>{!C||E.busy||W()};return window.addEventListener("focus",o),()=>window.removeEventListener("focus",o)},[E.busy,W,C]);const Fe=()=>{ae.current=null,E.reset(),se(ye()),c==null||c(void 0),u(!1),R("low"),ve(""),t==="paper"?h==null||h():y("/chat")},et=async(o,d)=>{try{const T=await ot(o,{title:d});return me.current.add(o),o===g&&ve(T.title),m(P=>P.map(H=>H.id===o?T:H)),!0}catch(T){return B(T instanceof Error?T.message:"Rename failed"),!1}},tt=async o=>{const d=o===g&&E.busy;if(window.confirm(d?"Stop and delete this chat? This cannot be undone.":"Delete this chat? This cannot be undone.")){d&&E.stop();try{if(d){const T=Date.now()+3e3;for(;(await Qe(o)).is_busy;){if(Date.now()>=T)throw new Error("Generation is still stopping. The chat was not deleted.");await new Promise(H=>window.setTimeout(H,150))}}await qr(o),o===g&&Fe(),await W()}catch(T){B(T instanceof Error?T.message:"Delete failed")}}},rt=dn({messages:E.messages,refreshSessions:W,resetChat:E.reset,restoreDraft:se,clearTitle:()=>ve("")}),Xt=async o=>{const d=G;if(le(o),!!g)try{const T=await ot(g,{selected_model:o});m(P=>P.map(H=>H.id===g?{...H,selected_model:T.selected_model}:H)),B("")}catch(T){le(d),B(T instanceof Error?T.message:"Model change failed")}},Zt=async o=>{const d=w;if(R(o),!!g)try{const T=await ot(g,{reasoning_effort:o});m(P=>P.map(H=>H.id===g?T:H))}catch(T){R(d),B(T instanceof Error?T.message:"Effort change failed")}},[er,tr]=l.useState(60);l.useLayoutEffect(()=>{const o=document.querySelector(".app-header");if(!o)return;const d=()=>tr(o.offsetHeight);d();const T=new ResizeObserver(d);return T.observe(o),()=>T.disconnect()},[]);const pe=ee.find(o=>o.id===g),nt=E.messages.length===0,st=(f==null?void 0:f.id)===g,at=!!(g&&(L||C&&(!st||(f==null?void 0:f.status)==="loading"))),pt=st&&(f==null?void 0:f.status)==="error"?f.error:void 0,rr=!!((bt=Me.data)!=null&&bt.fallback_enabled),nr=c?i?{...Ie,paperSelection:i}:{text:Ie.text,paperMentions:Ie.paperMentions}:Ie,ht={onSend:xe,busy:E.busy,onStop:E.stop,draft:nr,onDraftChange:o=>{c?(se({text:o.text,paperMentions:o.paperMentions}),o.paperSelection!==i&&c(o.paperSelection)):se(o)},models:Q,selectedModel:G,onModelChange:o=>void Xt(o),disabled:Z||L,describedBy:Z?"chat-paused-description":void 0,paperMentionsEnabled:!!((wt=U.data)!=null&&wt.paper_mentions_enabled),paperSelectionEnabled:((vt=U.data)==null?void 0:vt.paper_reader_selection_enabled)===!0,paperArtifactsEnabled:t==="general"&&((xt=U.data)==null?void 0:xt.paper_artifacts_enabled)===!0,webSearchAvailable:x,webSearchEnabled:Ae,onWebSearchChange:u,reasoningEffort:w,onReasoningEffortChange:o=>void Zt(o)};return s.jsx(Nn,{enabled:t==="general",workspaceKey:g??"new-chat",onAskAiFix:o=>{xe(ye(o))},children:s.jsxs("div",{className:`chat-page${t==="paper"?" chat-page--reader":""}`,style:{height:t==="paper"?"100%":`calc(100dvh - ${er}px)`},children:[t==="general"&&s.jsx(cn,{sessions:ee,activeSessionId:g,loading:j,error:S,open:_e,onClose:()=>de(!1),onNew:Fe,onNavigate:o=>y(`/chat/${o}`),onRename:et,onDelete:o=>void tt(o)}),s.jsx(Mn,{enabled:t==="general",children:s.jsxs("section",{className:"chat-main","data-testid":"active-chat-pane",children:[s.jsxs("div",{className:"chat-topbar",children:[t==="general"&&!_e&&s.jsx("button",{type:"button",className:"icon-btn",onClick:()=>de(!0),title:"Open sidebar",children:s.jsx(Yt,{})}),t==="paper"&&s.jsx("button",{type:"button",className:"chat-reader-action",onClick:Fe,children:"New chat"}),s.jsx("span",{className:"chat-topbar-title",children:at?(pe==null?void 0:pe.title)||"":Ze||(pe==null?void 0:pe.title)||(nt?"":"New chat")}),ne&&s.jsx("span",{className:"chat-staging-badge",children:"Staging"}),t==="paper"&&s.jsx(Rt,{className:"chat-reader-action",to:"/chat",children:"All chats"}),t==="general"&&(pe==null?void 0:pe.primary_paper)&&s.jsx(Rt,{className:"chat-reader-action",to:`/pdf/${pe.primary_paper.route_id}`,onClick:o=>{if(!We()){o.preventDefault();return}const d=pe.primary_paper.route_id;sessionStorage.setItem(`pwc:reader:session:${d}`,pe.id),Ke&&sessionStorage.setItem(`pwc:reader:page:${d}`,String(Ke))},children:"Open reader"}),g&&st&&(f==null?void 0:f.status)==="loaded"&&!nt&&s.jsx(ln,{sessionId:g,busy:E.busy,loading:at,hasPaperSelection:E.messages.some(o=>!!o.paperSelection),onError:B})]}),Le&&s.jsxs("div",{className:"chat-credits-notice",role:"status",children:[s.jsx("span",{children:Le.message}),s.jsx("button",{type:"button",className:"chat-credits-notice-close","aria-label":"Dismiss credits notice",onClick:()=>{On(Le.resetsAt),Ce(Le.resetsAt)},children:"×"})]}),t==="general"&&re&&s.jsx(un,{descriptor:re}),at&&!b.text?s.jsxs("div",{className:"chat-session-loading",role:"status","aria-live":"polite",children:[s.jsx(qt,{}),s.jsx("span",{children:"Loading conversation…"})]}):pt?s.jsxs("div",{className:"chat-session-load-error",role:"alert",children:[s.jsx("p",{children:pt}),s.jsx("button",{type:"button",onClick:()=>{v({id:g,status:"loading"}),te(o=>o+1)},children:"Try again"})]}):nt&&!b.text?s.jsx("div",{className:"chat-empty",children:s.jsxs("div",{className:"chat-empty-inner",children:[s.jsx("div",{className:"chat-empty-eyebrow",children:t==="paper"?"Paper chat":"Research chat"}),s.jsx("h1",{className:"chat-empty-title",children:t==="paper"?"Ask about this paper":s.jsxs(s.Fragment,{children:["Ask ",s.jsx("em",{children:"Papers With Code"})]})}),s.jsx("p",{className:"chat-empty-sub",children:t==="paper"?"Questions are grounded in the open paper. Add up to three other papers with @.":"Answers are grounded in a live hybrid search over papers, tasks, and benchmarks — with citations you can follow."}),ne&&s.jsx("p",{className:"chat-staging-access-note",children:"This is a limited staging preview. Only approved Hugging Face users can start chats."}),s.jsx(Dt,{variant:"empty",composerProps:ht,provider:J,paused:Z,suggestions:t==="paper"?jn:Br})]})}):s.jsxs(s.Fragment,{children:[E.sessionError&&s.jsx("div",{className:"chat-session-error",role:"alert",children:E.sessionError}),s.jsx(rn,{messages:E.messages,papers:E.papers,busy:E.busy,queuedDraft:b.text?b:void 0,paperMentionsEnabled:!!((St=U.data)!=null&&St.paper_mentions_enabled),archivePending:rt.pending,openRouterFallbackEnabled:rr,onToggleBlock:E.toggleBlock,onEditAndResend:E.editAndResend,onRetryFromProgress:E.retryFromProgress,onArchiveOld:()=>void rt.archiveOld(),onArchiveOldest:()=>void rt.archiveOldest()}),s.jsx(Dt,{variant:"followup",composerProps:ht,provider:J,paused:Z})]})]})}),E.capacityRequest&&s.jsx(nn,{retryAt:E.capacityRequest.retryAt,onCancel:E.cancelCapacity,onRetry:()=>{E.retryCapacity()&&(se(ye()),c==null||c(void 0))}}),E.disabledRequest&&s.jsx(sn,{onClose:()=>{var d;const o=((d=E.disabledRequest)==null?void 0:d.draft)??Ie;se(o),c==null||c(o.paperSelection),E.dismissDisabled(),U.refetch()}})]})})},is=()=>s.jsx(Ln,{});export{Ln as ChatExperience,is as default};
assets/ConferenceDetailView-BHu9__gm.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{u as L,r as D,j as e,L as p}from"./index-CxdnHo9-.js";import{u as T}from"./useQuery-D8Q6gREv.js";import{M as F}from"./MarkdownText-kHUUjGAC.js";import{c as A}from"./catalog-BRjI2ow6.js";import{c as B,h as C,d as E}from"./transform-CArGBSok.js";import{S as f}from"./skeleton-B_RgoAAL.js";import{A as P,a as z}from"./alert-BQ0_qoe3.js";import{s as M}from"./safeExternalHref-CkBrsh84.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-CUTHdATo.js";import"./index-DFKsmHrq.js";import"./index-B42pNGT3.js";import"./hover-card-CdRF8g76.js";import"./paperQueryKeys-CcqbH5YG.js";import"./papers-BwPS4QGO.js";import"./useMutation-Be3gnlrL.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}`},te=()=>{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{te as default};
assets/ConferenceDetailView-fQMXPiiZ.js DELETED
@@ -1 +0,0 @@
1
- import{u as L,r as D,j as e,L as p}from"./index-DVQGVzHu.js";import{u as T}from"./useQuery-tFDel9EL.js";import{M as F}from"./MarkdownText-D9cBh-rH.js";import{c as A}from"./catalog-Da4k4qEI.js";import{c as B,h as C,d as E}from"./transform-PseCN9bN.js";import{S as f}from"./skeleton-DJUh-5VW.js";import{A as P,a as z}from"./alert-7mO5HIuQ.js";import{s as M}from"./safeExternalHref-CkBrsh84.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-CpVn6ETd.js";import"./index-VSogvUtt.js";import"./index-B-ULOvtV.js";import"./hover-card-B-kPWoKE.js";import"./papers-DlaCqfyl.js";import"./useMutation-Doe-Qh76.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}`},ae=()=>{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{ae as default};
 
 
assets/ConferenceTaskView-B0eGZQ3N.js DELETED
@@ -1 +0,0 @@
1
- import{u as $,c as W,r as P,j as e,L as y,z as G}from"./index-DVQGVzHu.js";import{u as M}from"./useQuery-tFDel9EL.js";import{P as J}from"./components-_zRgatMC.js";import{u as X,P as Y}from"./useIntersectionObserver-IRMyVQkj.js";import{a as Z,P as ee,b as se}from"./PaperDateFilter-BH56Is-x.js";import{M as h}from"./MarkdownText-D9cBh-rH.js";import{c as z}from"./catalog-Da4k4qEI.js";import{t as ae,d as te}from"./transform-PseCN9bN.js";import{d as re}from"./usePapers-a_mp-Uw3.js";import{S as ne}from"./skeleton-DJUh-5VW.js";import{A as ie,a as oe}from"./alert-7mO5HIuQ.js";import"./LatexTitle-B0TwWoUu.js";import"./katex.min-BSBacQyE.js";import"./papers-DlaCqfyl.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-Beg3zsfL.js";import"./PaperPreviewLink-CpVn6ETd.js";import"./index-VSogvUtt.js";import"./index-B-ULOvtV.js";import"./hover-card-B-kPWoKE.js";import"./useMutation-Doe-Qh76.js";import"./useInfiniteQuery-CYdxlDgS.js";const ce=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],le=t=>t==="trending"||t==="date_published"||t==="citation_count"?t:"trending",Le=()=>{var A,L,O,T,B,D;const{confSlug:t,taskSlug:n}=$(),[o,u]=W(),w=le(o.get("order_by")),S=o.get("has_code")==="true",k=o.get("has_hf_artifacts")==="true",x=Z(o),I=a=>{const s=new URLSearchParams(o);s.set("order_by",a),u(s)},q=a=>{const s=new URLSearchParams(o);a?s.set("has_code","true"):s.delete("has_code"),u(s)},Q=a=>{const s=new URLSearchParams(o);a?s.set("has_hf_artifacts","true"):s.delete("has_hf_artifacts"),u(s)},R=n==="all",N=n==="oral",_=n==="spotlight",l=n==="outstanding",d=n==="best-paper-finalists",f=l||d,p=R||N||_||l||d,K=p?void 0:n,U=N?"oral":_?"spotlight":l?"outstanding":d?"best_paper_finalist":void 0,m=M({queryKey:["conference",t],queryFn:()=>z.getConference(t),enabled:!!t,staleTime:10*60*1e3}),j=M({queryKey:["task",n],queryFn:()=>z.getTask(n),enabled:!!n&&!p,staleTime:10*60*1e3}),i=re({conferenceSlug:t||"",taskSlug:K,presentation:U,page_size:12,order_by:w,order_dir:"desc",include_resources:!0,has_code:S,has_hf_artifacts:k,start_date:x.startDate,end_date:x.endDate,enabled:!!t}),{targetRef:V,isIntersecting:C}=X({rootMargin:"200px"});P.useEffect(()=>{C&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[C,i.hasNextPage,i.isFetchingNextPage]),P.useEffect(()=>{window.scrollTo(0,0)},[t,n]);const v=P.useMemo(()=>{var s;return(((s=i.data)==null?void 0:s.pages)??[]).flatMap(c=>c.results)},[i.data]),b=P.useMemo(()=>v.map(ae),[v]),g=R?"All papers":N?"Oral papers":_?"Spotlight papers":l?"Outstanding papers":d?"Best paper finalists":te(((A=j.data)==null?void 0:A.name)||n||"",((L=j.data)==null?void 0:L.slug)||n),F=((T=(O=i.data)==null?void 0:O.pages[0])==null?void 0:T.count)??((B=m.data)==null?void 0:B.paper_count)??0,r=j.data;return m.error||j.error||i.error?e.jsx("div",{className:"page",children:e.jsx(ie,{variant:"destructive",children:e.jsx(oe,{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(y,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(y,{to:"/conferences",children:"Conferences"}),e.jsx("span",{children:" / "}),e.jsx(y,{to:`/conferences/${t}`,children:((D=m.data)==null?void 0:D.name)??t}),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&&t==="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&&t==="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&&t==="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:F.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:a=>{var s,c;(c=(s=a.currentTarget.parentElement)==null?void 0:s.parentElement)==null||c.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:f?"Award papers":"Conference papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",F.toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[!f&&e.jsx("div",{className:"sort-options",children:ce.map(([a,s])=>e.jsx("button",{className:`sort-btn ${w===a?"active":""}`,onClick:()=>I(a),children:s},a))}),e.jsx(Y,{hasCode:S,hasHfArtifacts:k,onHasCodeChange:q,onHasHfArtifactsChange:Q,showDivider:!f})]}),e.jsx(ee,{startDate:x.startDate,endDate:x.endDate,onChange:a=>u(se(o,a))}),!f&&e.jsxs("div",{className:"results-count",children:[b.length," loaded in ",e.jsx("span",{children:g})]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,s)=>e.jsx(ne,{className:"h-40 w-full"},s))}):b.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:b.map((a,s)=>{var E;const c=(E=v[s])==null?void 0:E.conference_award,H=c==="outstanding"?"Outstanding Paper":c==="honorable_mention"?"Honorable Mention":c==="best_paper_finalist"&&!d?"Best Paper Finalist":null;return e.jsxs(G.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(J,{paper:a,rank:s+1})]},a.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{Le as default};
 
 
assets/ConferenceTaskView-D1RlMVvB.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{u as $,c as W,r as P,j as e,L as y,z as G}from"./index-CxdnHo9-.js";import{u as M}from"./useQuery-D8Q6gREv.js";import{P as J}from"./components-BH6Cy8IX.js";import{u as X,P as Y}from"./useIntersectionObserver-2PEjywgc.js";import{a as Z,P as ee,b as se}from"./PaperDateFilter-C9tnni-Y.js";import{M as h}from"./MarkdownText-kHUUjGAC.js";import{c as z}from"./catalog-BRjI2ow6.js";import{t as ae,d as te}from"./transform-CArGBSok.js";import{d as re}from"./usePapers-CD7ebaIw.js";import{S as ne}from"./skeleton-B_RgoAAL.js";import{A as ie,a as oe}from"./alert-BQ0_qoe3.js";import"./paperQueryKeys-CcqbH5YG.js";import"./LatexTitle-ih-jCKpS.js";import"./katex.min-BSBacQyE.js";import"./papers-BwPS4QGO.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-DEMAeJxN.js";import"./PaperPreviewLink-CUTHdATo.js";import"./index-DFKsmHrq.js";import"./index-B42pNGT3.js";import"./hover-card-CdRF8g76.js";import"./useMutation-Be3gnlrL.js";import"./useInfiniteQuery-BUi2pe7X.js";const ce=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],le=t=>t==="trending"||t==="date_published"||t==="citation_count"?t:"trending",Oe=()=>{var A,L,O,T,B,D;const{confSlug:t,taskSlug:n}=$(),[o,u]=W(),w=le(o.get("order_by")),S=o.get("has_code")==="true",k=o.get("has_hf_artifacts")==="true",x=Z(o),I=a=>{const s=new URLSearchParams(o);s.set("order_by",a),u(s)},q=a=>{const s=new URLSearchParams(o);a?s.set("has_code","true"):s.delete("has_code"),u(s)},Q=a=>{const s=new URLSearchParams(o);a?s.set("has_hf_artifacts","true"):s.delete("has_hf_artifacts"),u(s)},R=n==="all",N=n==="oral",_=n==="spotlight",l=n==="outstanding",d=n==="best-paper-finalists",f=l||d,p=R||N||_||l||d,K=p?void 0:n,U=N?"oral":_?"spotlight":l?"outstanding":d?"best_paper_finalist":void 0,m=M({queryKey:["conference",t],queryFn:()=>z.getConference(t),enabled:!!t,staleTime:10*60*1e3}),j=M({queryKey:["task",n],queryFn:()=>z.getTask(n),enabled:!!n&&!p,staleTime:10*60*1e3}),i=re({conferenceSlug:t||"",taskSlug:K,presentation:U,page_size:12,order_by:w,order_dir:"desc",include_resources:!0,has_code:S,has_hf_artifacts:k,start_date:x.startDate,end_date:x.endDate,enabled:!!t}),{targetRef:V,isIntersecting:C}=X({rootMargin:"200px"});P.useEffect(()=>{C&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[C,i.hasNextPage,i.isFetchingNextPage]),P.useEffect(()=>{window.scrollTo(0,0)},[t,n]);const v=P.useMemo(()=>{var s;return(((s=i.data)==null?void 0:s.pages)??[]).flatMap(c=>c.results)},[i.data]),b=P.useMemo(()=>v.map(ae),[v]),g=R?"All papers":N?"Oral papers":_?"Spotlight papers":l?"Outstanding papers":d?"Best paper finalists":te(((A=j.data)==null?void 0:A.name)||n||"",((L=j.data)==null?void 0:L.slug)||n),F=((T=(O=i.data)==null?void 0:O.pages[0])==null?void 0:T.count)??((B=m.data)==null?void 0:B.paper_count)??0,r=j.data;return m.error||j.error||i.error?e.jsx("div",{className:"page",children:e.jsx(ie,{variant:"destructive",children:e.jsx(oe,{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(y,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(y,{to:"/conferences",children:"Conferences"}),e.jsx("span",{children:" / "}),e.jsx(y,{to:`/conferences/${t}`,children:((D=m.data)==null?void 0:D.name)??t}),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&&t==="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&&t==="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&&t==="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:F.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:a=>{var s,c;(c=(s=a.currentTarget.parentElement)==null?void 0:s.parentElement)==null||c.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:f?"Award papers":"Conference papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",F.toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[!f&&e.jsx("div",{className:"sort-options",children:ce.map(([a,s])=>e.jsx("button",{className:`sort-btn ${w===a?"active":""}`,onClick:()=>I(a),children:s},a))}),e.jsx(Y,{hasCode:S,hasHfArtifacts:k,onHasCodeChange:q,onHasHfArtifactsChange:Q,showDivider:!f})]}),e.jsx(ee,{startDate:x.startDate,endDate:x.endDate,onChange:a=>u(se(o,a))}),!f&&e.jsxs("div",{className:"results-count",children:[b.length," loaded in ",e.jsx("span",{children:g})]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,s)=>e.jsx(ne,{className:"h-40 w-full"},s))}):b.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:b.map((a,s)=>{var E;const c=(E=v[s])==null?void 0:E.conference_award,H=c==="outstanding"?"Outstanding Paper":c==="honorable_mention"?"Honorable Mention":c==="best_paper_finalist"&&!d?"Best Paper Finalist":null;return e.jsxs(G.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(J,{paper:a,rank:s+1})]},a.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{Oe as default};
assets/{ConferencesIndexView-CAymeFPp.js → ConferencesIndexView-B10HZC6w.js} RENAMED
@@ -1 +1 @@
1
- import{r as p,j as e,L as d}from"./index-DVQGVzHu.js";import{u}from"./useQuery-tFDel9EL.js";import{c as f}from"./catalog-Da4k4qEI.js";import{S as m}from"./skeleton-DJUh-5VW.js";import{A as h,a as g}from"./alert-7mO5HIuQ.js";import{T as x}from"./TaxonomySuggestionTile-Cv_5Vdw1.js";import"./SignInToEditDialog-BnOs8fwJ.js";import"./button-CV3EZ-wD.js";import"./input-BAcBK79_.js";import"./textarea-aBWToPSo.js";import"./searchable-select-DCJ2FvKo.js";import"./popover-Beg3zsfL.js";import"./dialog-8H_bvgui.js";import"./loader-circle-PqpEC1ka.js";import"./useMutation-Doe-Qh76.js";import"./submissions-MYrqMRRd.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)"},q=()=>{const r=u({queryKey:["conferences"],queryFn:()=>f.conferences(),staleTime:6e5}),a=p.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{q as default};
 
1
+ import{r as p,j as e,L as d}from"./index-CxdnHo9-.js";import{u}from"./useQuery-D8Q6gREv.js";import{c as f}from"./catalog-BRjI2ow6.js";import{S as m}from"./skeleton-B_RgoAAL.js";import{A as h,a as g}from"./alert-BQ0_qoe3.js";import{T as x}from"./TaxonomySuggestionTile-LXp-6pUX.js";import"./SignInToEditDialog-CvCN1sw5.js";import"./button-CdSuwKQi.js";import"./input-DDdJ1U-7.js";import"./textarea-BDOV52Ld.js";import"./searchable-select-C6kGq-Ns.js";import"./popover-DEMAeJxN.js";import"./dialog-CPQIZl1d.js";import"./loader-circle-C8HknmII.js";import"./useMutation-Be3gnlrL.js";import"./submissions-Z67bAPym.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)"},q=()=>{const r=u({queryKey:["conferences"],queryFn:()=>f.conferences(),staleTime:6e5}),a=p.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{q as default};
assets/{CronDashboard-BnuBktOX.js → CronDashboard-C6qwAA5L.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{e as q,r as h,v as ss,l as as,j as e,k as ce,Y as rs,R as ns,I as ts,o as me,P as is,q as cs,w as Pe,s as F,h as Re,L as xe,a as ls,d as ds}from"./index-DVQGVzHu.js";import{u as V}from"./useQuery-tFDel9EL.js";import{f as _,A as te,C as v,a as b,b as y,c as E,d as f,o as ve}from"./operations-y4vJd47K.js";import{B as C}from"./badge-Bb6nkiIP.js";import{B as S}from"./button-CV3EZ-wD.js";import{C as os}from"./chevron-down-BAd8ubvW.js";import{D as fe,r as ms,f as us,h as hs,j as xs,p as ps,k as js}from"./codexAddEvals-w24SEtq1.js";import{F as _e}from"./file-text-Ci1EH-su.js";import{S as Fe}from"./shield-alert-Ca9ufK2K.js";import{E as ee}from"./external-link-NJ-WhNGs.js";import{C as se,R as Ne}from"./refresh-cw-CojbPFFj.js";import{L as M}from"./loader-circle-PqpEC1ka.js";import{C as pe}from"./circle-check-DDlJzsiu.js";import{u as U}from"./useMutation-Doe-Qh76.js";import{u as gs}from"./useInfiniteQuery-CYdxlDgS.js";import{p as Te}from"./paperEdits-CKi6BZBP.js";import{c as ue}from"./catalog-Da4k4qEI.js";import{c as be}from"./chat-CSWYblIR.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{e as q,r as h,v as ss,l as as,j as e,k as ce,Y as rs,R as ns,I as ts,o as me,P as is,q as cs,w as Pe,s as F,h as Re,L as xe,a as ls,d as ds}from"./index-CxdnHo9-.js";import{u as V}from"./useQuery-D8Q6gREv.js";import{f as _,A as te,C as v,a as b,b as y,c as E,d as f,o as ve}from"./operations-DS-P3qhn.js";import{B as C}from"./badge-JnIJa4Y-.js";import{B as S}from"./button-CdSuwKQi.js";import{C as os}from"./chevron-down-BbZGSdxv.js";import{D as fe,r as ms,f as us,h as hs,j as xs,p as ps,k as js}from"./codexAddEvals-BlP3s_w7.js";import{F as _e}from"./file-text-CqF2MZuA.js";import{S as Fe}from"./shield-alert-WfGqRZ8o.js";import{E as ee}from"./external-link-DZCSog7H.js";import{C as se,R as Ne}from"./refresh-cw-B71gAxOY.js";import{L as M}from"./loader-circle-C8HknmII.js";import{C as pe}from"./circle-check-vkOLj3Wu.js";import{u as U}from"./useMutation-Be3gnlrL.js";import{u as gs}from"./useInfiniteQuery-BUi2pe7X.js";import{p as Te}from"./paperEdits-yZm35mG3.js";import{c as ue}from"./catalog-BRjI2ow6.js";import{c as be}from"./chat-Cj9116s7.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{ExternalSourceEvalBadge-CExXjvU3.js → ExternalSourceEvalBadge-Bq3xq4B1.js} RENAMED
@@ -1 +1 @@
1
- import{a as l}from"./papers-DlaCqfyl.js";import{a0 as h,j as a,L as u}from"./index-DVQGVzHu.js";import{H as c,a as d,b as p}from"./hover-card-B-kPWoKE.js";import{s as g}from"./safeExternalHref-CkBrsh84.js";class m{constructor(e){this.request=e}list(e={}){const t=new URLSearchParams(Object.entries(e).filter(r=>r[1]!==void 0).map(([r,n])=>[r,String(n)])).toString();return this.request(`/evaluations/${t?`?${t}`:""}`,{cache:"no-store"})}get(e){return this.request(`/evaluations/${e}`)}async byPaper(e){return this.allPages({paper_id:Number(e),ordering:"-benchmark_popularity"})}async byDataset(e,t){return this.allPages({dataset_id:Number(e),best_metric:t,ordering:"best_rank"})}async byLeaderboard(e,t,r={}){return this.allPages({dataset_id:Number(e),task_id:Number(t),ordering:"best_rank",...r})}create(e){return this.request("/evaluations/",{method:"POST",body:JSON.stringify(e)})}update(e,t){return this.request(`/evaluations/${e}`,{method:"PUT",body:JSON.stringify(t)})}delete(e){return this.request(`/evaluations/${e}`,{method:"DELETE"})}primeCurationState(e,t=!1){return l.primeEvaluations(e,t)}batch(e,t){return l.mutateEvaluations(e,t,"/evaluations/batch",{method:"POST",body:JSON.stringify({paper_id:e,operations:t})})}async allPages(e){const r=await this.list({...e,page_size:100}),n=[...r.results];let i=r.next_page;for(;i;){const o=await this.list({...e,page:i,page_size:100});n.push(...o.results),i=o.next_page}return n}}const w=new m(h),S=()=>a.jsxs(c,{openDelay:120,closeDelay:120,children:[a.jsx(d,{asChild:!0,children:a.jsx("button",{type:"button",className:"bm-closed-source-tag","aria-label":"Closed-source model",children:"closed"})}),a.jsxs(p,{side:"top",align:"start",className:"w-auto max-w-[260px] p-3 text-sm leading-snug",children:["This is an evaluation of a closed-source model. You can disable viewing these in your"," ",a.jsx(u,{to:"/settings",className:"closed-eval-tooltip-link",children:"settings"}),"."]})]});function b(s){if(!s)return"Evaluation sourced outside this paper";const e=s.toLowerCase();if(e.includes("open-asr-leaderboard"))return"Open ASR Leaderboard";if(e.includes("arcprize.org"))return"ARC Prize Leaderboard";if(e.includes("frontierswe.com"))return"FrontierSWE";if(e.includes("deepswe.datacurve.ai"))return"DeepSWE";try{const t=new URL(s,"https://paperswithcode.co");return t.pathname.startsWith("/paper/")?"Source paper":t.hostname.replace(/^www\./,"")}catch{return s}}const j=({sourceUrl:s})=>{const e=g(s),t=typeof s=="string"&&s.startsWith("/paper/")?s:null,r=b(s);return a.jsxs(c,{openDelay:120,closeDelay:120,children:[a.jsx(d,{asChild:!0,children:a.jsx("button",{type:"button",className:"bm-external-source-tag","aria-label":`Externally sourced evaluation: ${r}`,children:"External"})}),a.jsxs(p,{side:"top",align:"start",className:"w-auto max-w-[280px] p-3 text-sm leading-snug",children:["This score was sourced outside this paper.",t?a.jsxs(a.Fragment,{children:[" ",a.jsx(u,{to:t,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:r}),"."]}):e?a.jsxs(a.Fragment,{children:[" ",a.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:r}),"."]}):a.jsxs(a.Fragment,{children:[" ",r,"."]})]})]})};export{S as C,j as E,w as e};
 
1
+ import{a as l}from"./papers-BwPS4QGO.js";import{a0 as h,j as a,L as u}from"./index-CxdnHo9-.js";import{H as c,a as d,b as p}from"./hover-card-CdRF8g76.js";import{s as g}from"./safeExternalHref-CkBrsh84.js";class m{constructor(e){this.request=e}list(e={}){const t=new URLSearchParams(Object.entries(e).filter(r=>r[1]!==void 0).map(([r,n])=>[r,String(n)])).toString();return this.request(`/evaluations/${t?`?${t}`:""}`,{cache:"no-store"})}get(e){return this.request(`/evaluations/${e}`)}async byPaper(e){return this.allPages({paper_id:Number(e),ordering:"-benchmark_popularity"})}async byDataset(e,t){return this.allPages({dataset_id:Number(e),best_metric:t,ordering:"best_rank"})}async byLeaderboard(e,t,r={}){return this.allPages({dataset_id:Number(e),task_id:Number(t),ordering:"best_rank",...r})}create(e){return this.request("/evaluations/",{method:"POST",body:JSON.stringify(e)})}update(e,t){return this.request(`/evaluations/${e}`,{method:"PUT",body:JSON.stringify(t)})}delete(e){return this.request(`/evaluations/${e}`,{method:"DELETE"})}primeCurationState(e,t=!1){return l.primeEvaluations(e,t)}batch(e,t){return l.mutateEvaluations(e,t,"/evaluations/batch",{method:"POST",body:JSON.stringify({paper_id:e,operations:t})})}async allPages(e){const r=await this.list({...e,page_size:100}),n=[...r.results];let i=r.next_page;for(;i;){const o=await this.list({...e,page:i,page_size:100});n.push(...o.results),i=o.next_page}return n}}const w=new m(h),S=()=>a.jsxs(c,{openDelay:120,closeDelay:120,children:[a.jsx(d,{asChild:!0,children:a.jsx("button",{type:"button",className:"bm-closed-source-tag","aria-label":"Closed-source model",children:"closed"})}),a.jsxs(p,{side:"top",align:"start",className:"w-auto max-w-[260px] p-3 text-sm leading-snug",children:["This is an evaluation of a closed-source model. You can disable viewing these in your"," ",a.jsx(u,{to:"/settings",className:"closed-eval-tooltip-link",children:"settings"}),"."]})]});function b(s){if(!s)return"Evaluation sourced outside this paper";const e=s.toLowerCase();if(e.includes("open-asr-leaderboard"))return"Open ASR Leaderboard";if(e.includes("arcprize.org"))return"ARC Prize Leaderboard";if(e.includes("frontierswe.com"))return"FrontierSWE";if(e.includes("deepswe.datacurve.ai"))return"DeepSWE";try{const t=new URL(s,"https://paperswithcode.co");return t.pathname.startsWith("/paper/")?"Source paper":t.hostname.replace(/^www\./,"")}catch{return s}}const j=({sourceUrl:s})=>{const e=g(s),t=typeof s=="string"&&s.startsWith("/paper/")?s:null,r=b(s);return a.jsxs(c,{openDelay:120,closeDelay:120,children:[a.jsx(d,{asChild:!0,children:a.jsx("button",{type:"button",className:"bm-external-source-tag","aria-label":`Externally sourced evaluation: ${r}`,children:"External"})}),a.jsxs(p,{side:"top",align:"start",className:"w-auto max-w-[280px] p-3 text-sm leading-snug",children:["This score was sourced outside this paper.",t?a.jsxs(a.Fragment,{children:[" ",a.jsx(u,{to:t,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:r}),"."]}):e?a.jsxs(a.Fragment,{children:[" ",a.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:r}),"."]}):a.jsxs(a.Fragment,{children:[" ",r,"."]})]})]})};export{S as C,j as E,w as e};
assets/FeedView-BchwnT7D.js DELETED
@@ -1 +0,0 @@
1
- import{b as q,r as c,i as k,j as e,c as $,L as C,d as B}from"./index-DVQGVzHu.js";import{P as K}from"./components-_zRgatMC.js";import{u as U,P as z}from"./useIntersectionObserver-IRMyVQkj.js";import{r as G,P as W,w as Q}from"./PaperDateFilter-BH56Is-x.js";import{D as V,u as X,P as Y,M as J,S as Z,a as ee,R as se,W as ae,A as te,b as re,q as ie,c as ne}from"./chatLaunch-Ufg754YN.js";import{c as oe}from"./chat-CSWYblIR.js";import{c as M}from"./catalog-Da4k4qEI.js";import{S as _}from"./chatPrompts-CDY3UGU1.js";import{t as le,d as H}from"./transform-PseCN9bN.js";import{u as ce}from"./usePapers-a_mp-Uw3.js";import{S as y}from"./skeleton-DJUh-5VW.js";import{A as de,a as me}from"./alert-7mO5HIuQ.js";import{u as D}from"./useQuery-tFDel9EL.js";import"./LatexTitle-B0TwWoUu.js";import"./katex.min-BSBacQyE.js";import"./papers-DlaCqfyl.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-Beg3zsfL.js";import"./chevron-down-BAd8ubvW.js";import"./useInfiniteQuery-CYdxlDgS.js";const he=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],R=45,pe=1800,ue=25,ge=350,xe=i=>{const[g,l]=c.useState(_[0].slice(0,1));return c.useEffect(()=>{var v,f;if(!i)return;if((f=(v=window.matchMedia)==null?void 0:v.call(window,"(prefers-reduced-motion: reduce)"))!=null&&f.matches){l(_[0]);return}let m=0,n=1,x=!1,h;l(_[0].slice(0,n));const d=()=>{const p=_[m];if(!x){if(n+=1,l(p.slice(0,n)),n===p.length){x=!0,h=window.setTimeout(d,pe);return}h=window.setTimeout(d,R);return}if(n-=1,l(p.slice(0,n)),n===0){x=!1,m=(m+1)%_.length,h=window.setTimeout(d,ge);return}h=window.setTimeout(d,ue)};return h=window.setTimeout(d,R),()=>window.clearTimeout(h)},[i]),g},fe=i=>i==="trending"||i==="date_published"||i==="citation_count"?i:"trending",be=()=>{var s,r;const i=q(),g=B()?Z:ee,[l,m]=c.useState({text:"",paperMentions:[]}),n=l.text,[x,h]=c.useState(0),[d,v]=c.useState(V),[f,p]=c.useState(!1),[o,A]=c.useState("low"),[b,E]=c.useState(!1),L=xe(!n),w=c.useRef(null),P=D({queryKey:["chatAvailability"],queryFn:()=>oe.getAvailability(),retry:!1,enabled:k()}),S=!!((s=P.data)!=null&&s.web_search_available),j=k()&&((r=P.data)==null?void 0:r.paper_mentions_enabled)!==!1,t=X({draft:l,onChange:m,enabled:j,textareaRef:w});c.useLayoutEffect(()=>{const a=w.current;if(!a)return;const u=()=>{if(a.style.height="auto",n){a.style.height=`${Math.min(a.scrollHeight,160)}px`;return}const N=a.placeholder,F=_.reduce((I,O)=>(a.placeholder=O,Math.max(I,a.scrollHeight)),0);a.placeholder=N,a.style.height=`${Math.min(F,160)}px`};return u(),window.addEventListener("resize",u),()=>window.removeEventListener("resize",u)},[n]);const T=async(a=l)=>{if(!(!a.text.trim()||b)){E(!0),ie(a,d,{webSearchEnabled:S&&f,reasoningEffort:o});try{const N=await ne(d,o);i(`/chat/${N.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(Y,{text:l.text,mentions:l.paperMentions,scrollTop:x,variant:"home"}),e.jsx("textarea",{ref:w,rows:1,value:n,placeholder:L,"aria-label":"Ask the assistant",disabled:b,onChange:a=>t.updateText(a.target.value,a.target.selectionStart),onSelect:a=>t.refresh(a.currentTarget.selectionStart),onClick:a=>t.refresh(a.currentTarget.selectionStart),onScroll:a=>h(a.currentTarget.scrollTop),onBlur:a=>{var u,N;(N=(u=a.relatedTarget)==null?void 0:u.closest)!=null&&N.call(u,".chat-paper-picker")||window.setTimeout(t.close,0)},onKeyDown:a=>{t.keyDown(a)||a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),T())},role:j?"combobox":void 0,"aria-expanded":j?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":j?"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(J,{models:g,selectedModel:d,onModelChange:v}),e.jsx(se,{value:o,onChange:A,disabled:b}),S&&e.jsx(ae,{enabled:f,onChange:p,disabled:b})]}),e.jsx("button",{type:"button",className:`chat-send${n.trim()?" chat-send-on":""}`,onClick:()=>void T(),disabled:!n.trim()||b,"aria-label":"Ask the assistant",children:e.jsx(te,{})})]}),e.jsx(re,{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})]})]})},Oe=()=>{var P,S,j,t,T;const[i,g]=$(),l=fe(i.get("order_by")),m=G(i),n=i.get("has_code")==="true",x=i.get("has_hf_artifacts")==="true",h=s=>{const r=new URLSearchParams(i);r.set("order_by",s),g(r)},d=s=>{const r=new URLSearchParams(i);s?r.set("has_code","true"):r.delete("has_code"),g(r)},v=s=>{const r=new URLSearchParams(i);s?r.set("has_hf_artifacts","true"):r.delete("has_hf_artifacts"),g(r)},f=D({queryKey:["top-tasks-sidebar"],queryFn:()=>M.topTasks(8),staleTime:10*60*1e3}),p=D({queryKey:["trending-tasks-sidebar"],queryFn:()=>M.trendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),o=ce({page_size:30,order_by:l,order_dir:"desc",start_date:m.startDate,end_date:m.endDate,include_resources:!0,has_code:n,has_hf_artifacts:x}),A=c.useMemo(()=>{var r;return(((r=o.data)==null?void 0:r.pages.flatMap(a=>a.results))||[]).map(le)},[o.data]),{targetRef:b,isIntersecting:E}=U({rootMargin:"400px"});c.useEffect(()=>{E&&o.hasNextPage&&!o.isFetchingNextPage&&o.fetchNextPage()},[E,o.hasNextPage,o.isFetchingNextPage]);const L=o.isLoading,w=o.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 sidebar-section-top-domains",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),f.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,r)=>e.jsx(y,{className:"h-5 w-full"},r))}),(P=f.data)==null?void 0:P.map(s=>e.jsxs(C,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[H(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(C,{to:"/tasks",className:"sidebar-link",style:{marginTop:8,fontStyle:"italic"},children:"all domains →"})]}),e.jsxs("div",{className:"sidebar-section sidebar-section-trending-domains",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),p.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,r)=>e.jsx(y,{className:"h-5 w-full"},r))}),((j=(S=p.data)==null?void 0:S.results)==null?void 0:j.length)===0&&!p.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(T=(t=p.data)==null?void 0:t.results)==null?void 0:T.map(s=>e.jsxs(C,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[H(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]})]}),e.jsxs("div",{className:"feed-main",children:[k()&&e.jsx("div",{className:"feed-chat",children:e.jsx(be,{})}),e.jsxs("div",{className:"feed-content",children:[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:he.map(([s,r])=>e.jsx("button",{className:`sort-btn ${l===s?"active":""}`,onClick:()=>h(s),children:r},s))}),e.jsx(z,{hasCode:n,hasHfArtifacts:x,onHasCodeChange:d,onHasHfArtifactsChange:v})]}),e.jsx(W,{startDate:m.startDate,endDate:m.endDate,onChange:s=>g(Q(i,s))})]}),w&&e.jsx(de,{variant:"destructive",className:"mb-4",children:e.jsx(me,{children:"Failed to load papers. Please try again."})}),L?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,r)=>e.jsxs("div",{className:"paper-card",children:[e.jsx("div",{className:"paper-thumb-wrap",children:e.jsx(y,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(y,{className:"h-6 w-3/4"}),e.jsx(y,{className:"h-4 w-1/2"}),e.jsx(y,{className:"h-12 w-full"})]})]},r))}):A.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:A.map((s,r)=>e.jsx(K,{paper:s,rank:r+1},s.id))}),e.jsx("div",{ref:b,style:{height:1}}),o.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})]})};export{be as AskAssistant,Oe as default};
 
 
assets/FeedView-CiJI0out.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{b as q,r as c,i as k,j as e,c as $,L as C,d as B}from"./index-CxdnHo9-.js";import{P as K}from"./components-BH6Cy8IX.js";import{u as U,P as z}from"./useIntersectionObserver-2PEjywgc.js";import{r as G,P as W,w as Q}from"./PaperDateFilter-C9tnni-Y.js";import{D as V,u as X,P as Y,M as J,S as Z,a as ee,R as se,W as ae,A as te,b as re,q as ie,c as ne}from"./chatLaunch-5Omrgp_C.js";import{c as oe}from"./chat-Cj9116s7.js";import{c as M}from"./catalog-BRjI2ow6.js";import{S as _}from"./chatPrompts-CDY3UGU1.js";import{t as le,d as H}from"./transform-CArGBSok.js";import{u as ce}from"./usePapers-CD7ebaIw.js";import{S as y}from"./skeleton-B_RgoAAL.js";import{A as de,a as me}from"./alert-BQ0_qoe3.js";import{u as D}from"./useQuery-D8Q6gREv.js";import"./paperQueryKeys-CcqbH5YG.js";import"./LatexTitle-ih-jCKpS.js";import"./katex.min-BSBacQyE.js";import"./papers-BwPS4QGO.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-DEMAeJxN.js";import"./chevron-down-BbZGSdxv.js";import"./useInfiniteQuery-BUi2pe7X.js";const he=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],R=45,pe=1800,ue=25,ge=350,xe=i=>{const[g,l]=c.useState(_[0].slice(0,1));return c.useEffect(()=>{var v,f;if(!i)return;if((f=(v=window.matchMedia)==null?void 0:v.call(window,"(prefers-reduced-motion: reduce)"))!=null&&f.matches){l(_[0]);return}let m=0,n=1,x=!1,h;l(_[0].slice(0,n));const d=()=>{const p=_[m];if(!x){if(n+=1,l(p.slice(0,n)),n===p.length){x=!0,h=window.setTimeout(d,pe);return}h=window.setTimeout(d,R);return}if(n-=1,l(p.slice(0,n)),n===0){x=!1,m=(m+1)%_.length,h=window.setTimeout(d,ge);return}h=window.setTimeout(d,ue)};return h=window.setTimeout(d,R),()=>window.clearTimeout(h)},[i]),g},fe=i=>i==="trending"||i==="date_published"||i==="citation_count"?i:"trending",be=()=>{var s,r;const i=q(),g=B()?Z:ee,[l,m]=c.useState({text:"",paperMentions:[]}),n=l.text,[x,h]=c.useState(0),[d,v]=c.useState(V),[f,p]=c.useState(!1),[o,A]=c.useState("low"),[b,E]=c.useState(!1),L=xe(!n),w=c.useRef(null),P=D({queryKey:["chatAvailability"],queryFn:()=>oe.getAvailability(),retry:!1,enabled:k()}),S=!!((s=P.data)!=null&&s.web_search_available),j=k()&&((r=P.data)==null?void 0:r.paper_mentions_enabled)!==!1,t=X({draft:l,onChange:m,enabled:j,textareaRef:w});c.useLayoutEffect(()=>{const a=w.current;if(!a)return;const u=()=>{if(a.style.height="auto",n){a.style.height=`${Math.min(a.scrollHeight,160)}px`;return}const N=a.placeholder,F=_.reduce((I,O)=>(a.placeholder=O,Math.max(I,a.scrollHeight)),0);a.placeholder=N,a.style.height=`${Math.min(F,160)}px`};return u(),window.addEventListener("resize",u),()=>window.removeEventListener("resize",u)},[n]);const T=async(a=l)=>{if(!(!a.text.trim()||b)){E(!0),ie(a,d,{webSearchEnabled:S&&f,reasoningEffort:o});try{const N=await ne(d,o);i(`/chat/${N.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(Y,{text:l.text,mentions:l.paperMentions,scrollTop:x,variant:"home"}),e.jsx("textarea",{ref:w,rows:1,value:n,placeholder:L,"aria-label":"Ask the assistant",disabled:b,onChange:a=>t.updateText(a.target.value,a.target.selectionStart),onSelect:a=>t.refresh(a.currentTarget.selectionStart),onClick:a=>t.refresh(a.currentTarget.selectionStart),onScroll:a=>h(a.currentTarget.scrollTop),onBlur:a=>{var u,N;(N=(u=a.relatedTarget)==null?void 0:u.closest)!=null&&N.call(u,".chat-paper-picker")||window.setTimeout(t.close,0)},onKeyDown:a=>{t.keyDown(a)||a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),T())},role:j?"combobox":void 0,"aria-expanded":j?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":j?"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(J,{models:g,selectedModel:d,onModelChange:v}),e.jsx(se,{value:o,onChange:A,disabled:b}),S&&e.jsx(ae,{enabled:f,onChange:p,disabled:b})]}),e.jsx("button",{type:"button",className:`chat-send${n.trim()?" chat-send-on":""}`,onClick:()=>void T(),disabled:!n.trim()||b,"aria-label":"Ask the assistant",children:e.jsx(te,{})})]}),e.jsx(re,{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})]})]})},qe=()=>{var P,S,j,t,T;const[i,g]=$(),l=fe(i.get("order_by")),m=G(i),n=i.get("has_code")==="true",x=i.get("has_hf_artifacts")==="true",h=s=>{const r=new URLSearchParams(i);r.set("order_by",s),g(r)},d=s=>{const r=new URLSearchParams(i);s?r.set("has_code","true"):r.delete("has_code"),g(r)},v=s=>{const r=new URLSearchParams(i);s?r.set("has_hf_artifacts","true"):r.delete("has_hf_artifacts"),g(r)},f=D({queryKey:["top-tasks-sidebar"],queryFn:()=>M.topTasks(8),staleTime:10*60*1e3}),p=D({queryKey:["trending-tasks-sidebar"],queryFn:()=>M.trendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),o=ce({page_size:30,order_by:l,order_dir:"desc",start_date:m.startDate,end_date:m.endDate,include_resources:!0,has_code:n,has_hf_artifacts:x}),A=c.useMemo(()=>{var r;return(((r=o.data)==null?void 0:r.pages.flatMap(a=>a.results))||[]).map(le)},[o.data]),{targetRef:b,isIntersecting:E}=U({rootMargin:"400px"});c.useEffect(()=>{E&&o.hasNextPage&&!o.isFetchingNextPage&&o.fetchNextPage()},[E,o.hasNextPage,o.isFetchingNextPage]);const L=o.isLoading,w=o.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 sidebar-section-top-domains",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),f.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,r)=>e.jsx(y,{className:"h-5 w-full"},r))}),(P=f.data)==null?void 0:P.map(s=>e.jsxs(C,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[H(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(C,{to:"/tasks",className:"sidebar-link",style:{marginTop:8,fontStyle:"italic"},children:"all domains →"})]}),e.jsxs("div",{className:"sidebar-section sidebar-section-trending-domains",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),p.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,r)=>e.jsx(y,{className:"h-5 w-full"},r))}),((j=(S=p.data)==null?void 0:S.results)==null?void 0:j.length)===0&&!p.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(T=(t=p.data)==null?void 0:t.results)==null?void 0:T.map(s=>e.jsxs(C,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[H(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]})]}),e.jsxs("div",{className:"feed-main",children:[k()&&e.jsx("div",{className:"feed-chat",children:e.jsx(be,{})}),e.jsxs("div",{className:"feed-content",children:[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:he.map(([s,r])=>e.jsx("button",{className:`sort-btn ${l===s?"active":""}`,onClick:()=>h(s),children:r},s))}),e.jsx(z,{hasCode:n,hasHfArtifacts:x,onHasCodeChange:d,onHasHfArtifactsChange:v})]}),e.jsx(W,{startDate:m.startDate,endDate:m.endDate,onChange:s=>g(Q(i,s))})]}),w&&e.jsx(de,{variant:"destructive",className:"mb-4",children:e.jsx(me,{children:"Failed to load papers. Please try again."})}),L?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,r)=>e.jsxs("div",{className:"paper-card",children:[e.jsx("div",{className:"paper-thumb-wrap",children:e.jsx(y,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(y,{className:"h-6 w-3/4"}),e.jsx(y,{className:"h-4 w-1/2"}),e.jsx(y,{className:"h-12 w-full"})]})]},r))}):A.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:A.map((s,r)=>e.jsx(K,{paper:s,rank:r+1},s.id))}),e.jsx("div",{ref:b,style:{height:1}}),o.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})]})};export{be as AskAssistant,qe as default};
assets/FrameworksIndexView-B246w2_2.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{b as d,j as e,L as o,z as m}from"./index-CxdnHo9-.js";import{u as p}from"./useQuery-D8Q6gREv.js";import{I as h}from"./components-BH6Cy8IX.js";import{c as u}from"./catalog-BRjI2ow6.js";import{c as g,h as f}from"./transform-CArGBSok.js";import"./paperQueryKeys-CcqbH5YG.js";import"./LatexTitle-ih-jCKpS.js";import"./katex.min-BSBacQyE.js";import"./papers-BwPS4QGO.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"})]})]})},T=()=>{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,T as default};
assets/FrameworksIndexView-n11RduOV.js DELETED
@@ -1 +0,0 @@
1
- import{b as d,j as e,L as o,z as m}from"./index-DVQGVzHu.js";import{u as p}from"./useQuery-tFDel9EL.js";import{I as h}from"./components-_zRgatMC.js";import{c as u}from"./catalog-Da4k4qEI.js";import{c as g,h as f}from"./transform-PseCN9bN.js";import"./LatexTitle-B0TwWoUu.js";import"./katex.min-BSBacQyE.js";import"./papers-DlaCqfyl.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"})]})]})},E=()=>{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,E as default};
 
 
assets/{LatexTitle-B0TwWoUu.js → LatexTitle-ih-jCKpS.js} RENAMED
@@ -1 +1 @@
1
- import{j as u,r as E}from"./index-DVQGVzHu.js";import{k as j}from"./katex.min-BSBacQyE.js";const C=new Set([",",";",":","!"," ","quad","qquad","enspace","thinspace"]),M={a:"á",e:"é",i:"í",o:"ó",u:"ú",y:"ý",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú",Y:"Ý"},_={a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"},b={a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"},w={a:"ä",e:"ë",i:"ï",o:"ö",u:"ü",y:"ÿ",A:"Ä",E:"Ë",I:"Ï",O:"Ö",U:"Ü",Y:"Ÿ"},O={"'":M,"`":_,"^":b,'"':w,"~":{n:"ñ",N:"Ñ"}},$={ss:"ß",ae:"æ",AE:"Æ",oe:"œ",OE:"Œ",o:"ø",O:"Ø",l:"ł",L:"Ł"};function S(n,s){var e;return((e=O[n])==null?void 0:e[s])??null}function N(n){const s=[];let e=0,r="";const t=()=>{r&&(s.push({type:"text",content:r}),r="")};for(;e<n.length;){if(n[e]==="$"&&n[e+1]==="$"){t();const o=n.indexOf("$$",e+2);if(o===-1){r+=n.slice(e);break}s.push({type:"display",content:n.slice(e+2,o)}),e=o+2;continue}if(n[e]==="$"){t();const o=n.indexOf("$",e+1);if(o===-1){r+=n.slice(e);break}s.push({type:"inline",content:n.slice(e+1,o)}),e=o+1;continue}r+=n[e],e+=1}return t(),s}function d(n,s){if(n[s]!=="{")return null;let e=0;for(let r=s;r<n.length;r+=1)if(n[r]==="{")e+=1;else if(n[r]==="}"&&(e-=1,e===0))return{content:n.slice(s+1,r),end:r+1};return null}function y(n,s){let e=s+1;if(e>=n.length)return{name:"",end:e};if(!/[a-zA-Z]/.test(n[e]))return{name:n[e],end:e+1};const r=e;for(;e<n.length&&/[a-zA-Z]/.test(n[e]);)e+=1;return{name:n.slice(r,e),end:e}}function k(n,s){const e=n[s];if(e!=="^"&&e!=="_"||s+1>=n.length)return null;if(n[s+1]==="{"){const r=d(n,s+1);return r?{end:r.end}:null}return/[A-Za-z0-9+\-=.]/.test(n[s+1])?{end:s+2}:null}function L(n,s){let e=s;if(n[e]==="\\"){const{name:o,end:i}=y(n,e);if(!o)return null;if(e=i,n[e]==="{"){const a=d(n,e);a&&(e=a.end)}}else if(/[A-Za-z0-9]/.test(n[e])){let o=e+1;for(;o<n.length&&/[A-Za-z0-9]/.test(n[o]);)o+=1;if(n[o]!=="^"&&n[o]!=="_")return null;e=o}else return null;const r=s;let t=0;for(;e<n.length;){const o=k(n,e);if(!o)break;t+=1,e=o.end}return t===0?null:{latex:n.slice(r,e),end:e}}function U(n){return Array.from(new Set((n||"").trim().split(/\s+/).filter(Boolean))).sort((s,e)=>e.length-s.length)}function z(n,s,e){const r=U(s);if(!r.length)return[n];const t=r.map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),o=new RegExp(`(${t.join("|")})`,"gi");return n.split(o).filter(Boolean).map((i,a)=>r.some(p=>p.toLocaleLowerCase()===i.toLocaleLowerCase())?u.jsx("mark",{children:i},`${e}-mark-${a}`):i)}function m(n,s,e){const r=[];let t=0,o=0;const i=()=>`${s}-${o++}`,a=(p,f)=>p==="strong"?u.jsx("strong",{children:f},i()):u.jsx("em",{children:f},i());for(;t<n.length;){if(n[t]==="\\"){const{name:l,end:T}=y(n,t);if(t=T,$[l]){r.push($[l]);continue}if(l.length===1&&t<n.length&&/[A-Za-z]/.test(n[t])){const c=S(l,n[t]);if(c){r.push(c),t+=1;continue}}if(l==="c"){const c=d(n,t);if((c==null?void 0:c.content.length)===1){const h={c:"ç",C:"Ç"}[c.content];if(h){r.push(h),t=c.end;continue}}}if(l==="textbf"||l==="mathbf"){const c=d(n,t);if(c){t=c.end,r.push(a("strong",m(c.content,i(),e)));continue}}if(l==="emph"||l==="textit"||l==="textsl"||l==="texttt"){const c=d(n,t);if(c){t=c.end,r.push(a("em",m(c.content,i(),e)));continue}}if(l==="color"||l==="textcolor"){const c=d(n,t);if(c){t=c.end;const h=d(n,t);h&&(t=h.end,r.push(...m(h.content,i(),e)));continue}}if(C.has(l)){r.push(" ");continue}if(l==="~"){r.push(" ");continue}const A=d(n,t);if(A){t=A.end,r.push(...m(A.content,i(),e));continue}r.push(`\\${l}`);continue}if(n[t]==="~"){r.push(" "),t+=1;continue}const p=L(n,t);if(p){r.push(u.jsx(g,{latex:p.latex,display:!1},i())),t=p.end;continue}let f=t;for(;f<n.length&&n[f]!=="\\"&&n[f]!=="~"&&!L(n,f);)f+=1;f>t&&r.push(...z(n.slice(t,f),e,i())),t=f}return r}function g({latex:n,display:s}){const e=E.useMemo(()=>{try{return j.renderToString(n.trim(),{displayMode:s,throwOnError:!1})}catch{return null}},[n,s]);return e?u.jsx("span",{className:s?"katex-display":void 0,dangerouslySetInnerHTML:{__html:e}}):u.jsx(u.Fragment,{children:s?`$$${n}$$`:`$${n}$`})}function I(n,s){const e=N(n),r=[];return e.forEach((t,o)=>{const i=`latex-${o}`;if(t.type==="text"){const a=m(t.content,i,s);a.length===1?r.push(a[0]):a.length>1&&r.push(u.jsx(E.Fragment,{children:a},i));return}if(t.type==="display"){r.push(u.jsx(g,{latex:t.content,display:!0},i));return}r.push(u.jsx(g,{latex:t.content,display:!1},i))}),r.length===1?r[0]:u.jsx(u.Fragment,{children:r})}const X=({text:n,className:s="",highlight:e})=>{const r=E.useMemo(()=>I(n,e),[n,e]);return u.jsx("span",{className:s,children:r})},D=({title:n,className:s="",highlight:e})=>u.jsx(X,{text:n,className:s,highlight:e});export{D as L,X as a};
 
1
+ import{j as u,r as E}from"./index-CxdnHo9-.js";import{k as j}from"./katex.min-BSBacQyE.js";const C=new Set([",",";",":","!"," ","quad","qquad","enspace","thinspace"]),M={a:"á",e:"é",i:"í",o:"ó",u:"ú",y:"ý",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú",Y:"Ý"},_={a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"},b={a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"},w={a:"ä",e:"ë",i:"ï",o:"ö",u:"ü",y:"ÿ",A:"Ä",E:"Ë",I:"Ï",O:"Ö",U:"Ü",Y:"Ÿ"},O={"'":M,"`":_,"^":b,'"':w,"~":{n:"ñ",N:"Ñ"}},$={ss:"ß",ae:"æ",AE:"Æ",oe:"œ",OE:"Œ",o:"ø",O:"Ø",l:"ł",L:"Ł"};function S(n,s){var e;return((e=O[n])==null?void 0:e[s])??null}function N(n){const s=[];let e=0,r="";const t=()=>{r&&(s.push({type:"text",content:r}),r="")};for(;e<n.length;){if(n[e]==="$"&&n[e+1]==="$"){t();const o=n.indexOf("$$",e+2);if(o===-1){r+=n.slice(e);break}s.push({type:"display",content:n.slice(e+2,o)}),e=o+2;continue}if(n[e]==="$"){t();const o=n.indexOf("$",e+1);if(o===-1){r+=n.slice(e);break}s.push({type:"inline",content:n.slice(e+1,o)}),e=o+1;continue}r+=n[e],e+=1}return t(),s}function d(n,s){if(n[s]!=="{")return null;let e=0;for(let r=s;r<n.length;r+=1)if(n[r]==="{")e+=1;else if(n[r]==="}"&&(e-=1,e===0))return{content:n.slice(s+1,r),end:r+1};return null}function y(n,s){let e=s+1;if(e>=n.length)return{name:"",end:e};if(!/[a-zA-Z]/.test(n[e]))return{name:n[e],end:e+1};const r=e;for(;e<n.length&&/[a-zA-Z]/.test(n[e]);)e+=1;return{name:n.slice(r,e),end:e}}function k(n,s){const e=n[s];if(e!=="^"&&e!=="_"||s+1>=n.length)return null;if(n[s+1]==="{"){const r=d(n,s+1);return r?{end:r.end}:null}return/[A-Za-z0-9+\-=.]/.test(n[s+1])?{end:s+2}:null}function L(n,s){let e=s;if(n[e]==="\\"){const{name:o,end:i}=y(n,e);if(!o)return null;if(e=i,n[e]==="{"){const a=d(n,e);a&&(e=a.end)}}else if(/[A-Za-z0-9]/.test(n[e])){let o=e+1;for(;o<n.length&&/[A-Za-z0-9]/.test(n[o]);)o+=1;if(n[o]!=="^"&&n[o]!=="_")return null;e=o}else return null;const r=s;let t=0;for(;e<n.length;){const o=k(n,e);if(!o)break;t+=1,e=o.end}return t===0?null:{latex:n.slice(r,e),end:e}}function U(n){return Array.from(new Set((n||"").trim().split(/\s+/).filter(Boolean))).sort((s,e)=>e.length-s.length)}function z(n,s,e){const r=U(s);if(!r.length)return[n];const t=r.map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),o=new RegExp(`(${t.join("|")})`,"gi");return n.split(o).filter(Boolean).map((i,a)=>r.some(p=>p.toLocaleLowerCase()===i.toLocaleLowerCase())?u.jsx("mark",{children:i},`${e}-mark-${a}`):i)}function m(n,s,e){const r=[];let t=0,o=0;const i=()=>`${s}-${o++}`,a=(p,f)=>p==="strong"?u.jsx("strong",{children:f},i()):u.jsx("em",{children:f},i());for(;t<n.length;){if(n[t]==="\\"){const{name:l,end:T}=y(n,t);if(t=T,$[l]){r.push($[l]);continue}if(l.length===1&&t<n.length&&/[A-Za-z]/.test(n[t])){const c=S(l,n[t]);if(c){r.push(c),t+=1;continue}}if(l==="c"){const c=d(n,t);if((c==null?void 0:c.content.length)===1){const h={c:"ç",C:"Ç"}[c.content];if(h){r.push(h),t=c.end;continue}}}if(l==="textbf"||l==="mathbf"){const c=d(n,t);if(c){t=c.end,r.push(a("strong",m(c.content,i(),e)));continue}}if(l==="emph"||l==="textit"||l==="textsl"||l==="texttt"){const c=d(n,t);if(c){t=c.end,r.push(a("em",m(c.content,i(),e)));continue}}if(l==="color"||l==="textcolor"){const c=d(n,t);if(c){t=c.end;const h=d(n,t);h&&(t=h.end,r.push(...m(h.content,i(),e)));continue}}if(C.has(l)){r.push(" ");continue}if(l==="~"){r.push(" ");continue}const A=d(n,t);if(A){t=A.end,r.push(...m(A.content,i(),e));continue}r.push(`\\${l}`);continue}if(n[t]==="~"){r.push(" "),t+=1;continue}const p=L(n,t);if(p){r.push(u.jsx(g,{latex:p.latex,display:!1},i())),t=p.end;continue}let f=t;for(;f<n.length&&n[f]!=="\\"&&n[f]!=="~"&&!L(n,f);)f+=1;f>t&&r.push(...z(n.slice(t,f),e,i())),t=f}return r}function g({latex:n,display:s}){const e=E.useMemo(()=>{try{return j.renderToString(n.trim(),{displayMode:s,throwOnError:!1})}catch{return null}},[n,s]);return e?u.jsx("span",{className:s?"katex-display":void 0,dangerouslySetInnerHTML:{__html:e}}):u.jsx(u.Fragment,{children:s?`$$${n}$$`:`$${n}$`})}function I(n,s){const e=N(n),r=[];return e.forEach((t,o)=>{const i=`latex-${o}`;if(t.type==="text"){const a=m(t.content,i,s);a.length===1?r.push(a[0]):a.length>1&&r.push(u.jsx(E.Fragment,{children:a},i));return}if(t.type==="display"){r.push(u.jsx(g,{latex:t.content,display:!0},i));return}r.push(u.jsx(g,{latex:t.content,display:!1},i))}),r.length===1?r[0]:u.jsx(u.Fragment,{children:r})}const X=({text:n,className:s="",highlight:e})=>{const r=E.useMemo(()=>I(n,e),[n,e]);return u.jsx("span",{className:s,children:r})},D=({title:n,className:s="",highlight:e})=>u.jsx(X,{text:n,className:s,highlight:e});export{D as L,X as a};
assets/{MarkdownText-D9cBh-rH.js → MarkdownText-kHUUjGAC.js} RENAMED
@@ -1 +1 @@
1
- import{n as l,j as s,L as u}from"./index-DVQGVzHu.js";import"./katex.min-BSBacQyE.js";import{r as p,a as m,P as h}from"./PaperPreviewLink-CpVn6ETd.js";import{M as d}from"./index-VSogvUtt.js";import{r as w}from"./index-B-ULOvtV.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 e=new URL(n,o);if(!x.has(e.hostname))return null;t=`${e.pathname}${e.search}${e.hash}`}catch{return null}const r=t.split(/[?#]/,1)[0];return P.some(e=>r===e||r.startsWith(`${e}/`))?t:null}function k(n){const t=n.split(/[?#]/,1)[0].match(/^\/papers?\/([^/]+)$/);if(!t||t[1].includes("%"))return null;const r=t[1],e=/^\d{4}[.-]\d{4,5}(?:v\d+)?$/.test(r),a=/^[1-9]\d*$/.test(r);return!e&&!a?null:l(r)}const L=({text:n,className:o=""})=>s.jsx("div",{className:o,children:s.jsx(d,{remarkPlugins:[w,m],rehypePlugins:[p],components:{a:({href:t,children:r,node:e,...a})=>{const i=f(t);if(i){const c=k(i);return c?s.jsx(h,{routeId:c,to:i,...a,children:r}):s.jsx(u,{to:i,...a,children:r})}return s.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",...a,children:r})}},children:n})});export{L as M,f as r};
 
1
+ import{n as l,j as s,L as u}from"./index-CxdnHo9-.js";import"./katex.min-BSBacQyE.js";import{r as p,a as m,P as h}from"./PaperPreviewLink-CUTHdATo.js";import{M as d}from"./index-DFKsmHrq.js";import{r as w}from"./index-B42pNGT3.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 e=new URL(n,o);if(!x.has(e.hostname))return null;t=`${e.pathname}${e.search}${e.hash}`}catch{return null}const r=t.split(/[?#]/,1)[0];return P.some(e=>r===e||r.startsWith(`${e}/`))?t:null}function k(n){const t=n.split(/[?#]/,1)[0].match(/^\/papers?\/([^/]+)$/);if(!t||t[1].includes("%"))return null;const r=t[1],e=/^\d{4}[.-]\d{4,5}(?:v\d+)?$/.test(r),a=/^[1-9]\d*$/.test(r);return!e&&!a?null:l(r)}const L=({text:n,className:o=""})=>s.jsx("div",{className:o,children:s.jsx(d,{remarkPlugins:[w,m],rehypePlugins:[p],components:{a:({href:t,children:r,node:e,...a})=>{const i=f(t);if(i){const c=k(i);return c?s.jsx(h,{routeId:c,to:i,...a,children:r}):s.jsx(u,{to:i,...a,children:r})}return s.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",...a,children:r})}},children:n})});export{L as M,f as r};
assets/{McpView-DVdfRWWT.js → McpView-C3ocx0rR.js} RENAMED
@@ -1 +1 @@
1
- import{z as m,j as e,C as b}from"./index-DVQGVzHu.js";import{u as x}from"./useQuery-tFDel9EL.js";import{f as j,D as f}from"./latexPlainText-DI8YEXVe.js";import{E as i}from"./external-link-NJ-WhNGs.js";import{C as y}from"./copy-D4HOG4XE.js";const h="https://paperswithcode.co/mcp",g="https://staging.paperswithcode.co/mcp";function u(s){const a=typeof window>"u"?void 0:window.location;return a?a.hostname==="staging.paperswithcode.co"?g:a.hostname==="paperswithcode.co"||a.hostname==="www.paperswithcode.co"?h:`${a.origin.replace(/\/$/,"")}/mcp`:h}function v(s){if(!s||typeof s!="object"||s.status!=="ok"||s.service!=="pwc-mcp"||typeof s.version!="string"||typeof s.protocol!="string")throw new Error("MCP health response is invalid");return s}async function w(s){const a=new AbortController,c=()=>a.abort();s==null||s.addEventListener("abort",c,{once:!0});const o=window.setTimeout(c,5e3);try{const t=await fetch(`${u()}/health`,{headers:{Accept:"application/json"},signal:a.signal,credentials:"omit"});if(!t.ok)throw new Error("MCP service is unavailable");return v(await t.json())}finally{window.clearTimeout(o),s==null||s.removeEventListener("abort",c)}}const k=()=>({queryKey:["mcp","health"],queryFn:({signal:s})=>w(s),retry:!1,staleTime:3e4,refetchInterval:6e4,refetchOnWindowFocus:!1}),C=[["search_papers","Search by topic, title, author, or arXiv ID."],["list_papers","Filter and order papers by taxonomy, venue, date, or organization."],["get_paper_info","Read canonical metadata, authors, abstract, links, and resources."],["read_paper","Read stored paper Markdown with safe continuation for long papers."],["list_recent_papers","Browse the most recently indexed research."],["get_related_papers","Find related work already indexed in the catalogue."],["list_trending_papers","Discover papers with recent repository momentum."],["get_paper_evaluations","Inspect benchmark results reported by one paper."],["get_paper_lineage","Follow explicit predecessor and successor relationships."],["list_tasks","Search tasks and retrieve stable slugs for exact lookup."],["get_task","Inspect a research task and its benchmark coverage."],["list_methods","Search methods and retrieve stable slugs for exact lookup."],["get_method","Inspect a method, its source paper, and catalogue metadata."],["list_conferences","Browse conferences with imported papers."],["get_conference","Inspect one exact conference edition."],["list_organizations","Browse research organizations."],["get_organization","Inspect one exact research organization."],["list_frameworks","Browse frameworks by domain, category, or platform."],["get_framework","Inspect one exact research framework."],["list_benchmarks","Browse and filter benchmark leaderboards."],["get_benchmark","Read one benchmark, metrics, datasets, and leading results."]],N=["pwc://papers/{paper}","pwc://papers/{paper}/markdown","pwc://tasks/{task}","pwc://benchmarks/{benchmark}"],P=["Find recent papers on test-time compute and summarize the main approaches.","Compare the methods and reported benchmarks in these three arXiv papers.","What are the leading benchmarks for text-to-video generation?","Trace the predecessor and successor papers for Mamba."],d=[{key:"chatgpt",label:"ChatGPT",summary:"In workspace developer settings, add a custom MCP app and paste the server URL. Availability and admin approval vary by plan."},{key:"claude",label:"Claude",summary:"Open Settings → Connectors → Add custom connector, paste the URL, then enable Papers With Code from Search and tools."},{key:"claude-code",label:"Claude Code",summary:"Add the anonymous Streamable HTTP server from a terminal.",code:s=>`claude mcp add --transport http paperswithcode ${s}`},{key:"cursor",label:"Cursor",summary:"Add this entry to your project or user MCP configuration.",code:s=>JSON.stringify({mcpServers:{paperswithcode:{url:s}}},null,2)},{key:"vscode",label:"VS Code",summary:"Add this Streamable HTTP server to .vscode/mcp.json.",code:s=>JSON.stringify({servers:{paperswithcode:{type:"http",url:s}}},null,2)},{key:"generic",label:"Generic",summary:"Configure an anonymous, stateless Streamable HTTP server using the URL below. No API key or OAuth flow is required."}],l=({value:s,label:a})=>{const[c,o]=m.useState(!1),t=async()=>{var n;(n=navigator.clipboard)!=null&&n.writeText&&(await navigator.clipboard.writeText(s),o(!0),window.setTimeout(()=>o(!1),1500))};return e.jsxs("button",{className:"action-btn mcp-copy",type:"button",onClick:()=>void t(),"aria-label":a,children:[c?e.jsx(b,{size:16,"aria-hidden":!0}):e.jsx(y,{size:16,"aria-hidden":!0}),c?"Copied":"Copy"]})},R=()=>{var n;const s=u(),a=x(k()),[c,o]=m.useState("chatgpt"),t=d.find(r=>r.key===c)??d[0];return m.useEffect(()=>(document.title=j("MCP Server"),()=>{document.title=f}),[]),e.jsxs("article",{className:"page mcp-page",children:[e.jsxs("header",{className:"mcp-hero",children:[e.jsxs("div",{children:[e.jsx("p",{className:"sidebar-label mcp-kicker",children:"Model Context Protocol"}),e.jsx("h1",{className:"feed-title",children:"Use Papers With Code in your AI assistant"}),e.jsx("p",{className:"mcp-lede",children:"Search research, inspect methods and benchmarks, and read complete papers through one anonymous, read-only MCP connection."}),e.jsxs("div",{className:"mcp-status","aria-live":"polite",children:[e.jsx("span",{className:a.isSuccess?"is-up":"is-unknown","aria-hidden":!0}),a.isSuccess?"Operational":"Status unavailable",a.data?` · v${a.data.version}`:""]})]}),e.jsxs("div",{className:"mcp-endpoint-card",children:[e.jsx("span",{children:"Remote MCP URL"}),e.jsx("code",{children:s}),e.jsx(l,{value:s,label:"Copy MCP server URL"})]})]}),e.jsxs("section",{className:"mcp-section","aria-labelledby":"mcp-connect",children:[e.jsxs("div",{className:"mcp-section-heading",children:[e.jsx("p",{className:"sidebar-label",children:"Connect"}),e.jsx("h2",{id:"mcp-connect",children:"One URL, your preferred client"}),e.jsx("span",{children:"Setup matrix reviewed September 13, 2026; staging qualification pending."})]}),e.jsx("div",{className:"mcp-client-tabs",role:"tablist","aria-label":"MCP client setup",children:d.map(r=>e.jsx("button",{type:"button",role:"tab","aria-selected":c===r.key,onClick:()=>o(r.key),children:r.label},r.key))}),e.jsxs("div",{className:"mcp-setup",role:"tabpanel",children:[e.jsx("p",{children:t.summary}),t.code?e.jsxs("div",{className:"mcp-code-row",children:[e.jsx("pre",{children:e.jsx("code",{children:t.code(s)})}),e.jsx(l,{value:t.code(s),label:`Copy ${t.label} setup`})]}):e.jsxs("div",{className:"mcp-code-row",children:[e.jsx("pre",{children:e.jsx("code",{children:s})}),e.jsx(l,{value:s,label:`Copy ${t.label} endpoint`})]})]})]}),e.jsxs("section",{className:"mcp-section","aria-labelledby":"mcp-capabilities",children:[e.jsxs("div",{className:"mcp-section-heading",children:[e.jsx("p",{className:"sidebar-label",children:"Capabilities"}),e.jsx("h2",{id:"mcp-capabilities",children:"Research context, structured for assistants"})]}),e.jsx("div",{className:"mcp-capability-grid",children:[["Discover","Search recent and established work with catalogue filters."],["Read","Continue through long stored papers without presenting a partial document as complete."],["Connect","Explore related work, paper lineage, tasks, and methods."],["Compare","Inspect benchmarks, datasets, metrics, and reported evaluations."]].map(([r,p])=>e.jsxs("div",{children:[e.jsx("h3",{children:r}),e.jsx("p",{children:p})]},r))})]}),e.jsxs("section",{className:"mcp-section","aria-labelledby":"mcp-tools",children:[e.jsxs("div",{className:"mcp-section-heading",children:[e.jsx("p",{className:"sidebar-label",children:"Catalogue"}),e.jsx("h2",{id:"mcp-tools",children:"Twenty-one focused, read-only tools"})]}),e.jsx("div",{className:"mcp-tool-grid",children:C.map(([r,p])=>e.jsxs("div",{className:"mcp-tool",children:[e.jsx("code",{children:r}),e.jsx("p",{children:p})]},r))}),e.jsx("h3",{className:"mcp-subheading",children:"Resource templates"}),e.jsx("div",{className:"mcp-resource-list",children:N.map(r=>e.jsx("code",{children:r},r))})]}),e.jsxs("section",{className:"mcp-section","aria-labelledby":"mcp-prompts",children:[e.jsxs("div",{className:"mcp-section-heading",children:[e.jsx("p",{className:"sidebar-label",children:"Try asking"}),e.jsx("h2",{id:"mcp-prompts",children:"Prompts that start useful research"})]}),e.jsx("div",{className:"mcp-prompt-list",children:P.map(r=>e.jsxs("div",{children:[e.jsx("p",{children:r}),e.jsx(l,{value:r,label:"Copy example prompt"})]},r))})]}),e.jsxs("section",{className:"mcp-section mcp-notes","aria-labelledby":"mcp-limits",children:[e.jsxs("div",{children:[e.jsx("p",{className:"sidebar-label mcp-kicker",children:"Limits & privacy"}),e.jsx("h2",{id:"mcp-limits",children:"Public by design"}),e.jsx("p",{children:"No account, API key, or write access. Fair-use limits are 60 total requests per minute, 10 semantic searches per minute, four concurrent requests per client, and 25 list results per call."}),e.jsx("p",{children:"MCP telemetry retains tool name, status, latency, response size, protocol, and server version—not prompts, paper IDs, cursors, resource URIs, raw IPs, authorization values, or bodies. Catalogue infrastructure has its own operational logging policy."})]}),e.jsxs("div",{children:[e.jsx("p",{className:"sidebar-label mcp-kicker",children:"Protocol & troubleshooting"}),e.jsx("h2",{children:"Streamable HTTP"}),e.jsxs("p",{children:["Primary protocol: ",((n=a.data)==null?void 0:n.protocol)??"verified during connection setup",". If setup fails, confirm your client supports remote Streamable HTTP, that custom servers are enabled by your workspace administrator, and that you pasted the URL exactly."]}),e.jsxs("nav",{className:"mcp-links","aria-label":"MCP documentation links",children:[e.jsxs("a",{href:"https://github.com/huggingface/pwc-cli",target:"_blank",rel:"noreferrer",children:["CLI repository ",e.jsx(i,{size:13})]}),e.jsxs("a",{href:"https://modelcontextprotocol.io/docs/2026-07-28/learn/server-concepts",target:"_blank",rel:"noreferrer",children:["MCP specification ",e.jsx(i,{size:13})]}),e.jsxs("a",{href:"/docs",target:"_blank",rel:"noreferrer",children:["Public API ",e.jsx(i,{size:13})]}),e.jsxs("a",{href:"/mcp/schema",target:"_blank",rel:"noreferrer",children:["MCP tool schema ",e.jsx(i,{size:13})]}),e.jsxs("a",{href:"/llms.txt",target:"_blank",rel:"noreferrer",children:["llms.txt ",e.jsx(i,{size:13})]})]})]})]})]})};export{R as default};
 
1
+ import{z as m,j as e,C as b}from"./index-CxdnHo9-.js";import{u as x}from"./useQuery-D8Q6gREv.js";import{f as j,D as f}from"./latexPlainText-DI8YEXVe.js";import{E as i}from"./external-link-DZCSog7H.js";import{C as y}from"./copy-DN4hDnRX.js";const h="https://paperswithcode.co/mcp",g="https://staging.paperswithcode.co/mcp";function u(s){const a=typeof window>"u"?void 0:window.location;return a?a.hostname==="staging.paperswithcode.co"?g:a.hostname==="paperswithcode.co"||a.hostname==="www.paperswithcode.co"?h:`${a.origin.replace(/\/$/,"")}/mcp`:h}function v(s){if(!s||typeof s!="object"||s.status!=="ok"||s.service!=="pwc-mcp"||typeof s.version!="string"||typeof s.protocol!="string")throw new Error("MCP health response is invalid");return s}async function w(s){const a=new AbortController,c=()=>a.abort();s==null||s.addEventListener("abort",c,{once:!0});const o=window.setTimeout(c,5e3);try{const t=await fetch(`${u()}/health`,{headers:{Accept:"application/json"},signal:a.signal,credentials:"omit"});if(!t.ok)throw new Error("MCP service is unavailable");return v(await t.json())}finally{window.clearTimeout(o),s==null||s.removeEventListener("abort",c)}}const k=()=>({queryKey:["mcp","health"],queryFn:({signal:s})=>w(s),retry:!1,staleTime:3e4,refetchInterval:6e4,refetchOnWindowFocus:!1}),C=[["search_papers","Search by topic, title, author, or arXiv ID."],["list_papers","Filter and order papers by taxonomy, venue, date, or organization."],["get_paper_info","Read canonical metadata, authors, abstract, links, and resources."],["read_paper","Read stored paper Markdown with safe continuation for long papers."],["list_recent_papers","Browse the most recently indexed research."],["get_related_papers","Find related work already indexed in the catalogue."],["list_trending_papers","Discover papers with recent repository momentum."],["get_paper_evaluations","Inspect benchmark results reported by one paper."],["get_paper_lineage","Follow explicit predecessor and successor relationships."],["list_tasks","Search tasks and retrieve stable slugs for exact lookup."],["get_task","Inspect a research task and its benchmark coverage."],["list_methods","Search methods and retrieve stable slugs for exact lookup."],["get_method","Inspect a method, its source paper, and catalogue metadata."],["list_conferences","Browse conferences with imported papers."],["get_conference","Inspect one exact conference edition."],["list_organizations","Browse research organizations."],["get_organization","Inspect one exact research organization."],["list_frameworks","Browse frameworks by domain, category, or platform."],["get_framework","Inspect one exact research framework."],["list_benchmarks","Browse and filter benchmark leaderboards."],["get_benchmark","Read one benchmark, metrics, datasets, and leading results."]],N=["pwc://papers/{paper}","pwc://papers/{paper}/markdown","pwc://tasks/{task}","pwc://benchmarks/{benchmark}"],P=["Find recent papers on test-time compute and summarize the main approaches.","Compare the methods and reported benchmarks in these three arXiv papers.","What are the leading benchmarks for text-to-video generation?","Trace the predecessor and successor papers for Mamba."],d=[{key:"chatgpt",label:"ChatGPT",summary:"In workspace developer settings, add a custom MCP app and paste the server URL. Availability and admin approval vary by plan."},{key:"claude",label:"Claude",summary:"Open Settings → Connectors → Add custom connector, paste the URL, then enable Papers With Code from Search and tools."},{key:"claude-code",label:"Claude Code",summary:"Add the anonymous Streamable HTTP server from a terminal.",code:s=>`claude mcp add --transport http paperswithcode ${s}`},{key:"cursor",label:"Cursor",summary:"Add this entry to your project or user MCP configuration.",code:s=>JSON.stringify({mcpServers:{paperswithcode:{url:s}}},null,2)},{key:"vscode",label:"VS Code",summary:"Add this Streamable HTTP server to .vscode/mcp.json.",code:s=>JSON.stringify({servers:{paperswithcode:{type:"http",url:s}}},null,2)},{key:"generic",label:"Generic",summary:"Configure an anonymous, stateless Streamable HTTP server using the URL below. No API key or OAuth flow is required."}],l=({value:s,label:a})=>{const[c,o]=m.useState(!1),t=async()=>{var n;(n=navigator.clipboard)!=null&&n.writeText&&(await navigator.clipboard.writeText(s),o(!0),window.setTimeout(()=>o(!1),1500))};return e.jsxs("button",{className:"action-btn mcp-copy",type:"button",onClick:()=>void t(),"aria-label":a,children:[c?e.jsx(b,{size:16,"aria-hidden":!0}):e.jsx(y,{size:16,"aria-hidden":!0}),c?"Copied":"Copy"]})},R=()=>{var n;const s=u(),a=x(k()),[c,o]=m.useState("chatgpt"),t=d.find(r=>r.key===c)??d[0];return m.useEffect(()=>(document.title=j("MCP Server"),()=>{document.title=f}),[]),e.jsxs("article",{className:"page mcp-page",children:[e.jsxs("header",{className:"mcp-hero",children:[e.jsxs("div",{children:[e.jsx("p",{className:"sidebar-label mcp-kicker",children:"Model Context Protocol"}),e.jsx("h1",{className:"feed-title",children:"Use Papers With Code in your AI assistant"}),e.jsx("p",{className:"mcp-lede",children:"Search research, inspect methods and benchmarks, and read complete papers through one anonymous, read-only MCP connection."}),e.jsxs("div",{className:"mcp-status","aria-live":"polite",children:[e.jsx("span",{className:a.isSuccess?"is-up":"is-unknown","aria-hidden":!0}),a.isSuccess?"Operational":"Status unavailable",a.data?` · v${a.data.version}`:""]})]}),e.jsxs("div",{className:"mcp-endpoint-card",children:[e.jsx("span",{children:"Remote MCP URL"}),e.jsx("code",{children:s}),e.jsx(l,{value:s,label:"Copy MCP server URL"})]})]}),e.jsxs("section",{className:"mcp-section","aria-labelledby":"mcp-connect",children:[e.jsxs("div",{className:"mcp-section-heading",children:[e.jsx("p",{className:"sidebar-label",children:"Connect"}),e.jsx("h2",{id:"mcp-connect",children:"One URL, your preferred client"}),e.jsx("span",{children:"Setup matrix reviewed September 13, 2026; staging qualification pending."})]}),e.jsx("div",{className:"mcp-client-tabs",role:"tablist","aria-label":"MCP client setup",children:d.map(r=>e.jsx("button",{type:"button",role:"tab","aria-selected":c===r.key,onClick:()=>o(r.key),children:r.label},r.key))}),e.jsxs("div",{className:"mcp-setup",role:"tabpanel",children:[e.jsx("p",{children:t.summary}),t.code?e.jsxs("div",{className:"mcp-code-row",children:[e.jsx("pre",{children:e.jsx("code",{children:t.code(s)})}),e.jsx(l,{value:t.code(s),label:`Copy ${t.label} setup`})]}):e.jsxs("div",{className:"mcp-code-row",children:[e.jsx("pre",{children:e.jsx("code",{children:s})}),e.jsx(l,{value:s,label:`Copy ${t.label} endpoint`})]})]})]}),e.jsxs("section",{className:"mcp-section","aria-labelledby":"mcp-capabilities",children:[e.jsxs("div",{className:"mcp-section-heading",children:[e.jsx("p",{className:"sidebar-label",children:"Capabilities"}),e.jsx("h2",{id:"mcp-capabilities",children:"Research context, structured for assistants"})]}),e.jsx("div",{className:"mcp-capability-grid",children:[["Discover","Search recent and established work with catalogue filters."],["Read","Continue through long stored papers without presenting a partial document as complete."],["Connect","Explore related work, paper lineage, tasks, and methods."],["Compare","Inspect benchmarks, datasets, metrics, and reported evaluations."]].map(([r,p])=>e.jsxs("div",{children:[e.jsx("h3",{children:r}),e.jsx("p",{children:p})]},r))})]}),e.jsxs("section",{className:"mcp-section","aria-labelledby":"mcp-tools",children:[e.jsxs("div",{className:"mcp-section-heading",children:[e.jsx("p",{className:"sidebar-label",children:"Catalogue"}),e.jsx("h2",{id:"mcp-tools",children:"Twenty-one focused, read-only tools"})]}),e.jsx("div",{className:"mcp-tool-grid",children:C.map(([r,p])=>e.jsxs("div",{className:"mcp-tool",children:[e.jsx("code",{children:r}),e.jsx("p",{children:p})]},r))}),e.jsx("h3",{className:"mcp-subheading",children:"Resource templates"}),e.jsx("div",{className:"mcp-resource-list",children:N.map(r=>e.jsx("code",{children:r},r))})]}),e.jsxs("section",{className:"mcp-section","aria-labelledby":"mcp-prompts",children:[e.jsxs("div",{className:"mcp-section-heading",children:[e.jsx("p",{className:"sidebar-label",children:"Try asking"}),e.jsx("h2",{id:"mcp-prompts",children:"Prompts that start useful research"})]}),e.jsx("div",{className:"mcp-prompt-list",children:P.map(r=>e.jsxs("div",{children:[e.jsx("p",{children:r}),e.jsx(l,{value:r,label:"Copy example prompt"})]},r))})]}),e.jsxs("section",{className:"mcp-section mcp-notes","aria-labelledby":"mcp-limits",children:[e.jsxs("div",{children:[e.jsx("p",{className:"sidebar-label mcp-kicker",children:"Limits & privacy"}),e.jsx("h2",{id:"mcp-limits",children:"Public by design"}),e.jsx("p",{children:"No account, API key, or write access. Fair-use limits are 60 total requests per minute, 10 semantic searches per minute, four concurrent requests per client, and 25 list results per call."}),e.jsx("p",{children:"MCP telemetry retains tool name, status, latency, response size, protocol, and server version—not prompts, paper IDs, cursors, resource URIs, raw IPs, authorization values, or bodies. Catalogue infrastructure has its own operational logging policy."})]}),e.jsxs("div",{children:[e.jsx("p",{className:"sidebar-label mcp-kicker",children:"Protocol & troubleshooting"}),e.jsx("h2",{children:"Streamable HTTP"}),e.jsxs("p",{children:["Primary protocol: ",((n=a.data)==null?void 0:n.protocol)??"verified during connection setup",". If setup fails, confirm your client supports remote Streamable HTTP, that custom servers are enabled by your workspace administrator, and that you pasted the URL exactly."]}),e.jsxs("nav",{className:"mcp-links","aria-label":"MCP documentation links",children:[e.jsxs("a",{href:"https://github.com/huggingface/pwc-cli",target:"_blank",rel:"noreferrer",children:["CLI repository ",e.jsx(i,{size:13})]}),e.jsxs("a",{href:"https://modelcontextprotocol.io/docs/2026-07-28/learn/server-concepts",target:"_blank",rel:"noreferrer",children:["MCP specification ",e.jsx(i,{size:13})]}),e.jsxs("a",{href:"/docs",target:"_blank",rel:"noreferrer",children:["Public API ",e.jsx(i,{size:13})]}),e.jsxs("a",{href:"/mcp/schema",target:"_blank",rel:"noreferrer",children:["MCP tool schema ",e.jsx(i,{size:13})]}),e.jsxs("a",{href:"/llms.txt",target:"_blank",rel:"noreferrer",children:["llms.txt ",e.jsx(i,{size:13})]})]})]})]})]})};export{R as default};
assets/MethodDetailView-Cw3qxOyE.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{j as e,r as A,u as Z,c as V,L,ab as X}from"./index-CxdnHo9-.js";import{p as Y}from"./paperQueryKeys-CcqbH5YG.js";import{u as F}from"./useQuery-D8Q6gREv.js";import{u as J}from"./useInfiniteQuery-BUi2pe7X.js";import{M as ee,P as te}from"./components-BH6Cy8IX.js";import{u as ae,P as se}from"./useIntersectionObserver-2PEjywgc.js";import{a as re,P as ne,b as ie}from"./PaperDateFilter-C9tnni-Y.js";import{r as le,M as O}from"./MarkdownText-kHUUjGAC.js";import{c as N}from"./catalog-BRjI2ow6.js";import{p as oe}from"./papers-BwPS4QGO.js";import{s as ce}from"./slug-BpH-Nkvz.js";import{t as de}from"./transform-CArGBSok.js";import{S as M}from"./skeleton-B_RgoAAL.js";import{A as me,a as he}from"./alert-BQ0_qoe3.js";import{s as pe}from"./safeExternalHref-CkBrsh84.js";import"./LatexTitle-ih-jCKpS.js";import"./katex.min-BSBacQyE.js";import"./popover-DEMAeJxN.js";import"./PaperPreviewLink-CUTHdATo.js";import"./index-DFKsmHrq.js";import"./index-B42pNGT3.js";import"./hover-card-CdRF8g76.js";import"./useMutation-Be3gnlrL.js";const a={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:d,h:m,fill:f,stroke:x,label:p,fontSize:l=10})=>e.jsxs("g",{children:[e.jsx("rect",{x:t,y:n,width:d,height:m,rx:"3",ry:"3",fill:f,stroke:x,strokeWidth:"1"}),e.jsx("text",{x:t+d/2,y:n+m/2,fontSize:l,fontFamily:"var(--sans)",fill:a.ink,textAnchor:"middle",dominantBaseline:"middle",children:p})]}),ue=()=>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:a.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(j,{x:140,y:40,w:80,h:26,fill:a.yellow,stroke:a.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:a.ink}),e.jsx(j,{x:140,y:80,w:80,h:26,fill:a.green,stroke:a.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:a.ink}),e.jsx(j,{x:140,y:120,w:80,h:26,fill:a.purple,stroke:a.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:a.ink}),e.jsx(j,{x:140,y:160,w:80,h:26,fill:a.blue,stroke:a.blueS,label:"Scale ÷√dₖ",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:a.ink}),e.jsx(j,{x:140,y:200,w:80,h:26,fill:a.yellow,stroke:a.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:a.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:a.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:a.ink}),e.jsx(j,{x:100,y:270,w:40,h:24,fill:a.pink,stroke:a.pinkS,label:"Q",fontSize:13}),e.jsx(j,{x:160,y:270,w:40,h:24,fill:a.pink,stroke:a.pinkS,label:"K",fontSize:13}),e.jsx(j,{x:220,y:270,w:40,h:24,fill:a.pink,stroke:a.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:a.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),xe=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],ge=()=>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:a.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:a.faint,strokeWidth:"1"}),xe.map(([t,n],d)=>{const m=92+d*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:m,fontSize:"11",fontFamily:"var(--mono)",fill:a.ink,dominantBaseline:"middle",children:t}),n?e.jsx("text",{x:"138",y:m,fontSize:"8.5",fontFamily:"var(--mono)",fill:a.faint,dominantBaseline:"middle",children:n}):null]},t)})]}),fe={attention:ue,"agent-skills":ge},je=({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:a.faint,textAnchor:"middle",children:t.name||"method"}),e.jsx(j,{x:80,y:70,w:200,h:50,fill:a.blue,stroke:a.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:a.ink}),e.jsx(j,{x:80,y:150,w:200,h:70,fill:a.orange,stroke:a.orangeS,label:t.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:a.ink}),e.jsx(j,{x:80,y:250,w:200,h:50,fill:a.purple,stroke:a.purpleS,label:"Output",fontSize:12})]}),_e=({method:t})=>{const n=(t.slug||"").toLowerCase(),d=fe[n];if(d)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(d,{})});if(t.image_url){const m=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${m}`,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(je,{method:t})})},C=720,T=138,u={top:8,right:10,bottom:25,left:36},Q=56,ye=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),ve=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),z=t=>ye.format(new Date(`${t}T00:00:00Z`)),Se=(t,n)=>{if(t===0)return new Set;const d=t>48?12:t>36?6:t>18?3:2,m=Math.max(1,Math.ceil(Q/n)),f=Math.max(d,m),x=t-1,p=new Set([0,x]);for(let l=f;l<x;l+=f)(x-l)*n>=Q&&p.add(l);return p},U=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}`},Ne=({history:t,methodName:n})=>{const[d,m]=A.useState(null),f=Math.max(1,...t.map(o=>o.paper_count)),x=C-u.left-u.right,p=T-u.top-u.bottom,l=t.length?x/t.length:x,k=Math.max(2,l*.68),D=Se(t.length,l),h=Array.from(new Set([0,Math.ceil(f/2),f])),_=d==null?null:t[d],g=_?U(_):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${C} ${T}`,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"]}),h.map(o=>{const i=u.top+p-o/f*p;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:u.left,x2:C-u.right,y1:i,y2:i}),e.jsx("text",{className:"method-usage-y-label",x:u.left-8,y:i+3,textAnchor:"end",children:o})]},o)}),t.map((o,i)=>{const b=o.paper_count/f*p,y=o.paper_count>0?Math.max(1,b):0,P=u.left+l*i+(l-k)/2,w=u.top+p-y,s=d===i,S=i===t.length-1,v=U(o);return e.jsxs("g",{className:`method-usage-bar${s?" is-active":""}${S?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${z(o.start_date)}: ${o.paper_count} ${o.paper_count===1?"paper":"papers"}${v?`. ${v}`:""}`,onMouseEnter:()=>m(i),onMouseLeave:()=>m(null),onFocus:()=>m(i),onBlur:()=>m(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:u.left+l*i,y:u.top,width:l,height:p}),e.jsx("rect",{className:"method-usage-bar-mark",x:P,y:w,width:k,height:y,rx:"1.5"})]},o.start_date)}),t.map((o,i)=>D.has(i)?e.jsx("text",{className:"method-usage-x-label",x:u.left+l*(i+.5),y:T-11,textAnchor:"middle",children:t.length>48?ve.format(new Date(`${o.start_date}T00:00:00Z`)):z(o.start_date)},o.start_date):null)]}),_&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:z(_.start_date)}),e.jsxs("span",{children:[_.paper_count," ",_.paper_count===1?"paper":"papers",d===t.length-1?" · month to date":""]}),e.jsxs("span",{children:[(_.catalog_share??0).toFixed(2),"% of"," ",(_.catalog_paper_count??0).toLocaleString()," catalog papers"]}),g&&e.jsx("span",{children:g})]})]})},ke=[["trending","trending"],["new","newest"],["cited","most cited"]],G={"on-policy-distillation":["fine-tuning","post-training","rlvr","rlhf","direct-preference-optimization-dpo"],mcp:["agent-skills"],"agent-skills":["mcp"]},We=()=>{var I,B,$,H,R,q;const{methodSlug:t}=Z(),[n,d]=V(),[m,f]=A.useState("trending"),x=n.get("has_code")==="true",p=n.get("has_hf_artifacts")==="true",l=re(n),k=r=>{const c=new URLSearchParams(n);r?c.set("has_code","true"):c.delete("has_code"),d(c)},D=r=>{const c=new URLSearchParams(n);r?c.set("has_hf_artifacts","true"):c.delete("has_hf_artifacts"),d(c)},h=F({queryKey:["method",t],queryFn:()=>N.getMethod(t),enabled:!!t,staleTime:10*60*1e3}),_=F({queryKey:["areas-all"],queryFn:()=>N.listAreas({page_size:50,ordering:"name"}),enabled:!!((I=h.data)!=null&&I.area_id),staleTime:10*60*1e3}),g=F({queryKey:["method-trend",t],queryFn:()=>N.methodTrend(t),enabled:!!t&&!!h.data,staleTime:10*60*1e3}),o=m==="trending"?"trending":m==="cited"?"citation_count":"date_published",i=J({queryKey:[...Y.feeds.method,t,o,x,p,l.startDate,l.endDate],queryFn:({pageParam:r=1})=>oe.forMethod(t,{page:r,page_size:20,order_by:o,order_dir:"desc",include_resources:!0,has_code:x,has_hf_artifacts:p,start_date:l.startDate,end_date:l.endDate}),getNextPageParam:r=>r.next_page,initialPageParam:1,enabled:!!t,staleTime:5*60*1e3,placeholderData:X}),b=F({queryKey:["related-methods",(B=h.data)==null?void 0:B.slug,($=h.data)==null?void 0:$.area_id,(H=h.data)==null?void 0:H.id],queryFn:async()=>{const r=h.data;if(!r)return[];const c=r.slug?G[r.slug]:void 0;return c?Promise.all(c.map(W=>N.getMethod(W))):r.area_id?(await N.listMethods({area_id:r.area_id,exclude_id:r.id,ordering:"-paper_count",page_size:8})).results:[]},enabled:!!(h.data&&(h.data.slug&&G[h.data.slug]||h.data.area_id)),staleTime:10*60*1e3}),y=A.useMemo(()=>{var c;return(((c=i.data)==null?void 0:c.pages.flatMap(K=>K.results))||[]).map(de)},[i.data]),{targetRef:P,isIntersecting:w}=ae({rootMargin:"200px"});if(A.useEffect(()=>{w&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[w,i.hasNextPage,i.isFetchingNextPage]),h.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(M,{className:"h-12 w-1/2 mb-4"}),e.jsx(M,{className:"h-64 w-full"})]});if(h.error||!h.data)return e.jsx("div",{className:"page",children:e.jsx(me,{variant:"destructive",children:e.jsx(he,{children:"Method not found."})})});const s=h.data,S=(R=_.data)==null?void 0:R.results.find(r=>r.id===s.area_id),v=le(s.source_url),E=v?null:pe(s.source_url);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(L,{to:"/methods",children:"Methods"}),S&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(L,{to:`/methods#area-${ce(S.name)}`,children:S.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:s.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${s.slug==="grokking"||s.slug==="latent-reasoning"||s.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:s.name}),s.full_name&&s.full_name!==s.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:s.full_name}),s.description&&e.jsx(O,{className:"method-description",text:s.description}),s.source_url&&s.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),v?e.jsxs(L,{className:"method-source-link",to:v,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:s.source_title}),s.introduced_year&&e.jsx("span",{className:"method-source-meta",children:s.introduced_year})]}):E?e.jsxs("a",{className:"method-source-link",href:E,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:s.source_title}),s.introduced_year&&e.jsx("span",{className:"method-source-meta",children:s.introduced_year})]}):e.jsxs("div",{className:"method-source-link is-static",children:[e.jsx("span",{className:"method-source-title",children:s.source_title}),s.introduced_year&&e.jsx("span",{className:"method-source-meta",children:s.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:(s.paper_count??0).toLocaleString()})]}),g.data&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Recent mentions"}),e.jsxs("span",{className:"value",children:[(g.data.recent_paper_count*30/g.data.recent_days).toFixed(1),e.jsx("small",{children:"/mo"})]}),!g.data.comparison_complete&&e.jsx("span",{title:"Tagging is still catching up. This rate reflects mentions found so far.",children:"Partial coverage"})]}),s.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:s.introduced_year})]})]}),g.isLoading?e.jsx(M,{className:"h-36 w-full method-trend-skeleton"}):g.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:g.data.recent_paper_count}),e.jsxs("span",{children:["papers / ",g.data.recent_days,"d"]})]})]}),e.jsx(Ne,{history:g.data.history,methodName:s.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(_e,{method:s}),s.image_credit&&e.jsx("figcaption",{children:e.jsx(O,{className:"method-image-credit",text:s.image_credit})})]})]}),(((q=b.data)==null?void 0:q.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),b.data.map(r=>e.jsx(ee,{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:ke.map(([r,c])=>e.jsx("button",{className:`sort-btn ${m===r?"active":""}`,onClick:()=>f(r),children:c},r))}),e.jsx(se,{hasCode:x,hasHfArtifacts:p,onHasCodeChange:k,onHasHfArtifactsChange:D})]}),e.jsx(ne,{startDate:l.startDate,endDate:l.endDate,onChange:r=>d(ie(n,r))}),e.jsxs("div",{className:"results-count",children:[y.length," papers mentioning ",s.name]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((r,c)=>e.jsx(M,{className:"h-40 w-full"},c))}):y.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:y.map((r,c)=>e.jsx(te,{paper:r,rank:c+1},r.id))}),e.jsx("div",{ref:P,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{We as default};
assets/MethodDetailView-DBPaI5Ks.js DELETED
@@ -1 +0,0 @@
1
- import{j as e,r as A,u as Z,c as V,L,ab as X}from"./index-DVQGVzHu.js";import{u as F}from"./useQuery-tFDel9EL.js";import{u as Y}from"./useInfiniteQuery-CYdxlDgS.js";import{M as J,P as ee}from"./components-_zRgatMC.js";import{u as te,P as ae}from"./useIntersectionObserver-IRMyVQkj.js";import{a as se,P as re,b as ne}from"./PaperDateFilter-BH56Is-x.js";import{r as ie,M as K}from"./MarkdownText-D9cBh-rH.js";import{c as N}from"./catalog-Da4k4qEI.js";import{p as le}from"./papers-DlaCqfyl.js";import{s as oe}from"./slug-BpH-Nkvz.js";import{t as ce}from"./transform-PseCN9bN.js";import{S as M}from"./skeleton-DJUh-5VW.js";import{A as de,a as me}from"./alert-7mO5HIuQ.js";import{s as he}from"./safeExternalHref-CkBrsh84.js";import"./LatexTitle-B0TwWoUu.js";import"./katex.min-BSBacQyE.js";import"./popover-Beg3zsfL.js";import"./PaperPreviewLink-CpVn6ETd.js";import"./index-VSogvUtt.js";import"./index-B-ULOvtV.js";import"./hover-card-B-kPWoKE.js";import"./useMutation-Doe-Qh76.js";const a={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:d,h:m,fill:f,stroke:x,label:p,fontSize:l=10})=>e.jsxs("g",{children:[e.jsx("rect",{x:t,y:n,width:d,height:m,rx:"3",ry:"3",fill:f,stroke:x,strokeWidth:"1"}),e.jsx("text",{x:t+d/2,y:n+m/2,fontSize:l,fontFamily:"var(--sans)",fill:a.ink,textAnchor:"middle",dominantBaseline:"middle",children:p})]}),pe=()=>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:a.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(j,{x:140,y:40,w:80,h:26,fill:a.yellow,stroke:a.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:a.ink}),e.jsx(j,{x:140,y:80,w:80,h:26,fill:a.green,stroke:a.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:a.ink}),e.jsx(j,{x:140,y:120,w:80,h:26,fill:a.purple,stroke:a.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:a.ink}),e.jsx(j,{x:140,y:160,w:80,h:26,fill:a.blue,stroke:a.blueS,label:"Scale ÷√dₖ",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:a.ink}),e.jsx(j,{x:140,y:200,w:80,h:26,fill:a.yellow,stroke:a.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:a.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:a.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:a.ink}),e.jsx(j,{x:100,y:270,w:40,h:24,fill:a.pink,stroke:a.pinkS,label:"Q",fontSize:13}),e.jsx(j,{x:160,y:270,w:40,h:24,fill:a.pink,stroke:a.pinkS,label:"K",fontSize:13}),e.jsx(j,{x:220,y:270,w:40,h:24,fill:a.pink,stroke:a.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:a.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),ue=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],xe=()=>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:a.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:a.faint,strokeWidth:"1"}),ue.map(([t,n],d)=>{const m=92+d*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:m,fontSize:"11",fontFamily:"var(--mono)",fill:a.ink,dominantBaseline:"middle",children:t}),n?e.jsx("text",{x:"138",y:m,fontSize:"8.5",fontFamily:"var(--mono)",fill:a.faint,dominantBaseline:"middle",children:n}):null]},t)})]}),ge={attention:pe,"agent-skills":xe},fe=({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:a.faint,textAnchor:"middle",children:t.name||"method"}),e.jsx(j,{x:80,y:70,w:200,h:50,fill:a.blue,stroke:a.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:a.ink}),e.jsx(j,{x:80,y:150,w:200,h:70,fill:a.orange,stroke:a.orangeS,label:t.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:a.ink}),e.jsx(j,{x:80,y:250,w:200,h:50,fill:a.purple,stroke:a.purpleS,label:"Output",fontSize:12})]}),je=({method:t})=>{const n=(t.slug||"").toLowerCase(),d=ge[n];if(d)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(d,{})});if(t.image_url){const m=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${m}`,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(fe,{method:t})})},C=720,T=138,u={top:8,right:10,bottom:25,left:36},Q=56,_e=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),ye=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),z=t=>_e.format(new Date(`${t}T00:00:00Z`)),ve=(t,n)=>{if(t===0)return new Set;const d=t>48?12:t>36?6:t>18?3:2,m=Math.max(1,Math.ceil(Q/n)),f=Math.max(d,m),x=t-1,p=new Set([0,x]);for(let l=f;l<x;l+=f)(x-l)*n>=Q&&p.add(l);return p},U=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}`},Se=({history:t,methodName:n})=>{const[d,m]=A.useState(null),f=Math.max(1,...t.map(o=>o.paper_count)),x=C-u.left-u.right,p=T-u.top-u.bottom,l=t.length?x/t.length:x,k=Math.max(2,l*.68),D=ve(t.length,l),h=Array.from(new Set([0,Math.ceil(f/2),f])),_=d==null?null:t[d],g=_?U(_):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${C} ${T}`,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"]}),h.map(o=>{const i=u.top+p-o/f*p;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:u.left,x2:C-u.right,y1:i,y2:i}),e.jsx("text",{className:"method-usage-y-label",x:u.left-8,y:i+3,textAnchor:"end",children:o})]},o)}),t.map((o,i)=>{const b=o.paper_count/f*p,y=o.paper_count>0?Math.max(1,b):0,P=u.left+l*i+(l-k)/2,w=u.top+p-y,s=d===i,S=i===t.length-1,v=U(o);return e.jsxs("g",{className:`method-usage-bar${s?" is-active":""}${S?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${z(o.start_date)}: ${o.paper_count} ${o.paper_count===1?"paper":"papers"}${v?`. ${v}`:""}`,onMouseEnter:()=>m(i),onMouseLeave:()=>m(null),onFocus:()=>m(i),onBlur:()=>m(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:u.left+l*i,y:u.top,width:l,height:p}),e.jsx("rect",{className:"method-usage-bar-mark",x:P,y:w,width:k,height:y,rx:"1.5"})]},o.start_date)}),t.map((o,i)=>D.has(i)?e.jsx("text",{className:"method-usage-x-label",x:u.left+l*(i+.5),y:T-11,textAnchor:"middle",children:t.length>48?ye.format(new Date(`${o.start_date}T00:00:00Z`)):z(o.start_date)},o.start_date):null)]}),_&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:z(_.start_date)}),e.jsxs("span",{children:[_.paper_count," ",_.paper_count===1?"paper":"papers",d===t.length-1?" · month to date":""]}),e.jsxs("span",{children:[(_.catalog_share??0).toFixed(2),"% of"," ",(_.catalog_paper_count??0).toLocaleString()," catalog papers"]}),g&&e.jsx("span",{children:g})]})]})},Ne=[["trending","trending"],["new","newest"],["cited","most cited"]],G={"on-policy-distillation":["fine-tuning","post-training","rlvr","rlhf","direct-preference-optimization-dpo"],mcp:["agent-skills"],"agent-skills":["mcp"]},Ue=()=>{var I,B,$,H,R,q;const{methodSlug:t}=Z(),[n,d]=V(),[m,f]=A.useState("trending"),x=n.get("has_code")==="true",p=n.get("has_hf_artifacts")==="true",l=se(n),k=r=>{const c=new URLSearchParams(n);r?c.set("has_code","true"):c.delete("has_code"),d(c)},D=r=>{const c=new URLSearchParams(n);r?c.set("has_hf_artifacts","true"):c.delete("has_hf_artifacts"),d(c)},h=F({queryKey:["method",t],queryFn:()=>N.getMethod(t),enabled:!!t,staleTime:10*60*1e3}),_=F({queryKey:["areas-all"],queryFn:()=>N.listAreas({page_size:50,ordering:"name"}),enabled:!!((I=h.data)!=null&&I.area_id),staleTime:10*60*1e3}),g=F({queryKey:["method-trend",t],queryFn:()=>N.methodTrend(t),enabled:!!t&&!!h.data,staleTime:10*60*1e3}),o=m==="trending"?"trending":m==="cited"?"citation_count":"date_published",i=Y({queryKey:["method-papers-infinite",t,o,x,p,l.startDate,l.endDate],queryFn:({pageParam:r=1})=>le.forMethod(t,{page:r,page_size:20,order_by:o,order_dir:"desc",include_resources:!0,has_code:x,has_hf_artifacts:p,start_date:l.startDate,end_date:l.endDate}),getNextPageParam:r=>r.next_page,initialPageParam:1,enabled:!!t,staleTime:5*60*1e3,placeholderData:X}),b=F({queryKey:["related-methods",(B=h.data)==null?void 0:B.slug,($=h.data)==null?void 0:$.area_id,(H=h.data)==null?void 0:H.id],queryFn:async()=>{const r=h.data;if(!r)return[];const c=r.slug?G[r.slug]:void 0;return c?Promise.all(c.map(W=>N.getMethod(W))):r.area_id?(await N.listMethods({area_id:r.area_id,exclude_id:r.id,ordering:"-paper_count",page_size:8})).results:[]},enabled:!!(h.data&&(h.data.slug&&G[h.data.slug]||h.data.area_id)),staleTime:10*60*1e3}),y=A.useMemo(()=>{var c;return(((c=i.data)==null?void 0:c.pages.flatMap(O=>O.results))||[]).map(ce)},[i.data]),{targetRef:P,isIntersecting:w}=te({rootMargin:"200px"});if(A.useEffect(()=>{w&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[w,i.hasNextPage,i.isFetchingNextPage]),h.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(M,{className:"h-12 w-1/2 mb-4"}),e.jsx(M,{className:"h-64 w-full"})]});if(h.error||!h.data)return e.jsx("div",{className:"page",children:e.jsx(de,{variant:"destructive",children:e.jsx(me,{children:"Method not found."})})});const s=h.data,S=(R=_.data)==null?void 0:R.results.find(r=>r.id===s.area_id),v=ie(s.source_url),E=v?null:he(s.source_url);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(L,{to:"/methods",children:"Methods"}),S&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(L,{to:`/methods#area-${oe(S.name)}`,children:S.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:s.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${s.slug==="grokking"||s.slug==="latent-reasoning"||s.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:s.name}),s.full_name&&s.full_name!==s.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:s.full_name}),s.description&&e.jsx(K,{className:"method-description",text:s.description}),s.source_url&&s.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),v?e.jsxs(L,{className:"method-source-link",to:v,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:s.source_title}),s.introduced_year&&e.jsx("span",{className:"method-source-meta",children:s.introduced_year})]}):E?e.jsxs("a",{className:"method-source-link",href:E,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:s.source_title}),s.introduced_year&&e.jsx("span",{className:"method-source-meta",children:s.introduced_year})]}):e.jsxs("div",{className:"method-source-link is-static",children:[e.jsx("span",{className:"method-source-title",children:s.source_title}),s.introduced_year&&e.jsx("span",{className:"method-source-meta",children:s.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:(s.paper_count??0).toLocaleString()})]}),g.data&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Recent mentions"}),e.jsxs("span",{className:"value",children:[(g.data.recent_paper_count*30/g.data.recent_days).toFixed(1),e.jsx("small",{children:"/mo"})]}),!g.data.comparison_complete&&e.jsx("span",{title:"Tagging is still catching up. This rate reflects mentions found so far.",children:"Partial coverage"})]}),s.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:s.introduced_year})]})]}),g.isLoading?e.jsx(M,{className:"h-36 w-full method-trend-skeleton"}):g.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:g.data.recent_paper_count}),e.jsxs("span",{children:["papers / ",g.data.recent_days,"d"]})]})]}),e.jsx(Se,{history:g.data.history,methodName:s.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(je,{method:s}),s.image_credit&&e.jsx("figcaption",{children:e.jsx(K,{className:"method-image-credit",text:s.image_credit})})]})]}),(((q=b.data)==null?void 0:q.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),b.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:Ne.map(([r,c])=>e.jsx("button",{className:`sort-btn ${m===r?"active":""}`,onClick:()=>f(r),children:c},r))}),e.jsx(ae,{hasCode:x,hasHfArtifacts:p,onHasCodeChange:k,onHasHfArtifactsChange:D})]}),e.jsx(re,{startDate:l.startDate,endDate:l.endDate,onChange:r=>d(ne(n,r))}),e.jsxs("div",{className:"results-count",children:[y.length," papers mentioning ",s.name]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((r,c)=>e.jsx(M,{className:"h-40 w-full"},c))}):y.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:y.map((r,c)=>e.jsx(ee,{paper:r,rank:c+1},r.id))}),e.jsx("div",{ref:P,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{Ue as default};
 
 
assets/{MethodsIndexView-DbwqEJrI.js → MethodsIndexView-D9UcmYcE.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{e as g,r as d,j as e,L as f}from"./index-DVQGVzHu.js";import{u as m}from"./useQuery-tFDel9EL.js";import{c as h}from"./catalog-Da4k4qEI.js";import{s as j}from"./slug-BpH-Nkvz.js";import{S as p}from"./skeleton-DJUh-5VW.js";import{A as y,a as v}from"./alert-7mO5HIuQ.js";import{T as _}from"./TaxonomySuggestionTile-Cv_5Vdw1.js";import"./SignInToEditDialog-BnOs8fwJ.js";import"./button-CV3EZ-wD.js";import"./input-BAcBK79_.js";import"./textarea-aBWToPSo.js";import"./searchable-select-DCJ2FvKo.js";import"./popover-Beg3zsfL.js";import"./dialog-8H_bvgui.js";import"./loader-circle-PqpEC1ka.js";import"./useMutation-Doe-Qh76.js";import"./submissions-MYrqMRRd.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{e as g,r as d,j as e,L as f}from"./index-CxdnHo9-.js";import{u as m}from"./useQuery-D8Q6gREv.js";import{c as h}from"./catalog-BRjI2ow6.js";import{s as j}from"./slug-BpH-Nkvz.js";import{S as p}from"./skeleton-B_RgoAAL.js";import{A as y,a as v}from"./alert-BQ0_qoe3.js";import{T as _}from"./TaxonomySuggestionTile-LXp-6pUX.js";import"./SignInToEditDialog-CvCN1sw5.js";import"./button-CdSuwKQi.js";import"./input-DDdJ1U-7.js";import"./textarea-BDOV52Ld.js";import"./searchable-select-C6kGq-Ns.js";import"./popover-DEMAeJxN.js";import"./dialog-CPQIZl1d.js";import"./loader-circle-C8HknmII.js";import"./useMutation-Be3gnlrL.js";import"./submissions-Z67bAPym.js";/**
2
  * @license lucide-react v0.462.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{NotFound-Db8yITOG.js → NotFound-rCpMdseu.js} RENAMED
@@ -1 +1 @@
1
- import{aJ as o,r as a,j as t,L as s}from"./index-DVQGVzHu.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};
 
1
+ import{aJ as o,r as a,j as t,L as s}from"./index-CxdnHo9-.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-D1VOwcUX.js → OrganizationContributionGraph-MP2Tw68V.js} RENAMED
@@ -1 +1 @@
1
- import{r as b,j as o}from"./index-DVQGVzHu.js";import{u as z}from"./useQuery-tFDel9EL.js";import{S as T}from"./skeleton-DJUh-5VW.js";import{c as w}from"./catalog-Da4k4qEI.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};
 
1
+ import{r as b,j as o}from"./index-CxdnHo9-.js";import{u as z}from"./useQuery-D8Q6gREv.js";import{S as T}from"./skeleton-B_RgoAAL.js";import{c as w}from"./catalog-BRjI2ow6.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-AlL95qKc.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{u as t,j as r}from"./index-CxdnHo9-.js";import{O as i}from"./OrganizationPaperFeed-Doln-moa.js";import m from"./NotFound-rCpMdseu.js";import"./useQuery-D8Q6gREv.js";import"./components-BH6Cy8IX.js";import"./paperQueryKeys-CcqbH5YG.js";import"./LatexTitle-ih-jCKpS.js";import"./katex.min-BSBacQyE.js";import"./transform-CArGBSok.js";import"./papers-BwPS4QGO.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-kHUUjGAC.js";import"./PaperPreviewLink-CUTHdATo.js";import"./index-DFKsmHrq.js";import"./index-B42pNGT3.js";import"./hover-card-CdRF8g76.js";import"./useMutation-Be3gnlrL.js";import"./OrganizationContributionGraph-MP2Tw68V.js";import"./skeleton-B_RgoAAL.js";import"./catalog-BRjI2ow6.js";import"./useIntersectionObserver-2PEjywgc.js";import"./PaperDateFilter-C9tnni-Y.js";import"./popover-DEMAeJxN.js";import"./alert-BQ0_qoe3.js";import"./searchable-select-C6kGq-Ns.js";import"./button-CdSuwKQi.js";import"./dialog-CPQIZl1d.js";import"./loader-circle-C8HknmII.js";import"./usePapers-CD7ebaIw.js";import"./useInfiniteQuery-BUi2pe7X.js";const A=()=>{const{orgSlug:o}=t();return o?r.jsx(i,{organizationSlug:o}):r.jsx(m,{})};export{A as default};
assets/OrganizationDetailView-a2Xbb6Ec.js DELETED
@@ -1 +0,0 @@
1
- import{u as t,j as r}from"./index-DVQGVzHu.js";import{O as i}from"./OrganizationPaperFeed-DL99kimS.js";import m from"./NotFound-Db8yITOG.js";import"./useQuery-tFDel9EL.js";import"./components-_zRgatMC.js";import"./LatexTitle-B0TwWoUu.js";import"./katex.min-BSBacQyE.js";import"./transform-PseCN9bN.js";import"./papers-DlaCqfyl.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-D9cBh-rH.js";import"./PaperPreviewLink-CpVn6ETd.js";import"./index-VSogvUtt.js";import"./index-B-ULOvtV.js";import"./hover-card-B-kPWoKE.js";import"./useMutation-Doe-Qh76.js";import"./OrganizationContributionGraph-D1VOwcUX.js";import"./skeleton-DJUh-5VW.js";import"./catalog-Da4k4qEI.js";import"./useIntersectionObserver-IRMyVQkj.js";import"./PaperDateFilter-BH56Is-x.js";import"./popover-Beg3zsfL.js";import"./alert-7mO5HIuQ.js";import"./searchable-select-DCJ2FvKo.js";import"./button-CV3EZ-wD.js";import"./dialog-8H_bvgui.js";import"./loader-circle-PqpEC1ka.js";import"./usePapers-a_mp-Uw3.js";import"./useInfiniteQuery-CYdxlDgS.js";const y=()=>{const{orgSlug:o}=t();return o?r.jsx(i,{organizationSlug:o}):r.jsx(m,{})};export{y as default};
 
 
assets/{OrganizationPaperFeed-DL99kimS.js → OrganizationPaperFeed-Doln-moa.js} RENAMED
@@ -1 +1 @@
1
- import{b as E,c as Q,r as d,j as e,L as A}from"./index-DVQGVzHu.js";import{u as C}from"./useQuery-tFDel9EL.js";import{P as U}from"./components-_zRgatMC.js";import{M as B}from"./MarkdownText-D9cBh-rH.js";import{O as G}from"./OrganizationContributionGraph-D1VOwcUX.js";import{u as K,P as W}from"./useIntersectionObserver-IRMyVQkj.js";import{a as Z,P as J,b as V}from"./PaperDateFilter-BH56Is-x.js";import{A as X,a as Y}from"./alert-7mO5HIuQ.js";import{S as z}from"./searchable-select-DCJ2FvKo.js";import{S as $}from"./skeleton-DJUh-5VW.js";import{e as ee}from"./usePapers-a_mp-Uw3.js";import{c as D}from"./catalog-Da4k4qEI.js";import{d as R,t as se}from"./transform-PseCN9bN.js";import ae from"./NotFound-Db8yITOG.js";const re=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],te=n=>n==="date_published"||n==="citation_count"?n:"trending",je=({organizationSlug:n,taskSlug:p})=>{var y,P,v,F,L,k,w,O;const T=E(),[o,h]=Q(),[I,u]=d.useState(!1),g=te(o.get("order_by")),f=o.get("has_code")==="true",_=o.get("has_hf_artifacts")==="true",m=Z(o),x=C({queryKey:["organization",n],queryFn:()=>D.getOrganization(n),staleTime:10*60*1e3}),c=C({queryKey:["organization-areas-with-tasks",n],queryFn:()=>D.organizationAreasWithTasks(n),staleTime:10*60*1e3}),i=ee({organizationSlug:n,taskSlug:p,page_size:12,order_by:g,order_dir:"desc",include_resources:!0,has_code:f,has_hf_artifacts:_,start_date:m.startDate,end_date:m.endDate,enabled:!!n}),{targetRef:M,isIntersecting:j}=K({rootMargin:"200px"});d.useEffect(()=>{j&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[j,i.hasNextPage,i.isFetchingNextPage]),d.useEffect(()=>{u(!1)},[n,p]);const b=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:R(t.name,t.slug)})))},[c.data]),l=b.find(a=>a.slug===p),N=d.useMemo(()=>{var a;return(((a=i.data)==null?void 0:a.pages)??[]).flatMap(r=>r.results.map(se))},[i.data]),s=x.data??((y=c.data)==null?void 0:y.organization),H=((v=(P=i.data)==null?void 0:P.pages[0])==null?void 0:v.count)??0;if(((F=x.error)==null?void 0:F.status)===404||((L=c.error)==null?void 0:L.status)===404||((k=i.error)==null?void 0:k.status)===404)return e.jsx(ae,{});if(c.error||i.error)return e.jsx("div",{className:"page",children:e.jsx(X,{variant:"destructive",children:e.jsx(Y,{children:"Failed to load organization papers. Please try again."})})});const q=a=>{const r=a.trim().toLocaleLowerCase();return b.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=o.toString();T({pathname:r,search:t?`?${t}`:""})};return e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(A,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(A,{to:"/organizations",children:"Organizations"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:(s==null?void 0:s.name)??n}),l&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:" / "}),e.jsx("span",{children:R(l.name,l.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&&!I?e.jsx("img",{src:s.logo_url,alt:"",width:58,height:58,onError:()=>u(!0)}):s?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:s.name.slice(0,1).toUpperCase()}):null,(s==null?void 0:s.name)??e.jsx($,{className:"h-12 w-64"})]}),s&&e.jsxs("div",{className:"feed-subtitle",children:[((w=s.paper_count)==null?void 0:w.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 ↗"})]})]}),e.jsx(G,{organizationSlug:n,organizationName:(s==null?void 0:s.name)??n})]}),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:l?{value:l.slug,label:l.label,description:`${l.paper_count.toLocaleString()} ${l.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:re.map(([a,r])=>e.jsx("button",{type:"button",className:`sort-btn ${g===a?"active":""}`,onClick:()=>{const t=new URLSearchParams(o);a==="trending"?t.delete("order_by"):t.set("order_by",a),h(t)},children:r},a))}),e.jsx(W,{hasCode:f,hasHfArtifacts:_,onHasCodeChange:a=>{const r=new URLSearchParams(o);a?r.set("has_code","true"):r.delete("has_code"),h(r)},onHasHfArtifactsChange:a=>{const r=new URLSearchParams(o);a?r.set("has_hf_artifacts","true"):r.delete("has_hf_artifacts"),h(r)}})]}),e.jsx(J,{startDate:m.startDate,endDate:m.endDate,onChange:a=>h(V(o,a))}),e.jsxs("div",{className:"results-count",children:[H.toLocaleString()," papers"]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,r)=>e.jsx($,{className:"h-40 w-full"},r))}):N.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:N.map((a,r)=>e.jsx(U,{paper:a,rank:r+1,showInstitution:!1},a.id))}),e.jsx("div",{ref:M,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center"},children:"Loading more…"})]})]})};export{je as O};
 
1
+ import{b as E,c as Q,r as d,j as e,L as A}from"./index-CxdnHo9-.js";import{u as C}from"./useQuery-D8Q6gREv.js";import{P as U}from"./components-BH6Cy8IX.js";import{M as B}from"./MarkdownText-kHUUjGAC.js";import{O as G}from"./OrganizationContributionGraph-MP2Tw68V.js";import{u as K,P as W}from"./useIntersectionObserver-2PEjywgc.js";import{a as Z,P as J,b as V}from"./PaperDateFilter-C9tnni-Y.js";import{A as X,a as Y}from"./alert-BQ0_qoe3.js";import{S as z}from"./searchable-select-C6kGq-Ns.js";import{S as $}from"./skeleton-B_RgoAAL.js";import{e as ee}from"./usePapers-CD7ebaIw.js";import{c as D}from"./catalog-BRjI2ow6.js";import{d as R,t as se}from"./transform-CArGBSok.js";import ae from"./NotFound-rCpMdseu.js";const re=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],te=n=>n==="date_published"||n==="citation_count"?n:"trending",je=({organizationSlug:n,taskSlug:p})=>{var y,P,v,F,L,k,w,O;const T=E(),[o,h]=Q(),[I,u]=d.useState(!1),g=te(o.get("order_by")),f=o.get("has_code")==="true",_=o.get("has_hf_artifacts")==="true",m=Z(o),x=C({queryKey:["organization",n],queryFn:()=>D.getOrganization(n),staleTime:10*60*1e3}),c=C({queryKey:["organization-areas-with-tasks",n],queryFn:()=>D.organizationAreasWithTasks(n),staleTime:10*60*1e3}),i=ee({organizationSlug:n,taskSlug:p,page_size:12,order_by:g,order_dir:"desc",include_resources:!0,has_code:f,has_hf_artifacts:_,start_date:m.startDate,end_date:m.endDate,enabled:!!n}),{targetRef:M,isIntersecting:j}=K({rootMargin:"200px"});d.useEffect(()=>{j&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[j,i.hasNextPage,i.isFetchingNextPage]),d.useEffect(()=>{u(!1)},[n,p]);const b=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:R(t.name,t.slug)})))},[c.data]),l=b.find(a=>a.slug===p),N=d.useMemo(()=>{var a;return(((a=i.data)==null?void 0:a.pages)??[]).flatMap(r=>r.results.map(se))},[i.data]),s=x.data??((y=c.data)==null?void 0:y.organization),H=((v=(P=i.data)==null?void 0:P.pages[0])==null?void 0:v.count)??0;if(((F=x.error)==null?void 0:F.status)===404||((L=c.error)==null?void 0:L.status)===404||((k=i.error)==null?void 0:k.status)===404)return e.jsx(ae,{});if(c.error||i.error)return e.jsx("div",{className:"page",children:e.jsx(X,{variant:"destructive",children:e.jsx(Y,{children:"Failed to load organization papers. Please try again."})})});const q=a=>{const r=a.trim().toLocaleLowerCase();return b.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=o.toString();T({pathname:r,search:t?`?${t}`:""})};return e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(A,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(A,{to:"/organizations",children:"Organizations"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:(s==null?void 0:s.name)??n}),l&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:" / "}),e.jsx("span",{children:R(l.name,l.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&&!I?e.jsx("img",{src:s.logo_url,alt:"",width:58,height:58,onError:()=>u(!0)}):s?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:s.name.slice(0,1).toUpperCase()}):null,(s==null?void 0:s.name)??e.jsx($,{className:"h-12 w-64"})]}),s&&e.jsxs("div",{className:"feed-subtitle",children:[((w=s.paper_count)==null?void 0:w.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 ↗"})]})]}),e.jsx(G,{organizationSlug:n,organizationName:(s==null?void 0:s.name)??n})]}),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:l?{value:l.slug,label:l.label,description:`${l.paper_count.toLocaleString()} ${l.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:re.map(([a,r])=>e.jsx("button",{type:"button",className:`sort-btn ${g===a?"active":""}`,onClick:()=>{const t=new URLSearchParams(o);a==="trending"?t.delete("order_by"):t.set("order_by",a),h(t)},children:r},a))}),e.jsx(W,{hasCode:f,hasHfArtifacts:_,onHasCodeChange:a=>{const r=new URLSearchParams(o);a?r.set("has_code","true"):r.delete("has_code"),h(r)},onHasHfArtifactsChange:a=>{const r=new URLSearchParams(o);a?r.set("has_hf_artifacts","true"):r.delete("has_hf_artifacts"),h(r)}})]}),e.jsx(J,{startDate:m.startDate,endDate:m.endDate,onChange:a=>h(V(o,a))}),e.jsxs("div",{className:"results-count",children:[H.toLocaleString()," papers"]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,r)=>e.jsx($,{className:"h-40 w-full"},r))}):N.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:N.map((a,r)=>e.jsx(U,{paper:a,rank:r+1,showInstitution:!1},a.id))}),e.jsx("div",{ref:M,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center"},children:"Loading more…"})]})]})};export{je as O};
assets/OrganizationTaskView-JLwOy4rM.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{u as i,j as t}from"./index-CxdnHo9-.js";import{O as m}from"./OrganizationPaperFeed-Doln-moa.js";import p from"./NotFound-rCpMdseu.js";import"./useQuery-D8Q6gREv.js";import"./components-BH6Cy8IX.js";import"./paperQueryKeys-CcqbH5YG.js";import"./LatexTitle-ih-jCKpS.js";import"./katex.min-BSBacQyE.js";import"./transform-CArGBSok.js";import"./papers-BwPS4QGO.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-kHUUjGAC.js";import"./PaperPreviewLink-CUTHdATo.js";import"./index-DFKsmHrq.js";import"./index-B42pNGT3.js";import"./hover-card-CdRF8g76.js";import"./useMutation-Be3gnlrL.js";import"./OrganizationContributionGraph-MP2Tw68V.js";import"./skeleton-B_RgoAAL.js";import"./catalog-BRjI2ow6.js";import"./useIntersectionObserver-2PEjywgc.js";import"./PaperDateFilter-C9tnni-Y.js";import"./popover-DEMAeJxN.js";import"./alert-BQ0_qoe3.js";import"./searchable-select-C6kGq-Ns.js";import"./button-CdSuwKQi.js";import"./dialog-CPQIZl1d.js";import"./loader-circle-C8HknmII.js";import"./usePapers-CD7ebaIw.js";import"./useInfiniteQuery-BUi2pe7X.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-NJtPaCq0.js DELETED
@@ -1 +0,0 @@
1
- import{u as i,j as t}from"./index-DVQGVzHu.js";import{O as m}from"./OrganizationPaperFeed-DL99kimS.js";import p from"./NotFound-Db8yITOG.js";import"./useQuery-tFDel9EL.js";import"./components-_zRgatMC.js";import"./LatexTitle-B0TwWoUu.js";import"./katex.min-BSBacQyE.js";import"./transform-PseCN9bN.js";import"./papers-DlaCqfyl.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-D9cBh-rH.js";import"./PaperPreviewLink-CpVn6ETd.js";import"./index-VSogvUtt.js";import"./index-B-ULOvtV.js";import"./hover-card-B-kPWoKE.js";import"./useMutation-Doe-Qh76.js";import"./OrganizationContributionGraph-D1VOwcUX.js";import"./skeleton-DJUh-5VW.js";import"./catalog-Da4k4qEI.js";import"./useIntersectionObserver-IRMyVQkj.js";import"./PaperDateFilter-BH56Is-x.js";import"./popover-Beg3zsfL.js";import"./alert-7mO5HIuQ.js";import"./searchable-select-DCJ2FvKo.js";import"./button-CV3EZ-wD.js";import"./dialog-8H_bvgui.js";import"./loader-circle-PqpEC1ka.js";import"./usePapers-a_mp-Uw3.js";import"./useInfiniteQuery-CYdxlDgS.js";const A=()=>{const{orgSlug:o,taskSlug:r}=i();return o&&r?t.jsx(m,{organizationSlug:o,taskSlug:r}):t.jsx(p,{})};export{A as default};
 
 
assets/{OrganizationsIndexView-CM8wCqcx.js → OrganizationsIndexView-CSY2JM5r.js} RENAMED
@@ -1 +1 @@
1
- import{c as u,r as g,j as e,L as x}from"./index-DVQGVzHu.js";import{u as j}from"./useQuery-tFDel9EL.js";import{A as y,a as f}from"./alert-7mO5HIuQ.js";import{S as _}from"./skeleton-DJUh-5VW.js";import{c as N}from"./catalog-Da4k4qEI.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.organizationIndex(),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 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};
 
1
+ import{c as u,r as g,j as e,L as x}from"./index-CxdnHo9-.js";import{u as j}from"./useQuery-D8Q6gREv.js";import{A as y,a as f}from"./alert-BQ0_qoe3.js";import{S as _}from"./skeleton-B_RgoAAL.js";import{c as N}from"./catalog-BRjI2ow6.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.organizationIndex(),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 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/{PaperDateFilter-BH56Is-x.js → PaperDateFilter-C9tnni-Y.js} RENAMED
@@ -1 +1 @@
1
- import{r as p,j as n}from"./index-DVQGVzHu.js";import{P as q,a as G,b as Q}from"./popover-Beg3zsfL.js";const E=(e,t)=>{const a=new Date(t),s=new Date(a);return s.setUTCDate(a.getUTCDate()-(e==="week"?6:29)),{startDate:s.toISOString().slice(0,10),endDate:a.toISOString().slice(0,10)}},z=e=>({startDate:e.get("start_date")||void 0,endDate:e.get("end_date")||void 0}),oe=(e,t=new Date)=>{const a=z(e);if(a.startDate||a.endDate||e.get("time")==="all_time")return a;const s=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()));return E("week",s)},J=(e,t)=>{const a=new URLSearchParams(e);return t.startDate?a.set("start_date",t.startDate):a.delete("start_date"),t.endDate?a.set("end_date",t.endDate):a.delete("end_date"),a.delete("time"),a},ie=(e,t)=>{const a=J(e,t);return!t.startDate&&!t.endDate&&a.set("time","all_time"),a},K=new Intl.DateTimeFormat("en",{month:"long",year:"numeric",timeZone:"UTC"}),O=new Intl.DateTimeFormat("en",{month:"short",timeZone:"UTC"}),L="(max-width: 640px)",X=()=>{const[e,t]=p.useState(()=>typeof window<"u"&&window.matchMedia(L).matches);return p.useEffect(()=>{const a=window.matchMedia(L),s=l=>t(l.matches);return t(a.matches),a.addEventListener("change",s),()=>a.removeEventListener("change",s)},[]),e},V=e=>e.toISOString().slice(0,10),b=e=>new Date(`${e}T00:00:00Z`),ee=()=>{const e=new Date;return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))},R=(e,t)=>new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+t,1)),M=e=>new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),1)),te=(e,t)=>new Date(Date.UTC(t,e.getUTCMonth(),1)),w=(e,t)=>e.startDate===t.startDate&&e.endDate===t.endDate,ae=(e,t)=>{const a=b(e),s=b(t),l=O.format(a),c=O.format(s),g=a.getUTCDate(),d=s.getUTCDate(),o=a.getUTCFullYear(),u=s.getUTCFullYear();return e===t?`${l} ${g}, ${o}`:o===u&&a.getUTCMonth()===s.getUTCMonth()?`${l} ${g}–${d}, ${o}`:o===u?`${l} ${g}–${c} ${d}, ${o}`:`${l} ${g}, ${o}–${c} ${d}, ${u}`},ne=e=>{const t=e.getUTCFullYear(),a=e.getUTCMonth(),s=new Date(Date.UTC(t,a,1)),l=(s.getUTCDay()+6)%7,c=new Date(s);return c.setUTCDate(s.getUTCDate()-l),Array.from({length:42},(g,d)=>{const o=new Date(c);return o.setUTCDate(c.getUTCDate()+d),{iso:V(o),day:o.getUTCDate(),outsideMonth:o.getUTCMonth()!==a}})},A=({month:e,today:t,startDate:a,endDate:s,onSelect:l,yearLabel:c,yearValue:g,onYearChange:d,secondary:o=!1})=>{const u=p.useMemo(()=>ne(e),[e]);return n.jsxs("section",{className:`paper-date-calendar${o?" paper-date-calendar-secondary":""}`,children:[n.jsxs("label",{className:"paper-date-year",children:[n.jsx("span",{children:c}),n.jsx("input",{type:"number",inputMode:"numeric",min:"1900",max:t.slice(0,4),step:"1",value:g,onChange:r=>d(r.target.value)})]}),n.jsx("h3",{children:K.format(e)}),n.jsx("div",{className:"paper-date-weekdays","aria-hidden":"true",children:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"].map(r=>n.jsx("span",{children:r},r))}),n.jsx("div",{className:"paper-date-days",children:u.map(r=>{const h=r.iso===a||r.iso===s,T=!!(a&&s&&r.iso>a&&r.iso<s),m=r.outsideMonth||r.iso>t;return n.jsx("button",{type:"button","aria-label":r.iso,"aria-selected":h,disabled:m,className:["paper-date-day",r.outsideMonth?"outside":"",h?"selected":"",T?"in-range":"",r.iso===t?"today":""].filter(Boolean).join(" "),onClick:()=>l(r.iso),children:r.day},r.iso)})})]})},I=({calendar:e,onPrevious:t,onNext:a,secondary:s=!1})=>n.jsxs("div",{className:`paper-date-navigation-group${s?" paper-date-navigation-group-secondary":""}`,children:[n.jsx("button",{type:"button","aria-label":`Previous ${e} month`,onClick:t,children:"←"}),n.jsx("button",{type:"button","aria-label":`Next ${e} month`,onClick:a,children:"→"})]}),ce=({startDate:e,endDate:t,onChange:a,currentDate:s})=>{const l=X(),c=s?b(s):ee(),[g,d]=p.useState(!1),[o,u]=p.useState(),[r,h]=p.useState(),[T,m]=p.useState(()=>M(c)),[$,D]=p.useState(()=>R(M(c),1)),[H,y]=p.useState(()=>String(c.getUTCFullYear())),[B,U]=p.useState(()=>String(c.getUTCFullYear())),f={startDate:e,endDate:t},N=E("week",c),Y=E("month",c),P=V(c),v=!!(e&&t&&!w(f,N)&&!w(f,Y)),Z=()=>{u(e),h(t);const i=M(e?b(e):c),C=M(t?b(t):R(i,1));m(i),D(C),y(String(i.getUTCFullYear())),U(String(C.getUTCFullYear())),d(!0)},k=(i,C,F)=>{if(C(i),!/^\d{4}$/.test(i))return;const x=Number(i);x>=1900&&x<=c.getUTCFullYear()&&F(j=>te(j,x))},S=(i,C,F,x)=>{const j=R(i,C);F(j),x(String(j.getUTCFullYear()))},_=i=>{!o||r?(u(i),h(void 0)):i<o?u(i):h(i)},W=()=>{a({}),d(!1)};return n.jsxs("div",{className:`paper-date-filter${l?" paper-date-filter-single-calendar":""}`,role:"group","aria-label":"Publication date",children:[n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${w(f,N)?" active":""}`,onClick:()=>a(N),children:"Last Week"}),n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${w(f,Y)?" active":""}`,onClick:()=>a(Y),children:"Last Month"}),n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${!e&&!t?" active":""}`,onClick:()=>a({}),children:"All Time"}),n.jsxs(q,{open:g,onOpenChange:i=>{i?Z():d(!1)},children:[n.jsx(G,{asChild:!0,children:n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${v?" active":""}`,"aria-label":v?"Change date range":"Select a range",children:v&&e&&t?ae(e,t):"Select a range"})}),n.jsxs(Q,{align:"end",className:`paper-date-popover${l?" paper-date-popover-single-calendar":""}`,role:"dialog","aria-label":"Select a date range",children:[n.jsxs("div",{className:"paper-date-popover-header",children:[n.jsx("h2",{children:"Select a date range"}),n.jsx("p",{children:"Choose an inclusive start and end publication date."})]}),n.jsxs("div",{className:"paper-date-navigation",children:[n.jsx(I,{calendar:"start",onPrevious:()=>S(T,-1,m,y),onNext:()=>S(T,1,m,y)}),!l&&n.jsx(I,{calendar:"end",onPrevious:()=>S($,-1,D,U),onNext:()=>S($,1,D,U),secondary:!0})]}),n.jsxs("div",{className:"paper-date-calendars",children:[n.jsx(A,{month:T,today:P,startDate:o,endDate:r,onSelect:_,yearLabel:l?"Year":"Start year",yearValue:H,onYearChange:i=>k(i,y,m)}),!l&&n.jsx(A,{month:$,today:P,startDate:o,endDate:r,onSelect:_,yearLabel:"End year",yearValue:B,onYearChange:i=>k(i,U,D),secondary:!0})]}),n.jsxs("div",{className:"paper-date-actions",children:[n.jsx("button",{type:"button",className:"paper-date-clear",onClick:W,children:"Clear range"}),n.jsxs("div",{children:[n.jsx("button",{type:"button",onClick:()=>d(!1),children:"Cancel"}),n.jsx("button",{type:"button",className:"paper-date-apply",disabled:!o||!r,onClick:()=>{o&&r&&a({startDate:o,endDate:r}),d(!1)},children:"Apply"})]})]})]})]})]})};export{ce as P,z as a,J as b,oe as r,ie as w};
 
1
+ import{r as p,j as n}from"./index-CxdnHo9-.js";import{P as q,a as G,b as Q}from"./popover-DEMAeJxN.js";const E=(e,t)=>{const a=new Date(t),s=new Date(a);return s.setUTCDate(a.getUTCDate()-(e==="week"?6:29)),{startDate:s.toISOString().slice(0,10),endDate:a.toISOString().slice(0,10)}},z=e=>({startDate:e.get("start_date")||void 0,endDate:e.get("end_date")||void 0}),oe=(e,t=new Date)=>{const a=z(e);if(a.startDate||a.endDate||e.get("time")==="all_time")return a;const s=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()));return E("week",s)},J=(e,t)=>{const a=new URLSearchParams(e);return t.startDate?a.set("start_date",t.startDate):a.delete("start_date"),t.endDate?a.set("end_date",t.endDate):a.delete("end_date"),a.delete("time"),a},ie=(e,t)=>{const a=J(e,t);return!t.startDate&&!t.endDate&&a.set("time","all_time"),a},K=new Intl.DateTimeFormat("en",{month:"long",year:"numeric",timeZone:"UTC"}),O=new Intl.DateTimeFormat("en",{month:"short",timeZone:"UTC"}),L="(max-width: 640px)",X=()=>{const[e,t]=p.useState(()=>typeof window<"u"&&window.matchMedia(L).matches);return p.useEffect(()=>{const a=window.matchMedia(L),s=l=>t(l.matches);return t(a.matches),a.addEventListener("change",s),()=>a.removeEventListener("change",s)},[]),e},V=e=>e.toISOString().slice(0,10),b=e=>new Date(`${e}T00:00:00Z`),ee=()=>{const e=new Date;return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))},R=(e,t)=>new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+t,1)),M=e=>new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),1)),te=(e,t)=>new Date(Date.UTC(t,e.getUTCMonth(),1)),w=(e,t)=>e.startDate===t.startDate&&e.endDate===t.endDate,ae=(e,t)=>{const a=b(e),s=b(t),l=O.format(a),c=O.format(s),g=a.getUTCDate(),d=s.getUTCDate(),o=a.getUTCFullYear(),u=s.getUTCFullYear();return e===t?`${l} ${g}, ${o}`:o===u&&a.getUTCMonth()===s.getUTCMonth()?`${l} ${g}–${d}, ${o}`:o===u?`${l} ${g}–${c} ${d}, ${o}`:`${l} ${g}, ${o}–${c} ${d}, ${u}`},ne=e=>{const t=e.getUTCFullYear(),a=e.getUTCMonth(),s=new Date(Date.UTC(t,a,1)),l=(s.getUTCDay()+6)%7,c=new Date(s);return c.setUTCDate(s.getUTCDate()-l),Array.from({length:42},(g,d)=>{const o=new Date(c);return o.setUTCDate(c.getUTCDate()+d),{iso:V(o),day:o.getUTCDate(),outsideMonth:o.getUTCMonth()!==a}})},A=({month:e,today:t,startDate:a,endDate:s,onSelect:l,yearLabel:c,yearValue:g,onYearChange:d,secondary:o=!1})=>{const u=p.useMemo(()=>ne(e),[e]);return n.jsxs("section",{className:`paper-date-calendar${o?" paper-date-calendar-secondary":""}`,children:[n.jsxs("label",{className:"paper-date-year",children:[n.jsx("span",{children:c}),n.jsx("input",{type:"number",inputMode:"numeric",min:"1900",max:t.slice(0,4),step:"1",value:g,onChange:r=>d(r.target.value)})]}),n.jsx("h3",{children:K.format(e)}),n.jsx("div",{className:"paper-date-weekdays","aria-hidden":"true",children:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"].map(r=>n.jsx("span",{children:r},r))}),n.jsx("div",{className:"paper-date-days",children:u.map(r=>{const h=r.iso===a||r.iso===s,T=!!(a&&s&&r.iso>a&&r.iso<s),m=r.outsideMonth||r.iso>t;return n.jsx("button",{type:"button","aria-label":r.iso,"aria-selected":h,disabled:m,className:["paper-date-day",r.outsideMonth?"outside":"",h?"selected":"",T?"in-range":"",r.iso===t?"today":""].filter(Boolean).join(" "),onClick:()=>l(r.iso),children:r.day},r.iso)})})]})},I=({calendar:e,onPrevious:t,onNext:a,secondary:s=!1})=>n.jsxs("div",{className:`paper-date-navigation-group${s?" paper-date-navigation-group-secondary":""}`,children:[n.jsx("button",{type:"button","aria-label":`Previous ${e} month`,onClick:t,children:"←"}),n.jsx("button",{type:"button","aria-label":`Next ${e} month`,onClick:a,children:"→"})]}),ce=({startDate:e,endDate:t,onChange:a,currentDate:s})=>{const l=X(),c=s?b(s):ee(),[g,d]=p.useState(!1),[o,u]=p.useState(),[r,h]=p.useState(),[T,m]=p.useState(()=>M(c)),[$,D]=p.useState(()=>R(M(c),1)),[H,y]=p.useState(()=>String(c.getUTCFullYear())),[B,U]=p.useState(()=>String(c.getUTCFullYear())),f={startDate:e,endDate:t},N=E("week",c),Y=E("month",c),P=V(c),v=!!(e&&t&&!w(f,N)&&!w(f,Y)),Z=()=>{u(e),h(t);const i=M(e?b(e):c),C=M(t?b(t):R(i,1));m(i),D(C),y(String(i.getUTCFullYear())),U(String(C.getUTCFullYear())),d(!0)},k=(i,C,F)=>{if(C(i),!/^\d{4}$/.test(i))return;const x=Number(i);x>=1900&&x<=c.getUTCFullYear()&&F(j=>te(j,x))},S=(i,C,F,x)=>{const j=R(i,C);F(j),x(String(j.getUTCFullYear()))},_=i=>{!o||r?(u(i),h(void 0)):i<o?u(i):h(i)},W=()=>{a({}),d(!1)};return n.jsxs("div",{className:`paper-date-filter${l?" paper-date-filter-single-calendar":""}`,role:"group","aria-label":"Publication date",children:[n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${w(f,N)?" active":""}`,onClick:()=>a(N),children:"Last Week"}),n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${w(f,Y)?" active":""}`,onClick:()=>a(Y),children:"Last Month"}),n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${!e&&!t?" active":""}`,onClick:()=>a({}),children:"All Time"}),n.jsxs(q,{open:g,onOpenChange:i=>{i?Z():d(!1)},children:[n.jsx(G,{asChild:!0,children:n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${v?" active":""}`,"aria-label":v?"Change date range":"Select a range",children:v&&e&&t?ae(e,t):"Select a range"})}),n.jsxs(Q,{align:"end",className:`paper-date-popover${l?" paper-date-popover-single-calendar":""}`,role:"dialog","aria-label":"Select a date range",children:[n.jsxs("div",{className:"paper-date-popover-header",children:[n.jsx("h2",{children:"Select a date range"}),n.jsx("p",{children:"Choose an inclusive start and end publication date."})]}),n.jsxs("div",{className:"paper-date-navigation",children:[n.jsx(I,{calendar:"start",onPrevious:()=>S(T,-1,m,y),onNext:()=>S(T,1,m,y)}),!l&&n.jsx(I,{calendar:"end",onPrevious:()=>S($,-1,D,U),onNext:()=>S($,1,D,U),secondary:!0})]}),n.jsxs("div",{className:"paper-date-calendars",children:[n.jsx(A,{month:T,today:P,startDate:o,endDate:r,onSelect:_,yearLabel:l?"Year":"Start year",yearValue:H,onYearChange:i=>k(i,y,m)}),!l&&n.jsx(A,{month:$,today:P,startDate:o,endDate:r,onSelect:_,yearLabel:"End year",yearValue:B,onYearChange:i=>k(i,U,D),secondary:!0})]}),n.jsxs("div",{className:"paper-date-actions",children:[n.jsx("button",{type:"button",className:"paper-date-clear",onClick:W,children:"Clear range"}),n.jsxs("div",{children:[n.jsx("button",{type:"button",onClick:()=>d(!1),children:"Cancel"}),n.jsx("button",{type:"button",className:"paper-date-apply",disabled:!o||!r,onClick:()=>{o&&r&&a({startDate:o,endDate:r}),d(!1)},children:"Apply"})]})]})]})]})]})};export{ce as P,z as a,J as b,oe as r,ie as w};
assets/PaperDetailView-BezkIl6P.js DELETED
The diff for this file is too large to render. See raw diff
 
assets/PaperDetailView-D1Y8eh6A.js ADDED
The diff for this file is too large to render. See raw diff
 
assets/{PaperPreviewLink-CpVn6ETd.js → PaperPreviewLink-CUTHdATo.js} RENAMED
@@ -1,7 +1,7 @@
1
- import{o as k,f as F,m as b,a as oe,p as z,b as L,n as O,h as le,s as ce,c as ue,v as he,S as pe}from"./index-VSogvUtt.js";import{l as me}from"./index-B-ULOvtV.js";import{k as D}from"./katex.min-BSBacQyE.js";import{j as m,z as M,N as fe,n as j,ah as de,h as ge,L as E,A as xe}from"./index-DVQGVzHu.js";import{u as ye}from"./useQuery-tFDel9EL.js";import{H as we,a as be,b as Ne}from"./hover-card-B-kPWoKE.js";import{p as P}from"./papers-DlaCqfyl.js";import{u as ve}from"./useMutation-Doe-Qh76.js";function ke(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:s},exit:{mathFlow:i,mathFlowFence:n,mathFlowFenceMeta:r,mathFlowValue:l,mathText:o,mathTextData:l}};function e(a){const c={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[c]}},a)}function t(){this.buffer()}function r(){const a=this.resume(),c=this.stack[this.stack.length-1];k(c.type==="math"),c.meta=a}function n(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(a){const c=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),h=this.stack[this.stack.length-1];k(h.type==="math"),this.exit(a),h.value=c;const f=h.data.hChildren[0];k(f.type==="element"),k(f.tagName==="code"),f.children.push({type:"text",value:c}),this.data.mathFlowInside=void 0}function s(a){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},a),this.buffer()}function o(a){const c=this.resume(),h=this.stack[this.stack.length-1];k(h.type==="inlineMath"),this.exit(a),h.value=c,h.data.hChildren.push({type:"text",value:c})}function l(a){this.config.enter.data.call(this,a),this.config.exit.data.call(this,a)}}function Fe(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),n.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:r,inlineMath:n}};function r(s,o,l,a){const c=s.value||"",h=l.createTracker(a),f="$".repeat(Math.max(me(c,"$")+1,2)),g=l.enter("mathFlow");let x=h.move(f);if(s.meta){const d=l.enter("mathFlowMeta");x+=h.move(l.safe(s.meta,{after:`
3
  `,before:x,encode:["$"],...h.current()})),d()}return x+=h.move(`
4
  `),c&&(x+=h.move(c+`
5
- `)),x+=h.move(f),g(),x}function n(s,o,l){let a=s.value||"",c=1;for(t||c++;new RegExp("(^|[^$])"+"\\$".repeat(c)+"([^$]|$)").test(a);)c++;const h="$".repeat(c);/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^\$|\$$/.test(a))&&(a=" "+a+" ");let f=-1;for(;++f<l.unsafe.length;){const g=l.unsafe[f];if(!g.atBreak)continue;const x=l.compilePattern(g);let d;for(;d=x.exec(a);){let p=d.index;a.codePointAt(p)===10&&a.codePointAt(p-1)===13&&p--,a=a.slice(0,p)+" "+a.slice(d.index+1)}}return h+a+h}function i(){return"$"}}const je={tokenize:Ce,concrete:!0,name:"mathFlow"},R={tokenize:Te,partial:!0};function Ce(e,t,r){const n=this,i=n.events[n.events.length-1],s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0;let o=0;return l;function l(u){return e.enter("mathFlow"),e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),a(u)}function a(u){return u===36?(e.consume(u),o++,a):o<2?r(u):(e.exit("mathFlowFenceSequence"),F(e,c,"whitespace")(u))}function c(u){return u===null||b(u)?f(u):(e.enter("mathFlowFenceMeta"),e.enter("chunkString",{contentType:"string"}),h(u))}function h(u){return u===null||b(u)?(e.exit("chunkString"),e.exit("mathFlowFenceMeta"),f(u)):u===36?r(u):(e.consume(u),h)}function f(u){return e.exit("mathFlowFence"),n.interrupt?t(u):e.attempt(R,g,w)(u)}function g(u){return e.attempt({tokenize:v,partial:!0},w,x)(u)}function x(u){return(s?F(e,d,"linePrefix",s+1):d)(u)}function d(u){return u===null?w(u):b(u)?e.attempt(R,g,w)(u):(e.enter("mathFlowValue"),p(u))}function p(u){return u===null||b(u)?(e.exit("mathFlowValue"),d(u)):(e.consume(u),p)}function w(u){return e.exit("mathFlow"),t(u)}function v(u,ie,q){let _=0;return F(u,ae,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function ae(y){return u.enter("mathFlowFence"),u.enter("mathFlowFenceSequence"),$(y)}function $(y){return y===36?(_++,u.consume(y),$):_<o?q(y):(u.exit("mathFlowFenceSequence"),F(u,se,"whitespace")(y))}function se(y){return y===null||b(y)?(u.exit("mathFlowFence"),ie(y)):q(y)}}}function Te(e,t,r){const n=this;return i;function i(o){return o===null?t(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return n.parser.lazy[n.now().line]?r(o):t(o)}}function Me(e){let r=(e||{}).singleDollarTextMath;return r==null&&(r=!0),{tokenize:n,resolve:Ee,previous:Ae,name:"mathText"};function n(i,s,o){let l=0,a,c;return h;function h(p){return i.enter("mathText"),i.enter("mathTextSequence"),f(p)}function f(p){return p===36?(i.consume(p),l++,f):l<2&&!r?o(p):(i.exit("mathTextSequence"),g(p))}function g(p){return p===null?o(p):p===36?(c=i.enter("mathTextSequence"),a=0,d(p)):p===32?(i.enter("space"),i.consume(p),i.exit("space"),g):b(p)?(i.enter("lineEnding"),i.consume(p),i.exit("lineEnding"),g):(i.enter("mathTextData"),x(p))}function x(p){return p===null||p===32||p===36||b(p)?(i.exit("mathTextData"),g(p)):(i.consume(p),x)}function d(p){return p===36?(i.consume(p),a++,d):a===l?(i.exit("mathTextSequence"),i.exit("mathText"),s(p)):(c.type="mathTextData",x(p))}}}function Ee(e){let t=e.length-4,r=3,n,i;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(n=r;++n<t;)if(e[n][1].type==="mathTextData"){e[t][1].type="mathTextPadding",e[r][1].type="mathTextPadding",r+=2,t-=2;break}}for(n=r-1,t++;++n<=t;)i===void 0?n!==t&&e[n][1].type!=="lineEnding"&&(i=n):(n===t||e[n][1].type==="lineEnding")&&(e[i][1].type="mathTextData",n!==i+2&&(e[i][1].end=e[n-1][1].end,e.splice(i+2,n-i-2),t-=n-i-2,n=i+2),i=void 0);return e}function Ae(e){return e!==36||this.events[this.events.length-1][1].type==="characterEscape"}function Se(e){return{flow:{36:je},text:{36:Me(e)}}}const Pe={};function Mt(e){const t=this,r=e||Pe,n=t.data(),i=n.micromarkExtensions||(n.micromarkExtensions=[]),s=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),o=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);i.push(Se(r)),s.push(ke()),o.push(Fe(r))}const B=/[#.]/g;function Ie(e,t){const r=e||"",n={};let i=0,s,o;for(;i<r.length;){B.lastIndex=i;const l=B.exec(r),a=r.slice(i,l?l.index:r.length);a&&(s?s==="#"?n.id=a:Array.isArray(n.className)?n.className.push(a):n.className=[a]:o=a,i+=a.length),l&&(s=l[0],i++)}return{type:"element",tagName:o||t||"div",properties:n,children:[]}}function Y(e,t,r){const n=r?ze(r):void 0;function i(s,o,...l){let a;if(s==null){a={type:"root",children:[]};const c=o;l.unshift(c)}else{a=Ie(s,t);const c=a.tagName.toLowerCase(),h=n?n.get(c):void 0;if(a.tagName=h||c,qe(o))l.unshift(o);else for(const[f,g]of Object.entries(o))_e(e,a.properties,f,g)}for(const c of l)A(a.children,c);return a.type==="element"&&a.tagName==="template"&&(a.content={type:"root",children:a.children},a.children=[]),a}return i}function qe(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,r=Object.keys(e);for(const n of r){const i=t[n];if(i&&typeof i=="object"){if(!Array.isArray(i))return!0;const s=i;for(const o of s)if(typeof o!="number"&&typeof o!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function _e(e,t,r,n){const i=oe(e,r);let s;if(n!=null){if(typeof n=="number"){if(Number.isNaN(n))return;s=n}else typeof n=="boolean"?s=n:typeof n=="string"?i.spaceSeparated?s=z(n):i.commaSeparated?s=L(n):i.commaOrSpaceSeparated?s=z(L(n).join(" ")):s=U(i,i.property,n):Array.isArray(n)?s=[...n]:s=i.property==="style"?$e(n):String(n);if(Array.isArray(s)){const o=[];for(const l of s)o.push(U(i,i.property,l));s=o}i.property==="className"&&Array.isArray(t.className)&&(s=t.className.concat(s)),t[i.property]=s}}function A(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const r of t)A(e,r);else if(typeof t=="object"&&"type"in t)t.type==="root"?A(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function U(e,t,r){if(typeof r=="string"){if(e.number&&r&&!Number.isNaN(Number(r)))return Number(r);if((e.boolean||e.overloadedBoolean)&&(r===""||O(r)===O(t)))return!0}return r}function $e(e){const t=[];for(const[r,n]of Object.entries(e))t.push([r,n].join(": "));return t.join("; ")}function ze(e){const t=new Map;for(const r of e)t.set(r.toLowerCase(),r);return t}const Le=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],Oe=Y(le,"div"),De=Y(ce,"g",Le),T={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function Re(e,t){return Z(e,{})||{type:"root",children:[]}}function Z(e,t){const r=Be(e,t);return r&&t.afterTransform&&t.afterTransform(e,r),r}function Be(e,t){switch(e.nodeType){case 1:return Ge(e,t);case 3:return He(e);case 8:return Ve(e);case 9:return H(e,t);case 10:return Ue();case 11:return H(e,t);default:return}}function H(e,t){return{type:"root",children:J(e,t)}}function Ue(){return{type:"doctype"}}function He(e){return{type:"text",value:e.nodeValue||""}}function Ve(e){return{type:"comment",value:e.nodeValue||""}}function Ge(e,t){const r=e.namespaceURI,n=r===T.svg?De:Oe,i=r===T.html?e.tagName.toLowerCase():e.tagName,s=r===T.html&&i==="template"?e.content:e,o=e.getAttributeNames(),l={};let a=-1;for(;++a<o.length;)l[o[a]]=e.getAttribute(o[a])||"";return n(i,l,J(s,t))}function J(e,t){const r=e.childNodes,n=[];let i=-1;for(;++i<r.length;){const s=Z(r[i],t);s!==void 0&&n.push(s)}return n}new DOMParser;function Ke(e,t){const r=Qe(e);return Re(r)}function Qe(e){const t=document.createElement("template");return t.innerHTML=e,t.content}const V=function(e,t,r){const n=ue(r);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(n(e.children[t],t,e))return e.children[t]},N=function(e){if(e==null)return Ye;if(typeof e=="string")return We(e);if(typeof e=="object")return Xe(e);if(typeof e=="function")return I(e);throw new Error("Expected function, string, or array as `test`")};function Xe(e){const t=[];let r=-1;for(;++r<e.length;)t[r]=N(e[r]);return I(n);function n(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function We(e){return I(t);function t(r){return r.tagName===e}}function I(e){return t;function t(r,n,i){return!!(Ze(r)&&e.call(this,r,typeof n=="number"?n:void 0,i||void 0))}}function Ye(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function Ze(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const G=/\n/g,K=/[\t ]+/g,S=N("br"),Q=N(st),Je=N("p"),X=N("tr"),et=N(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",at,ot]),ee=N(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function tt(e,t){const r=t||{},n="children"in e?e.children:[],i=ee(e),s=re(e,{whitespace:r.whitespace||"normal"}),o=[];(e.type==="text"||e.type==="comment")&&o.push(...ne(e,{breakBefore:!0,breakAfter:!0}));let l=-1;for(;++l<n.length;)o.push(...te(n[l],e,{whitespace:s,breakBefore:l?void 0:i,breakAfter:l<n.length-1?S(n[l+1]):i}));const a=[];let c;for(l=-1;++l<o.length;){const h=o[l];typeof h=="number"?c!==void 0&&h>c&&(c=h):h&&(c!==void 0&&c>-1&&a.push(`
6
- `.repeat(c)||" "),c=-1,a.push(h))}return a.join("")}function te(e,t,r){return e.type==="element"?nt(e,t,r):e.type==="text"?r.whitespace==="normal"?ne(e,r):rt(e):[]}function nt(e,t,r){const n=re(e,r),i=e.children||[];let s=-1,o=[];if(et(e))return o;let l,a;for(S(e)||X(e)&&V(t,e,X)?a=`
7
- `:Je(e)?(l=2,a=2):ee(e)&&(l=1,a=1);++s<i.length;)o=o.concat(te(i[s],e,{whitespace:n,breakBefore:s?void 0:l,breakAfter:s<i.length-1?S(i[s+1]):a}));return Q(e)&&V(t,e,Q)&&o.push(" "),l&&o.unshift(l),a&&o.push(a),o}function ne(e,t){const r=String(e.value),n=[],i=[];let s=0;for(;s<=r.length;){G.lastIndex=s;const a=G.exec(r),c=a&&"index"in a?a.index:r.length;n.push(it(r.slice(s,c).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),s===0?t.breakBefore:!0,c===r.length?t.breakAfter:!0)),s=c+1}let o=-1,l;for(;++o<n.length;)n[o].charCodeAt(n[o].length-1)===8203||o<n.length-1&&n[o+1].charCodeAt(0)===8203?(i.push(n[o]),l=void 0):n[o]?(typeof l=="number"&&i.push(l),i.push(n[o]),l=0):(o===0||o===n.length-1)&&i.push(0);return i}function rt(e){return[String(e.value)]}function it(e,t,r){const n=[];let i=0,s;for(;i<e.length;){K.lastIndex=i;const o=K.exec(e);s=o?o.index:e.length,!i&&!s&&o&&!t&&n.push(""),i!==s&&n.push(e.slice(i,s)),i=o?s+o[0].length:s}return i!==s&&!r&&n.push(""),n.join(" ")}function re(e,t){if(e.type==="element"){const r=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return r.wrap?"pre-wrap":"pre";case"td":case"th":return r.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function at(e){return!!(e.properties||{}).hidden}function st(e){return e.tagName==="td"||e.tagName==="th"}function ot(e){return e.tagName==="dialog"&&!(e.properties||{}).open}const lt={},ct=[];function Et(e){const t=e||lt;return function(r,n){he(r,"element",function(i,s){const o=Array.isArray(i.properties.className)?i.properties.className:ct,l=o.includes("language-math"),a=o.includes("math-display"),c=o.includes("math-inline");let h=a;if(!l&&!a&&!c)return;let f=s[s.length-1],g=i;if(i.tagName==="code"&&l&&f&&f.type==="element"&&f.tagName==="pre"&&(g=f,f=s[s.length-2],h=!0),!f)return;const x=tt(g,{whitespace:"pre"});let d;try{d=D.renderToString(x,{...t,displayMode:h,throwOnError:!0})}catch(w){const v=w,u=v.name.toLowerCase();n.message("Could not render math with KaTeX",{ancestors:[...s,i],cause:v,place:i.position,ruleId:u,source:"rehype-katex"});try{d=D.renderToString(x,{...t,displayMode:h,strict:"ignore",throwOnError:!1})}catch{d=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(t.errorColor||"#cc0000"),title:String(w)},children:[{type:"text",value:x}]}]}}typeof d=="string"&&(d=Ke(d).children);const p=f.children.indexOf(g);return f.children.splice(p,1,...d),pe})}}function ut(e,t=e.arxiv_id??e.id){return{routeId:t,title:e.title,arxivId:e.arxiv_id,source:e.source??(e.arxiv_id?"arxiv":"external"),sourceUrl:e.source_url??e.url_abs,thumbnailUrl:e.thumbnail_url??null,authors:e.authors,published:e.published??null,conference:e.conference_name??e.conference??null,citationCount:e.citation_count,tasks:(e.tasks??[]).map(r=>({name:r.name,slug:r.slug??""}))}}function ht(e){if(!e.authors.length)return"";const t=e.authors.slice(0,3).join(", ");return e.authors.length>3?`${t}, et al.`:t}function pt(e){var r;if(e.conference)return e.conference;const t=(r=e.published)==null?void 0:r.slice(0,4);if(e.arxivId)return t?`arXiv ${t}`:"arXiv";if(e.sourceUrl)try{return new URL(e.sourceUrl).hostname.replace(/^www\./,"")}catch{}return t??"external"}const mt=({seed:e=0})=>m.jsxs("div",{className:"paper-preview-thumb","aria-hidden":"true","data-testid":"faux-paper-thumb",children:[m.jsxs("div",{className:"paper-preview-thumb-title",children:[m.jsx("span",{}),m.jsx("span",{})]}),m.jsx("div",{className:"paper-preview-thumb-auth"}),m.jsxs("div",{className:"paper-preview-thumb-cols",children:[m.jsx("div",{className:"paper-preview-thumb-col"}),m.jsx("div",{className:"paper-preview-thumb-col"})]}),m.jsx("div",{className:"paper-preview-thumb-fig",style:{top:62+e%3*8}})]}),ft=({thumbnailUrl:e,seed:t})=>{const[r,n]=M.useState(!1),i=fe(e);return M.useEffect(()=>n(!1),[i]),!i||r?m.jsx(mt,{seed:t}):m.jsx("div",{className:"paper-preview-thumb paper-preview-thumb-real",children:m.jsx("img",{"data-testid":"paper-preview-image",src:i,alt:"",loading:"lazy",decoding:"async",onError:()=>n(!0)})})},dt=({data:e})=>{const t=e.routeId.split("").reduce((n,i)=>n+i.charCodeAt(0),0),r=ht(e);return m.jsxs("div",{className:"paper-preview-inner",children:[m.jsx(ft,{thumbnailUrl:e.thumbnailUrl,seed:t}),m.jsxs("div",{className:"paper-preview-meta",children:[m.jsx("div",{className:"paper-preview-title",children:e.title}),r&&m.jsx("div",{className:"paper-preview-auth",children:r}),m.jsxs("div",{className:"paper-preview-venue",children:[pt(e),e.arxivId&&m.jsxs(m.Fragment,{children:[" · arXiv:",e.arxivId]}),e.citationCount!=null&&m.jsxs(m.Fragment,{children:[" · ↑ ",e.citationCount.toLocaleString()]})]}),e.tasks.length>0&&m.jsx("div",{className:"paper-preview-tags",children:e.tasks.map(n=>m.jsx("span",{className:"paper-preview-tag",children:n.name},n.slug||n.name))})]})]})},C=e=>["paper-preview",j(e)],gt=e=>e.arxiv_id??e.id,W=200;function At(e,t=P){const r=new Set,n=async s=>{const o=new Map;for(const l of s)l.arxiv_id&&r.add(j(l.arxiv_id));for(let l=0;l<s.length;l+=W){const{references:a}=await t.lookup(s.slice(l,l+W));for(const c of a){if(!c.paper)continue;const h=gt(c.paper);e.setQueryData(C(h),c.paper),o.set(c.key,h)}}return o};return{lookup:n,warm:s=>{const o=s.filter(l=>{const a=j(l);return r.has(a)||e.getQueryData(C(a))?!1:(r.add(a),!0)});o.length&&n(o.map(l=>({key:l,arxiv_id:l}))).catch(()=>{})}}}const xt=/^(\d{4}\.\d{4,5}|[a-z-]+(\.[A-Z]{2})?\/\d{7})$/i,yt=({arxivId:e})=>{var i;const t=de(),r=ge(),n=ve({mutationFn:()=>P.submit({arxiv_id:e}),onSuccess:s=>{s.pending_review||r.invalidateQueries({queryKey:C(e)})}});return(i=n.data)!=null&&i.pending_review?m.jsxs("div",{className:"paper-preview-status paper-preview-index-request",children:[m.jsx("span",{children:"Indexing request queued for review."}),m.jsx(E,{to:"/submissions",target:"_blank",rel:"noopener noreferrer",children:"View submissions ↗"})]}):m.jsxs("div",{className:"paper-preview-status paper-preview-index-request",children:[m.jsx("span",{children:"Not indexed on Papers with Code yet."}),t!=null&&t.user?m.jsx("button",{type:"button",disabled:n.isPending,onClick:()=>n.mutate(),children:n.isPending?"Requesting…":"Request indexing"}):m.jsx(E,{to:`/submit?arxiv_id=${encodeURIComponent(e)}`,target:"_blank",rel:"noopener noreferrer",children:"Request indexing ↗"}),n.isError&&m.jsx("span",{role:"alert",children:n.error.message})]})},wt=()=>typeof window.matchMedia=="function"&&window.matchMedia("(hover: none), (pointer: coarse)").matches,St=({routeId:e,to:t,initialData:r,className:n,children:i,target:s,title:o,ariaLabel:l,onClick:a,previewFooter:c})=>{const h=j(e),[f,g]=M.useState(!1),x=!!(r!=null&&r.title.trim()),d=ye({queryKey:C(h),queryFn:()=>P.get(h,!1),enabled:f&&!x,staleTime:5*60*1e3,gcTime:30*60*1e3,retry:!1}),p=r??(d.data?ut(d.data,h):void 0),w=d.error instanceof xe&&d.error.status===404&&xt.test(h),v=m.jsx(E,{className:n,to:t??`/paper/${h}`,target:s,title:o,"aria-label":l,onClick:u=>{g(!1),a==null||a(u)},rel:s==="_blank"?"noopener noreferrer":void 0,children:i});return m.jsxs(we,{open:f,onOpenChange:u=>{(!u||!wt())&&g(u)},openDelay:150,closeDelay:100,children:[m.jsx(be,{asChild:!0,children:v}),m.jsx(Ne,{className:"paper-preview-pop",side:"bottom",align:"start",collisionPadding:12,children:p?m.jsxs(m.Fragment,{children:[m.jsx(dt,{data:p}),c==null?void 0:c(p)]}):w?m.jsx(yt,{arxivId:h}):d.isError?m.jsx("div",{className:"paper-preview-status",children:"Preview unavailable"}):m.jsx("div",{className:"paper-preview-status","aria-live":"polite",children:"Loading preview…"})})]})};export{St as P,Mt as a,At as c,Et as r};
 
1
+ import{o as k,f as F,m as b,a as oe,p as z,b as L,n as O,h as le,s as ce,c as ue,v as he,S as pe}from"./index-DFKsmHrq.js";import{l as me}from"./index-B42pNGT3.js";import{k as D}from"./katex.min-BSBacQyE.js";import{j as m,z as M,N as fe,n as j,ah as de,h as ge,L as E,A as xe}from"./index-CxdnHo9-.js";import{u as ye}from"./useQuery-D8Q6gREv.js";import{H as we,a as be,b as Ne}from"./hover-card-CdRF8g76.js";import{p as ve}from"./paperQueryKeys-CcqbH5YG.js";import{p as P}from"./papers-BwPS4QGO.js";import{u as ke}from"./useMutation-Be3gnlrL.js";function Fe(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:s},exit:{mathFlow:i,mathFlowFence:n,mathFlowFenceMeta:r,mathFlowValue:l,mathText:o,mathTextData:l}};function e(a){const c={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[c]}},a)}function t(){this.buffer()}function r(){const a=this.resume(),c=this.stack[this.stack.length-1];k(c.type==="math"),c.meta=a}function n(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(a){const c=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),h=this.stack[this.stack.length-1];k(h.type==="math"),this.exit(a),h.value=c;const f=h.data.hChildren[0];k(f.type==="element"),k(f.tagName==="code"),f.children.push({type:"text",value:c}),this.data.mathFlowInside=void 0}function s(a){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},a),this.buffer()}function o(a){const c=this.resume(),h=this.stack[this.stack.length-1];k(h.type==="inlineMath"),this.exit(a),h.value=c,h.data.hChildren.push({type:"text",value:c})}function l(a){this.config.enter.data.call(this,a),this.config.exit.data.call(this,a)}}function je(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),n.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:r,inlineMath:n}};function r(s,o,l,a){const c=s.value||"",h=l.createTracker(a),f="$".repeat(Math.max(me(c,"$")+1,2)),g=l.enter("mathFlow");let x=h.move(f);if(s.meta){const d=l.enter("mathFlowMeta");x+=h.move(l.safe(s.meta,{after:`
3
  `,before:x,encode:["$"],...h.current()})),d()}return x+=h.move(`
4
  `),c&&(x+=h.move(c+`
5
+ `)),x+=h.move(f),g(),x}function n(s,o,l){let a=s.value||"",c=1;for(t||c++;new RegExp("(^|[^$])"+"\\$".repeat(c)+"([^$]|$)").test(a);)c++;const h="$".repeat(c);/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^\$|\$$/.test(a))&&(a=" "+a+" ");let f=-1;for(;++f<l.unsafe.length;){const g=l.unsafe[f];if(!g.atBreak)continue;const x=l.compilePattern(g);let d;for(;d=x.exec(a);){let p=d.index;a.codePointAt(p)===10&&a.codePointAt(p-1)===13&&p--,a=a.slice(0,p)+" "+a.slice(d.index+1)}}return h+a+h}function i(){return"$"}}const Ce={tokenize:Te,concrete:!0,name:"mathFlow"},R={tokenize:Me,partial:!0};function Te(e,t,r){const n=this,i=n.events[n.events.length-1],s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0;let o=0;return l;function l(u){return e.enter("mathFlow"),e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),a(u)}function a(u){return u===36?(e.consume(u),o++,a):o<2?r(u):(e.exit("mathFlowFenceSequence"),F(e,c,"whitespace")(u))}function c(u){return u===null||b(u)?f(u):(e.enter("mathFlowFenceMeta"),e.enter("chunkString",{contentType:"string"}),h(u))}function h(u){return u===null||b(u)?(e.exit("chunkString"),e.exit("mathFlowFenceMeta"),f(u)):u===36?r(u):(e.consume(u),h)}function f(u){return e.exit("mathFlowFence"),n.interrupt?t(u):e.attempt(R,g,w)(u)}function g(u){return e.attempt({tokenize:v,partial:!0},w,x)(u)}function x(u){return(s?F(e,d,"linePrefix",s+1):d)(u)}function d(u){return u===null?w(u):b(u)?e.attempt(R,g,w)(u):(e.enter("mathFlowValue"),p(u))}function p(u){return u===null||b(u)?(e.exit("mathFlowValue"),d(u)):(e.consume(u),p)}function w(u){return e.exit("mathFlow"),t(u)}function v(u,ie,q){let _=0;return F(u,ae,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function ae(y){return u.enter("mathFlowFence"),u.enter("mathFlowFenceSequence"),$(y)}function $(y){return y===36?(_++,u.consume(y),$):_<o?q(y):(u.exit("mathFlowFenceSequence"),F(u,se,"whitespace")(y))}function se(y){return y===null||b(y)?(u.exit("mathFlowFence"),ie(y)):q(y)}}}function Me(e,t,r){const n=this;return i;function i(o){return o===null?t(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return n.parser.lazy[n.now().line]?r(o):t(o)}}function Ee(e){let r=(e||{}).singleDollarTextMath;return r==null&&(r=!0),{tokenize:n,resolve:Ae,previous:Se,name:"mathText"};function n(i,s,o){let l=0,a,c;return h;function h(p){return i.enter("mathText"),i.enter("mathTextSequence"),f(p)}function f(p){return p===36?(i.consume(p),l++,f):l<2&&!r?o(p):(i.exit("mathTextSequence"),g(p))}function g(p){return p===null?o(p):p===36?(c=i.enter("mathTextSequence"),a=0,d(p)):p===32?(i.enter("space"),i.consume(p),i.exit("space"),g):b(p)?(i.enter("lineEnding"),i.consume(p),i.exit("lineEnding"),g):(i.enter("mathTextData"),x(p))}function x(p){return p===null||p===32||p===36||b(p)?(i.exit("mathTextData"),g(p)):(i.consume(p),x)}function d(p){return p===36?(i.consume(p),a++,d):a===l?(i.exit("mathTextSequence"),i.exit("mathText"),s(p)):(c.type="mathTextData",x(p))}}}function Ae(e){let t=e.length-4,r=3,n,i;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(n=r;++n<t;)if(e[n][1].type==="mathTextData"){e[t][1].type="mathTextPadding",e[r][1].type="mathTextPadding",r+=2,t-=2;break}}for(n=r-1,t++;++n<=t;)i===void 0?n!==t&&e[n][1].type!=="lineEnding"&&(i=n):(n===t||e[n][1].type==="lineEnding")&&(e[i][1].type="mathTextData",n!==i+2&&(e[i][1].end=e[n-1][1].end,e.splice(i+2,n-i-2),t-=n-i-2,n=i+2),i=void 0);return e}function Se(e){return e!==36||this.events[this.events.length-1][1].type==="characterEscape"}function Pe(e){return{flow:{36:Ce},text:{36:Ee(e)}}}const Ie={};function At(e){const t=this,r=e||Ie,n=t.data(),i=n.micromarkExtensions||(n.micromarkExtensions=[]),s=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),o=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);i.push(Pe(r)),s.push(Fe()),o.push(je(r))}const B=/[#.]/g;function qe(e,t){const r=e||"",n={};let i=0,s,o;for(;i<r.length;){B.lastIndex=i;const l=B.exec(r),a=r.slice(i,l?l.index:r.length);a&&(s?s==="#"?n.id=a:Array.isArray(n.className)?n.className.push(a):n.className=[a]:o=a,i+=a.length),l&&(s=l[0],i++)}return{type:"element",tagName:o||t||"div",properties:n,children:[]}}function Y(e,t,r){const n=r?Le(r):void 0;function i(s,o,...l){let a;if(s==null){a={type:"root",children:[]};const c=o;l.unshift(c)}else{a=qe(s,t);const c=a.tagName.toLowerCase(),h=n?n.get(c):void 0;if(a.tagName=h||c,_e(o))l.unshift(o);else for(const[f,g]of Object.entries(o))$e(e,a.properties,f,g)}for(const c of l)A(a.children,c);return a.type==="element"&&a.tagName==="template"&&(a.content={type:"root",children:a.children},a.children=[]),a}return i}function _e(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,r=Object.keys(e);for(const n of r){const i=t[n];if(i&&typeof i=="object"){if(!Array.isArray(i))return!0;const s=i;for(const o of s)if(typeof o!="number"&&typeof o!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function $e(e,t,r,n){const i=oe(e,r);let s;if(n!=null){if(typeof n=="number"){if(Number.isNaN(n))return;s=n}else typeof n=="boolean"?s=n:typeof n=="string"?i.spaceSeparated?s=z(n):i.commaSeparated?s=L(n):i.commaOrSpaceSeparated?s=z(L(n).join(" ")):s=U(i,i.property,n):Array.isArray(n)?s=[...n]:s=i.property==="style"?ze(n):String(n);if(Array.isArray(s)){const o=[];for(const l of s)o.push(U(i,i.property,l));s=o}i.property==="className"&&Array.isArray(t.className)&&(s=t.className.concat(s)),t[i.property]=s}}function A(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const r of t)A(e,r);else if(typeof t=="object"&&"type"in t)t.type==="root"?A(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function U(e,t,r){if(typeof r=="string"){if(e.number&&r&&!Number.isNaN(Number(r)))return Number(r);if((e.boolean||e.overloadedBoolean)&&(r===""||O(r)===O(t)))return!0}return r}function ze(e){const t=[];for(const[r,n]of Object.entries(e))t.push([r,n].join(": "));return t.join("; ")}function Le(e){const t=new Map;for(const r of e)t.set(r.toLowerCase(),r);return t}const Oe=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],De=Y(le,"div"),Re=Y(ce,"g",Oe),T={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function Be(e,t){return Z(e,{})||{type:"root",children:[]}}function Z(e,t){const r=Ue(e,t);return r&&t.afterTransform&&t.afterTransform(e,r),r}function Ue(e,t){switch(e.nodeType){case 1:return Ge(e,t);case 3:return Ke(e);case 8:return Ve(e);case 9:return H(e,t);case 10:return He();case 11:return H(e,t);default:return}}function H(e,t){return{type:"root",children:J(e,t)}}function He(){return{type:"doctype"}}function Ke(e){return{type:"text",value:e.nodeValue||""}}function Ve(e){return{type:"comment",value:e.nodeValue||""}}function Ge(e,t){const r=e.namespaceURI,n=r===T.svg?Re:De,i=r===T.html?e.tagName.toLowerCase():e.tagName,s=r===T.html&&i==="template"?e.content:e,o=e.getAttributeNames(),l={};let a=-1;for(;++a<o.length;)l[o[a]]=e.getAttribute(o[a])||"";return n(i,l,J(s,t))}function J(e,t){const r=e.childNodes,n=[];let i=-1;for(;++i<r.length;){const s=Z(r[i],t);s!==void 0&&n.push(s)}return n}new DOMParser;function Qe(e,t){const r=Xe(e);return Be(r)}function Xe(e){const t=document.createElement("template");return t.innerHTML=e,t.content}const K=function(e,t,r){const n=ue(r);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(n(e.children[t],t,e))return e.children[t]},N=function(e){if(e==null)return Ze;if(typeof e=="string")return Ye(e);if(typeof e=="object")return We(e);if(typeof e=="function")return I(e);throw new Error("Expected function, string, or array as `test`")};function We(e){const t=[];let r=-1;for(;++r<e.length;)t[r]=N(e[r]);return I(n);function n(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function Ye(e){return I(t);function t(r){return r.tagName===e}}function I(e){return t;function t(r,n,i){return!!(Je(r)&&e.call(this,r,typeof n=="number"?n:void 0,i||void 0))}}function Ze(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function Je(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const V=/\n/g,G=/[\t ]+/g,S=N("br"),Q=N(ot),et=N("p"),X=N("tr"),tt=N(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",st,lt]),ee=N(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function nt(e,t){const r=t||{},n="children"in e?e.children:[],i=ee(e),s=re(e,{whitespace:r.whitespace||"normal"}),o=[];(e.type==="text"||e.type==="comment")&&o.push(...ne(e,{breakBefore:!0,breakAfter:!0}));let l=-1;for(;++l<n.length;)o.push(...te(n[l],e,{whitespace:s,breakBefore:l?void 0:i,breakAfter:l<n.length-1?S(n[l+1]):i}));const a=[];let c;for(l=-1;++l<o.length;){const h=o[l];typeof h=="number"?c!==void 0&&h>c&&(c=h):h&&(c!==void 0&&c>-1&&a.push(`
6
+ `.repeat(c)||" "),c=-1,a.push(h))}return a.join("")}function te(e,t,r){return e.type==="element"?rt(e,t,r):e.type==="text"?r.whitespace==="normal"?ne(e,r):it(e):[]}function rt(e,t,r){const n=re(e,r),i=e.children||[];let s=-1,o=[];if(tt(e))return o;let l,a;for(S(e)||X(e)&&K(t,e,X)?a=`
7
+ `:et(e)?(l=2,a=2):ee(e)&&(l=1,a=1);++s<i.length;)o=o.concat(te(i[s],e,{whitespace:n,breakBefore:s?void 0:l,breakAfter:s<i.length-1?S(i[s+1]):a}));return Q(e)&&K(t,e,Q)&&o.push(" "),l&&o.unshift(l),a&&o.push(a),o}function ne(e,t){const r=String(e.value),n=[],i=[];let s=0;for(;s<=r.length;){V.lastIndex=s;const a=V.exec(r),c=a&&"index"in a?a.index:r.length;n.push(at(r.slice(s,c).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),s===0?t.breakBefore:!0,c===r.length?t.breakAfter:!0)),s=c+1}let o=-1,l;for(;++o<n.length;)n[o].charCodeAt(n[o].length-1)===8203||o<n.length-1&&n[o+1].charCodeAt(0)===8203?(i.push(n[o]),l=void 0):n[o]?(typeof l=="number"&&i.push(l),i.push(n[o]),l=0):(o===0||o===n.length-1)&&i.push(0);return i}function it(e){return[String(e.value)]}function at(e,t,r){const n=[];let i=0,s;for(;i<e.length;){G.lastIndex=i;const o=G.exec(e);s=o?o.index:e.length,!i&&!s&&o&&!t&&n.push(""),i!==s&&n.push(e.slice(i,s)),i=o?s+o[0].length:s}return i!==s&&!r&&n.push(""),n.join(" ")}function re(e,t){if(e.type==="element"){const r=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return r.wrap?"pre-wrap":"pre";case"td":case"th":return r.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function st(e){return!!(e.properties||{}).hidden}function ot(e){return e.tagName==="td"||e.tagName==="th"}function lt(e){return e.tagName==="dialog"&&!(e.properties||{}).open}const ct={},ut=[];function St(e){const t=e||ct;return function(r,n){he(r,"element",function(i,s){const o=Array.isArray(i.properties.className)?i.properties.className:ut,l=o.includes("language-math"),a=o.includes("math-display"),c=o.includes("math-inline");let h=a;if(!l&&!a&&!c)return;let f=s[s.length-1],g=i;if(i.tagName==="code"&&l&&f&&f.type==="element"&&f.tagName==="pre"&&(g=f,f=s[s.length-2],h=!0),!f)return;const x=nt(g,{whitespace:"pre"});let d;try{d=D.renderToString(x,{...t,displayMode:h,throwOnError:!0})}catch(w){const v=w,u=v.name.toLowerCase();n.message("Could not render math with KaTeX",{ancestors:[...s,i],cause:v,place:i.position,ruleId:u,source:"rehype-katex"});try{d=D.renderToString(x,{...t,displayMode:h,strict:"ignore",throwOnError:!1})}catch{d=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(t.errorColor||"#cc0000"),title:String(w)},children:[{type:"text",value:x}]}]}}typeof d=="string"&&(d=Qe(d).children);const p=f.children.indexOf(g);return f.children.splice(p,1,...d),pe})}}function ht(e,t=e.arxiv_id??e.id){return{routeId:t,title:e.title,arxivId:e.arxiv_id,source:e.source??(e.arxiv_id?"arxiv":"external"),sourceUrl:e.source_url??e.url_abs,thumbnailUrl:e.thumbnail_url??null,authors:e.authors,published:e.published??null,conference:e.conference_name??e.conference??null,citationCount:e.citation_count,tasks:(e.tasks??[]).map(r=>({name:r.name,slug:r.slug??""}))}}function pt(e){if(!e.authors.length)return"";const t=e.authors.slice(0,3).join(", ");return e.authors.length>3?`${t}, et al.`:t}function mt(e){var r;if(e.conference)return e.conference;const t=(r=e.published)==null?void 0:r.slice(0,4);if(e.arxivId)return t?`arXiv ${t}`:"arXiv";if(e.sourceUrl)try{return new URL(e.sourceUrl).hostname.replace(/^www\./,"")}catch{}return t??"external"}const ft=({seed:e=0})=>m.jsxs("div",{className:"paper-preview-thumb","aria-hidden":"true","data-testid":"faux-paper-thumb",children:[m.jsxs("div",{className:"paper-preview-thumb-title",children:[m.jsx("span",{}),m.jsx("span",{})]}),m.jsx("div",{className:"paper-preview-thumb-auth"}),m.jsxs("div",{className:"paper-preview-thumb-cols",children:[m.jsx("div",{className:"paper-preview-thumb-col"}),m.jsx("div",{className:"paper-preview-thumb-col"})]}),m.jsx("div",{className:"paper-preview-thumb-fig",style:{top:62+e%3*8}})]}),dt=({thumbnailUrl:e,seed:t})=>{const[r,n]=M.useState(!1),i=fe(e);return M.useEffect(()=>n(!1),[i]),!i||r?m.jsx(ft,{seed:t}):m.jsx("div",{className:"paper-preview-thumb paper-preview-thumb-real",children:m.jsx("img",{"data-testid":"paper-preview-image",src:i,alt:"",loading:"lazy",decoding:"async",onError:()=>n(!0)})})},gt=({data:e})=>{const t=e.routeId.split("").reduce((n,i)=>n+i.charCodeAt(0),0),r=pt(e);return m.jsxs("div",{className:"paper-preview-inner",children:[m.jsx(dt,{thumbnailUrl:e.thumbnailUrl,seed:t}),m.jsxs("div",{className:"paper-preview-meta",children:[m.jsx("div",{className:"paper-preview-title",children:e.title}),r&&m.jsx("div",{className:"paper-preview-auth",children:r}),m.jsxs("div",{className:"paper-preview-venue",children:[mt(e),e.arxivId&&m.jsxs(m.Fragment,{children:[" · arXiv:",e.arxivId]}),e.citationCount!=null&&m.jsxs(m.Fragment,{children:[" · ↑ ",e.citationCount.toLocaleString()]})]}),e.tasks.length>0&&m.jsx("div",{className:"paper-preview-tags",children:e.tasks.map(n=>m.jsx("span",{className:"paper-preview-tag",children:n.name},n.slug||n.name))})]})]})},C=e=>ve.preview(j(e)),xt=e=>e.arxiv_id??e.id,W=200;function Pt(e,t=P){const r=new Set,n=async s=>{const o=new Map;for(const l of s)l.arxiv_id&&r.add(j(l.arxiv_id));for(let l=0;l<s.length;l+=W){const{references:a}=await t.lookup(s.slice(l,l+W));for(const c of a){if(!c.paper)continue;const h=xt(c.paper);e.setQueryData(C(h),c.paper),o.set(c.key,h)}}return o};return{lookup:n,warm:s=>{const o=s.filter(l=>{const a=j(l);return r.has(a)||e.getQueryData(C(a))?!1:(r.add(a),!0)});o.length&&n(o.map(l=>({key:l,arxiv_id:l}))).catch(()=>{})}}}const yt=/^(\d{4}\.\d{4,5}|[a-z-]+(\.[A-Z]{2})?\/\d{7})$/i,wt=({arxivId:e})=>{var i;const t=de(),r=ge(),n=ke({mutationFn:()=>P.submit({arxiv_id:e}),onSuccess:s=>{s.pending_review||r.invalidateQueries({queryKey:C(e)})}});return(i=n.data)!=null&&i.pending_review?m.jsxs("div",{className:"paper-preview-status paper-preview-index-request",children:[m.jsx("span",{children:"Indexing request queued for review."}),m.jsx(E,{to:"/submissions",target:"_blank",rel:"noopener noreferrer",children:"View submissions ↗"})]}):m.jsxs("div",{className:"paper-preview-status paper-preview-index-request",children:[m.jsx("span",{children:"Not indexed on Papers with Code yet."}),t!=null&&t.user?m.jsx("button",{type:"button",disabled:n.isPending,onClick:()=>n.mutate(),children:n.isPending?"Requesting…":"Request indexing"}):m.jsx(E,{to:`/submit?arxiv_id=${encodeURIComponent(e)}`,target:"_blank",rel:"noopener noreferrer",children:"Request indexing ↗"}),n.isError&&m.jsx("span",{role:"alert",children:n.error.message})]})},bt=()=>typeof window.matchMedia=="function"&&window.matchMedia("(hover: none), (pointer: coarse)").matches,It=({routeId:e,to:t,initialData:r,className:n,children:i,target:s,title:o,ariaLabel:l,onClick:a,previewFooter:c})=>{const h=j(e),[f,g]=M.useState(!1),x=!!(r!=null&&r.title.trim()),d=ye({queryKey:C(h),queryFn:()=>P.get(h,!1),enabled:f&&!x,staleTime:5*60*1e3,gcTime:30*60*1e3,retry:!1}),p=r??(d.data?ht(d.data,h):void 0),w=d.error instanceof xe&&d.error.status===404&&yt.test(h),v=m.jsx(E,{className:n,to:t??`/paper/${h}`,target:s,title:o,"aria-label":l,onClick:u=>{g(!1),a==null||a(u)},rel:s==="_blank"?"noopener noreferrer":void 0,children:i});return m.jsxs(we,{open:f,onOpenChange:u=>{(!u||!bt())&&g(u)},openDelay:150,closeDelay:100,children:[m.jsx(be,{asChild:!0,children:v}),m.jsx(Ne,{className:"paper-preview-pop",side:"bottom",align:"start",collisionPadding:12,children:p?m.jsxs(m.Fragment,{children:[m.jsx(gt,{data:p}),c==null?void 0:c(p)]}):w?m.jsx(wt,{arxivId:h}):d.isError?m.jsx("div",{className:"paper-preview-status",children:"Preview unavailable"}):m.jsx("div",{className:"paper-preview-status","aria-live":"polite",children:"Loading preview…"})})]})};export{It as P,At as a,Pt as c,St as r};
assets/PaperReaderView-C7w_8jdj.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{u as ie,j as i,b as Ce,n as _e,N as je,r as s,O as Ie,L as B}from"./index-CxdnHo9-.js";import{u as $e}from"./useQuery-D8Q6gREv.js";import{A as ke,u as Ae,a as Ne,P as Ee}from"./ArtifactWorkspace-BH6Hc7q-.js";import{b as Te}from"./usePapers-CD7ebaIw.js";import{c as ze}from"./chat-Cj9116s7.js";import{s as D}from"./safeExternalHref-CkBrsh84.js";import{ChatExperience as Le}from"./ChatView-C6KccNYj.js";import"./chatLaunch-5Omrgp_C.js";import"./chevron-down-BbZGSdxv.js";import"./papers-BwPS4QGO.js";import"./katex.min-BSBacQyE.js";import"./hover-card-CdRF8g76.js";import"./github-De9GLWXG.js";import"./github-BYB9vaDZ.js";import"./PaperPreviewLink-CUTHdATo.js";import"./index-DFKsmHrq.js";import"./index-B42pNGT3.js";import"./paperQueryKeys-CcqbH5YG.js";import"./useMutation-Be3gnlrL.js";import"./copy-DN4hDnRX.js";import"./file-text-CqF2MZuA.js";import"./external-link-DZCSog7H.js";import"./useInfiniteQuery-BUi2pe7X.js";import"./chatPrompts-CDY3UGU1.js";import"./openrouter-CtFTPs7F.js";const oe=66,Me=240,O="pwc:reader:split-ratio",k=r=>`pwc:reader:session:${r}`,U=r=>`pwc:reader:assistant-collapsed:${r}`,ce=r=>`pwc:reader:page:${r}`;function q(r){const o=Number(sessionStorage.getItem(ce(r)));return Number.isInteger(o)&&o>0?o:1}function Fe(){const r=Number(localStorage.getItem(O));return Number.isFinite(r)&&r>=45&&r<=75?r:oe}function We(r){const o=D(r);if(!o)return null;const n=new URL(o);return(n.hostname==="arxiv.org"||n.hostname==="www.arxiv.org")&&n.pathname.startsWith("/pdf/")&&n.pathname.endsWith(".pdf")&&(n.pathname=n.pathname.slice(0,-4)),n.href}function He(r){return new URL(r).hostname.replace(/^www\./,"")}function Ke(r){if(!r)return{};const o={};for(const d of r.repositories??[]){if(!d.is_official)continue;const t=D(d.url);if(!t)continue;const b=new URL(t),A=b.pathname.split("/").filter(Boolean);if((b.hostname==="github.com"||b.hostname==="www.github.com")&&A.length>=2){o.repository={href:t,stars:d.num_stars||0};break}}const n=[...r.project_pages??[]].sort((d,t)=>Number(t.is_official)-Number(d.is_official));for(const d of n){const t=D(d.url);if(t){o.projectPage={href:t,label:He(t)};break}}const g=r.hf_artifact_summary?r.hf_artifact_summary.model_count+r.hf_artifact_summary.dataset_count+r.hf_artifact_summary.space_count:new Set([...r.hf_models??[],...r.hf_datasets??[],...r.hf_spaces??[]]).size;return g>0&&r.arxiv_id&&(o.huggingFace={href:`https://huggingface.co/papers/${r.arxiv_id.replace(/v\d+$/i,"")}`,count:g}),o}function Be(){var re,ae,se,ne;const r=Ce(),{paperId:o}=ie(),n=_e(o??"").replace(/v\d+$/i,""),g=Te(n,!!n),d=$e({queryKey:["chatAvailability"],queryFn:()=>ze.getAvailability(),refetchInterval:3e4,retry:!1}),t=g.data,b=(t==null?void 0:t.source)==="external"?je(`/paper-assets/external/${t.id}/paper.pdf`):We(t==null?void 0:t.url_pdf),A=Ke(t),f=((re=t==null?void 0:t.arxiv_id)==null?void 0:re.replace(/v\d+$/i,""))||n,le=s.useCallback(()=>r(`/paper/${f}`),[f,r]),[P,N]=s.useState(()=>sessionStorage.getItem(k(n))||void 0),[w,E]=s.useState(Fe),[p,V]=s.useState(()=>sessionStorage.getItem(U(n))==="1"),[m,y]=s.useState("paper"),[T,R]=s.useState(),[ue,v]=s.useState(""),[de,pe]=s.useState(()=>q(n)),[S,fe]=s.useState(0),[X,Q]=s.useState(!1),[me,z]=s.useState(!1),C=s.useRef(null),L=s.useRef(null),M=s.useRef(null),Y=s.useRef(null),_=s.useRef(!1),j=s.useRef(0),h=s.useRef(0),F=s.useRef(0),x=s.useRef(w),W=s.useRef(q(n)),H=s.useRef(t==null?void 0:t.version),G=Ae().reset,J=s.useRef(`${n}:${P??"new"}`),c=S>=840;s.useEffect(()=>{const e=`${n}:${P??"new"}`;J.current!==e&&(J.current=e,G())},[P,G,n]),s.useEffect(()=>{t!=null&&t.version&&H.current&&t.version!==H.current&&(R(void 0),v("")),H.current=t==null?void 0:t.version},[t==null?void 0:t.version]),s.useEffect(()=>{window.clearTimeout(j.current),z(!1);const e=sessionStorage.getItem(k(n));N(e||void 0),V(sessionStorage.getItem(U(n))==="1"),y("paper"),R(void 0),v("");const a=q(n);W.current=a,pe(a)},[n]),s.useEffect(()=>()=>{window.clearTimeout(j.current),cancelAnimationFrame(h.current)},[]),s.useLayoutEffect(()=>{const e=C.current;if(!e)return;const a=()=>fe(e.clientWidth);a();const l=new ResizeObserver(a);return l.observe(e),()=>l.disconnect()},[t]),s.useEffect(()=>{if(!t)return;document.title=`${t.title} — Papers With Code reader`;let e=document.querySelector('meta[name="robots"]');const a=!e;e||(e=document.createElement("meta"),e.name="robots",document.head.appendChild(e));const l=e.content;e.content="noindex, nofollow";let u=document.querySelector('link[rel="canonical"]');const Pe=!u;u||(u=document.createElement("link"),u.rel="canonical",document.head.appendChild(u));const ye=u.href;return u.href=`${window.location.origin}/paper/${f}`,()=>{document.title="Papers With Code",a?e==null||e.remove():e&&(e.content=l),Pe?u==null||u.remove():u&&(u.href=ye)}},[f,t]);const I=s.useCallback(e=>{if(!S)return Math.max(45,Math.min(75,e));const a=480/S*100,l=100-360/S*100;return Math.max(a,Math.min(l,e))},[S]);s.useEffect(()=>E(e=>{const a=I(e);return x.current=a,a}),[I]);const $=e=>{const a=I(e);x.current=a,E(a),localStorage.setItem(O,String(a))},Z=e=>{var l;const a=I(e);x.current=a,L.current&&(L.current.style.width=`${a}%`),M.current&&(M.current.style.width=`${100-a}%`),(l=Y.current)==null||l.setAttribute("aria-valuenow",String(Math.round(a)))},ee=e=>{F.current=e,!h.current&&(h.current=requestAnimationFrame(()=>{var l;h.current=0;const a=(l=C.current)==null?void 0:l.getBoundingClientRect();a!=null&&a.width&&Z((F.current-a.left)/a.width*100)}))},he=e=>{_.current=!0,Q(!0),e.currentTarget.setPointerCapture(e.pointerId),ee(e.clientX)},K=()=>{var e;if(_.current){if(h.current){cancelAnimationFrame(h.current),h.current=0;const a=(e=C.current)==null?void 0:e.getBoundingClientRect();a!=null&&a.width&&Z((F.current-a.left)/a.width*100)}_.current=!1,E(x.current),localStorage.setItem(O,String(x.current)),Q(!1)}},te=e=>{window.clearTimeout(j.current),z(!0),V(e),sessionStorage.setItem(U(n),e?"1":"0"),j.current=window.setTimeout(()=>z(!1),Me+40)},ge=e=>{N(e),sessionStorage.setItem(k(n),e)},be=()=>{N(void 0),sessionStorage.removeItem(k(n)),R(void 0),v("")},ve=((ae=d.data)==null?void 0:ae.paper_reader_selection_enabled)===!0,we=e=>{R(e),v(`Selection from page ${e.page} added to chat`),c&&p&&te(!1)},Re=s.useCallback(e=>{R(e),e||v("")},[]),Se=Ie()&&((se=d.data)==null?void 0:se.paper_reader_chat_enabled)!==!1,xe=t&&Se?i.jsx(Le,{mode:"paper",routeSessionId:P,primaryPaper:{id:t.id,routeId:f,title:t.title},currentPage:()=>W.current,paperSelection:T,onPaperSelectionChange:Re,onSessionId:ge,onReaderSubmit:()=>y("assistant"),onReaderNewChat:be}):i.jsx("div",{className:"reader-chat-unavailable",children:"Chat is not enabled for this preview."});return g.isLoading?i.jsx("div",{className:"reader-status",role:"status",children:"Loading paper…"}):g.error||!t?i.jsxs("div",{className:"reader-status",role:"alert",children:[i.jsx("p",{children:"Paper not found."}),i.jsx(B,{to:"/papers",children:"Browse papers"})]}):((ne=d.data)==null?void 0:ne.native_pdf_reader_enabled)===!1?i.jsxs("div",{className:"reader-status",role:"alert",children:[i.jsx("p",{children:"The native reader is currently unavailable."}),i.jsx(B,{to:`/paper/${f}`,children:"Back to paper"})]}):b?i.jsxs("div",{className:"paper-reader-shell",children:[!c&&i.jsxs("div",{className:"reader-tabs",role:"tablist","aria-label":"Reader panels",children:[i.jsx("button",{type:"button",role:"tab","aria-selected":m==="paper",onClick:()=>y("paper"),children:"Paper"}),i.jsxs("button",{type:"button",role:"tab","aria-selected":m==="assistant","aria-label":T&&m!=="assistant"?"Chat, selection attached":"Chat",onClick:()=>y("assistant"),children:["Chat",T&&m!=="assistant"&&i.jsx("span",{className:"reader-tab-pending","aria-hidden":"true"})]})]}),i.jsx(Ne,{variant:"reader",children:i.jsxs("div",{ref:C,className:`reader-workspace${c?" is-desktop":" is-tabs"}${p?" is-assistant-collapsed":""}${X?" is-resizing":""}`,"data-testid":"paper-chat-workspace",children:[i.jsx("section",{ref:L,className:`reader-paper-pane${!c&&m!=="paper"?" is-hidden":""}`,style:c?{width:p?"100%":`${w}%`}:void 0,role:"tabpanel","aria-label":"Paper","aria-hidden":!c&&m!=="paper",children:i.jsx(Ee,{url:b,paperKey:f,paperTitle:t.title,paperHref:`/paper/${f}`,onClose:le,resources:A,initialPage:de,resizeActive:X||me,selectionEnabled:ve,paperVersion:t.version,loadErrorMessage:t.source==="external"?"Paper content is still being prepared. Please try again later.":void 0,onPaperSelection:we,onPaperSelectionError:v,onPageChange:e=>{W.current=e,sessionStorage.setItem(ce(n),String(e))}})}),c&&!p&&i.jsx("div",{ref:Y,className:"reader-resize-handle",role:"separator","aria-label":"Resize paper and Chat panels","aria-orientation":"vertical","aria-valuemin":45,"aria-valuemax":75,"aria-valuenow":Math.round(w),tabIndex:0,onPointerDown:he,onPointerMove:e=>{_.current&&ee(e.clientX)},onPointerUp:K,onPointerCancel:K,onLostPointerCapture:K,onDoubleClick:()=>$(oe),onKeyDown:e=>{(e.key==="ArrowLeft"||e.key==="ArrowRight")&&(e.preventDefault(),$(w+(e.key==="ArrowRight"?2:-2))),e.key==="Home"&&$(45),e.key==="End"&&$(75)}}),i.jsx("aside",{ref:M,id:"reader-chat-panel",className:`reader-assistant-pane${!c&&m!=="assistant"?" is-hidden":""}${c&&p?" is-collapsed":""}`,style:c?{width:p?0:`${100-w}%`}:void 0,role:"tabpanel","aria-label":"Chat","aria-hidden":!c&&m!=="assistant"||p,children:xe}),i.jsx("div",{className:"sr-only","aria-live":"polite",children:ue}),c&&i.jsx("button",{type:"button",className:"reader-collapse-assistant","aria-controls":"reader-chat-panel","aria-expanded":!p,onClick:()=>te(!p),children:p?"Open chat":"Hide chat"})]})})]}):i.jsxs("div",{className:"reader-status",role:"alert",children:[i.jsx("p",{children:"Native reading is unavailable for this resource."}),i.jsx(B,{to:`/paper/${f}`,children:"Back to paper"})]})}function ht(){const{paperId:r=""}=ie();return i.jsx(ke,{workspaceKey:`reader:${r}`,children:i.jsx(Be,{})})}export{ht as default,Ke as readerToolbarResources};
assets/PaperReaderView-WMNrI5KU.js DELETED
@@ -1 +0,0 @@
1
- import{u as ie,j as i,b as Ce,n as _e,N as je,r as s,O as Ie,L as B}from"./index-DVQGVzHu.js";import{u as $e}from"./useQuery-tFDel9EL.js";import{A as ke,u as Ae,a as Ne,P as Ee}from"./ArtifactWorkspace-DB5ujk-W.js";import{b as Te}from"./usePapers-a_mp-Uw3.js";import{c as ze}from"./chat-CSWYblIR.js";import{s as D}from"./safeExternalHref-CkBrsh84.js";import{ChatExperience as Le}from"./ChatView-4qz_MwOa.js";import"./chatLaunch-Ufg754YN.js";import"./chevron-down-BAd8ubvW.js";import"./papers-DlaCqfyl.js";import"./katex.min-BSBacQyE.js";import"./hover-card-B-kPWoKE.js";import"./github-_b5ZsN76.js";import"./github-CUCDfz_P.js";import"./PaperPreviewLink-CpVn6ETd.js";import"./index-VSogvUtt.js";import"./index-B-ULOvtV.js";import"./useMutation-Doe-Qh76.js";import"./copy-D4HOG4XE.js";import"./file-text-Ci1EH-su.js";import"./external-link-NJ-WhNGs.js";import"./useInfiniteQuery-CYdxlDgS.js";import"./chatPrompts-CDY3UGU1.js";import"./openrouter-CqZ6Mbgw.js";const oe=66,Me=240,O="pwc:reader:split-ratio",k=r=>`pwc:reader:session:${r}`,U=r=>`pwc:reader:assistant-collapsed:${r}`,ce=r=>`pwc:reader:page:${r}`;function q(r){const o=Number(sessionStorage.getItem(ce(r)));return Number.isInteger(o)&&o>0?o:1}function Fe(){const r=Number(localStorage.getItem(O));return Number.isFinite(r)&&r>=45&&r<=75?r:oe}function We(r){const o=D(r);if(!o)return null;const n=new URL(o);return(n.hostname==="arxiv.org"||n.hostname==="www.arxiv.org")&&n.pathname.startsWith("/pdf/")&&n.pathname.endsWith(".pdf")&&(n.pathname=n.pathname.slice(0,-4)),n.href}function He(r){return new URL(r).hostname.replace(/^www\./,"")}function Ke(r){if(!r)return{};const o={};for(const d of r.repositories??[]){if(!d.is_official)continue;const t=D(d.url);if(!t)continue;const b=new URL(t),A=b.pathname.split("/").filter(Boolean);if((b.hostname==="github.com"||b.hostname==="www.github.com")&&A.length>=2){o.repository={href:t,stars:d.num_stars||0};break}}const n=[...r.project_pages??[]].sort((d,t)=>Number(t.is_official)-Number(d.is_official));for(const d of n){const t=D(d.url);if(t){o.projectPage={href:t,label:He(t)};break}}const g=r.hf_artifact_summary?r.hf_artifact_summary.model_count+r.hf_artifact_summary.dataset_count+r.hf_artifact_summary.space_count:new Set([...r.hf_models??[],...r.hf_datasets??[],...r.hf_spaces??[]]).size;return g>0&&r.arxiv_id&&(o.huggingFace={href:`https://huggingface.co/papers/${r.arxiv_id.replace(/v\d+$/i,"")}`,count:g}),o}function Be(){var re,ae,se,ne;const r=Ce(),{paperId:o}=ie(),n=_e(o??"").replace(/v\d+$/i,""),g=Te(n,!!n),d=$e({queryKey:["chatAvailability"],queryFn:()=>ze.getAvailability(),refetchInterval:3e4,retry:!1}),t=g.data,b=(t==null?void 0:t.source)==="external"?je(`/paper-assets/external/${t.id}/paper.pdf`):We(t==null?void 0:t.url_pdf),A=Ke(t),f=((re=t==null?void 0:t.arxiv_id)==null?void 0:re.replace(/v\d+$/i,""))||n,le=s.useCallback(()=>r(`/paper/${f}`),[f,r]),[P,N]=s.useState(()=>sessionStorage.getItem(k(n))||void 0),[w,E]=s.useState(Fe),[p,V]=s.useState(()=>sessionStorage.getItem(U(n))==="1"),[m,y]=s.useState("paper"),[T,R]=s.useState(),[ue,v]=s.useState(""),[de,pe]=s.useState(()=>q(n)),[S,fe]=s.useState(0),[X,Q]=s.useState(!1),[me,z]=s.useState(!1),C=s.useRef(null),L=s.useRef(null),M=s.useRef(null),Y=s.useRef(null),_=s.useRef(!1),j=s.useRef(0),h=s.useRef(0),F=s.useRef(0),x=s.useRef(w),W=s.useRef(q(n)),H=s.useRef(t==null?void 0:t.version),G=Ae().reset,J=s.useRef(`${n}:${P??"new"}`),c=S>=840;s.useEffect(()=>{const e=`${n}:${P??"new"}`;J.current!==e&&(J.current=e,G())},[P,G,n]),s.useEffect(()=>{t!=null&&t.version&&H.current&&t.version!==H.current&&(R(void 0),v("")),H.current=t==null?void 0:t.version},[t==null?void 0:t.version]),s.useEffect(()=>{window.clearTimeout(j.current),z(!1);const e=sessionStorage.getItem(k(n));N(e||void 0),V(sessionStorage.getItem(U(n))==="1"),y("paper"),R(void 0),v("");const a=q(n);W.current=a,pe(a)},[n]),s.useEffect(()=>()=>{window.clearTimeout(j.current),cancelAnimationFrame(h.current)},[]),s.useLayoutEffect(()=>{const e=C.current;if(!e)return;const a=()=>fe(e.clientWidth);a();const l=new ResizeObserver(a);return l.observe(e),()=>l.disconnect()},[t]),s.useEffect(()=>{if(!t)return;document.title=`${t.title} — Papers With Code reader`;let e=document.querySelector('meta[name="robots"]');const a=!e;e||(e=document.createElement("meta"),e.name="robots",document.head.appendChild(e));const l=e.content;e.content="noindex, nofollow";let u=document.querySelector('link[rel="canonical"]');const Pe=!u;u||(u=document.createElement("link"),u.rel="canonical",document.head.appendChild(u));const ye=u.href;return u.href=`${window.location.origin}/paper/${f}`,()=>{document.title="Papers With Code",a?e==null||e.remove():e&&(e.content=l),Pe?u==null||u.remove():u&&(u.href=ye)}},[f,t]);const I=s.useCallback(e=>{if(!S)return Math.max(45,Math.min(75,e));const a=480/S*100,l=100-360/S*100;return Math.max(a,Math.min(l,e))},[S]);s.useEffect(()=>E(e=>{const a=I(e);return x.current=a,a}),[I]);const $=e=>{const a=I(e);x.current=a,E(a),localStorage.setItem(O,String(a))},Z=e=>{var l;const a=I(e);x.current=a,L.current&&(L.current.style.width=`${a}%`),M.current&&(M.current.style.width=`${100-a}%`),(l=Y.current)==null||l.setAttribute("aria-valuenow",String(Math.round(a)))},ee=e=>{F.current=e,!h.current&&(h.current=requestAnimationFrame(()=>{var l;h.current=0;const a=(l=C.current)==null?void 0:l.getBoundingClientRect();a!=null&&a.width&&Z((F.current-a.left)/a.width*100)}))},he=e=>{_.current=!0,Q(!0),e.currentTarget.setPointerCapture(e.pointerId),ee(e.clientX)},K=()=>{var e;if(_.current){if(h.current){cancelAnimationFrame(h.current),h.current=0;const a=(e=C.current)==null?void 0:e.getBoundingClientRect();a!=null&&a.width&&Z((F.current-a.left)/a.width*100)}_.current=!1,E(x.current),localStorage.setItem(O,String(x.current)),Q(!1)}},te=e=>{window.clearTimeout(j.current),z(!0),V(e),sessionStorage.setItem(U(n),e?"1":"0"),j.current=window.setTimeout(()=>z(!1),Me+40)},ge=e=>{N(e),sessionStorage.setItem(k(n),e)},be=()=>{N(void 0),sessionStorage.removeItem(k(n)),R(void 0),v("")},ve=((ae=d.data)==null?void 0:ae.paper_reader_selection_enabled)===!0,we=e=>{R(e),v(`Selection from page ${e.page} added to chat`),c&&p&&te(!1)},Re=s.useCallback(e=>{R(e),e||v("")},[]),Se=Ie()&&((se=d.data)==null?void 0:se.paper_reader_chat_enabled)!==!1,xe=t&&Se?i.jsx(Le,{mode:"paper",routeSessionId:P,primaryPaper:{id:t.id,routeId:f,title:t.title},currentPage:()=>W.current,paperSelection:T,onPaperSelectionChange:Re,onSessionId:ge,onReaderSubmit:()=>y("assistant"),onReaderNewChat:be}):i.jsx("div",{className:"reader-chat-unavailable",children:"Chat is not enabled for this preview."});return g.isLoading?i.jsx("div",{className:"reader-status",role:"status",children:"Loading paper…"}):g.error||!t?i.jsxs("div",{className:"reader-status",role:"alert",children:[i.jsx("p",{children:"Paper not found."}),i.jsx(B,{to:"/papers",children:"Browse papers"})]}):((ne=d.data)==null?void 0:ne.native_pdf_reader_enabled)===!1?i.jsxs("div",{className:"reader-status",role:"alert",children:[i.jsx("p",{children:"The native reader is currently unavailable."}),i.jsx(B,{to:`/paper/${f}`,children:"Back to paper"})]}):b?i.jsxs("div",{className:"paper-reader-shell",children:[!c&&i.jsxs("div",{className:"reader-tabs",role:"tablist","aria-label":"Reader panels",children:[i.jsx("button",{type:"button",role:"tab","aria-selected":m==="paper",onClick:()=>y("paper"),children:"Paper"}),i.jsxs("button",{type:"button",role:"tab","aria-selected":m==="assistant","aria-label":T&&m!=="assistant"?"Chat, selection attached":"Chat",onClick:()=>y("assistant"),children:["Chat",T&&m!=="assistant"&&i.jsx("span",{className:"reader-tab-pending","aria-hidden":"true"})]})]}),i.jsx(Ne,{variant:"reader",children:i.jsxs("div",{ref:C,className:`reader-workspace${c?" is-desktop":" is-tabs"}${p?" is-assistant-collapsed":""}${X?" is-resizing":""}`,"data-testid":"paper-chat-workspace",children:[i.jsx("section",{ref:L,className:`reader-paper-pane${!c&&m!=="paper"?" is-hidden":""}`,style:c?{width:p?"100%":`${w}%`}:void 0,role:"tabpanel","aria-label":"Paper","aria-hidden":!c&&m!=="paper",children:i.jsx(Ee,{url:b,paperKey:f,paperTitle:t.title,paperHref:`/paper/${f}`,onClose:le,resources:A,initialPage:de,resizeActive:X||me,selectionEnabled:ve,paperVersion:t.version,loadErrorMessage:t.source==="external"?"Paper content is still being prepared. Please try again later.":void 0,onPaperSelection:we,onPaperSelectionError:v,onPageChange:e=>{W.current=e,sessionStorage.setItem(ce(n),String(e))}})}),c&&!p&&i.jsx("div",{ref:Y,className:"reader-resize-handle",role:"separator","aria-label":"Resize paper and Chat panels","aria-orientation":"vertical","aria-valuemin":45,"aria-valuemax":75,"aria-valuenow":Math.round(w),tabIndex:0,onPointerDown:he,onPointerMove:e=>{_.current&&ee(e.clientX)},onPointerUp:K,onPointerCancel:K,onLostPointerCapture:K,onDoubleClick:()=>$(oe),onKeyDown:e=>{(e.key==="ArrowLeft"||e.key==="ArrowRight")&&(e.preventDefault(),$(w+(e.key==="ArrowRight"?2:-2))),e.key==="Home"&&$(45),e.key==="End"&&$(75)}}),i.jsx("aside",{ref:M,id:"reader-chat-panel",className:`reader-assistant-pane${!c&&m!=="assistant"?" is-hidden":""}${c&&p?" is-collapsed":""}`,style:c?{width:p?0:`${100-w}%`}:void 0,role:"tabpanel","aria-label":"Chat","aria-hidden":!c&&m!=="assistant"||p,children:xe}),i.jsx("div",{className:"sr-only","aria-live":"polite",children:ue}),c&&i.jsx("button",{type:"button",className:"reader-collapse-assistant","aria-controls":"reader-chat-panel","aria-expanded":!p,onClick:()=>te(!p),children:p?"Open chat":"Hide chat"})]})})]}):i.jsxs("div",{className:"reader-status",role:"alert",children:[i.jsx("p",{children:"Native reading is unavailable for this resource."}),i.jsx(B,{to:`/paper/${f}`,children:"Back to paper"})]})}function mt(){const{paperId:r=""}=ie();return i.jsx(ke,{workspaceKey:`reader:${r}`,children:i.jsx(Be,{})})}export{mt as default,Ke as readerToolbarResources};
 
 
assets/PapersListView-BjIkvVD9.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{c as X,r as x,A as J,j as e,L as j,i as W}from"./index-CxdnHo9-.js";import{I as U,T as Y,P as Z}from"./components-BH6Cy8IX.js";import{c as ee}from"./catalog-BRjI2ow6.js";import{t as se,d as ae}from"./transform-CArGBSok.js";import{u as re,a as te}from"./usePapers-CD7ebaIw.js";import{u as ne}from"./useDebounce-BRVOcJh3.js";import{u as ie,P as oe}from"./useIntersectionObserver-2PEjywgc.js";import{S as _}from"./skeleton-B_RgoAAL.js";import{A as ce,a as le}from"./alert-BQ0_qoe3.js";import{u as de}from"./useQuery-D8Q6gREv.js";import{a as me,P as he,b as pe}from"./PaperDateFilter-C9tnni-Y.js";import"./paperQueryKeys-CcqbH5YG.js";import"./LatexTitle-ih-jCKpS.js";import"./katex.min-BSBacQyE.js";import"./papers-BwPS4QGO.js";import"./safeExternalHref-CkBrsh84.js";import"./useInfiniteQuery-BUi2pe7X.js";import"./popover-DEMAeJxN.js";const v=360;function ue(a,o){const m=a.toLocaleLowerCase();return o.trim().split(/\s+/).filter(Boolean).reduce((c,t)=>{const l=m.indexOf(t.toLocaleLowerCase());return l>=0&&(c<0||l<c)?l:c},-1)}function z(a,o,m){if((a.slice(0,o).match(/\$/g)||[]).length%2===0)return o;if(m==="start")return a.lastIndexOf("$",o)+1;const t=a.indexOf("$",o);return t>=0?t+1:o}function fe(a,o){if(a.length<=v)return a;const m=ue(a,o);if(m<0||m<v*.6)return a;let c=Math.max(0,m-Math.floor(v*.35)),t=Math.min(a.length,c+v);return c=z(a,c,"start"),t=z(a,t,"end"),`${c>0?"…":""}${a.slice(c,t).trim()}${t<a.length?"…":""}`}const xe=[["trending","trending"],["new","newest"],["cited","most cited"]],ge=[["relevance","relevance"],["new","newest"],["cited","most cited"]],je=a=>new Intl.NumberFormat("en",{notation:a>=1e3?"compact":"standard",maximumFractionDigits:1}).format(a),Oe=()=>{var I,$,T,O,B,H,M,q,G;const[a,o]=X(),m=a.get("framework")||void 0,c=a.get("repository")||void 0,t=!!(m||c),l=a.get("search")||"",[F,C]=x.useState(l),p=ne(F,300),n=!t&&l.trim().length>0;x.useEffect(()=>C(l),[l]),x.useEffect(()=>{if(p===l)return;const s=new URLSearchParams(a);p?s.set("search",p):s.delete("search"),o(s,{replace:!0})},[p]),x.useEffect(()=>{const s=a.get("order_by"),i=new URLSearchParams(a);n&&!["relevance","date_published","citation_count"].includes(s||"")?(i.set("order_by","relevance"),o(i,{replace:!0})):!n&&s==="relevance"&&(i.delete("order_by"),o(i,{replace:!0}))},[n,a,o]);const L=a.get("order_by"),g=L==="citation_count"?"cited":L==="date_published"?"new":n?"relevance":"trending",u=me(a),w=a.get("has_hf_artifacts")==="true",k=!t&&a.get("has_code")==="true",y=(s,i)=>{const h=new URLSearchParams(a);i?h.set(s,i):h.delete(s),o(h)},Q=s=>{y("order_by",s==="cited"?"citation_count":s==="new"?"date_published":s)},b=re({page_size:20,order_by:g==="trending"?"trending":g==="cited"?"citation_count":"date_published",order_dir:"desc",search:t&&p||void 0,start_date:u.startDate,end_date:u.endDate,include_resources:!0,conference:a.get("conference")||void 0,latest_only:a.get("latest_only")!=="false",has_code:k,has_hf_artifacts:w,framework:m,repository:c,enabled:!n}),R=te({q:p.trim(),order_by:g==="cited"?"citation_count":g==="new"?"date_published":"relevance",start_date:u.startDate,end_date:u.endDate,has_code:k,has_hf_artifacts:w,enabled:n}),d=n?R:b,A=de({queryKey:["top-tasks-sidebar"],queryFn:()=>ee.topTasks(8),enabled:!t&&!n,staleTime:10*60*1e3}),N=x.useMemo(()=>{var i;return(((i=d.data)==null?void 0:i.pages.flatMap(h=>h.results))||[]).map(h=>{const S=se(h);return n?{...S,abstract:fe(S.abstract,l)}:S})},[d.data,n,l]),{targetRef:K,isIntersecting:D}=ie({rootMargin:"200px"});x.useEffect(()=>{D&&d.hasNextPage&&!d.isFetchingNextPage&&d.fetchNextPage()},[D,d.hasNextPage,d.isFetchingNextPage]);const f=((T=($=(I=b.data)==null?void 0:I.pages)==null?void 0:$[0])==null?void 0:T.count)??0,r=(H=(B=(O=b.data)==null?void 0:O.pages)==null?void 0:B[0])==null?void 0:H.scope,P=(q=(M=R.data)==null?void 0:M.pages)==null?void 0:q.at(-1),E=m&&d.error instanceof J&&d.error.status===404,V=(r==null?void 0:r.kind)==="framework"?r.framework_name:r==null?void 0:r.repository;return e.jsxs("div",{className:"page",children:[(r==null?void 0:r.kind)==="framework"&&e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(j,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(j,{to:"/frameworks",children:"Frameworks"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:r.framework_name})]}),e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:t?e.jsxs(e.Fragment,{children:["Papers implemented by ",e.jsx("em",{children:V||m||c})]}):n?e.jsxs(e.Fragment,{children:["Search results for ",e.jsxs("em",{children:["“",l,"”"]})]}):e.jsxs(e.Fragment,{children:["All ",e.jsx("em",{children:"Papers"})]})}),e.jsx("div",{className:"feed-subtitle",children:t?(r==null?void 0:r.kind)==="framework"?f>0&&`${f.toLocaleString()} papers.`:r!=null&&r.repository?e.jsxs(e.Fragment,{children:["GitHub repository ",e.jsx("strong",{children:r.repository}),". ",f>0&&`${f.toLocaleString()} papers.`]}):"Repository-scoped paper feed.":n?`${N.length} loaded from the most relevant results.`:e.jsxs(e.Fragment,{children:["Search the full corpus. ",f>0&&`${f.toLocaleString()} papers indexed.`]})}),t&&r&&e.jsxs("div",{className:"paper-feed-scope-links",children:[e.jsxs("div",{className:"paper-feed-primary-links",children:[r.github_url&&e.jsxs("a",{href:r.github_url,target:"_blank",rel:"noopener noreferrer",className:r.kind==="framework"?"task-framework-link":"framework-link",children:[e.jsx(U,{name:"github",size:13}),r.kind==="framework"?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:r.repository||"GitHub"}),r.num_stars!=null&&e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",je(r.num_stars)]})]}):"GitHub"]}),r.kind==="framework"&&r.introducing_paper_arxiv_id&&e.jsx(j,{to:`/paper/${r.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"})]}),r.kind==="framework"&&r.recommended_tasks&&r.recommended_tasks.length>0&&e.jsx("div",{className:"paper-feed-task-tags",children:r.recommended_tasks.map(s=>s.slug?e.jsx(Y,{slug:s.slug,label:s.name},s.id):null)})]})]}),e.jsx(he,{startDate:u.startDate,endDate:u.endDate,onChange:s=>o(pe(a,s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(U,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:F,onChange:s=>C(s.target.value)})]})}),e.jsxs("div",{className:t||n?"papers-feed-layout-scoped":"layout-with-sidebar",children:[!t&&!n&&e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),A.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,i)=>e.jsx(_,{className:"h-5 w-full"},i))}),(G=A.data)==null?void 0:G.map(s=>e.jsxs(j,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[ae(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:(n?ge:xe).map(([s,i])=>e.jsx("button",{className:`sort-btn ${g===s?"active":""}`,onClick:()=>Q(s),children:i},s))}),e.jsx(oe,{hasCode:k,hasHfArtifacts:w,onHasCodeChange:s=>y("has_code",s?"true":void 0),onHasHfArtifactsChange:s=>y("has_hf_artifacts",s?"true":void 0),showHasCode:!t})]}),e.jsxs("div",{className:"results-count",children:[N.length," loaded"]})]}),E?e.jsx("div",{className:"no-results",children:"Framework not found."}):d.error&&e.jsx(ce,{variant:"destructive",className:"mb-4",children:e.jsx(le,{children:"Failed to load papers. Please try again."})}),!E&&(d.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,i)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(_,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(_,{className:"h-6 w-3/4"}),e.jsx(_,{className:"h-4 w-1/2"}),e.jsx(_,{className:"h-12 w-full"})]})]},i))}):N.length===0?e.jsxs("div",{className:"no-results",children:[e.jsx("p",{children:"No matching papers."}),n&&W()&&e.jsx(j,{to:`/chat?q=${encodeURIComponent(l.trim())}`,children:"Ask the assistant instead"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:N.map((s,i)=>e.jsx(Z,{paper:s,rank:i+1,highlightQuery:n?l:void 0},s.id))}),e.jsx("div",{ref:K,style:{height:1}}),d.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"}),!d.hasNextPage&&!d.isFetchingNextPage&&n&&e.jsx("div",{className:"search-results-end",children:P!=null&&P.cap_reached?"End of the top 100 results":"End of results"})]}))]})]})]})};export{Oe as default};
assets/PapersListView-g7JsSUEB.js DELETED
@@ -1 +0,0 @@
1
- import{c as X,r as x,A as J,j as e,L as j,i as W}from"./index-DVQGVzHu.js";import{I as U,T as Y,P as Z}from"./components-_zRgatMC.js";import{c as ee}from"./catalog-Da4k4qEI.js";import{t as se,d as ae}from"./transform-PseCN9bN.js";import{u as re,a as te}from"./usePapers-a_mp-Uw3.js";import{u as ne}from"./useDebounce-R9QstKeY.js";import{u as ie,P as oe}from"./useIntersectionObserver-IRMyVQkj.js";import{S as _}from"./skeleton-DJUh-5VW.js";import{A as ce,a as le}from"./alert-7mO5HIuQ.js";import{u as de}from"./useQuery-tFDel9EL.js";import{a as me,P as he,b as pe}from"./PaperDateFilter-BH56Is-x.js";import"./LatexTitle-B0TwWoUu.js";import"./katex.min-BSBacQyE.js";import"./papers-DlaCqfyl.js";import"./safeExternalHref-CkBrsh84.js";import"./useInfiniteQuery-CYdxlDgS.js";import"./popover-Beg3zsfL.js";const v=360;function ue(a,o){const m=a.toLocaleLowerCase();return o.trim().split(/\s+/).filter(Boolean).reduce((c,t)=>{const l=m.indexOf(t.toLocaleLowerCase());return l>=0&&(c<0||l<c)?l:c},-1)}function z(a,o,m){if((a.slice(0,o).match(/\$/g)||[]).length%2===0)return o;if(m==="start")return a.lastIndexOf("$",o)+1;const t=a.indexOf("$",o);return t>=0?t+1:o}function fe(a,o){if(a.length<=v)return a;const m=ue(a,o);if(m<0||m<v*.6)return a;let c=Math.max(0,m-Math.floor(v*.35)),t=Math.min(a.length,c+v);return c=z(a,c,"start"),t=z(a,t,"end"),`${c>0?"…":""}${a.slice(c,t).trim()}${t<a.length?"…":""}`}const xe=[["trending","trending"],["new","newest"],["cited","most cited"]],ge=[["relevance","relevance"],["new","newest"],["cited","most cited"]],je=a=>new Intl.NumberFormat("en",{notation:a>=1e3?"compact":"standard",maximumFractionDigits:1}).format(a),Te=()=>{var I,$,T,O,B,H,M,q,G;const[a,o]=X(),m=a.get("framework")||void 0,c=a.get("repository")||void 0,t=!!(m||c),l=a.get("search")||"",[F,C]=x.useState(l),p=ne(F,300),n=!t&&l.trim().length>0;x.useEffect(()=>C(l),[l]),x.useEffect(()=>{if(p===l)return;const s=new URLSearchParams(a);p?s.set("search",p):s.delete("search"),o(s,{replace:!0})},[p]),x.useEffect(()=>{const s=a.get("order_by"),i=new URLSearchParams(a);n&&!["relevance","date_published","citation_count"].includes(s||"")?(i.set("order_by","relevance"),o(i,{replace:!0})):!n&&s==="relevance"&&(i.delete("order_by"),o(i,{replace:!0}))},[n,a,o]);const L=a.get("order_by"),g=L==="citation_count"?"cited":L==="date_published"?"new":n?"relevance":"trending",u=me(a),w=a.get("has_hf_artifacts")==="true",k=!t&&a.get("has_code")==="true",y=(s,i)=>{const h=new URLSearchParams(a);i?h.set(s,i):h.delete(s),o(h)},Q=s=>{y("order_by",s==="cited"?"citation_count":s==="new"?"date_published":s)},b=re({page_size:20,order_by:g==="trending"?"trending":g==="cited"?"citation_count":"date_published",order_dir:"desc",search:t&&p||void 0,start_date:u.startDate,end_date:u.endDate,include_resources:!0,conference:a.get("conference")||void 0,latest_only:a.get("latest_only")!=="false",has_code:k,has_hf_artifacts:w,framework:m,repository:c,enabled:!n}),R=te({q:p.trim(),order_by:g==="cited"?"citation_count":g==="new"?"date_published":"relevance",start_date:u.startDate,end_date:u.endDate,has_code:k,has_hf_artifacts:w,enabled:n}),d=n?R:b,A=de({queryKey:["top-tasks-sidebar"],queryFn:()=>ee.topTasks(8),enabled:!t&&!n,staleTime:10*60*1e3}),N=x.useMemo(()=>{var i;return(((i=d.data)==null?void 0:i.pages.flatMap(h=>h.results))||[]).map(h=>{const S=se(h);return n?{...S,abstract:fe(S.abstract,l)}:S})},[d.data,n,l]),{targetRef:K,isIntersecting:D}=ie({rootMargin:"200px"});x.useEffect(()=>{D&&d.hasNextPage&&!d.isFetchingNextPage&&d.fetchNextPage()},[D,d.hasNextPage,d.isFetchingNextPage]);const f=((T=($=(I=b.data)==null?void 0:I.pages)==null?void 0:$[0])==null?void 0:T.count)??0,r=(H=(B=(O=b.data)==null?void 0:O.pages)==null?void 0:B[0])==null?void 0:H.scope,P=(q=(M=R.data)==null?void 0:M.pages)==null?void 0:q.at(-1),E=m&&d.error instanceof J&&d.error.status===404,V=(r==null?void 0:r.kind)==="framework"?r.framework_name:r==null?void 0:r.repository;return e.jsxs("div",{className:"page",children:[(r==null?void 0:r.kind)==="framework"&&e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(j,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(j,{to:"/frameworks",children:"Frameworks"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:r.framework_name})]}),e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:t?e.jsxs(e.Fragment,{children:["Papers implemented by ",e.jsx("em",{children:V||m||c})]}):n?e.jsxs(e.Fragment,{children:["Search results for ",e.jsxs("em",{children:["“",l,"”"]})]}):e.jsxs(e.Fragment,{children:["All ",e.jsx("em",{children:"Papers"})]})}),e.jsx("div",{className:"feed-subtitle",children:t?(r==null?void 0:r.kind)==="framework"?f>0&&`${f.toLocaleString()} papers.`:r!=null&&r.repository?e.jsxs(e.Fragment,{children:["GitHub repository ",e.jsx("strong",{children:r.repository}),". ",f>0&&`${f.toLocaleString()} papers.`]}):"Repository-scoped paper feed.":n?`${N.length} loaded from the most relevant results.`:e.jsxs(e.Fragment,{children:["Search the full corpus. ",f>0&&`${f.toLocaleString()} papers indexed.`]})}),t&&r&&e.jsxs("div",{className:"paper-feed-scope-links",children:[e.jsxs("div",{className:"paper-feed-primary-links",children:[r.github_url&&e.jsxs("a",{href:r.github_url,target:"_blank",rel:"noopener noreferrer",className:r.kind==="framework"?"task-framework-link":"framework-link",children:[e.jsx(U,{name:"github",size:13}),r.kind==="framework"?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:r.repository||"GitHub"}),r.num_stars!=null&&e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",je(r.num_stars)]})]}):"GitHub"]}),r.kind==="framework"&&r.introducing_paper_arxiv_id&&e.jsx(j,{to:`/paper/${r.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"})]}),r.kind==="framework"&&r.recommended_tasks&&r.recommended_tasks.length>0&&e.jsx("div",{className:"paper-feed-task-tags",children:r.recommended_tasks.map(s=>s.slug?e.jsx(Y,{slug:s.slug,label:s.name},s.id):null)})]})]}),e.jsx(he,{startDate:u.startDate,endDate:u.endDate,onChange:s=>o(pe(a,s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(U,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:F,onChange:s=>C(s.target.value)})]})}),e.jsxs("div",{className:t||n?"papers-feed-layout-scoped":"layout-with-sidebar",children:[!t&&!n&&e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),A.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,i)=>e.jsx(_,{className:"h-5 w-full"},i))}),(G=A.data)==null?void 0:G.map(s=>e.jsxs(j,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[ae(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:(n?ge:xe).map(([s,i])=>e.jsx("button",{className:`sort-btn ${g===s?"active":""}`,onClick:()=>Q(s),children:i},s))}),e.jsx(oe,{hasCode:k,hasHfArtifacts:w,onHasCodeChange:s=>y("has_code",s?"true":void 0),onHasHfArtifactsChange:s=>y("has_hf_artifacts",s?"true":void 0),showHasCode:!t})]}),e.jsxs("div",{className:"results-count",children:[N.length," loaded"]})]}),E?e.jsx("div",{className:"no-results",children:"Framework not found."}):d.error&&e.jsx(ce,{variant:"destructive",className:"mb-4",children:e.jsx(le,{children:"Failed to load papers. Please try again."})}),!E&&(d.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,i)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(_,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(_,{className:"h-6 w-3/4"}),e.jsx(_,{className:"h-4 w-1/2"}),e.jsx(_,{className:"h-12 w-full"})]})]},i))}):N.length===0?e.jsxs("div",{className:"no-results",children:[e.jsx("p",{children:"No matching papers."}),n&&W()&&e.jsx(j,{to:`/chat?q=${encodeURIComponent(l.trim())}`,children:"Ask the assistant instead"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:N.map((s,i)=>e.jsx(Z,{paper:s,rank:i+1,highlightQuery:n?l:void 0},s.id))}),e.jsx("div",{ref:K,style:{height:1}}),d.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"}),!d.hasNextPage&&!d.isFetchingNextPage&&n&&e.jsx("div",{className:"search-results-end",children:P!=null&&P.cap_reached?"End of the top 100 results":"End of results"})]}))]})]})]})};export{Te as default};
 
 
assets/{PrivacyView-B9McxXg9.js → PrivacyView-Dx303QiW.js} RENAMED
@@ -1 +1 @@
1
- import{z as s,j as e}from"./index-DVQGVzHu.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};
 
1
+ import{z as s,j as e}from"./index-CxdnHo9-.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-DIlzUj6W.js → RateLimitsView-K0cHBNIJ.js} RENAMED
@@ -1 +1 @@
1
- import{j as e,B as t}from"./index-DVQGVzHu.js";import{u as s}from"./useQuery-tFDel9EL.js";const n=()=>{const i=s({queryKey:["submission-rate-limit-policy"],queryFn:()=>t.getRateLimitPolicy()}).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{n as default};
 
1
+ import{j as e,B as t}from"./index-CxdnHo9-.js";import{u as s}from"./useQuery-D8Q6gREv.js";const n=()=>{const i=s({queryKey:["submission-rate-limit-policy"],queryFn:()=>t.getRateLimitPolicy()}).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{n as default};
assets/SavedPapersView-CzP8sHZl.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{a as h,A as g,j as e,H as v,L as x,B as j}from"./index-CxdnHo9-.js";import{p as f}from"./paperQueryKeys-CcqbH5YG.js";import{u as N}from"./useQuery-D8Q6gREv.js";import{T as b,P as k}from"./components-BH6Cy8IX.js";import{S as r}from"./skeleton-B_RgoAAL.js";import{A as y,a as w}from"./alert-BQ0_qoe3.js";import{t as A}from"./transform-CArGBSok.js";import{s as B}from"./savedPapersAuth-CFVpi2ay.js";import"./LatexTitle-ih-jCKpS.js";import"./katex.min-BSBacQyE.js";import"./papers-BwPS4QGO.js";import"./safeExternalHref-CkBrsh84.js";const Y=()=>{var c,o;const{user:t,isLoading:u}=h(),a=N({queryKey:[...f.feeds.saved],queryFn:()=>j.getBookmarks(),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,d=()=>{window.location.assign(B())};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:[(c=a.data)!=null&&c.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:d,children:"Approve and migrate saved papers"})]}):a.error?e.jsx(y,{variant:"destructive",className:"mb-4",children:e.jsx(w,{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:d,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(k,{paper:A(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{Y as default};