diff --git a/assets/AgentLogos-06t31xxf.js b/assets/AgentLogos-C9q7zZc4.js similarity index 99% rename from assets/AgentLogos-06t31xxf.js rename to assets/AgentLogos-C9q7zZc4.js index 634b39613cfac63375499a8f9205ea4cb46de43e..09d1653715a872d12ef53ba1ba9b0d0305ddfee5 100644 --- a/assets/AgentLogos-06t31xxf.js +++ b/assets/AgentLogos-C9q7zZc4.js @@ -1 +1 @@ -import{j as e}from"./index-3CfcAX6N.js";const s="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='256'%20height='257'%20preserveAspectRatio='xMidYMid'%20viewBox='0%200%20256%20257'%3e%3cpath%20fill='%23D97757'%20d='m50.228%20170.321%2050.357-28.257.843-2.463-.843-1.361h-2.462l-8.426-.518-28.775-.778-24.952-1.037-24.175-1.296-6.092-1.297L0%20125.796l.583-3.759%205.12-3.434%207.324.648%2016.202%201.101%2024.304%201.685%2017.629%201.037%2026.118%202.722h4.148l.583-1.685-1.426-1.037-1.101-1.037-25.147-17.045-27.22-18.017-14.258-10.37-7.713-5.25-3.888-4.925-1.685-10.758%207-7.713%209.397.649%202.398.648%209.527%207.323%2020.35%2015.75L94.817%2091.9l3.889%203.24%201.555-1.102.195-.777-1.75-2.917-14.453-26.118-15.425-26.572-6.87-11.018-1.814-6.61c-.648-2.723-1.102-4.991-1.102-7.778l7.972-10.823L71.42%200%2082.05%201.426l4.472%203.888%206.61%2015.101%2010.694%2023.786%2016.591%2032.34%204.861%209.592%202.592%208.879.973%202.722h1.685v-1.556l1.36-18.211%202.528-22.36%202.463-28.776.843-8.1%204.018-9.722%207.971-5.25%206.222%202.981%205.12%207.324-.713%204.73-3.046%2019.768-5.962%2030.98-3.889%2020.739h2.268l2.593-2.593%2010.499-13.934%2017.628-22.036%207.778-8.749%209.073-9.657%205.833-4.601h11.018l8.1%2012.055-3.628%2012.443-11.342%2014.388-9.398%2012.184-13.48%2018.147-8.426%2014.518.778%201.166%202.01-.194%2030.46-6.481%2016.462-2.982%2019.637-3.37%208.88%204.148.971%204.213-3.5%208.62-20.998%205.184-24.628%204.926-36.682%208.685-.454.324.519.648%2016.526%201.555%207.065.389h17.304l32.21%202.398%208.426%205.574%205.055%206.805-.843%205.184-12.962%206.611-17.498-4.148-40.83-9.721-14-3.5h-1.944v1.167l11.666%2011.406%2021.387%2019.314%2026.767%2024.887%201.36%206.157-3.434%204.86-3.63-.518-23.526-17.693-9.073-7.972-20.545-17.304h-1.36v1.814l4.73%206.935%2025.017%2037.59%201.296%2011.536-1.814%203.76-6.481%202.268-7.13-1.297-14.647-20.544-15.1-23.138-12.185-20.739-1.49.843-7.194%2077.448-3.37%203.953-7.778%202.981-6.48-4.925-3.436-7.972%203.435-15.749%204.148-20.544%203.37-16.333%203.046-20.285%201.815-6.74-.13-.454-1.49.194-15.295%2020.999-23.267%2031.433-18.406%2019.702-4.407%201.75-7.648-3.954.713-7.064%204.277-6.286%2025.47-32.405%2015.36-20.092%209.917-11.6-.065-1.686h-.583L44.07%20198.125l-12.055%201.555-5.185-4.86.648-7.972%202.463-2.593%2020.35-13.999-.064.065Z'/%3e%3c/svg%3e",a="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='256'%20height='257'%20preserveAspectRatio='xMidYMid'%20viewBox='0%200%20256%20257'%3e%3cpath%20fill='%23D97757'%20d='m50.228%20170.321%2050.357-28.257.843-2.463-.843-1.361h-2.462l-8.426-.518-28.775-.778-24.952-1.037-24.175-1.296-6.092-1.297L0%20125.796l.583-3.759%205.12-3.434%207.324.648%2016.202%201.101%2024.304%201.685%2017.629%201.037%2026.118%202.722h4.148l.583-1.685-1.426-1.037-1.101-1.037-25.147-17.045-27.22-18.017-14.258-10.37-7.713-5.25-3.888-4.925-1.685-10.758%207-7.713%209.397.649%202.398.648%209.527%207.323%2020.35%2015.75L94.817%2091.9l3.889%203.24%201.555-1.102.195-.777-1.75-2.917-14.453-26.118-15.425-26.572-6.87-11.018-1.814-6.61c-.648-2.723-1.102-4.991-1.102-7.778l7.972-10.823L71.42%200%2082.05%201.426l4.472%203.888%206.61%2015.101%2010.694%2023.786%2016.591%2032.34%204.861%209.592%202.592%208.879.973%202.722h1.685v-1.556l1.36-18.211%202.528-22.36%202.463-28.776.843-8.1%204.018-9.722%207.971-5.25%206.222%202.981%205.12%207.324-.713%204.73-3.046%2019.768-5.962%2030.98-3.889%2020.739h2.268l2.593-2.593%2010.499-13.934%2017.628-22.036%207.778-8.749%209.073-9.657%205.833-4.601h11.018l8.1%2012.055-3.628%2012.443-11.342%2014.388-9.398%2012.184-13.48%2018.147-8.426%2014.518.778%201.166%202.01-.194%2030.46-6.481%2016.462-2.982%2019.637-3.37%208.88%204.148.971%204.213-3.5%208.62-20.998%205.184-24.628%204.926-36.682%208.685-.454.324.519.648%2016.526%201.555%207.065.389h17.304l32.21%202.398%208.426%205.574%205.055%206.805-.843%205.184-12.962%206.611-17.498-4.148-40.83-9.721-14-3.5h-1.944v1.167l11.666%2011.406%2021.387%2019.314%2026.767%2024.887%201.36%206.157-3.434%204.86-3.63-.518-23.526-17.693-9.073-7.972-20.545-17.304h-1.36v1.814l4.73%206.935%2025.017%2037.59%201.296%2011.536-1.814%203.76-6.481%202.268-7.13-1.297-14.647-20.544-15.1-23.138-12.185-20.739-1.49.843-7.194%2077.448-3.37%203.953-7.778%202.981-6.48-4.925-3.436-7.972%203.435-15.749%204.148-20.544%203.37-16.333%203.046-20.285%201.815-6.74-.13-.454-1.49.194-15.295%2020.999-23.267%2031.433-18.406%2019.702-4.407%201.75-7.648-3.954.713-7.064%204.277-6.286%2025.47-32.405%2015.36-20.092%209.917-11.6-.065-1.686h-.583L44.07%20198.125l-12.055%201.555-5.185-4.86.648-7.972%202.463-2.593%2020.35-13.999-.064.065Z'/%3e%3c/svg%3e",h="data:image/svg+xml,%3csvg%20fill='%23111'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eCodex%3c/title%3e%3cpath%20clip-rule='evenodd'%20d='M8.086.457a6.105%206.105%200%20013.046-.415c1.333.153%202.521.72%203.564%201.7a.117.117%200%2000.107.029c1.408-.346%202.762-.224%204.061.366l.063.03.154.076c1.357.703%202.33%201.77%202.918%203.198.278.679.418%201.388.421%202.126a5.655%205.655%200%2001-.18%201.631.167.167%200%2000.04.155%205.982%205.982%200%20011.578%202.891c.385%201.901-.01%203.615-1.183%205.14l-.182.22a6.063%206.063%200%2001-2.934%201.851.162.162%200%2000-.108.102c-.255.736-.511%201.364-.987%201.992-1.199%201.582-2.962%202.462-4.948%202.451-1.583-.008-2.986-.587-4.21-1.736a.145.145%200%2000-.14-.032c-.518.167-1.04.191-1.604.185a5.924%205.924%200%2001-2.595-.622%206.058%206.058%200%2001-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74%207.74%200%2001-.495-1.283%206.11%206.11%200%2001-.017-3.064.166.166%200%2000.008-.074.115.115%200%2000-.037-.064%205.958%205.958%200%2001-1.38-2.202%205.196%205.196%200%2001-.333-1.589%206.915%206.915%200%2001.188-2.132c.45-1.484%201.309-2.648%202.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129%200%2000.087-.087A6.016%206.016%200%20015.635%202.31C6.315%201.464%207.132.846%208.086.457zm-.804%207.85a.848.848%200%2000-1.473.842l1.694%202.965-1.688%202.848a.849.849%200%20001.46.864l1.94-3.272a.849.849%200%2000.007-.854l-1.94-3.393zm5.446%206.24a.849.849%200%20000%201.695h4.848a.849.849%200%20000-1.696h-4.848z'%3e%3c/path%3e%3c/svg%3e",o="data:image/svg+xml,%3csvg%20fill='%23fff'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eCodex%3c/title%3e%3cpath%20clip-rule='evenodd'%20d='M8.086.457a6.105%206.105%200%20013.046-.415c1.333.153%202.521.72%203.564%201.7a.117.117%200%2000.107.029c1.408-.346%202.762-.224%204.061.366l.063.03.154.076c1.357.703%202.33%201.77%202.918%203.198.278.679.418%201.388.421%202.126a5.655%205.655%200%2001-.18%201.631.167.167%200%2000.04.155%205.982%205.982%200%20011.578%202.891c.385%201.901-.01%203.615-1.183%205.14l-.182.22a6.063%206.063%200%2001-2.934%201.851.162.162%200%2000-.108.102c-.255.736-.511%201.364-.987%201.992-1.199%201.582-2.962%202.462-4.948%202.451-1.583-.008-2.986-.587-4.21-1.736a.145.145%200%2000-.14-.032c-.518.167-1.04.191-1.604.185a5.924%205.924%200%2001-2.595-.622%206.058%206.058%200%2001-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74%207.74%200%2001-.495-1.283%206.11%206.11%200%2001-.017-3.064.166.166%200%2000.008-.074.115.115%200%2000-.037-.064%205.958%205.958%200%2001-1.38-2.202%205.196%205.196%200%2001-.333-1.589%206.915%206.915%200%2001.188-2.132c.45-1.484%201.309-2.648%202.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129%200%2000.087-.087A6.016%206.016%200%20015.635%202.31C6.315%201.464%207.132.846%208.086.457zm-.804%207.85a.848.848%200%2000-1.473.842l1.694%202.965-1.688%202.848a.849.849%200%20001.46.864l1.94-3.272a.849.849%200%2000.007-.854l-1.94-3.393zm5.446%206.24a.849.849%200%20000%201.695h4.848a.849.849%200%20000-1.696h-4.848z'%3e%3c/path%3e%3c/svg%3e",r="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='cursor_light__Ebene_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20466.73%20532.09'%3e%3c!--Generator:%20Adobe%20Illustrator%2029.6.1,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.1%20Build%209)--%3e%3cdefs%3e%3cstyle%3e.cursor_light__st0{fill:%2326251e}%3c/style%3e%3c/defs%3e%3cpath%20class='cursor_light__st0'%20d='M457.43,125.94L244.42,2.96c-6.84-3.95-15.28-3.95-22.12,0L9.3,125.94c-5.75,3.32-9.3,9.46-9.3,16.11v247.99c0,6.65,3.55,12.79,9.3,16.11l213.01,122.98c6.84,3.95,15.28,3.95,22.12,0l213.01-122.98c5.75-3.32,9.3-9.46,9.3-16.11v-247.99c0-6.65-3.55-12.79-9.3-16.11h-.01ZM444.05,151.99l-205.63,356.16c-1.39,2.4-5.06,1.42-5.06-1.36v-233.21c0-4.66-2.49-8.97-6.53-11.31L24.87,145.67c-2.4-1.39-1.42-5.06,1.36-5.06h411.26c5.84,0,9.49,6.33,6.57,11.39h-.01Z'/%3e%3c/svg%3e",d="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='cursor_dark__Ebene_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20466.73%20532.09'%3e%3c!--Generator:%20Adobe%20Illustrator%2029.6.1,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.1%20Build%209)--%3e%3cdefs%3e%3cstyle%3e.cursor_dark__st0{fill:%23edecec}%3c/style%3e%3c/defs%3e%3cpath%20class='cursor_dark__st0'%20d='M457.43,125.94L244.42,2.96c-6.84-3.95-15.28-3.95-22.12,0L9.3,125.94c-5.75,3.32-9.3,9.46-9.3,16.11v247.99c0,6.65,3.55,12.79,9.3,16.11l213.01,122.98c6.84,3.95,15.28,3.95,22.12,0l213.01-122.98c5.75-3.32,9.3-9.46,9.3-16.11v-247.99c0-6.65-3.55-12.79-9.3-16.11h-.01ZM444.05,151.99l-205.63,356.16c-1.39,2.4-5.06,1.42-5.06-1.36v-233.21c0-4.66-2.49-8.97-6.53-11.31L24.87,145.67c-2.4-1.39-1.42-5.06,1.36-5.06h411.26c5.84,0,9.49,6.33,6.57,11.39h-.01Z'/%3e%3c/svg%3e",n="data:image/svg+xml,%3csvg%20width='512'%20height='512'%20viewBox='0%200%20512%20512'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='512'%20height='512'%20fill='%23FDFCFC'/%3e%3cpath%20d='M320%20224V352H192V224H320Z'%20fill='%23E6E5E6'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M384%20416H128V96H384V416ZM320%20160H192V352H320V160Z'%20fill='%2317181C'/%3e%3c/svg%3e",g="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='512'%20height='512'%3e%3csvg%20width='512'%20height='512'%20viewBox='0%200%20512%20512'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='512'%20height='512'%20fill='%23131010'%3e%3c/rect%3e%3cpath%20d='M320%20224V352H192V224H320Z'%20fill='%235A5858'%3e%3c/path%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M384%20416H128V96H384V416ZM320%20160H192V352H320V160Z'%20fill='white'%3e%3c/path%3e%3c/svg%3e%3cstyle%3e@media%20(prefers-color-scheme:%20light)%20{%20:root%20{%20filter:%20none;%20}%20}%20@media%20(prefers-color-scheme:%20dark)%20{%20:root%20{%20filter:%20none;%20}%20}%20%3c/style%3e%3c/svg%3e",i=[{name:"Claude",light:s,dark:a},{name:"Codex",light:h,dark:o},{name:"Cursor",light:r,dark:d},{name:"OpenCode",light:n,dark:g}];function w(){return e.jsx("span",{className:"inline-flex shrink-0 items-center gap-1.5","aria-hidden":"true",children:i.map(({name:l,light:t,dark:c})=>e.jsxs("span",{title:l,className:"inline-flex h-[18px] w-[18px]",children:[e.jsx("img",{src:t,alt:"",width:18,height:18,className:"h-full w-full object-contain dark:hidden"}),e.jsx("img",{src:c,alt:"",width:18,height:18,className:"hidden h-full w-full object-contain dark:block"})]},l))})}function x(){return e.jsx("ul",{className:"flex flex-wrap gap-2","aria-label":"Supported coding agents",children:i.map(({name:l,light:t,dark:c})=>e.jsxs("li",{className:"inline-flex items-center gap-2 rounded-full border px-3 py-1 text-sm",children:[e.jsx("img",{src:t,alt:"",width:18,height:18,className:"h-[18px] w-[18px] object-contain dark:hidden"}),e.jsx("img",{src:c,alt:"",width:18,height:18,className:"hidden h-[18px] w-[18px] object-contain dark:block"}),l]},l))})}export{w as A,x as a}; +import{j as e}from"./index-CxhY4zQ1.js";const s="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='256'%20height='257'%20preserveAspectRatio='xMidYMid'%20viewBox='0%200%20256%20257'%3e%3cpath%20fill='%23D97757'%20d='m50.228%20170.321%2050.357-28.257.843-2.463-.843-1.361h-2.462l-8.426-.518-28.775-.778-24.952-1.037-24.175-1.296-6.092-1.297L0%20125.796l.583-3.759%205.12-3.434%207.324.648%2016.202%201.101%2024.304%201.685%2017.629%201.037%2026.118%202.722h4.148l.583-1.685-1.426-1.037-1.101-1.037-25.147-17.045-27.22-18.017-14.258-10.37-7.713-5.25-3.888-4.925-1.685-10.758%207-7.713%209.397.649%202.398.648%209.527%207.323%2020.35%2015.75L94.817%2091.9l3.889%203.24%201.555-1.102.195-.777-1.75-2.917-14.453-26.118-15.425-26.572-6.87-11.018-1.814-6.61c-.648-2.723-1.102-4.991-1.102-7.778l7.972-10.823L71.42%200%2082.05%201.426l4.472%203.888%206.61%2015.101%2010.694%2023.786%2016.591%2032.34%204.861%209.592%202.592%208.879.973%202.722h1.685v-1.556l1.36-18.211%202.528-22.36%202.463-28.776.843-8.1%204.018-9.722%207.971-5.25%206.222%202.981%205.12%207.324-.713%204.73-3.046%2019.768-5.962%2030.98-3.889%2020.739h2.268l2.593-2.593%2010.499-13.934%2017.628-22.036%207.778-8.749%209.073-9.657%205.833-4.601h11.018l8.1%2012.055-3.628%2012.443-11.342%2014.388-9.398%2012.184-13.48%2018.147-8.426%2014.518.778%201.166%202.01-.194%2030.46-6.481%2016.462-2.982%2019.637-3.37%208.88%204.148.971%204.213-3.5%208.62-20.998%205.184-24.628%204.926-36.682%208.685-.454.324.519.648%2016.526%201.555%207.065.389h17.304l32.21%202.398%208.426%205.574%205.055%206.805-.843%205.184-12.962%206.611-17.498-4.148-40.83-9.721-14-3.5h-1.944v1.167l11.666%2011.406%2021.387%2019.314%2026.767%2024.887%201.36%206.157-3.434%204.86-3.63-.518-23.526-17.693-9.073-7.972-20.545-17.304h-1.36v1.814l4.73%206.935%2025.017%2037.59%201.296%2011.536-1.814%203.76-6.481%202.268-7.13-1.297-14.647-20.544-15.1-23.138-12.185-20.739-1.49.843-7.194%2077.448-3.37%203.953-7.778%202.981-6.48-4.925-3.436-7.972%203.435-15.749%204.148-20.544%203.37-16.333%203.046-20.285%201.815-6.74-.13-.454-1.49.194-15.295%2020.999-23.267%2031.433-18.406%2019.702-4.407%201.75-7.648-3.954.713-7.064%204.277-6.286%2025.47-32.405%2015.36-20.092%209.917-11.6-.065-1.686h-.583L44.07%20198.125l-12.055%201.555-5.185-4.86.648-7.972%202.463-2.593%2020.35-13.999-.064.065Z'/%3e%3c/svg%3e",a="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='256'%20height='257'%20preserveAspectRatio='xMidYMid'%20viewBox='0%200%20256%20257'%3e%3cpath%20fill='%23D97757'%20d='m50.228%20170.321%2050.357-28.257.843-2.463-.843-1.361h-2.462l-8.426-.518-28.775-.778-24.952-1.037-24.175-1.296-6.092-1.297L0%20125.796l.583-3.759%205.12-3.434%207.324.648%2016.202%201.101%2024.304%201.685%2017.629%201.037%2026.118%202.722h4.148l.583-1.685-1.426-1.037-1.101-1.037-25.147-17.045-27.22-18.017-14.258-10.37-7.713-5.25-3.888-4.925-1.685-10.758%207-7.713%209.397.649%202.398.648%209.527%207.323%2020.35%2015.75L94.817%2091.9l3.889%203.24%201.555-1.102.195-.777-1.75-2.917-14.453-26.118-15.425-26.572-6.87-11.018-1.814-6.61c-.648-2.723-1.102-4.991-1.102-7.778l7.972-10.823L71.42%200%2082.05%201.426l4.472%203.888%206.61%2015.101%2010.694%2023.786%2016.591%2032.34%204.861%209.592%202.592%208.879.973%202.722h1.685v-1.556l1.36-18.211%202.528-22.36%202.463-28.776.843-8.1%204.018-9.722%207.971-5.25%206.222%202.981%205.12%207.324-.713%204.73-3.046%2019.768-5.962%2030.98-3.889%2020.739h2.268l2.593-2.593%2010.499-13.934%2017.628-22.036%207.778-8.749%209.073-9.657%205.833-4.601h11.018l8.1%2012.055-3.628%2012.443-11.342%2014.388-9.398%2012.184-13.48%2018.147-8.426%2014.518.778%201.166%202.01-.194%2030.46-6.481%2016.462-2.982%2019.637-3.37%208.88%204.148.971%204.213-3.5%208.62-20.998%205.184-24.628%204.926-36.682%208.685-.454.324.519.648%2016.526%201.555%207.065.389h17.304l32.21%202.398%208.426%205.574%205.055%206.805-.843%205.184-12.962%206.611-17.498-4.148-40.83-9.721-14-3.5h-1.944v1.167l11.666%2011.406%2021.387%2019.314%2026.767%2024.887%201.36%206.157-3.434%204.86-3.63-.518-23.526-17.693-9.073-7.972-20.545-17.304h-1.36v1.814l4.73%206.935%2025.017%2037.59%201.296%2011.536-1.814%203.76-6.481%202.268-7.13-1.297-14.647-20.544-15.1-23.138-12.185-20.739-1.49.843-7.194%2077.448-3.37%203.953-7.778%202.981-6.48-4.925-3.436-7.972%203.435-15.749%204.148-20.544%203.37-16.333%203.046-20.285%201.815-6.74-.13-.454-1.49.194-15.295%2020.999-23.267%2031.433-18.406%2019.702-4.407%201.75-7.648-3.954.713-7.064%204.277-6.286%2025.47-32.405%2015.36-20.092%209.917-11.6-.065-1.686h-.583L44.07%20198.125l-12.055%201.555-5.185-4.86.648-7.972%202.463-2.593%2020.35-13.999-.064.065Z'/%3e%3c/svg%3e",h="data:image/svg+xml,%3csvg%20fill='%23111'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eCodex%3c/title%3e%3cpath%20clip-rule='evenodd'%20d='M8.086.457a6.105%206.105%200%20013.046-.415c1.333.153%202.521.72%203.564%201.7a.117.117%200%2000.107.029c1.408-.346%202.762-.224%204.061.366l.063.03.154.076c1.357.703%202.33%201.77%202.918%203.198.278.679.418%201.388.421%202.126a5.655%205.655%200%2001-.18%201.631.167.167%200%2000.04.155%205.982%205.982%200%20011.578%202.891c.385%201.901-.01%203.615-1.183%205.14l-.182.22a6.063%206.063%200%2001-2.934%201.851.162.162%200%2000-.108.102c-.255.736-.511%201.364-.987%201.992-1.199%201.582-2.962%202.462-4.948%202.451-1.583-.008-2.986-.587-4.21-1.736a.145.145%200%2000-.14-.032c-.518.167-1.04.191-1.604.185a5.924%205.924%200%2001-2.595-.622%206.058%206.058%200%2001-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74%207.74%200%2001-.495-1.283%206.11%206.11%200%2001-.017-3.064.166.166%200%2000.008-.074.115.115%200%2000-.037-.064%205.958%205.958%200%2001-1.38-2.202%205.196%205.196%200%2001-.333-1.589%206.915%206.915%200%2001.188-2.132c.45-1.484%201.309-2.648%202.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129%200%2000.087-.087A6.016%206.016%200%20015.635%202.31C6.315%201.464%207.132.846%208.086.457zm-.804%207.85a.848.848%200%2000-1.473.842l1.694%202.965-1.688%202.848a.849.849%200%20001.46.864l1.94-3.272a.849.849%200%2000.007-.854l-1.94-3.393zm5.446%206.24a.849.849%200%20000%201.695h4.848a.849.849%200%20000-1.696h-4.848z'%3e%3c/path%3e%3c/svg%3e",o="data:image/svg+xml,%3csvg%20fill='%23fff'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eCodex%3c/title%3e%3cpath%20clip-rule='evenodd'%20d='M8.086.457a6.105%206.105%200%20013.046-.415c1.333.153%202.521.72%203.564%201.7a.117.117%200%2000.107.029c1.408-.346%202.762-.224%204.061.366l.063.03.154.076c1.357.703%202.33%201.77%202.918%203.198.278.679.418%201.388.421%202.126a5.655%205.655%200%2001-.18%201.631.167.167%200%2000.04.155%205.982%205.982%200%20011.578%202.891c.385%201.901-.01%203.615-1.183%205.14l-.182.22a6.063%206.063%200%2001-2.934%201.851.162.162%200%2000-.108.102c-.255.736-.511%201.364-.987%201.992-1.199%201.582-2.962%202.462-4.948%202.451-1.583-.008-2.986-.587-4.21-1.736a.145.145%200%2000-.14-.032c-.518.167-1.04.191-1.604.185a5.924%205.924%200%2001-2.595-.622%206.058%206.058%200%2001-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74%207.74%200%2001-.495-1.283%206.11%206.11%200%2001-.017-3.064.166.166%200%2000.008-.074.115.115%200%2000-.037-.064%205.958%205.958%200%2001-1.38-2.202%205.196%205.196%200%2001-.333-1.589%206.915%206.915%200%2001.188-2.132c.45-1.484%201.309-2.648%202.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129%200%2000.087-.087A6.016%206.016%200%20015.635%202.31C6.315%201.464%207.132.846%208.086.457zm-.804%207.85a.848.848%200%2000-1.473.842l1.694%202.965-1.688%202.848a.849.849%200%20001.46.864l1.94-3.272a.849.849%200%2000.007-.854l-1.94-3.393zm5.446%206.24a.849.849%200%20000%201.695h4.848a.849.849%200%20000-1.696h-4.848z'%3e%3c/path%3e%3c/svg%3e",r="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='cursor_light__Ebene_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20466.73%20532.09'%3e%3c!--Generator:%20Adobe%20Illustrator%2029.6.1,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.1%20Build%209)--%3e%3cdefs%3e%3cstyle%3e.cursor_light__st0{fill:%2326251e}%3c/style%3e%3c/defs%3e%3cpath%20class='cursor_light__st0'%20d='M457.43,125.94L244.42,2.96c-6.84-3.95-15.28-3.95-22.12,0L9.3,125.94c-5.75,3.32-9.3,9.46-9.3,16.11v247.99c0,6.65,3.55,12.79,9.3,16.11l213.01,122.98c6.84,3.95,15.28,3.95,22.12,0l213.01-122.98c5.75-3.32,9.3-9.46,9.3-16.11v-247.99c0-6.65-3.55-12.79-9.3-16.11h-.01ZM444.05,151.99l-205.63,356.16c-1.39,2.4-5.06,1.42-5.06-1.36v-233.21c0-4.66-2.49-8.97-6.53-11.31L24.87,145.67c-2.4-1.39-1.42-5.06,1.36-5.06h411.26c5.84,0,9.49,6.33,6.57,11.39h-.01Z'/%3e%3c/svg%3e",d="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='cursor_dark__Ebene_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20466.73%20532.09'%3e%3c!--Generator:%20Adobe%20Illustrator%2029.6.1,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.1%20Build%209)--%3e%3cdefs%3e%3cstyle%3e.cursor_dark__st0{fill:%23edecec}%3c/style%3e%3c/defs%3e%3cpath%20class='cursor_dark__st0'%20d='M457.43,125.94L244.42,2.96c-6.84-3.95-15.28-3.95-22.12,0L9.3,125.94c-5.75,3.32-9.3,9.46-9.3,16.11v247.99c0,6.65,3.55,12.79,9.3,16.11l213.01,122.98c6.84,3.95,15.28,3.95,22.12,0l213.01-122.98c5.75-3.32,9.3-9.46,9.3-16.11v-247.99c0-6.65-3.55-12.79-9.3-16.11h-.01ZM444.05,151.99l-205.63,356.16c-1.39,2.4-5.06,1.42-5.06-1.36v-233.21c0-4.66-2.49-8.97-6.53-11.31L24.87,145.67c-2.4-1.39-1.42-5.06,1.36-5.06h411.26c5.84,0,9.49,6.33,6.57,11.39h-.01Z'/%3e%3c/svg%3e",n="data:image/svg+xml,%3csvg%20width='512'%20height='512'%20viewBox='0%200%20512%20512'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='512'%20height='512'%20fill='%23FDFCFC'/%3e%3cpath%20d='M320%20224V352H192V224H320Z'%20fill='%23E6E5E6'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M384%20416H128V96H384V416ZM320%20160H192V352H320V160Z'%20fill='%2317181C'/%3e%3c/svg%3e",g="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='512'%20height='512'%3e%3csvg%20width='512'%20height='512'%20viewBox='0%200%20512%20512'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='512'%20height='512'%20fill='%23131010'%3e%3c/rect%3e%3cpath%20d='M320%20224V352H192V224H320Z'%20fill='%235A5858'%3e%3c/path%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M384%20416H128V96H384V416ZM320%20160H192V352H320V160Z'%20fill='white'%3e%3c/path%3e%3c/svg%3e%3cstyle%3e@media%20(prefers-color-scheme:%20light)%20{%20:root%20{%20filter:%20none;%20}%20}%20@media%20(prefers-color-scheme:%20dark)%20{%20:root%20{%20filter:%20none;%20}%20}%20%3c/style%3e%3c/svg%3e",i=[{name:"Claude",light:s,dark:a},{name:"Codex",light:h,dark:o},{name:"Cursor",light:r,dark:d},{name:"OpenCode",light:n,dark:g}];function w(){return e.jsx("span",{className:"inline-flex shrink-0 items-center gap-1.5","aria-hidden":"true",children:i.map(({name:l,light:t,dark:c})=>e.jsxs("span",{title:l,className:"inline-flex h-[18px] w-[18px]",children:[e.jsx("img",{src:t,alt:"",width:18,height:18,className:"h-full w-full object-contain dark:hidden"}),e.jsx("img",{src:c,alt:"",width:18,height:18,className:"hidden h-full w-full object-contain dark:block"})]},l))})}function x(){return e.jsx("ul",{className:"flex flex-wrap gap-2","aria-label":"Supported coding agents",children:i.map(({name:l,light:t,dark:c})=>e.jsxs("li",{className:"inline-flex items-center gap-2 rounded-full border px-3 py-1 text-sm",children:[e.jsx("img",{src:t,alt:"",width:18,height:18,className:"h-[18px] w-[18px] object-contain dark:hidden"}),e.jsx("img",{src:c,alt:"",width:18,height:18,className:"hidden h-[18px] w-[18px] object-contain dark:block"}),l]},l))})}export{w as A,x as a}; diff --git a/assets/AiDeadlinesView-C6rZe1HQ.js b/assets/AiDeadlinesView-ySVlb5Zy.js similarity index 96% rename from assets/AiDeadlinesView-C6rZe1HQ.js rename to assets/AiDeadlinesView-ySVlb5Zy.js index 63d606f21c6d8fae1448a6851dd6011895552789..8413ebd162bd1399a0cd78bc49ee915589808de0 100644 --- a/assets/AiDeadlinesView-C6rZe1HQ.js +++ b/assets/AiDeadlinesView-ySVlb5Zy.js @@ -1,3 +1,3 @@ -import{f as y,j as t,b as A,T as L}from"./index-3CfcAX6N.js";import{c as B}from"./catalog-B47DuClX.js";import{S as U}from"./switch-B40zv53e.js";import{S as W}from"./skeleton-CQbSjC3L.js";import{A as M,a as O}from"./alert-BXZ4lnnf.js";import{s as _}from"./safeExternalHref-CkBrsh84.js";import{D as V,a as P,c as G,b as H,d as K}from"./dialog-Bbx5GVcy.js";import{s as Y,n as S,f as $,p as q,u as N,l as k,a as z,c as b,D as Q,i as E,b as F,d as J}from"./deadlines-BG5SWwEG.js";import"./index-Caztwwvv.js";const w={fontFamily:"var(--mono)",fontSize:10,letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--ink-faint)"},X=(e,s)=>{const l=Math.ceil((e-s)/Q);return l<=0?"passed":`${l} ${l===1?"day":"days"}`},R=(e,s)=>{const l=$(e.start_date,e.end_date),r=e.venue||[e.city,e.country].filter(Boolean).join(", ");return[`${s.label||s.type||"Deadline"} for ${e.name}`,l?`Dates: ${l}`:null,r?`Location: ${r}`:null,e.url?`Website: ${e.url}`:null].filter(Boolean).join(` +import{f as y,j as t,b as A,T as L}from"./index-CxhY4zQ1.js";import{c as B}from"./catalog-DCEU6WpP.js";import{S as U}from"./switch-COruZUxK.js";import{S as W}from"./skeleton-DdKViE4r.js";import{A as M,a as O}from"./alert-C-NbJX4N.js";import{s as _}from"./safeExternalHref-CkBrsh84.js";import{D as V,a as P,c as G,b as H,d as K}from"./dialog-CT48f48_.js";import{s as Y,n as S,f as $,p as q,u as N,l as k,a as z,c as b,D as Q,i as E,b as F,d as J}from"./deadlines-BG5SWwEG.js";import"./index-JxIVN7pD.js";const w={fontFamily:"var(--mono)",fontSize:10,letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--ink-faint)"},X=(e,s)=>{const l=Math.ceil((e-s)/Q);return l<=0?"passed":`${l} ${l===1?"day":"days"}`},R=(e,s)=>{const l=$(e.start_date,e.end_date),r=e.venue||[e.city,e.country].filter(Boolean).join(", ");return[`${s.label||s.type||"Deadline"} for ${e.name}`,l?`Dates: ${l}`:null,r?`Location: ${r}`:null,e.url?`Website: ${e.url}`:null].filter(Boolean).join(` `)},T=e=>e.toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,""),Z=(e,s)=>{const l=new Date(s.deadline_at),r=new Date(l.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${s.label||s.type||"deadline"}`,h=e.venue||[e.city,e.country].filter(Boolean).join(", "),n=`https://calendar.google.com/calendar/render?action=TEMPLATE&text=${encodeURIComponent(o)}&dates=${T(l)}/${T(r)}&details=${encodeURIComponent(R(e,s))}&location=${encodeURIComponent(h)}`,p=_(n);p&&window.open(p,"_blank","noopener,noreferrer")},ee=(e,s)=>{const l=new Date(s.deadline_at),r=new Date(l.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${s.label||s.type||"deadline"}`,h=e.venue||[e.city,e.country].filter(Boolean).join(", "),n=["BEGIN:VCALENDAR","VERSION:2.0","BEGIN:VEVENT",e.url?`URL:${e.url}`:null,`DTSTART:${T(l)}`,`DTEND:${T(r)}`,`SUMMARY:${o}`,`DESCRIPTION:${R(e,s).replace(/\n/g,"\\n")}`,h?`LOCATION:${h}`:null,"END:VEVENT","END:VCALENDAR"].filter(Boolean).join(` `),p=new Blob([n],{type:"text/calendar;charset=utf-8"}),d=document.createElement("a");d.href=URL.createObjectURL(p),d.download=`${(e.short_name||e.name).toLowerCase().replace(/\s+/g,"-")}-deadline.ics`,document.body.appendChild(d),d.click(),document.body.removeChild(d),URL.revokeObjectURL(d.href)},te=({conf:e,open:s,onOpenChange:l})=>{const[r,o]=y.useState(()=>Date.now());y.useEffect(()=>{if(!s)return;o(Date.now());const i=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(i)},[s]);const h=y.useMemo(()=>e?Y(e):[],[e]),n=y.useMemo(()=>e?S(e,r):null,[e,r]),p=e?$(e.start_date,e.end_date):null,d=e?e.venue||[e.city,e.country].filter(Boolean).join(", ")||e.location:null,m=n?new Date(n.deadline_at).getTime():null;return t.jsx(V,{open:s,onOpenChange:l,children:t.jsx(P,{className:"max-w-xl",style:{background:"var(--bg-elevated)",maxHeight:"85vh",overflowY:"auto"},children:e&&t.jsxs(t.Fragment,{children:[t.jsxs(G,{children:[t.jsx(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:[p&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:w,children:"Dates"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:p})]}),d&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:w,children:"Venue"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:d})]})]}),m!=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:w,children:"Next deadline in"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:22,fontWeight:600,color:N(m,r)},children:q(m,r)})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[t.jsx("span",{style:w,children:"Important deadlines"}),h.length===0?t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-faint)"},children:"Deadlines not announced yet"}):h.map((i,c)=>{const f=new Date(i.deadline_at).getTime(),a=n!=null&&i.deadline_at===n.deadline_at&&i.type===n.type,u=f<=r;return t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,padding:"8px 12px",borderRadius:6,background:a?"var(--accent-soft)":"transparent",border:a?"1px solid var(--hairline-strong)":"1px solid var(--hairline)",opacity:u&&!a?.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:a?600:400},children:[i.label||k(i.type||"deadline"),a&&t.jsx("span",{style:{...w,marginLeft:8},children:"Next"})]}),t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:[z(i.deadline_at),i.timezone?` · ${i.timezone}`:""]})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,fontWeight:600,whiteSpace:"nowrap",color:N(u?null:f,r)},children:X(f,r)})]},`${i.type??"deadline"}-${c}`)})]}),b(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:b(e).map(i=>t.jsx("span",{className:"tag-chip",style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:k(i)},i))}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:16,paddingTop:12,borderTop:"1px solid var(--hairline)"},children:[e.url&&t.jsx("a",{href:_(e.url)??void 0,target:"_blank",rel:"noopener noreferrer",style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--accent-text)"},children:"Visit website ↗"}),n&&t.jsxs("div",{style:{display:"flex",gap:12,marginLeft:"auto"},children:[t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>Z(e,n),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Google Calendar"}),t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>ee(e,n),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Apple / .ics"})]})]})]})]})})})},I=({id:e,label:s,checked:l,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:l,onCheckedChange:r}),t.jsx("label",{htmlFor:e,style:{cursor:"pointer"},children:s})]}),ne=({conf:e,now:s,selectedDomains:l,onToggleDomain:r,onOpen:o})=>{const h=S(e,s),n=h??F(e),p=n?new Date(n.deadline_at).getTime():null,d=N(h?p:null,s),m=$(e.start_date,e.end_date),i=[e.city??null,e.country??null].filter(Boolean).join(", ");return t.jsxs("div",{role:"button",tabIndex:0,onClick:()=>o(e),onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),o(e))},style:{border:"1px solid var(--hairline)",borderRadius:8,padding:20,background:"var(--bg-elevated)",display:"flex",flexDirection:"column",gap:12,cursor:"pointer"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:12},children:[t.jsx("h3",{style:{fontFamily:"var(--serif)",fontSize:20,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name}),e.url&&t.jsx("a",{href:_(e.url)??void 0,target:"_blank",rel:"noopener noreferrer",onClick:c=>c.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:(n==null?void 0:n.label)||(n==null?void 0:n.type)||"Deadlines"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:n?`${z(n.deadline_at)}${n.timezone?` · ${n.timezone}`:""}`:"Not announced yet"})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:14,fontWeight:600,color:d,whiteSpace:"nowrap"},children:p!=null?J(p,s):"TBA"})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:[m&&t.jsx("span",{children:m}),i&&t.jsx("span",{children:i})]}),b(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:b(e).map(c=>{const f=l.has(c);return t.jsx("button",{className:"tag-chip",onClick:a=>{a.stopPropagation(),r(c)},style:{background:f?"var(--ink)":"var(--bg-subtle)",color:f?"var(--bg)":"var(--ink-soft)"},children:k(c)},c)})})]})},me=()=>{const[e,s]=y.useState(!0),[l,r]=y.useState(!1),[o,h]=y.useState(new Set),[n,p]=y.useState(null),d=y.useMemo(()=>Date.now(),[]),m=A({queryKey:["conference-deadlines"],queryFn:()=>B.conferenceDeadlines(),staleTime:L}),i=a=>{h(u=>{const x=new Set(u);return x.has(a)?x.delete(a):x.add(a),x})},c=y.useMemo(()=>{var u;const a=new Map;return(u=m.data)==null||u.results.forEach(x=>{b(x).forEach(j=>a.set(j,(a.get(j)??0)+1))}),Array.from(a.entries()).sort((x,j)=>j[1]-x[1]).map(([x])=>x)},[m.data]),f=y.useMemo(()=>{var j;const u=(((j=m.data)==null?void 0:j.results)??[]).filter(g=>!(e&&g.tier!=="a"||o.size>0&&!b(g).some(v=>o.has(v))||!l&&!E(g)&&!S(g,d))),x=g=>{const D=S(g,d);if(D)return{group:0,time:new Date(D.deadline_at).getTime()};if(E(g))return{group:1,time:g.start_date?new Date(g.start_date).getTime():0};const v=F(g);return{group:2,time:-(v?new Date(v.deadline_at).getTime():0)}};return[...u].sort((g,D)=>{const v=x(g),C=x(D);return v.group!==C.group?v.group-C.group:v.time-C.time})},[m.data,e,l,o,d]);return m.error?t.jsx("div",{className:"page",children:t.jsx(M,{variant:"destructive",children:t.jsx(O,{children:"Failed to load conference deadlines. Please try again."})})}):t.jsxs("div",{className:"page",children:[t.jsx("div",{className:"feed-header",children:t.jsxs("div",{children:[t.jsxs("h1",{className:"feed-title",children:["AI Conference ",t.jsx("em",{children:"Deadlines"})]}),t.jsx("div",{className:"feed-subtitle",children:"Upcoming submission deadlines for major AI conferences, counting down."})]})}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:20,padding:"16px 0",borderBottom:"1px solid var(--hairline)",marginBottom:24},children:[t.jsx(I,{id:"top-tier-only",label:"Top tier only",checked:e,onChange:s}),t.jsx(I,{id:"show-past",label:"Show past conferences",checked:l,onChange:r})]}),c.length>0&&t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:24},children:[c.map(a=>{const u=o.has(a);return t.jsx("button",{className:"tag-chip",onClick:()=>i(a),style:{background:u?"var(--ink)":"var(--bg-subtle)",color:u?"var(--bg)":"var(--ink-soft)"},children:k(a)},a)}),o.size>0&&t.jsx("button",{className:"tag-chip",onClick:()=>h(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:m.isLoading?"…":`${f.length} conferences`})}),m.isLoading?t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:Array.from({length:6}).map((a,u)=>t.jsx(W,{className:"h-44"},u))}):f.length===0?t.jsxs("div",{className:"no-results",children:["No conferences match these filters",l?".":" — try enabling “Show past conferences”."]}):t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:f.map(a=>t.jsx(ne,{conf:a,now:d,selectedDomains:o,onToggleDomain:i,onOpen:p},a.id))}),t.jsx(te,{conf:n,open:n!==null,onOpenChange:a=>{a||p(null)}})]})};export{me as default}; diff --git a/assets/ApiDocsView-D0f2oP-S.js b/assets/ApiDocsView-DO1rgGlj.js similarity index 98% rename from assets/ApiDocsView-D0f2oP-S.js rename to assets/ApiDocsView-DO1rgGlj.js index d09d2dcee61d8dad34c4aec9660d8a52ade03116..955f33b180c795484a68ce8daccc9b7381733281 100644 --- a/assets/ApiDocsView-D0f2oP-S.js +++ b/assets/ApiDocsView-DO1rgGlj.js @@ -1,4 +1,4 @@ -import{ac as m,b as f,f as h,j as e}from"./index-3CfcAX6N.js";import{u as g}from"./useDocumentTitle-BnA1kM_d.js";import{M as y}from"./index-DGr54pyn.js";const b={queryKey:["public-api-schema"],queryFn:()=>m("/openapi.json",{credentials:"omit"}),staleTime:5*60*1e3};function w(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 v(s,r){return r==="Python"?`import requests +import{ac as m,b as f,f as h,j as e}from"./index-CxhY4zQ1.js";import{u as g}from"./useDocumentTitle-CC3zTSwA.js";import{M as y}from"./index-BCjs92mB.js";const b={queryKey:["public-api-schema"],queryFn:()=>m("/openapi.json",{credentials:"omit"}),staleTime:5*60*1e3};function w(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 v(s,r){return r==="Python"?`import requests response = requests.get(${JSON.stringify(s)}, timeout=30) response.raise_for_status() diff --git a/assets/AreaSection-Dzw2ZfXP.js b/assets/AreaSection-B21Mp4br.js similarity index 88% rename from assets/AreaSection-Dzw2ZfXP.js rename to assets/AreaSection-B21Mp4br.js index 70d76db9fa3d17f5a4d8bdcd037acb76b9a1eb07..3a9987c465de1282063f7f226e85196d18cb8863 100644 --- a/assets/AreaSection-Dzw2ZfXP.js +++ b/assets/AreaSection-B21Mp4br.js @@ -1 +1 @@ -import{j as s}from"./index-3CfcAX6N.js";import{S as l}from"./skeleton-CQbSjC3L.js";const m=({id:t,title:a,description:e,meta:r,style:c,children:i})=>s.jsxs("section",{id:t,className:"area-section",style:c,children:[s.jsxs("div",{className:"area-section-head",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"area-section-title",children:a}),e&&s.jsx("div",{className:"area-section-description",children:e})]}),s.jsx("div",{className:"area-section-meta",children:r})]}),s.jsx("div",{className:"tag-grid",children:i})]}),h=({sections:t=4,tiles:a,tileClassName:e})=>s.jsx("div",{className:"area-directory-skeleton",children:Array.from({length:t}).map((r,c)=>s.jsxs("div",{children:[s.jsx(l,{className:"h-8 w-1/3 mb-4"}),s.jsx("div",{className:"tag-grid",children:Array.from({length:a}).map((i,n)=>s.jsx(l,{className:e},n))})]},c))}),x=({areas:t})=>{const a=t.filter(r=>r.tasks.length>0),e=a.reduce((r,c)=>r+c.tasks.length,0);return e===0?null:s.jsxs("div",{className:"area-directory-footer",children:[e," tasks across ",a.length," areas."]})};export{h as A,m as a,x as b}; +import{j as s}from"./index-CxhY4zQ1.js";import{S as l}from"./skeleton-DdKViE4r.js";const m=({id:t,title:a,description:e,meta:r,style:c,children:i})=>s.jsxs("section",{id:t,className:"area-section",style:c,children:[s.jsxs("div",{className:"area-section-head",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"area-section-title",children:a}),e&&s.jsx("div",{className:"area-section-description",children:e})]}),s.jsx("div",{className:"area-section-meta",children:r})]}),s.jsx("div",{className:"tag-grid",children:i})]}),h=({sections:t=4,tiles:a,tileClassName:e})=>s.jsx("div",{className:"area-directory-skeleton",children:Array.from({length:t}).map((r,c)=>s.jsxs("div",{children:[s.jsx(l,{className:"h-8 w-1/3 mb-4"}),s.jsx("div",{className:"tag-grid",children:Array.from({length:a}).map((i,n)=>s.jsx(l,{className:e},n))})]},c))}),x=({areas:t})=>{const a=t.filter(r=>r.tasks.length>0),e=a.reduce((r,c)=>r+c.tasks.length,0);return e===0?null:s.jsxs("div",{className:"area-directory-footer",children:[e," tasks across ",a.length," areas."]})};export{h as A,m as a,x as b}; diff --git a/assets/AstraForRoboticsView-DihUxGRN.js b/assets/AstraForRoboticsView-Cbgf-67D.js similarity index 89% rename from assets/AstraForRoboticsView-DihUxGRN.js rename to assets/AstraForRoboticsView-Cbgf-67D.js index 439480c939710b94128602eb335ad0b430cdefca..aea31bb884bae5dbc092307aa9fe338761a3fac2 100644 --- a/assets/AstraForRoboticsView-DihUxGRN.js +++ b/assets/AstraForRoboticsView-Cbgf-67D.js @@ -1 +1 @@ -import{p,f as u,j as a,L as o}from"./index-3CfcAX6N.js";import{u as g,b as x,P as f}from"./PaperFeed-2dSUzcA2.js";import{A as b,a as j}from"./alert-BXZ4lnnf.js";import{u as y}from"./usePapers-CHoHKyWP.js";import{p as v}from"./papers-BsYlGUQi.js";import{u as k,f as w}from"./useDocumentTitle-BnA1kM_d.js";import{t as A}from"./transform-Dx-N8Yyj.js";import"./PaperCard-BZtXccuT.js";import"./AuthorAvatar-DYaYcwPm.js";import"./SotaBadges-BqZMAXyY.js";import"./colors-BkWRhvFI.js";import"./Icon-C0d9p4Q2.js";import"./LatexTitle-DvPeLepK.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-Dwe6SY1f.js";import"./skeleton-CQbSjC3L.js";import"./useIntersectionObserver-wAZWG4G7.js";import"./useInfiniteQuery-DYwUEaoz.js";import"./curation-BZoIvsHD.js";const n="robotics",i="gpt-6-astra",_="https://x.com/YuXiang_IRVL/status/2100395131924840570",P=[{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"}],R=[{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"}],h=({posts:s,label:e})=>a.jsxs("div",{className:"astra-posts",children:[a.jsx("div",{className:"astra-posts-label",children:e}),a.jsx("ul",{children:s.map(t=>a.jsxs("li",{children:[a.jsxs("a",{href:t.url,target:"_blank",rel:"noreferrer",children:["@",t.handle]}),a.jsxs("span",{className:"astra-post-author",children:[" ",t.author]}),a.jsxs("span",{className:"astra-post-summary",children:[" — ",t.summary]})]},t.url))})]}),B=()=>{var l,c;const s=g(),e=y([...p.feeds.infinite,{task:n,method:i,...s.filters}],r=>v.list({...s.filters,task:n,method:i,page:r,page_size:12}));k(w("GPT-6 Astra for Robotics"));const t=u.useMemo(()=>{var r;return(((r=e.data)==null?void 0:r.pages)??[]).flatMap(d=>d.results.map(A))},[e.data]),m=((c=(l=e.data)==null?void 0:l.pages[0])==null?void 0:c.count)??0;return a.jsxs("div",{className:"page",children:[a.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[a.jsx(o,{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:_,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(h,{posts:P,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(h,{posts:R,label:"Seen on X"})]})]}),a.jsxs("p",{className:"astra-note",children:["Listing is automatic: any paper tagged with both the"," ",a.jsx(o,{to:`/tasks/${n}`,children:"Robotics"})," task and the"," ",a.jsx(o,{to:`/methods/${i}`,children:"GPT-6 Astra"})," method appears here. Missing a report or preprint?"," ",a.jsx(o,{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:["[",m.toLocaleString(),"]"]})]})]}),a.jsx(x,{feed:s,showDateFilter:!1}),e.error?a.jsx(b,{variant:"destructive",children:a.jsx(j,{children:"Failed to load the collection. Please try again."})}):a.jsx(f,{query:e,cards:t,empty:"No papers match this selection yet."})]})};export{B as default}; +import{p,f as u,j as a,L as o}from"./index-CxhY4zQ1.js";import{u as g,b as x,P as f}from"./PaperFeed-D1egUlu_.js";import{A as b,a as j}from"./alert-C-NbJX4N.js";import{u as y}from"./usePapers-Cv13R7ph.js";import{p as v}from"./papers-BDxSKSYJ.js";import{u as k,f as w}from"./useDocumentTitle-CC3zTSwA.js";import{t as A}from"./transform-DehuZQh7.js";import"./PaperCard-DeWmBrg8.js";import"./AuthorAvatar-DPz8YQ5Z.js";import"./SotaBadges-EnDhSaVO.js";import"./colors-BkWRhvFI.js";import"./Icon-XOOkUEUX.js";import"./LatexTitle-BqNrCKu8.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-DgW_tN02.js";import"./skeleton-DdKViE4r.js";import"./useIntersectionObserver-ZqjUJuPc.js";import"./useInfiniteQuery-vHEhIVF_.js";import"./curation-D2sqKAqC.js";const n="robotics",i="gpt-6-astra",_="https://x.com/YuXiang_IRVL/status/2100395131924840570",P=[{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"}],R=[{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"}],h=({posts:s,label:e})=>a.jsxs("div",{className:"astra-posts",children:[a.jsx("div",{className:"astra-posts-label",children:e}),a.jsx("ul",{children:s.map(t=>a.jsxs("li",{children:[a.jsxs("a",{href:t.url,target:"_blank",rel:"noreferrer",children:["@",t.handle]}),a.jsxs("span",{className:"astra-post-author",children:[" ",t.author]}),a.jsxs("span",{className:"astra-post-summary",children:[" — ",t.summary]})]},t.url))})]}),B=()=>{var l,c;const s=g(),e=y([...p.feeds.infinite,{task:n,method:i,...s.filters}],r=>v.list({...s.filters,task:n,method:i,page:r,page_size:12}));k(w("GPT-6 Astra for Robotics"));const t=u.useMemo(()=>{var r;return(((r=e.data)==null?void 0:r.pages)??[]).flatMap(d=>d.results.map(A))},[e.data]),m=((c=(l=e.data)==null?void 0:l.pages[0])==null?void 0:c.count)??0;return a.jsxs("div",{className:"page",children:[a.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[a.jsx(o,{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:_,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(h,{posts:P,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(h,{posts:R,label:"Seen on X"})]})]}),a.jsxs("p",{className:"astra-note",children:["Listing is automatic: any paper tagged with both the"," ",a.jsx(o,{to:`/tasks/${n}`,children:"Robotics"})," task and the"," ",a.jsx(o,{to:`/methods/${i}`,children:"GPT-6 Astra"})," method appears here. Missing a report or preprint?"," ",a.jsx(o,{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:["[",m.toLocaleString(),"]"]})]})]}),a.jsx(x,{feed:s,showDateFilter:!1}),e.error?a.jsx(b,{variant:"destructive",children:a.jsx(j,{children:"Failed to load the collection. Please try again."})}):a.jsx(f,{query:e,cards:t,empty:"No papers match this selection yet."})]})};export{B as default}; diff --git a/assets/AuthorAvatar-DYaYcwPm.js b/assets/AuthorAvatar-DPz8YQ5Z.js similarity index 86% rename from assets/AuthorAvatar-DYaYcwPm.js rename to assets/AuthorAvatar-DPz8YQ5Z.js index f18a31f824710ded363d7143eed887e158658995..23cdf26aa5dfac0c487e9a581f72b6382cb7c17f 100644 --- a/assets/AuthorAvatar-DYaYcwPm.js +++ b/assets/AuthorAvatar-DPz8YQ5Z.js @@ -1 +1 @@ -import{f as c,j as r}from"./index-3CfcAX6N.js";const p=a=>a!=null&&a.startsWith("https://")&&!a.startsWith("https://huggingface.co/avatars/")?a:null,h=({url:a,className:o,href:t,label:n})=>{const[i,l]=c.useState(!1),s=i?null:p(a);if(!s)return null;const e=r.jsx("img",{className:`author-avatar-base ${o}`,src:s,alt:"",loading:"lazy",onError:()=>l(!0)});return t?r.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer","aria-label":n,children:e}):e};export{h as A}; +import{f as c,j as r}from"./index-CxhY4zQ1.js";const p=a=>a!=null&&a.startsWith("https://")&&!a.startsWith("https://huggingface.co/avatars/")?a:null,h=({url:a,className:o,href:t,label:n})=>{const[i,l]=c.useState(!1),s=i?null:p(a);if(!s)return null;const e=r.jsx("img",{className:`author-avatar-base ${o}`,src:s,alt:"",loading:"lazy",onError:()=>l(!0)});return t?r.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer","aria-label":n,children:e}):e};export{h as A}; diff --git a/assets/AuthorDetailView-D7LkRdLr.js b/assets/AuthorDetailView-BLIKTcZJ.js similarity index 76% rename from assets/AuthorDetailView-D7LkRdLr.js rename to assets/AuthorDetailView-BLIKTcZJ.js index dd8a8b8c1361ec719bdcc765aea79c87b8e363d2..bd533e64bbb4d85a3843ec8076ac056d2d2f2d22 100644 --- a/assets/AuthorDetailView-D7LkRdLr.js +++ b/assets/AuthorDetailView-BLIKTcZJ.js @@ -1 +1 @@ -import{u as b,j as a,b as N,p as v,f as F,ao as y,L as A}from"./index-3CfcAX6N.js";import{A as P}from"./AuthorAvatar-DYaYcwPm.js";import{u as k,b as $,P as S}from"./PaperFeed-2dSUzcA2.js";import{R as L}from"./ResearchFollowButton-YEXlvC8K.js";import{A as R,a as w}from"./alert-BXZ4lnnf.js";import{S as z}from"./skeleton-CQbSjC3L.js";import{u as C}from"./usePapers-CHoHKyWP.js";import{p as m}from"./papers-BsYlGUQi.js";import{i as H}from"./apiErrors-XoIVpN_S.js";import{t as q}from"./transform-Dx-N8Yyj.js";import f from"./NotFound-DXa9p6DX.js";import"./PaperCard-BZtXccuT.js";import"./SotaBadges-BqZMAXyY.js";import"./colors-BkWRhvFI.js";import"./Icon-C0d9p4Q2.js";import"./LatexTitle-DvPeLepK.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-Dwe6SY1f.js";import"./useIntersectionObserver-wAZWG4G7.js";import"./researchTopic-Z4AJDMN7.js";import"./useMutation-CKC6OFhA.js";import"./plus-CiDEk52y.js";import"./useInfiniteQuery-DYwUEaoz.js";import"./curation-BZoIvsHD.js";const Q=({authorId:r})=>{var n,i,l,p,c,d,h,u;const o=k(),{searchParams:g}=o,e=N({queryKey:["author",r],queryFn:()=>m.getAuthor(r)}),s=C([...v.feeds.infinite,{author:r,...o.filters}],t=>m.list({...o.filters,author:r,page:t,page_size:12})),x=F.useMemo(()=>{var t;return(((t=s.data)==null?void 0:t.pages)??[]).flatMap(_=>_.results.map(q))},[s.data]),j=((i=(n=s.data)==null?void 0:n.pages[0])==null?void 0:i.count)??0;if(H(e.error))return a.jsx(f,{});if((l=e.data)!=null&&l.organization_slug){const t=g.toString();return a.jsx(y,{to:`/orgs/${e.data.organization_slug}${t?`?${t}`:""}`,replace:!0})}return a.jsxs("div",{className:"page",children:[a.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[a.jsx(A,{to:"/",children:"Home"}),a.jsx("span",{children:" / "}),a.jsx("span",{children:"Authors"}),a.jsx("span",{children:" / "}),a.jsx("span",{children:((p=e.data)==null?void 0:p.full_name)??r})]}),a.jsxs("header",{className:"author-hero",children:[a.jsx("div",{className:"organizations-eyebrow",children:"AUTHOR"}),a.jsxs("div",{className:"author-hero-title",children:[(c=e.data)!=null&&c.photo?a.jsxs("figure",{className:"author-photo",children:[a.jsx("img",{className:"author-avatar-base author-avatar",src:e.data.photo.url,alt:""}),a.jsxs("figcaption",{children:["Photo:"," ",a.jsx("a",{href:e.data.photo.source_url,target:"_blank",rel:"noopener noreferrer",children:e.data.photo.credit}),", ",e.data.photo.license_url?a.jsx("a",{href:e.data.photo.license_url,target:"_blank",rel:"noopener noreferrer",children:e.data.photo.license}):e.data.photo.license]})]}):((d=e.data)==null?void 0:d.hf_username)&&a.jsx(P,{className:"author-avatar",url:e.data.hf_avatar_url,href:`https://huggingface.co/${e.data.hf_username}`,label:`@${e.data.hf_username} on Hugging Face`}),a.jsx("h1",{className:"feed-title",children:((h=e.data)==null?void 0:h.full_name)??a.jsx(z,{className:"h-12 w-64 inline-block"})})]}),e.data&&a.jsxs("div",{className:"feed-subtitle",children:[e.data.paper_count.toLocaleString()," ",e.data.paper_count===1?"paper":"papers",e.data.hf_username&&a.jsxs(a.Fragment,{children:[" · ",a.jsxs("a",{href:`https://huggingface.co/${e.data.hf_username}`,target:"_blank",rel:"noopener noreferrer",children:["@",e.data.hf_username," on Hugging Face ↗"]})]}),e.data.google_scholar_id&&a.jsxs(a.Fragment,{children:[" · ",a.jsx("a",{href:`https://scholar.google.com/citations?user=${encodeURIComponent(e.data.google_scholar_id)}`,target:"_blank",rel:"noopener noreferrer",children:"Google Scholar ↗"})]})]}),e.data&&a.jsx(L,{kind:"author",entityId:e.data.id})]}),a.jsx($,{feed:o,style:{alignItems:"center",gap:16},children:a.jsxs("div",{className:"results-count",children:[j.toLocaleString()," papers"]})}),s.error?a.jsx(R,{variant:"destructive",children:a.jsxs(w,{children:["Failed to load papers."," ",a.jsx("button",{type:"button",onClick:()=>void s.refetch(),children:"Try again"})]})}):a.jsx(S,{query:s,cards:x,empty:((u=e.data)==null?void 0:u.paper_count)===0?"No public papers are available.":"No papers found for this selection."})]})},la=()=>{const{authorId:r}=b();return r?a.jsx(Q,{authorId:r},r):a.jsx(f,{})};export{la as default}; +import{u as b,j as a,b as N,p as v,f as F,ao as y,L as A}from"./index-CxhY4zQ1.js";import{A as P}from"./AuthorAvatar-DPz8YQ5Z.js";import{u as k,b as $,P as S}from"./PaperFeed-D1egUlu_.js";import{R as L}from"./ResearchFollowButton-DPFVPZ0U.js";import{A as R,a as w}from"./alert-C-NbJX4N.js";import{S as z}from"./skeleton-DdKViE4r.js";import{u as C}from"./usePapers-Cv13R7ph.js";import{p as m}from"./papers-BDxSKSYJ.js";import{i as H}from"./apiErrors-D2bSY3Dq.js";import{t as q}from"./transform-DehuZQh7.js";import f from"./NotFound-BeRulOFd.js";import"./PaperCard-DeWmBrg8.js";import"./SotaBadges-EnDhSaVO.js";import"./colors-BkWRhvFI.js";import"./Icon-XOOkUEUX.js";import"./LatexTitle-BqNrCKu8.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-DgW_tN02.js";import"./useIntersectionObserver-ZqjUJuPc.js";import"./researchTopic-DXZVIvAq.js";import"./useMutation-BzRfwboV.js";import"./plus-CEkdlNSn.js";import"./useInfiniteQuery-vHEhIVF_.js";import"./curation-D2sqKAqC.js";const Q=({authorId:r})=>{var n,i,l,p,c,d,h,u;const o=k(),{searchParams:g}=o,e=N({queryKey:["author",r],queryFn:()=>m.getAuthor(r)}),s=C([...v.feeds.infinite,{author:r,...o.filters}],t=>m.list({...o.filters,author:r,page:t,page_size:12})),x=F.useMemo(()=>{var t;return(((t=s.data)==null?void 0:t.pages)??[]).flatMap(_=>_.results.map(q))},[s.data]),j=((i=(n=s.data)==null?void 0:n.pages[0])==null?void 0:i.count)??0;if(H(e.error))return a.jsx(f,{});if((l=e.data)!=null&&l.organization_slug){const t=g.toString();return a.jsx(y,{to:`/orgs/${e.data.organization_slug}${t?`?${t}`:""}`,replace:!0})}return a.jsxs("div",{className:"page",children:[a.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[a.jsx(A,{to:"/",children:"Home"}),a.jsx("span",{children:" / "}),a.jsx("span",{children:"Authors"}),a.jsx("span",{children:" / "}),a.jsx("span",{children:((p=e.data)==null?void 0:p.full_name)??r})]}),a.jsxs("header",{className:"author-hero",children:[a.jsx("div",{className:"organizations-eyebrow",children:"AUTHOR"}),a.jsxs("div",{className:"author-hero-title",children:[(c=e.data)!=null&&c.photo?a.jsxs("figure",{className:"author-photo",children:[a.jsx("img",{className:"author-avatar-base author-avatar",src:e.data.photo.url,alt:""}),a.jsxs("figcaption",{children:["Photo:"," ",a.jsx("a",{href:e.data.photo.source_url,target:"_blank",rel:"noopener noreferrer",children:e.data.photo.credit}),", ",e.data.photo.license_url?a.jsx("a",{href:e.data.photo.license_url,target:"_blank",rel:"noopener noreferrer",children:e.data.photo.license}):e.data.photo.license]})]}):((d=e.data)==null?void 0:d.hf_username)&&a.jsx(P,{className:"author-avatar",url:e.data.hf_avatar_url,href:`https://huggingface.co/${e.data.hf_username}`,label:`@${e.data.hf_username} on Hugging Face`}),a.jsx("h1",{className:"feed-title",children:((h=e.data)==null?void 0:h.full_name)??a.jsx(z,{className:"h-12 w-64 inline-block"})})]}),e.data&&a.jsxs("div",{className:"feed-subtitle",children:[e.data.paper_count.toLocaleString()," ",e.data.paper_count===1?"paper":"papers",e.data.hf_username&&a.jsxs(a.Fragment,{children:[" · ",a.jsxs("a",{href:`https://huggingface.co/${e.data.hf_username}`,target:"_blank",rel:"noopener noreferrer",children:["@",e.data.hf_username," on Hugging Face ↗"]})]}),e.data.google_scholar_id&&a.jsxs(a.Fragment,{children:[" · ",a.jsx("a",{href:`https://scholar.google.com/citations?user=${encodeURIComponent(e.data.google_scholar_id)}`,target:"_blank",rel:"noopener noreferrer",children:"Google Scholar ↗"})]})]}),e.data&&a.jsx(L,{kind:"author",entityId:e.data.id})]}),a.jsx($,{feed:o,style:{alignItems:"center",gap:16},children:a.jsxs("div",{className:"results-count",children:[j.toLocaleString()," papers"]})}),s.error?a.jsx(R,{variant:"destructive",children:a.jsxs(w,{children:["Failed to load papers."," ",a.jsx("button",{type:"button",onClick:()=>void s.refetch(),children:"Try again"})]})}):a.jsx(S,{query:s,cards:x,empty:((u=e.data)==null?void 0:u.paper_count)===0?"No public papers are available.":"No papers found for this selection."})]})},la=()=>{const{authorId:r}=b();return r?a.jsx(Q,{authorId:r},r):a.jsx(f,{})};export{la as default}; diff --git a/assets/AuthorizePaperEditView-BA-4FAC_.js b/assets/AuthorizePaperEditView-AscuEWFa.js similarity index 87% rename from assets/AuthorizePaperEditView-BA-4FAC_.js rename to assets/AuthorizePaperEditView-AscuEWFa.js index 51cb7a7baa8ec9e805b758c26dbbb6d337bf6e32..0d566c43f27945560c71e2b2f0ffba727f2c44cb 100644 --- a/assets/AuthorizePaperEditView-BA-4FAC_.js +++ b/assets/AuthorizePaperEditView-AscuEWFa.js @@ -1 +1 @@ -import{u,a as d,b as l,j as e,L as p,H as c}from"./index-3CfcAX6N.js";import{u as h}from"./useMutation-CKC6OFhA.js";import{B as g}from"./button-CbnaBx6W.js";import{p as n}from"./paperEdits-HkiQiv4C.js";function f(){const{authorizationId:t=""}=u(),{user:s,isLoading:o}=d(),i=l({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(p,{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(g,{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(c,{returnTo:`/authorize-paper-edit/${t}`,label:"Sign in with Hugging Face"}),r.error&&e.jsx("p",{role:"alert",children:r.error.message})]})]})}export{f as default}; +import{u,a as d,b as l,j as e,L as p,H as c}from"./index-CxhY4zQ1.js";import{u as h}from"./useMutation-BzRfwboV.js";import{B as g}from"./button-BenSiukP.js";import{p as n}from"./paperEdits-CfQUGmNN.js";function f(){const{authorizationId:t=""}=u(),{user:s,isLoading:o}=d(),i=l({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(p,{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(g,{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(c,{returnTo:`/authorize-paper-edit/${t}`,label:"Sign in with Hugging Face"}),r.error&&e.jsx("p",{role:"alert",children:r.error.message})]})]})}export{f as default}; diff --git a/assets/AutonomousOperations-CODCSTk3.js b/assets/AutonomousOperations-BGgLXdSh.js similarity index 94% rename from assets/AutonomousOperations-CODCSTk3.js rename to assets/AutonomousOperations-BGgLXdSh.js index 0c5394dd823f29e15ffffba7b485442ba205c0b6..84afba8abe104943bc92332e1c138ab08c5dad85 100644 --- a/assets/AutonomousOperations-CODCSTk3.js +++ b/assets/AutonomousOperations-BGgLXdSh.js @@ -1 +1 @@ -import{l as R,f as d,b as B,J as C,j as e,L as q}from"./index-3CfcAX6N.js";import{u as Q}from"./useMutation-CKC6OFhA.js";import{C as n,e as i,S as H,b as l,c as t,t as E,f as m,o as x}from"./CronDashboard-CJXGA8w4.js";import{B as I}from"./badge-BgT1mGjP.js";import{B as h}from"./button-CbnaBx6W.js";import{I as u}from"./input-B7wcXhgG.js";import{A as P}from"./activity-HTMf27Bb.js";import{A as D}from"./arrow-left-CZqhJnQC.js";const j={submissions:"Submission review",curation:"Scheduled curation",cron_health:"CRON health",chat_reliability:"Chat reliability"},S={healthy:"healthy",degraded:"degraded",repairing:"running","rolled-back":"broken",manual:"degraded"},V=()=>{var A;const M=R(),[p,T]=d.useState(""),[f,_]=d.useState(""),[b,v]=d.useState({}),[g,N]=d.useState(""),c=B({queryKey:C.autonomousOperations,queryFn:()=>x.getAutonomousOperations(),refetchInterval:3e4,retry:!1}),r=Q({mutationFn:s=>s(),onSuccess:s=>{M.setQueryData(C.autonomousOperations,s),_(""),v({}),N("")}}),a=c.data,y=r.error instanceof Error?r.error.message:null;if(c.isLoading)return e.jsx("div",{className:"page","aria-busy":"true",children:"Loading autonomous operations…"});if(c.error||!a)return e.jsxs("div",{className:"page",children:[e.jsx("h1",{children:"Autonomous operations unavailable"}),e.jsx("p",{children:c.error instanceof Error?c.error.message:"No status was returned."})]});const O=()=>r.mutate(()=>x.setAutonomousManualMode(!a.manual_mode,a.revision,f)),k=(s,o)=>r.mutate(()=>x.setAutonomousOperator(s,o,a.revision,b[s]??"")),w=()=>{var o;const s=((o=a.baseline)==null?void 0:o.revision)??0;r.mutate(()=>x.qualifyAutonomousChatBaseline(p,s,g))};return e.jsx("div",{className:"cron-dashboard","data-shadcn":!0,children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8 space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-3xl font-bold flex items-center gap-3",children:[e.jsx(P,{className:"h-8 w-8"}),"Autonomous operations"]}),e.jsx("p",{className:"mt-2 cron-muted",children:"Content-free supervision, remote controls, and bounded audit history."})]}),e.jsx(h,{asChild:!0,variant:"outline",children:e.jsxs(q,{to:"/admin-dashboard",children:[e.jsx(D,{className:"h-4 w-4 mr-2"}),"Admin dashboard"]})})]}),a.manual_mode&&e.jsx(n,{className:"cron-status--degraded",role:"status",children:e.jsxs(i,{className:"pt-6 flex gap-3",children:[e.jsx(H,{className:"h-5 w-5"}),e.jsxs("div",{children:[e.jsx("strong",{children:"Manual mode is enabled."}),e.jsxs("p",{children:[a.monitoring_active?"Monitoring remains active":"Monitoring is not currently verified","; autonomous callbacks, retries, deployments, and data mutations fail closed."]})]})]})}),e.jsxs("div",{className:"grid md:grid-cols-4 gap-4",children:[e.jsxs(n,{className:E(S[a.display_state]),children:[e.jsx(l,{children:e.jsx(t,{className:"text-sm",children:"Overall state"})}),e.jsxs(i,{children:[e.jsx("div",{className:"text-2xl font-bold capitalize",children:a.display_state}),e.jsxs("p",{className:"text-sm",children:["Monitoring ",a.monitoring_active?"active":"inactive"]})]})]}),e.jsxs(n,{children:[e.jsx(l,{children:e.jsx(t,{className:"text-sm",children:"Codex cost"})}),e.jsxs(i,{children:[e.jsxs("div",{className:"text-2xl font-bold",children:["$",a.costs.total_usd]}),e.jsxs("p",{className:"text-sm",children:[a.costs.input_tokens+a.costs.output_tokens," tokens"]})]})]}),e.jsxs(n,{children:[e.jsx(l,{children:e.jsx(t,{className:"text-sm",children:"Repair lease"})}),e.jsxs(i,{children:[e.jsx("div",{className:"text-lg font-bold",children:a.active_lease?a.active_lease.owner_operator:"Available"}),e.jsx("p",{className:"text-sm",children:a.active_lease?`Expires ${m(a.active_lease.expires_at)}`:"No active source repair"})]})]}),e.jsxs(n,{children:[e.jsx(l,{children:e.jsx(t,{className:"text-sm",children:"Global control"})}),e.jsxs(i,{className:"space-y-2",children:[e.jsx(u,{"aria-label":"Manual mode confirmation",value:f,onChange:s=>_(s.target.value),placeholder:"Type SET_MANUAL_MODE"}),e.jsx(h,{disabled:r.isPending||f!=="SET_MANUAL_MODE",onClick:O,children:a.manual_mode?"Leave manual mode":"Enable manual mode"})]})]})]}),e.jsx("div",{className:"grid md:grid-cols-4 gap-4",children:a.operators.map(s=>e.jsxs(n,{className:E(S[s.status]),children:[e.jsx(l,{children:e.jsxs(t,{className:"flex justify-between gap-2",children:[e.jsx("span",{children:j[s.operator]}),e.jsx(I,{children:s.status})]})}),e.jsxs(i,{className:"space-y-3",children:[e.jsxs("p",{children:[s.enabled?"Mutation enabled":"Mutation disabled"," · monitoring ",s.monitoring_active?"active":"unverified"]}),e.jsxs("p",{className:"text-sm",children:["Next scheduled run: ",s.next_scheduled_run?m(s.next_scheduled_run):"not scheduled"]}),e.jsx(u,{"aria-label":`${j[s.operator]} confirmation`,value:b[s.operator]??"",onChange:o=>v(L=>({...L,[s.operator]:o.target.value})),placeholder:"Type SET_OPERATOR_STATE"}),e.jsx(h,{disabled:r.isPending||a.manual_mode&&!s.enabled||b[s.operator]!=="SET_OPERATOR_STATE",onClick:()=>k(s.operator,!s.enabled),children:s.enabled?"Disable":"Enable"})]})]},s.operator))}),e.jsxs(n,{children:[e.jsx(l,{children:e.jsx(t,{children:"Qualified scalable-chat baseline"})}),e.jsxs(i,{className:"space-y-3",children:[e.jsx("p",{className:"font-mono break-all",children:((A=a.baseline)==null?void 0:A.sha)??"No baseline qualified"}),a.baseline&&e.jsxs("p",{className:"text-sm",children:["Revision ",a.baseline.revision," · ",a.baseline.qualified_by," · ",m(a.baseline.qualified_at)]}),e.jsxs("div",{className:"grid md:grid-cols-[1fr_1fr_auto] gap-2",children:[e.jsx(u,{"aria-label":"Exact baseline SHA",value:p,onChange:s=>T(s.target.value),placeholder:"40-character lowercase commit SHA"}),e.jsx(u,{"aria-label":"Baseline confirmation",value:g,onChange:s=>N(s.target.value),placeholder:"Type QUALIFY_CHAT_BASELINE"}),e.jsx(h,{disabled:r.isPending||!/^[0-9a-f]{40}$/.test(p)||g!=="QUALIFY_CHAT_BASELINE",onClick:w,children:"Qualify exact SHA"})]})]})]}),e.jsxs(n,{children:[e.jsx(l,{children:e.jsx(t,{children:"Provider and fallback state"})}),e.jsx(i,{children:a.provider_states.length?e.jsx("ul",{className:"space-y-2",children:a.provider_states.map(s=>e.jsxs("li",{children:[e.jsx("strong",{children:s.environment}),": ",s.active_provider," · ",s.reason_code," · manifest ",s.manifest_revision]},s.environment))}):e.jsx("p",{children:"No provider state recorded."})})]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs(n,{children:[e.jsx(l,{children:e.jsx(t,{children:"Recent runs"})}),e.jsx(i,{children:a.recent_runs.length?e.jsx("ul",{className:"space-y-2",children:a.recent_runs.map(s=>e.jsxs("li",{children:[e.jsx("strong",{children:j[s.operator]})," · ",s.status," · ",s.exit_classification," · $",s.cost_usd," · ",m(s.created_at)]},s.run_id))}):e.jsx("p",{children:"No runs recorded."})})]}),e.jsxs(n,{children:[e.jsx(l,{children:e.jsx(t,{children:"Recent actions"})}),e.jsx(i,{children:a.recent_actions.length?e.jsx("ul",{className:"space-y-2",children:a.recent_actions.map(s=>e.jsxs("li",{children:[e.jsx("strong",{children:j[s.operator]})," · ",s.capability," · ",s.reason_code," · ",s.resource_kind,"/",s.resource_identifier]},s.action_id))}):e.jsx("p",{children:"No actions recorded."})})]})]}),e.jsxs(n,{children:[e.jsx(l,{children:e.jsx(t,{children:"Hard exclusions"})}),e.jsx(i,{children:e.jsx("ul",{className:"list-disc pl-5",children:a.exclusions.map(s=>e.jsx("li",{children:s},s))})})]}),y&&e.jsxs("p",{role:"alert",children:["Control update failed: ",y,". Refresh before retrying."]})]})})};export{V as default}; +import{l as R,f as d,b as B,J as C,j as e,L as q}from"./index-CxhY4zQ1.js";import{u as Q}from"./useMutation-BzRfwboV.js";import{C as n,e as i,S as H,b as l,c as t,t as E,f as m,o as x}from"./CronDashboard-D2N9pnr3.js";import{B as I}from"./badge-Dj5QKh-d.js";import{B as h}from"./button-BenSiukP.js";import{I as u}from"./input-CxKbyH9e.js";import{A as P}from"./activity-bP8ilshD.js";import{A as D}from"./arrow-left-CDwy-_cK.js";const j={submissions:"Submission review",curation:"Scheduled curation",cron_health:"CRON health",chat_reliability:"Chat reliability"},S={healthy:"healthy",degraded:"degraded",repairing:"running","rolled-back":"broken",manual:"degraded"},V=()=>{var A;const M=R(),[p,T]=d.useState(""),[f,_]=d.useState(""),[b,v]=d.useState({}),[g,N]=d.useState(""),c=B({queryKey:C.autonomousOperations,queryFn:()=>x.getAutonomousOperations(),refetchInterval:3e4,retry:!1}),r=Q({mutationFn:s=>s(),onSuccess:s=>{M.setQueryData(C.autonomousOperations,s),_(""),v({}),N("")}}),a=c.data,y=r.error instanceof Error?r.error.message:null;if(c.isLoading)return e.jsx("div",{className:"page","aria-busy":"true",children:"Loading autonomous operations…"});if(c.error||!a)return e.jsxs("div",{className:"page",children:[e.jsx("h1",{children:"Autonomous operations unavailable"}),e.jsx("p",{children:c.error instanceof Error?c.error.message:"No status was returned."})]});const O=()=>r.mutate(()=>x.setAutonomousManualMode(!a.manual_mode,a.revision,f)),k=(s,o)=>r.mutate(()=>x.setAutonomousOperator(s,o,a.revision,b[s]??"")),w=()=>{var o;const s=((o=a.baseline)==null?void 0:o.revision)??0;r.mutate(()=>x.qualifyAutonomousChatBaseline(p,s,g))};return e.jsx("div",{className:"cron-dashboard","data-shadcn":!0,children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8 space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-3xl font-bold flex items-center gap-3",children:[e.jsx(P,{className:"h-8 w-8"}),"Autonomous operations"]}),e.jsx("p",{className:"mt-2 cron-muted",children:"Content-free supervision, remote controls, and bounded audit history."})]}),e.jsx(h,{asChild:!0,variant:"outline",children:e.jsxs(q,{to:"/admin-dashboard",children:[e.jsx(D,{className:"h-4 w-4 mr-2"}),"Admin dashboard"]})})]}),a.manual_mode&&e.jsx(n,{className:"cron-status--degraded",role:"status",children:e.jsxs(i,{className:"pt-6 flex gap-3",children:[e.jsx(H,{className:"h-5 w-5"}),e.jsxs("div",{children:[e.jsx("strong",{children:"Manual mode is enabled."}),e.jsxs("p",{children:[a.monitoring_active?"Monitoring remains active":"Monitoring is not currently verified","; autonomous callbacks, retries, deployments, and data mutations fail closed."]})]})]})}),e.jsxs("div",{className:"grid md:grid-cols-4 gap-4",children:[e.jsxs(n,{className:E(S[a.display_state]),children:[e.jsx(l,{children:e.jsx(t,{className:"text-sm",children:"Overall state"})}),e.jsxs(i,{children:[e.jsx("div",{className:"text-2xl font-bold capitalize",children:a.display_state}),e.jsxs("p",{className:"text-sm",children:["Monitoring ",a.monitoring_active?"active":"inactive"]})]})]}),e.jsxs(n,{children:[e.jsx(l,{children:e.jsx(t,{className:"text-sm",children:"Codex cost"})}),e.jsxs(i,{children:[e.jsxs("div",{className:"text-2xl font-bold",children:["$",a.costs.total_usd]}),e.jsxs("p",{className:"text-sm",children:[a.costs.input_tokens+a.costs.output_tokens," tokens"]})]})]}),e.jsxs(n,{children:[e.jsx(l,{children:e.jsx(t,{className:"text-sm",children:"Repair lease"})}),e.jsxs(i,{children:[e.jsx("div",{className:"text-lg font-bold",children:a.active_lease?a.active_lease.owner_operator:"Available"}),e.jsx("p",{className:"text-sm",children:a.active_lease?`Expires ${m(a.active_lease.expires_at)}`:"No active source repair"})]})]}),e.jsxs(n,{children:[e.jsx(l,{children:e.jsx(t,{className:"text-sm",children:"Global control"})}),e.jsxs(i,{className:"space-y-2",children:[e.jsx(u,{"aria-label":"Manual mode confirmation",value:f,onChange:s=>_(s.target.value),placeholder:"Type SET_MANUAL_MODE"}),e.jsx(h,{disabled:r.isPending||f!=="SET_MANUAL_MODE",onClick:O,children:a.manual_mode?"Leave manual mode":"Enable manual mode"})]})]})]}),e.jsx("div",{className:"grid md:grid-cols-4 gap-4",children:a.operators.map(s=>e.jsxs(n,{className:E(S[s.status]),children:[e.jsx(l,{children:e.jsxs(t,{className:"flex justify-between gap-2",children:[e.jsx("span",{children:j[s.operator]}),e.jsx(I,{children:s.status})]})}),e.jsxs(i,{className:"space-y-3",children:[e.jsxs("p",{children:[s.enabled?"Mutation enabled":"Mutation disabled"," · monitoring ",s.monitoring_active?"active":"unverified"]}),e.jsxs("p",{className:"text-sm",children:["Next scheduled run: ",s.next_scheduled_run?m(s.next_scheduled_run):"not scheduled"]}),e.jsx(u,{"aria-label":`${j[s.operator]} confirmation`,value:b[s.operator]??"",onChange:o=>v(L=>({...L,[s.operator]:o.target.value})),placeholder:"Type SET_OPERATOR_STATE"}),e.jsx(h,{disabled:r.isPending||a.manual_mode&&!s.enabled||b[s.operator]!=="SET_OPERATOR_STATE",onClick:()=>k(s.operator,!s.enabled),children:s.enabled?"Disable":"Enable"})]})]},s.operator))}),e.jsxs(n,{children:[e.jsx(l,{children:e.jsx(t,{children:"Qualified scalable-chat baseline"})}),e.jsxs(i,{className:"space-y-3",children:[e.jsx("p",{className:"font-mono break-all",children:((A=a.baseline)==null?void 0:A.sha)??"No baseline qualified"}),a.baseline&&e.jsxs("p",{className:"text-sm",children:["Revision ",a.baseline.revision," · ",a.baseline.qualified_by," · ",m(a.baseline.qualified_at)]}),e.jsxs("div",{className:"grid md:grid-cols-[1fr_1fr_auto] gap-2",children:[e.jsx(u,{"aria-label":"Exact baseline SHA",value:p,onChange:s=>T(s.target.value),placeholder:"40-character lowercase commit SHA"}),e.jsx(u,{"aria-label":"Baseline confirmation",value:g,onChange:s=>N(s.target.value),placeholder:"Type QUALIFY_CHAT_BASELINE"}),e.jsx(h,{disabled:r.isPending||!/^[0-9a-f]{40}$/.test(p)||g!=="QUALIFY_CHAT_BASELINE",onClick:w,children:"Qualify exact SHA"})]})]})]}),e.jsxs(n,{children:[e.jsx(l,{children:e.jsx(t,{children:"Provider and fallback state"})}),e.jsx(i,{children:a.provider_states.length?e.jsx("ul",{className:"space-y-2",children:a.provider_states.map(s=>e.jsxs("li",{children:[e.jsx("strong",{children:s.environment}),": ",s.active_provider," · ",s.reason_code," · manifest ",s.manifest_revision]},s.environment))}):e.jsx("p",{children:"No provider state recorded."})})]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs(n,{children:[e.jsx(l,{children:e.jsx(t,{children:"Recent runs"})}),e.jsx(i,{children:a.recent_runs.length?e.jsx("ul",{className:"space-y-2",children:a.recent_runs.map(s=>e.jsxs("li",{children:[e.jsx("strong",{children:j[s.operator]})," · ",s.status," · ",s.exit_classification," · $",s.cost_usd," · ",m(s.created_at)]},s.run_id))}):e.jsx("p",{children:"No runs recorded."})})]}),e.jsxs(n,{children:[e.jsx(l,{children:e.jsx(t,{children:"Recent actions"})}),e.jsx(i,{children:a.recent_actions.length?e.jsx("ul",{className:"space-y-2",children:a.recent_actions.map(s=>e.jsxs("li",{children:[e.jsx("strong",{children:j[s.operator]})," · ",s.capability," · ",s.reason_code," · ",s.resource_kind,"/",s.resource_identifier]},s.action_id))}):e.jsx("p",{children:"No actions recorded."})})]})]}),e.jsxs(n,{children:[e.jsx(l,{children:e.jsx(t,{children:"Hard exclusions"})}),e.jsx(i,{children:e.jsx("ul",{className:"list-disc pl-5",children:a.exclusions.map(s=>e.jsx("li",{children:s},s))})})]}),y&&e.jsxs("p",{role:"alert",children:["Control update failed: ",y,". Refresh before retrying."]})]})})};export{V as default}; diff --git a/assets/BenchmarkDetailView-BQc3hR5I.js b/assets/BenchmarkDetailView-ujezOHA2.js similarity index 98% rename from assets/BenchmarkDetailView-BQc3hR5I.js rename to assets/BenchmarkDetailView-ujezOHA2.js index e39e485ac7e859a07bbd2e05d179eefea12fae2c..cf499e0882f3f767d1f9b5456a2e1fd38aea8abc 100644 --- a/assets/BenchmarkDetailView-BQc3hR5I.js +++ b/assets/BenchmarkDetailView-ujezOHA2.js @@ -1,2 +1,2 @@ -import{f as L,j as a,M as le,L as ne,k as dt,x as ut,u as mt,e as ht,b as te,q as de,t as ft,T as oe}from"./index-3CfcAX6N.js";import{R as pt}from"./ResearchFollowButton-YEXlvC8K.js";import{c as re}from"./catalog-B47DuClX.js";import{C as gt,E as xt,e as bt}from"./ExternalSourceEvalBadge-CqK4g_y6.js";import{u as yt}from"./preferences-BmWwgggH.js";import{L as ce}from"./LatexTitle-DvPeLepK.js";import{S as Ge}from"./switch-B40zv53e.js";import{I as wt}from"./Icon-C0d9p4Q2.js";import{S as ue}from"./skeleton-CQbSjC3L.js";import{A as vt,a as jt}from"./alert-BXZ4lnnf.js";import{B as _t}from"./BenchmarkTrendSparkline--hXPKyI4.js";import{s as St}from"./safeExternalHref-CkBrsh84.js";import{s as kt}from"./slug-BpH-Nkvz.js";import{i as Ct}from"./apiErrors-XoIVpN_S.js";import Et from"./NotFound-DXa9p6DX.js";import"./researchTopic-Z4AJDMN7.js";import"./useMutation-CKC6OFhA.js";import"./plus-CiDEk52y.js";import"./curation-BZoIvsHD.js";import"./hover-card-DOKhkRf9.js";import"./account-Ee9-ZosC.js";import"./index-Caztwwvv.js";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 Xe=[{label:"All",maxParametersExclusive:void 0},{label:"<10M",maxParametersExclusive:1e7},{label:"<100M",maxParametersExclusive:1e8},{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 Nt(e){const t=e===null?void 0:Number(e);return Xe.some(r=>r.maxParametersExclusive===t)?t:void 0}function Rt(e){return new Intl.NumberFormat("en",{notation:"compact",maximumSignificantDigits:3}).format(e)}function Pt(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function Tt(e){const t=new Map;for(const r of e){const s=Pt(r),n=t.get(s);if(!n){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}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 Ae(e,t){return t===void 0?e:e.filter(r=>r.parameterCount!==null&&r.parameterCounts+n,0);for(const[s,n]of t)if(n>=2&&n*2>r)return s;return null}function Lt(e,t){const r=e.evaluated_on;return r&&r!==t&&r!==$t(e.updated_at)?r:e.paper_published_date||""}function It(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const s=Ft(e),n=e.map(u=>{var R;const h=ie((R=u.metrics)==null?void 0:R[t]);return{eval:u,value:h,date:Lt(u,s)}}).filter(u=>u.value!==null&&!!u.date).sort((u,h)=>u.date.localeCompare(h.date)),i=[];let l=null;for(const u of n){const h=l==null?!0:r==="↓"?u.valuel;h&&(l=u.value),i.push({value:u.value,date:u.date,dateLabel:u.date.slice(0,7),modelName:u.eval.model_name||"",paperTitle:u.eval.paper_title||"",paperRouteId:u.eval.paper_arxiv_id||u.eval.paper_id||null,isSota:h})}const d=e.map(u=>{var h;return{eval:u,value:ie((h=u.metrics)==null?void 0:h[t])}}).filter(u=>u.value!==null).sort((u,h)=>r==="↓"?u.value-h.value:h.value-u.value)[0],f=(d==null?void 0:d.value)??0,x=(d==null?void 0:d.eval.model_name)||(d==null?void 0:d.eval.paper_title)||"";return{points:i,sota:f,sotaModel:x}}function At(e,t,r){const s=t?(e??[]).filter(l=>l.task_id===t):e??[],n=s.filter(l=>l.is_open===!1),i=n.reduce((l,c)=>l?(c.best_rank??Number.POSITIVE_INFINITY)<(l.best_rank??Number.POSITIVE_INFINITY)?c:l:c,null);return{visible:r?s.filter(l=>l.is_open!==!1):s,hiddenClosed:n,topHiddenClosed:i}}function Ye(e,t,r,s){const n=t.find(i=>i.id===s);if(e.length===0)return null;if(n!=null&&n.task_id&&e.some(i=>i.id===n.task_id))return n.task_id;if(r){const i=e.find(l=>l.slug===r);if(i)return i.id}if(e.length===1)return e[0].id;if(t.length>0){const i=new Map;for(const d of t)i.set(d.task_id,(i.get(d.task_id)||0)+1);let l=null,c=-1;for(const d of e){const f=i.get(d.id)||0;f>c&&(c=f,l=d.id)}if(l)return l}return e[0].id}function Bt(e){var _,X,Y;const{evaluations:t,tasks:r,taskSlug:s,highlightEvalId:n,parameterBound:i,showMoreMetrics:l,fittingMetricCount:c=1}=e,d=Ye(r,t,s,n),f=r.find(o=>o.id===d)||r[0]||null,x=t.find(o=>o.id===n),u=At(t,d,e.hideClosed),h=Tt(u.visible),R=Ae(h,i),C=e.configuredMetrics.map(o=>o.metric_name),P=Array.from(new Set(h.flatMap(o=>[...o.best_metric?[o.best_metric]:[],...Object.keys(o.metrics||{})]))),S=C.length?C:P,g=new Map;for(const o of h){const m=o.best_metric;!m||ie(o.metrics[m])===null||C.length&&!S.includes(m)||g.set(m,(g.get(m)||0)+1)}const k=((_=[...g].sort((o,m)=>m[1]-o[1])[0])==null?void 0:_[0])||S[0]||"",j=S.find(o=>{var m;return o.toLocaleLowerCase()===((m=e.metric)==null?void 0:m.trim().toLocaleLowerCase())})||(x==null?void 0:x.best_metric)||k,D=((X=e.directions)==null?void 0:X.directions[j])==="lower_is_better"?"↓":"↑",W=j&&S.includes(j)?[j,...S.filter(o=>o!==j)]:S,w=W.length?l?W:W.slice(0,Math.max(1,c)):j?[j]:[],q=R.slice().sort((o,m)=>{const p=ie(o.metrics[j]),y=ie(m.metrics[j]);return p!==null&&y!==null?D==="↓"?p-y:y-p:p!==null?-1:y!==null?1:Be(o,j)-Be(m,j)});let I=null,N=0;const G=q.map((o,m)=>{const p=ie(o.metrics[j]);return p!==null&&p!==I&&(I=p,N=m+1),{evaluation:o,rank:p===null?null:N,isHighlighted:Mt(o,n)}}),{points:z,sota:ee,sotaModel:O}=It(R,j,D),M=i===void 0?e.initialSummary:void 0,U=e.ready.evaluations&&e.ready.tasks&&e.ready.directions&&(!d||e.ready.metrics),K={parameter_coverage_known:h.filter(o=>o.parameterCount!==null).length,parameter_coverage_total:h.length};return{currentTaskId:d,primaryTask:f,activeMetric:j,arrow:D,allowedMetrics:S,orderedMetrics:W,visibleMetrics:w,rows:G,chartPoints:z,highlightedEval:((Y=G.find(o=>o.isHighlighted))==null?void 0:Y.evaluation)||null,hiddenClosedEvals:u.hiddenClosed,hiddenClosedTopEval:u.topHiddenClosed,parameterBound:i,parameterCoverage:K,hasParameterMetadata:K.parameter_coverage_known>0,parameterFilters:Xe.map(o=>({...o,selected:i===o.maxParametersExclusive,disabled:i!==o.maxParametersExclusive&&Ae(h,o.maxParametersExclusive).length===0})),displayedMetric:U?j:M==null?void 0:M.metric,displayedSota:U?ee:M==null?void 0:M.value,displayedSotaModel:U?O:M==null?void 0:M.model_name,isSummaryLoading:!U&&!M,isInitialFilteredViewLoading:i!==void 0&&!U}}function Dt(e,t,r,s=1,n=0){const i=e-t.fixed-(r?t.harness:0);if(t.metric<=0)return 1;const l=Math.floor(i/t.metric);if(lr+pe(t,s),0),harness:pe(t,"--bm-harness-width"),metric:pe(t,"--bm-metric-width")}}const Vt=20;function De(e,t){return e?a.jsx(ce,{title:e}):t||"—"}function Wt({model:e,showHarness:t,setMetric:r,highlightRowRef:s,onFittingMetricCountChange:n}){const{rows:i,visibleMetrics:l,activeMetric:c,arrow:d}=e,[f,x]=L.useState(null);return L.useEffect(()=>{if(!f)return;const u=()=>{f.classList.toggle("has-horizontal-overflow",f.scrollWidth>f.clientWidth);const R=f.firstElementChild;if(!R)return;const C=f.clientWidth,P=Ht(R);f.classList.toggle("unpins-trailing-columns",CS.clientHeight?0:Vt;n(k=>Dt(C,P,t,k,g))},h=new ResizeObserver(u);return h.observe(f),f.firstElementChild&&h.observe(f.firstElementChild),u(),()=>h.disconnect()},[f,t,n]),a.jsx("div",{ref:x,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":l.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"}),l.map(u=>a.jsx("col",{className:"bm-width-metric"},u)),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.jsxs("th",{className:"col-parameters",children:[a.jsx("span",{className:"bm-label-full",children:"Parameters"}),a.jsx("span",{className:"bm-label-short",children:"Params"})]}),t&&a.jsx("th",{className:"col-harness",children:"Harness"}),l.map(u=>{const h=u===c;return a.jsx("th",{className:`col-value ${h?"is-active":""}`,"aria-sort":h?d==="↓"?"ascending":"descending":"none",children:a.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>r(u),"aria-pressed":h,title:`Sort by ${u}`,children:[u,h?` ${d}`:""]})},u)}),a.jsx("th",{className:"col-paper",children:"Paper"}),a.jsx("th",{className:"col-year",children:"Year"})]})}),a.jsx("tbody",{children:i.map(({evaluation:u,rank:h,isHighlighted:R})=>{var S;const C=u.paper_arxiv_id||u.paper_id,P=u.paper_title||(u.paper_arxiv_id?`arXiv:${u.paper_arxiv_id}`:null);return a.jsxs("tr",{ref:R?s:void 0,className:R?"is-highlighted":void 0,children:[a.jsx("td",{className:"col-rank",children:h??"—"}),a.jsxs("td",{className:"col-model",children:[R&&a.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),u.hf_model_url?a.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&&a.jsx(gt,{}),(u.external??u.is_external)&&a.jsx(xt,{sourceUrl:u.source_url||u.external_source_url||u.result_url})]}),a.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?"—":Rt(u.parameterCount)}),t&&a.jsx("td",{className:"col-harness",children:u.harness||"—"}),l.map(g=>{var j;const k=g===c,B=(j=u.metrics)==null?void 0:j[g];return a.jsx("td",{className:`col-value${k?" is-active":""}${k&&h===1?" is-best":""}`,children:B!=null&&B!==""?le(B):"—"},g)}),a.jsx("td",{className:"col-paper",children:C?a.jsx(ne,{to:`/paper/${C}`,title:u.paper_title||P||void 0,children:De(u.paper_title,P)}):De(u.paper_title,P)}),a.jsx("td",{className:"col-year",children:((S=u.evaluated_on||u.paper_published_date)==null?void 0:S.slice(0,4))||"—"})]},u.id)})})]})})}function He(e){const t=e.length===7?`${e}-01`:e,r=new Date(t).getTime();return Number.isFinite(r)?r:0}const ge=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function xe(e){const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()}}function Ot(e,t){if(e===t){const{year:d,month:f}=xe(e);return[{timestamp:new Date(d,f,1).getTime(),key:`${d}-${f}`,label:`${ge[f]} ${d}`}]}const r=xe(e),s=xe(t);if(r.year===s.year){const d=s.month-r.month+1;let f=1;const x=12;d>x&&(f=Math.ceil(d/x));const u=[];for(let h=r.month;h<=s.month;h+=f)u.push({timestamp:new Date(r.year,h,1).getTime(),key:`${r.year}-${h}`,label:d<=3?`${ge[h]} ${r.year}`:ge[h]});return u}const n=s.year-r.year+1;let i=1;const l=12;n>l&&(i=Math.ceil(n/l));const c=[];for(let d=r.year;d<=s.year;d+=i)c.push({timestamp:new Date(d,0,1).getTime(),key:String(d),label:String(d)});return c}const Ut=({points:e,metric:t})=>{const r=dt(),[s,n]=L.useState(null),i=880,l=320,c=60,d=30,f=40,x=50,u=e.map(o=>o.value),h=Math.min(...u),C=Math.max(...u)-h||1,P=i-c-d,S=l-f-x,g=e.map(o=>He(o.date)),k=Math.min(...g),B=Math.max(...g),j=B-k||1,D=o=>k===B?c+P/2:c+(o-k)/j*P,W=e.map((o,m)=>{const p=D(He(o.date)),y=(o.value-h)/C,T=f+S*(1-y);return{x:p,y:T,data:o,idx:m}}),w=W.filter(o=>o.data.isSota);let q="";if(w.length>=2){q=`M${w[0].x},${w[0].y}`;for(let o=1;o{const m=o.data.modelName||o.data.paperTitle||"";if(!m)return null;const p=m.length>22?m.slice(0,21)+"…":m,y=p.length*I;let T=o.x-y/2,E=o.x+y/2,v="middle";return Ti-d&&(E=i-d,T=E-y,v="end"),{x:v==="start"?c:v==="end"?i-d:o.x,y:o.y-G,text:p,anchor:v,left:T,right:E}},ee=[],O=w.length>0?z(w[w.length-1]):null;let M=-1/0;for(let o=0;oO.left-N||(M=m.right,ee.push({x:m.x,y:m.y,text:m.text,anchor:m.anchor})))}O&&ee.push({x:O.x,y:O.y,text:O.text,anchor:O.anchor});const U=Ot(k,B),K=5,_=o=>n(m=>m===o?null:m),X=o=>{o&&r(`/paper/${o}`)},Y=(o,m)=>{const y=`${o.data.modelName||o.data.paperTitle||"Unknown model"}: ${le(o.data.value)} on ${o.data.dateLabel}`,T=!!o.data.paperRouteId;return a.jsxs("g",{children:[m,a.jsx("circle",{cx:o.x,cy:o.y,r:"10",fill:"transparent",style:{cursor:T?"pointer":"default",outline:"none"},tabIndex:0,role:T?"link":"img","aria-label":y,onMouseEnter:()=>n(o.idx),onMouseLeave:()=>_(o.idx),onFocus:()=>n(o.idx),onBlur:()=>_(o.idx),onClick:()=>X(o.data.paperRouteId),onKeyDown:E=>{T&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),X(o.data.paperRouteId))},children:a.jsx("title",{children:y})})]},o.idx)};return a.jsxs("svg",{width:"100%",viewBox:`0 0 ${i} ${l}`,style:{display:"block"},children:[a.jsx("text",{x:c-38,y:f+S/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${c-38} ${f+S/2})`,children:t}),Array.from({length:K}).map((o,m)=>{const p=m/(K-1),y=f+S*(1-p),T=h+C*p;return a.jsxs("g",{children:[a.jsx("line",{x1:c,y1:y,x2:i-d,y2:y,stroke:"var(--hairline)",strokeWidth:"1"}),a.jsx("text",{x:c-10,y:y+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:le(T)})]},m)}),U.map(o=>{const m=D(o.timestamp);return a.jsx("text",{x:m,y:l-x+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:o.label},o.key)}),W.filter(o=>!o.data.isSota).map(o=>{const m=s===o.idx;return Y(o,a.jsx("circle",{cx:o.x,cy:o.y,r:m?3:2,fill:"var(--ink-faint)",opacity:m?1:.45,style:{transition:"r 0.12s ease, opacity 0.12s ease"}}))}),q&&a.jsx("path",{d:q,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),w.map(o=>{const m=s===o.idx;return Y(o,a.jsx("circle",{cx:o.x,cy:o.y,r:m?4.5:3,fill:m?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"1.5",style:{transition:"r 0.12s ease, fill 0.12s ease"}}))}),ee.map((o,m)=>a.jsx("text",{x:o.x,y:o.y,fontSize:"9.5",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:o.anchor,pointerEvents:"none",style:{paintOrder:"stroke",stroke:"var(--bg-elevated)",strokeWidth:3,strokeLinejoin:"round"},children:o.text},`label-${m}`)),s!==null&&W[s]&&(()=>{const o=W[s],m=o.data.modelName||o.data.paperTitle||"Unknown model",y=`${m.length>40?m.slice(0,39)+"…":m}: ${le(o.data.value)}`,E=Math.max(120,Math.min(340,y.length*6.6+24)),v=30;let H=o.x-E/2;Hi-d&&(H=i-d-E);const Q=o.y-v-14>=f?o.y-v-12:o.y+12;return a.jsxs("g",{pointerEvents:"none",children:[a.jsx("rect",{x:H,y:Q,width:E,height:v,rx:"6",ry:"6",fill:"var(--bg-elevated)",stroke:"var(--hairline-strong)",strokeWidth:"1",style:{filter:"drop-shadow(0 2px 6px rgba(0,0,0,0.08))"}}),a.jsx("text",{x:H+12,y:Q+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:y})]})})()]})};function qt(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"),n=r.createElement("a");return r.head.appendChild(s),r.body.appendChild(n),t&&(s.href=t),n.href=e,n.href}const zt=(()=>{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,s=e.length;rV||e.height>V)&&(e.width>V&&e.height>V?e.width>e.height?(e.height*=V/e.width,e.width=V):(e.width*=V/e.height,e.height=V):e.width>V?(e.height*=V/e.width,e.width=V):(e.width*=V/e.height,e.height=V))}function Yt(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]),n=s.length,i=new Uint8Array(n);for(let l=0;l{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 Jt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Zt(e,t,r){const s="http://www.w3.org/2000/svg",n=document.createElementNS(s,"svg"),i=document.createElementNS(s,"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),Jt(n)}const A=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||A(r,t)};function er(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function tr(e,t){return Je(t).map(r=>{const s=e.getPropertyValue(r),n=e.getPropertyPriority(r);return`${r}: ${s}${n?" !important":""};`}).join(" ")}function rr(e,t,r,s){const n=`.${e}:${t}`,i=r.cssText?er(r):tr(r,s);return document.createTextNode(`${n}{${i}}`)}function Ve(e,t,r,s){const n=window.getComputedStyle(e,r),i=n.getPropertyValue("content");if(i===""||i==="none")return;const l=zt();try{t.className=`${t.className} ${l}`}catch{return}const c=document.createElement("style");c.appendChild(rr(l,r,n,s)),t.appendChild(c)}function ar(e,t,r){Ve(e,t,":before",r),Ve(e,t,":after",r)}const We="application/font-woff",Oe="image/jpeg",sr={woff:We,woff2:We,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Oe,jpeg:Oe,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function nr(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function ve(e){const t=nr(e).toLowerCase();return sr[t]||""}function ir(e){return e.split(/,/)[1]}function ye(e){return e.search(/^(data:)/)!==-1}function lr(e,t){return`data:${t};base64,${e}`}async function et(e,t,r){const s=await fetch(e,t);if(s.status===404)throw new Error(`Resource "${s.url}" not found`);const n=await s.blob();return new Promise((i,l)=>{const c=new FileReader;c.onerror=l,c.onloadend=()=>{try{i(r({res:s,result:c.result}))}catch(d){l(d)}},c.readAsDataURL(n)})}const be={};function or(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 je(e,t,r){const s=or(e,t,r.includeQueryParams);if(be[s]!=null)return be[s];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let n;try{const i=await et(e,r.fetchRequestInit,({res:l,result:c})=>(t||(t=l.headers.get("Content-Type")||""),ir(c)));n=lr(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[s]=n,n}async function cr(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):he(t)}async function dr(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 c=i.toDataURL();return he(c)}const r=e.poster,s=ve(r),n=await je(r,s,t);return he(n)}async function ur(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await fe(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function mr(e,t){return A(e,HTMLCanvasElement)?cr(e):A(e,HTMLVideoElement)?dr(e,t):A(e,HTMLIFrameElement)?ur(e,t):e.cloneNode(tt(e))}const hr=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",tt=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function fr(e,t,r){var s,n;if(tt(t))return t;let i=[];return hr(e)&&e.assignedNodes?i=Z(e.assignedNodes()):A(e,HTMLIFrameElement)&&(!((s=e.contentDocument)===null||s===void 0)&&s.body)?i=Z(e.contentDocument.body.childNodes):i=Z(((n=e.shadowRoot)!==null&&n!==void 0?n:e).childNodes),i.length===0||A(e,HTMLVideoElement)||await i.reduce((l,c)=>l.then(()=>fe(c,r)).then(d=>{d&&t.appendChild(d)}),Promise.resolve()),t}function pr(e,t,r){const s=t.style;if(!s)return;const n=window.getComputedStyle(e);n.cssText?(s.cssText=n.cssText,s.transformOrigin=n.transformOrigin):Je(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`),A(e,HTMLIFrameElement)&&i==="display"&&l==="inline"&&(l="block"),i==="d"&&t.getAttribute("d")&&(l=`path(${t.getAttribute("d")})`),s.setProperty(i,l,n.getPropertyPriority(i))})}function gr(e,t){A(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),A(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function xr(e,t){if(A(e,HTMLSelectElement)){const r=t,s=Array.from(r.children).find(n=>e.value===n.getAttribute("value"));s&&s.setAttribute("selected","")}}function br(e,t,r){return A(t,Element)&&(pr(e,t,r),ar(e,t,r),gr(e,t),xr(e,t)),t}async function yr(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const s={};for(let i=0;imr(s,t)).then(s=>fr(e,s,t)).then(s=>br(e,s,t)).then(s=>yr(s,t))}const rt=/url\((['"]?)([^'"]+?)\1\)/g,wr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,vr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function jr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function _r(e){const t=[];return e.replace(rt,(r,s,n)=>(t.push(n),r)),t.filter(r=>!ye(r))}async function Sr(e,t,r,s,n){try{const i=r?qt(t,r):t,l=ve(t);let c;return n||(c=await je(i,l,s)),e.replace(jr(t),`$1${c}$3`)}catch{}return e}function kr(e,{preferredFontFormat:t}){return t?e.replace(vr,r=>{for(;;){const[s,,n]=wr.exec(r)||[];if(!n)return"";if(n===t)return`src: ${s};`}}):e}function at(e){return e.search(rt)!==-1}async function st(e,t,r){if(!at(e))return e;const s=kr(e,r);return _r(s).reduce((i,l)=>i.then(c=>Sr(c,l,t,r)),Promise.resolve(s))}async function se(e,t,r){var s;const n=(s=t.style)===null||s===void 0?void 0:s.getPropertyValue(e);if(n){const i=await st(n,null,r);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function Cr(e,t){await se("background",e,t)||await se("background-image",e,t),await se("mask",e,t)||await se("-webkit-mask",e,t)||await se("mask-image",e,t)||await se("-webkit-mask-image",e,t)}async function Er(e,t){const r=A(e,HTMLImageElement);if(!(r&&!ye(e.src))&&!(A(e,SVGImageElement)&&!ye(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,n=await je(s,ve(s),t);await new Promise((i,l)=>{e.onload=i,e.onerror=t.onImageErrorHandler?(...d)=>{try{i(t.onImageErrorHandler(...d))}catch(f){l(f)}}:l;const c=e;c.decode&&(c.decode=i),c.loading==="lazy"&&(c.loading="eager"),r?(e.srcset="",e.src=n):e.href.baseVal=n})}async function Nr(e,t){const s=Z(e.childNodes).map(n=>nt(n,t));await Promise.all(s).then(()=>e)}async function nt(e,t){A(e,Element)&&(await Cr(e,t),await Er(e,t),await Nr(e,t))}function Rr(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(n=>{r[n]=s[n]}),e}const Ue={};async function qe(e){let t=Ue[e];if(t!=null)return t;const s=await(await fetch(e)).text();return t={url:e,cssText:s},Ue[e]=t,t}async function ze(e,t){let r=e.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async l=>{let c=l.replace(s,"$1");return c.startsWith("https://")||(c=new URL(c,e.url).href),et(c,t.fetchRequestInit,({result:d})=>(r=r.replace(l,`url(${d})`),[l,d]))});return Promise.all(i).then(()=>r)}function Ke(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let s=e.replace(r,"");const n=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const d=n.exec(s);if(d===null)break;t.push(d[0])}s=s.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]*?)})",c=new RegExp(l,"gi");for(;;){let d=i.exec(s);if(d===null){if(d=c.exec(s),d===null)break;i.lastIndex=c.lastIndex}else c.lastIndex=i.lastIndex;t.push(d[0])}return t}async function Pr(e,t){const r=[],s=[];return e.forEach(n=>{if("cssRules"in n)try{Z(n.cssRules||[]).forEach((i,l)=>{if(i.type===CSSRule.IMPORT_RULE){let c=l+1;const d=i.href,f=qe(d).then(x=>ze(x,t)).then(x=>Ke(x).forEach(u=>{try{n.insertRule(u,u.startsWith("@import")?c+=1:n.cssRules.length)}catch(h){console.error("Error inserting rule from remote css",{rule:u,error:h})}})).catch(x=>{console.error("Error loading remote css",x.toString())});s.push(f)}})}catch(i){const l=e.find(c=>c.href==null)||document.styleSheets[0];n.href!=null&&s.push(qe(n.href).then(c=>ze(c,t)).then(c=>Ke(c).forEach(d=>{l.insertRule(d,l.cssRules.length)})).catch(c=>{console.error("Error loading remote stylesheet",c)})),console.error("Error inlining remote css file",i)}}),Promise.all(s).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 Tr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>at(t.style.getPropertyValue("src")))}async function Mr(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=Z(e.ownerDocument.styleSheets),s=await Pr(r,t);return Tr(s)}function it(e){return e.trim().replace(/["']/g,"")}function $r(e){const t=new Set;function r(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(i=>{t.add(it(i))}),Array.from(s.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function Fr(e,t){const r=await Mr(e,t),s=$r(e);return(await Promise.all(r.filter(i=>s.has(it(i.style.fontFamily))).map(i=>{const l=i.parentStyleSheet?i.parentStyleSheet.href:null;return st(i.cssText,l,t)}))).join(` +import{f as L,j as a,M as le,L as ne,k as dt,x as ut,u as mt,e as ht,b as te,q as de,t as ft,T as oe}from"./index-CxhY4zQ1.js";import{R as pt}from"./ResearchFollowButton-DPFVPZ0U.js";import{c as re}from"./catalog-DCEU6WpP.js";import{C as gt,E as xt,e as bt}from"./ExternalSourceEvalBadge-VjNs_cVj.js";import{u as yt}from"./preferences-CUy01zEm.js";import{L as ce}from"./LatexTitle-BqNrCKu8.js";import{S as Ge}from"./switch-COruZUxK.js";import{I as wt}from"./Icon-XOOkUEUX.js";import{S as ue}from"./skeleton-DdKViE4r.js";import{A as vt,a as jt}from"./alert-C-NbJX4N.js";import{B as _t}from"./BenchmarkTrendSparkline-daMK8XXD.js";import{s as St}from"./safeExternalHref-CkBrsh84.js";import{s as kt}from"./slug-BpH-Nkvz.js";import{i as Ct}from"./apiErrors-D2bSY3Dq.js";import Et from"./NotFound-BeRulOFd.js";import"./researchTopic-DXZVIvAq.js";import"./useMutation-BzRfwboV.js";import"./plus-CEkdlNSn.js";import"./curation-D2sqKAqC.js";import"./hover-card-CqKeZcpY.js";import"./account-Bplq3u-8.js";import"./index-JxIVN7pD.js";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 Xe=[{label:"All",maxParametersExclusive:void 0},{label:"<10M",maxParametersExclusive:1e7},{label:"<100M",maxParametersExclusive:1e8},{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 Nt(e){const t=e===null?void 0:Number(e);return Xe.some(r=>r.maxParametersExclusive===t)?t:void 0}function Rt(e){return new Intl.NumberFormat("en",{notation:"compact",maximumSignificantDigits:3}).format(e)}function Pt(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function Tt(e){const t=new Map;for(const r of e){const s=Pt(r),n=t.get(s);if(!n){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}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 Ae(e,t){return t===void 0?e:e.filter(r=>r.parameterCount!==null&&r.parameterCounts+n,0);for(const[s,n]of t)if(n>=2&&n*2>r)return s;return null}function Lt(e,t){const r=e.evaluated_on;return r&&r!==t&&r!==$t(e.updated_at)?r:e.paper_published_date||""}function It(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const s=Ft(e),n=e.map(u=>{var R;const h=ie((R=u.metrics)==null?void 0:R[t]);return{eval:u,value:h,date:Lt(u,s)}}).filter(u=>u.value!==null&&!!u.date).sort((u,h)=>u.date.localeCompare(h.date)),i=[];let l=null;for(const u of n){const h=l==null?!0:r==="↓"?u.valuel;h&&(l=u.value),i.push({value:u.value,date:u.date,dateLabel:u.date.slice(0,7),modelName:u.eval.model_name||"",paperTitle:u.eval.paper_title||"",paperRouteId:u.eval.paper_arxiv_id||u.eval.paper_id||null,isSota:h})}const d=e.map(u=>{var h;return{eval:u,value:ie((h=u.metrics)==null?void 0:h[t])}}).filter(u=>u.value!==null).sort((u,h)=>r==="↓"?u.value-h.value:h.value-u.value)[0],f=(d==null?void 0:d.value)??0,x=(d==null?void 0:d.eval.model_name)||(d==null?void 0:d.eval.paper_title)||"";return{points:i,sota:f,sotaModel:x}}function At(e,t,r){const s=t?(e??[]).filter(l=>l.task_id===t):e??[],n=s.filter(l=>l.is_open===!1),i=n.reduce((l,c)=>l?(c.best_rank??Number.POSITIVE_INFINITY)<(l.best_rank??Number.POSITIVE_INFINITY)?c:l:c,null);return{visible:r?s.filter(l=>l.is_open!==!1):s,hiddenClosed:n,topHiddenClosed:i}}function Ye(e,t,r,s){const n=t.find(i=>i.id===s);if(e.length===0)return null;if(n!=null&&n.task_id&&e.some(i=>i.id===n.task_id))return n.task_id;if(r){const i=e.find(l=>l.slug===r);if(i)return i.id}if(e.length===1)return e[0].id;if(t.length>0){const i=new Map;for(const d of t)i.set(d.task_id,(i.get(d.task_id)||0)+1);let l=null,c=-1;for(const d of e){const f=i.get(d.id)||0;f>c&&(c=f,l=d.id)}if(l)return l}return e[0].id}function Bt(e){var _,X,Y;const{evaluations:t,tasks:r,taskSlug:s,highlightEvalId:n,parameterBound:i,showMoreMetrics:l,fittingMetricCount:c=1}=e,d=Ye(r,t,s,n),f=r.find(o=>o.id===d)||r[0]||null,x=t.find(o=>o.id===n),u=At(t,d,e.hideClosed),h=Tt(u.visible),R=Ae(h,i),C=e.configuredMetrics.map(o=>o.metric_name),P=Array.from(new Set(h.flatMap(o=>[...o.best_metric?[o.best_metric]:[],...Object.keys(o.metrics||{})]))),S=C.length?C:P,g=new Map;for(const o of h){const m=o.best_metric;!m||ie(o.metrics[m])===null||C.length&&!S.includes(m)||g.set(m,(g.get(m)||0)+1)}const k=((_=[...g].sort((o,m)=>m[1]-o[1])[0])==null?void 0:_[0])||S[0]||"",j=S.find(o=>{var m;return o.toLocaleLowerCase()===((m=e.metric)==null?void 0:m.trim().toLocaleLowerCase())})||(x==null?void 0:x.best_metric)||k,D=((X=e.directions)==null?void 0:X.directions[j])==="lower_is_better"?"↓":"↑",W=j&&S.includes(j)?[j,...S.filter(o=>o!==j)]:S,w=W.length?l?W:W.slice(0,Math.max(1,c)):j?[j]:[],q=R.slice().sort((o,m)=>{const p=ie(o.metrics[j]),y=ie(m.metrics[j]);return p!==null&&y!==null?D==="↓"?p-y:y-p:p!==null?-1:y!==null?1:Be(o,j)-Be(m,j)});let I=null,N=0;const G=q.map((o,m)=>{const p=ie(o.metrics[j]);return p!==null&&p!==I&&(I=p,N=m+1),{evaluation:o,rank:p===null?null:N,isHighlighted:Mt(o,n)}}),{points:z,sota:ee,sotaModel:O}=It(R,j,D),M=i===void 0?e.initialSummary:void 0,U=e.ready.evaluations&&e.ready.tasks&&e.ready.directions&&(!d||e.ready.metrics),K={parameter_coverage_known:h.filter(o=>o.parameterCount!==null).length,parameter_coverage_total:h.length};return{currentTaskId:d,primaryTask:f,activeMetric:j,arrow:D,allowedMetrics:S,orderedMetrics:W,visibleMetrics:w,rows:G,chartPoints:z,highlightedEval:((Y=G.find(o=>o.isHighlighted))==null?void 0:Y.evaluation)||null,hiddenClosedEvals:u.hiddenClosed,hiddenClosedTopEval:u.topHiddenClosed,parameterBound:i,parameterCoverage:K,hasParameterMetadata:K.parameter_coverage_known>0,parameterFilters:Xe.map(o=>({...o,selected:i===o.maxParametersExclusive,disabled:i!==o.maxParametersExclusive&&Ae(h,o.maxParametersExclusive).length===0})),displayedMetric:U?j:M==null?void 0:M.metric,displayedSota:U?ee:M==null?void 0:M.value,displayedSotaModel:U?O:M==null?void 0:M.model_name,isSummaryLoading:!U&&!M,isInitialFilteredViewLoading:i!==void 0&&!U}}function Dt(e,t,r,s=1,n=0){const i=e-t.fixed-(r?t.harness:0);if(t.metric<=0)return 1;const l=Math.floor(i/t.metric);if(lr+pe(t,s),0),harness:pe(t,"--bm-harness-width"),metric:pe(t,"--bm-metric-width")}}const Vt=20;function De(e,t){return e?a.jsx(ce,{title:e}):t||"—"}function Wt({model:e,showHarness:t,setMetric:r,highlightRowRef:s,onFittingMetricCountChange:n}){const{rows:i,visibleMetrics:l,activeMetric:c,arrow:d}=e,[f,x]=L.useState(null);return L.useEffect(()=>{if(!f)return;const u=()=>{f.classList.toggle("has-horizontal-overflow",f.scrollWidth>f.clientWidth);const R=f.firstElementChild;if(!R)return;const C=f.clientWidth,P=Ht(R);f.classList.toggle("unpins-trailing-columns",CS.clientHeight?0:Vt;n(k=>Dt(C,P,t,k,g))},h=new ResizeObserver(u);return h.observe(f),f.firstElementChild&&h.observe(f.firstElementChild),u(),()=>h.disconnect()},[f,t,n]),a.jsx("div",{ref:x,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":l.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"}),l.map(u=>a.jsx("col",{className:"bm-width-metric"},u)),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.jsxs("th",{className:"col-parameters",children:[a.jsx("span",{className:"bm-label-full",children:"Parameters"}),a.jsx("span",{className:"bm-label-short",children:"Params"})]}),t&&a.jsx("th",{className:"col-harness",children:"Harness"}),l.map(u=>{const h=u===c;return a.jsx("th",{className:`col-value ${h?"is-active":""}`,"aria-sort":h?d==="↓"?"ascending":"descending":"none",children:a.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>r(u),"aria-pressed":h,title:`Sort by ${u}`,children:[u,h?` ${d}`:""]})},u)}),a.jsx("th",{className:"col-paper",children:"Paper"}),a.jsx("th",{className:"col-year",children:"Year"})]})}),a.jsx("tbody",{children:i.map(({evaluation:u,rank:h,isHighlighted:R})=>{var S;const C=u.paper_arxiv_id||u.paper_id,P=u.paper_title||(u.paper_arxiv_id?`arXiv:${u.paper_arxiv_id}`:null);return a.jsxs("tr",{ref:R?s:void 0,className:R?"is-highlighted":void 0,children:[a.jsx("td",{className:"col-rank",children:h??"—"}),a.jsxs("td",{className:"col-model",children:[R&&a.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),u.hf_model_url?a.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&&a.jsx(gt,{}),(u.external??u.is_external)&&a.jsx(xt,{sourceUrl:u.source_url||u.external_source_url||u.result_url})]}),a.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?"—":Rt(u.parameterCount)}),t&&a.jsx("td",{className:"col-harness",children:u.harness||"—"}),l.map(g=>{var j;const k=g===c,B=(j=u.metrics)==null?void 0:j[g];return a.jsx("td",{className:`col-value${k?" is-active":""}${k&&h===1?" is-best":""}`,children:B!=null&&B!==""?le(B):"—"},g)}),a.jsx("td",{className:"col-paper",children:C?a.jsx(ne,{to:`/paper/${C}`,title:u.paper_title||P||void 0,children:De(u.paper_title,P)}):De(u.paper_title,P)}),a.jsx("td",{className:"col-year",children:((S=u.evaluated_on||u.paper_published_date)==null?void 0:S.slice(0,4))||"—"})]},u.id)})})]})})}function He(e){const t=e.length===7?`${e}-01`:e,r=new Date(t).getTime();return Number.isFinite(r)?r:0}const ge=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function xe(e){const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()}}function Ot(e,t){if(e===t){const{year:d,month:f}=xe(e);return[{timestamp:new Date(d,f,1).getTime(),key:`${d}-${f}`,label:`${ge[f]} ${d}`}]}const r=xe(e),s=xe(t);if(r.year===s.year){const d=s.month-r.month+1;let f=1;const x=12;d>x&&(f=Math.ceil(d/x));const u=[];for(let h=r.month;h<=s.month;h+=f)u.push({timestamp:new Date(r.year,h,1).getTime(),key:`${r.year}-${h}`,label:d<=3?`${ge[h]} ${r.year}`:ge[h]});return u}const n=s.year-r.year+1;let i=1;const l=12;n>l&&(i=Math.ceil(n/l));const c=[];for(let d=r.year;d<=s.year;d+=i)c.push({timestamp:new Date(d,0,1).getTime(),key:String(d),label:String(d)});return c}const Ut=({points:e,metric:t})=>{const r=dt(),[s,n]=L.useState(null),i=880,l=320,c=60,d=30,f=40,x=50,u=e.map(o=>o.value),h=Math.min(...u),C=Math.max(...u)-h||1,P=i-c-d,S=l-f-x,g=e.map(o=>He(o.date)),k=Math.min(...g),B=Math.max(...g),j=B-k||1,D=o=>k===B?c+P/2:c+(o-k)/j*P,W=e.map((o,m)=>{const p=D(He(o.date)),y=(o.value-h)/C,T=f+S*(1-y);return{x:p,y:T,data:o,idx:m}}),w=W.filter(o=>o.data.isSota);let q="";if(w.length>=2){q=`M${w[0].x},${w[0].y}`;for(let o=1;o{const m=o.data.modelName||o.data.paperTitle||"";if(!m)return null;const p=m.length>22?m.slice(0,21)+"…":m,y=p.length*I;let T=o.x-y/2,E=o.x+y/2,v="middle";return Ti-d&&(E=i-d,T=E-y,v="end"),{x:v==="start"?c:v==="end"?i-d:o.x,y:o.y-G,text:p,anchor:v,left:T,right:E}},ee=[],O=w.length>0?z(w[w.length-1]):null;let M=-1/0;for(let o=0;oO.left-N||(M=m.right,ee.push({x:m.x,y:m.y,text:m.text,anchor:m.anchor})))}O&&ee.push({x:O.x,y:O.y,text:O.text,anchor:O.anchor});const U=Ot(k,B),K=5,_=o=>n(m=>m===o?null:m),X=o=>{o&&r(`/paper/${o}`)},Y=(o,m)=>{const y=`${o.data.modelName||o.data.paperTitle||"Unknown model"}: ${le(o.data.value)} on ${o.data.dateLabel}`,T=!!o.data.paperRouteId;return a.jsxs("g",{children:[m,a.jsx("circle",{cx:o.x,cy:o.y,r:"10",fill:"transparent",style:{cursor:T?"pointer":"default",outline:"none"},tabIndex:0,role:T?"link":"img","aria-label":y,onMouseEnter:()=>n(o.idx),onMouseLeave:()=>_(o.idx),onFocus:()=>n(o.idx),onBlur:()=>_(o.idx),onClick:()=>X(o.data.paperRouteId),onKeyDown:E=>{T&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),X(o.data.paperRouteId))},children:a.jsx("title",{children:y})})]},o.idx)};return a.jsxs("svg",{width:"100%",viewBox:`0 0 ${i} ${l}`,style:{display:"block"},children:[a.jsx("text",{x:c-38,y:f+S/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${c-38} ${f+S/2})`,children:t}),Array.from({length:K}).map((o,m)=>{const p=m/(K-1),y=f+S*(1-p),T=h+C*p;return a.jsxs("g",{children:[a.jsx("line",{x1:c,y1:y,x2:i-d,y2:y,stroke:"var(--hairline)",strokeWidth:"1"}),a.jsx("text",{x:c-10,y:y+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:le(T)})]},m)}),U.map(o=>{const m=D(o.timestamp);return a.jsx("text",{x:m,y:l-x+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:o.label},o.key)}),W.filter(o=>!o.data.isSota).map(o=>{const m=s===o.idx;return Y(o,a.jsx("circle",{cx:o.x,cy:o.y,r:m?3:2,fill:"var(--ink-faint)",opacity:m?1:.45,style:{transition:"r 0.12s ease, opacity 0.12s ease"}}))}),q&&a.jsx("path",{d:q,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),w.map(o=>{const m=s===o.idx;return Y(o,a.jsx("circle",{cx:o.x,cy:o.y,r:m?4.5:3,fill:m?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"1.5",style:{transition:"r 0.12s ease, fill 0.12s ease"}}))}),ee.map((o,m)=>a.jsx("text",{x:o.x,y:o.y,fontSize:"9.5",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:o.anchor,pointerEvents:"none",style:{paintOrder:"stroke",stroke:"var(--bg-elevated)",strokeWidth:3,strokeLinejoin:"round"},children:o.text},`label-${m}`)),s!==null&&W[s]&&(()=>{const o=W[s],m=o.data.modelName||o.data.paperTitle||"Unknown model",y=`${m.length>40?m.slice(0,39)+"…":m}: ${le(o.data.value)}`,E=Math.max(120,Math.min(340,y.length*6.6+24)),v=30;let H=o.x-E/2;Hi-d&&(H=i-d-E);const Q=o.y-v-14>=f?o.y-v-12:o.y+12;return a.jsxs("g",{pointerEvents:"none",children:[a.jsx("rect",{x:H,y:Q,width:E,height:v,rx:"6",ry:"6",fill:"var(--bg-elevated)",stroke:"var(--hairline-strong)",strokeWidth:"1",style:{filter:"drop-shadow(0 2px 6px rgba(0,0,0,0.08))"}}),a.jsx("text",{x:H+12,y:Q+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:y})]})})()]})};function qt(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"),n=r.createElement("a");return r.head.appendChild(s),r.body.appendChild(n),t&&(s.href=t),n.href=e,n.href}const zt=(()=>{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,s=e.length;rV||e.height>V)&&(e.width>V&&e.height>V?e.width>e.height?(e.height*=V/e.width,e.width=V):(e.width*=V/e.height,e.height=V):e.width>V?(e.height*=V/e.width,e.width=V):(e.width*=V/e.height,e.height=V))}function Yt(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]),n=s.length,i=new Uint8Array(n);for(let l=0;l{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 Jt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Zt(e,t,r){const s="http://www.w3.org/2000/svg",n=document.createElementNS(s,"svg"),i=document.createElementNS(s,"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),Jt(n)}const A=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||A(r,t)};function er(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function tr(e,t){return Je(t).map(r=>{const s=e.getPropertyValue(r),n=e.getPropertyPriority(r);return`${r}: ${s}${n?" !important":""};`}).join(" ")}function rr(e,t,r,s){const n=`.${e}:${t}`,i=r.cssText?er(r):tr(r,s);return document.createTextNode(`${n}{${i}}`)}function Ve(e,t,r,s){const n=window.getComputedStyle(e,r),i=n.getPropertyValue("content");if(i===""||i==="none")return;const l=zt();try{t.className=`${t.className} ${l}`}catch{return}const c=document.createElement("style");c.appendChild(rr(l,r,n,s)),t.appendChild(c)}function ar(e,t,r){Ve(e,t,":before",r),Ve(e,t,":after",r)}const We="application/font-woff",Oe="image/jpeg",sr={woff:We,woff2:We,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Oe,jpeg:Oe,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function nr(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function ve(e){const t=nr(e).toLowerCase();return sr[t]||""}function ir(e){return e.split(/,/)[1]}function ye(e){return e.search(/^(data:)/)!==-1}function lr(e,t){return`data:${t};base64,${e}`}async function et(e,t,r){const s=await fetch(e,t);if(s.status===404)throw new Error(`Resource "${s.url}" not found`);const n=await s.blob();return new Promise((i,l)=>{const c=new FileReader;c.onerror=l,c.onloadend=()=>{try{i(r({res:s,result:c.result}))}catch(d){l(d)}},c.readAsDataURL(n)})}const be={};function or(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 je(e,t,r){const s=or(e,t,r.includeQueryParams);if(be[s]!=null)return be[s];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let n;try{const i=await et(e,r.fetchRequestInit,({res:l,result:c})=>(t||(t=l.headers.get("Content-Type")||""),ir(c)));n=lr(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[s]=n,n}async function cr(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):he(t)}async function dr(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 c=i.toDataURL();return he(c)}const r=e.poster,s=ve(r),n=await je(r,s,t);return he(n)}async function ur(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await fe(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function mr(e,t){return A(e,HTMLCanvasElement)?cr(e):A(e,HTMLVideoElement)?dr(e,t):A(e,HTMLIFrameElement)?ur(e,t):e.cloneNode(tt(e))}const hr=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",tt=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function fr(e,t,r){var s,n;if(tt(t))return t;let i=[];return hr(e)&&e.assignedNodes?i=Z(e.assignedNodes()):A(e,HTMLIFrameElement)&&(!((s=e.contentDocument)===null||s===void 0)&&s.body)?i=Z(e.contentDocument.body.childNodes):i=Z(((n=e.shadowRoot)!==null&&n!==void 0?n:e).childNodes),i.length===0||A(e,HTMLVideoElement)||await i.reduce((l,c)=>l.then(()=>fe(c,r)).then(d=>{d&&t.appendChild(d)}),Promise.resolve()),t}function pr(e,t,r){const s=t.style;if(!s)return;const n=window.getComputedStyle(e);n.cssText?(s.cssText=n.cssText,s.transformOrigin=n.transformOrigin):Je(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`),A(e,HTMLIFrameElement)&&i==="display"&&l==="inline"&&(l="block"),i==="d"&&t.getAttribute("d")&&(l=`path(${t.getAttribute("d")})`),s.setProperty(i,l,n.getPropertyPriority(i))})}function gr(e,t){A(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),A(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function xr(e,t){if(A(e,HTMLSelectElement)){const r=t,s=Array.from(r.children).find(n=>e.value===n.getAttribute("value"));s&&s.setAttribute("selected","")}}function br(e,t,r){return A(t,Element)&&(pr(e,t,r),ar(e,t,r),gr(e,t),xr(e,t)),t}async function yr(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const s={};for(let i=0;imr(s,t)).then(s=>fr(e,s,t)).then(s=>br(e,s,t)).then(s=>yr(s,t))}const rt=/url\((['"]?)([^'"]+?)\1\)/g,wr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,vr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function jr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function _r(e){const t=[];return e.replace(rt,(r,s,n)=>(t.push(n),r)),t.filter(r=>!ye(r))}async function Sr(e,t,r,s,n){try{const i=r?qt(t,r):t,l=ve(t);let c;return n||(c=await je(i,l,s)),e.replace(jr(t),`$1${c}$3`)}catch{}return e}function kr(e,{preferredFontFormat:t}){return t?e.replace(vr,r=>{for(;;){const[s,,n]=wr.exec(r)||[];if(!n)return"";if(n===t)return`src: ${s};`}}):e}function at(e){return e.search(rt)!==-1}async function st(e,t,r){if(!at(e))return e;const s=kr(e,r);return _r(s).reduce((i,l)=>i.then(c=>Sr(c,l,t,r)),Promise.resolve(s))}async function se(e,t,r){var s;const n=(s=t.style)===null||s===void 0?void 0:s.getPropertyValue(e);if(n){const i=await st(n,null,r);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function Cr(e,t){await se("background",e,t)||await se("background-image",e,t),await se("mask",e,t)||await se("-webkit-mask",e,t)||await se("mask-image",e,t)||await se("-webkit-mask-image",e,t)}async function Er(e,t){const r=A(e,HTMLImageElement);if(!(r&&!ye(e.src))&&!(A(e,SVGImageElement)&&!ye(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,n=await je(s,ve(s),t);await new Promise((i,l)=>{e.onload=i,e.onerror=t.onImageErrorHandler?(...d)=>{try{i(t.onImageErrorHandler(...d))}catch(f){l(f)}}:l;const c=e;c.decode&&(c.decode=i),c.loading==="lazy"&&(c.loading="eager"),r?(e.srcset="",e.src=n):e.href.baseVal=n})}async function Nr(e,t){const s=Z(e.childNodes).map(n=>nt(n,t));await Promise.all(s).then(()=>e)}async function nt(e,t){A(e,Element)&&(await Cr(e,t),await Er(e,t),await Nr(e,t))}function Rr(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(n=>{r[n]=s[n]}),e}const Ue={};async function qe(e){let t=Ue[e];if(t!=null)return t;const s=await(await fetch(e)).text();return t={url:e,cssText:s},Ue[e]=t,t}async function ze(e,t){let r=e.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async l=>{let c=l.replace(s,"$1");return c.startsWith("https://")||(c=new URL(c,e.url).href),et(c,t.fetchRequestInit,({result:d})=>(r=r.replace(l,`url(${d})`),[l,d]))});return Promise.all(i).then(()=>r)}function Ke(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let s=e.replace(r,"");const n=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const d=n.exec(s);if(d===null)break;t.push(d[0])}s=s.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]*?)})",c=new RegExp(l,"gi");for(;;){let d=i.exec(s);if(d===null){if(d=c.exec(s),d===null)break;i.lastIndex=c.lastIndex}else c.lastIndex=i.lastIndex;t.push(d[0])}return t}async function Pr(e,t){const r=[],s=[];return e.forEach(n=>{if("cssRules"in n)try{Z(n.cssRules||[]).forEach((i,l)=>{if(i.type===CSSRule.IMPORT_RULE){let c=l+1;const d=i.href,f=qe(d).then(x=>ze(x,t)).then(x=>Ke(x).forEach(u=>{try{n.insertRule(u,u.startsWith("@import")?c+=1:n.cssRules.length)}catch(h){console.error("Error inserting rule from remote css",{rule:u,error:h})}})).catch(x=>{console.error("Error loading remote css",x.toString())});s.push(f)}})}catch(i){const l=e.find(c=>c.href==null)||document.styleSheets[0];n.href!=null&&s.push(qe(n.href).then(c=>ze(c,t)).then(c=>Ke(c).forEach(d=>{l.insertRule(d,l.cssRules.length)})).catch(c=>{console.error("Error loading remote stylesheet",c)})),console.error("Error inlining remote css file",i)}}),Promise.all(s).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 Tr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>at(t.style.getPropertyValue("src")))}async function Mr(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=Z(e.ownerDocument.styleSheets),s=await Pr(r,t);return Tr(s)}function it(e){return e.trim().replace(/["']/g,"")}function $r(e){const t=new Set;function r(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(i=>{t.add(it(i))}),Array.from(s.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function Fr(e,t){const r=await Mr(e,t),s=$r(e);return(await Promise.all(r.filter(i=>s.has(it(i.style.fontFamily))).map(i=>{const l=i.parentStyleSheet?i.parentStyleSheet.href:null;return st(i.cssText,l,t)}))).join(` `)}async function Lr(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Fr(e,t);if(r){const s=document.createElement("style"),n=document.createTextNode(r);s.appendChild(n),e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}}async function Ir(e,t={}){const{width:r,height:s}=Ze(e,t),n=await fe(e,t,!0);return await Lr(n,t),await nt(n,t),Rr(n,t),await Zt(n,r,s)}async function Ar(e,t={}){const{width:r,height:s}=Ze(e,t),n=await Ir(e,t),i=await he(n),l=document.createElement("canvas"),c=l.getContext("2d"),d=t.pixelRatio||Gt(),f=t.canvasWidth||r,x=t.canvasHeight||s;return l.width=f*d,l.height=x*d,t.skipAutoScale||Xt(l),l.style.width=`${f}`,l.style.height=`${x}`,t.backgroundColor&&(c.fillStyle=t.backgroundColor,c.fillRect(0,0,l.width,l.height)),c.drawImage(i,0,0,l.width,l.height),l}async function Br(e,t={}){const r=await Ar(e,t);return await Yt(r)}const we="#ffffff";function Dr(){return typeof window>"u"?we:window.getComputedStyle(document.documentElement).getPropertyValue("--bg-elevated").trim()||we}function Hr(e){if(typeof window>"u")return we;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Dr():t}async function Vr(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 Br(e,{pixelRatio:2,cacheBust:!0,backgroundColor:Hr(e)});if(!t)throw new Error("Failed to render screenshot.");await window.navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])}const lt=({targetRef:e,label:t})=>{const{toast:r}=ut(),[s,n]=L.useState("idle"),i=L.useRef(null);L.useEffect(()=>()=>{i.current!==null&&window.clearTimeout(i.current)},[]);const l=L.useCallback(async()=>{const d=e.current;if(d){n("copying"),d.classList.add("is-capturing"),d.offsetHeight,await new Promise(f=>window.requestAnimationFrame(()=>f()));try{await Vr(d),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(f){n("idle"),r({title:"Copy failed",description:f instanceof Error&&f.message?f.message:"Could not copy the screenshot to your clipboard.",variant:"destructive"})}finally{d.classList.remove("is-capturing")}}},[e,t,r]),c=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(wt,{name:"copy",size:11}),c]})};function Wr({model:e,datasetName:t,hideClosed:r,setHideClosed:s,setMetric:n}){const i=L.useRef(null),{isInitialFilteredViewLoading:l,chartPoints:c,activeMetric:d,allowedMetrics:f,orderedMetrics:x,parameterBound:u}=e;return l||c.length===0?null:a.jsxs("div",{className:"bm-card",ref:i,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:[f.length>1&&a.jsxs("label",{className:"bm-view-select",children:[a.jsx("span",{className:"bm-view-select-label",children:"View"}),a.jsx("select",{value:d,onChange:h=>n(h.target.value),children:x.map(h=>a.jsx("option",{value:h,children:h},h))})]}),a.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[a.jsx(Ge,{className:"bm-closed-toggle-switch",checked:!r,onCheckedChange:h=>{s(!h)},"aria-label":"Show closed-source models"}),a.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),a.jsx(lt,{targetRef:i,label:"SOTA chart"})]})]}),a.jsx("div",{className:"bm-chart-wrap",children:a.jsx(Ut,{points:c,metric:d})}),a.jsxs("div",{className:"bm-chart-foot",children:[a.jsx("span",{className:"legend-dot"}),u===void 0?"All models":"Filtered models"," over time · highlighted dots track the running best · hover for the model · click to open the paper"]})]})}function Or(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 Qe(e,t){return e?a.jsx(ce,{title:e}):t||"—"}const ma=()=>{var _e,Se,ke,Ce,Ee,Ne,Re,Pe,Te,Me,$e;const{datasetSlug:e}=mt(),[t,r]=ht(),s=t.get("task")||void 0,n=t.get("eval")||void 0,i=Nt(t.get("max_parameters_exclusive")),{preferences:l,setHideClosedSourceEvals:c}=yt(),d=L.useRef(null),f=L.useRef(!1),x=L.useRef(null),[u,h]=L.useState(null),R=`${e}:${s||""}`,C=u===R,[P,S]=L.useState(1),g=te({queryKey:[...de.dataset(e),"with-paper",s,l.hide_closed_source_evals?"open":"all"],queryFn:()=>re.getDatasetBySlug(e,{include_paper:!0,task:s,is_open:l.hide_closed_source_evals?!0:void 0}),enabled:!!e,staleTime:oe}),k=te({queryKey:ft.byDataset((_e=g.data)==null?void 0:_e.id),queryFn:()=>bt.byDataset(g.data.id),enabled:!!((Se=g.data)!=null&&Se.id),staleTime:5*60*1e3}),B=te({queryKey:[...de.datasetTasks,(ke=g.data)==null?void 0:ke.id],queryFn:()=>re.datasetTasks(g.data.id),enabled:!!((Ce=g.data)!=null&&Ce.id),staleTime:oe}),j=te({queryKey:["metric-directions"],queryFn:()=>re.metricDirections(),staleTime:60*60*1e3}),D=Ye(B.data||[],k.data||[],s,n),W=te({queryKey:[...de.taskBenchmarkTrends,D,l.hide_closed_source_evals?!0:void 0],queryFn:()=>re.trendingBenchmarks(D,{limit:100,min_recent_papers:0,is_open:l.hide_closed_source_evals?!0:void 0}),enabled:!!D&&!!((Ee=g.data)!=null&&Ee.id),staleTime:oe}),w=L.useMemo(()=>{var b;return(((b=W.data)==null?void 0:b.results)||[]).find($=>{var F;return $.id===((F=g.data)==null?void 0:F.id)})||null},[W.data,(Ne=g.data)==null?void 0:Ne.id]),q=te({queryKey:["leaderboard-metrics",(Re=g.data)==null?void 0:Re.id,D],queryFn:()=>re.leaderboardMetrics(g.data.id,D),enabled:!!((Pe=g.data)!=null&&Pe.id)&&!!D,staleTime:oe}),I=Bt({evaluations:k.data||[],tasks:B.data||[],configuredMetrics:q.data||[],directions:j.data,initialSummary:(Te=g.data)==null?void 0:Te.leaderboard_summary,taskSlug:s,highlightEvalId:n,metric:t.get("metric")||void 0,hideClosed:l.hide_closed_source_evals,parameterBound:i,showMoreMetrics:C,fittingMetricCount:P,ready:{evaluations:k.isSuccess,tasks:B.isSuccess,directions:j.isSuccess,metrics:q.isSuccess}}),{primaryTask:N,hiddenClosedEvals:G,hiddenClosedTopEval:z,isSummaryLoading:ee,displayedMetric:O,displayedSota:M,displayedSotaModel:U,isInitialFilteredViewLoading:K,highlightedEval:_,hasParameterMetadata:X,parameterCoverage:Y,orderedMetrics:o}=I;L.useEffect(()=>{if(f.current||!n||!k.data||k.data.length===0)return;const b=d.current;b&&(f.current=!0,b.scrollIntoView({behavior:"smooth",block:"start"}))},[n,k.data]);const m=te({queryKey:de.area(N==null?void 0:N.area_id),queryFn:()=>re.getArea(N.area_id),enabled:!!(N!=null&&N.area_id),staleTime:oe});if(g.isLoading)return a.jsxs("div",{className:"page",children:[a.jsx(ue,{className:"h-12 w-1/2 mb-6"}),a.jsx(ue,{className:"h-64 w-full"})]});if(Ct(g.error))return a.jsx(Et,{});if(g.error||!g.data)return a.jsx("div",{className:"page",children:a.jsx(vt,{variant:"destructive",children:a.jsx(jt,{children:"Benchmark not found."})})});const p=g.data,y=!!p.supports_harness,T=b=>{r($=>{const F=new URLSearchParams($);return b===void 0?F.delete("max_parameters_exclusive"):F.set("max_parameters_exclusive",String(b)),F})},E=b=>{r($=>{const F=new URLSearchParams($);return F.set("metric",b),F})},v=p.introducing_paper??void 0,H=(v==null?void 0:v.arxiv_id)||(v==null?void 0:v.id)||Or(p.paper_url),J=(v==null?void 0:v.title)||p.introducing_paper_title||null,Q=((Me=v==null?void 0:v.published)==null?void 0:Me.slice(0,4))||p.introduced_year||null,ot=!!H||!!p.paper_url||!!J,ct=v!=null&&v.arxiv_id||($e=p.paper_url)!=null&&$e.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${H}`:`Paper ${H}`;return a.jsx("div",{className:"page",children:a.jsxs("div",{className:"bm-page",children:[a.jsxs("div",{className:"breadcrumb",children:[a.jsx(ne,{to:"/tasks",children:"Tasks"}),m.data&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"sep",children:"/"}),a.jsx(ne,{to:`/tasks#area-${kt(m.data.name)}`,children:m.data.name})]}),N&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"sep",children:"/"}),a.jsx(ne,{to:`/tasks/${N.slug||N.id}`,children:N.name})]}),a.jsx("span",{className:"sep",children:"/"}),a.jsx("span",{style:{color:"var(--accent-text)"},children:p.name})]}),a.jsxs("div",{className:"bm-title-row",children:[a.jsx("h1",{className:"bm-title",children:p.name}),w&&a.jsxs("div",{className:"bm-title-trend","aria-label":`${p.name} reporting trend`,children:[a.jsx(_t,{history:w.history,benchmarkName:w.name}),a.jsxs("span",{className:"bm-title-trend-summary",children:[a.jsx("strong",{children:w.recent_paper_count})," ",w.recent_paper_count===1?"paper":"papers",w.rate_change==null?w.recent_paper_count>0&&a.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):a.jsxs("span",{className:`benchmark-trend-change ${w.rate_change>=1?"is-up":"is-down"}`,children:[w.rate_change>=1?"↑":"↓"," ",w.rate_change.toFixed(1),"×"]})]})]})]}),a.jsx(pt,{kind:"benchmark",entityId:p.id}),a.jsxs("div",{className:"bm-subtitle",children:[ee?a.jsx(ue,{className:"h-5 w-64 bm-summary-skeleton","aria-label":"Loading benchmark summary"}):a.jsxs("span",{children:[O&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"metric-tag",children:O}),a.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"·"})]}),U?a.jsxs("span",{children:["Best: ",a.jsx("span",{className:"best-name",children:le(M)})," by ",a.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:U})]}):a.jsxs("span",{children:[I.rows.length," evaluations"]})]}),p.hf_url&&a.jsxs("a",{className:"bm-action-btn",href:p.hf_url,target:"_blank",rel:"noopener noreferrer",children:[a.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),p.description&&a.jsx("p",{className:"bm-description",children:p.description}),l.hide_closed_source_evals&&G.length>0&&a.jsxs("div",{className:"bm-hidden-closed-notice",children:[a.jsxs("span",{children:[G.length," closed-source ",G.length===1?"row is":"rows are"," hidden",z!=null&&z.model_name?a.jsxs(a.Fragment,{children:[", including ",a.jsx("strong",{children:z.model_name})]}):null,"."]}),a.jsx("button",{type:"button",className:"bm-hidden-closed-action",onClick:()=>{c(!1)},children:"Show closed-source"})]}),ot&&a.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[a.jsx("span",{className:"method-source-label",children:"Source"}),H?a.jsxs(ne,{to:`/paper/${H}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[a.jsx("span",{className:"method-source-title",children:J?a.jsx(ce,{title:J}):ct}),Q&&a.jsx("span",{className:"method-source-meta",children:Q})]}):p.paper_url?a.jsxs("a",{href:St(p.paper_url)??void 0,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[a.jsx("span",{className:"method-source-title",children:J?a.jsx(ce,{title:J}):p.paper_url}),Q&&a.jsx("span",{className:"method-source-meta",children:Q})]}):a.jsxs("div",{className:"method-source-link is-static",children:[a.jsx("span",{className:"method-source-title",children:J?a.jsx(ce,{title:J}):null}),Q&&a.jsx("span",{className:"method-source-meta",children:Q})]})]}),a.jsx(Wr,{model:I,datasetName:p.name,hideClosed:l.hide_closed_source_evals,setHideClosed:c,setMetric:E}),_&&(()=>{var Le,Ie;const b=_.paper_arxiv_id||_.paper_id,$=_.paper_title||(_.paper_arxiv_id?`arXiv:${_.paper_arxiv_id}`:null),F=_.best_metric&&((Le=_.metrics)==null?void 0:Le[_.best_metric])!==void 0?_.best_metric:I.activeMetric,Fe=(Ie=_.metrics)==null?void 0:Ie[F];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:[_.model_name||$||"—",_.harness?` · ${_.harness}`:""]}),a.jsxs("span",{className:"bm-highlight-meta",children:[Fe!==void 0&&F?a.jsxs(a.Fragment,{children:[F,": ",le(Fe),$?" · ":""]}):null,b?a.jsx(ne,{to:`/paper/${b}`,children:Qe(_.paper_title,$)}):Qe(_.paper_title,$)]})]})]})})(),a.jsxs("div",{className:"bm-card",ref:x,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:p.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:[I.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:I.activeMetric,onChange:b=>E(b.target.value),children:o.map(b=>a.jsx("option",{value:b,children:b},b))})]}),a.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[a.jsx(Ge,{className:"bm-closed-toggle-switch",checked:!l.hide_closed_source_evals,onCheckedChange:b=>{c(!b)},"aria-label":"Show closed-source models"}),a.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),!K&&!X&&k.isSuccess?a.jsx("span",{className:"bm-parameter-unavailable",children:"Parameter metadata unavailable"}):null,a.jsx(lt,{targetRef:x,label:"leaderboard"})]})]}),!K&&X&&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:I.parameterFilters.map(b=>{const{selected:$,disabled:F}=b;return a.jsx("button",{type:"button",className:`bm-parameter-filter-option${$?" is-active":""}`,"aria-pressed":$,disabled:F,onClick:()=>T(b.maxParametersExclusive),children:b.label},b.label)})}),a.jsxs("span",{className:"bm-parameter-coverage",children:["Parameters known for ",Y.parameter_coverage_known," of ",Y.parameter_coverage_total," entries"]})]}),k.isLoading||K?a.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((b,$)=>a.jsx(ue,{className:"h-10 w-full mb-2"},$))}):I.rows.length===0?i?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:()=>T(void 0),children:"Show all"})]}):a.jsx("div",{className:"no-results",children:"No evaluations submitted yet."}):a.jsxs(a.Fragment,{children:[o.length>P&&a.jsxs("div",{className:"bm-metric-columns-control",children:[a.jsx("button",{type:"button",className:"bm-metric-columns-toggle","aria-expanded":C,"aria-controls":"benchmark-leaderboard",onClick:()=>h(C?null:R),children:C?"Show fewer metrics":`Show more metrics (${o.length-P})`}),C&&a.jsx("span",{children:"Scroll metrics horizontally; model and paper details stay visible."})]}),a.jsx(Wt,{model:I,showHarness:y,setMetric:E,highlightRowRef:d,onFittingMetricCountChange:S})]})]})]})})};export{ma as default}; diff --git a/assets/BenchmarkTrendSparkline--hXPKyI4.js b/assets/BenchmarkTrendSparkline-daMK8XXD.js similarity index 97% rename from assets/BenchmarkTrendSparkline--hXPKyI4.js rename to assets/BenchmarkTrendSparkline-daMK8XXD.js index b296c9163c5a1fd6216aafbb4770d7b1e0e66231..44517c2555957a80f9c8405cdb0d5b7d8936df02 100644 --- a/assets/BenchmarkTrendSparkline--hXPKyI4.js +++ b/assets/BenchmarkTrendSparkline-daMK8XXD.js @@ -1 +1 @@ -import{f as C,j as t}from"./index-3CfcAX6N.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),f=Math.max(1,...h),M=g-o*2,T=p-m*2,v=h.length>1?M/(h.length-1):0,a=h.map((s,c)=>({x:o+v*c,y:m+T-s/f*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}; +import{f as C,j as t}from"./index-CxhY4zQ1.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),f=Math.max(1,...h),M=g-o*2,T=p-m*2,v=h.length>1?M/(h.length-1):0,a=h.map((s,c)=>({x:o+v*c,y:m+T-s/f*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}; diff --git a/assets/CatalogEntityPreviewLink-BzZN33n7.js b/assets/CatalogEntityPreviewLink-Bp5A8eb_.js similarity index 97% rename from assets/CatalogEntityPreviewLink-BzZN33n7.js rename to assets/CatalogEntityPreviewLink-Bp5A8eb_.js index 8c081e83bfd9b1303ce20dff9535269166e1b9d0..1a2ebb5619802338bd3b558e6e21d942ef7ec947 100644 --- a/assets/CatalogEntityPreviewLink-BzZN33n7.js +++ b/assets/CatalogEntityPreviewLink-Bp5A8eb_.js @@ -1,4 +1,4 @@ -import{c as m,a5 as h,V as d,b as g,j as s,L as f,a3 as k}from"./index-3CfcAX6N.js";import{H as w,a as y,b as v}from"./hover-card-DOKhkRf9.js";import{c as l}from"./catalog-B47DuClX.js";/** +import{c as m,a5 as h,V as d,b as g,j as s,L as f,a3 as k}from"./index-CxhY4zQ1.js";import{H as w,a as y,b as v}from"./hover-card-CqKeZcpY.js";import{c as l}from"./catalog-DCEU6WpP.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/ChatView-BNDJ2kH3.js b/assets/ChatView-BNDJ2kH3.js new file mode 100644 index 0000000000000000000000000000000000000000..f8d65a41adb14f3430987830664fd0dba5576ce6 --- /dev/null +++ b/assets/ChatView-BNDJ2kH3.js @@ -0,0 +1,6 @@ +var Nt=Object.defineProperty;var Dt=(t,e,r)=>e in t?Nt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var ae=(t,e,r)=>Dt(t,typeof e!="symbol"?e+"":e,r);import{c as Lt,f as c,j as s,X as bt,x as wt,b as Te,L as vt,_ as Ft,$ as Bt,a0 as Ot,a1 as nt,V as qe,e as St,k as xt,s as _t,l as Et,h as Pt,a as Ct,u as qt,A as Ut}from"./index-CxhY4zQ1.js";import{C as Ht,U as at,b as Kt,f as ke,A as Wt,a as zt,c as $t,g as Qt,h as Vt,i as Oe,j as Yt,k as it,t as Gt,l as Xt,E as Jt,m as Zt,n as es,o as ot}from"./chatLifecycle-CUjL6RQJ.js";import{g as Fe,h as ts,j as ss,k as Rt,T as ct,e as kt,l as Le,m as Ke,r as rs,n as ns,o as he,D as We,s as as,t as is,v as os,w as cs,x as ls,y as us,z as ds,B as hs,C as ps,E as Xe,F as fs,G as lt,H as jt,I as ut,J as ze,f as ms,K as gs,L as ys,M as At,N as bs,O as ws,Q as vs,R as Ss,S as xs}from"./chatSessions-DjtMpqHz.js";import{M as _s}from"./McpShowcase-CXm3UZ_U.js";import{c as pe}from"./chat-CkiIbMG5.js";import{S as Es}from"./share-2-LsSZFLYg.js";import{u as Ue}from"./useMutation-BzRfwboV.js";import{I as Cs}from"./Icon-XOOkUEUX.js";import{m as Rs}from"./mlIntern-CBvHpMTi.js";import{u as ks,O as js}from"./openrouter-DLk2ZdMf.js";/* empty css */import"./hover-card-CqKeZcpY.js";import"./CatalogEntityPreviewLink-Bp5A8eb_.js";import"./catalog-DCEU6WpP.js";import"./github-Bv102r_G.js";import"./file-text-42n3m1yn.js";import"./PaperPreviewLink-Y2LI3xZW.js";import"./index-BCjs92mB.js";import"./index-mv_8ovfA.js";import"./katex-DkKDou_j.js";import"./papers-BDxSKSYJ.js";import"./curation-D2sqKAqC.js";import"./thumbs-up-DP1Ac3Tb.js";import"./copy-Dpy50x4G.js";import"./queryOptions-C9woPjwX.js";import"./arrow-left-CDwy-_cK.js";import"./external-link-UhGsnDEF.js";import"./plus-CEkdlNSn.js";import"./search-CkWMhIw6.js";import"./chevron-up-ClmVTWYw.js";import"./AuthorAvatar-DPz8YQ5Z.js";import"./AgentLogos-C9q7zZc4.js";/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const As=Lt("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);function Ms(t){const[e,r]=c.useState("calc(100dvh - 60px)");return c.useLayoutEffect(()=>{if(!t)return;const n=document.querySelector(".app-header"),i=window.visualViewport,a=()=>{const u=(i==null?void 0:i.height)??window.innerHeight;r(`${Math.max(0,u-((n==null?void 0:n.offsetHeight)??0))}px`)};a();const l=new ResizeObserver(a);return n&&l.observe(n),i==null||i.addEventListener("resize",a),window.addEventListener("resize",a),()=>{l.disconnect(),i==null||i.removeEventListener("resize",a),window.removeEventListener("resize",a)}},[t]),t?e:"100%"}const Is="https://huggingface.co/settings/inference-providers",dt="pwc.chat.billing-notice-dismissed.v1";function Ts({provider:t}){const[e,r]=c.useState(()=>localStorage.getItem(dt)==="1");return!Fe()||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:Is,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(dt,"1"),r(!0)},children:s.jsx(bt,{size:15,"aria-hidden":"true"})})]})]})}function ht({variant:t,composerProps:e,provider:r,sponsored:n=!1,paused:i,error:a,suggestions:l=[],suggestionLinks:u}){var b;const d=s.jsxs(s.Fragment,{children:[!n&&s.jsx(Ts,{provider:r}),i&&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."}),a&&s.jsx("div",{className:"chat-composer-error",role:"alert",children:a}),s.jsx(Ht,{...e,...t==="empty"?{autoFocus:!0}:{placeholder:(b=e.draft)!=null&&b.text?"Edit and send again…":"Ask a follow-up…"}}),t==="empty"&&s.jsxs("div",{className:"chat-examples",children:[l.map(I=>s.jsx("button",{type:"button",className:"chat-example",disabled:i,onClick:()=>{var h;return e.onSend({text:I,paperMentions:[],...(h=e.draft)!=null&&h.paperSelection?{paperSelection:e.draft.paperSelection}:{}})},children:I},I)),u]})]});return t==="empty"?d:s.jsx("div",{className:"chat-composer-wrap",children:s.jsxs("div",{className:"chat-composer-inner",children:[d,s.jsx("div",{className:"chat-composer-foot",children:Fe()?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 Ns({messages:t,papers:e,busy:r,queuedDraft:n,paperMentionsEnabled:i,archivePending:a,openRouterFallbackEnabled:l,onToggleBlock:u,onEditAndResend:d,onRetryFromProgress:b,onRetryWithLuna:I,onArchiveOld:h,onArchiveOldest:g}){var ne,J;const[A,x]=c.useState(null),k=c.useRef(null),P=c.useRef(null),V=c.useRef("bottom"),E=c.useRef(0),j=c.useRef(0),[T,R]=c.useState(!1),D=c.useRef(null),F=c.useCallback(p=>{V.current=p},[]),K=c.useCallback(()=>{const p=k.current;p&&R(p.scrollHeight-p.scrollTop-p.clientHeight>1)},[]),q=t.filter(p=>p.role==="user"),B=q.length,W=c.useRef(B),ie=c.useRef(!1),ce=(ne=q[0])==null?void 0:ne.id,oe=(J=q.at(-1))==null?void 0:J.id;c.useEffect(()=>{r&&x(null)},[r]),c.useLayoutEffect(()=>{const p=k.current;if(p){if(B>W.current||r&&!ie.current){const L=Array.from(p.querySelectorAll("[data-message-id]")).at(-1);if(L){const U=p.getBoundingClientRect().top;E.current=p.scrollTop+L.getBoundingClientRect().top-U-24,F("question")}}if(W.current=B,ie.current=r,P.current!==null){p.scrollTop=P.current,P.current=null;return}V.current==="bottom"&&(p.scrollTop=p.scrollHeight),V.current==="question"&&(p.scrollTop=E.current,j.current=p.scrollTop)}},[t,B,r,F]),c.useLayoutEffect(K),c.useEffect(()=>{const p=k.current;if(!p)return;const L=new ResizeObserver(K);return L.observe(p),p.firstElementChild&&L.observe(p.firstElementChild),()=>L.disconnect()},[K]);const Z=(p,L)=>{var U;P.current=((U=k.current)==null?void 0:U.scrollTop)??null,u(p,L)};return s.jsxs("div",{className:"chat-conversation-viewport",children:[s.jsx("div",{className:"chat-conversation",ref:k,tabIndex:0,role:"region","aria-label":"Conversation",onWheel:p=>{(p.deltaY<0||V.current==="question")&&F("free")},onTouchStart:p=>{var L;D.current=((L=p.touches[0])==null?void 0:L.clientY)??null},onTouchMove:p=>{var U;const L=(U=p.touches[0])==null?void 0:U.clientY;L!==void 0&&D.current!==null&&(L>D.current||V.current==="question")&&F("free"),D.current=L??null},onKeyDown:p=>{p.target===p.currentTarget&&((["ArrowUp","PageUp","Home"].includes(p.key)||p.key===" "&&p.shiftKey)&&F("free"),["ArrowDown","PageDown","End"," "].includes(p.key)&&V.current==="question"&&F("free"))},onScroll:p=>{const{scrollHeight:L,scrollTop:U,clientHeight:ee}=p.currentTarget,z=L-U-ee<=1;V.current==="bottom"&&!z&&F("free");const de=U-j.current;V.current==="question"&&(de>1||de<-1&&!z)&&F("free"),K()},children:s.jsxs("div",{className:"chat-conversation-inner",children:[t.length===0&&(n==null?void 0:n.text)&&s.jsx(at,{id:"queued-launch-preview",text:n.text,paperMentions:n.paperMentions,paperSelection:n.paperSelection,isInitial:!0}),t.map(p=>{var L,U,ee,z;return p.role==="user"?s.jsx(at,{id:p.id,text:p.text??"",paperMentions:p.paperMentions??[],paperSelection:p.paperSelection,paperMentionsEnabled:i,isInitial:p.id===ce,editingAllowed:!r&&!!p.revision,editing:A===p.id,editNotice:p.id===ce?"Sending will replace this conversation.":p.id===oe?"Sending will replace the response.":"Sending will replace the response and all messages after it.",onEdit:()=>x(p.id),onCancel:()=>x(null),onResendDraft:de=>{const fe=d(p.id,de);return fe&&x(null),fe}},p.id):s.jsx(Kt,{msg:p,papers:e,onToggleBlock:Z,onRetryCompaction:!r&&p.id===((L=t.at(-1))==null?void 0:L.id)&&((U=q.at(-1))!=null&&U.revision)?b:void 0,onRetryWithLuna:!r&&p.id===((ee=t.at(-1))==null?void 0:ee.id)&&((z=q.at(-1))!=null&&z.revision)?I:void 0,onArchiveOldChats:h,onArchiveOldestChats:g,archivePending:a,hfBilling:null,openRouterFallbackEnabled:l,feedbackEnabled:!0},p.id)})]})}),T&&s.jsx("button",{type:"button",className:"chat-jump-latest",onClick:()=>{F("bottom");const p=k.current;p&&(p.focus({preventScroll:!0}),p.scrollTop=p.scrollHeight,K())},children:"Jump to latest"})]})}function Ds({retryAt:t,onRetry:e,onCancel:r}){const[n,i]=c.useState(()=>Math.max(0,Math.ceil((t-Date.now())/1e3))),a=c.useRef(null);return c.useEffect(()=>{var b;const l=document.activeElement instanceof HTMLElement?document.activeElement:null;(b=a.current)==null||b.focus();const u=()=>i(Math.max(0,Math.ceil((t-Date.now())/1e3)));u();const d=window.setInterval(u,250);return()=>{window.clearInterval(d),l==null||l.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:l=>{l.key==="Escape"&&(l.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:a,onClick:r,children:"Cancel"}),s.jsx("button",{type:"button",className:"chat-capacity-retry",disabled:n>0,onClick:e,children:"Try again"})]})]})})}function Ls({onClose:t}){const e=c.useRef(null);return c.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 Fs({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 $e="pwc:chat:sidebar-width",Qe=280,Ve=200,Ye=480,Bs=12,Ge=t=>Math.max(Ve,Math.min(Ye,t)),Os=()=>{if(typeof window>"u")return Qe;const t=Number(localStorage.getItem($e));return Number.isFinite(t)&&t>0?Ge(t):Qe};function Ps({sessions:t,activeSessionId:e,loading:r,error:n,open:i,onClose:a,onNew:l,onNavigate:u,onRename:d,onDelete:b,onDeleteMany:I}){const[h,g]=c.useState(Os),A=c.useRef(null),x=c.useRef(h),[k,P]=c.useState(null),[V,E]=c.useState(""),[j,T]=c.useState(null),[R,D]=c.useState(!1),[F,K]=c.useState(new Set),q=t.filter(m=>F.has(m.id)).map(m=>m.id),B=q.length>0,[W,ie]=c.useState(!1),ce=[...t].sort((m,S)=>Date.parse(S.updated_at)-Date.parse(m.updated_at)),oe=ce.filter((m,S)=>S{if(!j)return;const m=()=>T(null),S=v=>{v.key==="Escape"&&m()};return window.addEventListener("click",m),window.addEventListener("keydown",S),()=>{window.removeEventListener("click",m),window.removeEventListener("keydown",S)}},[j]),c.useEffect(()=>{if(!B)return;const m=S=>{S.key==="Escape"&&K(new Set)};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[B]);const J=ts(Z),p=J.flatMap(m=>m.items.map(S=>S.id)),L=c.useRef(null),U=m=>{L.current=m,K(S=>{const v=new Set(S);return v.has(m)?v.delete(m):v.add(m),v})},ee=m=>{const v=(L.current&&F.has(L.current)?L.current:null)??(B?null:e??null);v&&(L.current=v);const X=v?p.indexOf(v):-1,M=p.indexOf(m);if(X<0||M<0){L.current=m,K(Ee=>new Set([...Ee,m]));return}const Ae=p.slice(Math.min(X,M),Math.max(X,M)+1);K(Ee=>new Set([...Ee,...Ae]))},z=async()=>{if(!(W||!ke())){ie(!0);try{await I(q)&&K(new Set)}finally{ie(!1)}}},de=m=>{P(m.id),E(m.title)},fe=async m=>{const S=V.trim();S&&await d(m,S)&&P(null)},me=(m,S,v)=>T({id:m,x:S,y:v}),je=m=>{if(!A.current)return;const S=Ge(A.current.width+m-A.current.x);x.current=S,g(S)},ve=()=>{A.current&&(A.current=null,localStorage.setItem($e,String(x.current)))},ye=m=>{const S=Ge(m);x.current=S,g(S),localStorage.setItem($e,String(S))};return s.jsxs(s.Fragment,{children:[i&&s.jsx("div",{className:"chat-sidebar-backdrop","aria-hidden":"true",onClick:a}),s.jsxs("aside",{className:`chat-sidebar${i?"":" chat-sidebar-closed"}`,style:{"--chat-sidebar-width":`${h}px`},children:[s.jsxs("div",{className:"chat-sidebar-top",children:[s.jsxs("button",{type:"button",className:"chat-new-chat",onClick:()=>{ke()&&l()},children:[s.jsx(ss,{})," New chat"]}),s.jsx("button",{type:"button",className:"icon-btn",onClick:a,title:"Collapse sidebar",children:s.jsx(Rt,{})})]}),B&&s.jsxs("div",{className:"chat-sessions-bulk",role:"toolbar","aria-label":"Selected chats",children:[s.jsxs("span",{className:"chat-sessions-bulk-count",children:[q.length," selected"]}),s.jsxs("button",{type:"button",className:"chat-sessions-bulk-delete",disabled:W,onClick:()=>void z(),children:[s.jsx(ct,{})," ",W?"Deleting…":"Delete"]}),s.jsx("button",{type:"button",className:"chat-sessions-bulk-cancel",disabled:W,onClick:()=>K(new Set),children:"Cancel"})]}),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."}),J.map(m=>s.jsxs("div",{className:"chat-session-group",children:[s.jsx("div",{className:"chat-session-group-label",children:m.label}),m.items.map(S=>s.jsxs("div",{className:`chat-session${S.id===e?" chat-session-active":""}${F.has(S.id)?" chat-session-selected":""}`,role:"button",tabIndex:0,"aria-pressed":B?F.has(S.id):void 0,title:B?"Shift-click to select every chat up to here":"Shift-click to select several chats",onMouseDown:v=>{v.shiftKey&&v.preventDefault()},onClick:v=>{v.shiftKey?ee(S.id):B?U(S.id):ke()&&u(S.id)},onKeyDown:v=>{if(v.key==="Enter"&&v.shiftKey?ee(S.id):v.key==="Enter"&&B?U(S.id):v.key==="Enter"&&ke()&&u(S.id),v.key==="F2"&&de(S),v.key==="ContextMenu"||v.shiftKey&&v.key==="F10"){v.preventDefault();const X=v.currentTarget.getBoundingClientRect();me(S.id,X.right-150,X.bottom)}},onContextMenu:v=>{v.preventDefault(),me(S.id,v.clientX,v.clientY)},children:[k===S.id?s.jsx("input",{className:"chat-session-title-input",value:V,autoFocus:!0,maxLength:80,onClick:v=>v.stopPropagation(),onChange:v=>E(v.target.value),onBlur:()=>void fe(S.id),onKeyDown:v=>{v.stopPropagation(),v.key==="Enter"&&fe(S.id),v.key==="Escape"&&P(null)}}):s.jsx("span",{className:"chat-session-title",children:S.title}),s.jsx("button",{type:"button",className:"chat-session-menu","aria-label":"Chat actions","aria-haspopup":"menu",title:"Chat actions",onClick:v=>{v.stopPropagation();const X=v.currentTarget.getBoundingClientRect();me(S.id,X.right-150,X.bottom)},children:"⋯"}),s.jsx("button",{type:"button",className:"chat-session-delete","aria-label":"Delete conversation",onClick:v=>{v.stopPropagation(),ke()&&b(S.id)},children:s.jsx(ct,{})})]},S.id))]},m.label)),ne>0&&s.jsx("button",{type:"button",className:"chat-sessions-toggle","aria-expanded":R,onClick:()=>D(m=>!m),children:R?"Show less":`Show ${ne} older ${ne===1?"chat":"chats"}`})]}),s.jsx(_s,{className:"chat-sidebar-tools",canNavigate:ke}),s.jsx("div",{className:"chat-sidebar-resize-handle",role:"separator","aria-label":"Resize chat history","aria-orientation":"vertical","aria-valuemin":Ve,"aria-valuemax":Ye,"aria-valuenow":h,title:"Drag to resize; double-click to reset",tabIndex:0,onPointerDown:m=>{m.button===0&&(A.current={x:m.clientX,width:h},x.current=h,m.currentTarget.setPointerCapture(m.pointerId))},onPointerMove:m=>je(m.clientX),onPointerUp:ve,onPointerCancel:ve,onLostPointerCapture:ve,onDoubleClick:()=>ye(Qe),onKeyDown:m=>{(m.key==="ArrowLeft"||m.key==="ArrowRight")&&(m.preventDefault(),ye(h+(m.key==="ArrowRight"?10:-10))),(m.key==="Home"||m.key==="End")&&(m.preventDefault(),ye(m.key==="Home"?Ve:Ye))}}),j&&s.jsxs("div",{className:"chat-session-context-menu",role:"menu",style:{left:j.x,top:j.y},onClick:m=>m.stopPropagation(),children:[s.jsx("button",{type:"button",role:"menuitem",autoFocus:!0,onClick:()=>{const m=t.find(S=>S.id===j.id);m&&de(m),T(null)},children:"Rename chat"}),s.jsx("button",{type:"button",role:"menuitem",onClick:()=>{U(j.id),T(null)},children:F.has(j.id)?"Deselect chat":"Select chat"})]})]})]})}function qs({sessionId:t,busy:e,loading:r,hasPaperSelection:n=!1,onError:i}){const{toast:a}=wt(),[l,u]=c.useState(!1),[d,b]=c.useState(""),I=async()=>{var h;if(!(e||l)&&!(n&&!window.confirm("This public link will include the selected paper passage. Anyone with the link can read that passage. Continue?"))){u(!0);try{const g=await pe.createOrRefreshShare(t),A=new URL(g.public_path,window.location.origin).toString();try{if(!((h=navigator.clipboard)!=null&&h.writeText))throw new Error("Clipboard unavailable");await navigator.clipboard.writeText(A),a({className:"chat-share-toast",duration:5e3,title:"Public link copied to your clipboard",description:"Anyone with this link can see this conversation."})}catch{b(A)}}catch(g){const A=g instanceof Error?g.message:"Could not share this conversation";i(A),a({variant:"destructive",title:"Share failed",description:A})}finally{u(!1)}}};return s.jsxs(s.Fragment,{children:[s.jsxs("button",{type:"button",className:"chat-share-button",onClick:()=>void I(),disabled:e||l||r,"aria-label":"Share conversation",children:[l?s.jsx(kt,{}):s.jsx(Es,{"aria-hidden":"true"}),s.jsx("span",{children:"Share"})]}),s.jsx(Fs,{url:d,onClose:()=>b("")})]})}const Mt=["chat","openai","usage"],Us=90,It="pwc:chat:openai-credits-notice:dismissed";function Hs(t=!0){return Te({queryKey:Mt,queryFn:()=>pe.getOpenAIUsage(),enabled:t,staleTime:3e4,retry:!1,refetchOnWindowFocus:!0})}function Ks(t,e,r){if(!t||e!=="openai"||t.used_percentt?s.jsx(Wt,{workspaceKey:e,onAskAiFix:n,children:r}):s.jsx(s.Fragment,{children:r}),Qs=({enabled:t,children:e})=>t?s.jsx(zt,{variant:"chat",children:e}):s.jsx(s.Fragment,{children:e}),Vs=({provider:t,enabled:e})=>{const r=Hs(e),[n,i]=qe.useState(()=>Ws()),a=Ks(r.data,t,n);return a?s.jsxs("div",{className:"chat-credits-notice",role:"status",children:[s.jsx("span",{children:a.message}),s.jsx("button",{type:"button",className:"chat-credits-notice-close","aria-label":"Dismiss credits notice",onClick:()=>{zs(a.resetsAt),i(a.resetsAt)},children:"×"})]}):null},Ys=({onNewChat:t,onClose:e})=>s.jsxs(s.Fragment,{children:[s.jsxs(Ft,{children:[s.jsx(Bt,{asChild:!0,children:s.jsx("button",{type:"button",className:"icon-btn chat-reader-icon-btn","aria-label":"Chat options",title:"Chat options",children:s.jsx(As,{"aria-hidden":"true"})})}),s.jsxs(Ot,{align:"end",children:[s.jsx(nt,{onSelect:t,children:"New chat"}),s.jsx(nt,{asChild:!0,children:s.jsx(vt,{to:"/chat",children:"All chats"})})]})]}),e&&s.jsx("button",{type:"button",className:"icon-btn chat-reader-icon-btn",onClick:e,"aria-label":"Close chat",title:"Close chat",children:s.jsx(bt,{"aria-hidden":"true"})})]}),Gs=({routeId:t,sessionId:e,page:r})=>s.jsx(vt,{className:"chat-reader-action",to:`/pdf/${t}`,onClick:n=>{if(!ke()){n.preventDefault();return}sessionStorage.setItem(`pwc:reader:session:${t}`,e),r&&sessionStorage.setItem(`pwc:reader:page:${t}`,String(r))},children:"Open reader"}),Xs=({mode:t,staging:e,children:r})=>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."}),e&&s.jsx("p",{className:"chat-staging-access-note",children:"This is a limited staging preview. Only approved Hugging Face users can start chats."}),r]})}),Js=({descriptor:t})=>{const e=$t(),{open:r,register:n,unregister:i}=e,a=qe.useRef(null),l=t.source_head??t.preview_head,u=qe.useMemo(()=>l?{kind:"artifact",schema_version:1,scope:"owner",artifact_id:t.artifact_id,version_id:l.version_id,identifier:"latex-paper",version:l.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,l]),d=u?Qt(u):null;return qe.useEffect(()=>{if(!(!u||!d))return n(u),a.current!==d&&(a.current=d,r(u)),()=>i(d)},[u,d,r,n,i]),null},Zs={old:"Could not archive old chats",oldest:"Could not archive chats"};function er({messages:t,refreshSessions:e,resetChat:r,restoreDraft:n}){const{toast:i}=wt(),a=Ue({mutationFn:async d=>{const b=d==="old"?await pe.archiveOldChats():await pe.archiveOldestChats();return await e(),b},onSuccess:({archived_count:d},b)=>{if(b==="old"&&d===0){i({title:"No chats were archived",description:"There are no inactive chats older than 30 days."});return}const I=Le(t);r(),n(Ke(I)),i({title:`${d} ${d===1?"chat":"chats"} archived`,description:"Your question is ready to send again."})},onError:(d,b)=>{i({variant:"destructive",title:Zs[b],description:d instanceof Error?d.message:"Try again."})}}),l=a.isPending?a.variables??null:null,u=async d=>{l===null&&await a.mutateAsync(d).catch(()=>{})};return{pending:l,archiveOld:()=>u("old"),archiveOldest:()=>u("oldest")}}function tr({pendingDraft:t,setPendingDraft:e,blocked:r,authLoading:n,signedIn:i,send:a,restoreDraft:l,setSelectedModel:u,onPaperSelectionChange:d}){const[b,I]=St(),h=c.useRef(!1);c.useEffect(()=>{if(n||!i)return;const g=rs();g&&(g.draft.paperSelection&&(d==null||d(g.draft.paperSelection)),g.autoSend?e(g.draft):(l(g.draft),ns()))},[n,d,l,e,i]),c.useEffect(()=>{var k;if(n)return;const g=(k=b.get("q"))==null?void 0:k.trim();if(!g)return;h.current=!1;const A=b.get("model");A&&u(A),e(he(g));const x=new URLSearchParams(b);x.delete("q"),x.delete("model"),I(x,{replace:!0})},[n,b,e,I,u]),c.useEffect(()=>{if(r||!t.text||h.current)return;const g=window.setTimeout(()=>{h.current||(h.current=!0,a(t).finally(()=>e(he())))},0);return()=>window.clearTimeout(g)},[r,t,a,e])}function sr(t,e){var a;const r=xt(),n=Te({queryKey:["chatSessionPublicShare",t],queryFn:()=>pe.getSessionPublicShare(t??""),enabled:!!t&&e,retry:!1}),i=(a=n.data)==null?void 0:a.public_path;return c.useEffect(()=>{i&&r(i,{replace:!0})},[r,i]),{pending:n.isFetching||!!i}}function rr({userId:t,signedIn:e,authLoading:r,requestedModel:n,routeSessionIdRef:i}){const a=c.useRef(n),l=c.useRef(null),[u,d]=c.useState(n||We),b=c.useCallback(k=>{a.current=k,d(k)},[]),h=Te({...Vt(t),enabled:e&&!r}).data,g=(h==null?void 0:h.items)??(_t()?as:is);c.useEffect(()=>{if(r||!e)return;const k=os();l.current=k,k&&d(k)},[r,e]),c.useEffect(()=>{if(!h||i.current)return;const k=a.current||l.current;d(k&&h.items.some(P=>P.id===k)?k:h.default_model)},[h,i]);const A=cs(g,u),x=ls(g,u);return{models:g,selectedModel:u,setSelectedModel:b,provider:A,sponsored:x,userBilledInference:A==="huggingface"&&!x,lunaAvailable:g.some(k=>k.id===We)}}const nr=3e3,ar=150,He=(t,e)=>t instanceof Error?t.message:e;function ir(t){const e=Et(),r=c.useCallback(l=>{e.setQueryData(Oe.list(t),u=>l(u??[]))},[e,t]),n=c.useCallback((l,u)=>{r(d=>d.map(b=>b.id===l?{...b,...u}:b)),e.setQueryData(Oe.detail(t,l),d=>d&&{...d,...u})},[e,r,t]),i=c.useCallback(async()=>{await e.invalidateQueries({queryKey:Oe.list(t)})},[e,t]);return{markSessionBusy:c.useCallback((l,u)=>{e.cancelQueries({queryKey:Oe.list(t)});const d=new Date().toISOString();r(b=>b.some(I=>I.id===l)?b.map(I=>I.id===l?{...I,is_busy:!0}:I):[{id:l,title:"New chat",selected_model:u.model,created_at:d,updated_at:d,message_count:1,is_busy:!0,web_search_enabled:u.webSearchEnabled,reasoning_effort:u.reasoningEffort},...b])},[e,r,t]),patchSession:n,refreshSessions:i}}function or({routeSessionId:t,selectedModel:e,setSelectedModel:r,patchSession:n,onRenamed:i,refreshSessions:a,onError:l,onSelectedDeleted:u,isActive:d,stopActive:b}){const I=Ue({mutationFn:({id:E,title:j})=>pe.updateSession(E,{title:j}),onSuccess:(E,{id:j})=>{i(j),n(j,E)},onError:E=>l(He(E,"Rename failed"))}),h=async(E,j)=>{if(j){const T=Date.now()+nr;for(;(await pe.getSession(E)).is_busy;){if(Date.now()>=T)throw new Error("Generation is still stopping. The chat was not deleted.");await new Promise(D=>window.setTimeout(D,ar))}}await pe.removeSession(E)},g=Ue({mutationFn:async({ids:E,activeId:j})=>{let T=!1;try{for(const R of E)await h(R,R===j),R===t&&(T=!0)}finally{T&&u(),await a()}},onError:E=>l(He(E,"Delete failed"))}),A=Ue({mutationFn:({sessionId:E,model:j})=>pe.updateSession(E,{selected_model:j}),onSuccess:(E,{sessionId:j})=>{n(j,{selected_model:E.selected_model}),l("")},onError:(E,{previous:j})=>{r(j),l(He(E,"Model change failed"))}}),x=(E,j)=>I.mutateAsync({id:E,title:j}).then(()=>!0,()=>!1),k=async E=>{if(E.length===0)return!1;const j=E.find(d),T=E.length===1?"this chat":`these ${E.length} chats`;return window.confirm(`${j?"Stop and delete":"Delete"} ${T}? This cannot be undone.`)?(j&&b(),g.mutateAsync({ids:E,activeId:j}).then(()=>!0,()=>!1)):!1};return{rename:x,remove:async E=>{await k([E])},removeMany:k,changeModel:async E=>{const j=e;return r(E),t?A.mutateAsync({sessionId:t,model:E,previous:j}).then(()=>!0,()=>!1):!0}}}function cr({returnTo:t,selectedModel:e,reasoningEffort:r,userBilledInference:n,onPromptRestored:i}){const a=c.useRef(!1),l=c.useRef(!1),u=c.useCallback(h=>{us(h,e,r),window.location.href=Pt(t(),{authorizeInference:n})},[r,t,e,n]),d=c.useCallback((h,g)=>{ds(h,e),i(h,g)},[i,e]),b=c.useCallback(async h=>{if(l.current)return!1;l.current=!0;try{return(await pe.getInferenceBilling()).connected?(a.current=!0,!0):hs()?(d(h,"Hugging Face inference authorization was not completed. Your prompt is ready to retry."),!1):(u(h),!1)}catch(g){return d(h,g instanceof Error?g.message:"Could not check Hugging Face authorization."),!1}finally{l.current=!1}},[u,d]);return{authorizeSend:c.useCallback((h,g)=>g?n&&!a.current?b(h):!0:(u(h),!1),[u,b,n]),restorePrompt:d}}function lr(t,e,r){return{message:e,...r,web_search_enabled:!!t.webSearchEnabled,reasoning_effort:t.reasoningEffort??Xe}}function Tt(t){return t.primaryPaperRouteId?{primary_paper_route_id:t.primaryPaperRouteId}:{}}function pt(t,e){var n;const r=(n=t.viewerContext)==null?void 0:n.call(t);return{paper_mentions:e.paperMentions.map(({route_id:i,title:a,start:l,end:u})=>({route_id:i,title:a,start:l,end:u})),...Tt(t),...r?{viewer_context:r}:{},...e.paperSelection?{paper_selection:ps(e.paperSelection)}:{}}}class ur{constructor(e,r=fs){ae(this,"requestId");ae(this,"firstVisibleAt");ae(this,"streamStartReported",!1);ae(this,"firstVisibleReported",!1);ae(this,"terminalReported",!1);ae(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 _e={minDelayMs:5,maxDelayMs:80,minRateCharsPerMs:.3,maxBufferedMs:400,arrivalRateTauMs:1e3,arrivalRateHeadroom:1.1,maxPendingChars:64},dr={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 hr(t){return!["stream_start","sandbox_start","sandbox_ready","workspace_ready","session_title_start","session_title_delta","session_title_done"].includes(t.type)}function pr(t,e=!1,r=_e.maxPendingChars){var i;if(!t)return{pieces:[],pending:""};if(e)return{pieces:[t],pending:""};const n=Intl.Segmenter;if(n){const l=[...new n(void 0,{granularity:"word"}).segment(t)].filter(d=>d.isWordLike);let u=0;if(l.length>1&&(u=l.at(-1).index),l.length&&/\s$/u.test(t)&&(u=t.length),u>0){const d=t.slice(0,u),b=[],h=[...new n(void 0,{granularity:"word"}).segment(d)].filter(g=>g.isWordLike);for(let g=0;gA&&b.push(d.slice(A,x))}return h.length||b.push(d),{pieces:b,pending:t.slice(u)}}}else{const a=[...t.matchAll(/\s+/gu)];if(a.length){const l=[];let u=0;for(const d of a){const b=d.index+d[0].length;l.push(t.slice(u,b)),u=b}return{pieces:l,pending:t.slice(u)}}}return t.length>=r?{pieces:[t.slice(0,r)],pending:t.slice(r)}:{pieces:[],pending:t}}function fr(t,e={}){const r={minDelayMs:e.minDelayMs??_e.minDelayMs,maxDelayMs:e.maxDelayMs??_e.maxDelayMs,minRateCharsPerMs:e.minRateCharsPerMs??_e.minRateCharsPerMs,maxBufferedMs:e.maxBufferedMs??_e.maxBufferedMs,arrivalRateTauMs:e.arrivalRateTauMs??_e.arrivalRateTauMs,arrivalRateHeadroom:e.arrivalRateHeadroom??_e.arrivalRateHeadroom,maxPendingChars:e.maxPendingChars??_e.maxPendingChars},n=e.clock??dr,i=[];let a="",l=null,u=0,d=!0,b=!1,I=null,h=0,g=n.now(),A=!1;const x=()=>{I==null||I(),I=null},k=(R,D)=>{const F=R.type==="reasoning_delta"||R.type==="answer_delta"?R.text.length:0;i.push({kind:"event",event:R,arrivedAt:D,chars:F}),x()},P=R=>{if(!l||!a)return;const D=pr(a,R,r.maxPendingChars);for(const F of D.pieces)F&&k({type:l,text:F},u),u=n.now();a=D.pending,a||(l=null)},V=R=>{if(!d)return;const D=n.now();if(R.type==="reasoning_delta"||R.type==="answer_delta"){const F=R.type;if(!R.text)return;if(!A){A=!0,h+=R.text.length,g=D;const q=Array.from(R.text)[0];k({type:F,text:q},D);const B=R.text.slice(q.length);if(B)for(l=F,a=B,u=D,P(!1);a.length>=r.maxPendingChars;)P(!1);return}l&&l!==F&&P(!0),l||(l=F,u=D),a+=R.text;const K=Math.max(0,D-g);for(h*=Math.exp(-K/r.arrivalRateTauMs),h+=R.text.length,g=D,P(!1);a.length>=r.maxPendingChars;)P(!1);return}hr(R)&&P(!0),k(R,D)},E=(async()=>{var R;try{for await(const D of t)V(D);d&&P(!0)}catch(D){d&&!((R=e.signal)!=null&&R.aborted)&&(P(!0),i.push({kind:"error",error:D,arrivedAt:n.now(),chars:0}))}finally{b=!0,x()}})(),j=()=>i.length||b?Promise.resolve():new Promise(R=>{I=R});return{events:async function*(){var D,F,K,q;let R=Number.NEGATIVE_INFINITY;try{for(;;){if(await j(),!i.length){if(b||!d)return;continue}const B=i[0];if(B.kind==="error")throw i.shift(),B.error;if(B.chars&&!((D=e.isHidden)!=null&&D.call(e))){const W=n.now(),ie=i.reduce((ee,z)=>ee+z.chars,0),ce=((F=i.find(ee=>ee.chars))==null?void 0:F.arrivedAt)??W,oe=Math.max(0,r.maxBufferedMs-(W-ce)),Z=h*Math.exp(-Math.max(0,W-g)/r.arrivalRateTauMs)/r.arrivalRateTauMs,ne=oe>0?ie/oe:Number.POSITIVE_INFINITY,J=Math.max(r.minRateCharsPerMs,Z*r.arrivalRateHeadroom,ne),p=Math.min(r.maxDelayMs,Math.max(r.minDelayMs,B.chars/J)),L=Math.max(0,B.arrivedAt+r.maxBufferedMs-W),U=Math.max(B.arrivedAt,R+Math.min(p,L));if(await n.sleep(Math.max(0,U-n.now()),e.signal),!d||(K=e.signal)!=null&&K.aborted)return}i.shift(),R=n.now(),yield B.event}}finally{d&&(d=!1,x(),await((q=t.return)==null?void 0:q.call(t,void 0))),await E}}(),takeAcceptedForStop(){var D;if(!d)return[];d=!1,l&&a&&(k({type:l,text:a},u),a="",l=null);const R=i.flatMap(F=>F.kind==="event"&&F.event.type!=="done"&&F.event.type!=="error"?[F.event]:[]);return i.length=0,x(),(D=t.return)==null||D.call(t,void 0),R}}}const ft=[250,500,1e3],mr=(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*gr(t,e){let r=t,n=0;for(;;){let i=!1;try{for await(const a of r)(a.type==="done"||a.type==="error")&&(i=!0),yield a;if(i||e.signal.aborted)return;throw new lt}catch(a){e.onDisconnect();const l=e.getSessionId();if(e.signal.aborted||i||!(a instanceof lt)||!l||n>=ft.length)throw a;if(await mr(ft[n],e.signal),e.signal.aborted)return;n+=1,r=jt(l,{signal:e.signal,afterSequence:e.getAfterSequence(),onSequence:e.onSequence})}}}class yr{constructor(){ae(this,"configuration");ae(this,"lifecycle",Yt());ae(this,"_phase",{status:"idle"});ae(this,"_pendingCapacity",null);ae(this,"view",{messages:[],sessionError:"",disabledRequest:null});ae(this,"snapshot",this.buildSnapshot());ae(this,"listeners",new Set);ae(this,"subscribe",e=>(this.listeners.add(e),()=>{this.listeners.delete(e)}));ae(this,"getSnapshot",()=>this.snapshot)}buildSnapshot(){return{...this.view,busy:this.busy,capacityRequest:this._pendingCapacity}}publish(){const e=this.buildSnapshot(),r=this.snapshot;if(!Object.keys(e).every(n=>e[n]===r[n])){this.snapshot=e;for(const n of this.listeners)n()}}get visibleMessages(){return this.view.messages}present(e){this.view={...this.view,...e},this.publish()}get phase(){return this._phase}get busy(){return this._phase.status==="streaming"}get pendingCapacity(){return this._pendingCapacity}get sawStreamStart(){return this._phase.status!=="idle"&&this._phase.streamStart!==null}get sawTerminalEvent(){return this._phase.status!=="idle"&&(this._phase.terminal==="complete"||this._phase.terminal==="error")}get streamFailed(){return this._phase.status!=="idle"&&(this._phase.terminal==="error"||this._phase.terminal==="transport_error"||this._phase.terminal==="admission_rejected")}get admissionRejected(){return this._phase.status!=="idle"&&this._phase.terminal==="admission_rejected"}get shouldRefreshProvider(){var e;return this._phase.status==="idle"?!1:!!((e=this._phase.streamStart)!=null&&e.providerExecuted)||this._phase.providerStatusChanged}progress(e){this._phase.status!=="idle"&&(this._phase={...this._phase,...e})}finish(){this._phase.status==="streaming"&&(this._phase={...this._phase,status:"settled"}),this.publish()}queueCapacity(e){this._pendingCapacity=e,this.publish()}cancelCapacity(){this._pendingCapacity=null,this.publish()}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,r=!1){return this.lifecycle=it(this.lifecycle,e),r&&(this.view={...this.view,messages:this.lifecycle.messages}),this.publish(),this.lifecycle}start(e,r,n){this.configuration=n,this._phase={status:"streaming",streamStart:null,providerStatusChanged:!1,terminal:"pending"},this.view={...this.view,messages:e,sessionError:""},this.transition({type:"start",messages:e,sessionId:r})}restore(e,{sessionId:r=this.sessionId,show:n=!1,view:i}={}){return this.lifecycle=it(this.lifecycle,{type:"load",messages:e,sessionId:r}),this.view={...this.view,...n?{messages:e}:{},...i},this.publish(),this.lifecycle}observe(e){return e.type==="stream_start"&&this.progress({streamStart:{providerExecuted:e.provider_execution!==!1}}),(e.type==="done"||e.type==="error")&&this.progress({terminal:e.type==="done"?"complete":"error"}),e.type==="error"&&ut(e.code)==="provider"?(this.progress({providerStatusChanged:!0}),!0):!1}reject(e,r){const n=e instanceof ze?e.code:void 0,i=ut(n),a=r&&n==="chat_not_busy"?"completed":n==="chat_temporarily_disabled"?"disabled":n==="chat_capacity"?"capacity":i==="draft"?"draft":i==="provider"?"provider":"network";return this.progress({terminal:a==="completed"?"already_complete":a==="disabled"||a==="capacity"||a==="draft"?"admission_rejected":"transport_error",...a==="provider"?{providerStatusChanged:!0}:{}}),a}reset(){this._phase={status:"idle"},this._pendingCapacity=null,this.view={...this.view,messages:[],sessionError:""},this.transition({type:"reset"})}}const br=750,wr=8e3,mt="The assistant stream failed.",gt="Couldn’t resend this message. Your original conversation was restored.";function we(t){const e=c.useRef(t);return c.useLayoutEffect(()=>{e.current=t}),c.useCallback((...r)=>e.current(...r),[])}const Pe=t=>({id:t,role:"assistant",streaming:!0,blocks:[]});function vr(t){const[e]=c.useState(()=>new yr),r=c.useSyncExternalStore(e.subscribe,e.getSnapshot),n=c.useRef(t);n.current=t;const i=c.useRef(null),a=c.useRef(0),l=c.useRef(null),u=c.useRef(!1),d=c.useRef(t.sessionId),b=c.useRef(null),I=c.useRef(null),h=c.useRef(!1),g=c.useRef({state:"cleared",timer:null}),A=c.useRef(null),x=c.useRef(null),k=c.useRef(he()),P=c.useRef(0),E=(d.current!==t.sessionId?e.projectSession(t.sessionId):null)??r.messages,j=r.busy,T=()=>{var o;(o=I.current)==null||o.cancel(),I.current=null},R=()=>{const o=g.current;o.timer!==null&&window.clearTimeout(o.timer),g.current={state:"cleared",timer:null}},D=we(()=>{var f;const{timer:o}=g.current;o!==null&&window.clearTimeout(o),(f=i.current)==null||f.abort(),b.current=null,T(),e.cancelCapacity()});c.useEffect(()=>D,[D]),c.useLayoutEffect(()=>{d.current!==t.sessionId&&(d.current=t.sessionId,e.sessionId!==t.sessionId&&(a.current+=1,A.current=null));const o=e.projectSession(t.sessionId);u.current=o!==null,o&&e.present({messages:o})},[t.sessionId,e]),c.useEffect(()=>{e.busy||e.restore(e.messages,{sessionId:t.sessionId})},[t.sessionId,e]);const F=c.useMemo(()=>ms(E),[E]),K=()=>`m${++P.current}_${Date.now().toString(36)}`,q=(o,f=!0)=>{const C=e.state,_=e.transition(o,f),w=o.type==="event"&&o.event.type==="stream_start"?o.event.session_id:null;return w?n.current.onSessionId(w,C.sessionId,e.configuration):_.sessionId&&_.sessionId!==C.sessionId&&n.current.onSessionId(_.sessionId,C.sessionId,e.configuration),_.title!==C.title&&n.current.onTitle(_.title,_.sessionId),_},B=(o,f=!0)=>{q({type:"event",event:o},f)},W=()=>l.current===a.current||u.current,ie=(o,f,C,_={})=>{const w=a.current===f;e.restore(o,{show:w,view:{..._,...w?{sessionError:C}:{}}})},ce=()=>{T(),document.visibilityState!=="hidden"&&u.current&&(h.current=!1,e.present({messages:e.messages}))},oe=()=>{if(!u.current||document.visibilityState==="hidden"||I.current!==null)return;const o=()=>{I.current=null,ce()};if(typeof requestAnimationFrame=="function"){const f=requestAnimationFrame(o);I.current={cancel:()=>cancelAnimationFrame(f)}}else{const f=window.setTimeout(o,0);I.current={cancel:()=>window.clearTimeout(f)}}};c.useEffect(()=>{const o=()=>{document.visibilityState==="visible"&&h.current&&oe()};return document.addEventListener("visibilitychange",o),()=>document.removeEventListener("visibilitychange",o)});const Z=o=>{if(i.current!==o)return;const{state:f}=g.current;R(),f==="shown"&&q({type:"clear_workspace_status"},W())},ne=(o,f)=>{const{timer:C}=g.current;C!==null&&window.clearTimeout(C);const _=window.setTimeout(()=>{g.current={...g.current,timer:null},!(g.current.state!=="armed"||i.current!==o||o.signal.aborted||a.current!==f)&&(g.current={state:"shown",timer:null},q({type:"workspace_status"},W()))},br);g.current={state:"armed",timer:_}},J=(o,f)=>{const C=A.current;!C||C.controller!==o||C.tracker.recordStreamStart(f,performance.now())},p=(o,f)=>{const C=A.current;!C||C.controller!==o||C.tracker.recordTerminal(f)};c.useLayoutEffect(()=>{const o=A.current;if(!o)return;const f=E.at(-1);if((f==null?void 0:f.role)!=="assistant"||!(f.blocks??[]).some(w=>w.kind==="tool"||w.kind==="reasoning"&&!!w.text.trim()||w.kind==="answer"&&!!w.text.trim()))return;const _=performance.now();o.tracker.recordFirstVisible(_);for(const w of f.blocks??[])w.kind==="reasoning"&&w.text.trim()?o.tracker.recordSemantic("reasoning",_):w.kind==="tool"?o.tracker.recordSemantic("tool",_):w.kind==="answer"&&w.text.trim()&&o.tracker.recordSemantic("answer",_)},[E]);const L=async(o,f)=>{var O;const _=await(n.current.loadSession??($=>pe.getSession($)))(o);let w=At(_);return((O=x.current)==null?void 0:O.sessionId)===o&&(w=x.current.messages,x.current=null),a.current!==f&&!(l.current===f&&u.current&&n.current.sessionId===o)?null:(e.restore(w,{sessionId:o,show:!0}),w)},U=(o,f)=>lr(n.current,o,f),ee=o=>{const f=typeof o=="string"?he(o.trim()):o;return!f.text||f.text.length>wr||e.busy||e.pendingCapacity?null:f},z=(o,f,C,_,w,O,$)=>{const Q=++a.current;l.current=Q,u.current=!0;const N=new AbortController;i.current=N;const te=o.text;return k.current=o,e.start(C,f.session_id,$??{model:n.current.initialModel,webSearchEnabled:!!f.web_search_enabled,reasoningEffort:f.reasoning_effort??Xe}),A.current=O?null:{controller:N,tracker:new ur(performance.now())},g.current={...g.current,state:"cleared"},(async()=>{var Ce,Ne,Be,Me,Re,Ie;let Se=0;const H=Y=>{Y>Se&&(Se=Y)};try{const Y=O?jt(O,{signal:N.signal,onSequence:H}):gs(f,{signal:N.signal,onSequence:H}),le=gr(Y,{signal:N.signal,getSessionId:()=>e.sessionId,onDisconnect:()=>{!N.signal.aborted&&i.current===N&&B({type:"compaction_status",state:"finished"},W())},getAfterSequence:()=>Se,onSequence:H}),ue=!O&&Fe()&&ys(),se=ue?fr(le,{signal:N.signal,isHidden:()=>document.visibilityState==="hidden"}):null;se&&(b.current={controller:N,stream:se});for await(const ge of(se==null?void 0:se.events)??le){if(N.signal.aborted||i.current!==N)break;const be=Jt[ge.type];ge.type==="paper_artifact"&&((Ne=(Ce=n.current).onPaperArtifact)==null||Ne.call(Ce,ge,e.sessionId)),ge.type==="stream_start"&&J(N,ge.request_id),be.workspaceStatus==="arm"&&ne(N,Q),be.workspaceStatus==="clear"&&Z(N),e.observe(ge)&&W()&&n.current.onInterrupted(o),be.terminal&&p(N,be.terminal);const xe=W(),De=xe&&!(ue&&document.visibilityState==="hidden");ue&&be.presentation==="structural"&&ce(),ue&&be.presentation==="delta"?(B(ge,!1),h.current||(h.current=xe),oe()):(B(ge,De),ue&&xe&&!De&&(h.current=!0))}}catch(Y){if(!N.signal.aborted&&i.current===N){const le=e.reject(Y,!!O);if(Z(N),le!=="completed")if(le==="disabled")ie(_,Q,"",{disabledRequest:{question:te,draft:o}});else if(le==="capacity"){const ue=Y instanceof ze?Y.retryAfterSeconds??5:5;e.queueCapacity({question:te,draft:o,request:f,optimistic:C,original:_,edit:w,retryAfterSeconds:ue,retryAt:Date.now()+ue*1e3}),ie(_,Q,"")}else p(N,"network_error"),le==="draft"&&(W()&&n.current.onInterrupted(o),ie(_,Q,Y instanceof Error?Y.message:mt)),le==="provider"&&W()&&n.current.onInterrupted(o);le!=="completed"&&!e.admissionRejected&&a.current===Q&&B({type:"error",message:Y instanceof Error?Y.message:mt,code:Y instanceof ze?Y.code:void 0})}}finally{if(i.current===N){if(((Be=b.current)==null?void 0:Be.controller)===N&&(ce(),b.current=null),Z(N),!e.sawTerminalEvent&&!N.signal.aborted&&p(N,"network_error"),e.finish(),e.admissionRejected)n.current.onSettled(f.session_id);else if(!N.signal.aborted){e.shouldRefreshProvider&&((Re=(Me=n.current).onProviderTerminal)==null||Re.call(Me));const Y=e.sessionId,le=a.current===Q;if(w&&!e.sawStreamStart)ie(w.snapshot,Q,gt);else if(Y){le&&w&&(e.streamFailed||!e.sawTerminalEvent)&&e.restore(w.snapshot,{show:!0});try{const ue=await L(Y,Q);ue&&w&&ue.some(se=>se.id===w.targetId)&&e.present({sessionError:gt})}catch{a.current===Q&&q({type:"settle"})}}else le&&q({type:"settle"});(!i.current||i.current===N)&&n.current.onSettled(Y)}((Ie=A.current)==null?void 0:Ie.controller)===N&&(A.current=null)}}})(),!0},de=we(o=>{const f=ee(o);if(!f)return!1;const C=e.visibleMessages,_=Le(C),w=_!=null&&_.status&&_.status!=="complete"&&_.revision?{replace_message_id:_.id,prior_revision:_.revision}:null,O={id:K(),role:"user",text:f.text,paperMentions:f.paperMentions,paperSelection:f.paperSelection},$=Pe(K()),Q=w&&_?Xt(C,H=>H.id===_.id):-1,N=Q<0?[...C,O,$]:[...C.slice(0,Q),O,$],{sessionId:te,initialModel:Se}=n.current;return z(f,U(f.text,{session_id:te,client_message_id:crypto.randomUUID(),...pt(n.current,f),...!te&&Se?{initial_model:Se}:{},...w??{}}),N,C)}),fe=we((o,f)=>{const C=ee(f);if(!C)return!1;const _=e.visibleMessages.slice(),w=_.findIndex(te=>te.id===o&&te.role==="user");if(w<0)return!1;const O=_[w],{sessionId:$}=n.current;if(!$||!O.revision)return!1;const Q={id:O.id,role:"user",text:C.text,paperMentions:C.paperMentions,paperSelection:C.paperSelection,revision:O.revision+1,status:"generating"},N=[..._.slice(0,w),Q,Pe(K())];return z(C,U(C.text,{session_id:$,client_message_id:crypto.randomUUID(),...pt(n.current,C),replace_message_id:O.id,prior_revision:O.revision}),N,_,{targetId:O.id,snapshot:_})}),me=we(()=>{const o=e.visibleMessages.slice(),f=Le(o),{sessionId:C}=n.current;if(!C||!(f!=null&&f.revision)||e.busy||e.pendingCapacity)return!1;const _=he(f.text??"Continue the interrupted response from saved progress."),w=[...o,{id:K(),role:"user",text:_.text,paperMentions:[]},Pe(K())];return z(_,U(_.text,{session_id:C,client_message_id:crypto.randomUUID(),retry_message_id:f.id,...Tt(n.current)}),w,o)}),je=we(()=>{const o=Le(e.visibleMessages);return o!=null&&o.text?fe(o.id,Ke(o)):!1}),ve=c.useCallback(()=>{e.cancelCapacity()},[e]),ye=we(()=>{const o=e.pendingCapacity;return!o||Date.now(){var $,Q;if(!i.current)return;const o=i.current;Z(o),p(o,"stopped"),o.abort();const f=(($=b.current)==null?void 0:$.controller)===o?b.current.stream.takeAcceptedForStop():[];b.current=null;for(const N of f)B(N,!1);ce(),i.current=null,((Q=A.current)==null?void 0:Q.controller)===o&&(A.current=null),e.finish();const C=W(),_=q({type:"stop"},C).messages;C&&n.current.onInterrupted(k.current);const w=e.sessionId;w&&(x.current={sessionId:w,messages:_}),w&&pe.cancelSession(w).catch(()=>{});const O=++a.current;window.setTimeout(()=>{w&&C&&a.current===O?L(w,O).catch(()=>{}).finally(()=>{i.current||n.current.onSettled(w)}):i.current||n.current.onSettled(w)},450)}),S=we((o,f)=>{u.current?e.transition({type:"toggle_block",messageId:o,blockIndex:f},!0):e.present({messages:Gt(e.visibleMessages,o,f)})}),v=()=>{a.current+=1,R(),T(),h.current=!1,A.current=null},X=()=>{var o;(o=i.current)==null||o.abort(),i.current=null,l.current=null},M=we(()=>{v(),X(),b.current=null,x.current=null,u.current=!1,e.reset()}),Ae=we((o,f,C=!1,_)=>{if(v(),e.cancelCapacity(),e.busy&&f!==void 0&&f===e.sessionId){u.current=!0,e.present({messages:e.messages,sessionError:""});return}if(u.current=!1,e.busy||X(),C&&f&&!e.busy){const w=Le(o);if(w){const O=Ke(w),$=[...o,Pe(`${w.id}-active`)];z(O,U(O.text,{session_id:f,client_message_id:"reconnect"}),$,o,void 0,f,_);return}}e.busy?e.present({messages:o,sessionError:""}):e.restore(o,{sessionId:f??n.current.sessionId,show:!0,view:{sessionError:""}})}),Ee=r.capacityRequest;return{messages:E,busy:j,activeSessionId:j?e.sessionId:null,activeTitle:e.state.title,activeConfiguration:e.configuration,selectedBusy:j&&e.sessionId===t.sessionId,papers:F,sessionError:r.sessionError,capacityRequest:Ee,disabledRequest:r.disabledRequest,send:de,editAndResend:fe,retryFromProgress:me,retryLatest:je,retryCapacity:ye,cancelCapacity:ve,dismissDisabled:()=>e.present({disabledRequest:null}),stop:m,toggleBlock:S,reset:M,load:Ae}}const yt=(t,e,r)=>e?r?{...t,paperSelection:r}:{text:t.text,paperMentions:t.paperMentions}:t,Sr=({mode:t="general",routeSessionId:e,primaryPaper:r,currentPage:n,paperSelection:i,onPaperSelectionChange:a,onSessionId:l,onReaderSubmit:u,onReaderNewChat:d,onReaderClose:b})=>{var Ze,et,tt,st,rt;const{sessionId:I}=qt(),h=e??(t==="general"?I:void 0),g=xt(),[A]=St(),{user:x,isLoading:k}=Ct(),P=Et(),V=(x==null?void 0:x.hf_subject)??null,E=_t(),j=Te({...Zt(),enabled:Fe()&&!!x}),T=j.data,R=(T==null?void 0:T.status)==="paused"||t==="paper"&&(T==null?void 0:T.paper_reader_chat_enabled)===!1,D=Te({...es(V),enabled:!!x&&!k}),F=D.data??[],{markSessionBusy:K,patchSession:q,refreshSessions:B}=ir(V),[W,ie]=c.useState(null),[ce,oe]=c.useState(""),[Z]=c.useState(bs),ne=c.useRef(h);ne.current=h;const J=rr({userId:V,signedIn:!!x,authLoading:k,requestedModel:A.get("model")||(Z==null?void 0:Z.model),routeSessionIdRef:ne}),{selectedModel:p,setSelectedModel:L}=J,U=ks(!!(x&&J.provider==="openrouter")),[ee,z]=c.useState(()=>he()),de=Xe,fe=!!(T!=null&&T.web_search_available),[me,je]=c.useState(()=>{var G;const y=(G=A.get("q"))==null?void 0:G.trim();return y?he(y):(Z==null?void 0:Z.draft)??he()}),[ve,ye]=c.useState(()=>typeof window>"u"||window.innerWidth>900),m=c.useRef(new Set),[S,v]=c.useState(void 0),X=c.useCallback(y=>{z(y),a==null||a(y.paperSelection)},[a]),M=vr({sessionId:h??null,initialModel:p,webSearchEnabled:fe,reasoningEffort:de,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,loadSession:async y=>{const G=await P.fetchQuery(ot(V,y));return ie(re=>(re==null?void 0:re.sessionId)===y?null:re),G},onSessionId:(y,G,re)=>{K(y,{model:(re==null?void 0:re.model)??p,webSearchEnabled:(re==null?void 0:re.webSearchEnabled)??fe,reasoningEffort:(re==null?void 0:re.reasoningEffort)??de}),(ne.current??null)===G&&y!==G&&(t==="paper"?l==null||l(y):g(`/chat/${y}`,{replace:!0}))},onTitle:(y,G)=>{G&&!m.current.has(G)&&q(G,{title:y})},onSettled:y=>{y&&q(y,{is_busy:!1}),P.invalidateQueries({queryKey:Mt}),B()},onProviderTerminal:()=>{P.invalidateQueries({queryKey:js})},onPaperArtifact:(y,G)=>{G&&ie({sessionId:G,descriptor:y.descriptor})},onInterrupted:X}),Ae=M.send;c.useEffect(()=>{M.capacityRequest&&X(M.capacityRequest.draft)},[M.capacityRequest,X]);const Ee=c.useCallback(()=>t==="paper"&&r?`/pdf/${r.routeId}`:ne.current?`/chat/${ne.current}`:"/chat",[t,r]),o=c.useCallback((y,G)=>{je(he()),X(y),oe(G)},[X]),f=cr({returnTo:Ee,selectedModel:p,reasoningEffort:de,userBilledInference:J.userBilledInference,onPromptRestored:o}),{authorizeSend:C,restorePrompt:_}=f,w=!!a,O=c.useCallback(async y=>{const G=yt(y,w,i),re=C(G,!!x);if(!(re!==!0&&!await re)){if(ws(),!Ae(G)){_(G,"Your prompt was not sent. It is ready to retry.");return}vs(),z(he()),a==null||a(void 0),t==="paper"&&(u==null||u())}},[C,t,a,u,i,w,_,Ae,x]),$=M.selectedBusy,{load:Q,activeConfiguration:N}=M,te=Te({...ot(V,h??null),enabled:!!(h&&x&&!k&&!$),refetchOnMount:"always"}),Se=sr(t==="general"?h:void 0,!k&&(!x||te.error instanceof Ut&&te.error.status===404)),H=te.data,Ce=$||S===(h??null),Ne=W&&W.sessionId===h?W.descriptor:H==null?void 0:H.latex_paper,Be=(et=(Ze=[...(H==null?void 0:H.messages)??[]].reverse().find(y=>y.role==="user"&&y.viewer_context))==null?void 0:Ze.viewer_context)==null?void 0:et.page;c.useLayoutEffect(()=>{const y=h??null;if(S!==y){if($){v(y),N!=null&&N.model&&L(N.model);return}if(!y){Q([],null),v(null);return}!H||te.isFetching||(v(y),Q(At(H),y,H.is_busy,{model:H.selected_model,webSearchEnabled:H.web_search_enabled,reasoningEffort:H.reasoning_effort??"high"}),oe(""),L(H.selected_model))}},[h,$,H,Q,N,te.isFetching,S,L]),tr({pendingDraft:me,setPendingDraft:je,blocked:k||M.busy||!!x&&j.isFetching||!!(h&&!Ce),authLoading:k,signedIn:!!x,send:O,restoreDraft:z,setSelectedModel:L,onPaperSelectionChange:a}),c.useEffect(()=>{const y=()=>{!x||M.busy||B()};return window.addEventListener("focus",y),()=>window.removeEventListener("focus",y)},[M.busy,B,x]);const Me=()=>{window.innerWidth<=900&&ye(!1),Q([],null),v(null),z(he()),a==null||a(void 0),t==="paper"?d==null||d():g("/chat")},Re=or({routeSessionId:h,selectedModel:p,setSelectedModel:L,patchSession:q,onRenamed:y=>m.current.add(y),refreshSessions:B,onError:oe,onSelectedDeleted:Me,isActive:y=>M.busy&&y===M.activeSessionId,stopActive:M.stop}),Ie=er({messages:M.messages,refreshSessions:B,resetChat:M.reset,restoreDraft:z}),Y=async()=>{await Re.changeModel(We)&&M.retryLatest()},le=Ms(t==="general"),ue=F.map(y=>y.id===M.activeSessionId&&M.busy?{...y,is_busy:!0,title:m.current.has(y.id)?y.title:M.activeTitle||y.title}:y),se=ue.find(y=>y.id===h),ge=(se==null?void 0:se.primary_paper)??(H==null?void 0:H.primary_paper),be=M.messages.length===0,xe=!!(h&&(k||x&&!Ce&&!te.isError||Se.pending)),De=!Ce&&!xe&&((tt=te.error)==null?void 0:tt.message),Je={composerProps:{onSend:O,busy:$,onStop:M.stop,draft:yt(ee,w,i),onDraftChange:y=>{a?(z({text:y.text,paperMentions:y.paperMentions}),y.paperSelection!==i&&a(y.paperSelection)):z(y)},disabled:R||k||M.busy&&!$,describedBy:R?"chat-paused-description":void 0,paperMentionsEnabled:!!(T!=null&&T.paper_mentions_enabled),paperSelectionEnabled:(T==null?void 0:T.paper_reader_selection_enabled)===!0,paperArtifactsEnabled:t==="general"&&(T==null?void 0:T.paper_artifacts_enabled)===!0},provider:J.provider,sponsored:J.sponsored,paused:R,error:M.sessionError};return s.jsx($s,{enabled:t==="general",workspaceKey:h??"new-chat",onAskAiFix:y=>{O(he(y))},children:s.jsxs("div",{className:`chat-page${t==="paper"?" chat-page--reader":""}`,style:{height:le},children:[t==="general"&&s.jsx(Ps,{sessions:ue,activeSessionId:h,loading:D.isLoading,error:ce||((st=D.error)==null?void 0:st.message)||"",open:ve,onClose:()=>ye(!1),onNew:Me,onNavigate:y=>{window.innerWidth<=900&&ye(!1),g(`/chat/${y}`)},onRename:Re.rename,onDelete:y=>void Re.remove(y),onDeleteMany:Re.removeMany}),s.jsx(Qs,{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"&&!ve&&s.jsx("button",{type:"button",className:"icon-btn",onClick:()=>ye(!0),title:"Open sidebar",children:s.jsx(Rt,{})}),s.jsx("span",{className:"chat-topbar-title",children:xe?(se==null?void 0:se.title)||"":(se==null?void 0:se.title)||(H==null?void 0:H.title)||(be?"":"New chat")}),E&&s.jsx("span",{className:"chat-staging-badge",children:"Staging"}),t==="general"&&h&&ge&&s.jsx(Gs,{routeId:ge.route_id,sessionId:h,page:Be}),h&&Ce&&!be&&s.jsx(qs,{sessionId:h,busy:$,loading:xe,hasPaperSelection:M.messages.some(y=>!!y.paperSelection),onError:oe}),t==="paper"&&s.jsx(Ys,{onNewChat:Me,onClose:b})]}),s.jsx(Vs,{provider:J.provider,enabled:Fe()&&!!x&&J.provider==="openai"}),t==="general"&&Ne&&s.jsx(Js,{descriptor:Ne}),xe&&!me.text?s.jsxs("div",{className:"chat-session-loading",role:"status","aria-live":"polite",children:[s.jsx(kt,{}),s.jsx("span",{children:"Loading conversation…"})]}):De?s.jsxs("div",{className:"chat-session-load-error",role:"alert",children:[s.jsx("p",{children:De}),s.jsx("button",{type:"button",onClick:()=>{te.refetch()},children:"Try again"})]}):be&&!me.text?s.jsx(Xs,{mode:t,staging:E,children:s.jsx(ht,{variant:"empty",...Je,suggestions:t==="paper"?Ss:xs,suggestionLinks:t==="paper"&&r&&s.jsxs("a",{className:"chat-example",href:Rs(r.title,r.arxivId),target:"_blank",rel:"noopener noreferrer",title:"Ask Hugging Face ML Intern to reproduce this paper",children:[s.jsx("span",{className:"chat-example-icon",children:s.jsx(Cs,{name:"robot",size:14})}),"Reproduce with ML Intern"]})})}):s.jsxs(s.Fragment,{children:[s.jsx(Ns,{messages:M.messages,papers:M.papers,busy:$,queuedDraft:me.text?me:void 0,paperMentionsEnabled:!!(T!=null&&T.paper_mentions_enabled),archivePending:Ie.pending,openRouterFallbackEnabled:!!((rt=U.data)!=null&&rt.fallback_enabled),onToggleBlock:M.toggleBlock,onEditAndResend:M.editAndResend,onRetryFromProgress:M.retryFromProgress,onRetryWithLuna:J.lunaAvailable?()=>void Y():void 0,onArchiveOld:()=>void Ie.archiveOld(),onArchiveOldest:()=>void Ie.archiveOldest()}),s.jsx(ht,{variant:"followup",...Je})]})]})}),M.capacityRequest&&s.jsx(Ds,{retryAt:M.capacityRequest.retryAt,onCancel:M.cancelCapacity,onRetry:()=>{M.retryCapacity()&&(z(he()),a==null||a(void 0))}}),M.disabledRequest&&s.jsx(Ls,{onClose:()=>{var y;X(((y=M.disabledRequest)==null?void 0:y.draft)??ee),M.dismissDisabled(),j.refetch()}})]})})},xr=t=>{const{user:e}=Ct();return s.jsx(Sr,{...t},(e==null?void 0:e.hf_subject)??"guest")},rn=()=>s.jsx(xr,{});export{xr as ChatExperience,rn as default}; diff --git a/assets/ChatView-C7RaZyCS.js b/assets/ChatView-C7RaZyCS.js deleted file mode 100644 index 2d4fada71dd1c9f17990f0f5438787f83abfc6a4..0000000000000000000000000000000000000000 --- a/assets/ChatView-C7RaZyCS.js +++ /dev/null @@ -1,6 +0,0 @@ -var Nt=Object.defineProperty;var Dt=(t,e,r)=>e in t?Nt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var ae=(t,e,r)=>Dt(t,typeof e!="symbol"?e+"":e,r);import{c as Lt,f as c,j as s,X as bt,x as wt,b as Ie,L as vt,_ as Ft,$ as Bt,a0 as Ot,a1 as nt,V as Pe,e as St,k as xt,s as _t,l as Et,h as Pt,a as Ct,u as qt,A as Ut}from"./index-3CfcAX6N.js";import{C as Ht,U as at,b as Kt,f as ke,A as Wt,a as zt,c as $t,g as Qt,h as Vt,i as Be,j as Yt,k as it,t as Gt,l as Xt,E as Jt,m as Zt,n as es,o as ot}from"./chatLifecycle-DK4zPLlA.js";import{g as Le,h as ts,j as ss,k as Rt,T as ct,e as kt,l as De,m as Ke,r as rs,n as ns,o as he,D as We,s as as,t as is,v as os,w as cs,x as ls,y as us,z as ds,B as hs,C as ps,E as Xe,F as fs,G as lt,H as jt,I as ut,J as ze,f as ms,K as gs,L as ys,M as At,N as bs,O as ws,Q as vs,R as Ss,S as xs}from"./chatSessions-C9fOk1AR.js";import{M as _s}from"./McpShowcase-CcyaF6wZ.js";import{c as pe}from"./chat-81nIwu_j.js";import{S as Es}from"./share-2-CvYRtEqg.js";import{u as qe}from"./useMutation-CKC6OFhA.js";import{I as Cs}from"./Icon-C0d9p4Q2.js";import{m as Rs}from"./mlIntern-CyazNz7i.js";import{u as ks,O as js}from"./openrouter-Bol7eGlT.js";/* empty css */import"./hover-card-DOKhkRf9.js";import"./CatalogEntityPreviewLink-BzZN33n7.js";import"./catalog-B47DuClX.js";import"./github-vz0wxUgq.js";import"./file-text-BnjsSheU.js";import"./PaperPreviewLink-BJAulcHJ.js";import"./index-DGr54pyn.js";import"./index-C8DcqbS3.js";import"./katex-DkKDou_j.js";import"./papers-BsYlGUQi.js";import"./curation-BZoIvsHD.js";import"./thumbs-up-BMfH8ZZ-.js";import"./copy-BCi4szva.js";import"./queryOptions-C9woPjwX.js";import"./arrow-left-CZqhJnQC.js";import"./external-link-_7BCdt0S.js";import"./plus-CiDEk52y.js";import"./search-SnOvJVk_.js";import"./chevron-up-DgV4G0Wf.js";import"./AuthorAvatar-DYaYcwPm.js";import"./AgentLogos-06t31xxf.js";/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const As=Lt("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);function Ms(t){const[e,r]=c.useState("calc(100dvh - 60px)");return c.useLayoutEffect(()=>{if(!t)return;const n=document.querySelector(".app-header"),i=window.visualViewport,a=()=>{const u=(i==null?void 0:i.height)??window.innerHeight;r(`${Math.max(0,u-((n==null?void 0:n.offsetHeight)??0))}px`)};a();const l=new ResizeObserver(a);return n&&l.observe(n),i==null||i.addEventListener("resize",a),window.addEventListener("resize",a),()=>{l.disconnect(),i==null||i.removeEventListener("resize",a),window.removeEventListener("resize",a)}},[t]),t?e:"100%"}const Is="https://huggingface.co/settings/inference-providers",dt="pwc.chat.billing-notice-dismissed.v1";function Ts({provider:t}){const[e,r]=c.useState(()=>localStorage.getItem(dt)==="1");return!Le()||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:Is,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(dt,"1"),r(!0)},children:s.jsx(bt,{size:15,"aria-hidden":"true"})})]})]})}function ht({variant:t,composerProps:e,provider:r,sponsored:n=!1,paused:i,error:a,suggestions:l=[],suggestionLinks:u}){var b;const d=s.jsxs(s.Fragment,{children:[!n&&s.jsx(Ts,{provider:r}),i&&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."}),a&&s.jsx("div",{className:"chat-composer-error",role:"alert",children:a}),s.jsx(Ht,{...e,...t==="empty"?{autoFocus:!0}:{placeholder:(b=e.draft)!=null&&b.text?"Edit and send again…":"Ask a follow-up…"}}),t==="empty"&&s.jsxs("div",{className:"chat-examples",children:[l.map(M=>s.jsx("button",{type:"button",className:"chat-example",disabled:i,onClick:()=>{var h;return e.onSend({text:M,paperMentions:[],...(h=e.draft)!=null&&h.paperSelection?{paperSelection:e.draft.paperSelection}:{}})},children:M},M)),u]})]});return t==="empty"?d:s.jsx("div",{className:"chat-composer-wrap",children:s.jsxs("div",{className:"chat-composer-inner",children:[d,s.jsx("div",{className:"chat-composer-foot",children:Le()?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 Ns({messages:t,papers:e,busy:r,queuedDraft:n,paperMentionsEnabled:i,archivePending:a,openRouterFallbackEnabled:l,onToggleBlock:u,onEditAndResend:d,onRetryFromProgress:b,onRetryWithLuna:M,onArchiveOld:h,onArchiveOldest:g}){var ne,J;const[A,x]=c.useState(null),k=c.useRef(null),P=c.useRef(null),V=c.useRef("bottom"),E=c.useRef(0),j=c.useRef(0),[I,R]=c.useState(!1),D=c.useRef(null),L=c.useCallback(p=>{V.current=p},[]),K=c.useCallback(()=>{const p=k.current;p&&R(p.scrollHeight-p.scrollTop-p.clientHeight>1)},[]),q=t.filter(p=>p.role==="user"),F=q.length,W=c.useRef(F),ie=c.useRef(!1),ce=(ne=q[0])==null?void 0:ne.id,oe=(J=q.at(-1))==null?void 0:J.id;c.useEffect(()=>{r&&x(null)},[r]),c.useLayoutEffect(()=>{const p=k.current;if(p){if(F>W.current||r&&!ie.current){const B=Array.from(p.querySelectorAll("[data-message-id]")).at(-1);if(B){const U=p.getBoundingClientRect().top;E.current=p.scrollTop+B.getBoundingClientRect().top-U-24,L("question")}}if(W.current=F,ie.current=r,P.current!==null){p.scrollTop=P.current,P.current=null;return}V.current==="bottom"&&(p.scrollTop=p.scrollHeight),V.current==="question"&&(p.scrollTop=E.current,j.current=p.scrollTop)}},[t,F,r,L]),c.useLayoutEffect(K),c.useEffect(()=>{const p=k.current;if(!p)return;const B=new ResizeObserver(K);return B.observe(p),p.firstElementChild&&B.observe(p.firstElementChild),()=>B.disconnect()},[K]);const Z=(p,B)=>{var U;P.current=((U=k.current)==null?void 0:U.scrollTop)??null,u(p,B)};return s.jsxs("div",{className:"chat-conversation-viewport",children:[s.jsx("div",{className:"chat-conversation",ref:k,tabIndex:0,role:"region","aria-label":"Conversation",onWheel:p=>{(p.deltaY<0||V.current==="question")&&L("free")},onTouchStart:p=>{var B;D.current=((B=p.touches[0])==null?void 0:B.clientY)??null},onTouchMove:p=>{var U;const B=(U=p.touches[0])==null?void 0:U.clientY;B!==void 0&&D.current!==null&&(B>D.current||V.current==="question")&&L("free"),D.current=B??null},onKeyDown:p=>{p.target===p.currentTarget&&((["ArrowUp","PageUp","Home"].includes(p.key)||p.key===" "&&p.shiftKey)&&L("free"),["ArrowDown","PageDown","End"," "].includes(p.key)&&V.current==="question"&&L("free"))},onScroll:p=>{const{scrollHeight:B,scrollTop:U,clientHeight:ee}=p.currentTarget,z=B-U-ee<=1;V.current==="bottom"&&!z&&L("free");const de=U-j.current;V.current==="question"&&(de>1||de<-1&&!z)&&L("free"),K()},children:s.jsxs("div",{className:"chat-conversation-inner",children:[t.length===0&&(n==null?void 0:n.text)&&s.jsx(at,{id:"queued-launch-preview",text:n.text,paperMentions:n.paperMentions,paperSelection:n.paperSelection,isInitial:!0}),t.map(p=>{var B,U,ee,z;return p.role==="user"?s.jsx(at,{id:p.id,text:p.text??"",paperMentions:p.paperMentions??[],paperSelection:p.paperSelection,paperMentionsEnabled:i,isInitial:p.id===ce,editingAllowed:!r&&!!p.revision,editing:A===p.id,editNotice:p.id===ce?"Sending will replace this conversation.":p.id===oe?"Sending will replace the response.":"Sending will replace the response and all messages after it.",onEdit:()=>x(p.id),onCancel:()=>x(null),onResendDraft:de=>{const fe=d(p.id,de);return fe&&x(null),fe}},p.id):s.jsx(Kt,{msg:p,papers:e,onToggleBlock:Z,onRetryCompaction:!r&&p.id===((B=t.at(-1))==null?void 0:B.id)&&((U=q.at(-1))!=null&&U.revision)?b:void 0,onRetryWithLuna:!r&&p.id===((ee=t.at(-1))==null?void 0:ee.id)&&((z=q.at(-1))!=null&&z.revision)?M:void 0,onArchiveOldChats:h,onArchiveOldestChats:g,archivePending:a,hfBilling:null,openRouterFallbackEnabled:l,feedbackEnabled:!0},p.id)})]})}),I&&s.jsx("button",{type:"button",className:"chat-jump-latest",onClick:()=>{L("bottom");const p=k.current;p&&(p.focus({preventScroll:!0}),p.scrollTop=p.scrollHeight,K())},children:"Jump to latest"})]})}function Ds({retryAt:t,onRetry:e,onCancel:r}){const[n,i]=c.useState(()=>Math.max(0,Math.ceil((t-Date.now())/1e3))),a=c.useRef(null);return c.useEffect(()=>{var b;const l=document.activeElement instanceof HTMLElement?document.activeElement:null;(b=a.current)==null||b.focus();const u=()=>i(Math.max(0,Math.ceil((t-Date.now())/1e3)));u();const d=window.setInterval(u,250);return()=>{window.clearInterval(d),l==null||l.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:l=>{l.key==="Escape"&&(l.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:a,onClick:r,children:"Cancel"}),s.jsx("button",{type:"button",className:"chat-capacity-retry",disabled:n>0,onClick:e,children:"Try again"})]})]})})}function Ls({onClose:t}){const e=c.useRef(null);return c.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 Fs({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 $e="pwc:chat:sidebar-width",Qe=280,Ve=200,Ye=480,Bs=12,Ge=t=>Math.max(Ve,Math.min(Ye,t)),Os=()=>{if(typeof window>"u")return Qe;const t=Number(localStorage.getItem($e));return Number.isFinite(t)&&t>0?Ge(t):Qe};function Ps({sessions:t,activeSessionId:e,loading:r,error:n,open:i,onClose:a,onNew:l,onNavigate:u,onRename:d,onDelete:b,onDeleteMany:M}){const[h,g]=c.useState(Os),A=c.useRef(null),x=c.useRef(h),[k,P]=c.useState(null),[V,E]=c.useState(""),[j,I]=c.useState(null),[R,D]=c.useState(!1),[L,K]=c.useState(new Set),q=t.filter(m=>L.has(m.id)).map(m=>m.id),F=q.length>0,[W,ie]=c.useState(!1),ce=[...t].sort((m,w)=>Date.parse(w.updated_at)-Date.parse(m.updated_at)),oe=ce.filter((m,w)=>w{if(!j)return;const m=()=>I(null),w=S=>{S.key==="Escape"&&m()};return window.addEventListener("click",m),window.addEventListener("keydown",w),()=>{window.removeEventListener("click",m),window.removeEventListener("keydown",w)}},[j]),c.useEffect(()=>{if(!F)return;const m=w=>{w.key==="Escape"&&K(new Set)};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[F]);const J=ts(Z),p=J.flatMap(m=>m.items.map(w=>w.id)),B=c.useRef(null),U=m=>{B.current=m,K(w=>{const S=new Set(w);return S.has(m)?S.delete(m):S.add(m),S})},ee=m=>{const w=B.current,S=w&&L.has(w)?p.indexOf(w):-1,X=p.indexOf(m);if(S<0||X<0){B.current=m,K(Se=>new Set([...Se,m]));return}const T=p.slice(Math.min(S,X),Math.max(S,X)+1);K(Se=>new Set([...Se,...T]))},z=async()=>{if(!(W||!ke())){ie(!0);try{await M(q)&&K(new Set)}finally{ie(!1)}}},de=m=>{P(m.id),E(m.title)},fe=async m=>{const w=V.trim();w&&await d(m,w)&&P(null)},me=(m,w,S)=>I({id:m,x:w,y:S}),je=m=>{if(!A.current)return;const w=Ge(A.current.width+m-A.current.x);x.current=w,g(w)},ve=()=>{A.current&&(A.current=null,localStorage.setItem($e,String(x.current)))},ye=m=>{const w=Ge(m);x.current=w,g(w),localStorage.setItem($e,String(w))};return s.jsxs(s.Fragment,{children:[i&&s.jsx("div",{className:"chat-sidebar-backdrop","aria-hidden":"true",onClick:a}),s.jsxs("aside",{className:`chat-sidebar${i?"":" chat-sidebar-closed"}`,style:{"--chat-sidebar-width":`${h}px`},children:[s.jsxs("div",{className:"chat-sidebar-top",children:[s.jsxs("button",{type:"button",className:"chat-new-chat",onClick:()=>{ke()&&l()},children:[s.jsx(ss,{})," New chat"]}),s.jsx("button",{type:"button",className:"icon-btn",onClick:a,title:"Collapse sidebar",children:s.jsx(Rt,{})})]}),F&&s.jsxs("div",{className:"chat-sessions-bulk",role:"toolbar","aria-label":"Selected chats",children:[s.jsxs("span",{className:"chat-sessions-bulk-count",children:[q.length," selected"]}),s.jsxs("button",{type:"button",className:"chat-sessions-bulk-delete",disabled:W,onClick:()=>void z(),children:[s.jsx(ct,{})," ",W?"Deleting…":"Delete"]}),s.jsx("button",{type:"button",className:"chat-sessions-bulk-cancel",disabled:W,onClick:()=>K(new Set),children:"Cancel"})]}),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."}),J.map(m=>s.jsxs("div",{className:"chat-session-group",children:[s.jsx("div",{className:"chat-session-group-label",children:m.label}),m.items.map(w=>s.jsxs("div",{className:`chat-session${w.id===e?" chat-session-active":""}${L.has(w.id)?" chat-session-selected":""}`,role:"button",tabIndex:0,"aria-pressed":F?L.has(w.id):void 0,title:F?"Shift-click to select every chat up to here":"Shift-click to select several chats",onMouseDown:S=>{S.shiftKey&&S.preventDefault()},onClick:S=>{S.shiftKey?ee(w.id):F?U(w.id):ke()&&u(w.id)},onKeyDown:S=>{if(S.key==="Enter"&&S.shiftKey?ee(w.id):S.key==="Enter"&&F?U(w.id):S.key==="Enter"&&ke()&&u(w.id),S.key==="F2"&&de(w),S.key==="ContextMenu"||S.shiftKey&&S.key==="F10"){S.preventDefault();const X=S.currentTarget.getBoundingClientRect();me(w.id,X.right-150,X.bottom)}},onContextMenu:S=>{S.preventDefault(),me(w.id,S.clientX,S.clientY)},children:[k===w.id?s.jsx("input",{className:"chat-session-title-input",value:V,autoFocus:!0,maxLength:80,onClick:S=>S.stopPropagation(),onChange:S=>E(S.target.value),onBlur:()=>void fe(w.id),onKeyDown:S=>{S.stopPropagation(),S.key==="Enter"&&fe(w.id),S.key==="Escape"&&P(null)}}):s.jsx("span",{className:"chat-session-title",children:w.title}),s.jsx("button",{type:"button",className:"chat-session-menu","aria-label":"Chat actions","aria-haspopup":"menu",title:"Chat actions",onClick:S=>{S.stopPropagation();const X=S.currentTarget.getBoundingClientRect();me(w.id,X.right-150,X.bottom)},children:"⋯"}),s.jsx("button",{type:"button",className:"chat-session-delete","aria-label":"Delete conversation",onClick:S=>{S.stopPropagation(),ke()&&b(w.id)},children:s.jsx(ct,{})})]},w.id))]},m.label)),ne>0&&s.jsx("button",{type:"button",className:"chat-sessions-toggle","aria-expanded":R,onClick:()=>D(m=>!m),children:R?"Show less":`Show ${ne} older ${ne===1?"chat":"chats"}`})]}),s.jsx(_s,{className:"chat-sidebar-tools",canNavigate:ke}),s.jsx("div",{className:"chat-sidebar-resize-handle",role:"separator","aria-label":"Resize chat history","aria-orientation":"vertical","aria-valuemin":Ve,"aria-valuemax":Ye,"aria-valuenow":h,title:"Drag to resize; double-click to reset",tabIndex:0,onPointerDown:m=>{m.button===0&&(A.current={x:m.clientX,width:h},x.current=h,m.currentTarget.setPointerCapture(m.pointerId))},onPointerMove:m=>je(m.clientX),onPointerUp:ve,onPointerCancel:ve,onLostPointerCapture:ve,onDoubleClick:()=>ye(Qe),onKeyDown:m=>{(m.key==="ArrowLeft"||m.key==="ArrowRight")&&(m.preventDefault(),ye(h+(m.key==="ArrowRight"?10:-10))),(m.key==="Home"||m.key==="End")&&(m.preventDefault(),ye(m.key==="Home"?Ve:Ye))}}),j&&s.jsxs("div",{className:"chat-session-context-menu",role:"menu",style:{left:j.x,top:j.y},onClick:m=>m.stopPropagation(),children:[s.jsx("button",{type:"button",role:"menuitem",autoFocus:!0,onClick:()=>{const m=t.find(w=>w.id===j.id);m&&de(m),I(null)},children:"Rename chat"}),s.jsx("button",{type:"button",role:"menuitem",onClick:()=>{U(j.id),I(null)},children:L.has(j.id)?"Deselect chat":"Select chat"})]})]})]})}function qs({sessionId:t,busy:e,loading:r,hasPaperSelection:n=!1,onError:i}){const{toast:a}=wt(),[l,u]=c.useState(!1),[d,b]=c.useState(""),M=async()=>{var h;if(!(e||l)&&!(n&&!window.confirm("This public link will include the selected paper passage. Anyone with the link can read that passage. Continue?"))){u(!0);try{const g=await pe.createOrRefreshShare(t),A=new URL(g.public_path,window.location.origin).toString();try{if(!((h=navigator.clipboard)!=null&&h.writeText))throw new Error("Clipboard unavailable");await navigator.clipboard.writeText(A),a({className:"chat-share-toast",duration:5e3,title:"Public link copied to your clipboard",description:"Anyone with this link can see this conversation."})}catch{b(A)}}catch(g){const A=g instanceof Error?g.message:"Could not share this conversation";i(A),a({variant:"destructive",title:"Share failed",description:A})}finally{u(!1)}}};return s.jsxs(s.Fragment,{children:[s.jsxs("button",{type:"button",className:"chat-share-button",onClick:()=>void M(),disabled:e||l||r,"aria-label":"Share conversation",children:[l?s.jsx(kt,{}):s.jsx(Es,{"aria-hidden":"true"}),s.jsx("span",{children:"Share"})]}),s.jsx(Fs,{url:d,onClose:()=>b("")})]})}const Mt=["chat","openai","usage"],Us=90,It="pwc:chat:openai-credits-notice:dismissed";function Hs(t=!0){return Ie({queryKey:Mt,queryFn:()=>pe.getOpenAIUsage(),enabled:t,staleTime:3e4,retry:!1,refetchOnWindowFocus:!0})}function Ks(t,e,r){if(!t||e!=="openai"||t.used_percentt?s.jsx(Wt,{workspaceKey:e,onAskAiFix:n,children:r}):s.jsx(s.Fragment,{children:r}),Qs=({enabled:t,children:e})=>t?s.jsx(zt,{variant:"chat",children:e}):s.jsx(s.Fragment,{children:e}),Vs=({provider:t,enabled:e})=>{const r=Hs(e),[n,i]=Pe.useState(()=>Ws()),a=Ks(r.data,t,n);return a?s.jsxs("div",{className:"chat-credits-notice",role:"status",children:[s.jsx("span",{children:a.message}),s.jsx("button",{type:"button",className:"chat-credits-notice-close","aria-label":"Dismiss credits notice",onClick:()=>{zs(a.resetsAt),i(a.resetsAt)},children:"×"})]}):null},Ys=({onNewChat:t,onClose:e})=>s.jsxs(s.Fragment,{children:[s.jsxs(Ft,{children:[s.jsx(Bt,{asChild:!0,children:s.jsx("button",{type:"button",className:"icon-btn chat-reader-icon-btn","aria-label":"Chat options",title:"Chat options",children:s.jsx(As,{"aria-hidden":"true"})})}),s.jsxs(Ot,{align:"end",children:[s.jsx(nt,{onSelect:t,children:"New chat"}),s.jsx(nt,{asChild:!0,children:s.jsx(vt,{to:"/chat",children:"All chats"})})]})]}),e&&s.jsx("button",{type:"button",className:"icon-btn chat-reader-icon-btn",onClick:e,"aria-label":"Close chat",title:"Close chat",children:s.jsx(bt,{"aria-hidden":"true"})})]}),Gs=({routeId:t,sessionId:e,page:r})=>s.jsx(vt,{className:"chat-reader-action",to:`/pdf/${t}`,onClick:n=>{if(!ke()){n.preventDefault();return}sessionStorage.setItem(`pwc:reader:session:${t}`,e),r&&sessionStorage.setItem(`pwc:reader:page:${t}`,String(r))},children:"Open reader"}),Xs=({mode:t,staging:e,children:r})=>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."}),e&&s.jsx("p",{className:"chat-staging-access-note",children:"This is a limited staging preview. Only approved Hugging Face users can start chats."}),r]})}),Js=({descriptor:t})=>{const e=$t(),{open:r,register:n,unregister:i}=e,a=Pe.useRef(null),l=t.source_head??t.preview_head,u=Pe.useMemo(()=>l?{kind:"artifact",schema_version:1,scope:"owner",artifact_id:t.artifact_id,version_id:l.version_id,identifier:"latex-paper",version:l.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,l]),d=u?Qt(u):null;return Pe.useEffect(()=>{if(!(!u||!d))return n(u),a.current!==d&&(a.current=d,r(u)),()=>i(d)},[u,d,r,n,i]),null},Zs={old:"Could not archive old chats",oldest:"Could not archive chats"};function er({messages:t,refreshSessions:e,resetChat:r,restoreDraft:n}){const{toast:i}=wt(),a=qe({mutationFn:async d=>{const b=d==="old"?await pe.archiveOldChats():await pe.archiveOldestChats();return await e(),b},onSuccess:({archived_count:d},b)=>{if(b==="old"&&d===0){i({title:"No chats were archived",description:"There are no inactive chats older than 30 days."});return}const M=De(t);r(),n(Ke(M)),i({title:`${d} ${d===1?"chat":"chats"} archived`,description:"Your question is ready to send again."})},onError:(d,b)=>{i({variant:"destructive",title:Zs[b],description:d instanceof Error?d.message:"Try again."})}}),l=a.isPending?a.variables??null:null,u=async d=>{l===null&&await a.mutateAsync(d).catch(()=>{})};return{pending:l,archiveOld:()=>u("old"),archiveOldest:()=>u("oldest")}}function tr({pendingDraft:t,setPendingDraft:e,blocked:r,authLoading:n,signedIn:i,send:a,restoreDraft:l,setSelectedModel:u,onPaperSelectionChange:d}){const[b,M]=St(),h=c.useRef(!1);c.useEffect(()=>{if(n||!i)return;const g=rs();g&&(g.draft.paperSelection&&(d==null||d(g.draft.paperSelection)),g.autoSend?e(g.draft):(l(g.draft),ns()))},[n,d,l,e,i]),c.useEffect(()=>{var k;if(n)return;const g=(k=b.get("q"))==null?void 0:k.trim();if(!g)return;h.current=!1;const A=b.get("model");A&&u(A),e(he(g));const x=new URLSearchParams(b);x.delete("q"),x.delete("model"),M(x,{replace:!0})},[n,b,e,M,u]),c.useEffect(()=>{if(r||!t.text||h.current)return;const g=window.setTimeout(()=>{h.current||(h.current=!0,a(t).finally(()=>e(he())))},0);return()=>window.clearTimeout(g)},[r,t,a,e])}function sr(t,e){var a;const r=xt(),n=Ie({queryKey:["chatSessionPublicShare",t],queryFn:()=>pe.getSessionPublicShare(t??""),enabled:!!t&&e,retry:!1}),i=(a=n.data)==null?void 0:a.public_path;return c.useEffect(()=>{i&&r(i,{replace:!0})},[r,i]),{pending:n.isFetching||!!i}}function rr({userId:t,signedIn:e,authLoading:r,requestedModel:n,routeSessionIdRef:i}){const a=c.useRef(n),l=c.useRef(null),[u,d]=c.useState(n||We),b=c.useCallback(k=>{a.current=k,d(k)},[]),h=Ie({...Vt(t),enabled:e&&!r}).data,g=(h==null?void 0:h.items)??(_t()?as:is);c.useEffect(()=>{if(r||!e)return;const k=os();l.current=k,k&&d(k)},[r,e]),c.useEffect(()=>{if(!h||i.current)return;const k=a.current||l.current;d(k&&h.items.some(P=>P.id===k)?k:h.default_model)},[h,i]);const A=cs(g,u),x=ls(g,u);return{models:g,selectedModel:u,setSelectedModel:b,provider:A,sponsored:x,userBilledInference:A==="huggingface"&&!x,lunaAvailable:g.some(k=>k.id===We)}}const nr=3e3,ar=150,He=(t,e)=>t instanceof Error?t.message:e;function ir(t){const e=Et(),r=c.useCallback(l=>{e.setQueryData(Be.list(t),u=>l(u??[]))},[e,t]),n=c.useCallback((l,u)=>{r(d=>d.map(b=>b.id===l?{...b,...u}:b)),e.setQueryData(Be.detail(t,l),d=>d&&{...d,...u})},[e,r,t]),i=c.useCallback(async()=>{await e.invalidateQueries({queryKey:Be.list(t)})},[e,t]);return{markSessionBusy:c.useCallback((l,u)=>{e.cancelQueries({queryKey:Be.list(t)});const d=new Date().toISOString();r(b=>b.some(M=>M.id===l)?b.map(M=>M.id===l?{...M,is_busy:!0}:M):[{id:l,title:"New chat",selected_model:u.model,created_at:d,updated_at:d,message_count:1,is_busy:!0,web_search_enabled:u.webSearchEnabled,reasoning_effort:u.reasoningEffort},...b])},[e,r,t]),patchSession:n,refreshSessions:i}}function or({routeSessionId:t,selectedModel:e,setSelectedModel:r,patchSession:n,onRenamed:i,refreshSessions:a,onError:l,onSelectedDeleted:u,isActive:d,stopActive:b}){const M=qe({mutationFn:({id:E,title:j})=>pe.updateSession(E,{title:j}),onSuccess:(E,{id:j})=>{i(j),n(j,E)},onError:E=>l(He(E,"Rename failed"))}),h=async(E,j)=>{if(j){const I=Date.now()+nr;for(;(await pe.getSession(E)).is_busy;){if(Date.now()>=I)throw new Error("Generation is still stopping. The chat was not deleted.");await new Promise(D=>window.setTimeout(D,ar))}}await pe.removeSession(E)},g=qe({mutationFn:async({ids:E,activeId:j})=>{let I=!1;try{for(const R of E)await h(R,R===j),R===t&&(I=!0)}finally{I&&u(),await a()}},onError:E=>l(He(E,"Delete failed"))}),A=qe({mutationFn:({sessionId:E,model:j})=>pe.updateSession(E,{selected_model:j}),onSuccess:(E,{sessionId:j})=>{n(j,{selected_model:E.selected_model}),l("")},onError:(E,{previous:j})=>{r(j),l(He(E,"Model change failed"))}}),x=(E,j)=>M.mutateAsync({id:E,title:j}).then(()=>!0,()=>!1),k=async E=>{if(E.length===0)return!1;const j=E.find(d),I=E.length===1?"this chat":`these ${E.length} chats`;return window.confirm(`${j?"Stop and delete":"Delete"} ${I}? This cannot be undone.`)?(j&&b(),g.mutateAsync({ids:E,activeId:j}).then(()=>!0,()=>!1)):!1};return{rename:x,remove:async E=>{await k([E])},removeMany:k,changeModel:async E=>{const j=e;return r(E),t?A.mutateAsync({sessionId:t,model:E,previous:j}).then(()=>!0,()=>!1):!0}}}function cr({returnTo:t,selectedModel:e,reasoningEffort:r,userBilledInference:n,onPromptRestored:i}){const a=c.useRef(!1),l=c.useRef(!1),u=c.useCallback(h=>{us(h,e,r),window.location.href=Pt(t(),{authorizeInference:n})},[r,t,e,n]),d=c.useCallback((h,g)=>{ds(h,e),i(h,g)},[i,e]),b=c.useCallback(async h=>{if(l.current)return!1;l.current=!0;try{return(await pe.getInferenceBilling()).connected?(a.current=!0,!0):hs()?(d(h,"Hugging Face inference authorization was not completed. Your prompt is ready to retry."),!1):(u(h),!1)}catch(g){return d(h,g instanceof Error?g.message:"Could not check Hugging Face authorization."),!1}finally{l.current=!1}},[u,d]);return{authorizeSend:c.useCallback((h,g)=>g?n&&!a.current?b(h):!0:(u(h),!1),[u,b,n]),restorePrompt:d}}function lr(t,e,r){return{message:e,...r,web_search_enabled:!!t.webSearchEnabled,reasoning_effort:t.reasoningEffort??Xe}}function Tt(t){return t.primaryPaperRouteId?{primary_paper_route_id:t.primaryPaperRouteId}:{}}function pt(t,e){var n;const r=(n=t.viewerContext)==null?void 0:n.call(t);return{paper_mentions:e.paperMentions.map(({route_id:i,title:a,start:l,end:u})=>({route_id:i,title:a,start:l,end:u})),...Tt(t),...r?{viewer_context:r}:{},...e.paperSelection?{paper_selection:ps(e.paperSelection)}:{}}}class ur{constructor(e,r=fs){ae(this,"requestId");ae(this,"firstVisibleAt");ae(this,"streamStartReported",!1);ae(this,"firstVisibleReported",!1);ae(this,"terminalReported",!1);ae(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 Ee={minDelayMs:5,maxDelayMs:80,minRateCharsPerMs:.3,maxBufferedMs:400,arrivalRateTauMs:1e3,arrivalRateHeadroom:1.1,maxPendingChars:64},dr={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 hr(t){return!["stream_start","sandbox_start","sandbox_ready","workspace_ready","session_title_start","session_title_delta","session_title_done"].includes(t.type)}function pr(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 l=[...new n(void 0,{granularity:"word"}).segment(t)].filter(d=>d.isWordLike);let u=0;if(l.length>1&&(u=l.at(-1).index),l.length&&/\s$/u.test(t)&&(u=t.length),u>0){const d=t.slice(0,u),b=[],h=[...new n(void 0,{granularity:"word"}).segment(d)].filter(g=>g.isWordLike);for(let g=0;gA&&b.push(d.slice(A,x))}return h.length||b.push(d),{pieces:b,pending:t.slice(u)}}}else{const a=[...t.matchAll(/\s+/gu)];if(a.length){const l=[];let u=0;for(const d of a){const b=d.index+d[0].length;l.push(t.slice(u,b)),u=b}return{pieces:l,pending:t.slice(u)}}}return t.length>=r?{pieces:[t.slice(0,r)],pending:t.slice(r)}:{pieces:[],pending:t}}function fr(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??dr,i=[];let a="",l=null,u=0,d=!0,b=!1,M=null,h=0,g=n.now(),A=!1;const x=()=>{M==null||M(),M=null},k=(R,D)=>{const L=R.type==="reasoning_delta"||R.type==="answer_delta"?R.text.length:0;i.push({kind:"event",event:R,arrivedAt:D,chars:L}),x()},P=R=>{if(!l||!a)return;const D=pr(a,R,r.maxPendingChars);for(const L of D.pieces)L&&k({type:l,text:L},u),u=n.now();a=D.pending,a||(l=null)},V=R=>{if(!d)return;const D=n.now();if(R.type==="reasoning_delta"||R.type==="answer_delta"){const L=R.type;if(!R.text)return;if(!A){A=!0,h+=R.text.length,g=D;const q=Array.from(R.text)[0];k({type:L,text:q},D);const F=R.text.slice(q.length);if(F)for(l=L,a=F,u=D,P(!1);a.length>=r.maxPendingChars;)P(!1);return}l&&l!==L&&P(!0),l||(l=L,u=D),a+=R.text;const K=Math.max(0,D-g);for(h*=Math.exp(-K/r.arrivalRateTauMs),h+=R.text.length,g=D,P(!1);a.length>=r.maxPendingChars;)P(!1);return}hr(R)&&P(!0),k(R,D)},E=(async()=>{var R;try{for await(const D of t)V(D);d&&P(!0)}catch(D){d&&!((R=e.signal)!=null&&R.aborted)&&(P(!0),i.push({kind:"error",error:D,arrivedAt:n.now(),chars:0}))}finally{b=!0,x()}})(),j=()=>i.length||b?Promise.resolve():new Promise(R=>{M=R});return{events:async function*(){var D,L,K,q;let R=Number.NEGATIVE_INFINITY;try{for(;;){if(await j(),!i.length){if(b||!d)return;continue}const F=i[0];if(F.kind==="error")throw i.shift(),F.error;if(F.chars&&!((D=e.isHidden)!=null&&D.call(e))){const W=n.now(),ie=i.reduce((ee,z)=>ee+z.chars,0),ce=((L=i.find(ee=>ee.chars))==null?void 0:L.arrivedAt)??W,oe=Math.max(0,r.maxBufferedMs-(W-ce)),Z=h*Math.exp(-Math.max(0,W-g)/r.arrivalRateTauMs)/r.arrivalRateTauMs,ne=oe>0?ie/oe:Number.POSITIVE_INFINITY,J=Math.max(r.minRateCharsPerMs,Z*r.arrivalRateHeadroom,ne),p=Math.min(r.maxDelayMs,Math.max(r.minDelayMs,F.chars/J)),B=Math.max(0,F.arrivedAt+r.maxBufferedMs-W),U=Math.max(F.arrivedAt,R+Math.min(p,B));if(await n.sleep(Math.max(0,U-n.now()),e.signal),!d||(K=e.signal)!=null&&K.aborted)return}i.shift(),R=n.now(),yield F.event}}finally{d&&(d=!1,x(),await((q=t.return)==null?void 0:q.call(t,void 0))),await E}}(),takeAcceptedForStop(){var D;if(!d)return[];d=!1,l&&a&&(k({type:l,text:a},u),a="",l=null);const R=i.flatMap(L=>L.kind==="event"&&L.event.type!=="done"&&L.event.type!=="error"?[L.event]:[]);return i.length=0,x(),(D=t.return)==null||D.call(t,void 0),R}}}const ft=[250,500,1e3],mr=(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*gr(t,e){let r=t,n=0;for(;;){let i=!1;try{for await(const a of r)(a.type==="done"||a.type==="error")&&(i=!0),yield a;if(i||e.signal.aborted)return;throw new lt}catch(a){e.onDisconnect();const l=e.getSessionId();if(e.signal.aborted||i||!(a instanceof lt)||!l||n>=ft.length)throw a;if(await mr(ft[n],e.signal),e.signal.aborted)return;n+=1,r=jt(l,{signal:e.signal,afterSequence:e.getAfterSequence(),onSequence:e.onSequence})}}}class yr{constructor(){ae(this,"configuration");ae(this,"lifecycle",Yt());ae(this,"_phase",{status:"idle"});ae(this,"_pendingCapacity",null);ae(this,"view",{messages:[],sessionError:"",disabledRequest:null});ae(this,"snapshot",this.buildSnapshot());ae(this,"listeners",new Set);ae(this,"subscribe",e=>(this.listeners.add(e),()=>{this.listeners.delete(e)}));ae(this,"getSnapshot",()=>this.snapshot)}buildSnapshot(){return{...this.view,busy:this.busy,capacityRequest:this._pendingCapacity}}publish(){const e=this.buildSnapshot(),r=this.snapshot;if(!Object.keys(e).every(n=>e[n]===r[n])){this.snapshot=e;for(const n of this.listeners)n()}}get visibleMessages(){return this.view.messages}present(e){this.view={...this.view,...e},this.publish()}get phase(){return this._phase}get busy(){return this._phase.status==="streaming"}get pendingCapacity(){return this._pendingCapacity}get sawStreamStart(){return this._phase.status!=="idle"&&this._phase.streamStart!==null}get sawTerminalEvent(){return this._phase.status!=="idle"&&(this._phase.terminal==="complete"||this._phase.terminal==="error")}get streamFailed(){return this._phase.status!=="idle"&&(this._phase.terminal==="error"||this._phase.terminal==="transport_error"||this._phase.terminal==="admission_rejected")}get admissionRejected(){return this._phase.status!=="idle"&&this._phase.terminal==="admission_rejected"}get shouldRefreshProvider(){var e;return this._phase.status==="idle"?!1:!!((e=this._phase.streamStart)!=null&&e.providerExecuted)||this._phase.providerStatusChanged}progress(e){this._phase.status!=="idle"&&(this._phase={...this._phase,...e})}finish(){this._phase.status==="streaming"&&(this._phase={...this._phase,status:"settled"}),this.publish()}queueCapacity(e){this._pendingCapacity=e,this.publish()}cancelCapacity(){this._pendingCapacity=null,this.publish()}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,r=!1){return this.lifecycle=it(this.lifecycle,e),r&&(this.view={...this.view,messages:this.lifecycle.messages}),this.publish(),this.lifecycle}start(e,r,n){this.configuration=n,this._phase={status:"streaming",streamStart:null,providerStatusChanged:!1,terminal:"pending"},this.view={...this.view,messages:e,sessionError:""},this.transition({type:"start",messages:e,sessionId:r})}restore(e,{sessionId:r=this.sessionId,show:n=!1,view:i}={}){return this.lifecycle=it(this.lifecycle,{type:"load",messages:e,sessionId:r}),this.view={...this.view,...n?{messages:e}:{},...i},this.publish(),this.lifecycle}observe(e){return e.type==="stream_start"&&this.progress({streamStart:{providerExecuted:e.provider_execution!==!1}}),(e.type==="done"||e.type==="error")&&this.progress({terminal:e.type==="done"?"complete":"error"}),e.type==="error"&&ut(e.code)==="provider"?(this.progress({providerStatusChanged:!0}),!0):!1}reject(e,r){const n=e instanceof ze?e.code:void 0,i=ut(n),a=r&&n==="chat_not_busy"?"completed":n==="chat_temporarily_disabled"?"disabled":n==="chat_capacity"?"capacity":i==="draft"?"draft":i==="provider"?"provider":"network";return this.progress({terminal:a==="completed"?"already_complete":a==="disabled"||a==="capacity"||a==="draft"?"admission_rejected":"transport_error",...a==="provider"?{providerStatusChanged:!0}:{}}),a}reset(){this._phase={status:"idle"},this._pendingCapacity=null,this.view={...this.view,messages:[],sessionError:""},this.transition({type:"reset"})}}const br=750,wr=8e3,mt="The assistant stream failed.",gt="Couldn’t resend this message. Your original conversation was restored.";function we(t){const e=c.useRef(t);return c.useLayoutEffect(()=>{e.current=t}),c.useCallback((...r)=>e.current(...r),[])}const Oe=t=>({id:t,role:"assistant",streaming:!0,blocks:[]});function vr(t){const[e]=c.useState(()=>new yr),r=c.useSyncExternalStore(e.subscribe,e.getSnapshot),n=c.useRef(t);n.current=t;const i=c.useRef(null),a=c.useRef(0),l=c.useRef(null),u=c.useRef(!1),d=c.useRef(t.sessionId),b=c.useRef(null),M=c.useRef(null),h=c.useRef(!1),g=c.useRef({state:"cleared",timer:null}),A=c.useRef(null),x=c.useRef(null),k=c.useRef(he()),P=c.useRef(0),E=(d.current!==t.sessionId?e.projectSession(t.sessionId):null)??r.messages,j=r.busy,I=()=>{var o;(o=M.current)==null||o.cancel(),M.current=null},R=()=>{const o=g.current;o.timer!==null&&window.clearTimeout(o.timer),g.current={state:"cleared",timer:null}},D=we(()=>{var f;const{timer:o}=g.current;o!==null&&window.clearTimeout(o),(f=i.current)==null||f.abort(),b.current=null,I(),e.cancelCapacity()});c.useEffect(()=>D,[D]),c.useLayoutEffect(()=>{d.current!==t.sessionId&&(d.current=t.sessionId,e.sessionId!==t.sessionId&&(a.current+=1,A.current=null));const o=e.projectSession(t.sessionId);u.current=o!==null,o&&e.present({messages:o})},[t.sessionId,e]),c.useEffect(()=>{e.busy||e.restore(e.messages,{sessionId:t.sessionId})},[t.sessionId,e]);const L=c.useMemo(()=>ms(E),[E]),K=()=>`m${++P.current}_${Date.now().toString(36)}`,q=(o,f=!0)=>{const C=e.state,_=e.transition(o,f),v=o.type==="event"&&o.event.type==="stream_start"?o.event.session_id:null;return v?n.current.onSessionId(v,C.sessionId,e.configuration):_.sessionId&&_.sessionId!==C.sessionId&&n.current.onSessionId(_.sessionId,C.sessionId,e.configuration),_.title!==C.title&&n.current.onTitle(_.title,_.sessionId),_},F=(o,f=!0)=>{q({type:"event",event:o},f)},W=()=>l.current===a.current||u.current,ie=(o,f,C,_={})=>{const v=a.current===f;e.restore(o,{show:v,view:{..._,...v?{sessionError:C}:{}}})},ce=()=>{I(),document.visibilityState!=="hidden"&&u.current&&(h.current=!1,e.present({messages:e.messages}))},oe=()=>{if(!u.current||document.visibilityState==="hidden"||M.current!==null)return;const o=()=>{M.current=null,ce()};if(typeof requestAnimationFrame=="function"){const f=requestAnimationFrame(o);M.current={cancel:()=>cancelAnimationFrame(f)}}else{const f=window.setTimeout(o,0);M.current={cancel:()=>window.clearTimeout(f)}}};c.useEffect(()=>{const o=()=>{document.visibilityState==="visible"&&h.current&&oe()};return document.addEventListener("visibilitychange",o),()=>document.removeEventListener("visibilitychange",o)});const Z=o=>{if(i.current!==o)return;const{state:f}=g.current;R(),f==="shown"&&q({type:"clear_workspace_status"},W())},ne=(o,f)=>{const{timer:C}=g.current;C!==null&&window.clearTimeout(C);const _=window.setTimeout(()=>{g.current={...g.current,timer:null},!(g.current.state!=="armed"||i.current!==o||o.signal.aborted||a.current!==f)&&(g.current={state:"shown",timer:null},q({type:"workspace_status"},W()))},br);g.current={state:"armed",timer:_}},J=(o,f)=>{const C=A.current;!C||C.controller!==o||C.tracker.recordStreamStart(f,performance.now())},p=(o,f)=>{const C=A.current;!C||C.controller!==o||C.tracker.recordTerminal(f)};c.useLayoutEffect(()=>{const o=A.current;if(!o)return;const f=E.at(-1);if((f==null?void 0:f.role)!=="assistant"||!(f.blocks??[]).some(v=>v.kind==="tool"||v.kind==="reasoning"&&!!v.text.trim()||v.kind==="answer"&&!!v.text.trim()))return;const _=performance.now();o.tracker.recordFirstVisible(_);for(const v of f.blocks??[])v.kind==="reasoning"&&v.text.trim()?o.tracker.recordSemantic("reasoning",_):v.kind==="tool"?o.tracker.recordSemantic("tool",_):v.kind==="answer"&&v.text.trim()&&o.tracker.recordSemantic("answer",_)},[E]);const B=async(o,f)=>{var O;const _=await(n.current.loadSession??($=>pe.getSession($)))(o);let v=At(_);return((O=x.current)==null?void 0:O.sessionId)===o&&(v=x.current.messages,x.current=null),a.current!==f&&!(l.current===f&&u.current&&n.current.sessionId===o)?null:(e.restore(v,{sessionId:o,show:!0}),v)},U=(o,f)=>lr(n.current,o,f),ee=o=>{const f=typeof o=="string"?he(o.trim()):o;return!f.text||f.text.length>wr||e.busy||e.pendingCapacity?null:f},z=(o,f,C,_,v,O,$)=>{const Q=++a.current;l.current=Q,u.current=!0;const N=new AbortController;i.current=N;const te=o.text;return k.current=o,e.start(C,f.session_id,$??{model:n.current.initialModel,webSearchEnabled:!!f.web_search_enabled,reasoningEffort:f.reasoning_effort??Xe}),A.current=O?null:{controller:N,tracker:new ur(performance.now())},g.current={...g.current,state:"cleared"},(async()=>{var Ce,Te,Fe,Ae,Re,Me;let xe=0;const H=Y=>{Y>xe&&(xe=Y)};try{const Y=O?jt(O,{signal:N.signal,onSequence:H}):gs(f,{signal:N.signal,onSequence:H}),le=gr(Y,{signal:N.signal,getSessionId:()=>e.sessionId,onDisconnect:()=>{!N.signal.aborted&&i.current===N&&F({type:"compaction_status",state:"finished"},W())},getAfterSequence:()=>xe,onSequence:H}),ue=!O&&Le()&&ys(),se=ue?fr(le,{signal:N.signal,isHidden:()=>document.visibilityState==="hidden"}):null;se&&(b.current={controller:N,stream:se});for await(const ge of(se==null?void 0:se.events)??le){if(N.signal.aborted||i.current!==N)break;const be=Jt[ge.type];ge.type==="paper_artifact"&&((Te=(Ce=n.current).onPaperArtifact)==null||Te.call(Ce,ge,e.sessionId)),ge.type==="stream_start"&&J(N,ge.request_id),be.workspaceStatus==="arm"&&ne(N,Q),be.workspaceStatus==="clear"&&Z(N),e.observe(ge)&&W()&&n.current.onInterrupted(o),be.terminal&&p(N,be.terminal);const _e=W(),Ne=_e&&!(ue&&document.visibilityState==="hidden");ue&&be.presentation==="structural"&&ce(),ue&&be.presentation==="delta"?(F(ge,!1),h.current||(h.current=_e),oe()):(F(ge,Ne),ue&&_e&&!Ne&&(h.current=!0))}}catch(Y){if(!N.signal.aborted&&i.current===N){const le=e.reject(Y,!!O);if(Z(N),le!=="completed")if(le==="disabled")ie(_,Q,"",{disabledRequest:{question:te,draft:o}});else if(le==="capacity"){const ue=Y instanceof ze?Y.retryAfterSeconds??5:5;e.queueCapacity({question:te,draft:o,request:f,optimistic:C,original:_,edit:v,retryAfterSeconds:ue,retryAt:Date.now()+ue*1e3}),ie(_,Q,"")}else p(N,"network_error"),le==="draft"&&(W()&&n.current.onInterrupted(o),ie(_,Q,Y instanceof Error?Y.message:mt)),le==="provider"&&W()&&n.current.onInterrupted(o);le!=="completed"&&!e.admissionRejected&&a.current===Q&&F({type:"error",message:Y instanceof Error?Y.message:mt,code:Y instanceof ze?Y.code:void 0})}}finally{if(i.current===N){if(((Fe=b.current)==null?void 0:Fe.controller)===N&&(ce(),b.current=null),Z(N),!e.sawTerminalEvent&&!N.signal.aborted&&p(N,"network_error"),e.finish(),e.admissionRejected)n.current.onSettled(f.session_id);else if(!N.signal.aborted){e.shouldRefreshProvider&&((Re=(Ae=n.current).onProviderTerminal)==null||Re.call(Ae));const Y=e.sessionId,le=a.current===Q;if(v&&!e.sawStreamStart)ie(v.snapshot,Q,gt);else if(Y){le&&v&&(e.streamFailed||!e.sawTerminalEvent)&&e.restore(v.snapshot,{show:!0});try{const ue=await B(Y,Q);ue&&v&&ue.some(se=>se.id===v.targetId)&&e.present({sessionError:gt})}catch{a.current===Q&&q({type:"settle"})}}else le&&q({type:"settle"});(!i.current||i.current===N)&&n.current.onSettled(Y)}((Me=A.current)==null?void 0:Me.controller)===N&&(A.current=null)}}})(),!0},de=we(o=>{const f=ee(o);if(!f)return!1;const C=e.visibleMessages,_=De(C),v=_!=null&&_.status&&_.status!=="complete"&&_.revision?{replace_message_id:_.id,prior_revision:_.revision}:null,O={id:K(),role:"user",text:f.text,paperMentions:f.paperMentions,paperSelection:f.paperSelection},$=Oe(K()),Q=v&&_?Xt(C,H=>H.id===_.id):-1,N=Q<0?[...C,O,$]:[...C.slice(0,Q),O,$],{sessionId:te,initialModel:xe}=n.current;return z(f,U(f.text,{session_id:te,client_message_id:crypto.randomUUID(),...pt(n.current,f),...!te&&xe?{initial_model:xe}:{},...v??{}}),N,C)}),fe=we((o,f)=>{const C=ee(f);if(!C)return!1;const _=e.visibleMessages.slice(),v=_.findIndex(te=>te.id===o&&te.role==="user");if(v<0)return!1;const O=_[v],{sessionId:$}=n.current;if(!$||!O.revision)return!1;const Q={id:O.id,role:"user",text:C.text,paperMentions:C.paperMentions,paperSelection:C.paperSelection,revision:O.revision+1,status:"generating"},N=[..._.slice(0,v),Q,Oe(K())];return z(C,U(C.text,{session_id:$,client_message_id:crypto.randomUUID(),...pt(n.current,C),replace_message_id:O.id,prior_revision:O.revision}),N,_,{targetId:O.id,snapshot:_})}),me=we(()=>{const o=e.visibleMessages.slice(),f=De(o),{sessionId:C}=n.current;if(!C||!(f!=null&&f.revision)||e.busy||e.pendingCapacity)return!1;const _=he(f.text??"Continue the interrupted response from saved progress."),v=[...o,{id:K(),role:"user",text:_.text,paperMentions:[]},Oe(K())];return z(_,U(_.text,{session_id:C,client_message_id:crypto.randomUUID(),retry_message_id:f.id,...Tt(n.current)}),v,o)}),je=we(()=>{const o=De(e.visibleMessages);return o!=null&&o.text?fe(o.id,Ke(o)):!1}),ve=c.useCallback(()=>{e.cancelCapacity()},[e]),ye=we(()=>{const o=e.pendingCapacity;return!o||Date.now(){var $,Q;if(!i.current)return;const o=i.current;Z(o),p(o,"stopped"),o.abort();const f=(($=b.current)==null?void 0:$.controller)===o?b.current.stream.takeAcceptedForStop():[];b.current=null;for(const N of f)F(N,!1);ce(),i.current=null,((Q=A.current)==null?void 0:Q.controller)===o&&(A.current=null),e.finish();const C=W(),_=q({type:"stop"},C).messages;C&&n.current.onInterrupted(k.current);const v=e.sessionId;v&&(x.current={sessionId:v,messages:_}),v&&pe.cancelSession(v).catch(()=>{});const O=++a.current;window.setTimeout(()=>{v&&C&&a.current===O?B(v,O).catch(()=>{}).finally(()=>{i.current||n.current.onSettled(v)}):i.current||n.current.onSettled(v)},450)}),w=we((o,f)=>{u.current?e.transition({type:"toggle_block",messageId:o,blockIndex:f},!0):e.present({messages:Gt(e.visibleMessages,o,f)})}),S=()=>{a.current+=1,R(),I(),h.current=!1,A.current=null},X=()=>{var o;(o=i.current)==null||o.abort(),i.current=null,l.current=null},T=we(()=>{S(),X(),b.current=null,x.current=null,u.current=!1,e.reset()}),Se=we((o,f,C=!1,_)=>{if(S(),e.cancelCapacity(),e.busy&&f!==void 0&&f===e.sessionId){u.current=!0,e.present({messages:e.messages,sessionError:""});return}if(u.current=!1,e.busy||X(),C&&f&&!e.busy){const v=De(o);if(v){const O=Ke(v),$=[...o,Oe(`${v.id}-active`)];z(O,U(O.text,{session_id:f,client_message_id:"reconnect"}),$,o,void 0,f,_);return}}e.busy?e.present({messages:o,sessionError:""}):e.restore(o,{sessionId:f??n.current.sessionId,show:!0,view:{sessionError:""}})}),Ue=r.capacityRequest;return{messages:E,busy:j,activeSessionId:j?e.sessionId:null,activeTitle:e.state.title,activeConfiguration:e.configuration,selectedBusy:j&&e.sessionId===t.sessionId,papers:L,sessionError:r.sessionError,capacityRequest:Ue,disabledRequest:r.disabledRequest,send:de,editAndResend:fe,retryFromProgress:me,retryLatest:je,retryCapacity:ye,cancelCapacity:ve,dismissDisabled:()=>e.present({disabledRequest:null}),stop:m,toggleBlock:w,reset:T,load:Se}}const yt=(t,e,r)=>e?r?{...t,paperSelection:r}:{text:t.text,paperMentions:t.paperMentions}:t,Sr=({mode:t="general",routeSessionId:e,primaryPaper:r,currentPage:n,paperSelection:i,onPaperSelectionChange:a,onSessionId:l,onReaderSubmit:u,onReaderNewChat:d,onReaderClose:b})=>{var Ze,et,tt,st,rt;const{sessionId:M}=qt(),h=e??(t==="general"?M:void 0),g=xt(),[A]=St(),{user:x,isLoading:k}=Ct(),P=Et(),V=(x==null?void 0:x.hf_subject)??null,E=_t(),j=Ie({...Zt(),enabled:Le()&&!!x}),I=j.data,R=(I==null?void 0:I.status)==="paused"||t==="paper"&&(I==null?void 0:I.paper_reader_chat_enabled)===!1,D=Ie({...es(V),enabled:!!x&&!k}),L=D.data??[],{markSessionBusy:K,patchSession:q,refreshSessions:F}=ir(V),[W,ie]=c.useState(null),[ce,oe]=c.useState(""),[Z]=c.useState(bs),ne=c.useRef(h);ne.current=h;const J=rr({userId:V,signedIn:!!x,authLoading:k,requestedModel:A.get("model")||(Z==null?void 0:Z.model),routeSessionIdRef:ne}),{selectedModel:p,setSelectedModel:B}=J,U=ks(!!(x&&J.provider==="openrouter")),[ee,z]=c.useState(()=>he()),de=Xe,fe=!!(I!=null&&I.web_search_available),[me,je]=c.useState(()=>{var G;const y=(G=A.get("q"))==null?void 0:G.trim();return y?he(y):(Z==null?void 0:Z.draft)??he()}),[ve,ye]=c.useState(()=>typeof window>"u"||window.innerWidth>900),m=c.useRef(new Set),[w,S]=c.useState(void 0),X=c.useCallback(y=>{z(y),a==null||a(y.paperSelection)},[a]),T=vr({sessionId:h??null,initialModel:p,webSearchEnabled:fe,reasoningEffort:de,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,loadSession:async y=>{const G=await P.fetchQuery(ot(V,y));return ie(re=>(re==null?void 0:re.sessionId)===y?null:re),G},onSessionId:(y,G,re)=>{K(y,{model:(re==null?void 0:re.model)??p,webSearchEnabled:(re==null?void 0:re.webSearchEnabled)??fe,reasoningEffort:(re==null?void 0:re.reasoningEffort)??de}),(ne.current??null)===G&&y!==G&&(t==="paper"?l==null||l(y):g(`/chat/${y}`,{replace:!0}))},onTitle:(y,G)=>{G&&!m.current.has(G)&&q(G,{title:y})},onSettled:y=>{y&&q(y,{is_busy:!1}),P.invalidateQueries({queryKey:Mt}),F()},onProviderTerminal:()=>{P.invalidateQueries({queryKey:js})},onPaperArtifact:(y,G)=>{G&&ie({sessionId:G,descriptor:y.descriptor})},onInterrupted:X}),Se=T.send;c.useEffect(()=>{T.capacityRequest&&X(T.capacityRequest.draft)},[T.capacityRequest,X]);const Ue=c.useCallback(()=>t==="paper"&&r?`/pdf/${r.routeId}`:ne.current?`/chat/${ne.current}`:"/chat",[t,r]),o=c.useCallback((y,G)=>{je(he()),X(y),oe(G)},[X]),f=cr({returnTo:Ue,selectedModel:p,reasoningEffort:de,userBilledInference:J.userBilledInference,onPromptRestored:o}),{authorizeSend:C,restorePrompt:_}=f,v=!!a,O=c.useCallback(async y=>{const G=yt(y,v,i),re=C(G,!!x);if(!(re!==!0&&!await re)){if(ws(),!Se(G)){_(G,"Your prompt was not sent. It is ready to retry.");return}vs(),z(he()),a==null||a(void 0),t==="paper"&&(u==null||u())}},[C,t,a,u,i,v,_,Se,x]),$=T.selectedBusy,{load:Q,activeConfiguration:N}=T,te=Ie({...ot(V,h??null),enabled:!!(h&&x&&!k&&!$),refetchOnMount:"always"}),xe=sr(t==="general"?h:void 0,!k&&(!x||te.error instanceof Ut&&te.error.status===404)),H=te.data,Ce=$||w===(h??null),Te=W&&W.sessionId===h?W.descriptor:H==null?void 0:H.latex_paper,Fe=(et=(Ze=[...(H==null?void 0:H.messages)??[]].reverse().find(y=>y.role==="user"&&y.viewer_context))==null?void 0:Ze.viewer_context)==null?void 0:et.page;c.useLayoutEffect(()=>{const y=h??null;if(w!==y){if($){S(y),N!=null&&N.model&&B(N.model);return}if(!y){Q([],null),S(null);return}!H||te.isFetching||(S(y),Q(At(H),y,H.is_busy,{model:H.selected_model,webSearchEnabled:H.web_search_enabled,reasoningEffort:H.reasoning_effort??"high"}),oe(""),B(H.selected_model))}},[h,$,H,Q,N,te.isFetching,w,B]),tr({pendingDraft:me,setPendingDraft:je,blocked:k||T.busy||!!x&&j.isFetching||!!(h&&!Ce),authLoading:k,signedIn:!!x,send:O,restoreDraft:z,setSelectedModel:B,onPaperSelectionChange:a}),c.useEffect(()=>{const y=()=>{!x||T.busy||F()};return window.addEventListener("focus",y),()=>window.removeEventListener("focus",y)},[T.busy,F,x]);const Ae=()=>{window.innerWidth<=900&&ye(!1),Q([],null),S(null),z(he()),a==null||a(void 0),t==="paper"?d==null||d():g("/chat")},Re=or({routeSessionId:h,selectedModel:p,setSelectedModel:B,patchSession:q,onRenamed:y=>m.current.add(y),refreshSessions:F,onError:oe,onSelectedDeleted:Ae,isActive:y=>T.busy&&y===T.activeSessionId,stopActive:T.stop}),Me=er({messages:T.messages,refreshSessions:F,resetChat:T.reset,restoreDraft:z}),Y=async()=>{await Re.changeModel(We)&&T.retryLatest()},le=Ms(t==="general"),ue=L.map(y=>y.id===T.activeSessionId&&T.busy?{...y,is_busy:!0,title:m.current.has(y.id)?y.title:T.activeTitle||y.title}:y),se=ue.find(y=>y.id===h),ge=(se==null?void 0:se.primary_paper)??(H==null?void 0:H.primary_paper),be=T.messages.length===0,_e=!!(h&&(k||x&&!Ce&&!te.isError||xe.pending)),Ne=!Ce&&!_e&&((tt=te.error)==null?void 0:tt.message),Je={composerProps:{onSend:O,busy:$,onStop:T.stop,draft:yt(ee,v,i),onDraftChange:y=>{a?(z({text:y.text,paperMentions:y.paperMentions}),y.paperSelection!==i&&a(y.paperSelection)):z(y)},disabled:R||k||T.busy&&!$,describedBy:R?"chat-paused-description":void 0,paperMentionsEnabled:!!(I!=null&&I.paper_mentions_enabled),paperSelectionEnabled:(I==null?void 0:I.paper_reader_selection_enabled)===!0,paperArtifactsEnabled:t==="general"&&(I==null?void 0:I.paper_artifacts_enabled)===!0},provider:J.provider,sponsored:J.sponsored,paused:R,error:T.sessionError};return s.jsx($s,{enabled:t==="general",workspaceKey:h??"new-chat",onAskAiFix:y=>{O(he(y))},children:s.jsxs("div",{className:`chat-page${t==="paper"?" chat-page--reader":""}`,style:{height:le},children:[t==="general"&&s.jsx(Ps,{sessions:ue,activeSessionId:h,loading:D.isLoading,error:ce||((st=D.error)==null?void 0:st.message)||"",open:ve,onClose:()=>ye(!1),onNew:Ae,onNavigate:y=>{window.innerWidth<=900&&ye(!1),g(`/chat/${y}`)},onRename:Re.rename,onDelete:y=>void Re.remove(y),onDeleteMany:Re.removeMany}),s.jsx(Qs,{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"&&!ve&&s.jsx("button",{type:"button",className:"icon-btn",onClick:()=>ye(!0),title:"Open sidebar",children:s.jsx(Rt,{})}),s.jsx("span",{className:"chat-topbar-title",children:_e?(se==null?void 0:se.title)||"":(se==null?void 0:se.title)||(H==null?void 0:H.title)||(be?"":"New chat")}),E&&s.jsx("span",{className:"chat-staging-badge",children:"Staging"}),t==="general"&&h&&ge&&s.jsx(Gs,{routeId:ge.route_id,sessionId:h,page:Fe}),h&&Ce&&!be&&s.jsx(qs,{sessionId:h,busy:$,loading:_e,hasPaperSelection:T.messages.some(y=>!!y.paperSelection),onError:oe}),t==="paper"&&s.jsx(Ys,{onNewChat:Ae,onClose:b})]}),s.jsx(Vs,{provider:J.provider,enabled:Le()&&!!x&&J.provider==="openai"}),t==="general"&&Te&&s.jsx(Js,{descriptor:Te}),_e&&!me.text?s.jsxs("div",{className:"chat-session-loading",role:"status","aria-live":"polite",children:[s.jsx(kt,{}),s.jsx("span",{children:"Loading conversation…"})]}):Ne?s.jsxs("div",{className:"chat-session-load-error",role:"alert",children:[s.jsx("p",{children:Ne}),s.jsx("button",{type:"button",onClick:()=>{te.refetch()},children:"Try again"})]}):be&&!me.text?s.jsx(Xs,{mode:t,staging:E,children:s.jsx(ht,{variant:"empty",...Je,suggestions:t==="paper"?Ss:xs,suggestionLinks:t==="paper"&&r&&s.jsxs("a",{className:"chat-example",href:Rs(r.title,r.arxivId),target:"_blank",rel:"noopener noreferrer",title:"Ask Hugging Face ML Intern to reproduce this paper",children:[s.jsx("span",{className:"chat-example-icon",children:s.jsx(Cs,{name:"robot",size:14})}),"Reproduce with ML Intern"]})})}):s.jsxs(s.Fragment,{children:[s.jsx(Ns,{messages:T.messages,papers:T.papers,busy:$,queuedDraft:me.text?me:void 0,paperMentionsEnabled:!!(I!=null&&I.paper_mentions_enabled),archivePending:Me.pending,openRouterFallbackEnabled:!!((rt=U.data)!=null&&rt.fallback_enabled),onToggleBlock:T.toggleBlock,onEditAndResend:T.editAndResend,onRetryFromProgress:T.retryFromProgress,onRetryWithLuna:J.lunaAvailable?()=>void Y():void 0,onArchiveOld:()=>void Me.archiveOld(),onArchiveOldest:()=>void Me.archiveOldest()}),s.jsx(ht,{variant:"followup",...Je})]})]})}),T.capacityRequest&&s.jsx(Ds,{retryAt:T.capacityRequest.retryAt,onCancel:T.cancelCapacity,onRetry:()=>{T.retryCapacity()&&(z(he()),a==null||a(void 0))}}),T.disabledRequest&&s.jsx(Ls,{onClose:()=>{var y;X(((y=T.disabledRequest)==null?void 0:y.draft)??ee),T.dismissDisabled(),j.refetch()}})]})})},xr=t=>{const{user:e}=Ct();return s.jsx(Sr,{...t},(e==null?void 0:e.hf_subject)??"guest")},rn=()=>s.jsx(xr,{});export{xr as ChatExperience,rn as default}; diff --git a/assets/ConferenceDetailView-jxKxeht5.js b/assets/ConferenceDetailView-Bes-wZoN.js similarity index 82% rename from assets/ConferenceDetailView-jxKxeht5.js rename to assets/ConferenceDetailView-Bes-wZoN.js index 34a1d441310a8d5114875b643da09c6a5fb560cc..f6dc4fbb43c55a634847c076ca8bd4f316e453d5 100644 --- a/assets/ConferenceDetailView-jxKxeht5.js +++ b/assets/ConferenceDetailView-Bes-wZoN.js @@ -1 +1 @@ -import{u as y,b as k,f as _,j as e,L as h,T as S}from"./index-3CfcAX6N.js";import{a as f,A as b,b as E}from"./AreaSection-Dzw2ZfXP.js";import{M as j}from"./MarkdownText-BfMP6CxP.js";import{c as A}from"./catalog-B47DuClX.js";import{i as C}from"./apiErrors-XoIVpN_S.js";import{s as F}from"./areas-Dvi8w2dp.js";import{c as T,h as L}from"./colors-BkWRhvFI.js";import{C as $}from"./conferenceListings-BnmhBx-_.js";import{f as w}from"./deadlines-BG5SWwEG.js";import{d as D}from"./transform-Dx-N8Yyj.js";import{S as P}from"./skeleton-CQbSjC3L.js";import{A as M,a as R}from"./alert-BXZ4lnnf.js";import{s as B}from"./safeExternalHref-CkBrsh84.js";import I from"./NotFound-DXa9p6DX.js";/* empty css */import"./PaperPreviewLink-BJAulcHJ.js";import"./index-DGr54pyn.js";import"./index-C8DcqbS3.js";import"./katex-DkKDou_j.js";import"./hover-card-DOKhkRf9.js";import"./papers-BsYlGUQi.js";import"./curation-BZoIvsHD.js";import"./useMutation-CKC6OFhA.js";const ce=()=>{var g,x;const{confSlug:o}=y(),t=k({queryKey:["conference-areas-with-tasks",o],queryFn:()=>A.conferenceAreasWithTasks(o),enabled:!!o,staleTime:S}),m=_.useMemo(()=>{var a;return F(((a=t.data)==null?void 0:a.results)??[])},[t.data]),s=(g=t.data)==null?void 0:g.conference,d=((x=t.data)==null?void 0:x.total_paper_count)??0,N=$.filter(a=>{var r;return(((r=t.data)==null?void 0:r[a.countKey])??0)>0});if(C(t.error))return e.jsx(I,{});if(t.error)return e.jsx("div",{className:"page",children:e.jsx(M,{variant:"destructive",children:e.jsx(R,{children:"Failed to load conference. Please try again."})})});const p=s?w(s.start_date,s.end_date):null,u=s?[s.venue,s.location].filter(Boolean).join(", "):null,n=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:n??e.jsx(P,{className:"h-10 w-64 inline-block"})}),e.jsxs("div",{className:"feed-subtitle",style:{display:"flex",flexDirection:"column",gap:4},children:[p&&e.jsx("span",{children:p}),u&&e.jsx("span",{children:u}),(s==null?void 0:s.url)&&e.jsx("a",{href:B(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(j,{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:n?`${n} visual`:"Conference visual",onError:a=>{var r,c;(c=(r=a.currentTarget.parentElement)==null?void 0:r.parentElement)==null||c.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",n??"Conference",s.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(j,{className:"task-image-credit",text:s.image_credit})]})]})]})]}),!t.isLoading&&d>0&&e.jsx(f,{title:"Browse papers",description:"All accepted papers, plus oral, spotlight, outstanding, and best paper finalists.",meta:`${d.toLocaleString()} papers`,style:{marginTop:48},children:N.map(a=>{var r;return e.jsxs(h,{to:`/conferences/${o}/${a.slug}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:a.dotColor}}),a.label]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(((r=t.data)==null?void 0:r[a.countKey])??0).toLocaleString()," papers"]})})]},a.slug)})}),t.isLoading?e.jsx(b,{tiles:6,tileClassName:"h-24"}):m.map(a=>{const r=a.tasks;if(r.length===0)return null;const c=r.reduce((i,l)=>i+(l.paper_count||0),0);return e.jsx(f,{title:a.name,description:a.description,meta:`${r.length} ${r.length===1?"task":"tasks"} · ${c.toLocaleString()} papers`,children:r.map(i=>{const l=i.slug||"",v=T(L(l));return e.jsxs(h,{to:`/conferences/${o}/${l}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:v.dot}}),D(i.name,l)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(i.paper_count??0).toLocaleString()," papers"]})})]},i.id)})},a.id)}),e.jsx(E,{areas:m})]})};export{ce as default}; +import{u as y,b as k,f as _,j as e,L as h,T as S}from"./index-CxhY4zQ1.js";import{a as f,A as b,b as E}from"./AreaSection-B21Mp4br.js";import{M as j}from"./MarkdownText-D0WkOxKi.js";import{c as A}from"./catalog-DCEU6WpP.js";import{i as C}from"./apiErrors-D2bSY3Dq.js";import{s as F}from"./areas-Dvi8w2dp.js";import{c as T,h as L}from"./colors-BkWRhvFI.js";import{C as $}from"./conferenceListings-BnmhBx-_.js";import{f as w}from"./deadlines-BG5SWwEG.js";import{d as D}from"./transform-DehuZQh7.js";import{S as P}from"./skeleton-DdKViE4r.js";import{A as M,a as R}from"./alert-C-NbJX4N.js";import{s as B}from"./safeExternalHref-CkBrsh84.js";import I from"./NotFound-BeRulOFd.js";/* empty css */import"./PaperPreviewLink-Y2LI3xZW.js";import"./index-BCjs92mB.js";import"./index-mv_8ovfA.js";import"./katex-DkKDou_j.js";import"./hover-card-CqKeZcpY.js";import"./papers-BDxSKSYJ.js";import"./curation-D2sqKAqC.js";import"./useMutation-BzRfwboV.js";const ce=()=>{var g,x;const{confSlug:o}=y(),t=k({queryKey:["conference-areas-with-tasks",o],queryFn:()=>A.conferenceAreasWithTasks(o),enabled:!!o,staleTime:S}),m=_.useMemo(()=>{var a;return F(((a=t.data)==null?void 0:a.results)??[])},[t.data]),s=(g=t.data)==null?void 0:g.conference,d=((x=t.data)==null?void 0:x.total_paper_count)??0,N=$.filter(a=>{var r;return(((r=t.data)==null?void 0:r[a.countKey])??0)>0});if(C(t.error))return e.jsx(I,{});if(t.error)return e.jsx("div",{className:"page",children:e.jsx(M,{variant:"destructive",children:e.jsx(R,{children:"Failed to load conference. Please try again."})})});const p=s?w(s.start_date,s.end_date):null,u=s?[s.venue,s.location].filter(Boolean).join(", "):null,n=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:n??e.jsx(P,{className:"h-10 w-64 inline-block"})}),e.jsxs("div",{className:"feed-subtitle",style:{display:"flex",flexDirection:"column",gap:4},children:[p&&e.jsx("span",{children:p}),u&&e.jsx("span",{children:u}),(s==null?void 0:s.url)&&e.jsx("a",{href:B(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(j,{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:n?`${n} visual`:"Conference visual",onError:a=>{var r,c;(c=(r=a.currentTarget.parentElement)==null?void 0:r.parentElement)==null||c.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",n??"Conference",s.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(j,{className:"task-image-credit",text:s.image_credit})]})]})]})]}),!t.isLoading&&d>0&&e.jsx(f,{title:"Browse papers",description:"All accepted papers, plus oral, spotlight, outstanding, and best paper finalists.",meta:`${d.toLocaleString()} papers`,style:{marginTop:48},children:N.map(a=>{var r;return e.jsxs(h,{to:`/conferences/${o}/${a.slug}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:a.dotColor}}),a.label]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(((r=t.data)==null?void 0:r[a.countKey])??0).toLocaleString()," papers"]})})]},a.slug)})}),t.isLoading?e.jsx(b,{tiles:6,tileClassName:"h-24"}):m.map(a=>{const r=a.tasks;if(r.length===0)return null;const c=r.reduce((i,l)=>i+(l.paper_count||0),0);return e.jsx(f,{title:a.name,description:a.description,meta:`${r.length} ${r.length===1?"task":"tasks"} · ${c.toLocaleString()} papers`,children:r.map(i=>{const l=i.slug||"",v=T(L(l));return e.jsxs(h,{to:`/conferences/${o}/${l}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:v.dot}}),D(i.name,l)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(i.paper_count??0).toLocaleString()," papers"]})})]},i.id)})},a.id)}),e.jsx(E,{areas:m})]})};export{ce as default}; diff --git a/assets/ConferenceTaskView-DUmYfmWg.js b/assets/ConferenceTaskView-7vjNk0Qt.js similarity index 79% rename from assets/ConferenceTaskView-DUmYfmWg.js rename to assets/ConferenceTaskView-7vjNk0Qt.js index 3a2e938ff7919a4824371fa3aa480014fd1ee225..5d5a7c0289d9ab1632f8b150451caa79bedd8eb1 100644 --- a/assets/ConferenceTaskView-DUmYfmWg.js +++ b/assets/ConferenceTaskView-7vjNk0Qt.js @@ -1 +1 @@ -import{u as S,b as _,p as R,f as C,j as e,L as x,q as M,T as E}from"./index-3CfcAX6N.js";import{u as L,b as q,P as Q}from"./PaperFeed-2dSUzcA2.js";import{M as g}from"./MarkdownText-BfMP6CxP.js";import{c as F}from"./catalog-B47DuClX.js";import{p as B}from"./papers-BsYlGUQi.js";import{i as A}from"./apiErrors-XoIVpN_S.js";import{C as O}from"./conferenceListings-BnmhBx-_.js";import{t as z,d as H}from"./transform-Dx-N8Yyj.js";import{u as I}from"./usePapers-CHoHKyWP.js";import{A as K,a as $}from"./alert-BXZ4lnnf.js";import V from"./NotFound-DXa9p6DX.js";import"./PaperCard-BZtXccuT.js";import"./AuthorAvatar-DYaYcwPm.js";import"./SotaBadges-BqZMAXyY.js";import"./colors-BkWRhvFI.js";import"./Icon-C0d9p4Q2.js";import"./LatexTitle-DvPeLepK.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-Dwe6SY1f.js";import"./skeleton-CQbSjC3L.js";import"./useIntersectionObserver-wAZWG4G7.js";/* empty css */import"./PaperPreviewLink-BJAulcHJ.js";import"./index-DGr54pyn.js";import"./index-C8DcqbS3.js";import"./katex-DkKDou_j.js";import"./hover-card-DOKhkRf9.js";import"./useMutation-CKC6OFhA.js";import"./curation-BZoIvsHD.js";import"./useInfiniteQuery-DYwUEaoz.js";const D={"iclr-2026/outstanding":"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/).","icml-2026/outstanding":"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/).","cvpr-2026/best-paper-finalists":"CVPR 2026 recognized fifteen Best Paper Award finalists, including the winners. [Read the announcement](https://x.com/CVPR/status/2062912519522717978)."},Pe=()=>{var b,y,v,P,k,w;const{confSlug:t,taskSlug:n}=S(),p=L(),a=O.find(r=>r.slug===n),u=!!(a!=null&&a.award),i=_({queryKey:["conference",t],queryFn:()=>F.getConference(t),enabled:!!t,staleTime:E}),c=_({queryKey:M.task(n),queryFn:()=>F.getTask(n),enabled:!!n&&!a,staleTime:E}),l=I([...R.feeds.conference,t,n,p.filters],r=>B.forConference(t,{...p.filters,task:a?void 0:n,presentation:a==null?void 0:a.presentation,page:r,page_size:12}),{enabled:!!t}),f=C.useMemo(()=>{var r;return((r=l.data)==null?void 0:r.pages.flatMap(o=>o.results))??[]},[l.data]),h=C.useMemo(()=>f.map(z),[f]),d=(a==null?void 0:a.label)??H(((b=c.data)==null?void 0:b.name)||n||"",((y=c.data)==null?void 0:y.slug)||n),j=D[`${t}/${n}`],N=((P=(v=l.data)==null?void 0:v.pages[0])==null?void 0:P.count)??((k=i.data)==null?void 0:k.paper_count)??0,s=c.data;return A(i.error)||A(c.error)?e.jsx(V,{}):i.error||c.error||l.error?e.jsx("div",{className:"page",children:e.jsx(K,{variant:"destructive",children:e.jsx($,{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(x,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(x,{to:"/conferences",children:"Conferences"}),e.jsx("span",{children:" / "}),e.jsx(x,{to:`/conferences/${t}`,children:((w=i.data)==null?void 0:w.name)??t}),e.jsx("span",{children:" / "}),e.jsx("span",{children:d})]}),e.jsxs("div",{className:!a&&(s!=null&&s.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:a?"BROWSE PAPERS":"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:d}),j&&e.jsx(g,{className:"task-explainer",text:j}),!a&&(s==null?void 0:s.description)&&e.jsx(g,{className:"task-explainer",text:s.description}),i.data&&e.jsxs("div",{className:"task-quickstats",style:{marginTop:12},children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:N.toLocaleString()}),"PAPERS"]}),e.jsx("span",{children:i.data.name})]})]}),!a&&(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:`${d} schematic`,onError:r=>{var o,m;(m=(o=r.currentTarget.parentElement)==null?void 0:o.parentElement)==null||m.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",d,s.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(g,{className:"task-image-credit",text:s.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-section-head",children:[e.jsx("div",{className:"task-section-eyebrow",children:u?"Award papers":"Conference papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",N.toLocaleString(),"]"]})]})]}),e.jsx(q,{feed:p,sorts:u?null:void 0,children:!u&&e.jsxs("div",{className:"results-count",children:[h.length," loaded in ",e.jsx("span",{children:d})]})}),e.jsx(Q,{query:l,cards:h,empty:"No papers found for this selection.",cardHeader:r=>{var T;const o=(T=f[r])==null?void 0:T.conference_award,m=o==="outstanding"?"Outstanding Paper":o==="honorable_mention"?"Honorable Mention":o==="best_paper_finalist"&&(a==null?void 0:a.presentation)!=="best_paper_finalist"?"Best Paper Finalist":null;return m&&e.jsx("div",{className:"conference-award-label",children:m})}})]})};export{Pe as default}; +import{u as S,b as _,p as R,f as C,j as e,L as x,q as M,T as E}from"./index-CxhY4zQ1.js";import{u as L,b as q,P as Q}from"./PaperFeed-D1egUlu_.js";import{M as g}from"./MarkdownText-D0WkOxKi.js";import{c as F}from"./catalog-DCEU6WpP.js";import{p as B}from"./papers-BDxSKSYJ.js";import{i as A}from"./apiErrors-D2bSY3Dq.js";import{C as O}from"./conferenceListings-BnmhBx-_.js";import{t as z,d as H}from"./transform-DehuZQh7.js";import{u as I}from"./usePapers-Cv13R7ph.js";import{A as K,a as $}from"./alert-C-NbJX4N.js";import V from"./NotFound-BeRulOFd.js";import"./PaperCard-DeWmBrg8.js";import"./AuthorAvatar-DPz8YQ5Z.js";import"./SotaBadges-EnDhSaVO.js";import"./colors-BkWRhvFI.js";import"./Icon-XOOkUEUX.js";import"./LatexTitle-BqNrCKu8.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-DgW_tN02.js";import"./skeleton-DdKViE4r.js";import"./useIntersectionObserver-ZqjUJuPc.js";/* empty css */import"./PaperPreviewLink-Y2LI3xZW.js";import"./index-BCjs92mB.js";import"./index-mv_8ovfA.js";import"./katex-DkKDou_j.js";import"./hover-card-CqKeZcpY.js";import"./useMutation-BzRfwboV.js";import"./curation-D2sqKAqC.js";import"./useInfiniteQuery-vHEhIVF_.js";const D={"iclr-2026/outstanding":"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/).","icml-2026/outstanding":"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/).","cvpr-2026/best-paper-finalists":"CVPR 2026 recognized fifteen Best Paper Award finalists, including the winners. [Read the announcement](https://x.com/CVPR/status/2062912519522717978)."},Pe=()=>{var b,y,v,P,k,w;const{confSlug:t,taskSlug:n}=S(),p=L(),a=O.find(r=>r.slug===n),u=!!(a!=null&&a.award),i=_({queryKey:["conference",t],queryFn:()=>F.getConference(t),enabled:!!t,staleTime:E}),c=_({queryKey:M.task(n),queryFn:()=>F.getTask(n),enabled:!!n&&!a,staleTime:E}),l=I([...R.feeds.conference,t,n,p.filters],r=>B.forConference(t,{...p.filters,task:a?void 0:n,presentation:a==null?void 0:a.presentation,page:r,page_size:12}),{enabled:!!t}),f=C.useMemo(()=>{var r;return((r=l.data)==null?void 0:r.pages.flatMap(o=>o.results))??[]},[l.data]),h=C.useMemo(()=>f.map(z),[f]),d=(a==null?void 0:a.label)??H(((b=c.data)==null?void 0:b.name)||n||"",((y=c.data)==null?void 0:y.slug)||n),j=D[`${t}/${n}`],N=((P=(v=l.data)==null?void 0:v.pages[0])==null?void 0:P.count)??((k=i.data)==null?void 0:k.paper_count)??0,s=c.data;return A(i.error)||A(c.error)?e.jsx(V,{}):i.error||c.error||l.error?e.jsx("div",{className:"page",children:e.jsx(K,{variant:"destructive",children:e.jsx($,{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(x,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(x,{to:"/conferences",children:"Conferences"}),e.jsx("span",{children:" / "}),e.jsx(x,{to:`/conferences/${t}`,children:((w=i.data)==null?void 0:w.name)??t}),e.jsx("span",{children:" / "}),e.jsx("span",{children:d})]}),e.jsxs("div",{className:!a&&(s!=null&&s.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:a?"BROWSE PAPERS":"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:d}),j&&e.jsx(g,{className:"task-explainer",text:j}),!a&&(s==null?void 0:s.description)&&e.jsx(g,{className:"task-explainer",text:s.description}),i.data&&e.jsxs("div",{className:"task-quickstats",style:{marginTop:12},children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:N.toLocaleString()}),"PAPERS"]}),e.jsx("span",{children:i.data.name})]})]}),!a&&(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:`${d} schematic`,onError:r=>{var o,m;(m=(o=r.currentTarget.parentElement)==null?void 0:o.parentElement)==null||m.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",d,s.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(g,{className:"task-image-credit",text:s.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-section-head",children:[e.jsx("div",{className:"task-section-eyebrow",children:u?"Award papers":"Conference papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",N.toLocaleString(),"]"]})]})]}),e.jsx(q,{feed:p,sorts:u?null:void 0,children:!u&&e.jsxs("div",{className:"results-count",children:[h.length," loaded in ",e.jsx("span",{children:d})]})}),e.jsx(Q,{query:l,cards:h,empty:"No papers found for this selection.",cardHeader:r=>{var T;const o=(T=f[r])==null?void 0:T.conference_award,m=o==="outstanding"?"Outstanding Paper":o==="honorable_mention"?"Honorable Mention":o==="best_paper_finalist"&&(a==null?void 0:a.presentation)!=="best_paper_finalist"?"Best Paper Finalist":null;return m&&e.jsx("div",{className:"conference-award-label",children:m})}})]})};export{Pe as default}; diff --git a/assets/ConferencesIndexView-W-0wqk8I.js b/assets/ConferencesIndexView-CJ3etu5H.js similarity index 76% rename from assets/ConferencesIndexView-W-0wqk8I.js rename to assets/ConferencesIndexView-CJ3etu5H.js index 1b93e4df0e62acb6117b2eb90d224be8397d8790..e3e5436e14e7d6c590a6449c941bd4d01acde625 100644 --- a/assets/ConferencesIndexView-W-0wqk8I.js +++ b/assets/ConferencesIndexView-CJ3etu5H.js @@ -1 +1 @@ -import{b as d,f as m,j as e,L as c,T as p}from"./index-3CfcAX6N.js";import{c as u}from"./catalog-B47DuClX.js";import{f}from"./deadlines-BG5SWwEG.js";import{A as h,a as x}from"./alert-BXZ4lnnf.js";import{A as g,a as j}from"./AreaSection-Dzw2ZfXP.js";import{T as N}from"./TaxonomySuggestionTile-CvpdGHs9.js";import"./skeleton-CQbSjC3L.js";import"./SignInToEditDialog-P5ytZJBG.js";import"./button-CbnaBx6W.js";import"./input-B7wcXhgG.js";import"./textarea-CdcMknzH.js";import"./searchable-select-DBlreWDS.js";import"./popover-Dwe6SY1f.js";import"./dialog-Bbx5GVcy.js";import"./search-SnOvJVk_.js";import"./loader-circle-CMgZ_maE.js";import"./useMutation-CKC6OFhA.js";import"./submissions-D-jwpMfI.js";import"./plus-CiDEk52y.js";const 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},_=(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)},Q=()=>{const r=d({queryKey:["conferences"],queryFn:()=>u.conferences(),staleTime:p}),a=m.useMemo(()=>{var i;if(!((i=r.data)!=null&&i.results))return null;const t={};return r.data.results.forEach(n=>{const s=v(n);(t[s]||(t[s]=[])).push(n)}),Object.values(t).forEach(n=>n.sort(_)),Object.keys(t).map(Number).sort((n,s)=>s-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(x,{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(c,{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(g,{sections:2,tiles:3,tileClassName:"h-32"}):a==null?void 0:a.map(({year:t,conferences:i})=>{const n=i.reduce((s,o)=>s+(o.paper_count??0),0);return e.jsxs(j,{title:t>0?String(t):"Unknown year",meta:`${i.length} ${i.length===1?"conference":"conferences"} · ${n.toLocaleString()} papers`,children:[i.map(s=>{const o=f(s.start_date,s.end_date),l=[s.venue,s.location].filter(Boolean).join(", ");return e.jsxs(c,{to:`/conferences/${s.slug}`,className:"tag-cell",children:[e.jsx("div",{className:"name",children:s.name}),e.jsxs("div",{className:"meta",style:{display:"flex",flexDirection:"column",gap:4},children:[o&&e.jsx("span",{children:o}),l&&e.jsx("span",{children:l}),e.jsxs("span",{children:[(s.paper_count??0).toLocaleString()," papers"]})]})]},s.id)}),e.jsx(N,{kind:"conference"})]},t)})]})};export{Q as default}; +import{b as d,f as m,j as e,L as c,T as p}from"./index-CxhY4zQ1.js";import{c as u}from"./catalog-DCEU6WpP.js";import{f}from"./deadlines-BG5SWwEG.js";import{A as h,a as x}from"./alert-C-NbJX4N.js";import{A as g,a as j}from"./AreaSection-B21Mp4br.js";import{T as N}from"./TaxonomySuggestionTile-Ch_m5AUx.js";import"./skeleton-DdKViE4r.js";import"./SignInToEditDialog-0W7FFwc1.js";import"./button-BenSiukP.js";import"./input-CxKbyH9e.js";import"./textarea-uttJnDhA.js";import"./searchable-select-hPIpmCr4.js";import"./popover-DgW_tN02.js";import"./dialog-CT48f48_.js";import"./search-CkWMhIw6.js";import"./loader-circle-C5gQxAlQ.js";import"./useMutation-BzRfwboV.js";import"./submissions-DF3SD1oA.js";import"./plus-CEkdlNSn.js";const 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},_=(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)},Q=()=>{const r=d({queryKey:["conferences"],queryFn:()=>u.conferences(),staleTime:p}),a=m.useMemo(()=>{var i;if(!((i=r.data)!=null&&i.results))return null;const t={};return r.data.results.forEach(n=>{const s=v(n);(t[s]||(t[s]=[])).push(n)}),Object.values(t).forEach(n=>n.sort(_)),Object.keys(t).map(Number).sort((n,s)=>s-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(x,{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(c,{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(g,{sections:2,tiles:3,tileClassName:"h-32"}):a==null?void 0:a.map(({year:t,conferences:i})=>{const n=i.reduce((s,o)=>s+(o.paper_count??0),0);return e.jsxs(j,{title:t>0?String(t):"Unknown year",meta:`${i.length} ${i.length===1?"conference":"conferences"} · ${n.toLocaleString()} papers`,children:[i.map(s=>{const o=f(s.start_date,s.end_date),l=[s.venue,s.location].filter(Boolean).join(", ");return e.jsxs(c,{to:`/conferences/${s.slug}`,className:"tag-cell",children:[e.jsx("div",{className:"name",children:s.name}),e.jsxs("div",{className:"meta",style:{display:"flex",flexDirection:"column",gap:4},children:[o&&e.jsx("span",{children:o}),l&&e.jsx("span",{children:l}),e.jsxs("span",{children:[(s.paper_count??0).toLocaleString()," papers"]})]})]},s.id)}),e.jsx(N,{kind:"conference"})]},t)})]})};export{Q as default}; diff --git a/assets/CronDashboard-DrKxFNux.js b/assets/CronDashboard-CIUsXoy9.js similarity index 98% rename from assets/CronDashboard-DrKxFNux.js rename to assets/CronDashboard-CIUsXoy9.js index ec61d92d07a7f33c850c1bcff35d93c22741c621..5256f8e4d3229f97f4ef1e2c090456649e5b8ce5 100644 --- a/assets/CronDashboard-DrKxFNux.js +++ b/assets/CronDashboard-CIUsXoy9.js @@ -1,4 +1,4 @@ -import{c as O,f as h,N as is,B as cs,j as e,z as ie,af as ls,R as ds,O as os,E as oe,P as ms,G as us,Q as Ae,I as L,b as G,J as $,l as xe,A as Re,L as pe,a as hs,s as xs}from"./index-3CfcAX6N.js";import{u as P}from"./useMutation-CKC6OFhA.js";import{t as ge,f as v,a as S,S as Te,o as ue,C as g,b as N,c as b,d as F,e as j,g as C}from"./CronDashboard-CJXGA8w4.js";import{B as D}from"./badge-BgT1mGjP.js";import{B as y}from"./button-CbnaBx6W.js";import{C as ps,a as gs}from"./chevron-up-DgV4G0Wf.js";import{D as fe}from"./database-ut7m-SnN.js";import{T as js}from"./trending-up-BcVfaomA.js";import{A as ne}from"./activity-HTMf27Bb.js";import{F as Ne}from"./file-text-BnjsSheU.js";import{T as Ee,I as vs}from"./triangle-alert-UGq54fwL.js";import{E as Y}from"./external-link-_7BCdt0S.js";import{C as Z,R as be}from"./refresh-cw-CwE-ezgN.js";import{L as R}from"./loader-circle-CMgZ_maE.js";import{C as je}from"./circle-check-D68ytty0.js";import{c as M,A as _s}from"./codex-C7vcS1UO.js";import{u as fs}from"./useInfiniteQuery-DYwUEaoz.js";import{p as Me}from"./paperEdits-HkiQiv4C.js";import{c as me}from"./catalog-B47DuClX.js";import{c as ye}from"./chat-81nIwu_j.js";/** +import{c as O,f as h,N as is,B as cs,j as e,z as ie,af as ls,R as ds,O as os,E as oe,P as ms,G as us,Q as Ae,I as L,b as G,J as $,l as xe,A as Re,L as pe,a as hs,s as xs}from"./index-CxhY4zQ1.js";import{u as P}from"./useMutation-BzRfwboV.js";import{t as ge,f as v,a as S,S as Te,o as ue,C as g,b as N,c as b,d as F,e as j,g as C}from"./CronDashboard-D2N9pnr3.js";import{B as D}from"./badge-Dj5QKh-d.js";import{B as y}from"./button-BenSiukP.js";import{C as ps,a as gs}from"./chevron-up-ClmVTWYw.js";import{D as fe}from"./database-DTsYk9y1.js";import{T as js}from"./trending-up-BaROX4bP.js";import{A as ne}from"./activity-bP8ilshD.js";import{F as Ne}from"./file-text-42n3m1yn.js";import{T as Ee,I as vs}from"./triangle-alert-BCFuWBBz.js";import{E as Y}from"./external-link-UhGsnDEF.js";import{C as Z,R as be}from"./refresh-cw-Ddb6Y_kg.js";import{L as R}from"./loader-circle-C5gQxAlQ.js";import{C as je}from"./circle-check-CnqnwdL4.js";import{c as M,A as _s}from"./codex-Bw15uMy8.js";import{u as fs}from"./useInfiniteQuery-vHEhIVF_.js";import{p as Me}from"./paperEdits-CfQUGmNN.js";import{c as me}from"./catalog-DCEU6WpP.js";import{c as ye}from"./chat-CkiIbMG5.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/CronDashboard-CJXGA8w4.js b/assets/CronDashboard-D2N9pnr3.js similarity index 97% rename from assets/CronDashboard-CJXGA8w4.js rename to assets/CronDashboard-D2N9pnr3.js index fd4996a0a4a5a1ecd528f5ea5b5811d24f0c0ac4..3d9cd83899b78934a7ffb25f748e739892a14554 100644 --- a/assets/CronDashboard-CJXGA8w4.js +++ b/assets/CronDashboard-D2N9pnr3.js @@ -1,4 +1,4 @@ -import{c,f as a,j as r,I as n,ac as u}from"./index-3CfcAX6N.js";/** +import{c,f as a,j as r,I as n,ac as u}from"./index-CxhY4zQ1.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/ExternalSourceEvalBadge-CqK4g_y6.js b/assets/ExternalSourceEvalBadge-VjNs_cVj.js similarity index 94% rename from assets/ExternalSourceEvalBadge-CqK4g_y6.js rename to assets/ExternalSourceEvalBadge-VjNs_cVj.js index 301d7989af07bac91de907378a1eec7a39ef1b89..e0fca96f6544466b1e91f0bc95c4861ec3977e2f 100644 --- a/assets/ExternalSourceEvalBadge-CqK4g_y6.js +++ b/assets/ExternalSourceEvalBadge-VjNs_cVj.js @@ -1 +1 @@ -import{p as o}from"./curation-BZoIvsHD.js";import{ac as g,j as a,L as l}from"./index-3CfcAX6N.js";import{H as u,a as c,b as d}from"./hover-card-DOKhkRf9.js";import{s as m}from"./safeExternalHref-CkBrsh84.js";class b{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 o.primeEvaluations(e,t)}batch(e,t){return o.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});if(!r.next_page)return r.results;const n=Math.ceil(r.count/100),p=await Promise.all(Array.from({length:n-1},(i,h)=>this.list({...e,page:h+2,page_size:100})));return[r,...p].flatMap(i=>i.results)}}const w=new b(g),j=()=>a.jsxs(u,{openDelay:120,closeDelay:120,children:[a.jsx(c,{asChild:!0,children:a.jsx("button",{type:"button",className:"bm-closed-source-tag","aria-label":"Closed-source model",children:"closed"})}),a.jsxs(d,{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(l,{to:"/settings",className:"closed-eval-tooltip-link",children:"settings"}),"."]})]});function x(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 E=({sourceUrl:s})=>{const e=m(s),t=typeof s=="string"&&s.startsWith("/paper/")?s:null,r=x(s);return a.jsxs(u,{openDelay:120,closeDelay:120,children:[a.jsx(c,{asChild:!0,children:a.jsx("button",{type:"button",className:"bm-external-source-tag","aria-label":`Externally sourced evaluation: ${r}`,children:"External"})}),a.jsxs(d,{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(l,{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{j as C,E,w as e}; +import{p as o}from"./curation-D2sqKAqC.js";import{ac as g,j as a,L as l}from"./index-CxhY4zQ1.js";import{H as u,a as c,b as d}from"./hover-card-CqKeZcpY.js";import{s as m}from"./safeExternalHref-CkBrsh84.js";class b{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 o.primeEvaluations(e,t)}batch(e,t){return o.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});if(!r.next_page)return r.results;const n=Math.ceil(r.count/100),p=await Promise.all(Array.from({length:n-1},(i,h)=>this.list({...e,page:h+2,page_size:100})));return[r,...p].flatMap(i=>i.results)}}const w=new b(g),j=()=>a.jsxs(u,{openDelay:120,closeDelay:120,children:[a.jsx(c,{asChild:!0,children:a.jsx("button",{type:"button",className:"bm-closed-source-tag","aria-label":"Closed-source model",children:"closed"})}),a.jsxs(d,{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(l,{to:"/settings",className:"closed-eval-tooltip-link",children:"settings"}),"."]})]});function x(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 E=({sourceUrl:s})=>{const e=m(s),t=typeof s=="string"&&s.startsWith("/paper/")?s:null,r=x(s);return a.jsxs(u,{openDelay:120,closeDelay:120,children:[a.jsx(c,{asChild:!0,children:a.jsx("button",{type:"button",className:"bm-external-source-tag","aria-label":`Externally sourced evaluation: ${r}`,children:"External"})}),a.jsxs(d,{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(l,{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{j as C,E,w as e}; diff --git a/assets/FeedView-T5hkRnNT.js b/assets/FeedView-C8zGqRsW.js similarity index 94% rename from assets/FeedView-T5hkRnNT.js rename to assets/FeedView-C8zGqRsW.js index ccc11015d32d1f83e06bf8c6cef20f062e9b8072..f53ce8b94999a42dccf297fa41d84853e0ec4a65 100644 --- a/assets/FeedView-T5hkRnNT.js +++ b/assets/FeedView-C8zGqRsW.js @@ -1 +1 @@ -import{j as e,L as E,a as ze,g as Be,b as B,f as m,C as Se,h as Ke,T as J,r as Ae,k as De,d as Ue,e as Ge,p as ke,l as Qe,i as We,m as ge,n as Re,o as Ye,q as Xe}from"./index-3CfcAX6N.js";import{S as Ze}from"./sparkles-BY8EsDI7.js";import{D as Ve,a as Je,b as es}from"./dialog-Bbx5GVcy.js";import{c as de}from"./catalog-B47DuClX.js";import{d as Me,e as Ie,f as qe,b as ss,g as $e,h as fe,i as Te,j as ts,k as as,r as be,t as os,a as is,l as ns,m as Pe,n as _e,o as rs}from"./researchTopic-Z4AJDMN7.js";import{d as xe,t as ls}from"./transform-Dx-N8Yyj.js";import{P as Ce}from"./plus-CiDEk52y.js";import{A as cs}from"./arrow-right-U4Mftc_z.js";import{r as ds,a as us,w as hs,P as ps}from"./PaperFeed-2dSUzcA2.js";import{M as ms}from"./McpShowcase-CcyaF6wZ.js";import{u as gs,a as fs,P as xs,i as bs,A as ws,b as js,S as z,c as ys,D as ue,q as vs,d as Ns}from"./chatSessions-C9fOk1AR.js";import{c as Ss}from"./chat-81nIwu_j.js";import{u as ks}from"./usePapers-CHoHKyWP.js";import{p as Ts}from"./papers-BsYlGUQi.js";import{S as he}from"./skeleton-CQbSjC3L.js";import{A as pe,a as me}from"./alert-BXZ4lnnf.js";import"./useMutation-CKC6OFhA.js";import"./PaperCard-BZtXccuT.js";import"./AuthorAvatar-DYaYcwPm.js";import"./SotaBadges-BqZMAXyY.js";import"./colors-BkWRhvFI.js";import"./Icon-C0d9p4Q2.js";import"./LatexTitle-DvPeLepK.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-Dwe6SY1f.js";import"./useIntersectionObserver-wAZWG4G7.js";import"./AgentLogos-06t31xxf.js";import"./useInfiniteQuery-DYwUEaoz.js";import"./curation-BZoIvsHD.js";function Ps({onBuild:h}){return e.jsxs("section",{className:"following-intro","aria-labelledby":"following-intro-title",children:[e.jsx("h2",{id:"following-intro-title",children:"Build your personal research feed"}),e.jsx("p",{className:"following-intro-lead",children:"Describe topics in your own words, or follow the tasks, benchmarks, authors, and organizations you care about, and this page collects their latest papers and results in one place."}),h&&e.jsxs("button",{type:"button",className:"research-topic-save following-intro-topic",onClick:h,children:[e.jsx(Ze,{"aria-hidden":"true"}),"Build your feed"]}),e.jsxs("p",{className:"following-intro-note",children:["Matching papers also arrive as a weekly email, which you can turn off in"," ",e.jsx(E,{to:"/settings",children:"Settings"}),"."]})]})}const Ee=16;function _s({open:h,topicId:i=null,onOpenChange:n}){return e.jsx(Ve,{open:h,onOpenChange:n,children:e.jsx(Je,{className:"topic-dialog","aria-describedby":void 0,children:e.jsx(Cs,{topicId:i,onDone:()=>n(!1)},i??"new")})})}function Cs({topicId:h,onDone:i}){var ne,re,$,Y,ee,O,X,se,le,ce;const{user:n}=ze(),u=Be(),a=Me(),g=Ie(),j=B({queryKey:["trending-tasks-follow"],queryFn:()=>de.trendingTasks({limit:Ee,level:0}),staleTime:J}),p=B({queryKey:["trending-methods-follow"],queryFn:()=>de.trendingMethods({limit:Ee}),staleTime:J}),T=B({queryKey:["research-follow-suggestions"],queryFn:be.followSuggestions,staleTime:J}),P=(t=[])=>t.map(d=>({id:String(d.entity_id),name:d.name,image:d.image_url})),[A,F]=m.useState(null),[C,R]=m.useState([]),[q,M]=m.useState([]),c=qe(),v=ss(),N=$e(),l=(ne=a.data)==null?void 0:ne.find(t=>t.id===h),L=((re=a.data)==null?void 0:re.filter(t=>t.id!==h))??[],o=q.filter(t=>L.some(d=>d.id===t)),f=(l==null?void 0:l.text)??"",b=A??f,S=b.trim().replace(/\s+/g," "),k=(l==null?void 0:l.status)==="failed"&&S===f,K=!l&&((($=a.data)==null?void 0:$.length)??0)-o.length>=fe,U=S.length>=3&&(S!==f||k)&&!K,I=c.isPending||v.isPending||N.isPending,G=(t,d)=>{var y;return((y=g.data)==null?void 0:y.some(w=>w.kind===t&&String(w.entity_id)===d))??!1},Q=(t,d)=>{var y;return((y=C.find(w=>w.kind===t&&w.id===d))==null?void 0:y.follow)??G(t,d)},D=C.filter(t=>t.follow!==G(t.kind,t.id)),W=!I&&(U||D.length>0||o.length>0),oe=(t,d,y)=>R(w=>[...w.filter(Z=>Z.kind!==t||Z.id!==d),{kind:t,id:d,name:y,follow:!Q(t,d)}]),ie=()=>{if(!W)return;if(!n){U&&ts(S),D.length&&as(D),window.location.href=Ke(`${u.pathname}${u.search}`);return}const t=o.length?v.mutateAsync(o):Promise.resolve(),d=[...D.length?[N.mutateAsync(D)]:[],t,...U?[t.catch(()=>{}).then(()=>c.mutateAsync({id:l==null?void 0:l.id,text:S}))]:[]];Promise.allSettled(d).then(y=>{y.every(w=>w.status==="fulfilled")&&i()})},H=(t,d,y,w)=>{const te=[...(g.data??[]).filter(x=>x.kind===d).map(x=>({id:String(x.entity_id),name:x.name,slug:x.url.split("/").pop(),image:x.image_url})),...y.filter(x=>!G(d,x.id)).map(x=>({...x,suggested:!0}))];return te.length>0&&e.jsxs("div",{className:"topic-dialog-group",children:[e.jsx("h3",{children:t}),e.jsxs(Es,{children:[te.map(x=>{const ae=Q(d,x.id),V=d==="task"?xe(x.name,x.slug??void 0):x.name;return e.jsxs("button",{type:"button",className:"topic-dialog-chip","aria-pressed":ae,disabled:I,"data-suggested":"suggested"in x||void 0,onClick:()=>oe(d,x.id,V),children:[ae?e.jsx(Se,{"aria-hidden":"true"}):e.jsx(Ce,{"aria-hidden":"true"}),(d==="author"||d==="organization")&&e.jsx(Fs,{kind:d,name:V,src:x.image}),V]},x.id)}),w&&e.jsxs(E,{to:w.to,className:"topic-dialog-browse",children:[w.label,e.jsx(cs,{"aria-hidden":"true"})]})]})]})};return e.jsxs("form",{className:"topic-dialog-form",onSubmit:t=>{t.preventDefault(),ie()},children:[e.jsx(es,{className:"topic-dialog-title",children:(Y=a.data)!=null&&Y.length||(ee=g.data)!=null&&ee.length?"Edit your research feed":"Build your research feed"}),e.jsxs("div",{className:"topic-dialog-group",children:[e.jsx("h3",{children:e.jsx("label",{htmlFor:"topic-dialog-input",children:l?"Edit this topic":(O=a.data)!=null&&O.length?"Add a topic in your own words":"Describe a topic in your own words"})}),e.jsx("p",{className:"topic-dialog-hint",children:K?`You follow ${fe} topics, the most allowed. Remove one below to add another.`:"A model reads every new paper and adds the ones that match to your Following feed. New topics are public and show your Hugging Face username; make one private in Settings."}),e.jsx("textarea",{id:"topic-dialog-input",className:"research-topic-input",rows:4,maxLength:Te,"aria-label":"Research topic",placeholder:"e.g. diffusion policies for robot manipulation, or speculative decoding for LLM inference",value:b,onChange:t=>F(t.target.value),onKeyDown:t=>{t.key==="Enter"&&!t.shiftKey&&!t.nativeEvent.isComposing&&(t.preventDefault(),ie())}}),e.jsxs("span",{className:"research-topic-count",children:[b.length,"/",Te]})]}),L.length>0&&e.jsxs("div",{className:"topic-dialog-group",children:[e.jsx("h3",{children:l?"Your other topics":"Your topics"}),e.jsx("div",{className:"topic-dialog-chips",children:L.map(t=>{const d=!q.includes(t.id);return e.jsxs("button",{type:"button",className:"topic-dialog-chip","aria-pressed":d,disabled:I,title:t.text,onClick:()=>M(y=>d?[...y,t.id]:y.filter(w=>w!==t.id)),children:[d?e.jsx(Se,{"aria-hidden":"true"}):e.jsx(Ce,{"aria-hidden":"true"}),t.label??t.text]},t.id)})})]}),H("Trending tasks","task",((X=j.data)==null?void 0:X.results)??[],{to:"/tasks",label:"Browse tasks"}),H("Trending methods","method",((se=p.data)==null?void 0:se.results)??[],{to:"/methods",label:"Browse methods"}),H("Benchmarks","benchmark",[],{to:"/tasks",label:"Browse benchmarks"}),H("Popular authors","author",P((le=T.data)==null?void 0:le.authors)),H("Popular organizations","organization",P((ce=T.data)==null?void 0:ce.organizations),{to:"/organizations",label:"Browse organizations"}),(c.error||v.error||N.error)&&e.jsx("p",{className:"settings-token-error",role:"alert",children:"Could not save your feed. Please try again."}),e.jsxs("div",{className:"topic-dialog-actions",children:[l&&e.jsx("button",{type:"button",className:"research-follow-action topic-dialog-remove",disabled:I,onClick:()=>v.mutate([l.id],{onSuccess:i}),children:"Remove topic"}),e.jsx("button",{type:"button",className:"research-follow-action",disabled:I,onClick:i,children:"Cancel"}),e.jsx("button",{type:"submit",className:"research-topic-save",disabled:!W,children:D.some(t=>t.follow===!1)||o.length?"Save":D.length?"Follow":k?"Retry":l?"Update topic":"Follow"})]})]})}function Es({children:h}){const i=m.useRef(null);return m.useLayoutEffect(()=>{const n=i.current;if(!n)return;const u=()=>{const a=[...n.children],g=a.filter(p=>p.dataset.suggested);g.forEach(p=>{p.hidden=!1});const j=()=>new Set(a.filter(p=>!p.hidden).map(p=>p.offsetTop)).size;for(let p=g.length-1;p>=0&&j()>2;p--)g[p].hidden=!0};return u(),window.addEventListener("resize",u),()=>window.removeEventListener("resize",u)}),e.jsx("div",{ref:i,className:"topic-dialog-chips",children:h})}function Fs({kind:h,name:i,src:n}){const[u,a]=m.useState(!1);if(n&&!u)return e.jsx("img",{className:`topic-dialog-chip-image is-${h}`,src:n,alt:"",loading:"lazy",onError:()=>a(!0)});if(h!=="author")return null;const g=i.split(/\s+/).filter(Boolean).map(j=>j[0]).slice(0,2).join("").toUpperCase();return e.jsx("span",{className:"topic-dialog-chip-image is-author is-initials","aria-hidden":"true",children:g})}function Ls(){var i;const h=B({queryKey:Ae.featuredTopics,queryFn:be.featuredTopics,staleTime:J});return(i=h.data)!=null&&i.length?e.jsx("nav",{className:"topic-bubbles","aria-label":"Popular topics",children:h.data.map(n=>e.jsxs(E,{className:"topic-bubble",to:is(n),title:`${n.followers.toLocaleString()} ${n.followers===1?"follower":"followers"}`,children:[n.creator&&e.jsx("img",{src:n.creator.avatar_url,alt:"",width:20,height:20,loading:"lazy"}),e.jsx("span",{className:"topic-bubble-name",children:os(n)}),n.creator&&e.jsxs("span",{className:"topic-bubble-creator",children:["@",n.creator.username]})]},n.id))}):null}const Fe=45,As=1800,Ds=25,Rs=350,Ms=h=>{const[i,n]=m.useState(z[0].slice(0,1)),[u,a]=m.useState(0);return m.useEffect(()=>{var A,F;if(!h)return;if((F=(A=window.matchMedia)==null?void 0:A.call(window,"(prefers-reduced-motion: reduce)"))!=null&&F.matches){n(z[0]),a(0);return}let g=0,j=1,p=!1,T;n(z[0].slice(0,j)),a(0);const P=()=>{const C=z[g];if(!p){if(j+=1,n(C.slice(0,j)),j===C.length){p=!0,T=window.setTimeout(P,As);return}T=window.setTimeout(P,Fe);return}if(j-=1,n(C.slice(0,j)),j===0){p=!1,g=(g+1)%z.length,a(g),T=window.setTimeout(P,Rs);return}T=window.setTimeout(P,Ds)};return T=window.setTimeout(P,Fe),()=>window.clearTimeout(T)},[h]),{placeholder:i,prompt:z[u]}},Is=()=>{var L;const h=De(),i=Re(),[n,u]=m.useState({text:"",paperMentions:[]}),a=n.text,[g,j]=m.useState(0),[p,T]=m.useState(!1),[P,A]=m.useState(null),{placeholder:F,prompt:C}=Ms(!a),R=m.useRef(null),q=B({queryKey:["chatAvailability"],queryFn:()=>Ss.getAvailability(),retry:!1,enabled:ge()}),M=ge()&&((L=q.data)==null?void 0:L.paper_mentions_enabled)!==!1,c=gs({draft:n,onChange:u,enabled:M,textareaRef:R}),v=fs(n,c.open),N=a?v.completion:C;m.useLayoutEffect(()=>{const o=R.current;if(!o)return;const f=()=>{if(o.style.height="auto",a){o.style.height=`${Math.min(ys(o),160)}px`;return}const b=o.placeholder,S=z.reduce((k,K)=>(o.placeholder=K,Math.max(k,o.scrollHeight)),0);o.placeholder=b,o.style.height=`${Math.min(S,160)}px`};return f(),window.addEventListener("resize",f),()=>window.removeEventListener("resize",f)},[a,N]);const l=async(o=n)=>{const f=o.text.trim();if(!(!f||p)){if(i){const b=new URLSearchParams({q:f,model:ue}),S=`${Ye}?${b}`,k=window.open(S,"_blank");if(!k){A(S);return}k.opener=null,A(null),u({text:"",paperMentions:[]});return}T(!0),vs(o,ue);try{const b=await Ns(ue);h(`/chat/${b.id}`)}catch{h("/chat")}}};return e.jsxs(e.Fragment,{children:[!i&&e.jsx("div",{className:"ask-home-new",children:"Hint: type @ to bring papers into context, or press Tab to use a suggestion"}),e.jsxs("div",{className:"ask-home",children:[e.jsxs("div",{className:"ask-home-row",children:[e.jsxs("div",{className:"ask-home-textarea-wrap",children:[e.jsx(xs,{text:n.text,mentions:n.paperMentions,scrollTop:g,variant:"home",completion:a?N:""}),e.jsx("textarea",{ref:R,rows:1,value:a,placeholder:F,"aria-label":"Ask the assistant",disabled:p,onChange:o=>{c.updateText(o.target.value,o.target.selectionStart),v.trackCaret(o.target)},onSelect:o=>{c.refresh(o.currentTarget.selectionStart),v.trackCaret(o.currentTarget)},onClick:o=>{c.refresh(o.currentTarget.selectionStart),v.trackCaret(o.currentTarget)},onScroll:o=>j(o.currentTarget.scrollTop),onBlur:o=>{var f,b;(b=(f=o.relatedTarget)==null?void 0:f.closest)!=null&&b.call(f,".chat-paper-picker")||window.setTimeout(c.close,0)},onKeyDown:o=>{if(!c.keyDown(o)){if(bs(o)&&N){o.preventDefault();const f=a+N;c.updateText(f,f.length),window.requestAnimationFrame(()=>{var b;return(b=R.current)==null?void 0:b.setSelectionRange(f.length,f.length)});return}o.key==="Enter"&&!o.shiftKey&&(o.preventDefault(),l())}},role:M?"combobox":void 0,"aria-expanded":M?c.open:void 0,"aria-controls":c.open?c.pickerId:void 0,"aria-activedescendant":c.open&&c.results.length?`${c.optionIdPrefix}-${c.activeIndex}`:void 0,"aria-autocomplete":M?"list":void 0,"aria-describedby":c.message?"ask-home-paper-mention-message":void 0})]}),e.jsx("button",{type:"button",className:`chat-send${a.trim()?" chat-send-on":""}`,onClick:()=>void l(),disabled:!a.trim()||p,"aria-label":"Ask the assistant",children:e.jsx(ws,{})})]}),P&&e.jsx("div",{className:"chat-paper-mention-message",role:"alert",children:e.jsx("a",{href:P,target:"_blank",rel:"noreferrer",children:"Open this question on paperswithcode.co"})}),c.message&&e.jsx("div",{id:"ask-home-paper-mention-message",className:"chat-paper-mention-message",role:"alert",children:c.message}),e.jsx(js,{open:c.open,query:c.query,results:c.results,activeIndex:c.activeIndex,loading:c.loading,error:c.error,onSelect:c.select,id:c.pickerId,optionIdPrefix:c.optionIdPrefix})]})]})},Oe={task:"Tasks",method:"Methods",benchmark:"Benchmarks",author:"Authors",organization:"Orgs"},qs=Object.keys(Oe),$s=30,Le=40,Os=async h=>{const i=await h;return{results:i.results.map(n=>({paper:n})),next_page:i.next_page}},Hs=({mode:h})=>{var y,w,Z,te,x,ae,V,we,je,ye,ve,Ne;const i=h==="following",n=De(),u=Ue(),a=u==null?void 0:u.user,[g,j]=Ge(),p=ds(g,void 0,h==="trending"?"week":"month"),T=s=>{const r=new URLSearchParams(g);r.delete("order_by"),r.delete("only"),r.delete("topic");const _=r.toString();n(_?`${s}?${_}`:s)},P=s=>{const r=new URLSearchParams(g);r.delete("only"),s===null?r.delete("topic"):r.set("topic",String(s));const _=r.toString();return _?`/following?${_}`:"/following"},A=B({queryKey:Xe.topTasksSidebar,queryFn:()=>de.topTasks(8),staleTime:J}),F=B({queryKey:["trending-tasks-sidebar"],queryFn:()=>de.trendingTasks({limit:8,level:0,min_recent_papers:10}),staleTime:J}),C=i&&g.get("only")==="topic",R=i?Number(g.get("topic")??NaN):NaN,q=Number.isInteger(R)?R:void 0,M={start_date:p.startDate,end_date:p.endDate},c={...p,topicOnly:C,topicId:q},v=ks(i?[...ke.feeds.following,a==null?void 0:a.hf_subject,c]:[...ke.feeds.trending,M],async s=>{if(i){const _=await be.following(s,c),He=_.length===Le?s+Le:null;return{results:_,next_page:He}}const r={...M,page:s,page_size:$s,include_resources:!0};return Os(Ts.list({...r,order_by:"trending",order_dir:"desc",latest_only:!0}))},{enabled:!i||!!a,initialPage:i?0:1}),N=Ie(i),l=Me(i,1e4),L=s=>s.label??s.text,o=((y=l.data)==null?void 0:y.filter(ns))??[],f=o.length>0,b=(w=l.data)==null?void 0:w.find(s=>s.id===q),[S,k]=m.useState(void 0),K=(((Z=l.data)==null?void 0:Z.length)??0)s.id).join(","),G=m.useRef([]);m.useEffect(()=>{const s=I?I.split(","):[];G.current.some(r=>!s.includes(r))&&U.invalidateQueries({queryKey:Ae.feed(a==null?void 0:a.hf_subject)}),G.current=s},[I,U,a==null?void 0:a.hf_subject]);const Q=i&&!!a&&((te=N.data)==null?void 0:te.length)===0&&l.isSuccess&&l.data.length===0,D=i&&!(u!=null&&u.isLoading)&&!a||Q,W=!!a||!We(),[oe,ie]=m.useState(!1),[H]=m.useState(()=>!!Pe()||_e().length>0),[ne,re]=m.useState(!1);!oe&&((x=l.data)!=null&&x.length||(ae=N.data)!=null&&ae.length)&&ie(!0),D&&!ne&&(re(!0),W&&!oe&&!H&&k(null));const $=qe(),{mutate:Y}=$,ee=m.useRef(!1);m.useEffect(()=>{const s=Pe();!a||!l.isSuccess||!s||ee.current||(ee.current=!0,l.data.some(r=>r.text===s)?rs():Y({text:s}))},[a,l.isSuccess,l.data,Y]);const O=$e(),{mutate:X}=O,se=m.useRef(!1);m.useEffect(()=>{const s=_e();!a||!s.length||se.current||(se.current=!0,X(s))},[a,X]);const le=m.useMemo(()=>qs.map(s=>{var r;return{kind:s,follows:i?((r=N.data)==null?void 0:r.filter(_=>_.kind===s))??[]:[]}}).filter(s=>s.follows.length>0),[i,N.data]),ce=i&&(!!(u!=null&&u.isLoading)||!!a&&!Q),t=m.useMemo(()=>{var s;return((s=v.data)==null?void 0:s.pages.flatMap(r=>r.results.map(_=>({...ls(_.paper),followReasons:_.reasons}))))??[]},[v.data]),d=v.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 feed-sidebar",children:[ce?e.jsxs("div",{className:"sidebar-section sidebar-section-follows",children:[e.jsx("div",{className:"sidebar-label",children:"You follow"}),((u==null?void 0:u.isLoading)||N.isLoading)&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:4}).map((s,r)=>e.jsx(he,{className:"h-5 w-full"},r))}),N.isError&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"Couldn't load your follows."}),e.jsxs("div",{className:"sidebar-links",children:[!!((V=l.data)!=null&&V.length)&&e.jsxs("div",{className:"sidebar-follow-group sidebar-follow-topics",children:[e.jsx("span",{className:"sidebar-follow-kind",children:l.data.length===1?"Topic":"Topics"}),l.data.map(s=>{const r=s.id===q;return e.jsxs("div",{className:`sidebar-follow-topic ${r?"active":""}`,children:[e.jsx(E,{to:P(r?null:s.id),className:"sidebar-link sidebar-follow-link",title:r?"Show papers from everything you follow":`Show only papers about “${s.text}”`,"aria-current":r?"true":void 0,children:e.jsx("span",{className:"sidebar-follow-name",children:L(s)})}),e.jsx("button",{type:"button",className:"sidebar-follow-edit","aria-label":`Edit topic ${L(s)}`,"aria-expanded":S===s.id,onClick:()=>k(s.id),children:"edit"})]},s.id)}),K&&e.jsx("button",{type:"button",className:"sidebar-follow-add","aria-expanded":S===null,onClick:()=>k(null),children:"+ Add topic"})]}),le.map(s=>e.jsxs("div",{className:"sidebar-follow-group",children:[e.jsx("span",{className:"sidebar-follow-kind",children:Oe[s.kind]}),s.follows.map(r=>e.jsx(E,{to:r.url,className:"sidebar-link sidebar-follow-link",children:e.jsx("span",{className:"sidebar-follow-name",children:r.name})},r.entity_id))]},s.kind))]}),e.jsx(E,{to:"/settings",className:"sidebar-follow-manage",children:"Manage in Settings"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"sidebar-section sidebar-section-top-domains",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,r)=>e.jsx(he,{className:"h-5 w-full"},r))}),e.jsxs("div",{className:"sidebar-links",children:[(we=A.data)==null?void 0:we.map(s=>e.jsxs(E,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[xe(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(E,{to:"/tasks",className:"sidebar-link sidebar-link-more",children:"all domains →"})]})]}),e.jsxs("div",{className:"sidebar-section sidebar-section-trending-domains",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),F.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,r)=>e.jsx(he,{className:"h-5 w-full"},r))}),((ye=(je=F.data)==null?void 0:je.results)==null?void 0:ye.length)===0&&!F.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),e.jsx("div",{className:"sidebar-links",children:(Ne=(ve=F.data)==null?void 0:ve.results)==null?void 0:Ne.map(s=>e.jsxs(E,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[xe(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))})]})]}),e.jsx(ms,{})]}),e.jsxs("div",{className:"feed-main",children:[(ge()||Re())&&e.jsx("div",{className:"feed-chat",children:e.jsx(Is,{})}),e.jsxs("div",{className:"feed-content",children:[e.jsxs("div",{className:"sort-bar home-feed-sort-bar",children:[e.jsx("div",{className:"paper-feed-toolbar-controls",children:e.jsxs("div",{className:"sort-options",children:[e.jsx("button",{className:`sort-btn ${h==="trending"?"active":""}`,onClick:()=>T("/"),children:"trending"}),e.jsx("button",{className:`sort-btn ${i?"active":""}`,onClick:()=>T("/following"),children:"following"})]})}),e.jsx(us,{startDate:p.startDate,endDate:p.endDate,onChange:s=>j(hs(g,s))})]}),e.jsx(Ls,{}),d&&e.jsx(pe,{variant:"destructive",className:"mb-4",children:e.jsxs(me,{children:["Failed to load papers. ",e.jsx("button",{type:"button",onClick:()=>void v.refetch(),children:"Try again"})]})}),$.isError&&$.variables&&e.jsx(pe,{variant:"destructive",className:"mb-4",children:e.jsxs(me,{children:["Could not follow “",$.variables.text,"”. ",e.jsx("button",{type:"button",onClick:()=>Y($.variables),children:"Try again"})]})}),O.isError&&O.variables&&e.jsx(pe,{variant:"destructive",className:"mb-4",children:e.jsxs(me,{children:["Could not follow ",O.variables.map(s=>s.name).join(", "),". ",e.jsx("button",{type:"button",onClick:()=>X(O.variables),children:"Try again"})]})}),i&&!!a&&l.isSuccess&&!N.isPending&&!Q&&(l.data.length===0?e.jsxs("div",{className:"following-topic-note",role:"status",children:["Describe a topic in your own words, and a model adds matching new papers to this feed."," ",e.jsx("button",{type:"button",className:"link-button",onClick:()=>k(null),children:"Follow a topic"})]}):f?e.jsxs("div",{className:"following-topic-note",role:"status",children:["Showing the closest papers about ",o.map(s=>`“${L(s)}”`).join(" and ")," now. A model is reading papers to refine these matches, which takes a few minutes."]}):null),i&&W&&e.jsx(_s,{open:S!==void 0,topicId:S??null,onOpenChange:s=>{s||k(void 0)}}),(C||b)&&e.jsxs("div",{className:"following-topic-note following-topic-filter",role:"status",children:["Showing only papers about ",b?`“${L(b)}”`:"your topics","."," ",e.jsx(E,{to:P(null),children:"Show everything you follow"})]}),D?e.jsx(Ps,{onBuild:W?()=>k(null):void 0}):e.jsx(ps,{query:v,isLoading:v.isLoading||i&&!!(u!=null&&u.isLoading),cards:t,skeleton:"card",rootMargin:"400px",empty:d?null:b?e.jsxs(e.Fragment,{children:["No papers about this topic match these filters. Widen the date range or ",e.jsx("button",{type:"button",className:"link-button",onClick:()=>k(b.id),children:"edit the topic"}),"."]}):C?e.jsx(e.Fragment,{children:"No papers about your topics match these filters. Widen the date range or follow more topics."}):i?e.jsxs(e.Fragment,{children:["No papers from your topics or follows match these filters. Widen the date range, or follow more from ",e.jsx(E,{to:"/tasks",children:"tasks"}),", ",e.jsx(E,{to:"/methods",children:"methods"}),", benchmark, author, or organization pages."]}):"No papers in this window."})]})]})]})]})},xt=()=>e.jsx(Hs,{mode:"trending"});export{Is as AskAssistant,Hs as HomeFeed,xt as default}; +import{j as e,L as E,a as ze,g as Be,b as B,f as m,C as Se,h as Ke,T as J,r as Ae,k as De,d as Ue,e as Ge,p as ke,l as Qe,i as We,m as ge,n as Re,o as Ye,q as Xe}from"./index-CxhY4zQ1.js";import{S as Ze}from"./sparkles-CBme4WI-.js";import{D as Ve,a as Je,b as es}from"./dialog-CT48f48_.js";import{c as de}from"./catalog-DCEU6WpP.js";import{d as Me,e as Ie,f as qe,b as ss,g as $e,h as fe,i as Te,j as ts,k as as,r as be,t as os,a as is,l as ns,m as Pe,n as _e,o as rs}from"./researchTopic-DXZVIvAq.js";import{d as xe,t as ls}from"./transform-DehuZQh7.js";import{P as Ce}from"./plus-CEkdlNSn.js";import{A as cs}from"./arrow-right-BwBMsu3P.js";import{r as ds,a as us,w as hs,P as ps}from"./PaperFeed-D1egUlu_.js";import{M as ms}from"./McpShowcase-CXm3UZ_U.js";import{u as gs,a as fs,P as xs,i as bs,A as ws,b as js,S as z,c as ys,D as ue,q as vs,d as Ns}from"./chatSessions-DjtMpqHz.js";import{c as Ss}from"./chat-CkiIbMG5.js";import{u as ks}from"./usePapers-Cv13R7ph.js";import{p as Ts}from"./papers-BDxSKSYJ.js";import{S as he}from"./skeleton-DdKViE4r.js";import{A as pe,a as me}from"./alert-C-NbJX4N.js";import"./useMutation-BzRfwboV.js";import"./PaperCard-DeWmBrg8.js";import"./AuthorAvatar-DPz8YQ5Z.js";import"./SotaBadges-EnDhSaVO.js";import"./colors-BkWRhvFI.js";import"./Icon-XOOkUEUX.js";import"./LatexTitle-BqNrCKu8.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-DgW_tN02.js";import"./useIntersectionObserver-ZqjUJuPc.js";import"./AgentLogos-C9q7zZc4.js";import"./useInfiniteQuery-vHEhIVF_.js";import"./curation-D2sqKAqC.js";function Ps({onBuild:h}){return e.jsxs("section",{className:"following-intro","aria-labelledby":"following-intro-title",children:[e.jsx("h2",{id:"following-intro-title",children:"Build your personal research feed"}),e.jsx("p",{className:"following-intro-lead",children:"Describe topics in your own words, or follow the tasks, benchmarks, authors, and organizations you care about, and this page collects their latest papers and results in one place."}),h&&e.jsxs("button",{type:"button",className:"research-topic-save following-intro-topic",onClick:h,children:[e.jsx(Ze,{"aria-hidden":"true"}),"Build your feed"]}),e.jsxs("p",{className:"following-intro-note",children:["Matching papers also arrive as a weekly email, which you can turn off in"," ",e.jsx(E,{to:"/settings",children:"Settings"}),"."]})]})}const Ee=16;function _s({open:h,topicId:i=null,onOpenChange:n}){return e.jsx(Ve,{open:h,onOpenChange:n,children:e.jsx(Je,{className:"topic-dialog","aria-describedby":void 0,children:e.jsx(Cs,{topicId:i,onDone:()=>n(!1)},i??"new")})})}function Cs({topicId:h,onDone:i}){var ne,re,$,Y,ee,O,X,se,le,ce;const{user:n}=ze(),u=Be(),a=Me(),g=Ie(),j=B({queryKey:["trending-tasks-follow"],queryFn:()=>de.trendingTasks({limit:Ee,level:0}),staleTime:J}),p=B({queryKey:["trending-methods-follow"],queryFn:()=>de.trendingMethods({limit:Ee}),staleTime:J}),T=B({queryKey:["research-follow-suggestions"],queryFn:be.followSuggestions,staleTime:J}),P=(t=[])=>t.map(d=>({id:String(d.entity_id),name:d.name,image:d.image_url})),[A,F]=m.useState(null),[C,R]=m.useState([]),[q,M]=m.useState([]),c=qe(),v=ss(),N=$e(),l=(ne=a.data)==null?void 0:ne.find(t=>t.id===h),L=((re=a.data)==null?void 0:re.filter(t=>t.id!==h))??[],o=q.filter(t=>L.some(d=>d.id===t)),f=(l==null?void 0:l.text)??"",b=A??f,S=b.trim().replace(/\s+/g," "),k=(l==null?void 0:l.status)==="failed"&&S===f,K=!l&&((($=a.data)==null?void 0:$.length)??0)-o.length>=fe,U=S.length>=3&&(S!==f||k)&&!K,I=c.isPending||v.isPending||N.isPending,G=(t,d)=>{var y;return((y=g.data)==null?void 0:y.some(w=>w.kind===t&&String(w.entity_id)===d))??!1},Q=(t,d)=>{var y;return((y=C.find(w=>w.kind===t&&w.id===d))==null?void 0:y.follow)??G(t,d)},D=C.filter(t=>t.follow!==G(t.kind,t.id)),W=!I&&(U||D.length>0||o.length>0),oe=(t,d,y)=>R(w=>[...w.filter(Z=>Z.kind!==t||Z.id!==d),{kind:t,id:d,name:y,follow:!Q(t,d)}]),ie=()=>{if(!W)return;if(!n){U&&ts(S),D.length&&as(D),window.location.href=Ke(`${u.pathname}${u.search}`);return}const t=o.length?v.mutateAsync(o):Promise.resolve(),d=[...D.length?[N.mutateAsync(D)]:[],t,...U?[t.catch(()=>{}).then(()=>c.mutateAsync({id:l==null?void 0:l.id,text:S}))]:[]];Promise.allSettled(d).then(y=>{y.every(w=>w.status==="fulfilled")&&i()})},H=(t,d,y,w)=>{const te=[...(g.data??[]).filter(x=>x.kind===d).map(x=>({id:String(x.entity_id),name:x.name,slug:x.url.split("/").pop(),image:x.image_url})),...y.filter(x=>!G(d,x.id)).map(x=>({...x,suggested:!0}))];return te.length>0&&e.jsxs("div",{className:"topic-dialog-group",children:[e.jsx("h3",{children:t}),e.jsxs(Es,{children:[te.map(x=>{const ae=Q(d,x.id),V=d==="task"?xe(x.name,x.slug??void 0):x.name;return e.jsxs("button",{type:"button",className:"topic-dialog-chip","aria-pressed":ae,disabled:I,"data-suggested":"suggested"in x||void 0,onClick:()=>oe(d,x.id,V),children:[ae?e.jsx(Se,{"aria-hidden":"true"}):e.jsx(Ce,{"aria-hidden":"true"}),(d==="author"||d==="organization")&&e.jsx(Fs,{kind:d,name:V,src:x.image}),V]},x.id)}),w&&e.jsxs(E,{to:w.to,className:"topic-dialog-browse",children:[w.label,e.jsx(cs,{"aria-hidden":"true"})]})]})]})};return e.jsxs("form",{className:"topic-dialog-form",onSubmit:t=>{t.preventDefault(),ie()},children:[e.jsx(es,{className:"topic-dialog-title",children:(Y=a.data)!=null&&Y.length||(ee=g.data)!=null&&ee.length?"Edit your research feed":"Build your research feed"}),e.jsxs("div",{className:"topic-dialog-group",children:[e.jsx("h3",{children:e.jsx("label",{htmlFor:"topic-dialog-input",children:l?"Edit this topic":(O=a.data)!=null&&O.length?"Add a topic in your own words":"Describe a topic in your own words"})}),e.jsx("p",{className:"topic-dialog-hint",children:K?`You follow ${fe} topics, the most allowed. Remove one below to add another.`:"A model reads every new paper and adds the ones that match to your Following feed. New topics are public and show your Hugging Face username; make one private in Settings."}),e.jsx("textarea",{id:"topic-dialog-input",className:"research-topic-input",rows:4,maxLength:Te,"aria-label":"Research topic",placeholder:"e.g. diffusion policies for robot manipulation, or speculative decoding for LLM inference",value:b,onChange:t=>F(t.target.value),onKeyDown:t=>{t.key==="Enter"&&!t.shiftKey&&!t.nativeEvent.isComposing&&(t.preventDefault(),ie())}}),e.jsxs("span",{className:"research-topic-count",children:[b.length,"/",Te]})]}),L.length>0&&e.jsxs("div",{className:"topic-dialog-group",children:[e.jsx("h3",{children:l?"Your other topics":"Your topics"}),e.jsx("div",{className:"topic-dialog-chips",children:L.map(t=>{const d=!q.includes(t.id);return e.jsxs("button",{type:"button",className:"topic-dialog-chip","aria-pressed":d,disabled:I,title:t.text,onClick:()=>M(y=>d?[...y,t.id]:y.filter(w=>w!==t.id)),children:[d?e.jsx(Se,{"aria-hidden":"true"}):e.jsx(Ce,{"aria-hidden":"true"}),t.label??t.text]},t.id)})})]}),H("Trending tasks","task",((X=j.data)==null?void 0:X.results)??[],{to:"/tasks",label:"Browse tasks"}),H("Trending methods","method",((se=p.data)==null?void 0:se.results)??[],{to:"/methods",label:"Browse methods"}),H("Benchmarks","benchmark",[],{to:"/tasks",label:"Browse benchmarks"}),H("Popular authors","author",P((le=T.data)==null?void 0:le.authors)),H("Popular organizations","organization",P((ce=T.data)==null?void 0:ce.organizations),{to:"/organizations",label:"Browse organizations"}),(c.error||v.error||N.error)&&e.jsx("p",{className:"settings-token-error",role:"alert",children:"Could not save your feed. Please try again."}),e.jsxs("div",{className:"topic-dialog-actions",children:[l&&e.jsx("button",{type:"button",className:"research-follow-action topic-dialog-remove",disabled:I,onClick:()=>v.mutate([l.id],{onSuccess:i}),children:"Remove topic"}),e.jsx("button",{type:"button",className:"research-follow-action",disabled:I,onClick:i,children:"Cancel"}),e.jsx("button",{type:"submit",className:"research-topic-save",disabled:!W,children:D.some(t=>t.follow===!1)||o.length?"Save":D.length?"Follow":k?"Retry":l?"Update topic":"Follow"})]})]})}function Es({children:h}){const i=m.useRef(null);return m.useLayoutEffect(()=>{const n=i.current;if(!n)return;const u=()=>{const a=[...n.children],g=a.filter(p=>p.dataset.suggested);g.forEach(p=>{p.hidden=!1});const j=()=>new Set(a.filter(p=>!p.hidden).map(p=>p.offsetTop)).size;for(let p=g.length-1;p>=0&&j()>2;p--)g[p].hidden=!0};return u(),window.addEventListener("resize",u),()=>window.removeEventListener("resize",u)}),e.jsx("div",{ref:i,className:"topic-dialog-chips",children:h})}function Fs({kind:h,name:i,src:n}){const[u,a]=m.useState(!1);if(n&&!u)return e.jsx("img",{className:`topic-dialog-chip-image is-${h}`,src:n,alt:"",loading:"lazy",onError:()=>a(!0)});if(h!=="author")return null;const g=i.split(/\s+/).filter(Boolean).map(j=>j[0]).slice(0,2).join("").toUpperCase();return e.jsx("span",{className:"topic-dialog-chip-image is-author is-initials","aria-hidden":"true",children:g})}function Ls(){var i;const h=B({queryKey:Ae.featuredTopics,queryFn:be.featuredTopics,staleTime:J});return(i=h.data)!=null&&i.length?e.jsx("nav",{className:"topic-bubbles","aria-label":"Popular topics",children:h.data.map(n=>e.jsxs(E,{className:"topic-bubble",to:is(n),title:`${n.followers.toLocaleString()} ${n.followers===1?"follower":"followers"}`,children:[n.creator&&e.jsx("img",{src:n.creator.avatar_url,alt:"",width:20,height:20,loading:"lazy"}),e.jsx("span",{className:"topic-bubble-name",children:os(n)}),n.creator&&e.jsxs("span",{className:"topic-bubble-creator",children:["@",n.creator.username]})]},n.id))}):null}const Fe=45,As=1800,Ds=25,Rs=350,Ms=h=>{const[i,n]=m.useState(z[0].slice(0,1)),[u,a]=m.useState(0);return m.useEffect(()=>{var A,F;if(!h)return;if((F=(A=window.matchMedia)==null?void 0:A.call(window,"(prefers-reduced-motion: reduce)"))!=null&&F.matches){n(z[0]),a(0);return}let g=0,j=1,p=!1,T;n(z[0].slice(0,j)),a(0);const P=()=>{const C=z[g];if(!p){if(j+=1,n(C.slice(0,j)),j===C.length){p=!0,T=window.setTimeout(P,As);return}T=window.setTimeout(P,Fe);return}if(j-=1,n(C.slice(0,j)),j===0){p=!1,g=(g+1)%z.length,a(g),T=window.setTimeout(P,Rs);return}T=window.setTimeout(P,Ds)};return T=window.setTimeout(P,Fe),()=>window.clearTimeout(T)},[h]),{placeholder:i,prompt:z[u]}},Is=()=>{var L;const h=De(),i=Re(),[n,u]=m.useState({text:"",paperMentions:[]}),a=n.text,[g,j]=m.useState(0),[p,T]=m.useState(!1),[P,A]=m.useState(null),{placeholder:F,prompt:C}=Ms(!a),R=m.useRef(null),q=B({queryKey:["chatAvailability"],queryFn:()=>Ss.getAvailability(),retry:!1,enabled:ge()}),M=ge()&&((L=q.data)==null?void 0:L.paper_mentions_enabled)!==!1,c=gs({draft:n,onChange:u,enabled:M,textareaRef:R}),v=fs(n,c.open),N=a?v.completion:C;m.useLayoutEffect(()=>{const o=R.current;if(!o)return;const f=()=>{if(o.style.height="auto",a){o.style.height=`${Math.min(ys(o),160)}px`;return}const b=o.placeholder,S=z.reduce((k,K)=>(o.placeholder=K,Math.max(k,o.scrollHeight)),0);o.placeholder=b,o.style.height=`${Math.min(S,160)}px`};return f(),window.addEventListener("resize",f),()=>window.removeEventListener("resize",f)},[a,N]);const l=async(o=n)=>{const f=o.text.trim();if(!(!f||p)){if(i){const b=new URLSearchParams({q:f,model:ue}),S=`${Ye}?${b}`,k=window.open(S,"_blank");if(!k){A(S);return}k.opener=null,A(null),u({text:"",paperMentions:[]});return}T(!0),vs(o,ue);try{const b=await Ns(ue);h(`/chat/${b.id}`)}catch{h("/chat")}}};return e.jsxs(e.Fragment,{children:[!i&&e.jsx("div",{className:"ask-home-new",children:"Hint: type @ to bring papers into context, or press Tab to use a suggestion"}),e.jsxs("div",{className:"ask-home",children:[e.jsxs("div",{className:"ask-home-row",children:[e.jsxs("div",{className:"ask-home-textarea-wrap",children:[e.jsx(xs,{text:n.text,mentions:n.paperMentions,scrollTop:g,variant:"home",completion:a?N:""}),e.jsx("textarea",{ref:R,rows:1,value:a,placeholder:F,"aria-label":"Ask the assistant",disabled:p,onChange:o=>{c.updateText(o.target.value,o.target.selectionStart),v.trackCaret(o.target)},onSelect:o=>{c.refresh(o.currentTarget.selectionStart),v.trackCaret(o.currentTarget)},onClick:o=>{c.refresh(o.currentTarget.selectionStart),v.trackCaret(o.currentTarget)},onScroll:o=>j(o.currentTarget.scrollTop),onBlur:o=>{var f,b;(b=(f=o.relatedTarget)==null?void 0:f.closest)!=null&&b.call(f,".chat-paper-picker")||window.setTimeout(c.close,0)},onKeyDown:o=>{if(!c.keyDown(o)){if(bs(o)&&N){o.preventDefault();const f=a+N;c.updateText(f,f.length),window.requestAnimationFrame(()=>{var b;return(b=R.current)==null?void 0:b.setSelectionRange(f.length,f.length)});return}o.key==="Enter"&&!o.shiftKey&&(o.preventDefault(),l())}},role:M?"combobox":void 0,"aria-expanded":M?c.open:void 0,"aria-controls":c.open?c.pickerId:void 0,"aria-activedescendant":c.open&&c.results.length?`${c.optionIdPrefix}-${c.activeIndex}`:void 0,"aria-autocomplete":M?"list":void 0,"aria-describedby":c.message?"ask-home-paper-mention-message":void 0})]}),e.jsx("button",{type:"button",className:`chat-send${a.trim()?" chat-send-on":""}`,onClick:()=>void l(),disabled:!a.trim()||p,"aria-label":"Ask the assistant",children:e.jsx(ws,{})})]}),P&&e.jsx("div",{className:"chat-paper-mention-message",role:"alert",children:e.jsx("a",{href:P,target:"_blank",rel:"noreferrer",children:"Open this question on paperswithcode.co"})}),c.message&&e.jsx("div",{id:"ask-home-paper-mention-message",className:"chat-paper-mention-message",role:"alert",children:c.message}),e.jsx(js,{open:c.open,query:c.query,results:c.results,activeIndex:c.activeIndex,loading:c.loading,error:c.error,onSelect:c.select,id:c.pickerId,optionIdPrefix:c.optionIdPrefix})]})]})},Oe={task:"Tasks",method:"Methods",benchmark:"Benchmarks",author:"Authors",organization:"Orgs"},qs=Object.keys(Oe),$s=30,Le=40,Os=async h=>{const i=await h;return{results:i.results.map(n=>({paper:n})),next_page:i.next_page}},Hs=({mode:h})=>{var y,w,Z,te,x,ae,V,we,je,ye,ve,Ne;const i=h==="following",n=De(),u=Ue(),a=u==null?void 0:u.user,[g,j]=Ge(),p=ds(g,void 0,h==="trending"?"week":"month"),T=s=>{const r=new URLSearchParams(g);r.delete("order_by"),r.delete("only"),r.delete("topic");const _=r.toString();n(_?`${s}?${_}`:s)},P=s=>{const r=new URLSearchParams(g);r.delete("only"),s===null?r.delete("topic"):r.set("topic",String(s));const _=r.toString();return _?`/following?${_}`:"/following"},A=B({queryKey:Xe.topTasksSidebar,queryFn:()=>de.topTasks(8),staleTime:J}),F=B({queryKey:["trending-tasks-sidebar"],queryFn:()=>de.trendingTasks({limit:8,level:0,min_recent_papers:10}),staleTime:J}),C=i&&g.get("only")==="topic",R=i?Number(g.get("topic")??NaN):NaN,q=Number.isInteger(R)?R:void 0,M={start_date:p.startDate,end_date:p.endDate},c={...p,topicOnly:C,topicId:q},v=ks(i?[...ke.feeds.following,a==null?void 0:a.hf_subject,c]:[...ke.feeds.trending,M],async s=>{if(i){const _=await be.following(s,c),He=_.length===Le?s+Le:null;return{results:_,next_page:He}}const r={...M,page:s,page_size:$s,include_resources:!0};return Os(Ts.list({...r,order_by:"trending",order_dir:"desc",latest_only:!0}))},{enabled:!i||!!a,initialPage:i?0:1}),N=Ie(i),l=Me(i,1e4),L=s=>s.label??s.text,o=((y=l.data)==null?void 0:y.filter(ns))??[],f=o.length>0,b=(w=l.data)==null?void 0:w.find(s=>s.id===q),[S,k]=m.useState(void 0),K=(((Z=l.data)==null?void 0:Z.length)??0)s.id).join(","),G=m.useRef([]);m.useEffect(()=>{const s=I?I.split(","):[];G.current.some(r=>!s.includes(r))&&U.invalidateQueries({queryKey:Ae.feed(a==null?void 0:a.hf_subject)}),G.current=s},[I,U,a==null?void 0:a.hf_subject]);const Q=i&&!!a&&((te=N.data)==null?void 0:te.length)===0&&l.isSuccess&&l.data.length===0,D=i&&!(u!=null&&u.isLoading)&&!a||Q,W=!!a||!We(),[oe,ie]=m.useState(!1),[H]=m.useState(()=>!!Pe()||_e().length>0),[ne,re]=m.useState(!1);!oe&&((x=l.data)!=null&&x.length||(ae=N.data)!=null&&ae.length)&&ie(!0),D&&!ne&&(re(!0),W&&!oe&&!H&&k(null));const $=qe(),{mutate:Y}=$,ee=m.useRef(!1);m.useEffect(()=>{const s=Pe();!a||!l.isSuccess||!s||ee.current||(ee.current=!0,l.data.some(r=>r.text===s)?rs():Y({text:s}))},[a,l.isSuccess,l.data,Y]);const O=$e(),{mutate:X}=O,se=m.useRef(!1);m.useEffect(()=>{const s=_e();!a||!s.length||se.current||(se.current=!0,X(s))},[a,X]);const le=m.useMemo(()=>qs.map(s=>{var r;return{kind:s,follows:i?((r=N.data)==null?void 0:r.filter(_=>_.kind===s))??[]:[]}}).filter(s=>s.follows.length>0),[i,N.data]),ce=i&&(!!(u!=null&&u.isLoading)||!!a&&!Q),t=m.useMemo(()=>{var s;return((s=v.data)==null?void 0:s.pages.flatMap(r=>r.results.map(_=>({...ls(_.paper),followReasons:_.reasons}))))??[]},[v.data]),d=v.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 feed-sidebar",children:[ce?e.jsxs("div",{className:"sidebar-section sidebar-section-follows",children:[e.jsx("div",{className:"sidebar-label",children:"You follow"}),((u==null?void 0:u.isLoading)||N.isLoading)&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:4}).map((s,r)=>e.jsx(he,{className:"h-5 w-full"},r))}),N.isError&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"Couldn't load your follows."}),e.jsxs("div",{className:"sidebar-links",children:[!!((V=l.data)!=null&&V.length)&&e.jsxs("div",{className:"sidebar-follow-group sidebar-follow-topics",children:[e.jsx("span",{className:"sidebar-follow-kind",children:l.data.length===1?"Topic":"Topics"}),l.data.map(s=>{const r=s.id===q;return e.jsxs("div",{className:`sidebar-follow-topic ${r?"active":""}`,children:[e.jsx(E,{to:P(r?null:s.id),className:"sidebar-link sidebar-follow-link",title:r?"Show papers from everything you follow":`Show only papers about “${s.text}”`,"aria-current":r?"true":void 0,children:e.jsx("span",{className:"sidebar-follow-name",children:L(s)})}),e.jsx("button",{type:"button",className:"sidebar-follow-edit","aria-label":`Edit topic ${L(s)}`,"aria-expanded":S===s.id,onClick:()=>k(s.id),children:"edit"})]},s.id)}),K&&e.jsx("button",{type:"button",className:"sidebar-follow-add","aria-expanded":S===null,onClick:()=>k(null),children:"+ Add topic"})]}),le.map(s=>e.jsxs("div",{className:"sidebar-follow-group",children:[e.jsx("span",{className:"sidebar-follow-kind",children:Oe[s.kind]}),s.follows.map(r=>e.jsx(E,{to:r.url,className:"sidebar-link sidebar-follow-link",children:e.jsx("span",{className:"sidebar-follow-name",children:r.name})},r.entity_id))]},s.kind))]}),e.jsx(E,{to:"/settings",className:"sidebar-follow-manage",children:"Manage in Settings"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"sidebar-section sidebar-section-top-domains",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,r)=>e.jsx(he,{className:"h-5 w-full"},r))}),e.jsxs("div",{className:"sidebar-links",children:[(we=A.data)==null?void 0:we.map(s=>e.jsxs(E,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[xe(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(E,{to:"/tasks",className:"sidebar-link sidebar-link-more",children:"all domains →"})]})]}),e.jsxs("div",{className:"sidebar-section sidebar-section-trending-domains",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),F.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,r)=>e.jsx(he,{className:"h-5 w-full"},r))}),((ye=(je=F.data)==null?void 0:je.results)==null?void 0:ye.length)===0&&!F.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),e.jsx("div",{className:"sidebar-links",children:(Ne=(ve=F.data)==null?void 0:ve.results)==null?void 0:Ne.map(s=>e.jsxs(E,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[xe(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))})]})]}),e.jsx(ms,{})]}),e.jsxs("div",{className:"feed-main",children:[(ge()||Re())&&e.jsx("div",{className:"feed-chat",children:e.jsx(Is,{})}),e.jsxs("div",{className:"feed-content",children:[e.jsxs("div",{className:"sort-bar home-feed-sort-bar",children:[e.jsx("div",{className:"paper-feed-toolbar-controls",children:e.jsxs("div",{className:"sort-options",children:[e.jsx("button",{className:`sort-btn ${h==="trending"?"active":""}`,onClick:()=>T("/"),children:"trending"}),e.jsx("button",{className:`sort-btn ${i?"active":""}`,onClick:()=>T("/following"),children:"following"})]})}),e.jsx(us,{startDate:p.startDate,endDate:p.endDate,onChange:s=>j(hs(g,s))})]}),e.jsx(Ls,{}),d&&e.jsx(pe,{variant:"destructive",className:"mb-4",children:e.jsxs(me,{children:["Failed to load papers. ",e.jsx("button",{type:"button",onClick:()=>void v.refetch(),children:"Try again"})]})}),$.isError&&$.variables&&e.jsx(pe,{variant:"destructive",className:"mb-4",children:e.jsxs(me,{children:["Could not follow “",$.variables.text,"”. ",e.jsx("button",{type:"button",onClick:()=>Y($.variables),children:"Try again"})]})}),O.isError&&O.variables&&e.jsx(pe,{variant:"destructive",className:"mb-4",children:e.jsxs(me,{children:["Could not follow ",O.variables.map(s=>s.name).join(", "),". ",e.jsx("button",{type:"button",onClick:()=>X(O.variables),children:"Try again"})]})}),i&&!!a&&l.isSuccess&&!N.isPending&&!Q&&(l.data.length===0?e.jsxs("div",{className:"following-topic-note",role:"status",children:["Describe a topic in your own words, and a model adds matching new papers to this feed."," ",e.jsx("button",{type:"button",className:"link-button",onClick:()=>k(null),children:"Follow a topic"})]}):f?e.jsxs("div",{className:"following-topic-note",role:"status",children:["Showing the closest papers about ",o.map(s=>`“${L(s)}”`).join(" and ")," now. A model is reading papers to refine these matches, which takes a few minutes."]}):null),i&&W&&e.jsx(_s,{open:S!==void 0,topicId:S??null,onOpenChange:s=>{s||k(void 0)}}),(C||b)&&e.jsxs("div",{className:"following-topic-note following-topic-filter",role:"status",children:["Showing only papers about ",b?`“${L(b)}”`:"your topics","."," ",e.jsx(E,{to:P(null),children:"Show everything you follow"})]}),D?e.jsx(Ps,{onBuild:W?()=>k(null):void 0}):e.jsx(ps,{query:v,isLoading:v.isLoading||i&&!!(u!=null&&u.isLoading),cards:t,skeleton:"card",rootMargin:"400px",empty:d?null:b?e.jsxs(e.Fragment,{children:["No papers about this topic match these filters. Widen the date range or ",e.jsx("button",{type:"button",className:"link-button",onClick:()=>k(b.id),children:"edit the topic"}),"."]}):C?e.jsx(e.Fragment,{children:"No papers about your topics match these filters. Widen the date range or follow more topics."}):i?e.jsxs(e.Fragment,{children:["No papers from your topics or follows match these filters. Widen the date range, or follow more from ",e.jsx(E,{to:"/tasks",children:"tasks"}),", ",e.jsx(E,{to:"/methods",children:"methods"}),", benchmark, author, or organization pages."]}):"No papers in this window."})]})]})]})]})},xt=()=>e.jsx(Hs,{mode:"trending"});export{Is as AskAssistant,Hs as HomeFeed,xt as default}; diff --git a/assets/FollowingView-CxPwEdv-.js b/assets/FollowingView-CxPwEdv-.js new file mode 100644 index 0000000000000000000000000000000000000000..6bab50323c2f10b7bbefb008ebd430e0a19ebdbd --- /dev/null +++ b/assets/FollowingView-CxPwEdv-.js @@ -0,0 +1 @@ +import{j as o}from"./index-CxhY4zQ1.js";import{HomeFeed as r}from"./FeedView-C8zGqRsW.js";import"./sparkles-CBme4WI-.js";import"./dialog-CT48f48_.js";import"./catalog-DCEU6WpP.js";import"./researchTopic-DXZVIvAq.js";import"./useMutation-BzRfwboV.js";import"./transform-DehuZQh7.js";import"./plus-CEkdlNSn.js";import"./arrow-right-BwBMsu3P.js";import"./PaperFeed-D1egUlu_.js";import"./PaperCard-DeWmBrg8.js";import"./AuthorAvatar-DPz8YQ5Z.js";import"./SotaBadges-EnDhSaVO.js";import"./colors-BkWRhvFI.js";import"./Icon-XOOkUEUX.js";import"./LatexTitle-BqNrCKu8.js";import"./papers-BDxSKSYJ.js";import"./curation-D2sqKAqC.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-DgW_tN02.js";import"./skeleton-DdKViE4r.js";import"./useIntersectionObserver-ZqjUJuPc.js";import"./McpShowcase-CXm3UZ_U.js";import"./AgentLogos-C9q7zZc4.js";import"./chatSessions-DjtMpqHz.js";import"./chat-CkiIbMG5.js";import"./usePapers-Cv13R7ph.js";import"./useInfiniteQuery-vHEhIVF_.js";import"./alert-C-NbJX4N.js";function B(){return o.jsx(r,{mode:"following"})}export{B as default}; diff --git a/assets/FollowingView-DVSEqGFR.js b/assets/FollowingView-DVSEqGFR.js deleted file mode 100644 index d99392f3c9ab84cc35123e673305f726a1fdff97..0000000000000000000000000000000000000000 --- a/assets/FollowingView-DVSEqGFR.js +++ /dev/null @@ -1 +0,0 @@ -import{j as o}from"./index-3CfcAX6N.js";import{HomeFeed as r}from"./FeedView-T5hkRnNT.js";import"./sparkles-BY8EsDI7.js";import"./dialog-Bbx5GVcy.js";import"./catalog-B47DuClX.js";import"./researchTopic-Z4AJDMN7.js";import"./useMutation-CKC6OFhA.js";import"./transform-Dx-N8Yyj.js";import"./plus-CiDEk52y.js";import"./arrow-right-U4Mftc_z.js";import"./PaperFeed-2dSUzcA2.js";import"./PaperCard-BZtXccuT.js";import"./AuthorAvatar-DYaYcwPm.js";import"./SotaBadges-BqZMAXyY.js";import"./colors-BkWRhvFI.js";import"./Icon-C0d9p4Q2.js";import"./LatexTitle-DvPeLepK.js";import"./papers-BsYlGUQi.js";import"./curation-BZoIvsHD.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-Dwe6SY1f.js";import"./skeleton-CQbSjC3L.js";import"./useIntersectionObserver-wAZWG4G7.js";import"./McpShowcase-CcyaF6wZ.js";import"./AgentLogos-06t31xxf.js";import"./chatSessions-C9fOk1AR.js";import"./chat-81nIwu_j.js";import"./usePapers-CHoHKyWP.js";import"./useInfiniteQuery-DYwUEaoz.js";import"./alert-BXZ4lnnf.js";function B(){return o.jsx(r,{mode:"following"})}export{B as default}; diff --git a/assets/FrameworksIndexView-BVijHCyJ.js b/assets/FrameworksIndexView-DzgxIZ2R.js similarity index 95% rename from assets/FrameworksIndexView-BVijHCyJ.js rename to assets/FrameworksIndexView-DzgxIZ2R.js index 56315c7920c857f0e1eb90dae5c24b974070dda8..e3409fa7c1d29a305d4b0b3bf625068bcf68042f 100644 --- a/assets/FrameworksIndexView-BVijHCyJ.js +++ b/assets/FrameworksIndexView-DzgxIZ2R.js @@ -1 +1 @@ -import{k as d,j as e,L as c,b as m,V as h}from"./index-3CfcAX6N.js";import{I as p}from"./Icon-C0d9p4Q2.js";import{c as u}from"./catalog-B47DuClX.js";import{c as g,h as x}from"./colors-BkWRhvFI.js";import{P as f}from"./frameworks-DDA0P4Tf.js";const j={fontFamily:"var(--mono)",fontSize:13,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--ink)",marginBottom:6},k=({platform:s})=>{const n=g(x(s));return e.jsx("span",{className:"framework-platform-chip",style:{background:n.bg,color:n.text},children:f[s]})},_=({framework:s})=>{const n=d(),t=`/papers?framework=${encodeURIComponent(s.slug)}`;return e.jsxs("article",{id:`framework-${s.slug}`,className:"framework-card framework-card-clickable",role:"link",tabIndex:0,"aria-label":`View papers implemented by ${s.name}`,onClick:a=>{a.target.closest("a, button")||n(t)},onKeyDown:a=>{a.target===a.currentTarget&&(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),n(t))},children:[e.jsxs("div",{className:"framework-card-head",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"framework-card-name",children:s.name}),s.organization_name&&e.jsx("div",{className:"framework-card-org",children:s.organization_name})]}),s.platforms&&s.platforms.length>0&&e.jsx("div",{className:"framework-platform-row",children:s.platforms.map(a=>e.jsx(k,{platform:a},a))})]}),e.jsx("p",{className:"framework-card-desc",children:s.description}),s.when_to_use&&e.jsxs("div",{className:"framework-card-when",children:[e.jsx("span",{className:"framework-card-when-label",children:"When to use"}),s.when_to_use]}),(s.github_url||s.docs_url||s.introducing_paper_arxiv_id)&&e.jsxs("div",{className:"framework-card-links",children:[s.introducing_paper_arxiv_id&&e.jsx(c,{to:`/paper/${s.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"}),s.github_url&&s.paper_count>0&&e.jsxs(c,{to:t,className:"framework-link",children:["Implements ",s.paper_count," ",s.paper_count===1?"paper":"papers"]}),s.github_url&&s.paper_count===0&&e.jsx("span",{className:"framework-link framework-link-disabled","aria-disabled":"true",children:"Implements 0 papers"}),s.github_url&&e.jsxs("a",{href:s.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(p,{name:"github",size:13}),"GitHub"]}),s.docs_url&&s.docs_url!==s.github_url&&e.jsx("a",{href:s.docs_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:"Docs"})]})]})},I=()=>{var a;const s=m({queryKey:["framework-catalog"],queryFn:()=>u.frameworkCatalog()}),n=((a=s.data)==null?void 0:a.domains)??[],t=n.reduce((i,r)=>i+r.categories.reduce((l,o)=>l+o.frameworks.length,0),0);return h.useEffect(()=>{var r;const i=window.location.hash.slice(1);i&&((r=document.getElementById(i))==null||r.scrollIntoView())},[s.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."})]})}),s.isLoading&&e.jsx("div",{className:"empty",children:"Loading frameworks…"}),s.isError&&e.jsx("div",{className:"empty",children:"Could not load frameworks."}),n.map(i=>e.jsxs("section",{style:{marginBottom:56},children:[e.jsxs("div",{className:"area-section-head",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"area-section-title",children:i.name}),e.jsx("div",{className:"area-section-description",children:i.description})]}),e.jsxs("div",{className:"area-section-meta",children:[i.categories.length," ",i.categories.length===1?"category":"categories"," ·"," ",i.categories.reduce((r,l)=>r+l.frameworks.length,0)," frameworks"]})]}),i.categories.map(r=>e.jsxs("div",{className:"framework-category",children:[e.jsxs("div",{className:"framework-category-head",children:[e.jsxs("div",{children:[e.jsx("h3",{style:j,children:r.name}),r.description&&e.jsx("p",{className:"framework-category-blurb",children:r.description}),r.guide_url&&e.jsxs("a",{href:r.guide_url,target:"_blank",rel:"noopener noreferrer",className:"framework-guide-link",children:[r.guide_label??"Read guide"," →"]})]}),e.jsxs("div",{className:"framework-category-meta",children:[r.frameworks.length," ",r.frameworks.length===1?"framework":"frameworks"]})]}),e.jsx("div",{className:"framework-grid",children:r.frameworks.map(l=>e.jsx(_,{framework:l},l.slug))})]},r.slug))]},i.slug)),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:8},children:[t," frameworks across ",n.length," ",n.length===1?"domain":"domains",". More areas coming soon."]})]})};export{_ as FrameworkCard,I as default}; +import{k as d,j as e,L as c,b as m,V as h}from"./index-CxhY4zQ1.js";import{I as p}from"./Icon-XOOkUEUX.js";import{c as u}from"./catalog-DCEU6WpP.js";import{c as g,h as x}from"./colors-BkWRhvFI.js";import{P as f}from"./frameworks-DDA0P4Tf.js";const j={fontFamily:"var(--mono)",fontSize:13,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--ink)",marginBottom:6},k=({platform:s})=>{const n=g(x(s));return e.jsx("span",{className:"framework-platform-chip",style:{background:n.bg,color:n.text},children:f[s]})},_=({framework:s})=>{const n=d(),t=`/papers?framework=${encodeURIComponent(s.slug)}`;return e.jsxs("article",{id:`framework-${s.slug}`,className:"framework-card framework-card-clickable",role:"link",tabIndex:0,"aria-label":`View papers implemented by ${s.name}`,onClick:a=>{a.target.closest("a, button")||n(t)},onKeyDown:a=>{a.target===a.currentTarget&&(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),n(t))},children:[e.jsxs("div",{className:"framework-card-head",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"framework-card-name",children:s.name}),s.organization_name&&e.jsx("div",{className:"framework-card-org",children:s.organization_name})]}),s.platforms&&s.platforms.length>0&&e.jsx("div",{className:"framework-platform-row",children:s.platforms.map(a=>e.jsx(k,{platform:a},a))})]}),e.jsx("p",{className:"framework-card-desc",children:s.description}),s.when_to_use&&e.jsxs("div",{className:"framework-card-when",children:[e.jsx("span",{className:"framework-card-when-label",children:"When to use"}),s.when_to_use]}),(s.github_url||s.docs_url||s.introducing_paper_arxiv_id)&&e.jsxs("div",{className:"framework-card-links",children:[s.introducing_paper_arxiv_id&&e.jsx(c,{to:`/paper/${s.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"}),s.github_url&&s.paper_count>0&&e.jsxs(c,{to:t,className:"framework-link",children:["Implements ",s.paper_count," ",s.paper_count===1?"paper":"papers"]}),s.github_url&&s.paper_count===0&&e.jsx("span",{className:"framework-link framework-link-disabled","aria-disabled":"true",children:"Implements 0 papers"}),s.github_url&&e.jsxs("a",{href:s.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(p,{name:"github",size:13}),"GitHub"]}),s.docs_url&&s.docs_url!==s.github_url&&e.jsx("a",{href:s.docs_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:"Docs"})]})]})},I=()=>{var a;const s=m({queryKey:["framework-catalog"],queryFn:()=>u.frameworkCatalog()}),n=((a=s.data)==null?void 0:a.domains)??[],t=n.reduce((i,r)=>i+r.categories.reduce((l,o)=>l+o.frameworks.length,0),0);return h.useEffect(()=>{var r;const i=window.location.hash.slice(1);i&&((r=document.getElementById(i))==null||r.scrollIntoView())},[s.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."})]})}),s.isLoading&&e.jsx("div",{className:"empty",children:"Loading frameworks…"}),s.isError&&e.jsx("div",{className:"empty",children:"Could not load frameworks."}),n.map(i=>e.jsxs("section",{style:{marginBottom:56},children:[e.jsxs("div",{className:"area-section-head",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"area-section-title",children:i.name}),e.jsx("div",{className:"area-section-description",children:i.description})]}),e.jsxs("div",{className:"area-section-meta",children:[i.categories.length," ",i.categories.length===1?"category":"categories"," ·"," ",i.categories.reduce((r,l)=>r+l.frameworks.length,0)," frameworks"]})]}),i.categories.map(r=>e.jsxs("div",{className:"framework-category",children:[e.jsxs("div",{className:"framework-category-head",children:[e.jsxs("div",{children:[e.jsx("h3",{style:j,children:r.name}),r.description&&e.jsx("p",{className:"framework-category-blurb",children:r.description}),r.guide_url&&e.jsxs("a",{href:r.guide_url,target:"_blank",rel:"noopener noreferrer",className:"framework-guide-link",children:[r.guide_label??"Read guide"," →"]})]}),e.jsxs("div",{className:"framework-category-meta",children:[r.frameworks.length," ",r.frameworks.length===1?"framework":"frameworks"]})]}),e.jsx("div",{className:"framework-grid",children:r.frameworks.map(l=>e.jsx(_,{framework:l},l.slug))})]},r.slug))]},i.slug)),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:8},children:[t," frameworks across ",n.length," ",n.length===1?"domain":"domains",". More areas coming soon."]})]})};export{_ as FrameworkCard,I as default}; diff --git a/assets/Icon-C0d9p4Q2.js b/assets/Icon-XOOkUEUX.js similarity index 98% rename from assets/Icon-C0d9p4Q2.js rename to assets/Icon-XOOkUEUX.js index b90f0ffc05f05e9883144469fc8b8b809f81a294..2bec5d60dd8162b40d0b8528b68605288ecb6368 100644 --- a/assets/Icon-C0d9p4Q2.js +++ b/assets/Icon-XOOkUEUX.js @@ -1 +1 @@ -import{j as o}from"./index-3CfcAX6N.js";const s=({name:t,size:r=14})=>{const e={search:o.jsx("path",{d:"M11 11l3 3M7 12.5a5.5 5.5 0 110-11 5.5 5.5 0 010 11z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),arrowUp:o.jsx("path",{d:"M8 3l5 6H3l5-6z",fill:"currentColor"}),arrowLeft:o.jsx("path",{d:"M9 3l-4 5 4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),arrowRight:o.jsx("path",{d:"M7 3l4 5-4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),external:o.jsx("path",{d:"M5 3h-2v8h8v-2M9 3h3v3M7 9l5-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),github:o.jsx("path",{d:"M8 1a7 7 0 00-2.21 13.64c.35.06.48-.15.48-.34v-1.2c-1.95.42-2.36-.94-2.36-.94-.32-.81-.78-1.03-.78-1.03-.64-.43.05-.43.05-.43.7.05 1.07.72 1.07.72.62 1.07 1.64.76 2.04.58.06-.45.24-.76.44-.94-1.55-.18-3.18-.78-3.18-3.46 0-.76.27-1.39.72-1.88-.07-.18-.31-.89.07-1.86 0 0 .59-.19 1.92.72.56-.15 1.16-.23 1.75-.24.59 0 1.19.08 1.75.24 1.33-.9 1.92-.72 1.92-.72.38.97.14 1.68.07 1.86.45.49.72 1.12.72 1.88 0 2.69-1.64 3.28-3.19 3.45.25.22.48.65.48 1.32v1.95c0 .19.13.41.49.34A7 7 0 008 1z",fill:"currentColor"}),citation:o.jsx("path",{d:"M3 4h3v3H3zM4 7v1.5a1.5 1.5 0 01-1.5 1.5M9 4h3v3H9zM10 7v1.5a1.5 1.5 0 01-1.5 1.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none"}),bookmark:o.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),chart:o.jsx("path",{d:"M2 13h12M3 11l3-4 3 2 4-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),chat:o.jsx("path",{d:"M3 3h10v7H7l-3 3v-3H3V3z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),pdf:o.jsx("path",{d:"M5 2h5l3 3v9H5V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),copy:o.jsx("path",{d:"M5 5h7v8H5V5zM3 3h7v2M3 3v8h2",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinejoin:"round"}),sparkle:o.jsx("path",{d:"M8 2l1.2 3.8L13 7l-3.8 1.2L8 12l-1.2-3.8L3 7l3.8-1.2L8 2z",fill:"currentColor"}),user:o.jsx("path",{d:"M8 8a3 3 0 100-6 3 3 0 000 6zM2 14c0-3 2.5-5 6-5s6 2 6 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),globe:o.jsx("path",{d:"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM1.5 8h13M8 1.5c1.7 1.9 2.6 4.2 2.6 6.5s-.9 4.6-2.6 6.5M8 1.5C6.3 3.4 5.4 5.7 5.4 8s.9 4.6 2.6 6.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinecap:"round"}),menu:o.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:o.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),pencil:o.jsx("path",{d:"M10.5 2.5l3 3L6 13H3v-3l7.5-7.5zM9 4l3 3",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),robot:o.jsx("path",{d:"M6 12.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5M3 8.062C3 6.76 4.235 5.765 5.53 5.886a26.6 26.6 0 0 0 4.94 0C11.765 5.765 13 6.76 13 8.062v1.157a.93.93 0 0 1-.765.935c-.845.147-2.34.346-4.235.346s-3.39-.2-4.235-.346A.93.93 0 0 1 3 9.219zm4.542-.827a.25.25 0 0 0-.217.068l-.92.9a25 25 0 0 1-1.871-.183a.25.25 0 0 0-.068.495c.55.076 1.232.149 2.02.193a.25.25 0 0 0 .189-.071l.754-.736l.847 1.71a.25.25 0 0 0 .404.062l.932-.97a25 25 0 0 0 1.922-.188a.25.25 0 0 0-.068-.495c-.538.074-1.207.145-1.98.189a.25.25 0 0 0-.166.076l-.754.785l-.842-1.7a.25.25 0 0 0-.182-.135M8.5 1.866a1 1 0 1 0-1 0V3h-2A4.5 4.5 0 0 0 1 7.5V8a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1v1a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-1a1 1 0 0 0 1-1V9a1 1 0 0 0-1-1v-.5A4.5 4.5 0 0 0 10.5 3h-2zM14 7.5V13a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V7.5A3.5 3.5 0 0 1 5.5 4h5A3.5 3.5 0 0 1 14 7.5",fill:"currentColor"})};return o.jsx("svg",{className:r===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:r,height:r,children:e[t]})};export{s as I}; +import{j as o}from"./index-CxhY4zQ1.js";const s=({name:t,size:r=14})=>{const e={search:o.jsx("path",{d:"M11 11l3 3M7 12.5a5.5 5.5 0 110-11 5.5 5.5 0 010 11z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),arrowUp:o.jsx("path",{d:"M8 3l5 6H3l5-6z",fill:"currentColor"}),arrowLeft:o.jsx("path",{d:"M9 3l-4 5 4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),arrowRight:o.jsx("path",{d:"M7 3l4 5-4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),external:o.jsx("path",{d:"M5 3h-2v8h8v-2M9 3h3v3M7 9l5-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),github:o.jsx("path",{d:"M8 1a7 7 0 00-2.21 13.64c.35.06.48-.15.48-.34v-1.2c-1.95.42-2.36-.94-2.36-.94-.32-.81-.78-1.03-.78-1.03-.64-.43.05-.43.05-.43.7.05 1.07.72 1.07.72.62 1.07 1.64.76 2.04.58.06-.45.24-.76.44-.94-1.55-.18-3.18-.78-3.18-3.46 0-.76.27-1.39.72-1.88-.07-.18-.31-.89.07-1.86 0 0 .59-.19 1.92.72.56-.15 1.16-.23 1.75-.24.59 0 1.19.08 1.75.24 1.33-.9 1.92-.72 1.92-.72.38.97.14 1.68.07 1.86.45.49.72 1.12.72 1.88 0 2.69-1.64 3.28-3.19 3.45.25.22.48.65.48 1.32v1.95c0 .19.13.41.49.34A7 7 0 008 1z",fill:"currentColor"}),citation:o.jsx("path",{d:"M3 4h3v3H3zM4 7v1.5a1.5 1.5 0 01-1.5 1.5M9 4h3v3H9zM10 7v1.5a1.5 1.5 0 01-1.5 1.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none"}),bookmark:o.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),chart:o.jsx("path",{d:"M2 13h12M3 11l3-4 3 2 4-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),chat:o.jsx("path",{d:"M3 3h10v7H7l-3 3v-3H3V3z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),pdf:o.jsx("path",{d:"M5 2h5l3 3v9H5V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),copy:o.jsx("path",{d:"M5 5h7v8H5V5zM3 3h7v2M3 3v8h2",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinejoin:"round"}),sparkle:o.jsx("path",{d:"M8 2l1.2 3.8L13 7l-3.8 1.2L8 12l-1.2-3.8L3 7l3.8-1.2L8 2z",fill:"currentColor"}),user:o.jsx("path",{d:"M8 8a3 3 0 100-6 3 3 0 000 6zM2 14c0-3 2.5-5 6-5s6 2 6 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),globe:o.jsx("path",{d:"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM1.5 8h13M8 1.5c1.7 1.9 2.6 4.2 2.6 6.5s-.9 4.6-2.6 6.5M8 1.5C6.3 3.4 5.4 5.7 5.4 8s.9 4.6 2.6 6.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinecap:"round"}),menu:o.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:o.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),pencil:o.jsx("path",{d:"M10.5 2.5l3 3L6 13H3v-3l7.5-7.5zM9 4l3 3",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),robot:o.jsx("path",{d:"M6 12.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5M3 8.062C3 6.76 4.235 5.765 5.53 5.886a26.6 26.6 0 0 0 4.94 0C11.765 5.765 13 6.76 13 8.062v1.157a.93.93 0 0 1-.765.935c-.845.147-2.34.346-4.235.346s-3.39-.2-4.235-.346A.93.93 0 0 1 3 9.219zm4.542-.827a.25.25 0 0 0-.217.068l-.92.9a25 25 0 0 1-1.871-.183a.25.25 0 0 0-.068.495c.55.076 1.232.149 2.02.193a.25.25 0 0 0 .189-.071l.754-.736l.847 1.71a.25.25 0 0 0 .404.062l.932-.97a25 25 0 0 0 1.922-.188a.25.25 0 0 0-.068-.495c-.538.074-1.207.145-1.98.189a.25.25 0 0 0-.166.076l-.754.785l-.842-1.7a.25.25 0 0 0-.182-.135M8.5 1.866a1 1 0 1 0-1 0V3h-2A4.5 4.5 0 0 0 1 7.5V8a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1v1a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-1a1 1 0 0 0 1-1V9a1 1 0 0 0-1-1v-.5A4.5 4.5 0 0 0 10.5 3h-2zM14 7.5V13a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V7.5A3.5 3.5 0 0 1 5.5 4h5A3.5 3.5 0 0 1 14 7.5",fill:"currentColor"})};return o.jsx("svg",{className:r===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:r,height:r,children:e[t]})};export{s as I}; diff --git a/assets/LatexTitle-DvPeLepK.js b/assets/LatexTitle-BqNrCKu8.js similarity index 98% rename from assets/LatexTitle-DvPeLepK.js rename to assets/LatexTitle-BqNrCKu8.js index cde3836363432f12085563c7a40c5f5c531c4178..90f5e80f36bd8136d5e1998fe18754a5fb366b36 100644 --- a/assets/LatexTitle-DvPeLepK.js +++ b/assets/LatexTitle-BqNrCKu8.js @@ -1,2 +1,2 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/katex-wklAmtGL.css"])))=>i.map(i=>d[i]); -import{j as u,f as A,a7 as L}from"./index-3CfcAX6N.js";let g=null,$=null;function M(){return $??($=Promise.all([L(()=>import("./katex-DkKDou_j.js"),[]),L(()=>Promise.resolve({}),__vite__mapDeps([0]))]).then(([n])=>(g=n.default,g))),$}const O=new Set([",",";",":","!"," ","quad","qquad","enspace","thinspace"]),S={a:"á",e:"é",i:"í",o:"ó",u:"ú",y:"ý",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú",Y:"Ý"},b={a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"},w={a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"},k={a:"ä",e:"ë",i:"ï",o:"ö",u:"ü",y:"ÿ",A:"Ä",E:"Ë",I:"Ï",O:"Ö",U:"Ü",Y:"Ÿ"},N={"'":S,"`":b,"^":w,'"':k,"~":{n:"ñ",N:"Ñ"}},T={ss:"ß",ae:"æ",AE:"Æ",oe:"œ",OE:"Œ",o:"ø",O:"Ø",l:"ł",L:"Ł"};function I(n,i){var e;return((e=N[n])==null?void 0:e[i])??null}function v(n){const i=[];let e=0,t="";const r=()=>{t&&(i.push({type:"text",content:t}),t="")};for(;e=n.length)return{name:"",end:e};if(!/[a-zA-Z]/.test(n[e]))return{name:n[e],end:e+1};const t=e;for(;e=n.length)return null;if(n[i+1]==="{"){const t=d(n,i+1);return t?{end:t.end}:null}return/[A-Za-z0-9+\-=.]/.test(n[i+1])?{end:i+2}:null}function y(n,i){let e=i;if(n[e]==="\\"){const{name:o,end:s}=j(n,e);if(!o)return null;if(e=s,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(;oe.length-i.length)}function X(n,i,e){const t=z(i);if(!t.length)return[n];const r=t.map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),o=new RegExp(`(${r.join("|")})`,"gi");return n.split(o).filter(Boolean).map((s,a)=>t.some(p=>p.toLocaleLowerCase()===s.toLocaleLowerCase())?u.jsx("mark",{children:s},`${e}-mark-${a}`):s)}function m(n,i,e){const t=[];let r=0,o=0;const s=()=>`${i}-${o++}`,a=(p,f)=>p==="strong"?u.jsx("strong",{children:f},s()):u.jsx("em",{children:f},s());for(;rr&&t.push(...X(n.slice(r,f),e,s())),r=f}return t}function _({latex:n,display:i}){const[e,t]=A.useState(g);A.useEffect(()=>{if(e)return;let o=!0;return M().then(s=>{o&&t(()=>s)}),()=>{o=!1}},[e]);const r=A.useMemo(()=>{if(e)try{return e.renderToString(n.trim(),{displayMode:i,throwOnError:!1})}catch{return null}},[e,n,i]);return r===void 0?u.jsx(u.Fragment,{children:n}):r?u.jsx("span",{className:i?"katex-display":void 0,dangerouslySetInnerHTML:{__html:r}}):u.jsx(u.Fragment,{children:i?`$$${n}$$`:`$${n}$`})}function D(n,i){const e=v(n),t=[];return e.forEach((r,o)=>{const s=`latex-${o}`;if(r.type==="text"){const a=m(r.content,s,i);a.length===1?t.push(a[0]):a.length>1&&t.push(u.jsx(A.Fragment,{children:a},s));return}if(r.type==="display"){t.push(u.jsx(_,{latex:r.content,display:!0},s));return}t.push(u.jsx(_,{latex:r.content,display:!1},s))}),t.length===1?t[0]:u.jsx(u.Fragment,{children:t})}const P=({text:n,className:i="",highlight:e})=>{const t=A.useMemo(()=>D(n,e),[n,e]);return u.jsx("span",{className:i,children:t})},Z=({title:n,className:i="",highlight:e})=>u.jsx(P,{text:n,className:i,highlight:e});export{Z as L,P as a}; +import{j as u,f as A,a7 as L}from"./index-CxhY4zQ1.js";let g=null,$=null;function M(){return $??($=Promise.all([L(()=>import("./katex-DkKDou_j.js"),[]),L(()=>Promise.resolve({}),__vite__mapDeps([0]))]).then(([n])=>(g=n.default,g))),$}const O=new Set([",",";",":","!"," ","quad","qquad","enspace","thinspace"]),S={a:"á",e:"é",i:"í",o:"ó",u:"ú",y:"ý",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú",Y:"Ý"},b={a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"},w={a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"},k={a:"ä",e:"ë",i:"ï",o:"ö",u:"ü",y:"ÿ",A:"Ä",E:"Ë",I:"Ï",O:"Ö",U:"Ü",Y:"Ÿ"},N={"'":S,"`":b,"^":w,'"':k,"~":{n:"ñ",N:"Ñ"}},T={ss:"ß",ae:"æ",AE:"Æ",oe:"œ",OE:"Œ",o:"ø",O:"Ø",l:"ł",L:"Ł"};function I(n,i){var e;return((e=N[n])==null?void 0:e[i])??null}function v(n){const i=[];let e=0,t="";const r=()=>{t&&(i.push({type:"text",content:t}),t="")};for(;e=n.length)return{name:"",end:e};if(!/[a-zA-Z]/.test(n[e]))return{name:n[e],end:e+1};const t=e;for(;e=n.length)return null;if(n[i+1]==="{"){const t=d(n,i+1);return t?{end:t.end}:null}return/[A-Za-z0-9+\-=.]/.test(n[i+1])?{end:i+2}:null}function y(n,i){let e=i;if(n[e]==="\\"){const{name:o,end:s}=j(n,e);if(!o)return null;if(e=s,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(;oe.length-i.length)}function X(n,i,e){const t=z(i);if(!t.length)return[n];const r=t.map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),o=new RegExp(`(${r.join("|")})`,"gi");return n.split(o).filter(Boolean).map((s,a)=>t.some(p=>p.toLocaleLowerCase()===s.toLocaleLowerCase())?u.jsx("mark",{children:s},`${e}-mark-${a}`):s)}function m(n,i,e){const t=[];let r=0,o=0;const s=()=>`${i}-${o++}`,a=(p,f)=>p==="strong"?u.jsx("strong",{children:f},s()):u.jsx("em",{children:f},s());for(;rr&&t.push(...X(n.slice(r,f),e,s())),r=f}return t}function _({latex:n,display:i}){const[e,t]=A.useState(g);A.useEffect(()=>{if(e)return;let o=!0;return M().then(s=>{o&&t(()=>s)}),()=>{o=!1}},[e]);const r=A.useMemo(()=>{if(e)try{return e.renderToString(n.trim(),{displayMode:i,throwOnError:!1})}catch{return null}},[e,n,i]);return r===void 0?u.jsx(u.Fragment,{children:n}):r?u.jsx("span",{className:i?"katex-display":void 0,dangerouslySetInnerHTML:{__html:r}}):u.jsx(u.Fragment,{children:i?`$$${n}$$`:`$${n}$`})}function D(n,i){const e=v(n),t=[];return e.forEach((r,o)=>{const s=`latex-${o}`;if(r.type==="text"){const a=m(r.content,s,i);a.length===1?t.push(a[0]):a.length>1&&t.push(u.jsx(A.Fragment,{children:a},s));return}if(r.type==="display"){t.push(u.jsx(_,{latex:r.content,display:!0},s));return}t.push(u.jsx(_,{latex:r.content,display:!1},s))}),t.length===1?t[0]:u.jsx(u.Fragment,{children:t})}const P=({text:n,className:i="",highlight:e})=>{const t=A.useMemo(()=>D(n,e),[n,e]);return u.jsx("span",{className:i,children:t})},Z=({title:n,className:i="",highlight:e})=>u.jsx(P,{text:n,className:i,highlight:e});export{Z as L,P as a}; diff --git a/assets/MarkdownText-BfMP6CxP.js b/assets/MarkdownText-D0WkOxKi.js similarity index 86% rename from assets/MarkdownText-BfMP6CxP.js rename to assets/MarkdownText-D0WkOxKi.js index 4c331a704908001f623c6d60f58d70b3672e0a8b..642797cfbbc5f48d480ad26e90d7643e71e8d719 100644 --- a/assets/MarkdownText-BfMP6CxP.js +++ b/assets/MarkdownText-D0WkOxKi.js @@ -1 +1 @@ -import{w as c,j as o,L as u}from"./index-3CfcAX6N.js";/* empty css */import{r as p,a as m,P as d}from"./PaperPreviewLink-BJAulcHJ.js";import{M as h}from"./index-DGr54pyn.js";import{r as f}from"./index-C8DcqbS3.js";function w(e){return(e??"").split(",").map(a=>a.trim().toLowerCase()).filter(Boolean)}const x=new Set(["paperswithcode.co","www.paperswithcode.co","localhost","127.0.0.1",...w(void 0)]),P=["/methods","/paper","/papers","/tasks","/benchmark","/conferences"];function k(e,a=window.location.origin){if(!e)return null;let t;if(e.startsWith("/"))t=e;else try{const n=new URL(e,a);if(!x.has(n.hostname))return null;t=`${n.pathname}${n.search}${n.hash}`}catch{return null}const r=t.split(/[?#]/,1)[0];return P.some(n=>r===n||r.startsWith(`${n}/`))?t:null}function I(e){const t=e.split(/[?#]/,1)[0].match(/^\/papers?\/([^/]+)$/);if(!t||t[1].includes("%"))return null;const r=t[1],n=/^\d{4}[.-]\d{4,5}(?:v\d+)?$/.test(r),s=/^[1-9]\d*$/.test(r);return!n&&!s?null:c(r)}const M=({text:e,className:a=""})=>o.jsx("div",{className:a,children:o.jsx(h,{remarkPlugins:[f,m],rehypePlugins:[p],components:{a:({href:t,children:r,node:n,...s})=>{const i=k(t);if(i){const l=I(i);return l?o.jsx(d,{routeId:l,to:i,...s,children:r}):o.jsx(u,{to:i,...s,children:r})}return o.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",...s,children:r})}},children:e})});export{M,k as r}; +import{w as c,j as o,L as u}from"./index-CxhY4zQ1.js";/* empty css */import{r as p,a as m,P as d}from"./PaperPreviewLink-Y2LI3xZW.js";import{M as h}from"./index-BCjs92mB.js";import{r as f}from"./index-mv_8ovfA.js";function w(e){return(e??"").split(",").map(a=>a.trim().toLowerCase()).filter(Boolean)}const x=new Set(["paperswithcode.co","www.paperswithcode.co","localhost","127.0.0.1",...w(void 0)]),P=["/methods","/paper","/papers","/tasks","/benchmark","/conferences"];function k(e,a=window.location.origin){if(!e)return null;let t;if(e.startsWith("/"))t=e;else try{const n=new URL(e,a);if(!x.has(n.hostname))return null;t=`${n.pathname}${n.search}${n.hash}`}catch{return null}const r=t.split(/[?#]/,1)[0];return P.some(n=>r===n||r.startsWith(`${n}/`))?t:null}function I(e){const t=e.split(/[?#]/,1)[0].match(/^\/papers?\/([^/]+)$/);if(!t||t[1].includes("%"))return null;const r=t[1],n=/^\d{4}[.-]\d{4,5}(?:v\d+)?$/.test(r),s=/^[1-9]\d*$/.test(r);return!n&&!s?null:c(r)}const M=({text:e,className:a=""})=>o.jsx("div",{className:a,children:o.jsx(h,{remarkPlugins:[f,m],rehypePlugins:[p],components:{a:({href:t,children:r,node:n,...s})=>{const i=k(t);if(i){const l=I(i);return l?o.jsx(d,{routeId:l,to:i,...s,children:r}):o.jsx(u,{to:i,...s,children:r})}return o.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",...s,children:r})}},children:e})});export{M,k as r}; diff --git a/assets/McpShowcase-CcyaF6wZ.js b/assets/McpShowcase-CXm3UZ_U.js similarity index 84% rename from assets/McpShowcase-CcyaF6wZ.js rename to assets/McpShowcase-CXm3UZ_U.js index 1beba7227028bc118aa0c00f15c99aea9ef832f9..49338f01075c8a4cc7674e317364a298dc769990 100644 --- a/assets/McpShowcase-CcyaF6wZ.js +++ b/assets/McpShowcase-CXm3UZ_U.js @@ -1 +1 @@ -import{j as e,L as t}from"./index-3CfcAX6N.js";import{A as a}from"./AgentLogos-06t31xxf.js";function n({className:s="",canNavigate:r}){return e.jsxs("div",{className:`sidebar-section sidebar-section-tools ${s}`.trim(),children:[e.jsx("div",{className:"sidebar-label",children:"Use PwC with your agent"}),e.jsxs(t,{to:"/mcp",className:"action-btn sidebar-tools-mcp",title:"Connect Claude, Codex, Cursor, or OpenCode to the PwC MCP server",onClick:o=>{r&&!r()&&o.preventDefault()},children:["MCP server",e.jsx(a,{})]}),e.jsxs("p",{className:"sidebar-tools-copy",children:["Search papers, benchmarks, and leaderboards from any MCP client, or from the terminal with the"," ",e.jsxs("a",{href:"https://github.com/huggingface/pwc-cli",target:"_blank",rel:"noreferrer",children:[e.jsx("code",{children:"pwc"})," CLI"]}),"."]})]})}export{n as M}; +import{j as e,L as t}from"./index-CxhY4zQ1.js";import{A as a}from"./AgentLogos-C9q7zZc4.js";function n({className:s="",canNavigate:r}){return e.jsxs("div",{className:`sidebar-section sidebar-section-tools ${s}`.trim(),children:[e.jsx("div",{className:"sidebar-label",children:"Use PwC with your agent"}),e.jsxs(t,{to:"/mcp",className:"action-btn sidebar-tools-mcp",title:"Connect Claude, Codex, Cursor, or OpenCode to the PwC MCP server",onClick:o=>{r&&!r()&&o.preventDefault()},children:["MCP server",e.jsx(a,{})]}),e.jsxs("p",{className:"sidebar-tools-copy",children:["Search papers, benchmarks, and leaderboards from any MCP client, or from the terminal with the"," ",e.jsxs("a",{href:"https://github.com/huggingface/pwc-cli",target:"_blank",rel:"noreferrer",children:[e.jsx("code",{children:"pwc"})," CLI"]}),"."]})]})}export{n as M}; diff --git a/assets/McpView-DLNB1sUw.js b/assets/McpView-DfOBSpbX.js similarity index 97% rename from assets/McpView-DLNB1sUw.js rename to assets/McpView-DfOBSpbX.js index 1f7e65c171b5673b820dcc2d25b9a8b986b4ab82..fbeb8a0f5e26dc8a90f7dc4afff64a026b728236 100644 --- a/assets/McpView-DLNB1sUw.js +++ b/assets/McpView-DfOBSpbX.js @@ -1,4 +1,4 @@ -import{c as b,b as x,V as m,j as e,C as j}from"./index-3CfcAX6N.js";import{u as g,f as y}from"./useDocumentTitle-BnA1kM_d.js";import{q as f}from"./queryOptions-C9woPjwX.js";import{G as v}from"./github-vz0wxUgq.js";import{E as o}from"./external-link-_7BCdt0S.js";import{C as w}from"./copy-BCi4szva.js";/** +import{c as b,b as x,V as m,j as e,C as j}from"./index-CxhY4zQ1.js";import{u as g,f as y}from"./useDocumentTitle-CC3zTSwA.js";import{q as f}from"./queryOptions-C9woPjwX.js";import{G as v}from"./github-Bv102r_G.js";import{E as o}from"./external-link-UhGsnDEF.js";import{C as w}from"./copy-Dpy50x4G.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/MethodDetailView-fHVzs8OA.js b/assets/MethodDetailView-DX6nB6xF.js similarity index 92% rename from assets/MethodDetailView-fHVzs8OA.js rename to assets/MethodDetailView-DX6nB6xF.js index 6604a850ebc695c25f74d40ec17c1e74448f5434..4bc456a986c9f4b0beb74b32f70445706cbd3006 100644 --- a/assets/MethodDetailView-fHVzs8OA.js +++ b/assets/MethodDetailView-DX6nB6xF.js @@ -1 +1 @@ -import{j as e,f as I,u as P,b as k,p as V,L as _,q as A,T as v}from"./index-3CfcAX6N.js";import{R as q}from"./ResearchFollowButton-YEXlvC8K.js";import{M as H}from"./SotaBadges-BqZMAXyY.js";import{u as Q,b as K,P as R}from"./PaperFeed-2dSUzcA2.js";import{r as G,M as L}from"./MarkdownText-BfMP6CxP.js";import{c as b}from"./catalog-B47DuClX.js";import{p as U}from"./papers-BsYlGUQi.js";import{i as O}from"./apiErrors-XoIVpN_S.js";import{s as W}from"./slug-BpH-Nkvz.js";import{t as Z}from"./transform-Dx-N8Yyj.js";import{u as X}from"./usePapers-CHoHKyWP.js";import{S as N}from"./skeleton-CQbSjC3L.js";import{A as Y,a as J}from"./alert-BXZ4lnnf.js";import{s as ee}from"./safeExternalHref-CkBrsh84.js";import te from"./NotFound-DXa9p6DX.js";import"./researchTopic-Z4AJDMN7.js";import"./useMutation-CKC6OFhA.js";import"./plus-CiDEk52y.js";import"./colors-BkWRhvFI.js";import"./PaperCard-BZtXccuT.js";import"./AuthorAvatar-DYaYcwPm.js";import"./Icon-C0d9p4Q2.js";import"./LatexTitle-DvPeLepK.js";import"./popover-Dwe6SY1f.js";import"./useIntersectionObserver-wAZWG4G7.js";/* empty css */import"./PaperPreviewLink-BJAulcHJ.js";import"./index-DGr54pyn.js";import"./index-C8DcqbS3.js";import"./katex-DkKDou_j.js";import"./hover-card-DOKhkRf9.js";import"./curation-BZoIvsHD.js";import"./useInfiniteQuery-DYwUEaoz.js";const t={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"},n=({x:s,y:r,w:l,h:d,fill:o,stroke:p,label:h,fontSize:c=10})=>e.jsxs("g",{children:[e.jsx("rect",{x:s,y:r,width:l,height:d,rx:"3",ry:"3",fill:o,stroke:p,strokeWidth:"1"}),e.jsx("text",{x:s+l/2,y:r+d/2,fontSize:c,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:h})]}),se=()=>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:t.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(n,{x:140,y:40,w:80,h:26,fill:t.yellow,stroke:t.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:t.ink}),e.jsx(n,{x:140,y:80,w:80,h:26,fill:t.green,stroke:t.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:t.ink}),e.jsx(n,{x:140,y:120,w:80,h:26,fill:t.purple,stroke:t.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:t.ink}),e.jsx(n,{x:140,y:160,w:80,h:26,fill:t.blue,stroke:t.blueS,label:"Scale ÷√dₖ",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:t.ink}),e.jsx(n,{x:140,y:200,w:80,h:26,fill:t.yellow,stroke:t.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:t.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:t.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:t.ink}),e.jsx(n,{x:100,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"Q",fontSize:13}),e.jsx(n,{x:160,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"K",fontSize:13}),e.jsx(n,{x:220,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),ae=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Contrastive learning"}),e.jsx(n,{x:120,y:40,w:120,h:26,fill:t.blue,stroke:t.blueS,label:"Input x",fontSize:11}),e.jsx("path",{d:"M180 66 V76 M90 76 H270 M90 76 V88 M270 76 V88",stroke:t.ink}),e.jsx(n,{x:35,y:88,w:110,h:26,fill:t.yellow,stroke:t.yellowS,label:"Augment t₁",fontSize:11}),e.jsx(n,{x:215,y:88,w:110,h:26,fill:t.yellow,stroke:t.yellowS,label:"Augment t₂",fontSize:11}),e.jsx("path",{d:"M90 114 V138 M270 114 V138",stroke:t.ink}),e.jsx(n,{x:35,y:138,w:110,h:26,fill:t.orange,stroke:t.orangeS,label:"Encoder f",fontSize:11}),e.jsx(n,{x:215,y:138,w:110,h:26,fill:t.orange,stroke:t.orangeS,label:"Encoder f",fontSize:11}),e.jsx("text",{x:"180",y:"155",fontSize:"9",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"shared weights"}),e.jsx("path",{d:"M90 164 V188 M270 164 V188",stroke:t.ink}),e.jsx(n,{x:35,y:188,w:110,h:26,fill:t.purple,stroke:t.purpleS,label:"Projection g",fontSize:11}),e.jsx(n,{x:215,y:188,w:110,h:26,fill:t.purple,stroke:t.purpleS,label:"Projection g",fontSize:11}),e.jsx("path",{d:"M90 214 V238 M270 214 V238",stroke:t.ink}),e.jsx(n,{x:35,y:238,w:110,h:26,fill:t.pink,stroke:t.pinkS,label:"z₁",fontSize:13}),e.jsx(n,{x:215,y:238,w:110,h:26,fill:t.pink,stroke:t.pinkS,label:"z₂",fontSize:13}),e.jsx("path",{d:"M145 251 H215",stroke:t.greenS,strokeWidth:"1.5",strokeDasharray:"4 3"}),e.jsx("text",{x:"180",y:"244",fontSize:"9",fontFamily:"var(--sans)",fill:t.greenS,textAnchor:"middle",children:"attract"}),e.jsx("text",{x:"180",y:"318",fontSize:"12",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"Positive pair: pull together"}),e.jsx("text",{x:"180",y:"336",fontSize:"12",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"Other samples: push apart"}),e.jsx("text",{x:"180",y:"370",fontSize:"11",fontFamily:"var(--serif)",fill:t.faint,textAnchor:"middle",children:"InfoNCE: maximize sim(z₁, z₂) / τ"})]}),re=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],le=()=>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:t.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:t.faint,strokeWidth:"1"}),re.map(([s,r],l)=>{const d=92+l*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:d,fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,dominantBaseline:"middle",children:s}),r?e.jsx("text",{x:"138",y:d,fontSize:"8.5",fontFamily:"var(--mono)",fill:t.faint,dominantBaseline:"middle",children:r}):null]},s)})]}),ie={attention:se,"contrastive-learning":ae,"agent-skills":le},ne=({method:s})=>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:t.faint,textAnchor:"middle",children:s.name||"method"}),e.jsx(n,{x:80,y:70,w:200,h:50,fill:t.blue,stroke:t.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:t.ink}),e.jsx(n,{x:80,y:150,w:200,h:70,fill:t.orange,stroke:t.orangeS,label:s.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:t.ink}),e.jsx(n,{x:80,y:250,w:200,h:50,fill:t.purple,stroke:t.purpleS,label:"Output",fontSize:12})]}),oe=({method:s})=>{const r=(s.slug||"").toLowerCase(),l=ie[r];if(l)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(l,{})});if(s.image_url){const d=r==="transformer"||r==="gpt-4"||r==="gpt-4o"||r==="multi-head-attention"?" method-figure-svg--compact":r==="rpn"?" method-figure-svg--scaled-80":"";return e.jsx("div",{className:`method-figure-svg method-figure-svg--image${d}`,children:e.jsx("img",{className:"method-figure-img",src:s.image_url,alt:`${s.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(ne,{method:s})})},w=720,M=138,x={top:8,right:10,bottom:25,left:36},E=56,ce=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),de=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),F=s=>ce.format(new Date(`${s}T00:00:00Z`)),me=(s,r)=>{if(s===0)return new Set;const l=s>48?12:s>36?6:s>18?3:2,d=Math.max(1,Math.ceil(E/r)),o=Math.max(l,d),p=s-1,h=new Set([0,p]);for(let c=o;c=E&&h.add(c);return h},T=s=>{if(s.coverage_status===void 0||["complete","not_applicable"].includes(s.coverage_status))return null;const r=s.processed_paper_count!==void 0&&s.eligible_paper_count!==void 0?`; ${s.processed_paper_count.toLocaleString()} of ${s.eligible_paper_count.toLocaleString()} eligible papers processed`:"";return`Historical tagging ${s.coverage_status==="failed"?"needs retry":"in progress"}${r}`},he=({history:s,methodName:r})=>{const[l,d]=I.useState(null),o=Math.max(1,...s.map(i=>i.paper_count)),p=w-x.left-x.right,h=M-x.top-x.bottom,c=s.length?p/s.length:p,a=Math.max(2,c*.68),g=me(s.length,c),j=Array.from(new Set([0,Math.ceil(o/2),o])),f=l==null?null:s[l],y=f?T(f):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${w} ${M}`,role:"group","aria-label":`${r}: papers mentioning this method by publication month`,children:[e.jsxs("title",{children:[r,": papers mentioning this method by publication month"]}),j.map(i=>{const m=x.top+h-i/o*h;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:x.left,x2:w-x.right,y1:m,y2:m}),e.jsx("text",{className:"method-usage-y-label",x:x.left-8,y:m+3,textAnchor:"end",children:i})]},i)}),s.map((i,m)=>{const u=i.paper_count/o*h,S=i.paper_count>0?Math.max(1,u):0,C=x.left+c*m+(c-a)/2,D=x.top+h-S,$=l===m,B=m===s.length-1,z=T(i);return e.jsxs("g",{className:`method-usage-bar${$?" is-active":""}${B?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${F(i.start_date)}: ${i.paper_count} ${i.paper_count===1?"paper":"papers"}${z?`. ${z}`:""}`,onMouseEnter:()=>d(m),onMouseLeave:()=>d(null),onFocus:()=>d(m),onBlur:()=>d(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:x.left+c*m,y:x.top,width:c,height:h}),e.jsx("rect",{className:"method-usage-bar-mark",x:C,y:D,width:a,height:S,rx:"1.5"})]},i.start_date)}),s.map((i,m)=>g.has(m)?e.jsx("text",{className:"method-usage-x-label",x:x.left+c*(m+.5),y:M-11,textAnchor:"middle",children:s.length>48?de.format(new Date(`${i.start_date}T00:00:00Z`)):F(i.start_date)},i.start_date):null)]}),f&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:F(f.start_date)}),e.jsxs("span",{children:[f.paper_count," ",f.paper_count===1?"paper":"papers",l===s.length-1?" · month to date":""]}),e.jsxs("span",{children:[(f.catalog_share??0).toFixed(2),"% of"," ",(f.catalog_paper_count??0).toLocaleString()," catalog papers"]}),y&&e.jsx("span",{children:y})]})]})},Ge=()=>{var y,i,m;const{methodSlug:s}=P(),r=Q(),l=k({queryKey:A.method(s),queryFn:()=>b.getMethod(s),enabled:!!s,staleTime:v}),d=k({queryKey:A.areas,queryFn:()=>b.listAreas({page_size:50,ordering:"name"}),enabled:!!((y=l.data)!=null&&y.area_id),staleTime:v}),o=k({queryKey:["method-trend",s],queryFn:()=>b.methodTrend(s),enabled:!!s,staleTime:v}),p=X([...V.feeds.method,s,r.filters],u=>U.forMethod(s,{...r.filters,page:u,page_size:20,repository_limit:1}),{enabled:!!s}),h=k({queryKey:["related-methods",s],queryFn:()=>b.relatedMethods(s),enabled:!!s,staleTime:v}),c=I.useMemo(()=>{var u;return((u=p.data)==null?void 0:u.pages.flatMap(S=>S.results.map(Z)))??[]},[p.data]);if(l.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(N,{className:"h-12 w-1/2 mb-4"}),e.jsx(N,{className:"h-64 w-full"})]});if(O(l.error))return e.jsx(te,{});if(l.error||!l.data)return e.jsx("div",{className:"page",children:e.jsx(Y,{variant:"destructive",children:e.jsx(J,{children:"Method not found."})})});const a=l.data,g=(i=d.data)==null?void 0:i.results.find(u=>u.id===a.area_id),j=G(a.source_url),f=j?null:ee(a.source_url);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(_,{to:"/methods",children:"Methods"}),g&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(_,{to:`/methods#area-${W(g.name)}`,children:g.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:a.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${a.slug==="grokking"||a.slug==="latent-reasoning"||a.slug==="world-action-models"?" method-hero-grid--wide-figure":""}`,children:[e.jsxs("div",{children:[e.jsx("div",{className:"tag-hero-eyebrow",children:"METHOD"}),e.jsx("h1",{className:"tag-hero-title method-hero-title",children:a.name}),e.jsx(q,{kind:"method",entityId:a.id}),a.full_name&&!a.name.includes(a.full_name)&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:a.full_name}),a.description&&e.jsx(L,{className:"method-description",text:a.description}),a.source_url&&a.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),j?e.jsxs(_,{className:"method-source-link",to:j,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):f?e.jsxs("a",{className:"method-source-link",href:f,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):e.jsxs("div",{className:"method-source-link is-static",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]})]}),e.jsxs("div",{className:"tag-hero-meta",children:[e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Papers mentioning"}),e.jsx("span",{className:"value",children:(a.paper_count??0).toLocaleString()})]}),o.data&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Recent mentions"}),e.jsxs("span",{className:"value",children:[(o.data.recent_paper_count*30/o.data.recent_days).toFixed(1),e.jsx("small",{children:"/mo"})]}),!o.data.comparison_complete&&e.jsx("span",{title:"Tagging is still catching up. This rate reflects mentions found so far.",children:"Partial coverage"})]}),a.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:a.introduced_year})]})]}),o.isLoading?e.jsx(N,{className:"h-36 w-full method-trend-skeleton"}):o.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:o.data.recent_paper_count}),e.jsxs("span",{children:["papers / ",o.data.recent_days,"d"]})]})]}),e.jsx(he,{history:o.data.history,methodName:a.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(oe,{method:a}),a.image_credit&&e.jsx("figcaption",{children:e.jsx(L,{className:"method-image-credit",text:a.image_credit})})]})]}),(((m=h.data)==null?void 0:m.results.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),h.data.results.map(u=>e.jsx(H,{method:{slug:u.slug,name:u.name}},u.id))]}),e.jsx(K,{feed:r,children:e.jsxs("div",{className:"results-count",children:[c.length," papers mentioning ",a.name]})}),e.jsx(R,{query:p,cards:c,empty:"No papers tagged with this method yet."})]})};export{Ge as default}; +import{j as e,f as I,u as P,b as k,p as V,L as _,q as A,T as v}from"./index-CxhY4zQ1.js";import{R as q}from"./ResearchFollowButton-DPFVPZ0U.js";import{M as H}from"./SotaBadges-EnDhSaVO.js";import{u as Q,b as K,P as R}from"./PaperFeed-D1egUlu_.js";import{r as G,M as L}from"./MarkdownText-D0WkOxKi.js";import{c as b}from"./catalog-DCEU6WpP.js";import{p as U}from"./papers-BDxSKSYJ.js";import{i as O}from"./apiErrors-D2bSY3Dq.js";import{s as W}from"./slug-BpH-Nkvz.js";import{t as Z}from"./transform-DehuZQh7.js";import{u as X}from"./usePapers-Cv13R7ph.js";import{S as N}from"./skeleton-DdKViE4r.js";import{A as Y,a as J}from"./alert-C-NbJX4N.js";import{s as ee}from"./safeExternalHref-CkBrsh84.js";import te from"./NotFound-BeRulOFd.js";import"./researchTopic-DXZVIvAq.js";import"./useMutation-BzRfwboV.js";import"./plus-CEkdlNSn.js";import"./colors-BkWRhvFI.js";import"./PaperCard-DeWmBrg8.js";import"./AuthorAvatar-DPz8YQ5Z.js";import"./Icon-XOOkUEUX.js";import"./LatexTitle-BqNrCKu8.js";import"./popover-DgW_tN02.js";import"./useIntersectionObserver-ZqjUJuPc.js";/* empty css */import"./PaperPreviewLink-Y2LI3xZW.js";import"./index-BCjs92mB.js";import"./index-mv_8ovfA.js";import"./katex-DkKDou_j.js";import"./hover-card-CqKeZcpY.js";import"./curation-D2sqKAqC.js";import"./useInfiniteQuery-vHEhIVF_.js";const t={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"},n=({x:s,y:r,w:l,h:d,fill:o,stroke:p,label:h,fontSize:c=10})=>e.jsxs("g",{children:[e.jsx("rect",{x:s,y:r,width:l,height:d,rx:"3",ry:"3",fill:o,stroke:p,strokeWidth:"1"}),e.jsx("text",{x:s+l/2,y:r+d/2,fontSize:c,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:h})]}),se=()=>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:t.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(n,{x:140,y:40,w:80,h:26,fill:t.yellow,stroke:t.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:t.ink}),e.jsx(n,{x:140,y:80,w:80,h:26,fill:t.green,stroke:t.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:t.ink}),e.jsx(n,{x:140,y:120,w:80,h:26,fill:t.purple,stroke:t.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:t.ink}),e.jsx(n,{x:140,y:160,w:80,h:26,fill:t.blue,stroke:t.blueS,label:"Scale ÷√dₖ",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:t.ink}),e.jsx(n,{x:140,y:200,w:80,h:26,fill:t.yellow,stroke:t.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:t.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:t.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:t.ink}),e.jsx(n,{x:100,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"Q",fontSize:13}),e.jsx(n,{x:160,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"K",fontSize:13}),e.jsx(n,{x:220,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),ae=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Contrastive learning"}),e.jsx(n,{x:120,y:40,w:120,h:26,fill:t.blue,stroke:t.blueS,label:"Input x",fontSize:11}),e.jsx("path",{d:"M180 66 V76 M90 76 H270 M90 76 V88 M270 76 V88",stroke:t.ink}),e.jsx(n,{x:35,y:88,w:110,h:26,fill:t.yellow,stroke:t.yellowS,label:"Augment t₁",fontSize:11}),e.jsx(n,{x:215,y:88,w:110,h:26,fill:t.yellow,stroke:t.yellowS,label:"Augment t₂",fontSize:11}),e.jsx("path",{d:"M90 114 V138 M270 114 V138",stroke:t.ink}),e.jsx(n,{x:35,y:138,w:110,h:26,fill:t.orange,stroke:t.orangeS,label:"Encoder f",fontSize:11}),e.jsx(n,{x:215,y:138,w:110,h:26,fill:t.orange,stroke:t.orangeS,label:"Encoder f",fontSize:11}),e.jsx("text",{x:"180",y:"155",fontSize:"9",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"shared weights"}),e.jsx("path",{d:"M90 164 V188 M270 164 V188",stroke:t.ink}),e.jsx(n,{x:35,y:188,w:110,h:26,fill:t.purple,stroke:t.purpleS,label:"Projection g",fontSize:11}),e.jsx(n,{x:215,y:188,w:110,h:26,fill:t.purple,stroke:t.purpleS,label:"Projection g",fontSize:11}),e.jsx("path",{d:"M90 214 V238 M270 214 V238",stroke:t.ink}),e.jsx(n,{x:35,y:238,w:110,h:26,fill:t.pink,stroke:t.pinkS,label:"z₁",fontSize:13}),e.jsx(n,{x:215,y:238,w:110,h:26,fill:t.pink,stroke:t.pinkS,label:"z₂",fontSize:13}),e.jsx("path",{d:"M145 251 H215",stroke:t.greenS,strokeWidth:"1.5",strokeDasharray:"4 3"}),e.jsx("text",{x:"180",y:"244",fontSize:"9",fontFamily:"var(--sans)",fill:t.greenS,textAnchor:"middle",children:"attract"}),e.jsx("text",{x:"180",y:"318",fontSize:"12",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"Positive pair: pull together"}),e.jsx("text",{x:"180",y:"336",fontSize:"12",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"Other samples: push apart"}),e.jsx("text",{x:"180",y:"370",fontSize:"11",fontFamily:"var(--serif)",fill:t.faint,textAnchor:"middle",children:"InfoNCE: maximize sim(z₁, z₂) / τ"})]}),re=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],le=()=>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:t.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:t.faint,strokeWidth:"1"}),re.map(([s,r],l)=>{const d=92+l*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:d,fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,dominantBaseline:"middle",children:s}),r?e.jsx("text",{x:"138",y:d,fontSize:"8.5",fontFamily:"var(--mono)",fill:t.faint,dominantBaseline:"middle",children:r}):null]},s)})]}),ie={attention:se,"contrastive-learning":ae,"agent-skills":le},ne=({method:s})=>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:t.faint,textAnchor:"middle",children:s.name||"method"}),e.jsx(n,{x:80,y:70,w:200,h:50,fill:t.blue,stroke:t.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:t.ink}),e.jsx(n,{x:80,y:150,w:200,h:70,fill:t.orange,stroke:t.orangeS,label:s.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:t.ink}),e.jsx(n,{x:80,y:250,w:200,h:50,fill:t.purple,stroke:t.purpleS,label:"Output",fontSize:12})]}),oe=({method:s})=>{const r=(s.slug||"").toLowerCase(),l=ie[r];if(l)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(l,{})});if(s.image_url){const d=r==="transformer"||r==="gpt-4"||r==="gpt-4o"||r==="multi-head-attention"?" method-figure-svg--compact":r==="rpn"?" method-figure-svg--scaled-80":"";return e.jsx("div",{className:`method-figure-svg method-figure-svg--image${d}`,children:e.jsx("img",{className:"method-figure-img",src:s.image_url,alt:`${s.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(ne,{method:s})})},w=720,M=138,x={top:8,right:10,bottom:25,left:36},E=56,ce=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),de=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),F=s=>ce.format(new Date(`${s}T00:00:00Z`)),me=(s,r)=>{if(s===0)return new Set;const l=s>48?12:s>36?6:s>18?3:2,d=Math.max(1,Math.ceil(E/r)),o=Math.max(l,d),p=s-1,h=new Set([0,p]);for(let c=o;c=E&&h.add(c);return h},T=s=>{if(s.coverage_status===void 0||["complete","not_applicable"].includes(s.coverage_status))return null;const r=s.processed_paper_count!==void 0&&s.eligible_paper_count!==void 0?`; ${s.processed_paper_count.toLocaleString()} of ${s.eligible_paper_count.toLocaleString()} eligible papers processed`:"";return`Historical tagging ${s.coverage_status==="failed"?"needs retry":"in progress"}${r}`},he=({history:s,methodName:r})=>{const[l,d]=I.useState(null),o=Math.max(1,...s.map(i=>i.paper_count)),p=w-x.left-x.right,h=M-x.top-x.bottom,c=s.length?p/s.length:p,a=Math.max(2,c*.68),g=me(s.length,c),j=Array.from(new Set([0,Math.ceil(o/2),o])),f=l==null?null:s[l],y=f?T(f):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${w} ${M}`,role:"group","aria-label":`${r}: papers mentioning this method by publication month`,children:[e.jsxs("title",{children:[r,": papers mentioning this method by publication month"]}),j.map(i=>{const m=x.top+h-i/o*h;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:x.left,x2:w-x.right,y1:m,y2:m}),e.jsx("text",{className:"method-usage-y-label",x:x.left-8,y:m+3,textAnchor:"end",children:i})]},i)}),s.map((i,m)=>{const u=i.paper_count/o*h,S=i.paper_count>0?Math.max(1,u):0,C=x.left+c*m+(c-a)/2,D=x.top+h-S,$=l===m,B=m===s.length-1,z=T(i);return e.jsxs("g",{className:`method-usage-bar${$?" is-active":""}${B?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${F(i.start_date)}: ${i.paper_count} ${i.paper_count===1?"paper":"papers"}${z?`. ${z}`:""}`,onMouseEnter:()=>d(m),onMouseLeave:()=>d(null),onFocus:()=>d(m),onBlur:()=>d(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:x.left+c*m,y:x.top,width:c,height:h}),e.jsx("rect",{className:"method-usage-bar-mark",x:C,y:D,width:a,height:S,rx:"1.5"})]},i.start_date)}),s.map((i,m)=>g.has(m)?e.jsx("text",{className:"method-usage-x-label",x:x.left+c*(m+.5),y:M-11,textAnchor:"middle",children:s.length>48?de.format(new Date(`${i.start_date}T00:00:00Z`)):F(i.start_date)},i.start_date):null)]}),f&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:F(f.start_date)}),e.jsxs("span",{children:[f.paper_count," ",f.paper_count===1?"paper":"papers",l===s.length-1?" · month to date":""]}),e.jsxs("span",{children:[(f.catalog_share??0).toFixed(2),"% of"," ",(f.catalog_paper_count??0).toLocaleString()," catalog papers"]}),y&&e.jsx("span",{children:y})]})]})},Ge=()=>{var y,i,m;const{methodSlug:s}=P(),r=Q(),l=k({queryKey:A.method(s),queryFn:()=>b.getMethod(s),enabled:!!s,staleTime:v}),d=k({queryKey:A.areas,queryFn:()=>b.listAreas({page_size:50,ordering:"name"}),enabled:!!((y=l.data)!=null&&y.area_id),staleTime:v}),o=k({queryKey:["method-trend",s],queryFn:()=>b.methodTrend(s),enabled:!!s,staleTime:v}),p=X([...V.feeds.method,s,r.filters],u=>U.forMethod(s,{...r.filters,page:u,page_size:20,repository_limit:1}),{enabled:!!s}),h=k({queryKey:["related-methods",s],queryFn:()=>b.relatedMethods(s),enabled:!!s,staleTime:v}),c=I.useMemo(()=>{var u;return((u=p.data)==null?void 0:u.pages.flatMap(S=>S.results.map(Z)))??[]},[p.data]);if(l.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(N,{className:"h-12 w-1/2 mb-4"}),e.jsx(N,{className:"h-64 w-full"})]});if(O(l.error))return e.jsx(te,{});if(l.error||!l.data)return e.jsx("div",{className:"page",children:e.jsx(Y,{variant:"destructive",children:e.jsx(J,{children:"Method not found."})})});const a=l.data,g=(i=d.data)==null?void 0:i.results.find(u=>u.id===a.area_id),j=G(a.source_url),f=j?null:ee(a.source_url);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(_,{to:"/methods",children:"Methods"}),g&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(_,{to:`/methods#area-${W(g.name)}`,children:g.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:a.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${a.slug==="grokking"||a.slug==="latent-reasoning"||a.slug==="world-action-models"?" method-hero-grid--wide-figure":""}`,children:[e.jsxs("div",{children:[e.jsx("div",{className:"tag-hero-eyebrow",children:"METHOD"}),e.jsx("h1",{className:"tag-hero-title method-hero-title",children:a.name}),e.jsx(q,{kind:"method",entityId:a.id}),a.full_name&&!a.name.includes(a.full_name)&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:a.full_name}),a.description&&e.jsx(L,{className:"method-description",text:a.description}),a.source_url&&a.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),j?e.jsxs(_,{className:"method-source-link",to:j,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):f?e.jsxs("a",{className:"method-source-link",href:f,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):e.jsxs("div",{className:"method-source-link is-static",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]})]}),e.jsxs("div",{className:"tag-hero-meta",children:[e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Papers mentioning"}),e.jsx("span",{className:"value",children:(a.paper_count??0).toLocaleString()})]}),o.data&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Recent mentions"}),e.jsxs("span",{className:"value",children:[(o.data.recent_paper_count*30/o.data.recent_days).toFixed(1),e.jsx("small",{children:"/mo"})]}),!o.data.comparison_complete&&e.jsx("span",{title:"Tagging is still catching up. This rate reflects mentions found so far.",children:"Partial coverage"})]}),a.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:a.introduced_year})]})]}),o.isLoading?e.jsx(N,{className:"h-36 w-full method-trend-skeleton"}):o.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:o.data.recent_paper_count}),e.jsxs("span",{children:["papers / ",o.data.recent_days,"d"]})]})]}),e.jsx(he,{history:o.data.history,methodName:a.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(oe,{method:a}),a.image_credit&&e.jsx("figcaption",{children:e.jsx(L,{className:"method-image-credit",text:a.image_credit})})]})]}),(((m=h.data)==null?void 0:m.results.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),h.data.results.map(u=>e.jsx(H,{method:{slug:u.slug,name:u.name}},u.id))]}),e.jsx(K,{feed:r,children:e.jsxs("div",{className:"results-count",children:[c.length," papers mentioning ",a.name]})}),e.jsx(R,{query:p,cards:c,empty:"No papers tagged with this method yet."})]})};export{Ge as default}; diff --git a/assets/MethodsIndexView-BIAyn6Np.js b/assets/MethodsIndexView-DFxGizEv.js similarity index 82% rename from assets/MethodsIndexView-BIAyn6Np.js rename to assets/MethodsIndexView-DFxGizEv.js index ede7f7c954f09f321ac3ba427bce9f27ef0c5042..37a0f1483207309c7e2ef5bcb155aa262aa7397f 100644 --- a/assets/MethodsIndexView-BIAyn6Np.js +++ b/assets/MethodsIndexView-DFxGizEv.js @@ -1,4 +1,4 @@ -import{c as f,b as c,f as l,j as s,L as _,q as N,T as m}from"./index-3CfcAX6N.js";import{c as p}from"./catalog-B47DuClX.js";import{s as T}from"./areas-Dvi8w2dp.js";import{s as v}from"./slug-BpH-Nkvz.js";import{A as L,a as M}from"./alert-BXZ4lnnf.js";import{A as q,a as A}from"./AreaSection-Dzw2ZfXP.js";import{T as F}from"./TaxonomySuggestionTile-CvpdGHs9.js";import{u as S,T as I}from"./useHashScrollOnReady-DNNLLOuJ.js";import"./skeleton-CQbSjC3L.js";import"./SignInToEditDialog-P5ytZJBG.js";import"./button-CbnaBx6W.js";import"./input-B7wcXhgG.js";import"./textarea-CdcMknzH.js";import"./searchable-select-DBlreWDS.js";import"./popover-Dwe6SY1f.js";import"./dialog-Bbx5GVcy.js";import"./search-SnOvJVk_.js";import"./loader-circle-CMgZ_maE.js";import"./useMutation-CKC6OFhA.js";import"./submissions-D-jwpMfI.js";import"./plus-CiDEk52y.js";import"./trending-up-BcVfaomA.js";/** +import{c as f,b as c,f as l,j as s,L as _,q as N,T as m}from"./index-CxhY4zQ1.js";import{c as p}from"./catalog-DCEU6WpP.js";import{s as T}from"./areas-Dvi8w2dp.js";import{s as v}from"./slug-BpH-Nkvz.js";import{A as L,a as M}from"./alert-C-NbJX4N.js";import{A as q,a as A}from"./AreaSection-B21Mp4br.js";import{T as F}from"./TaxonomySuggestionTile-Ch_m5AUx.js";import{u as S,T as I}from"./useHashScrollOnReady-KPtO6vdP.js";import"./skeleton-DdKViE4r.js";import"./SignInToEditDialog-0W7FFwc1.js";import"./button-BenSiukP.js";import"./input-CxKbyH9e.js";import"./textarea-uttJnDhA.js";import"./searchable-select-hPIpmCr4.js";import"./popover-DgW_tN02.js";import"./dialog-CT48f48_.js";import"./search-CkWMhIw6.js";import"./loader-circle-C5gQxAlQ.js";import"./useMutation-BzRfwboV.js";import"./submissions-DF3SD1oA.js";import"./plus-CEkdlNSn.js";import"./trending-up-BaROX4bP.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/NotFound-DXa9p6DX.js b/assets/NotFound-BeRulOFd.js similarity index 89% rename from assets/NotFound-DXa9p6DX.js rename to assets/NotFound-BeRulOFd.js index 79618a42d11d27e786a426e0771fc69200a1f774..d47864a86b0c42e87899f2efe5aa5d03f8bc087c 100644 --- a/assets/NotFound-DXa9p6DX.js +++ b/assets/NotFound-BeRulOFd.js @@ -1 +1 @@ -import{g as o,f as s,j as t,L as a}from"./index-3CfcAX6N.js";const r=()=>{const e=o();return s.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(a,{to:"/",className:"action-btn",children:"Return home"})]})};export{r as default}; +import{g as o,f as s,j as t,L as a}from"./index-CxhY4zQ1.js";const r=()=>{const e=o();return s.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(a,{to:"/",className:"action-btn",children:"Return home"})]})};export{r as default}; diff --git a/assets/OrganizationContributionGraph-AzFycVwZ.js b/assets/OrganizationContributionGraph-BW4dfD-r.js similarity index 94% rename from assets/OrganizationContributionGraph-AzFycVwZ.js rename to assets/OrganizationContributionGraph-BW4dfD-r.js index 6f2b56e4f2c203b1075a07c3c3e81d9622929181..d89dca476e7829e8a79cc9dfe0430627c055fef5 100644 --- a/assets/OrganizationContributionGraph-AzFycVwZ.js +++ b/assets/OrganizationContributionGraph-BW4dfD-r.js @@ -1 +1 @@ -import{f as b,j as o,b as $,T as z}from"./index-3CfcAX6N.js";import{S as w}from"./skeleton-CQbSjC3L.js";import{c as y}from"./catalog-B47DuClX.js";const x=24*60*60*1e3,f=12,N=3,v=new Map([[1,"Mon"],[3,"Wed"],[5,"Fri"]]),T=n=>new Date(`${n}T00:00:00Z`),_=n=>n.toISOString().slice(0,10),M=(n,a)=>{if(n===0)return 0;const i=a.findIndex(s=>n<=s);return i===-1?4:i+1},S=n=>{const a=T(n.start_date),i=T(n.end_date),s=new Date(a.getTime()-a.getUTCDay()*x),h=new Date(i.getTime()+(6-i.getUTCDay())*x),p=new Map(n.results.map(e=>[e.date,e.paper_count])),u=n.results.map(e=>e.paper_count).sort((e,g)=>e-g),c=[.25,.5,.75].map(e=>u[Math.min(u.length-1,Math.floor(u.length*e))]??1),l=[];for(let e=s.getTime();e<=h.getTime();e+=x){const g=new Date(e),d=_(g),m=e>=a.getTime()&&e<=i.getTime(),C=m?p.get(d)??0:0;l.push({key:d,date:g,count:C,inRange:m,level:M(C,c)})}const t=l.length/7,r=[];let j=-1;for(let e=0;em.inRange&&(e===0||m.date.getUTCDate()<=7));d&&d.date.getUTCMonth()!==j&&(j=d.date.getUTCMonth(),r.length>0&&e-r[r.length-1].column<3&&r.pop(),r.push({label:d.date.toLocaleString("en",{month:"short",timeZone:"UTC"}),column:e}))}return{days:l,months:r,weekCount:t}},D=({data:n,organizationName:a,title:i="Paper contributions",noun:s="paper"})=>{const h=b.useRef(null),{days:p,months:u,weekCount:c}=b.useMemo(()=>S(n),[n]),l=c*f+(c-1)*N;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":`${a} 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,r)=>o.jsx("span",{children:v.get(r)??""},r))}),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"})]})]})},U=({organizationSlug:n,organizationName:a})=>{const i=$({queryKey:["organization-contributions",n],queryFn:()=>y.organizationContributions(n),staleTime:z});return i.isLoading?o.jsx(w,{className:"organization-contributions-skeleton"}):i.data?o.jsx(D,{data:i.data,organizationName:a}):null};export{D as C,U as O}; +import{f as b,j as o,b as $,T as z}from"./index-CxhY4zQ1.js";import{S as w}from"./skeleton-DdKViE4r.js";import{c as y}from"./catalog-DCEU6WpP.js";const x=24*60*60*1e3,f=12,N=3,v=new Map([[1,"Mon"],[3,"Wed"],[5,"Fri"]]),T=n=>new Date(`${n}T00:00:00Z`),_=n=>n.toISOString().slice(0,10),M=(n,a)=>{if(n===0)return 0;const i=a.findIndex(s=>n<=s);return i===-1?4:i+1},S=n=>{const a=T(n.start_date),i=T(n.end_date),s=new Date(a.getTime()-a.getUTCDay()*x),h=new Date(i.getTime()+(6-i.getUTCDay())*x),p=new Map(n.results.map(e=>[e.date,e.paper_count])),u=n.results.map(e=>e.paper_count).sort((e,g)=>e-g),c=[.25,.5,.75].map(e=>u[Math.min(u.length-1,Math.floor(u.length*e))]??1),l=[];for(let e=s.getTime();e<=h.getTime();e+=x){const g=new Date(e),d=_(g),m=e>=a.getTime()&&e<=i.getTime(),C=m?p.get(d)??0:0;l.push({key:d,date:g,count:C,inRange:m,level:M(C,c)})}const t=l.length/7,r=[];let j=-1;for(let e=0;em.inRange&&(e===0||m.date.getUTCDate()<=7));d&&d.date.getUTCMonth()!==j&&(j=d.date.getUTCMonth(),r.length>0&&e-r[r.length-1].column<3&&r.pop(),r.push({label:d.date.toLocaleString("en",{month:"short",timeZone:"UTC"}),column:e}))}return{days:l,months:r,weekCount:t}},D=({data:n,organizationName:a,title:i="Paper contributions",noun:s="paper"})=>{const h=b.useRef(null),{days:p,months:u,weekCount:c}=b.useMemo(()=>S(n),[n]),l=c*f+(c-1)*N;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":`${a} 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,r)=>o.jsx("span",{children:v.get(r)??""},r))}),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"})]})]})},U=({organizationSlug:n,organizationName:a})=>{const i=$({queryKey:["organization-contributions",n],queryFn:()=>y.organizationContributions(n),staleTime:z});return i.isLoading?o.jsx(w,{className:"organization-contributions-skeleton"}):i.data?o.jsx(D,{data:i.data,organizationName:a}):null};export{D as C,U as O}; diff --git a/assets/OrganizationDetailView-BWLPu8mH.js b/assets/OrganizationDetailView-D82QKEh2.js similarity index 75% rename from assets/OrganizationDetailView-BWLPu8mH.js rename to assets/OrganizationDetailView-D82QKEh2.js index 11a4a8997642de97e7236d0ff6eeb78fa3b283ba..0da1cbd9695360190a3993aa2c32d1d3d392dc10 100644 --- a/assets/OrganizationDetailView-BWLPu8mH.js +++ b/assets/OrganizationDetailView-D82QKEh2.js @@ -1 +1 @@ -import{k as M,f as d,b as N,p as C,j as r,L as y,q as Q,T as F,u as z}from"./index-3CfcAX6N.js";import{R as E}from"./ResearchFollowButton-YEXlvC8K.js";import{M as I}from"./MarkdownText-BfMP6CxP.js";import{O as K}from"./OrganizationContributionGraph-AzFycVwZ.js";import{u as R,b as G,P as H}from"./PaperFeed-2dSUzcA2.js";import{A as W,a as B}from"./alert-BXZ4lnnf.js";import{S as D}from"./searchable-select-DBlreWDS.js";import{S}from"./skeleton-CQbSjC3L.js";import{u as U}from"./usePapers-CHoHKyWP.js";import{c as v}from"./catalog-B47DuClX.js";import{p as V}from"./papers-BsYlGUQi.js";import{i as Z}from"./apiErrors-XoIVpN_S.js";import{d as k,t as J}from"./transform-Dx-N8Yyj.js";import{o as X,i as Y}from"./organizationNames-BVKzYEBp.js";import L from"./NotFound-DXa9p6DX.js";import"./researchTopic-Z4AJDMN7.js";import"./useMutation-CKC6OFhA.js";import"./plus-CiDEk52y.js";/* empty css */import"./PaperPreviewLink-BJAulcHJ.js";import"./index-DGr54pyn.js";import"./index-C8DcqbS3.js";import"./katex-DkKDou_j.js";import"./hover-card-DOKhkRf9.js";import"./PaperCard-BZtXccuT.js";import"./AuthorAvatar-DYaYcwPm.js";import"./SotaBadges-BqZMAXyY.js";import"./colors-BkWRhvFI.js";import"./Icon-C0d9p4Q2.js";import"./LatexTitle-DvPeLepK.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-Dwe6SY1f.js";import"./useIntersectionObserver-wAZWG4G7.js";import"./button-CbnaBx6W.js";import"./dialog-Bbx5GVcy.js";import"./search-SnOvJVk_.js";import"./loader-circle-CMgZ_maE.js";import"./useInfiniteQuery-DYwUEaoz.js";import"./curation-BZoIvsHD.js";const ee=({organizationSlug:a,taskSlug:n})=>{var f,x,j,_,b;const $=M(),c=R(),{searchParams:w}=c,[O,h]=d.useState(!1),u=N({queryKey:Q.organization(a),queryFn:()=>v.getOrganization(a),staleTime:F}),l=N({queryKey:["organization-areas-with-tasks",a],queryFn:()=>v.organizationAreasWithTasks(a),staleTime:F}),p=U([...C.feeds.organization,a,n,c.filters],t=>V.forOrganization(a,{...c.filters,task:n,page:t,page_size:12}),{enabled:!!a});d.useEffect(()=>{h(!1)},[a,n]);const g=d.useMemo(()=>{var t;return(((t=l.data)==null?void 0:t.results)??[]).flatMap(o=>o.tasks.filter(s=>!!s.slug).map(s=>({...s,slug:s.slug,label:k(s.name,s.slug)})))},[l.data]),i=g.find(t=>t.slug===n),P=d.useMemo(()=>{var t;return(((t=p.data)==null?void 0:t.pages)??[]).flatMap(o=>o.results.map(J))},[p.data]),e=u.data??((f=l.data)==null?void 0:f.organization),m=e?X(e):null,T=((j=(x=p.data)==null?void 0:x.pages[0])==null?void 0:j.count)??0;if([u.error,l.error,p.error].some(Z))return r.jsx(L,{});if(l.error||p.error)return r.jsx("div",{className:"page",children:r.jsx(W,{variant:"destructive",children:r.jsx(B,{children:"Failed to load organization papers. Please try again."})})});const A=t=>{const o=t.trim().toLocaleLowerCase();return g.filter(s=>`${s.label} ${s.slug}`.toLocaleLowerCase().includes(o)).map(s=>({value:s.slug,label:s.label,description:`${s.paper_count.toLocaleString()} ${s.paper_count===1?"paper":"papers"}`}))},q=t=>{const o=t==="__all__"?`/orgs/${a}`:`/orgs/${a}/${t}`,s=w.toString();$({pathname:o,search:s?`?${s}`:""})};return r.jsxs("div",{className:"page",children:[r.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[r.jsx(y,{to:"/",children:"Home"}),r.jsx("span",{children:" / "}),r.jsx(y,{to:"/organizations",children:"Organizations"}),r.jsx("span",{children:" / "}),r.jsx("span",{children:(e==null?void 0:e.name)??a}),i&&r.jsxs(r.Fragment,{children:[r.jsx("span",{children:" / "}),r.jsx("span",{children:k(i.name,i.slug)})]})]}),r.jsxs("header",{className:"organization-hero",children:[r.jsxs("div",{className:"organization-hero-profile",children:[r.jsx("div",{className:"organizations-eyebrow",children:"ORGANIZATION"}),r.jsxs("h1",{className:`feed-title organization-hero-title${e&&!m&&Y(e.name)?" organization-hero-title--long":""}`,children:[e!=null&&e.logo_url&&!O?r.jsx("img",{src:e.logo_url,alt:"",width:58,height:58,onError:()=>h(!0)}):e?r.jsx("span",{className:"organization-hero-monogram","aria-hidden":"true",children:(m??e.name).slice(0,1).toUpperCase()}):null,e?r.jsxs("span",{className:"organization-hero-name",children:[m??e.name,m&&r.jsx("span",{className:"organization-hero-full-name",children:e.name})]}):r.jsx(S,{className:"h-12 w-64"})]}),e&&r.jsx(E,{kind:"organization",entityId:e.id}),e&&r.jsxs("div",{className:"feed-subtitle",children:[((_=e.paper_count)==null?void 0:_.toLocaleString())??0," papers",(e.organization_trending_score??0)>0&&e.trending_rank&&r.jsxs(r.Fragment,{children:[" · #",e.trending_rank," trending this month"]})]}),(e==null?void 0:e.description)&&r.jsx(I,{className:"method-description",text:e.description}),e&&r.jsxs("div",{className:"organization-hero-links",children:[e.website_url&&r.jsx("a",{href:e.website_url,target:"_blank",rel:"noreferrer",children:"Website ↗"}),e.hf_url&&r.jsx("a",{href:e.hf_url,target:"_blank",rel:"noreferrer",children:"Hugging Face ↗"}),e.github_url&&r.jsx("a",{href:e.github_url,target:"_blank",rel:"noreferrer",children:"GitHub ↗"})]})]}),r.jsx(K,{organizationSlug:a,organizationName:(e==null?void 0:e.name)??a})]}),r.jsx(G,{feed:c,style:{alignItems:"center",gap:16},leading:r.jsx("div",{style:{minWidth:260},children:r.jsx(D,{value:n??"__all__",onChange:q,placeholder:"All tasks",searchPlaceholder:"Search organization tasks...",emptyMessage:"No matching tasks.",ariaLabel:"Filter papers by task",selectedOption:i?{value:i.slug,label:i.label,description:`${i.paper_count.toLocaleString()} ${i.paper_count===1?"paper":"papers"}`}:{value:"__all__",label:"All tasks",description:`${((b=e==null?void 0:e.paper_count)==null?void 0:b.toLocaleString())??0} papers`},queryKey:["organization-task-options",a],queryFn:async t=>{var o;return[{value:"__all__",label:"All tasks",description:`${((o=e==null?void 0:e.paper_count)==null?void 0:o.toLocaleString())??0} papers`},...A(t)]},enabled:!l.isLoading,className:"h-[38px]"})}),children:r.jsxs("div",{className:"results-count",children:[T.toLocaleString()," papers"]})}),r.jsx(H,{query:p,cards:P,showInstitution:!1,empty:(e==null?void 0:e.paper_count)===0?"No papers indexed yet":"No papers found for this selection."})]})},Ke=()=>{const{orgSlug:a,taskSlug:n}=z();return a?r.jsx(ee,{organizationSlug:a,taskSlug:n}):r.jsx(L,{})};export{Ke as default}; +import{k as M,f as d,b as N,p as C,j as r,L as y,q as Q,T as F,u as z}from"./index-CxhY4zQ1.js";import{R as E}from"./ResearchFollowButton-DPFVPZ0U.js";import{M as I}from"./MarkdownText-D0WkOxKi.js";import{O as K}from"./OrganizationContributionGraph-BW4dfD-r.js";import{u as R,b as G,P as H}from"./PaperFeed-D1egUlu_.js";import{A as W,a as B}from"./alert-C-NbJX4N.js";import{S as D}from"./searchable-select-hPIpmCr4.js";import{S}from"./skeleton-DdKViE4r.js";import{u as U}from"./usePapers-Cv13R7ph.js";import{c as v}from"./catalog-DCEU6WpP.js";import{p as V}from"./papers-BDxSKSYJ.js";import{i as Z}from"./apiErrors-D2bSY3Dq.js";import{d as k,t as J}from"./transform-DehuZQh7.js";import{o as X,i as Y}from"./organizationNames-BVKzYEBp.js";import L from"./NotFound-BeRulOFd.js";import"./researchTopic-DXZVIvAq.js";import"./useMutation-BzRfwboV.js";import"./plus-CEkdlNSn.js";/* empty css */import"./PaperPreviewLink-Y2LI3xZW.js";import"./index-BCjs92mB.js";import"./index-mv_8ovfA.js";import"./katex-DkKDou_j.js";import"./hover-card-CqKeZcpY.js";import"./PaperCard-DeWmBrg8.js";import"./AuthorAvatar-DPz8YQ5Z.js";import"./SotaBadges-EnDhSaVO.js";import"./colors-BkWRhvFI.js";import"./Icon-XOOkUEUX.js";import"./LatexTitle-BqNrCKu8.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-DgW_tN02.js";import"./useIntersectionObserver-ZqjUJuPc.js";import"./button-BenSiukP.js";import"./dialog-CT48f48_.js";import"./search-CkWMhIw6.js";import"./loader-circle-C5gQxAlQ.js";import"./useInfiniteQuery-vHEhIVF_.js";import"./curation-D2sqKAqC.js";const ee=({organizationSlug:a,taskSlug:n})=>{var f,x,j,_,b;const $=M(),c=R(),{searchParams:w}=c,[O,h]=d.useState(!1),u=N({queryKey:Q.organization(a),queryFn:()=>v.getOrganization(a),staleTime:F}),l=N({queryKey:["organization-areas-with-tasks",a],queryFn:()=>v.organizationAreasWithTasks(a),staleTime:F}),p=U([...C.feeds.organization,a,n,c.filters],t=>V.forOrganization(a,{...c.filters,task:n,page:t,page_size:12}),{enabled:!!a});d.useEffect(()=>{h(!1)},[a,n]);const g=d.useMemo(()=>{var t;return(((t=l.data)==null?void 0:t.results)??[]).flatMap(o=>o.tasks.filter(s=>!!s.slug).map(s=>({...s,slug:s.slug,label:k(s.name,s.slug)})))},[l.data]),i=g.find(t=>t.slug===n),P=d.useMemo(()=>{var t;return(((t=p.data)==null?void 0:t.pages)??[]).flatMap(o=>o.results.map(J))},[p.data]),e=u.data??((f=l.data)==null?void 0:f.organization),m=e?X(e):null,T=((j=(x=p.data)==null?void 0:x.pages[0])==null?void 0:j.count)??0;if([u.error,l.error,p.error].some(Z))return r.jsx(L,{});if(l.error||p.error)return r.jsx("div",{className:"page",children:r.jsx(W,{variant:"destructive",children:r.jsx(B,{children:"Failed to load organization papers. Please try again."})})});const A=t=>{const o=t.trim().toLocaleLowerCase();return g.filter(s=>`${s.label} ${s.slug}`.toLocaleLowerCase().includes(o)).map(s=>({value:s.slug,label:s.label,description:`${s.paper_count.toLocaleString()} ${s.paper_count===1?"paper":"papers"}`}))},q=t=>{const o=t==="__all__"?`/orgs/${a}`:`/orgs/${a}/${t}`,s=w.toString();$({pathname:o,search:s?`?${s}`:""})};return r.jsxs("div",{className:"page",children:[r.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[r.jsx(y,{to:"/",children:"Home"}),r.jsx("span",{children:" / "}),r.jsx(y,{to:"/organizations",children:"Organizations"}),r.jsx("span",{children:" / "}),r.jsx("span",{children:(e==null?void 0:e.name)??a}),i&&r.jsxs(r.Fragment,{children:[r.jsx("span",{children:" / "}),r.jsx("span",{children:k(i.name,i.slug)})]})]}),r.jsxs("header",{className:"organization-hero",children:[r.jsxs("div",{className:"organization-hero-profile",children:[r.jsx("div",{className:"organizations-eyebrow",children:"ORGANIZATION"}),r.jsxs("h1",{className:`feed-title organization-hero-title${e&&!m&&Y(e.name)?" organization-hero-title--long":""}`,children:[e!=null&&e.logo_url&&!O?r.jsx("img",{src:e.logo_url,alt:"",width:58,height:58,onError:()=>h(!0)}):e?r.jsx("span",{className:"organization-hero-monogram","aria-hidden":"true",children:(m??e.name).slice(0,1).toUpperCase()}):null,e?r.jsxs("span",{className:"organization-hero-name",children:[m??e.name,m&&r.jsx("span",{className:"organization-hero-full-name",children:e.name})]}):r.jsx(S,{className:"h-12 w-64"})]}),e&&r.jsx(E,{kind:"organization",entityId:e.id}),e&&r.jsxs("div",{className:"feed-subtitle",children:[((_=e.paper_count)==null?void 0:_.toLocaleString())??0," papers",(e.organization_trending_score??0)>0&&e.trending_rank&&r.jsxs(r.Fragment,{children:[" · #",e.trending_rank," trending this month"]})]}),(e==null?void 0:e.description)&&r.jsx(I,{className:"method-description",text:e.description}),e&&r.jsxs("div",{className:"organization-hero-links",children:[e.website_url&&r.jsx("a",{href:e.website_url,target:"_blank",rel:"noreferrer",children:"Website ↗"}),e.hf_url&&r.jsx("a",{href:e.hf_url,target:"_blank",rel:"noreferrer",children:"Hugging Face ↗"}),e.github_url&&r.jsx("a",{href:e.github_url,target:"_blank",rel:"noreferrer",children:"GitHub ↗"})]})]}),r.jsx(K,{organizationSlug:a,organizationName:(e==null?void 0:e.name)??a})]}),r.jsx(G,{feed:c,style:{alignItems:"center",gap:16},leading:r.jsx("div",{style:{minWidth:260},children:r.jsx(D,{value:n??"__all__",onChange:q,placeholder:"All tasks",searchPlaceholder:"Search organization tasks...",emptyMessage:"No matching tasks.",ariaLabel:"Filter papers by task",selectedOption:i?{value:i.slug,label:i.label,description:`${i.paper_count.toLocaleString()} ${i.paper_count===1?"paper":"papers"}`}:{value:"__all__",label:"All tasks",description:`${((b=e==null?void 0:e.paper_count)==null?void 0:b.toLocaleString())??0} papers`},queryKey:["organization-task-options",a],queryFn:async t=>{var o;return[{value:"__all__",label:"All tasks",description:`${((o=e==null?void 0:e.paper_count)==null?void 0:o.toLocaleString())??0} papers`},...A(t)]},enabled:!l.isLoading,className:"h-[38px]"})}),children:r.jsxs("div",{className:"results-count",children:[T.toLocaleString()," papers"]})}),r.jsx(H,{query:p,cards:P,showInstitution:!1,empty:(e==null?void 0:e.paper_count)===0?"No papers indexed yet":"No papers found for this selection."})]})},Ke=()=>{const{orgSlug:a,taskSlug:n}=z();return a?r.jsx(ee,{organizationSlug:a,taskSlug:n}):r.jsx(L,{})};export{Ke as default}; diff --git a/assets/OrganizationsIndexView-BKYZomGz.js b/assets/OrganizationsIndexView-CU64F1W1.js similarity index 97% rename from assets/OrganizationsIndexView-BKYZomGz.js rename to assets/OrganizationsIndexView-CU64F1W1.js index bdb934bbfff4f45f081032e9db0b2d2ef0914106..e2ce6f0388eb934f06f89d243fb72a9162664a18 100644 --- a/assets/OrganizationsIndexView-BKYZomGz.js +++ b/assets/OrganizationsIndexView-CU64F1W1.js @@ -1 +1 @@ -import{e as m,b as x,f as h,j as e,L as u,q as j,T as y}from"./index-3CfcAX6N.js";import{A as N,a as f}from"./alert-BXZ4lnnf.js";import{c as _}from"./catalog-B47DuClX.js";const v=n=>n==="papers"||n==="name"?n:"trending",z=({organization:n})=>{const[d,i]=h.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:()=>i(!0)})})},L=()=>{const[n,d]=m(),i=v(n.get("sort")),c=n.get("q")??"",o=x({queryKey:[...j.organizations,"featured"],queryFn:()=>_.organizationIndex(),staleTime:y}),p=s=>{const a=new URLSearchParams(n),t=s.sort??i,r=s.query??c;t==="trending"?a.delete("sort"):a.set("sort",t),r.trim()?a.set("q",r):a.delete("q"),d(a)},g=h.useMemo(()=>{var t;const s=c.trim().toLocaleLowerCase(),a=(((t=o.data)==null?void 0:t.results)??[]).filter(r=>[r.name,r.slug,r.hf_slug??""].join(" ").toLocaleLowerCase().includes(s));return i==="papers"?[...a].sort((r,l)=>(l.paper_count??0)-(r.paper_count??0)||r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):i==="name"?[...a].sort((r,l)=>r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):a},[o.data,c,i]);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.jsx("h2",{id:"organizations-heading",children:o.data?`${o.data.count.toLocaleString()} organizations`:"Organizations"}),e.jsx("span",{children:i==="trending"?"Ranked by 30-day momentum":i==="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:i===s?"active":"","aria-pressed":i===s,onClick:()=>p({sort:s}),children:a},s))})]}),o.isLoading?e.jsx("div",{className:"organizations-grid","aria-busy":"true","aria-label":"Loading organizations",children:Array.from({length:12}).map((s,a)=>e.jsxs("div",{className:"organization-card organization-card-skeleton",children:[e.jsxs("div",{className:"organization-card-header",children:[e.jsx("span",{className:"organization-logo"}),e.jsxs("div",{children:[e.jsx("span",{className:"organization-skeleton-line"}),e.jsx("span",{className:"organization-skeleton-line short"})]})]}),e.jsx("div",{className:"organization-card-metrics",children:e.jsx("span",{className:"organization-skeleton-line short"})}),e.jsxs("div",{className:"organization-highlight",children:[e.jsx("span",{className:"organization-skeleton-line"}),e.jsx("span",{className:"organization-skeleton-line"})]})]},a))}):o.error?e.jsx(N,{variant:"destructive",children:e.jsxs(f,{children:["Failed to load organizations."," ",e.jsx("button",{type:"button",onClick:()=>o.refetch(),children:"Try again"})]})}):g.length===0?e.jsxs("div",{className:"organizations-empty",children:["No organizations match “",c,"”."]}):e.jsx("div",{className:"organizations-grid",children:g.map(s=>{var r;const a=s.paper_count??0,t=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(u,{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(z,{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"}),i==="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:[t?`Publishing ${t}`:"Research archive ready",e.jsx("span",{"aria-hidden":"true",children:"↗"})]})]},s.id)})})]})]})};export{L as default}; +import{e as m,b as x,f as h,j as e,L as u,q as j,T as y}from"./index-CxhY4zQ1.js";import{A as N,a as f}from"./alert-C-NbJX4N.js";import{c as _}from"./catalog-DCEU6WpP.js";const v=n=>n==="papers"||n==="name"?n:"trending",z=({organization:n})=>{const[d,i]=h.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:()=>i(!0)})})},L=()=>{const[n,d]=m(),i=v(n.get("sort")),c=n.get("q")??"",o=x({queryKey:[...j.organizations,"featured"],queryFn:()=>_.organizationIndex(),staleTime:y}),p=s=>{const a=new URLSearchParams(n),t=s.sort??i,r=s.query??c;t==="trending"?a.delete("sort"):a.set("sort",t),r.trim()?a.set("q",r):a.delete("q"),d(a)},g=h.useMemo(()=>{var t;const s=c.trim().toLocaleLowerCase(),a=(((t=o.data)==null?void 0:t.results)??[]).filter(r=>[r.name,r.slug,r.hf_slug??""].join(" ").toLocaleLowerCase().includes(s));return i==="papers"?[...a].sort((r,l)=>(l.paper_count??0)-(r.paper_count??0)||r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):i==="name"?[...a].sort((r,l)=>r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):a},[o.data,c,i]);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.jsx("h2",{id:"organizations-heading",children:o.data?`${o.data.count.toLocaleString()} organizations`:"Organizations"}),e.jsx("span",{children:i==="trending"?"Ranked by 30-day momentum":i==="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:i===s?"active":"","aria-pressed":i===s,onClick:()=>p({sort:s}),children:a},s))})]}),o.isLoading?e.jsx("div",{className:"organizations-grid","aria-busy":"true","aria-label":"Loading organizations",children:Array.from({length:12}).map((s,a)=>e.jsxs("div",{className:"organization-card organization-card-skeleton",children:[e.jsxs("div",{className:"organization-card-header",children:[e.jsx("span",{className:"organization-logo"}),e.jsxs("div",{children:[e.jsx("span",{className:"organization-skeleton-line"}),e.jsx("span",{className:"organization-skeleton-line short"})]})]}),e.jsx("div",{className:"organization-card-metrics",children:e.jsx("span",{className:"organization-skeleton-line short"})}),e.jsxs("div",{className:"organization-highlight",children:[e.jsx("span",{className:"organization-skeleton-line"}),e.jsx("span",{className:"organization-skeleton-line"})]})]},a))}):o.error?e.jsx(N,{variant:"destructive",children:e.jsxs(f,{children:["Failed to load organizations."," ",e.jsx("button",{type:"button",onClick:()=>o.refetch(),children:"Try again"})]})}):g.length===0?e.jsxs("div",{className:"organizations-empty",children:["No organizations match “",c,"”."]}):e.jsx("div",{className:"organizations-grid",children:g.map(s=>{var r;const a=s.paper_count??0,t=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(u,{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(z,{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"}),i==="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:[t?`Publishing ${t}`:"Research archive ready",e.jsx("span",{"aria-hidden":"true",children:"↗"})]})]},s.id)})})]})]})};export{L as default}; diff --git a/assets/PaperCard-BZtXccuT.js b/assets/PaperCard-DeWmBrg8.js similarity index 96% rename from assets/PaperCard-BZtXccuT.js rename to assets/PaperCard-DeWmBrg8.js index 1fa189e897701a38531b314345adbbceed5546f9..7cdfa040fd1178ce76a1a94767db2b7106500795 100644 --- a/assets/PaperCard-BZtXccuT.js +++ b/assets/PaperCard-DeWmBrg8.js @@ -1 +1 @@ -import{l as v,V as g,T as M,p as y,j as a,L as d}from"./index-3CfcAX6N.js";import{A as L}from"./AuthorAvatar-DYaYcwPm.js";import{P as Z,S as A,T as k,M as E}from"./SotaBadges-BqZMAXyY.js";import{I as P}from"./Icon-C0d9p4Q2.js";import{L as U,a as w}from"./LatexTitle-DvPeLepK.js";import{p as C}from"./papers-BsYlGUQi.js";import{s as h}from"./safeExternalHref-CkBrsh84.js";const $=({size:s=16})=>a.jsxs("svg",{className:"hf-logo",width:s,height:s,viewBox:"0 0 95 88",fill:"none","aria-hidden":"true",focusable:"false",children:[a.jsx("path",{fill:"#FFD21E",d:"M47.21 76.5a34.75 34.75 0 1 0 0-69.5 34.75 34.75 0 0 0 0 69.5Z"}),a.jsx("path",{fill:"#FF9D0B",d:"M81.96 41.75a34.75 34.75 0 1 0-69.5 0 34.75 34.75 0 0 0 69.5 0Zm-73.5 0a38.75 38.75 0 1 1 77.5 0 38.75 38.75 0 0 1-77.5 0Z"}),a.jsx("path",{fill:"#3A3B45",d:"M58.5 32.3c1.28.44 1.78 3.06 3.07 2.38a5 5 0 1 0-6.76-2.07c.61 1.15 2.55-.72 3.7-.32ZM34.95 32.3c-1.28.44-1.79 3.06-3.07 2.38a5 5 0 1 1 6.76-2.07c-.61 1.15-2.56-.72-3.7-.32Z"}),a.jsx("path",{fill:"#FF323D",d:"M46.96 56.29c9.83 0 13-8.76 13-13.26 0-2.34-1.57-1.6-4.09-.36-2.33 1.15-5.46 2.74-8.9 2.74-7.19 0-13-6.88-13-2.38s3.16 13.26 13 13.26Z"}),a.jsx("path",{fill:"#3A3B45",fillRule:"evenodd",clipRule:"evenodd",d:"M39.43 54a8.7 8.7 0 0 1 5.3-4.49c.4-.12.81.57 1.24 1.28.4.68.82 1.37 1.24 1.37.45 0 .9-.68 1.33-1.35.45-.7.89-1.38 1.32-1.25a8.61 8.61 0 0 1 5 4.17c3.73-2.94 5.1-7.74 5.1-10.7 0-2.34-1.57-1.6-4.09-.36l-.14.07c-2.31 1.15-5.39 2.67-8.77 2.67s-6.45-1.52-8.77-2.67c-2.6-1.29-4.23-2.1-4.23.29 0 3.05 1.46 8.06 5.47 10.97Z"}),a.jsx("path",{fill:"#FF9D0B",d:"M70.71 37a3.25 3.25 0 1 0 0-6.5 3.25 3.25 0 0 0 0 6.5ZM24.21 37a3.25 3.25 0 1 0 0-6.5 3.25 3.25 0 0 0 0 6.5ZM17.52 48c-1.62 0-3.06.66-4.07 1.87a5.97 5.97 0 0 0-1.33 3.76 7.1 7.1 0 0 0-1.94-.3c-1.55 0-2.95.59-3.94 1.66a5.8 5.8 0 0 0-.8 7 5.3 5.3 0 0 0-1.79 2.82c-.24.9-.48 2.8.8 4.74a5.22 5.22 0 0 0-.37 5.02c1.02 2.32 3.57 4.14 8.52 6.1 3.07 1.22 5.89 2 5.91 2.01a44.33 44.33 0 0 0 10.93 1.6c5.86 0 10.05-1.8 12.46-5.34 3.88-5.69 3.33-10.9-1.7-15.92-2.77-2.78-4.62-6.87-5-7.77-.78-2.66-2.84-5.62-6.25-5.62a5.7 5.7 0 0 0-4.6 2.46c-1-1.26-1.98-2.25-2.86-2.82A7.4 7.4 0 0 0 17.52 48Zm0 4c.51 0 1.14.22 1.82.65 2.14 1.36 6.25 8.43 7.76 11.18.5.92 1.37 1.31 2.14 1.31 1.55 0 2.75-1.53.15-3.48-3.92-2.93-2.55-7.72-.68-8.01.08-.02.17-.02.24-.02 1.7 0 2.45 2.93 2.45 2.93s2.2 5.52 5.98 9.3c3.77 3.77 3.97 6.8 1.22 10.83-1.88 2.75-5.47 3.58-9.16 3.58-3.81 0-7.73-.9-9.92-1.46-.11-.03-13.45-3.8-11.76-7 .28-.54.75-.76 1.34-.76 2.38 0 6.7 3.54 8.57 3.54.41 0 .7-.17.83-.6.79-2.85-12.06-4.05-10.98-8.17.2-.73.71-1.02 1.44-1.02 3.14 0 10.2 5.53 11.68 5.53.11 0 .2-.03.24-.1.74-1.2.33-2.04-4.9-5.2-5.21-3.16-8.88-5.06-6.8-7.33.24-.26.58-.38 1-.38 3.17 0 10.66 6.82 10.66 6.82s2.02 2.1 3.25 2.1c.28 0 .52-.1.68-.38.86-1.46-8.06-8.22-8.56-11.01-.34-1.9.24-2.85 1.31-2.85Z"}),a.jsx("path",{fill:"#FFD21E",d:"M38.6 76.69c2.75-4.04 2.55-7.07-1.22-10.84-3.78-3.77-5.98-9.3-5.98-9.3s-.82-3.2-2.69-2.9c-1.87.3-3.24 5.08.68 8.01 3.91 2.93-.78 4.92-2.29 2.17-1.5-2.75-5.62-9.82-7.76-11.18-2.13-1.35-3.63-.6-3.13 2.2.5 2.79 9.43 9.55 8.56 11-.87 1.47-3.93-1.71-3.93-1.71s-9.57-8.71-11.66-6.44c-2.08 2.27 1.59 4.17 6.8 7.33 5.23 3.16 5.64 4 4.9 5.2-.75 1.2-12.28-8.53-13.36-4.4-1.08 4.11 11.77 5.3 10.98 8.15-.8 2.85-9.06-5.38-10.74-2.18-1.7 3.21 11.65 6.98 11.76 7.01 4.3 1.12 15.25 3.49 19.08-2.12Z"}),a.jsx("path",{fill:"#FF9D0B",d:"M77.4 48c1.62 0 3.07.66 4.07 1.87a5.97 5.97 0 0 1 1.33 3.76 7.1 7.1 0 0 1 1.95-.3c1.55 0 2.95.59 3.94 1.66a5.8 5.8 0 0 1 .8 7 5.3 5.3 0 0 1 1.78 2.82c.24.9.48 2.8-.8 4.74a5.22 5.22 0 0 1 .37 5.02c-1.02 2.32-3.57 4.14-8.51 6.1-3.08 1.22-5.9 2-5.92 2.01a44.33 44.33 0 0 1-10.93 1.6c-5.86 0-10.05-1.8-12.46-5.34-3.88-5.69-3.33-10.9 1.7-15.92 2.78-2.78 4.63-6.87 5.01-7.77.78-2.66 2.83-5.62 6.24-5.62a5.7 5.7 0 0 1 4.6 2.46c1-1.26 1.98-2.25 2.87-2.82A7.4 7.4 0 0 1 77.4 48Zm0 4c-.51 0-1.13.22-1.82.65-2.13 1.36-6.25 8.43-7.76 11.18a2.43 2.43 0 0 1-2.14 1.31c-1.54 0-2.75-1.53-.14-3.48 3.91-2.93 2.54-7.72.67-8.01a1.54 1.54 0 0 0-.24-.02c-1.7 0-2.45 2.93-2.45 2.93s-2.2 5.52-5.97 9.3c-3.78 3.77-3.98 6.8-1.22 10.83 1.87 2.75 5.47 3.58 9.15 3.58 3.82 0 7.73-.9 9.93-1.46.1-.03 13.45-3.8 11.76-7-.29-.54-.75-.76-1.34-.76-2.38 0-6.71 3.54-8.57 3.54-.42 0-.71-.17-.83-.6-.8-2.85 12.05-4.05 10.97-8.17-.19-.73-.7-1.02-1.44-1.02-3.14 0-10.2 5.53-11.68 5.53-.1 0-.19-.03-.23-.1-.74-1.2-.34-2.04 4.88-5.2 5.23-3.16 8.9-5.06 6.8-7.33-.23-.26-.57-.38-.98-.38-3.18 0-10.67 6.82-10.67 6.82s-2.02 2.1-3.24 2.1a.74.74 0 0 1-.68-.38c-.87-1.46 8.05-8.22 8.55-11.01.34-1.9-.24-2.85-1.31-2.85Z"}),a.jsx("path",{fill:"#FFD21E",d:"M56.33 76.69c-2.75-4.04-2.56-7.07 1.22-10.84 3.77-3.77 5.97-9.3 5.97-9.3s.82-3.2 2.7-2.9c1.86.3 3.23 5.08-.68 8.01-3.92 2.93.78 4.92 2.28 2.17 1.51-2.75 5.63-9.82 7.76-11.18 2.13-1.35 3.64-.6 3.13 2.2-.5 2.79-9.42 9.55-8.55 11 .86 1.47 3.92-1.71 3.92-1.71s9.58-8.71 11.66-6.44c2.08 2.27-1.58 4.17-6.8 7.33-5.23 3.16-5.63 4-4.9 5.2.75 1.2 12.28-8.53 13.36-4.4 1.08 4.11-11.76 5.3-10.97 8.15.8 2.85 9.05-5.38 10.74-2.18 1.69 3.21-11.65 6.98-11.76 7.01-4.31 1.12-15.26 3.49-19.08-2.12Z"})]});function T(s){const t=[...new Set(s.map(r=>r.replace(/ \(subtask\)$/,"")))],l=t.length>3?[...t.slice(0,2),`${t.length-2} more`]:t;return l.length>1?`${l.slice(0,-1).join(", ")} and ${l[l.length-1]}`:l[0]}const z="language-modeling";function p(s){return s?s.toLowerCase().replace(/\(.*?\)/g," ").replace(/[^a-z]+/g," ").replace(/\bllm\b/g," ").replace(/\s+/g," ").trim().replace(/s$/,""):""}function B(s){return p(s.slug)==="large language model"||p(s.name)==="large language model"}function D(s){return s.tags.includes(z)?s.methods.filter(t=>!B(t)):s.methods}const S=({name:s,slug:t,logoUrl:l})=>{const[r,i]=g.useState(!1);return!l||r?null:a.jsx(d,{to:`/orgs/${t}`,className:"paper-organization-logo","aria-label":`View ${s} organization`,title:s,children:a.jsx("img",{src:l,alt:"",onError:()=>i(!0)})})},q=({paper:s,priority:t=!1,showInstitution:l=!0,highlightQuery:r,followReasons:i})=>{const m=v(),u=`/paper/${s.id}`,n=g.useCallback(()=>{m.prefetchQuery({queryKey:y.detail(s.id),queryFn:()=>C.get(s.id,!0),staleTime:M})},[s.id,m]),F=s.authors.slice(0,3).map((e,o)=>{var b,N;const f=(b=s.authorIds)==null?void 0:b[o],j=(N=s.authorHfProfiles)==null?void 0:N[o];return a.jsxs(g.Fragment,{children:[o>0&&", ",j&&a.jsx(L,{className:"paper-card-author-avatar",url:j.avatarUrl}),f?a.jsx(d,{to:`/authors/${f}`,children:e}):e]},o)}),c=s.authors.length,x=D(s);return a.jsxs("article",{className:"paper-card",children:[a.jsx(d,{to:u,className:"paper-thumb-wrap",onFocus:n,onMouseEnter:n,children:a.jsx(Z,{paperId:s.id,title:s.title,thumbnailUrl:s.thumbnailUrl,priority:t})}),a.jsxs("div",{className:"paper-body",children:[a.jsxs("div",{className:"paper-body-main",children:[i&&i.length>0&&a.jsxs("div",{className:"paper-follow-reason",children:["Because you follow ",T(i)]}),a.jsxs("h3",{className:"paper-title",children:[a.jsx(d,{to:u,onFocus:n,onMouseEnter:n,children:a.jsx(U,{title:s.title,highlight:r})}),l&&s.organizations.length>0&&a.jsx("span",{className:"paper-organization-logos",children:s.organizations.map(e=>a.jsx(S,{...e},e.slug))})]}),a.jsxs("div",{className:"paper-authors",children:[F,c>3&&a.jsxs("span",{children:[", ","+",c-3," authors"]}),s.date&&a.jsxs(a.Fragment,{children:[c>0?" · ":"",a.jsx("span",{children:s.date})]}),s.citations>0&&a.jsxs(a.Fragment,{children:[c>0||s.date?" · ":"",a.jsxs("span",{children:[s.citations.toLocaleString()," citations"]})]})]}),s.abstract&&a.jsx("p",{className:"paper-abstract",children:a.jsx(w,{text:s.abstract,highlight:r})}),s.sotaRanks.length>0&&a.jsx(A,{ranks:s.sotaRanks,paperHref:u}),(s.tags.length>0||x.length>0)&&a.jsxs("div",{className:"paper-tags paper-tags--clamped",children:[s.tags.map(e=>a.jsx(k,{slug:e},e)),x.map(e=>a.jsx(E,{method:e},e.id||e.slug||e.name))]})]}),(s.githubUrl||s.hfUrl)&&a.jsxs("div",{className:"paper-resources",children:[h(s.githubUrl)&&a.jsxs("a",{className:"paper-resource is-link",href:h(s.githubUrl)??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":"Open GitHub repository",onClick:e=>e.stopPropagation(),children:[a.jsx(P,{name:"github",size:20}),s.velocity24h!=null&&s.velocity24h>0&&a.jsxs("span",{className:"resource-stat",children:[a.jsxs("span",{className:"resource-value",children:[a.jsx("span",{className:"gh-rate-arrow",children:"↑"}),s.velocity24h.toFixed(1)]}),a.jsx("span",{className:"resource-label",children:"stars / hr"})]})]}),h(s.hfUrl)&&s.hfKind&&a.jsxs("a",{className:"paper-resource is-link",href:h(s.hfUrl)??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":`Open Hugging Face ${s.hfKind}`,onClick:e=>e.stopPropagation(),children:[a.jsx($,{size:20}),a.jsxs("span",{className:"resource-stat",children:[a.jsx("span",{className:"resource-value",children:s.hfCount}),a.jsx("span",{className:"resource-label",children:s.hfKind})]})]})]})]})]})};export{q as P}; +import{l as v,V as g,T as M,p as y,j as a,L as d}from"./index-CxhY4zQ1.js";import{A as L}from"./AuthorAvatar-DPz8YQ5Z.js";import{P as Z,S as A,T as k,M as E}from"./SotaBadges-EnDhSaVO.js";import{I as P}from"./Icon-XOOkUEUX.js";import{L as U,a as w}from"./LatexTitle-BqNrCKu8.js";import{p as C}from"./papers-BDxSKSYJ.js";import{s as h}from"./safeExternalHref-CkBrsh84.js";const $=({size:s=16})=>a.jsxs("svg",{className:"hf-logo",width:s,height:s,viewBox:"0 0 95 88",fill:"none","aria-hidden":"true",focusable:"false",children:[a.jsx("path",{fill:"#FFD21E",d:"M47.21 76.5a34.75 34.75 0 1 0 0-69.5 34.75 34.75 0 0 0 0 69.5Z"}),a.jsx("path",{fill:"#FF9D0B",d:"M81.96 41.75a34.75 34.75 0 1 0-69.5 0 34.75 34.75 0 0 0 69.5 0Zm-73.5 0a38.75 38.75 0 1 1 77.5 0 38.75 38.75 0 0 1-77.5 0Z"}),a.jsx("path",{fill:"#3A3B45",d:"M58.5 32.3c1.28.44 1.78 3.06 3.07 2.38a5 5 0 1 0-6.76-2.07c.61 1.15 2.55-.72 3.7-.32ZM34.95 32.3c-1.28.44-1.79 3.06-3.07 2.38a5 5 0 1 1 6.76-2.07c-.61 1.15-2.56-.72-3.7-.32Z"}),a.jsx("path",{fill:"#FF323D",d:"M46.96 56.29c9.83 0 13-8.76 13-13.26 0-2.34-1.57-1.6-4.09-.36-2.33 1.15-5.46 2.74-8.9 2.74-7.19 0-13-6.88-13-2.38s3.16 13.26 13 13.26Z"}),a.jsx("path",{fill:"#3A3B45",fillRule:"evenodd",clipRule:"evenodd",d:"M39.43 54a8.7 8.7 0 0 1 5.3-4.49c.4-.12.81.57 1.24 1.28.4.68.82 1.37 1.24 1.37.45 0 .9-.68 1.33-1.35.45-.7.89-1.38 1.32-1.25a8.61 8.61 0 0 1 5 4.17c3.73-2.94 5.1-7.74 5.1-10.7 0-2.34-1.57-1.6-4.09-.36l-.14.07c-2.31 1.15-5.39 2.67-8.77 2.67s-6.45-1.52-8.77-2.67c-2.6-1.29-4.23-2.1-4.23.29 0 3.05 1.46 8.06 5.47 10.97Z"}),a.jsx("path",{fill:"#FF9D0B",d:"M70.71 37a3.25 3.25 0 1 0 0-6.5 3.25 3.25 0 0 0 0 6.5ZM24.21 37a3.25 3.25 0 1 0 0-6.5 3.25 3.25 0 0 0 0 6.5ZM17.52 48c-1.62 0-3.06.66-4.07 1.87a5.97 5.97 0 0 0-1.33 3.76 7.1 7.1 0 0 0-1.94-.3c-1.55 0-2.95.59-3.94 1.66a5.8 5.8 0 0 0-.8 7 5.3 5.3 0 0 0-1.79 2.82c-.24.9-.48 2.8.8 4.74a5.22 5.22 0 0 0-.37 5.02c1.02 2.32 3.57 4.14 8.52 6.1 3.07 1.22 5.89 2 5.91 2.01a44.33 44.33 0 0 0 10.93 1.6c5.86 0 10.05-1.8 12.46-5.34 3.88-5.69 3.33-10.9-1.7-15.92-2.77-2.78-4.62-6.87-5-7.77-.78-2.66-2.84-5.62-6.25-5.62a5.7 5.7 0 0 0-4.6 2.46c-1-1.26-1.98-2.25-2.86-2.82A7.4 7.4 0 0 0 17.52 48Zm0 4c.51 0 1.14.22 1.82.65 2.14 1.36 6.25 8.43 7.76 11.18.5.92 1.37 1.31 2.14 1.31 1.55 0 2.75-1.53.15-3.48-3.92-2.93-2.55-7.72-.68-8.01.08-.02.17-.02.24-.02 1.7 0 2.45 2.93 2.45 2.93s2.2 5.52 5.98 9.3c3.77 3.77 3.97 6.8 1.22 10.83-1.88 2.75-5.47 3.58-9.16 3.58-3.81 0-7.73-.9-9.92-1.46-.11-.03-13.45-3.8-11.76-7 .28-.54.75-.76 1.34-.76 2.38 0 6.7 3.54 8.57 3.54.41 0 .7-.17.83-.6.79-2.85-12.06-4.05-10.98-8.17.2-.73.71-1.02 1.44-1.02 3.14 0 10.2 5.53 11.68 5.53.11 0 .2-.03.24-.1.74-1.2.33-2.04-4.9-5.2-5.21-3.16-8.88-5.06-6.8-7.33.24-.26.58-.38 1-.38 3.17 0 10.66 6.82 10.66 6.82s2.02 2.1 3.25 2.1c.28 0 .52-.1.68-.38.86-1.46-8.06-8.22-8.56-11.01-.34-1.9.24-2.85 1.31-2.85Z"}),a.jsx("path",{fill:"#FFD21E",d:"M38.6 76.69c2.75-4.04 2.55-7.07-1.22-10.84-3.78-3.77-5.98-9.3-5.98-9.3s-.82-3.2-2.69-2.9c-1.87.3-3.24 5.08.68 8.01 3.91 2.93-.78 4.92-2.29 2.17-1.5-2.75-5.62-9.82-7.76-11.18-2.13-1.35-3.63-.6-3.13 2.2.5 2.79 9.43 9.55 8.56 11-.87 1.47-3.93-1.71-3.93-1.71s-9.57-8.71-11.66-6.44c-2.08 2.27 1.59 4.17 6.8 7.33 5.23 3.16 5.64 4 4.9 5.2-.75 1.2-12.28-8.53-13.36-4.4-1.08 4.11 11.77 5.3 10.98 8.15-.8 2.85-9.06-5.38-10.74-2.18-1.7 3.21 11.65 6.98 11.76 7.01 4.3 1.12 15.25 3.49 19.08-2.12Z"}),a.jsx("path",{fill:"#FF9D0B",d:"M77.4 48c1.62 0 3.07.66 4.07 1.87a5.97 5.97 0 0 1 1.33 3.76 7.1 7.1 0 0 1 1.95-.3c1.55 0 2.95.59 3.94 1.66a5.8 5.8 0 0 1 .8 7 5.3 5.3 0 0 1 1.78 2.82c.24.9.48 2.8-.8 4.74a5.22 5.22 0 0 1 .37 5.02c-1.02 2.32-3.57 4.14-8.51 6.1-3.08 1.22-5.9 2-5.92 2.01a44.33 44.33 0 0 1-10.93 1.6c-5.86 0-10.05-1.8-12.46-5.34-3.88-5.69-3.33-10.9 1.7-15.92 2.78-2.78 4.63-6.87 5.01-7.77.78-2.66 2.83-5.62 6.24-5.62a5.7 5.7 0 0 1 4.6 2.46c1-1.26 1.98-2.25 2.87-2.82A7.4 7.4 0 0 1 77.4 48Zm0 4c-.51 0-1.13.22-1.82.65-2.13 1.36-6.25 8.43-7.76 11.18a2.43 2.43 0 0 1-2.14 1.31c-1.54 0-2.75-1.53-.14-3.48 3.91-2.93 2.54-7.72.67-8.01a1.54 1.54 0 0 0-.24-.02c-1.7 0-2.45 2.93-2.45 2.93s-2.2 5.52-5.97 9.3c-3.78 3.77-3.98 6.8-1.22 10.83 1.87 2.75 5.47 3.58 9.15 3.58 3.82 0 7.73-.9 9.93-1.46.1-.03 13.45-3.8 11.76-7-.29-.54-.75-.76-1.34-.76-2.38 0-6.71 3.54-8.57 3.54-.42 0-.71-.17-.83-.6-.8-2.85 12.05-4.05 10.97-8.17-.19-.73-.7-1.02-1.44-1.02-3.14 0-10.2 5.53-11.68 5.53-.1 0-.19-.03-.23-.1-.74-1.2-.34-2.04 4.88-5.2 5.23-3.16 8.9-5.06 6.8-7.33-.23-.26-.57-.38-.98-.38-3.18 0-10.67 6.82-10.67 6.82s-2.02 2.1-3.24 2.1a.74.74 0 0 1-.68-.38c-.87-1.46 8.05-8.22 8.55-11.01.34-1.9-.24-2.85-1.31-2.85Z"}),a.jsx("path",{fill:"#FFD21E",d:"M56.33 76.69c-2.75-4.04-2.56-7.07 1.22-10.84 3.77-3.77 5.97-9.3 5.97-9.3s.82-3.2 2.7-2.9c1.86.3 3.23 5.08-.68 8.01-3.92 2.93.78 4.92 2.28 2.17 1.51-2.75 5.63-9.82 7.76-11.18 2.13-1.35 3.64-.6 3.13 2.2-.5 2.79-9.42 9.55-8.55 11 .86 1.47 3.92-1.71 3.92-1.71s9.58-8.71 11.66-6.44c2.08 2.27-1.58 4.17-6.8 7.33-5.23 3.16-5.63 4-4.9 5.2.75 1.2 12.28-8.53 13.36-4.4 1.08 4.11-11.76 5.3-10.97 8.15.8 2.85 9.05-5.38 10.74-2.18 1.69 3.21-11.65 6.98-11.76 7.01-4.31 1.12-15.26 3.49-19.08-2.12Z"})]});function T(s){const t=[...new Set(s.map(r=>r.replace(/ \(subtask\)$/,"")))],l=t.length>3?[...t.slice(0,2),`${t.length-2} more`]:t;return l.length>1?`${l.slice(0,-1).join(", ")} and ${l[l.length-1]}`:l[0]}const z="language-modeling";function p(s){return s?s.toLowerCase().replace(/\(.*?\)/g," ").replace(/[^a-z]+/g," ").replace(/\bllm\b/g," ").replace(/\s+/g," ").trim().replace(/s$/,""):""}function B(s){return p(s.slug)==="large language model"||p(s.name)==="large language model"}function D(s){return s.tags.includes(z)?s.methods.filter(t=>!B(t)):s.methods}const S=({name:s,slug:t,logoUrl:l})=>{const[r,i]=g.useState(!1);return!l||r?null:a.jsx(d,{to:`/orgs/${t}`,className:"paper-organization-logo","aria-label":`View ${s} organization`,title:s,children:a.jsx("img",{src:l,alt:"",onError:()=>i(!0)})})},q=({paper:s,priority:t=!1,showInstitution:l=!0,highlightQuery:r,followReasons:i})=>{const m=v(),u=`/paper/${s.id}`,n=g.useCallback(()=>{m.prefetchQuery({queryKey:y.detail(s.id),queryFn:()=>C.get(s.id,!0),staleTime:M})},[s.id,m]),F=s.authors.slice(0,3).map((e,o)=>{var b,N;const f=(b=s.authorIds)==null?void 0:b[o],j=(N=s.authorHfProfiles)==null?void 0:N[o];return a.jsxs(g.Fragment,{children:[o>0&&", ",j&&a.jsx(L,{className:"paper-card-author-avatar",url:j.avatarUrl}),f?a.jsx(d,{to:`/authors/${f}`,children:e}):e]},o)}),c=s.authors.length,x=D(s);return a.jsxs("article",{className:"paper-card",children:[a.jsx(d,{to:u,className:"paper-thumb-wrap",onFocus:n,onMouseEnter:n,children:a.jsx(Z,{paperId:s.id,title:s.title,thumbnailUrl:s.thumbnailUrl,priority:t})}),a.jsxs("div",{className:"paper-body",children:[a.jsxs("div",{className:"paper-body-main",children:[i&&i.length>0&&a.jsxs("div",{className:"paper-follow-reason",children:["Because you follow ",T(i)]}),a.jsxs("h3",{className:"paper-title",children:[a.jsx(d,{to:u,onFocus:n,onMouseEnter:n,children:a.jsx(U,{title:s.title,highlight:r})}),l&&s.organizations.length>0&&a.jsx("span",{className:"paper-organization-logos",children:s.organizations.map(e=>a.jsx(S,{...e},e.slug))})]}),a.jsxs("div",{className:"paper-authors",children:[F,c>3&&a.jsxs("span",{children:[", ","+",c-3," authors"]}),s.date&&a.jsxs(a.Fragment,{children:[c>0?" · ":"",a.jsx("span",{children:s.date})]}),s.citations>0&&a.jsxs(a.Fragment,{children:[c>0||s.date?" · ":"",a.jsxs("span",{children:[s.citations.toLocaleString()," citations"]})]})]}),s.abstract&&a.jsx("p",{className:"paper-abstract",children:a.jsx(w,{text:s.abstract,highlight:r})}),s.sotaRanks.length>0&&a.jsx(A,{ranks:s.sotaRanks,paperHref:u}),(s.tags.length>0||x.length>0)&&a.jsxs("div",{className:"paper-tags paper-tags--clamped",children:[s.tags.map(e=>a.jsx(k,{slug:e},e)),x.map(e=>a.jsx(E,{method:e},e.id||e.slug||e.name))]})]}),(s.githubUrl||s.hfUrl)&&a.jsxs("div",{className:"paper-resources",children:[h(s.githubUrl)&&a.jsxs("a",{className:"paper-resource is-link",href:h(s.githubUrl)??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":"Open GitHub repository",onClick:e=>e.stopPropagation(),children:[a.jsx(P,{name:"github",size:20}),s.velocity24h!=null&&s.velocity24h>0&&a.jsxs("span",{className:"resource-stat",children:[a.jsxs("span",{className:"resource-value",children:[a.jsx("span",{className:"gh-rate-arrow",children:"↑"}),s.velocity24h.toFixed(1)]}),a.jsx("span",{className:"resource-label",children:"stars / hr"})]})]}),h(s.hfUrl)&&s.hfKind&&a.jsxs("a",{className:"paper-resource is-link",href:h(s.hfUrl)??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":`Open Hugging Face ${s.hfKind}`,onClick:e=>e.stopPropagation(),children:[a.jsx($,{size:20}),a.jsxs("span",{className:"resource-stat",children:[a.jsx("span",{className:"resource-value",children:s.hfCount}),a.jsx("span",{className:"resource-label",children:s.hfKind})]})]})]})]})]})};export{q as P}; diff --git a/assets/PaperDetailView-CTPtjCWI.js b/assets/PaperDetailView-B7LjkGBN.js similarity index 98% rename from assets/PaperDetailView-CTPtjCWI.js rename to assets/PaperDetailView-B7LjkGBN.js index b4e83eb0d3a5b5c2ce7917daa393b750c277c87c..142e747b1781cb924fbf3205dacabe251521d10d 100644 --- a/assets/PaperDetailView-CTPtjCWI.js +++ b/assets/PaperDetailView-B7LjkGBN.js @@ -1,4 +1,4 @@ -import{c as ft,b as Q,t as ea,T as it,v as re,w as ta,k as rs,x as J,f as b,p as me,j as e,C as gt,l as Z,y as xt,X as ns,q as Lt,P as is,z as ee,B as os,D as pe,E as he,F as ls,G as bt,I as Ce,J as Tt,K as sa,L as K,M as aa,N as ra,R as na,O as ia,Q as cs,S as oa,h as la,U as ca,A as Se,m as da,a as Pe,V as Ee,W as se,i as ds,u as ua,Y as Dt,Z as ma,s as Ft,_ as ha,$ as pa,a0 as fa,a1 as ga,a2 as xa,a3 as ba}from"./index-3CfcAX6N.js";import{u as ae}from"./useMutation-CKC6OFhA.js";import{I as F}from"./Icon-C0d9p4Q2.js";import{T as ja,M as va,S as ya,P as _a}from"./SotaBadges-BqZMAXyY.js";import{L as Ne,a as ot}from"./LatexTitle-DvPeLepK.js";import{e as $e,C as ka,E as Na}from"./ExternalSourceEvalBadge-CqK4g_y6.js";import{p as U}from"./papers-BsYlGUQi.js";import{s as wa,a as Ca}from"./transform-Dx-N8Yyj.js";import{r as us,p as Sa}from"./paperReader-td2aJigh.js";import{a as Ea}from"./usePapers-CHoHKyWP.js";import{u as Pa,f as $a}from"./useDocumentTitle-BnA1kM_d.js";import{u as Ia}from"./preferences-BmWwgggH.js";import{s as Y}from"./safeExternalHref-CkBrsh84.js";import{F as Ut,i as Ra,P as Aa}from"./curation-BZoIvsHD.js";import{m as La}from"./mlIntern-CyazNz7i.js";import{S as ue}from"./skeleton-CQbSjC3L.js";import{A as Ta,a as Da}from"./alert-BXZ4lnnf.js";import{B as A}from"./button-CbnaBx6W.js";import{D as Ie,a as Re,c as Ae,b as Le,d as Te,e as jt}from"./dialog-Bbx5GVcy.js";import{A as Fa,a as Ua}from"./AgentLogos-06t31xxf.js";import{C as Ba}from"./copy-BCi4szva.js";import{u as ye,r as za,e as Ma}from"./evaluationQueryInvalidation-BJCX6Q6o.js";import{I as z}from"./input-B7wcXhgG.js";import{S as Bt}from"./searchable-select-DBlreWDS.js";import{L as vt}from"./loader-circle-CMgZ_maE.js";import{T as fe,n as He,g as zt,C as Ha}from"./CatalogEntityPreviewLink-BzZN33n7.js";import{S as ms,L as O,a as Oa}from"./SignInToEditDialog-P5ytZJBG.js";import{c as G}from"./catalog-B47DuClX.js";import{s as hs,p as ps}from"./submissions-D-jwpMfI.js";import{i as fs,a as gs,r as qa}from"./queryInvalidation-CO_YWd6U.js";import{D as Ka}from"./database-ut7m-SnN.js";import{P as ge}from"./plus-CiDEk52y.js";import{S as lt}from"./search-SnOvJVk_.js";import{B as xs}from"./badge-BgT1mGjP.js";import{G as Mt}from"./globe-DZ-1g_DI.js";import{G as Ht}from"./github-vz0wxUgq.js";import{u as bs}from"./index-Caztwwvv.js";import{c as Oe,A as Ga}from"./codex-C7vcS1UO.js";import{M as Qa}from"./index-DGr54pyn.js";import{r as Xa}from"./index-C8DcqbS3.js";import{u as Va}from"./useIntersectionObserver-wAZWG4G7.js";import{a as ct}from"./account-Ee9-ZosC.js";import{S as Ot,s as Wa}from"./savedPapersAuth-8mhzkOxc.js";import{o as Ya}from"./organizationNames-BVKzYEBp.js";import{A as Ja}from"./AuthorAvatar-DYaYcwPm.js";import"./colors-BkWRhvFI.js";import"./hover-card-DOKhkRf9.js";import"./useInfiniteQuery-DYwUEaoz.js";import"./popover-Dwe6SY1f.js";import"./textarea-CdcMknzH.js";/** +import{c as ft,b as Q,t as ea,T as it,v as re,w as ta,k as rs,x as J,f as b,p as me,j as e,C as gt,l as Z,y as xt,X as ns,q as Lt,P as is,z as ee,B as os,D as pe,E as he,F as ls,G as bt,I as Ce,J as Tt,K as sa,L as K,M as aa,N as ra,R as na,O as ia,Q as cs,S as oa,h as la,U as ca,A as Se,m as da,a as Pe,V as Ee,W as se,i as ds,u as ua,Y as Dt,Z as ma,s as Ft,_ as ha,$ as pa,a0 as fa,a1 as ga,a2 as xa,a3 as ba}from"./index-CxhY4zQ1.js";import{u as ae}from"./useMutation-BzRfwboV.js";import{I as F}from"./Icon-XOOkUEUX.js";import{T as ja,M as va,S as ya,P as _a}from"./SotaBadges-EnDhSaVO.js";import{L as Ne,a as ot}from"./LatexTitle-BqNrCKu8.js";import{e as $e,C as ka,E as Na}from"./ExternalSourceEvalBadge-VjNs_cVj.js";import{p as U}from"./papers-BDxSKSYJ.js";import{s as wa,a as Ca}from"./transform-DehuZQh7.js";import{r as us,p as Sa}from"./paperReader-td2aJigh.js";import{a as Ea}from"./usePapers-Cv13R7ph.js";import{u as Pa,f as $a}from"./useDocumentTitle-CC3zTSwA.js";import{u as Ia}from"./preferences-CUy01zEm.js";import{s as Y}from"./safeExternalHref-CkBrsh84.js";import{F as Ut,i as Ra,P as Aa}from"./curation-D2sqKAqC.js";import{m as La}from"./mlIntern-CBvHpMTi.js";import{S as ue}from"./skeleton-DdKViE4r.js";import{A as Ta,a as Da}from"./alert-C-NbJX4N.js";import{B as A}from"./button-BenSiukP.js";import{D as Ie,a as Re,c as Ae,b as Le,d as Te,e as jt}from"./dialog-CT48f48_.js";import{A as Fa,a as Ua}from"./AgentLogos-C9q7zZc4.js";import{C as Ba}from"./copy-Dpy50x4G.js";import{u as ye,r as za,e as Ma}from"./evaluationQueryInvalidation-PEtgmyxY.js";import{I as z}from"./input-CxKbyH9e.js";import{S as Bt}from"./searchable-select-hPIpmCr4.js";import{L as vt}from"./loader-circle-C5gQxAlQ.js";import{T as fe,n as He,g as zt,C as Ha}from"./CatalogEntityPreviewLink-Bp5A8eb_.js";import{S as ms,L as O,a as Oa}from"./SignInToEditDialog-0W7FFwc1.js";import{c as G}from"./catalog-DCEU6WpP.js";import{s as hs,p as ps}from"./submissions-DF3SD1oA.js";import{i as fs,a as gs,r as qa}from"./queryInvalidation-Djot7Ix_.js";import{D as Ka}from"./database-DTsYk9y1.js";import{P as ge}from"./plus-CEkdlNSn.js";import{S as lt}from"./search-CkWMhIw6.js";import{B as xs}from"./badge-Dj5QKh-d.js";import{G as Mt}from"./globe-DIhafOmF.js";import{G as Ht}from"./github-Bv102r_G.js";import{u as bs}from"./index-JxIVN7pD.js";import{c as Oe,A as Ga}from"./codex-Bw15uMy8.js";import{M as Qa}from"./index-BCjs92mB.js";import{r as Xa}from"./index-mv_8ovfA.js";import{u as Va}from"./useIntersectionObserver-ZqjUJuPc.js";import{a as ct}from"./account-Bplq3u-8.js";import{S as Ot,s as Wa}from"./savedPapersAuth-YhdYkTbG.js";import{o as Ya}from"./organizationNames-BVKzYEBp.js";import{A as Ja}from"./AuthorAvatar-DPz8YQ5Z.js";import"./colors-BkWRhvFI.js";import"./hover-card-CqKeZcpY.js";import"./useInfiniteQuery-vHEhIVF_.js";import"./popover-DgW_tN02.js";import"./textarea-uttJnDhA.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/PaperFeed-2dSUzcA2.js b/assets/PaperFeed-D1egUlu_.js similarity index 97% rename from assets/PaperFeed-2dSUzcA2.js rename to assets/PaperFeed-D1egUlu_.js index 3e4835a86ff3daa60de6781b687eaa5ec6ab4aad..4253ea7ea5925f7b2173e34cc0c4420de30e3e22 100644 --- a/assets/PaperFeed-2dSUzcA2.js +++ b/assets/PaperFeed-D1egUlu_.js @@ -1 +1 @@ -import{f as u,j as t,e as J,V as K}from"./index-3CfcAX6N.js";import{P as X}from"./PaperCard-BZtXccuT.js";import{P as ee,a as te,b as ae}from"./popover-Dwe6SY1f.js";import{I as se}from"./Icon-C0d9p4Q2.js";import{S as j}from"./skeleton-CQbSjC3L.js";import{u as ne}from"./useIntersectionObserver-wAZWG4G7.js";const Y=(e,a)=>{const s=new Date(a),n=new Date(s);return n.setUTCDate(s.getUTCDate()-(e==="week"?6:29)),{startDate:n.toISOString().slice(0,10),endDate:s.toISOString().slice(0,10)}},V=e=>({startDate:e.get("start_date")||void 0,endDate:e.get("end_date")||void 0}),Ne=(e,a=new Date,s="week")=>{const n=V(e);if(n.startDate||n.endDate||e.get("time")==="all_time")return n;const o=new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()));return Y(s,o)},Z=(e,a)=>{const s=new URLSearchParams(e);return a.startDate?s.set("start_date",a.startDate):s.delete("start_date"),a.endDate?s.set("end_date",a.endDate):s.delete("end_date"),s.delete("time"),s},Se=(e,a)=>{const s=Z(e,a);return!a.startDate&&!a.endDate&&s.set("time","all_time"),s},re=new Intl.DateTimeFormat("en",{month:"long",year:"numeric",timeZone:"UTC"}),H=new Intl.DateTimeFormat("en",{month:"short",timeZone:"UTC"}),O="(max-width: 640px)",oe=()=>{const[e,a]=u.useState(()=>typeof window<"u"&&window.matchMedia(O).matches);return u.useEffect(()=>{const s=window.matchMedia(O),n=o=>a(o.matches);return a(s.matches),s.addEventListener("change",n),()=>s.removeEventListener("change",n)},[]),e},W=e=>e.toISOString().slice(0,10),b=e=>new Date(`${e}T00:00:00Z`),ie=()=>{const e=new Date;return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))},F=(e,a)=>new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+a,1)),v=e=>new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),1)),ce=(e,a)=>new Date(Date.UTC(a,e.getUTCMonth(),1)),w=(e,a)=>e.startDate===a.startDate&&e.endDate===a.endDate,le=(e,a)=>{const s=b(e),n=b(a),o=H.format(s),i=H.format(n),d=s.getUTCDate(),l=n.getUTCDate(),r=s.getUTCFullYear(),p=n.getUTCFullYear();return e===a?`${o} ${d}, ${r}`:r===p&&s.getUTCMonth()===n.getUTCMonth()?`${o} ${d}–${l}, ${r}`:r===p?`${o} ${d}–${i} ${l}, ${r}`:`${o} ${d}, ${r}–${i} ${l}, ${p}`},de=e=>{const a=e.getUTCFullYear(),s=e.getUTCMonth(),n=new Date(Date.UTC(a,s,1)),o=(n.getUTCDay()+6)%7,i=new Date(n);return i.setUTCDate(n.getUTCDate()-o),Array.from({length:42},(d,l)=>{const r=new Date(i);return r.setUTCDate(i.getUTCDate()+l),{iso:W(r),day:r.getUTCDate(),outsideMonth:r.getUTCMonth()!==s}})},L=({month:e,today:a,startDate:s,endDate:n,onSelect:o,yearLabel:i,yearValue:d,onYearChange:l,secondary:r=!1})=>{const p=u.useMemo(()=>de(e),[e]);return t.jsxs("section",{className:`paper-date-calendar${r?" paper-date-calendar-secondary":""}`,children:[t.jsxs("label",{className:"paper-date-year",children:[t.jsx("span",{children:i}),t.jsx("input",{type:"number",inputMode:"numeric",min:"1900",max:a.slice(0,4),step:"1",value:d,onChange:c=>l(c.target.value)})]}),t.jsx("h3",{children:re.format(e)}),t.jsx("div",{className:"paper-date-weekdays","aria-hidden":"true",children:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"].map(c=>t.jsx("span",{children:c},c))}),t.jsx("div",{className:"paper-date-days",children:p.map(c=>{const g=c.iso===s||c.iso===n,m=!!(s&&n&&c.iso>s&&c.isoa;return t.jsx("button",{type:"button","aria-label":c.iso,"aria-selected":g,disabled:f,className:["paper-date-day",c.outsideMonth?"outside":"",g?"selected":"",m?"in-range":"",c.iso===a?"today":""].filter(Boolean).join(" "),onClick:()=>o(c.iso),children:c.day},c.iso)})})]})},I=({calendar:e,onPrevious:a,onNext:s,secondary:n=!1})=>t.jsxs("div",{className:`paper-date-navigation-group${n?" paper-date-navigation-group-secondary":""}`,children:[t.jsx("button",{type:"button","aria-label":`Previous ${e} month`,onClick:a,children:"←"}),t.jsx("button",{type:"button","aria-label":`Next ${e} month`,onClick:s,children:"→"})]}),he=({startDate:e,endDate:a,onChange:s,currentDate:n})=>{const o=oe(),i=n?b(n):ie(),[d,l]=u.useState(!1),[r,p]=u.useState(),[c,g]=u.useState(),[m,f]=u.useState(()=>v(i)),[_,T]=u.useState(()=>F(v(i),1)),[z,D]=u.useState(()=>String(i.getUTCFullYear())),[G,y]=u.useState(()=>String(i.getUTCFullYear())),N={startDate:e,endDate:a},M=Y("week",i),P=Y("month",i),k=W(i),R=!!(e&&a&&!w(N,M)&&!w(N,P)),Q=()=>{p(e),g(a);const h=v(e?b(e):i),x=v(a?b(a):F(h,1));f(h),T(x),D(String(h.getUTCFullYear())),y(String(x.getUTCFullYear())),l(!0)},E=(h,x,$)=>{if(x(h),!/^\d{4}$/.test(h))return;const C=Number(h);C>=1900&&C<=i.getUTCFullYear()&&$(U=>ce(U,C))},S=(h,x,$,C)=>{const U=F(h,x);$(U),C(String(U.getUTCFullYear()))},A=h=>{!r||c?(p(h),g(void 0)):h{s({}),l(!1)};return t.jsxs("div",{className:`paper-date-filter${o?" paper-date-filter-single-calendar":""}`,role:"group","aria-label":"Publication date",children:[t.jsx("button",{type:"button",className:`sort-btn sort-btn-time${w(N,M)?" active":""}`,onClick:()=>s(M),children:"Last Week"}),t.jsx("button",{type:"button",className:`sort-btn sort-btn-time${w(N,P)?" active":""}`,onClick:()=>s(P),children:"Last Month"}),t.jsx("button",{type:"button",className:`sort-btn sort-btn-time${!e&&!a?" active":""}`,onClick:()=>s({}),children:"All Time"}),t.jsxs(ee,{open:d,onOpenChange:h=>{h?Q():l(!1)},children:[t.jsx(te,{asChild:!0,children:t.jsx("button",{type:"button",className:`sort-btn sort-btn-time${R?" active":""}`,"aria-label":R?"Change date range":"Select a range",children:R&&e&&a?le(e,a):"Select a range"})}),t.jsxs(ae,{align:"end",className:`paper-date-popover${o?" paper-date-popover-single-calendar":""}`,role:"dialog","aria-label":"Select a date range",children:[t.jsxs("div",{className:"paper-date-popover-header",children:[t.jsx("h2",{children:"Select a date range"}),t.jsx("p",{children:"Choose an inclusive start and end publication date."})]}),t.jsxs("div",{className:"paper-date-navigation",children:[t.jsx(I,{calendar:"start",onPrevious:()=>S(m,-1,f,D),onNext:()=>S(m,1,f,D)}),!o&&t.jsx(I,{calendar:"end",onPrevious:()=>S(_,-1,T,y),onNext:()=>S(_,1,T,y),secondary:!0})]}),t.jsxs("div",{className:"paper-date-calendars",children:[t.jsx(L,{month:m,today:k,startDate:r,endDate:c,onSelect:A,yearLabel:o?"Year":"Start year",yearValue:z,onYearChange:h=>E(h,D,f)}),!o&&t.jsx(L,{month:_,today:k,startDate:r,endDate:c,onSelect:A,yearLabel:"End year",yearValue:G,onYearChange:h=>E(h,y,T),secondary:!0})]}),t.jsxs("div",{className:"paper-date-actions",children:[t.jsx("button",{type:"button",className:"paper-date-clear",onClick:q,children:"Clear range"}),t.jsxs("div",{children:[t.jsx("button",{type:"button",onClick:()=>l(!1),children:"Cancel"}),t.jsx("button",{type:"button",className:"paper-date-apply",disabled:!r||!c,onClick:()=>{r&&c&&s({startDate:r,endDate:c}),l(!1)},children:"Apply"})]})]})]})]})]})},pe=()=>t.jsxs("span",{className:"hf-resource-logo",children:[t.jsx("img",{className:"hf-resource-logo-black",src:"/hf-logo-monochrome-black.svg?v=20260729",alt:""}),t.jsx("img",{className:"hf-resource-logo-white",src:"/hf-logo-monochrome-white.svg?v=20260729",alt:""})]}),B=({checked:e,icon:a,label:s,onChange:n})=>t.jsxs("button",{type:"button",className:`paper-feed-filter ${e?"active":""}`,"aria-pressed":e,onClick:()=>n(!e),children:[t.jsxs("span",{className:"paper-feed-filter-content",children:[t.jsx("span",{className:"paper-feed-filter-icon","aria-hidden":"true",children:a}),s]}),e&&t.jsx("span",{className:"paper-feed-filter-check","aria-hidden":"true",children:"✓"})]}),ge=({hasCode:e,hasHfArtifacts:a,onHasCodeChange:s,onHasHfArtifactsChange:n,showDivider:o=!0,showHasCode:i=!0})=>t.jsxs("div",{className:"paper-feed-resource-controls",role:"group","aria-label":"Resource filters",children:[o&&t.jsx("span",{className:"paper-feed-resource-divider","aria-hidden":"true"}),t.jsxs("div",{className:"paper-feed-filter-options",children:[i&&t.jsx(B,{checked:e,icon:t.jsx(se,{name:"github",size:14}),label:"Has code",onChange:s}),t.jsx(B,{checked:a,icon:t.jsx(pe,{}),label:"Has artifacts",onChange:n})]})]});function ue(e,a="200px"){const{targetRef:s,isIntersecting:n}=ne({rootMargin:a}),{data:o,hasNextPage:i,isFetchingNextPage:d,fetchNextPage:l}=e;return u.useEffect(()=>{n&&i&&!d&&l()},[n,i,d,l,o]),s}const me=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]];function Ue(){const[e,a]=J(),s=e.get("order_by"),n=s==="date_published"||s==="citation_count"?s:"trending",o=e.get("has_code")==="true",i=e.get("has_hf_artifacts")==="true",d=V(e),l=(r,p)=>{const c=new URLSearchParams(e);p?c.set(r,p):c.delete(r),a(c)};return{searchParams:e,setSearchParams:a,orderBy:n,hasCode:o,hasHfArtifacts:i,dateRange:d,setOrderBy:r=>l("order_by",r==="trending"?null:r),setHasCode:r=>l("has_code",r?"true":null),setHasHfArtifacts:r=>l("has_hf_artifacts",r?"true":null),setDateRange:r=>a(Z(e,r)),filters:{order_by:n,order_dir:"desc",latest_only:!0,include_resources:!0,has_code:o,has_hf_artifacts:i,start_date:d.startDate,end_date:d.endDate}}}const ve=({feed:e,sorts:a=me,activeSort:s=e.orderBy,showDateFilter:n=!0,showHasCode:o,style:i,leading:d,children:l})=>t.jsxs("div",{className:"sort-bar",style:i,children:[d,t.jsxs("div",{className:"paper-feed-toolbar-controls",children:[a&&t.jsx("div",{className:"sort-options",children:a.map(([r,p])=>t.jsx("button",{type:"button",className:`sort-btn ${s===r?"active":""}`,onClick:()=>e.setOrderBy(r),children:p},r))}),t.jsx(ge,{hasCode:e.hasCode,hasHfArtifacts:e.hasHfArtifacts,onHasCodeChange:e.setHasCode,onHasHfArtifactsChange:e.setHasHfArtifacts,showDivider:!!a,showHasCode:o})]}),n&&t.jsx(he,{startDate:e.dateRange.startDate,endDate:e.dateRange.endDate,onChange:e.setDateRange}),l]}),fe=()=>t.jsx(j,{className:"h-40 w-full"}),xe=()=>t.jsxs("div",{className:"paper-card",children:[t.jsx("div",{className:"paper-thumb-wrap",children:t.jsx(j,{className:"paper-thumb-skeleton"})}),t.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[t.jsx(j,{className:"h-6 w-3/4"}),t.jsx(j,{className:"h-4 w-1/2"}),t.jsx(j,{className:"h-12 w-full"})]})]}),we=({query:e,isLoading:a=e.isLoading,cards:s,empty:n,skeleton:o="block",showInstitution:i,highlightQuery:d,cardHeader:l,rootMargin:r,children:p})=>{const c=ue(e,r);if(a){const g=o==="card"?xe:fe;return t.jsx("div",{className:"paper-list",children:Array.from({length:o==="card"?6:4}).map((m,f)=>t.jsx(g,{},f))})}return s.length===0?n===null?null:t.jsx("div",{className:"no-results",children:n}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"paper-list",children:s.map((g,m)=>t.jsxs(K.Fragment,{children:[l==null?void 0:l(m),t.jsx(X,{paper:g,priority:m<3,showInstitution:i,highlightQuery:d,followReasons:g.followReasons})]},g.id))}),t.jsx("div",{ref:c,style:{height:1}}),e.isFetchingNextPage&&t.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"}),p]})};export{we as P,he as a,ve as b,me as c,Ne as r,Ue as u,Se as w}; +import{f as u,j as t,e as J,V as K}from"./index-CxhY4zQ1.js";import{P as X}from"./PaperCard-DeWmBrg8.js";import{P as ee,a as te,b as ae}from"./popover-DgW_tN02.js";import{I as se}from"./Icon-XOOkUEUX.js";import{S as j}from"./skeleton-DdKViE4r.js";import{u as ne}from"./useIntersectionObserver-ZqjUJuPc.js";const Y=(e,a)=>{const s=new Date(a),n=new Date(s);return n.setUTCDate(s.getUTCDate()-(e==="week"?6:29)),{startDate:n.toISOString().slice(0,10),endDate:s.toISOString().slice(0,10)}},V=e=>({startDate:e.get("start_date")||void 0,endDate:e.get("end_date")||void 0}),Ne=(e,a=new Date,s="week")=>{const n=V(e);if(n.startDate||n.endDate||e.get("time")==="all_time")return n;const o=new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()));return Y(s,o)},Z=(e,a)=>{const s=new URLSearchParams(e);return a.startDate?s.set("start_date",a.startDate):s.delete("start_date"),a.endDate?s.set("end_date",a.endDate):s.delete("end_date"),s.delete("time"),s},Se=(e,a)=>{const s=Z(e,a);return!a.startDate&&!a.endDate&&s.set("time","all_time"),s},re=new Intl.DateTimeFormat("en",{month:"long",year:"numeric",timeZone:"UTC"}),H=new Intl.DateTimeFormat("en",{month:"short",timeZone:"UTC"}),O="(max-width: 640px)",oe=()=>{const[e,a]=u.useState(()=>typeof window<"u"&&window.matchMedia(O).matches);return u.useEffect(()=>{const s=window.matchMedia(O),n=o=>a(o.matches);return a(s.matches),s.addEventListener("change",n),()=>s.removeEventListener("change",n)},[]),e},W=e=>e.toISOString().slice(0,10),b=e=>new Date(`${e}T00:00:00Z`),ie=()=>{const e=new Date;return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))},F=(e,a)=>new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+a,1)),v=e=>new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),1)),ce=(e,a)=>new Date(Date.UTC(a,e.getUTCMonth(),1)),w=(e,a)=>e.startDate===a.startDate&&e.endDate===a.endDate,le=(e,a)=>{const s=b(e),n=b(a),o=H.format(s),i=H.format(n),d=s.getUTCDate(),l=n.getUTCDate(),r=s.getUTCFullYear(),p=n.getUTCFullYear();return e===a?`${o} ${d}, ${r}`:r===p&&s.getUTCMonth()===n.getUTCMonth()?`${o} ${d}–${l}, ${r}`:r===p?`${o} ${d}–${i} ${l}, ${r}`:`${o} ${d}, ${r}–${i} ${l}, ${p}`},de=e=>{const a=e.getUTCFullYear(),s=e.getUTCMonth(),n=new Date(Date.UTC(a,s,1)),o=(n.getUTCDay()+6)%7,i=new Date(n);return i.setUTCDate(n.getUTCDate()-o),Array.from({length:42},(d,l)=>{const r=new Date(i);return r.setUTCDate(i.getUTCDate()+l),{iso:W(r),day:r.getUTCDate(),outsideMonth:r.getUTCMonth()!==s}})},L=({month:e,today:a,startDate:s,endDate:n,onSelect:o,yearLabel:i,yearValue:d,onYearChange:l,secondary:r=!1})=>{const p=u.useMemo(()=>de(e),[e]);return t.jsxs("section",{className:`paper-date-calendar${r?" paper-date-calendar-secondary":""}`,children:[t.jsxs("label",{className:"paper-date-year",children:[t.jsx("span",{children:i}),t.jsx("input",{type:"number",inputMode:"numeric",min:"1900",max:a.slice(0,4),step:"1",value:d,onChange:c=>l(c.target.value)})]}),t.jsx("h3",{children:re.format(e)}),t.jsx("div",{className:"paper-date-weekdays","aria-hidden":"true",children:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"].map(c=>t.jsx("span",{children:c},c))}),t.jsx("div",{className:"paper-date-days",children:p.map(c=>{const g=c.iso===s||c.iso===n,m=!!(s&&n&&c.iso>s&&c.isoa;return t.jsx("button",{type:"button","aria-label":c.iso,"aria-selected":g,disabled:f,className:["paper-date-day",c.outsideMonth?"outside":"",g?"selected":"",m?"in-range":"",c.iso===a?"today":""].filter(Boolean).join(" "),onClick:()=>o(c.iso),children:c.day},c.iso)})})]})},I=({calendar:e,onPrevious:a,onNext:s,secondary:n=!1})=>t.jsxs("div",{className:`paper-date-navigation-group${n?" paper-date-navigation-group-secondary":""}`,children:[t.jsx("button",{type:"button","aria-label":`Previous ${e} month`,onClick:a,children:"←"}),t.jsx("button",{type:"button","aria-label":`Next ${e} month`,onClick:s,children:"→"})]}),he=({startDate:e,endDate:a,onChange:s,currentDate:n})=>{const o=oe(),i=n?b(n):ie(),[d,l]=u.useState(!1),[r,p]=u.useState(),[c,g]=u.useState(),[m,f]=u.useState(()=>v(i)),[_,T]=u.useState(()=>F(v(i),1)),[z,D]=u.useState(()=>String(i.getUTCFullYear())),[G,y]=u.useState(()=>String(i.getUTCFullYear())),N={startDate:e,endDate:a},M=Y("week",i),P=Y("month",i),k=W(i),R=!!(e&&a&&!w(N,M)&&!w(N,P)),Q=()=>{p(e),g(a);const h=v(e?b(e):i),x=v(a?b(a):F(h,1));f(h),T(x),D(String(h.getUTCFullYear())),y(String(x.getUTCFullYear())),l(!0)},E=(h,x,$)=>{if(x(h),!/^\d{4}$/.test(h))return;const C=Number(h);C>=1900&&C<=i.getUTCFullYear()&&$(U=>ce(U,C))},S=(h,x,$,C)=>{const U=F(h,x);$(U),C(String(U.getUTCFullYear()))},A=h=>{!r||c?(p(h),g(void 0)):h{s({}),l(!1)};return t.jsxs("div",{className:`paper-date-filter${o?" paper-date-filter-single-calendar":""}`,role:"group","aria-label":"Publication date",children:[t.jsx("button",{type:"button",className:`sort-btn sort-btn-time${w(N,M)?" active":""}`,onClick:()=>s(M),children:"Last Week"}),t.jsx("button",{type:"button",className:`sort-btn sort-btn-time${w(N,P)?" active":""}`,onClick:()=>s(P),children:"Last Month"}),t.jsx("button",{type:"button",className:`sort-btn sort-btn-time${!e&&!a?" active":""}`,onClick:()=>s({}),children:"All Time"}),t.jsxs(ee,{open:d,onOpenChange:h=>{h?Q():l(!1)},children:[t.jsx(te,{asChild:!0,children:t.jsx("button",{type:"button",className:`sort-btn sort-btn-time${R?" active":""}`,"aria-label":R?"Change date range":"Select a range",children:R&&e&&a?le(e,a):"Select a range"})}),t.jsxs(ae,{align:"end",className:`paper-date-popover${o?" paper-date-popover-single-calendar":""}`,role:"dialog","aria-label":"Select a date range",children:[t.jsxs("div",{className:"paper-date-popover-header",children:[t.jsx("h2",{children:"Select a date range"}),t.jsx("p",{children:"Choose an inclusive start and end publication date."})]}),t.jsxs("div",{className:"paper-date-navigation",children:[t.jsx(I,{calendar:"start",onPrevious:()=>S(m,-1,f,D),onNext:()=>S(m,1,f,D)}),!o&&t.jsx(I,{calendar:"end",onPrevious:()=>S(_,-1,T,y),onNext:()=>S(_,1,T,y),secondary:!0})]}),t.jsxs("div",{className:"paper-date-calendars",children:[t.jsx(L,{month:m,today:k,startDate:r,endDate:c,onSelect:A,yearLabel:o?"Year":"Start year",yearValue:z,onYearChange:h=>E(h,D,f)}),!o&&t.jsx(L,{month:_,today:k,startDate:r,endDate:c,onSelect:A,yearLabel:"End year",yearValue:G,onYearChange:h=>E(h,y,T),secondary:!0})]}),t.jsxs("div",{className:"paper-date-actions",children:[t.jsx("button",{type:"button",className:"paper-date-clear",onClick:q,children:"Clear range"}),t.jsxs("div",{children:[t.jsx("button",{type:"button",onClick:()=>l(!1),children:"Cancel"}),t.jsx("button",{type:"button",className:"paper-date-apply",disabled:!r||!c,onClick:()=>{r&&c&&s({startDate:r,endDate:c}),l(!1)},children:"Apply"})]})]})]})]})]})},pe=()=>t.jsxs("span",{className:"hf-resource-logo",children:[t.jsx("img",{className:"hf-resource-logo-black",src:"/hf-logo-monochrome-black.svg?v=20260729",alt:""}),t.jsx("img",{className:"hf-resource-logo-white",src:"/hf-logo-monochrome-white.svg?v=20260729",alt:""})]}),B=({checked:e,icon:a,label:s,onChange:n})=>t.jsxs("button",{type:"button",className:`paper-feed-filter ${e?"active":""}`,"aria-pressed":e,onClick:()=>n(!e),children:[t.jsxs("span",{className:"paper-feed-filter-content",children:[t.jsx("span",{className:"paper-feed-filter-icon","aria-hidden":"true",children:a}),s]}),e&&t.jsx("span",{className:"paper-feed-filter-check","aria-hidden":"true",children:"✓"})]}),ge=({hasCode:e,hasHfArtifacts:a,onHasCodeChange:s,onHasHfArtifactsChange:n,showDivider:o=!0,showHasCode:i=!0})=>t.jsxs("div",{className:"paper-feed-resource-controls",role:"group","aria-label":"Resource filters",children:[o&&t.jsx("span",{className:"paper-feed-resource-divider","aria-hidden":"true"}),t.jsxs("div",{className:"paper-feed-filter-options",children:[i&&t.jsx(B,{checked:e,icon:t.jsx(se,{name:"github",size:14}),label:"Has code",onChange:s}),t.jsx(B,{checked:a,icon:t.jsx(pe,{}),label:"Has artifacts",onChange:n})]})]});function ue(e,a="200px"){const{targetRef:s,isIntersecting:n}=ne({rootMargin:a}),{data:o,hasNextPage:i,isFetchingNextPage:d,fetchNextPage:l}=e;return u.useEffect(()=>{n&&i&&!d&&l()},[n,i,d,l,o]),s}const me=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]];function Ue(){const[e,a]=J(),s=e.get("order_by"),n=s==="date_published"||s==="citation_count"?s:"trending",o=e.get("has_code")==="true",i=e.get("has_hf_artifacts")==="true",d=V(e),l=(r,p)=>{const c=new URLSearchParams(e);p?c.set(r,p):c.delete(r),a(c)};return{searchParams:e,setSearchParams:a,orderBy:n,hasCode:o,hasHfArtifacts:i,dateRange:d,setOrderBy:r=>l("order_by",r==="trending"?null:r),setHasCode:r=>l("has_code",r?"true":null),setHasHfArtifacts:r=>l("has_hf_artifacts",r?"true":null),setDateRange:r=>a(Z(e,r)),filters:{order_by:n,order_dir:"desc",latest_only:!0,include_resources:!0,has_code:o,has_hf_artifacts:i,start_date:d.startDate,end_date:d.endDate}}}const ve=({feed:e,sorts:a=me,activeSort:s=e.orderBy,showDateFilter:n=!0,showHasCode:o,style:i,leading:d,children:l})=>t.jsxs("div",{className:"sort-bar",style:i,children:[d,t.jsxs("div",{className:"paper-feed-toolbar-controls",children:[a&&t.jsx("div",{className:"sort-options",children:a.map(([r,p])=>t.jsx("button",{type:"button",className:`sort-btn ${s===r?"active":""}`,onClick:()=>e.setOrderBy(r),children:p},r))}),t.jsx(ge,{hasCode:e.hasCode,hasHfArtifacts:e.hasHfArtifacts,onHasCodeChange:e.setHasCode,onHasHfArtifactsChange:e.setHasHfArtifacts,showDivider:!!a,showHasCode:o})]}),n&&t.jsx(he,{startDate:e.dateRange.startDate,endDate:e.dateRange.endDate,onChange:e.setDateRange}),l]}),fe=()=>t.jsx(j,{className:"h-40 w-full"}),xe=()=>t.jsxs("div",{className:"paper-card",children:[t.jsx("div",{className:"paper-thumb-wrap",children:t.jsx(j,{className:"paper-thumb-skeleton"})}),t.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[t.jsx(j,{className:"h-6 w-3/4"}),t.jsx(j,{className:"h-4 w-1/2"}),t.jsx(j,{className:"h-12 w-full"})]})]}),we=({query:e,isLoading:a=e.isLoading,cards:s,empty:n,skeleton:o="block",showInstitution:i,highlightQuery:d,cardHeader:l,rootMargin:r,children:p})=>{const c=ue(e,r);if(a){const g=o==="card"?xe:fe;return t.jsx("div",{className:"paper-list",children:Array.from({length:o==="card"?6:4}).map((m,f)=>t.jsx(g,{},f))})}return s.length===0?n===null?null:t.jsx("div",{className:"no-results",children:n}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"paper-list",children:s.map((g,m)=>t.jsxs(K.Fragment,{children:[l==null?void 0:l(m),t.jsx(X,{paper:g,priority:m<3,showInstitution:i,highlightQuery:d,followReasons:g.followReasons})]},g.id))}),t.jsx("div",{ref:c,style:{height:1}}),e.isFetchingNextPage&&t.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"}),p]})};export{we as P,he as a,ve as b,me as c,Ne as r,Ue as u,Se as w}; diff --git a/assets/PaperPreviewLink-BJAulcHJ.js b/assets/PaperPreviewLink-Y2LI3xZW.js similarity index 98% rename from assets/PaperPreviewLink-BJAulcHJ.js rename to assets/PaperPreviewLink-Y2LI3xZW.js index c169fa43bfe294d32c6e8c011617a55d2f228c02..33f9e6b9c256b9f5ef384bebae43846515324fdc 100644 --- a/assets/PaperPreviewLink-BJAulcHJ.js +++ b/assets/PaperPreviewLink-Y2LI3xZW.js @@ -1,4 +1,4 @@ -import{o as F,f as j,m as b,a as le,p as O,b as z,n as D,h as ce,s as ue,c as he,v as pe,S as me}from"./index-DGr54pyn.js";import{l as fe}from"./index-C8DcqbS3.js";import R from"./katex-DkKDou_j.js";import{j as p,V as A,a3 as de,p as xe,w as C,d as ge,l as ye,L as T,b as we,A as be}from"./index-3CfcAX6N.js";import{H as Ne,a as ve,b as ke}from"./hover-card-DOKhkRf9.js";import{p as I}from"./papers-BsYlGUQi.js";import{u as Fe}from"./useMutation-CKC6OFhA.js";function je(){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];F(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,""),m=this.stack[this.stack.length-1];F(m.type==="math"),this.exit(a),m.value=c;const f=m.data.hChildren[0];F(f.type==="element"),F(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(),m=this.stack[this.stack.length-1];F(m.type==="inlineMath"),this.exit(a),m.value=c,m.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 Ce(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),n.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` +import{o as F,f as j,m as b,a as le,p as O,b as z,n as D,h as ce,s as ue,c as he,v as pe,S as me}from"./index-BCjs92mB.js";import{l as fe}from"./index-mv_8ovfA.js";import R from"./katex-DkKDou_j.js";import{j as p,V as A,a3 as de,p as xe,w as C,d as ge,l as ye,L as T,b as we,A as be}from"./index-CxhY4zQ1.js";import{H as Ne,a as ve,b as ke}from"./hover-card-CqKeZcpY.js";import{p as I}from"./papers-BDxSKSYJ.js";import{u as Fe}from"./useMutation-BzRfwboV.js";function je(){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];F(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,""),m=this.stack[this.stack.length-1];F(m.type==="math"),this.exit(a),m.value=c;const f=m.data.hChildren[0];F(f.type==="element"),F(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(),m=this.stack[this.stack.length-1];F(m.type==="inlineMath"),this.exit(a),m.value=c,m.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 Ce(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),n.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` `,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||"",m=l.createTracker(a),f="$".repeat(Math.max(fe(c,"$")+1,2)),g=l.enter("mathFlow");let d=m.move(f);if(s.meta){const x=l.enter("mathFlowMeta");d+=m.move(l.safe(s.meta,{after:` `,before:d,encode:["$"],...m.current()})),x()}return d+=m.move(` `),c&&(d+=m.move(c+` diff --git a/assets/PaperReaderView-D01S6OM3.js b/assets/PaperReaderView-CMX4-aWi.js similarity index 91% rename from assets/PaperReaderView-D01S6OM3.js rename to assets/PaperReaderView-CMX4-aWi.js index c9c817094e4c5cf37400ba33c0cc10474274b685..f233a3a03eda02938bfccfbafb64e862236f34fa 100644 --- a/assets/PaperReaderView-D01S6OM3.js +++ b/assets/PaperReaderView-CMX4-aWi.js @@ -1 +1 @@ -import{f as s,b as F,j as r,A as ee,u as Fe,w as qe,k as He,a3 as Se,Z as Ke,L as G}from"./index-3CfcAX6N.js";import{u as Oe,R as De,A as Ue,c as Ve,d as Qe,a as Xe,P as Ze,e as Ye}from"./chatLifecycle-DK4zPLlA.js";import{M as Ge}from"./MarkdownText-BfMP6CxP.js";import{g as Je,a as et,b as tt}from"./papers-BsYlGUQi.js";import{f as at,w as rt,s as st,e as nt,a as J,b as je,c as _e}from"./paperReader-td2aJigh.js";import{a as it}from"./usePapers-CHoHKyWP.js";import{c as ot}from"./chat-81nIwu_j.js";import{s as te}from"./safeExternalHref-CkBrsh84.js";import{ChatExperience as ct}from"./ChatView-C7RaZyCS.js";import"./chatSessions-C9fOk1AR.js";/* empty css */import"./hover-card-DOKhkRf9.js";import"./CatalogEntityPreviewLink-BzZN33n7.js";import"./catalog-B47DuClX.js";import"./github-vz0wxUgq.js";import"./file-text-BnjsSheU.js";import"./PaperPreviewLink-BJAulcHJ.js";import"./index-DGr54pyn.js";import"./index-C8DcqbS3.js";import"./katex-DkKDou_j.js";import"./useMutation-CKC6OFhA.js";import"./thumbs-up-BMfH8ZZ-.js";import"./copy-BCi4szva.js";import"./queryOptions-C9woPjwX.js";import"./arrow-left-CZqhJnQC.js";import"./external-link-_7BCdt0S.js";import"./plus-CiDEk52y.js";import"./search-SnOvJVk_.js";import"./chevron-up-DgV4G0Wf.js";import"./AuthorAvatar-DYaYcwPm.js";import"./curation-BZoIvsHD.js";import"./useInfiniteQuery-DYwUEaoz.js";import"./McpShowcase-CcyaF6wZ.js";import"./AgentLogos-06t31xxf.js";import"./share-2-CvYRtEqg.js";import"./Icon-C0d9p4Q2.js";import"./mlIntern-CyazNz7i.js";import"./openrouter-Bol7eGlT.js";function lt(a){return a instanceof ee&&a.status===422?"This page could not be turned into a readable paper.":a instanceof ee&&a.status===503?"Paper content is still being prepared. Please try again later.":"The paper could not be loaded."}function dt({paperId:a,paperKey:i,paperTitle:c,paperHref:b,sourceUrl:t,resources:o,paperVersion:g="",selectionEnabled:v=!1,onReady:P,onPaperSelection:q,onPaperSelectionError:l}){var E;const A=s.useRef(null),x=at(t),C=F({queryKey:["paperWebPage",a],queryFn:()=>Je(a),enabled:!x,staleTime:5*6e4,retry:!1}),w=!x&&C.isPending,S=x||((E=C.data)==null?void 0:E.frameable)===!0,[u,T]=s.useState("original"),p=S&&u==="original",m=F({queryKey:["paperWebMarkdown",a],queryFn:()=>et(a),staleTime:5*6e4,retry:(K,$)=>K<2&&!($ instanceof ee&&$.status<500),retryDelay:3e3}),y=m.isSuccess;s.useEffect(()=>{y&&(P==null||P())},[P,y]),Oe({enabled:v&&!!g&&y&&!p,pagesRoot:A,routeId:i,paperVersion:g,numPages:1,onSelect:q,onError:l});const R=m.data?rt(m.data):"",H=!!(o!=null&&o.projectPage&&st(o.projectPage.href,t));return r.jsxs("div",{className:"pdf-viewer",children:[r.jsx(De,{paperTitle:c,paperHref:b,resources:o,label:"Paper controls",children:r.jsxs("div",{className:"pdf-toolbar-controls",children:[S&&r.jsxs("div",{className:"reader-web-view-toggle",role:"group","aria-label":"Paper view",children:[r.jsx("button",{type:"button","aria-pressed":p,onClick:()=>T("original"),children:"Original"}),r.jsx("button",{type:"button","aria-pressed":!p,title:"Readable text; select a passage to ask the chat about it",onClick:()=>T("text"),children:"Text"})]}),!H&&r.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",children:"Open original"})]})}),r.jsx("div",{className:"pdf-scroll-frame",children:w?r.jsx("div",{className:"pdf-loading",role:"status",children:"Loading the paper…"}):p?r.jsx("iframe",{className:"reader-web-frame",src:t,title:`Original page: ${c}`,sandbox:"allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox",referrerPolicy:"strict-origin-when-cross-origin"}):r.jsx("div",{className:"pdf-scroll",role:"region","aria-label":"Paper web page",children:m.isPending?r.jsx("div",{className:"pdf-loading",role:"status",children:"Preparing a readable version of this page…"}):m.isError?r.jsxs("div",{className:"pdf-error",role:"alert",children:[r.jsx("p",{children:lt(m.error)}),r.jsxs("div",{children:[r.jsx("button",{type:"button",onClick:()=>void m.refetch(),children:"Retry"})," ",r.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",children:"Open original"})]})]}):r.jsxs("article",{ref:A,className:"reader-web-document","data-page":"1",children:[!R.startsWith("# ")&&r.jsx("h1",{children:c}),r.jsx(Ge,{text:R})]})})})]})}const Ce=66,ut=240,ae="pwc:reader:split-ratio";function pt(a){const i=Number(sessionStorage.getItem(_e(a)));return Number.isInteger(i)&&i>0?i:1}function ft(){const a=Number(localStorage.getItem(ae));return Number.isFinite(a)&&a>=45&&a<=75?a:Ce}function mt(a){const i=te(a);if(!i)return null;const c=new URL(i);return(c.hostname==="arxiv.org"||c.hostname==="www.arxiv.org")&&c.pathname.startsWith("/pdf/")&&c.pathname.endsWith(".pdf")&&(c.pathname=c.pathname.slice(0,-4)),c.href}const ht=/^\/pdf\/(\d{4}\.\d{4,5}(?:v\d{1,3})?|[a-z]+(?:-[a-z]+)*(?:\.[A-Z]{2})?\/\d{7}(?:v\d{1,3})?)$/;function gt(a){const i=new URL(a),c=i.pathname.match(ht);return(i.hostname==="arxiv.org"||i.hostname==="www.arxiv.org")&&c&&!i.search?Se(`/paper-assets/arxiv-pdf/${c[1]}`)??a:a}function bt(a){return new URL(a).hostname.replace(/^www\./,"")}function vt(a){if(!a)return{};const i={};for(const t of a.repositories??[]){if(!t.is_official)continue;const o=te(t.url);if(!o)continue;const g=new URL(o),v=g.pathname.split("/").filter(Boolean);if((g.hostname==="github.com"||g.hostname==="www.github.com")&&v.length>=2){i.repository={href:o,stars:t.num_stars||0};break}}const c=[...a.project_pages??[]].sort((t,o)=>Number(o.is_official)-Number(t.is_official));for(const t of c){const o=te(t.url);if(o){i.projectPage={href:o,label:bt(o)};break}}const b=a.hf_artifact_summary?a.hf_artifact_summary.model_count+a.hf_artifact_summary.dataset_count+a.hf_artifact_summary.space_count:new Set([...a.hf_models??[],...a.hf_datasets??[],...a.hf_spaces??[]]).size;return b>0&&a.arxiv_id&&(i.huggingFace={href:`https://huggingface.co/papers/${a.arxiv_id.replace(/v\d+$/i,"")}`,count:b}),i}function xt({routeId:a}){var xe,Pe,we,ye,Re;const i=He(),c=it(a,!!a),b=F({queryKey:["chatAvailability"],queryFn:()=>ot.getAvailability(),refetchInterval:3e4,retry:!1}),t=c.data,o=t?nt(t):null,g=o?null:(t==null?void 0:t.source)==="external"?Se(`/paper-assets/external/${t.id}/paper.pdf`):mt(t==null?void 0:t.url_pdf),v=g&&(t==null?void 0:t.source)!=="external"?gt(g):g,P=vt(t),q=s.useMemo(()=>{var e;return(e=t==null?void 0:t.author_links)==null?void 0:e.flatMap(n=>n.id?[{id:n.id,name:n.name,avatarUrl:n.hf_avatar_url}]:[])},[t==null?void 0:t.author_links]),l=((xe=t==null?void 0:t.arxiv_id)==null?void 0:xe.replace(/v\d+$/i,""))||a,A=s.useCallback(()=>i(`/paper/${l}`),[l,i]),[x,C]=s.useState(()=>sessionStorage.getItem(J(a))||void 0),[w,S]=s.useState(ft),[u,T]=s.useState(()=>sessionStorage.getItem(je(a))==="1"),[p,m]=s.useState("paper"),[y,R]=s.useState(),[H,E]=s.useState(),[K,$]=s.useState(!1),ke=s.useCallback(()=>$(!0),[]),[Ne,_]=s.useState(""),[re]=s.useState(()=>pt(a)),[k,Ae]=s.useState(0),[se,ne]=s.useState(!1),[Te,ie]=s.useState(!1),I=s.useRef(null),O=s.useRef(null),W=s.useRef(null),oe=s.useRef(null),ce=s.useRef(null),D=s.useRef(!1),M=s.useRef(!1),U=s.useRef(0),j=s.useRef(0),V=s.useRef(0),N=s.useRef(w),le=s.useRef(re),Q=s.useRef(t==null?void 0:t.version),de=Ve().reset,ue=s.useRef(x),f=k>=840;s.useEffect(()=>{ue.current!==x&&(ue.current=x,de())},[x,de]),s.useEffect(()=>{t!=null&&t.version&&Q.current&&t.version!==Q.current&&(R(void 0),_("")),Q.current=t==null?void 0:t.version},[t==null?void 0:t.version]),s.useEffect(()=>()=>{window.clearTimeout(U.current),cancelAnimationFrame(j.current)},[]),s.useLayoutEffect(()=>{const e=I.current;if(!e)return;const n=()=>Ae(e.clientWidth);n();const d=new ResizeObserver(n);return d.observe(e),()=>d.disconnect()},[t]),s.useEffect(()=>{if(!t)return;document.title=`${t.title} — Papers With Code reader`;let e=document.querySelector('meta[name="robots"]');const n=!e;e||(e=document.createElement("meta"),e.name="robots",document.head.appendChild(e));const d=e.content;e.content="noindex, nofollow";let h=document.querySelector('link[rel="canonical"]');const Le=!h;h||(h=document.createElement("link"),h.rel="canonical",document.head.appendChild(h));const Be=h.href;return h.href=`${window.location.origin}/paper/${l}`,()=>{document.title="Papers With Code",n?e==null||e.remove():e&&(e.content=d),Le?h==null||h.remove():h&&(h.href=Be)}},[l,t]);const z=s.useCallback(e=>{if(!k)return Math.max(45,Math.min(75,e));const n=480/k*100,d=100-360/k*100;return Math.max(n,Math.min(d,e))},[k]);s.useEffect(()=>S(e=>{const n=z(e);return N.current=n,n}),[z]);const L=e=>{const n=z(e);N.current=n,S(n),localStorage.setItem(ae,String(n))},pe=e=>{var d;const n=z(e);N.current=n,O.current&&(O.current.style.width=`${n}%`),W.current&&(W.current.style.width=`${100-n}%`),(d=oe.current)==null||d.setAttribute("aria-valuenow",String(Math.round(n)))},fe=e=>{V.current=e,!j.current&&(j.current=requestAnimationFrame(()=>{var d;j.current=0;const n=(d=I.current)==null?void 0:d.getBoundingClientRect();n!=null&&n.width&&pe((V.current-n.left)/n.width*100)}))},Ee=e=>{M.current=!0,ne(!0),e.currentTarget.setPointerCapture(e.pointerId),fe(e.clientX)},X=()=>{var e;if(M.current){if(j.current){cancelAnimationFrame(j.current),j.current=0;const n=(e=I.current)==null?void 0:e.getBoundingClientRect();n!=null&&n.width&&pe((V.current-n.left)/n.width*100)}M.current=!1,S(N.current),localStorage.setItem(ae,String(N.current)),ne(!1)}},me=e=>{window.clearTimeout(U.current),ie(!0),T(e),sessionStorage.setItem(je(a),e?"1":"0"),U.current=window.setTimeout(()=>ie(!1),ut+40)},he=e=>{D.current=!0,me(e)};s.useEffect(()=>{var e;D.current&&(D.current=!1,(e=u?ce.current:W.current)==null||e.focus())},[u]);const $e=e=>{C(e),sessionStorage.setItem(J(a),e)},Ie=()=>{C(void 0),sessionStorage.removeItem(J(a)),R(void 0),_("")},ge=((Pe=b.data)==null?void 0:Pe.paper_reader_selection_enabled)===!0,be=e=>{R(e),_(`Selection from page ${e.page} added to chat`),f&&u&&me(!1)},We=s.useCallback(e=>{R(e),e||_("")},[]),Z=((we=b.data)==null?void 0:we.paper_reader_citations_enabled)===!0&&!!v,B=F({queryKey:["paper-layout",l],queryFn:()=>tt(l),enabled:Z&&!!l,staleTime:5*6e4}).data,Me=s.useMemo(()=>Z?{layout:B,open:e=>{const n=B?Qe(B,e):[];n.length&&(E(d=>({boxes:n,nonce:((d==null?void 0:d.nonce)??0)+1})),m("paper"))}}:null,[Z,B]),ve=Ke()&&((ye=b.data)==null?void 0:ye.paper_reader_chat_enabled)!==!1,Y=!!(t&&ve&&!(o&&!K)),ze=t&&ve&&!Y?r.jsx("div",{className:"reader-chat-unavailable",role:"status",children:"Chat opens once the paper is ready."}):t&&Y?r.jsx(ct,{mode:"paper",routeSessionId:x,primaryPaper:{id:t.id,routeId:l,title:t.title,arxivId:t.arxiv_id},currentPage:()=>le.current,paperSelection:y,onPaperSelectionChange:We,onSessionId:$e,onReaderSubmit:()=>m("assistant"),onReaderNewChat:Ie,onReaderClose:f?()=>he(!0):void 0}):r.jsx("div",{className:"reader-chat-unavailable",children:"Chat is not enabled for this preview."});return c.isLoading?r.jsx("div",{className:"reader-status",role:"status",children:"Loading paper…"}):c.error||!t?r.jsxs("div",{className:"reader-status",role:"alert",children:[r.jsx("p",{children:"Paper not found."}),r.jsx(G,{to:"/papers",children:"Browse papers"})]}):((Re=b.data)==null?void 0:Re.native_pdf_reader_enabled)===!1?r.jsxs("div",{className:"reader-status",role:"alert",children:[r.jsx("p",{children:"The native reader is currently unavailable."}),r.jsx(G,{to:`/paper/${l}`,children:"Back to paper"})]}):!v&&!o?r.jsxs("div",{className:"reader-status",role:"alert",children:[r.jsx("p",{children:"Native reading is unavailable for this resource."}),r.jsx(G,{to:`/paper/${l}`,children:"Back to paper"})]}):r.jsxs("div",{className:"paper-reader-shell",children:[!f&&r.jsxs("div",{className:"reader-tabs",role:"tablist","aria-label":"Reader panels",children:[r.jsx("button",{type:"button",role:"tab","aria-selected":p==="paper",onClick:()=>m("paper"),children:"Paper"}),r.jsxs("button",{type:"button",role:"tab","aria-selected":p==="assistant","aria-label":y&&p!=="assistant"?"Chat, selection attached":"Chat",onClick:()=>m("assistant"),children:["Chat",y&&p!=="assistant"&&r.jsx("span",{className:"reader-tab-pending","aria-hidden":"true"})]})]}),r.jsx(Xe,{variant:"reader",children:r.jsxs("div",{ref:I,className:`reader-workspace${f?" is-desktop":" is-tabs"}${u?" is-assistant-collapsed":""}${se?" is-resizing":""}`,"data-testid":"paper-chat-workspace",children:[r.jsx("section",{ref:O,className:`reader-paper-pane${!f&&p!=="paper"?" is-hidden":""}`,style:f?{width:u?"100%":`${w}%`}:void 0,role:"tabpanel","aria-label":"Paper","aria-hidden":!f&&p!=="paper",children:o?r.jsx(dt,{paperId:t.id,paperKey:l,paperTitle:t.title,paperHref:`/paper/${l}`,sourceUrl:o,resources:P,paperVersion:t.version,selectionEnabled:ge,onReady:ke,onPaperSelection:be,onPaperSelectionError:_}):v&&r.jsx(Ze,{url:v,downloadUrl:g??v,paperKey:l,paperTitle:t.title,paperHref:`/paper/${l}`,onClose:A,resources:P,initialPage:re,resizeActive:se||Te,selectionEnabled:ge,paperVersion:t.version,authors:q,loadErrorMessage:t.source==="external"?"Paper content is still being prepared. Please try again later.":void 0,onPaperSelection:be,onPaperSelectionError:_,highlight:H,onPageChange:e=>{le.current=e,sessionStorage.setItem(_e(a),String(e))}})}),f&&!u&&r.jsx("div",{ref:oe,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:Ee,onPointerMove:e=>{M.current&&fe(e.clientX)},onPointerUp:X,onPointerCancel:X,onLostPointerCapture:X,onDoubleClick:()=>L(Ce),onKeyDown:e=>{(e.key==="ArrowLeft"||e.key==="ArrowRight")&&(e.preventDefault(),L(w+(e.key==="ArrowRight"?2:-2))),e.key==="Home"&&L(45),e.key==="End"&&L(75)}}),r.jsx("aside",{ref:W,id:"reader-chat-panel",className:`reader-assistant-pane${!f&&p!=="assistant"?" is-hidden":""}${f&&u?" is-collapsed":""}`,style:f?{width:u?0:`${100-w}%`}:void 0,role:"tabpanel","aria-label":"Chat","aria-hidden":!f&&p!=="assistant"||u,tabIndex:-1,children:r.jsx(Ye.Provider,{value:Me,children:ze})}),r.jsx("div",{className:"sr-only","aria-live":"polite",children:Ne}),f&&(u||!Y)&&r.jsx("button",{ref:ce,type:"button",className:"reader-collapse-assistant","aria-controls":"reader-chat-panel","aria-expanded":!u,onClick:()=>he(!u),children:u?"Open chat":"Hide chat"})]})})]})}function ia(){const{paperId:a=""}=Fe(),i=qe(a).replace(/v\d+$/i,"");return r.jsx(Ue,{workspaceKey:`reader:${a}`,children:r.jsx(xt,{routeId:i},i)})}export{ia as default,vt as readerToolbarResources}; +import{f as s,b as F,j as r,A as ee,u as Fe,w as qe,k as He,a3 as Se,Z as Ke,L as G}from"./index-CxhY4zQ1.js";import{u as Oe,R as De,A as Ue,c as Ve,d as Qe,a as Xe,P as Ze,e as Ye}from"./chatLifecycle-CUjL6RQJ.js";import{M as Ge}from"./MarkdownText-D0WkOxKi.js";import{g as Je,a as et,b as tt}from"./papers-BDxSKSYJ.js";import{f as at,w as rt,s as st,e as nt,a as J,b as je,c as _e}from"./paperReader-td2aJigh.js";import{a as it}from"./usePapers-Cv13R7ph.js";import{c as ot}from"./chat-CkiIbMG5.js";import{s as te}from"./safeExternalHref-CkBrsh84.js";import{ChatExperience as ct}from"./ChatView-BNDJ2kH3.js";import"./chatSessions-DjtMpqHz.js";/* empty css */import"./hover-card-CqKeZcpY.js";import"./CatalogEntityPreviewLink-Bp5A8eb_.js";import"./catalog-DCEU6WpP.js";import"./github-Bv102r_G.js";import"./file-text-42n3m1yn.js";import"./PaperPreviewLink-Y2LI3xZW.js";import"./index-BCjs92mB.js";import"./index-mv_8ovfA.js";import"./katex-DkKDou_j.js";import"./useMutation-BzRfwboV.js";import"./thumbs-up-DP1Ac3Tb.js";import"./copy-Dpy50x4G.js";import"./queryOptions-C9woPjwX.js";import"./arrow-left-CDwy-_cK.js";import"./external-link-UhGsnDEF.js";import"./plus-CEkdlNSn.js";import"./search-CkWMhIw6.js";import"./chevron-up-ClmVTWYw.js";import"./AuthorAvatar-DPz8YQ5Z.js";import"./curation-D2sqKAqC.js";import"./useInfiniteQuery-vHEhIVF_.js";import"./McpShowcase-CXm3UZ_U.js";import"./AgentLogos-C9q7zZc4.js";import"./share-2-LsSZFLYg.js";import"./Icon-XOOkUEUX.js";import"./mlIntern-CBvHpMTi.js";import"./openrouter-DLk2ZdMf.js";function lt(a){return a instanceof ee&&a.status===422?"This page could not be turned into a readable paper.":a instanceof ee&&a.status===503?"Paper content is still being prepared. Please try again later.":"The paper could not be loaded."}function dt({paperId:a,paperKey:i,paperTitle:c,paperHref:b,sourceUrl:t,resources:o,paperVersion:g="",selectionEnabled:v=!1,onReady:P,onPaperSelection:q,onPaperSelectionError:l}){var E;const A=s.useRef(null),x=at(t),C=F({queryKey:["paperWebPage",a],queryFn:()=>Je(a),enabled:!x,staleTime:5*6e4,retry:!1}),w=!x&&C.isPending,S=x||((E=C.data)==null?void 0:E.frameable)===!0,[u,T]=s.useState("original"),p=S&&u==="original",m=F({queryKey:["paperWebMarkdown",a],queryFn:()=>et(a),staleTime:5*6e4,retry:(K,$)=>K<2&&!($ instanceof ee&&$.status<500),retryDelay:3e3}),y=m.isSuccess;s.useEffect(()=>{y&&(P==null||P())},[P,y]),Oe({enabled:v&&!!g&&y&&!p,pagesRoot:A,routeId:i,paperVersion:g,numPages:1,onSelect:q,onError:l});const R=m.data?rt(m.data):"",H=!!(o!=null&&o.projectPage&&st(o.projectPage.href,t));return r.jsxs("div",{className:"pdf-viewer",children:[r.jsx(De,{paperTitle:c,paperHref:b,resources:o,label:"Paper controls",children:r.jsxs("div",{className:"pdf-toolbar-controls",children:[S&&r.jsxs("div",{className:"reader-web-view-toggle",role:"group","aria-label":"Paper view",children:[r.jsx("button",{type:"button","aria-pressed":p,onClick:()=>T("original"),children:"Original"}),r.jsx("button",{type:"button","aria-pressed":!p,title:"Readable text; select a passage to ask the chat about it",onClick:()=>T("text"),children:"Text"})]}),!H&&r.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",children:"Open original"})]})}),r.jsx("div",{className:"pdf-scroll-frame",children:w?r.jsx("div",{className:"pdf-loading",role:"status",children:"Loading the paper…"}):p?r.jsx("iframe",{className:"reader-web-frame",src:t,title:`Original page: ${c}`,sandbox:"allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox",referrerPolicy:"strict-origin-when-cross-origin"}):r.jsx("div",{className:"pdf-scroll",role:"region","aria-label":"Paper web page",children:m.isPending?r.jsx("div",{className:"pdf-loading",role:"status",children:"Preparing a readable version of this page…"}):m.isError?r.jsxs("div",{className:"pdf-error",role:"alert",children:[r.jsx("p",{children:lt(m.error)}),r.jsxs("div",{children:[r.jsx("button",{type:"button",onClick:()=>void m.refetch(),children:"Retry"})," ",r.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",children:"Open original"})]})]}):r.jsxs("article",{ref:A,className:"reader-web-document","data-page":"1",children:[!R.startsWith("# ")&&r.jsx("h1",{children:c}),r.jsx(Ge,{text:R})]})})})]})}const Ce=66,ut=240,ae="pwc:reader:split-ratio";function pt(a){const i=Number(sessionStorage.getItem(_e(a)));return Number.isInteger(i)&&i>0?i:1}function ft(){const a=Number(localStorage.getItem(ae));return Number.isFinite(a)&&a>=45&&a<=75?a:Ce}function mt(a){const i=te(a);if(!i)return null;const c=new URL(i);return(c.hostname==="arxiv.org"||c.hostname==="www.arxiv.org")&&c.pathname.startsWith("/pdf/")&&c.pathname.endsWith(".pdf")&&(c.pathname=c.pathname.slice(0,-4)),c.href}const ht=/^\/pdf\/(\d{4}\.\d{4,5}(?:v\d{1,3})?|[a-z]+(?:-[a-z]+)*(?:\.[A-Z]{2})?\/\d{7}(?:v\d{1,3})?)$/;function gt(a){const i=new URL(a),c=i.pathname.match(ht);return(i.hostname==="arxiv.org"||i.hostname==="www.arxiv.org")&&c&&!i.search?Se(`/paper-assets/arxiv-pdf/${c[1]}`)??a:a}function bt(a){return new URL(a).hostname.replace(/^www\./,"")}function vt(a){if(!a)return{};const i={};for(const t of a.repositories??[]){if(!t.is_official)continue;const o=te(t.url);if(!o)continue;const g=new URL(o),v=g.pathname.split("/").filter(Boolean);if((g.hostname==="github.com"||g.hostname==="www.github.com")&&v.length>=2){i.repository={href:o,stars:t.num_stars||0};break}}const c=[...a.project_pages??[]].sort((t,o)=>Number(o.is_official)-Number(t.is_official));for(const t of c){const o=te(t.url);if(o){i.projectPage={href:o,label:bt(o)};break}}const b=a.hf_artifact_summary?a.hf_artifact_summary.model_count+a.hf_artifact_summary.dataset_count+a.hf_artifact_summary.space_count:new Set([...a.hf_models??[],...a.hf_datasets??[],...a.hf_spaces??[]]).size;return b>0&&a.arxiv_id&&(i.huggingFace={href:`https://huggingface.co/papers/${a.arxiv_id.replace(/v\d+$/i,"")}`,count:b}),i}function xt({routeId:a}){var xe,Pe,we,ye,Re;const i=He(),c=it(a,!!a),b=F({queryKey:["chatAvailability"],queryFn:()=>ot.getAvailability(),refetchInterval:3e4,retry:!1}),t=c.data,o=t?nt(t):null,g=o?null:(t==null?void 0:t.source)==="external"?Se(`/paper-assets/external/${t.id}/paper.pdf`):mt(t==null?void 0:t.url_pdf),v=g&&(t==null?void 0:t.source)!=="external"?gt(g):g,P=vt(t),q=s.useMemo(()=>{var e;return(e=t==null?void 0:t.author_links)==null?void 0:e.flatMap(n=>n.id?[{id:n.id,name:n.name,avatarUrl:n.hf_avatar_url}]:[])},[t==null?void 0:t.author_links]),l=((xe=t==null?void 0:t.arxiv_id)==null?void 0:xe.replace(/v\d+$/i,""))||a,A=s.useCallback(()=>i(`/paper/${l}`),[l,i]),[x,C]=s.useState(()=>sessionStorage.getItem(J(a))||void 0),[w,S]=s.useState(ft),[u,T]=s.useState(()=>sessionStorage.getItem(je(a))==="1"),[p,m]=s.useState("paper"),[y,R]=s.useState(),[H,E]=s.useState(),[K,$]=s.useState(!1),ke=s.useCallback(()=>$(!0),[]),[Ne,_]=s.useState(""),[re]=s.useState(()=>pt(a)),[k,Ae]=s.useState(0),[se,ne]=s.useState(!1),[Te,ie]=s.useState(!1),I=s.useRef(null),O=s.useRef(null),W=s.useRef(null),oe=s.useRef(null),ce=s.useRef(null),D=s.useRef(!1),M=s.useRef(!1),U=s.useRef(0),j=s.useRef(0),V=s.useRef(0),N=s.useRef(w),le=s.useRef(re),Q=s.useRef(t==null?void 0:t.version),de=Ve().reset,ue=s.useRef(x),f=k>=840;s.useEffect(()=>{ue.current!==x&&(ue.current=x,de())},[x,de]),s.useEffect(()=>{t!=null&&t.version&&Q.current&&t.version!==Q.current&&(R(void 0),_("")),Q.current=t==null?void 0:t.version},[t==null?void 0:t.version]),s.useEffect(()=>()=>{window.clearTimeout(U.current),cancelAnimationFrame(j.current)},[]),s.useLayoutEffect(()=>{const e=I.current;if(!e)return;const n=()=>Ae(e.clientWidth);n();const d=new ResizeObserver(n);return d.observe(e),()=>d.disconnect()},[t]),s.useEffect(()=>{if(!t)return;document.title=`${t.title} — Papers With Code reader`;let e=document.querySelector('meta[name="robots"]');const n=!e;e||(e=document.createElement("meta"),e.name="robots",document.head.appendChild(e));const d=e.content;e.content="noindex, nofollow";let h=document.querySelector('link[rel="canonical"]');const Le=!h;h||(h=document.createElement("link"),h.rel="canonical",document.head.appendChild(h));const Be=h.href;return h.href=`${window.location.origin}/paper/${l}`,()=>{document.title="Papers With Code",n?e==null||e.remove():e&&(e.content=d),Le?h==null||h.remove():h&&(h.href=Be)}},[l,t]);const z=s.useCallback(e=>{if(!k)return Math.max(45,Math.min(75,e));const n=480/k*100,d=100-360/k*100;return Math.max(n,Math.min(d,e))},[k]);s.useEffect(()=>S(e=>{const n=z(e);return N.current=n,n}),[z]);const L=e=>{const n=z(e);N.current=n,S(n),localStorage.setItem(ae,String(n))},pe=e=>{var d;const n=z(e);N.current=n,O.current&&(O.current.style.width=`${n}%`),W.current&&(W.current.style.width=`${100-n}%`),(d=oe.current)==null||d.setAttribute("aria-valuenow",String(Math.round(n)))},fe=e=>{V.current=e,!j.current&&(j.current=requestAnimationFrame(()=>{var d;j.current=0;const n=(d=I.current)==null?void 0:d.getBoundingClientRect();n!=null&&n.width&&pe((V.current-n.left)/n.width*100)}))},Ee=e=>{M.current=!0,ne(!0),e.currentTarget.setPointerCapture(e.pointerId),fe(e.clientX)},X=()=>{var e;if(M.current){if(j.current){cancelAnimationFrame(j.current),j.current=0;const n=(e=I.current)==null?void 0:e.getBoundingClientRect();n!=null&&n.width&&pe((V.current-n.left)/n.width*100)}M.current=!1,S(N.current),localStorage.setItem(ae,String(N.current)),ne(!1)}},me=e=>{window.clearTimeout(U.current),ie(!0),T(e),sessionStorage.setItem(je(a),e?"1":"0"),U.current=window.setTimeout(()=>ie(!1),ut+40)},he=e=>{D.current=!0,me(e)};s.useEffect(()=>{var e;D.current&&(D.current=!1,(e=u?ce.current:W.current)==null||e.focus())},[u]);const $e=e=>{C(e),sessionStorage.setItem(J(a),e)},Ie=()=>{C(void 0),sessionStorage.removeItem(J(a)),R(void 0),_("")},ge=((Pe=b.data)==null?void 0:Pe.paper_reader_selection_enabled)===!0,be=e=>{R(e),_(`Selection from page ${e.page} added to chat`),f&&u&&me(!1)},We=s.useCallback(e=>{R(e),e||_("")},[]),Z=((we=b.data)==null?void 0:we.paper_reader_citations_enabled)===!0&&!!v,B=F({queryKey:["paper-layout",l],queryFn:()=>tt(l),enabled:Z&&!!l,staleTime:5*6e4}).data,Me=s.useMemo(()=>Z?{layout:B,open:e=>{const n=B?Qe(B,e):[];n.length&&(E(d=>({boxes:n,nonce:((d==null?void 0:d.nonce)??0)+1})),m("paper"))}}:null,[Z,B]),ve=Ke()&&((ye=b.data)==null?void 0:ye.paper_reader_chat_enabled)!==!1,Y=!!(t&&ve&&!(o&&!K)),ze=t&&ve&&!Y?r.jsx("div",{className:"reader-chat-unavailable",role:"status",children:"Chat opens once the paper is ready."}):t&&Y?r.jsx(ct,{mode:"paper",routeSessionId:x,primaryPaper:{id:t.id,routeId:l,title:t.title,arxivId:t.arxiv_id},currentPage:()=>le.current,paperSelection:y,onPaperSelectionChange:We,onSessionId:$e,onReaderSubmit:()=>m("assistant"),onReaderNewChat:Ie,onReaderClose:f?()=>he(!0):void 0}):r.jsx("div",{className:"reader-chat-unavailable",children:"Chat is not enabled for this preview."});return c.isLoading?r.jsx("div",{className:"reader-status",role:"status",children:"Loading paper…"}):c.error||!t?r.jsxs("div",{className:"reader-status",role:"alert",children:[r.jsx("p",{children:"Paper not found."}),r.jsx(G,{to:"/papers",children:"Browse papers"})]}):((Re=b.data)==null?void 0:Re.native_pdf_reader_enabled)===!1?r.jsxs("div",{className:"reader-status",role:"alert",children:[r.jsx("p",{children:"The native reader is currently unavailable."}),r.jsx(G,{to:`/paper/${l}`,children:"Back to paper"})]}):!v&&!o?r.jsxs("div",{className:"reader-status",role:"alert",children:[r.jsx("p",{children:"Native reading is unavailable for this resource."}),r.jsx(G,{to:`/paper/${l}`,children:"Back to paper"})]}):r.jsxs("div",{className:"paper-reader-shell",children:[!f&&r.jsxs("div",{className:"reader-tabs",role:"tablist","aria-label":"Reader panels",children:[r.jsx("button",{type:"button",role:"tab","aria-selected":p==="paper",onClick:()=>m("paper"),children:"Paper"}),r.jsxs("button",{type:"button",role:"tab","aria-selected":p==="assistant","aria-label":y&&p!=="assistant"?"Chat, selection attached":"Chat",onClick:()=>m("assistant"),children:["Chat",y&&p!=="assistant"&&r.jsx("span",{className:"reader-tab-pending","aria-hidden":"true"})]})]}),r.jsx(Xe,{variant:"reader",children:r.jsxs("div",{ref:I,className:`reader-workspace${f?" is-desktop":" is-tabs"}${u?" is-assistant-collapsed":""}${se?" is-resizing":""}`,"data-testid":"paper-chat-workspace",children:[r.jsx("section",{ref:O,className:`reader-paper-pane${!f&&p!=="paper"?" is-hidden":""}`,style:f?{width:u?"100%":`${w}%`}:void 0,role:"tabpanel","aria-label":"Paper","aria-hidden":!f&&p!=="paper",children:o?r.jsx(dt,{paperId:t.id,paperKey:l,paperTitle:t.title,paperHref:`/paper/${l}`,sourceUrl:o,resources:P,paperVersion:t.version,selectionEnabled:ge,onReady:ke,onPaperSelection:be,onPaperSelectionError:_}):v&&r.jsx(Ze,{url:v,downloadUrl:g??v,paperKey:l,paperTitle:t.title,paperHref:`/paper/${l}`,onClose:A,resources:P,initialPage:re,resizeActive:se||Te,selectionEnabled:ge,paperVersion:t.version,authors:q,loadErrorMessage:t.source==="external"?"Paper content is still being prepared. Please try again later.":void 0,onPaperSelection:be,onPaperSelectionError:_,highlight:H,onPageChange:e=>{le.current=e,sessionStorage.setItem(_e(a),String(e))}})}),f&&!u&&r.jsx("div",{ref:oe,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:Ee,onPointerMove:e=>{M.current&&fe(e.clientX)},onPointerUp:X,onPointerCancel:X,onLostPointerCapture:X,onDoubleClick:()=>L(Ce),onKeyDown:e=>{(e.key==="ArrowLeft"||e.key==="ArrowRight")&&(e.preventDefault(),L(w+(e.key==="ArrowRight"?2:-2))),e.key==="Home"&&L(45),e.key==="End"&&L(75)}}),r.jsx("aside",{ref:W,id:"reader-chat-panel",className:`reader-assistant-pane${!f&&p!=="assistant"?" is-hidden":""}${f&&u?" is-collapsed":""}`,style:f?{width:u?0:`${100-w}%`}:void 0,role:"tabpanel","aria-label":"Chat","aria-hidden":!f&&p!=="assistant"||u,tabIndex:-1,children:r.jsx(Ye.Provider,{value:Me,children:ze})}),r.jsx("div",{className:"sr-only","aria-live":"polite",children:Ne}),f&&(u||!Y)&&r.jsx("button",{ref:ce,type:"button",className:"reader-collapse-assistant","aria-controls":"reader-chat-panel","aria-expanded":!u,onClick:()=>he(!u),children:u?"Open chat":"Hide chat"})]})})]})}function ia(){const{paperId:a=""}=Fe(),i=qe(a).replace(/v\d+$/i,"");return r.jsx(Ue,{workspaceKey:`reader:${a}`,children:r.jsx(xt,{routeId:i},i)})}export{ia as default,vt as readerToolbarResources}; diff --git a/assets/PapersListView-VY1_gvHF.js b/assets/PapersListView-Bs-H-o-h.js similarity index 87% rename from assets/PapersListView-VY1_gvHF.js rename to assets/PapersListView-Bs-H-o-h.js index 809a8cb823638a6ec68f9a9f7895f136293fad4e..41aed90e2309ceab7bdf705103b55767046b0f8a 100644 --- a/assets/PapersListView-VY1_gvHF.js +++ b/assets/PapersListView-Bs-H-o-h.js @@ -1 +1 @@ -import{f,p as M,b as K,j as e,L as x,m as V,q as X,T as J}from"./index-3CfcAX6N.js";import{T as W}from"./SotaBadges-BqZMAXyY.js";import{I as H}from"./Icon-C0d9p4Q2.js";import{u as Y,a as Z,b as ee,c as se,P as re}from"./PaperFeed-2dSUzcA2.js";import{c as ae}from"./catalog-B47DuClX.js";import{p as O}from"./papers-BsYlGUQi.js";import{t as te,d as ne}from"./transform-Dx-N8Yyj.js";import{u as Q}from"./usePapers-CHoHKyWP.js";import{u as ie}from"./useDebounce-Dky0xohQ.js";import{S as oe}from"./skeleton-CQbSjC3L.js";import{A as le,a as ce}from"./alert-BXZ4lnnf.js";import{i as de}from"./apiErrors-XoIVpN_S.js";import{f as me}from"./frameworks-DDA0P4Tf.js";import"./colors-BkWRhvFI.js";import"./PaperCard-BZtXccuT.js";import"./AuthorAvatar-DYaYcwPm.js";import"./LatexTitle-DvPeLepK.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-Dwe6SY1f.js";import"./useIntersectionObserver-wAZWG4G7.js";import"./curation-BZoIvsHD.js";import"./useInfiniteQuery-DYwUEaoz.js";const g=360;function pe(r,t){const c=r.toLocaleLowerCase();return t.trim().split(/\s+/).filter(Boolean).reduce((i,l)=>{const o=c.indexOf(l.toLocaleLowerCase());return o>=0&&(i<0||o=0?l+1:t}function he(r,t){if(r.length<=g)return r;const c=pe(r,t);if(c<0||c0?"…":""}${r.slice(i,l).trim()}${l{var L,R,T,D,$,A,I,q,B;const r=Y(),{searchParams:t,setSearchParams:c}=r,i=t.get("framework")||void 0,l=t.get("repository")||void 0,o=!!(i||l),d=t.get("search")||"",[b,F]=f.useState(d),h=ie(b,300),n=!o&&d.trim().length>0;f.useEffect(()=>F(d),[d]),f.useEffect(()=>{if(h===d)return;const a=new URLSearchParams(t);h?a.set("search",h):a.delete("search"),c(a,{replace:!0})},[h]),f.useEffect(()=>{const a=t.get("order_by"),m=new URLSearchParams(t);n&&!["relevance","date_published","citation_count"].includes(a||"")?(m.set("order_by","relevance"),c(m,{replace:!0})):!n&&a==="relevance"&&(m.delete("order_by"),c(m,{replace:!0}))},[n,t,c]);const j=n&&r.orderBy==="trending"?"relevance":r.orderBy,S=!o&&r.hasCode,P={...r.filters,has_code:S,search:o&&h||void 0,conference:t.get("conference")||void 0,latest_only:t.get("latest_only")!=="false",framework:i,repository:l},k=Q([...M.feeds.infinite,P],a=>O.list({...P,page:a,page_size:20}),{enabled:!n}),_={q:h.trim(),order_by:j==="trending"?"relevance":j,start_date:r.dateRange.startDate,end_date:r.dateRange.endDate,has_code:S,has_hf_artifacts:r.hasHfArtifacts},E=Q([...M.feeds.search,_],a=>O.searchFeed({..._,page:a,page_size:20,mode:"hybrid"}),{enabled:n&&_.q.length>0}),p=n?E:k,C=K({queryKey:X.topTasksSidebar,queryFn:()=>ae.topTasks(8),enabled:!o&&!n,staleTime:J}),v=f.useMemo(()=>{var m;return(((m=p.data)==null?void 0:m.pages.flatMap(N=>N.results))||[]).map(N=>{const w=te(N);return n?{...w,abstract:he(w.abstract,d)}:w})},[p.data,n,d]),u=((T=(R=(L=k.data)==null?void 0:L.pages)==null?void 0:R[0])==null?void 0:T.count)??0,s=(A=($=(D=k.data)==null?void 0:D.pages)==null?void 0:$[0])==null?void 0:A.scope,y=(q=(I=E.data)==null?void 0:I.pages)==null?void 0:q.at(-1),G=i&&de(p.error),U=(s==null?void 0:s.kind)==="framework"?s.framework_name:s==null?void 0:s.repository;return e.jsxs("div",{className:"page",children:[(s==null?void 0:s.kind)==="framework"&&e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(x,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(x,{to:"/frameworks",children:"Frameworks"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:s.framework_name})]}),e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:o?e.jsxs(e.Fragment,{children:["Papers implemented by ",e.jsx("em",{children:U||i||l})]}):n?e.jsxs(e.Fragment,{children:["Search results for ",e.jsxs("em",{children:["“",d,"”"]})]}):e.jsxs(e.Fragment,{children:["All ",e.jsx("em",{children:"Papers"})]})}),e.jsx("div",{className:"feed-subtitle",children:o?(s==null?void 0:s.kind)==="framework"?u>0&&`${u.toLocaleString()} papers.`:s!=null&&s.repository?e.jsxs(e.Fragment,{children:["GitHub repository ",e.jsx("strong",{children:s.repository}),". ",u>0&&`${u.toLocaleString()} papers.`]}):"Repository-scoped paper feed.":n?`${v.length} loaded from the most relevant results.`:e.jsxs(e.Fragment,{children:["Search the full corpus. ",u>0&&`${u.toLocaleString()} papers indexed.`]})}),o&&s&&e.jsxs("div",{className:"paper-feed-scope-links",children:[e.jsxs("div",{className:"paper-feed-primary-links",children:[s.github_url&&e.jsxs("a",{href:s.github_url,target:"_blank",rel:"noopener noreferrer",className:s.kind==="framework"?"task-framework-link":"framework-link",children:[e.jsx(H,{name:"github",size:13}),s.kind==="framework"?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:s.repository||"GitHub"}),s.num_stars!=null&&e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",me(s.num_stars)]})]}):"GitHub"]}),s.kind==="framework"&&s.introducing_paper_arxiv_id&&e.jsx(x,{to:`/paper/${s.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"})]}),s.kind==="framework"&&s.recommended_tasks&&s.recommended_tasks.length>0&&e.jsx("div",{className:"paper-feed-task-tags",children:s.recommended_tasks.map(a=>a.slug?e.jsx(W,{slug:a.slug,label:a.name},a.id):null)})]})]}),e.jsx(Z,{startDate:r.dateRange.startDate,endDate:r.dateRange.endDate,onChange:r.setDateRange})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(H,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:b,onChange:a=>F(a.target.value)})]})}),e.jsxs("div",{className:o||n?"papers-feed-layout-scoped":"layout-with-sidebar",children:[!o&&!n&&e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),C.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((a,m)=>e.jsx(oe,{className:"h-5 w-full"},m))}),e.jsx("div",{className:"sidebar-links",children:(B=C.data)==null?void 0:B.map(a=>e.jsxs(x,{to:`/tasks/${a.slug}`,className:"sidebar-link",children:[ne(a.name,a.slug),a.paper_count!=null&&e.jsx("span",{className:"count",children:a.paper_count})]},a.id))})]})}),e.jsxs("div",{children:[e.jsx(ee,{feed:r,sorts:n?ue:se,activeSort:j,showDateFilter:!1,showHasCode:!o,children:e.jsxs("div",{className:"results-count",children:[v.length," loaded"]})}),G?e.jsx("div",{className:"no-results",children:"Framework not found."}):e.jsxs(e.Fragment,{children:[p.error&&e.jsx(le,{variant:"destructive",className:"mb-4",children:e.jsx(ce,{children:"Failed to load papers. Please try again."})}),e.jsx(re,{query:p,cards:v,skeleton:"card",highlightQuery:n?d:void 0,empty:e.jsxs(e.Fragment,{children:[e.jsx("p",{children:"No matching papers."}),n&&V()&&e.jsx(x,{to:`/chat?q=${encodeURIComponent(d.trim())}`,children:"Ask the assistant instead"})]}),children:!p.hasNextPage&&!p.isFetchingNextPage&&n&&e.jsx("div",{className:"search-results-end",children:y!=null&&y.cap_reached?"End of the top 100 results":"End of results"})})]})]})]})]})};export{Ie as default}; +import{f,p as M,b as K,j as e,L as x,m as V,q as X,T as J}from"./index-CxhY4zQ1.js";import{T as W}from"./SotaBadges-EnDhSaVO.js";import{I as H}from"./Icon-XOOkUEUX.js";import{u as Y,a as Z,b as ee,c as se,P as re}from"./PaperFeed-D1egUlu_.js";import{c as ae}from"./catalog-DCEU6WpP.js";import{p as O}from"./papers-BDxSKSYJ.js";import{t as te,d as ne}from"./transform-DehuZQh7.js";import{u as Q}from"./usePapers-Cv13R7ph.js";import{u as ie}from"./useDebounce-BqT24mBv.js";import{S as oe}from"./skeleton-DdKViE4r.js";import{A as le,a as ce}from"./alert-C-NbJX4N.js";import{i as de}from"./apiErrors-D2bSY3Dq.js";import{f as me}from"./frameworks-DDA0P4Tf.js";import"./colors-BkWRhvFI.js";import"./PaperCard-DeWmBrg8.js";import"./AuthorAvatar-DPz8YQ5Z.js";import"./LatexTitle-BqNrCKu8.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-DgW_tN02.js";import"./useIntersectionObserver-ZqjUJuPc.js";import"./curation-D2sqKAqC.js";import"./useInfiniteQuery-vHEhIVF_.js";const g=360;function pe(r,t){const c=r.toLocaleLowerCase();return t.trim().split(/\s+/).filter(Boolean).reduce((i,l)=>{const o=c.indexOf(l.toLocaleLowerCase());return o>=0&&(i<0||o=0?l+1:t}function he(r,t){if(r.length<=g)return r;const c=pe(r,t);if(c<0||c0?"…":""}${r.slice(i,l).trim()}${l{var L,R,T,D,$,A,I,q,B;const r=Y(),{searchParams:t,setSearchParams:c}=r,i=t.get("framework")||void 0,l=t.get("repository")||void 0,o=!!(i||l),d=t.get("search")||"",[b,F]=f.useState(d),h=ie(b,300),n=!o&&d.trim().length>0;f.useEffect(()=>F(d),[d]),f.useEffect(()=>{if(h===d)return;const a=new URLSearchParams(t);h?a.set("search",h):a.delete("search"),c(a,{replace:!0})},[h]),f.useEffect(()=>{const a=t.get("order_by"),m=new URLSearchParams(t);n&&!["relevance","date_published","citation_count"].includes(a||"")?(m.set("order_by","relevance"),c(m,{replace:!0})):!n&&a==="relevance"&&(m.delete("order_by"),c(m,{replace:!0}))},[n,t,c]);const j=n&&r.orderBy==="trending"?"relevance":r.orderBy,S=!o&&r.hasCode,P={...r.filters,has_code:S,search:o&&h||void 0,conference:t.get("conference")||void 0,latest_only:t.get("latest_only")!=="false",framework:i,repository:l},k=Q([...M.feeds.infinite,P],a=>O.list({...P,page:a,page_size:20}),{enabled:!n}),_={q:h.trim(),order_by:j==="trending"?"relevance":j,start_date:r.dateRange.startDate,end_date:r.dateRange.endDate,has_code:S,has_hf_artifacts:r.hasHfArtifacts},E=Q([...M.feeds.search,_],a=>O.searchFeed({..._,page:a,page_size:20,mode:"hybrid"}),{enabled:n&&_.q.length>0}),p=n?E:k,C=K({queryKey:X.topTasksSidebar,queryFn:()=>ae.topTasks(8),enabled:!o&&!n,staleTime:J}),v=f.useMemo(()=>{var m;return(((m=p.data)==null?void 0:m.pages.flatMap(N=>N.results))||[]).map(N=>{const w=te(N);return n?{...w,abstract:he(w.abstract,d)}:w})},[p.data,n,d]),u=((T=(R=(L=k.data)==null?void 0:L.pages)==null?void 0:R[0])==null?void 0:T.count)??0,s=(A=($=(D=k.data)==null?void 0:D.pages)==null?void 0:$[0])==null?void 0:A.scope,y=(q=(I=E.data)==null?void 0:I.pages)==null?void 0:q.at(-1),G=i&&de(p.error),U=(s==null?void 0:s.kind)==="framework"?s.framework_name:s==null?void 0:s.repository;return e.jsxs("div",{className:"page",children:[(s==null?void 0:s.kind)==="framework"&&e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(x,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(x,{to:"/frameworks",children:"Frameworks"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:s.framework_name})]}),e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:o?e.jsxs(e.Fragment,{children:["Papers implemented by ",e.jsx("em",{children:U||i||l})]}):n?e.jsxs(e.Fragment,{children:["Search results for ",e.jsxs("em",{children:["“",d,"”"]})]}):e.jsxs(e.Fragment,{children:["All ",e.jsx("em",{children:"Papers"})]})}),e.jsx("div",{className:"feed-subtitle",children:o?(s==null?void 0:s.kind)==="framework"?u>0&&`${u.toLocaleString()} papers.`:s!=null&&s.repository?e.jsxs(e.Fragment,{children:["GitHub repository ",e.jsx("strong",{children:s.repository}),". ",u>0&&`${u.toLocaleString()} papers.`]}):"Repository-scoped paper feed.":n?`${v.length} loaded from the most relevant results.`:e.jsxs(e.Fragment,{children:["Search the full corpus. ",u>0&&`${u.toLocaleString()} papers indexed.`]})}),o&&s&&e.jsxs("div",{className:"paper-feed-scope-links",children:[e.jsxs("div",{className:"paper-feed-primary-links",children:[s.github_url&&e.jsxs("a",{href:s.github_url,target:"_blank",rel:"noopener noreferrer",className:s.kind==="framework"?"task-framework-link":"framework-link",children:[e.jsx(H,{name:"github",size:13}),s.kind==="framework"?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:s.repository||"GitHub"}),s.num_stars!=null&&e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",me(s.num_stars)]})]}):"GitHub"]}),s.kind==="framework"&&s.introducing_paper_arxiv_id&&e.jsx(x,{to:`/paper/${s.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"})]}),s.kind==="framework"&&s.recommended_tasks&&s.recommended_tasks.length>0&&e.jsx("div",{className:"paper-feed-task-tags",children:s.recommended_tasks.map(a=>a.slug?e.jsx(W,{slug:a.slug,label:a.name},a.id):null)})]})]}),e.jsx(Z,{startDate:r.dateRange.startDate,endDate:r.dateRange.endDate,onChange:r.setDateRange})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(H,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:b,onChange:a=>F(a.target.value)})]})}),e.jsxs("div",{className:o||n?"papers-feed-layout-scoped":"layout-with-sidebar",children:[!o&&!n&&e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),C.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((a,m)=>e.jsx(oe,{className:"h-5 w-full"},m))}),e.jsx("div",{className:"sidebar-links",children:(B=C.data)==null?void 0:B.map(a=>e.jsxs(x,{to:`/tasks/${a.slug}`,className:"sidebar-link",children:[ne(a.name,a.slug),a.paper_count!=null&&e.jsx("span",{className:"count",children:a.paper_count})]},a.id))})]})}),e.jsxs("div",{children:[e.jsx(ee,{feed:r,sorts:n?ue:se,activeSort:j,showDateFilter:!1,showHasCode:!o,children:e.jsxs("div",{className:"results-count",children:[v.length," loaded"]})}),G?e.jsx("div",{className:"no-results",children:"Framework not found."}):e.jsxs(e.Fragment,{children:[p.error&&e.jsx(le,{variant:"destructive",className:"mb-4",children:e.jsx(ce,{children:"Failed to load papers. Please try again."})}),e.jsx(re,{query:p,cards:v,skeleton:"card",highlightQuery:n?d:void 0,empty:e.jsxs(e.Fragment,{children:[e.jsx("p",{children:"No matching papers."}),n&&V()&&e.jsx(x,{to:`/chat?q=${encodeURIComponent(d.trim())}`,children:"Ask the assistant instead"})]}),children:!p.hasNextPage&&!p.isFetchingNextPage&&n&&e.jsx("div",{className:"search-results-end",children:y!=null&&y.cap_reached?"End of the top 100 results":"End of results"})})]})]})]})]})};export{Ie as default}; diff --git a/assets/PrivacyView-2dCBj8zE.js b/assets/PrivacyView-BGwob0k2.js similarity index 98% rename from assets/PrivacyView-2dCBj8zE.js rename to assets/PrivacyView-BGwob0k2.js index 52f3928000b07ed19ee907d308369f4cb625b607..fe04e1d8ecd9e440c3aecb2dc0e44450baa0751d 100644 --- a/assets/PrivacyView-2dCBj8zE.js +++ b/assets/PrivacyView-BGwob0k2.js @@ -1 +1 @@ -import{j as e}from"./index-3CfcAX6N.js";import{u as s,f as i}from"./useDocumentTitle-BnA1kM_d.js";const t=()=>(s(i("Privacy Policy")),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 500 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{t as default}; +import{j as e}from"./index-CxhY4zQ1.js";import{u as s,f as i}from"./useDocumentTitle-CC3zTSwA.js";const t=()=>(s(i("Privacy Policy")),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 500 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{t as default}; diff --git a/assets/RateLimitsView-BphGmeyY.js b/assets/RateLimitsView-DujSBsSL.js similarity index 87% rename from assets/RateLimitsView-BphGmeyY.js rename to assets/RateLimitsView-DujSBsSL.js index 5f96c1d3f664b5798b4dae592d447ddc2b9a779e..3e0a2d9dea176863cdadd3a991dce4665119bbd5 100644 --- a/assets/RateLimitsView-BphGmeyY.js +++ b/assets/RateLimitsView-DujSBsSL.js @@ -1 +1 @@ -import{b as t,j as e}from"./index-3CfcAX6N.js";import{a as s}from"./account-Ee9-ZosC.js";const n=()=>{const i=t({queryKey:["submission-rate-limit-policy"],queryFn:()=>s.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}; +import{b as t,j as e}from"./index-CxhY4zQ1.js";import{a as s}from"./account-Bplq3u-8.js";const n=()=>{const i=t({queryKey:["submission-rate-limit-policy"],queryFn:()=>s.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}; diff --git a/assets/ResearchFollowButton-YEXlvC8K.js b/assets/ResearchFollowButton-DPFVPZ0U.js similarity index 93% rename from assets/ResearchFollowButton-YEXlvC8K.js rename to assets/ResearchFollowButton-DPFVPZ0U.js index 64e299967b2f27ef1a6342129dca2f808631d331..15699a9b60698cd5a5fe064672855b2d64c76a58 100644 --- a/assets/ResearchFollowButton-YEXlvC8K.js +++ b/assets/ResearchFollowButton-DPFVPZ0U.js @@ -1 +1 @@ -import{d as x,g as j,f as b,i as F,j as e,h as N,C as S,L as i}from"./index-3CfcAX6N.js";import{e as y,p as C}from"./researchTopic-Z4AJDMN7.js";import{P as w}from"./plus-CiDEk52y.js";const f={task:"Get new papers on this task",method:"Get new papers using this method",benchmark:"Get new results on this benchmark",author:"Get new papers by this author",organization:"Get new papers from this organization"};function k({kind:o,entityId:n}){var u;const l=x(),c=l==null?void 0:l.user,h=j(),[m,p]=b.useState(null),d=`${o}:${n}`,a=y(),s=((u=a.data)==null?void 0:u.some(r=>r.kind===o&&String(r.entity_id)===String(n)))??!1,t=C({onChanged:({follow:r})=>p(r?d:null),awaitRefresh:!0});if(!l||!c&&F())return null;if(!c)return e.jsxs("div",{className:"research-follow",children:[e.jsxs("a",{className:"research-follow-btn",href:N(h.pathname+h.search),children:[e.jsx(w,{"aria-hidden":"true"}),"Follow"]}),e.jsxs("span",{className:"research-follow-hint",children:["Sign in to ",f[o].toLowerCase(),"."]})]});const g=t.error||a.error;return e.jsxs("div",{className:"research-follow",children:[e.jsx("button",{type:"button",className:s?"research-follow-btn is-following":"research-follow-btn",disabled:a.isLoading||!!a.error||t.isPending,"aria-pressed":s,"aria-label":s?"Unfollow":"Follow",onClick:()=>t.mutate({kind:o,entityId:n,follow:!s}),children:s?e.jsxs(e.Fragment,{children:[e.jsx(S,{"aria-hidden":"true"}),e.jsx("span",{className:"research-follow-label",children:"Following"}),e.jsx("span",{className:"research-follow-label-hover",children:"Unfollow"})]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{"aria-hidden":"true"}),"Follow"]})}),g?e.jsx("span",{className:"research-follow-hint is-error",role:"alert",children:"Could not update follows. Please try again."}):s?m===d&&e.jsxs("span",{className:"research-follow-hint",role:"status",children:["Added to ",e.jsx(i,{to:"/following",children:"your Following feed"})," · ",e.jsx(i,{to:"/settings",children:"Manage in Settings"})]}):e.jsxs("span",{className:"research-follow-hint",children:[f[o]," in ",e.jsx(i,{to:"/following",children:"your Following feed"}),"."]})]})}export{k as R}; +import{d as x,g as j,f as b,i as F,j as e,h as N,C as S,L as i}from"./index-CxhY4zQ1.js";import{e as y,p as C}from"./researchTopic-DXZVIvAq.js";import{P as w}from"./plus-CEkdlNSn.js";const f={task:"Get new papers on this task",method:"Get new papers using this method",benchmark:"Get new results on this benchmark",author:"Get new papers by this author",organization:"Get new papers from this organization"};function k({kind:o,entityId:n}){var u;const l=x(),c=l==null?void 0:l.user,h=j(),[m,p]=b.useState(null),d=`${o}:${n}`,a=y(),s=((u=a.data)==null?void 0:u.some(r=>r.kind===o&&String(r.entity_id)===String(n)))??!1,t=C({onChanged:({follow:r})=>p(r?d:null),awaitRefresh:!0});if(!l||!c&&F())return null;if(!c)return e.jsxs("div",{className:"research-follow",children:[e.jsxs("a",{className:"research-follow-btn",href:N(h.pathname+h.search),children:[e.jsx(w,{"aria-hidden":"true"}),"Follow"]}),e.jsxs("span",{className:"research-follow-hint",children:["Sign in to ",f[o].toLowerCase(),"."]})]});const g=t.error||a.error;return e.jsxs("div",{className:"research-follow",children:[e.jsx("button",{type:"button",className:s?"research-follow-btn is-following":"research-follow-btn",disabled:a.isLoading||!!a.error||t.isPending,"aria-pressed":s,"aria-label":s?"Unfollow":"Follow",onClick:()=>t.mutate({kind:o,entityId:n,follow:!s}),children:s?e.jsxs(e.Fragment,{children:[e.jsx(S,{"aria-hidden":"true"}),e.jsx("span",{className:"research-follow-label",children:"Following"}),e.jsx("span",{className:"research-follow-label-hover",children:"Unfollow"})]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{"aria-hidden":"true"}),"Follow"]})}),g?e.jsx("span",{className:"research-follow-hint is-error",role:"alert",children:"Could not update follows. Please try again."}):s?m===d&&e.jsxs("span",{className:"research-follow-hint",role:"status",children:["Added to ",e.jsx(i,{to:"/following",children:"your Following feed"})," · ",e.jsx(i,{to:"/settings",children:"Manage in Settings"})]}):e.jsxs("span",{className:"research-follow-hint",children:[f[o]," in ",e.jsx(i,{to:"/following",children:"your Following feed"}),"."]})]})}export{k as R}; diff --git a/assets/SavedPapersView-CffKQwuC.js b/assets/SavedPapersView-CSPbwTYh.js similarity index 89% rename from assets/SavedPapersView-CffKQwuC.js rename to assets/SavedPapersView-CSPbwTYh.js index 3bbd104021d3ac0137f0b5f2212116757ba01585..fed46ac2e14dc43d5dce5480c1e5185cd3fc579d 100644 --- a/assets/SavedPapersView-CffKQwuC.js +++ b/assets/SavedPapersView-CSPbwTYh.js @@ -1 +1 @@ -import{a as g,b as v,A as x,j as e,H as j,L as b,p as N}from"./index-3CfcAX6N.js";import{P as f}from"./PaperCard-BZtXccuT.js";import{T as k}from"./SotaBadges-BqZMAXyY.js";import{S as r}from"./skeleton-CQbSjC3L.js";import{A as y,a as w}from"./alert-BXZ4lnnf.js";import{a as A}from"./account-Ee9-ZosC.js";import{t as B}from"./transform-Dx-N8Yyj.js";import{s as F}from"./savedPapersAuth-8mhzkOxc.js";import"./AuthorAvatar-DYaYcwPm.js";import"./Icon-C0d9p4Q2.js";import"./LatexTitle-DvPeLepK.js";import"./papers-BsYlGUQi.js";import"./curation-BZoIvsHD.js";import"./safeExternalHref-CkBrsh84.js";import"./colors-BkWRhvFI.js";const U=()=>{var d,l;const{user:i,isLoading:m}=g(),a=v({queryKey:[...N.feeds.saved],queryFn:()=>A.getBookmarks(),enabled:!!i,staleTime:30*1e3}),c=a.error instanceof x&&a.error.code==="saved_papers_bucket_authorization_required",o=!!a.data&&!a.data.bucket_connected,n=()=>{window.location.assign(F())};if(m)return 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"})]});if(!i)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:["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(j,{returnTo:"/saved"})})]});let h=0;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:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:[(d=a.data)!=null&&d.count?`${a.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain.",(l=a.data)!=null&&l.bucket_connected?e.jsxs(e.Fragment,{children:[" · ",e.jsx("a",{href:`https://huggingface.co/buckets/${i.username}/pwc-saved-papers`,target:"_blank",rel:"noopener noreferrer",children:"Open your Hugging Face Bucket"})]}):null]})]})}),c?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:n,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,o&&a.data.bucket_migrated?e.jsxs("div",{className:"saved-bucket-migration",children:[e.jsx("p",{children:"Your saved papers are already in your private Hugging Face Bucket. Reconnect it in this browser to read from it and save new papers there."}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:n,children:"Reconnect Hugging Face Bucket"})]}):o?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:n,children:a.data.count?"Approve and migrate saved papers":"Use a Hugging Face Bucket"})]}):null,c||a.error?null:a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((t,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(b,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers →"})]}):a.data.areas.map(t=>e.jsxs("section",{className:"saved-area-section",children:[e.jsx("h2",{className:"saved-area-heading",children:t.name}),t.tasks.map(s=>{const p=s.papers.length;return e.jsxs("div",{className:"saved-task-block",children:[e.jsxs("div",{className:"saved-task-row",children:[s.slug?e.jsx(k,{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:[p," ",p===1?"paper":"papers"]})]}),e.jsx("div",{className:"paper-list",children:s.papers.map(u=>e.jsx(f,{paper:B(u),priority:h++<3},u.id))})]},`task-${t.id??"other"}-${s.id??"untagged"}`)})]},`area-${t.id??"other"}`))]})};export{U as default}; +import{a as g,b as v,A as x,j as e,H as j,L as b,p as N}from"./index-CxhY4zQ1.js";import{P as f}from"./PaperCard-DeWmBrg8.js";import{T as k}from"./SotaBadges-EnDhSaVO.js";import{S as r}from"./skeleton-DdKViE4r.js";import{A as y,a as w}from"./alert-C-NbJX4N.js";import{a as A}from"./account-Bplq3u-8.js";import{t as B}from"./transform-DehuZQh7.js";import{s as F}from"./savedPapersAuth-YhdYkTbG.js";import"./AuthorAvatar-DPz8YQ5Z.js";import"./Icon-XOOkUEUX.js";import"./LatexTitle-BqNrCKu8.js";import"./papers-BDxSKSYJ.js";import"./curation-D2sqKAqC.js";import"./safeExternalHref-CkBrsh84.js";import"./colors-BkWRhvFI.js";const U=()=>{var d,l;const{user:i,isLoading:m}=g(),a=v({queryKey:[...N.feeds.saved],queryFn:()=>A.getBookmarks(),enabled:!!i,staleTime:30*1e3}),c=a.error instanceof x&&a.error.code==="saved_papers_bucket_authorization_required",o=!!a.data&&!a.data.bucket_connected,n=()=>{window.location.assign(F())};if(m)return 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"})]});if(!i)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:["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(j,{returnTo:"/saved"})})]});let h=0;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:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:[(d=a.data)!=null&&d.count?`${a.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain.",(l=a.data)!=null&&l.bucket_connected?e.jsxs(e.Fragment,{children:[" · ",e.jsx("a",{href:`https://huggingface.co/buckets/${i.username}/pwc-saved-papers`,target:"_blank",rel:"noopener noreferrer",children:"Open your Hugging Face Bucket"})]}):null]})]})}),c?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:n,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,o&&a.data.bucket_migrated?e.jsxs("div",{className:"saved-bucket-migration",children:[e.jsx("p",{children:"Your saved papers are already in your private Hugging Face Bucket. Reconnect it in this browser to read from it and save new papers there."}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:n,children:"Reconnect Hugging Face Bucket"})]}):o?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:n,children:a.data.count?"Approve and migrate saved papers":"Use a Hugging Face Bucket"})]}):null,c||a.error?null:a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((t,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(b,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers →"})]}):a.data.areas.map(t=>e.jsxs("section",{className:"saved-area-section",children:[e.jsx("h2",{className:"saved-area-heading",children:t.name}),t.tasks.map(s=>{const p=s.papers.length;return e.jsxs("div",{className:"saved-task-block",children:[e.jsxs("div",{className:"saved-task-row",children:[s.slug?e.jsx(k,{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:[p," ",p===1?"paper":"papers"]})]}),e.jsx("div",{className:"paper-list",children:s.papers.map(u=>e.jsx(f,{paper:B(u),priority:h++<3},u.id))})]},`task-${t.id??"other"}-${s.id??"untagged"}`)})]},`area-${t.id??"other"}`))]})};export{U as default}; diff --git a/assets/SearchOverlay-By9cH9ju.js b/assets/SearchOverlay-CkohnQ4e.js similarity index 95% rename from assets/SearchOverlay-By9cH9ju.js rename to assets/SearchOverlay-CkohnQ4e.js index 5ee521704fd07e09cc625362e526491649135226..af36ce34f75de2b47c25fd8ff0c3943e9588b2d0 100644 --- a/assets/SearchOverlay-By9cH9ju.js +++ b/assets/SearchOverlay-CkohnQ4e.js @@ -1 +1 @@ -import{f as K,k as O,V as M,m as B,b as i,j as e,p as H}from"./index-3CfcAX6N.js";import{L as U}from"./LatexTitle-DvPeLepK.js";import{c as x}from"./catalog-B47DuClX.js";import{p as R}from"./papers-BsYlGUQi.js";import{u as Y}from"./useDebounce-Dky0xohQ.js";import{c as G,h as V}from"./colors-BkWRhvFI.js";import{d as X}from"./transform-Dx-N8Yyj.js";import"./curation-BZoIvsHD.js";const Z=10,S=6,W=350,f=3,ls=({open:t,onClose:h})=>{var A,C,w,P,Q,z;const v=K.useRef(null),$=O(),[c,D]=M.useState(""),a=Y(c,W),j=c.trim(),r=a.trim().length>=f,y=B();K.useEffect(()=>{var l;if(!t)return;(l=v.current)==null||l.focus();const s=N=>{N.key==="Escape"&&(N.preventDefault(),N.stopPropagation(),h())};return window.addEventListener("keydown",s,!0),()=>window.removeEventListener("keydown",s,!0)},[t,h]);const k=i({queryKey:[...H.feeds.searchOverlay,a],queryFn:()=>R.search(a,1,Z),enabled:t&&r,staleTime:6e4,retry:!1}),_=i({queryKey:["search-tasks",a],queryFn:()=>x.listTasks({q:a,page_size:6}),enabled:t&&r,staleTime:6e4,retry:!1}),b=i({queryKey:["search-methods",a],queryFn:()=>x.listMethods({q:a,page_size:6}),enabled:t&&r,staleTime:6e4,retry:!1}),E=i({queryKey:["search-benchmarks",a],queryFn:()=>x.listDatasets({q:a,page_size:6}),enabled:t&&r,staleTime:6e4,retry:!1}),F=i({queryKey:["search-authors",a],queryFn:()=>R.searchAuthors(a,S),enabled:t&&r,staleTime:6e4,retry:!1}),q=i({queryKey:["search-organizations",a],queryFn:()=>x.searchOrganizations(a,S),enabled:t&&r,staleTime:6e4,retry:!1});if(!t)return null;const o=((A=_.data)==null?void 0:A.results)||[],d=((C=b.data)==null?void 0:C.results)||[],m=((w=E.data)==null?void 0:w.results)||[],u=((P=F.data)==null?void 0:P.results)||[],p=((Q=q.data)==null?void 0:Q.results)||[],g=((z=k.data)==null?void 0:z.results)||[],I=k.isFetching||_.isFetching||b.isFetching||E.isFetching||F.isFetching||q.isFetching,L=o.length||g.length||d.length||m.length||u.length||p.length,n=s=>{h(),$(s)},T=()=>{const s=c.trim();s&&n(`/chat?q=${encodeURIComponent(s)}`)};return e.jsx("div",{className:"search-overlay",onClick:h,children:e.jsxs("div",{className:"search-modal",onClick:s=>s.stopPropagation(),children:[e.jsx("input",{ref:v,className:"search-modal-input",placeholder:"Search papers, tasks, methods, benchmarks, authors, or organizations…",value:c,onChange:s=>D(s.target.value),onKeyDown:s=>{y&&s.key==="Enter"&&(s.preventDefault(),T())}}),e.jsxs("div",{className:"search-results",children:[y&&c.trim()&&e.jsxs("button",{type:"button",className:"search-ask-row",onClick:T,children:[e.jsx("span",{className:"search-ask-chip",children:"assistant"}),e.jsxs("span",{className:"search-ask-text",children:["Ask: “",c.trim(),"”"]}),e.jsx("kbd",{children:"↵"})]}),!a&&e.jsxs("div",{className:"search-empty",children:["Try “diffusion”, “object detection”, or an arXiv id.",y&&e.jsx("span",{className:"search-empty-sub",children:"Press Enter to ask the assistant"})]}),a&&!r&&e.jsxs("div",{className:"search-empty",children:["Keep typing: results appear from ",f," characters."]}),r&&!I&&!L&&e.jsxs("div",{className:"search-empty",children:['No matches for "',c,'"']}),o.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Tasks · ",o.length]}),o.map(s=>{const l=G(V(s.slug||""));return e.jsxs("div",{className:"search-result-tag",onClick:()=>n(`/tasks/${s.slug}`),children:[e.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:l.dot}}),e.jsx("span",{className:"name",children:X(s.name,s.slug)}),s.paper_count!=null&&e.jsxs("span",{className:"count",children:[s.paper_count," papers"]})]},s.id)})]}),d.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Methods · ",d.length]}),d.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>n(`/methods/${s.slug||s.id}`),children:[e.jsx("span",{style:{fontFamily:"var(--mono)",fontWeight:600},children:s.name}),s.paper_count!=null&&e.jsxs("span",{className:"count",children:[s.paper_count," papers"]})]},s.id))]}),m.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Benchmarks · ",m.length]}),m.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>n(`/benchmark/${s.slug||s.id}`),children:[e.jsx("span",{className:"name",children:s.name}),s.paper_count!=null&&s.paper_count>0&&e.jsxs("span",{className:"count",children:[s.paper_count," entries"]})]},s.id))]}),u.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Authors · ",u.length]}),u.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>n(`/authors/${s.id}`),children:[e.jsx("span",{className:"name",children:s.full_name}),s.hf_username&&e.jsxs("span",{className:"handle",children:["@",s.hf_username]}),s.paper_count>0&&e.jsxs("span",{className:"count",children:[s.paper_count," papers"]})]},s.id))]}),p.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Organizations · ",p.length]}),p.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>n(`/orgs/${s.slug}`),children:[s.logo_url&&e.jsx("img",{className:"logo",src:s.logo_url,alt:"",loading:"lazy"}),e.jsx("span",{className:"name",children:s.name}),s.paper_count!=null&&s.paper_count>0&&e.jsxs("span",{className:"count",children:[s.paper_count," papers"]})]},s.id))]}),g.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Papers · ",g.length]}),g.map(s=>{var l;return e.jsxs("div",{className:"search-result",onClick:()=>n(`/paper/${s.arxiv_id||s.id}`),children:[e.jsx("div",{className:"search-result-title",children:e.jsx(U,{title:s.title})}),e.jsxs("div",{className:"search-result-meta",children:[e.jsx("span",{children:s.arxiv_id?`arXiv:${s.arxiv_id}`:"External resource"}),((l=s.authors)==null?void 0:l[0])&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[s.authors[0],s.authors.length>1?" et al.":""]})]}),s.citation_count!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:["↑ ",s.citation_count.toLocaleString()]})]})]})]},s.id)})]}),j.length>=f&&e.jsxs("button",{type:"button",className:"search-view-all-row",onClick:()=>n(`/papers?search=${encodeURIComponent(j)}`),children:["View all paper results for “",j,"”"]})]})]})})};export{ls as default}; +import{f as K,k as O,V as M,m as B,b as i,j as e,p as H}from"./index-CxhY4zQ1.js";import{L as U}from"./LatexTitle-BqNrCKu8.js";import{c as x}from"./catalog-DCEU6WpP.js";import{p as R}from"./papers-BDxSKSYJ.js";import{u as Y}from"./useDebounce-BqT24mBv.js";import{c as G,h as V}from"./colors-BkWRhvFI.js";import{d as X}from"./transform-DehuZQh7.js";import"./curation-D2sqKAqC.js";const Z=10,S=6,W=350,f=3,ls=({open:t,onClose:h})=>{var A,C,w,P,Q,z;const v=K.useRef(null),$=O(),[c,D]=M.useState(""),a=Y(c,W),j=c.trim(),r=a.trim().length>=f,y=B();K.useEffect(()=>{var l;if(!t)return;(l=v.current)==null||l.focus();const s=N=>{N.key==="Escape"&&(N.preventDefault(),N.stopPropagation(),h())};return window.addEventListener("keydown",s,!0),()=>window.removeEventListener("keydown",s,!0)},[t,h]);const k=i({queryKey:[...H.feeds.searchOverlay,a],queryFn:()=>R.search(a,1,Z),enabled:t&&r,staleTime:6e4,retry:!1}),_=i({queryKey:["search-tasks",a],queryFn:()=>x.listTasks({q:a,page_size:6}),enabled:t&&r,staleTime:6e4,retry:!1}),b=i({queryKey:["search-methods",a],queryFn:()=>x.listMethods({q:a,page_size:6}),enabled:t&&r,staleTime:6e4,retry:!1}),E=i({queryKey:["search-benchmarks",a],queryFn:()=>x.listDatasets({q:a,page_size:6}),enabled:t&&r,staleTime:6e4,retry:!1}),F=i({queryKey:["search-authors",a],queryFn:()=>R.searchAuthors(a,S),enabled:t&&r,staleTime:6e4,retry:!1}),q=i({queryKey:["search-organizations",a],queryFn:()=>x.searchOrganizations(a,S),enabled:t&&r,staleTime:6e4,retry:!1});if(!t)return null;const o=((A=_.data)==null?void 0:A.results)||[],d=((C=b.data)==null?void 0:C.results)||[],m=((w=E.data)==null?void 0:w.results)||[],u=((P=F.data)==null?void 0:P.results)||[],p=((Q=q.data)==null?void 0:Q.results)||[],g=((z=k.data)==null?void 0:z.results)||[],I=k.isFetching||_.isFetching||b.isFetching||E.isFetching||F.isFetching||q.isFetching,L=o.length||g.length||d.length||m.length||u.length||p.length,n=s=>{h(),$(s)},T=()=>{const s=c.trim();s&&n(`/chat?q=${encodeURIComponent(s)}`)};return e.jsx("div",{className:"search-overlay",onClick:h,children:e.jsxs("div",{className:"search-modal",onClick:s=>s.stopPropagation(),children:[e.jsx("input",{ref:v,className:"search-modal-input",placeholder:"Search papers, tasks, methods, benchmarks, authors, or organizations…",value:c,onChange:s=>D(s.target.value),onKeyDown:s=>{y&&s.key==="Enter"&&(s.preventDefault(),T())}}),e.jsxs("div",{className:"search-results",children:[y&&c.trim()&&e.jsxs("button",{type:"button",className:"search-ask-row",onClick:T,children:[e.jsx("span",{className:"search-ask-chip",children:"assistant"}),e.jsxs("span",{className:"search-ask-text",children:["Ask: “",c.trim(),"”"]}),e.jsx("kbd",{children:"↵"})]}),!a&&e.jsxs("div",{className:"search-empty",children:["Try “diffusion”, “object detection”, or an arXiv id.",y&&e.jsx("span",{className:"search-empty-sub",children:"Press Enter to ask the assistant"})]}),a&&!r&&e.jsxs("div",{className:"search-empty",children:["Keep typing: results appear from ",f," characters."]}),r&&!I&&!L&&e.jsxs("div",{className:"search-empty",children:['No matches for "',c,'"']}),o.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Tasks · ",o.length]}),o.map(s=>{const l=G(V(s.slug||""));return e.jsxs("div",{className:"search-result-tag",onClick:()=>n(`/tasks/${s.slug}`),children:[e.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:l.dot}}),e.jsx("span",{className:"name",children:X(s.name,s.slug)}),s.paper_count!=null&&e.jsxs("span",{className:"count",children:[s.paper_count," papers"]})]},s.id)})]}),d.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Methods · ",d.length]}),d.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>n(`/methods/${s.slug||s.id}`),children:[e.jsx("span",{style:{fontFamily:"var(--mono)",fontWeight:600},children:s.name}),s.paper_count!=null&&e.jsxs("span",{className:"count",children:[s.paper_count," papers"]})]},s.id))]}),m.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Benchmarks · ",m.length]}),m.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>n(`/benchmark/${s.slug||s.id}`),children:[e.jsx("span",{className:"name",children:s.name}),s.paper_count!=null&&s.paper_count>0&&e.jsxs("span",{className:"count",children:[s.paper_count," entries"]})]},s.id))]}),u.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Authors · ",u.length]}),u.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>n(`/authors/${s.id}`),children:[e.jsx("span",{className:"name",children:s.full_name}),s.hf_username&&e.jsxs("span",{className:"handle",children:["@",s.hf_username]}),s.paper_count>0&&e.jsxs("span",{className:"count",children:[s.paper_count," papers"]})]},s.id))]}),p.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Organizations · ",p.length]}),p.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>n(`/orgs/${s.slug}`),children:[s.logo_url&&e.jsx("img",{className:"logo",src:s.logo_url,alt:"",loading:"lazy"}),e.jsx("span",{className:"name",children:s.name}),s.paper_count!=null&&s.paper_count>0&&e.jsxs("span",{className:"count",children:[s.paper_count," papers"]})]},s.id))]}),g.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Papers · ",g.length]}),g.map(s=>{var l;return e.jsxs("div",{className:"search-result",onClick:()=>n(`/paper/${s.arxiv_id||s.id}`),children:[e.jsx("div",{className:"search-result-title",children:e.jsx(U,{title:s.title})}),e.jsxs("div",{className:"search-result-meta",children:[e.jsx("span",{children:s.arxiv_id?`arXiv:${s.arxiv_id}`:"External resource"}),((l=s.authors)==null?void 0:l[0])&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[s.authors[0],s.authors.length>1?" et al.":""]})]}),s.citation_count!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:["↑ ",s.citation_count.toLocaleString()]})]})]})]},s.id)})]}),j.length>=f&&e.jsxs("button",{type:"button",className:"search-view-all-row",onClick:()=>n(`/papers?search=${encodeURIComponent(j)}`),children:["View all paper results for “",j,"”"]})]})]})})};export{ls as default}; diff --git a/assets/SettingsView-_N3_O5i0.js b/assets/SettingsView-CWBdqT8i.js similarity index 97% rename from assets/SettingsView-_N3_O5i0.js rename to assets/SettingsView-CWBdqT8i.js index 8ac89f13edede61beb0f1eab01990db3dad475fc..0db3521f682213e623c264483ea11807b9e4402e 100644 --- a/assets/SettingsView-_N3_O5i0.js +++ b/assets/SettingsView-CWBdqT8i.js @@ -1,4 +1,4 @@ -import{c as v,a as T,g as he,f as L,j as e,L as F,l as z,r as te,b as B,H as k,h as ue,aw as ge,m as me,V as O,A as ie}from"./index-3CfcAX6N.js";import{u as N}from"./useMutation-CKC6OFhA.js";import{d as pe,h as ee,f as xe,b as fe,i as se,q as ye,v as je,a as be,e as ve,r as U,p as we}from"./researchTopic-Z4AJDMN7.js";import{S as C}from"./switch-B40zv53e.js";import{S as ke}from"./sparkles-BY8EsDI7.js";import{A as Ne}from"./arrow-right-U4Mftc_z.js";import{T as Ce}from"./trophy-BKn0k0Fw.js";import{c as w}from"./chat-81nIwu_j.js";import{u as Fe,f as Re}from"./useDocumentTitle-BnA1kM_d.js";import{a as _e,u as Se,r as Ee,O as Y}from"./openrouter-Bol7eGlT.js";import{u as Pe}from"./preferences-BmWwgggH.js";import{E as ae}from"./external-link-_7BCdt0S.js";import{M as Me}from"./moon-DWTtiCFw.js";import"./index-Caztwwvv.js";import"./account-Ee9-ZosC.js";/** +import{c as v,a as T,g as he,f as L,j as e,L as F,l as z,r as te,b as B,H as k,h as ue,aw as ge,m as me,V as O,A as ie}from"./index-CxhY4zQ1.js";import{u as N}from"./useMutation-BzRfwboV.js";import{d as pe,h as ee,f as xe,b as fe,i as se,q as ye,v as je,a as be,e as ve,r as U,p as we}from"./researchTopic-DXZVIvAq.js";import{S as C}from"./switch-COruZUxK.js";import{S as ke}from"./sparkles-CBme4WI-.js";import{A as Ne}from"./arrow-right-BwBMsu3P.js";import{T as Ce}from"./trophy-BVERRwS-.js";import{c as w}from"./chat-CkiIbMG5.js";import{u as Fe,f as Re}from"./useDocumentTitle-CC3zTSwA.js";import{a as _e,u as Se,r as Ee,O as Y}from"./openrouter-DLk2ZdMf.js";import{u as Pe}from"./preferences-CUy01zEm.js";import{E as ae}from"./external-link-UhGsnDEF.js";import{M as Me}from"./moon-D6Y7BLS4.js";import"./index-JxIVN7pD.js";import"./account-Bplq3u-8.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/SharedChatView-DHFlFcmS.js b/assets/SharedChatView-DgpdZ95u.js similarity index 78% rename from assets/SharedChatView-DHFlFcmS.js rename to assets/SharedChatView-DgpdZ95u.js index 14405e3c41aeb400ab6384838c290455997564d1..51449acf6006cf4c3f7591efd2e1ca52e1c54250 100644 --- a/assets/SharedChatView-DHFlFcmS.js +++ b/assets/SharedChatView-DgpdZ95u.js @@ -1 +1 @@ -import{u as x,k as g,f as o,b as v,j as e,A as f,s as j}from"./index-3CfcAX6N.js";import{A as b,a as y,C as S,U as w,b as N,t as k}from"./chatLifecycle-DK4zPLlA.js";import{e as C,p as q,f as A,q as P}from"./chatSessions-C9fOk1AR.js";import{c as _}from"./chat-81nIwu_j.js";/* empty css */import"./hover-card-DOKhkRf9.js";import"./CatalogEntityPreviewLink-BzZN33n7.js";import"./catalog-B47DuClX.js";import"./github-vz0wxUgq.js";import"./file-text-BnjsSheU.js";import"./PaperPreviewLink-BJAulcHJ.js";import"./index-DGr54pyn.js";import"./index-C8DcqbS3.js";import"./katex-DkKDou_j.js";import"./papers-BsYlGUQi.js";import"./curation-BZoIvsHD.js";import"./useMutation-CKC6OFhA.js";import"./thumbs-up-BMfH8ZZ-.js";import"./copy-BCi4szva.js";import"./queryOptions-C9woPjwX.js";import"./arrow-left-CZqhJnQC.js";import"./external-link-_7BCdt0S.js";import"./plus-CiDEk52y.js";import"./search-SnOvJVk_.js";import"./chevron-up-DgV4G0Wf.js";import"./AuthorAvatar-DYaYcwPm.js";const m=s=>s instanceof f&&s.status===404,E=({detail:s})=>{const[n,i]=o.useState(()=>q(s)),h=o.useMemo(()=>A(n),[n]),l=(t,p)=>{i(u=>k(u,t,p))};return e.jsx("div",{className:"shared-chat-transcript",children:n.map(t=>t.role==="user"?e.jsx(w,{id:t.id,text:t.text??"",paperMentions:t.paperMentions??[],paperSelection:t.paperSelection},t.id):e.jsx(N,{msg:t,papers:h,onToggleBlock:l},t.id))})},se=()=>{const{shareId:s=""}=x(),n=g(),i=j(),[h,l]=o.useState(60),t=v({queryKey:["shared-chat",s],queryFn:()=>_.getSharedChat(s),retry:(r,a)=>!m(a)&&r<1});o.useEffect(()=>{const r=document.title,a=document.head.querySelector('meta[name="robots"]'),c=a==null?void 0:a.content,d=a??document.createElement("meta");return d.name="robots",d.content="noindex,nofollow",a||document.head.appendChild(d),document.title="Shared conversation",()=>{document.title=r,a?a.content=c??"":d.remove()}},[]),o.useLayoutEffect(()=>{const r=document.querySelector(".app-header");if(!r)return;const a=()=>l(r.offsetHeight);a();const c=new ResizeObserver(a);return c.observe(r),()=>c.disconnect()},[]);const p=r=>{P(r,void 0,{autoSend:!1}),n("/chat")},u=m(t.error);return t.isLoading?e.jsxs("div",{className:"shared-chat-state",role:"status",children:[e.jsx(C,{})," Loading shared conversation…"]}):u?e.jsxs("div",{className:"shared-chat-state shared-chat-not-found",children:[e.jsx("h1",{children:"Shared conversation not found"}),e.jsx("p",{children:"This link is invalid or is no longer available."})]}):t.isError||!t.data?e.jsxs("div",{className:"shared-chat-state",role:"alert",children:[e.jsx("h1",{children:"Couldn’t load this conversation"}),e.jsx("p",{children:"Please check your connection and try again."}),e.jsx("button",{type:"button",onClick:()=>void t.refetch(),children:"Try again"})]}):e.jsx(b,{workspaceKey:`share:${s}:${t.data.updated_at}`,autoOpenOnMount:!0,children:e.jsxs("div",{className:"shared-chat-page",style:{height:`calc(100dvh - ${h}px)`},children:[e.jsxs("div",{className:"shared-chat-heading",children:[e.jsx("h1",{children:"Shared conversation"}),i&&e.jsx("span",{className:"chat-staging-badge",children:"Staging"})]}),e.jsx(y,{variant:"shared",children:e.jsxs("div",{className:"shared-chat-content","data-testid":"shared-conversation-pane",children:[e.jsx(E,{detail:t.data},t.data.updated_at),t.data.model_label&&e.jsxs("div",{className:"shared-chat-attribution",children:[e.jsxs("span",{children:["Generated with ",t.data.model_label]}),t.data.model_provider==="huggingface"&&e.jsxs("span",{children:["Powered by ",e.jsx("span",{"aria-hidden":"true",children:"🤗"})," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]}),t.data.model_provider==="openrouter"&&e.jsxs("span",{children:["Powered by ",e.jsx("a",{href:"https://openrouter.ai",target:"_blank",rel:"noreferrer",children:"OpenRouter"})]}),t.data.model_provider==="openai"&&e.jsx("span",{children:"Powered by OpenAI"})]}),e.jsxs("section",{className:"shared-chat-fresh","aria-labelledby":"shared-chat-fresh-title",children:[e.jsx("h2",{id:"shared-chat-fresh-title",children:"Start a new conversation"}),e.jsx("p",{children:"Your new question starts with an empty context."}),i&&e.jsxs("div",{className:"shared-chat-access-note",role:"note",children:[e.jsx("strong",{children:"Limited staging preview."})," Starting a chat is available only to approved Hugging Face users."]}),e.jsx(S,{onSend:r=>p(r.text),placeholder:"Ask a new research question…"})]})]})})]})})};export{se as default}; +import{u as x,k as g,f as o,b as v,j as e,A as f,s as j}from"./index-CxhY4zQ1.js";import{A as b,a as y,C as S,U as w,b as N,t as k}from"./chatLifecycle-CUjL6RQJ.js";import{e as C,p as q,f as A,q as P}from"./chatSessions-DjtMpqHz.js";import{c as _}from"./chat-CkiIbMG5.js";/* empty css */import"./hover-card-CqKeZcpY.js";import"./CatalogEntityPreviewLink-Bp5A8eb_.js";import"./catalog-DCEU6WpP.js";import"./github-Bv102r_G.js";import"./file-text-42n3m1yn.js";import"./PaperPreviewLink-Y2LI3xZW.js";import"./index-BCjs92mB.js";import"./index-mv_8ovfA.js";import"./katex-DkKDou_j.js";import"./papers-BDxSKSYJ.js";import"./curation-D2sqKAqC.js";import"./useMutation-BzRfwboV.js";import"./thumbs-up-DP1Ac3Tb.js";import"./copy-Dpy50x4G.js";import"./queryOptions-C9woPjwX.js";import"./arrow-left-CDwy-_cK.js";import"./external-link-UhGsnDEF.js";import"./plus-CEkdlNSn.js";import"./search-CkWMhIw6.js";import"./chevron-up-ClmVTWYw.js";import"./AuthorAvatar-DPz8YQ5Z.js";const m=s=>s instanceof f&&s.status===404,E=({detail:s})=>{const[n,i]=o.useState(()=>q(s)),h=o.useMemo(()=>A(n),[n]),l=(t,p)=>{i(u=>k(u,t,p))};return e.jsx("div",{className:"shared-chat-transcript",children:n.map(t=>t.role==="user"?e.jsx(w,{id:t.id,text:t.text??"",paperMentions:t.paperMentions??[],paperSelection:t.paperSelection},t.id):e.jsx(N,{msg:t,papers:h,onToggleBlock:l},t.id))})},se=()=>{const{shareId:s=""}=x(),n=g(),i=j(),[h,l]=o.useState(60),t=v({queryKey:["shared-chat",s],queryFn:()=>_.getSharedChat(s),retry:(r,a)=>!m(a)&&r<1});o.useEffect(()=>{const r=document.title,a=document.head.querySelector('meta[name="robots"]'),c=a==null?void 0:a.content,d=a??document.createElement("meta");return d.name="robots",d.content="noindex,nofollow",a||document.head.appendChild(d),document.title="Shared conversation",()=>{document.title=r,a?a.content=c??"":d.remove()}},[]),o.useLayoutEffect(()=>{const r=document.querySelector(".app-header");if(!r)return;const a=()=>l(r.offsetHeight);a();const c=new ResizeObserver(a);return c.observe(r),()=>c.disconnect()},[]);const p=r=>{P(r,void 0,{autoSend:!1}),n("/chat")},u=m(t.error);return t.isLoading?e.jsxs("div",{className:"shared-chat-state",role:"status",children:[e.jsx(C,{})," Loading shared conversation…"]}):u?e.jsxs("div",{className:"shared-chat-state shared-chat-not-found",children:[e.jsx("h1",{children:"Shared conversation not found"}),e.jsx("p",{children:"This link is invalid or is no longer available."})]}):t.isError||!t.data?e.jsxs("div",{className:"shared-chat-state",role:"alert",children:[e.jsx("h1",{children:"Couldn’t load this conversation"}),e.jsx("p",{children:"Please check your connection and try again."}),e.jsx("button",{type:"button",onClick:()=>void t.refetch(),children:"Try again"})]}):e.jsx(b,{workspaceKey:`share:${s}:${t.data.updated_at}`,autoOpenOnMount:!0,children:e.jsxs("div",{className:"shared-chat-page",style:{height:`calc(100dvh - ${h}px)`},children:[e.jsxs("div",{className:"shared-chat-heading",children:[e.jsx("h1",{children:"Shared conversation"}),i&&e.jsx("span",{className:"chat-staging-badge",children:"Staging"})]}),e.jsx(y,{variant:"shared",children:e.jsxs("div",{className:"shared-chat-content","data-testid":"shared-conversation-pane",children:[e.jsx(E,{detail:t.data},t.data.updated_at),t.data.model_label&&e.jsxs("div",{className:"shared-chat-attribution",children:[e.jsxs("span",{children:["Generated with ",t.data.model_label]}),t.data.model_provider==="huggingface"&&e.jsxs("span",{children:["Powered by ",e.jsx("span",{"aria-hidden":"true",children:"🤗"})," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]}),t.data.model_provider==="openrouter"&&e.jsxs("span",{children:["Powered by ",e.jsx("a",{href:"https://openrouter.ai",target:"_blank",rel:"noreferrer",children:"OpenRouter"})]}),t.data.model_provider==="openai"&&e.jsx("span",{children:"Powered by OpenAI"})]}),e.jsxs("section",{className:"shared-chat-fresh","aria-labelledby":"shared-chat-fresh-title",children:[e.jsx("h2",{id:"shared-chat-fresh-title",children:"Start a new conversation"}),e.jsx("p",{children:"Your new question starts with an empty context."}),i&&e.jsxs("div",{className:"shared-chat-access-note",role:"note",children:[e.jsx("strong",{children:"Limited staging preview."})," Starting a chat is available only to approved Hugging Face users."]}),e.jsx(S,{onSend:r=>p(r.text),placeholder:"Ask a new research question…"})]})]})})]})})};export{se as default}; diff --git a/assets/SignInToEditDialog-P5ytZJBG.js b/assets/SignInToEditDialog-0W7FFwc1.js similarity index 95% rename from assets/SignInToEditDialog-P5ytZJBG.js rename to assets/SignInToEditDialog-0W7FFwc1.js index 5997aaddcd295856f34f3b9d29fc08292cb47619..aebf11f76f14e0c4fe3ff2e09a8967dafd2e3a39 100644 --- a/assets/SignInToEditDialog-P5ytZJBG.js +++ b/assets/SignInToEditDialog-0W7FFwc1.js @@ -1,4 +1,4 @@ -import{c as be,f as a,j as e,ad as je,I as fe,ae as ye,x as Ne,y as we,X as Se,C as _e,H as ke}from"./index-3CfcAX6N.js";import{B as P}from"./button-CbnaBx6W.js";import{I as u}from"./input-B7wcXhgG.js";import{T as Ce}from"./textarea-CdcMknzH.js";import{S as se}from"./searchable-select-DBlreWDS.js";import{D as ie,a as oe,c as le,b as ce,d as de,e as De}from"./dialog-Bbx5GVcy.js";import{u as Ie}from"./useMutation-CKC6OFhA.js";import{s as b,p as j}from"./submissions-D-jwpMfI.js";import{c as te}from"./catalog-B47DuClX.js";import{L as Ee}from"./loader-circle-CMgZ_maE.js";/** +import{c as be,f as a,j as e,ad as je,I as fe,ae as ye,x as Ne,y as we,X as Se,C as _e,H as ke}from"./index-CxhY4zQ1.js";import{B as P}from"./button-BenSiukP.js";import{I as u}from"./input-CxKbyH9e.js";import{T as Ce}from"./textarea-uttJnDhA.js";import{S as se}from"./searchable-select-hPIpmCr4.js";import{D as ie,a as oe,c as le,b as ce,d as de,e as De}from"./dialog-CT48f48_.js";import{u as Ie}from"./useMutation-BzRfwboV.js";import{s as b,p as j}from"./submissions-DF3SD1oA.js";import{c as te}from"./catalog-DCEU6WpP.js";import{L as Ee}from"./loader-circle-C5gQxAlQ.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/SotaBadges-BqZMAXyY.js b/assets/SotaBadges-EnDhSaVO.js similarity index 97% rename from assets/SotaBadges-BqZMAXyY.js rename to assets/SotaBadges-EnDhSaVO.js index bbac248edd94afa66c696892a40ff2d9dd1dee21..f5c082e68a760b4dff32abf0f2a23e9cd8a8c8da 100644 --- a/assets/SotaBadges-BqZMAXyY.js +++ b/assets/SotaBadges-EnDhSaVO.js @@ -1 +1 @@ -import{k as M,j as e,V as x,L as C}from"./index-3CfcAX6N.js";import{h as F,c as E}from"./colors-BkWRhvFI.js";import{d as A,h as P}from"./transform-Dx-N8Yyj.js";const D=({slug:t,label:s,onClick:r})=>{const a=M(),j=F(t),o=E(j),p=c=>{if(c.stopPropagation(),r){r(t);return}a(`/tasks/${t}`)};return e.jsxs("span",{className:"tag-chip",style:{background:o.bg,color:o.text},onClick:p,children:[e.jsx("span",{className:"dot",style:{background:o.dot}}),A(s||P(t),t)]})},I=({method:t,onClick:s})=>{const r=M(),a=t.slug||t.id||"";if(!a)return null;const j=o=>{if(o.stopPropagation(),s){s(a);return}r(`/methods/${a}`)};return e.jsx("span",{className:"method-chip",onClick:j,children:t.name})},W=t=>{let s=2166136261;for(let r=0;r(s=Math.imul(s^s>>>15,2246822507),s=Math.imul(s^s>>>13,3266489909),s^=s>>>16,(s>>>0)%1e4/1e4)},O=({paperId:t})=>{const s=W(t),r=160,a=220,j=[.85+s()*.1,.55+s()*.25],o=.45+s()*.3,p=[],c=9+Math.floor(s()*3);for(let y=0;y.3,l=Math.floor(s()*3),m=[],$=6+Math.floor(s()*3);for(let y=0;y<$;y++)m.push(.5+s()*.45);const d="#9A9588",u="#3A352D",i=5,h=(r-i*2-2)/2,b=i,f=i+h+2;let v=i+2;const R=v;v+=6;const T=v+1;v+=5;const L=v;v+=3;const g=v+1;return e.jsx("div",{style:{width:r,height:a,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:e.jsxs("svg",{width:r,height:a,viewBox:`0 0 ${r} ${a}`,style:{display:"block"},children:[j.map((y,k)=>e.jsx("rect",{x:i+(r-i*2)*(1-y)/2,y:R+k*2.4,width:(r-i*2)*y,height:1.4,fill:u,rx:.3},`t${k}`)),e.jsx("rect",{x:i+(r-i*2)*(1-o)/2,y:T,width:(r-i*2)*o,height:.9,fill:d,opacity:.7,rx:.2}),e.jsx("rect",{x:i,y:L,width:6,height:1,fill:u,opacity:.6}),p.map((y,k)=>{const w=g+k*2.1;return w>a-i-1?null:e.jsx("rect",{x:b,y:w,width:h*y,height:.8,fill:d,opacity:.55,rx:.2},`l${k}`)}),n&&e.jsxs("g",{children:[e.jsx("rect",{x:f,y:g,width:h,height:14,fill:"#F0EBE0",stroke:d,strokeWidth:.3,opacity:.9}),l===0&&e.jsx("g",{stroke:u,strokeWidth:.4,fill:"none",opacity:.6,children:e.jsx("polyline",{points:`${f+2},${g+11} ${f+6},${g+8} ${f+10},${g+9} ${f+14},${g+5} ${f+18},${g+6} ${f+22},${g+3}`})}),l===1&&e.jsxs("g",{opacity:.55,children:[e.jsx("circle",{cx:f+h/2,cy:g+7,r:3.5,fill:u}),e.jsx("rect",{x:f+2,y:g+11,width:h-4,height:1.5,fill:d})]}),l===2&&e.jsxs("g",{opacity:.55,children:[e.jsx("rect",{x:f+3,y:g+5,width:h-6,height:1,fill:u}),e.jsx("rect",{x:f+6,y:g+8,width:h-12,height:.8,fill:u})]})]}),m.map((y,k)=>{const w=g+(n?16:0)+k*2.1;return w>a-i-1?null:e.jsx("rect",{x:f,y:w,width:h*y,height:.8,fill:d,opacity:.55,rx:.2},`r${k}`)})]})})},Y=({paperId:t,title:s,thumbnailUrl:r,priority:a=!1})=>{const[j,o]=x.useState(!1),[p,c]=x.useState(0),[n,l]=x.useState(a),m=x.useRef(null);x.useEffect(()=>{o(!1),c(0)},[r]);const $=x.useMemo(()=>{if(!r)return null;if(p===0)return r;const d=r.includes("?")?"&":"?";return`${r}${d}retry=${p}`},[r,p]);return x.useEffect(()=>{if(a||n)return;const d=m.current;if(!d)return;const u=new IntersectionObserver(([i])=>{i.isIntersecting&&(l(!0),u.disconnect())},{rootMargin:"250px"});return u.observe(d),()=>u.disconnect()},[a,n]),r&&!j?e.jsx("div",{ref:m,style:{width:160,height:220,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:(a||n)&&$&&e.jsx("img",{src:$,alt:`Thumbnail for ${s}`,loading:a?"eager":"lazy",decoding:"async",fetchPriority:a?"high":"auto",style:{width:"100%",height:"100%",objectFit:"contain",display:"block"},onError:()=>{if(p<1){c(d=>d+1);return}o(!0)}},$)}):e.jsx(O,{paperId:t})},S={1:"SOTA 🏆",2:"#2",3:"#3"},N=({units:t,paperHref:s})=>{const r=x.useRef(null),a=x.useRef(null),[j,o]=x.useState(t.length);if(x.useLayoutEffect(()=>{const n=r.current,l=a.current;if(!n||!l||t.length===0)return;const m=u=>(l.textContent=u,l.scrollWidth),$=()=>{const u=n.clientWidth;if(u<=0)return;let i=0,h=0;for(const b of t){const f=m(b.measureText);if(i+f<=u)i+=f,h+=1;else break}if(h0&&i+m(` · +${t.length-h} more`)>u;)h-=1,i-=m(t[h].measureText);h===0&&(h=1)}o(h)};$();const d=new ResizeObserver($);return d.observe(n),()=>d.disconnect()},[t]),t.length===0)return null;const p=t.slice(0,Math.max(1,Math.min(j,t.length))),c=t.length-p.length;return e.jsxs("div",{className:"paper-sota",ref:r,children:[e.jsx("span",{ref:a,className:"paper-sota-measure","aria-hidden":"true"}),p.map((n,l)=>e.jsxs(x.Fragment,{children:[n.isGroupStart?e.jsxs(e.Fragment,{children:[l>0&&e.jsx("span",{className:"paper-sota-sep",children:" · "}),e.jsx("span",{className:`paper-sota-label${n.rank===1?" paper-sota-label--sota":""}`,children:S[n.rank]}),e.jsx("span",{className:"paper-sota-on",children:" on "})]}):e.jsx("span",{className:"paper-sota-sep",children:", "}),n.href?e.jsx(C,{to:n.href,className:"paper-sota-name",onClick:m=>m.stopPropagation(),children:n.name}):e.jsx("span",{className:"paper-sota-name",children:n.name})]},`${n.href||n.name}-${l}`)),c>0&&e.jsxs(C,{to:`${s}#results`,className:"paper-sota-more",onClick:n=>n.stopPropagation(),children:[" · +",c," more"]})]})},V=({ranks:t,paperHref:s,wrap:r=!1})=>{const a=x.useMemo(()=>{const o=[];let p=!0;for(const c of[1,2,3]){const n=t.filter(l=>l.rank===c);n.forEach((l,m)=>{const $=m===0,d=$?`${p?"":" · "}${S[c]} on `:", ";o.push({name:l.name,href:l.href,rank:c,isGroupStart:$,measureText:d+l.name})}),n.length>0&&(p=!1)}return o},[t]),j=x.useMemo(()=>[1,2,3].map(o=>t.filter(c=>c.rank===o).map((c,n)=>({name:c.name,href:c.href,rank:o,isGroupStart:n===0,measureText:(n===0?`${S[o]} on `:", ")+c.name}))).filter(o=>o.length>0),[t]);return r?j.length===0?null:e.jsx("div",{className:"paper-sota-stack",children:j.map(o=>e.jsx(N,{units:o,paperHref:s},o[0].rank))}):a.length===0?null:e.jsx(N,{units:a,paperHref:s})};export{I as M,Y as P,V as S,D as T}; +import{k as M,j as e,V as x,L as C}from"./index-CxhY4zQ1.js";import{h as F,c as E}from"./colors-BkWRhvFI.js";import{d as A,h as P}from"./transform-DehuZQh7.js";const D=({slug:t,label:s,onClick:r})=>{const a=M(),j=F(t),o=E(j),p=c=>{if(c.stopPropagation(),r){r(t);return}a(`/tasks/${t}`)};return e.jsxs("span",{className:"tag-chip",style:{background:o.bg,color:o.text},onClick:p,children:[e.jsx("span",{className:"dot",style:{background:o.dot}}),A(s||P(t),t)]})},I=({method:t,onClick:s})=>{const r=M(),a=t.slug||t.id||"";if(!a)return null;const j=o=>{if(o.stopPropagation(),s){s(a);return}r(`/methods/${a}`)};return e.jsx("span",{className:"method-chip",onClick:j,children:t.name})},W=t=>{let s=2166136261;for(let r=0;r(s=Math.imul(s^s>>>15,2246822507),s=Math.imul(s^s>>>13,3266489909),s^=s>>>16,(s>>>0)%1e4/1e4)},O=({paperId:t})=>{const s=W(t),r=160,a=220,j=[.85+s()*.1,.55+s()*.25],o=.45+s()*.3,p=[],c=9+Math.floor(s()*3);for(let y=0;y.3,l=Math.floor(s()*3),m=[],$=6+Math.floor(s()*3);for(let y=0;y<$;y++)m.push(.5+s()*.45);const d="#9A9588",u="#3A352D",i=5,h=(r-i*2-2)/2,b=i,f=i+h+2;let v=i+2;const R=v;v+=6;const T=v+1;v+=5;const L=v;v+=3;const g=v+1;return e.jsx("div",{style:{width:r,height:a,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:e.jsxs("svg",{width:r,height:a,viewBox:`0 0 ${r} ${a}`,style:{display:"block"},children:[j.map((y,k)=>e.jsx("rect",{x:i+(r-i*2)*(1-y)/2,y:R+k*2.4,width:(r-i*2)*y,height:1.4,fill:u,rx:.3},`t${k}`)),e.jsx("rect",{x:i+(r-i*2)*(1-o)/2,y:T,width:(r-i*2)*o,height:.9,fill:d,opacity:.7,rx:.2}),e.jsx("rect",{x:i,y:L,width:6,height:1,fill:u,opacity:.6}),p.map((y,k)=>{const w=g+k*2.1;return w>a-i-1?null:e.jsx("rect",{x:b,y:w,width:h*y,height:.8,fill:d,opacity:.55,rx:.2},`l${k}`)}),n&&e.jsxs("g",{children:[e.jsx("rect",{x:f,y:g,width:h,height:14,fill:"#F0EBE0",stroke:d,strokeWidth:.3,opacity:.9}),l===0&&e.jsx("g",{stroke:u,strokeWidth:.4,fill:"none",opacity:.6,children:e.jsx("polyline",{points:`${f+2},${g+11} ${f+6},${g+8} ${f+10},${g+9} ${f+14},${g+5} ${f+18},${g+6} ${f+22},${g+3}`})}),l===1&&e.jsxs("g",{opacity:.55,children:[e.jsx("circle",{cx:f+h/2,cy:g+7,r:3.5,fill:u}),e.jsx("rect",{x:f+2,y:g+11,width:h-4,height:1.5,fill:d})]}),l===2&&e.jsxs("g",{opacity:.55,children:[e.jsx("rect",{x:f+3,y:g+5,width:h-6,height:1,fill:u}),e.jsx("rect",{x:f+6,y:g+8,width:h-12,height:.8,fill:u})]})]}),m.map((y,k)=>{const w=g+(n?16:0)+k*2.1;return w>a-i-1?null:e.jsx("rect",{x:f,y:w,width:h*y,height:.8,fill:d,opacity:.55,rx:.2},`r${k}`)})]})})},Y=({paperId:t,title:s,thumbnailUrl:r,priority:a=!1})=>{const[j,o]=x.useState(!1),[p,c]=x.useState(0),[n,l]=x.useState(a),m=x.useRef(null);x.useEffect(()=>{o(!1),c(0)},[r]);const $=x.useMemo(()=>{if(!r)return null;if(p===0)return r;const d=r.includes("?")?"&":"?";return`${r}${d}retry=${p}`},[r,p]);return x.useEffect(()=>{if(a||n)return;const d=m.current;if(!d)return;const u=new IntersectionObserver(([i])=>{i.isIntersecting&&(l(!0),u.disconnect())},{rootMargin:"250px"});return u.observe(d),()=>u.disconnect()},[a,n]),r&&!j?e.jsx("div",{ref:m,style:{width:160,height:220,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:(a||n)&&$&&e.jsx("img",{src:$,alt:`Thumbnail for ${s}`,loading:a?"eager":"lazy",decoding:"async",fetchPriority:a?"high":"auto",style:{width:"100%",height:"100%",objectFit:"contain",display:"block"},onError:()=>{if(p<1){c(d=>d+1);return}o(!0)}},$)}):e.jsx(O,{paperId:t})},S={1:"SOTA 🏆",2:"#2",3:"#3"},N=({units:t,paperHref:s})=>{const r=x.useRef(null),a=x.useRef(null),[j,o]=x.useState(t.length);if(x.useLayoutEffect(()=>{const n=r.current,l=a.current;if(!n||!l||t.length===0)return;const m=u=>(l.textContent=u,l.scrollWidth),$=()=>{const u=n.clientWidth;if(u<=0)return;let i=0,h=0;for(const b of t){const f=m(b.measureText);if(i+f<=u)i+=f,h+=1;else break}if(h0&&i+m(` · +${t.length-h} more`)>u;)h-=1,i-=m(t[h].measureText);h===0&&(h=1)}o(h)};$();const d=new ResizeObserver($);return d.observe(n),()=>d.disconnect()},[t]),t.length===0)return null;const p=t.slice(0,Math.max(1,Math.min(j,t.length))),c=t.length-p.length;return e.jsxs("div",{className:"paper-sota",ref:r,children:[e.jsx("span",{ref:a,className:"paper-sota-measure","aria-hidden":"true"}),p.map((n,l)=>e.jsxs(x.Fragment,{children:[n.isGroupStart?e.jsxs(e.Fragment,{children:[l>0&&e.jsx("span",{className:"paper-sota-sep",children:" · "}),e.jsx("span",{className:`paper-sota-label${n.rank===1?" paper-sota-label--sota":""}`,children:S[n.rank]}),e.jsx("span",{className:"paper-sota-on",children:" on "})]}):e.jsx("span",{className:"paper-sota-sep",children:", "}),n.href?e.jsx(C,{to:n.href,className:"paper-sota-name",onClick:m=>m.stopPropagation(),children:n.name}):e.jsx("span",{className:"paper-sota-name",children:n.name})]},`${n.href||n.name}-${l}`)),c>0&&e.jsxs(C,{to:`${s}#results`,className:"paper-sota-more",onClick:n=>n.stopPropagation(),children:[" · +",c," more"]})]})},V=({ranks:t,paperHref:s,wrap:r=!1})=>{const a=x.useMemo(()=>{const o=[];let p=!0;for(const c of[1,2,3]){const n=t.filter(l=>l.rank===c);n.forEach((l,m)=>{const $=m===0,d=$?`${p?"":" · "}${S[c]} on `:", ";o.push({name:l.name,href:l.href,rank:c,isGroupStart:$,measureText:d+l.name})}),n.length>0&&(p=!1)}return o},[t]),j=x.useMemo(()=>[1,2,3].map(o=>t.filter(c=>c.rank===o).map((c,n)=>({name:c.name,href:c.href,rank:o,isGroupStart:n===0,measureText:(n===0?`${S[o]} on `:", ")+c.name}))).filter(o=>o.length>0),[t]);return r?j.length===0?null:e.jsx("div",{className:"paper-sota-stack",children:j.map(o=>e.jsx(N,{units:o,paperHref:s},o[0].rank))}):a.length===0?null:e.jsx(N,{units:a,paperHref:s})};export{I as M,Y as P,V as S,D as T}; diff --git a/assets/StagingAccessRequestView-Dj2Lej-i.js b/assets/StagingAccessRequestView-D-ipJ4kW.js similarity index 95% rename from assets/StagingAccessRequestView-Dj2Lej-i.js rename to assets/StagingAccessRequestView-D-ipJ4kW.js index 4c95531c8f7dfa932bbc672c408c92333cb88ff8..f6fef8e31fb35246829357d4cc52eeb88760fb4b 100644 --- a/assets/StagingAccessRequestView-Dj2Lej-i.js +++ b/assets/StagingAccessRequestView-D-ipJ4kW.js @@ -1 +1 @@ -import{a as m,V as a,j as e,H as g,b3 as p}from"./index-3CfcAX6N.js";import{C as j}from"./circle-check-D68ytty0.js";const f=()=>{const{user:s,isLoading:u}=m(),[l,d]=a.useState(!1),[r,t]=a.useState(!1),[c,i]=a.useState(null),o=async h=>{h.preventDefault(),t(!0),i(null);try{await p.requestStagingAccess(),d(!0)}catch(n){i(n instanceof Error?n.message:"Could not submit your request.")}finally{t(!1)}};return e.jsx("main",{className:"access-request-page",children:e.jsxs("section",{className:"access-request-card","aria-labelledby":"access-request-title",children:[e.jsxs("a",{className:"access-request-brand",href:"https://paperswithcode.co",children:[e.jsx("span",{className:"brand-mark","aria-hidden":"true"}),e.jsxs("span",{className:"brand-name",children:["Papers ",e.jsx("em",{children:"with"})," Code"]})]}),l?e.jsxs("div",{className:"access-request-success",role:"status",children:[e.jsx(j,{size:34,strokeWidth:1.6,"aria-hidden":"true"}),e.jsx("h1",{id:"access-request-title",children:"Request received"}),e.jsxs("p",{children:["Thanks, @",s==null?void 0:s.username,". We’ll review your contributor access request."]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"access-request-heading",children:[e.jsx("p",{className:"access-request-eyebrow",children:"Staging preview"}),e.jsx("h1",{id:"access-request-title",children:"Request access"}),e.jsx("p",{children:"This preview is limited to project contributors. Send us your verified Hugging Face username and email address to request access."})]}),u?e.jsx("p",{className:"access-request-status",role:"status",children:"Checking your Hugging Face account…"}):s?e.jsxs("form",{className:"access-request-form",onSubmit:o,children:[e.jsx("label",{htmlFor:"hf-username",children:"Hugging Face username"}),e.jsxs("div",{className:"access-request-input-wrap",children:[e.jsx("span",{"aria-hidden":"true",children:"@"}),e.jsx("input",{id:"hf-username",name:"hf_username",value:s.username,readOnly:!0,autoComplete:"username"})]}),e.jsxs("p",{className:"access-request-verified",children:["Username and email verified through Hugging Face sign-in. See our"," ",e.jsx("a",{href:"https://paperswithcode.co/privacy",children:"Privacy Policy"}),"."]}),c&&e.jsx("p",{className:"access-request-error",role:"alert",children:c}),e.jsx("button",{className:"access-request-submit",type:"submit",disabled:r,children:r?"Sending…":"Request access"})]}):e.jsxs("div",{className:"access-request-signin",children:[e.jsx("p",{children:"Sign in first so we can verify the account you’re requesting access for."}),e.jsx(g,{returnTo:"/request-access",label:"Sign in with Hugging Face",collectEmail:!0})]})]})]})})};export{f as default}; +import{a as m,V as a,j as e,H as g,b3 as p}from"./index-CxhY4zQ1.js";import{C as j}from"./circle-check-CnqnwdL4.js";const f=()=>{const{user:s,isLoading:u}=m(),[l,d]=a.useState(!1),[r,t]=a.useState(!1),[c,i]=a.useState(null),o=async h=>{h.preventDefault(),t(!0),i(null);try{await p.requestStagingAccess(),d(!0)}catch(n){i(n instanceof Error?n.message:"Could not submit your request.")}finally{t(!1)}};return e.jsx("main",{className:"access-request-page",children:e.jsxs("section",{className:"access-request-card","aria-labelledby":"access-request-title",children:[e.jsxs("a",{className:"access-request-brand",href:"https://paperswithcode.co",children:[e.jsx("span",{className:"brand-mark","aria-hidden":"true"}),e.jsxs("span",{className:"brand-name",children:["Papers ",e.jsx("em",{children:"with"})," Code"]})]}),l?e.jsxs("div",{className:"access-request-success",role:"status",children:[e.jsx(j,{size:34,strokeWidth:1.6,"aria-hidden":"true"}),e.jsx("h1",{id:"access-request-title",children:"Request received"}),e.jsxs("p",{children:["Thanks, @",s==null?void 0:s.username,". We’ll review your contributor access request."]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"access-request-heading",children:[e.jsx("p",{className:"access-request-eyebrow",children:"Staging preview"}),e.jsx("h1",{id:"access-request-title",children:"Request access"}),e.jsx("p",{children:"This preview is limited to project contributors. Send us your verified Hugging Face username and email address to request access."})]}),u?e.jsx("p",{className:"access-request-status",role:"status",children:"Checking your Hugging Face account…"}):s?e.jsxs("form",{className:"access-request-form",onSubmit:o,children:[e.jsx("label",{htmlFor:"hf-username",children:"Hugging Face username"}),e.jsxs("div",{className:"access-request-input-wrap",children:[e.jsx("span",{"aria-hidden":"true",children:"@"}),e.jsx("input",{id:"hf-username",name:"hf_username",value:s.username,readOnly:!0,autoComplete:"username"})]}),e.jsxs("p",{className:"access-request-verified",children:["Username and email verified through Hugging Face sign-in. See our"," ",e.jsx("a",{href:"https://paperswithcode.co/privacy",children:"Privacy Policy"}),"."]}),c&&e.jsx("p",{className:"access-request-error",role:"alert",children:c}),e.jsx("button",{className:"access-request-submit",type:"submit",disabled:r,children:r?"Sending…":"Request access"})]}):e.jsxs("div",{className:"access-request-signin",children:[e.jsx("p",{children:"Sign in first so we can verify the account you’re requesting access for."}),e.jsx(g,{returnTo:"/request-access",label:"Sign in with Hugging Face",collectEmail:!0})]})]})]})})};export{f as default}; diff --git a/assets/SubmissionsDashboard-U7U8ESH5.js b/assets/SubmissionsDashboard-DQ0IgORY.js similarity index 97% rename from assets/SubmissionsDashboard-U7U8ESH5.js rename to assets/SubmissionsDashboard-DQ0IgORY.js index 89d003a156c55af9d3a19c440fd400e368eb2aa3..cbf04c3db95cfc74d47c1bce950bc0fd41cafb69 100644 --- a/assets/SubmissionsDashboard-U7U8ESH5.js +++ b/assets/SubmissionsDashboard-DQ0IgORY.js @@ -1,4 +1,4 @@ -import{c as ae,V as v,j as e,I as y,b as ne,q as H,a3 as re,x as oe,p as le,y as E,l as de,a$ as T,b0 as ce,b1 as ue,b2 as pe}from"./index-3CfcAX6N.js";import{u as W,r as me,e as he}from"./evaluationQueryInvalidation-BJCX6Q6o.js";import{i as X,a as K}from"./queryInvalidation-CO_YWd6U.js";import{u as D}from"./useMutation-CKC6OFhA.js";import{u as fe}from"./useInfiniteQuery-DYwUEaoz.js";import{c as C}from"./catalog-B47DuClX.js";import{s as xe}from"./safeExternalHref-CkBrsh84.js";import{E as O,s as I}from"./submissions-D-jwpMfI.js";import{p as je}from"./papers-BsYlGUQi.js";import{R as ge,C as ve}from"./refresh-cw-CwE-ezgN.js";import{L as $}from"./loader-circle-CMgZ_maE.js";import{C as be}from"./circle-check-D68ytty0.js";import"./curation-BZoIvsHD.js";/** +import{c as ae,V as v,j as e,I as y,b as ne,q as H,a3 as re,x as oe,p as le,y as E,l as de,a$ as T,b0 as ce,b1 as ue,b2 as pe}from"./index-CxhY4zQ1.js";import{u as W,r as me,e as he}from"./evaluationQueryInvalidation-PEtgmyxY.js";import{i as X,a as K}from"./queryInvalidation-Djot7Ix_.js";import{u as D}from"./useMutation-BzRfwboV.js";import{u as fe}from"./useInfiniteQuery-vHEhIVF_.js";import{c as C}from"./catalog-DCEU6WpP.js";import{s as xe}from"./safeExternalHref-CkBrsh84.js";import{E as O,s as I}from"./submissions-DF3SD1oA.js";import{p as je}from"./papers-BDxSKSYJ.js";import{R as ge,C as ve}from"./refresh-cw-Ddb6Y_kg.js";import{L as $}from"./loader-circle-C5gQxAlQ.js";import{C as be}from"./circle-check-CnqnwdL4.js";import"./curation-D2sqKAqC.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/SubmitView-Bsr4OUhJ.js b/assets/SubmitView-BUjda1b9.js similarity index 93% rename from assets/SubmitView-Bsr4OUhJ.js rename to assets/SubmitView-BUjda1b9.js index 1d77792f0f6a0ec19dedbe714c5fc6d794e4d35b..c2bf5c1e3d32da8974f06506aab079c3d92ba4bd 100644 --- a/assets/SubmitView-Bsr4OUhJ.js +++ b/assets/SubmitView-BUjda1b9.js @@ -1 +1 @@ -import{k as D,l as E,x as C,a as F,e as N,V as o,y as X,j as e,h as z}from"./index-3CfcAX6N.js";import{u as U}from"./useMutation-CKC6OFhA.js";import{A as O,a as V}from"./alert-BXZ4lnnf.js";import{B as P}from"./button-CbnaBx6W.js";import{I as h}from"./input-B7wcXhgG.js";import{T as q}from"./textarea-CdcMknzH.js";import{p as B}from"./papers-BsYlGUQi.js";import{a as H}from"./queryInvalidation-CO_YWd6U.js";import"./curation-BZoIvsHD.js";const S="pwc:paper-submit-draft",k={color:"var(--accent-text)",fontWeight:600,textDecoration:"underline",textUnderlineOffset:2},M=/^\d{4}\.\d{4,5}(v\d+)?$/i,J=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,W=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function R(l){const i=l.trim();return i?M.test(i)||J.test(i)||W.test(i)?"arxiv":/^https?:\/\//i.test(i)?"external":"arxiv":"empty"}function $(l,i){const r=l.trim();if(R(r)==="arxiv")return/^https?:\/\//i.test(r)?{source_url:r}:{arxiv_id:r};const s={source_url:r},p=i.title.trim();p&&(s.title=p);const d=i.abstract.trim();d&&(s.abstract=d);const n=i.authors.split(/[,\n]/).map(c=>c.trim()).filter(Boolean);return n.length>0&&(s.authors=n),i.datePublished&&(s.date_published=i.datePublished),s}const re=()=>{const l=D(),i=E(),{toast:r}=C(),{user:g,isLoading:s}=F(),[p]=N(),d=p.get("arxiv_id")??"",[n,c]=o.useState(d),[f,j]=o.useState(""),[x,w]=o.useState(""),[b,I]=o.useState(""),[v,_]=o.useState(""),[A,y]=o.useState(null);o.useEffect(()=>{if(d)return;const t=sessionStorage.getItem(S);if(t){sessionStorage.removeItem(S);try{const a=JSON.parse(t);c(a.input??""),j(a.title??""),w(a.abstract??""),I(a.authors??""),_(a.datePublished??"")}catch{}}},[d]);const m=R(n),L=m==="external",u=U({mutationFn:t=>B.submit(t),onSuccess:t=>{if(t.pending_review){r({title:"Submission queued for review",description:"No source page was fetched and no catalog row was changed."}),u.reset();return}H(i);const a=t.refreshed&&t.created&&t.latest_version;r({title:a?`Paper updated to ${t.latest_version}`:t.created?"Paper submitted":"Paper already indexed",description:a?"Opening the updated paper page…":t.created?"Opening the paper page…":"Opening the existing paper page…"}),t.route_identifier&&l(`/paper/${t.route_identifier}`)},onError:t=>{y(X(t,"Submission failed"))}}),T=t=>{if(t.preventDefault(),y(null),m==="empty"){y("Enter an arXiv ID or a paper URL to submit.");return}if(!g){sessionStorage.setItem(S,JSON.stringify({input:n,title:f,abstract:x,authors:b,datePublished:v})),window.location.assign(z(window.location.href));return}const a=$(n,{title:f,abstract:x,authors:b,datePublished:v});u.mutate(a)};return e.jsxs("div",{className:"page",style:{maxWidth:720},children:[e.jsx("h1",{className:"detail-title",children:"Submit a paper"}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:["If your paper is on arXiv, submit it on"," ",e.jsx("a",{href:"https://huggingface.co/papers/submit",target:"_blank",rel:"noopener noreferrer",style:k,children:"Hugging Face"}),", which will automatically index it on Papers with Code."]}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:["If your paper is not on arXiv, submit it here. Non-arXiv papers (blog posts, technical reports, model release pages) enter the submission queue and appear only after review."," ",e.jsx("a",{href:"/rate-limits",style:k,children:"Read the submission and rate-limit policy."})]}),e.jsxs("form",{onSubmit:T,style:{marginTop:28,display:"grid",gap:20},children:[e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-input",style:{fontWeight:600,fontSize:14},children:"arXiv ID or paper URL"}),e.jsx(h,{id:"submit-input",value:n,onChange:t=>c(t.target.value),placeholder:"2501.12345 · https://arxiv.org/abs/2501.12345 · https://blog.example.com/release",autoFocus:!0,required:!0}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)",minHeight:18},children:m==="arxiv"?"Detected: arXiv paper — metadata will be fetched automatically.":m==="external"?"Detected: external URL — we'll extract metadata and you can override below.":"Paste an arXiv ID like 2501.12345 or any paper/blog URL."})]}),L&&e.jsxs("fieldset",{style:{border:"1px solid var(--rule)",borderRadius:8,padding:"16px 20px 20px",display:"grid",gap:16},children:[e.jsx("legend",{style:{padding:"0 8px",fontSize:12,color:"var(--ink-soft)",textTransform:"uppercase",letterSpacing:.5},children:"External paper details (optional)"}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-title",style:{fontSize:13},children:"Title"}),e.jsx(h,{id:"submit-title",value:f,onChange:t=>j(t.target.value),placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-abstract",style:{fontSize:13},children:"Abstract or summary"}),e.jsx(q,{id:"submit-abstract",value:x,onChange:t=>w(t.target.value),rows:4,placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-authors",style:{fontSize:13},children:"Authors (comma-separated)"}),e.jsx(h,{id:"submit-authors",value:b,onChange:t=>I(t.target.value),placeholder:"Jane Smith, John Doe"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-date",style:{fontSize:13},children:"Publication date"}),e.jsx(h,{id:"submit-date",type:"date",value:v,onChange:t=>_(t.target.value),style:{maxWidth:220}}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)"},children:"Required only if we cannot infer a date from the page."})]})]}),A&&e.jsx(O,{variant:"destructive",children:e.jsx(V,{children:A})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(P,{type:"submit",disabled:u.isPending||s,children:s?"Checking sign-in…":u.isPending?"Submitting…":g?"Submit paper":"Sign in to submit"}),e.jsx(P,{type:"button",variant:"outline",onClick:()=>l(-1),disabled:u.isPending,children:"Cancel"})]})]})]})};export{re as default}; +import{k as D,l as E,x as C,a as F,e as N,V as o,y as X,j as e,h as z}from"./index-CxhY4zQ1.js";import{u as U}from"./useMutation-BzRfwboV.js";import{A as O,a as V}from"./alert-C-NbJX4N.js";import{B as P}from"./button-BenSiukP.js";import{I as h}from"./input-CxKbyH9e.js";import{T as q}from"./textarea-uttJnDhA.js";import{p as B}from"./papers-BDxSKSYJ.js";import{a as H}from"./queryInvalidation-Djot7Ix_.js";import"./curation-D2sqKAqC.js";const S="pwc:paper-submit-draft",k={color:"var(--accent-text)",fontWeight:600,textDecoration:"underline",textUnderlineOffset:2},M=/^\d{4}\.\d{4,5}(v\d+)?$/i,J=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,W=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function R(l){const i=l.trim();return i?M.test(i)||J.test(i)||W.test(i)?"arxiv":/^https?:\/\//i.test(i)?"external":"arxiv":"empty"}function $(l,i){const r=l.trim();if(R(r)==="arxiv")return/^https?:\/\//i.test(r)?{source_url:r}:{arxiv_id:r};const s={source_url:r},p=i.title.trim();p&&(s.title=p);const d=i.abstract.trim();d&&(s.abstract=d);const n=i.authors.split(/[,\n]/).map(c=>c.trim()).filter(Boolean);return n.length>0&&(s.authors=n),i.datePublished&&(s.date_published=i.datePublished),s}const re=()=>{const l=D(),i=E(),{toast:r}=C(),{user:g,isLoading:s}=F(),[p]=N(),d=p.get("arxiv_id")??"",[n,c]=o.useState(d),[f,j]=o.useState(""),[x,w]=o.useState(""),[b,I]=o.useState(""),[v,_]=o.useState(""),[A,y]=o.useState(null);o.useEffect(()=>{if(d)return;const t=sessionStorage.getItem(S);if(t){sessionStorage.removeItem(S);try{const a=JSON.parse(t);c(a.input??""),j(a.title??""),w(a.abstract??""),I(a.authors??""),_(a.datePublished??"")}catch{}}},[d]);const m=R(n),L=m==="external",u=U({mutationFn:t=>B.submit(t),onSuccess:t=>{if(t.pending_review){r({title:"Submission queued for review",description:"No source page was fetched and no catalog row was changed."}),u.reset();return}H(i);const a=t.refreshed&&t.created&&t.latest_version;r({title:a?`Paper updated to ${t.latest_version}`:t.created?"Paper submitted":"Paper already indexed",description:a?"Opening the updated paper page…":t.created?"Opening the paper page…":"Opening the existing paper page…"}),t.route_identifier&&l(`/paper/${t.route_identifier}`)},onError:t=>{y(X(t,"Submission failed"))}}),T=t=>{if(t.preventDefault(),y(null),m==="empty"){y("Enter an arXiv ID or a paper URL to submit.");return}if(!g){sessionStorage.setItem(S,JSON.stringify({input:n,title:f,abstract:x,authors:b,datePublished:v})),window.location.assign(z(window.location.href));return}const a=$(n,{title:f,abstract:x,authors:b,datePublished:v});u.mutate(a)};return e.jsxs("div",{className:"page",style:{maxWidth:720},children:[e.jsx("h1",{className:"detail-title",children:"Submit a paper"}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:["If your paper is on arXiv, submit it on"," ",e.jsx("a",{href:"https://huggingface.co/papers/submit",target:"_blank",rel:"noopener noreferrer",style:k,children:"Hugging Face"}),", which will automatically index it on Papers with Code."]}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:["If your paper is not on arXiv, submit it here. Non-arXiv papers (blog posts, technical reports, model release pages) enter the submission queue and appear only after review."," ",e.jsx("a",{href:"/rate-limits",style:k,children:"Read the submission and rate-limit policy."})]}),e.jsxs("form",{onSubmit:T,style:{marginTop:28,display:"grid",gap:20},children:[e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-input",style:{fontWeight:600,fontSize:14},children:"arXiv ID or paper URL"}),e.jsx(h,{id:"submit-input",value:n,onChange:t=>c(t.target.value),placeholder:"2501.12345 · https://arxiv.org/abs/2501.12345 · https://blog.example.com/release",autoFocus:!0,required:!0}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)",minHeight:18},children:m==="arxiv"?"Detected: arXiv paper — metadata will be fetched automatically.":m==="external"?"Detected: external URL — we'll extract metadata and you can override below.":"Paste an arXiv ID like 2501.12345 or any paper/blog URL."})]}),L&&e.jsxs("fieldset",{style:{border:"1px solid var(--rule)",borderRadius:8,padding:"16px 20px 20px",display:"grid",gap:16},children:[e.jsx("legend",{style:{padding:"0 8px",fontSize:12,color:"var(--ink-soft)",textTransform:"uppercase",letterSpacing:.5},children:"External paper details (optional)"}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-title",style:{fontSize:13},children:"Title"}),e.jsx(h,{id:"submit-title",value:f,onChange:t=>j(t.target.value),placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-abstract",style:{fontSize:13},children:"Abstract or summary"}),e.jsx(q,{id:"submit-abstract",value:x,onChange:t=>w(t.target.value),rows:4,placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-authors",style:{fontSize:13},children:"Authors (comma-separated)"}),e.jsx(h,{id:"submit-authors",value:b,onChange:t=>I(t.target.value),placeholder:"Jane Smith, John Doe"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-date",style:{fontSize:13},children:"Publication date"}),e.jsx(h,{id:"submit-date",type:"date",value:v,onChange:t=>_(t.target.value),style:{maxWidth:220}}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)"},children:"Required only if we cannot infer a date from the page."})]})]}),A&&e.jsx(O,{variant:"destructive",children:e.jsx(V,{children:A})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(P,{type:"submit",disabled:u.isPending||s,children:s?"Checking sign-in…":u.isPending?"Submitting…":g?"Submit paper":"Sign in to submit"}),e.jsx(P,{type:"button",variant:"outline",onClick:()=>l(-1),disabled:u.isPending,children:"Cancel"})]})]})]})};export{re as default}; diff --git a/assets/TagBrowseView-ZQj4XIo7.js b/assets/TagBrowseView-HXuz3Cu0.js similarity index 91% rename from assets/TagBrowseView-ZQj4XIo7.js rename to assets/TagBrowseView-HXuz3Cu0.js index f1e51842da586c9c21c5ffa3e33dd679f1e0ff5a..14f2c0f294b6bcdac89f362fa03f68e1ae39b151 100644 --- a/assets/TagBrowseView-ZQj4XIo7.js +++ b/assets/TagBrowseView-HXuz3Cu0.js @@ -1 +1 @@ -import{j as e,L as g,V as oe,u as de,k as me,f as j,b as G,p as he,a3 as pe,q as K,T as O}from"./index-3CfcAX6N.js";import{R as ue}from"./ResearchFollowButton-YEXlvC8K.js";import{M as ge}from"./SotaBadges-BqZMAXyY.js";import{u as be,b as xe,P as je}from"./PaperFeed-2dSUzcA2.js";import{A as L}from"./arrow-right-U4Mftc_z.js";import{B as ke}from"./BenchmarkTrendSparkline--hXPKyI4.js";import{M as W}from"./MarkdownText-BfMP6CxP.js";import{c as J}from"./catalog-B47DuClX.js";import{p as _e}from"./papers-BsYlGUQi.js";import{i as fe}from"./apiErrors-XoIVpN_S.js";import{f as Ne}from"./frameworks-DDA0P4Tf.js";import{u as we}from"./preferences-BmWwgggH.js";import{s as ve}from"./slug-BpH-Nkvz.js";import{d as N,t as ye}from"./transform-Dx-N8Yyj.js";import{u as Se}from"./usePapers-CHoHKyWP.js";import{S as P}from"./skeleton-CQbSjC3L.js";import{A as Te,a as Ee}from"./alert-BXZ4lnnf.js";import Be from"./NotFound-DXa9p6DX.js";import{T as $e}from"./trophy-BKn0k0Fw.js";import{G as Me}from"./github-vz0wxUgq.js";import"./researchTopic-Z4AJDMN7.js";import"./useMutation-CKC6OFhA.js";import"./plus-CiDEk52y.js";import"./colors-BkWRhvFI.js";import"./PaperCard-BZtXccuT.js";import"./AuthorAvatar-DYaYcwPm.js";import"./Icon-C0d9p4Q2.js";import"./LatexTitle-DvPeLepK.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-Dwe6SY1f.js";import"./useIntersectionObserver-wAZWG4G7.js";/* empty css */import"./PaperPreviewLink-BJAulcHJ.js";import"./index-DGr54pyn.js";import"./index-C8DcqbS3.js";import"./katex-DkKDou_j.js";import"./hover-card-DOKhkRf9.js";import"./curation-BZoIvsHD.js";import"./account-Ee9-ZosC.js";import"./useInfiniteQuery-DYwUEaoz.js";const Ce=()=>e.jsxs(g,{to:"/astra-for-robotics",className:"task-featured-collection","aria-label":"Featured collection: GPT-6 Astra for Robotics",children:[e.jsx("span",{className:"task-featured-collection-eyebrow",children:"Featured collection"}),e.jsx("strong",{children:"GPT-6 Astra for Robotics"}),e.jsx("span",{className:"task-featured-collection-description",children:"Papers and demos that put GPT-6 Astra in control of real and simulated robots, as the policy itself or as an agent orchestrating the stack."}),e.jsxs("span",{className:"task-featured-collection-meta",children:["Explore the collection",e.jsx(L,{size:14,"aria-hidden":"true"})]})]}),X=n=>{const c=n.match(/\(([^()]*)\)\s*$/);return c?c[1].split(",").map(d=>d.trim()).filter(Boolean):[]};function Fe(n,c){const d=X(n);if(c===void 0)return"standard";const i=new Set(X(c).map(l=>l.toLowerCase())),m=d.filter(l=>!i.has(l.toLowerCase()));return m.length?m.join(", "):n}function Ae(n,c){const d=new Map(n.map(l=>[l.id,l])),i=l=>{const x=new Set([l.id]);let k=l;for(;;){const w=c(k),_=w?d.get(w):void 0;if(!_)return k.id;if(x.has(_.id))return l.id;x.add(_.id),k=_}},m=new Map;return n.forEach(l=>{const x=i(l);m.set(x,[...m.get(x)||[],l])}),[...m].map(([l,x])=>({key:l,members:[d.get(l),...x.filter(k=>k.id!==l)]}))}const R=3,Pe=[{slug:"healthcare",eyebrow:"Clinical systems",title:"Clinical AI & Healthcare",description:"Agents, clinical workflows, medical calculators, safety, and decision support.",href:"#benchmarks"},{slug:"medical-question-answering",eyebrow:"Language & reasoning",title:"Medical Question Answering",description:"Medical exams, biomedical evidence, clinical comprehension, and explanations.",href:"/tasks/medical-question-answering"},{slug:"medical-imaging",eyebrow:"Vision",title:"Medical Imaging",description:"Radiology, pathology, ophthalmology, ultrasound, and diagnostic imaging.",href:"/tasks/medical-imaging"},{slug:"medical-visual-question-answering",eyebrow:"Multimodal",title:"Medical Visual Question Answering",description:"Questions grounded in radiology, pathology, and other biomedical images.",href:"/tasks/medical-visual-question-answering"}],Re=({frameworks:n})=>n.length===0?null:e.jsxs("div",{className:"task-framework-links",children:[e.jsx("span",{className:"task-framework-links-label",children:"Recommended frameworks"}),n.map(c=>e.jsxs(g,{to:`/papers?framework=${encodeURIComponent(c.framework_slug)}`,className:"task-framework-link",children:[e.jsx("span",{children:c.framework_name}),e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",Ne(c.num_stars)]})]},c.framework_id))]}),Le=({task:n,area:c,parents:d})=>e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(g,{to:"/tasks",children:"Tasks"}),c&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(g,{to:`/tasks#area-${ve(c.name)}`,children:c.name})]}),[...d].reverse().map(i=>e.jsxs(oe.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(g,{to:`/tasks/${i.slug||i.id}`,children:N(i.name,i.slug)})]},i.id)),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--accent-text)"},children:N(n.name,n.slug)})]}),Ie=({task:n,relatedTasks:c})=>{const d=new Map([n,...c].map(i=>[i.slug,i]));return e.jsxs("section",{className:"medical-ai-hub","aria-labelledby":"medical-ai-hub-title",children:[e.jsxs("div",{className:"medical-ai-hub-heading",children:[e.jsx("span",{children:"Medical AI directory"}),e.jsx("h2",{id:"medical-ai-hub-title",children:"Explore Healthcare & Medical AI"}),e.jsx("p",{children:"Browse the field by clinical application, language, vision, or multimodal reasoning."})]}),e.jsx("div",{className:"medical-ai-hub-grid",children:Pe.map(i=>{const m=d.get(i.slug),l=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"medical-ai-hub-card-eyebrow",children:i.eyebrow}),e.jsx("strong",{children:i.title}),e.jsx("span",{className:"medical-ai-hub-card-description",children:i.description}),e.jsxs("span",{className:"medical-ai-hub-card-meta",children:[(m==null?void 0:m.paper_count)!=null?`${m.paper_count.toLocaleString()} papers`:"Explore task",e.jsx(L,{size:14,"aria-hidden":"true"})]})]});return i.slug==="healthcare"?e.jsx("a",{href:i.href,className:"medical-ai-hub-card",children:l},i.slug):e.jsx(g,{to:i.href,className:"medical-ai-hub-card",children:l},i.slug)})})]})},qe=n=>[...n].sort((c,d)=>{const i=c.slug==="classic-language-modeling",m=d.slug==="classic-language-modeling";return i!==m?i?1:-1:0}),Ss=()=>{var V,z,U;const{taskSlug:n}=de(),c=me(),d=be(),{searchParams:i}=d,[m,l]=j.useState(!1),[x,k]=j.useState({}),[w,_]=j.useState(()=>new Set),{preferences:Y}=we(),E=(s,a)=>{const t=s||"";return a?`/benchmark/${t}?task=${encodeURIComponent(a)}`:`/benchmark/${t}`},v=Y.hide_closed_source_evals?!0:void 0,h=G({queryKey:[...K.taskPage,n,v],queryFn:()=>J.taskPage(n,{is_open:v}),enabled:!!n,staleTime:O});j.useEffect(()=>{var t;const s=(t=h.data)==null?void 0:t.task.slug;if(!n||!s||s===n)return;const a=i.toString();c(`/tasks/${s}${a?`?${a}`:""}`,{replace:!0})},[c,(V=h.data)==null?void 0:V.task.slug,i,n]);const I=G({queryKey:[...K.taskBenchmarkTrends,n,v],queryFn:()=>J.trendingBenchmarks(n,{limit:100,min_recent_papers:0,is_open:v}),enabled:!!n,staleTime:O}),y=j.useMemo(()=>{var s;return qe(((s=h.data)==null?void 0:s.children)||[])},[h.data]),B=j.useMemo(()=>{var a;const s=new Map;return(((a=h.data)==null?void 0:a.subtask_benchmarks)||[]).forEach(t=>{s.set(t.subtask_id,t.benchmarks||[])}),s},[h.data]),f=Se([...he.feeds.task,n,d.filters],s=>_e.forTask(n,{...d.filters,page:s,page_size:20,repository_limit:1}),{enabled:!!n}),Z=j.useMemo(()=>{var s;return((s=f.data)==null?void 0:s.pages.flatMap(a=>a.results.map(ye)))??[]},[f.data]),$=j.useMemo(()=>{var a;const s={};return(a=f.data)==null||a.pages.forEach(t=>t.results.forEach(b=>(b.methods||[]).forEach(u=>{const r=u.slug||u.id;s[r]||(s[r]={id:u.id,name:u.name,slug:u.slug||"",count:0}),s[r].count++}))),Object.values(s).sort((t,b)=>b.count-t.count).slice(0,8)},[f.data]);if(h.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(P,{className:"h-12 w-1/2 mb-4"}),e.jsx(P,{className:"h-6 w-1/3 mb-8"}),e.jsx(P,{className:"h-64 w-full"})]});if(fe(h.error))return e.jsx(Be,{});if(h.error||!h.data)return e.jsx("div",{className:"page",children:e.jsx(Te,{variant:"destructive",children:e.jsx(Ee,{children:"Task not found."})})});const o=h.data.task,ee=h.data.parents||[],M=N(o.name,o.slug),C=(h.data.sisters||[]).filter(s=>s.id!==o.id),se=h.data.recommended_frameworks||[],S=h.data.benchmarks||[],q=new Map(S.map(s=>[s.id,s])),ae=new Set(S.map(s=>s.id)),H=(((z=I.data)==null?void 0:z.results)||[]).filter(s=>ae.has(s.id)).map(s=>{const a=q.get(s.id);return{...s,best_model_name:(a==null?void 0:a.best_model_name)??s.best_model_name,best_paper_route:a==null?void 0:a.best_paper_route,best_paper_title:a==null?void 0:a.best_paper_title,best_code_url:a==null?void 0:a.best_code_url}}),F=H.length?H:S.map(s=>({id:s.id,name:s.name,slug:s.slug,full_name:s.full_name,recent_paper_count:0,baseline_paper_count:0,all_time_paper_count:s.paper_count||0,trend_score:0,support_weighted_score:0,rate_change:null,latest_reported_on:null,best_model_name:s.best_model_name,best_paper_route:s.best_paper_route,best_paper_title:s.best_paper_title,best_code_url:s.best_code_url,history:[]})),T=Ae(F,s=>{var a;return(a=q.get(s.id))==null?void 0:a.parent_dataset_id}),re=m?T:T.slice(0,5),ne=T.slice(5).reduce((s,a)=>s+a.members.length,0),Q=((U=I.data)==null?void 0:U.recent_days)||90,te=y.some(s=>(B.get(s.id)||[]).length>0),ie=y.length>0,D=F.length>0,ce=(()=>{const s=new Set;return S.forEach(a=>s.add(a.id)),B.forEach(a=>a.forEach(t=>s.add(t.id))),s.size})(),le=s=>{_(a=>{const t=new Set(a);return t.has(s)?t.delete(s):t.add(s),t})};return e.jsxs("div",{className:"page",children:[e.jsx(Le,{task:o,area:h.data.area,parents:ee}),e.jsxs("div",{className:o.image_url?`task-hero-grid${o.slug==="auto-research"?" task-hero-grid--wide":""}`: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:"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:M}),e.jsx(ue,{kind:"task",entityId:o.id}),o.description&&e.jsx(W,{className:"task-explainer",text:o.description}),e.jsxs("div",{className:"task-quickstats",children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:(o.paper_count??0).toLocaleString()}),"PAPERS"]}),e.jsxs("span",{children:[e.jsx("span",{className:"num",children:ce}),"BENCHMARKS"]}),e.jsxs("span",{children:[e.jsxs("span",{className:"num",children:[$.length,"+"]}),"METHODS USED"]})]}),e.jsx(Re,{frameworks:se})]}),o.image_url&&e.jsxs("figure",{className:`task-figure-card${o.slug==="omni-models"?" task-figure-card--compact":""}`,children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:pe(o.image_url)??void 0,alt:`${M} schematic`,onError:s=>{var a,t;(t=(a=s.currentTarget.parentElement)==null?void 0:a.parentElement)==null||t.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",M,o.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(W,{className:"task-image-credit",text:o.image_credit})]})]})]})]}),o.slug==="healthcare"&&e.jsx(Ie,{task:o,relatedTasks:C}),o.slug==="robotics"&&e.jsx(Ce,{}),e.jsxs("div",{className:"task-page-grid",style:{marginTop:28},children:[e.jsxs("div",{children:[D&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",id:"benchmarks",children:[e.jsxs("div",{className:"task-section-eyebrow",children:[Q,"-day reporting activity · select a benchmark"]}),e.jsxs("div",{className:"task-section-title",children:["Benchmarks ",e.jsxs("span",{className:"meta",children:["[",F.length,"]"]})]})]}),e.jsxs("div",{className:"benchmark-trend-table",role:"table","aria-label":"Trending benchmarks",children:[e.jsxs("div",{className:"benchmark-trend-head",role:"row",children:[e.jsx("span",{role:"columnheader",children:"Trend"}),e.jsx("span",{role:"columnheader",children:"Benchmark"}),e.jsx("span",{role:"columnheader",children:"Best model"}),e.jsx("span",{role:"columnheader",children:"Paper title"}),e.jsx("span",{role:"columnheader",children:"Code"}),e.jsx("span",{role:"columnheader",children:"Compare"})]}),re.map(({key:s,members:a})=>{const t=a[0],b=p=>p===t?"standard":Fe(p.name,t.name),u=[t,...a.slice(1).sort((p,A)=>b(p).localeCompare(b(A),void 0,{sensitivity:"base"}))],r=u.find(p=>p.id===x[s])??t;return e.jsxs("div",{className:"benchmark-trend-row",role:"row",children:[e.jsxs("div",{className:"benchmark-trend-cell",role:"cell",children:[e.jsx(ke,{history:r.history,benchmarkName:r.name}),e.jsxs("div",{className:"benchmark-trend-meta",children:[e.jsxs("span",{children:[e.jsx("strong",{children:r.recent_paper_count})," ",r.recent_paper_count===1?"paper":"papers"," /"," ",Q,"d"]}),r.rate_change==null?r.recent_paper_count>0&&e.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):e.jsxs("span",{className:`benchmark-trend-change ${r.rate_change>=1?"is-up":"is-down"}`,children:[r.rate_change>=1?"↑":"↓"," ",r.rate_change.toFixed(1),"×"]})]})]}),e.jsxs("div",{className:"benchmark-trend-benchmark",role:"cell",children:[e.jsx(g,{className:"bench-row-name",to:E(r.slug||r.id,n),children:r.name}),u.length>1&&e.jsx("div",{className:"bench-row-variants",role:"group","aria-label":`Evaluation protocols for ${t.name}`,children:u.map(p=>e.jsx("button",{type:"button",className:"bench-row-variant","aria-pressed":p.id===r.id,title:p.name,onClick:()=>k(A=>({...A,[s]:p.id})),children:b(p)},p.id))}),e.jsx("div",{className:"bench-row-sub",children:e.jsxs("span",{children:[e.jsx("strong",{children:r.all_time_paper_count})," reporting papers"]})})]}),e.jsx("div",{className:"bench-row-best",role:"cell",children:r.best_model_name?e.jsxs(e.Fragment,{children:[e.jsx($e,{size:13,className:"bench-row-best-icon"}),e.jsx("span",{className:"bench-row-best-name",children:r.best_model_name})]}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-paper",role:"cell",children:r.best_paper_route&&r.best_paper_title?e.jsx(g,{to:`/paper/${encodeURIComponent(r.best_paper_route)}`,children:r.best_paper_title}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-code",role:"cell",children:r.best_code_url?e.jsx("a",{href:r.best_code_url,target:"_blank",rel:"noopener noreferrer","aria-label":`Code for ${r.best_paper_title||r.best_model_name}`,children:e.jsx(Me,{size:18,strokeWidth:1.8,"aria-hidden":"true"})}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-compare",role:"cell",children:e.jsxs(g,{to:E(r.slug||r.id,n),"aria-label":`Compare ${r.best_model_name||"the best model"} with all results on ${r.name}`,children:[e.jsx("span",{children:"See all"}),e.jsx(L,{size:11,strokeWidth:2,"aria-hidden":"true"})]})})]},s)})]}),T.length>5&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>l(s=>!s),children:m?"− show top 5":`+ show ${ne} more benchmarks`})]}),ie&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",style:D?{marginTop:36}:void 0,children:[e.jsx("div",{className:"task-section-eyebrow",children:te?"Benchmarks by capability":"Task hierarchy"}),e.jsxs("div",{className:"task-section-title",children:["Subtasks ",e.jsxs("span",{className:"meta",children:["[",y.length,"]"]})]})]}),e.jsx("div",{className:"subtask-grid",children:y.map(s=>{const a=B.get(s.id)||[],t=w.has(s.id),b=t?a:a.slice(0,R),u=a.length-R;return e.jsxs("div",{className:"subtask-section",children:[e.jsxs("div",{className:"subtask-head",children:[e.jsx(g,{to:`/tasks/${s.slug||s.id}`,className:"subtask-head-name",children:N(s.name,s.slug)}),e.jsx("span",{className:"subtask-head-meta",children:a.length>0?`[${a.length} benchmark${a.length===1?"":"s"}]`:`[${(s.paper_count??0).toLocaleString()} papers]`})]}),b.length>0?b.map((r,p)=>e.jsxs("div",{className:"bench-row",onClick:()=>c(E(r.slug||r.id,s.slug||s.id)),children:[e.jsx("div",{className:"bench-row-num",children:String(p+1).padStart(2,"0")}),e.jsxs("div",{className:"bench-row-main",children:[e.jsx("div",{className:"bench-row-name",children:r.name}),e.jsx("div",{className:"bench-row-sub",children:r.paper_count!=null&&e.jsxs("span",{children:[e.jsx("strong",{children:r.paper_count})," ENTRIES"]})})]}),e.jsx("div",{className:"bench-row-arrow",children:"→"})]},r.id)):e.jsxs(g,{to:`/tasks/${s.slug||s.id}`,className:"subtask-summary",children:[e.jsxs("span",{children:[(s.paper_count??0).toLocaleString()," papers"]}),s.description&&e.jsx("span",{className:"subtask-summary-desc",children:s.description})]}),u>0&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>le(s.id),children:t?`− show top ${R}`:`+ show ${u} more benchmark${u===1?"":"s"}`})]},s.id)})})]}),e.jsxs("div",{className:"task-section-head",style:{marginTop:36},children:[e.jsx("div",{className:"task-section-eyebrow",children:"Top trending · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",(o.paper_count??0).toLocaleString(),"]"]})]})]}),e.jsx(xe,{feed:d}),e.jsx(je,{query:f,cards:Z,empty:"No papers in this task yet."})]}),e.jsxs("aside",{className:"task-side",children:[C.length>0&&o.slug!=="healthcare"&&e.jsxs("div",{className:"side-block",children:[e.jsx("div",{className:"side-block-num",children:"01/"}),e.jsx("div",{className:"side-block-label",children:"Sister Tasks"}),C.slice(0,8).map(s=>e.jsxs(g,{to:`/tasks/${s.slug||s.id}`,className:"side-link-row",children:[e.jsx("span",{children:N(s.name,s.slug)}),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count.toLocaleString()})]},s.id))]}),$.length>0&&e.jsxs("div",{className:"side-block",children:[e.jsx("div",{className:"side-block-num",children:"02/"}),e.jsx("div",{className:"side-block-label",children:"Common Methods"}),$.map(s=>e.jsxs("div",{className:"side-method-row",children:[e.jsx(ge,{method:{slug:s.slug,name:s.name}}),e.jsxs("span",{className:"num",children:["·",s.count]})]},s.id))]})]})]})]})};export{Ie as HealthcareMedicalAiHub,Re as RecommendedFrameworkLinks,Le as TaskBreadcrumb,Ss as default}; +import{j as e,L as g,V as oe,u as de,k as me,f as j,b as G,p as he,a3 as pe,q as K,T as O}from"./index-CxhY4zQ1.js";import{R as ue}from"./ResearchFollowButton-DPFVPZ0U.js";import{M as ge}from"./SotaBadges-EnDhSaVO.js";import{u as be,b as xe,P as je}from"./PaperFeed-D1egUlu_.js";import{A as L}from"./arrow-right-BwBMsu3P.js";import{B as ke}from"./BenchmarkTrendSparkline-daMK8XXD.js";import{M as W}from"./MarkdownText-D0WkOxKi.js";import{c as J}from"./catalog-DCEU6WpP.js";import{p as _e}from"./papers-BDxSKSYJ.js";import{i as fe}from"./apiErrors-D2bSY3Dq.js";import{f as Ne}from"./frameworks-DDA0P4Tf.js";import{u as we}from"./preferences-CUy01zEm.js";import{s as ve}from"./slug-BpH-Nkvz.js";import{d as N,t as ye}from"./transform-DehuZQh7.js";import{u as Se}from"./usePapers-Cv13R7ph.js";import{S as P}from"./skeleton-DdKViE4r.js";import{A as Te,a as Ee}from"./alert-C-NbJX4N.js";import Be from"./NotFound-BeRulOFd.js";import{T as $e}from"./trophy-BVERRwS-.js";import{G as Me}from"./github-Bv102r_G.js";import"./researchTopic-DXZVIvAq.js";import"./useMutation-BzRfwboV.js";import"./plus-CEkdlNSn.js";import"./colors-BkWRhvFI.js";import"./PaperCard-DeWmBrg8.js";import"./AuthorAvatar-DPz8YQ5Z.js";import"./Icon-XOOkUEUX.js";import"./LatexTitle-BqNrCKu8.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-DgW_tN02.js";import"./useIntersectionObserver-ZqjUJuPc.js";/* empty css */import"./PaperPreviewLink-Y2LI3xZW.js";import"./index-BCjs92mB.js";import"./index-mv_8ovfA.js";import"./katex-DkKDou_j.js";import"./hover-card-CqKeZcpY.js";import"./curation-D2sqKAqC.js";import"./account-Bplq3u-8.js";import"./useInfiniteQuery-vHEhIVF_.js";const Ce=()=>e.jsxs(g,{to:"/astra-for-robotics",className:"task-featured-collection","aria-label":"Featured collection: GPT-6 Astra for Robotics",children:[e.jsx("span",{className:"task-featured-collection-eyebrow",children:"Featured collection"}),e.jsx("strong",{children:"GPT-6 Astra for Robotics"}),e.jsx("span",{className:"task-featured-collection-description",children:"Papers and demos that put GPT-6 Astra in control of real and simulated robots, as the policy itself or as an agent orchestrating the stack."}),e.jsxs("span",{className:"task-featured-collection-meta",children:["Explore the collection",e.jsx(L,{size:14,"aria-hidden":"true"})]})]}),X=n=>{const c=n.match(/\(([^()]*)\)\s*$/);return c?c[1].split(",").map(d=>d.trim()).filter(Boolean):[]};function Fe(n,c){const d=X(n);if(c===void 0)return"standard";const i=new Set(X(c).map(l=>l.toLowerCase())),m=d.filter(l=>!i.has(l.toLowerCase()));return m.length?m.join(", "):n}function Ae(n,c){const d=new Map(n.map(l=>[l.id,l])),i=l=>{const x=new Set([l.id]);let k=l;for(;;){const w=c(k),_=w?d.get(w):void 0;if(!_)return k.id;if(x.has(_.id))return l.id;x.add(_.id),k=_}},m=new Map;return n.forEach(l=>{const x=i(l);m.set(x,[...m.get(x)||[],l])}),[...m].map(([l,x])=>({key:l,members:[d.get(l),...x.filter(k=>k.id!==l)]}))}const R=3,Pe=[{slug:"healthcare",eyebrow:"Clinical systems",title:"Clinical AI & Healthcare",description:"Agents, clinical workflows, medical calculators, safety, and decision support.",href:"#benchmarks"},{slug:"medical-question-answering",eyebrow:"Language & reasoning",title:"Medical Question Answering",description:"Medical exams, biomedical evidence, clinical comprehension, and explanations.",href:"/tasks/medical-question-answering"},{slug:"medical-imaging",eyebrow:"Vision",title:"Medical Imaging",description:"Radiology, pathology, ophthalmology, ultrasound, and diagnostic imaging.",href:"/tasks/medical-imaging"},{slug:"medical-visual-question-answering",eyebrow:"Multimodal",title:"Medical Visual Question Answering",description:"Questions grounded in radiology, pathology, and other biomedical images.",href:"/tasks/medical-visual-question-answering"}],Re=({frameworks:n})=>n.length===0?null:e.jsxs("div",{className:"task-framework-links",children:[e.jsx("span",{className:"task-framework-links-label",children:"Recommended frameworks"}),n.map(c=>e.jsxs(g,{to:`/papers?framework=${encodeURIComponent(c.framework_slug)}`,className:"task-framework-link",children:[e.jsx("span",{children:c.framework_name}),e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",Ne(c.num_stars)]})]},c.framework_id))]}),Le=({task:n,area:c,parents:d})=>e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(g,{to:"/tasks",children:"Tasks"}),c&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(g,{to:`/tasks#area-${ve(c.name)}`,children:c.name})]}),[...d].reverse().map(i=>e.jsxs(oe.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(g,{to:`/tasks/${i.slug||i.id}`,children:N(i.name,i.slug)})]},i.id)),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--accent-text)"},children:N(n.name,n.slug)})]}),Ie=({task:n,relatedTasks:c})=>{const d=new Map([n,...c].map(i=>[i.slug,i]));return e.jsxs("section",{className:"medical-ai-hub","aria-labelledby":"medical-ai-hub-title",children:[e.jsxs("div",{className:"medical-ai-hub-heading",children:[e.jsx("span",{children:"Medical AI directory"}),e.jsx("h2",{id:"medical-ai-hub-title",children:"Explore Healthcare & Medical AI"}),e.jsx("p",{children:"Browse the field by clinical application, language, vision, or multimodal reasoning."})]}),e.jsx("div",{className:"medical-ai-hub-grid",children:Pe.map(i=>{const m=d.get(i.slug),l=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"medical-ai-hub-card-eyebrow",children:i.eyebrow}),e.jsx("strong",{children:i.title}),e.jsx("span",{className:"medical-ai-hub-card-description",children:i.description}),e.jsxs("span",{className:"medical-ai-hub-card-meta",children:[(m==null?void 0:m.paper_count)!=null?`${m.paper_count.toLocaleString()} papers`:"Explore task",e.jsx(L,{size:14,"aria-hidden":"true"})]})]});return i.slug==="healthcare"?e.jsx("a",{href:i.href,className:"medical-ai-hub-card",children:l},i.slug):e.jsx(g,{to:i.href,className:"medical-ai-hub-card",children:l},i.slug)})})]})},qe=n=>[...n].sort((c,d)=>{const i=c.slug==="classic-language-modeling",m=d.slug==="classic-language-modeling";return i!==m?i?1:-1:0}),Ss=()=>{var V,z,U;const{taskSlug:n}=de(),c=me(),d=be(),{searchParams:i}=d,[m,l]=j.useState(!1),[x,k]=j.useState({}),[w,_]=j.useState(()=>new Set),{preferences:Y}=we(),E=(s,a)=>{const t=s||"";return a?`/benchmark/${t}?task=${encodeURIComponent(a)}`:`/benchmark/${t}`},v=Y.hide_closed_source_evals?!0:void 0,h=G({queryKey:[...K.taskPage,n,v],queryFn:()=>J.taskPage(n,{is_open:v}),enabled:!!n,staleTime:O});j.useEffect(()=>{var t;const s=(t=h.data)==null?void 0:t.task.slug;if(!n||!s||s===n)return;const a=i.toString();c(`/tasks/${s}${a?`?${a}`:""}`,{replace:!0})},[c,(V=h.data)==null?void 0:V.task.slug,i,n]);const I=G({queryKey:[...K.taskBenchmarkTrends,n,v],queryFn:()=>J.trendingBenchmarks(n,{limit:100,min_recent_papers:0,is_open:v}),enabled:!!n,staleTime:O}),y=j.useMemo(()=>{var s;return qe(((s=h.data)==null?void 0:s.children)||[])},[h.data]),B=j.useMemo(()=>{var a;const s=new Map;return(((a=h.data)==null?void 0:a.subtask_benchmarks)||[]).forEach(t=>{s.set(t.subtask_id,t.benchmarks||[])}),s},[h.data]),f=Se([...he.feeds.task,n,d.filters],s=>_e.forTask(n,{...d.filters,page:s,page_size:20,repository_limit:1}),{enabled:!!n}),Z=j.useMemo(()=>{var s;return((s=f.data)==null?void 0:s.pages.flatMap(a=>a.results.map(ye)))??[]},[f.data]),$=j.useMemo(()=>{var a;const s={};return(a=f.data)==null||a.pages.forEach(t=>t.results.forEach(b=>(b.methods||[]).forEach(u=>{const r=u.slug||u.id;s[r]||(s[r]={id:u.id,name:u.name,slug:u.slug||"",count:0}),s[r].count++}))),Object.values(s).sort((t,b)=>b.count-t.count).slice(0,8)},[f.data]);if(h.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(P,{className:"h-12 w-1/2 mb-4"}),e.jsx(P,{className:"h-6 w-1/3 mb-8"}),e.jsx(P,{className:"h-64 w-full"})]});if(fe(h.error))return e.jsx(Be,{});if(h.error||!h.data)return e.jsx("div",{className:"page",children:e.jsx(Te,{variant:"destructive",children:e.jsx(Ee,{children:"Task not found."})})});const o=h.data.task,ee=h.data.parents||[],M=N(o.name,o.slug),C=(h.data.sisters||[]).filter(s=>s.id!==o.id),se=h.data.recommended_frameworks||[],S=h.data.benchmarks||[],q=new Map(S.map(s=>[s.id,s])),ae=new Set(S.map(s=>s.id)),H=(((z=I.data)==null?void 0:z.results)||[]).filter(s=>ae.has(s.id)).map(s=>{const a=q.get(s.id);return{...s,best_model_name:(a==null?void 0:a.best_model_name)??s.best_model_name,best_paper_route:a==null?void 0:a.best_paper_route,best_paper_title:a==null?void 0:a.best_paper_title,best_code_url:a==null?void 0:a.best_code_url}}),F=H.length?H:S.map(s=>({id:s.id,name:s.name,slug:s.slug,full_name:s.full_name,recent_paper_count:0,baseline_paper_count:0,all_time_paper_count:s.paper_count||0,trend_score:0,support_weighted_score:0,rate_change:null,latest_reported_on:null,best_model_name:s.best_model_name,best_paper_route:s.best_paper_route,best_paper_title:s.best_paper_title,best_code_url:s.best_code_url,history:[]})),T=Ae(F,s=>{var a;return(a=q.get(s.id))==null?void 0:a.parent_dataset_id}),re=m?T:T.slice(0,5),ne=T.slice(5).reduce((s,a)=>s+a.members.length,0),Q=((U=I.data)==null?void 0:U.recent_days)||90,te=y.some(s=>(B.get(s.id)||[]).length>0),ie=y.length>0,D=F.length>0,ce=(()=>{const s=new Set;return S.forEach(a=>s.add(a.id)),B.forEach(a=>a.forEach(t=>s.add(t.id))),s.size})(),le=s=>{_(a=>{const t=new Set(a);return t.has(s)?t.delete(s):t.add(s),t})};return e.jsxs("div",{className:"page",children:[e.jsx(Le,{task:o,area:h.data.area,parents:ee}),e.jsxs("div",{className:o.image_url?`task-hero-grid${o.slug==="auto-research"?" task-hero-grid--wide":""}`: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:"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:M}),e.jsx(ue,{kind:"task",entityId:o.id}),o.description&&e.jsx(W,{className:"task-explainer",text:o.description}),e.jsxs("div",{className:"task-quickstats",children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:(o.paper_count??0).toLocaleString()}),"PAPERS"]}),e.jsxs("span",{children:[e.jsx("span",{className:"num",children:ce}),"BENCHMARKS"]}),e.jsxs("span",{children:[e.jsxs("span",{className:"num",children:[$.length,"+"]}),"METHODS USED"]})]}),e.jsx(Re,{frameworks:se})]}),o.image_url&&e.jsxs("figure",{className:`task-figure-card${o.slug==="omni-models"?" task-figure-card--compact":""}`,children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:pe(o.image_url)??void 0,alt:`${M} schematic`,onError:s=>{var a,t;(t=(a=s.currentTarget.parentElement)==null?void 0:a.parentElement)==null||t.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",M,o.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(W,{className:"task-image-credit",text:o.image_credit})]})]})]})]}),o.slug==="healthcare"&&e.jsx(Ie,{task:o,relatedTasks:C}),o.slug==="robotics"&&e.jsx(Ce,{}),e.jsxs("div",{className:"task-page-grid",style:{marginTop:28},children:[e.jsxs("div",{children:[D&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",id:"benchmarks",children:[e.jsxs("div",{className:"task-section-eyebrow",children:[Q,"-day reporting activity · select a benchmark"]}),e.jsxs("div",{className:"task-section-title",children:["Benchmarks ",e.jsxs("span",{className:"meta",children:["[",F.length,"]"]})]})]}),e.jsxs("div",{className:"benchmark-trend-table",role:"table","aria-label":"Trending benchmarks",children:[e.jsxs("div",{className:"benchmark-trend-head",role:"row",children:[e.jsx("span",{role:"columnheader",children:"Trend"}),e.jsx("span",{role:"columnheader",children:"Benchmark"}),e.jsx("span",{role:"columnheader",children:"Best model"}),e.jsx("span",{role:"columnheader",children:"Paper title"}),e.jsx("span",{role:"columnheader",children:"Code"}),e.jsx("span",{role:"columnheader",children:"Compare"})]}),re.map(({key:s,members:a})=>{const t=a[0],b=p=>p===t?"standard":Fe(p.name,t.name),u=[t,...a.slice(1).sort((p,A)=>b(p).localeCompare(b(A),void 0,{sensitivity:"base"}))],r=u.find(p=>p.id===x[s])??t;return e.jsxs("div",{className:"benchmark-trend-row",role:"row",children:[e.jsxs("div",{className:"benchmark-trend-cell",role:"cell",children:[e.jsx(ke,{history:r.history,benchmarkName:r.name}),e.jsxs("div",{className:"benchmark-trend-meta",children:[e.jsxs("span",{children:[e.jsx("strong",{children:r.recent_paper_count})," ",r.recent_paper_count===1?"paper":"papers"," /"," ",Q,"d"]}),r.rate_change==null?r.recent_paper_count>0&&e.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):e.jsxs("span",{className:`benchmark-trend-change ${r.rate_change>=1?"is-up":"is-down"}`,children:[r.rate_change>=1?"↑":"↓"," ",r.rate_change.toFixed(1),"×"]})]})]}),e.jsxs("div",{className:"benchmark-trend-benchmark",role:"cell",children:[e.jsx(g,{className:"bench-row-name",to:E(r.slug||r.id,n),children:r.name}),u.length>1&&e.jsx("div",{className:"bench-row-variants",role:"group","aria-label":`Evaluation protocols for ${t.name}`,children:u.map(p=>e.jsx("button",{type:"button",className:"bench-row-variant","aria-pressed":p.id===r.id,title:p.name,onClick:()=>k(A=>({...A,[s]:p.id})),children:b(p)},p.id))}),e.jsx("div",{className:"bench-row-sub",children:e.jsxs("span",{children:[e.jsx("strong",{children:r.all_time_paper_count})," reporting papers"]})})]}),e.jsx("div",{className:"bench-row-best",role:"cell",children:r.best_model_name?e.jsxs(e.Fragment,{children:[e.jsx($e,{size:13,className:"bench-row-best-icon"}),e.jsx("span",{className:"bench-row-best-name",children:r.best_model_name})]}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-paper",role:"cell",children:r.best_paper_route&&r.best_paper_title?e.jsx(g,{to:`/paper/${encodeURIComponent(r.best_paper_route)}`,children:r.best_paper_title}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-code",role:"cell",children:r.best_code_url?e.jsx("a",{href:r.best_code_url,target:"_blank",rel:"noopener noreferrer","aria-label":`Code for ${r.best_paper_title||r.best_model_name}`,children:e.jsx(Me,{size:18,strokeWidth:1.8,"aria-hidden":"true"})}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-compare",role:"cell",children:e.jsxs(g,{to:E(r.slug||r.id,n),"aria-label":`Compare ${r.best_model_name||"the best model"} with all results on ${r.name}`,children:[e.jsx("span",{children:"See all"}),e.jsx(L,{size:11,strokeWidth:2,"aria-hidden":"true"})]})})]},s)})]}),T.length>5&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>l(s=>!s),children:m?"− show top 5":`+ show ${ne} more benchmarks`})]}),ie&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",style:D?{marginTop:36}:void 0,children:[e.jsx("div",{className:"task-section-eyebrow",children:te?"Benchmarks by capability":"Task hierarchy"}),e.jsxs("div",{className:"task-section-title",children:["Subtasks ",e.jsxs("span",{className:"meta",children:["[",y.length,"]"]})]})]}),e.jsx("div",{className:"subtask-grid",children:y.map(s=>{const a=B.get(s.id)||[],t=w.has(s.id),b=t?a:a.slice(0,R),u=a.length-R;return e.jsxs("div",{className:"subtask-section",children:[e.jsxs("div",{className:"subtask-head",children:[e.jsx(g,{to:`/tasks/${s.slug||s.id}`,className:"subtask-head-name",children:N(s.name,s.slug)}),e.jsx("span",{className:"subtask-head-meta",children:a.length>0?`[${a.length} benchmark${a.length===1?"":"s"}]`:`[${(s.paper_count??0).toLocaleString()} papers]`})]}),b.length>0?b.map((r,p)=>e.jsxs("div",{className:"bench-row",onClick:()=>c(E(r.slug||r.id,s.slug||s.id)),children:[e.jsx("div",{className:"bench-row-num",children:String(p+1).padStart(2,"0")}),e.jsxs("div",{className:"bench-row-main",children:[e.jsx("div",{className:"bench-row-name",children:r.name}),e.jsx("div",{className:"bench-row-sub",children:r.paper_count!=null&&e.jsxs("span",{children:[e.jsx("strong",{children:r.paper_count})," ENTRIES"]})})]}),e.jsx("div",{className:"bench-row-arrow",children:"→"})]},r.id)):e.jsxs(g,{to:`/tasks/${s.slug||s.id}`,className:"subtask-summary",children:[e.jsxs("span",{children:[(s.paper_count??0).toLocaleString()," papers"]}),s.description&&e.jsx("span",{className:"subtask-summary-desc",children:s.description})]}),u>0&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>le(s.id),children:t?`− show top ${R}`:`+ show ${u} more benchmark${u===1?"":"s"}`})]},s.id)})})]}),e.jsxs("div",{className:"task-section-head",style:{marginTop:36},children:[e.jsx("div",{className:"task-section-eyebrow",children:"Top trending · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",(o.paper_count??0).toLocaleString(),"]"]})]})]}),e.jsx(xe,{feed:d}),e.jsx(je,{query:f,cards:Z,empty:"No papers in this task yet."})]}),e.jsxs("aside",{className:"task-side",children:[C.length>0&&o.slug!=="healthcare"&&e.jsxs("div",{className:"side-block",children:[e.jsx("div",{className:"side-block-num",children:"01/"}),e.jsx("div",{className:"side-block-label",children:"Sister Tasks"}),C.slice(0,8).map(s=>e.jsxs(g,{to:`/tasks/${s.slug||s.id}`,className:"side-link-row",children:[e.jsx("span",{children:N(s.name,s.slug)}),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count.toLocaleString()})]},s.id))]}),$.length>0&&e.jsxs("div",{className:"side-block",children:[e.jsx("div",{className:"side-block-num",children:"02/"}),e.jsx("div",{className:"side-block-label",children:"Common Methods"}),$.map(s=>e.jsxs("div",{className:"side-method-row",children:[e.jsx(ge,{method:{slug:s.slug,name:s.name}}),e.jsxs("span",{className:"num",children:["·",s.count]})]},s.id))]})]})]})]})};export{Ie as HealthcareMedicalAiHub,Re as RecommendedFrameworkLinks,Le as TaskBreadcrumb,Ss as default}; diff --git a/assets/TagsIndexView-ChN-5wyU.js b/assets/TagsIndexView-DiKdGZx0.js similarity index 97% rename from assets/TagsIndexView-ChN-5wyU.js rename to assets/TagsIndexView-DiKdGZx0.js index a5734ea739cb1d79f4d1d85d9ec9cbb25a5f139a..e8760fd322b3830958039118616d28cc9d18ee90 100644 --- a/assets/TagsIndexView-ChN-5wyU.js +++ b/assets/TagsIndexView-DiKdGZx0.js @@ -1,4 +1,4 @@ -import{c as e,b as s,f as g,j as a,L as z,q as j,T as p}from"./index-3CfcAX6N.js";import{c as k}from"./catalog-B47DuClX.js";import{c as v,h as u}from"./colors-BkWRhvFI.js";import{d as f}from"./transform-Dx-N8Yyj.js";import{s as S}from"./slug-BpH-Nkvz.js";import{S as L}from"./search-SnOvJVk_.js";import{I as C,T as V}from"./triangle-alert-UGq54fwL.js";import{S as A}from"./share-2-CvYRtEqg.js";import{T as H}from"./trending-up-BcVfaomA.js";import{M as T}from"./moon-DWTtiCFw.js";import{T as F}from"./thumbs-up-BMfH8ZZ-.js";import{D as Z}from"./database-ut7m-SnN.js";import{L as B}from"./link-2-D0J2rv3E.js";import{T as P}from"./trophy-BKn0k0Fw.js";import{F as N}from"./file-text-BnjsSheU.js";import{A as D}from"./activity-HTMf27Bb.js";import{G as E}from"./globe-DZ-1g_DI.js";import{S as _}from"./sparkles-BY8EsDI7.js";import{A as G,a as I}from"./alert-BXZ4lnnf.js";import{A as U,a as W,b as Q}from"./AreaSection-Dzw2ZfXP.js";import{T as R}from"./TaxonomySuggestionTile-CvpdGHs9.js";import{u as $,T as K}from"./useHashScrollOnReady-DNNLLOuJ.js";import{s as O}from"./areas-Dvi8w2dp.js";import"./skeleton-CQbSjC3L.js";import"./SignInToEditDialog-P5ytZJBG.js";import"./button-CbnaBx6W.js";import"./input-B7wcXhgG.js";import"./textarea-CdcMknzH.js";import"./searchable-select-DBlreWDS.js";import"./popover-Dwe6SY1f.js";import"./dialog-Bbx5GVcy.js";import"./loader-circle-CMgZ_maE.js";import"./useMutation-CKC6OFhA.js";import"./submissions-D-jwpMfI.js";import"./plus-CiDEk52y.js";/** +import{c as e,b as s,f as g,j as a,L as z,q as j,T as p}from"./index-CxhY4zQ1.js";import{c as k}from"./catalog-DCEU6WpP.js";import{c as v,h as u}from"./colors-BkWRhvFI.js";import{d as f}from"./transform-DehuZQh7.js";import{s as S}from"./slug-BpH-Nkvz.js";import{S as L}from"./search-CkWMhIw6.js";import{I as C,T as V}from"./triangle-alert-BCFuWBBz.js";import{S as A}from"./share-2-LsSZFLYg.js";import{T as H}from"./trending-up-BaROX4bP.js";import{M as T}from"./moon-D6Y7BLS4.js";import{T as F}from"./thumbs-up-DP1Ac3Tb.js";import{D as Z}from"./database-DTsYk9y1.js";import{L as B}from"./link-2-CyUnfeFP.js";import{T as P}from"./trophy-BVERRwS-.js";import{F as N}from"./file-text-42n3m1yn.js";import{A as D}from"./activity-bP8ilshD.js";import{G as E}from"./globe-DIhafOmF.js";import{S as _}from"./sparkles-CBme4WI-.js";import{A as G,a as I}from"./alert-C-NbJX4N.js";import{A as U,a as W,b as Q}from"./AreaSection-B21Mp4br.js";import{T as R}from"./TaxonomySuggestionTile-Ch_m5AUx.js";import{u as $,T as K}from"./useHashScrollOnReady-KPtO6vdP.js";import{s as O}from"./areas-Dvi8w2dp.js";import"./skeleton-DdKViE4r.js";import"./SignInToEditDialog-0W7FFwc1.js";import"./button-BenSiukP.js";import"./input-CxKbyH9e.js";import"./textarea-uttJnDhA.js";import"./searchable-select-hPIpmCr4.js";import"./popover-DgW_tN02.js";import"./dialog-CT48f48_.js";import"./loader-circle-C5gQxAlQ.js";import"./useMutation-BzRfwboV.js";import"./submissions-DF3SD1oA.js";import"./plus-CEkdlNSn.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/TaxonomySuggestionTile-CvpdGHs9.js b/assets/TaxonomySuggestionTile-Ch_m5AUx.js similarity index 76% rename from assets/TaxonomySuggestionTile-CvpdGHs9.js rename to assets/TaxonomySuggestionTile-Ch_m5AUx.js index 844dd3397a6288220248eef94c21681fdbbcb8ab..8fc3371aabeaab1c43b9e793c3fb65484c42db99 100644 --- a/assets/TaxonomySuggestionTile-CvpdGHs9.js +++ b/assets/TaxonomySuggestionTile-Ch_m5AUx.js @@ -1 +1 @@ -import{a as u,f as t,j as e}from"./index-3CfcAX6N.js";import{S as c,a as m}from"./SignInToEditDialog-P5ytZJBG.js";import{P as p}from"./plus-CiDEk52y.js";function f({kind:s}){const{user:a}=u(),[i,n]=t.useState(!1),[l,o]=t.useState(!1),r=`Suggest a new ${s}...`,g=()=>{a?n(!0):o(!0)};return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"tag-cell taxonomy-suggestion-cell",onClick:g,children:[e.jsxs("div",{className:"name",children:[e.jsx(p,{className:"taxonomy-suggestion-icon","aria-hidden":"true"}),r]}),e.jsx("div",{className:"meta",children:e.jsx("span",{children:"Propose an addition"})})]}),e.jsx(c,{open:i,onOpenChange:n,kind:s}),e.jsx(m,{open:l,onOpenChange:o,sectionLabel:`${s}s`,returnTo:typeof window<"u"?window.location.pathname:`/${s}s`,taxonomySuggestion:!0})]})}export{f as T}; +import{a as u,f as t,j as e}from"./index-CxhY4zQ1.js";import{S as c,a as m}from"./SignInToEditDialog-0W7FFwc1.js";import{P as p}from"./plus-CEkdlNSn.js";function f({kind:s}){const{user:a}=u(),[i,n]=t.useState(!1),[l,o]=t.useState(!1),r=`Suggest a new ${s}...`,g=()=>{a?n(!0):o(!0)};return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"tag-cell taxonomy-suggestion-cell",onClick:g,children:[e.jsxs("div",{className:"name",children:[e.jsx(p,{className:"taxonomy-suggestion-icon","aria-hidden":"true"}),r]}),e.jsx("div",{className:"meta",children:e.jsx("span",{children:"Propose an addition"})})]}),e.jsx(c,{open:i,onOpenChange:n,kind:s}),e.jsx(m,{open:l,onOpenChange:o,sectionLabel:`${s}s`,returnTo:typeof window<"u"?window.location.pathname:`/${s}s`,taxonomySuggestion:!0})]})}export{f as T}; diff --git a/assets/TopicView-BynemQKe.js b/assets/TopicView-CdjM8WYW.js similarity index 88% rename from assets/TopicView-BynemQKe.js rename to assets/TopicView-CdjM8WYW.js index 10402f48de00dae1bf07d0e6a0e62433260ab5f7..ddc425f5267e9bbf76113b3adc990608b457dd45 100644 --- a/assets/TopicView-BynemQKe.js +++ b/assets/TopicView-CdjM8WYW.js @@ -1,4 +1,4 @@ -import{c as S,u as D,d as P,e as R,b as _,r as j,f as u,j as e,L as A,i as E,h as $,C as I,A as k}from"./index-3CfcAX6N.js";import{r as q,P as g,a as M,w as z}from"./PaperFeed-2dSUzcA2.js";import{S as f}from"./skeleton-CQbSjC3L.js";import{u as B}from"./usePapers-CHoHKyWP.js";import{r as b,T as N,t as T,a as C,u as H,b as O,c as Q,s as U}from"./researchTopic-Z4AJDMN7.js";import{t as K}from"./transform-Dx-N8Yyj.js";import{P as v}from"./plus-CiDEk52y.js";import{L as V}from"./link-2-D0J2rv3E.js";import"./PaperCard-BZtXccuT.js";import"./AuthorAvatar-DYaYcwPm.js";import"./SotaBadges-BqZMAXyY.js";import"./colors-BkWRhvFI.js";import"./Icon-C0d9p4Q2.js";import"./LatexTitle-DvPeLepK.js";import"./papers-BsYlGUQi.js";import"./curation-BZoIvsHD.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-Dwe6SY1f.js";import"./useIntersectionObserver-wAZWG4G7.js";import"./useInfiniteQuery-DYwUEaoz.js";import"./useMutation-CKC6OFhA.js";/** +import{c as S,u as D,d as P,e as R,b as _,r as j,f as u,j as e,L as A,i as E,h as $,C as I,A as k}from"./index-CxhY4zQ1.js";import{r as q,P as g,a as M,w as z}from"./PaperFeed-D1egUlu_.js";import{S as f}from"./skeleton-DdKViE4r.js";import{u as B}from"./usePapers-Cv13R7ph.js";import{r as b,T as N,t as T,a as C,u as H,b as O,c as Q,s as U}from"./researchTopic-DXZVIvAq.js";import{t as K}from"./transform-DehuZQh7.js";import{P as v}from"./plus-CEkdlNSn.js";import{L as V}from"./link-2-CyUnfeFP.js";import"./PaperCard-DeWmBrg8.js";import"./AuthorAvatar-DPz8YQ5Z.js";import"./SotaBadges-EnDhSaVO.js";import"./colors-BkWRhvFI.js";import"./Icon-XOOkUEUX.js";import"./LatexTitle-BqNrCKu8.js";import"./papers-BDxSKSYJ.js";import"./curation-D2sqKAqC.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-DgW_tN02.js";import"./useIntersectionObserver-ZqjUJuPc.js";import"./useInfiniteQuery-vHEhIVF_.js";import"./useMutation-BzRfwboV.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/TrendsView-B2Nu5XpR.js b/assets/TrendsView-C0roiQkv.js similarity index 97% rename from assets/TrendsView-B2Nu5XpR.js rename to assets/TrendsView-C0roiQkv.js index 05db273042047ea3fa0c6181f3e96825949a686e..c8eeb66e382c43e6e90d6eeb88f6ad5793ef69c6 100644 --- a/assets/TrendsView-B2Nu5XpR.js +++ b/assets/TrendsView-C0roiQkv.js @@ -1 +1 @@ -import{V as I,j as e,ac as X,b as G}from"./index-3CfcAX6N.js";import{A as J,a as V}from"./alert-BXZ4lnnf.js";import{S as P}from"./skeleton-CQbSjC3L.js";const m=t=>{const r=/^(\d{4})-(0[1-9]|1[0-2])$/.exec(t);if(!r)return t;const[,s,l]=r;return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][Number(l)-1]} '${s.slice(2)}`},g=980,j=400,x=62,B=26,f=30,E=58,u=g-x-B,A=j-f-E,v=f+A,Q=t=>{if(t.length<3)return t.map((s,l)=>`${l?"L":"M"}${s[0]} ${s[1]}`).join(" ");let r=`M${t[0][0]} ${t[0][1]}`;for(let s=0;s{const[a,y]=I.useState(null),i=r.length,b=l[l.length-1],d=n=>x+u*(i===1?0:n/(i-1)),p=n=>f+A*(1-n/b);if(i===0)return null;const R=r.map((n,h)=>[d(h),p(n.percent)]),F=Q(R),_=`${F} L ${d(i-1)} ${v} L ${x} ${v} Z`,w=i<=12?1:Math.ceil(i/8),O=n=>{const h=n.currentTarget.getBoundingClientRect(),S=(n.clientX-h.left)/h.width*g,k=i>1?u/(i-1):u,q=Math.max(0,Math.min(i-1,Math.round((S-x)/k)));y(q)},H=`trend-gradient-${t}`;return e.jsxs("figure",{className:"trend-chart",children:[e.jsxs("div",{className:"trend-chart-visual",children:[e.jsxs("svg",{viewBox:`0 0 ${g} ${j}`,width:"100%",role:"img","aria-label":`${c} by ${o.toLowerCase()}, from ${m(r[0].month)} (${r[0].percent}%) to ${m(r[i-1].month)} (${r[i-1].percent}%)`,style:{display:"block",overflow:"visible",cursor:"crosshair"},onPointerMove:O,onPointerLeave:()=>y(null),children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:H,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",style:{stopColor:s,stopOpacity:.26}}),e.jsx("stop",{offset:"100%",style:{stopColor:s,stopOpacity:.02}})]})}),l.map(n=>e.jsxs("g",{children:[e.jsx("line",{x1:x,x2:g-B,y1:p(n),y2:p(n),stroke:"var(--hairline)",strokeWidth:1}),e.jsxs("text",{x:x-14,y:p(n)+4,textAnchor:"end",style:W,children:[n,"%"]})]},n)),e.jsx("path",{d:_,fill:`url(#${H})`}),e.jsx("path",{d:F,fill:"none",stroke:s,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}),r.map((n,h)=>{const S=h===i-1,k=h%w===0&&i-1-h>=w/2;return!S&&!k?null:e.jsx("text",{x:d(h),y:v+24,textAnchor:"middle",style:W,children:m(n.month)},n.month)}),e.jsx("text",{x:x+u/2,y:j-4,textAnchor:"middle",style:z,children:o}),e.jsx("text",{transform:`translate(16 ${f+A/2}) rotate(-90)`,textAnchor:"middle",style:z,children:c}),a!=null&&e.jsxs(e.Fragment,{children:[e.jsx("line",{x1:d(a),x2:d(a),y1:f,y2:v,stroke:s,strokeWidth:1,strokeDasharray:"3 4",opacity:.5}),e.jsx("circle",{cx:d(a),cy:p(r[a].percent),r:5,fill:"var(--bg)",stroke:s,strokeWidth:2})]})]}),a!=null&&e.jsxs("div",{style:{position:"absolute",left:`${d(a)/g*100}%`,top:`${p(r[a].percent)/j*100}%`,transform:"translate(-50%, calc(-100% - 14px))",background:"var(--bg-elevated)",border:"1px solid var(--hairline)",borderRadius:6,boxShadow:"0 8px 26px rgba(0,0,0,.13)",padding:"7px 12px",pointerEvents:"none",whiteSpace:"nowrap",zIndex:3},children:[e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-faint)",fontSize:13,marginBottom:2},children:m(r[a].month)}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:7,fontFamily:"var(--mono)",fontWeight:600,fontSize:15,color:"var(--ink)"},children:[e.jsx("span",{style:{width:8,height:8,borderRadius:2,background:s,display:"inline-block"}}),r[a].percent,"%"]})]})]}),e.jsxs("details",{className:"trend-chart-table",children:[e.jsx("summary",{style:{fontFamily:"var(--mono)",fontSize:11,letterSpacing:"0.04em",color:"var(--ink-faint)",cursor:"pointer"},children:"View data table"}),e.jsxs("table",{style:{marginTop:8,borderCollapse:"collapse",fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{style:{textAlign:"left",padding:"3px 18px 3px 0"},children:o}),e.jsx("th",{style:{textAlign:"right",padding:"3px 0"},children:c})]})}),e.jsx("tbody",{children:r.map(n=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 18px 2px 0"},children:m(n.month)}),e.jsxs("td",{style:{textAlign:"right",padding:"2px 0"},children:[n.percent,"%"]})]},n.month))})]})]})]})};class Y{constructor(r){this.request=r}trends(){return this.request("/stats/trends")}}const K=new Y(X),$={maxWidth:960,padding:"48px 0 8px",borderTop:"1px solid var(--hairline)",marginTop:48},T={fontFamily:"var(--serif)",fontSize:34,fontWeight:500,letterSpacing:"-0.02em",margin:"0 0 10px",color:"var(--ink)"},M={fontFamily:"var(--serif)",fontSize:18,lineHeight:1.55,color:"var(--ink-soft)",maxWidth:620,margin:"0 0 8px"},C={fontFamily:"var(--mono)",fontSize:12,fontWeight:600,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--ink-faint)",marginBottom:8},N={fontFamily:"var(--serif)",fontSize:17,lineHeight:1.6,color:"var(--ink-soft)",margin:0},D={height:320,marginTop:26},te=()=>{const t=G({queryKey:["research-trends"],queryFn:()=>K.trends(),staleTime:36e5});return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Research ",e.jsx("em",{children:"Trends"})]}),e.jsx("div",{className:"feed-subtitle",children:"How open science is changing across machine learning — tracked over time from arXiv and the Hugging Face Hub."})]})}),t.error&&e.jsx(J,{variant:"destructive",children:e.jsx(V,{children:"Failed to load research trends. Please try again."})}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Code Availability"}),e.jsx("p",{style:M,children:"The percentage of published papers that have at least one official code implementation on GitHub."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(L,{id:"code",data:t.data.code_availability,color:"var(--trend-code)",yTicks:[0,20,40,60,80],yLabel:"Code Availability",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Papers with Hugging Face artifacts"}),e.jsx("p",{style:M,children:"The percentage of published papers linked to at least one Hugging Face artifact — a model, dataset or Space — making the work directly runnable and reusable."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(L,{id:"hf",data:t.data.hf_artifacts,color:"var(--trend-hf)",yTicks:[0,10,20,30,40,50],yLabel:"HF Artifact Coverage",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:{...$,paddingBottom:72},children:[e.jsx("h2",{style:{...T,fontSize:27},children:"How the data is collected"}),e.jsxs("div",{style:{display:"grid",gap:24,maxWidth:680},children:[e.jsxs("div",{children:[e.jsx("div",{style:C,children:"Code Availability"}),e.jsx("p",{style:N,children:"For every open-access machine learning paper, we check whether an official code implementation is linked on GitHub. The date axis is the paper's publication date."})]}),e.jsxs("div",{children:[e.jsx("div",{style:C,children:"Hugging Face artifacts"}),e.jsx("p",{style:N,children:"We resolve links between papers and the Hugging Face Hub, counting a paper as covered when it references at least one model, dataset or Space. The date axis is the paper's publication date."})]}),e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,lineHeight:1.6,color:"var(--ink-faint)",margin:"8px 0 0",letterSpacing:"0.02em"},children:"Figures use complete publication months. Historical Hugging Face coverage reflects artifacts currently linked in the catalog."})]})]})]})};export{te as default}; +import{V as I,j as e,ac as X,b as G}from"./index-CxhY4zQ1.js";import{A as J,a as V}from"./alert-C-NbJX4N.js";import{S as P}from"./skeleton-DdKViE4r.js";const m=t=>{const r=/^(\d{4})-(0[1-9]|1[0-2])$/.exec(t);if(!r)return t;const[,s,l]=r;return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][Number(l)-1]} '${s.slice(2)}`},g=980,j=400,x=62,B=26,f=30,E=58,u=g-x-B,A=j-f-E,v=f+A,Q=t=>{if(t.length<3)return t.map((s,l)=>`${l?"L":"M"}${s[0]} ${s[1]}`).join(" ");let r=`M${t[0][0]} ${t[0][1]}`;for(let s=0;s{const[a,y]=I.useState(null),i=r.length,b=l[l.length-1],d=n=>x+u*(i===1?0:n/(i-1)),p=n=>f+A*(1-n/b);if(i===0)return null;const R=r.map((n,h)=>[d(h),p(n.percent)]),F=Q(R),_=`${F} L ${d(i-1)} ${v} L ${x} ${v} Z`,w=i<=12?1:Math.ceil(i/8),O=n=>{const h=n.currentTarget.getBoundingClientRect(),S=(n.clientX-h.left)/h.width*g,k=i>1?u/(i-1):u,q=Math.max(0,Math.min(i-1,Math.round((S-x)/k)));y(q)},H=`trend-gradient-${t}`;return e.jsxs("figure",{className:"trend-chart",children:[e.jsxs("div",{className:"trend-chart-visual",children:[e.jsxs("svg",{viewBox:`0 0 ${g} ${j}`,width:"100%",role:"img","aria-label":`${c} by ${o.toLowerCase()}, from ${m(r[0].month)} (${r[0].percent}%) to ${m(r[i-1].month)} (${r[i-1].percent}%)`,style:{display:"block",overflow:"visible",cursor:"crosshair"},onPointerMove:O,onPointerLeave:()=>y(null),children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:H,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",style:{stopColor:s,stopOpacity:.26}}),e.jsx("stop",{offset:"100%",style:{stopColor:s,stopOpacity:.02}})]})}),l.map(n=>e.jsxs("g",{children:[e.jsx("line",{x1:x,x2:g-B,y1:p(n),y2:p(n),stroke:"var(--hairline)",strokeWidth:1}),e.jsxs("text",{x:x-14,y:p(n)+4,textAnchor:"end",style:W,children:[n,"%"]})]},n)),e.jsx("path",{d:_,fill:`url(#${H})`}),e.jsx("path",{d:F,fill:"none",stroke:s,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}),r.map((n,h)=>{const S=h===i-1,k=h%w===0&&i-1-h>=w/2;return!S&&!k?null:e.jsx("text",{x:d(h),y:v+24,textAnchor:"middle",style:W,children:m(n.month)},n.month)}),e.jsx("text",{x:x+u/2,y:j-4,textAnchor:"middle",style:z,children:o}),e.jsx("text",{transform:`translate(16 ${f+A/2}) rotate(-90)`,textAnchor:"middle",style:z,children:c}),a!=null&&e.jsxs(e.Fragment,{children:[e.jsx("line",{x1:d(a),x2:d(a),y1:f,y2:v,stroke:s,strokeWidth:1,strokeDasharray:"3 4",opacity:.5}),e.jsx("circle",{cx:d(a),cy:p(r[a].percent),r:5,fill:"var(--bg)",stroke:s,strokeWidth:2})]})]}),a!=null&&e.jsxs("div",{style:{position:"absolute",left:`${d(a)/g*100}%`,top:`${p(r[a].percent)/j*100}%`,transform:"translate(-50%, calc(-100% - 14px))",background:"var(--bg-elevated)",border:"1px solid var(--hairline)",borderRadius:6,boxShadow:"0 8px 26px rgba(0,0,0,.13)",padding:"7px 12px",pointerEvents:"none",whiteSpace:"nowrap",zIndex:3},children:[e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-faint)",fontSize:13,marginBottom:2},children:m(r[a].month)}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:7,fontFamily:"var(--mono)",fontWeight:600,fontSize:15,color:"var(--ink)"},children:[e.jsx("span",{style:{width:8,height:8,borderRadius:2,background:s,display:"inline-block"}}),r[a].percent,"%"]})]})]}),e.jsxs("details",{className:"trend-chart-table",children:[e.jsx("summary",{style:{fontFamily:"var(--mono)",fontSize:11,letterSpacing:"0.04em",color:"var(--ink-faint)",cursor:"pointer"},children:"View data table"}),e.jsxs("table",{style:{marginTop:8,borderCollapse:"collapse",fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{style:{textAlign:"left",padding:"3px 18px 3px 0"},children:o}),e.jsx("th",{style:{textAlign:"right",padding:"3px 0"},children:c})]})}),e.jsx("tbody",{children:r.map(n=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 18px 2px 0"},children:m(n.month)}),e.jsxs("td",{style:{textAlign:"right",padding:"2px 0"},children:[n.percent,"%"]})]},n.month))})]})]})]})};class Y{constructor(r){this.request=r}trends(){return this.request("/stats/trends")}}const K=new Y(X),$={maxWidth:960,padding:"48px 0 8px",borderTop:"1px solid var(--hairline)",marginTop:48},T={fontFamily:"var(--serif)",fontSize:34,fontWeight:500,letterSpacing:"-0.02em",margin:"0 0 10px",color:"var(--ink)"},M={fontFamily:"var(--serif)",fontSize:18,lineHeight:1.55,color:"var(--ink-soft)",maxWidth:620,margin:"0 0 8px"},C={fontFamily:"var(--mono)",fontSize:12,fontWeight:600,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--ink-faint)",marginBottom:8},N={fontFamily:"var(--serif)",fontSize:17,lineHeight:1.6,color:"var(--ink-soft)",margin:0},D={height:320,marginTop:26},te=()=>{const t=G({queryKey:["research-trends"],queryFn:()=>K.trends(),staleTime:36e5});return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Research ",e.jsx("em",{children:"Trends"})]}),e.jsx("div",{className:"feed-subtitle",children:"How open science is changing across machine learning — tracked over time from arXiv and the Hugging Face Hub."})]})}),t.error&&e.jsx(J,{variant:"destructive",children:e.jsx(V,{children:"Failed to load research trends. Please try again."})}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Code Availability"}),e.jsx("p",{style:M,children:"The percentage of published papers that have at least one official code implementation on GitHub."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(L,{id:"code",data:t.data.code_availability,color:"var(--trend-code)",yTicks:[0,20,40,60,80],yLabel:"Code Availability",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Papers with Hugging Face artifacts"}),e.jsx("p",{style:M,children:"The percentage of published papers linked to at least one Hugging Face artifact — a model, dataset or Space — making the work directly runnable and reusable."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(L,{id:"hf",data:t.data.hf_artifacts,color:"var(--trend-hf)",yTicks:[0,10,20,30,40,50],yLabel:"HF Artifact Coverage",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:{...$,paddingBottom:72},children:[e.jsx("h2",{style:{...T,fontSize:27},children:"How the data is collected"}),e.jsxs("div",{style:{display:"grid",gap:24,maxWidth:680},children:[e.jsxs("div",{children:[e.jsx("div",{style:C,children:"Code Availability"}),e.jsx("p",{style:N,children:"For every open-access machine learning paper, we check whether an official code implementation is linked on GitHub. The date axis is the paper's publication date."})]}),e.jsxs("div",{children:[e.jsx("div",{style:C,children:"Hugging Face artifacts"}),e.jsx("p",{style:N,children:"We resolve links between papers and the Hugging Face Hub, counting a paper as covered when it references at least one model, dataset or Space. The date axis is the paper's publication date."})]}),e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,lineHeight:1.6,color:"var(--ink-faint)",margin:"8px 0 0",letterSpacing:"0.02em"},children:"Figures use complete publication months. Historical Hugging Face coverage reflects artifacts currently linked in the catalog."})]})]})]})};export{te as default}; diff --git a/assets/UserProfileView-DQtExllo.js b/assets/UserProfileView-2VsZSUPK.js similarity index 89% rename from assets/UserProfileView-DQtExllo.js rename to assets/UserProfileView-2VsZSUPK.js index 4888e6133412f78dda47a809e9fc55ef912e9985..c47bcbf5459a4e320628f9a4c374b0cb7581abb6 100644 --- a/assets/UserProfileView-DQtExllo.js +++ b/assets/UserProfileView-2VsZSUPK.js @@ -1 +1 @@ -import{az as n,u as i,b as o,j as e,ao as d}from"./index-3CfcAX6N.js";import{C as l}from"./OrganizationContributionGraph-AzFycVwZ.js";import"./skeleton-CQbSjC3L.js";import"./catalog-B47DuClX.js";const c={async get(s){const a=await n(`/profiles/${encodeURIComponent(s)}`),r=await a.json();if(!a.redirected)return r;const t=decodeURIComponent(new URL(a.url).pathname.split("/").pop()||r.username);return{...r,username:t,redirected_from_alias:!0}}},x=()=>{const{username:s=""}=i(),a=o({queryKey:["user-profile",s.toLowerCase()],queryFn:()=>c.get(s)});return a.isLoading?e.jsx("div",{className:"page",children:"Loading profile…"}):a.data?a.data.redirected_from_alias?e.jsx(d,{to:`/${a.data.username}`,replace:!0}):e.jsxs("div",{className:"page",style:{maxWidth:960},children:[e.jsxs("h1",{children:["@",a.data.username]}),e.jsx("p",{children:"Canonical Papers with Code contributions"}),e.jsx(l,{data:a.data.calendar,organizationName:`@${a.data.username}`,title:"Canonical contributions",noun:"contribution"}),a.data.is_owner&&e.jsxs("section",{className:"mt-10",children:[e.jsx("h2",{children:"Your submissions"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Limits and duplicate behavior are documented on ",e.jsx("a",{href:"/rate-limits",children:"the policy page"}),"."]}),e.jsx("div",{className:"mt-4 space-y-3",children:a.data.submissions.map(r=>e.jsxs("article",{className:"rounded-md border p-4",children:[e.jsx("strong",{children:r.edit_type})," · ",r.status,e.jsxs("details",{className:"mt-2 text-xs",children:[e.jsx("summary",{children:"Original and applied payload"}),e.jsx("pre",{children:JSON.stringify({proposed:r.proposed_payload,applied:r.applied_payload},null,2)})]}),r.review_reason&&e.jsx("p",{children:r.review_reason})]},r.id))})]})]}):e.jsx("div",{className:"page",children:e.jsx("h1",{children:"Profile not found"})})};export{x as default}; +import{az as n,u as i,b as o,j as e,ao as d}from"./index-CxhY4zQ1.js";import{C as l}from"./OrganizationContributionGraph-BW4dfD-r.js";import"./skeleton-DdKViE4r.js";import"./catalog-DCEU6WpP.js";const c={async get(s){const a=await n(`/profiles/${encodeURIComponent(s)}`),r=await a.json();if(!a.redirected)return r;const t=decodeURIComponent(new URL(a.url).pathname.split("/").pop()||r.username);return{...r,username:t,redirected_from_alias:!0}}},x=()=>{const{username:s=""}=i(),a=o({queryKey:["user-profile",s.toLowerCase()],queryFn:()=>c.get(s)});return a.isLoading?e.jsx("div",{className:"page",children:"Loading profile…"}):a.data?a.data.redirected_from_alias?e.jsx(d,{to:`/${a.data.username}`,replace:!0}):e.jsxs("div",{className:"page",style:{maxWidth:960},children:[e.jsxs("h1",{children:["@",a.data.username]}),e.jsx("p",{children:"Canonical Papers with Code contributions"}),e.jsx(l,{data:a.data.calendar,organizationName:`@${a.data.username}`,title:"Canonical contributions",noun:"contribution"}),a.data.is_owner&&e.jsxs("section",{className:"mt-10",children:[e.jsx("h2",{children:"Your submissions"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Limits and duplicate behavior are documented on ",e.jsx("a",{href:"/rate-limits",children:"the policy page"}),"."]}),e.jsx("div",{className:"mt-4 space-y-3",children:a.data.submissions.map(r=>e.jsxs("article",{className:"rounded-md border p-4",children:[e.jsx("strong",{children:r.edit_type})," · ",r.status,e.jsxs("details",{className:"mt-2 text-xs",children:[e.jsx("summary",{children:"Original and applied payload"}),e.jsx("pre",{children:JSON.stringify({proposed:r.proposed_payload,applied:r.applied_payload},null,2)})]}),r.review_reason&&e.jsx("p",{children:r.review_reason})]},r.id))})]})]}):e.jsx("div",{className:"page",children:e.jsx("h1",{children:"Profile not found"})})};export{x as default}; diff --git a/assets/account-Ee9-ZosC.js b/assets/account-Bplq3u-8.js similarity index 89% rename from assets/account-Ee9-ZosC.js rename to assets/account-Bplq3u-8.js index 01c24fe4d4e972feff7159e7c069042955480a85..f7f4ea9ba324910b94f4b5d718997c27e5470c17 100644 --- a/assets/account-Ee9-ZosC.js +++ b/assets/account-Bplq3u-8.js @@ -1 +1 @@ -import{ac as r}from"./index-3CfcAX6N.js";class t{constructor(e){this.request=e}getPreferences(){return this.request("/me/preferences")}updatePreferences(e){return this.request("/me/preferences",{method:"PUT",body:JSON.stringify(e)})}getRateLimitPolicy(){return this.request("/rate-limits",{credentials:"omit"})}getBookmarkIds(){return this.request("/me/bookmarks/ids")}getBookmarks(){return this.request("/me/bookmarks")}addBookmark(e){return this.request(`/me/bookmarks/${e}`,{method:"POST"})}removeBookmark(e){return this.request(`/me/bookmarks/${e}`,{method:"DELETE"})}}const m=new t(r);export{m as a}; +import{ac as r}from"./index-CxhY4zQ1.js";class t{constructor(e){this.request=e}getPreferences(){return this.request("/me/preferences")}updatePreferences(e){return this.request("/me/preferences",{method:"PUT",body:JSON.stringify(e)})}getRateLimitPolicy(){return this.request("/rate-limits",{credentials:"omit"})}getBookmarkIds(){return this.request("/me/bookmarks/ids")}getBookmarks(){return this.request("/me/bookmarks")}addBookmark(e){return this.request(`/me/bookmarks/${e}`,{method:"POST"})}removeBookmark(e){return this.request(`/me/bookmarks/${e}`,{method:"DELETE"})}}const m=new t(r);export{m as a}; diff --git a/assets/activity-HTMf27Bb.js b/assets/activity-bP8ilshD.js similarity index 89% rename from assets/activity-HTMf27Bb.js rename to assets/activity-bP8ilshD.js index 5e10349ed2ce67218953ceb6cca3a3194ba2a07c..61acaa3cf0f03a41ff8ee34f7e66f134338ce9d8 100644 --- a/assets/activity-HTMf27Bb.js +++ b/assets/activity-bP8ilshD.js @@ -1,4 +1,4 @@ -import{c as t}from"./index-3CfcAX6N.js";/** +import{c as t}from"./index-CxhY4zQ1.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/alert-BXZ4lnnf.js b/assets/alert-C-NbJX4N.js similarity index 92% rename from assets/alert-BXZ4lnnf.js rename to assets/alert-C-NbJX4N.js index 182168235567ed13901c8ac571331fc14ff1a774..e52d1643dbc473331874a3978b023253eb1ff4b3 100644 --- a/assets/alert-BXZ4lnnf.js +++ b/assets/alert-C-NbJX4N.js @@ -1 +1 @@ -import{f as r,j as s,I as l,ae as i}from"./index-3CfcAX6N.js";const o=i("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),n=r.forwardRef(({className:e,variant:t,...a},d)=>s.jsx("div",{ref:d,role:"alert",className:l(o({variant:t}),e),...a}));n.displayName="Alert";const v=r.forwardRef(({className:e,...t},a)=>s.jsx("h5",{ref:a,className:l("mb-1 font-medium leading-none tracking-tight",e),...t}));v.displayName="AlertTitle";const c=r.forwardRef(({className:e,...t},a)=>s.jsx("div",{ref:a,className:l("text-sm [&_p]:leading-relaxed",e),...t}));c.displayName="AlertDescription";export{n as A,c as a}; +import{f as r,j as s,I as l,ae as i}from"./index-CxhY4zQ1.js";const o=i("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),n=r.forwardRef(({className:e,variant:t,...a},d)=>s.jsx("div",{ref:d,role:"alert",className:l(o({variant:t}),e),...a}));n.displayName="Alert";const v=r.forwardRef(({className:e,...t},a)=>s.jsx("h5",{ref:a,className:l("mb-1 font-medium leading-none tracking-tight",e),...t}));v.displayName="AlertTitle";const c=r.forwardRef(({className:e,...t},a)=>s.jsx("div",{ref:a,className:l("text-sm [&_p]:leading-relaxed",e),...t}));c.displayName="AlertDescription";export{n as A,c as a}; diff --git a/assets/apiErrors-D2bSY3Dq.js b/assets/apiErrors-D2bSY3Dq.js new file mode 100644 index 0000000000000000000000000000000000000000..2eabf9c28cec17bf95ec7c043a1269b03765d95d --- /dev/null +++ b/assets/apiErrors-D2bSY3Dq.js @@ -0,0 +1 @@ +import{A as s}from"./index-CxhY4zQ1.js";const i=o=>o instanceof s&&o.status===404;export{i}; diff --git a/assets/apiErrors-XoIVpN_S.js b/assets/apiErrors-XoIVpN_S.js deleted file mode 100644 index 0df00b1a356d25d9cf65f954869807838745d15a..0000000000000000000000000000000000000000 --- a/assets/apiErrors-XoIVpN_S.js +++ /dev/null @@ -1 +0,0 @@ -import{A as s}from"./index-3CfcAX6N.js";const i=o=>o instanceof s&&o.status===404;export{i}; diff --git a/assets/arrow-left-CZqhJnQC.js b/assets/arrow-left-CDwy-_cK.js similarity index 86% rename from assets/arrow-left-CZqhJnQC.js rename to assets/arrow-left-CDwy-_cK.js index baa0f4514fb0463e568249a1efdd4841eac97259..978f5e2002eb3ade9b191e54339c86e13622bc24 100644 --- a/assets/arrow-left-CZqhJnQC.js +++ b/assets/arrow-left-CDwy-_cK.js @@ -1,4 +1,4 @@ -import{c as e}from"./index-3CfcAX6N.js";/** +import{c as e}from"./index-CxhY4zQ1.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/arrow-right-U4Mftc_z.js b/assets/arrow-right-BwBMsu3P.js similarity index 86% rename from assets/arrow-right-U4Mftc_z.js rename to assets/arrow-right-BwBMsu3P.js index a72c8a63a5678edc34395e4f0c587011d966f29e..798d960db99db1583713d2ffbd1a897533c40b29 100644 --- a/assets/arrow-right-U4Mftc_z.js +++ b/assets/arrow-right-BwBMsu3P.js @@ -1,4 +1,4 @@ -import{c as r}from"./index-3CfcAX6N.js";/** +import{c as r}from"./index-CxhY4zQ1.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/badge-BgT1mGjP.js b/assets/badge-Dj5QKh-d.js similarity index 90% rename from assets/badge-BgT1mGjP.js rename to assets/badge-Dj5QKh-d.js index b569e6dd6cda03f42db5e09e4f6872a64cbefbd8..f1ba8101f0774a028476b783414d2b87e3e98491 100644 --- a/assets/badge-BgT1mGjP.js +++ b/assets/badge-Dj5QKh-d.js @@ -1 +1 @@ -import{j as n,I as o,ae as a}from"./index-3CfcAX6N.js";const s=a("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function d({className:r,variant:e,...t}){return n.jsx("div",{className:o(s({variant:e}),r),...t})}export{d as B}; +import{j as n,I as o,ae as a}from"./index-CxhY4zQ1.js";const s=a("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function d({className:r,variant:e,...t}){return n.jsx("div",{className:o(s({variant:e}),r),...t})}export{d as B}; diff --git a/assets/button-CbnaBx6W.js b/assets/button-BenSiukP.js similarity index 89% rename from assets/button-CbnaBx6W.js rename to assets/button-BenSiukP.js index 8ddb643885b3c39d4c1bb349430ff8f2b088e0f2..e28011874bdcbb929a05e0c64386d2e4d2dd093d 100644 --- a/assets/button-CbnaBx6W.js +++ b/assets/button-BenSiukP.js @@ -1 +1 @@ -import{f as a,j as d,aA as u,I as c,ae as f}from"./index-3CfcAX6N.js";const g=f("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),v=a.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...o},s)=>{const i=n?u:"button";return d.jsx(i,{className:c(g({variant:t,size:r,className:e})),ref:s,...o})});v.displayName="Button";export{v as B}; +import{f as a,j as d,aA as u,I as c,ae as f}from"./index-CxhY4zQ1.js";const g=f("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),v=a.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...o},s)=>{const i=n?u:"button";return d.jsx(i,{className:c(g({variant:t,size:r,className:e})),ref:s,...o})});v.displayName="Button";export{v as B}; diff --git a/assets/catalog-B47DuClX.js b/assets/catalog-DCEU6WpP.js similarity index 97% rename from assets/catalog-B47DuClX.js rename to assets/catalog-DCEU6WpP.js index 3b4b96b89e7514226d576ebe16fce17d44924882..41196e51fa49a97ee37ac9c3053a0b86ced8d4fa 100644 --- a/assets/catalog-B47DuClX.js +++ b/assets/catalog-DCEU6WpP.js @@ -1 +1 @@ -import{ac as o}from"./index-3CfcAX6N.js";function s(a,e){const t=new URLSearchParams;for(const[i,n]of Object.entries(e??{}))n!==void 0&&n!==""&&t.set(i,String(n));const r=t.toString();return`${a}${r?`?${r}`:""}`}class u{constructor(e){this.request=e}listAreas(e){return this.request(s("/areas/",e))}getArea(e){return this.request(`/areas/${e}`)}areasWithTasks(){return this.request("/areas/with-tasks/")}listTasks(e){return this.request(s("/tasks/",e))}getTask(e){return this.request(`/tasks/${e}`)}topTasks(e){return this.request(s("/tasks/top",{limit:e}))}trendingTasks(e){return this.request(s("/tasks/trending",e))}taskChildren(e,t){return this.request(s(`/tasks/${e}/children`,t))}taskParents(e){return this.request(`/tasks/${e}/parents`)}taskPage(e,t){return this.request(s(`/tasks/${e}/page`,t))}trendingBenchmarks(e,t){return this.request(s(`/tasks/${encodeURIComponent(e)}/trending-benchmarks`,t))}frameworkCatalog(){return this.request("/frameworks/")}listMethods(e){return this.request(s("/methods/",e))}methodIndex(){return this.request("/methods/index/cards")}trendingMethods(e){return this.request(s("/methods/trending",e))}getMethod(e){return this.request(`/methods/${encodeURIComponent(e)}`)}relatedMethods(e){return this.request(`/methods/${encodeURIComponent(e)}/related`)}methodTrend(e,t){return this.request(s(`/methods/${encodeURIComponent(e)}/trend`,t))}listDatasets(e){const{task_id:t,...r}=e??{};return this.request(s("/datasets/",{...r,task:r.task??t}))}getDataset(e){return this.request(`/datasets/${e}`)}getDatasetBySlug(e,t){return this.request(s(`/datasets/${e}`,t))}async datasetTasks(e){return(await this.request(`/datasets/${e}/tasks/`)).results}async leaderboardMetrics(e,t){return(await this.request(`/datasets/${e}/tasks/${t}/metrics`)).metrics}metricDirections(){return this.request("/metrics/directions")}conferences(){return this.request("/conferences/")}conferenceDeadlines(){return this.request("/conferences/deadlines")}getConference(e){return this.request(`/conferences/${e}`)}conferenceAreasWithTasks(e){return this.request(`/conferences/${e}/areas-with-tasks`)}organizations(e=!1){return this.request(`/organizations/${e?"?featured_only=true":""}`)}searchOrganizations(e,t){return this.request(s("/organizations/",{q:e,limit:t}))}organizationIndex(){return this.request("/organizations/index/cards")}getOrganization(e){return this.request(`/organizations/${e}`)}organizationContributions(e){return this.request(`/organizations/${e}/contributions`)}organizationAreasWithTasks(e){return this.request(`/organizations/${e}/areas-with-tasks`)}audit(e){return this.request(s("/admin/catalog-audit",{cursor:e}))}acknowledgeAudit(){return this.request("/admin/catalog-audit/acknowledge",{method:"POST"})}rollbackEvent(e){return this.request(`/admin/catalog-audit/${e}/rollback`,{method:"POST"})}}const d=new u(o);export{d as c}; +import{ac as o}from"./index-CxhY4zQ1.js";function s(a,e){const t=new URLSearchParams;for(const[i,n]of Object.entries(e??{}))n!==void 0&&n!==""&&t.set(i,String(n));const r=t.toString();return`${a}${r?`?${r}`:""}`}class u{constructor(e){this.request=e}listAreas(e){return this.request(s("/areas/",e))}getArea(e){return this.request(`/areas/${e}`)}areasWithTasks(){return this.request("/areas/with-tasks/")}listTasks(e){return this.request(s("/tasks/",e))}getTask(e){return this.request(`/tasks/${e}`)}topTasks(e){return this.request(s("/tasks/top",{limit:e}))}trendingTasks(e){return this.request(s("/tasks/trending",e))}taskChildren(e,t){return this.request(s(`/tasks/${e}/children`,t))}taskParents(e){return this.request(`/tasks/${e}/parents`)}taskPage(e,t){return this.request(s(`/tasks/${e}/page`,t))}trendingBenchmarks(e,t){return this.request(s(`/tasks/${encodeURIComponent(e)}/trending-benchmarks`,t))}frameworkCatalog(){return this.request("/frameworks/")}listMethods(e){return this.request(s("/methods/",e))}methodIndex(){return this.request("/methods/index/cards")}trendingMethods(e){return this.request(s("/methods/trending",e))}getMethod(e){return this.request(`/methods/${encodeURIComponent(e)}`)}relatedMethods(e){return this.request(`/methods/${encodeURIComponent(e)}/related`)}methodTrend(e,t){return this.request(s(`/methods/${encodeURIComponent(e)}/trend`,t))}listDatasets(e){const{task_id:t,...r}=e??{};return this.request(s("/datasets/",{...r,task:r.task??t}))}getDataset(e){return this.request(`/datasets/${e}`)}getDatasetBySlug(e,t){return this.request(s(`/datasets/${e}`,t))}async datasetTasks(e){return(await this.request(`/datasets/${e}/tasks/`)).results}async leaderboardMetrics(e,t){return(await this.request(`/datasets/${e}/tasks/${t}/metrics`)).metrics}metricDirections(){return this.request("/metrics/directions")}conferences(){return this.request("/conferences/")}conferenceDeadlines(){return this.request("/conferences/deadlines")}getConference(e){return this.request(`/conferences/${e}`)}conferenceAreasWithTasks(e){return this.request(`/conferences/${e}/areas-with-tasks`)}organizations(e=!1){return this.request(`/organizations/${e?"?featured_only=true":""}`)}searchOrganizations(e,t){return this.request(s("/organizations/",{q:e,limit:t}))}organizationIndex(){return this.request("/organizations/index/cards")}getOrganization(e){return this.request(`/organizations/${e}`)}organizationContributions(e){return this.request(`/organizations/${e}/contributions`)}organizationAreasWithTasks(e){return this.request(`/organizations/${e}/areas-with-tasks`)}audit(e){return this.request(s("/admin/catalog-audit",{cursor:e}))}acknowledgeAudit(){return this.request("/admin/catalog-audit/acknowledge",{method:"POST"})}rollbackEvent(e){return this.request(`/admin/catalog-audit/${e}/rollback`,{method:"POST"})}}const d=new u(o);export{d as c}; diff --git a/assets/chat-81nIwu_j.js b/assets/chat-CkiIbMG5.js similarity index 98% rename from assets/chat-81nIwu_j.js rename to assets/chat-CkiIbMG5.js index 0186c4abf4cb56bd8e588a5f63d19a4f77e3a729..a756bc18be42cbee84694ffd8dac812b270b5aa3 100644 --- a/assets/chat-81nIwu_j.js +++ b/assets/chat-CkiIbMG5.js @@ -1 +1 @@ -import{a5 as i,ac as p,ay as h,az as m}from"./index-3CfcAX6N.js";const c=encodeURIComponent,n=s=>`/chat/artifacts/${c(s)}`,a=(s,e)=>`${n(s)}/versions/${c(e)}`,u=s=>s.split("/").map(encodeURIComponent).join("/"),S={preview:(s,e)=>i(`/api/v1${a(s,e)}/preview`),file:(s,e,t,r)=>i(`/api/v1${a(s,e)}/${t}/${u(r)}`),pdfExport:s=>i(`/api/v1${n(s)}/export/pdf`),sourceZip:(s,e)=>i(`/api/v1${a(s,e)}/export/source.zip`),sharedRoot:(s,e)=>i(`/api/v1/chat/shares/${c(s)}/artifacts/${c(e)}`)};class l{constructor(e){this.request=e}listSessions(e){const t=new URLSearchParams({limit:"50"});return e&&t.set("cursor",e),this.request(`/chat/sessions?${t.toString()}`)}createSession(e,t="low"){return this.request("/chat/sessions",{method:"POST",body:JSON.stringify({selected_model:e||null,reasoning_effort:t})})}getSession(e){return this.request(`/chat/sessions/${e}`)}updateSession(e,t){return this.request(`/chat/sessions/${e}`,{method:"PATCH",body:JSON.stringify(t)})}removeSession(e){return this.request(`/chat/sessions/${e}`,{method:"DELETE"})}archiveOldChats(){return this.request("/chat/sessions/archive-old",{method:"POST"})}archiveOldestChats(){return this.request("/chat/sessions/archive-oldest",{method:"POST"})}cancelSession(e){return this.request(`/chat/sessions/${e}/cancel`,{method:"POST"})}createOrRefreshShare(e){return this.request(`/chat/sessions/${e}/share`,{method:"POST"})}getSessionPublicShare(e){return this.request(`/chat/sessions/${encodeURIComponent(e)}/public-share`,{credentials:"omit"})}getSharedChat(e){return this.request(`/chat/shares/${encodeURIComponent(e)}`,{credentials:"omit"})}getModels(){return this.request("/chat/models")}getUsage(){return this.request("/chat/usage",{cache:"no-store"})}getOpenAIUsage(){return this.request("/chat/openai-usage",{cache:"no-store"})}getAvailability(){return this.request("/chat/availability",{cache:"no-store"})}getAutocompleteVocabulary(){return this.request("/chat/autocomplete-vocabulary")}getInferenceBilling(){return this.request("/me/inference-billing",{cache:"no-store"})}selectInferenceBillingAccount(e){return this.request("/me/inference-billing",{method:"PATCH",body:JSON.stringify({bill_to:e})})}prewarmPaperContext(e){return this.request("/chat/paper-context/prewarm",{method:"POST",body:JSON.stringify({route_id:e}),credentials:"omit",cache:"no-store"})}getSandboxSpend(e){const t=e?`?environment=${encodeURIComponent(e)}`:"";return this.request(`/chat/admin/sandbox-spend${t}`,{cache:"no-store"})}getWebSearchBudget(){return this.request("/chat/admin/web-search-budget",{cache:"no-store"})}getOpenRouterCredential(){return this.request("/chat/openrouter-key",{cache:"no-store"})}connectOpenRouterCredential(e){return this.request("/chat/openrouter-key",{method:"PUT",body:JSON.stringify({api_key:e})})}setOpenRouterFallback(e){return this.request("/chat/openrouter-key",{method:"PATCH",body:JSON.stringify({enabled:e})})}disconnectOpenRouterCredential(){return this.request("/chat/openrouter-key",{method:"DELETE"})}reportLatency(e,t){return h(`/chat/latency/${encodeURIComponent(e)}`,{method:"POST",keepalive:!0,body:JSON.stringify(t)})}reportFeedback(e,t,r){return this.request(`/chat/messages/${encodeURIComponent(e)}/feedback`,{method:"POST",body:JSON.stringify({value:t,...r?{comment:r}:{}})})}getPosterVersions(e){return this.request(n(e),{cache:"no-store"}).then(t=>t.versions)}getPosterManifest(e,t){return this.request(`${a(e,t)}/manifest`,{cache:"no-store"})}getLatexPaper(e){return this.request(n(e),{cache:"no-store"})}getLatexPaperHistory(e,t){const r=new URLSearchParams({limit:"20"});return t&&r.set("cursor",t),this.request(`${n(e)}/versions?${r}`,{cache:"no-store"})}getLatexPaperManifest(e,t){return this.request(`${a(e,t)}/manifest`,{cache:"no-store"})}getArtifactSource(e,t,r){return m(`${a(e,t)}/source/${u(r)}`,{cache:"no-store"}).then(o=>o.text())}saveLatexPaper(e,t,r){return this.request(`${n(e)}/save-compile`,{method:"POST",body:JSON.stringify({expected_parent_version_id:t,files:Object.entries(r).map(([o,d])=>({path:o,content:d}))})})}restoreLatexPaperVersion(e,t,r){return this.request(`${n(e)}/versions/restore`,{method:"POST",body:JSON.stringify({source_version_id:t,expected_parent_version_id:r})})}uploadLatexPaperFigure(e,t,r){const o=new FormData;return o.set("expected_parent_version_id",t),o.set("path",`figures/${r.name}`),o.set("figure",r),this.request(`${n(e)}/figures`,{method:"POST",body:o})}refreshLatexPaperCompile(e){return this.request(`${n(e)}/refresh-compile`,{method:"POST"})}stream(e,t){return h("/chat/stream",{method:"POST",headers:{Accept:"text/event-stream"},body:JSON.stringify(e),signal:t})}resumeStream(e,t,r){return h(`/chat/sessions/${encodeURIComponent(e)}/stream`,{method:"GET",headers:{Accept:"text/event-stream",...r&&r>0?{"Last-Event-ID":String(r)}:{}},signal:t})}}const f=new l(p);export{S as a,f as c}; +import{a5 as i,ac as p,ay as h,az as m}from"./index-CxhY4zQ1.js";const c=encodeURIComponent,n=s=>`/chat/artifacts/${c(s)}`,a=(s,e)=>`${n(s)}/versions/${c(e)}`,u=s=>s.split("/").map(encodeURIComponent).join("/"),S={preview:(s,e)=>i(`/api/v1${a(s,e)}/preview`),file:(s,e,t,r)=>i(`/api/v1${a(s,e)}/${t}/${u(r)}`),pdfExport:s=>i(`/api/v1${n(s)}/export/pdf`),sourceZip:(s,e)=>i(`/api/v1${a(s,e)}/export/source.zip`),sharedRoot:(s,e)=>i(`/api/v1/chat/shares/${c(s)}/artifacts/${c(e)}`)};class l{constructor(e){this.request=e}listSessions(e){const t=new URLSearchParams({limit:"50"});return e&&t.set("cursor",e),this.request(`/chat/sessions?${t.toString()}`)}createSession(e,t="low"){return this.request("/chat/sessions",{method:"POST",body:JSON.stringify({selected_model:e||null,reasoning_effort:t})})}getSession(e){return this.request(`/chat/sessions/${e}`)}updateSession(e,t){return this.request(`/chat/sessions/${e}`,{method:"PATCH",body:JSON.stringify(t)})}removeSession(e){return this.request(`/chat/sessions/${e}`,{method:"DELETE"})}archiveOldChats(){return this.request("/chat/sessions/archive-old",{method:"POST"})}archiveOldestChats(){return this.request("/chat/sessions/archive-oldest",{method:"POST"})}cancelSession(e){return this.request(`/chat/sessions/${e}/cancel`,{method:"POST"})}createOrRefreshShare(e){return this.request(`/chat/sessions/${e}/share`,{method:"POST"})}getSessionPublicShare(e){return this.request(`/chat/sessions/${encodeURIComponent(e)}/public-share`,{credentials:"omit"})}getSharedChat(e){return this.request(`/chat/shares/${encodeURIComponent(e)}`,{credentials:"omit"})}getModels(){return this.request("/chat/models")}getUsage(){return this.request("/chat/usage",{cache:"no-store"})}getOpenAIUsage(){return this.request("/chat/openai-usage",{cache:"no-store"})}getAvailability(){return this.request("/chat/availability",{cache:"no-store"})}getAutocompleteVocabulary(){return this.request("/chat/autocomplete-vocabulary")}getInferenceBilling(){return this.request("/me/inference-billing",{cache:"no-store"})}selectInferenceBillingAccount(e){return this.request("/me/inference-billing",{method:"PATCH",body:JSON.stringify({bill_to:e})})}prewarmPaperContext(e){return this.request("/chat/paper-context/prewarm",{method:"POST",body:JSON.stringify({route_id:e}),credentials:"omit",cache:"no-store"})}getSandboxSpend(e){const t=e?`?environment=${encodeURIComponent(e)}`:"";return this.request(`/chat/admin/sandbox-spend${t}`,{cache:"no-store"})}getWebSearchBudget(){return this.request("/chat/admin/web-search-budget",{cache:"no-store"})}getOpenRouterCredential(){return this.request("/chat/openrouter-key",{cache:"no-store"})}connectOpenRouterCredential(e){return this.request("/chat/openrouter-key",{method:"PUT",body:JSON.stringify({api_key:e})})}setOpenRouterFallback(e){return this.request("/chat/openrouter-key",{method:"PATCH",body:JSON.stringify({enabled:e})})}disconnectOpenRouterCredential(){return this.request("/chat/openrouter-key",{method:"DELETE"})}reportLatency(e,t){return h(`/chat/latency/${encodeURIComponent(e)}`,{method:"POST",keepalive:!0,body:JSON.stringify(t)})}reportFeedback(e,t,r){return this.request(`/chat/messages/${encodeURIComponent(e)}/feedback`,{method:"POST",body:JSON.stringify({value:t,...r?{comment:r}:{}})})}getPosterVersions(e){return this.request(n(e),{cache:"no-store"}).then(t=>t.versions)}getPosterManifest(e,t){return this.request(`${a(e,t)}/manifest`,{cache:"no-store"})}getLatexPaper(e){return this.request(n(e),{cache:"no-store"})}getLatexPaperHistory(e,t){const r=new URLSearchParams({limit:"20"});return t&&r.set("cursor",t),this.request(`${n(e)}/versions?${r}`,{cache:"no-store"})}getLatexPaperManifest(e,t){return this.request(`${a(e,t)}/manifest`,{cache:"no-store"})}getArtifactSource(e,t,r){return m(`${a(e,t)}/source/${u(r)}`,{cache:"no-store"}).then(o=>o.text())}saveLatexPaper(e,t,r){return this.request(`${n(e)}/save-compile`,{method:"POST",body:JSON.stringify({expected_parent_version_id:t,files:Object.entries(r).map(([o,d])=>({path:o,content:d}))})})}restoreLatexPaperVersion(e,t,r){return this.request(`${n(e)}/versions/restore`,{method:"POST",body:JSON.stringify({source_version_id:t,expected_parent_version_id:r})})}uploadLatexPaperFigure(e,t,r){const o=new FormData;return o.set("expected_parent_version_id",t),o.set("path",`figures/${r.name}`),o.set("figure",r),this.request(`${n(e)}/figures`,{method:"POST",body:o})}refreshLatexPaperCompile(e){return this.request(`${n(e)}/refresh-compile`,{method:"POST"})}stream(e,t){return h("/chat/stream",{method:"POST",headers:{Accept:"text/event-stream"},body:JSON.stringify(e),signal:t})}resumeStream(e,t,r){return h(`/chat/sessions/${encodeURIComponent(e)}/stream`,{method:"GET",headers:{Accept:"text/event-stream",...r&&r>0?{"Last-Event-ID":String(r)}:{}},signal:t})}}const f=new l(p);export{S as a,f as c}; diff --git a/assets/chatLifecycle-DK4zPLlA.js b/assets/chatLifecycle-CUjL6RQJ.js similarity index 99% rename from assets/chatLifecycle-DK4zPLlA.js rename to assets/chatLifecycle-CUjL6RQJ.js index aaffa74107f5338dde90b60f47edea393879a0c9..47f40c14d990173406ee3a5ebcf46f1b2eceb202 100644 --- a/assets/chatLifecycle-DK4zPLlA.js +++ b/assets/chatLifecycle-CUjL6RQJ.js @@ -1,4 +1,4 @@ -var wL=Object.defineProperty;var ck=n=>{throw TypeError(n)};var _L=(n,e,t)=>e in n?wL(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var ae=(n,e,t)=>_L(n,typeof e!="symbol"?e+"":e,t),J0=(n,e,t)=>e.has(n)||ck("Cannot "+t);var f=(n,e,t)=>(J0(n,e,"read from private field"),t?t.call(n):e.get(n)),M=(n,e,t)=>e.has(n)?ck("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),$=(n,e,t,s)=>(J0(n,e,"write to private field"),s?s.call(n,t):e.set(n,t),t),P=(n,e,t)=>(J0(n,e,"access private method"),t);var os=(n,e,t,s)=>({set _(i){$(n,e,i,t)},get _(){return f(n,e,s)}});import{c as To,f as V,j as S,V as ee,b as yo,a4 as G_,a5 as SL,L as Md,a6 as xL,X as n0,a7 as um,a8 as s0,a9 as kL,l as FC,aa as Id,A as AL,C as EL}from"./index-3CfcAX6N.js";import{u as zC,a as CL,c as $L,P as HC,i as TL,b as BC,e as K_,A as PL,o as RL,U as ML,V as IL,W as OL,X as NL,Y as LL,Z as DL,_ as qC,$ as jL}from"./chatSessions-C9fOk1AR.js";/* empty css */import{H as Ip,a as Op,b as Np}from"./hover-card-DOKhkRf9.js";import{f as FL,i as VC,p as zL,C as HL,a as BL,T as qL}from"./CatalogEntityPreviewLink-BzZN33n7.js";import{G as i0}from"./github-vz0wxUgq.js";import{F as UC}from"./file-text-BnjsSheU.js";import{r as VL,a as UL,P as r0,c as WL}from"./PaperPreviewLink-BJAulcHJ.js";import{M as GL,d as KL}from"./index-DGr54pyn.js";import{r as ZL}from"./index-C8DcqbS3.js";import{u as ad}from"./useMutation-CKC6OFhA.js";import{c as ts,a as zo}from"./chat-81nIwu_j.js";import{T as XL}from"./thumbs-up-BMfH8ZZ-.js";import{C as YL}from"./copy-BCi4szva.js";import{q as o0}from"./queryOptions-C9woPjwX.js";import{A as JL}from"./arrow-left-CZqhJnQC.js";import{E as WC}from"./external-link-_7BCdt0S.js";import{P as QL}from"./plus-CiDEk52y.js";import{S as eD}from"./search-SnOvJVk_.js";import{C as GC,a as KC}from"./chevron-up-DgV4G0Wf.js";import{A as tD}from"./AuthorAvatar-DYaYcwPm.js";import{p as nD}from"./papers-BsYlGUQi.js";/** +var wL=Object.defineProperty;var ck=n=>{throw TypeError(n)};var _L=(n,e,t)=>e in n?wL(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var ae=(n,e,t)=>_L(n,typeof e!="symbol"?e+"":e,t),J0=(n,e,t)=>e.has(n)||ck("Cannot "+t);var f=(n,e,t)=>(J0(n,e,"read from private field"),t?t.call(n):e.get(n)),M=(n,e,t)=>e.has(n)?ck("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),$=(n,e,t,s)=>(J0(n,e,"write to private field"),s?s.call(n,t):e.set(n,t),t),P=(n,e,t)=>(J0(n,e,"access private method"),t);var os=(n,e,t,s)=>({set _(i){$(n,e,i,t)},get _(){return f(n,e,s)}});import{c as To,f as V,j as S,V as ee,b as yo,a4 as G_,a5 as SL,L as Md,a6 as xL,X as n0,a7 as um,a8 as s0,a9 as kL,l as FC,aa as Id,A as AL,C as EL}from"./index-CxhY4zQ1.js";import{u as zC,a as CL,c as $L,P as HC,i as TL,b as BC,e as K_,A as PL,o as RL,U as ML,V as IL,W as OL,X as NL,Y as LL,Z as DL,_ as qC,$ as jL}from"./chatSessions-DjtMpqHz.js";/* empty css */import{H as Ip,a as Op,b as Np}from"./hover-card-CqKeZcpY.js";import{f as FL,i as VC,p as zL,C as HL,a as BL,T as qL}from"./CatalogEntityPreviewLink-Bp5A8eb_.js";import{G as i0}from"./github-Bv102r_G.js";import{F as UC}from"./file-text-42n3m1yn.js";import{r as VL,a as UL,P as r0,c as WL}from"./PaperPreviewLink-Y2LI3xZW.js";import{M as GL,d as KL}from"./index-BCjs92mB.js";import{r as ZL}from"./index-mv_8ovfA.js";import{u as ad}from"./useMutation-BzRfwboV.js";import{c as ts,a as zo}from"./chat-CkiIbMG5.js";import{T as XL}from"./thumbs-up-DP1Ac3Tb.js";import{C as YL}from"./copy-Dpy50x4G.js";import{q as o0}from"./queryOptions-C9woPjwX.js";import{A as JL}from"./arrow-left-CDwy-_cK.js";import{E as WC}from"./external-link-UhGsnDEF.js";import{P as QL}from"./plus-CEkdlNSn.js";import{S as eD}from"./search-CkWMhIw6.js";import{C as GC,a as KC}from"./chevron-up-ClmVTWYw.js";import{A as tD}from"./AuthorAvatar-DPz8YQ5Z.js";import{p as nD}from"./papers-BDxSKSYJ.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/chatSessions-C9fOk1AR.js b/assets/chatSessions-DjtMpqHz.js similarity index 99% rename from assets/chatSessions-C9fOk1AR.js rename to assets/chatSessions-DjtMpqHz.js index 86de4ab9d0cf46573bd45ed0ec8a04c2e7d2c5a7..f4d1ff5096b5eaf876e08fdd05464b903ad57bba 100644 --- a/assets/chatSessions-C9fOk1AR.js +++ b/assets/chatSessions-DjtMpqHz.js @@ -1,4 +1,4 @@ -import{j as p,V as f,b as oe,A as Ce,ab as xe}from"./index-3CfcAX6N.js";import{c as k}from"./chat-81nIwu_j.js";import{p as Re}from"./papers-BsYlGUQi.js";const et=({light:e})=>p.jsx("span",{className:`chat-spinner${e?" chat-spinner-light":""}`}),tt=({open:e})=>p.jsx("svg",{className:`chat-chev${e?" chat-chev-open":""}`,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:p.jsx("path",{d:"m6 9 6 6 6-6"})}),rt=()=>p.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[p.jsx("circle",{cx:"12",cy:"12",r:"9"}),p.jsx("path",{d:"m9 12 2 2 4-4"})]}),nt=({size:e=14})=>p.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[p.jsx("circle",{cx:"11",cy:"11",r:"7"}),p.jsx("path",{d:"m21 21-4.3-4.3"})]}),ot=()=>p.jsx("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",children:p.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})}),at=()=>p.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:p.jsx("path",{d:"M12 5v14M5 12h14"})}),st=()=>p.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[p.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),p.jsx("path",{d:"M9 4v16"})]}),it=()=>p.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:p.jsx("path",{d:"M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2M6 6l1 14a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-14"})}),ct=({text:e,mentions:t,scrollTop:r=0,variant:n="composer",completion:o=""})=>{const s=[];let i=0;for(const a of[...t].sort((u,d)=>u.start-d.start)){const u=e.slice(a.start,a.end),d=u===a.title||u===`@${a.title}`;a.starte.length||!d||(s.push(e.slice(i,a.start)),s.push(p.jsx("span",{className:`chat-paper-inline-highlight${a.unavailable?" is-unavailable":""}`,"data-paper-route-id":a.route_id,children:u},a.key)),i=a.end)}return s.push(e.slice(i)),o&&s.push(p.jsx("span",{className:"chat-prompt-completion",children:o},"completion")),e.endsWith(` +import{j as p,V as f,b as oe,A as Ce,ab as xe}from"./index-CxhY4zQ1.js";import{c as k}from"./chat-CkiIbMG5.js";import{p as Re}from"./papers-BDxSKSYJ.js";const et=({light:e})=>p.jsx("span",{className:`chat-spinner${e?" chat-spinner-light":""}`}),tt=({open:e})=>p.jsx("svg",{className:`chat-chev${e?" chat-chev-open":""}`,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:p.jsx("path",{d:"m6 9 6 6 6-6"})}),rt=()=>p.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[p.jsx("circle",{cx:"12",cy:"12",r:"9"}),p.jsx("path",{d:"m9 12 2 2 4-4"})]}),nt=({size:e=14})=>p.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[p.jsx("circle",{cx:"11",cy:"11",r:"7"}),p.jsx("path",{d:"m21 21-4.3-4.3"})]}),ot=()=>p.jsx("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",children:p.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})}),at=()=>p.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:p.jsx("path",{d:"M12 5v14M5 12h14"})}),st=()=>p.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[p.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),p.jsx("path",{d:"M9 4v16"})]}),it=()=>p.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:p.jsx("path",{d:"M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2M6 6l1 14a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-14"})}),ct=({text:e,mentions:t,scrollTop:r=0,variant:n="composer",completion:o=""})=>{const s=[];let i=0;for(const a of[...t].sort((u,d)=>u.start-d.start)){const u=e.slice(a.start,a.end),d=u===a.title||u===`@${a.title}`;a.starte.length||!d||(s.push(e.slice(i,a.start)),s.push(p.jsx("span",{className:`chat-paper-inline-highlight${a.unavailable?" is-unavailable":""}`,"data-paper-route-id":a.route_id,children:u},a.key)),i=a.end)}return s.push(e.slice(i)),o&&s.push(p.jsx("span",{className:"chat-prompt-completion",children:o},"completion")),e.endsWith(` `)&&s.push("​"),p.jsx("div",{"aria-hidden":"true",className:`chat-paper-highlight-layer chat-paper-highlight-layer-${n}`,children:p.jsx("div",{style:{transform:`translateY(-${r}px)`},children:s})})},lt=({open:e,query:t,results:r,activeIndex:n,loading:o,error:s,onSelect:i,id:a="chat-paper-picker",optionIdPrefix:u="chat-paper-option"})=>{if(!e)return null;const d=t.trim()?o?"Searching papers…":s?"Paper search is unavailable":r.length?`${r.length} paper${r.length===1?"":"s"} found`:"No papers found":"Type to search papers";return p.jsxs("div",{className:"chat-paper-picker",id:a,role:"listbox","aria-label":"Paper results",children:[p.jsx("div",{className:"chat-paper-picker-status",role:"status","aria-live":"polite",children:d}),r.map((h,l)=>{const O=h.arxiv_id||h.id,L=h.arxiv_id||(()=>{try{return h.source_url?new URL(h.source_url).hostname:"External resource"}catch{return"External resource"}})();return p.jsxs("button",{type:"button",id:`${u}-${l}`,role:"option","aria-selected":l===n,className:`chat-paper-option${l===n?" is-active":""}`,onMouseDown:Y=>{Y.preventDefault(),i(h)},children:[p.jsx("span",{className:"chat-paper-option-title",children:h.title}),p.jsx("span",{className:"chat-paper-option-meta",children:L})]},O)})]})},ke=["What are decision models?","Find relevant papers on RLVR","What's the state-of-the-art for real-time object detection?"],ut=["Summarize the main contributions","Explain in simple terms","Identify the main limitations"],Ae=[...ke,"What are the latest papers on ","Which benchmarks are used for ","Which methods work best for ","How does ","Explain how ","Compare ","Summarize the key contributions of "],De=3,Ie=4,Le=new Set(["about","all","and","are","best","can","compare","does","explain","find","for","from","give","how","into","latest","list","method","methods","model","models","new","paper","papers","recent","show","state","summarize","task","tasks","the","this","use","what","when","where","which","who","why","with","work"]),Me=new RegExp(`(?:^|(?<=[\\s("'“‘]))(?=\\S)`,"g"),Pe=e=>{const t=e.toLowerCase(),r=Ae.find(n=>n.length>e.length&&n.toLowerCase().startsWith(t));return r?r.slice(e.length):""},Ne=(e,t)=>{const r=[...e.matchAll(Me)].map(n=>n.index??0);for(const n of r.slice(-4)){const o=e.slice(n),s=o.toLowerCase(),i=/\s/.test(o);if(o.length<(i?De:Ie)||!i&&Le.has(s))continue;const a=t.find(u=>u.length>o.length&&u.toLowerCase().startsWith(s));if(a)return a.slice(o.length)}return""},Ye=(e,t)=>!e.trim()||/\s$/.test(e)?"":Pe(e)||Ne(e,t);function dt(e,t=!1){var h;const r=e.text,[n,o]=f.useState(null),s=oe({queryKey:["chatAutocompleteVocabulary"],queryFn:()=>k.getAutocompleteVocabulary(),enabled:r.length>0,staleTime:1/0,gcTime:1/0,retry:!1}),i=(n==null?void 0:n.text)===r?n.atEnd:!0,a=e.paperMentions.some(l=>l.end===r.length);return{completion:!t&&i&&!a?Ye(r,((h=s.data)==null?void 0:h.names)??[]):"",trackCaret:l=>o({text:l.value,atEnd:l.selectionStart===l.selectionEnd&&l.selectionEnd===l.value.length})}}const pt=e=>e.key==="Tab"&&!e.shiftKey&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.nativeEvent.isComposing,ht=e=>{var r;const t=(r=e.parentElement)==null?void 0:r.querySelector(".chat-paper-highlight-layer");return Math.max(e.scrollHeight,(t==null?void 0:t.scrollHeight)??0)},ae=8e3,se=16384,ie=1e4,C={crossPage:"Select text within one PDF page.",outside:"Select text from the paper, not the surrounding interface.",tooLarge:"Select a shorter passage (maximum 8,000 characters)."};function ce(e){return new TextEncoder().encode(e).length}function le(e){return e.replace(/\r\n/g,` `).replace(/\r/g,` `).replace(/\u00a0/g," ").replace(/[^\S\n]+/g," ").trim()}function ft(e){return`${e.routeId}\0${e.paperVersion}\0${e.page}\0${e.text}`}function mt(e){return{route_id:e.routeId,paper_version:e.paperVersion,page:e.page,text:e.text}}function N(e="",t){return t?{text:e,paperMentions:[],paperSelection:t}:{text:e,paperMentions:[]}}function K(e,t,r){return e.paperSelection?{text:t,paperMentions:r,paperSelection:e.paperSelection}:{text:t,paperMentions:r}}function Fe(e){if(!e||typeof e!="object")return;const t=e;if(typeof t.routeId!="string"||!t.routeId.trim()||typeof t.paperVersion!="string"||!t.paperVersion.trim())return;const r=t.page;if(typeof r!="number"||!Number.isInteger(r)||r<1||r>ie||typeof t.text!="string")return;const n=le(t.text);if(n&&!(n.length>ae)&&!(ce(n)>se))return{routeId:t.routeId.trim(),paperVersion:t.paperVersion.trim(),page:r,text:n}}function je(e,t){if(typeof e=="string")return N(e);if(!e||typeof e!="object")return t===void 0?null:N(t);const r=e;if(typeof r.text!="string"||!Array.isArray(r.paperMentions))return t===void 0?null:N(t);const n=Fe(r.paperSelection);return n?{text:r.text,paperMentions:r.paperMentions,paperSelection:n}:{text:r.text,paperMentions:r.paperMentions}}function ue(e){return e?e instanceof Element?e:e.parentElement:null}function G(e,t){const r=ue(e);if(!r||!t.contains(r)||!r.closest(".textLayer, .reader-web-document"))return null;const n=r.closest(".pdf-page[data-page], .reader-web-document[data-page]");if(!n||!t.contains(n))return null;const o=Number(n.dataset.page);return!Number.isInteger(o)||o<1||o>ie?null:o}function gt(e){const{selection:t,pagesRoot:r,routeId:n,paperVersion:o,numPages:s}=e;if(!r||!t||t.rangeCount!==1)return t&&t.rangeCount>1?{ok:!1,error:C.crossPage}:{ok:!1,error:null};const i=t.getRangeAt(0);if(i.collapsed)return{ok:!1,error:null};const a=G(i.startContainer,r),u=G(i.endContainer,r),d=ue(i.commonAncestorContainer);if(!d||!r.contains(d))return{ok:!1,error:C.outside};if(a===null||u===null)return{ok:!1,error:C.outside};if(a!==u)return{ok:!1,error:C.crossPage};if(s&&(a<1||a>s))return{ok:!1,error:C.crossPage};const h=t.toString(),l=le(h);return l?l.length>ae||ce(l)>se?{ok:!1,error:C.tooLarge}:{ok:!0,selection:{routeId:n,paperVersion:o,page:a,text:l}}:{ok:!1,error:C.crossPage}}const qe=10,We=3;function z(e,t){const n=e.slice(0,t).lastIndexOf("@");if(n<0)return null;const o=n>0?e[n-1]:"";if(o&&/[\p{L}\p{M}\p{N}_@]/u.test(o))return null;const s=e.slice(n+1,t);return/[\n\r@]/.test(s)?null:{start:n,end:t,query:s}}function X(e,t,r){let n=0;for(;na.end<=n?[a]:a.start>=s?[{...a,start:a.start+i,end:a.end+i}]:[])}function yt({draft:e,onChange:t,enabled:r,textareaRef:n}){var V;const o=`chat-paper-picker-${f.useId().replace(/:/g,"")}`,s=`${o}-option`,[i,a]=f.useState(null),[u,d]=f.useState(""),[h,l]=f.useState(0),[O,L]=f.useState(""),Y=f.useRef(new Set);f.useEffect(()=>{r||a(null)},[r]),f.useEffect(()=>{const c=window.setTimeout(()=>d((i==null?void 0:i.query.trim())??""),150);return()=>window.clearTimeout(c)},[i==null?void 0:i.query]);const D=oe({queryKey:["chat-paper-mention-search",u.toLowerCase()],queryFn:({signal:c})=>Re.search(u,1,10,"hybrid",c),enabled:r&&!!i&&u.length>=1,staleTime:3e4,refetchOnWindowFocus:!1,retry:!1}),y=f.useMemo(()=>{var c;return((c=D.data)==null?void 0:c.results)??[]},[(V=D.data)==null?void 0:V.results]);f.useEffect(()=>l(0),[u]),f.useEffect(()=>{var c;(c=document.getElementById(`${s}-${h}`))==null||c.scrollIntoView({block:"nearest"})},[h,s]);const be=f.useCallback(c=>{var v;if(!r){a(null);return}const m=c??((v=n.current)==null?void 0:v.selectionStart)??e.text.length;if(e.paperMentions.some(T=>m>T.start&&m<=T.end)){a(null);return}a(z(e.text,m))},[e.paperMentions,e.text,r,n]),Oe=f.useCallback((c,m)=>{var M;const v=X(e.text,c,e.paperMentions),T=K(e,c,v);t(T);const E=m??((M=n.current)==null?void 0:M.selectionStart)??c.length;r&&!v.some(P=>E>P.start&&E<=P.end)?a(z(c,E)):a(null)},[e,r,t,n]),W=f.useCallback(c=>{if(!i)return!1;const m=c.arxiv_id||c.id,v=new Set(e.paperMentions.map(I=>I.route_id));if(e.paperMentions.length>=qe)return L("A message can contain at most 10 paper mentions."),!1;if(!v.has(m)&&v.size>=We)return L("A message can attach at most 3 distinct papers."),!1;const T=c.title,E=e.text.slice(i.end),M=E.length===0,P=e.text.slice(0,i.start)+T+(M?" ":"")+E,Ee=X(e.text,P,e.paperMentions),$={key:crypto.randomUUID(),route_id:m,title:c.title,source:c.source==="external"?"external":"arxiv",start:i.start,end:i.start+T.length};return t(K(e,P,[...Ee,$].sort((I,F)=>I.start-F.start))),a(null),L(""),window.requestAnimationFrame(()=>{var F,B;const I=$.end+(M||E.startsWith(" ")?1:0);(F=n.current)==null||F.focus(),(B=n.current)==null||B.setSelectionRange(I,I)}),Y.current.has(m)||(Y.current.add(m),k.prewarmPaperContext(m).catch(()=>{})),!0},[i,e,t,n]),Te=f.useCallback(c=>!i||c.nativeEvent.isComposing?!1:c.key==="Tab"?(a(null),!1):c.key==="Escape"?(c.preventDefault(),a(null),!0):c.key==="ArrowDown"||c.key==="ArrowUp"?(c.preventDefault(),y.length&&l(m=>c.key==="ArrowDown"?(m+1)%y.length:(m-1+y.length)%y.length),!0):c.key==="Home"&&y.length?(c.preventDefault(),l(0),!0):c.key==="End"&&y.length?(c.preventDefault(),l(y.length-1),!0):c.key==="Enter"&&!c.shiftKey?(c.preventDefault(),y[h]?W(y[h]):D.isFetching||a(null),!0):!1,[i,h,y,D.isFetching,W]);return{open:!!i,query:(i==null?void 0:i.query)??"",results:y,activeIndex:h,loading:D.isFetching,error:D.isError,message:O,pickerId:o,optionIdPrefix:s,updateText:Oe,refresh:be,select:W,keyDown:Te,close:()=>a(null)}}const g=(e,t)=>new Promise(r=>{const n=setTimeout(o,e);function o(){t==null||t.removeEventListener("abort",o),clearTimeout(n),r()}t==null||t.addEventListener("abort",o)}),S=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}),w={name:"Object Detection",slug:"object-detection"},x={name:"Real-Time Object Detection",slug:"real-time-object-detection"},He={"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:S({arxiv_id:"2502.12524",authors:[{name:"Y. Tian"},{name:"Q. Ye"},{name:"D. Doermann"}],published:"2025-02-18",citation_count:412,tasks:[w,x],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:S({arxiv_id:"2407.17140",authors:[{name:"W. Lv"},{name:"Y. Zhao"},{name:"J. Chang"}],published:"2024-07-24",citation_count:268,tasks:[w,x],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:S({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:[w,x],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:S({arxiv_id:"2406.03459",authors:[{name:"Q. Chen"},{name:"X. Su"},{name:"X. Zhang"}],published:"2024-06-05",citation_count:94,tasks:[w,x],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:S({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:[w,x],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:S({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:[w,x],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:S({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"},w],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:S({source:"external",source_url:"https://docs.ultralytics.com/models/",authors:[{name:"Ultralytics"}],published:"2025-01-02",tasks:[w,x],repositories:[{url:"https://github.com/ultralytics/ultralytics",stars:46e3}],project_pages:[{url:"https://docs.ultralytics.com"}]})}},de=e=>e.map(t=>He[t]),J=de(["2502.12524","2407.17140","2410.13842","2406.03459","2304.08069","2405.14458","2401.17270","158342"]),Q=de(["2410.13842","2502.12524","2407.17140","2405.14458","2304.08069"]),Z="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.",ee="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.",te=`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. diff --git a/assets/chevron-up-DgV4G0Wf.js b/assets/chevron-up-ClmVTWYw.js similarity index 91% rename from assets/chevron-up-DgV4G0Wf.js rename to assets/chevron-up-ClmVTWYw.js index ec317da111c191d1690fc37961fe6cd2279c54c1..f2840b0ac9f6383d6f65cf9fd5b1768acd1a3f7e 100644 --- a/assets/chevron-up-DgV4G0Wf.js +++ b/assets/chevron-up-ClmVTWYw.js @@ -1,4 +1,4 @@ -import{c as o}from"./index-3CfcAX6N.js";/** +import{c as o}from"./index-CxhY4zQ1.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/circle-check-D68ytty0.js b/assets/circle-check-CnqnwdL4.js similarity index 88% rename from assets/circle-check-D68ytty0.js rename to assets/circle-check-CnqnwdL4.js index 379ae1caf2de7473481a072ab18df9fc136585ef..5fa4cd53fdf7ffc5e9d36308c3b805c35a270862 100644 --- a/assets/circle-check-D68ytty0.js +++ b/assets/circle-check-CnqnwdL4.js @@ -1,4 +1,4 @@ -import{c}from"./index-3CfcAX6N.js";/** +import{c}from"./index-CxhY4zQ1.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/codex-C7vcS1UO.js b/assets/codex-Bw15uMy8.js similarity index 95% rename from assets/codex-C7vcS1UO.js rename to assets/codex-Bw15uMy8.js index 7b5f09b42df8f7e5c4263725a461a8c722886f5d..c27840c87e7511e0d3bd92ce732ed40050a214d3 100644 --- a/assets/codex-C7vcS1UO.js +++ b/assets/codex-Bw15uMy8.js @@ -1 +1 @@ -import{ac as i,a5 as c}from"./index-3CfcAX6N.js";const u="No paper text was available yet. This job starts again automatically within an hour of the paper's Markdown being extracted.",r="/admin/codex-curation/jobs";class n{constructor(e){this.request=e}startPaperJob(e,t){return this.request(`/admin/codex-${e}/jobs`,{method:"POST",body:JSON.stringify({paper_id:t})})}getPaperJob(e,t){return this.request(`/admin/codex-${e}/jobs/${t}`)}cancelPaperJob(e,t){return this.request(`/admin/codex-${e}/jobs/${t}`,{method:"DELETE"})}listJobs(e=100,t={}){const a=new URLSearchParams({limit:String(e)});return Object.entries(t).forEach(([o,s])=>{s&&a.set(o,s)}),this.request(`${r}?${a}`,{cache:"no-store"})}retryJob(e){return this.request(`${r}/${e}/retry`,{method:"POST"})}cancelJob(e){return this.request(`${r}/${e}`,{method:"DELETE"})}async retryTrace(e){await this.request(`${r}/${e}/retry-trace`,{method:"POST"})}async setScheduler(e){await this.request(`${r}/scheduler/${e}`,{method:"POST"})}async promoteBenchmarkCandidate(e,t){await this.request(`${r}/benchmark-candidates/${e}/promote`,{method:"POST",body:JSON.stringify(t)})}async rollbackBenchmarkCandidate(e){await this.request(`${r}/benchmark-candidates/${e}/rollback`,{method:"POST"})}traceUrl(e){return c(`/api/v1${r}/${e}/trace`)}}const m=new n(i);export{u as A,m as c}; +import{ac as i,a5 as c}from"./index-CxhY4zQ1.js";const u="No paper text was available yet. This job starts again automatically within an hour of the paper's Markdown being extracted.",r="/admin/codex-curation/jobs";class n{constructor(e){this.request=e}startPaperJob(e,t){return this.request(`/admin/codex-${e}/jobs`,{method:"POST",body:JSON.stringify({paper_id:t})})}getPaperJob(e,t){return this.request(`/admin/codex-${e}/jobs/${t}`)}cancelPaperJob(e,t){return this.request(`/admin/codex-${e}/jobs/${t}`,{method:"DELETE"})}listJobs(e=100,t={}){const a=new URLSearchParams({limit:String(e)});return Object.entries(t).forEach(([o,s])=>{s&&a.set(o,s)}),this.request(`${r}?${a}`,{cache:"no-store"})}retryJob(e){return this.request(`${r}/${e}/retry`,{method:"POST"})}cancelJob(e){return this.request(`${r}/${e}`,{method:"DELETE"})}async retryTrace(e){await this.request(`${r}/${e}/retry-trace`,{method:"POST"})}async setScheduler(e){await this.request(`${r}/scheduler/${e}`,{method:"POST"})}async promoteBenchmarkCandidate(e,t){await this.request(`${r}/benchmark-candidates/${e}/promote`,{method:"POST",body:JSON.stringify(t)})}async rollbackBenchmarkCandidate(e){await this.request(`${r}/benchmark-candidates/${e}/rollback`,{method:"POST"})}traceUrl(e){return c(`/api/v1${r}/${e}/trace`)}}const m=new n(i);export{u as A,m as c}; diff --git a/assets/copy-BCi4szva.js b/assets/copy-Dpy50x4G.js similarity index 90% rename from assets/copy-BCi4szva.js rename to assets/copy-Dpy50x4G.js index c1980cfbfbcae53b38c733d14c642e050ce6dcc2..adbc77d620dd21201afb99a02c639b24dd954abb 100644 --- a/assets/copy-BCi4szva.js +++ b/assets/copy-Dpy50x4G.js @@ -1,4 +1,4 @@ -import{c}from"./index-3CfcAX6N.js";/** +import{c}from"./index-CxhY4zQ1.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/curation-BZoIvsHD.js b/assets/curation-D2sqKAqC.js similarity index 98% rename from assets/curation-BZoIvsHD.js rename to assets/curation-D2sqKAqC.js index 4a33787af63dec335e5f381d844520dd7e4278a7..70b8171c27ab95990aff9b549c482801402cb4fd 100644 --- a/assets/curation-BZoIvsHD.js +++ b/assets/curation-D2sqKAqC.js @@ -1 +1 @@ -var f=Object.defineProperty;var w=(i,e,t)=>e in i?f(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var d=(i,e,t)=>w(i,typeof e!="symbol"?e+"":e,t);import{A as l,aR as g,ac as v}from"./index-3CfcAX6N.js";const y={tasks:"tasks",methods:"methods",organizations:"organizations",repositories:"GitHub repositories",project_pages:"project pages",hf_artifacts:"Hugging Face artifacts",source_url:"source URL",x_threads:"X threads",evaluations:"evaluation results"};function _(i){return Object.prototype.hasOwnProperty.call(y,i)}const p="pwc:fresh-auth-edit",c="pwc:fresh-auth-mutation";function E(i){if(typeof window>"u")return;sessionStorage.setItem(p,i);const e=g("/api/v1/auth/hf/login");window.location.assign(`${e}?return_to=${encodeURIComponent(window.location.href)}`)}class S{constructor(e,t=E){d(this,"paperLoads",new Map);d(this,"evaluationLoads",new Map);this.request=e,this.recoverFreshAuth=t}primePaper(e,t=!1){t&&this.paperLoads.delete(e);let s=this.paperLoads.get(e);return s||(s=this.request(`/papers/${e}/curation-state`).catch(o=>{throw this.paperLoads.delete(e),o}),this.paperLoads.set(e,s)),s}primeEvaluations(e,t=!1){t&&this.evaluationLoads.delete(e);let s=this.evaluationLoads.get(e);return s||(s=this.request(`/evaluations/curation-state?paper_id=${e}`).catch(o=>{throw this.evaluationLoads.delete(e),o}),this.evaluationLoads.set(e,s)),s}async mutatePaper(e,t,s,o,a){const r=this.paperLoads.get(e);if(!r)throw new Error("The catalog version was not loaded when this editor opened. Close and reopen the editor.");const h=(await r).sections[t];if(!h)throw new Error(`Missing curation version for ${t}`);return this.mutate(t,o,s,h,a,`paper:${e}:${t}`)}async mutateEvaluations(e,t,s,o){const a=this.evaluationLoads.get(String(e));if(!a)throw new Error("The evaluation version was not loaded when this editor opened. Close and reopen the editor.");const r=(await a).version;return this.mutate("evaluations",s,t,r,o,`paper:${e}:evaluations`)}async mutate(e,t,s,o,a,r){const h=new Headers(a.headers);Object.entries(this.idempotencyHeaders(r,s,o)).forEach(([n,m])=>h.set(n,m));const u={...a,headers:h};try{const n=await this.request(t,u);return this.clearAttempt(u),n}catch(n){throw n instanceof l&&n.status===401&&n.code==="fresh_auth_required"?(this.saveFreshAuthMutation(e,t,s,u),this.recoverFreshAuth(e)):n instanceof l&&n.status===409&&(this.clearAttempt(u),typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:catalog-conflict",{detail:{endpoint:t}}))),n}}freshAuthMutationDraft(){const e=sessionStorage.getItem(c);if(!e)return null;try{const t=JSON.parse(e);if(!t.endpoint.startsWith("/")||t.endpoint.startsWith("//")||!["POST","PUT","PATCH","DELETE"].includes(t.options.method))throw new Error("Invalid saved mutation draft");return t}catch{return sessionStorage.removeItem(c),null}}async resumeFreshAuthMutation(){const e=this.freshAuthMutationDraft();if(!e)throw new Error("No saved catalog edit is available.");const t=await this.request(e.endpoint,{method:e.options.method,body:e.options.body,headers:e.options.headers});return this.clearAttempt({headers:e.options.headers}),sessionStorage.removeItem(c),sessionStorage.removeItem(p),t}saveFreshAuthMutation(e,t,s,o){const a=Object.fromEntries(new Headers(o.headers).entries()),r=typeof o.body=="string"?o.body:void 0;sessionStorage.setItem(c,JSON.stringify({section:e,endpoint:t,payload:s,options:{method:(o.method??"POST").toUpperCase(),body:r,headers:a}}))}idempotencyHeaders(e,t,s){const o=`pwc:mutation:${e}:${JSON.stringify(t)}`,a=sessionStorage.getItem(o);if(a){const h=JSON.parse(a);return{"Idempotency-Key":h.key,"If-Match":h.version}}const r=crypto.randomUUID();return sessionStorage.setItem(o,JSON.stringify({key:r,version:s})),sessionStorage.setItem(`pwc:mutation-key:${r}`,o),{"Idempotency-Key":r,"If-Match":s}}clearAttempt(e){const t=new Headers(e.headers).get("Idempotency-Key");if(!t)return;const s=sessionStorage.getItem(`pwc:mutation-key:${t}`);s&&sessionStorage.removeItem(s),sessionStorage.removeItem(`pwc:mutation-key:${t}`),this.paperLoads.clear(),this.evaluationLoads.clear()}}const T=new S(v);export{p as F,y as P,_ as i,T as p}; +var f=Object.defineProperty;var w=(i,e,t)=>e in i?f(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var d=(i,e,t)=>w(i,typeof e!="symbol"?e+"":e,t);import{A as l,aR as g,ac as v}from"./index-CxhY4zQ1.js";const y={tasks:"tasks",methods:"methods",organizations:"organizations",repositories:"GitHub repositories",project_pages:"project pages",hf_artifacts:"Hugging Face artifacts",source_url:"source URL",x_threads:"X threads",evaluations:"evaluation results"};function _(i){return Object.prototype.hasOwnProperty.call(y,i)}const p="pwc:fresh-auth-edit",c="pwc:fresh-auth-mutation";function E(i){if(typeof window>"u")return;sessionStorage.setItem(p,i);const e=g("/api/v1/auth/hf/login");window.location.assign(`${e}?return_to=${encodeURIComponent(window.location.href)}`)}class S{constructor(e,t=E){d(this,"paperLoads",new Map);d(this,"evaluationLoads",new Map);this.request=e,this.recoverFreshAuth=t}primePaper(e,t=!1){t&&this.paperLoads.delete(e);let s=this.paperLoads.get(e);return s||(s=this.request(`/papers/${e}/curation-state`).catch(o=>{throw this.paperLoads.delete(e),o}),this.paperLoads.set(e,s)),s}primeEvaluations(e,t=!1){t&&this.evaluationLoads.delete(e);let s=this.evaluationLoads.get(e);return s||(s=this.request(`/evaluations/curation-state?paper_id=${e}`).catch(o=>{throw this.evaluationLoads.delete(e),o}),this.evaluationLoads.set(e,s)),s}async mutatePaper(e,t,s,o,a){const r=this.paperLoads.get(e);if(!r)throw new Error("The catalog version was not loaded when this editor opened. Close and reopen the editor.");const h=(await r).sections[t];if(!h)throw new Error(`Missing curation version for ${t}`);return this.mutate(t,o,s,h,a,`paper:${e}:${t}`)}async mutateEvaluations(e,t,s,o){const a=this.evaluationLoads.get(String(e));if(!a)throw new Error("The evaluation version was not loaded when this editor opened. Close and reopen the editor.");const r=(await a).version;return this.mutate("evaluations",s,t,r,o,`paper:${e}:evaluations`)}async mutate(e,t,s,o,a,r){const h=new Headers(a.headers);Object.entries(this.idempotencyHeaders(r,s,o)).forEach(([n,m])=>h.set(n,m));const u={...a,headers:h};try{const n=await this.request(t,u);return this.clearAttempt(u),n}catch(n){throw n instanceof l&&n.status===401&&n.code==="fresh_auth_required"?(this.saveFreshAuthMutation(e,t,s,u),this.recoverFreshAuth(e)):n instanceof l&&n.status===409&&(this.clearAttempt(u),typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:catalog-conflict",{detail:{endpoint:t}}))),n}}freshAuthMutationDraft(){const e=sessionStorage.getItem(c);if(!e)return null;try{const t=JSON.parse(e);if(!t.endpoint.startsWith("/")||t.endpoint.startsWith("//")||!["POST","PUT","PATCH","DELETE"].includes(t.options.method))throw new Error("Invalid saved mutation draft");return t}catch{return sessionStorage.removeItem(c),null}}async resumeFreshAuthMutation(){const e=this.freshAuthMutationDraft();if(!e)throw new Error("No saved catalog edit is available.");const t=await this.request(e.endpoint,{method:e.options.method,body:e.options.body,headers:e.options.headers});return this.clearAttempt({headers:e.options.headers}),sessionStorage.removeItem(c),sessionStorage.removeItem(p),t}saveFreshAuthMutation(e,t,s,o){const a=Object.fromEntries(new Headers(o.headers).entries()),r=typeof o.body=="string"?o.body:void 0;sessionStorage.setItem(c,JSON.stringify({section:e,endpoint:t,payload:s,options:{method:(o.method??"POST").toUpperCase(),body:r,headers:a}}))}idempotencyHeaders(e,t,s){const o=`pwc:mutation:${e}:${JSON.stringify(t)}`,a=sessionStorage.getItem(o);if(a){const h=JSON.parse(a);return{"Idempotency-Key":h.key,"If-Match":h.version}}const r=crypto.randomUUID();return sessionStorage.setItem(o,JSON.stringify({key:r,version:s})),sessionStorage.setItem(`pwc:mutation-key:${r}`,o),{"Idempotency-Key":r,"If-Match":s}}clearAttempt(e){const t=new Headers(e.headers).get("Idempotency-Key");if(!t)return;const s=sessionStorage.getItem(`pwc:mutation-key:${t}`);s&&sessionStorage.removeItem(s),sessionStorage.removeItem(`pwc:mutation-key:${t}`),this.paperLoads.clear(),this.evaluationLoads.clear()}}const T=new S(v);export{p as F,y as P,_ as i,T as p}; diff --git a/assets/database-ut7m-SnN.js b/assets/database-DTsYk9y1.js similarity index 89% rename from assets/database-ut7m-SnN.js rename to assets/database-DTsYk9y1.js index b687f1f31495fa6270bd97d0ce9d71fdf5094399..8eb45a5bdba8f9c71ba67a9d3952603602e0dfc1 100644 --- a/assets/database-ut7m-SnN.js +++ b/assets/database-DTsYk9y1.js @@ -1,4 +1,4 @@ -import{c as e}from"./index-3CfcAX6N.js";/** +import{c as e}from"./index-CxhY4zQ1.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/dialog-Bbx5GVcy.js b/assets/dialog-CT48f48_.js similarity index 96% rename from assets/dialog-Bbx5GVcy.js rename to assets/dialog-CT48f48_.js index fb1e7dc6326280cd5549e04c5113b695fb155ac3..cd061e8feb8d18f107ea956e6363007ff0a2f99c 100644 --- a/assets/dialog-Bbx5GVcy.js +++ b/assets/dialog-CT48f48_.js @@ -1 +1 @@ -import{ag as f,f as l,j as t,ah as p,aj as d,al as g,X as x,I as o,ai as n,am as i,an as r}from"./index-3CfcAX6N.js";const w=f,u=p,c=l.forwardRef(({className:a,...e},s)=>t.jsx(n,{ref:s,className:o("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...e}));c.displayName=n.displayName;const y=l.forwardRef(({className:a,children:e,...s},m)=>t.jsxs(u,{children:[t.jsx(c,{}),t.jsxs(d,{ref:m,className:o("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",a),...s,children:[e,t.jsxs(g,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[t.jsx(x,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));y.displayName=d.displayName;const N=({className:a,...e})=>t.jsx("div",{className:o("flex flex-col space-y-1.5 text-center sm:text-left",a),...e});N.displayName="DialogHeader";const j=({className:a,...e})=>t.jsx("div",{className:o("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a),...e});j.displayName="DialogFooter";const D=l.forwardRef(({className:a,...e},s)=>t.jsx(i,{ref:s,className:o("text-lg font-semibold leading-none tracking-tight",a),...e}));D.displayName=i.displayName;const b=l.forwardRef(({className:a,...e},s)=>t.jsx(r,{ref:s,className:o("text-sm text-muted-foreground",a),...e}));b.displayName=r.displayName;export{w as D,y as a,D as b,N as c,b as d,j as e}; +import{ag as f,f as l,j as t,ah as p,aj as d,al as g,X as x,I as o,ai as n,am as i,an as r}from"./index-CxhY4zQ1.js";const w=f,u=p,c=l.forwardRef(({className:a,...e},s)=>t.jsx(n,{ref:s,className:o("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...e}));c.displayName=n.displayName;const y=l.forwardRef(({className:a,children:e,...s},m)=>t.jsxs(u,{children:[t.jsx(c,{}),t.jsxs(d,{ref:m,className:o("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",a),...s,children:[e,t.jsxs(g,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[t.jsx(x,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));y.displayName=d.displayName;const N=({className:a,...e})=>t.jsx("div",{className:o("flex flex-col space-y-1.5 text-center sm:text-left",a),...e});N.displayName="DialogHeader";const j=({className:a,...e})=>t.jsx("div",{className:o("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a),...e});j.displayName="DialogFooter";const D=l.forwardRef(({className:a,...e},s)=>t.jsx(i,{ref:s,className:o("text-lg font-semibold leading-none tracking-tight",a),...e}));D.displayName=i.displayName;const b=l.forwardRef(({className:a,...e},s)=>t.jsx(r,{ref:s,className:o("text-sm text-muted-foreground",a),...e}));b.displayName=r.displayName;export{w as D,y as a,D as b,N as c,b as d,j as e}; diff --git a/assets/evaluationQueryInvalidation-BJCX6Q6o.js b/assets/evaluationQueryInvalidation-PEtgmyxY.js similarity index 97% rename from assets/evaluationQueryInvalidation-BJCX6Q6o.js rename to assets/evaluationQueryInvalidation-PEtgmyxY.js index b4b925e8033ccbaedb5ebae923419d0eeaa24ad9..8d04bebbd81912a9370d2af2cb3986bd6f995d05 100644 --- a/assets/evaluationQueryInvalidation-BJCX6Q6o.js +++ b/assets/evaluationQueryInvalidation-PEtgmyxY.js @@ -1 +1 @@ -var z=a=>{throw TypeError(a)};var I=(a,e,t)=>e.has(a)||z("Cannot "+t);var u=(a,e,t)=>(I(a,e,"read from private field"),t?t.call(a):e.get(a)),v=(a,e,t)=>e.has(a)?z("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(a):e.set(a,t),l=(a,e,t,s)=>(I(a,e,"write to private field"),s?s.call(a,t):e.set(a,t),t),g=(a,e,t)=>(I(a,e,"access private method"),t);import{aB as Y,aF as H,aC as Z,aS as J,aN as N,l as W,aT as ee,aU as se,f as C,aV as te,aW as re,aX as ae,aG as ie,aY as F,aZ as ne,a_ as oe,t as A,q as B}from"./index-3CfcAX6N.js";import{i as ue,a as ce}from"./queryInvalidation-CO_YWd6U.js";function j(a,e){const t=new Set(e);return a.filter(s=>!t.has(s))}function de(a,e,t){const s=a.slice(0);return s[e]=t,s}var _,f,w,E,y,k,x,K,M,P,d,L,D,V,T,$,U,G,he=(G=class extends Y{constructor(e,t,s){super();v(this,d);v(this,_);v(this,f);v(this,w);v(this,E);v(this,y);v(this,k);v(this,x);v(this,K);v(this,M);v(this,P,[]);l(this,_,e),l(this,E,s),l(this,w,[]),l(this,y,[]),l(this,f,[]),this.setQueries(t)}onSubscribe(){this.listeners.size===1&&u(this,y).forEach(e=>{e.subscribe(t=>{g(this,d,$).call(this,e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,u(this,y).forEach(e=>{e.destroy()})}setQueries(e,t){l(this,w,e),l(this,E,t),H.batch(()=>{const s=u(this,y),n=g(this,d,T).call(this,u(this,w));n.forEach(i=>i.observer.setOptions(i.defaultedQueryOptions));const r=n.map(i=>i.observer),o=r.map(i=>i.getCurrentResult()),h=s.length!==r.length,m=r.some((i,b)=>i!==s[b]),S=h||m,c=S?!0:o.some((i,b)=>{const R=u(this,f)[b];return!R||!Z(i,R)});!S&&!c||(S&&(l(this,P,n),l(this,y,r)),l(this,f,o),this.hasListeners()&&(S&&(j(s,r).forEach(i=>{i.destroy()}),j(r,s).forEach(i=>{i.subscribe(b=>{g(this,d,$).call(this,i,b)})})),g(this,d,U).call(this)))})}getCurrentResult(){return u(this,f)}getQueries(){return u(this,y).map(e=>e.getCurrentQuery())}getObservers(){return u(this,y)}getOptimisticResult(e,t){const s=g(this,d,T).call(this,e),n=s.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),r=s.map(o=>o.defaultedQueryOptions.queryHash);return[n,o=>g(this,d,D).call(this,o??n,t,r),()=>g(this,d,L).call(this,n,s)]}},_=new WeakMap,f=new WeakMap,w=new WeakMap,E=new WeakMap,y=new WeakMap,k=new WeakMap,x=new WeakMap,K=new WeakMap,M=new WeakMap,P=new WeakMap,d=new WeakSet,L=function(e,t){return t.map((s,n)=>{const r=e[n];return s.defaultedQueryOptions.notifyOnChangeProps?r:s.observer.trackResult(r,o=>{t.forEach(h=>{h.observer.trackProp(o)})})})},D=function(e,t,s){if(t){const n=u(this,M),r=s!==void 0&&n!==void 0&&(n.length!==s.length||s.some((o,h)=>o!==n[h]));return(!u(this,k)||u(this,f)!==u(this,K)||r||t!==u(this,x))&&(l(this,x,t),l(this,K,u(this,f)),s!==void 0&&l(this,M,s),l(this,k,J(u(this,k),t(e)))),u(this,k)}return e},V=function(){var e;return((e=u(this,E))==null?void 0:e.combine)!==void 0&&u(this,y).some((t,s)=>{var n;return t.options.suspense&&((n=u(this,f)[s])==null?void 0:n.data)===void 0})},T=function(e){const t=new Map;u(this,y).forEach(n=>{const r=n.options.queryHash;if(!r)return;const o=t.get(r);o?o.push(n):t.set(r,[n])});const s=[];return e.forEach(n=>{var m;const r=u(this,_).defaultQueryOptions(n),h=((m=t.get(r.queryHash))==null?void 0:m.shift())??new N(u(this,_),r);s.push({defaultedQueryOptions:r,observer:h})}),s},$=function(e,t){const s=u(this,y).indexOf(e);s!==-1&&(l(this,f,de(u(this,f),s,t)),g(this,d,U).call(this))},U=function(){var e;if(this.hasListeners()){const t=g(this,d,L).call(this,u(this,f),u(this,P)),s=g(this,d,V).call(this),n=u(this,k),r=s?n:g(this,d,D).call(this,t,(e=u(this,E))==null?void 0:e.combine);(s||n!==r)&&H.batch(()=>{this.listeners.forEach(o=>{o(u(this,f))})})}},G);function ye({queries:a,...e},t){const s=W(),n=ee(),r=se(),o=C.useMemo(()=>a.map(p=>{const Q=s.defaultQueryOptions(p);return Q._optimisticResults=n?"isRestoring":"optimistic",Q}),[a,s,n]);o.forEach(p=>{te(p);const Q=s.getQueryCache().get(p.queryHash);re(p,r,Q)}),ae(r);const[h]=C.useState(()=>new he(s,o,e)),[m,S,c]=h.getOptimisticResult(o,e.combine),i=!n&&e.subscribed!==!1;C.useSyncExternalStore(C.useCallback(p=>i?h.subscribe(H.batchCalls(p)):ie,[h,i]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),C.useEffect(()=>{h.setQueries(o,e)},[o,e,h]);const R=m.some((p,Q)=>F(o[Q],p))?m.flatMap((p,Q)=>{const O=o[Q];if(O&&F(O,p)){const X=new N(s,O);return ne(O,X,r)}return[]}):[];if(R.length>0)throw Promise.all(R);const q=m.find((p,Q)=>{const O=o[Q];return O&&oe({result:p,errorResetBoundary:r,throwOnError:O.throwOnError,query:s.getQueryCache().get(O.queryHash),suspense:O.suspense})});if(q!=null&&q.error)throw q.error;return S(c())}function be(a,e,t,s){const n=new Set(t.flatMap(r=>r.op==="create"?[]:[String(r.evaluation_id)]));return{paperId:a,arxivId:s,contexts:[...e.filter(r=>r.id!==void 0&&n.has(String(r.id))),...t.flatMap(r=>r.op==="delete"?[]:[r.data])]}}function ve(a,e){const t=new Set(e.contexts.flatMap(c=>c.dataset_id==null?[]:[String(c.dataset_id)])),s=new Set(e.contexts.flatMap(c=>c.task_id==null?[]:[String(c.task_id)])),n=new Set([e.paperId]),r=new Set;e.arxivId&&r.add(e.arxivId);const o=new Set(e.contexts.map(c=>`${c.task_id}:${c.dataset_id}`)),h=a.getQueryCache(),m=[...h.findAll({queryKey:A.byDatasetAll}),...h.findAll({queryKey:A.byPaperAll})];for(const c of m)for(const i of c.state.data??[])o.has(`${i.task_id}:${i.dataset_id}`)&&(n.add(String(i.paper_id)),i.paper_arxiv_id&&r.add(i.paper_arxiv_id));ue(a,[...n,...r]),ce(a),a.invalidateQueries({queryKey:A.byPaperAll,predicate:c=>n.has(String(c.queryKey[2]))});const S=c=>t.has(String(c.queryKey[1]));a.invalidateQueries({queryKey:A.byDatasetAll,predicate:S}),a.invalidateQueries({queryKey:B.datasetTasks,predicate:S}),a.invalidateQueries({queryKey:B.datasets,predicate:c=>{const i=c.state.data;return S(c)||!!(i&&t.has(String(i.id)))}}),a.invalidateQueries({queryKey:B.taskPage,predicate:c=>{const i=c.state.data;return s.has(String(c.queryKey[1]))||!!(i&&(s.has(String(i.task.id))||i.subtask_benchmarks.some(b=>s.has(String(b.subtask_id)))||i.benchmarks.some(b=>t.has(String(b.id)))||i.subtask_benchmarks.some(b=>b.benchmarks.some(R=>t.has(String(R.id))))))}}),a.invalidateQueries({queryKey:B.taskBenchmarkTrends,predicate:c=>{const i=c.state.data;return s.has(String(c.queryKey[1]))||!!(i&&s.has(String(i.task_id)))}})}export{be as e,ve as r,ye as u}; +var z=a=>{throw TypeError(a)};var I=(a,e,t)=>e.has(a)||z("Cannot "+t);var u=(a,e,t)=>(I(a,e,"read from private field"),t?t.call(a):e.get(a)),v=(a,e,t)=>e.has(a)?z("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(a):e.set(a,t),l=(a,e,t,s)=>(I(a,e,"write to private field"),s?s.call(a,t):e.set(a,t),t),g=(a,e,t)=>(I(a,e,"access private method"),t);import{aB as Y,aF as H,aC as Z,aS as J,aN as N,l as W,aT as ee,aU as se,f as C,aV as te,aW as re,aX as ae,aG as ie,aY as F,aZ as ne,a_ as oe,t as A,q as B}from"./index-CxhY4zQ1.js";import{i as ue,a as ce}from"./queryInvalidation-Djot7Ix_.js";function j(a,e){const t=new Set(e);return a.filter(s=>!t.has(s))}function de(a,e,t){const s=a.slice(0);return s[e]=t,s}var _,f,w,E,y,k,x,K,M,P,d,L,D,V,T,$,U,G,he=(G=class extends Y{constructor(e,t,s){super();v(this,d);v(this,_);v(this,f);v(this,w);v(this,E);v(this,y);v(this,k);v(this,x);v(this,K);v(this,M);v(this,P,[]);l(this,_,e),l(this,E,s),l(this,w,[]),l(this,y,[]),l(this,f,[]),this.setQueries(t)}onSubscribe(){this.listeners.size===1&&u(this,y).forEach(e=>{e.subscribe(t=>{g(this,d,$).call(this,e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,u(this,y).forEach(e=>{e.destroy()})}setQueries(e,t){l(this,w,e),l(this,E,t),H.batch(()=>{const s=u(this,y),n=g(this,d,T).call(this,u(this,w));n.forEach(i=>i.observer.setOptions(i.defaultedQueryOptions));const r=n.map(i=>i.observer),o=r.map(i=>i.getCurrentResult()),h=s.length!==r.length,m=r.some((i,b)=>i!==s[b]),S=h||m,c=S?!0:o.some((i,b)=>{const R=u(this,f)[b];return!R||!Z(i,R)});!S&&!c||(S&&(l(this,P,n),l(this,y,r)),l(this,f,o),this.hasListeners()&&(S&&(j(s,r).forEach(i=>{i.destroy()}),j(r,s).forEach(i=>{i.subscribe(b=>{g(this,d,$).call(this,i,b)})})),g(this,d,U).call(this)))})}getCurrentResult(){return u(this,f)}getQueries(){return u(this,y).map(e=>e.getCurrentQuery())}getObservers(){return u(this,y)}getOptimisticResult(e,t){const s=g(this,d,T).call(this,e),n=s.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),r=s.map(o=>o.defaultedQueryOptions.queryHash);return[n,o=>g(this,d,D).call(this,o??n,t,r),()=>g(this,d,L).call(this,n,s)]}},_=new WeakMap,f=new WeakMap,w=new WeakMap,E=new WeakMap,y=new WeakMap,k=new WeakMap,x=new WeakMap,K=new WeakMap,M=new WeakMap,P=new WeakMap,d=new WeakSet,L=function(e,t){return t.map((s,n)=>{const r=e[n];return s.defaultedQueryOptions.notifyOnChangeProps?r:s.observer.trackResult(r,o=>{t.forEach(h=>{h.observer.trackProp(o)})})})},D=function(e,t,s){if(t){const n=u(this,M),r=s!==void 0&&n!==void 0&&(n.length!==s.length||s.some((o,h)=>o!==n[h]));return(!u(this,k)||u(this,f)!==u(this,K)||r||t!==u(this,x))&&(l(this,x,t),l(this,K,u(this,f)),s!==void 0&&l(this,M,s),l(this,k,J(u(this,k),t(e)))),u(this,k)}return e},V=function(){var e;return((e=u(this,E))==null?void 0:e.combine)!==void 0&&u(this,y).some((t,s)=>{var n;return t.options.suspense&&((n=u(this,f)[s])==null?void 0:n.data)===void 0})},T=function(e){const t=new Map;u(this,y).forEach(n=>{const r=n.options.queryHash;if(!r)return;const o=t.get(r);o?o.push(n):t.set(r,[n])});const s=[];return e.forEach(n=>{var m;const r=u(this,_).defaultQueryOptions(n),h=((m=t.get(r.queryHash))==null?void 0:m.shift())??new N(u(this,_),r);s.push({defaultedQueryOptions:r,observer:h})}),s},$=function(e,t){const s=u(this,y).indexOf(e);s!==-1&&(l(this,f,de(u(this,f),s,t)),g(this,d,U).call(this))},U=function(){var e;if(this.hasListeners()){const t=g(this,d,L).call(this,u(this,f),u(this,P)),s=g(this,d,V).call(this),n=u(this,k),r=s?n:g(this,d,D).call(this,t,(e=u(this,E))==null?void 0:e.combine);(s||n!==r)&&H.batch(()=>{this.listeners.forEach(o=>{o(u(this,f))})})}},G);function ye({queries:a,...e},t){const s=W(),n=ee(),r=se(),o=C.useMemo(()=>a.map(p=>{const Q=s.defaultQueryOptions(p);return Q._optimisticResults=n?"isRestoring":"optimistic",Q}),[a,s,n]);o.forEach(p=>{te(p);const Q=s.getQueryCache().get(p.queryHash);re(p,r,Q)}),ae(r);const[h]=C.useState(()=>new he(s,o,e)),[m,S,c]=h.getOptimisticResult(o,e.combine),i=!n&&e.subscribed!==!1;C.useSyncExternalStore(C.useCallback(p=>i?h.subscribe(H.batchCalls(p)):ie,[h,i]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),C.useEffect(()=>{h.setQueries(o,e)},[o,e,h]);const R=m.some((p,Q)=>F(o[Q],p))?m.flatMap((p,Q)=>{const O=o[Q];if(O&&F(O,p)){const X=new N(s,O);return ne(O,X,r)}return[]}):[];if(R.length>0)throw Promise.all(R);const q=m.find((p,Q)=>{const O=o[Q];return O&&oe({result:p,errorResetBoundary:r,throwOnError:O.throwOnError,query:s.getQueryCache().get(O.queryHash),suspense:O.suspense})});if(q!=null&&q.error)throw q.error;return S(c())}function be(a,e,t,s){const n=new Set(t.flatMap(r=>r.op==="create"?[]:[String(r.evaluation_id)]));return{paperId:a,arxivId:s,contexts:[...e.filter(r=>r.id!==void 0&&n.has(String(r.id))),...t.flatMap(r=>r.op==="delete"?[]:[r.data])]}}function ve(a,e){const t=new Set(e.contexts.flatMap(c=>c.dataset_id==null?[]:[String(c.dataset_id)])),s=new Set(e.contexts.flatMap(c=>c.task_id==null?[]:[String(c.task_id)])),n=new Set([e.paperId]),r=new Set;e.arxivId&&r.add(e.arxivId);const o=new Set(e.contexts.map(c=>`${c.task_id}:${c.dataset_id}`)),h=a.getQueryCache(),m=[...h.findAll({queryKey:A.byDatasetAll}),...h.findAll({queryKey:A.byPaperAll})];for(const c of m)for(const i of c.state.data??[])o.has(`${i.task_id}:${i.dataset_id}`)&&(n.add(String(i.paper_id)),i.paper_arxiv_id&&r.add(i.paper_arxiv_id));ue(a,[...n,...r]),ce(a),a.invalidateQueries({queryKey:A.byPaperAll,predicate:c=>n.has(String(c.queryKey[2]))});const S=c=>t.has(String(c.queryKey[1]));a.invalidateQueries({queryKey:A.byDatasetAll,predicate:S}),a.invalidateQueries({queryKey:B.datasetTasks,predicate:S}),a.invalidateQueries({queryKey:B.datasets,predicate:c=>{const i=c.state.data;return S(c)||!!(i&&t.has(String(i.id)))}}),a.invalidateQueries({queryKey:B.taskPage,predicate:c=>{const i=c.state.data;return s.has(String(c.queryKey[1]))||!!(i&&(s.has(String(i.task.id))||i.subtask_benchmarks.some(b=>s.has(String(b.subtask_id)))||i.benchmarks.some(b=>t.has(String(b.id)))||i.subtask_benchmarks.some(b=>b.benchmarks.some(R=>t.has(String(R.id))))))}}),a.invalidateQueries({queryKey:B.taskBenchmarkTrends,predicate:c=>{const i=c.state.data;return s.has(String(c.queryKey[1]))||!!(i&&s.has(String(i.task_id)))}})}export{be as e,ve as r,ye as u}; diff --git a/assets/external-link-_7BCdt0S.js b/assets/external-link-UhGsnDEF.js similarity index 89% rename from assets/external-link-_7BCdt0S.js rename to assets/external-link-UhGsnDEF.js index ae71ef40a92592187843532eea6722409aaccce5..46d4c5990774749edd756359401feeaad4baaa61 100644 --- a/assets/external-link-_7BCdt0S.js +++ b/assets/external-link-UhGsnDEF.js @@ -1,4 +1,4 @@ -import{c as a}from"./index-3CfcAX6N.js";/** +import{c as a}from"./index-CxhY4zQ1.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/file-text-BnjsSheU.js b/assets/file-text-42n3m1yn.js similarity index 91% rename from assets/file-text-BnjsSheU.js rename to assets/file-text-42n3m1yn.js index 9660167965e1ad9a2b799e359d407e4070a97835..19d83c0e7015615d9892d4d3235d62f45e48185b 100644 --- a/assets/file-text-BnjsSheU.js +++ b/assets/file-text-42n3m1yn.js @@ -1,4 +1,4 @@ -import{c as e}from"./index-3CfcAX6N.js";/** +import{c as e}from"./index-CxhY4zQ1.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/github-vz0wxUgq.js b/assets/github-Bv102r_G.js similarity index 93% rename from assets/github-vz0wxUgq.js rename to assets/github-Bv102r_G.js index 3be68379f8ad5c710b988bd28ad02eb26b7661ea..b2f28d3d896ac7df0cdc3ba3895a8e627bed3ca2 100644 --- a/assets/github-vz0wxUgq.js +++ b/assets/github-Bv102r_G.js @@ -1,4 +1,4 @@ -import{c}from"./index-3CfcAX6N.js";/** +import{c}from"./index-CxhY4zQ1.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/globe-DZ-1g_DI.js b/assets/globe-DIhafOmF.js similarity index 89% rename from assets/globe-DZ-1g_DI.js rename to assets/globe-DIhafOmF.js index 863ebf8655ed8fcf3ff1c57a032fa2d28dee7b32..1add7a8cb5db40dbbdfca803f7502b913208a25b 100644 --- a/assets/globe-DZ-1g_DI.js +++ b/assets/globe-DIhafOmF.js @@ -1,4 +1,4 @@ -import{c as e}from"./index-3CfcAX6N.js";/** +import{c as e}from"./index-CxhY4zQ1.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/hover-card-DOKhkRf9.js b/assets/hover-card-CqKeZcpY.js similarity index 98% rename from assets/hover-card-DOKhkRf9.js rename to assets/hover-card-CqKeZcpY.js index 6aaa3e60de0dff0c3090ca544485246d1d85fc50..209cc30140ad8462a9cdc8c4edf257b8f1003c36 100644 --- a/assets/hover-card-DOKhkRf9.js +++ b/assets/hover-card-CqKeZcpY.js @@ -1 +1 @@ -import{f as n,B as k,j as c,ap as F,aq as I,z as U,E as l,ar as T,P as O,as as $,G as z,D as B,at as W,au as G,av as K,I as q}from"./index-3CfcAX6N.js";var E,g="HoverCard",[y]=z(g,[T]),w=T(),[V,S]=y(g),N=e=>{const{__scopeHoverCard:o,children:r,open:s,defaultOpen:a,onOpenChange:i,openDelay:f=700,closeDelay:v=300}=e,d=w(o),C=n.useRef(0),u=n.useRef(0),h=n.useRef(!1),p=n.useRef(!1),[m,t]=k({prop:s,defaultProp:a??!1,onChange:i,caller:g}),x=n.useCallback(()=>{clearTimeout(u.current),C.current=window.setTimeout(()=>t(!0),f)},[f,t]),P=n.useCallback(()=>{clearTimeout(C.current),!h.current&&!p.current&&(u.current=window.setTimeout(()=>t(!1),v))},[v,t]),M=n.useCallback(()=>t(!1),[t]);return n.useEffect(()=>()=>{clearTimeout(C.current),clearTimeout(u.current)},[]),c.jsx(V,{scope:o,open:m,onOpenChange:t,onOpen:x,onClose:P,onDismiss:M,hasSelectionRef:h,isPointerDownOnContentRef:p,children:c.jsx(F,{...d,children:r})})};N.displayName=g;var _="HoverCardTrigger",D=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=S(_,r),i=w(r);return c.jsx(I,{asChild:!0,...i,children:c.jsx(U.a,{"data-state":a.open?"open":"closed",...s,ref:o,onPointerEnter:l(e.onPointerEnter,b(a.onOpen)),onPointerLeave:l(e.onPointerLeave,b(a.onClose)),onFocus:l(e.onFocus,a.onOpen),onBlur:l(e.onBlur,a.onClose),onTouchStart:l(e.onTouchStart,f=>f.preventDefault())})})});D.displayName=_;var H="HoverCardPortal",[J,Q]=y(H,{forceMount:void 0}),j=e=>{const{__scopeHoverCard:o,forceMount:r,children:s,container:a}=e,i=S(H,o);return c.jsx(J,{scope:o,forceMount:r,children:c.jsx(O,{present:r||i.open,children:c.jsx($,{asChild:!0,container:a,children:s})})})};j.displayName=H;var R="HoverCardContent",A=n.forwardRef((e,o)=>{const r=Q(R,e.__scopeHoverCard),{forceMount:s=r.forceMount,...a}=e,i=S(R,e.__scopeHoverCard);return c.jsx(O,{present:s||i.open,children:c.jsx(X,{"data-state":i.open?"open":"closed",...a,onPointerEnter:l(e.onPointerEnter,b(i.onOpen)),onPointerLeave:l(e.onPointerLeave,b(i.onClose)),ref:o})})});A.displayName=R;var X=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:f,...v}=e,d=S(R,r),C=w(r),u=n.useRef(null),h=B(o,u),[p,m]=n.useState(!1);return n.useEffect(()=>{if(p){const t=document.body;return E=t.style.userSelect||t.style.webkitUserSelect,t.style.userSelect="none",t.style.webkitUserSelect="none",()=>{t.style.userSelect=E,t.style.webkitUserSelect=E}}},[p]),n.useEffect(()=>{if(u.current){const t=()=>{m(!1),d.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var P;((P=document.getSelection())==null?void 0:P.toString())!==""&&(d.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",t),()=>{document.removeEventListener("pointerup",t),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!1}}},[d.isPointerDownOnContentRef,d.hasSelectionRef]),n.useEffect(()=>{u.current&&ee(u.current).forEach(x=>x.setAttribute("tabindex","-1"))}),c.jsx(W,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:f,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:l(i,t=>{t.preventDefault()}),onDismiss:d.onDismiss,children:c.jsx(G,{...C,...v,onPointerDown:l(v.onPointerDown,t=>{t.currentTarget.contains(t.target)&&m(!0),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!0}),ref:h,style:{...v.style,userSelect:p?"text":void 0,WebkitUserSelect:p?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),Y="HoverCardArrow",Z=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=w(r);return c.jsx(K,{...a,...s,ref:o})});Z.displayName=Y;function b(e){return o=>o.pointerType==="touch"?void 0:e()}function ee(e){const o=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;r.nextNode();)o.push(r.currentNode);return o}var te=N,oe=D,re=j,L=A;const se=te,ce=oe,ne=n.forwardRef(({className:e,align:o="center",sideOffset:r=4,...s},a)=>c.jsx(re,{children:c.jsx(L,{ref:a,align:o,sideOffset:r,className:q("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...s})}));ne.displayName=L.displayName;export{se as H,ce as a,ne as b}; +import{f as n,B as k,j as c,ap as F,aq as I,z as U,E as l,ar as T,P as O,as as $,G as z,D as B,at as W,au as G,av as K,I as q}from"./index-CxhY4zQ1.js";var E,g="HoverCard",[y]=z(g,[T]),w=T(),[V,S]=y(g),N=e=>{const{__scopeHoverCard:o,children:r,open:s,defaultOpen:a,onOpenChange:i,openDelay:f=700,closeDelay:v=300}=e,d=w(o),C=n.useRef(0),u=n.useRef(0),h=n.useRef(!1),p=n.useRef(!1),[m,t]=k({prop:s,defaultProp:a??!1,onChange:i,caller:g}),x=n.useCallback(()=>{clearTimeout(u.current),C.current=window.setTimeout(()=>t(!0),f)},[f,t]),P=n.useCallback(()=>{clearTimeout(C.current),!h.current&&!p.current&&(u.current=window.setTimeout(()=>t(!1),v))},[v,t]),M=n.useCallback(()=>t(!1),[t]);return n.useEffect(()=>()=>{clearTimeout(C.current),clearTimeout(u.current)},[]),c.jsx(V,{scope:o,open:m,onOpenChange:t,onOpen:x,onClose:P,onDismiss:M,hasSelectionRef:h,isPointerDownOnContentRef:p,children:c.jsx(F,{...d,children:r})})};N.displayName=g;var _="HoverCardTrigger",D=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=S(_,r),i=w(r);return c.jsx(I,{asChild:!0,...i,children:c.jsx(U.a,{"data-state":a.open?"open":"closed",...s,ref:o,onPointerEnter:l(e.onPointerEnter,b(a.onOpen)),onPointerLeave:l(e.onPointerLeave,b(a.onClose)),onFocus:l(e.onFocus,a.onOpen),onBlur:l(e.onBlur,a.onClose),onTouchStart:l(e.onTouchStart,f=>f.preventDefault())})})});D.displayName=_;var H="HoverCardPortal",[J,Q]=y(H,{forceMount:void 0}),j=e=>{const{__scopeHoverCard:o,forceMount:r,children:s,container:a}=e,i=S(H,o);return c.jsx(J,{scope:o,forceMount:r,children:c.jsx(O,{present:r||i.open,children:c.jsx($,{asChild:!0,container:a,children:s})})})};j.displayName=H;var R="HoverCardContent",A=n.forwardRef((e,o)=>{const r=Q(R,e.__scopeHoverCard),{forceMount:s=r.forceMount,...a}=e,i=S(R,e.__scopeHoverCard);return c.jsx(O,{present:s||i.open,children:c.jsx(X,{"data-state":i.open?"open":"closed",...a,onPointerEnter:l(e.onPointerEnter,b(i.onOpen)),onPointerLeave:l(e.onPointerLeave,b(i.onClose)),ref:o})})});A.displayName=R;var X=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:f,...v}=e,d=S(R,r),C=w(r),u=n.useRef(null),h=B(o,u),[p,m]=n.useState(!1);return n.useEffect(()=>{if(p){const t=document.body;return E=t.style.userSelect||t.style.webkitUserSelect,t.style.userSelect="none",t.style.webkitUserSelect="none",()=>{t.style.userSelect=E,t.style.webkitUserSelect=E}}},[p]),n.useEffect(()=>{if(u.current){const t=()=>{m(!1),d.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var P;((P=document.getSelection())==null?void 0:P.toString())!==""&&(d.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",t),()=>{document.removeEventListener("pointerup",t),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!1}}},[d.isPointerDownOnContentRef,d.hasSelectionRef]),n.useEffect(()=>{u.current&&ee(u.current).forEach(x=>x.setAttribute("tabindex","-1"))}),c.jsx(W,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:f,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:l(i,t=>{t.preventDefault()}),onDismiss:d.onDismiss,children:c.jsx(G,{...C,...v,onPointerDown:l(v.onPointerDown,t=>{t.currentTarget.contains(t.target)&&m(!0),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!0}),ref:h,style:{...v.style,userSelect:p?"text":void 0,WebkitUserSelect:p?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),Y="HoverCardArrow",Z=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=w(r);return c.jsx(K,{...a,...s,ref:o})});Z.displayName=Y;function b(e){return o=>o.pointerType==="touch"?void 0:e()}function ee(e){const o=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;r.nextNode();)o.push(r.currentNode);return o}var te=N,oe=D,re=j,L=A;const se=te,ce=oe,ne=n.forwardRef(({className:e,align:o="center",sideOffset:r=4,...s},a)=>c.jsx(re,{children:c.jsx(L,{ref:a,align:o,sideOffset:r,className:q("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...s})}));ne.displayName=L.displayName;export{se as H,ce as a,ne as b}; diff --git a/assets/index-DGr54pyn.js b/assets/index-BCjs92mB.js similarity index 99% rename from assets/index-DGr54pyn.js rename to assets/index-BCjs92mB.js index c6bc4db06e17f19c3b2a4d8effcfc0197ffa0f1b..af21a506c1452ae2c42159dcb6c624707b81329c 100644 --- a/assets/index-DGr54pyn.js +++ b/assets/index-BCjs92mB.js @@ -1,4 +1,4 @@ -import{ax as We,a4 as Ot,j as Ze}from"./index-3CfcAX6N.js";function hu(){}function mu(e){const n=[],t=String(e||"");let r=t.indexOf(","),i=0,l=!1;for(;!l;){r===-1&&(r=t.length,l=!0);const o=t.slice(i,r).trim();(o||!l)&&n.push(o),i=r+1,r=t.indexOf(",",i)}return n}function Ir(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const Tr=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ar=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Pr={};function Vn(e,n){return(Pr.jsx?Ar:Tr).test(e)}const zr=/[ \t\n\f\r]/g;function Lr(e){return typeof e=="object"?e.type==="text"?qn(e.value):!1:qn(e)}function qn(e){return e.replace(zr,"")===""}class Me{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}Me.prototype.normal={};Me.prototype.property={};Me.prototype.space=void 0;function _t(e,n){const t={},r={};for(const i of e)Object.assign(t,i.property),Object.assign(r,i.normal);return new Me(t,r,n)}function fn(e){return e.toLowerCase()}class J{constructor(n,t){this.attribute=t,this.property=n}}J.prototype.attribute="";J.prototype.booleanish=!1;J.prototype.boolean=!1;J.prototype.commaOrSpaceSeparated=!1;J.prototype.commaSeparated=!1;J.prototype.defined=!1;J.prototype.mustUseProperty=!1;J.prototype.number=!1;J.prototype.overloadedBoolean=!1;J.prototype.property="";J.prototype.spaceSeparated=!1;J.prototype.space=void 0;let vr=0;const z=be(),$=be(),hn=be(),k=be(),R=be(),Ie=be(),ee=be();function be(){return 2**++vr}const mn=Object.freeze(Object.defineProperty({__proto__:null,boolean:z,booleanish:$,commaOrSpaceSeparated:ee,commaSeparated:Ie,number:k,overloadedBoolean:hn,spaceSeparated:R},Symbol.toStringTag,{value:"Module"})),en=Object.keys(mn);class En extends J{constructor(n,t,r,i){let l=-1;if(super(n,t),$n(this,"space",i),typeof r=="number")for(;++l4&&t.slice(0,4)==="data"&&Fr.test(n)){if(n.charAt(4)==="-"){const l=n.slice(5).replace(Wn,Br);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=n.slice(4);if(!Wn.test(l)){let o=l.replace(Nr,Mr);o.charAt(0)!=="-"&&(o="-"+o),n="data"+o}}i=En}return new i(r,n)}function Mr(e){return"-"+e.toLowerCase()}function Br(e){return e.charAt(1).toUpperCase()}const jr=_t([Nt,Dr,Mt,Bt,jt],"html"),Cn=_t([Nt,Or,Mt,Bt,jt],"svg");function du(e){const n=String(e||"").trim();return n?n.split(/[ \t\n\r\f]+/g):[]}function Hr(e){return e.join(" ").trim()}var In={},Yn=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Ur=/\n/g,Vr=/^\s*/,qr=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,$r=/^:\s*/,Wr=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Yr=/^[;\s]*/,Xr=/^\s+|\s+$/g,Qr=` +import{ax as We,a4 as Ot,j as Ze}from"./index-CxhY4zQ1.js";function hu(){}function mu(e){const n=[],t=String(e||"");let r=t.indexOf(","),i=0,l=!1;for(;!l;){r===-1&&(r=t.length,l=!0);const o=t.slice(i,r).trim();(o||!l)&&n.push(o),i=r+1,r=t.indexOf(",",i)}return n}function Ir(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const Tr=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ar=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Pr={};function Vn(e,n){return(Pr.jsx?Ar:Tr).test(e)}const zr=/[ \t\n\f\r]/g;function Lr(e){return typeof e=="object"?e.type==="text"?qn(e.value):!1:qn(e)}function qn(e){return e.replace(zr,"")===""}class Me{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}Me.prototype.normal={};Me.prototype.property={};Me.prototype.space=void 0;function _t(e,n){const t={},r={};for(const i of e)Object.assign(t,i.property),Object.assign(r,i.normal);return new Me(t,r,n)}function fn(e){return e.toLowerCase()}class J{constructor(n,t){this.attribute=t,this.property=n}}J.prototype.attribute="";J.prototype.booleanish=!1;J.prototype.boolean=!1;J.prototype.commaOrSpaceSeparated=!1;J.prototype.commaSeparated=!1;J.prototype.defined=!1;J.prototype.mustUseProperty=!1;J.prototype.number=!1;J.prototype.overloadedBoolean=!1;J.prototype.property="";J.prototype.spaceSeparated=!1;J.prototype.space=void 0;let vr=0;const z=be(),$=be(),hn=be(),k=be(),R=be(),Ie=be(),ee=be();function be(){return 2**++vr}const mn=Object.freeze(Object.defineProperty({__proto__:null,boolean:z,booleanish:$,commaOrSpaceSeparated:ee,commaSeparated:Ie,number:k,overloadedBoolean:hn,spaceSeparated:R},Symbol.toStringTag,{value:"Module"})),en=Object.keys(mn);class En extends J{constructor(n,t,r,i){let l=-1;if(super(n,t),$n(this,"space",i),typeof r=="number")for(;++l4&&t.slice(0,4)==="data"&&Fr.test(n)){if(n.charAt(4)==="-"){const l=n.slice(5).replace(Wn,Br);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=n.slice(4);if(!Wn.test(l)){let o=l.replace(Nr,Mr);o.charAt(0)!=="-"&&(o="-"+o),n="data"+o}}i=En}return new i(r,n)}function Mr(e){return"-"+e.toLowerCase()}function Br(e){return e.charAt(1).toUpperCase()}const jr=_t([Nt,Dr,Mt,Bt,jt],"html"),Cn=_t([Nt,Or,Mt,Bt,jt],"svg");function du(e){const n=String(e||"").trim();return n?n.split(/[ \t\n\r\f]+/g):[]}function Hr(e){return e.join(" ").trim()}var In={},Yn=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Ur=/\n/g,Vr=/^\s*/,qr=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,$r=/^:\s*/,Wr=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Yr=/^[;\s]*/,Xr=/^\s+|\s+$/g,Qr=` `,Xn="/",Qn="*",ke="",Gr="comment",Kr="declaration";function Jr(e,n){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];n=n||{};var t=1,r=1;function i(y){var b=y.match(Ur);b&&(t+=b.length);var T=y.lastIndexOf(Qr);r=~T?y.length-T:r+y.length}function l(){var y={line:t,column:r};return function(b){return b.position=new o(y),c(),b}}function o(y){this.start=y,this.end={line:t,column:r},this.source=n.source}o.prototype.content=e;function a(y){var b=new Error(n.source+":"+t+":"+r+": "+y);if(b.reason=y,b.filename=n.source,b.line=t,b.column=r,b.source=e,!n.silent)throw b}function u(y){var b=y.exec(e);if(b){var T=b[0];return i(T),e=e.slice(T.length),b}}function c(){u(Vr)}function s(y){var b;for(y=y||[];b=f();)b!==!1&&y.push(b);return y}function f(){var y=l();if(!(Xn!=e.charAt(0)||Qn!=e.charAt(1))){for(var b=2;ke!=e.charAt(b)&&(Qn!=e.charAt(b)||Xn!=e.charAt(b+1));)++b;if(b+=2,ke===e.charAt(b-1))return a("End of comment missing");var T=e.slice(2,b-2);return r+=2,i(T),e=e.slice(b),r+=2,y({type:Gr,comment:T})}}function d(){var y=l(),b=u(qr);if(b){if(f(),!u($r))return a("property missing ':'");var T=u(Wr),w=y({type:Kr,property:Gn(b[0].replace(Yn,ke)),value:T?Gn(T[0].replace(Yn,ke)):ke});return u(Yr),w}}function p(){var y=[];s(y);for(var b;b=d();)b!==!1&&(y.push(b),s(y));return y}return c(),p()}function Gn(e){return e?e.replace(Xr,ke):ke}var Zr=Jr,ei=We&&We.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(In,"__esModule",{value:!0});In.default=ti;const ni=ei(Zr);function ti(e,n){let t=null;if(!e||typeof e!="string")return t;const r=(0,ni.default)(e),i=typeof n=="function";return r.forEach(l=>{if(l.type!=="declaration")return;const{property:o,value:a}=l;i?n(o,a,l):a&&(t=t||{},t[o]=a)}),t}var Qe={};Object.defineProperty(Qe,"__esModule",{value:!0});Qe.camelCase=void 0;var ri=/^--[a-zA-Z0-9_-]+$/,ii=/-([a-z])/g,li=/^[^-]+$/,oi=/^-(webkit|moz|ms|o|khtml)-/,ai=/^-(ms)-/,ui=function(e){return!e||li.test(e)||ri.test(e)},si=function(e,n){return n.toUpperCase()},Kn=function(e,n){return"".concat(n,"-")},ci=function(e,n){return n===void 0&&(n={}),ui(e)?e:(e=e.toLowerCase(),n.reactCompat?e=e.replace(ai,Kn):e=e.replace(oi,Kn),e.replace(ii,si))};Qe.camelCase=ci;var pi=We&&We.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},fi=pi(In),hi=Qe;function dn(e,n){var t={};return!e||typeof e!="string"||(0,fi.default)(e,function(r,i){r&&i&&(t[(0,hi.camelCase)(r,n)]=i)}),t}dn.default=dn;var mi=dn;const di=Ot(mi),Ht=Ut("end"),Tn=Ut("start");function Ut(e){return n;function n(t){const r=t&&t.position&&t.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function gi(e){const n=Tn(e),t=Ht(e);if(n&&t)return{start:n,end:t}}function _e(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Jn(e.position):"start"in e||"end"in e?Jn(e):"line"in e||"column"in e?gn(e):""}function gn(e){return Zn(e&&e.line)+":"+Zn(e&&e.column)}function Jn(e){return gn(e&&e.start)+"-"+gn(e&&e.end)}function Zn(e){return e&&typeof e=="number"?e:1}class Q extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let i="",l={},o=!1;if(t&&("line"in t&&"column"in t?l={place:t}:"start"in t&&"end"in t?l={place:t}:"type"in t?l={ancestors:[t],place:t.position}:l={...t}),typeof n=="string"?i=n:!l.cause&&n&&(o=!0,i=n.message,l.cause=n),!l.ruleId&&!l.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?l.ruleId=r:(l.source=r.slice(0,u),l.ruleId=r.slice(u+1))}if(!l.place&&l.ancestors&&l.ancestors){const u=l.ancestors[l.ancestors.length-1];u&&(l.place=u.position)}const a=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=_e(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=o&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Q.prototype.file="";Q.prototype.name="";Q.prototype.reason="";Q.prototype.message="";Q.prototype.stack="";Q.prototype.column=void 0;Q.prototype.line=void 0;Q.prototype.ancestors=void 0;Q.prototype.cause=void 0;Q.prototype.fatal=void 0;Q.prototype.place=void 0;Q.prototype.ruleId=void 0;Q.prototype.source=void 0;const An={}.hasOwnProperty,yi=new Map,xi=/[A-Z]/g,ki=new Set(["table","tbody","thead","tfoot","tr"]),bi=new Set(["td","th"]),Vt="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function wi(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=zi(t,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Pi(t,n.jsx,n.jsxs)}const i={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Cn:jr,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},l=qt(i,e,void 0);return l&&typeof l!="string"?l:i.create(e,i.Fragment,{children:l||void 0},void 0)}function qt(e,n,t){if(n.type==="element")return Si(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return Ei(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return Ii(e,n,t);if(n.type==="mdxjsEsm")return Ci(e,n);if(n.type==="root")return Ti(e,n,t);if(n.type==="text")return Ai(e,n)}function Si(e,n,t){const r=e.schema;let i=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Cn,e.schema=i),e.ancestors.push(n);const l=Wt(e,n.tagName,!1),o=Li(e,n);let a=zn(e,n);return ki.has(n.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!Lr(u):!0})),$t(e,o,l,n),Pn(o,a),e.ancestors.pop(),e.schema=r,e.create(n,l,o,t)}function Ei(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Re(e,n.position)}function Ci(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);Re(e,n.position)}function Ii(e,n,t){const r=e.schema;let i=r;n.name==="svg"&&r.space==="html"&&(i=Cn,e.schema=i),e.ancestors.push(n);const l=n.name===null?e.Fragment:Wt(e,n.name,!0),o=vi(e,n),a=zn(e,n);return $t(e,o,l,n),Pn(o,a),e.ancestors.pop(),e.schema=r,e.create(n,l,o,t)}function Ti(e,n,t){const r={};return Pn(r,zn(e,n)),e.create(n,e.Fragment,r,t)}function Ai(e,n){return n.value}function $t(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function Pn(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function Pi(e,n,t){return r;function r(i,l,o,a){const c=Array.isArray(o.children)?t:n;return a?c(l,o,a):c(l,o)}}function zi(e,n){return t;function t(r,i,l,o){const a=Array.isArray(l.children),u=Tn(r);return n(i,l,o,a,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function Li(e,n){const t={};let r,i;for(i in n.properties)if(i!=="children"&&An.call(n.properties,i)){const l=Di(e,i,n.properties[i]);if(l){const[o,a]=l;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&bi.has(n.tagName)?r=a:t[o]=a}}if(r){const l=t.style||(t.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function vi(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const o=l.expression;o.type;const a=o.properties[0];a.type,Object.assign(t,e.evaluater.evaluateExpression(a.argument))}else Re(e,n.position);else{const i=r.name;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,l=e.evaluater.evaluateExpression(a.expression)}else Re(e,n.position);else l=r.value===null?!0:r.value;t[i]=l}return t}function zn(e,n){const t=[];let r=-1;const i=e.passKeys?new Map:yi;for(;++ri?0:i+n:n=n>i?i:n,t=t>0?t:0,r.length<1e4)o=Array.from(r),o.unshift(n,t),e.splice(...o);else for(t&&e.splice(n,t);l0?(se(e,e.length,0,n),e):n}const tt={}.hasOwnProperty;function ji(e){const n={};let t=-1;for(;++t13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function Te(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ue=ge(/[A-Za-z]/),ne=ge(/[\dA-Za-z]/),Vi=ge(/[#-'*+\--9=?A-Z^-~]/);function yn(e){return e!==null&&(e<32||e===127)}const xn=ge(/\d/),qi=ge(/[\dA-Fa-f]/),$i=ge(/[!-/:-@[-`{-~]/);function A(e){return e!==null&&e<-2}function K(e){return e!==null&&(e<0||e===32)}function O(e){return e===-2||e===-1||e===32}const Wi=ge(new RegExp("\\p{P}|\\p{S}","u")),Yi=ge(/\s/);function ge(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Pe(e){const n=[];let t=-1,r=0,i=0;for(;++t55295&&l<57344){const a=e.charCodeAt(t+1);l<56320&&a>56319&&a<57344?(o=String.fromCharCode(l,a),i=1):o="�"}else o=String.fromCharCode(l);o&&(n.push(e.slice(r,t),encodeURIComponent(o)),r=t+i+1,o=""),i&&(t+=i,i=0)}return n.join("")+e.slice(r)}function M(e,n,t,r){const i=r?r-1:Number.POSITIVE_INFINITY;let l=0;return o;function o(u){return O(u)?(e.enter(t),a(u)):n(u)}function a(u){return O(u)&&l++o))return;const _=n.events.length;let V=_,N,B;for(;V--;)if(n.events[V][0]==="exit"&&n.events[V][1].type==="chunkFlow"){if(N){B=n.events[V][1].end;break}N=!0}for(w(r),x=_;xE;){const U=t[j];n.containerState=U[1],U[0].exit.call(n,e)}t.length=E}function L(){i.write([null]),l=void 0,i=void 0,n.containerState._closeFlow=void 0}}function Ji(e,n,t){return M(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function it(e){if(e===null||K(e)||Yi(e))return 1;if(Wi(e))return 2}function vn(e,n,t){const r=[];let i=-1;for(;++i1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const f={...e[r][1].end},d={...e[t][1].start};lt(f,-u),lt(d,u),o={type:u>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:d},l={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},i={type:u>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[t][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=te(c,[["enter",e[r][1],n],["exit",e[r][1],n]])),c=te(c,[["enter",i,n],["enter",o,n],["exit",o,n],["enter",l,n]]),c=te(c,vn(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),c=te(c,[["exit",l,n],["enter",a,n],["exit",a,n],["exit",i,n]]),e[t][1].end.offset-e[t][1].start.offset?(s=2,c=te(c,[["enter",e[t][1],n],["exit",e[t][1],n]])):s=0,se(e,r-1,t-r+3,c),t=r+c.length-s-2;break}}for(t=-1;++t0&&O(x)?M(e,L,"linePrefix",l+1)(x):L(x)}function L(x){return x===null||A(x)?e.check(ot,b,j)(x):(e.enter("codeFlowValue"),E(x))}function E(x){return x===null||A(x)?(e.exit("codeFlowValue"),L(x)):(e.consume(x),E)}function j(x){return e.exit("codeFenced"),n(x)}function U(x,_,V){let N=0;return B;function B(D){return x.enter("lineEnding"),x.consume(D),x.exit("lineEnding"),I}function I(D){return x.enter("codeFencedFence"),O(D)?M(x,C,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):C(D)}function C(D){return D===a?(x.enter("codeFencedFenceSequence"),H(D)):V(D)}function H(D){return D===a?(N++,x.consume(D),H):N>=o?(x.exit("codeFencedFenceSequence"),O(D)?M(x,q,"whitespace")(D):q(D)):V(D)}function q(D){return D===null||A(D)?(x.exit("codeFencedFence"),_(D)):V(D)}}}function cl(e,n,t){const r=this;return i;function i(o){return o===null?t(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l)}function l(o){return r.parser.lazy[r.now().line]?t(o):n(o)}}const tn={name:"codeIndented",tokenize:fl},pl={partial:!0,tokenize:hl};function fl(e,n,t){const r=this;return i;function i(c){return e.enter("codeIndented"),M(e,l,"linePrefix",5)(c)}function l(c){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?o(c):t(c)}function o(c){return c===null?u(c):A(c)?e.attempt(pl,o,u)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||A(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),a)}function u(c){return e.exit("codeIndented"),n(c)}}function hl(e,n,t){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?t(o):A(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):M(e,l,"linePrefix",5)(o)}function l(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(o):A(o)?i(o):t(o)}}const ml={name:"codeText",previous:gl,resolve:dl,tokenize:yl};function dl(e){let n=e.length-4,t=3,r,i;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=t;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return nthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const i=t||0;this.setCursor(Math.trunc(n));const l=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&De(this.left,r),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),De(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),De(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n=4?n(o):e.interrupt(r.parser.constructs.flow,t,n)(o)}}function Zt(e,n,t,r,i,l,o,a,u){const c=u||Number.POSITIVE_INFINITY;let s=0;return f;function f(w){return w===60?(e.enter(r),e.enter(i),e.enter(l),e.consume(w),e.exit(l),d):w===null||w===32||w===41||yn(w)?t(w):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),b(w))}function d(w){return w===62?(e.enter(l),e.consume(w),e.exit(l),e.exit(i),e.exit(r),n):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===62?(e.exit("chunkString"),e.exit(a),d(w)):w===null||w===60||A(w)?t(w):(e.consume(w),w===92?y:p)}function y(w){return w===60||w===62||w===92?(e.consume(w),p):p(w)}function b(w){return!s&&(w===null||w===41||K(w))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),n(w)):s999||p===null||p===91||p===93&&!u||p===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?t(p):p===93?(e.exit(l),e.enter(i),e.consume(p),e.exit(i),e.exit(r),n):A(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),s):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||A(p)||a++>999?(e.exit("chunkString"),s(p)):(e.consume(p),u||(u=!O(p)),p===92?d:f)}function d(p){return p===91||p===92||p===93?(e.consume(p),a++,f):f(p)}}function nr(e,n,t,r,i,l){let o;return a;function a(d){return d===34||d===39||d===40?(e.enter(r),e.enter(i),e.consume(d),e.exit(i),o=d===40?41:d,u):t(d)}function u(d){return d===o?(e.enter(i),e.consume(d),e.exit(i),e.exit(r),n):(e.enter(l),c(d))}function c(d){return d===o?(e.exit(l),u(o)):d===null?t(d):A(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),M(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),s(d))}function s(d){return d===o||d===null||A(d)?(e.exit("chunkString"),c(d)):(e.consume(d),d===92?f:s)}function f(d){return d===o||d===92?(e.consume(d),s):s(d)}}function Ne(e,n){let t;return r;function r(i){return A(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t=!0,r):O(i)?M(e,r,t?"linePrefix":"lineSuffix")(i):n(i)}}const Il={name:"definition",tokenize:Al},Tl={partial:!0,tokenize:Pl};function Al(e,n,t){const r=this;let i;return l;function l(p){return e.enter("definition"),o(p)}function o(p){return er.call(r,e,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=Te(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),u):t(p)}function u(p){return K(p)?Ne(e,c)(p):c(p)}function c(p){return Zt(e,s,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function s(p){return e.attempt(Tl,f,f)(p)}function f(p){return O(p)?M(e,d,"whitespace")(p):d(p)}function d(p){return p===null||A(p)?(e.exit("definition"),r.parser.defined.push(i),n(p)):t(p)}}function Pl(e,n,t){return r;function r(a){return K(a)?Ne(e,i)(a):t(a)}function i(a){return nr(e,l,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function l(a){return O(a)?M(e,o,"whitespace")(a):o(a)}function o(a){return a===null||A(a)?n(a):t(a)}}const zl={name:"hardBreakEscape",tokenize:Ll};function Ll(e,n,t){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),i}function i(l){return A(l)?(e.exit("hardBreakEscape"),n(l)):t(l)}}const vl={name:"headingAtx",resolve:Dl,tokenize:Ol};function Dl(e,n){let t=e.length-2,r=3,i,l;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},l={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},se(e,r,t-r+1,[["enter",i,n],["enter",l,n],["exit",l,n],["exit",i,n]])),e}function Ol(e,n,t){let r=0;return i;function i(s){return e.enter("atxHeading"),l(s)}function l(s){return e.enter("atxHeadingSequence"),o(s)}function o(s){return s===35&&r++<6?(e.consume(s),o):s===null||K(s)?(e.exit("atxHeadingSequence"),a(s)):t(s)}function a(s){return s===35?(e.enter("atxHeadingSequence"),u(s)):s===null||A(s)?(e.exit("atxHeading"),n(s)):O(s)?M(e,a,"whitespace")(s):(e.enter("atxHeadingText"),c(s))}function u(s){return s===35?(e.consume(s),u):(e.exit("atxHeadingSequence"),a(s))}function c(s){return s===null||s===35||K(s)?(e.exit("atxHeadingText"),a(s)):(e.consume(s),c)}}const _l=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],ut=["pre","script","style","textarea"],Nl={concrete:!0,name:"htmlFlow",resolveTo:Ml,tokenize:Bl},Fl={partial:!0,tokenize:Hl},Rl={partial:!0,tokenize:jl};function Ml(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function Bl(e,n,t){const r=this;let i,l,o,a,u;return c;function c(m){return s(m)}function s(m){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(m),f}function f(m){return m===33?(e.consume(m),d):m===47?(e.consume(m),l=!0,b):m===63?(e.consume(m),i=3,r.interrupt?n:h):ue(m)?(e.consume(m),o=String.fromCharCode(m),T):t(m)}function d(m){return m===45?(e.consume(m),i=2,p):m===91?(e.consume(m),i=5,a=0,y):ue(m)?(e.consume(m),i=4,r.interrupt?n:h):t(m)}function p(m){return m===45?(e.consume(m),r.interrupt?n:h):t(m)}function y(m){const le="CDATA[";return m===le.charCodeAt(a++)?(e.consume(m),a===le.length?r.interrupt?n:C:y):t(m)}function b(m){return ue(m)?(e.consume(m),o=String.fromCharCode(m),T):t(m)}function T(m){if(m===null||m===47||m===62||K(m)){const le=m===47,ye=o.toLowerCase();return!le&&!l&&ut.includes(ye)?(i=1,r.interrupt?n(m):C(m)):_l.includes(o.toLowerCase())?(i=6,le?(e.consume(m),w):r.interrupt?n(m):C(m)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(m):l?L(m):E(m))}return m===45||ne(m)?(e.consume(m),o+=String.fromCharCode(m),T):t(m)}function w(m){return m===62?(e.consume(m),r.interrupt?n:C):t(m)}function L(m){return O(m)?(e.consume(m),L):B(m)}function E(m){return m===47?(e.consume(m),B):m===58||m===95||ue(m)?(e.consume(m),j):O(m)?(e.consume(m),E):B(m)}function j(m){return m===45||m===46||m===58||m===95||ne(m)?(e.consume(m),j):U(m)}function U(m){return m===61?(e.consume(m),x):O(m)?(e.consume(m),U):E(m)}function x(m){return m===null||m===60||m===61||m===62||m===96?t(m):m===34||m===39?(e.consume(m),u=m,_):O(m)?(e.consume(m),x):V(m)}function _(m){return m===u?(e.consume(m),u=null,N):m===null||A(m)?t(m):(e.consume(m),_)}function V(m){return m===null||m===34||m===39||m===47||m===60||m===61||m===62||m===96||K(m)?U(m):(e.consume(m),V)}function N(m){return m===47||m===62||O(m)?E(m):t(m)}function B(m){return m===62?(e.consume(m),I):t(m)}function I(m){return m===null||A(m)?C(m):O(m)?(e.consume(m),I):t(m)}function C(m){return m===45&&i===2?(e.consume(m),X):m===60&&i===1?(e.consume(m),W):m===62&&i===4?(e.consume(m),ie):m===63&&i===3?(e.consume(m),h):m===93&&i===5?(e.consume(m),ce):A(m)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Fl,pe,H)(m)):m===null||A(m)?(e.exit("htmlFlowData"),H(m)):(e.consume(m),C)}function H(m){return e.check(Rl,q,pe)(m)}function q(m){return e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),D}function D(m){return m===null||A(m)?H(m):(e.enter("htmlFlowData"),C(m))}function X(m){return m===45?(e.consume(m),h):C(m)}function W(m){return m===47?(e.consume(m),o="",re):C(m)}function re(m){if(m===62){const le=o.toLowerCase();return ut.includes(le)?(e.consume(m),ie):C(m)}return ue(m)&&o.length<8?(e.consume(m),o+=String.fromCharCode(m),re):C(m)}function ce(m){return m===93?(e.consume(m),h):C(m)}function h(m){return m===62?(e.consume(m),ie):m===45&&i===2?(e.consume(m),h):C(m)}function ie(m){return m===null||A(m)?(e.exit("htmlFlowData"),pe(m)):(e.consume(m),ie)}function pe(m){return e.exit("htmlFlow"),n(m)}}function jl(e,n,t){const r=this;return i;function i(o){return A(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l):t(o)}function l(o){return r.parser.lazy[r.now().line]?t(o):n(o)}}function Hl(e,n,t){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ge,n,t)}}const Ul={name:"htmlText",tokenize:Vl};function Vl(e,n,t){const r=this;let i,l,o;return a;function a(h){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(h),u}function u(h){return h===33?(e.consume(h),c):h===47?(e.consume(h),U):h===63?(e.consume(h),E):ue(h)?(e.consume(h),V):t(h)}function c(h){return h===45?(e.consume(h),s):h===91?(e.consume(h),l=0,y):ue(h)?(e.consume(h),L):t(h)}function s(h){return h===45?(e.consume(h),p):t(h)}function f(h){return h===null?t(h):h===45?(e.consume(h),d):A(h)?(o=f,W(h)):(e.consume(h),f)}function d(h){return h===45?(e.consume(h),p):f(h)}function p(h){return h===62?X(h):h===45?d(h):f(h)}function y(h){const ie="CDATA[";return h===ie.charCodeAt(l++)?(e.consume(h),l===ie.length?b:y):t(h)}function b(h){return h===null?t(h):h===93?(e.consume(h),T):A(h)?(o=b,W(h)):(e.consume(h),b)}function T(h){return h===93?(e.consume(h),w):b(h)}function w(h){return h===62?X(h):h===93?(e.consume(h),w):b(h)}function L(h){return h===null||h===62?X(h):A(h)?(o=L,W(h)):(e.consume(h),L)}function E(h){return h===null?t(h):h===63?(e.consume(h),j):A(h)?(o=E,W(h)):(e.consume(h),E)}function j(h){return h===62?X(h):E(h)}function U(h){return ue(h)?(e.consume(h),x):t(h)}function x(h){return h===45||ne(h)?(e.consume(h),x):_(h)}function _(h){return A(h)?(o=_,W(h)):O(h)?(e.consume(h),_):X(h)}function V(h){return h===45||ne(h)?(e.consume(h),V):h===47||h===62||K(h)?N(h):t(h)}function N(h){return h===47?(e.consume(h),X):h===58||h===95||ue(h)?(e.consume(h),B):A(h)?(o=N,W(h)):O(h)?(e.consume(h),N):X(h)}function B(h){return h===45||h===46||h===58||h===95||ne(h)?(e.consume(h),B):I(h)}function I(h){return h===61?(e.consume(h),C):A(h)?(o=I,W(h)):O(h)?(e.consume(h),I):N(h)}function C(h){return h===null||h===60||h===61||h===62||h===96?t(h):h===34||h===39?(e.consume(h),i=h,H):A(h)?(o=C,W(h)):O(h)?(e.consume(h),C):(e.consume(h),q)}function H(h){return h===i?(e.consume(h),i=void 0,D):h===null?t(h):A(h)?(o=H,W(h)):(e.consume(h),H)}function q(h){return h===null||h===34||h===39||h===60||h===61||h===96?t(h):h===47||h===62||K(h)?N(h):(e.consume(h),q)}function D(h){return h===47||h===62||K(h)?N(h):t(h)}function X(h){return h===62?(e.consume(h),e.exit("htmlTextData"),e.exit("htmlText"),n):t(h)}function W(h){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),re}function re(h){return O(h)?M(e,ce,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(h):ce(h)}function ce(h){return e.enter("htmlTextData"),o(h)}}const Dn={name:"labelEnd",resolveAll:Yl,resolveTo:Xl,tokenize:Ql},ql={tokenize:Gl},$l={tokenize:Kl},Wl={tokenize:Jl};function Yl(e){let n=-1;const t=[];for(;++n=3&&(c===null||A(c))?(e.exit("thematicBreak"),n(c)):t(c)}function u(c){return c===i?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),O(c)?M(e,a,"whitespace")(c):a(c))}}const G={continuation:{tokenize:uo},exit:co,name:"list",tokenize:ao},lo={partial:!0,tokenize:po},oo={partial:!0,tokenize:so};function ao(e,n,t){const r=this,i=r.events[r.events.length-1];let l=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(p){const y=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:xn(p)){if(r.containerState.type||(r.containerState.type=y,e.enter(y,{_container:!0})),y==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(qe,t,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(p)}return t(p)}function u(p){return xn(p)&&++o<10?(e.consume(p),u):(!r.interrupt||o<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):t(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Ge,r.interrupt?t:s,e.attempt(lo,d,f))}function s(p){return r.containerState.initialBlankLine=!0,l++,d(p)}function f(p){return O(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),d):t(p)}function d(p){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(p)}}function uo(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(Ge,i,l);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,M(e,n,"listItemIndent",r.containerState.size+1)(a)}function l(a){return r.containerState.furtherBlankLines||!O(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(oo,n,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,M(e,e.attempt(G,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function so(e,n,t){const r=this;return M(e,i,"listItemIndent",r.containerState.size+1);function i(l){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?n(l):t(l)}}function co(e){e.exit(this.containerState.type)}function po(e,n,t){const r=this;return M(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(l){const o=r.events[r.events.length-1];return!O(l)&&o&&o[1].type==="listItemPrefixWhitespace"?n(l):t(l)}}const st={name:"setextUnderline",resolveTo:fo,tokenize:ho};function fo(e,n){let t=e.length,r,i,l;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(i=t)}else e[t][1].type==="content"&&e.splice(t,1),!l&&e[t][1].type==="definition"&&(l=t);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",l?(e.splice(i,0,["enter",o,n]),e.splice(l+1,0,["exit",e[r][1],n]),e[r][1].end={...e[l][1].end}):e[r][1]=o,e.push(["exit",o,n]),e}function ho(e,n,t){const r=this;let i;return l;function l(c){let s=r.events.length,f;for(;s--;)if(r.events[s][1].type!=="lineEnding"&&r.events[s][1].type!=="linePrefix"&&r.events[s][1].type!=="content"){f=r.events[s][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=c,o(c)):t(c)}function o(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),O(c)?M(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||A(c)?(e.exit("setextHeadingLine"),n(c)):t(c)}}const mo={tokenize:go};function go(e){const n=this,t=e.attempt(Ge,r,e.attempt(this.parser.constructs.flowInitial,i,M(e,e.attempt(this.parser.constructs.flow,i,e.attempt(bl,i)),"linePrefix")));return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function i(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const yo={resolveAll:rr()},xo=tr("string"),ko=tr("text");function tr(e){return{resolveAll:rr(e==="text"?bo:void 0),tokenize:n};function n(t){const r=this,i=this.parser.constructs[e],l=t.attempt(i,o,a);return o;function o(s){return c(s)?l(s):a(s)}function a(s){if(s===null){t.consume(s);return}return t.enter("data"),t.consume(s),u}function u(s){return c(s)?(t.exit("data"),l(s)):(t.consume(s),u)}function c(s){if(s===null)return!0;const f=i[s];let d=-1;if(f)for(;++d-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}l>0&&o.push(e[i].slice(0,l))}return o}function Oo(e,n){let t=-1;const r=[];let i;for(;++t0){const oe=P.tokenStack[P.tokenStack.length-1];(oe[1]||pt).call(P,void 0,oe[0])}for(S.position={start:de(g.length>0?g[0][1].start:{line:1,column:1,offset:0}),end:de(g.length>0?g[g.length-2][1].end:{line:1,column:1,offset:0})},F=-1;++Fi.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AuthorizePaperEditView-AscuEWFa.js","assets/useMutation-BzRfwboV.js","assets/button-BenSiukP.js","assets/paperEdits-CfQUGmNN.js","assets/FollowingView-CxPwEdv-.js","assets/FeedView-C8zGqRsW.js","assets/sparkles-CBme4WI-.js","assets/dialog-CT48f48_.js","assets/catalog-DCEU6WpP.js","assets/researchTopic-DXZVIvAq.js","assets/transform-DehuZQh7.js","assets/plus-CEkdlNSn.js","assets/arrow-right-BwBMsu3P.js","assets/PaperFeed-D1egUlu_.js","assets/PaperCard-DeWmBrg8.js","assets/AuthorAvatar-DPz8YQ5Z.js","assets/AuthorAvatar-o5W6pl_W.css","assets/SotaBadges-EnDhSaVO.js","assets/colors-BkWRhvFI.js","assets/Icon-XOOkUEUX.js","assets/LatexTitle-BqNrCKu8.js","assets/papers-BDxSKSYJ.js","assets/curation-D2sqKAqC.js","assets/safeExternalHref-CkBrsh84.js","assets/popover-DgW_tN02.js","assets/skeleton-DdKViE4r.js","assets/useIntersectionObserver-ZqjUJuPc.js","assets/McpShowcase-CXm3UZ_U.js","assets/AgentLogos-C9q7zZc4.js","assets/chatSessions-DjtMpqHz.js","assets/chat-CkiIbMG5.js","assets/usePapers-Cv13R7ph.js","assets/useInfiniteQuery-vHEhIVF_.js","assets/alert-C-NbJX4N.js","assets/TopicView-CdjM8WYW.js","assets/link-2-CyUnfeFP.js","assets/ChatView-BNDJ2kH3.js","assets/chatLifecycle-CUjL6RQJ.js","assets/hover-card-CqKeZcpY.js","assets/CatalogEntityPreviewLink-Bp5A8eb_.js","assets/github-Bv102r_G.js","assets/file-text-42n3m1yn.js","assets/PaperPreviewLink-Y2LI3xZW.js","assets/index-BCjs92mB.js","assets/index-mv_8ovfA.js","assets/katex-DkKDou_j.js","assets/thumbs-up-DP1Ac3Tb.js","assets/copy-Dpy50x4G.js","assets/queryOptions-C9woPjwX.js","assets/arrow-left-CDwy-_cK.js","assets/external-link-UhGsnDEF.js","assets/search-CkWMhIw6.js","assets/chevron-up-ClmVTWYw.js","assets/chatLifecycle-Lr_OJaUk.css","assets/katex-wklAmtGL.css","assets/share-2-LsSZFLYg.js","assets/mlIntern-CBvHpMTi.js","assets/openrouter-DLk2ZdMf.js","assets/SharedChatView-DgpdZ95u.js","assets/PapersListView-Bs-H-o-h.js","assets/useDebounce-BqT24mBv.js","assets/apiErrors-D2bSY3Dq.js","assets/frameworks-DDA0P4Tf.js","assets/PaperDetailView-B7LjkGBN.js","assets/ExternalSourceEvalBadge-VjNs_cVj.js","assets/ExternalSourceEvalBadge-CWUQ52cV.css","assets/paperReader-td2aJigh.js","assets/useDocumentTitle-CC3zTSwA.js","assets/preferences-CUy01zEm.js","assets/account-Bplq3u-8.js","assets/evaluationQueryInvalidation-PEtgmyxY.js","assets/queryInvalidation-Djot7Ix_.js","assets/input-CxKbyH9e.js","assets/searchable-select-hPIpmCr4.js","assets/loader-circle-C5gQxAlQ.js","assets/SignInToEditDialog-0W7FFwc1.js","assets/textarea-uttJnDhA.js","assets/submissions-DF3SD1oA.js","assets/database-DTsYk9y1.js","assets/badge-Dj5QKh-d.js","assets/globe-DIhafOmF.js","assets/index-JxIVN7pD.js","assets/codex-Bw15uMy8.js","assets/savedPapersAuth-YhdYkTbG.js","assets/organizationNames-BVKzYEBp.js","assets/PaperDetailView-CnKK6W4F.css","assets/PaperReaderView-CMX4-aWi.js","assets/MarkdownText-D0WkOxKi.js","assets/TagsIndexView-DiKdGZx0.js","assets/slug-BpH-Nkvz.js","assets/triangle-alert-BCFuWBBz.js","assets/trending-up-BaROX4bP.js","assets/moon-D6Y7BLS4.js","assets/trophy-BVERRwS-.js","assets/activity-bP8ilshD.js","assets/AreaSection-B21Mp4br.js","assets/TaxonomySuggestionTile-Ch_m5AUx.js","assets/useHashScrollOnReady-KPtO6vdP.js","assets/areas-Dvi8w2dp.js","assets/TagBrowseView-HXuz3Cu0.js","assets/ResearchFollowButton-DPFVPZ0U.js","assets/BenchmarkTrendSparkline-daMK8XXD.js","assets/NotFound-BeRulOFd.js","assets/MethodsIndexView-DFxGizEv.js","assets/FrameworksIndexView-DzgxIZ2R.js","assets/TrendsView-C0roiQkv.js","assets/ConferencesIndexView-CJ3etu5H.js","assets/deadlines-BG5SWwEG.js","assets/AiDeadlinesView-ySVlb5Zy.js","assets/switch-COruZUxK.js","assets/ConferenceDetailView-Bes-wZoN.js","assets/conferenceListings-BnmhBx-_.js","assets/ConferenceTaskView-7vjNk0Qt.js","assets/OrganizationsIndexView-CU64F1W1.js","assets/OrganizationsIndexView-CJnrfIkP.css","assets/OrganizationDetailView-D82QKEh2.js","assets/OrganizationContributionGraph-BW4dfD-r.js","assets/AuthorDetailView-BLIKTcZJ.js","assets/MethodDetailView-DX6nB6xF.js","assets/BenchmarkDetailView-ujezOHA2.js","assets/BenchmarkDetailView-CXxK75GR.css","assets/SavedPapersView-CSPbwTYh.js","assets/SettingsView-CWBdqT8i.js","assets/PrivacyView-BGwob0k2.js","assets/ApiDocsView-DO1rgGlj.js","assets/ApiDocsView-DPuMdYvY.css","assets/McpView-DfOBSpbX.js","assets/McpView-EGeqkP46.css","assets/SubmitView-BUjda1b9.js","assets/CronDashboard-CIUsXoy9.js","assets/CronDashboard-D2N9pnr3.js","assets/CronDashboard-DwChfW9h.css","assets/refresh-cw-Ddb6Y_kg.js","assets/circle-check-CnqnwdL4.js","assets/AutonomousOperations-BGgLXdSh.js","assets/SubmissionsDashboard-DQ0IgORY.js","assets/SubmissionsDashboard-BTmvDoLW.css","assets/UserProfileView-2VsZSUPK.js","assets/RateLimitsView-DujSBsSL.js","assets/AstraForRoboticsView-Cbgf-67D.js","assets/AstraForRoboticsView-C_lTF_XB.css","assets/SearchOverlay-CkohnQ4e.js","assets/StagingAccessRequestView-D-ipJ4kW.js"])))=>i.map(i=>d[i]); var zk=Object.defineProperty;var ym=e=>{throw TypeError(e)};var Uk=(e,t,n)=>t in e?zk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var kr=(e,t,n)=>Uk(e,typeof t!="symbol"?t+"":t,n),Nd=(e,t,n)=>t.has(e)||ym("Cannot "+n);var k=(e,t,n)=>(Nd(e,t,"read from private field"),n?n.call(e):t.get(e)),X=(e,t,n)=>t.has(e)?ym("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),H=(e,t,n,r)=>(Nd(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),ue=(e,t,n)=>(Nd(e,t,"access private method"),n);var Tl=(e,t,n,r)=>({set _(i){H(e,t,i,n)},get _(){return k(e,t,r)}});function Vk(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var rz=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ow(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var aw={exports:{}},Gc={},lw={exports:{}},le={};/** * @license React * react.production.min.js @@ -159,4 +159,4 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const c2=Id("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),d2=t2,f2=n2,h2=g.forwardRef(({className:e,inset:t,children:n,...r},i)=>w.jsxs(ak,{ref:i,className:ct("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent",t&&"pl-8",e),...r,children:[n,w.jsx(l2,{className:"ml-auto h-4 w-4"})]}));h2.displayName=ak.displayName;const p2=g.forwardRef(({className:e,...t},n)=>w.jsx(lk,{ref:n,className:ct("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));p2.displayName=lk.displayName;const ck=g.forwardRef(({className:e,sideOffset:t=4,...n},r)=>w.jsx(r2,{children:w.jsx(ek,{ref:r,sideOffset:t,className:ct("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));ck.displayName=ek.displayName;const er=g.forwardRef(({className:e,inset:t,...n},r)=>w.jsx(nk,{ref:r,className:ct("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t&&"pl-8",e),...n}));er.displayName=nk.displayName;const v2=g.forwardRef(({className:e,children:t,checked:n,...r},i)=>w.jsxs(rk,{ref:i,className:ct("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),checked:n,...r,children:[w.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:w.jsx(sk,{children:w.jsx(a2,{className:"h-4 w-4"})})}),t]}));v2.displayName=rk.displayName;const g2=g.forwardRef(({className:e,children:t,...n},r)=>w.jsxs(ik,{ref:r,className:ct("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...n,children:[w.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:w.jsx(sk,{children:w.jsx(u2,{className:"h-2 w-2 fill-current"})})}),t]}));g2.displayName=ik.displayName;const dk=g.forwardRef(({className:e,inset:t,...n},r)=>w.jsx(tk,{ref:r,className:ct("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));dk.displayName=tk.displayName;const uv=g.forwardRef(({className:e,...t},n)=>w.jsx(ok,{ref:n,className:ct("-mx-1 my-1 h-px bg-muted",e),...t}));uv.displayName=ok.displayName;function m2(e){const n=(e.name||e.username||"?").trim().split(/\s+/).filter(Boolean);return n.length===0?"?":n.length===1?n[0][0].toUpperCase():(n[0][0]+n[n.length-1][0]).toUpperCase()}const y2=({user:e,onLogout:t})=>w.jsxs(d2,{children:[w.jsx(f2,{asChild:!0,children:w.jsx("button",{type:"button",className:"user-avatar-btn","aria-label":`Account menu for ${e.username}`,children:w.jsxs(j1,{className:"h-8 w-8",children:[e.avatar_url&&w.jsx(D1,{src:e.avatar_url,alt:e.username}),w.jsx(z1,{className:"text-xs",children:m2(e)})]})})}),w.jsxs(ck,{align:"end",className:"w-56",children:[w.jsxs(dk,{className:"flex flex-col gap-0.5 py-2",children:[w.jsx("span",{className:"text-sm font-medium leading-tight",children:e.name||e.username}),w.jsxs("span",{className:"text-xs font-normal text-muted-foreground",children:["@",e.username]}),e.is_admin&&w.jsx("span",{className:"mt-1 inline-flex w-fit items-center rounded-full bg-amber-100 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-amber-900",children:"Admin"}),e.role==="contributor"&&w.jsx("span",{className:"mt-1 inline-flex w-fit items-center rounded-full bg-blue-100 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-blue-900",children:"Contributor"})]}),w.jsx(uv,{}),w.jsx(er,{asChild:!0,children:w.jsx("a",{href:`https://huggingface.co/${encodeURIComponent(e.username)}`,target:"_blank",rel:"noopener noreferrer",children:"Hugging Face profile"})}),w.jsx(er,{asChild:!0,children:w.jsx(bn,{to:"/frameworks",children:"Frameworks"})}),w.jsx(er,{asChild:!0,children:w.jsx(bn,{to:"/trends",children:"Trends"})}),e.is_admin&&w.jsxs(w.Fragment,{children:[w.jsx(er,{asChild:!0,children:w.jsx(bn,{to:"/admin-dashboard",children:"Admin dashboard"})}),w.jsx(er,{asChild:!0,children:w.jsx(bn,{to:"/submissions",children:"Review submissions"})})]}),w.jsx(er,{asChild:!0,children:w.jsx(bn,{to:`/${encodeURIComponent(e.username)}`,children:"My contributions"})}),w.jsx(er,{asChild:!0,children:w.jsx(bn,{to:"/settings",children:"Settings"})}),w.jsx(uv,{}),w.jsx(er,{onSelect:n=>{n.preventDefault(),t()},children:"Log out"})]})]}),_2=!1;class Od extends Error{constructor(n,r){var i;super(`API request failed: ${n.status} ${n.statusText}`);kr(this,"status");kr(this,"statusText");kr(this,"response");kr(this,"detail");kr(this,"code");kr(this,"displayMessage");this.name="ApiError",this.status=n.status,this.statusText=n.statusText,this.response=r;try{if(this.detail=(i=JSON.parse(r))==null?void 0:i.detail,typeof this.detail=="string"&&(this.message=this.detail),Array.isArray(this.detail)){const s=this.detail[0];typeof s=="object"&&s!==null&&"msg"in s&&typeof s.msg=="string"&&(this.message=s.msg)}if(typeof this.detail=="object"&&this.detail!==null&&"code"in this.detail&&typeof this.detail.code=="string"&&(this.code=this.detail.code),typeof this.detail=="object"&&this.detail!==null&&"message"in this.detail&&typeof this.detail.message=="string"){const s="help"in this.detail&&typeof this.detail.help=="string"?` See ${this.detail.help} for help.`:"";this.message=`${this.detail.message}${s}`}}catch{this.detail=void 0,this.displayMessage=r||this.message;return}this.displayMessage=this.message}}function wz(e,t){return e instanceof Od?e.displayMessage||t:typeof e=="object"&&e!==null&&"message"in e&&typeof e.message=="string"&&e.message||t}class w2{constructor(t){this.baseUrl=t}async fetch(t,n){const r=`${this.baseUrl}${t}`;try{const{headers:i,...s}=n??{},a=(s.method??"GET").toUpperCase()==="GET"?"default":"no-store",l=new Headers(i);return typeof s.body=="string"&&!l.has("Content-Type")&&l.set("Content-Type","application/json"),await fetch(r,{...s,cache:s.cache??a,credentials:s.credentials??"include",headers:l})}catch(i){throw console.error(`[API] Request to ${r} failed:`,i),i}}async fetchOk(t,n){const r=await this.fetch(t,n);if(!r.ok){const i=new Od(r,await r.text());throw console.error("[API] Error response:",i.response),i}return r}async request(t,n){const r=await this.fetchOk(t,n);return r.status===204?void 0:await r.json()}}function x2(e){e instanceof Od&&e.status===401&&e.code!=="fresh_auth_required"&&e.code!=="saved_papers_bucket_authorization_required"&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:auth-stale"))}async function fk(e){try{return await e()}catch(t){throw x2(t),t}}const cm=new w2(`${Bg()}/api/v1`),b2=(e,t)=>cm.fetch(e,t),xz=(e,t)=>fk(()=>cm.fetchOk(e,t)),cv=(e,t)=>fk(()=>cm.request(e,t));async function bz(e,t){try{return await cv(e,t)}catch(n){if(n instanceof Od&&n.status===404)return null;throw n}}const z0={async getCurrentUser(){if($o())return null;const e=await b2("/auth/me",{cache:"no-store"});return e.status===401||!e.ok?null:e.json()},async logout(){await cv("/auth/logout",{method:"POST"})},async requestStagingAccess(){await cv("/staging-access-request",{method:"POST"})}},E2={detail:e=>["paper",e],arxiv:e=>["paper-arxiv",e],preview:e=>["paper-preview",e],summary:e=>["paper-summary",e],feeds:{list:["papers"],infinite:["papers-infinite"],following:["research-feed"],search:["paper-search-feed"],task:["task-papers-infinite"],conference:["conference-papers-infinite"],organization:["organization-papers-infinite"],method:["method-papers-infinite"],saved:["my-bookmarks"],related:["related-papers"],versions:["paper-versions"],searchOverlay:["search-papers"],mentions:["chat-paper-mention-search"],trending:["trending-papers"]}},Ez=10*60*1e3,hu={me:["auth","me"]},Sz={preferences:["account","preferences"],bookmarkIds:["my-bookmark-ids"]},Cz={areas:["areas-all"],area:e=>["area",e],topTasksSidebar:["top-tasks-sidebar"],task:e=>["task",e],method:e=>["method",e],organization:e=>["organization",e],dataset:e=>["dataset",e],datasets:["dataset"],datasetTasks:["dataset-tasks"],taskPage:["task-page"],taskBenchmarkTrends:["task-benchmark-trends"],organizations:["organizations"]},kz={all:["evaluations"],byPaper:e=>["evaluations","paper",e],byPaperAll:["evaluations","paper"],byDatasetAll:["dataset-evals"],byDataset:e=>["dataset-evals",e]},Pz={pendingEdits:["pendingPaperEdits"]},Rz={all:["admin"],cronStatus:["admin","cronStatus"],chatSandboxSpend:e=>["admin","chatSandboxSpend",e],chatWebSearchBudget:["admin","chatWebSearchBudget"],autonomousOperations:["admin","autonomousOperations"],paperMarkdownJobs:["admin","paperMarkdownJobs"],codexPaperJobs:["admin","codexPaperJobs"],codexPaperJob:(e,t)=>["admin","codexPaperJob",e,t],catalogAudit:["catalog-audit"]},Tz={follows:e=>["research-follows",e],topics:e=>["research-topics",e],publicTopics:["research-public-topic"],publicTopic:(e,t)=>["research-public-topic",e,t],topicPapers:(e,t,n,r)=>[`research-topic-papers-${e}`,t,n.startDate??null,n.endDate??null,r],featuredTopics:["research-featured-topics"],email:e=>["research-email",e],feed:e=>[...E2.feeds.following,e]},dm=q.createContext(null),U0="pwc:auth-stale",S2=({children:e})=>{const t=DS(),n=uN({queryKey:hu.me,queryFn:()=>z0.getCurrentUser(),staleTime:1/0}),r=n.data??null,i=q.useRef(null),{refetch:s}=n,o=q.useCallback(async()=>{await s()},[s]),a=q.useCallback(async()=>{const u=qg("/api/v1/auth/logout");if(new URL(u,window.location.origin).origin!==window.location.origin){const c=document.createElement("form");c.method="POST",c.action=`${u}?return_to=${encodeURIComponent(window.location.href)}`,document.body.appendChild(c),c.submit();return}await z0.logout(),t.setQueryData(hu.me,null)},[t]);q.useEffect(()=>{},[r]),q.useEffect(()=>{i.current&&!r&&t.resetQueries({predicate:u=>u.queryKey[0]!==hu.me[0]}),i.current=r},[t,r]),q.useEffect(()=>{const u=()=>t.setQueryData(hu.me,null);return window.addEventListener(U0,u),()=>window.removeEventListener(U0,u)},[t]);const l=q.useMemo(()=>({user:r,isLoading:n.isPending,refresh:o,logout:a}),[r,n.isPending,o,a]);return w.jsx(dm.Provider,{value:l,children:e})};function hk(){const e=q.useContext(dm);if(!e)throw new Error("useAuth must be used inside an ");return e}function Iz(){return q.useContext(dm)}const Mr=({name:e,size:t=14})=>{const n={search:w.jsx("path",{d:"M11 11l3 3M7 12.5a5.5 5.5 0 110-11 5.5 5.5 0 010 11z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),bookmark:w.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),menu:w.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:w.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),github:w.jsx("path",{fill:"currentColor",d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})};return w.jsx("svg",{className:t===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:t,height:t,children:n[e]})},V0="https://github.com/huggingface/paperswithcode-feedback/issues",B0="https://github.com/huggingface/paperswithcode",C2="https://paperswithcode.co/following",q0="pwc:announcement:following-feed:v1:dismissed",th=[{to:"/",label:"Trending",end:!0},{to:"/tasks",label:"Browse state-of-the-art",end:!1},{to:"/methods",label:"Methods",end:!1},{to:"/conferences",label:"Conferences",end:!1},{to:"/organizations",label:"Organizations",end:!1},{to:"/submit",label:"Submit",end:!1}],k2=()=>{if(typeof navigator>"u")return!1;const e=navigator.userAgentData,t=(e==null?void 0:e.platform)||navigator.platform||navigator.userAgent||"";return/Mac|iPhone|iPad|iPod/i.test(t)},P2=()=>{const[e,t]=q.useState(!1);return q.useEffect(()=>{t(k2())},[]),w.jsx("kbd",{children:e?"⌘K":"Ctrl K"})},R2=({onOpenSearch:e})=>{const[t,n]=q.useState(!1),[r,i]=q.useState(()=>localStorage.getItem(q0)!=="1"),s=q.useRef(null),o=q.useRef(null),a=()=>n(!1),{user:l,logout:u}=hk(),c=hn(),d=c.pathname.startsWith("/pdf/"),f=`${c.pathname}${c.search}`||"/",m=$o(),_=al()?{to:"/chat",label:"Chat",end:!1,badge:"New"}:tF()?{to:"/chat",label:"Chat",end:!1,badge:"New",href:eF}:null,p=_?[th[0],_,...th.slice(1)]:th;return q.useLayoutEffect(()=>{var S;const y=s.current,h=o.current;if(!y||!h)return;let v=!1;const x=()=>{if(v)return;const P=y.querySelector(".nav-item.active"),C=(P==null?void 0:P.offsetWidth)??0;h.style.width=`${C}px`,h.style.transform=`translateX(${(P==null?void 0:P.offsetLeft)??0}px)`,h.style.opacity=C>0?"1":"0"};x();const b=window.requestAnimationFrame(()=>{h.classList.add("nav-indicator-ready")}),E=typeof ResizeObserver>"u"?null:new ResizeObserver(x);return E==null||E.observe(y),window.addEventListener("resize",x),(S=document.fonts)==null||S.ready.then(x),()=>{v=!0,window.cancelAnimationFrame(b),E==null||E.disconnect(),window.removeEventListener("resize",x)}},[c.pathname,p.length]),w.jsxs(q$,{open:t,onOpenChange:n,children:[w.jsxs("header",{className:"app-header",children:[w.jsxs("div",{className:"app-header-inner",children:[w.jsxs(ys,{to:"/",className:"brand",onClick:a,children:[w.jsx("span",{className:"brand-mark"}),w.jsxs("span",{className:"brand-name",children:["Papers ",w.jsx("em",{children:"With Code"})]})]}),w.jsxs("nav",{className:"nav",ref:s,children:[p.map(({to:y,label:h,end:v,badge:x,href:b})=>{const E=w.jsxs(w.Fragment,{children:[w.jsx("span",{children:h}),x&&w.jsx("span",{className:"nav-new-badge","aria-hidden":"true",children:x})]});return b?w.jsx("a",{href:b,target:"_blank",rel:"noreferrer",className:`nav-item${x?" nav-item-with-badge":""}`,children:E},y):w.jsx(ys,{to:y,end:v,className:({isActive:S})=>`nav-item${x?" nav-item-with-badge":""}${S?" active":""}`,children:E},y)}),w.jsx("span",{ref:o,className:"nav-indicator","aria-hidden":"true"})]}),w.jsx("div",{className:"header-spacer"}),w.jsx("a",{className:"feedback-link header-feedback-link",href:V0,target:"_blank",rel:"noreferrer",children:"Submit feedback"}),w.jsx("a",{className:"icon-btn header-github-btn",href:B0,target:"_blank",rel:"noreferrer","aria-label":"GitHub repository",title:"GitHub repository",children:w.jsx(Mr,{name:"github",size:14})}),w.jsxs("button",{className:"search-trigger","aria-label":"Search papers, authors, domains",onClick:e,children:[w.jsx(Mr,{name:"search",size:13}),w.jsx("span",{children:"Search papers, authors, domains…"}),w.jsx(P2,{})]}),w.jsx("button",{className:"icon-btn mobile-search-btn","aria-label":"Search",onClick:e,children:w.jsx(Mr,{name:"search",size:14})}),!m&&w.jsx(ys,{to:"/saved",className:"icon-btn header-bookmark-btn","aria-label":"Saved papers",title:"Saved papers",children:w.jsx(Mr,{name:"bookmark",size:13})}),m?null:l?w.jsx(y2,{user:l,onLogout:u}):w.jsx(m1,{returnTo:f}),w.jsx(W$,{asChild:!0,children:w.jsx("button",{className:"icon-btn mobile-menu-btn","aria-label":"Open menu",children:w.jsx(Mr,{name:"menu",size:14})})})]}),!d&&r&&w.jsxs("div",{className:"site-announcement",role:"status",children:[w.jsx("span",{children:"New: "}),m?w.jsx("a",{href:C2,target:"_blank",rel:"noreferrer",children:"following feed"}):w.jsx(bn,{to:"/following",children:"following feed"}),w.jsx("span",{children:", follow your favorite tasks, benchmarks, authors or organizations"}),w.jsx("button",{type:"button",className:"site-announcement-close","aria-label":"Dismiss announcement",onClick:()=>{localStorage.setItem(q0,"1"),i(!1)},children:w.jsx(Mr,{name:"close",size:11})})]})]}),w.jsx(H$,{children:w.jsx(G$,{className:"mobile-nav-drawer",children:w.jsxs(K$,{className:"mobile-nav-panel","aria-describedby":void 0,children:[w.jsx(Q$,{className:"sr-only",children:"Navigation menu"}),w.jsx(Y$,{className:"icon-btn mobile-nav-close","aria-label":"Close menu",children:w.jsx(Mr,{name:"close",size:14})}),w.jsxs("button",{type:"button",className:"mobile-nav-link mobile-nav-search",onClick:()=>{a(),e()},children:[w.jsx(Mr,{name:"search",size:14}),w.jsx("span",{children:"Search papers, authors, domains…"})]}),p.map(({to:y,label:h,end:v,badge:x,href:b})=>{const E=`mobile-nav-link${x?" mobile-nav-link-with-badge":""}`,S=w.jsxs(w.Fragment,{children:[w.jsx("span",{children:h}),x&&w.jsx("span",{className:"nav-new-badge","aria-hidden":"true",children:x})]});return b?w.jsx("a",{href:b,target:"_blank",rel:"noreferrer",className:E,onClick:a,children:S},y):w.jsx(ys,{to:y,end:v,className:E,onClick:a,children:S},y)}),w.jsx("a",{className:"mobile-nav-link",href:V0,target:"_blank",rel:"noreferrer",onClick:a,children:"Submit feedback"}),w.jsx("a",{className:"mobile-nav-link",href:B0,target:"_blank",rel:"noreferrer",onClick:a,children:"GitHub"}),!m&&w.jsx(ys,{to:"/saved",className:"mobile-nav-link",onClick:a,children:"Saved papers"}),!m&&(l==null?void 0:l.is_admin)&&w.jsx(ys,{to:"/admin-dashboard",className:"mobile-nav-link",onClick:a,children:"Admin dashboard"})]})})})]})},T2=()=>{const{pathname:e}=hn();return e==="/chat"||e.startsWith("/chat/")||e.startsWith("/pdf/")?null:w.jsx("footer",{className:"site-footer",children:w.jsxs("div",{className:"site-footer-inner",children:[w.jsxs("span",{children:["© ",new Date().getFullYear()," Hugging Face"]}),w.jsx(bn,{to:"/docs/api",children:"API"}),w.jsx(bn,{to:"/mcp",children:"MCP"}),w.jsx(bn,{to:"/privacy",children:"Privacy"}),w.jsx("a",{href:"https://github.com/huggingface/paperswithcode-feedback/issues",target:"_blank",rel:"noreferrer",children:"Feedback"})]})})},I2=1,O2=1e6;let nh=0;function M2(){return nh=(nh+1)%Number.MAX_SAFE_INTEGER,nh.toString()}const rh=new Map,W0=e=>{if(rh.has(e))return;const t=setTimeout(()=>{rh.delete(e),Ia({type:"REMOVE_TOAST",toastId:e})},O2);rh.set(e,t)},A2=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,I2)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?W0(n):e.toasts.forEach(r=>{W0(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Lu=[];let ju={toasts:[]};function Ia(e){ju=A2(ju,e),Lu.forEach(t=>{t(ju)})}function N2({...e}){const t=M2(),n=i=>Ia({type:"UPDATE_TOAST",toast:{...i,id:t}}),r=()=>Ia({type:"DISMISS_TOAST",toastId:t});return Ia({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:i=>{i||r()}}}),{id:t,dismiss:r,update:n}}function $2(){const[e,t]=g.useState(ju);return g.useEffect(()=>(Lu.push(t),()=>{const n=Lu.indexOf(t);n>-1&&Lu.splice(n,1)}),[e]),{...e,toast:N2,dismiss:n=>Ia({type:"DISMISS_TOAST",toastId:n})}}var F2=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),L2="VisuallyHidden",fm=g.forwardRef((e,t)=>w.jsx(ke.span,{...e,ref:t,style:{...F2,...e.style}}));fm.displayName=L2;var hm="ToastProvider",[pm,j2,D2]=Kg("Toast"),[pk]=os("Toast",[D2]),[z2,Md]=pk(hm),vk=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:i="right",swipeThreshold:s=50,children:o}=e,[a,l]=g.useState(null),[u,c]=g.useState(0),d=g.useRef(!1),f=g.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${hm}\`. Expected non-empty \`string\`.`),w.jsx(pm.Provider,{scope:t,children:w.jsx(z2,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:s,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:g.useCallback(()=>c(m=>m+1),[]),onToastRemove:g.useCallback(()=>c(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:o})})};vk.displayName=hm;var gk="ToastViewport",U2=["F8"],dv="toast.viewportPause",fv="toast.viewportResume",mk=g.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=U2,label:i="Notifications ({hotkey})",...s}=e,o=Md(gk,n),a=j2(n),l=g.useRef(null),u=g.useRef(null),c=g.useRef(null),d=g.useRef(null),f=et(t,d,o.onViewportChange),m=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),_=o.toastCount>0;g.useEffect(()=>{const y=h=>{var x;r.length!==0&&r.every(b=>h[b]||h.code===b)&&((x=d.current)==null||x.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),g.useEffect(()=>{const y=l.current,h=d.current;if(_&&y&&h){const v=()=>{if(!o.isClosePausedRef.current){const S=new CustomEvent(dv);h.dispatchEvent(S),o.isClosePausedRef.current=!0}},x=()=>{if(o.isClosePausedRef.current){const S=new CustomEvent(fv);h.dispatchEvent(S),o.isClosePausedRef.current=!1}},b=S=>{!y.contains(S.relatedTarget)&&x()},E=()=>{y.contains(document.activeElement)||x()};return y.addEventListener("focusin",v),y.addEventListener("focusout",b),y.addEventListener("pointermove",v),y.addEventListener("pointerleave",E),window.addEventListener("blur",v),window.addEventListener("focus",x),()=>{y.removeEventListener("focusin",v),y.removeEventListener("focusout",b),y.removeEventListener("pointermove",v),y.removeEventListener("pointerleave",E),window.removeEventListener("blur",v),window.removeEventListener("focus",x)}}},[_,o.isClosePausedRef]);const p=g.useCallback(({tabbingDirection:y})=>{const v=a().map(x=>{const b=x.ref.current,E=[b,...e3(b)];return y==="forwards"?E:E.reverse()});return(y==="forwards"?v.reverse():v).flat()},[a]);return g.useEffect(()=>{const y=d.current;if(y){const h=v=>{var E,S,P;const x=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!x){const C=document.activeElement,T=v.shiftKey;if(v.target===y&&T){(E=u.current)==null||E.focus();return}const M=p({tabbingDirection:T?"backwards":"forwards"}),z=M.findIndex(F=>F===C);ih(M.slice(z+1))?v.preventDefault():T?(S=u.current)==null||S.focus():(P=c.current)==null||P.focus()}};return y.addEventListener("keydown",h),()=>y.removeEventListener("keydown",h)}},[a,p]),w.jsxs(MN,{ref:l,role:"region","aria-label":i.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:_?void 0:"none"},children:[_&&w.jsx(hv,{ref:u,onFocusFromOutsideViewport:()=>{const y=p({tabbingDirection:"forwards"});ih(y)}}),w.jsx(pm.Slot,{scope:n,children:w.jsx(ke.ol,{tabIndex:-1,...s,ref:f})}),_&&w.jsx(hv,{ref:c,onFocusFromOutsideViewport:()=>{const y=p({tabbingDirection:"backwards"});ih(y)}})]})});mk.displayName=gk;var yk="ToastFocusProxy",hv=g.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,s=Md(yk,n);return w.jsx(fm,{tabIndex:0,...i,ref:t,style:{position:"fixed"},onFocus:o=>{var u;const a=o.relatedTarget;!((u=s.viewport)!=null&&u.contains(a))&&r()}})});hv.displayName=yk;var Rl="Toast",V2="toast.swipeStart",B2="toast.swipeMove",q2="toast.swipeCancel",W2="toast.swipeEnd",_k=g.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:i,onOpenChange:s,...o}=e,[a,l]=yd({prop:r,defaultProp:i??!0,onChange:s,caller:Rl});return w.jsx(br,{present:n||a,children:w.jsx(K2,{open:a,...o,ref:t,onClose:()=>l(!1),onPause:Ut(e.onPause),onResume:Ut(e.onResume),onSwipeStart:ee(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ee(e.onSwipeMove,u=>{const{x:c,y:d}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:ee(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:ee(e.onSwipeEnd,u=>{const{x:c,y:d}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),l(!1)})})})});_k.displayName=Rl;var[H2,G2]=pk(Rl,{onClose(){}}),K2=g.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:i,open:s,onClose:o,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:c,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:m,..._}=e,p=Md(Rl,n),[y,h]=g.useState(null),v=et(t,F=>h(F)),x=g.useRef(null),b=g.useRef(null),E=i||p.duration,S=g.useRef(0),P=g.useRef(E),C=g.useRef(0),{onToastAdd:T,onToastRemove:R}=p,N=Ut(()=>{var W;(y==null?void 0:y.contains(document.activeElement))&&((W=p.viewport)==null||W.focus()),o()}),M=g.useCallback(F=>{!F||F===1/0||(window.clearTimeout(C.current),S.current=new Date().getTime(),C.current=window.setTimeout(N,F))},[N]);g.useEffect(()=>{const F=p.viewport;if(F){const W=()=>{M(P.current),u==null||u()},B=()=>{const Q=new Date().getTime()-S.current;P.current=P.current-Q,window.clearTimeout(C.current),l==null||l()};return F.addEventListener(dv,B),F.addEventListener(fv,W),()=>{F.removeEventListener(dv,B),F.removeEventListener(fv,W)}}},[p.viewport,E,l,u,M]),g.useEffect(()=>{s&&!p.isClosePausedRef.current&&M(E)},[s,E,p.isClosePausedRef,M]),g.useEffect(()=>(T(),()=>R()),[T,R]);const z=g.useMemo(()=>y?kk(y):null,[y]);return p.viewport?w.jsxs(w.Fragment,{children:[z&&w.jsx(Q2,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:z}),w.jsx(H2,{scope:n,onClose:N,children:xl.createPortal(w.jsx(pm.ItemSlot,{scope:n,children:w.jsx(ON,{asChild:!0,onEscapeKeyDown:ee(a,()=>{p.isFocusedToastEscapeKeyDownRef.current||N(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:w.jsx(ke.li,{tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":p.swipeDirection,..._,ref:v,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:ee(e.onKeyDown,F=>{F.key==="Escape"&&(a==null||a(F.nativeEvent),F.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,N()))}),onPointerDown:ee(e.onPointerDown,F=>{F.button===0&&(x.current={x:F.clientX,y:F.clientY})}),onPointerMove:ee(e.onPointerMove,F=>{if(!x.current)return;const W=F.clientX-x.current.x,B=F.clientY-x.current.y,Q=!!b.current,O=["left","right"].includes(p.swipeDirection),A=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,V=O?A(0,W):0,K=O?0:A(0,B),te=F.pointerType==="touch"?10:2,oe={x:V,y:K},de={originalEvent:F,delta:oe};Q?(b.current=oe,pu(B2,d,de,{discrete:!1})):H0(oe,p.swipeDirection,te)?(b.current=oe,pu(V2,c,de,{discrete:!1}),F.target.setPointerCapture(F.pointerId)):(Math.abs(W)>te||Math.abs(B)>te)&&(x.current=null)}),onPointerUp:ee(e.onPointerUp,F=>{const W=b.current,B=F.target;if(B.hasPointerCapture(F.pointerId)&&B.releasePointerCapture(F.pointerId),b.current=null,x.current=null,W){const Q=F.currentTarget,O={originalEvent:F,delta:W};H0(W,p.swipeDirection,p.swipeThreshold)?pu(W2,m,O,{discrete:!0}):pu(q2,f,O,{discrete:!0}),Q.addEventListener("click",A=>A.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),Q2=e=>{const{__scopeToast:t,children:n,...r}=e,i=Md(Rl,t),[s,o]=g.useState(!1),[a,l]=g.useState(!1);return J2(()=>o(!0)),g.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:w.jsx(wd,{asChild:!0,children:w.jsx(fm,{...r,children:s&&w.jsxs(w.Fragment,{children:[i.label," ",n]})})})},Y2="ToastTitle",wk=g.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return w.jsx(ke.div,{...r,ref:t})});wk.displayName=Y2;var X2="ToastDescription",xk=g.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return w.jsx(ke.div,{...r,ref:t})});xk.displayName=X2;var bk="ToastAction",Ek=g.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?w.jsx(Ck,{altText:n,asChild:!0,children:w.jsx(vm,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${bk}\`. Expected non-empty \`string\`.`),null)});Ek.displayName=bk;var Sk="ToastClose",vm=g.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,i=G2(Sk,n);return w.jsx(Ck,{asChild:!0,children:w.jsx(ke.button,{type:"button",...r,ref:t,onClick:ee(e.onClick,i.onClose)})})});vm.displayName=Sk;var Ck=g.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...i}=e;return w.jsx(ke.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...i,ref:t})});function kk(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),Z2(r)){const i=r.ariaHidden||r.hidden||r.style.display==="none",s=r.dataset.radixToastAnnounceExclude==="";if(!i)if(s){const o=r.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...kk(r))}}),t}function pu(e,t,n,{discrete:r}){const i=n.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Lg(i,s):i.dispatchEvent(s)}var H0=(e,t,n=0)=>{const r=Math.abs(e.x),i=Math.abs(e.y),s=r>i;return t==="left"||t==="right"?s&&r>n:!s&&i>n};function J2(e=()=>{}){const t=Ut(e);fn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function Z2(e){return e.nodeType===e.ELEMENT_NODE}function e3(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ih(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var t3=vk,Pk=mk,Rk=_k,Tk=wk,Ik=xk,Ok=Ek,Mk=vm;const G0=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,K0=M1,n3=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return K0(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:s}=t,o=Object.keys(i).map(u=>{const c=n==null?void 0:n[u],d=s==null?void 0:s[u];if(c===null)return null;const f=G0(c)||G0(d);return i[u][f]}),a=n&&Object.entries(n).reduce((u,c)=>{let[d,f]=c;return f===void 0||(u[d]=f),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,c)=>{let{class:d,className:f,...m}=c;return Object.entries(m).every(_=>{let[p,y]=_;return Array.isArray(y)?y.includes({...s,...a}[p]):{...s,...a}[p]===y})?[...u,d,f]:u},[]);return K0(e,o,l,n==null?void 0:n.class,n==null?void 0:n.className)},r3=t3,Ak=g.forwardRef(({className:e,...t},n)=>w.jsx(Pk,{ref:n,className:ct("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));Ak.displayName=Pk.displayName;const i3=n3("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-16 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Nk=g.forwardRef(({className:e,variant:t,...n},r)=>w.jsx(Rk,{ref:r,className:ct(i3({variant:t}),e),...n}));Nk.displayName=Rk.displayName;const s3=g.forwardRef(({className:e,...t},n)=>w.jsx(Ok,{ref:n,className:ct("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",e),...t}));s3.displayName=Ok.displayName;const $k=g.forwardRef(({className:e,...t},n)=>w.jsx(Mk,{ref:n,className:ct("absolute right-2 top-2 inline-flex h-11 w-11 items-center justify-center rounded-md text-foreground transition-colors hover:bg-muted focus:outline-none focus:ring-2 focus:ring-ring group-[.destructive]:text-destructive-foreground group-[.destructive]:hover:bg-destructive-foreground/10 group-[.destructive]:focus:ring-destructive-foreground",e),"aria-label":"Dismiss notification","toast-close":"",...t,children:w.jsx(c2,{className:"h-4 w-4"})}));$k.displayName=Mk.displayName;const Fk=g.forwardRef(({className:e,...t},n)=>w.jsx(Tk,{ref:n,className:ct("text-sm font-semibold",e),...t}));Fk.displayName=Tk.displayName;const Lk=g.forwardRef(({className:e,...t},n)=>w.jsx(Ik,{ref:n,className:ct("text-sm opacity-90",e),...t}));Lk.displayName=Ik.displayName;function o3(){const{toasts:e}=$2();return w.jsxs(r3,{children:[e.map(function({id:t,title:n,description:r,action:i,...s}){return w.jsxs(Nk,{...s,children:[w.jsxs("div",{className:"grid gap-1",children:[n&&w.jsx(Fk,{children:n}),r&&w.jsx(Lk,{children:r})]}),i,w.jsx($k,{})]},t)}),w.jsx(Ak,{})]})}function a3(){const{pathname:e,hash:t}=hn();g.useLayoutEffect(()=>{t||window.scrollTo({top:0,left:0,behavior:"instant"})},[e,t])}const jk=rF(),l3=jk?wA:_A;if(!jk&&typeof window<"u"){const e=window.location.hash;e.startsWith("#/")&&!e.startsWith("#//")&&window.history.replaceState(null,"",e.slice(1))}const u3=q.lazy(()=>ae(()=>import("./AuthorizePaperEditView-BA-4FAC_.js"),__vite__mapDeps([0,1,2,3]))),c3=q.lazy(()=>ae(()=>import("./FollowingView-DVSEqGFR.js"),__vite__mapDeps([4,5,6,7,8,9,1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33]))),d3=q.lazy(()=>ae(()=>import("./TopicView-BynemQKe.js"),__vite__mapDeps([34,13,14,15,16,17,18,10,19,20,21,22,23,24,25,26,31,32,9,1,11,35]))),f3=q.lazy(()=>ae(()=>import("./FeedView-T5hkRnNT.js"),__vite__mapDeps([5,6,7,8,9,1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33]))),h3=q.lazy(()=>ae(()=>import("./ChatView-C7RaZyCS.js"),__vite__mapDeps([36,37,29,30,21,22,38,39,8,40,41,42,43,44,45,1,46,47,48,49,50,11,51,52,15,16,53,54,27,28,55,19,56,57]))),p3=q.lazy(()=>ae(()=>import("./SharedChatView-DHFlFcmS.js"),__vite__mapDeps([58,37,29,30,21,22,38,39,8,40,41,42,43,44,45,1,46,47,48,49,50,11,51,52,15,16,53,54]))),v3=q.lazy(()=>ae(()=>import("./PapersListView-VY1_gvHF.js"),__vite__mapDeps([59,17,18,10,19,13,14,15,16,20,21,22,23,24,25,26,8,31,32,60,33,61,62]))),g3=q.lazy(()=>ae(()=>import("./PaperDetailView-CTPtjCWI.js"),__vite__mapDeps([63,1,19,17,18,10,20,64,22,38,23,65,21,66,31,32,67,68,69,56,25,33,2,7,28,47,70,71,72,73,24,51,74,39,8,75,76,77,78,11,79,80,40,81,82,43,44,26,83,84,15,16,85]))),m3=q.lazy(()=>ae(()=>import("./PaperReaderView-D01S6OM3.js"),__vite__mapDeps([86,37,29,30,21,22,38,39,8,40,41,42,43,44,45,1,46,47,48,49,50,11,51,52,15,16,53,54,87,66,23,31,32,36,27,28,55,19,56,57]))),y3=q.lazy(()=>ae(()=>import("./TagsIndexView-ChN-5wyU.js"),__vite__mapDeps([88,8,18,10,89,51,90,55,91,92,46,78,35,93,41,94,80,6,33,95,25,96,75,2,72,76,73,24,7,74,1,77,11,97,98]))),_3=q.lazy(()=>ae(()=>import("./TagBrowseView-ZQj4XIo7.js"),__vite__mapDeps([99,100,9,1,11,17,18,10,13,14,15,16,19,20,21,22,23,24,25,26,12,101,87,42,43,44,45,38,54,8,61,62,68,69,89,31,32,33,102,93,40]))),w3=q.lazy(()=>ae(()=>import("./MethodsIndexView-BIAyn6Np.js"),__vite__mapDeps([103,8,98,89,33,95,25,96,75,2,72,76,73,24,7,51,74,1,77,11,97,91]))),x3=q.lazy(()=>ae(()=>import("./FrameworksIndexView-BVijHCyJ.js"),__vite__mapDeps([104,19,8,18,62]))),b3=q.lazy(()=>ae(()=>import("./TrendsView-B2Nu5XpR.js"),__vite__mapDeps([105,33,25]))),E3=q.lazy(()=>ae(()=>import("./ConferencesIndexView-W-0wqk8I.js"),__vite__mapDeps([106,8,107,33,95,25,96,75,2,72,76,73,24,7,51,74,1,77,11]))),S3=q.lazy(()=>ae(()=>import("./AiDeadlinesView-C6rZe1HQ.js"),__vite__mapDeps([108,8,109,81,25,33,23,7,107]))),C3=q.lazy(()=>ae(()=>import("./ConferenceDetailView-jxKxeht5.js"),__vite__mapDeps([110,95,25,87,42,43,44,45,38,21,22,1,54,8,61,98,18,111,107,10,33,23,102]))),k3=q.lazy(()=>ae(()=>import("./ConferenceTaskView-DUmYfmWg.js"),__vite__mapDeps([112,13,14,15,16,17,18,10,19,20,21,22,23,24,25,26,87,42,43,44,45,38,1,54,8,61,111,31,32,33,102]))),P3=q.lazy(()=>ae(()=>import("./OrganizationsIndexView-BKYZomGz.js"),__vite__mapDeps([113,33,8,114]))),R3=q.lazy(()=>ae(()=>import("./OrganizationDetailView-BWLPu8mH.js"),__vite__mapDeps([115,100,9,1,11,87,42,43,44,45,38,21,22,54,116,25,8,13,14,15,16,17,18,10,19,20,23,24,26,33,73,2,7,51,74,31,32,61,84,102]))),T3=q.lazy(()=>ae(()=>import("./OrganizationDetailView-BWLPu8mH.js"),__vite__mapDeps([115,100,9,1,11,87,42,43,44,45,38,21,22,54,116,25,8,13,14,15,16,17,18,10,19,20,23,24,26,33,73,2,7,51,74,31,32,61,84,102]))),I3=q.lazy(()=>ae(()=>import("./AuthorDetailView-D7LkRdLr.js"),__vite__mapDeps([117,15,16,13,14,17,18,10,19,20,21,22,23,24,25,26,100,9,1,11,33,31,32,61,102]))),O3=q.lazy(()=>ae(()=>import("./MethodDetailView-fHVzs8OA.js"),__vite__mapDeps([118,100,9,1,11,17,18,10,13,14,15,16,19,20,21,22,23,24,25,26,87,42,43,44,45,38,54,8,61,89,31,32,33,102]))),M3=q.lazy(()=>ae(()=>import("./BenchmarkDetailView-BQc3hR5I.js"),__vite__mapDeps([119,100,9,1,11,8,64,22,38,23,65,68,69,20,109,81,19,25,33,101,89,61,102,120]))),A3=q.lazy(()=>ae(()=>import("./SavedPapersView-CffKQwuC.js"),__vite__mapDeps([121,14,15,16,17,18,10,19,20,21,22,23,25,33,69,83]))),N3=q.lazy(()=>ae(()=>import("./SettingsView-_N3_O5i0.js"),__vite__mapDeps([122,1,9,109,81,6,12,93,30,67,57,68,69,50,92]))),$3=q.lazy(()=>ae(()=>import("./PrivacyView-2dCBj8zE.js"),__vite__mapDeps([123,67]))),F3=q.lazy(()=>ae(()=>import("./ApiDocsView-D0f2oP-S.js"),__vite__mapDeps([124,67,43,125]))),L3=q.lazy(()=>ae(()=>import("./McpView-DLNB1sUw.js"),__vite__mapDeps([126,67,48,40,50,47,127]))),j3=q.lazy(()=>ae(()=>import("./SubmitView-Bsr4OUhJ.js"),__vite__mapDeps([128,1,33,2,72,76,21,22,71]))),D3=q.lazy(()=>ae(()=>import("./CronDashboard-DrKxFNux.js"),__vite__mapDeps([129,1,130,131,79,2,52,78,91,94,41,90,50,132,74,133,82,32,3,8,30]))),z3=q.lazy(()=>ae(()=>import("./AutonomousOperations-CODCSTk3.js"),__vite__mapDeps([134,1,130,131,79,2,72,94,49]))),U3=q.lazy(()=>ae(()=>import("./SubmissionsDashboard-U7U8ESH5.js"),__vite__mapDeps([135,70,71,1,32,8,23,77,21,22,132,74,133,136]))),V3=q.lazy(()=>ae(()=>import("./UserProfileView-DQtExllo.js"),__vite__mapDeps([137,116,25,8]))),B3=q.lazy(()=>ae(()=>import("./RateLimitsView-BphGmeyY.js"),__vite__mapDeps([138,69]))),q3=q.lazy(()=>ae(()=>import("./AstraForRoboticsView-DihUxGRN.js"),__vite__mapDeps([139,13,14,15,16,17,18,10,19,20,21,22,23,24,25,26,33,31,32,67,140]))),sh=q.lazy(()=>ae(()=>import("./NotFound-DXa9p6DX.js"),[])),W3=q.lazy(()=>ae(()=>import("./SearchOverlay-By9cH9ju.js"),__vite__mapDeps([141,20,8,21,22,60,18,10]))),H3=q.lazy(()=>ae(()=>import("./StagingAccessRequestView-Dj2Lej-i.js"),__vite__mapDeps([142,133]))),Dk=()=>w.jsxs("div",{className:"page","aria-busy":"true","aria-live":"polite",children:[w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:24,width:"30%",marginBottom:24}}),w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:64,width:"60%",marginBottom:32}}),w.jsxs("div",{className:"paper-list",style:{display:"grid",gap:16},children:[w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}})]})]}),G3=new YA({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),K3=()=>{const{arxivId:e}=wS();return w.jsx(Ki,{to:e?`/paper/${e}`:"/papers",replace:!0})},Q3=()=>{const{taskSlug:e}=wS();return w.jsx(Ki,{to:e?`/tasks/${e}`:"/tasks",replace:!0})},Y3=({element:e})=>$o()?w.jsx(Ki,{to:"/",replace:!0}):w.jsx(w.Fragment,{children:e}),pv=({element:e})=>{const{user:t,isLoading:n}=hk(),r=hn();return $o()?w.jsx(Ki,{to:"/",replace:!0}):n?w.jsx("div",{className:"page",children:w.jsx("div",{className:"submission-loading",children:w.jsx("span",{children:"Checking admin session..."})})}):t?t.is_admin?w.jsx(w.Fragment,{children:e}):w.jsx("div",{className:"page",children:w.jsxs("div",{className:"submission-empty submission-empty-warn",children:[w.jsx("h1",{children:"Admin access required"}),w.jsxs("p",{children:["Signed in as @",t.username,". This dashboard is limited to allowlisted admin accounts."]})]})}):w.jsx("div",{className:"page",children:w.jsxs("div",{className:"submission-empty submission-empty-warn",children:[w.jsx("h1",{children:"Sign in required"}),w.jsx("p",{children:"Sign in with an allowlisted Hugging Face admin account to view admin operations."}),w.jsx(m1,{returnTo:`${r.pathname}${r.search}`})]})})},X3=()=>{const e=Z$(),t=typeof window<"u"&&new URL(e,window.location.origin).origin!==window.location.origin;return q.useEffect(()=>{t&&window.location.replace(e)},[e,t]),t?w.jsx("div",{className:"page",children:w.jsxs("div",{className:"submission-loading",children:[w.jsx("span",{children:"Opening the production admin dashboard..."}),w.jsx("a",{href:e,children:"Continue"})]})}):w.jsx(pv,{element:w.jsx(D3,{})})},Q0=({reader:e=!1})=>{const[t,n]=q.useState(!1),{pathname:r}=hn();q.useEffect(()=>{const a=l=>{(l.metaKey||l.ctrlKey)&&l.key==="k"&&(l.preventDefault(),n(!0))};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[]);const i=w.jsx(R2,{onOpenSearch:()=>n(!0)}),s=w.jsx(dS,{resetKey:r,children:w.jsx(q.Suspense,{fallback:w.jsx(Dk,{}),children:w.jsx(uA,{})})}),o=t&&w.jsx(q.Suspense,{fallback:null,children:w.jsx(W3,{open:t,onClose:()=>n(!1)})});return e?w.jsxs("div",{className:"reader-route-shell",children:[i,w.jsx("div",{className:"reader-route-content",children:s}),o]}):w.jsxs(w.Fragment,{children:[i,w.jsx("main",{children:s}),w.jsx(T2,{}),o]})},J3=()=>(a3(),q.useLayoutEffect(()=>{var e;(e=document.getElementById("initial-discovery-footer"))==null||e.remove()},[]),w.jsxs(cA,{children:[w.jsx(re,{path:"/request-access",element:w.jsx(q.Suspense,{fallback:w.jsx(Dk,{}),children:w.jsx(H3,{})})}),w.jsx(re,{element:w.jsx(Q0,{reader:!0}),children:w.jsx(re,{path:"/pdf/:paperId",element:nF()?w.jsx(m3,{}):w.jsx(sh,{})})}),w.jsxs(re,{element:w.jsx(Q0,{}),children:[w.jsx(re,{path:"/",element:w.jsx(f3,{})}),w.jsx(re,{path:"/following",element:w.jsx(c3,{})}),w.jsx(re,{path:"/topics/:topicParam",element:w.jsx(d3,{})}),w.jsx(re,{path:"/x-trending",element:w.jsx(Ki,{to:"/",replace:!0})}),w.jsx(re,{path:"/chat/:sessionId?",element:al()?w.jsx(h3,{}):w.jsx(Ki,{to:"/",replace:!0})}),w.jsx(re,{path:"/share/:shareId",element:al()?w.jsx(p3,{}):w.jsx(sh,{})}),w.jsx(re,{path:"/papers",element:w.jsx(v3,{})}),w.jsx(re,{path:"/papers/:arxivId",element:w.jsx(K3,{})}),w.jsx(re,{path:"/paper/:arxivId",element:w.jsx(g3,{})}),w.jsx(re,{path:"/tasks",element:w.jsx(y3,{})}),w.jsx(re,{path:"/tasks/:taskSlug",element:w.jsx(_3,{})}),w.jsx(re,{path:"/task/:taskSlug",element:w.jsx(Q3,{})}),w.jsx(re,{path:"/methods",element:w.jsx(w3,{})}),w.jsx(re,{path:"/methods/:methodSlug",element:w.jsx(O3,{})}),w.jsx(re,{path:"/frameworks",element:w.jsx(x3,{})}),w.jsx(re,{path:"/trends",element:w.jsx(b3,{})}),w.jsx(re,{path:"/conferences",element:w.jsx(E3,{})}),w.jsx(re,{path:"/ai-deadlines",element:w.jsx(S3,{})}),w.jsx(re,{path:"/conferences/:confSlug",element:w.jsx(C3,{})}),w.jsx(re,{path:"/conferences/:confSlug/:taskSlug",element:w.jsx(k3,{})}),w.jsx(re,{path:"/organizations",element:w.jsx(P3,{})}),w.jsx(re,{path:"/orgs/:orgSlug",element:w.jsx(R3,{})}),w.jsx(re,{path:"/orgs/:orgSlug/:taskSlug",element:w.jsx(T3,{})}),w.jsx(re,{path:"/authors/:authorId",element:w.jsx(I3,{})}),w.jsx(re,{path:"/benchmark/:datasetSlug",element:w.jsx(M3,{})}),w.jsx(re,{path:"/authorize-paper-edit/:authorizationId",element:w.jsx(u3,{})}),w.jsx(re,{path:"/submit",element:w.jsx(j3,{})}),w.jsx(re,{path:"/saved",element:w.jsx(Y3,{element:w.jsx(A3,{})})}),w.jsx(re,{path:"/settings",element:w.jsx(N3,{})}),w.jsx(re,{path:"/privacy",element:w.jsx($3,{})}),w.jsx(re,{path:"/docs/api",element:w.jsx(F3,{})}),w.jsx(re,{path:"/mcp",element:w.jsx(L3,{})}),w.jsx(re,{path:"/admin-dashboard",element:w.jsx(X3,{})}),w.jsx(re,{path:"/autonomous-operations",element:w.jsx(pv,{element:w.jsx(z3,{})})}),w.jsx(re,{path:"/cron-dashboard",element:w.jsx(Ki,{to:"/admin-dashboard",replace:!0})}),w.jsx(re,{path:"/submissions",element:w.jsx(pv,{element:w.jsx(U3,{})})}),w.jsx(re,{path:"/rate-limits",element:w.jsx(B3,{})}),w.jsx(re,{path:"/astra-for-robotics",element:w.jsx(q3,{})}),w.jsx(re,{path:"/:username",element:w.jsx(V3,{})}),w.jsx(re,{path:"*",element:w.jsx(sh,{})})]})]})),Z3=()=>w.jsx(XA,{client:G3,children:w.jsxs(S2,{children:[w.jsx(l3,{children:w.jsx(J3,{})}),w.jsx(o3,{}),!1]})});mM();const ez=w.jsx(mT,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,storageKey:"pwc-theme",children:w.jsx(dS,{children:w.jsx(Z3,{})})}),tz=_b(document.getElementById("root"));tz.render(w.jsx(q.StrictMode,{children:ez}));export{f2 as $,Od as A,yd as B,a2 as C,et as D,ee as E,wj as F,os as G,m1 as H,ct as I,Rz as J,fz as K,bn as L,yz as M,U1 as N,Vj as O,br as P,dC as Q,Uj as R,u2 as S,Ez as T,s3 as U,q as V,Sz as W,c2 as X,nF as Y,dz as Z,d2 as _,hk as a,Pz as a$,ck as a0,er as a1,hz as a2,cz as a3,ow as a4,X$ as a5,l2 as a6,ae as a7,M1 as a8,xl as a9,vz as aA,El as aB,Up as aC,il as aD,GA as aE,at as aF,At as aG,IS as aH,bz as aI,e1 as aJ,Dg as aK,WS as aL,jg as aM,BA as aN,az as aO,oz as aP,lN as aQ,qg as aR,RS as aS,JA as aT,tN as aU,sN as aV,nN as aW,rN as aX,aN as aY,l0 as aZ,iN as a_,$g as aa,x2 as ab,cv as ac,_1 as ad,n3 as ae,Ys as af,q$ as ag,H$ as ah,G$ as ai,K$ as aj,vi as ak,Y$ as al,Q$ as am,uz as an,Ki as ao,Pj as ap,Rj as aq,tC as ar,wd as as,_d as at,Tj as au,Ij as av,iz as aw,rz as ax,b2 as ay,xz as az,uN as b,j1 as b0,D1 as b1,z1 as b2,z0 as b3,Id as c,Iz as d,sz as e,g as f,hn as g,J$ as h,$o as i,w as j,Mg as k,DS as l,al as m,tF as n,eF as o,E2 as p,Cz as q,Tz as r,pz as s,kz as t,wS as u,gz as v,mz as w,$2 as x,wz as y,ke as z}; + */const c2=Id("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),d2=t2,f2=n2,h2=g.forwardRef(({className:e,inset:t,children:n,...r},i)=>w.jsxs(ak,{ref:i,className:ct("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent",t&&"pl-8",e),...r,children:[n,w.jsx(l2,{className:"ml-auto h-4 w-4"})]}));h2.displayName=ak.displayName;const p2=g.forwardRef(({className:e,...t},n)=>w.jsx(lk,{ref:n,className:ct("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));p2.displayName=lk.displayName;const ck=g.forwardRef(({className:e,sideOffset:t=4,...n},r)=>w.jsx(r2,{children:w.jsx(ek,{ref:r,sideOffset:t,className:ct("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));ck.displayName=ek.displayName;const er=g.forwardRef(({className:e,inset:t,...n},r)=>w.jsx(nk,{ref:r,className:ct("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t&&"pl-8",e),...n}));er.displayName=nk.displayName;const v2=g.forwardRef(({className:e,children:t,checked:n,...r},i)=>w.jsxs(rk,{ref:i,className:ct("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),checked:n,...r,children:[w.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:w.jsx(sk,{children:w.jsx(a2,{className:"h-4 w-4"})})}),t]}));v2.displayName=rk.displayName;const g2=g.forwardRef(({className:e,children:t,...n},r)=>w.jsxs(ik,{ref:r,className:ct("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...n,children:[w.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:w.jsx(sk,{children:w.jsx(u2,{className:"h-2 w-2 fill-current"})})}),t]}));g2.displayName=ik.displayName;const dk=g.forwardRef(({className:e,inset:t,...n},r)=>w.jsx(tk,{ref:r,className:ct("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));dk.displayName=tk.displayName;const uv=g.forwardRef(({className:e,...t},n)=>w.jsx(ok,{ref:n,className:ct("-mx-1 my-1 h-px bg-muted",e),...t}));uv.displayName=ok.displayName;function m2(e){const n=(e.name||e.username||"?").trim().split(/\s+/).filter(Boolean);return n.length===0?"?":n.length===1?n[0][0].toUpperCase():(n[0][0]+n[n.length-1][0]).toUpperCase()}const y2=({user:e,onLogout:t})=>w.jsxs(d2,{children:[w.jsx(f2,{asChild:!0,children:w.jsx("button",{type:"button",className:"user-avatar-btn","aria-label":`Account menu for ${e.username}`,children:w.jsxs(j1,{className:"h-8 w-8",children:[e.avatar_url&&w.jsx(D1,{src:e.avatar_url,alt:e.username}),w.jsx(z1,{className:"text-xs",children:m2(e)})]})})}),w.jsxs(ck,{align:"end",className:"w-56",children:[w.jsxs(dk,{className:"flex flex-col gap-0.5 py-2",children:[w.jsx("span",{className:"text-sm font-medium leading-tight",children:e.name||e.username}),w.jsxs("span",{className:"text-xs font-normal text-muted-foreground",children:["@",e.username]}),e.is_admin&&w.jsx("span",{className:"mt-1 inline-flex w-fit items-center rounded-full bg-amber-100 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-amber-900",children:"Admin"}),e.role==="contributor"&&w.jsx("span",{className:"mt-1 inline-flex w-fit items-center rounded-full bg-blue-100 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-blue-900",children:"Contributor"})]}),w.jsx(uv,{}),w.jsx(er,{asChild:!0,children:w.jsx("a",{href:`https://huggingface.co/${encodeURIComponent(e.username)}`,target:"_blank",rel:"noopener noreferrer",children:"Hugging Face profile"})}),w.jsx(er,{asChild:!0,children:w.jsx(bn,{to:"/frameworks",children:"Frameworks"})}),w.jsx(er,{asChild:!0,children:w.jsx(bn,{to:"/trends",children:"Trends"})}),e.is_admin&&w.jsxs(w.Fragment,{children:[w.jsx(er,{asChild:!0,children:w.jsx(bn,{to:"/admin-dashboard",children:"Admin dashboard"})}),w.jsx(er,{asChild:!0,children:w.jsx(bn,{to:"/submissions",children:"Review submissions"})})]}),w.jsx(er,{asChild:!0,children:w.jsx(bn,{to:`/${encodeURIComponent(e.username)}`,children:"My contributions"})}),w.jsx(er,{asChild:!0,children:w.jsx(bn,{to:"/settings",children:"Settings"})}),w.jsx(uv,{}),w.jsx(er,{onSelect:n=>{n.preventDefault(),t()},children:"Log out"})]})]}),_2=!1;class Od extends Error{constructor(n,r){var i;super(`API request failed: ${n.status} ${n.statusText}`);kr(this,"status");kr(this,"statusText");kr(this,"response");kr(this,"detail");kr(this,"code");kr(this,"displayMessage");this.name="ApiError",this.status=n.status,this.statusText=n.statusText,this.response=r;try{if(this.detail=(i=JSON.parse(r))==null?void 0:i.detail,typeof this.detail=="string"&&(this.message=this.detail),Array.isArray(this.detail)){const s=this.detail[0];typeof s=="object"&&s!==null&&"msg"in s&&typeof s.msg=="string"&&(this.message=s.msg)}if(typeof this.detail=="object"&&this.detail!==null&&"code"in this.detail&&typeof this.detail.code=="string"&&(this.code=this.detail.code),typeof this.detail=="object"&&this.detail!==null&&"message"in this.detail&&typeof this.detail.message=="string"){const s="help"in this.detail&&typeof this.detail.help=="string"?` See ${this.detail.help} for help.`:"";this.message=`${this.detail.message}${s}`}}catch{this.detail=void 0,this.displayMessage=r||this.message;return}this.displayMessage=this.message}}function wz(e,t){return e instanceof Od?e.displayMessage||t:typeof e=="object"&&e!==null&&"message"in e&&typeof e.message=="string"&&e.message||t}class w2{constructor(t){this.baseUrl=t}async fetch(t,n){const r=`${this.baseUrl}${t}`;try{const{headers:i,...s}=n??{},a=(s.method??"GET").toUpperCase()==="GET"?"default":"no-store",l=new Headers(i);return typeof s.body=="string"&&!l.has("Content-Type")&&l.set("Content-Type","application/json"),await fetch(r,{...s,cache:s.cache??a,credentials:s.credentials??"include",headers:l})}catch(i){throw console.error(`[API] Request to ${r} failed:`,i),i}}async fetchOk(t,n){const r=await this.fetch(t,n);if(!r.ok){const i=new Od(r,await r.text());throw console.error("[API] Error response:",i.response),i}return r}async request(t,n){const r=await this.fetchOk(t,n);return r.status===204?void 0:await r.json()}}function x2(e){e instanceof Od&&e.status===401&&e.code!=="fresh_auth_required"&&e.code!=="saved_papers_bucket_authorization_required"&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:auth-stale"))}async function fk(e){try{return await e()}catch(t){throw x2(t),t}}const cm=new w2(`${Bg()}/api/v1`),b2=(e,t)=>cm.fetch(e,t),xz=(e,t)=>fk(()=>cm.fetchOk(e,t)),cv=(e,t)=>fk(()=>cm.request(e,t));async function bz(e,t){try{return await cv(e,t)}catch(n){if(n instanceof Od&&n.status===404)return null;throw n}}const z0={async getCurrentUser(){if($o())return null;const e=await b2("/auth/me",{cache:"no-store"});return e.status===401||!e.ok?null:e.json()},async logout(){await cv("/auth/logout",{method:"POST"})},async requestStagingAccess(){await cv("/staging-access-request",{method:"POST"})}},E2={detail:e=>["paper",e],arxiv:e=>["paper-arxiv",e],preview:e=>["paper-preview",e],summary:e=>["paper-summary",e],feeds:{list:["papers"],infinite:["papers-infinite"],following:["research-feed"],search:["paper-search-feed"],task:["task-papers-infinite"],conference:["conference-papers-infinite"],organization:["organization-papers-infinite"],method:["method-papers-infinite"],saved:["my-bookmarks"],related:["related-papers"],versions:["paper-versions"],searchOverlay:["search-papers"],mentions:["chat-paper-mention-search"],trending:["trending-papers"]}},Ez=10*60*1e3,hu={me:["auth","me"]},Sz={preferences:["account","preferences"],bookmarkIds:["my-bookmark-ids"]},Cz={areas:["areas-all"],area:e=>["area",e],topTasksSidebar:["top-tasks-sidebar"],task:e=>["task",e],method:e=>["method",e],organization:e=>["organization",e],dataset:e=>["dataset",e],datasets:["dataset"],datasetTasks:["dataset-tasks"],taskPage:["task-page"],taskBenchmarkTrends:["task-benchmark-trends"],organizations:["organizations"]},kz={all:["evaluations"],byPaper:e=>["evaluations","paper",e],byPaperAll:["evaluations","paper"],byDatasetAll:["dataset-evals"],byDataset:e=>["dataset-evals",e]},Pz={pendingEdits:["pendingPaperEdits"]},Rz={all:["admin"],cronStatus:["admin","cronStatus"],chatSandboxSpend:e=>["admin","chatSandboxSpend",e],chatWebSearchBudget:["admin","chatWebSearchBudget"],autonomousOperations:["admin","autonomousOperations"],paperMarkdownJobs:["admin","paperMarkdownJobs"],codexPaperJobs:["admin","codexPaperJobs"],codexPaperJob:(e,t)=>["admin","codexPaperJob",e,t],catalogAudit:["catalog-audit"]},Tz={follows:e=>["research-follows",e],topics:e=>["research-topics",e],publicTopics:["research-public-topic"],publicTopic:(e,t)=>["research-public-topic",e,t],topicPapers:(e,t,n,r)=>[`research-topic-papers-${e}`,t,n.startDate??null,n.endDate??null,r],featuredTopics:["research-featured-topics"],email:e=>["research-email",e],feed:e=>[...E2.feeds.following,e]},dm=q.createContext(null),U0="pwc:auth-stale",S2=({children:e})=>{const t=DS(),n=uN({queryKey:hu.me,queryFn:()=>z0.getCurrentUser(),staleTime:1/0}),r=n.data??null,i=q.useRef(null),{refetch:s}=n,o=q.useCallback(async()=>{await s()},[s]),a=q.useCallback(async()=>{const u=qg("/api/v1/auth/logout");if(new URL(u,window.location.origin).origin!==window.location.origin){const c=document.createElement("form");c.method="POST",c.action=`${u}?return_to=${encodeURIComponent(window.location.href)}`,document.body.appendChild(c),c.submit();return}await z0.logout(),t.setQueryData(hu.me,null)},[t]);q.useEffect(()=>{},[r]),q.useEffect(()=>{i.current&&!r&&t.resetQueries({predicate:u=>u.queryKey[0]!==hu.me[0]}),i.current=r},[t,r]),q.useEffect(()=>{const u=()=>t.setQueryData(hu.me,null);return window.addEventListener(U0,u),()=>window.removeEventListener(U0,u)},[t]);const l=q.useMemo(()=>({user:r,isLoading:n.isPending,refresh:o,logout:a}),[r,n.isPending,o,a]);return w.jsx(dm.Provider,{value:l,children:e})};function hk(){const e=q.useContext(dm);if(!e)throw new Error("useAuth must be used inside an ");return e}function Iz(){return q.useContext(dm)}const Mr=({name:e,size:t=14})=>{const n={search:w.jsx("path",{d:"M11 11l3 3M7 12.5a5.5 5.5 0 110-11 5.5 5.5 0 010 11z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),bookmark:w.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),menu:w.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:w.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),github:w.jsx("path",{fill:"currentColor",d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})};return w.jsx("svg",{className:t===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:t,height:t,children:n[e]})},V0="https://github.com/huggingface/paperswithcode-feedback/issues",B0="https://github.com/huggingface/paperswithcode",C2="https://paperswithcode.co/following",q0="pwc:announcement:following-feed:v1:dismissed",th=[{to:"/",label:"Trending",end:!0},{to:"/tasks",label:"Browse state-of-the-art",end:!1},{to:"/methods",label:"Methods",end:!1},{to:"/conferences",label:"Conferences",end:!1},{to:"/organizations",label:"Organizations",end:!1},{to:"/submit",label:"Submit",end:!1}],k2=()=>{if(typeof navigator>"u")return!1;const e=navigator.userAgentData,t=(e==null?void 0:e.platform)||navigator.platform||navigator.userAgent||"";return/Mac|iPhone|iPad|iPod/i.test(t)},P2=()=>{const[e,t]=q.useState(!1);return q.useEffect(()=>{t(k2())},[]),w.jsx("kbd",{children:e?"⌘K":"Ctrl K"})},R2=({onOpenSearch:e})=>{const[t,n]=q.useState(!1),[r,i]=q.useState(()=>localStorage.getItem(q0)!=="1"),s=q.useRef(null),o=q.useRef(null),a=()=>n(!1),{user:l,logout:u}=hk(),c=hn(),d=c.pathname.startsWith("/pdf/"),f=`${c.pathname}${c.search}`||"/",m=$o(),_=al()?{to:"/chat",label:"Chat",end:!1,badge:"New"}:tF()?{to:"/chat",label:"Chat",end:!1,badge:"New",href:eF}:null,p=_?[th[0],_,...th.slice(1)]:th;return q.useLayoutEffect(()=>{var S;const y=s.current,h=o.current;if(!y||!h)return;let v=!1;const x=()=>{if(v)return;const P=y.querySelector(".nav-item.active"),C=(P==null?void 0:P.offsetWidth)??0;h.style.width=`${C}px`,h.style.transform=`translateX(${(P==null?void 0:P.offsetLeft)??0}px)`,h.style.opacity=C>0?"1":"0"};x();const b=window.requestAnimationFrame(()=>{h.classList.add("nav-indicator-ready")}),E=typeof ResizeObserver>"u"?null:new ResizeObserver(x);return E==null||E.observe(y),window.addEventListener("resize",x),(S=document.fonts)==null||S.ready.then(x),()=>{v=!0,window.cancelAnimationFrame(b),E==null||E.disconnect(),window.removeEventListener("resize",x)}},[c.pathname,p.length]),w.jsxs(q$,{open:t,onOpenChange:n,children:[w.jsxs("header",{className:"app-header",children:[w.jsxs("div",{className:"app-header-inner",children:[w.jsxs(ys,{to:"/",className:"brand",onClick:a,children:[w.jsx("span",{className:"brand-mark"}),w.jsxs("span",{className:"brand-name",children:["Papers ",w.jsx("em",{children:"With Code"})]})]}),w.jsxs("nav",{className:"nav",ref:s,children:[p.map(({to:y,label:h,end:v,badge:x,href:b})=>{const E=w.jsxs(w.Fragment,{children:[w.jsx("span",{children:h}),x&&w.jsx("span",{className:"nav-new-badge","aria-hidden":"true",children:x})]});return b?w.jsx("a",{href:b,target:"_blank",rel:"noreferrer",className:`nav-item${x?" nav-item-with-badge":""}`,children:E},y):w.jsx(ys,{to:y,end:v,className:({isActive:S})=>`nav-item${x?" nav-item-with-badge":""}${S?" active":""}`,children:E},y)}),w.jsx("span",{ref:o,className:"nav-indicator","aria-hidden":"true"})]}),w.jsx("div",{className:"header-spacer"}),w.jsx("a",{className:"feedback-link header-feedback-link",href:V0,target:"_blank",rel:"noreferrer",children:"Submit feedback"}),w.jsx("a",{className:"icon-btn header-github-btn",href:B0,target:"_blank",rel:"noreferrer","aria-label":"GitHub repository",title:"GitHub repository",children:w.jsx(Mr,{name:"github",size:14})}),w.jsxs("button",{className:"search-trigger","aria-label":"Search papers, authors, domains",onClick:e,children:[w.jsx(Mr,{name:"search",size:13}),w.jsx("span",{children:"Search papers, authors, domains…"}),w.jsx(P2,{})]}),w.jsx("button",{className:"icon-btn mobile-search-btn","aria-label":"Search",onClick:e,children:w.jsx(Mr,{name:"search",size:14})}),!m&&w.jsx(ys,{to:"/saved",className:"icon-btn header-bookmark-btn","aria-label":"Saved papers",title:"Saved papers",children:w.jsx(Mr,{name:"bookmark",size:13})}),m?null:l?w.jsx(y2,{user:l,onLogout:u}):w.jsx(m1,{returnTo:f}),w.jsx(W$,{asChild:!0,children:w.jsx("button",{className:"icon-btn mobile-menu-btn","aria-label":"Open menu",children:w.jsx(Mr,{name:"menu",size:14})})})]}),!d&&r&&w.jsxs("div",{className:"site-announcement",role:"status",children:[w.jsx("span",{children:"New: "}),m?w.jsx("a",{href:C2,target:"_blank",rel:"noreferrer",children:"following feed"}):w.jsx(bn,{to:"/following",children:"following feed"}),w.jsx("span",{children:", follow your favorite tasks, benchmarks, authors or organizations"}),w.jsx("button",{type:"button",className:"site-announcement-close","aria-label":"Dismiss announcement",onClick:()=>{localStorage.setItem(q0,"1"),i(!1)},children:w.jsx(Mr,{name:"close",size:11})})]})]}),w.jsx(H$,{children:w.jsx(G$,{className:"mobile-nav-drawer",children:w.jsxs(K$,{className:"mobile-nav-panel","aria-describedby":void 0,children:[w.jsx(Q$,{className:"sr-only",children:"Navigation menu"}),w.jsx(Y$,{className:"icon-btn mobile-nav-close","aria-label":"Close menu",children:w.jsx(Mr,{name:"close",size:14})}),w.jsxs("button",{type:"button",className:"mobile-nav-link mobile-nav-search",onClick:()=>{a(),e()},children:[w.jsx(Mr,{name:"search",size:14}),w.jsx("span",{children:"Search papers, authors, domains…"})]}),p.map(({to:y,label:h,end:v,badge:x,href:b})=>{const E=`mobile-nav-link${x?" mobile-nav-link-with-badge":""}`,S=w.jsxs(w.Fragment,{children:[w.jsx("span",{children:h}),x&&w.jsx("span",{className:"nav-new-badge","aria-hidden":"true",children:x})]});return b?w.jsx("a",{href:b,target:"_blank",rel:"noreferrer",className:E,onClick:a,children:S},y):w.jsx(ys,{to:y,end:v,className:E,onClick:a,children:S},y)}),w.jsx("a",{className:"mobile-nav-link",href:V0,target:"_blank",rel:"noreferrer",onClick:a,children:"Submit feedback"}),w.jsx("a",{className:"mobile-nav-link",href:B0,target:"_blank",rel:"noreferrer",onClick:a,children:"GitHub"}),!m&&w.jsx(ys,{to:"/saved",className:"mobile-nav-link",onClick:a,children:"Saved papers"}),!m&&(l==null?void 0:l.is_admin)&&w.jsx(ys,{to:"/admin-dashboard",className:"mobile-nav-link",onClick:a,children:"Admin dashboard"})]})})})]})},T2=()=>{const{pathname:e}=hn();return e==="/chat"||e.startsWith("/chat/")||e.startsWith("/pdf/")?null:w.jsx("footer",{className:"site-footer",children:w.jsxs("div",{className:"site-footer-inner",children:[w.jsxs("span",{children:["© ",new Date().getFullYear()," Hugging Face"]}),w.jsx(bn,{to:"/docs/api",children:"API"}),w.jsx(bn,{to:"/mcp",children:"MCP"}),w.jsx(bn,{to:"/privacy",children:"Privacy"}),w.jsx("a",{href:"https://github.com/huggingface/paperswithcode-feedback/issues",target:"_blank",rel:"noreferrer",children:"Feedback"})]})})},I2=1,O2=1e6;let nh=0;function M2(){return nh=(nh+1)%Number.MAX_SAFE_INTEGER,nh.toString()}const rh=new Map,W0=e=>{if(rh.has(e))return;const t=setTimeout(()=>{rh.delete(e),Ia({type:"REMOVE_TOAST",toastId:e})},O2);rh.set(e,t)},A2=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,I2)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?W0(n):e.toasts.forEach(r=>{W0(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Lu=[];let ju={toasts:[]};function Ia(e){ju=A2(ju,e),Lu.forEach(t=>{t(ju)})}function N2({...e}){const t=M2(),n=i=>Ia({type:"UPDATE_TOAST",toast:{...i,id:t}}),r=()=>Ia({type:"DISMISS_TOAST",toastId:t});return Ia({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:i=>{i||r()}}}),{id:t,dismiss:r,update:n}}function $2(){const[e,t]=g.useState(ju);return g.useEffect(()=>(Lu.push(t),()=>{const n=Lu.indexOf(t);n>-1&&Lu.splice(n,1)}),[e]),{...e,toast:N2,dismiss:n=>Ia({type:"DISMISS_TOAST",toastId:n})}}var F2=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),L2="VisuallyHidden",fm=g.forwardRef((e,t)=>w.jsx(ke.span,{...e,ref:t,style:{...F2,...e.style}}));fm.displayName=L2;var hm="ToastProvider",[pm,j2,D2]=Kg("Toast"),[pk]=os("Toast",[D2]),[z2,Md]=pk(hm),vk=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:i="right",swipeThreshold:s=50,children:o}=e,[a,l]=g.useState(null),[u,c]=g.useState(0),d=g.useRef(!1),f=g.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${hm}\`. Expected non-empty \`string\`.`),w.jsx(pm.Provider,{scope:t,children:w.jsx(z2,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:s,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:g.useCallback(()=>c(m=>m+1),[]),onToastRemove:g.useCallback(()=>c(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:o})})};vk.displayName=hm;var gk="ToastViewport",U2=["F8"],dv="toast.viewportPause",fv="toast.viewportResume",mk=g.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=U2,label:i="Notifications ({hotkey})",...s}=e,o=Md(gk,n),a=j2(n),l=g.useRef(null),u=g.useRef(null),c=g.useRef(null),d=g.useRef(null),f=et(t,d,o.onViewportChange),m=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),_=o.toastCount>0;g.useEffect(()=>{const y=h=>{var x;r.length!==0&&r.every(b=>h[b]||h.code===b)&&((x=d.current)==null||x.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),g.useEffect(()=>{const y=l.current,h=d.current;if(_&&y&&h){const v=()=>{if(!o.isClosePausedRef.current){const S=new CustomEvent(dv);h.dispatchEvent(S),o.isClosePausedRef.current=!0}},x=()=>{if(o.isClosePausedRef.current){const S=new CustomEvent(fv);h.dispatchEvent(S),o.isClosePausedRef.current=!1}},b=S=>{!y.contains(S.relatedTarget)&&x()},E=()=>{y.contains(document.activeElement)||x()};return y.addEventListener("focusin",v),y.addEventListener("focusout",b),y.addEventListener("pointermove",v),y.addEventListener("pointerleave",E),window.addEventListener("blur",v),window.addEventListener("focus",x),()=>{y.removeEventListener("focusin",v),y.removeEventListener("focusout",b),y.removeEventListener("pointermove",v),y.removeEventListener("pointerleave",E),window.removeEventListener("blur",v),window.removeEventListener("focus",x)}}},[_,o.isClosePausedRef]);const p=g.useCallback(({tabbingDirection:y})=>{const v=a().map(x=>{const b=x.ref.current,E=[b,...e3(b)];return y==="forwards"?E:E.reverse()});return(y==="forwards"?v.reverse():v).flat()},[a]);return g.useEffect(()=>{const y=d.current;if(y){const h=v=>{var E,S,P;const x=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!x){const C=document.activeElement,T=v.shiftKey;if(v.target===y&&T){(E=u.current)==null||E.focus();return}const M=p({tabbingDirection:T?"backwards":"forwards"}),z=M.findIndex(F=>F===C);ih(M.slice(z+1))?v.preventDefault():T?(S=u.current)==null||S.focus():(P=c.current)==null||P.focus()}};return y.addEventListener("keydown",h),()=>y.removeEventListener("keydown",h)}},[a,p]),w.jsxs(MN,{ref:l,role:"region","aria-label":i.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:_?void 0:"none"},children:[_&&w.jsx(hv,{ref:u,onFocusFromOutsideViewport:()=>{const y=p({tabbingDirection:"forwards"});ih(y)}}),w.jsx(pm.Slot,{scope:n,children:w.jsx(ke.ol,{tabIndex:-1,...s,ref:f})}),_&&w.jsx(hv,{ref:c,onFocusFromOutsideViewport:()=>{const y=p({tabbingDirection:"backwards"});ih(y)}})]})});mk.displayName=gk;var yk="ToastFocusProxy",hv=g.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,s=Md(yk,n);return w.jsx(fm,{tabIndex:0,...i,ref:t,style:{position:"fixed"},onFocus:o=>{var u;const a=o.relatedTarget;!((u=s.viewport)!=null&&u.contains(a))&&r()}})});hv.displayName=yk;var Rl="Toast",V2="toast.swipeStart",B2="toast.swipeMove",q2="toast.swipeCancel",W2="toast.swipeEnd",_k=g.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:i,onOpenChange:s,...o}=e,[a,l]=yd({prop:r,defaultProp:i??!0,onChange:s,caller:Rl});return w.jsx(br,{present:n||a,children:w.jsx(K2,{open:a,...o,ref:t,onClose:()=>l(!1),onPause:Ut(e.onPause),onResume:Ut(e.onResume),onSwipeStart:ee(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ee(e.onSwipeMove,u=>{const{x:c,y:d}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:ee(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:ee(e.onSwipeEnd,u=>{const{x:c,y:d}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),l(!1)})})})});_k.displayName=Rl;var[H2,G2]=pk(Rl,{onClose(){}}),K2=g.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:i,open:s,onClose:o,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:c,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:m,..._}=e,p=Md(Rl,n),[y,h]=g.useState(null),v=et(t,F=>h(F)),x=g.useRef(null),b=g.useRef(null),E=i||p.duration,S=g.useRef(0),P=g.useRef(E),C=g.useRef(0),{onToastAdd:T,onToastRemove:R}=p,N=Ut(()=>{var W;(y==null?void 0:y.contains(document.activeElement))&&((W=p.viewport)==null||W.focus()),o()}),M=g.useCallback(F=>{!F||F===1/0||(window.clearTimeout(C.current),S.current=new Date().getTime(),C.current=window.setTimeout(N,F))},[N]);g.useEffect(()=>{const F=p.viewport;if(F){const W=()=>{M(P.current),u==null||u()},B=()=>{const Q=new Date().getTime()-S.current;P.current=P.current-Q,window.clearTimeout(C.current),l==null||l()};return F.addEventListener(dv,B),F.addEventListener(fv,W),()=>{F.removeEventListener(dv,B),F.removeEventListener(fv,W)}}},[p.viewport,E,l,u,M]),g.useEffect(()=>{s&&!p.isClosePausedRef.current&&M(E)},[s,E,p.isClosePausedRef,M]),g.useEffect(()=>(T(),()=>R()),[T,R]);const z=g.useMemo(()=>y?kk(y):null,[y]);return p.viewport?w.jsxs(w.Fragment,{children:[z&&w.jsx(Q2,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:z}),w.jsx(H2,{scope:n,onClose:N,children:xl.createPortal(w.jsx(pm.ItemSlot,{scope:n,children:w.jsx(ON,{asChild:!0,onEscapeKeyDown:ee(a,()=>{p.isFocusedToastEscapeKeyDownRef.current||N(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:w.jsx(ke.li,{tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":p.swipeDirection,..._,ref:v,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:ee(e.onKeyDown,F=>{F.key==="Escape"&&(a==null||a(F.nativeEvent),F.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,N()))}),onPointerDown:ee(e.onPointerDown,F=>{F.button===0&&(x.current={x:F.clientX,y:F.clientY})}),onPointerMove:ee(e.onPointerMove,F=>{if(!x.current)return;const W=F.clientX-x.current.x,B=F.clientY-x.current.y,Q=!!b.current,O=["left","right"].includes(p.swipeDirection),A=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,V=O?A(0,W):0,K=O?0:A(0,B),te=F.pointerType==="touch"?10:2,oe={x:V,y:K},de={originalEvent:F,delta:oe};Q?(b.current=oe,pu(B2,d,de,{discrete:!1})):H0(oe,p.swipeDirection,te)?(b.current=oe,pu(V2,c,de,{discrete:!1}),F.target.setPointerCapture(F.pointerId)):(Math.abs(W)>te||Math.abs(B)>te)&&(x.current=null)}),onPointerUp:ee(e.onPointerUp,F=>{const W=b.current,B=F.target;if(B.hasPointerCapture(F.pointerId)&&B.releasePointerCapture(F.pointerId),b.current=null,x.current=null,W){const Q=F.currentTarget,O={originalEvent:F,delta:W};H0(W,p.swipeDirection,p.swipeThreshold)?pu(W2,m,O,{discrete:!0}):pu(q2,f,O,{discrete:!0}),Q.addEventListener("click",A=>A.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),Q2=e=>{const{__scopeToast:t,children:n,...r}=e,i=Md(Rl,t),[s,o]=g.useState(!1),[a,l]=g.useState(!1);return J2(()=>o(!0)),g.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:w.jsx(wd,{asChild:!0,children:w.jsx(fm,{...r,children:s&&w.jsxs(w.Fragment,{children:[i.label," ",n]})})})},Y2="ToastTitle",wk=g.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return w.jsx(ke.div,{...r,ref:t})});wk.displayName=Y2;var X2="ToastDescription",xk=g.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return w.jsx(ke.div,{...r,ref:t})});xk.displayName=X2;var bk="ToastAction",Ek=g.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?w.jsx(Ck,{altText:n,asChild:!0,children:w.jsx(vm,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${bk}\`. Expected non-empty \`string\`.`),null)});Ek.displayName=bk;var Sk="ToastClose",vm=g.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,i=G2(Sk,n);return w.jsx(Ck,{asChild:!0,children:w.jsx(ke.button,{type:"button",...r,ref:t,onClick:ee(e.onClick,i.onClose)})})});vm.displayName=Sk;var Ck=g.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...i}=e;return w.jsx(ke.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...i,ref:t})});function kk(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),Z2(r)){const i=r.ariaHidden||r.hidden||r.style.display==="none",s=r.dataset.radixToastAnnounceExclude==="";if(!i)if(s){const o=r.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...kk(r))}}),t}function pu(e,t,n,{discrete:r}){const i=n.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Lg(i,s):i.dispatchEvent(s)}var H0=(e,t,n=0)=>{const r=Math.abs(e.x),i=Math.abs(e.y),s=r>i;return t==="left"||t==="right"?s&&r>n:!s&&i>n};function J2(e=()=>{}){const t=Ut(e);fn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function Z2(e){return e.nodeType===e.ELEMENT_NODE}function e3(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ih(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var t3=vk,Pk=mk,Rk=_k,Tk=wk,Ik=xk,Ok=Ek,Mk=vm;const G0=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,K0=M1,n3=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return K0(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:s}=t,o=Object.keys(i).map(u=>{const c=n==null?void 0:n[u],d=s==null?void 0:s[u];if(c===null)return null;const f=G0(c)||G0(d);return i[u][f]}),a=n&&Object.entries(n).reduce((u,c)=>{let[d,f]=c;return f===void 0||(u[d]=f),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,c)=>{let{class:d,className:f,...m}=c;return Object.entries(m).every(_=>{let[p,y]=_;return Array.isArray(y)?y.includes({...s,...a}[p]):{...s,...a}[p]===y})?[...u,d,f]:u},[]);return K0(e,o,l,n==null?void 0:n.class,n==null?void 0:n.className)},r3=t3,Ak=g.forwardRef(({className:e,...t},n)=>w.jsx(Pk,{ref:n,className:ct("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));Ak.displayName=Pk.displayName;const i3=n3("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-16 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Nk=g.forwardRef(({className:e,variant:t,...n},r)=>w.jsx(Rk,{ref:r,className:ct(i3({variant:t}),e),...n}));Nk.displayName=Rk.displayName;const s3=g.forwardRef(({className:e,...t},n)=>w.jsx(Ok,{ref:n,className:ct("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",e),...t}));s3.displayName=Ok.displayName;const $k=g.forwardRef(({className:e,...t},n)=>w.jsx(Mk,{ref:n,className:ct("absolute right-2 top-2 inline-flex h-11 w-11 items-center justify-center rounded-md text-foreground transition-colors hover:bg-muted focus:outline-none focus:ring-2 focus:ring-ring group-[.destructive]:text-destructive-foreground group-[.destructive]:hover:bg-destructive-foreground/10 group-[.destructive]:focus:ring-destructive-foreground",e),"aria-label":"Dismiss notification","toast-close":"",...t,children:w.jsx(c2,{className:"h-4 w-4"})}));$k.displayName=Mk.displayName;const Fk=g.forwardRef(({className:e,...t},n)=>w.jsx(Tk,{ref:n,className:ct("text-sm font-semibold",e),...t}));Fk.displayName=Tk.displayName;const Lk=g.forwardRef(({className:e,...t},n)=>w.jsx(Ik,{ref:n,className:ct("text-sm opacity-90",e),...t}));Lk.displayName=Ik.displayName;function o3(){const{toasts:e}=$2();return w.jsxs(r3,{children:[e.map(function({id:t,title:n,description:r,action:i,...s}){return w.jsxs(Nk,{...s,children:[w.jsxs("div",{className:"grid gap-1",children:[n&&w.jsx(Fk,{children:n}),r&&w.jsx(Lk,{children:r})]}),i,w.jsx($k,{})]},t)}),w.jsx(Ak,{})]})}function a3(){const{pathname:e,hash:t}=hn();g.useLayoutEffect(()=>{t||window.scrollTo({top:0,left:0,behavior:"instant"})},[e,t])}const jk=rF(),l3=jk?wA:_A;if(!jk&&typeof window<"u"){const e=window.location.hash;e.startsWith("#/")&&!e.startsWith("#//")&&window.history.replaceState(null,"",e.slice(1))}const u3=q.lazy(()=>ae(()=>import("./AuthorizePaperEditView-AscuEWFa.js"),__vite__mapDeps([0,1,2,3]))),c3=q.lazy(()=>ae(()=>import("./FollowingView-CxPwEdv-.js"),__vite__mapDeps([4,5,6,7,8,9,1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33]))),d3=q.lazy(()=>ae(()=>import("./TopicView-CdjM8WYW.js"),__vite__mapDeps([34,13,14,15,16,17,18,10,19,20,21,22,23,24,25,26,31,32,9,1,11,35]))),f3=q.lazy(()=>ae(()=>import("./FeedView-C8zGqRsW.js"),__vite__mapDeps([5,6,7,8,9,1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33]))),h3=q.lazy(()=>ae(()=>import("./ChatView-BNDJ2kH3.js"),__vite__mapDeps([36,37,29,30,21,22,38,39,8,40,41,42,43,44,45,1,46,47,48,49,50,11,51,52,15,16,53,54,27,28,55,19,56,57]))),p3=q.lazy(()=>ae(()=>import("./SharedChatView-DgpdZ95u.js"),__vite__mapDeps([58,37,29,30,21,22,38,39,8,40,41,42,43,44,45,1,46,47,48,49,50,11,51,52,15,16,53,54]))),v3=q.lazy(()=>ae(()=>import("./PapersListView-Bs-H-o-h.js"),__vite__mapDeps([59,17,18,10,19,13,14,15,16,20,21,22,23,24,25,26,8,31,32,60,33,61,62]))),g3=q.lazy(()=>ae(()=>import("./PaperDetailView-B7LjkGBN.js"),__vite__mapDeps([63,1,19,17,18,10,20,64,22,38,23,65,21,66,31,32,67,68,69,56,25,33,2,7,28,47,70,71,72,73,24,51,74,39,8,75,76,77,78,11,79,80,40,81,82,43,44,26,83,84,15,16,85]))),m3=q.lazy(()=>ae(()=>import("./PaperReaderView-CMX4-aWi.js"),__vite__mapDeps([86,37,29,30,21,22,38,39,8,40,41,42,43,44,45,1,46,47,48,49,50,11,51,52,15,16,53,54,87,66,23,31,32,36,27,28,55,19,56,57]))),y3=q.lazy(()=>ae(()=>import("./TagsIndexView-DiKdGZx0.js"),__vite__mapDeps([88,8,18,10,89,51,90,55,91,92,46,78,35,93,41,94,80,6,33,95,25,96,75,2,72,76,73,24,7,74,1,77,11,97,98]))),_3=q.lazy(()=>ae(()=>import("./TagBrowseView-HXuz3Cu0.js"),__vite__mapDeps([99,100,9,1,11,17,18,10,13,14,15,16,19,20,21,22,23,24,25,26,12,101,87,42,43,44,45,38,54,8,61,62,68,69,89,31,32,33,102,93,40]))),w3=q.lazy(()=>ae(()=>import("./MethodsIndexView-DFxGizEv.js"),__vite__mapDeps([103,8,98,89,33,95,25,96,75,2,72,76,73,24,7,51,74,1,77,11,97,91]))),x3=q.lazy(()=>ae(()=>import("./FrameworksIndexView-DzgxIZ2R.js"),__vite__mapDeps([104,19,8,18,62]))),b3=q.lazy(()=>ae(()=>import("./TrendsView-C0roiQkv.js"),__vite__mapDeps([105,33,25]))),E3=q.lazy(()=>ae(()=>import("./ConferencesIndexView-CJ3etu5H.js"),__vite__mapDeps([106,8,107,33,95,25,96,75,2,72,76,73,24,7,51,74,1,77,11]))),S3=q.lazy(()=>ae(()=>import("./AiDeadlinesView-ySVlb5Zy.js"),__vite__mapDeps([108,8,109,81,25,33,23,7,107]))),C3=q.lazy(()=>ae(()=>import("./ConferenceDetailView-Bes-wZoN.js"),__vite__mapDeps([110,95,25,87,42,43,44,45,38,21,22,1,54,8,61,98,18,111,107,10,33,23,102]))),k3=q.lazy(()=>ae(()=>import("./ConferenceTaskView-7vjNk0Qt.js"),__vite__mapDeps([112,13,14,15,16,17,18,10,19,20,21,22,23,24,25,26,87,42,43,44,45,38,1,54,8,61,111,31,32,33,102]))),P3=q.lazy(()=>ae(()=>import("./OrganizationsIndexView-CU64F1W1.js"),__vite__mapDeps([113,33,8,114]))),R3=q.lazy(()=>ae(()=>import("./OrganizationDetailView-D82QKEh2.js"),__vite__mapDeps([115,100,9,1,11,87,42,43,44,45,38,21,22,54,116,25,8,13,14,15,16,17,18,10,19,20,23,24,26,33,73,2,7,51,74,31,32,61,84,102]))),T3=q.lazy(()=>ae(()=>import("./OrganizationDetailView-D82QKEh2.js"),__vite__mapDeps([115,100,9,1,11,87,42,43,44,45,38,21,22,54,116,25,8,13,14,15,16,17,18,10,19,20,23,24,26,33,73,2,7,51,74,31,32,61,84,102]))),I3=q.lazy(()=>ae(()=>import("./AuthorDetailView-BLIKTcZJ.js"),__vite__mapDeps([117,15,16,13,14,17,18,10,19,20,21,22,23,24,25,26,100,9,1,11,33,31,32,61,102]))),O3=q.lazy(()=>ae(()=>import("./MethodDetailView-DX6nB6xF.js"),__vite__mapDeps([118,100,9,1,11,17,18,10,13,14,15,16,19,20,21,22,23,24,25,26,87,42,43,44,45,38,54,8,61,89,31,32,33,102]))),M3=q.lazy(()=>ae(()=>import("./BenchmarkDetailView-ujezOHA2.js"),__vite__mapDeps([119,100,9,1,11,8,64,22,38,23,65,68,69,20,109,81,19,25,33,101,89,61,102,120]))),A3=q.lazy(()=>ae(()=>import("./SavedPapersView-CSPbwTYh.js"),__vite__mapDeps([121,14,15,16,17,18,10,19,20,21,22,23,25,33,69,83]))),N3=q.lazy(()=>ae(()=>import("./SettingsView-CWBdqT8i.js"),__vite__mapDeps([122,1,9,109,81,6,12,93,30,67,57,68,69,50,92]))),$3=q.lazy(()=>ae(()=>import("./PrivacyView-BGwob0k2.js"),__vite__mapDeps([123,67]))),F3=q.lazy(()=>ae(()=>import("./ApiDocsView-DO1rgGlj.js"),__vite__mapDeps([124,67,43,125]))),L3=q.lazy(()=>ae(()=>import("./McpView-DfOBSpbX.js"),__vite__mapDeps([126,67,48,40,50,47,127]))),j3=q.lazy(()=>ae(()=>import("./SubmitView-BUjda1b9.js"),__vite__mapDeps([128,1,33,2,72,76,21,22,71]))),D3=q.lazy(()=>ae(()=>import("./CronDashboard-CIUsXoy9.js"),__vite__mapDeps([129,1,130,131,79,2,52,78,91,94,41,90,50,132,74,133,82,32,3,8,30]))),z3=q.lazy(()=>ae(()=>import("./AutonomousOperations-BGgLXdSh.js"),__vite__mapDeps([134,1,130,131,79,2,72,94,49]))),U3=q.lazy(()=>ae(()=>import("./SubmissionsDashboard-DQ0IgORY.js"),__vite__mapDeps([135,70,71,1,32,8,23,77,21,22,132,74,133,136]))),V3=q.lazy(()=>ae(()=>import("./UserProfileView-2VsZSUPK.js"),__vite__mapDeps([137,116,25,8]))),B3=q.lazy(()=>ae(()=>import("./RateLimitsView-DujSBsSL.js"),__vite__mapDeps([138,69]))),q3=q.lazy(()=>ae(()=>import("./AstraForRoboticsView-Cbgf-67D.js"),__vite__mapDeps([139,13,14,15,16,17,18,10,19,20,21,22,23,24,25,26,33,31,32,67,140]))),sh=q.lazy(()=>ae(()=>import("./NotFound-BeRulOFd.js"),[])),W3=q.lazy(()=>ae(()=>import("./SearchOverlay-CkohnQ4e.js"),__vite__mapDeps([141,20,8,21,22,60,18,10]))),H3=q.lazy(()=>ae(()=>import("./StagingAccessRequestView-D-ipJ4kW.js"),__vite__mapDeps([142,133]))),Dk=()=>w.jsxs("div",{className:"page","aria-busy":"true","aria-live":"polite",children:[w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:24,width:"30%",marginBottom:24}}),w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:64,width:"60%",marginBottom:32}}),w.jsxs("div",{className:"paper-list",style:{display:"grid",gap:16},children:[w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}})]})]}),G3=new YA({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),K3=()=>{const{arxivId:e}=wS();return w.jsx(Ki,{to:e?`/paper/${e}`:"/papers",replace:!0})},Q3=()=>{const{taskSlug:e}=wS();return w.jsx(Ki,{to:e?`/tasks/${e}`:"/tasks",replace:!0})},Y3=({element:e})=>$o()?w.jsx(Ki,{to:"/",replace:!0}):w.jsx(w.Fragment,{children:e}),pv=({element:e})=>{const{user:t,isLoading:n}=hk(),r=hn();return $o()?w.jsx(Ki,{to:"/",replace:!0}):n?w.jsx("div",{className:"page",children:w.jsx("div",{className:"submission-loading",children:w.jsx("span",{children:"Checking admin session..."})})}):t?t.is_admin?w.jsx(w.Fragment,{children:e}):w.jsx("div",{className:"page",children:w.jsxs("div",{className:"submission-empty submission-empty-warn",children:[w.jsx("h1",{children:"Admin access required"}),w.jsxs("p",{children:["Signed in as @",t.username,". This dashboard is limited to allowlisted admin accounts."]})]})}):w.jsx("div",{className:"page",children:w.jsxs("div",{className:"submission-empty submission-empty-warn",children:[w.jsx("h1",{children:"Sign in required"}),w.jsx("p",{children:"Sign in with an allowlisted Hugging Face admin account to view admin operations."}),w.jsx(m1,{returnTo:`${r.pathname}${r.search}`})]})})},X3=()=>{const e=Z$(),t=typeof window<"u"&&new URL(e,window.location.origin).origin!==window.location.origin;return q.useEffect(()=>{t&&window.location.replace(e)},[e,t]),t?w.jsx("div",{className:"page",children:w.jsxs("div",{className:"submission-loading",children:[w.jsx("span",{children:"Opening the production admin dashboard..."}),w.jsx("a",{href:e,children:"Continue"})]})}):w.jsx(pv,{element:w.jsx(D3,{})})},Q0=({reader:e=!1})=>{const[t,n]=q.useState(!1),{pathname:r}=hn();q.useEffect(()=>{const a=l=>{(l.metaKey||l.ctrlKey)&&l.key==="k"&&(l.preventDefault(),n(!0))};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[]);const i=w.jsx(R2,{onOpenSearch:()=>n(!0)}),s=w.jsx(dS,{resetKey:r,children:w.jsx(q.Suspense,{fallback:w.jsx(Dk,{}),children:w.jsx(uA,{})})}),o=t&&w.jsx(q.Suspense,{fallback:null,children:w.jsx(W3,{open:t,onClose:()=>n(!1)})});return e?w.jsxs("div",{className:"reader-route-shell",children:[i,w.jsx("div",{className:"reader-route-content",children:s}),o]}):w.jsxs(w.Fragment,{children:[i,w.jsx("main",{children:s}),w.jsx(T2,{}),o]})},J3=()=>(a3(),q.useLayoutEffect(()=>{var e;(e=document.getElementById("initial-discovery-footer"))==null||e.remove()},[]),w.jsxs(cA,{children:[w.jsx(re,{path:"/request-access",element:w.jsx(q.Suspense,{fallback:w.jsx(Dk,{}),children:w.jsx(H3,{})})}),w.jsx(re,{element:w.jsx(Q0,{reader:!0}),children:w.jsx(re,{path:"/pdf/:paperId",element:nF()?w.jsx(m3,{}):w.jsx(sh,{})})}),w.jsxs(re,{element:w.jsx(Q0,{}),children:[w.jsx(re,{path:"/",element:w.jsx(f3,{})}),w.jsx(re,{path:"/following",element:w.jsx(c3,{})}),w.jsx(re,{path:"/topics/:topicParam",element:w.jsx(d3,{})}),w.jsx(re,{path:"/x-trending",element:w.jsx(Ki,{to:"/",replace:!0})}),w.jsx(re,{path:"/chat/:sessionId?",element:al()?w.jsx(h3,{}):w.jsx(Ki,{to:"/",replace:!0})}),w.jsx(re,{path:"/share/:shareId",element:al()?w.jsx(p3,{}):w.jsx(sh,{})}),w.jsx(re,{path:"/papers",element:w.jsx(v3,{})}),w.jsx(re,{path:"/papers/:arxivId",element:w.jsx(K3,{})}),w.jsx(re,{path:"/paper/:arxivId",element:w.jsx(g3,{})}),w.jsx(re,{path:"/tasks",element:w.jsx(y3,{})}),w.jsx(re,{path:"/tasks/:taskSlug",element:w.jsx(_3,{})}),w.jsx(re,{path:"/task/:taskSlug",element:w.jsx(Q3,{})}),w.jsx(re,{path:"/methods",element:w.jsx(w3,{})}),w.jsx(re,{path:"/methods/:methodSlug",element:w.jsx(O3,{})}),w.jsx(re,{path:"/frameworks",element:w.jsx(x3,{})}),w.jsx(re,{path:"/trends",element:w.jsx(b3,{})}),w.jsx(re,{path:"/conferences",element:w.jsx(E3,{})}),w.jsx(re,{path:"/ai-deadlines",element:w.jsx(S3,{})}),w.jsx(re,{path:"/conferences/:confSlug",element:w.jsx(C3,{})}),w.jsx(re,{path:"/conferences/:confSlug/:taskSlug",element:w.jsx(k3,{})}),w.jsx(re,{path:"/organizations",element:w.jsx(P3,{})}),w.jsx(re,{path:"/orgs/:orgSlug",element:w.jsx(R3,{})}),w.jsx(re,{path:"/orgs/:orgSlug/:taskSlug",element:w.jsx(T3,{})}),w.jsx(re,{path:"/authors/:authorId",element:w.jsx(I3,{})}),w.jsx(re,{path:"/benchmark/:datasetSlug",element:w.jsx(M3,{})}),w.jsx(re,{path:"/authorize-paper-edit/:authorizationId",element:w.jsx(u3,{})}),w.jsx(re,{path:"/submit",element:w.jsx(j3,{})}),w.jsx(re,{path:"/saved",element:w.jsx(Y3,{element:w.jsx(A3,{})})}),w.jsx(re,{path:"/settings",element:w.jsx(N3,{})}),w.jsx(re,{path:"/privacy",element:w.jsx($3,{})}),w.jsx(re,{path:"/docs/api",element:w.jsx(F3,{})}),w.jsx(re,{path:"/mcp",element:w.jsx(L3,{})}),w.jsx(re,{path:"/admin-dashboard",element:w.jsx(X3,{})}),w.jsx(re,{path:"/autonomous-operations",element:w.jsx(pv,{element:w.jsx(z3,{})})}),w.jsx(re,{path:"/cron-dashboard",element:w.jsx(Ki,{to:"/admin-dashboard",replace:!0})}),w.jsx(re,{path:"/submissions",element:w.jsx(pv,{element:w.jsx(U3,{})})}),w.jsx(re,{path:"/rate-limits",element:w.jsx(B3,{})}),w.jsx(re,{path:"/astra-for-robotics",element:w.jsx(q3,{})}),w.jsx(re,{path:"/:username",element:w.jsx(V3,{})}),w.jsx(re,{path:"*",element:w.jsx(sh,{})})]})]})),Z3=()=>w.jsx(XA,{client:G3,children:w.jsxs(S2,{children:[w.jsx(l3,{children:w.jsx(J3,{})}),w.jsx(o3,{}),!1]})});mM();const ez=w.jsx(mT,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,storageKey:"pwc-theme",children:w.jsx(dS,{children:w.jsx(Z3,{})})}),tz=_b(document.getElementById("root"));tz.render(w.jsx(q.StrictMode,{children:ez}));export{f2 as $,Od as A,yd as B,a2 as C,et as D,ee as E,wj as F,os as G,m1 as H,ct as I,Rz as J,fz as K,bn as L,yz as M,U1 as N,Vj as O,br as P,dC as Q,Uj as R,u2 as S,Ez as T,s3 as U,q as V,Sz as W,c2 as X,nF as Y,dz as Z,d2 as _,hk as a,Pz as a$,ck as a0,er as a1,hz as a2,cz as a3,ow as a4,X$ as a5,l2 as a6,ae as a7,M1 as a8,xl as a9,vz as aA,El as aB,Up as aC,il as aD,GA as aE,at as aF,At as aG,IS as aH,bz as aI,e1 as aJ,Dg as aK,WS as aL,jg as aM,BA as aN,az as aO,oz as aP,lN as aQ,qg as aR,RS as aS,JA as aT,tN as aU,sN as aV,nN as aW,rN as aX,aN as aY,l0 as aZ,iN as a_,$g as aa,x2 as ab,cv as ac,_1 as ad,n3 as ae,Ys as af,q$ as ag,H$ as ah,G$ as ai,K$ as aj,vi as ak,Y$ as al,Q$ as am,uz as an,Ki as ao,Pj as ap,Rj as aq,tC as ar,wd as as,_d as at,Tj as au,Ij as av,iz as aw,rz as ax,b2 as ay,xz as az,uN as b,j1 as b0,D1 as b1,z1 as b2,z0 as b3,Id as c,Iz as d,sz as e,g as f,hn as g,J$ as h,$o as i,w as j,Mg as k,DS as l,al as m,tF as n,eF as o,E2 as p,Cz as q,Tz as r,pz as s,kz as t,wS as u,gz as v,mz as w,$2 as x,wz as y,ke as z}; diff --git a/assets/index-Caztwwvv.js b/assets/index-JxIVN7pD.js similarity index 72% rename from assets/index-Caztwwvv.js rename to assets/index-JxIVN7pD.js index 7fe74d786c6a8b016b15267a39721a91492fae4e..1d193a9508f6afb9046e04b1c9a928273cb7cf8b 100644 --- a/assets/index-Caztwwvv.js +++ b/assets/index-JxIVN7pD.js @@ -1 +1 @@ -import{f as u}from"./index-3CfcAX6N.js";function o(r){const e=u.useRef({value:r,previous:r});return u.useMemo(()=>(e.current.value!==r&&(e.current.previous=e.current.value,e.current.value=r),e.current.previous),[r])}export{o as u}; +import{f as u}from"./index-CxhY4zQ1.js";function o(r){const e=u.useRef({value:r,previous:r});return u.useMemo(()=>(e.current.value!==r&&(e.current.previous=e.current.value,e.current.value=r),e.current.previous),[r])}export{o as u}; diff --git a/assets/index-C8DcqbS3.js b/assets/index-mv_8ovfA.js similarity index 99% rename from assets/index-C8DcqbS3.js rename to assets/index-mv_8ovfA.js index c6d5ff5af47d8ddcf10d33e683acaf80b5bb978c..66ae4ef8934509239f31da7617c05c2e478b869e 100644 --- a/assets/index-C8DcqbS3.js +++ b/assets/index-mv_8ovfA.js @@ -1,4 +1,4 @@ -import{c as ce,v as _e,o as E,u as I,e as Z,g as O,i as W,j as Oe,t as fe,E as je,k as J,l as M,q as A,r as Be,w as qe,f as S,x as H,y as We,m as P,z as T,A as $e}from"./index-DGr54pyn.js";function re(e,n){const t=String(e);if(typeof n!="string")throw new TypeError("Expected character");let i=0,o=t.indexOf(n);for(;o!==-1;)i++,o=t.indexOf(n,o+n.length);return i}function He(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Ue(e,n,t){const o=ce((t||{}).ignore||[]),a=Ve(n);let r=-1;for(;++r0?{type:"text",value:y}:void 0),y===!1?p.lastIndex=v+1:(m!==v&&w.push({type:"text",value:s.value.slice(m,v)}),Array.isArray(y)?w.push(...y):y&&w.push(y),m=v+d[0].length,k=!0),!p.global)break;d=p.exec(s.value)}return k?(m?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let t=n[0],i=t.indexOf(")");const o=re(e,"(");let a=re(e,")");for(;i!==-1&&o>a;)e+=t.slice(0,i+1),t=t.slice(i+1),i=t.indexOf(")"),a++;return[e,t]}function he(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||I(t)||Z(t))&&(!n||t!==47)}me.peek=pt;function ot(){this.buffer()}function at(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function ut(){this.buffer()}function st(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function ct(e){const n=this.resume(),t=this.stack[this.stack.length-1];E(t.type==="footnoteReference"),t.identifier=O(this.sliceSerialize(e)).toLowerCase(),t.label=n}function ft(e){this.exit(e)}function ht(e){const n=this.resume(),t=this.stack[this.stack.length-1];E(t.type==="footnoteDefinition"),t.identifier=O(this.sliceSerialize(e)).toLowerCase(),t.label=n}function mt(e){this.exit(e)}function pt(){return"["}function me(e,n,t,i){const o=t.createTracker(i);let a=o.move("[^");const r=t.enter("footnoteReference"),u=t.enter("reference");return a+=o.move(t.safe(t.associationId(e),{after:"]",before:a})),u(),r(),a+=o.move("]"),a}function gt(){return{enter:{gfmFootnoteCallString:ot,gfmFootnoteCall:at,gfmFootnoteDefinitionLabelString:ut,gfmFootnoteDefinition:st},exit:{gfmFootnoteCallString:ct,gfmFootnoteCall:ft,gfmFootnoteDefinitionLabelString:ht,gfmFootnoteDefinition:mt}}}function kt(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:me},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(i,o,a,r){const u=a.createTracker(r);let l=u.move("[^");const s=a.enter("footnoteDefinition"),h=a.enter("label");return l+=u.move(a.safe(a.associationId(i),{before:l,after:"]"})),h(),l+=u.move("]:"),i.children&&i.children.length>0&&(u.shift(4),l+=u.move((n?` +import{c as ce,v as _e,o as E,u as I,e as Z,g as O,i as W,j as Oe,t as fe,E as je,k as J,l as M,q as A,r as Be,w as qe,f as S,x as H,y as We,m as P,z as T,A as $e}from"./index-BCjs92mB.js";function re(e,n){const t=String(e);if(typeof n!="string")throw new TypeError("Expected character");let i=0,o=t.indexOf(n);for(;o!==-1;)i++,o=t.indexOf(n,o+n.length);return i}function He(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Ue(e,n,t){const o=ce((t||{}).ignore||[]),a=Ve(n);let r=-1;for(;++r0?{type:"text",value:y}:void 0),y===!1?p.lastIndex=v+1:(m!==v&&w.push({type:"text",value:s.value.slice(m,v)}),Array.isArray(y)?w.push(...y):y&&w.push(y),m=v+d[0].length,k=!0),!p.global)break;d=p.exec(s.value)}return k?(m?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let t=n[0],i=t.indexOf(")");const o=re(e,"(");let a=re(e,")");for(;i!==-1&&o>a;)e+=t.slice(0,i+1),t=t.slice(i+1),i=t.indexOf(")"),a++;return[e,t]}function he(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||I(t)||Z(t))&&(!n||t!==47)}me.peek=pt;function ot(){this.buffer()}function at(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function ut(){this.buffer()}function st(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function ct(e){const n=this.resume(),t=this.stack[this.stack.length-1];E(t.type==="footnoteReference"),t.identifier=O(this.sliceSerialize(e)).toLowerCase(),t.label=n}function ft(e){this.exit(e)}function ht(e){const n=this.resume(),t=this.stack[this.stack.length-1];E(t.type==="footnoteDefinition"),t.identifier=O(this.sliceSerialize(e)).toLowerCase(),t.label=n}function mt(e){this.exit(e)}function pt(){return"["}function me(e,n,t,i){const o=t.createTracker(i);let a=o.move("[^");const r=t.enter("footnoteReference"),u=t.enter("reference");return a+=o.move(t.safe(t.associationId(e),{after:"]",before:a})),u(),r(),a+=o.move("]"),a}function gt(){return{enter:{gfmFootnoteCallString:ot,gfmFootnoteCall:at,gfmFootnoteDefinitionLabelString:ut,gfmFootnoteDefinition:st},exit:{gfmFootnoteCallString:ct,gfmFootnoteCall:ft,gfmFootnoteDefinitionLabelString:ht,gfmFootnoteDefinition:mt}}}function kt(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:me},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(i,o,a,r){const u=a.createTracker(r);let l=u.move("[^");const s=a.enter("footnoteDefinition"),h=a.enter("label");return l+=u.move(a.safe(a.associationId(i),{before:l,after:"]"})),h(),l+=u.move("]:"),i.children&&i.children.length>0&&(u.shift(4),l+=u.move((n?` `:" ")+a.indentLines(a.containerFlow(i,u.current()),n?pe:bt))),s(),l}}function bt(e,n,t){return n===0?e:pe(e,n,t)}function pe(e,n,t){return(t?"":" ")+e}const xt=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];ge.peek=vt;function wt(){return{canContainEols:["delete"],enter:{strikethrough:yt},exit:{strikethrough:Ct}}}function dt(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:xt}],handlers:{delete:ge}}}function yt(e){this.enter({type:"delete",children:[]},e)}function Ct(e){this.exit(e)}function ge(e,n,t,i){const o=t.createTracker(i),a=t.enter("strikethrough");let r=o.move("~~");return r+=t.containerPhrasing(e,{...o.current(),before:r,after:"~"}),r+=o.move("~~"),a(),r}function vt(){return"~"}function At(e){return e.length}function Dt(e,n){const t=n||{},i=(t.align||[]).concat(),o=t.stringLength||At,a=[],r=[],u=[],l=[];let s=0,h=-1;for(;++hs&&(s=e[h].length);++kl[k])&&(l[k]=d)}b.push(w)}r[h]=b,u[h]=x}let c=-1;if(typeof i=="object"&&"length"in i)for(;++cl[c]&&(l[c]=w),g[c]=w),p[c]=d}r.splice(1,0,p),u.splice(1,0,g),h=-1;const m=[];for(;++h "),a.shift(2);const r=t.indentLines(t.containerFlow(e,a.current()),Lt);return o(),r}function Lt(e,n,t){return">"+(t?"":" ")+e}function Tt(e,n){return le(e,n.inConstruct,!0)&&!le(e,n.notInConstruct,!1)}function le(e,n,t){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return t;let i=-1;for(;++ii.jsx("input",{type:r,className:n("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:t,...o}));f.displayName="Input";export{f as I}; +import{f as s,j as i,I as n}from"./index-CxhY4zQ1.js";const f=s.forwardRef(({className:e,type:r,...o},t)=>i.jsx("input",{type:r,className:n("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:t,...o}));f.displayName="Input";export{f as I}; diff --git a/assets/link-2-D0J2rv3E.js b/assets/link-2-CyUnfeFP.js similarity index 89% rename from assets/link-2-D0J2rv3E.js rename to assets/link-2-CyUnfeFP.js index 6984e813cc759a4cb31a04650284a1decd9b5d05..c22b73e60979a04fed091c58cf499df1d673d646 100644 --- a/assets/link-2-D0J2rv3E.js +++ b/assets/link-2-CyUnfeFP.js @@ -1,4 +1,4 @@ -import{c as e}from"./index-3CfcAX6N.js";/** +import{c as e}from"./index-CxhY4zQ1.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/loader-circle-CMgZ_maE.js b/assets/loader-circle-C5gQxAlQ.js similarity index 85% rename from assets/loader-circle-CMgZ_maE.js rename to assets/loader-circle-C5gQxAlQ.js index 083d7d602a352987fa10bffde294a6f49af4b862..7e27cd31eae0d0e3ba8992f799484ad91fc00bbe 100644 --- a/assets/loader-circle-CMgZ_maE.js +++ b/assets/loader-circle-C5gQxAlQ.js @@ -1,4 +1,4 @@ -import{c as e}from"./index-3CfcAX6N.js";/** +import{c as e}from"./index-CxhY4zQ1.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/mlIntern-CyazNz7i.js b/assets/mlIntern-CBvHpMTi.js similarity index 90% rename from assets/mlIntern-CyazNz7i.js rename to assets/mlIntern-CBvHpMTi.js index f3d8cd1447f90fe018e5b0f67afbbbcb9cee8746..0ba8f0d19508b17bf25018435d05d69504119b90 100644 --- a/assets/mlIntern-CyazNz7i.js +++ b/assets/mlIntern-CBvHpMTi.js @@ -1 +1 @@ -import{v as a}from"./index-3CfcAX6N.js";function n(t,e){const r=e?` (arXiv:${a(e)})`:"";return[`Reproduce the central claims of the research paper "${t}"${r}.`,"If it is not feasible to fully reproduce the experiments from the paper, then run smaller-scale experiments that can still validate or falsify the claims.","Publish any trained models, processed datasets, and demos as Hub repos, and upload everything else to a Hugging Face Bucket, with the final report as README.md at the bucket's root linking to them."].join(" ")}function s(t,e){return`https://huggingface.co/chat/?${new URLSearchParams({mode:"ml-intern",prompt:n(t,e)}).toString()}`}export{s as m}; +import{v as a}from"./index-CxhY4zQ1.js";function n(t,e){const r=e?` (arXiv:${a(e)})`:"";return[`Reproduce the central claims of the research paper "${t}"${r}.`,"If it is not feasible to fully reproduce the experiments from the paper, then run smaller-scale experiments that can still validate or falsify the claims.","Publish any trained models, processed datasets, and demos as Hub repos, and upload everything else to a Hugging Face Bucket, with the final report as README.md at the bucket's root linking to them."].join(" ")}function s(t,e){return`https://huggingface.co/chat/?${new URLSearchParams({mode:"ml-intern",prompt:n(t,e)}).toString()}`}export{s as m}; diff --git a/assets/moon-DWTtiCFw.js b/assets/moon-D6Y7BLS4.js similarity index 85% rename from assets/moon-DWTtiCFw.js rename to assets/moon-D6Y7BLS4.js index 652ee0a8064aaccec2a90b3e21f3a5951a0d2d4d..5739e31a67ebb60fb395e191967c28f46a7aa07a 100644 --- a/assets/moon-DWTtiCFw.js +++ b/assets/moon-D6Y7BLS4.js @@ -1,4 +1,4 @@ -import{c as o}from"./index-3CfcAX6N.js";/** +import{c as o}from"./index-CxhY4zQ1.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/openrouter-Bol7eGlT.js b/assets/openrouter-DLk2ZdMf.js similarity index 82% rename from assets/openrouter-Bol7eGlT.js rename to assets/openrouter-DLk2ZdMf.js index 49d165f855e3ca4e7a7956ea814f1fe4e1546014..9fe31d99dab15c9aea959fa015cdfa03aee1da03 100644 --- a/assets/openrouter-Bol7eGlT.js +++ b/assets/openrouter-DLk2ZdMf.js @@ -1 +1 @@ -import{b as r}from"./index-3CfcAX6N.js";import{c as n}from"./chat-81nIwu_j.js";const o=["chat","openrouter","usage"],u=["chat","openrouter","credential"];function s(e=!0){return r({queryKey:o,queryFn:()=>n.getUsage(),enabled:e,staleTime:3e4,refetchOnWindowFocus:!0})}function c(e=!0){return r({queryKey:u,queryFn:()=>n.getOpenRouterCredential(),enabled:e,refetchOnWindowFocus:!0})}function m(e){const t=new Date(e);return{local:new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}).format(t),utc:`${t.toLocaleString("en-GB",{timeZone:"UTC",year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})} UTC`}}export{u as O,s as a,m as r,c as u}; +import{b as r}from"./index-CxhY4zQ1.js";import{c as n}from"./chat-CkiIbMG5.js";const o=["chat","openrouter","usage"],u=["chat","openrouter","credential"];function s(e=!0){return r({queryKey:o,queryFn:()=>n.getUsage(),enabled:e,staleTime:3e4,refetchOnWindowFocus:!0})}function c(e=!0){return r({queryKey:u,queryFn:()=>n.getOpenRouterCredential(),enabled:e,refetchOnWindowFocus:!0})}function m(e){const t=new Date(e);return{local:new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}).format(t),utc:`${t.toLocaleString("en-GB",{timeZone:"UTC",year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})} UTC`}}export{u as O,s as a,m as r,c as u}; diff --git a/assets/paperEdits-HkiQiv4C.js b/assets/paperEdits-CfQUGmNN.js similarity index 84% rename from assets/paperEdits-HkiQiv4C.js rename to assets/paperEdits-CfQUGmNN.js index c59b4732d4c1a247107b68c41533fe709f85b713..07c08bd1716004e2e0717fbda6fa1c8f53c40b67 100644 --- a/assets/paperEdits-HkiQiv4C.js +++ b/assets/paperEdits-CfQUGmNN.js @@ -1 +1 @@ -import{ac as p}from"./index-3CfcAX6N.js";const a={authorization:e=>p(`/paper-edit-authorizations/${encodeURIComponent(e)}`),approve:e=>p(`/paper-edit-authorizations/${encodeURIComponent(e)}/approve`,{method:"POST"}),digest:(e,t)=>p(`/admin/paper-edit-digest?day=${e}&page=${t}`),suspend:(e,t)=>p("/admin/paper-edit-suspension",{method:"POST",body:JSON.stringify({hf_subject:e,suspended:t})})};export{a as p}; +import{ac as p}from"./index-CxhY4zQ1.js";const a={authorization:e=>p(`/paper-edit-authorizations/${encodeURIComponent(e)}`),approve:e=>p(`/paper-edit-authorizations/${encodeURIComponent(e)}/approve`,{method:"POST"}),digest:(e,t)=>p(`/admin/paper-edit-digest?day=${e}&page=${t}`),suspend:(e,t)=>p("/admin/paper-edit-suspension",{method:"POST",body:JSON.stringify({hf_subject:e,suspended:t})})};export{a as p}; diff --git a/assets/papers-BsYlGUQi.js b/assets/papers-BDxSKSYJ.js similarity index 96% rename from assets/papers-BsYlGUQi.js rename to assets/papers-BDxSKSYJ.js index 888f90cec2795af98f72fca8a2108c9a2c97efca..abda48fd9e8d65457d6e258a2915f0eb2da070a5 100644 --- a/assets/papers-BsYlGUQi.js +++ b/assets/papers-BDxSKSYJ.js @@ -1 +1 @@ -import{p as a}from"./curation-BZoIvsHD.js";import{ac as c,az as h,aI as m}from"./index-3CfcAX6N.js";function i(o){const e=new URLSearchParams;for(const[r,s]of Object.entries(o??{}))s!==void 0&&s!==""&&e.set(r,String(s));const t=e.toString();return t?`?${t}`:""}class d{constructor(e){this.request=e}list(e){const t=new URLSearchParams;for(const[s,n]of Object.entries(e??{}))n!==void 0&&n!==""&&t.set(s,String(n));const r=t.toString();return this.request(`/papers/${r?`?${r}`:""}`,{cache:"no-cache"})}search(e,t=1,r=10,s,n,u){const p=new URLSearchParams({q:e,page:t.toString(),page_size:r.toString()});return s&&p.set("mode",s),u!=null&&u.start_date&&p.set("start_date",u.start_date),u!=null&&u.end_date&&p.set("end_date",u.end_date),this.request(`/papers/search?${p.toString()}`,{signal:n})}searchFeed(e){return this.request(`/papers/search/feed${i(e)}`,{cache:"no-cache"})}get(e,t=!0){const r=t?"?include_resources=true":"";return this.request(`/papers/${e}${r}`)}getByArxivId(e,t=!0){const r=t?"?include_resources=true":"";return this.request(`/papers/arxiv/${e}${r}`)}lookup(e){return this.request("/papers/lookup",{method:"POST",body:JSON.stringify({references:e})})}related(e,t=4){return this.request(`/papers/${encodeURIComponent(e)}/related?limit=${t}`)}suggestedQuestions(e){return this.request(`/papers/${encodeURIComponent(e)}/suggested-questions`)}versions(e){return this.request(`/papers/arxiv/${e}/versions`)}indexFromArxiv(e){return this.request(`/papers/index/${e}`,{method:"POST"})}submit(e){return this.request("/papers/submit",{method:"POST",body:JSON.stringify(e)})}copyToBucket(e,t){return this.request(`/papers/${encodeURIComponent(e)}/copy-to-bucket`,{method:"POST",body:JSON.stringify(t)})}trending(e){const t=new URLSearchParams;for(const[s,n]of Object.entries(e??{}))n!==void 0&&t.set(s,String(n));const r=t.toString();return this.request(`/papers/trending${r?`?${r}`:""}`,{cache:"no-store"})}forTask(e,t){return this.request(`/tasks/${e}/papers${i(t)}`)}forMethod(e,t){return this.request(`/methods/${encodeURIComponent(e)}/papers${i(t)}`)}forConference(e,t){return this.request(`/conferences/${e}/papers${i(t)}`)}forOrganization(e,t){return this.request(`/organizations/${e}/papers${i(t)}`)}getAuthor(e){return this.request(`/authors/${e}`)}searchAuthors(e,t){return this.request(`/authors/${i({search:e,page_size:t})}`)}primeCurationState(e,t=!1){return a.primePaper(e,t)}freshAuthMutationDraft(){return a.freshAuthMutationDraft()}resumeFreshAuthMutation(){return a.resumeFreshAuthMutation()}updateTasks(e,t){const r=new URLSearchParams(t.map(s=>["task_ids",String(s)])).toString();return a.mutatePaper(e,"tasks",t,`/papers/${e}/tasks?${r}`,{method:"PUT"})}updateMethods(e,t){const r=new URLSearchParams(t.map(s=>["method_ids",String(s)])).toString();return a.mutatePaper(e,"methods",t,`/papers/${e}/methods?${r}`,{method:"PUT"})}updateOrganizations(e,t){const r=new URLSearchParams(t.map(s=>["organization_ids",String(s)])).toString();return a.mutatePaper(e,"organizations",t,`/papers/${e}/organizations?${r}`,{method:"PUT"})}updateRepositories(e,t){return a.mutatePaper(e,"repositories",t,`/papers/${e}/repositories`,{method:"PUT",body:JSON.stringify({repositories:t})})}updateProjectPages(e,t){return a.mutatePaper(e,"project_pages",t,`/papers/${e}/project-pages`,{method:"PUT",body:JSON.stringify({project_pages:t})})}updateXThreads(e,t){return a.mutatePaper(e,"x_threads",t,`/papers/${e}/x-threads`,{method:"PUT",body:JSON.stringify({x_threads:t})})}updateSourceUrl(e,t){return a.mutatePaper(e,"source_url",t,`/papers/${e}/source-url`,{method:"PUT",body:JSON.stringify({source_url:t})})}updateHfArtifacts(e,t){return a.mutatePaper(e,"hf_artifacts",t,`/papers/${e}/hf-artifacts`,{method:"PUT",body:JSON.stringify(t)})}}const g=new d(c);async function P(o){return(await h(`/papers/${encodeURIComponent(o)}/web-markdown`)).text()}function S(o){return c(`/papers/${encodeURIComponent(o)}/web-page`)}function y(o){return m(`/papers/${encodeURIComponent(o)}/layout`)}export{P as a,y as b,S as g,g as p}; +import{p as a}from"./curation-D2sqKAqC.js";import{ac as c,az as h,aI as m}from"./index-CxhY4zQ1.js";function i(o){const e=new URLSearchParams;for(const[r,s]of Object.entries(o??{}))s!==void 0&&s!==""&&e.set(r,String(s));const t=e.toString();return t?`?${t}`:""}class d{constructor(e){this.request=e}list(e){const t=new URLSearchParams;for(const[s,n]of Object.entries(e??{}))n!==void 0&&n!==""&&t.set(s,String(n));const r=t.toString();return this.request(`/papers/${r?`?${r}`:""}`,{cache:"no-cache"})}search(e,t=1,r=10,s,n,u){const p=new URLSearchParams({q:e,page:t.toString(),page_size:r.toString()});return s&&p.set("mode",s),u!=null&&u.start_date&&p.set("start_date",u.start_date),u!=null&&u.end_date&&p.set("end_date",u.end_date),this.request(`/papers/search?${p.toString()}`,{signal:n})}searchFeed(e){return this.request(`/papers/search/feed${i(e)}`,{cache:"no-cache"})}get(e,t=!0){const r=t?"?include_resources=true":"";return this.request(`/papers/${e}${r}`)}getByArxivId(e,t=!0){const r=t?"?include_resources=true":"";return this.request(`/papers/arxiv/${e}${r}`)}lookup(e){return this.request("/papers/lookup",{method:"POST",body:JSON.stringify({references:e})})}related(e,t=4){return this.request(`/papers/${encodeURIComponent(e)}/related?limit=${t}`)}suggestedQuestions(e){return this.request(`/papers/${encodeURIComponent(e)}/suggested-questions`)}versions(e){return this.request(`/papers/arxiv/${e}/versions`)}indexFromArxiv(e){return this.request(`/papers/index/${e}`,{method:"POST"})}submit(e){return this.request("/papers/submit",{method:"POST",body:JSON.stringify(e)})}copyToBucket(e,t){return this.request(`/papers/${encodeURIComponent(e)}/copy-to-bucket`,{method:"POST",body:JSON.stringify(t)})}trending(e){const t=new URLSearchParams;for(const[s,n]of Object.entries(e??{}))n!==void 0&&t.set(s,String(n));const r=t.toString();return this.request(`/papers/trending${r?`?${r}`:""}`,{cache:"no-store"})}forTask(e,t){return this.request(`/tasks/${e}/papers${i(t)}`)}forMethod(e,t){return this.request(`/methods/${encodeURIComponent(e)}/papers${i(t)}`)}forConference(e,t){return this.request(`/conferences/${e}/papers${i(t)}`)}forOrganization(e,t){return this.request(`/organizations/${e}/papers${i(t)}`)}getAuthor(e){return this.request(`/authors/${e}`)}searchAuthors(e,t){return this.request(`/authors/${i({search:e,page_size:t})}`)}primeCurationState(e,t=!1){return a.primePaper(e,t)}freshAuthMutationDraft(){return a.freshAuthMutationDraft()}resumeFreshAuthMutation(){return a.resumeFreshAuthMutation()}updateTasks(e,t){const r=new URLSearchParams(t.map(s=>["task_ids",String(s)])).toString();return a.mutatePaper(e,"tasks",t,`/papers/${e}/tasks?${r}`,{method:"PUT"})}updateMethods(e,t){const r=new URLSearchParams(t.map(s=>["method_ids",String(s)])).toString();return a.mutatePaper(e,"methods",t,`/papers/${e}/methods?${r}`,{method:"PUT"})}updateOrganizations(e,t){const r=new URLSearchParams(t.map(s=>["organization_ids",String(s)])).toString();return a.mutatePaper(e,"organizations",t,`/papers/${e}/organizations?${r}`,{method:"PUT"})}updateRepositories(e,t){return a.mutatePaper(e,"repositories",t,`/papers/${e}/repositories`,{method:"PUT",body:JSON.stringify({repositories:t})})}updateProjectPages(e,t){return a.mutatePaper(e,"project_pages",t,`/papers/${e}/project-pages`,{method:"PUT",body:JSON.stringify({project_pages:t})})}updateXThreads(e,t){return a.mutatePaper(e,"x_threads",t,`/papers/${e}/x-threads`,{method:"PUT",body:JSON.stringify({x_threads:t})})}updateSourceUrl(e,t){return a.mutatePaper(e,"source_url",t,`/papers/${e}/source-url`,{method:"PUT",body:JSON.stringify({source_url:t})})}updateHfArtifacts(e,t){return a.mutatePaper(e,"hf_artifacts",t,`/papers/${e}/hf-artifacts`,{method:"PUT",body:JSON.stringify(t)})}}const g=new d(c);async function P(o){return(await h(`/papers/${encodeURIComponent(o)}/web-markdown`)).text()}function S(o){return c(`/papers/${encodeURIComponent(o)}/web-page`)}function y(o){return m(`/papers/${encodeURIComponent(o)}/layout`)}export{P as a,y as b,S as g,g as p}; diff --git a/assets/plus-CiDEk52y.js b/assets/plus-CEkdlNSn.js similarity index 86% rename from assets/plus-CiDEk52y.js rename to assets/plus-CEkdlNSn.js index 213062834b77a049d0f61f58579bb3dc15bedf56..7f9c091b90d9bdb0dfa42aefd8893421c7d4152f 100644 --- a/assets/plus-CiDEk52y.js +++ b/assets/plus-CEkdlNSn.js @@ -1,4 +1,4 @@ -import{c as e}from"./index-3CfcAX6N.js";/** +import{c as e}from"./index-CxhY4zQ1.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/popover-Dwe6SY1f.js b/assets/popover-DgW_tN02.js similarity index 98% rename from assets/popover-Dwe6SY1f.js rename to assets/popover-DgW_tN02.js index e118b356d122ddb570ab036ed70f00f86a3201aa..9ed4601e1318741b545a0bb3e4507abbff3c55eb 100644 --- a/assets/popover-Dwe6SY1f.js +++ b/assets/popover-DgW_tN02.js @@ -1 +1 @@ -import{f as s,j as l,ak as L,B as V,ap as $,af as W,D as A,z as O,E as h,aq as E,ar as y,P as _,as as H,G as z,aJ as G,aK as B,aL as K,aM as Z,at as q,au as J,av as U,I as Q}from"./index-3CfcAX6N.js";function X(e){const t=Y(e),r=s.forwardRef((n,o)=>{const{children:a,...c}=n,i=s.Children.toArray(a),p=i.find(oe);if(p){const u=p.props.children,P=i.map(f=>f===p?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return l.jsx(t,{...c,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,P):null})}return l.jsx(t,{...c,ref:o,children:a})});return r.displayName=`${e}.Slot`,r}function Y(e){const t=s.forwardRef((r,n)=>{const{children:o,...a}=r;if(s.isValidElement(o)){const c=re(o),i=te(a,o.props);return o.type!==s.Fragment&&(i.ref=n?L(n,c):c),s.cloneElement(o,i)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ee=Symbol("radix.slottable");function oe(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ee}function te(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...i)=>{const p=a(...i);return o(...i),p}:o&&(r[n]=o):n==="style"?r[n]={...o,...a}:n==="className"&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}function re(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var C="Popover",[b]=z(C,[y]),m=y(),[ne,d]=b(C),j=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:a,modal:c=!1}=e,i=m(t),p=s.useRef(null),[u,P]=s.useState(!1),[f,v]=V({prop:n,defaultProp:o??!1,onChange:a,caller:C});return l.jsx($,{...i,children:l.jsx(ne,{scope:t,contentId:W(),triggerRef:p,open:f,onOpenChange:v,onOpenToggle:s.useCallback(()=>v(x=>!x),[v]),hasCustomAnchor:u,onCustomAnchorAdd:s.useCallback(()=>P(!0),[]),onCustomAnchorRemove:s.useCallback(()=>P(!1),[]),modal:c,children:r})})};j.displayName=C;var w="PopoverAnchor",ae=s.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=d(w,r),a=m(r),{onCustomAnchorAdd:c,onCustomAnchorRemove:i}=o;return s.useEffect(()=>(c(),()=>i()),[c,i]),l.jsx(E,{...a,...n,ref:t})});ae.displayName=w;var S="PopoverTrigger",N=s.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=d(S,r),a=m(r),c=A(t,o.triggerRef),i=l.jsx(O.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":M(o.open),...n,ref:c,onClick:h(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?i:l.jsx(E,{asChild:!0,...a,children:i})});N.displayName=S;var R="PopoverPortal",[se,ce]=b(R,{forceMount:void 0}),F=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,a=d(R,t);return l.jsx(se,{scope:t,forceMount:r,children:l.jsx(_,{present:r||a.open,children:l.jsx(H,{asChild:!0,container:o,children:n})})})};F.displayName=R;var g="PopoverContent",D=s.forwardRef((e,t)=>{const r=ce(g,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,a=d(g,e.__scopePopover);return l.jsx(_,{present:n||a.open,children:a.modal?l.jsx(le,{...o,ref:t}):l.jsx(pe,{...o,ref:t})})});D.displayName=g;var ie=X("PopoverContent.RemoveScroll"),le=s.forwardRef((e,t)=>{const r=d(g,e.__scopePopover),n=s.useRef(null),o=A(t,n),a=s.useRef(!1);return s.useEffect(()=>{const c=n.current;if(c)return G(c)},[]),l.jsx(B,{as:ie,allowPinchZoom:!0,children:l.jsx(I,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:h(e.onCloseAutoFocus,c=>{var i;c.preventDefault(),a.current||(i=r.triggerRef.current)==null||i.focus()}),onPointerDownOutside:h(e.onPointerDownOutside,c=>{const i=c.detail.originalEvent,p=i.button===0&&i.ctrlKey===!0,u=i.button===2||p;a.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:h(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),pe=s.forwardRef((e,t)=>{const r=d(g,e.__scopePopover),n=s.useRef(!1),o=s.useRef(!1);return l.jsx(I,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var c,i;(c=e.onCloseAutoFocus)==null||c.call(e,a),a.defaultPrevented||(n.current||(i=r.triggerRef.current)==null||i.focus(),a.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:a=>{var p,u;(p=e.onInteractOutside)==null||p.call(e,a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const c=a.target;((u=r.triggerRef.current)==null?void 0:u.contains(c))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),I=s.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEscapeKeyDown:i,onPointerDownOutside:p,onFocusOutside:u,onInteractOutside:P,...f}=e,v=d(g,r),x=m(r);return K(),l.jsx(Z,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:a,children:l.jsx(q,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:P,onEscapeKeyDown:i,onPointerDownOutside:p,onFocusOutside:u,onDismiss:()=>v.onOpenChange(!1),children:l.jsx(J,{"data-state":M(v.open),role:"dialog",id:v.contentId,...x,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),T="PopoverClose",ue=s.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=d(T,r);return l.jsx(O.button,{type:"button",...n,ref:t,onClick:h(e.onClick,()=>o.onOpenChange(!1))})});ue.displayName=T;var de="PopoverArrow",fe=s.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=m(r);return l.jsx(U,{...o,...n,ref:t})});fe.displayName=de;function M(e){return e?"open":"closed"}var ve=j,Pe=N,ge=F,k=D;const Ce=ve,xe=Pe,he=s.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},o)=>l.jsx(ge,{children:l.jsx(k,{ref:o,align:t,sideOffset:r,className:Q("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));he.displayName=k.displayName;export{Ce as P,xe as a,he as b}; +import{f as s,j as l,ak as L,B as V,ap as $,af as W,D as A,z as O,E as h,aq as E,ar as y,P as _,as as H,G as z,aJ as G,aK as B,aL as K,aM as Z,at as q,au as J,av as U,I as Q}from"./index-CxhY4zQ1.js";function X(e){const t=Y(e),r=s.forwardRef((n,o)=>{const{children:a,...c}=n,i=s.Children.toArray(a),p=i.find(oe);if(p){const u=p.props.children,P=i.map(f=>f===p?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return l.jsx(t,{...c,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,P):null})}return l.jsx(t,{...c,ref:o,children:a})});return r.displayName=`${e}.Slot`,r}function Y(e){const t=s.forwardRef((r,n)=>{const{children:o,...a}=r;if(s.isValidElement(o)){const c=re(o),i=te(a,o.props);return o.type!==s.Fragment&&(i.ref=n?L(n,c):c),s.cloneElement(o,i)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ee=Symbol("radix.slottable");function oe(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ee}function te(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...i)=>{const p=a(...i);return o(...i),p}:o&&(r[n]=o):n==="style"?r[n]={...o,...a}:n==="className"&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}function re(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var C="Popover",[b]=z(C,[y]),m=y(),[ne,d]=b(C),j=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:a,modal:c=!1}=e,i=m(t),p=s.useRef(null),[u,P]=s.useState(!1),[f,v]=V({prop:n,defaultProp:o??!1,onChange:a,caller:C});return l.jsx($,{...i,children:l.jsx(ne,{scope:t,contentId:W(),triggerRef:p,open:f,onOpenChange:v,onOpenToggle:s.useCallback(()=>v(x=>!x),[v]),hasCustomAnchor:u,onCustomAnchorAdd:s.useCallback(()=>P(!0),[]),onCustomAnchorRemove:s.useCallback(()=>P(!1),[]),modal:c,children:r})})};j.displayName=C;var w="PopoverAnchor",ae=s.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=d(w,r),a=m(r),{onCustomAnchorAdd:c,onCustomAnchorRemove:i}=o;return s.useEffect(()=>(c(),()=>i()),[c,i]),l.jsx(E,{...a,...n,ref:t})});ae.displayName=w;var S="PopoverTrigger",N=s.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=d(S,r),a=m(r),c=A(t,o.triggerRef),i=l.jsx(O.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":M(o.open),...n,ref:c,onClick:h(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?i:l.jsx(E,{asChild:!0,...a,children:i})});N.displayName=S;var R="PopoverPortal",[se,ce]=b(R,{forceMount:void 0}),F=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,a=d(R,t);return l.jsx(se,{scope:t,forceMount:r,children:l.jsx(_,{present:r||a.open,children:l.jsx(H,{asChild:!0,container:o,children:n})})})};F.displayName=R;var g="PopoverContent",D=s.forwardRef((e,t)=>{const r=ce(g,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,a=d(g,e.__scopePopover);return l.jsx(_,{present:n||a.open,children:a.modal?l.jsx(le,{...o,ref:t}):l.jsx(pe,{...o,ref:t})})});D.displayName=g;var ie=X("PopoverContent.RemoveScroll"),le=s.forwardRef((e,t)=>{const r=d(g,e.__scopePopover),n=s.useRef(null),o=A(t,n),a=s.useRef(!1);return s.useEffect(()=>{const c=n.current;if(c)return G(c)},[]),l.jsx(B,{as:ie,allowPinchZoom:!0,children:l.jsx(I,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:h(e.onCloseAutoFocus,c=>{var i;c.preventDefault(),a.current||(i=r.triggerRef.current)==null||i.focus()}),onPointerDownOutside:h(e.onPointerDownOutside,c=>{const i=c.detail.originalEvent,p=i.button===0&&i.ctrlKey===!0,u=i.button===2||p;a.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:h(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),pe=s.forwardRef((e,t)=>{const r=d(g,e.__scopePopover),n=s.useRef(!1),o=s.useRef(!1);return l.jsx(I,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var c,i;(c=e.onCloseAutoFocus)==null||c.call(e,a),a.defaultPrevented||(n.current||(i=r.triggerRef.current)==null||i.focus(),a.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:a=>{var p,u;(p=e.onInteractOutside)==null||p.call(e,a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const c=a.target;((u=r.triggerRef.current)==null?void 0:u.contains(c))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),I=s.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEscapeKeyDown:i,onPointerDownOutside:p,onFocusOutside:u,onInteractOutside:P,...f}=e,v=d(g,r),x=m(r);return K(),l.jsx(Z,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:a,children:l.jsx(q,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:P,onEscapeKeyDown:i,onPointerDownOutside:p,onFocusOutside:u,onDismiss:()=>v.onOpenChange(!1),children:l.jsx(J,{"data-state":M(v.open),role:"dialog",id:v.contentId,...x,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),T="PopoverClose",ue=s.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=d(T,r);return l.jsx(O.button,{type:"button",...n,ref:t,onClick:h(e.onClick,()=>o.onOpenChange(!1))})});ue.displayName=T;var de="PopoverArrow",fe=s.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=m(r);return l.jsx(U,{...o,...n,ref:t})});fe.displayName=de;function M(e){return e?"open":"closed"}var ve=j,Pe=N,ge=F,k=D;const Ce=ve,xe=Pe,he=s.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},o)=>l.jsx(ge,{children:l.jsx(k,{ref:o,align:t,sideOffset:r,className:Q("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));he.displayName=k.displayName;export{Ce as P,xe as a,he as b}; diff --git a/assets/preferences-BmWwgggH.js b/assets/preferences-CUy01zEm.js similarity index 74% rename from assets/preferences-BmWwgggH.js rename to assets/preferences-CUy01zEm.js index 1e28e62ac590b20e69d287603542ce0943443677..b4b32f398e8c08b8928ce19b43c00251447994f9 100644 --- a/assets/preferences-BmWwgggH.js +++ b/assets/preferences-CUy01zEm.js @@ -1 +1 @@ -import{a as y,l as d,b as f,W as p}from"./index-3CfcAX6N.js";import{u as m}from"./useMutation-CKC6OFhA.js";import{a as c}from"./account-Ee9-ZosC.js";const i={hide_closed_source_evals:!1};function v(){const{user:t}=y(),r=d(),s=p.preferences,a=f({queryKey:s,queryFn:()=>c.getPreferences(),enabled:!!t,staleTime:1/0}),o=a.data??i,l=m({mutationFn:e=>t?c.updatePreferences(e):Promise.resolve(e),onMutate:async e=>{await r.cancelQueries({queryKey:s});const u=r.getQueryData(s)??i;return r.setQueryData(s,e),{previous:u}},onError:(e,u,n)=>{n&&r.setQueryData(s,n.previous)},onSuccess:e=>r.setQueryData(s,e)});return{preferences:o,canPersist:!!t,isLoading:a.isLoading,setHideClosedSourceEvals:e=>l.mutate({...o,hide_closed_source_evals:e})}}export{v as u}; +import{a as y,l as d,b as f,W as p}from"./index-CxhY4zQ1.js";import{u as m}from"./useMutation-BzRfwboV.js";import{a as c}from"./account-Bplq3u-8.js";const i={hide_closed_source_evals:!1};function v(){const{user:t}=y(),r=d(),s=p.preferences,a=f({queryKey:s,queryFn:()=>c.getPreferences(),enabled:!!t,staleTime:1/0}),o=a.data??i,l=m({mutationFn:e=>t?c.updatePreferences(e):Promise.resolve(e),onMutate:async e=>{await r.cancelQueries({queryKey:s});const u=r.getQueryData(s)??i;return r.setQueryData(s,e),{previous:u}},onError:(e,u,n)=>{n&&r.setQueryData(s,n.previous)},onSuccess:e=>r.setQueryData(s,e)});return{preferences:o,canPersist:!!t,isLoading:a.isLoading,setHideClosedSourceEvals:e=>l.mutate({...o,hide_closed_source_evals:e})}}export{v as u}; diff --git a/assets/queryInvalidation-CO_YWd6U.js b/assets/queryInvalidation-Djot7Ix_.js similarity index 93% rename from assets/queryInvalidation-CO_YWd6U.js rename to assets/queryInvalidation-Djot7Ix_.js index 38d0027b2b0466eb99ac6bccef4f38969081e88e..69f0551f91f23555b0c4ef58309ebe15689785c6 100644 --- a/assets/queryInvalidation-CO_YWd6U.js +++ b/assets/queryInvalidation-Djot7Ix_.js @@ -1 +1 @@ -import{p as n,t as u}from"./index-3CfcAX6N.js";function f(e,t,a){if(!e)return e;const i=r=>r.paper_id!==t||r.paper_title===a?r:{...r,paper_title:a};if(Array.isArray(e)){const r=e.map(i);return r.some((s,o)=>s!==e[o])?r:e}if(Array.isArray(e.results)){const r=e.results.map(i);return r.some((s,o)=>s!==e.results[o])?{...e,results:r}:e}return e}function p(e,t){const a=new Set(t.filter(i=>!!i));for(const i of a)for(const r of[n.detail(i),n.arxiv(i),n.preview(i),n.summary(i)])e.invalidateQueries({queryKey:r,exact:!0})}function y(e){for(const t of Object.values(n.feeds))e.invalidateQueries({queryKey:t,refetchType:"none"})}function h(e,t,a){new Set([...a,t.id,t.arxiv_id].filter(s=>!!s)).forEach(s=>{e.setQueryData(n.detail(s),t),e.setQueryData(n.arxiv(s),t),e.setQueriesData({queryKey:n.preview(s),exact:!0},t),e.setQueriesData({queryKey:n.summary(s),exact:!0},t)}),y(e);const r=String(t.id),c=s=>f(s,r,t.title);for(const s of[u.all,u.byDatasetAll])e.setQueriesData({queryKey:s},c),e.invalidateQueries({queryKey:s,refetchType:"none"})}export{y as a,p as i,h as r}; +import{p as n,t as u}from"./index-CxhY4zQ1.js";function f(e,t,a){if(!e)return e;const i=r=>r.paper_id!==t||r.paper_title===a?r:{...r,paper_title:a};if(Array.isArray(e)){const r=e.map(i);return r.some((s,o)=>s!==e[o])?r:e}if(Array.isArray(e.results)){const r=e.results.map(i);return r.some((s,o)=>s!==e.results[o])?{...e,results:r}:e}return e}function p(e,t){const a=new Set(t.filter(i=>!!i));for(const i of a)for(const r of[n.detail(i),n.arxiv(i),n.preview(i),n.summary(i)])e.invalidateQueries({queryKey:r,exact:!0})}function y(e){for(const t of Object.values(n.feeds))e.invalidateQueries({queryKey:t,refetchType:"none"})}function h(e,t,a){new Set([...a,t.id,t.arxiv_id].filter(s=>!!s)).forEach(s=>{e.setQueryData(n.detail(s),t),e.setQueryData(n.arxiv(s),t),e.setQueriesData({queryKey:n.preview(s),exact:!0},t),e.setQueriesData({queryKey:n.summary(s),exact:!0},t)}),y(e);const r=String(t.id),c=s=>f(s,r,t.title);for(const s of[u.all,u.byDatasetAll])e.setQueriesData({queryKey:s},c),e.invalidateQueries({queryKey:s,refetchType:"none"})}export{y as a,p as i,h as r}; diff --git a/assets/refresh-cw-CwE-ezgN.js b/assets/refresh-cw-Ddb6Y_kg.js similarity index 94% rename from assets/refresh-cw-CwE-ezgN.js rename to assets/refresh-cw-Ddb6Y_kg.js index 7672f12f8de8ac59c4714f70f68658d7108617b4..b5f1bd92a0067e73a50e7de4a59ad7fb69ed5a28 100644 --- a/assets/refresh-cw-CwE-ezgN.js +++ b/assets/refresh-cw-Ddb6Y_kg.js @@ -1,4 +1,4 @@ -import{c as e}from"./index-3CfcAX6N.js";/** +import{c as e}from"./index-CxhY4zQ1.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/researchTopic-Z4AJDMN7.js b/assets/researchTopic-DXZVIvAq.js similarity index 97% rename from assets/researchTopic-Z4AJDMN7.js rename to assets/researchTopic-DXZVIvAq.js index 2fd3be10b73abf6324d7a9ab30d3fad8d906b376..ae658c7dcb25504afe1b10210aa66210c36bd0df 100644 --- a/assets/researchTopic-Z4AJDMN7.js +++ b/assets/researchTopic-DXZVIvAq.js @@ -1 +1 @@ -import{ac as i,d as u,b as y,r as l,l as f}from"./index-3CfcAX6N.js";import{u as p}from"./useMutation-CKC6OFhA.js";const S=20,E=300,N=10,c={follows:()=>i("/me/follows"),followSuggestions:()=>i("/research/follow-suggestions"),setFollow:(e,t,s)=>i(`/me/follows/${e}/${t}`,{method:s?"PUT":"DELETE"}),following:(e=0,t={})=>{const s=new URLSearchParams({offset:String(e),limit:"40"});return t.startDate&&s.set("start_date",t.startDate),t.endDate&&s.set("end_date",t.endDate),!t.startDate&&!t.endDate&&s.set("all_time","true"),t.topicOnly&&s.set("topic_only","true"),t.topicId!==void 0&&s.set("topic_id",String(t.topicId)),i(`/me/following?${s}`)},topics:()=>i("/me/topics"),addTopic:e=>i("/me/topics",{method:"POST",body:JSON.stringify({text:e})}),updateTopic:(e,t)=>i(`/me/topics/${e}`,{method:"PUT",body:JSON.stringify({text:t})}),removeTopic:e=>i(`/me/topics/${e}`,{method:"DELETE"}),followTopic:e=>i(`/me/topics/${e}/follow`,{method:"POST"}),setTopicPublic:(e,t)=>i(`/me/topics/${e}`,{method:"PATCH",body:JSON.stringify({is_public:t})}),setShowAsFollower:e=>i("/me/topic-follower-visibility",{method:"PUT",body:JSON.stringify({show_as_follower:e})}),publicTopic:e=>i(`/research/topics/${e}`),topicPapers:(e,t,s=0,o={})=>{const n=new URLSearchParams({order:t,offset:String(s),limit:String(S)});return o.startDate&&n.set("start_date",o.startDate),o.endDate&&n.set("end_date",o.endDate),i(`/research/topics/${e}/papers?${n}`)},featuredTopics:()=>i("/research/topics/featured"),email:()=>i("/me/research-email"),setEmail:e=>i("/me/research-email",{method:"PUT",body:JSON.stringify({enabled:e})})};function m(e,t,{follows:s}){return Promise.all([s&&e.invalidateQueries({queryKey:l.follows(t)}),e.invalidateQueries({queryKey:l.feed(t)}),e.invalidateQueries({queryKey:l.email(t)})])}function D(e=!0){var s;const t=(s=u())==null?void 0:s.user;return y({queryKey:l.follows(t==null?void 0:t.hf_subject),queryFn:c.follows,enabled:e&&!!t})}function $({onChanged:e,awaitRefresh:t=!1}={}){var n;const s=(n=u())==null?void 0:n.user,o=f();return p({mutationFn:({kind:a,entityId:r,follow:d})=>c.setFollow(a,r,d),onSuccess:async(a,r)=>{e==null||e(r);const d=m(o,s==null?void 0:s.hf_subject,{follows:!0});t&&await d}})}function P(e){const t=e.label??e.text;return t.charAt(0).toUpperCase()+t.slice(1)}function L(e){const t=P(e).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,60);return t?`/topics/${e.id}-${t}`:`/topics/${e.id}`}function q(e){return e.split(/[,;\n]|\s-\s|^\s*-\s/m).filter(t=>t.trim().length>=3).length>=4}function K(){var s;const e=(s=u())==null?void 0:s.user,t=f();return p({mutationFn:o=>c.followTopic(o),onSuccess:async()=>{_(),await g(t,e==null?void 0:e.hf_subject)}})}function Q(){var s;const e=(s=u())==null?void 0:s.user,t=f();return p({mutationFn:({id:o,isPublic:n})=>c.setTopicPublic(o,n),onSuccess:()=>t.invalidateQueries({queryKey:l.topics(e==null?void 0:e.hf_subject)})})}const w="pwc:pending-topic-follow";function j(e){sessionStorage.setItem(w,String(e))}function A(){const e=Number(sessionStorage.getItem(w));return Number.isInteger(e)&&e>0?e:null}function _(){sessionStorage.removeItem(w)}const b=e=>e.status==="pending"||e.status==="running";function R(e=!0,t=5e3){var o;const s=(o=u())==null?void 0:o.user;return y({queryKey:l.topics(s==null?void 0:s.hf_subject),queryFn:c.topics,enabled:e&&!!s,refetchInterval:n=>{var a;return(a=n.state.data)!=null&&a.some(b)?t:!1}})}function g(e,t){return m(e,t,{follows:!1}),e.invalidateQueries({queryKey:l.publicTopics}),e.invalidateQueries({queryKey:l.topics(t)})}function J(e){var o;const t=(o=u())==null?void 0:o.user,s=f();return p({mutationFn:({id:n,text:a})=>n===void 0?c.addTopic(a):c.updateTopic(n,a),onSuccess:async()=>{F(),await g(s,t==null?void 0:t.hf_subject),e==null||e()}})}function U(){var s;const e=(s=u())==null?void 0:s.user,t=f();return p({mutationFn:async o=>{const a=(await Promise.allSettled(o.map(r=>c.removeTopic(r)))).find(r=>r.status==="rejected");if(a)throw a.reason},onSettled:()=>void g(t,e==null?void 0:e.hf_subject)})}const T="pwc:following-pending-topic";function C(e){sessionStorage.setItem(T,e)}function G(){return sessionStorage.getItem(T)}function F(){sessionStorage.removeItem(T)}function M(){var s;const e=(s=u())==null?void 0:s.user,t=f();return p({mutationFn:async o=>{const a=(await Promise.allSettled(o.map(r=>c.setFollow(r.kind,r.id,r.follow??!0)))).find(r=>r.status==="rejected");if(a)throw a.reason},onSuccess:()=>I(),onSettled:()=>void m(t,e==null?void 0:e.hf_subject,{follows:!0})})}const h="pwc:following-pending-follows";function Y(e){sessionStorage.setItem(h,JSON.stringify(e))}function k(){return JSON.parse(sessionStorage.getItem(h)??"[]")}function I(){sessionStorage.removeItem(h)}export{S as T,L as a,U as b,A as c,R as d,D as e,J as f,M as g,N as h,E as i,C as j,Y as k,b as l,G as m,k as n,F as o,$ as p,q,c as r,j as s,P as t,K as u,Q as v}; +import{ac as i,d as u,b as y,r as l,l as f}from"./index-CxhY4zQ1.js";import{u as p}from"./useMutation-BzRfwboV.js";const S=20,E=300,N=10,c={follows:()=>i("/me/follows"),followSuggestions:()=>i("/research/follow-suggestions"),setFollow:(e,t,s)=>i(`/me/follows/${e}/${t}`,{method:s?"PUT":"DELETE"}),following:(e=0,t={})=>{const s=new URLSearchParams({offset:String(e),limit:"40"});return t.startDate&&s.set("start_date",t.startDate),t.endDate&&s.set("end_date",t.endDate),!t.startDate&&!t.endDate&&s.set("all_time","true"),t.topicOnly&&s.set("topic_only","true"),t.topicId!==void 0&&s.set("topic_id",String(t.topicId)),i(`/me/following?${s}`)},topics:()=>i("/me/topics"),addTopic:e=>i("/me/topics",{method:"POST",body:JSON.stringify({text:e})}),updateTopic:(e,t)=>i(`/me/topics/${e}`,{method:"PUT",body:JSON.stringify({text:t})}),removeTopic:e=>i(`/me/topics/${e}`,{method:"DELETE"}),followTopic:e=>i(`/me/topics/${e}/follow`,{method:"POST"}),setTopicPublic:(e,t)=>i(`/me/topics/${e}`,{method:"PATCH",body:JSON.stringify({is_public:t})}),setShowAsFollower:e=>i("/me/topic-follower-visibility",{method:"PUT",body:JSON.stringify({show_as_follower:e})}),publicTopic:e=>i(`/research/topics/${e}`),topicPapers:(e,t,s=0,o={})=>{const n=new URLSearchParams({order:t,offset:String(s),limit:String(S)});return o.startDate&&n.set("start_date",o.startDate),o.endDate&&n.set("end_date",o.endDate),i(`/research/topics/${e}/papers?${n}`)},featuredTopics:()=>i("/research/topics/featured"),email:()=>i("/me/research-email"),setEmail:e=>i("/me/research-email",{method:"PUT",body:JSON.stringify({enabled:e})})};function m(e,t,{follows:s}){return Promise.all([s&&e.invalidateQueries({queryKey:l.follows(t)}),e.invalidateQueries({queryKey:l.feed(t)}),e.invalidateQueries({queryKey:l.email(t)})])}function D(e=!0){var s;const t=(s=u())==null?void 0:s.user;return y({queryKey:l.follows(t==null?void 0:t.hf_subject),queryFn:c.follows,enabled:e&&!!t})}function $({onChanged:e,awaitRefresh:t=!1}={}){var n;const s=(n=u())==null?void 0:n.user,o=f();return p({mutationFn:({kind:a,entityId:r,follow:d})=>c.setFollow(a,r,d),onSuccess:async(a,r)=>{e==null||e(r);const d=m(o,s==null?void 0:s.hf_subject,{follows:!0});t&&await d}})}function P(e){const t=e.label??e.text;return t.charAt(0).toUpperCase()+t.slice(1)}function L(e){const t=P(e).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,60);return t?`/topics/${e.id}-${t}`:`/topics/${e.id}`}function q(e){return e.split(/[,;\n]|\s-\s|^\s*-\s/m).filter(t=>t.trim().length>=3).length>=4}function K(){var s;const e=(s=u())==null?void 0:s.user,t=f();return p({mutationFn:o=>c.followTopic(o),onSuccess:async()=>{_(),await g(t,e==null?void 0:e.hf_subject)}})}function Q(){var s;const e=(s=u())==null?void 0:s.user,t=f();return p({mutationFn:({id:o,isPublic:n})=>c.setTopicPublic(o,n),onSuccess:()=>t.invalidateQueries({queryKey:l.topics(e==null?void 0:e.hf_subject)})})}const w="pwc:pending-topic-follow";function j(e){sessionStorage.setItem(w,String(e))}function A(){const e=Number(sessionStorage.getItem(w));return Number.isInteger(e)&&e>0?e:null}function _(){sessionStorage.removeItem(w)}const b=e=>e.status==="pending"||e.status==="running";function R(e=!0,t=5e3){var o;const s=(o=u())==null?void 0:o.user;return y({queryKey:l.topics(s==null?void 0:s.hf_subject),queryFn:c.topics,enabled:e&&!!s,refetchInterval:n=>{var a;return(a=n.state.data)!=null&&a.some(b)?t:!1}})}function g(e,t){return m(e,t,{follows:!1}),e.invalidateQueries({queryKey:l.publicTopics}),e.invalidateQueries({queryKey:l.topics(t)})}function J(e){var o;const t=(o=u())==null?void 0:o.user,s=f();return p({mutationFn:({id:n,text:a})=>n===void 0?c.addTopic(a):c.updateTopic(n,a),onSuccess:async()=>{F(),await g(s,t==null?void 0:t.hf_subject),e==null||e()}})}function U(){var s;const e=(s=u())==null?void 0:s.user,t=f();return p({mutationFn:async o=>{const a=(await Promise.allSettled(o.map(r=>c.removeTopic(r)))).find(r=>r.status==="rejected");if(a)throw a.reason},onSettled:()=>void g(t,e==null?void 0:e.hf_subject)})}const T="pwc:following-pending-topic";function C(e){sessionStorage.setItem(T,e)}function G(){return sessionStorage.getItem(T)}function F(){sessionStorage.removeItem(T)}function M(){var s;const e=(s=u())==null?void 0:s.user,t=f();return p({mutationFn:async o=>{const a=(await Promise.allSettled(o.map(r=>c.setFollow(r.kind,r.id,r.follow??!0)))).find(r=>r.status==="rejected");if(a)throw a.reason},onSuccess:()=>I(),onSettled:()=>void m(t,e==null?void 0:e.hf_subject,{follows:!0})})}const h="pwc:following-pending-follows";function Y(e){sessionStorage.setItem(h,JSON.stringify(e))}function k(){return JSON.parse(sessionStorage.getItem(h)??"[]")}function I(){sessionStorage.removeItem(h)}export{S as T,L as a,U as b,A as c,R as d,D as e,J as f,M as g,N as h,E as i,C as j,Y as k,b as l,G as m,k as n,F as o,$ as p,q,c as r,j as s,P as t,K as u,Q as v}; diff --git a/assets/savedPapersAuth-8mhzkOxc.js b/assets/savedPapersAuth-YhdYkTbG.js similarity index 75% rename from assets/savedPapersAuth-8mhzkOxc.js rename to assets/savedPapersAuth-YhdYkTbG.js index c2f5a0d64fc17729ea44ed3bec19e33c880e9489..76344748afbc42346f0779da249238b84d518d65 100644 --- a/assets/savedPapersAuth-8mhzkOxc.js +++ b/assets/savedPapersAuth-YhdYkTbG.js @@ -1 +1 @@ -import{h as a}from"./index-3CfcAX6N.js";const t="saved_papers_authorized";function o(r=!1){const e=new URL(window.location.href);return r&&e.searchParams.set(t,"1"),a(`${e.pathname}${e.search}${e.hash}`,{authorizeBucket:!0,bucketCreate:!0})}export{t as S,o as s}; +import{h as a}from"./index-CxhY4zQ1.js";const t="saved_papers_authorized";function o(r=!1){const e=new URL(window.location.href);return r&&e.searchParams.set(t,"1"),a(`${e.pathname}${e.search}${e.hash}`,{authorizeBucket:!0,bucketCreate:!0})}export{t as S,o as s}; diff --git a/assets/search-SnOvJVk_.js b/assets/search-CkWMhIw6.js similarity index 88% rename from assets/search-SnOvJVk_.js rename to assets/search-CkWMhIw6.js index 6a40ccd7f4f6d3ed92ec89f44fb35bdb9c4dcdc4..86759c278009af575da3a94f690db457f4060798 100644 --- a/assets/search-SnOvJVk_.js +++ b/assets/search-CkWMhIw6.js @@ -1,4 +1,4 @@ -import{c}from"./index-3CfcAX6N.js";/** +import{c}from"./index-CxhY4zQ1.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/searchable-select-DBlreWDS.js b/assets/searchable-select-hPIpmCr4.js similarity index 98% rename from assets/searchable-select-DBlreWDS.js rename to assets/searchable-select-hPIpmCr4.js index d347be1704a360e28122544bb3f539989592d151..56fedc28f8ae8eecf599f529b9097fb89bfb4eb8 100644 --- a/assets/searchable-select-DBlreWDS.js +++ b/assets/searchable-select-hPIpmCr4.js @@ -1,4 +1,4 @@ -import{c as Ae,f as a,af as z,z as L,ag as Me,ah as De,ai as $e,aj as Le,ak as H,j as p,I as D,b as Pe,C as Fe}from"./index-3CfcAX6N.js";import{B as Ke}from"./button-CbnaBx6W.js";import{P as qe,a as Ve,b as Be}from"./popover-Dwe6SY1f.js";import"./dialog-Bbx5GVcy.js";import{S as Ue}from"./search-SnOvJVk_.js";import{L as ze}from"./loader-circle-CMgZ_maE.js";/** +import{c as Ae,f as a,af as z,z as L,ag as Me,ah as De,ai as $e,aj as Le,ak as H,j as p,I as D,b as Pe,C as Fe}from"./index-CxhY4zQ1.js";import{B as Ke}from"./button-BenSiukP.js";import{P as qe,a as Ve,b as Be}from"./popover-DgW_tN02.js";import"./dialog-CT48f48_.js";import{S as Ue}from"./search-CkWMhIw6.js";import{L as ze}from"./loader-circle-C5gQxAlQ.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/share-2-CvYRtEqg.js b/assets/share-2-LsSZFLYg.js similarity index 92% rename from assets/share-2-CvYRtEqg.js rename to assets/share-2-LsSZFLYg.js index ab3e87fac0c5c0d261908da888254e00296ddd29..5aedb4fd7604326658de3f8b6da69ada574ac6c6 100644 --- a/assets/share-2-CvYRtEqg.js +++ b/assets/share-2-LsSZFLYg.js @@ -1,4 +1,4 @@ -import{c}from"./index-3CfcAX6N.js";/** +import{c}from"./index-CxhY4zQ1.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/skeleton-CQbSjC3L.js b/assets/skeleton-DdKViE4r.js similarity index 62% rename from assets/skeleton-CQbSjC3L.js rename to assets/skeleton-DdKViE4r.js index acd455153d4e2ad28f88fee577d6fb5e4ec4b303..4142ad464f989c7d833e748c8c7df52ad7c1dacb 100644 --- a/assets/skeleton-CQbSjC3L.js +++ b/assets/skeleton-DdKViE4r.js @@ -1 +1 @@ -import{j as t,I as n}from"./index-3CfcAX6N.js";function m({className:e,...s}){return t.jsx("div",{className:n("animate-pulse rounded-md bg-muted",e),...s})}export{m as S}; +import{j as t,I as n}from"./index-CxhY4zQ1.js";function m({className:e,...s}){return t.jsx("div",{className:n("animate-pulse rounded-md bg-muted",e),...s})}export{m as S}; diff --git a/assets/sparkles-BY8EsDI7.js b/assets/sparkles-CBme4WI-.js similarity index 93% rename from assets/sparkles-BY8EsDI7.js rename to assets/sparkles-CBme4WI-.js index bded750292aa1520c51c18fd7cd66b3ad4629007..ecd22a3d534b97dae26cac25ff3f758f78b323a0 100644 --- a/assets/sparkles-BY8EsDI7.js +++ b/assets/sparkles-CBme4WI-.js @@ -1,4 +1,4 @@ -import{c as a}from"./index-3CfcAX6N.js";/** +import{c as a}from"./index-CxhY4zQ1.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/submissions-D-jwpMfI.js b/assets/submissions-DF3SD1oA.js similarity index 99% rename from assets/submissions-D-jwpMfI.js rename to assets/submissions-DF3SD1oA.js index d2c799d5b05c8e1627e8b43b4a05ad7a48d697f4..5ec8915706d760fd42f43873c6299c50eccb2165 100644 --- a/assets/submissions-D-jwpMfI.js +++ b/assets/submissions-DF3SD1oA.js @@ -1 +1 @@ -import{ac as Fe}from"./index-3CfcAX6N.js";var v;(function(s){s.assertEqual=a=>{};function e(a){}s.assertIs=e;function t(a){throw new Error}s.assertNever=t,s.arrayToEnum=a=>{const n={};for(const i of a)n[i]=i;return n},s.getValidEnumValues=a=>{const n=s.objectKeys(a).filter(o=>typeof a[a[o]]!="number"),i={};for(const o of n)i[o]=a[o];return s.objectValues(i)},s.objectValues=a=>s.objectKeys(a).map(function(n){return a[n]}),s.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const n=[];for(const i in a)Object.prototype.hasOwnProperty.call(a,i)&&n.push(i);return n},s.find=(a,n)=>{for(const i of a)if(n(i))return i},s.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function r(a,n=" | "){return a.map(i=>typeof i=="string"?`'${i}'`:i).join(n)}s.joinValues=r,s.jsonStringifyReplacer=(a,n)=>typeof n=="bigint"?n.toString():n})(v||(v={}));var Se;(function(s){s.mergeShapes=(e,t)=>({...e,...t})})(Se||(Se={}));const u=v.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),$=s=>{switch(typeof s){case"undefined":return u.undefined;case"string":return u.string;case"number":return Number.isNaN(s)?u.nan:u.number;case"boolean":return u.boolean;case"function":return u.function;case"bigint":return u.bigint;case"symbol":return u.symbol;case"object":return Array.isArray(s)?u.array:s===null?u.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?u.promise:typeof Map<"u"&&s instanceof Map?u.map:typeof Set<"u"&&s instanceof Set?u.set:typeof Date<"u"&&s instanceof Date?u.date:u.object;default:return u.unknown}},d=v.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class I extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(n){return n.message},r={_errors:[]},a=n=>{for(const i of n.issues)if(i.code==="invalid_union")i.unionErrors.map(a);else if(i.code==="invalid_return_type")a(i.returnTypeError);else if(i.code==="invalid_arguments")a(i.argumentsError);else if(i.path.length===0)r._errors.push(t(i));else{let o=r,f=0;for(;ft.message){const t={},r=[];for(const a of this.issues)if(a.path.length>0){const n=a.path[0];t[n]=t[n]||[],t[n].push(e(a))}else r.push(e(a));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}I.create=s=>new I(s);const le=(s,e)=>{let t;switch(s.code){case d.invalid_type:s.received===u.undefined?t="Required":t=`Expected ${s.expected}, received ${s.received}`;break;case d.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(s.expected,v.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:t=`Unrecognized key(s) in object: ${v.joinValues(s.keys,", ")}`;break;case d.invalid_union:t="Invalid input";break;case d.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${v.joinValues(s.options)}`;break;case d.invalid_enum_value:t=`Invalid enum value. Expected ${v.joinValues(s.options)}, received '${s.received}'`;break;case d.invalid_arguments:t="Invalid function arguments";break;case d.invalid_return_type:t="Invalid function return type";break;case d.invalid_date:t="Invalid date";break;case d.invalid_string:typeof s.validation=="object"?"includes"in s.validation?(t=`Invalid input: must include "${s.validation.includes}"`,typeof s.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${s.validation.position}`)):"startsWith"in s.validation?t=`Invalid input: must start with "${s.validation.startsWith}"`:"endsWith"in s.validation?t=`Invalid input: must end with "${s.validation.endsWith}"`:v.assertNever(s.validation):s.validation!=="regex"?t=`Invalid ${s.validation}`:t="Invalid";break;case d.too_small:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at least":"more than"} ${s.minimum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at least":"over"} ${s.minimum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="bigint"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(s.minimum))}`:t="Invalid input";break;case d.too_big:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at most":"less than"} ${s.maximum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at most":"under"} ${s.maximum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="bigint"?t=`BigInt must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly":s.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(s.maximum))}`:t="Invalid input";break;case d.custom:t="Invalid input";break;case d.invalid_intersection_types:t="Intersection results could not be merged";break;case d.not_multiple_of:t=`Number must be a multiple of ${s.multipleOf}`;break;case d.not_finite:t="Number must be finite";break;default:t=e.defaultError,v.assertNever(s)}return{message:t}};let We=le;function Je(){return We}const Ye=s=>{const{data:e,path:t,errorMaps:r,issueData:a}=s,n=[...t,...a.path||[]],i={...a,path:n};if(a.message!==void 0)return{...a,path:n,message:a.message};let o="";const f=r.filter(p=>!!p).slice().reverse();for(const p of f)o=p(i,{data:e,defaultError:o}).message;return{...a,path:n,message:o}};function c(s,e){const t=Je(),r=Ye({issueData:e,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,t,t===le?void 0:le].filter(a=>!!a)});s.common.issues.push(r)}class C{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const a of t){if(a.status==="aborted")return m;a.status==="dirty"&&e.dirty(),r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const a of t){const n=await a.key,i=await a.value;r.push({key:n,value:i})}return C.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const a of t){const{key:n,value:i}=a;if(n.status==="aborted"||i.status==="aborted")return m;n.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),n.value!=="__proto__"&&(typeof i.value<"u"||a.alwaysSet)&&(r[n.value]=i.value)}return{status:e.value,value:r}}}const m=Object.freeze({status:"aborted"}),J=s=>({status:"dirty",value:s}),O=s=>({status:"valid",value:s}),Ce=s=>s.status==="aborted",Oe=s=>s.status==="dirty",B=s=>s.status==="valid",X=s=>typeof Promise<"u"&&s instanceof Promise;var h;(function(s){s.errToObj=e=>typeof e=="string"?{message:e}:e||{},s.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(h||(h={}));class E{constructor(e,t,r,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Ne=(s,e)=>{if(B(e))return{success:!0,data:e.value};if(!s.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new I(s.common.issues);return this._error=t,this._error}}};function g(s){if(!s)return{};const{errorMap:e,invalid_type_error:t,required_error:r,description:a}=s;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(i,o)=>{const{message:f}=s;return i.code==="invalid_enum_value"?{message:f??o.defaultError}:typeof o.data>"u"?{message:f??r??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:f??t??o.defaultError}},description:a}}class y{get description(){return this._def.description}_getType(e){return $(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:$(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new C,ctx:{common:e.parent.common,data:e.data,parsedType:$(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(X(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){const r={common:{issues:[],async:(t==null?void 0:t.async)??!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)},a=this._parseSync({data:e,path:r.path,parent:r});return Ne(r,a)}"~validate"(e){var r,a;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:t});return B(n)?{value:n.value}:{issues:t.common.issues}}catch(n){(a=(r=n==null?void 0:n.message)==null?void 0:r.toLowerCase())!=null&&a.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(n=>B(n)?{value:n.value}:{issues:t.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)},a=this._parse({data:e,path:r.path,parent:r}),n=await(X(a)?a:Promise.resolve(a));return Ne(r,n)}refine(e,t){const r=a=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(a):t;return this._refinement((a,n)=>{const i=e(a),o=()=>n.addIssue({code:d.custom,...r(a)});return typeof Promise<"u"&&i instanceof Promise?i.then(f=>f?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((r,a)=>e(r)?!0:(a.addIssue(typeof t=="function"?t(r,a):t),!1))}_refinement(e){return new L({schema:this,typeName:_.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return j.create(this,this._def)}nullable(){return D.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return N.create(this)}promise(){return ae.create(this,this._def)}or(e){return ee.create([this,e],this._def)}and(e){return te.create(this,e,this._def)}transform(e){return new L({...g(this._def),schema:this,typeName:_.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new ne({...g(this._def),innerType:this,defaultValue:t,typeName:_.ZodDefault})}brand(){return new ze({typeName:_.ZodBranded,type:this,...g(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new ie({...g(this._def),innerType:this,catchValue:t,typeName:_.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return be.create(this,e)}readonly(){return oe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const He=/^c[^\s-]{8,}$/i,Ge=/^[0-9a-z]+$/,Qe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Xe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Ke=/^[a-z0-9_-]{21}$/i,et=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,tt=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,st=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,rt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ue;const at=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,nt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,it=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ot=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,dt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ct=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,$e="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",ut=new RegExp(`^${$e}$`);function Pe(s){let e="[0-5]\\d";s.precision?e=`${e}\\.\\d{${s.precision}}`:s.precision==null&&(e=`${e}(\\.\\d+)?`);const t=s.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function lt(s){return new RegExp(`^${Pe(s)}$`)}function ht(s){let e=`${$e}T${Pe(s)}`;const t=[];return t.push(s.local?"Z?":"Z"),s.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function ft(s,e){return!!((e==="v4"||!e)&&at.test(s)||(e==="v6"||!e)&&it.test(s))}function pt(s,e){if(!et.test(s))return!1;try{const[t]=s.split(".");if(!t)return!1;const r=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),a=JSON.parse(atob(r));return!(typeof a!="object"||a===null||"typ"in a&&(a==null?void 0:a.typ)!=="JWT"||!a.alg||e&&a.alg!==e)}catch{return!1}}function mt(s,e){return!!((e==="v4"||!e)&&nt.test(s)||(e==="v6"||!e)&&ot.test(s))}class R extends y{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==u.string){const n=this._getOrReturnCtx(e);return c(n,{code:d.invalid_type,expected:u.string,received:n.parsedType}),m}const r=new C;let a;for(const n of this._def.checks)if(n.kind==="min")e.data.lengthn.value&&(a=this._getOrReturnCtx(e,a),c(a,{code:d.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty());else if(n.kind==="length"){const i=e.data.length>n.value,o=e.data.lengthe.test(a),{validation:t,code:d.invalid_string,...h.errToObj(r)})}_addCheck(e){return new R({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...h.errToObj(e)})}url(e){return this._addCheck({kind:"url",...h.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...h.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...h.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...h.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...h.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...h.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...h.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...h.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...h.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...h.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...h.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...h.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...h.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...h.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...h.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...h.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...h.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...h.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...h.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...h.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...h.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...h.errToObj(t)})}nonempty(e){return this.min(1,h.errToObj(e))}trim(){return new R({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new R({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new R({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew R({checks:[],typeName:_.ZodString,coerce:(s==null?void 0:s.coerce)??!1,...g(s)});function _t(s,e){const t=(s.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,a=t>r?t:r,n=Number.parseInt(s.toFixed(a).replace(".","")),i=Number.parseInt(e.toFixed(a).replace(".",""));return n%i/10**a}class q extends y{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==u.number){const n=this._getOrReturnCtx(e);return c(n,{code:d.invalid_type,expected:u.number,received:n.parsedType}),m}let r;const a=new C;for(const n of this._def.checks)n.kind==="int"?v.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),c(r,{code:d.invalid_type,expected:"integer",received:"float",message:n.message}),a.dirty()):n.kind==="min"?(n.inclusive?e.datan.value:e.data>=n.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),a.dirty()):n.kind==="multipleOf"?_t(e.data,n.value)!==0&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):n.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_finite,message:n.message}),a.dirty()):v.assertNever(n);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,r,a){return new q({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:h.toString(a)}]})}_addCheck(e){return new q({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:h.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:h.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:h.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:h.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuee.kind==="int"||e.kind==="multipleOf"&&v.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.valuenew q({checks:[],typeName:_.ZodNumber,coerce:(s==null?void 0:s.coerce)||!1,...g(s)});class Y extends y{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==u.bigint)return this._getInvalidInput(e);let r;const a=new C;for(const n of this._def.checks)n.kind==="min"?(n.inclusive?e.datan.value:e.data>=n.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),a.dirty()):n.kind==="multipleOf"?e.data%n.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):v.assertNever(n);return{status:a.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return c(t,{code:d.invalid_type,expected:u.bigint,received:t.parsedType}),m}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,r,a){return new Y({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:h.toString(a)}]})}_addCheck(e){return new Y({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew Y({checks:[],typeName:_.ZodBigInt,coerce:(s==null?void 0:s.coerce)??!1,...g(s)});class he extends y{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==u.boolean){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.boolean,received:r.parsedType}),m}return O(e.data)}}he.create=s=>new he({typeName:_.ZodBoolean,coerce:(s==null?void 0:s.coerce)||!1,...g(s)});class K extends y{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==u.date){const n=this._getOrReturnCtx(e);return c(n,{code:d.invalid_type,expected:u.date,received:n.parsedType}),m}if(Number.isNaN(e.data.getTime())){const n=this._getOrReturnCtx(e);return c(n,{code:d.invalid_date}),m}const r=new C;let a;for(const n of this._def.checks)n.kind==="min"?e.data.getTime()n.value&&(a=this._getOrReturnCtx(e,a),c(a,{code:d.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),r.dirty()):v.assertNever(n);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new K({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:h.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:h.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew K({checks:[],coerce:(s==null?void 0:s.coerce)||!1,typeName:_.ZodDate,...g(s)});class Ae extends y{_parse(e){if(this._getType(e)!==u.symbol){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.symbol,received:r.parsedType}),m}return O(e.data)}}Ae.create=s=>new Ae({typeName:_.ZodSymbol,...g(s)});class fe extends y{_parse(e){if(this._getType(e)!==u.undefined){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.undefined,received:r.parsedType}),m}return O(e.data)}}fe.create=s=>new fe({typeName:_.ZodUndefined,...g(s)});class pe extends y{_parse(e){if(this._getType(e)!==u.null){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.null,received:r.parsedType}),m}return O(e.data)}}pe.create=s=>new pe({typeName:_.ZodNull,...g(s)});class Ee extends y{constructor(){super(...arguments),this._any=!0}_parse(e){return O(e.data)}}Ee.create=s=>new Ee({typeName:_.ZodAny,...g(s)});class me extends y{constructor(){super(...arguments),this._unknown=!0}_parse(e){return O(e.data)}}me.create=s=>new me({typeName:_.ZodUnknown,...g(s)});class P extends y{_parse(e){const t=this._getOrReturnCtx(e);return c(t,{code:d.invalid_type,expected:u.never,received:t.parsedType}),m}}P.create=s=>new P({typeName:_.ZodNever,...g(s)});class Ze extends y{_parse(e){if(this._getType(e)!==u.undefined){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.void,received:r.parsedType}),m}return O(e.data)}}Ze.create=s=>new Ze({typeName:_.ZodVoid,...g(s)});class N extends y{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),a=this._def;if(t.parsedType!==u.array)return c(t,{code:d.invalid_type,expected:u.array,received:t.parsedType}),m;if(a.exactLength!==null){const i=t.data.length>a.exactLength.value,o=t.data.lengtha.maxLength.value&&(c(t,{code:d.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>a.type._parseAsync(new E(t,i,t.path,o)))).then(i=>C.mergeArray(r,i));const n=[...t.data].map((i,o)=>a.type._parseSync(new E(t,i,t.path,o)));return C.mergeArray(r,n)}get element(){return this._def.type}min(e,t){return new N({...this._def,minLength:{value:e,message:h.toString(t)}})}max(e,t){return new N({...this._def,maxLength:{value:e,message:h.toString(t)}})}length(e,t){return new N({...this._def,exactLength:{value:e,message:h.toString(t)}})}nonempty(e){return this.min(1,e)}}N.create=(s,e)=>new N({type:s,minLength:null,maxLength:null,exactLength:null,typeName:_.ZodArray,...g(e)});function U(s){if(s instanceof w){const e={};for(const t in s.shape){const r=s.shape[t];e[t]=j.create(U(r))}return new w({...s._def,shape:()=>e})}else return s instanceof N?new N({...s._def,type:U(s.element)}):s instanceof j?j.create(U(s.unwrap())):s instanceof D?D.create(U(s.unwrap())):s instanceof z?z.create(s.items.map(e=>U(e))):s}class w extends y{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=v.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==u.object){const p=this._getOrReturnCtx(e);return c(p,{code:d.invalid_type,expected:u.object,received:p.parsedType}),m}const{status:r,ctx:a}=this._processInputParams(e),{shape:n,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof P&&this._def.unknownKeys==="strip"))for(const p in a.data)i.includes(p)||o.push(p);const f=[];for(const p of i){const x=n[p],W=a.data[p];f.push({key:{status:"valid",value:p},value:x._parse(new E(a,W,a.path,p)),alwaysSet:p in a.data})}if(this._def.catchall instanceof P){const p=this._def.unknownKeys;if(p==="passthrough")for(const x of o)f.push({key:{status:"valid",value:x},value:{status:"valid",value:a.data[x]}});else if(p==="strict")o.length>0&&(c(a,{code:d.unrecognized_keys,keys:o}),r.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const p=this._def.catchall;for(const x of o){const W=a.data[x];f.push({key:{status:"valid",value:x},value:p._parse(new E(a,W,a.path,x)),alwaysSet:x in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const p=[];for(const x of f){const W=await x.key,qe=await x.value;p.push({key:W,value:qe,alwaysSet:x.alwaysSet})}return p}).then(p=>C.mergeObjectSync(r,p)):C.mergeObjectSync(r,f)}get shape(){return this._def.shape()}strict(e){return h.errToObj,new w({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var n,i;const a=((i=(n=this._def).errorMap)==null?void 0:i.call(n,t,r).message)??r.defaultError;return t.code==="unrecognized_keys"?{message:h.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new w({...this._def,unknownKeys:"strip"})}passthrough(){return new w({...this._def,unknownKeys:"passthrough"})}extend(e){return new w({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new w({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new w({...this._def,catchall:e})}pick(e){const t={};for(const r of v.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new w({...this._def,shape:()=>t})}omit(e){const t={};for(const r of v.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new w({...this._def,shape:()=>t})}deepPartial(){return U(this)}partial(e){const t={};for(const r of v.objectKeys(this.shape)){const a=this.shape[r];e&&!e[r]?t[r]=a:t[r]=a.optional()}return new w({...this._def,shape:()=>t})}required(e){const t={};for(const r of v.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let n=this.shape[r];for(;n instanceof j;)n=n._def.innerType;t[r]=n}return new w({...this._def,shape:()=>t})}keyof(){return Me(v.objectKeys(this.shape))}}w.create=(s,e)=>new w({shape:()=>s,unknownKeys:"strip",catchall:P.create(),typeName:_.ZodObject,...g(e)});w.strictCreate=(s,e)=>new w({shape:()=>s,unknownKeys:"strict",catchall:P.create(),typeName:_.ZodObject,...g(e)});w.lazycreate=(s,e)=>new w({shape:s,unknownKeys:"strip",catchall:P.create(),typeName:_.ZodObject,...g(e)});class ee extends y{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function a(n){for(const o of n)if(o.result.status==="valid")return o.result;for(const o of n)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=n.map(o=>new I(o.ctx.common.issues));return c(t,{code:d.invalid_union,unionErrors:i}),m}if(t.common.async)return Promise.all(r.map(async n=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await n._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(a);{let n;const i=[];for(const f of r){const p={...t,common:{...t.common,issues:[]},parent:null},x=f._parseSync({data:t.data,path:t.path,parent:p});if(x.status==="valid")return x;x.status==="dirty"&&!n&&(n={result:x,ctx:p}),p.common.issues.length&&i.push(p.common.issues)}if(n)return t.common.issues.push(...n.ctx.common.issues),n.result;const o=i.map(f=>new I(f));return c(t,{code:d.invalid_union,unionErrors:o}),m}}get options(){return this._def.options}}ee.create=(s,e)=>new ee({options:s,typeName:_.ZodUnion,...g(e)});const Z=s=>s instanceof ge?Z(s.schema):s instanceof L?Z(s.innerType()):s instanceof re?[s.value]:s instanceof V?s.options:s instanceof ye?v.objectValues(s.enum):s instanceof ne?Z(s._def.innerType):s instanceof fe?[void 0]:s instanceof pe?[null]:s instanceof j?[void 0,...Z(s.unwrap())]:s instanceof D?[null,...Z(s.unwrap())]:s instanceof ze||s instanceof oe?Z(s.unwrap()):s instanceof ie?Z(s._def.innerType):[];class ke extends y{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.object)return c(t,{code:d.invalid_type,expected:u.object,received:t.parsedType}),m;const r=this.discriminator,a=t.data[r],n=this.optionsMap.get(a);return n?t.common.async?n._parseAsync({data:t.data,path:t.path,parent:t}):n._parseSync({data:t.data,path:t.path,parent:t}):(c(t,{code:d.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),m)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const a=new Map;for(const n of t){const i=Z(n.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of i){if(a.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);a.set(o,n)}}return new ke({typeName:_.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a,...g(r)})}}function _e(s,e){const t=$(s),r=$(e);if(s===e)return{valid:!0,data:s};if(t===u.object&&r===u.object){const a=v.objectKeys(e),n=v.objectKeys(s).filter(o=>a.indexOf(o)!==-1),i={...s,...e};for(const o of n){const f=_e(s[o],e[o]);if(!f.valid)return{valid:!1};i[o]=f.data}return{valid:!0,data:i}}else if(t===u.array&&r===u.array){if(s.length!==e.length)return{valid:!1};const a=[];for(let n=0;n{if(Ce(n)||Ce(i))return m;const o=_e(n.value,i.value);return o.valid?((Oe(n)||Oe(i))&&t.dirty(),{status:t.value,value:o.data}):(c(r,{code:d.invalid_intersection_types}),m)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([n,i])=>a(n,i)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}te.create=(s,e,t)=>new te({left:s,right:e,typeName:_.ZodIntersection,...g(t)});class z extends y{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.array)return c(r,{code:d.invalid_type,expected:u.array,received:r.parsedType}),m;if(r.data.lengththis._def.items.length&&(c(r,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...r.data].map((i,o)=>{const f=this._def.items[o]||this._def.rest;return f?f._parse(new E(r,i,r.path,o)):null}).filter(i=>!!i);return r.common.async?Promise.all(n).then(i=>C.mergeArray(t,i)):C.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new z({...this._def,rest:e})}}z.create=(s,e)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new z({items:s,typeName:_.ZodTuple,rest:null,...g(e)})};class se extends y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.object)return c(r,{code:d.invalid_type,expected:u.object,received:r.parsedType}),m;const a=[],n=this._def.keyType,i=this._def.valueType;for(const o in r.data)a.push({key:n._parse(new E(r,o,r.path,o)),value:i._parse(new E(r,r.data[o],r.path,o)),alwaysSet:o in r.data});return r.common.async?C.mergeObjectAsync(t,a):C.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof y?new se({keyType:e,valueType:t,typeName:_.ZodRecord,...g(r)}):new se({keyType:R.create(),valueType:e,typeName:_.ZodRecord,...g(t)})}}class Re extends y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.map)return c(r,{code:d.invalid_type,expected:u.map,received:r.parsedType}),m;const a=this._def.keyType,n=this._def.valueType,i=[...r.data.entries()].map(([o,f],p)=>({key:a._parse(new E(r,o,r.path,[p,"key"])),value:n._parse(new E(r,f,r.path,[p,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const f of i){const p=await f.key,x=await f.value;if(p.status==="aborted"||x.status==="aborted")return m;(p.status==="dirty"||x.status==="dirty")&&t.dirty(),o.set(p.value,x.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const f of i){const p=f.key,x=f.value;if(p.status==="aborted"||x.status==="aborted")return m;(p.status==="dirty"||x.status==="dirty")&&t.dirty(),o.set(p.value,x.value)}return{status:t.value,value:o}}}}Re.create=(s,e,t)=>new Re({valueType:e,keyType:s,typeName:_.ZodMap,...g(t)});class H extends y{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.set)return c(r,{code:d.invalid_type,expected:u.set,received:r.parsedType}),m;const a=this._def;a.minSize!==null&&r.data.sizea.maxSize.value&&(c(r,{code:d.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const n=this._def.valueType;function i(f){const p=new Set;for(const x of f){if(x.status==="aborted")return m;x.status==="dirty"&&t.dirty(),p.add(x.value)}return{status:t.value,value:p}}const o=[...r.data.values()].map((f,p)=>n._parse(new E(r,f,r.path,p)));return r.common.async?Promise.all(o).then(f=>i(f)):i(o)}min(e,t){return new H({...this._def,minSize:{value:e,message:h.toString(t)}})}max(e,t){return new H({...this._def,maxSize:{value:e,message:h.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}H.create=(s,e)=>new H({valueType:s,minSize:null,maxSize:null,typeName:_.ZodSet,...g(e)});class ge extends y{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ge.create=(s,e)=>new ge({getter:s,typeName:_.ZodLazy,...g(e)});class re extends y{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return c(t,{received:t.data,code:d.invalid_literal,expected:this._def.value}),m}return{status:"valid",value:e.data}}get value(){return this._def.value}}re.create=(s,e)=>new re({value:s,typeName:_.ZodLiteral,...g(e)});function Me(s,e){return new V({values:s,typeName:_.ZodEnum,...g(e)})}class V extends y{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),r=this._def.values;return c(t,{expected:v.joinValues(r),received:t.parsedType,code:d.invalid_type}),m}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return c(t,{received:t.data,code:d.invalid_enum_value,options:r}),m}return O(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return V.create(e,{...this._def,...t})}exclude(e,t=this._def){return V.create(this.options.filter(r=>!e.includes(r)),{...this._def,...t})}}V.create=Me;class ye extends y{_parse(e){const t=v.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==u.string&&r.parsedType!==u.number){const a=v.objectValues(t);return c(r,{expected:v.joinValues(a),received:r.parsedType,code:d.invalid_type}),m}if(this._cache||(this._cache=new Set(v.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const a=v.objectValues(t);return c(r,{received:r.data,code:d.invalid_enum_value,options:a}),m}return O(e.data)}get enum(){return this._def.values}}ye.create=(s,e)=>new ye({values:s,typeName:_.ZodNativeEnum,...g(e)});class ae extends y{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.promise&&t.common.async===!1)return c(t,{code:d.invalid_type,expected:u.promise,received:t.parsedType}),m;const r=t.parsedType===u.promise?t.data:Promise.resolve(t.data);return O(r.then(a=>this._def.type.parseAsync(a,{path:t.path,errorMap:t.common.contextualErrorMap})))}}ae.create=(s,e)=>new ae({type:s,typeName:_.ZodPromise,...g(e)});class L extends y{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),a=this._def.effect||null,n={addIssue:i=>{c(r,i),i.fatal?t.abort():t.dirty()},get path(){return r.path}};if(n.addIssue=n.addIssue.bind(n),a.type==="preprocess"){const i=a.transform(r.data,n);if(r.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return m;const f=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return f.status==="aborted"?m:f.status==="dirty"||t.value==="dirty"?J(f.value):f});{if(t.value==="aborted")return m;const o=this._def.schema._parseSync({data:i,path:r.path,parent:r});return o.status==="aborted"?m:o.status==="dirty"||t.value==="dirty"?J(o.value):o}}if(a.type==="refinement"){const i=o=>{const f=a.refinement(o,n);if(r.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?m:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?m:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(a.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!B(i))return m;const o=a.transform(i.value,n);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>B(i)?Promise.resolve(a.transform(i.value,n)).then(o=>({status:t.value,value:o})):m);v.assertNever(a)}}L.create=(s,e,t)=>new L({schema:s,typeName:_.ZodEffects,effect:e,...g(t)});L.createWithPreprocess=(s,e,t)=>new L({schema:e,effect:{type:"preprocess",transform:s},typeName:_.ZodEffects,...g(t)});class j extends y{_parse(e){return this._getType(e)===u.undefined?O(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}j.create=(s,e)=>new j({innerType:s,typeName:_.ZodOptional,...g(e)});class D extends y{_parse(e){return this._getType(e)===u.null?O(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}D.create=(s,e)=>new D({innerType:s,typeName:_.ZodNullable,...g(e)});class ne extends y{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===u.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ne.create=(s,e)=>new ne({innerType:s,typeName:_.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...g(e)});class ie extends y{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return X(a)?a.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new I(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new I(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ie.create=(s,e)=>new ie({innerType:s,typeName:_.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...g(e)});class je extends y{_parse(e){if(this._getType(e)!==u.nan){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.nan,received:r.parsedType}),m}return{status:"valid",value:e.data}}}je.create=s=>new je({typeName:_.ZodNaN,...g(s)});class ze extends y{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class be extends y{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const n=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return n.status==="aborted"?m:n.status==="dirty"?(t.dirty(),J(n.value)):this._def.out._parseAsync({data:n.value,path:r.path,parent:r})})();{const a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?m:a.status==="dirty"?(t.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(e,t){return new be({in:e,out:t,typeName:_.ZodPipeline})}}class oe extends y{_parse(e){const t=this._def.innerType._parse(e),r=a=>(B(a)&&(a.value=Object.freeze(a.value)),a);return X(t)?t.then(a=>r(a)):r(t)}unwrap(){return this._def.innerType}}oe.create=(s,e)=>new oe({innerType:s,typeName:_.ZodReadonly,...g(e)});var _;(function(s){s.ZodString="ZodString",s.ZodNumber="ZodNumber",s.ZodNaN="ZodNaN",s.ZodBigInt="ZodBigInt",s.ZodBoolean="ZodBoolean",s.ZodDate="ZodDate",s.ZodSymbol="ZodSymbol",s.ZodUndefined="ZodUndefined",s.ZodNull="ZodNull",s.ZodAny="ZodAny",s.ZodUnknown="ZodUnknown",s.ZodNever="ZodNever",s.ZodVoid="ZodVoid",s.ZodArray="ZodArray",s.ZodObject="ZodObject",s.ZodUnion="ZodUnion",s.ZodDiscriminatedUnion="ZodDiscriminatedUnion",s.ZodIntersection="ZodIntersection",s.ZodTuple="ZodTuple",s.ZodRecord="ZodRecord",s.ZodMap="ZodMap",s.ZodSet="ZodSet",s.ZodFunction="ZodFunction",s.ZodLazy="ZodLazy",s.ZodLiteral="ZodLiteral",s.ZodEnum="ZodEnum",s.ZodEffects="ZodEffects",s.ZodNativeEnum="ZodNativeEnum",s.ZodOptional="ZodOptional",s.ZodNullable="ZodNullable",s.ZodDefault="ZodDefault",s.ZodCatch="ZodCatch",s.ZodPromise="ZodPromise",s.ZodBranded="ZodBranded",s.ZodPipeline="ZodPipeline",s.ZodReadonly="ZodReadonly"})(_||(_={}));const l=R.create,b=q.create,de=he.create,gt=me.create;P.create;const T=N.create,k=w.create,Ve=ee.create,Le=ke.create;te.create;z.create;const De=se.create,Q=re.create,ve=V.create;ae.create;j.create;D.create;const A=De(gt()),we=k({id:b(),name:l(),slug:l().optional()}).passthrough(),ce=k({url:l(),is_official:de()}),xe=k({task_id:b(),dataset_id:b(),model_name:l().nullish(),harness:l().nullish(),methodology:l().nullish(),metrics:De(Ve([l(),b()])),uses_additional_data:de().optional(),is_open:de().optional(),best_rank:b().nullish(),best_metric:l().nullish(),evaluated_on:l().nullish(),external_source_url:l().nullish(),num_parameters:b().nullish(),hf_model_url:l().nullish()}).passthrough(),yt=xe.partial().extend({id:b().optional()}),vt=Le("op",[k({op:Q("create"),data:xe}),k({op:Q("update"),evaluation_id:b(),data:xe}),k({op:Q("delete"),evaluation_id:b()})]),Ie=k({hf_models:T(l()),hf_datasets:T(l()),hf_spaces:T(l())}),Te=k({file_name:l(),mime_type:l(),data_url:l().optional(),url:l().optional()}),F=k({name:l(),description:l().optional()}),xt=F.extend({image:Te.optional(),image_credit:l().optional(),parent_id:b().optional(),area_id:b().optional(),keywords:l().optional()}),kt=F.extend({image:Te.optional(),image_credit:l().optional(),source_paper_id:b().optional(),source_url:l().optional(),source_title:l().optional()}),bt=Ve([k({benchmark:l(),task:l(),description:l()}),F.extend({description:l(),task_ids:T(b()),full_name:l().optional(),url:l().optional(),hf_url:l().optional(),paper_url:l().optional(),license_name:l().optional(),license_url:l().optional()})]),wt=F.extend({description:l(),direction:ve(["higher_is_better","lower_is_better"]),full_name:l().optional(),scale:l().optional(),task_id:b(),dataset_id:b()}),Tt=F.extend({short_name:l().optional(),venue:l().optional(),location:l().optional(),url:l(),year:b(),start_date:l().optional(),end_date:l().optional()}),St=F.extend({hf_slug:l().optional(),website_url:l().optional(),image:Te.optional()}),Ct=k({id:b(),paper_id:b().nullable(),hf_username:l(),hf_subject:l().nullish(),is_author:de(),status:ve(["pending","approved","rejected"]),applied_payload:A.nullish(),conflict_payload:A.nullish(),result_entity_type:l().nullish(),result_entity_id:l().nullish(),admin_note:l().nullish(),user_review_reason:l().nullish(),reviewed_by:l().nullish(),reviewed_by_kind:ve(["human","codex","auto"]).nullish(),catalog_event_id:l().nullish(),review_evidence:A.nullish(),created_at:l(),updated_at:l(),reviewed_at:l().nullish()});function S(s,e,t){return Ct.extend({edit_type:Q(s),proposed_payload:e,current_payload:t.nullish()})}const Ot=S("tasks",k({task_ids:T(b())}),k({tasks:T(we)})),Nt=S("methods",k({method_ids:T(b())}),k({methods:T(we)})),At=S("evaluations",k({operations:T(vt)}),k({evaluations:T(yt)})),Et=S("repositories",k({repositories:T(ce)}),k({repositories:T(ce)})),Zt=S("project_pages",k({project_pages:T(ce)}),k({project_pages:T(ce)})),Rt=S("source_url",k({source_url:l()}),k({source_url:l().nullish()})),jt=S("hf_artifacts",Ie,Ie),It=S("x_threads",k({x_threads:T(l())}),k({x_threads:T(k({url:l()}))})),$t=S("organizations",k({organization_ids:T(b())}),k({organizations:T(we)})),Pt=S("new_task",xt,A),Mt=S("new_method",kt,A),zt=S("new_benchmark",bt,A),Vt=S("new_metric",wt,A),Lt=S("new_conference",Tt,A),Dt=S("new_organization",St,A),Ut=S("new_external_paper",k({title:l().optional(),source_url:l(),authors:T(l()),date_published:l().optional(),abstract:l().optional()}),A),Ue=Le("edit_type",[Ot,Nt,At,Et,Zt,Rt,jt,It,$t,Pt,Mt,zt,Vt,Lt,Dt,Ut]);function Yt(s,e,t){return{paper_id:s,edit_type:e,proposed_payload:t}}const M=(s,e)=>({directory:{title:s,subtitle:e}}),Ht={tasks:{label:"tasks",administrative:!1},methods:{label:"methods",administrative:!1},evaluations:{label:"evaluations",administrative:!1},repositories:{label:"repositories",administrative:!1},project_pages:{label:"project pages",administrative:!1},source_url:{label:"source url",administrative:!1},x_threads:{label:"x threads",administrative:!1},hf_artifacts:{label:"hf artifacts",administrative:!1},organizations:{label:"organizations",administrative:!1},new_task:{label:"new task",administrative:!0,...M("New task","Task suggestion")},new_method:{label:"new method",administrative:!0,...M("New method","Method suggestion")},new_benchmark:{label:"new benchmark",administrative:!0,...M("New benchmark","Benchmark suggestion")},new_metric:{label:"new metric",administrative:!0,...M("New metric","Metric suggestion")},new_conference:{label:"new conference",administrative:!0,...M("New conference","Conference suggestion")},new_organization:{label:"new organization",administrative:!1,...M("New organization","Organization suggestion")},new_external_paper:{label:"external paper",administrative:!1,...M("External paper","External paper submission")}},Bt=k({count:b(),results:T(Ue)});class qt extends Error{constructor(e){super(`Malformed pending-edit payload: ${e}`),this.name="PendingEditPayloadError"}}function Be(s,e){const t=s.safeParse(e);if(t.success)return t.data;const r=t.error.issues[0];throw new qt(`${(r==null?void 0:r.path.join("."))||"response"}: ${(r==null?void 0:r.message)||"invalid value"}`)}const G=s=>Be(Ue,s),Ft=s=>Be(Bt,s);class Wt{constructor(e){this.request=e}async submit(e){return G(await this.request("/me/paper-edits",{method:"POST",body:JSON.stringify(e)}))}list(e){const t=new URLSearchParams;for(const[a,n]of Object.entries(e??{}))n!==void 0&&t.set(a,String(n));const r=t.toString();return this.request(`/admin/paper-edits${r?`?${r}`:""}`).then(Ft)}revertAutoApproved(e,t={}){return this.request(`/admin/submitters/${encodeURIComponent(e)}/revert-auto-approved`,{method:"POST",body:JSON.stringify(t)})}async get(e){return G(await this.request(`/admin/paper-edits/${e}`))}async approve(e,t={}){return G(await this.request(`/admin/paper-edits/${e}/approve`,{method:"POST",body:JSON.stringify(t)}))}async reject(e,t={}){return G(await this.request(`/admin/paper-edits/${e}/reject`,{method:"POST",body:JSON.stringify(t)}))}}const Gt=new Wt(Fe);export{Ht as E,Yt as p,Gt as s}; +import{ac as Fe}from"./index-CxhY4zQ1.js";var v;(function(s){s.assertEqual=a=>{};function e(a){}s.assertIs=e;function t(a){throw new Error}s.assertNever=t,s.arrayToEnum=a=>{const n={};for(const i of a)n[i]=i;return n},s.getValidEnumValues=a=>{const n=s.objectKeys(a).filter(o=>typeof a[a[o]]!="number"),i={};for(const o of n)i[o]=a[o];return s.objectValues(i)},s.objectValues=a=>s.objectKeys(a).map(function(n){return a[n]}),s.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const n=[];for(const i in a)Object.prototype.hasOwnProperty.call(a,i)&&n.push(i);return n},s.find=(a,n)=>{for(const i of a)if(n(i))return i},s.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function r(a,n=" | "){return a.map(i=>typeof i=="string"?`'${i}'`:i).join(n)}s.joinValues=r,s.jsonStringifyReplacer=(a,n)=>typeof n=="bigint"?n.toString():n})(v||(v={}));var Se;(function(s){s.mergeShapes=(e,t)=>({...e,...t})})(Se||(Se={}));const u=v.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),$=s=>{switch(typeof s){case"undefined":return u.undefined;case"string":return u.string;case"number":return Number.isNaN(s)?u.nan:u.number;case"boolean":return u.boolean;case"function":return u.function;case"bigint":return u.bigint;case"symbol":return u.symbol;case"object":return Array.isArray(s)?u.array:s===null?u.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?u.promise:typeof Map<"u"&&s instanceof Map?u.map:typeof Set<"u"&&s instanceof Set?u.set:typeof Date<"u"&&s instanceof Date?u.date:u.object;default:return u.unknown}},d=v.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class I extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(n){return n.message},r={_errors:[]},a=n=>{for(const i of n.issues)if(i.code==="invalid_union")i.unionErrors.map(a);else if(i.code==="invalid_return_type")a(i.returnTypeError);else if(i.code==="invalid_arguments")a(i.argumentsError);else if(i.path.length===0)r._errors.push(t(i));else{let o=r,f=0;for(;ft.message){const t={},r=[];for(const a of this.issues)if(a.path.length>0){const n=a.path[0];t[n]=t[n]||[],t[n].push(e(a))}else r.push(e(a));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}I.create=s=>new I(s);const le=(s,e)=>{let t;switch(s.code){case d.invalid_type:s.received===u.undefined?t="Required":t=`Expected ${s.expected}, received ${s.received}`;break;case d.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(s.expected,v.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:t=`Unrecognized key(s) in object: ${v.joinValues(s.keys,", ")}`;break;case d.invalid_union:t="Invalid input";break;case d.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${v.joinValues(s.options)}`;break;case d.invalid_enum_value:t=`Invalid enum value. Expected ${v.joinValues(s.options)}, received '${s.received}'`;break;case d.invalid_arguments:t="Invalid function arguments";break;case d.invalid_return_type:t="Invalid function return type";break;case d.invalid_date:t="Invalid date";break;case d.invalid_string:typeof s.validation=="object"?"includes"in s.validation?(t=`Invalid input: must include "${s.validation.includes}"`,typeof s.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${s.validation.position}`)):"startsWith"in s.validation?t=`Invalid input: must start with "${s.validation.startsWith}"`:"endsWith"in s.validation?t=`Invalid input: must end with "${s.validation.endsWith}"`:v.assertNever(s.validation):s.validation!=="regex"?t=`Invalid ${s.validation}`:t="Invalid";break;case d.too_small:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at least":"more than"} ${s.minimum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at least":"over"} ${s.minimum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="bigint"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(s.minimum))}`:t="Invalid input";break;case d.too_big:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at most":"less than"} ${s.maximum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at most":"under"} ${s.maximum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="bigint"?t=`BigInt must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly":s.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(s.maximum))}`:t="Invalid input";break;case d.custom:t="Invalid input";break;case d.invalid_intersection_types:t="Intersection results could not be merged";break;case d.not_multiple_of:t=`Number must be a multiple of ${s.multipleOf}`;break;case d.not_finite:t="Number must be finite";break;default:t=e.defaultError,v.assertNever(s)}return{message:t}};let We=le;function Je(){return We}const Ye=s=>{const{data:e,path:t,errorMaps:r,issueData:a}=s,n=[...t,...a.path||[]],i={...a,path:n};if(a.message!==void 0)return{...a,path:n,message:a.message};let o="";const f=r.filter(p=>!!p).slice().reverse();for(const p of f)o=p(i,{data:e,defaultError:o}).message;return{...a,path:n,message:o}};function c(s,e){const t=Je(),r=Ye({issueData:e,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,t,t===le?void 0:le].filter(a=>!!a)});s.common.issues.push(r)}class C{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const a of t){if(a.status==="aborted")return m;a.status==="dirty"&&e.dirty(),r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const a of t){const n=await a.key,i=await a.value;r.push({key:n,value:i})}return C.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const a of t){const{key:n,value:i}=a;if(n.status==="aborted"||i.status==="aborted")return m;n.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),n.value!=="__proto__"&&(typeof i.value<"u"||a.alwaysSet)&&(r[n.value]=i.value)}return{status:e.value,value:r}}}const m=Object.freeze({status:"aborted"}),J=s=>({status:"dirty",value:s}),O=s=>({status:"valid",value:s}),Ce=s=>s.status==="aborted",Oe=s=>s.status==="dirty",B=s=>s.status==="valid",X=s=>typeof Promise<"u"&&s instanceof Promise;var h;(function(s){s.errToObj=e=>typeof e=="string"?{message:e}:e||{},s.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(h||(h={}));class E{constructor(e,t,r,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Ne=(s,e)=>{if(B(e))return{success:!0,data:e.value};if(!s.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new I(s.common.issues);return this._error=t,this._error}}};function g(s){if(!s)return{};const{errorMap:e,invalid_type_error:t,required_error:r,description:a}=s;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(i,o)=>{const{message:f}=s;return i.code==="invalid_enum_value"?{message:f??o.defaultError}:typeof o.data>"u"?{message:f??r??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:f??t??o.defaultError}},description:a}}class y{get description(){return this._def.description}_getType(e){return $(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:$(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new C,ctx:{common:e.parent.common,data:e.data,parsedType:$(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(X(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){const r={common:{issues:[],async:(t==null?void 0:t.async)??!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)},a=this._parseSync({data:e,path:r.path,parent:r});return Ne(r,a)}"~validate"(e){var r,a;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:t});return B(n)?{value:n.value}:{issues:t.common.issues}}catch(n){(a=(r=n==null?void 0:n.message)==null?void 0:r.toLowerCase())!=null&&a.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(n=>B(n)?{value:n.value}:{issues:t.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)},a=this._parse({data:e,path:r.path,parent:r}),n=await(X(a)?a:Promise.resolve(a));return Ne(r,n)}refine(e,t){const r=a=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(a):t;return this._refinement((a,n)=>{const i=e(a),o=()=>n.addIssue({code:d.custom,...r(a)});return typeof Promise<"u"&&i instanceof Promise?i.then(f=>f?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((r,a)=>e(r)?!0:(a.addIssue(typeof t=="function"?t(r,a):t),!1))}_refinement(e){return new L({schema:this,typeName:_.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return j.create(this,this._def)}nullable(){return D.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return N.create(this)}promise(){return ae.create(this,this._def)}or(e){return ee.create([this,e],this._def)}and(e){return te.create(this,e,this._def)}transform(e){return new L({...g(this._def),schema:this,typeName:_.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new ne({...g(this._def),innerType:this,defaultValue:t,typeName:_.ZodDefault})}brand(){return new ze({typeName:_.ZodBranded,type:this,...g(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new ie({...g(this._def),innerType:this,catchValue:t,typeName:_.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return be.create(this,e)}readonly(){return oe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const He=/^c[^\s-]{8,}$/i,Ge=/^[0-9a-z]+$/,Qe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Xe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Ke=/^[a-z0-9_-]{21}$/i,et=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,tt=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,st=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,rt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ue;const at=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,nt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,it=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ot=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,dt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ct=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,$e="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",ut=new RegExp(`^${$e}$`);function Pe(s){let e="[0-5]\\d";s.precision?e=`${e}\\.\\d{${s.precision}}`:s.precision==null&&(e=`${e}(\\.\\d+)?`);const t=s.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function lt(s){return new RegExp(`^${Pe(s)}$`)}function ht(s){let e=`${$e}T${Pe(s)}`;const t=[];return t.push(s.local?"Z?":"Z"),s.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function ft(s,e){return!!((e==="v4"||!e)&&at.test(s)||(e==="v6"||!e)&&it.test(s))}function pt(s,e){if(!et.test(s))return!1;try{const[t]=s.split(".");if(!t)return!1;const r=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),a=JSON.parse(atob(r));return!(typeof a!="object"||a===null||"typ"in a&&(a==null?void 0:a.typ)!=="JWT"||!a.alg||e&&a.alg!==e)}catch{return!1}}function mt(s,e){return!!((e==="v4"||!e)&&nt.test(s)||(e==="v6"||!e)&&ot.test(s))}class R extends y{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==u.string){const n=this._getOrReturnCtx(e);return c(n,{code:d.invalid_type,expected:u.string,received:n.parsedType}),m}const r=new C;let a;for(const n of this._def.checks)if(n.kind==="min")e.data.lengthn.value&&(a=this._getOrReturnCtx(e,a),c(a,{code:d.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty());else if(n.kind==="length"){const i=e.data.length>n.value,o=e.data.lengthe.test(a),{validation:t,code:d.invalid_string,...h.errToObj(r)})}_addCheck(e){return new R({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...h.errToObj(e)})}url(e){return this._addCheck({kind:"url",...h.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...h.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...h.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...h.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...h.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...h.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...h.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...h.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...h.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...h.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...h.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...h.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...h.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...h.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...h.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...h.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...h.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...h.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...h.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...h.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...h.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...h.errToObj(t)})}nonempty(e){return this.min(1,h.errToObj(e))}trim(){return new R({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new R({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new R({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew R({checks:[],typeName:_.ZodString,coerce:(s==null?void 0:s.coerce)??!1,...g(s)});function _t(s,e){const t=(s.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,a=t>r?t:r,n=Number.parseInt(s.toFixed(a).replace(".","")),i=Number.parseInt(e.toFixed(a).replace(".",""));return n%i/10**a}class q extends y{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==u.number){const n=this._getOrReturnCtx(e);return c(n,{code:d.invalid_type,expected:u.number,received:n.parsedType}),m}let r;const a=new C;for(const n of this._def.checks)n.kind==="int"?v.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),c(r,{code:d.invalid_type,expected:"integer",received:"float",message:n.message}),a.dirty()):n.kind==="min"?(n.inclusive?e.datan.value:e.data>=n.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),a.dirty()):n.kind==="multipleOf"?_t(e.data,n.value)!==0&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):n.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_finite,message:n.message}),a.dirty()):v.assertNever(n);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,r,a){return new q({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:h.toString(a)}]})}_addCheck(e){return new q({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:h.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:h.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:h.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:h.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuee.kind==="int"||e.kind==="multipleOf"&&v.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.valuenew q({checks:[],typeName:_.ZodNumber,coerce:(s==null?void 0:s.coerce)||!1,...g(s)});class Y extends y{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==u.bigint)return this._getInvalidInput(e);let r;const a=new C;for(const n of this._def.checks)n.kind==="min"?(n.inclusive?e.datan.value:e.data>=n.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),a.dirty()):n.kind==="multipleOf"?e.data%n.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):v.assertNever(n);return{status:a.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return c(t,{code:d.invalid_type,expected:u.bigint,received:t.parsedType}),m}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,r,a){return new Y({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:h.toString(a)}]})}_addCheck(e){return new Y({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew Y({checks:[],typeName:_.ZodBigInt,coerce:(s==null?void 0:s.coerce)??!1,...g(s)});class he extends y{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==u.boolean){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.boolean,received:r.parsedType}),m}return O(e.data)}}he.create=s=>new he({typeName:_.ZodBoolean,coerce:(s==null?void 0:s.coerce)||!1,...g(s)});class K extends y{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==u.date){const n=this._getOrReturnCtx(e);return c(n,{code:d.invalid_type,expected:u.date,received:n.parsedType}),m}if(Number.isNaN(e.data.getTime())){const n=this._getOrReturnCtx(e);return c(n,{code:d.invalid_date}),m}const r=new C;let a;for(const n of this._def.checks)n.kind==="min"?e.data.getTime()n.value&&(a=this._getOrReturnCtx(e,a),c(a,{code:d.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),r.dirty()):v.assertNever(n);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new K({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:h.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:h.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew K({checks:[],coerce:(s==null?void 0:s.coerce)||!1,typeName:_.ZodDate,...g(s)});class Ae extends y{_parse(e){if(this._getType(e)!==u.symbol){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.symbol,received:r.parsedType}),m}return O(e.data)}}Ae.create=s=>new Ae({typeName:_.ZodSymbol,...g(s)});class fe extends y{_parse(e){if(this._getType(e)!==u.undefined){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.undefined,received:r.parsedType}),m}return O(e.data)}}fe.create=s=>new fe({typeName:_.ZodUndefined,...g(s)});class pe extends y{_parse(e){if(this._getType(e)!==u.null){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.null,received:r.parsedType}),m}return O(e.data)}}pe.create=s=>new pe({typeName:_.ZodNull,...g(s)});class Ee extends y{constructor(){super(...arguments),this._any=!0}_parse(e){return O(e.data)}}Ee.create=s=>new Ee({typeName:_.ZodAny,...g(s)});class me extends y{constructor(){super(...arguments),this._unknown=!0}_parse(e){return O(e.data)}}me.create=s=>new me({typeName:_.ZodUnknown,...g(s)});class P extends y{_parse(e){const t=this._getOrReturnCtx(e);return c(t,{code:d.invalid_type,expected:u.never,received:t.parsedType}),m}}P.create=s=>new P({typeName:_.ZodNever,...g(s)});class Ze extends y{_parse(e){if(this._getType(e)!==u.undefined){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.void,received:r.parsedType}),m}return O(e.data)}}Ze.create=s=>new Ze({typeName:_.ZodVoid,...g(s)});class N extends y{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),a=this._def;if(t.parsedType!==u.array)return c(t,{code:d.invalid_type,expected:u.array,received:t.parsedType}),m;if(a.exactLength!==null){const i=t.data.length>a.exactLength.value,o=t.data.lengtha.maxLength.value&&(c(t,{code:d.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>a.type._parseAsync(new E(t,i,t.path,o)))).then(i=>C.mergeArray(r,i));const n=[...t.data].map((i,o)=>a.type._parseSync(new E(t,i,t.path,o)));return C.mergeArray(r,n)}get element(){return this._def.type}min(e,t){return new N({...this._def,minLength:{value:e,message:h.toString(t)}})}max(e,t){return new N({...this._def,maxLength:{value:e,message:h.toString(t)}})}length(e,t){return new N({...this._def,exactLength:{value:e,message:h.toString(t)}})}nonempty(e){return this.min(1,e)}}N.create=(s,e)=>new N({type:s,minLength:null,maxLength:null,exactLength:null,typeName:_.ZodArray,...g(e)});function U(s){if(s instanceof w){const e={};for(const t in s.shape){const r=s.shape[t];e[t]=j.create(U(r))}return new w({...s._def,shape:()=>e})}else return s instanceof N?new N({...s._def,type:U(s.element)}):s instanceof j?j.create(U(s.unwrap())):s instanceof D?D.create(U(s.unwrap())):s instanceof z?z.create(s.items.map(e=>U(e))):s}class w extends y{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=v.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==u.object){const p=this._getOrReturnCtx(e);return c(p,{code:d.invalid_type,expected:u.object,received:p.parsedType}),m}const{status:r,ctx:a}=this._processInputParams(e),{shape:n,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof P&&this._def.unknownKeys==="strip"))for(const p in a.data)i.includes(p)||o.push(p);const f=[];for(const p of i){const x=n[p],W=a.data[p];f.push({key:{status:"valid",value:p},value:x._parse(new E(a,W,a.path,p)),alwaysSet:p in a.data})}if(this._def.catchall instanceof P){const p=this._def.unknownKeys;if(p==="passthrough")for(const x of o)f.push({key:{status:"valid",value:x},value:{status:"valid",value:a.data[x]}});else if(p==="strict")o.length>0&&(c(a,{code:d.unrecognized_keys,keys:o}),r.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const p=this._def.catchall;for(const x of o){const W=a.data[x];f.push({key:{status:"valid",value:x},value:p._parse(new E(a,W,a.path,x)),alwaysSet:x in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const p=[];for(const x of f){const W=await x.key,qe=await x.value;p.push({key:W,value:qe,alwaysSet:x.alwaysSet})}return p}).then(p=>C.mergeObjectSync(r,p)):C.mergeObjectSync(r,f)}get shape(){return this._def.shape()}strict(e){return h.errToObj,new w({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var n,i;const a=((i=(n=this._def).errorMap)==null?void 0:i.call(n,t,r).message)??r.defaultError;return t.code==="unrecognized_keys"?{message:h.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new w({...this._def,unknownKeys:"strip"})}passthrough(){return new w({...this._def,unknownKeys:"passthrough"})}extend(e){return new w({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new w({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new w({...this._def,catchall:e})}pick(e){const t={};for(const r of v.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new w({...this._def,shape:()=>t})}omit(e){const t={};for(const r of v.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new w({...this._def,shape:()=>t})}deepPartial(){return U(this)}partial(e){const t={};for(const r of v.objectKeys(this.shape)){const a=this.shape[r];e&&!e[r]?t[r]=a:t[r]=a.optional()}return new w({...this._def,shape:()=>t})}required(e){const t={};for(const r of v.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let n=this.shape[r];for(;n instanceof j;)n=n._def.innerType;t[r]=n}return new w({...this._def,shape:()=>t})}keyof(){return Me(v.objectKeys(this.shape))}}w.create=(s,e)=>new w({shape:()=>s,unknownKeys:"strip",catchall:P.create(),typeName:_.ZodObject,...g(e)});w.strictCreate=(s,e)=>new w({shape:()=>s,unknownKeys:"strict",catchall:P.create(),typeName:_.ZodObject,...g(e)});w.lazycreate=(s,e)=>new w({shape:s,unknownKeys:"strip",catchall:P.create(),typeName:_.ZodObject,...g(e)});class ee extends y{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function a(n){for(const o of n)if(o.result.status==="valid")return o.result;for(const o of n)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=n.map(o=>new I(o.ctx.common.issues));return c(t,{code:d.invalid_union,unionErrors:i}),m}if(t.common.async)return Promise.all(r.map(async n=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await n._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(a);{let n;const i=[];for(const f of r){const p={...t,common:{...t.common,issues:[]},parent:null},x=f._parseSync({data:t.data,path:t.path,parent:p});if(x.status==="valid")return x;x.status==="dirty"&&!n&&(n={result:x,ctx:p}),p.common.issues.length&&i.push(p.common.issues)}if(n)return t.common.issues.push(...n.ctx.common.issues),n.result;const o=i.map(f=>new I(f));return c(t,{code:d.invalid_union,unionErrors:o}),m}}get options(){return this._def.options}}ee.create=(s,e)=>new ee({options:s,typeName:_.ZodUnion,...g(e)});const Z=s=>s instanceof ge?Z(s.schema):s instanceof L?Z(s.innerType()):s instanceof re?[s.value]:s instanceof V?s.options:s instanceof ye?v.objectValues(s.enum):s instanceof ne?Z(s._def.innerType):s instanceof fe?[void 0]:s instanceof pe?[null]:s instanceof j?[void 0,...Z(s.unwrap())]:s instanceof D?[null,...Z(s.unwrap())]:s instanceof ze||s instanceof oe?Z(s.unwrap()):s instanceof ie?Z(s._def.innerType):[];class ke extends y{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.object)return c(t,{code:d.invalid_type,expected:u.object,received:t.parsedType}),m;const r=this.discriminator,a=t.data[r],n=this.optionsMap.get(a);return n?t.common.async?n._parseAsync({data:t.data,path:t.path,parent:t}):n._parseSync({data:t.data,path:t.path,parent:t}):(c(t,{code:d.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),m)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const a=new Map;for(const n of t){const i=Z(n.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of i){if(a.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);a.set(o,n)}}return new ke({typeName:_.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a,...g(r)})}}function _e(s,e){const t=$(s),r=$(e);if(s===e)return{valid:!0,data:s};if(t===u.object&&r===u.object){const a=v.objectKeys(e),n=v.objectKeys(s).filter(o=>a.indexOf(o)!==-1),i={...s,...e};for(const o of n){const f=_e(s[o],e[o]);if(!f.valid)return{valid:!1};i[o]=f.data}return{valid:!0,data:i}}else if(t===u.array&&r===u.array){if(s.length!==e.length)return{valid:!1};const a=[];for(let n=0;n{if(Ce(n)||Ce(i))return m;const o=_e(n.value,i.value);return o.valid?((Oe(n)||Oe(i))&&t.dirty(),{status:t.value,value:o.data}):(c(r,{code:d.invalid_intersection_types}),m)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([n,i])=>a(n,i)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}te.create=(s,e,t)=>new te({left:s,right:e,typeName:_.ZodIntersection,...g(t)});class z extends y{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.array)return c(r,{code:d.invalid_type,expected:u.array,received:r.parsedType}),m;if(r.data.lengththis._def.items.length&&(c(r,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...r.data].map((i,o)=>{const f=this._def.items[o]||this._def.rest;return f?f._parse(new E(r,i,r.path,o)):null}).filter(i=>!!i);return r.common.async?Promise.all(n).then(i=>C.mergeArray(t,i)):C.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new z({...this._def,rest:e})}}z.create=(s,e)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new z({items:s,typeName:_.ZodTuple,rest:null,...g(e)})};class se extends y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.object)return c(r,{code:d.invalid_type,expected:u.object,received:r.parsedType}),m;const a=[],n=this._def.keyType,i=this._def.valueType;for(const o in r.data)a.push({key:n._parse(new E(r,o,r.path,o)),value:i._parse(new E(r,r.data[o],r.path,o)),alwaysSet:o in r.data});return r.common.async?C.mergeObjectAsync(t,a):C.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof y?new se({keyType:e,valueType:t,typeName:_.ZodRecord,...g(r)}):new se({keyType:R.create(),valueType:e,typeName:_.ZodRecord,...g(t)})}}class Re extends y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.map)return c(r,{code:d.invalid_type,expected:u.map,received:r.parsedType}),m;const a=this._def.keyType,n=this._def.valueType,i=[...r.data.entries()].map(([o,f],p)=>({key:a._parse(new E(r,o,r.path,[p,"key"])),value:n._parse(new E(r,f,r.path,[p,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const f of i){const p=await f.key,x=await f.value;if(p.status==="aborted"||x.status==="aborted")return m;(p.status==="dirty"||x.status==="dirty")&&t.dirty(),o.set(p.value,x.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const f of i){const p=f.key,x=f.value;if(p.status==="aborted"||x.status==="aborted")return m;(p.status==="dirty"||x.status==="dirty")&&t.dirty(),o.set(p.value,x.value)}return{status:t.value,value:o}}}}Re.create=(s,e,t)=>new Re({valueType:e,keyType:s,typeName:_.ZodMap,...g(t)});class H extends y{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.set)return c(r,{code:d.invalid_type,expected:u.set,received:r.parsedType}),m;const a=this._def;a.minSize!==null&&r.data.sizea.maxSize.value&&(c(r,{code:d.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const n=this._def.valueType;function i(f){const p=new Set;for(const x of f){if(x.status==="aborted")return m;x.status==="dirty"&&t.dirty(),p.add(x.value)}return{status:t.value,value:p}}const o=[...r.data.values()].map((f,p)=>n._parse(new E(r,f,r.path,p)));return r.common.async?Promise.all(o).then(f=>i(f)):i(o)}min(e,t){return new H({...this._def,minSize:{value:e,message:h.toString(t)}})}max(e,t){return new H({...this._def,maxSize:{value:e,message:h.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}H.create=(s,e)=>new H({valueType:s,minSize:null,maxSize:null,typeName:_.ZodSet,...g(e)});class ge extends y{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ge.create=(s,e)=>new ge({getter:s,typeName:_.ZodLazy,...g(e)});class re extends y{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return c(t,{received:t.data,code:d.invalid_literal,expected:this._def.value}),m}return{status:"valid",value:e.data}}get value(){return this._def.value}}re.create=(s,e)=>new re({value:s,typeName:_.ZodLiteral,...g(e)});function Me(s,e){return new V({values:s,typeName:_.ZodEnum,...g(e)})}class V extends y{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),r=this._def.values;return c(t,{expected:v.joinValues(r),received:t.parsedType,code:d.invalid_type}),m}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return c(t,{received:t.data,code:d.invalid_enum_value,options:r}),m}return O(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return V.create(e,{...this._def,...t})}exclude(e,t=this._def){return V.create(this.options.filter(r=>!e.includes(r)),{...this._def,...t})}}V.create=Me;class ye extends y{_parse(e){const t=v.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==u.string&&r.parsedType!==u.number){const a=v.objectValues(t);return c(r,{expected:v.joinValues(a),received:r.parsedType,code:d.invalid_type}),m}if(this._cache||(this._cache=new Set(v.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const a=v.objectValues(t);return c(r,{received:r.data,code:d.invalid_enum_value,options:a}),m}return O(e.data)}get enum(){return this._def.values}}ye.create=(s,e)=>new ye({values:s,typeName:_.ZodNativeEnum,...g(e)});class ae extends y{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.promise&&t.common.async===!1)return c(t,{code:d.invalid_type,expected:u.promise,received:t.parsedType}),m;const r=t.parsedType===u.promise?t.data:Promise.resolve(t.data);return O(r.then(a=>this._def.type.parseAsync(a,{path:t.path,errorMap:t.common.contextualErrorMap})))}}ae.create=(s,e)=>new ae({type:s,typeName:_.ZodPromise,...g(e)});class L extends y{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),a=this._def.effect||null,n={addIssue:i=>{c(r,i),i.fatal?t.abort():t.dirty()},get path(){return r.path}};if(n.addIssue=n.addIssue.bind(n),a.type==="preprocess"){const i=a.transform(r.data,n);if(r.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return m;const f=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return f.status==="aborted"?m:f.status==="dirty"||t.value==="dirty"?J(f.value):f});{if(t.value==="aborted")return m;const o=this._def.schema._parseSync({data:i,path:r.path,parent:r});return o.status==="aborted"?m:o.status==="dirty"||t.value==="dirty"?J(o.value):o}}if(a.type==="refinement"){const i=o=>{const f=a.refinement(o,n);if(r.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?m:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?m:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(a.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!B(i))return m;const o=a.transform(i.value,n);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>B(i)?Promise.resolve(a.transform(i.value,n)).then(o=>({status:t.value,value:o})):m);v.assertNever(a)}}L.create=(s,e,t)=>new L({schema:s,typeName:_.ZodEffects,effect:e,...g(t)});L.createWithPreprocess=(s,e,t)=>new L({schema:e,effect:{type:"preprocess",transform:s},typeName:_.ZodEffects,...g(t)});class j extends y{_parse(e){return this._getType(e)===u.undefined?O(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}j.create=(s,e)=>new j({innerType:s,typeName:_.ZodOptional,...g(e)});class D extends y{_parse(e){return this._getType(e)===u.null?O(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}D.create=(s,e)=>new D({innerType:s,typeName:_.ZodNullable,...g(e)});class ne extends y{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===u.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ne.create=(s,e)=>new ne({innerType:s,typeName:_.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...g(e)});class ie extends y{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return X(a)?a.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new I(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new I(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ie.create=(s,e)=>new ie({innerType:s,typeName:_.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...g(e)});class je extends y{_parse(e){if(this._getType(e)!==u.nan){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.nan,received:r.parsedType}),m}return{status:"valid",value:e.data}}}je.create=s=>new je({typeName:_.ZodNaN,...g(s)});class ze extends y{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class be extends y{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const n=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return n.status==="aborted"?m:n.status==="dirty"?(t.dirty(),J(n.value)):this._def.out._parseAsync({data:n.value,path:r.path,parent:r})})();{const a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?m:a.status==="dirty"?(t.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(e,t){return new be({in:e,out:t,typeName:_.ZodPipeline})}}class oe extends y{_parse(e){const t=this._def.innerType._parse(e),r=a=>(B(a)&&(a.value=Object.freeze(a.value)),a);return X(t)?t.then(a=>r(a)):r(t)}unwrap(){return this._def.innerType}}oe.create=(s,e)=>new oe({innerType:s,typeName:_.ZodReadonly,...g(e)});var _;(function(s){s.ZodString="ZodString",s.ZodNumber="ZodNumber",s.ZodNaN="ZodNaN",s.ZodBigInt="ZodBigInt",s.ZodBoolean="ZodBoolean",s.ZodDate="ZodDate",s.ZodSymbol="ZodSymbol",s.ZodUndefined="ZodUndefined",s.ZodNull="ZodNull",s.ZodAny="ZodAny",s.ZodUnknown="ZodUnknown",s.ZodNever="ZodNever",s.ZodVoid="ZodVoid",s.ZodArray="ZodArray",s.ZodObject="ZodObject",s.ZodUnion="ZodUnion",s.ZodDiscriminatedUnion="ZodDiscriminatedUnion",s.ZodIntersection="ZodIntersection",s.ZodTuple="ZodTuple",s.ZodRecord="ZodRecord",s.ZodMap="ZodMap",s.ZodSet="ZodSet",s.ZodFunction="ZodFunction",s.ZodLazy="ZodLazy",s.ZodLiteral="ZodLiteral",s.ZodEnum="ZodEnum",s.ZodEffects="ZodEffects",s.ZodNativeEnum="ZodNativeEnum",s.ZodOptional="ZodOptional",s.ZodNullable="ZodNullable",s.ZodDefault="ZodDefault",s.ZodCatch="ZodCatch",s.ZodPromise="ZodPromise",s.ZodBranded="ZodBranded",s.ZodPipeline="ZodPipeline",s.ZodReadonly="ZodReadonly"})(_||(_={}));const l=R.create,b=q.create,de=he.create,gt=me.create;P.create;const T=N.create,k=w.create,Ve=ee.create,Le=ke.create;te.create;z.create;const De=se.create,Q=re.create,ve=V.create;ae.create;j.create;D.create;const A=De(gt()),we=k({id:b(),name:l(),slug:l().optional()}).passthrough(),ce=k({url:l(),is_official:de()}),xe=k({task_id:b(),dataset_id:b(),model_name:l().nullish(),harness:l().nullish(),methodology:l().nullish(),metrics:De(Ve([l(),b()])),uses_additional_data:de().optional(),is_open:de().optional(),best_rank:b().nullish(),best_metric:l().nullish(),evaluated_on:l().nullish(),external_source_url:l().nullish(),num_parameters:b().nullish(),hf_model_url:l().nullish()}).passthrough(),yt=xe.partial().extend({id:b().optional()}),vt=Le("op",[k({op:Q("create"),data:xe}),k({op:Q("update"),evaluation_id:b(),data:xe}),k({op:Q("delete"),evaluation_id:b()})]),Ie=k({hf_models:T(l()),hf_datasets:T(l()),hf_spaces:T(l())}),Te=k({file_name:l(),mime_type:l(),data_url:l().optional(),url:l().optional()}),F=k({name:l(),description:l().optional()}),xt=F.extend({image:Te.optional(),image_credit:l().optional(),parent_id:b().optional(),area_id:b().optional(),keywords:l().optional()}),kt=F.extend({image:Te.optional(),image_credit:l().optional(),source_paper_id:b().optional(),source_url:l().optional(),source_title:l().optional()}),bt=Ve([k({benchmark:l(),task:l(),description:l()}),F.extend({description:l(),task_ids:T(b()),full_name:l().optional(),url:l().optional(),hf_url:l().optional(),paper_url:l().optional(),license_name:l().optional(),license_url:l().optional()})]),wt=F.extend({description:l(),direction:ve(["higher_is_better","lower_is_better"]),full_name:l().optional(),scale:l().optional(),task_id:b(),dataset_id:b()}),Tt=F.extend({short_name:l().optional(),venue:l().optional(),location:l().optional(),url:l(),year:b(),start_date:l().optional(),end_date:l().optional()}),St=F.extend({hf_slug:l().optional(),website_url:l().optional(),image:Te.optional()}),Ct=k({id:b(),paper_id:b().nullable(),hf_username:l(),hf_subject:l().nullish(),is_author:de(),status:ve(["pending","approved","rejected"]),applied_payload:A.nullish(),conflict_payload:A.nullish(),result_entity_type:l().nullish(),result_entity_id:l().nullish(),admin_note:l().nullish(),user_review_reason:l().nullish(),reviewed_by:l().nullish(),reviewed_by_kind:ve(["human","codex","auto"]).nullish(),catalog_event_id:l().nullish(),review_evidence:A.nullish(),created_at:l(),updated_at:l(),reviewed_at:l().nullish()});function S(s,e,t){return Ct.extend({edit_type:Q(s),proposed_payload:e,current_payload:t.nullish()})}const Ot=S("tasks",k({task_ids:T(b())}),k({tasks:T(we)})),Nt=S("methods",k({method_ids:T(b())}),k({methods:T(we)})),At=S("evaluations",k({operations:T(vt)}),k({evaluations:T(yt)})),Et=S("repositories",k({repositories:T(ce)}),k({repositories:T(ce)})),Zt=S("project_pages",k({project_pages:T(ce)}),k({project_pages:T(ce)})),Rt=S("source_url",k({source_url:l()}),k({source_url:l().nullish()})),jt=S("hf_artifacts",Ie,Ie),It=S("x_threads",k({x_threads:T(l())}),k({x_threads:T(k({url:l()}))})),$t=S("organizations",k({organization_ids:T(b())}),k({organizations:T(we)})),Pt=S("new_task",xt,A),Mt=S("new_method",kt,A),zt=S("new_benchmark",bt,A),Vt=S("new_metric",wt,A),Lt=S("new_conference",Tt,A),Dt=S("new_organization",St,A),Ut=S("new_external_paper",k({title:l().optional(),source_url:l(),authors:T(l()),date_published:l().optional(),abstract:l().optional()}),A),Ue=Le("edit_type",[Ot,Nt,At,Et,Zt,Rt,jt,It,$t,Pt,Mt,zt,Vt,Lt,Dt,Ut]);function Yt(s,e,t){return{paper_id:s,edit_type:e,proposed_payload:t}}const M=(s,e)=>({directory:{title:s,subtitle:e}}),Ht={tasks:{label:"tasks",administrative:!1},methods:{label:"methods",administrative:!1},evaluations:{label:"evaluations",administrative:!1},repositories:{label:"repositories",administrative:!1},project_pages:{label:"project pages",administrative:!1},source_url:{label:"source url",administrative:!1},x_threads:{label:"x threads",administrative:!1},hf_artifacts:{label:"hf artifacts",administrative:!1},organizations:{label:"organizations",administrative:!1},new_task:{label:"new task",administrative:!0,...M("New task","Task suggestion")},new_method:{label:"new method",administrative:!0,...M("New method","Method suggestion")},new_benchmark:{label:"new benchmark",administrative:!0,...M("New benchmark","Benchmark suggestion")},new_metric:{label:"new metric",administrative:!0,...M("New metric","Metric suggestion")},new_conference:{label:"new conference",administrative:!0,...M("New conference","Conference suggestion")},new_organization:{label:"new organization",administrative:!1,...M("New organization","Organization suggestion")},new_external_paper:{label:"external paper",administrative:!1,...M("External paper","External paper submission")}},Bt=k({count:b(),results:T(Ue)});class qt extends Error{constructor(e){super(`Malformed pending-edit payload: ${e}`),this.name="PendingEditPayloadError"}}function Be(s,e){const t=s.safeParse(e);if(t.success)return t.data;const r=t.error.issues[0];throw new qt(`${(r==null?void 0:r.path.join("."))||"response"}: ${(r==null?void 0:r.message)||"invalid value"}`)}const G=s=>Be(Ue,s),Ft=s=>Be(Bt,s);class Wt{constructor(e){this.request=e}async submit(e){return G(await this.request("/me/paper-edits",{method:"POST",body:JSON.stringify(e)}))}list(e){const t=new URLSearchParams;for(const[a,n]of Object.entries(e??{}))n!==void 0&&t.set(a,String(n));const r=t.toString();return this.request(`/admin/paper-edits${r?`?${r}`:""}`).then(Ft)}revertAutoApproved(e,t={}){return this.request(`/admin/submitters/${encodeURIComponent(e)}/revert-auto-approved`,{method:"POST",body:JSON.stringify(t)})}async get(e){return G(await this.request(`/admin/paper-edits/${e}`))}async approve(e,t={}){return G(await this.request(`/admin/paper-edits/${e}/approve`,{method:"POST",body:JSON.stringify(t)}))}async reject(e,t={}){return G(await this.request(`/admin/paper-edits/${e}/reject`,{method:"POST",body:JSON.stringify(t)}))}}const Gt=new Wt(Fe);export{Ht as E,Yt as p,Gt as s}; diff --git a/assets/switch-B40zv53e.js b/assets/switch-COruZUxK.js similarity index 94% rename from assets/switch-B40zv53e.js rename to assets/switch-COruZUxK.js index dbf727c7179f2378d02c1956dad65ba8414c4483..2aa9fb596ac3b2b7deab506c3316528d06eb3d6f 100644 --- a/assets/switch-B40zv53e.js +++ b/assets/switch-COruZUxK.js @@ -1 +1 @@ -import{f as s,D as C,B as T,j as a,z as y,E as M,F as H,G as z,I as x}from"./index-3CfcAX6N.js";import{u as A}from"./index-Caztwwvv.js";var b="Switch",[U]=z(b),[q,D]=U(b),E=s.forwardRef((t,o)=>{const{__scopeSwitch:e,name:n,checked:r,defaultChecked:m,required:d,disabled:c,value:u="on",onCheckedChange:v,form:i,...w}=t,[l,p]=s.useState(null),S=C(o,h=>p(h)),k=s.useRef(!1),g=l?i||!!l.closest("form"):!0,[f,B]=T({prop:r,defaultProp:m??!1,onChange:v,caller:b});return a.jsxs(q,{scope:e,checked:f,disabled:c,children:[a.jsx(y.button,{type:"button",role:"switch","aria-checked":f,"aria-required":d,"data-state":j(f),"data-disabled":c?"":void 0,disabled:c,value:u,...w,ref:S,onClick:M(t.onClick,h=>{B(I=>!I),g&&(k.current=h.isPropagationStopped(),k.current||h.stopPropagation())})}),g&&a.jsx(N,{control:l,bubbles:!k.current,name:n,value:u,checked:f,required:d,disabled:c,form:i,style:{transform:"translateX(-100%)"}})]})});E.displayName=b;var P="SwitchThumb",R=s.forwardRef((t,o)=>{const{__scopeSwitch:e,...n}=t,r=D(P,e);return a.jsx(y.span,{"data-state":j(r.checked),"data-disabled":r.disabled?"":void 0,...n,ref:o})});R.displayName=P;var F="SwitchBubbleInput",N=s.forwardRef(({__scopeSwitch:t,control:o,checked:e,bubbles:n=!0,...r},m)=>{const d=s.useRef(null),c=C(d,m),u=A(e),v=H(o);return s.useEffect(()=>{const i=d.current;if(!i)return;const w=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(w,"checked").set;if(u!==e&&p){const S=new Event("click",{bubbles:n});p.call(i,e),i.dispatchEvent(S)}},[u,e,n]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:e,...r,tabIndex:-1,ref:c,style:{...r.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});N.displayName=F;function j(t){return t?"checked":"unchecked"}var _=E,L=R;const O=s.forwardRef(({className:t,...o},e)=>a.jsx(_,{className:x("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",t),...o,ref:e,children:a.jsx(L,{className:x("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));O.displayName=_.displayName;export{O as S}; +import{f as s,D as C,B as T,j as a,z as y,E as M,F as H,G as z,I as x}from"./index-CxhY4zQ1.js";import{u as A}from"./index-JxIVN7pD.js";var b="Switch",[U]=z(b),[q,D]=U(b),E=s.forwardRef((t,o)=>{const{__scopeSwitch:e,name:n,checked:r,defaultChecked:m,required:d,disabled:c,value:u="on",onCheckedChange:v,form:i,...w}=t,[l,p]=s.useState(null),S=C(o,h=>p(h)),k=s.useRef(!1),g=l?i||!!l.closest("form"):!0,[f,B]=T({prop:r,defaultProp:m??!1,onChange:v,caller:b});return a.jsxs(q,{scope:e,checked:f,disabled:c,children:[a.jsx(y.button,{type:"button",role:"switch","aria-checked":f,"aria-required":d,"data-state":j(f),"data-disabled":c?"":void 0,disabled:c,value:u,...w,ref:S,onClick:M(t.onClick,h=>{B(I=>!I),g&&(k.current=h.isPropagationStopped(),k.current||h.stopPropagation())})}),g&&a.jsx(N,{control:l,bubbles:!k.current,name:n,value:u,checked:f,required:d,disabled:c,form:i,style:{transform:"translateX(-100%)"}})]})});E.displayName=b;var P="SwitchThumb",R=s.forwardRef((t,o)=>{const{__scopeSwitch:e,...n}=t,r=D(P,e);return a.jsx(y.span,{"data-state":j(r.checked),"data-disabled":r.disabled?"":void 0,...n,ref:o})});R.displayName=P;var F="SwitchBubbleInput",N=s.forwardRef(({__scopeSwitch:t,control:o,checked:e,bubbles:n=!0,...r},m)=>{const d=s.useRef(null),c=C(d,m),u=A(e),v=H(o);return s.useEffect(()=>{const i=d.current;if(!i)return;const w=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(w,"checked").set;if(u!==e&&p){const S=new Event("click",{bubbles:n});p.call(i,e),i.dispatchEvent(S)}},[u,e,n]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:e,...r,tabIndex:-1,ref:c,style:{...r.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});N.displayName=F;function j(t){return t?"checked":"unchecked"}var _=E,L=R;const O=s.forwardRef(({className:t,...o},e)=>a.jsx(_,{className:x("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",t),...o,ref:e,children:a.jsx(L,{className:x("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));O.displayName=_.displayName;export{O as S}; diff --git a/assets/textarea-CdcMknzH.js b/assets/textarea-uttJnDhA.js similarity index 86% rename from assets/textarea-CdcMknzH.js rename to assets/textarea-uttJnDhA.js index 8672235416f796c009e839150ea86a43611312c6..d3d4055cb0452a7bebf7c37f467cdfdc6e3dfbbe 100644 --- a/assets/textarea-CdcMknzH.js +++ b/assets/textarea-uttJnDhA.js @@ -1 +1 @@ -import{f as s,j as a,I as t}from"./index-3CfcAX6N.js";const i=s.forwardRef(({className:e,...r},o)=>a.jsx("textarea",{className:t("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...r}));i.displayName="Textarea";export{i as T}; +import{f as s,j as a,I as t}from"./index-CxhY4zQ1.js";const i=s.forwardRef(({className:e,...r},o)=>a.jsx("textarea",{className:t("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...r}));i.displayName="Textarea";export{i as T}; diff --git a/assets/thumbs-up-BMfH8ZZ-.js b/assets/thumbs-up-DP1Ac3Tb.js similarity index 90% rename from assets/thumbs-up-BMfH8ZZ-.js rename to assets/thumbs-up-DP1Ac3Tb.js index a099f2c34cb888a74d044accf7c2313383bee80d..466dc59d0e312084af1257cbf0850943233d90cd 100644 --- a/assets/thumbs-up-BMfH8ZZ-.js +++ b/assets/thumbs-up-DP1Ac3Tb.js @@ -1,4 +1,4 @@ -import{c as a}from"./index-3CfcAX6N.js";/** +import{c as a}from"./index-CxhY4zQ1.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/transform-Dx-N8Yyj.js b/assets/transform-DehuZQh7.js similarity index 99% rename from assets/transform-Dx-N8Yyj.js rename to assets/transform-DehuZQh7.js index 25d4e8b803a1977d2aa9cb4188f8d8d36b6b321b..edea868ce26e2f87c7fff082d5fcfbfcf9555d71 100644 --- a/assets/transform-Dx-N8Yyj.js +++ b/assets/transform-DehuZQh7.js @@ -1 +1 @@ -import{a3 as _}from"./index-3CfcAX6N.js";function w(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function D(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}const A=6048e5,z=864e5,I=6e4,R=36e5;let V={};function W(){return V}function v(t,e){var s,u,d,f;const n=W(),r=(e==null?void 0:e.weekStartsOn)??((u=(s=e==null?void 0:e.locale)==null?void 0:s.options)==null?void 0:u.weekStartsOn)??n.weekStartsOn??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)??0,a=w(t),i=a.getDay(),o=(i=a.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function F(t){const e=w(t);return e.setHours(0,0,0,0),e}function E(t){const e=w(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function J(t,e){const n=F(t),r=F(e),a=+n-E(n),i=+r-E(r);return Math.round((a-i)/z)}function Z(t){const e=j(t),n=D(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),S(n)}function K(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function tt(t){if(!K(t)&&typeof t!="number")return!1;const e=w(t);return!isNaN(Number(e))}function et(t){const e=w(t),n=D(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}const nt={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},rt=(t,e,n)=>{let r;const a=nt[t];return typeof a=="string"?r=a:e===1?r=a.one:r=a.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function N(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const at={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},it={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ot={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},st={date:N({formats:at,defaultWidth:"full"}),time:N({formats:it,defaultWidth:"full"}),dateTime:N({formats:ot,defaultWidth:"full"})},ut={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ct=(t,e,n,r)=>ut[t];function O(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,s=n!=null&&n.width?String(n.width):o;a=t.formattingValues[s]||t.formattingValues[o]}else{const o=t.defaultWidth,s=n!=null&&n.width?String(n.width):t.defaultWidth;a=t.values[s]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(e):e;return a[i]}}const dt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},lt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ft={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},ht={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},mt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},gt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},wt=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},yt={ordinalNumber:wt,era:O({values:dt,defaultWidth:"wide"}),quarter:O({values:lt,defaultWidth:"wide",argumentCallback:t=>t-1}),month:O({values:ft,defaultWidth:"wide"}),day:O({values:ht,defaultWidth:"wide"}),dayPeriod:O({values:mt,defaultWidth:"wide",formattingValues:gt,defaultFormattingWidth:"wide"})};function P(t){return(e,n={})=>{const r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(a);if(!i)return null;const o=i[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?Dt(s,g=>g.test(o)):bt(s,g=>g.test(o));let d;d=t.valueCallback?t.valueCallback(u):u,d=n.valueCallback?n.valueCallback(d):d;const f=e.slice(o.length);return{value:d,rest:f}}}function bt(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Dt(t,e){for(let n=0;n{const r=e.match(t.matchPattern);if(!r)return null;const a=r[0],i=e.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const s=e.slice(a.length);return{value:o,rest:s}}}const kt=/^(\d+)(th|st|nd|rd)?/i,Ot=/\d+/i,Pt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},pt={any:[/^b/i,/^(a|c)/i]},vt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},xt={any:[/1/i,/2/i,/3/i,/4/i]},Tt={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},St={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Wt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Yt={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Nt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ct={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},_t={ordinalNumber:Mt({matchPattern:kt,parsePattern:Ot,valueCallback:t=>parseInt(t,10)}),era:P({matchPatterns:Pt,defaultMatchWidth:"wide",parsePatterns:pt,defaultParseWidth:"any"}),quarter:P({matchPatterns:vt,defaultMatchWidth:"wide",parsePatterns:xt,defaultParseWidth:"any",valueCallback:t=>t+1}),month:P({matchPatterns:Tt,defaultMatchWidth:"wide",parsePatterns:St,defaultParseWidth:"any"}),day:P({matchPatterns:Wt,defaultMatchWidth:"wide",parsePatterns:Yt,defaultParseWidth:"any"}),dayPeriod:P({matchPatterns:Nt,defaultMatchWidth:"any",parsePatterns:Ct,defaultParseWidth:"any"})},Ft={code:"en-US",formatDistance:rt,formatLong:st,formatRelative:ct,localize:yt,match:_t,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Et(t){const e=w(t);return J(e,et(e))+1}function qt(t){const e=w(t),n=+S(e)-+Z(e);return Math.round(n/A)+1}function Q(t,e){var f,g,l,k;const n=w(t),r=n.getFullYear(),a=W(),i=(e==null?void 0:e.firstWeekContainsDate)??((g=(f=e==null?void 0:e.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??a.firstWeekContainsDate??((k=(l=a.locale)==null?void 0:l.options)==null?void 0:k.firstWeekContainsDate)??1,o=D(t,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const s=v(o,e),u=D(t,0);u.setFullYear(r,0,i),u.setHours(0,0,0,0);const d=v(u,e);return n.getTime()>=s.getTime()?r+1:n.getTime()>=d.getTime()?r:r-1}function Ut(t,e){var s,u,d,f;const n=W(),r=(e==null?void 0:e.firstWeekContainsDate)??((u=(s=e==null?void 0:e.locale)==null?void 0:s.options)==null?void 0:u.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??1,a=Q(t,e),i=D(t,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),v(i,e)}function Lt(t,e){const n=w(t),r=+v(n,e)-+Ut(n,e);return Math.round(r/A)+1}function c(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const y={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return c(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):c(n+1,2)},d(t,e){return c(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return c(t.getHours()%12||12,e.length)},H(t,e){return c(t.getHours(),e.length)},m(t,e){return c(t.getMinutes(),e.length)},s(t,e){return c(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return c(a,e.length)}},M={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},q={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return y.y(t,e)},Y:function(t,e,n,r){const a=Q(t,r),i=a>0?a:1-a;if(e==="YY"){const o=i%100;return c(o,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):c(i,e.length)},R:function(t,e){const n=j(t);return c(n,e.length)},u:function(t,e){const n=t.getFullYear();return c(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return c(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return c(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return y.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return c(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const a=Lt(t,r);return e==="wo"?n.ordinalNumber(a,{unit:"week"}):c(a,e.length)},I:function(t,e,n){const r=qt(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):c(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):y.d(t,e)},D:function(t,e,n){const r=Et(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):c(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return c(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return c(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),a=r===0?7:r;switch(e){case"i":return String(a);case"ii":return c(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const a=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let a;switch(r===12?a=M.noon:r===0?a=M.midnight:a=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let a;switch(r>=17?a=M.evening:r>=12?a=M.afternoon:r>=4?a=M.morning:a=M.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return y.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):y.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):c(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):c(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):y.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):y.s(t,e)},S:function(t,e){return y.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return L(r);case"XXXX":case"XX":return b(r);case"XXXXX":case"XXX":default:return b(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return L(r);case"xxxx":case"xx":return b(r);case"xxxxx":case"xxx":default:return b(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+U(r,":");case"OOOO":default:return"GMT"+b(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+U(r,":");case"zzzz":default:return"GMT"+b(r,":")}},t:function(t,e,n){const r=Math.trunc(t.getTime()/1e3);return c(r,e.length)},T:function(t,e,n){const r=t.getTime();return c(r,e.length)}};function U(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+e+c(i,2)}function L(t,e){return t%60===0?(t>0?"-":"+")+c(Math.abs(t)/60,2):b(t,e)}function b(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=c(Math.trunc(r/60),2),i=c(r%60,2);return n+a+e+i}const H=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},X=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},Ht=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return H(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",H(r,e)).replace("{{time}}",X(a,e))},At={p:X,P:Ht},It=/^D+$/,Rt=/^Y+$/,jt=["D","DD","YY","YYYY"];function Qt(t){return It.test(t)}function Xt(t){return Rt.test(t)}function Bt(t,e,n){const r=Gt(t,e,n);if(console.warn(r),jt.includes(t))throw new RangeError(r)}function Gt(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const $t=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,zt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Vt=/^'([^]*?)'?$/,Jt=/''/g,Zt=/[a-zA-Z]/;function Kt(t,e,n){var f,g,l,k;const r=W(),a=r.locale??Ft,i=r.firstWeekContainsDate??((g=(f=r.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,o=r.weekStartsOn??((k=(l=r.locale)==null?void 0:l.options)==null?void 0:k.weekStartsOn)??0,s=w(t);if(!tt(s))throw new RangeError("Invalid time value");let u=e.match(zt).map(m=>{const h=m[0];if(h==="p"||h==="P"){const Y=At[h];return Y(m,a.formatLong)}return m}).join("").match($t).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const h=m[0];if(h==="'")return{isToken:!1,value:te(m)};if(q[h])return{isToken:!0,value:m};if(h.match(Zt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:m}});a.localize.preprocessor&&(u=a.localize.preprocessor(s,u));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return u.map(m=>{if(!m.isToken)return m.value;const h=m.value;(Xt(h)||Qt(h))&&Bt(h,e,String(t));const Y=q[h[0]];return Y(s,h,a.localize,d)}).join("")}function te(t){const e=t.match(Vt);return e?e[1].replace(Jt,"'"):t}function B(t,e){const r=ae(t);let a;if(r.date){const u=ie(r.date,2);a=oe(u.restDateString,u.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);const i=a.getTime();let o=0,s;if(r.time&&(o=se(r.time),isNaN(o)))return new Date(NaN);if(r.timezone){if(s=ue(r.timezone),isNaN(s))return new Date(NaN)}else{const u=new Date(i+o),d=new Date(0);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return new Date(i+o+s)}const x={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ee=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ne=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,re=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ae(t){const e={},n=t.split(x.dateTimeDelimiter);let r;if(n.length>2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],x.timeZoneDelimiter.test(e.date)&&(e.date=t.split(x.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){const a=x.timezone.exec(r);a?(e.time=r.replace(a[1],""),e.timezone=a[1]):e.time=r}return e}function ie(t,e){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};const a=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?a:i*100,restDateString:t.slice((r[1]||r[2]).length)}}function oe(t,e){if(e===null)return new Date(NaN);const n=t.match(ee);if(!n)return new Date(NaN);const r=!!n[4],a=p(n[1]),i=p(n[2])-1,o=p(n[3]),s=p(n[4]),u=p(n[5])-1;if(r)return he(e,s,u)?ce(e,s,u):new Date(NaN);{const d=new Date(0);return!le(e,i,o)||!fe(e,a)?new Date(NaN):(d.setUTCFullYear(e,i,Math.max(a,o)),d)}}function p(t){return t?parseInt(t):1}function se(t){const e=t.match(ne);if(!e)return NaN;const n=C(e[1]),r=C(e[2]),a=C(e[3]);return me(n,r,a)?n*R+r*I+a*1e3:NaN}function C(t){return t&&parseFloat(t.replace(",","."))||0}function ue(t){if(t==="Z")return 0;const e=t.match(re);if(!e)return 0;const n=e[1]==="+"?-1:1,r=parseInt(e[2]),a=e[3]&&parseInt(e[3])||0;return ge(r,a)?n*(r*R+a*I):NaN}function ce(t,e,n){const r=new Date(0);r.setUTCFullYear(t,0,4);const a=r.getUTCDay()||7,i=(e-1)*7+n+1-a;return r.setUTCDate(r.getUTCDate()+i),r}const de=[31,null,31,30,31,30,31,31,30,31,30,31];function G(t){return t%400===0||t%4===0&&t%100!==0}function le(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(de[e]||(G(t)?29:28))}function fe(t,e){return e>=1&&e<=(G(t)?366:365)}function he(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function me(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function ge(t,e){return e>=0&&e<=59}const we={model:"models",dataset:"datasets",space:"spaces"};function ye(t){const e=t.hf_artifact_summary;return!e||!e.best_kind||!e.best_url||e.best_count<=0?{hfKind:null,hfCount:0,hfUrl:null}:{hfKind:we[e.best_kind]??null,hfCount:e.best_count,hfUrl:e.best_url}}function be(t){if(!t||t.length===0)return{github:null,githubUrl:null,velocity24h:null};const e=t.filter(a=>a.is_official),r=[...e.length>0?e:t].sort((a,i)=>(i.num_stars||0)-(a.num_stars||0))[0];return{github:r&&r.num_stars>0?r.num_stars:null,githubUrl:(r==null?void 0:r.url)||null,velocity24h:(r==null?void 0:r.trending_score)??null}}function De(t){if(!t)return null;try{const e=typeof t=="string"?B(t):t;return Kt(e,"MMM d, yyyy")}catch{return null}}function Me(t){if(!t)return null;try{return B(t).getFullYear()}catch{return null}}function ke(t){return(t||[]).filter(e=>e.best_rank>=1&&e.best_rank<=3).map(e=>{let n=null;if(e.dataset_slug){const r=new URLSearchParams;e.task_slug&&r.set("task",e.task_slug),r.set("eval",e.evaluation_id),n=`/benchmark/${e.dataset_slug}?${r}`}return{name:e.dataset_name,href:n,rank:e.best_rank}})}function ve(t){var f,g;const{github:e,githubUrl:n,velocity24h:r}=be(t.repositories),{hfKind:a,hfCount:i,hfUrl:o}=ye(t),s=(t.tasks||[]).map(l=>l.slug||"").filter(Boolean),u=(t.methods||[]).map(l=>({id:l.id,name:l.name,slug:l.slug})),d=ke(t.leaderboard_ranks);return{id:t.arxiv_id||t.id,dbId:t.id,title:t.title,abstract:t.abstract||"",authors:t.authors||[],authorIds:(t.author_links||[]).map(l=>l.id??null),authorHfProfiles:(t.author_links||[]).map(l=>l.hf_username?{username:l.hf_username,avatarUrl:l.hf_avatar_url??null}:null),tags:s,methods:u,organizations:(t.organizations||[]).map(l=>({name:l.name,slug:l.slug,logoUrl:_(l.logo_url)||null})),citations:t.citation_count||0,github:e,githubUrl:n,project:((g=(f=t.project_pages)==null?void 0:f[0])==null?void 0:g.url)||null,date:De(t.published),publishedIso:t.published||null,year:Me(t.published),thumbnailUrl:_(t.thumbnail_url)||null,tldr:t.tldr||null,version:t.version||"v1",velocity24h:r,hfKind:a,hfCount:i,hfUrl:o,sotaRanks:d}}function Oe(t){const e=$.get(t.toLowerCase());if(e)return e;const n=t.toUpperCase();return T.has(n)?n:t.replace(/[-_]+/g," ").replace(/\b\w/g,r=>r.toUpperCase())}const T=new Set(["3D","AI","OCR"]),$=new Map([["3d-tracking","3D Tracking"],["point-tracking","2D Point Tracking"],["3d-generation","3D generation"],["3d-understanding","3D understanding"],["3d-semantic-segmentation","3D semantic segmentation"],["3d-instance-segmentation","3D instance segmentation"],["3d-object-detection","3D object detection"],["text-to-sql","Text-to-SQL"]]);function xe(t,e){const n=t||Oe(e||""),r=$.get((e==null?void 0:e.toLowerCase())||Pe(n));if(r)return r;const a=e==null?void 0:e.toUpperCase(),i=n.toUpperCase();return/^[A-Z0-9][A-Z0-9-]{1,}$/.test(n)||a&&T.has(a)||T.has(i)?i:n.replace(/\b[A-Za-z0-9]+\b/g,s=>/^[A-Z0-9]{2,}$/.test(s)||T.has(s.toUpperCase())?s.toUpperCase():s.charAt(0).toUpperCase()+s.slice(1).toLowerCase())}function Pe(t){return t.trim().toLowerCase().replace(/[\s_]+/g,"-")}export{ke as a,xe as d,Oe as h,be as s,ve as t}; +import{a3 as _}from"./index-CxhY4zQ1.js";function w(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function D(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}const A=6048e5,z=864e5,I=6e4,R=36e5;let V={};function W(){return V}function v(t,e){var s,u,d,f;const n=W(),r=(e==null?void 0:e.weekStartsOn)??((u=(s=e==null?void 0:e.locale)==null?void 0:s.options)==null?void 0:u.weekStartsOn)??n.weekStartsOn??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)??0,a=w(t),i=a.getDay(),o=(i=a.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function F(t){const e=w(t);return e.setHours(0,0,0,0),e}function E(t){const e=w(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function J(t,e){const n=F(t),r=F(e),a=+n-E(n),i=+r-E(r);return Math.round((a-i)/z)}function Z(t){const e=j(t),n=D(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),S(n)}function K(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function tt(t){if(!K(t)&&typeof t!="number")return!1;const e=w(t);return!isNaN(Number(e))}function et(t){const e=w(t),n=D(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}const nt={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},rt=(t,e,n)=>{let r;const a=nt[t];return typeof a=="string"?r=a:e===1?r=a.one:r=a.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function N(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const at={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},it={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ot={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},st={date:N({formats:at,defaultWidth:"full"}),time:N({formats:it,defaultWidth:"full"}),dateTime:N({formats:ot,defaultWidth:"full"})},ut={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ct=(t,e,n,r)=>ut[t];function O(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,s=n!=null&&n.width?String(n.width):o;a=t.formattingValues[s]||t.formattingValues[o]}else{const o=t.defaultWidth,s=n!=null&&n.width?String(n.width):t.defaultWidth;a=t.values[s]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(e):e;return a[i]}}const dt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},lt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ft={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},ht={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},mt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},gt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},wt=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},yt={ordinalNumber:wt,era:O({values:dt,defaultWidth:"wide"}),quarter:O({values:lt,defaultWidth:"wide",argumentCallback:t=>t-1}),month:O({values:ft,defaultWidth:"wide"}),day:O({values:ht,defaultWidth:"wide"}),dayPeriod:O({values:mt,defaultWidth:"wide",formattingValues:gt,defaultFormattingWidth:"wide"})};function P(t){return(e,n={})=>{const r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(a);if(!i)return null;const o=i[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?Dt(s,g=>g.test(o)):bt(s,g=>g.test(o));let d;d=t.valueCallback?t.valueCallback(u):u,d=n.valueCallback?n.valueCallback(d):d;const f=e.slice(o.length);return{value:d,rest:f}}}function bt(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Dt(t,e){for(let n=0;n{const r=e.match(t.matchPattern);if(!r)return null;const a=r[0],i=e.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const s=e.slice(a.length);return{value:o,rest:s}}}const kt=/^(\d+)(th|st|nd|rd)?/i,Ot=/\d+/i,Pt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},pt={any:[/^b/i,/^(a|c)/i]},vt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},xt={any:[/1/i,/2/i,/3/i,/4/i]},Tt={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},St={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Wt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Yt={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Nt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ct={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},_t={ordinalNumber:Mt({matchPattern:kt,parsePattern:Ot,valueCallback:t=>parseInt(t,10)}),era:P({matchPatterns:Pt,defaultMatchWidth:"wide",parsePatterns:pt,defaultParseWidth:"any"}),quarter:P({matchPatterns:vt,defaultMatchWidth:"wide",parsePatterns:xt,defaultParseWidth:"any",valueCallback:t=>t+1}),month:P({matchPatterns:Tt,defaultMatchWidth:"wide",parsePatterns:St,defaultParseWidth:"any"}),day:P({matchPatterns:Wt,defaultMatchWidth:"wide",parsePatterns:Yt,defaultParseWidth:"any"}),dayPeriod:P({matchPatterns:Nt,defaultMatchWidth:"any",parsePatterns:Ct,defaultParseWidth:"any"})},Ft={code:"en-US",formatDistance:rt,formatLong:st,formatRelative:ct,localize:yt,match:_t,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Et(t){const e=w(t);return J(e,et(e))+1}function qt(t){const e=w(t),n=+S(e)-+Z(e);return Math.round(n/A)+1}function Q(t,e){var f,g,l,k;const n=w(t),r=n.getFullYear(),a=W(),i=(e==null?void 0:e.firstWeekContainsDate)??((g=(f=e==null?void 0:e.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??a.firstWeekContainsDate??((k=(l=a.locale)==null?void 0:l.options)==null?void 0:k.firstWeekContainsDate)??1,o=D(t,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const s=v(o,e),u=D(t,0);u.setFullYear(r,0,i),u.setHours(0,0,0,0);const d=v(u,e);return n.getTime()>=s.getTime()?r+1:n.getTime()>=d.getTime()?r:r-1}function Ut(t,e){var s,u,d,f;const n=W(),r=(e==null?void 0:e.firstWeekContainsDate)??((u=(s=e==null?void 0:e.locale)==null?void 0:s.options)==null?void 0:u.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??1,a=Q(t,e),i=D(t,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),v(i,e)}function Lt(t,e){const n=w(t),r=+v(n,e)-+Ut(n,e);return Math.round(r/A)+1}function c(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const y={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return c(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):c(n+1,2)},d(t,e){return c(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return c(t.getHours()%12||12,e.length)},H(t,e){return c(t.getHours(),e.length)},m(t,e){return c(t.getMinutes(),e.length)},s(t,e){return c(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return c(a,e.length)}},M={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},q={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return y.y(t,e)},Y:function(t,e,n,r){const a=Q(t,r),i=a>0?a:1-a;if(e==="YY"){const o=i%100;return c(o,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):c(i,e.length)},R:function(t,e){const n=j(t);return c(n,e.length)},u:function(t,e){const n=t.getFullYear();return c(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return c(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return c(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return y.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return c(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const a=Lt(t,r);return e==="wo"?n.ordinalNumber(a,{unit:"week"}):c(a,e.length)},I:function(t,e,n){const r=qt(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):c(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):y.d(t,e)},D:function(t,e,n){const r=Et(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):c(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return c(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return c(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),a=r===0?7:r;switch(e){case"i":return String(a);case"ii":return c(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const a=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let a;switch(r===12?a=M.noon:r===0?a=M.midnight:a=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let a;switch(r>=17?a=M.evening:r>=12?a=M.afternoon:r>=4?a=M.morning:a=M.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return y.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):y.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):c(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):c(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):y.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):y.s(t,e)},S:function(t,e){return y.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return L(r);case"XXXX":case"XX":return b(r);case"XXXXX":case"XXX":default:return b(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return L(r);case"xxxx":case"xx":return b(r);case"xxxxx":case"xxx":default:return b(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+U(r,":");case"OOOO":default:return"GMT"+b(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+U(r,":");case"zzzz":default:return"GMT"+b(r,":")}},t:function(t,e,n){const r=Math.trunc(t.getTime()/1e3);return c(r,e.length)},T:function(t,e,n){const r=t.getTime();return c(r,e.length)}};function U(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+e+c(i,2)}function L(t,e){return t%60===0?(t>0?"-":"+")+c(Math.abs(t)/60,2):b(t,e)}function b(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=c(Math.trunc(r/60),2),i=c(r%60,2);return n+a+e+i}const H=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},X=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},Ht=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return H(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",H(r,e)).replace("{{time}}",X(a,e))},At={p:X,P:Ht},It=/^D+$/,Rt=/^Y+$/,jt=["D","DD","YY","YYYY"];function Qt(t){return It.test(t)}function Xt(t){return Rt.test(t)}function Bt(t,e,n){const r=Gt(t,e,n);if(console.warn(r),jt.includes(t))throw new RangeError(r)}function Gt(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const $t=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,zt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Vt=/^'([^]*?)'?$/,Jt=/''/g,Zt=/[a-zA-Z]/;function Kt(t,e,n){var f,g,l,k;const r=W(),a=r.locale??Ft,i=r.firstWeekContainsDate??((g=(f=r.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,o=r.weekStartsOn??((k=(l=r.locale)==null?void 0:l.options)==null?void 0:k.weekStartsOn)??0,s=w(t);if(!tt(s))throw new RangeError("Invalid time value");let u=e.match(zt).map(m=>{const h=m[0];if(h==="p"||h==="P"){const Y=At[h];return Y(m,a.formatLong)}return m}).join("").match($t).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const h=m[0];if(h==="'")return{isToken:!1,value:te(m)};if(q[h])return{isToken:!0,value:m};if(h.match(Zt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:m}});a.localize.preprocessor&&(u=a.localize.preprocessor(s,u));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return u.map(m=>{if(!m.isToken)return m.value;const h=m.value;(Xt(h)||Qt(h))&&Bt(h,e,String(t));const Y=q[h[0]];return Y(s,h,a.localize,d)}).join("")}function te(t){const e=t.match(Vt);return e?e[1].replace(Jt,"'"):t}function B(t,e){const r=ae(t);let a;if(r.date){const u=ie(r.date,2);a=oe(u.restDateString,u.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);const i=a.getTime();let o=0,s;if(r.time&&(o=se(r.time),isNaN(o)))return new Date(NaN);if(r.timezone){if(s=ue(r.timezone),isNaN(s))return new Date(NaN)}else{const u=new Date(i+o),d=new Date(0);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return new Date(i+o+s)}const x={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ee=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ne=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,re=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ae(t){const e={},n=t.split(x.dateTimeDelimiter);let r;if(n.length>2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],x.timeZoneDelimiter.test(e.date)&&(e.date=t.split(x.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){const a=x.timezone.exec(r);a?(e.time=r.replace(a[1],""),e.timezone=a[1]):e.time=r}return e}function ie(t,e){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};const a=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?a:i*100,restDateString:t.slice((r[1]||r[2]).length)}}function oe(t,e){if(e===null)return new Date(NaN);const n=t.match(ee);if(!n)return new Date(NaN);const r=!!n[4],a=p(n[1]),i=p(n[2])-1,o=p(n[3]),s=p(n[4]),u=p(n[5])-1;if(r)return he(e,s,u)?ce(e,s,u):new Date(NaN);{const d=new Date(0);return!le(e,i,o)||!fe(e,a)?new Date(NaN):(d.setUTCFullYear(e,i,Math.max(a,o)),d)}}function p(t){return t?parseInt(t):1}function se(t){const e=t.match(ne);if(!e)return NaN;const n=C(e[1]),r=C(e[2]),a=C(e[3]);return me(n,r,a)?n*R+r*I+a*1e3:NaN}function C(t){return t&&parseFloat(t.replace(",","."))||0}function ue(t){if(t==="Z")return 0;const e=t.match(re);if(!e)return 0;const n=e[1]==="+"?-1:1,r=parseInt(e[2]),a=e[3]&&parseInt(e[3])||0;return ge(r,a)?n*(r*R+a*I):NaN}function ce(t,e,n){const r=new Date(0);r.setUTCFullYear(t,0,4);const a=r.getUTCDay()||7,i=(e-1)*7+n+1-a;return r.setUTCDate(r.getUTCDate()+i),r}const de=[31,null,31,30,31,30,31,31,30,31,30,31];function G(t){return t%400===0||t%4===0&&t%100!==0}function le(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(de[e]||(G(t)?29:28))}function fe(t,e){return e>=1&&e<=(G(t)?366:365)}function he(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function me(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function ge(t,e){return e>=0&&e<=59}const we={model:"models",dataset:"datasets",space:"spaces"};function ye(t){const e=t.hf_artifact_summary;return!e||!e.best_kind||!e.best_url||e.best_count<=0?{hfKind:null,hfCount:0,hfUrl:null}:{hfKind:we[e.best_kind]??null,hfCount:e.best_count,hfUrl:e.best_url}}function be(t){if(!t||t.length===0)return{github:null,githubUrl:null,velocity24h:null};const e=t.filter(a=>a.is_official),r=[...e.length>0?e:t].sort((a,i)=>(i.num_stars||0)-(a.num_stars||0))[0];return{github:r&&r.num_stars>0?r.num_stars:null,githubUrl:(r==null?void 0:r.url)||null,velocity24h:(r==null?void 0:r.trending_score)??null}}function De(t){if(!t)return null;try{const e=typeof t=="string"?B(t):t;return Kt(e,"MMM d, yyyy")}catch{return null}}function Me(t){if(!t)return null;try{return B(t).getFullYear()}catch{return null}}function ke(t){return(t||[]).filter(e=>e.best_rank>=1&&e.best_rank<=3).map(e=>{let n=null;if(e.dataset_slug){const r=new URLSearchParams;e.task_slug&&r.set("task",e.task_slug),r.set("eval",e.evaluation_id),n=`/benchmark/${e.dataset_slug}?${r}`}return{name:e.dataset_name,href:n,rank:e.best_rank}})}function ve(t){var f,g;const{github:e,githubUrl:n,velocity24h:r}=be(t.repositories),{hfKind:a,hfCount:i,hfUrl:o}=ye(t),s=(t.tasks||[]).map(l=>l.slug||"").filter(Boolean),u=(t.methods||[]).map(l=>({id:l.id,name:l.name,slug:l.slug})),d=ke(t.leaderboard_ranks);return{id:t.arxiv_id||t.id,dbId:t.id,title:t.title,abstract:t.abstract||"",authors:t.authors||[],authorIds:(t.author_links||[]).map(l=>l.id??null),authorHfProfiles:(t.author_links||[]).map(l=>l.hf_username?{username:l.hf_username,avatarUrl:l.hf_avatar_url??null}:null),tags:s,methods:u,organizations:(t.organizations||[]).map(l=>({name:l.name,slug:l.slug,logoUrl:_(l.logo_url)||null})),citations:t.citation_count||0,github:e,githubUrl:n,project:((g=(f=t.project_pages)==null?void 0:f[0])==null?void 0:g.url)||null,date:De(t.published),publishedIso:t.published||null,year:Me(t.published),thumbnailUrl:_(t.thumbnail_url)||null,tldr:t.tldr||null,version:t.version||"v1",velocity24h:r,hfKind:a,hfCount:i,hfUrl:o,sotaRanks:d}}function Oe(t){const e=$.get(t.toLowerCase());if(e)return e;const n=t.toUpperCase();return T.has(n)?n:t.replace(/[-_]+/g," ").replace(/\b\w/g,r=>r.toUpperCase())}const T=new Set(["3D","AI","OCR"]),$=new Map([["3d-tracking","3D Tracking"],["point-tracking","2D Point Tracking"],["3d-generation","3D generation"],["3d-understanding","3D understanding"],["3d-semantic-segmentation","3D semantic segmentation"],["3d-instance-segmentation","3D instance segmentation"],["3d-object-detection","3D object detection"],["text-to-sql","Text-to-SQL"]]);function xe(t,e){const n=t||Oe(e||""),r=$.get((e==null?void 0:e.toLowerCase())||Pe(n));if(r)return r;const a=e==null?void 0:e.toUpperCase(),i=n.toUpperCase();return/^[A-Z0-9][A-Z0-9-]{1,}$/.test(n)||a&&T.has(a)||T.has(i)?i:n.replace(/\b[A-Za-z0-9]+\b/g,s=>/^[A-Z0-9]{2,}$/.test(s)||T.has(s.toUpperCase())?s.toUpperCase():s.charAt(0).toUpperCase()+s.slice(1).toLowerCase())}function Pe(t){return t.trim().toLowerCase().replace(/[\s_]+/g,"-")}export{ke as a,xe as d,Oe as h,be as s,ve as t}; diff --git a/assets/trending-up-BcVfaomA.js b/assets/trending-up-BaROX4bP.js similarity index 88% rename from assets/trending-up-BcVfaomA.js rename to assets/trending-up-BaROX4bP.js index a2fbf734f7dc1e89dd9819f964aca2652203c9e9..aede6fa99e7367d3a133b08c02da70bee2bf981f 100644 --- a/assets/trending-up-BcVfaomA.js +++ b/assets/trending-up-BaROX4bP.js @@ -1,4 +1,4 @@ -import{c as e}from"./index-3CfcAX6N.js";/** +import{c as e}from"./index-CxhY4zQ1.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/triangle-alert-UGq54fwL.js b/assets/triangle-alert-BCFuWBBz.js similarity index 94% rename from assets/triangle-alert-UGq54fwL.js rename to assets/triangle-alert-BCFuWBBz.js index 0203c034edca5174c6546261ffe8d5a2770c1260..040f9b9b887d6de4e11d5b858eaf61c88385128c 100644 --- a/assets/triangle-alert-UGq54fwL.js +++ b/assets/triangle-alert-BCFuWBBz.js @@ -1,4 +1,4 @@ -import{c as e}from"./index-3CfcAX6N.js";/** +import{c as e}from"./index-CxhY4zQ1.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/trophy-BKn0k0Fw.js b/assets/trophy-BVERRwS-.js similarity index 93% rename from assets/trophy-BKn0k0Fw.js rename to assets/trophy-BVERRwS-.js index 8309f9f456cfd6dfac2e072696a7c8b0efe2a7a5..c8a94c8a2b67d3c99aabf964d43e124162582e61 100644 --- a/assets/trophy-BKn0k0Fw.js +++ b/assets/trophy-BVERRwS-.js @@ -1,4 +1,4 @@ -import{c as a}from"./index-3CfcAX6N.js";/** +import{c as a}from"./index-CxhY4zQ1.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/useDebounce-Dky0xohQ.js b/assets/useDebounce-BqT24mBv.js similarity index 66% rename from assets/useDebounce-Dky0xohQ.js rename to assets/useDebounce-BqT24mBv.js index ff5f06e501882ba45075150110deccd3cf473e13..5fa0bb5991f40e2e1f0b3dcbb682e294d9113b13 100644 --- a/assets/useDebounce-Dky0xohQ.js +++ b/assets/useDebounce-BqT24mBv.js @@ -1 +1 @@ -import{f as o}from"./index-3CfcAX6N.js";function s(e,t=300){const[r,u]=o.useState(e);return o.useEffect(()=>{const c=setTimeout(()=>u(e),t);return()=>clearTimeout(c)},[e,t]),r}export{s as u}; +import{f as o}from"./index-CxhY4zQ1.js";function s(e,t=300){const[r,u]=o.useState(e);return o.useEffect(()=>{const c=setTimeout(()=>u(e),t);return()=>clearTimeout(c)},[e,t]),r}export{s as u}; diff --git a/assets/useDocumentTitle-BnA1kM_d.js b/assets/useDocumentTitle-CC3zTSwA.js similarity index 96% rename from assets/useDocumentTitle-BnA1kM_d.js rename to assets/useDocumentTitle-CC3zTSwA.js index 2ed06b2ad9b2a4f692cea65cd587c566ae3977bf..e0000f2cdf9412902c37fd5d69165c7a63d0816e 100644 --- a/assets/useDocumentTitle-BnA1kM_d.js +++ b/assets/useDocumentTitle-CC3zTSwA.js @@ -1 +1 @@ -import{f as s}from"./index-3CfcAX6N.js";const E={a:"á",e:"é",i:"í",o:"ó",u:"ú",y:"ý",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú",Y:"Ý"},p={a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"},u={a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"},_={a:"ä",e:"ë",i:"ï",o:"ö",u:"ü",y:"ÿ",A:"Ä",E:"Ë",I:"Ï",O:"Ö",U:"Ü",Y:"Ÿ"},T={"'":E,"`":p,"^":u,'"':_,"~":{n:"ñ",N:"Ñ"}},i={ss:"ß",ae:"æ",AE:"Æ",oe:"œ",OE:"Œ",o:"ø",O:"Ø",l:"ł",L:"Ł"},m=[["varphi","φ"],["varepsilon","ε"],["vartheta","ϑ"],["Gamma","Γ"],["Delta","Δ"],["Theta","Θ"],["Lambda","Λ"],["Sigma","Σ"],["Omega","Ω"],["alpha","α"],["beta","β"],["gamma","γ"],["delta","δ"],["epsilon","ε"],["zeta","ζ"],["eta","η"],["theta","θ"],["kappa","κ"],["lambda","λ"],["mu","μ"],["nu","ν"],["xi","ξ"],["pi","π"],["rho","ρ"],["sigma","σ"],["tau","τ"],["phi","φ"],["chi","χ"],["psi","ψ"],["omega","ω"]],L=/\\(?:textbf|mathbf|emph|textit|textsl|texttt|color|textcolor)\{([^{}]*)\}/g,f=/\\(['"`^~])([A-Za-z])/g,C=/\\c\{([cCsS])\}/g,M=new RegExp(`\\\\(${Object.keys(i).join("|")})(?![A-Za-z])`,"g"),g=/\$\$([^$]+)\$\$/g,O=/\$([^$]+)\$/g,$=/\\([A-Za-z]+)/g;function o(e,t,a){return e.split(t).join(a)}function r(e){let t=e.trim();for(const[a,n]of m)t=o(t,`\\${a}`,n);return t=t.replace($,(a,n)=>n),o(t,"$","")}function h(e){let t=e.replace(g,(a,n)=>r(n));return t=t.replace(O,(a,n)=>r(n)),o(t,"$","")}function D(e){if(!e)return e;let t=e.replace(L,"$1");return t=t.replace(C,(a,n)=>({c:"ç",C:"Ç"})[n]??a),t=t.replace(f,(a,n,A)=>{var c;return((c=T[n])==null?void 0:c[A])??a}),t=t.replace(M,(a,n)=>i[n]??a),t=h(t),o(t,"~"," ")}const l="Papers with Code";function I(e,t=l){return`${D(e.trim())||"Paper"} | ${t}`}function R(e,{restorePrevious:t=!1}={}){s.useEffect(()=>{if(!e)return;const a=document.title;return document.title=e,()=>{document.title=t?a:l}},[e,t])}export{I as f,R as u}; +import{f as s}from"./index-CxhY4zQ1.js";const E={a:"á",e:"é",i:"í",o:"ó",u:"ú",y:"ý",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú",Y:"Ý"},p={a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"},u={a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"},_={a:"ä",e:"ë",i:"ï",o:"ö",u:"ü",y:"ÿ",A:"Ä",E:"Ë",I:"Ï",O:"Ö",U:"Ü",Y:"Ÿ"},T={"'":E,"`":p,"^":u,'"':_,"~":{n:"ñ",N:"Ñ"}},i={ss:"ß",ae:"æ",AE:"Æ",oe:"œ",OE:"Œ",o:"ø",O:"Ø",l:"ł",L:"Ł"},m=[["varphi","φ"],["varepsilon","ε"],["vartheta","ϑ"],["Gamma","Γ"],["Delta","Δ"],["Theta","Θ"],["Lambda","Λ"],["Sigma","Σ"],["Omega","Ω"],["alpha","α"],["beta","β"],["gamma","γ"],["delta","δ"],["epsilon","ε"],["zeta","ζ"],["eta","η"],["theta","θ"],["kappa","κ"],["lambda","λ"],["mu","μ"],["nu","ν"],["xi","ξ"],["pi","π"],["rho","ρ"],["sigma","σ"],["tau","τ"],["phi","φ"],["chi","χ"],["psi","ψ"],["omega","ω"]],L=/\\(?:textbf|mathbf|emph|textit|textsl|texttt|color|textcolor)\{([^{}]*)\}/g,f=/\\(['"`^~])([A-Za-z])/g,C=/\\c\{([cCsS])\}/g,M=new RegExp(`\\\\(${Object.keys(i).join("|")})(?![A-Za-z])`,"g"),g=/\$\$([^$]+)\$\$/g,O=/\$([^$]+)\$/g,$=/\\([A-Za-z]+)/g;function o(e,t,a){return e.split(t).join(a)}function r(e){let t=e.trim();for(const[a,n]of m)t=o(t,`\\${a}`,n);return t=t.replace($,(a,n)=>n),o(t,"$","")}function h(e){let t=e.replace(g,(a,n)=>r(n));return t=t.replace(O,(a,n)=>r(n)),o(t,"$","")}function D(e){if(!e)return e;let t=e.replace(L,"$1");return t=t.replace(C,(a,n)=>({c:"ç",C:"Ç"})[n]??a),t=t.replace(f,(a,n,A)=>{var c;return((c=T[n])==null?void 0:c[A])??a}),t=t.replace(M,(a,n)=>i[n]??a),t=h(t),o(t,"~"," ")}const l="Papers with Code";function I(e,t=l){return`${D(e.trim())||"Paper"} | ${t}`}function R(e,{restorePrevious:t=!1}={}){s.useEffect(()=>{if(!e)return;const a=document.title;return document.title=e,()=>{document.title=t?a:l}},[e,t])}export{I as f,R as u}; diff --git a/assets/useHashScrollOnReady-DNNLLOuJ.js b/assets/useHashScrollOnReady-KPtO6vdP.js similarity index 90% rename from assets/useHashScrollOnReady-DNNLLOuJ.js rename to assets/useHashScrollOnReady-KPtO6vdP.js index 6045dc7f14f8a628c8a496e41abcc57dc0df6249..6d93e45af8c0b7b36ac534d6c474ac9552a1f5b5 100644 --- a/assets/useHashScrollOnReady-DNNLLOuJ.js +++ b/assets/useHashScrollOnReady-KPtO6vdP.js @@ -1 +1 @@ -import{j as s,L as h,f as x}from"./index-3CfcAX6N.js";import{S as p}from"./skeleton-CQbSjC3L.js";import{A as j,a as m}from"./alert-BXZ4lnnf.js";import{T as d}from"./trending-up-BcVfaomA.js";const y=({noun:n,items:e,recentDays:i=30,baselineDays:l=180,isLoading:o,error:t,mono:c})=>!o&&!t&&!(e!=null&&e.length)?null:s.jsxs("section",{id:"trending",className:"taxonomy-trending","aria-label":`Trending ${n}s`,children:[s.jsxs("div",{className:"taxonomy-trending-header",children:[s.jsxs("h2",{children:[s.jsx(d,{size:22,"aria-hidden":"true"}),"Trending"]}),s.jsxs("p",{className:"taxonomy-trending-note",children:[n==="task"?"Tasks":"Methods"," across all areas whose share of papers in the last ",i," days grew the most against the preceding ",l," days."]})]}),t?s.jsx(j,{variant:"destructive",children:s.jsxs(m,{children:["Failed to load trending ",n,"s."]})}):o?s.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((a,r)=>s.jsx(p,{className:"h-20"},r))}):s.jsx("div",{className:"tag-grid",children:e==null?void 0:e.map((a,r)=>s.jsxs(h,{to:a.href,className:"tag-cell",children:[s.jsxs("div",{className:"name",style:c?{fontFamily:"var(--mono)",fontSize:15}:void 0,children:[s.jsx("span",{className:"taxonomy-trending-rank",children:r+1}),a.icon&&s.jsx("span",{className:"task-icon",style:{color:a.iconColor},children:s.jsx(a.icon,{size:16,strokeWidth:2,"aria-hidden":"true"})}),a.name]}),s.jsxs("div",{className:"meta taxonomy-trending-meta",children:[a.areaName&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:a.areaName}),s.jsx("span",{children:"·"})]}),s.jsxs("span",{children:[a.recentPaperCount.toLocaleString()," papers / ",i,"d"]}),s.jsx("span",{children:"·"}),s.jsxs("span",{className:"method-trend-score taxonomy-trending-lift",title:`Share of recent papers is ${a.shareLift.toFixed(1)}× its baseline share`,children:[s.jsx(d,{size:12,"aria-hidden":"true"}),a.shareLift.toFixed(1),"×"]})]})]},a.id))})]});function v(n){x.useEffect(()=>{var e;!n||!window.location.hash||(e=document.getElementById(window.location.hash.slice(1)))==null||e.scrollIntoView({block:"start"})},[n])}export{y as T,v as u}; +import{j as s,L as h,f as x}from"./index-CxhY4zQ1.js";import{S as p}from"./skeleton-DdKViE4r.js";import{A as j,a as m}from"./alert-C-NbJX4N.js";import{T as d}from"./trending-up-BaROX4bP.js";const y=({noun:n,items:e,recentDays:i=30,baselineDays:l=180,isLoading:o,error:t,mono:c})=>!o&&!t&&!(e!=null&&e.length)?null:s.jsxs("section",{id:"trending",className:"taxonomy-trending","aria-label":`Trending ${n}s`,children:[s.jsxs("div",{className:"taxonomy-trending-header",children:[s.jsxs("h2",{children:[s.jsx(d,{size:22,"aria-hidden":"true"}),"Trending"]}),s.jsxs("p",{className:"taxonomy-trending-note",children:[n==="task"?"Tasks":"Methods"," across all areas whose share of papers in the last ",i," days grew the most against the preceding ",l," days."]})]}),t?s.jsx(j,{variant:"destructive",children:s.jsxs(m,{children:["Failed to load trending ",n,"s."]})}):o?s.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((a,r)=>s.jsx(p,{className:"h-20"},r))}):s.jsx("div",{className:"tag-grid",children:e==null?void 0:e.map((a,r)=>s.jsxs(h,{to:a.href,className:"tag-cell",children:[s.jsxs("div",{className:"name",style:c?{fontFamily:"var(--mono)",fontSize:15}:void 0,children:[s.jsx("span",{className:"taxonomy-trending-rank",children:r+1}),a.icon&&s.jsx("span",{className:"task-icon",style:{color:a.iconColor},children:s.jsx(a.icon,{size:16,strokeWidth:2,"aria-hidden":"true"})}),a.name]}),s.jsxs("div",{className:"meta taxonomy-trending-meta",children:[a.areaName&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:a.areaName}),s.jsx("span",{children:"·"})]}),s.jsxs("span",{children:[a.recentPaperCount.toLocaleString()," papers / ",i,"d"]}),s.jsx("span",{children:"·"}),s.jsxs("span",{className:"method-trend-score taxonomy-trending-lift",title:`Share of recent papers is ${a.shareLift.toFixed(1)}× its baseline share`,children:[s.jsx(d,{size:12,"aria-hidden":"true"}),a.shareLift.toFixed(1),"×"]})]})]},a.id))})]});function v(n){x.useEffect(()=>{var e;!n||!window.location.hash||(e=document.getElementById(window.location.hash.slice(1)))==null||e.scrollIntoView({block:"start"})},[n])}export{y as T,v as u}; diff --git a/assets/useInfiniteQuery-DYwUEaoz.js b/assets/useInfiniteQuery-vHEhIVF_.js similarity index 94% rename from assets/useInfiniteQuery-DYwUEaoz.js rename to assets/useInfiniteQuery-vHEhIVF_.js index 0efc3553cfd5f03340d2608e76daa62dac7c6ca4..502229c15ced13b015204f4725a33e86aaa2b3ce 100644 --- a/assets/useInfiniteQuery-DYwUEaoz.js +++ b/assets/useInfiniteQuery-vHEhIVF_.js @@ -1 +1 @@ -import{aN as v,aO as x,aP as p,aQ as N}from"./index-3CfcAX6N.js";var b=class extends v{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var f,P;const{state:s}=e,i=super.createResult(e,t),{isFetching:a,isRefetching:g,isError:c,isRefetchError:d}=i,r=(P=(f=s.fetchMeta)==null?void 0:f.fetchMore)==null?void 0:P.direction,h=c&&r==="forward",n=a&&r==="forward",o=c&&r==="backward",u=a&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:p(t,s.data),hasPreviousPage:x(t,s.data),isFetchNextPageError:h,isFetchingNextPage:n,isFetchPreviousPageError:o,isFetchingPreviousPage:u,isRefetchError:d&&!h&&!o,isRefetching:g&&!n&&!u}}};function O(e,t){return N(e,b)}export{O as u}; +import{aN as v,aO as x,aP as p,aQ as N}from"./index-CxhY4zQ1.js";var b=class extends v{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var f,P;const{state:s}=e,i=super.createResult(e,t),{isFetching:a,isRefetching:g,isError:c,isRefetchError:d}=i,r=(P=(f=s.fetchMeta)==null?void 0:f.fetchMore)==null?void 0:P.direction,h=c&&r==="forward",n=a&&r==="forward",o=c&&r==="backward",u=a&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:p(t,s.data),hasPreviousPage:x(t,s.data),isFetchNextPageError:h,isFetchingNextPage:n,isFetchPreviousPageError:o,isFetchingPreviousPage:u,isRefetchError:d&&!h&&!o,isRefetching:g&&!n&&!u}}};function O(e,t){return N(e,b)}export{O as u}; diff --git a/assets/useIntersectionObserver-wAZWG4G7.js b/assets/useIntersectionObserver-ZqjUJuPc.js similarity index 86% rename from assets/useIntersectionObserver-wAZWG4G7.js rename to assets/useIntersectionObserver-ZqjUJuPc.js index ebc7ca1fca9d0a91d021f1908cfa4a2b2271833c..d7ca3544eb966058bfd8d825295d680b765882d1 100644 --- a/assets/useIntersectionObserver-wAZWG4G7.js +++ b/assets/useIntersectionObserver-ZqjUJuPc.js @@ -1 +1 @@ -import{f as r}from"./index-3CfcAX6N.js";function b(u={}){const{threshold:t=0,rootMargin:n="0px"}=u,[i,s]=r.useState(!1),e=r.useRef(null),f=r.useCallback(c=>{if(e.current&&(e.current.disconnect(),e.current=null),!c){s(!1);return}const o=new IntersectionObserver(([l])=>s(l.isIntersecting),{threshold:t,rootMargin:n});o.observe(c),e.current=o},[t,n]);return r.useEffect(()=>()=>{e.current&&(e.current.disconnect(),e.current=null)},[]),{targetRef:f,isIntersecting:i}}export{b as u}; +import{f as r}from"./index-CxhY4zQ1.js";function b(u={}){const{threshold:t=0,rootMargin:n="0px"}=u,[i,s]=r.useState(!1),e=r.useRef(null),f=r.useCallback(c=>{if(e.current&&(e.current.disconnect(),e.current=null),!c){s(!1);return}const o=new IntersectionObserver(([l])=>s(l.isIntersecting),{threshold:t,rootMargin:n});o.observe(c),e.current=o},[t,n]);return r.useEffect(()=>()=>{e.current&&(e.current.disconnect(),e.current=null)},[]),{targetRef:f,isIntersecting:i}}export{b as u}; diff --git a/assets/useMutation-CKC6OFhA.js b/assets/useMutation-BzRfwboV.js similarity index 97% rename from assets/useMutation-CKC6OFhA.js rename to assets/useMutation-BzRfwboV.js index 87939dc7b5a3b37f161693a605c16fdf5b55bf2e..b9e675c328527a7e9c9c2b977d7c3e0bfbc5c639 100644 --- a/assets/useMutation-CKC6OFhA.js +++ b/assets/useMutation-BzRfwboV.js @@ -1 +1 @@ -var R=i=>{throw TypeError(i)};var E=(i,t,s)=>t.has(i)||R("Cannot "+s);var e=(i,t,s)=>(E(i,t,"read from private field"),s?s.call(i):t.get(i)),b=(i,t,s)=>t.has(i)?R("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,s),p=(i,t,s,r)=>(E(i,t,"write to private field"),r?r.call(i,s):t.set(i,s),s),y=(i,t,s)=>(E(i,t,"access private method"),s);import{aB as U,aC as k,aD as j,aE as q,aF as P,l as D,f as v,aG as L,aH as A}from"./index-3CfcAX6N.js";var a,c,o,h,n,g,S,w,B=(w=class extends U{constructor(t,s){super();b(this,n);b(this,a);b(this,c);b(this,o);b(this,h);p(this,a,t),this.setOptions(s),this.bindMethods(),y(this,n,g).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const s=this.options;this.options=e(this,a).defaultMutationOptions(t),k(this.options,s)||e(this,a).getMutationCache().notify({type:"observerOptionsUpdated",mutation:e(this,o),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&j(s.mutationKey)!==j(this.options.mutationKey)?this.reset():((r=e(this,o))==null?void 0:r.state.status)==="pending"&&e(this,o).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=e(this,o))==null||t.removeObserver(this)}onMutationUpdate(t){y(this,n,g).call(this),y(this,n,S).call(this,t)}getCurrentResult(){return e(this,c)}reset(){var t;(t=e(this,o))==null||t.removeObserver(this),p(this,o,void 0),y(this,n,g).call(this),y(this,n,S).call(this)}mutate(t,s){var r;return p(this,h,s),(r=e(this,o))==null||r.removeObserver(this),p(this,o,e(this,a).getMutationCache().build(e(this,a),this.options)),e(this,o).addObserver(this),e(this,o).execute(t)}},a=new WeakMap,c=new WeakMap,o=new WeakMap,h=new WeakMap,n=new WeakSet,g=function(){var s;const t=((s=e(this,o))==null?void 0:s.state)??q();p(this,c,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},S=function(t){P.batch(()=>{var s,r,u,f,d,O,x,K;if(e(this,h)&&this.hasListeners()){const m=e(this,c).variables,C=e(this,c).context,M={client:e(this,a),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(r=(s=e(this,h)).onSuccess)==null||r.call(s,t.data,m,C,M)}catch(l){Promise.reject(l)}try{(f=(u=e(this,h)).onSettled)==null||f.call(u,t.data,null,m,C,M)}catch(l){Promise.reject(l)}}else if((t==null?void 0:t.type)==="error"){try{(O=(d=e(this,h)).onError)==null||O.call(d,t.error,m,C,M)}catch(l){Promise.reject(l)}try{(K=(x=e(this,h)).onSettled)==null||K.call(x,void 0,t.error,m,C,M)}catch(l){Promise.reject(l)}}}this.listeners.forEach(m=>{m(e(this,c))})})},w);function H(i,t){const s=D(),[r]=v.useState(()=>new B(s,i));v.useEffect(()=>{r.setOptions(i)},[r,i]);const u=v.useSyncExternalStore(v.useCallback(d=>r.subscribe(P.batchCalls(d)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),f=v.useCallback((d,O)=>{r.mutate(d,O).catch(L)},[r]);if(u.error&&A(r.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:f,mutateAsync:u.mutate}}export{H as u}; +var R=i=>{throw TypeError(i)};var E=(i,t,s)=>t.has(i)||R("Cannot "+s);var e=(i,t,s)=>(E(i,t,"read from private field"),s?s.call(i):t.get(i)),b=(i,t,s)=>t.has(i)?R("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,s),p=(i,t,s,r)=>(E(i,t,"write to private field"),r?r.call(i,s):t.set(i,s),s),y=(i,t,s)=>(E(i,t,"access private method"),s);import{aB as U,aC as k,aD as j,aE as q,aF as P,l as D,f as v,aG as L,aH as A}from"./index-CxhY4zQ1.js";var a,c,o,h,n,g,S,w,B=(w=class extends U{constructor(t,s){super();b(this,n);b(this,a);b(this,c);b(this,o);b(this,h);p(this,a,t),this.setOptions(s),this.bindMethods(),y(this,n,g).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const s=this.options;this.options=e(this,a).defaultMutationOptions(t),k(this.options,s)||e(this,a).getMutationCache().notify({type:"observerOptionsUpdated",mutation:e(this,o),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&j(s.mutationKey)!==j(this.options.mutationKey)?this.reset():((r=e(this,o))==null?void 0:r.state.status)==="pending"&&e(this,o).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=e(this,o))==null||t.removeObserver(this)}onMutationUpdate(t){y(this,n,g).call(this),y(this,n,S).call(this,t)}getCurrentResult(){return e(this,c)}reset(){var t;(t=e(this,o))==null||t.removeObserver(this),p(this,o,void 0),y(this,n,g).call(this),y(this,n,S).call(this)}mutate(t,s){var r;return p(this,h,s),(r=e(this,o))==null||r.removeObserver(this),p(this,o,e(this,a).getMutationCache().build(e(this,a),this.options)),e(this,o).addObserver(this),e(this,o).execute(t)}},a=new WeakMap,c=new WeakMap,o=new WeakMap,h=new WeakMap,n=new WeakSet,g=function(){var s;const t=((s=e(this,o))==null?void 0:s.state)??q();p(this,c,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},S=function(t){P.batch(()=>{var s,r,u,f,d,O,x,K;if(e(this,h)&&this.hasListeners()){const m=e(this,c).variables,C=e(this,c).context,M={client:e(this,a),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(r=(s=e(this,h)).onSuccess)==null||r.call(s,t.data,m,C,M)}catch(l){Promise.reject(l)}try{(f=(u=e(this,h)).onSettled)==null||f.call(u,t.data,null,m,C,M)}catch(l){Promise.reject(l)}}else if((t==null?void 0:t.type)==="error"){try{(O=(d=e(this,h)).onError)==null||O.call(d,t.error,m,C,M)}catch(l){Promise.reject(l)}try{(K=(x=e(this,h)).onSettled)==null||K.call(x,void 0,t.error,m,C,M)}catch(l){Promise.reject(l)}}}this.listeners.forEach(m=>{m(e(this,c))})})},w);function H(i,t){const s=D(),[r]=v.useState(()=>new B(s,i));v.useEffect(()=>{r.setOptions(i)},[r,i]);const u=v.useSyncExternalStore(v.useCallback(d=>r.subscribe(P.batchCalls(d)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),f=v.useCallback((d,O)=>{r.mutate(d,O).catch(L)},[r]);if(u.error&&A(r.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:f,mutateAsync:u.mutate}}export{H as u}; diff --git a/assets/usePapers-CHoHKyWP.js b/assets/usePapers-Cv13R7ph.js similarity index 63% rename from assets/usePapers-CHoHKyWP.js rename to assets/usePapers-Cv13R7ph.js index b763dd51443486ba6df8845342215725a7fc95a4..8cbf0b76d39ba7433af32bad41f3d78536792788 100644 --- a/assets/usePapers-CHoHKyWP.js +++ b/assets/usePapers-Cv13R7ph.js @@ -1 +1 @@ -import{b as s,T as u,p as i}from"./index-3CfcAX6N.js";import{u as m}from"./useInfiniteQuery-DYwUEaoz.js";import{p as o}from"./papers-BsYlGUQi.js";function g(e,t=!0){return s({queryKey:i.detail(e),queryFn:()=>o.get(e),enabled:t&&!!e,staleTime:u})}function y(e,t,{enabled:n=!0,initialPage:p=1}={}){return m({queryKey:e,queryFn:({pageParam:a})=>t(a),initialPageParam:p,getNextPageParam:a=>a.next_page??void 0,enabled:n,staleTime:5*60*1e3,placeholderData:(a,r)=>(r==null?void 0:r.queryKey[0])===e[0]?a:void 0})}export{g as a,y as u}; +import{b as s,T as u,p as i}from"./index-CxhY4zQ1.js";import{u as m}from"./useInfiniteQuery-vHEhIVF_.js";import{p as o}from"./papers-BDxSKSYJ.js";function g(e,t=!0){return s({queryKey:i.detail(e),queryFn:()=>o.get(e),enabled:t&&!!e,staleTime:u})}function y(e,t,{enabled:n=!0,initialPage:p=1}={}){return m({queryKey:e,queryFn:({pageParam:a})=>t(a),initialPageParam:p,getNextPageParam:a=>a.next_page??void 0,enabled:n,staleTime:5*60*1e3,placeholderData:(a,r)=>(r==null?void 0:r.queryKey[0])===e[0]?a:void 0})}export{g as a,y as u}; diff --git a/index.html b/index.html index cc9256937cbd11cf04076f033f81724db2ed1cc1..e93c9b0fe7c2e3ede6d043048f446cfe82e97ca0 100644 --- a/index.html +++ b/index.html @@ -72,7 +72,7 @@ plausible.init(); })(); - +