diff --git a/assets/AgentLogos-BjOw21yN.js b/assets/AgentLogos-DCE1drFe.js similarity index 99% rename from assets/AgentLogos-BjOw21yN.js rename to assets/AgentLogos-DCE1drFe.js index 8a5e81a511a7589c18a21d7ef408808c1fbf6c20..4bccd2d1e1bda94ae88024c1d9092936ce3bbe76 100644 --- a/assets/AgentLogos-BjOw21yN.js +++ b/assets/AgentLogos-DCE1drFe.js @@ -1 +1 @@ -import{j as e}from"./index-Ba3erEGJ.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-UJSMyFje.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-dLGfFkt7.js b/assets/AiDeadlinesView-D6fo2hqw.js similarity index 96% rename from assets/AiDeadlinesView-dLGfFkt7.js rename to assets/AiDeadlinesView-D6fo2hqw.js index f95c240167fba996491adf72e333d0df27f5bff6..16cab73655f68533ca5ecdd841c21fa9748d4f9c 100644 --- a/assets/AiDeadlinesView-dLGfFkt7.js +++ b/assets/AiDeadlinesView-D6fo2hqw.js @@ -1,3 +1,3 @@ -import{d as g,j as t,b as R,T as A}from"./index-Ba3erEGJ.js";import{c as L}from"./catalog-DrZhs4eC.js";import{S as B}from"./switch-tyjzliQR.js";import{S as U}from"./skeleton-HWnr28Ly.js";import{A as W,a as M}from"./alert-DftukI1b.js";import{s as $}from"./safeExternalHref-CkBrsh84.js";import{D as O,a as V,c as P,b as G,d as H}from"./dialog-ChZD9naX.js";import{s as K,n as S,f as _,p as Y,u as N,l as k,a as I,c as b,D as q,b as z,d as Q}from"./deadlines-BH32v7D1.js";import"./index-Cf9alo2v.js";const w={fontFamily:"var(--mono)",fontSize:10,letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--ink-faint)"},J=(e,l)=>{const s=Math.ceil((e-l)/q);return s<=0?"passed":`${s} ${s===1?"day":"days"}`},F=(e,l)=>{const s=_(e.start_date,e.end_date),r=e.venue||[e.city,e.country].filter(Boolean).join(", ");return[`${l.label||l.type||"Deadline"} for ${e.name}`,s?`Dates: ${s}`:null,r?`Location: ${r}`:null,e.url?`Website: ${e.url}`:null].filter(Boolean).join(` +import{d as g,j as t,b as R,T as A}from"./index-UJSMyFje.js";import{c as L}from"./catalog-Dsah5Rrt.js";import{S as B}from"./switch-DnXKOkEG.js";import{S as U}from"./skeleton-CFPwaPrc.js";import{A as W,a as M}from"./alert-B1JnXYJB.js";import{s as $}from"./safeExternalHref-CkBrsh84.js";import{D as O,a as V,c as P,b as G,d as H}from"./dialog-BodVIP1P.js";import{s as K,n as S,f as _,p as Y,u as N,l as k,a as I,c as b,D as q,b as z,d as Q}from"./deadlines-BH32v7D1.js";import"./index-Mqdf1wPX.js";const w={fontFamily:"var(--mono)",fontSize:10,letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--ink-faint)"},J=(e,l)=>{const s=Math.ceil((e-l)/q);return s<=0?"passed":`${s} ${s===1?"day":"days"}`},F=(e,l)=>{const s=_(e.start_date,e.end_date),r=e.venue||[e.city,e.country].filter(Boolean).join(", ");return[`${l.label||l.type||"Deadline"} for ${e.name}`,s?`Dates: ${s}`:null,r?`Location: ${r}`:null,e.url?`Website: ${e.url}`:null].filter(Boolean).join(` `)},C=e=>e.toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,""),X=(e,l)=>{const s=new Date(l.deadline_at),r=new Date(s.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${l.label||l.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=${C(s)}/${C(r)}&details=${encodeURIComponent(F(e,l))}&location=${encodeURIComponent(h)}`,p=$(n);p&&window.open(p,"_blank","noopener,noreferrer")},Z=(e,l)=>{const s=new Date(l.deadline_at),r=new Date(s.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${l.label||l.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:${C(s)}`,`DTEND:${C(r)}`,`SUMMARY:${o}`,`DESCRIPTION:${F(e,l).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)},ee=({conf:e,open:l,onOpenChange:s})=>{const[r,o]=g.useState(()=>Date.now());g.useEffect(()=>{if(!l)return;o(Date.now());const i=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(i)},[l]);const h=g.useMemo(()=>e?K(e):[],[e]),n=g.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(O,{open:l,onOpenChange:s,children:t.jsx(V,{className:"max-w-xl",style:{background:"var(--bg-elevated)",maxHeight:"85vh",overflowY:"auto"},children:e&&t.jsxs(t.Fragment,{children:[t.jsxs(P,{children:[t.jsx(G,{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(H,{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:Y(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:"No deadlines listed"}):h.map((i,c)=>{const y=new Date(i.deadline_at).getTime(),a=n!=null&&i.deadline_at===n.deadline_at&&i.type===n.type,u=y<=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:[I(i.deadline_at),i.timezone?` · ${i.timezone}`:""]})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,fontWeight:600,whiteSpace:"nowrap",color:N(u?null:y,r)},children:J(y,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:()=>X(e,n),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Google Calendar"}),t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>Z(e,n),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Apple / .ics"})]})]})]})]})})})},E=({id:e,label:l,checked:s,onChange:r})=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[t.jsx(B,{id:e,checked:s,onCheckedChange:r}),t.jsx("label",{htmlFor:e,style:{cursor:"pointer"},children:l})]}),te=({conf:e,now:l,selectedDomains:s,onToggleDomain:r,onOpen:o})=>{const h=S(e,l),n=h??z(e),p=n?new Date(n.deadline_at).getTime():null,d=N(h?p:null,l),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)||"Deadline"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:n?`${I(n.deadline_at)}${n.timezone?` · ${n.timezone}`:""}`:"TBD"})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:14,fontWeight:600,color:d,whiteSpace:"nowrap"},children:p!=null?Q(p,l):"TBD"})]}),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 y=s.has(c);return t.jsx("button",{className:"tag-chip",onClick:a=>{a.stopPropagation(),r(c)},style:{background:y?"var(--ink)":"var(--bg-subtle)",color:y?"var(--bg)":"var(--ink-soft)"},children:k(c)},c)})})]})},pe=()=>{const[e,l]=g.useState(!0),[s,r]=g.useState(!1),[o,h]=g.useState(new Set),[n,p]=g.useState(null),d=g.useMemo(()=>Date.now(),[]),m=R({queryKey:["conference-deadlines"],queryFn:()=>L.conferenceDeadlines(),staleTime:A}),i=a=>{h(u=>{const x=new Set(u);return x.has(a)?x.delete(a):x.add(a),x})},c=g.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]),y=g.useMemo(()=>{var j;const u=(((j=m.data)==null?void 0:j.results)??[]).filter(f=>!(e&&f.tier!=="a"||o.size>0&&!b(f).some(v=>o.has(v))||!s&&!S(f,d))),x=f=>{const D=S(f,d);if(D)return{group:0,time:new Date(D.deadline_at).getTime()};const v=z(f);return{group:1,time:-(v?new Date(v.deadline_at).getTime():0)}};return[...u].sort((f,D)=>{const v=x(f),T=x(D);return v.group!==T.group?v.group-T.group:v.time-T.time})},[m.data,e,s,o,d]);return m.error?t.jsx("div",{className:"page",children:t.jsx(W,{variant:"destructive",children:t.jsx(M,{children:"Failed to load conference deadlines. Please try again."})})}):t.jsxs("div",{className:"page",children:[t.jsx("div",{className:"feed-header",children:t.jsxs("div",{children:[t.jsxs("h1",{className:"feed-title",children:["AI Conference ",t.jsx("em",{children:"Deadlines"})]}),t.jsx("div",{className:"feed-subtitle",children:"Upcoming submission deadlines for major AI conferences, counting down."})]})}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:20,padding:"16px 0",borderBottom:"1px solid var(--hairline)",marginBottom:24},children:[t.jsx(E,{id:"top-tier-only",label:"Top tier only",checked:e,onChange:l}),t.jsx(E,{id:"show-past",label:"Show past conferences",checked:s,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?"…":`${y.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(U,{className:"h-44"},u))}):y.length===0?t.jsxs("div",{className:"no-results",children:["No conferences match these filters",s?".":" — try enabling “Show past conferences”."]}):t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:y.map(a=>t.jsx(te,{conf:a,now:d,selectedDomains:o,onToggleDomain:i,onOpen:p},a.id))}),t.jsx(ee,{conf:n,open:n!==null,onOpenChange:a=>{a||p(null)}})]})};export{pe as default}; diff --git a/assets/ApiDocsView-_-YW6hmY.js b/assets/ApiDocsView-CGJojwAl.js similarity index 98% rename from assets/ApiDocsView-_-YW6hmY.js rename to assets/ApiDocsView-CGJojwAl.js index f0a5b9c51c6f6f6b6cdfce401d939e26c46eea18..6f6a6af6cca6e07c7760251fef24bafe5c1f805b 100644 --- a/assets/ApiDocsView-_-YW6hmY.js +++ b/assets/ApiDocsView-CGJojwAl.js @@ -1,4 +1,4 @@ -import{ac as m,b as f,d as h,j as e}from"./index-Ba3erEGJ.js";import{u as g}from"./useDocumentTitle-CJWZHe8w.js";import{M as y}from"./index-Bc8fO69p.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,d as h,j as e}from"./index-UJSMyFje.js";import{u as g}from"./useDocumentTitle-BSodmmbQ.js";import{M as y}from"./index-DBb3IysA.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-C1JWPNIG.js b/assets/AreaSection-GuFqPtDa.js similarity index 88% rename from assets/AreaSection-C1JWPNIG.js rename to assets/AreaSection-GuFqPtDa.js index 2284f251d162c6112bb293ff178757ec304568d1..e41f616968a610f51fe98b6692765c04f82b375c 100644 --- a/assets/AreaSection-C1JWPNIG.js +++ b/assets/AreaSection-GuFqPtDa.js @@ -1 +1 @@ -import{j as s}from"./index-Ba3erEGJ.js";import{S as l}from"./skeleton-HWnr28Ly.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-UJSMyFje.js";import{S as l}from"./skeleton-CFPwaPrc.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-C6GRjjgP.js b/assets/AstraForRoboticsView-BaVrHGWL.js similarity index 89% rename from assets/AstraForRoboticsView-C6GRjjgP.js rename to assets/AstraForRoboticsView-BaVrHGWL.js index 6e52c64352efc80e1e587147d0b9c873bebffa5b..82cab71ed55ccb8e7de52ec8b5aacd86575b56b4 100644 --- a/assets/AstraForRoboticsView-C6GRjjgP.js +++ b/assets/AstraForRoboticsView-BaVrHGWL.js @@ -1 +1 @@ -import{p,d as u,j as a,L as o}from"./index-Ba3erEGJ.js";import{u as g,b as x,a as b}from"./PaperFeed-BJ9VCI43.js";import{A as f,a as j}from"./alert-DftukI1b.js";import{u as y}from"./usePapers-MJ0ibwsa.js";import{p as v}from"./papers-BS2bC1xn.js";import{u as k,f as w}from"./useDocumentTitle-CJWZHe8w.js";import{t as A}from"./transform-CLQo0OXf.js";import"./PaperCard-cfN4cMqP.js";import"./AuthorAvatar-7M5dWdHD.js";import"./SotaBadges-jHwP4qBt.js";import"./colors-BkWRhvFI.js";import"./Icon-B7TPsKGh.js";import"./LatexTitle-ZavI0vgc.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-DmIp_t7d.js";import"./skeleton-HWnr28Ly.js";import"./useIntersectionObserver-CEcObYrC.js";import"./useInfiniteQuery-BSM2sFVO.js";import"./curation-BzdOQbkp.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(f,{variant:"destructive",children:a.jsx(j,{children:"Failed to load the collection. Please try again."})}):a.jsx(b,{query:e,cards:t,empty:"No papers match this selection yet."})]})};export{B as default}; +import{p,d as u,j as a,L as o}from"./index-UJSMyFje.js";import{u as g,b as x,a as b}from"./PaperFeed-DCI8gGsr.js";import{A as f,a as j}from"./alert-B1JnXYJB.js";import{u as y}from"./usePapers-CWb1CFyQ.js";import{p as v}from"./papers-CDbCMm0m.js";import{u as k,f as w}from"./useDocumentTitle-BSodmmbQ.js";import{t as A}from"./transform-C3_Sl_p2.js";import"./PaperCard-DaYJC8Bk.js";import"./AuthorAvatar-B-tDeLM5.js";import"./SotaBadges-Bu3EIx-o.js";import"./colors-BkWRhvFI.js";import"./Icon-BoCHdPFA.js";import"./LatexTitle-rKci1b5e.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-BTFxRv7H.js";import"./skeleton-CFPwaPrc.js";import"./useIntersectionObserver-Akbgy6EK.js";import"./useInfiniteQuery-SD8FlI5O.js";import"./curation-B0_XT_FL.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(f,{variant:"destructive",children:a.jsx(j,{children:"Failed to load the collection. Please try again."})}):a.jsx(b,{query:e,cards:t,empty:"No papers match this selection yet."})]})};export{B as default}; diff --git a/assets/AuthorAvatar-7M5dWdHD.js b/assets/AuthorAvatar-B-tDeLM5.js similarity index 86% rename from assets/AuthorAvatar-7M5dWdHD.js rename to assets/AuthorAvatar-B-tDeLM5.js index e2940225e2cc8eb9f53af9b2fbdee3da8f78fe84..412e8b2374231eb107525bf14a97a7fab955954b 100644 --- a/assets/AuthorAvatar-7M5dWdHD.js +++ b/assets/AuthorAvatar-B-tDeLM5.js @@ -1 +1 @@ -import{d as c,j as r}from"./index-Ba3erEGJ.js";const p=a=>a!=null&&a.startsWith("https://")&&!a.startsWith("https://huggingface.co/avatars/")?a:null,g=({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{g as A}; +import{d as c,j as r}from"./index-UJSMyFje.js";const p=a=>a!=null&&a.startsWith("https://")&&!a.startsWith("https://huggingface.co/avatars/")?a:null,g=({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{g as A}; diff --git a/assets/AuthorDetailView-D6_HYb4K.js b/assets/AuthorDetailView-hYbe3RKy.js similarity index 76% rename from assets/AuthorDetailView-D6_HYb4K.js rename to assets/AuthorDetailView-hYbe3RKy.js index 1881e51cf0d34dd8b545cdca33d311d920cda743..75ba682ac14f015bd5f14726a29c76e07f6f4f79 100644 --- a/assets/AuthorDetailView-D6_HYb4K.js +++ b/assets/AuthorDetailView-hYbe3RKy.js @@ -1 +1 @@ -import{u as b,j as a,b as N,p as v,d as F,ao as y,L as A}from"./index-Ba3erEGJ.js";import{A as k}from"./AuthorAvatar-7M5dWdHD.js";import{u as P,b as $,a as S}from"./PaperFeed-BJ9VCI43.js";import{R as L}from"./ResearchFollowButton-DXt6Qpt5.js";import{A as R,a as w}from"./alert-DftukI1b.js";import{S as z}from"./skeleton-HWnr28Ly.js";import{u as C}from"./usePapers-MJ0ibwsa.js";import{p as m}from"./papers-BS2bC1xn.js";import{i as H}from"./apiErrors-CPeTQuQC.js";import{t as q}from"./transform-CLQo0OXf.js";import f from"./NotFound-B3EehO4t.js";import"./PaperCard-cfN4cMqP.js";import"./SotaBadges-jHwP4qBt.js";import"./colors-BkWRhvFI.js";import"./Icon-B7TPsKGh.js";import"./LatexTitle-ZavI0vgc.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-DmIp_t7d.js";import"./useIntersectionObserver-CEcObYrC.js";import"./researchTopic-CMY-StWV.js";import"./useMutation-BEHPbJP-.js";import"./plus-iAFjdNIx.js";import"./useInfiniteQuery-BSM2sFVO.js";import"./curation-BzdOQbkp.js";const Q=({authorId:r})=>{var n,i,l,p,c,d,h,u;const o=P(),{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(k,{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,d as F,ao as y,L as A}from"./index-UJSMyFje.js";import{A as k}from"./AuthorAvatar-B-tDeLM5.js";import{u as P,b as $,a as S}from"./PaperFeed-DCI8gGsr.js";import{R as L}from"./ResearchFollowButton-Cn7bhIam.js";import{A as R,a as w}from"./alert-B1JnXYJB.js";import{S as z}from"./skeleton-CFPwaPrc.js";import{u as C}from"./usePapers-CWb1CFyQ.js";import{p as m}from"./papers-CDbCMm0m.js";import{i as H}from"./apiErrors-DXz1vC-X.js";import{t as q}from"./transform-C3_Sl_p2.js";import f from"./NotFound-CyT6FuD7.js";import"./PaperCard-DaYJC8Bk.js";import"./SotaBadges-Bu3EIx-o.js";import"./colors-BkWRhvFI.js";import"./Icon-BoCHdPFA.js";import"./LatexTitle-rKci1b5e.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-BTFxRv7H.js";import"./useIntersectionObserver-Akbgy6EK.js";import"./researchTopic-DWD5gtip.js";import"./useMutation-BZfxMmoZ.js";import"./plus-DvxtHJU_.js";import"./useInfiniteQuery-SD8FlI5O.js";import"./curation-B0_XT_FL.js";const Q=({authorId:r})=>{var n,i,l,p,c,d,h,u;const o=P(),{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(k,{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-Cq1DcUql.js b/assets/AuthorizePaperEditView-C_CCc6DX.js similarity index 87% rename from assets/AuthorizePaperEditView-Cq1DcUql.js rename to assets/AuthorizePaperEditView-C_CCc6DX.js index 599648313be7e1c9997ece1ffe65a6a025d50ab2..27f7d61de21d1932a4f8567d21c244690a98d01e 100644 --- a/assets/AuthorizePaperEditView-Cq1DcUql.js +++ b/assets/AuthorizePaperEditView-C_CCc6DX.js @@ -1 +1 @@ -import{u,a as d,b as l,j as e,L as p,H as c}from"./index-Ba3erEGJ.js";import{u as h}from"./useMutation-BEHPbJP-.js";import{B as g}from"./button-Dvq5drsi.js";import{p as n}from"./paperEdits-XD13WwNK.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-UJSMyFje.js";import{u as h}from"./useMutation-BZfxMmoZ.js";import{B as g}from"./button-CIbfeiDg.js";import{p as n}from"./paperEdits-YrKMd5r3.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-C9LX_q_o.js b/assets/AutonomousOperations-CKUsh2Ag.js similarity index 94% rename from assets/AutonomousOperations-C9LX_q_o.js rename to assets/AutonomousOperations-CKUsh2Ag.js index 95ed5094292391257a3a912620b4693b79c73dd9..c1e5ce362350944d9e4db705eff594ac93513b55 100644 --- a/assets/AutonomousOperations-C9LX_q_o.js +++ b/assets/AutonomousOperations-CKUsh2Ag.js @@ -1 +1 @@ -import{i as R,d,b as B,J as C,j as e,L as q}from"./index-Ba3erEGJ.js";import{u as Q}from"./useMutation-BEHPbJP-.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-DHBDO3qC.js";import{B as I}from"./badge-Cjyk4r9x.js";import{B as h}from"./button-Dvq5drsi.js";import{I as u}from"./input-wEykysM6.js";import{A as P}from"./activity-BAgDG_PZ.js";import{A as D}from"./arrow-left-BsmWH9rO.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{i as R,d,b as B,J as C,j as e,L as q}from"./index-UJSMyFje.js";import{u as Q}from"./useMutation-BZfxMmoZ.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-DR0j7-EG.js";import{B as I}from"./badge-Blda41S-.js";import{B as h}from"./button-CIbfeiDg.js";import{I as u}from"./input-C9lvFHZR.js";import{A as P}from"./activity-CrJg4hka.js";import{A as D}from"./arrow-left-0-cN70MP.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-DzybbikG.js b/assets/BenchmarkDetailView-Dlbzw_1F.js similarity index 98% rename from assets/BenchmarkDetailView-DzybbikG.js rename to assets/BenchmarkDetailView-Dlbzw_1F.js index b580e2584b23774e64eb57098c04a7dd9f9ca6dd..8c0dcf8f3af6e681dc29004a6c987f3015e8d0c9 100644 --- a/assets/BenchmarkDetailView-DzybbikG.js +++ b/assets/BenchmarkDetailView-Dlbzw_1F.js @@ -1,2 +1,2 @@ -import{d as L,j as a,M as le,L as ne,e as dt,x as ut,u as mt,g as ht,b as te,o as de,t as ft,T as oe}from"./index-Ba3erEGJ.js";import{R as pt}from"./ResearchFollowButton-DXt6Qpt5.js";import{c as re}from"./catalog-DrZhs4eC.js";import{C as gt,E as xt,e as bt}from"./ExternalSourceEvalBadge-BJcbRwqY.js";import{u as yt}from"./preferences-VZbz27zI.js";import{L as ce}from"./LatexTitle-ZavI0vgc.js";import{S as Ge}from"./switch-tyjzliQR.js";import{I as wt}from"./Icon-B7TPsKGh.js";import{S as ue}from"./skeleton-HWnr28Ly.js";import{A as vt,a as jt}from"./alert-DftukI1b.js";import{B as _t}from"./BenchmarkTrendSparkline-DUyuuDoa.js";import{s as St}from"./safeExternalHref-CkBrsh84.js";import{s as kt}from"./slug-BpH-Nkvz.js";import{i as Ct}from"./apiErrors-CPeTQuQC.js";import Et from"./NotFound-B3EehO4t.js";import"./researchTopic-CMY-StWV.js";import"./useMutation-BEHPbJP-.js";import"./plus-iAFjdNIx.js";import"./curation-BzdOQbkp.js";import"./hover-card-C6ObQOHL.js";import"./account-CKlWxNaZ.js";import"./index-Cf9alo2v.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{d as L,j as a,M as le,L as ne,e as dt,x as ut,u as mt,g as ht,b as te,o as de,t as ft,T as oe}from"./index-UJSMyFje.js";import{R as pt}from"./ResearchFollowButton-Cn7bhIam.js";import{c as re}from"./catalog-Dsah5Rrt.js";import{C as gt,E as xt,e as bt}from"./ExternalSourceEvalBadge-CV4FV0f1.js";import{u as yt}from"./preferences-C-HGVwrj.js";import{L as ce}from"./LatexTitle-rKci1b5e.js";import{S as Ge}from"./switch-DnXKOkEG.js";import{I as wt}from"./Icon-BoCHdPFA.js";import{S as ue}from"./skeleton-CFPwaPrc.js";import{A as vt,a as jt}from"./alert-B1JnXYJB.js";import{B as _t}from"./BenchmarkTrendSparkline-Bj_0iVvJ.js";import{s as St}from"./safeExternalHref-CkBrsh84.js";import{s as kt}from"./slug-BpH-Nkvz.js";import{i as Ct}from"./apiErrors-DXz1vC-X.js";import Et from"./NotFound-CyT6FuD7.js";import"./researchTopic-DWD5gtip.js";import"./useMutation-BZfxMmoZ.js";import"./plus-DvxtHJU_.js";import"./curation-B0_XT_FL.js";import"./hover-card-DcL7U8NI.js";import"./account-Ds_mpAFf.js";import"./index-Mqdf1wPX.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-DUyuuDoa.js b/assets/BenchmarkTrendSparkline-Bj_0iVvJ.js similarity index 97% rename from assets/BenchmarkTrendSparkline-DUyuuDoa.js rename to assets/BenchmarkTrendSparkline-Bj_0iVvJ.js index 8092465b965d13cc9dd21bffd2c7938b4a92ea35..5698fb1951b0d36c1479b94deabe64c1c351bf25 100644 --- a/assets/BenchmarkTrendSparkline-DUyuuDoa.js +++ b/assets/BenchmarkTrendSparkline-Bj_0iVvJ.js @@ -1 +1 @@ -import{d as C,j as t}from"./index-Ba3erEGJ.js";const g=112,p=42,o=5,m=5,b=new Intl.DateTimeFormat("en",{month:"short",timeZone:"UTC"}),y=(e,d)=>{const r=new Date(`${e}T00:00:00Z`),n=new Date(`${d}T00:00:00Z`);return r.getUTCMonth()===n.getUTCMonth()?`${b.format(r)} ${r.getUTCDate()}–${n.getUTCDate()}`:`${b.format(r)} ${r.getUTCDate()}–${b.format(n)} ${n.getUTCDate()}`},I=({history:e,benchmarkName:d,interactive:r=!1})=>{const[n,x]=C.useState(null),h=e.map(s=>s.paper_count),M=Math.max(1,...h),f=g-o*2,T=p-m*2,v=h.length>1?f/(h.length-1):0,a=h.map((s,c)=>({x:o+v*c,y:m+T-s/M*T})),$=a.map(({x:s,y:c})=>`${s},${c}`).join(" "),_=a.length?`${o},${p-m} ${$} ${a[a.length-1].x},${p-m}`:"",D=h.reduce((s,c)=>s+c,0),u=49,N=14,i=n==null?null:a[n],j=i?Math.min(g-o-u,Math.max(o,i.x-u/2)):0,k=i?i.y>p/2?i.y-N-3:i.y+3:0;return t.jsxs("svg",{className:`benchmark-trend-sparkline${r?" is-interactive":""}`,viewBox:`0 0 ${g} ${p}`,role:r?"group":"img","aria-label":`${d}: ${D} reporting papers across the displayed trend history`,children:[t.jsxs("title",{children:[d,": ",D," reporting papers across the displayed trend history"]}),t.jsx("line",{className:"benchmark-trend-axis",x1:o,y1:p-m,x2:g-o,y2:p-m}),t.jsx("line",{className:"benchmark-trend-axis",x1:o,y1:m,x2:o,y2:p-m}),_&&t.jsx("polygon",{className:"benchmark-trend-area",points:_}),$&&t.jsx("polyline",{className:"benchmark-trend-line",points:$}),r?a.map(({x:s,y:c},l)=>t.jsxs("g",{className:"benchmark-trend-point",tabIndex:0,role:"img","aria-label":`${y(e[l].start_date,e[l].end_date)}: ${e[l].paper_count} ${e[l].paper_count===1?"paper":"papers"}`,onMouseEnter:()=>x(l),onMouseLeave:()=>x(null),onFocus:()=>x(l),onBlur:()=>x(null),children:[t.jsx("circle",{className:"benchmark-trend-point-hit",cx:s,cy:c,r:"5"}),t.jsx("circle",{className:"benchmark-trend-point-mark",cx:s,cy:c,r:"1.8"})]},`${e[l].start_date}-${e[l].end_date}`)):a.length>0&&t.jsx("circle",{className:"benchmark-trend-dot",cx:a[a.length-1].x,cy:a[a.length-1].y,r:"2.6"}),i&&n!=null&&t.jsxs("g",{className:"benchmark-trend-tooltip",pointerEvents:"none",children:[t.jsx("rect",{x:j,y:k,width:u,height:N,rx:"2"}),t.jsx("text",{x:j+3,y:k+5.4,children:y(e[n].start_date,e[n].end_date)}),t.jsxs("text",{className:"benchmark-trend-tooltip-value",x:j+3,y:k+11,children:[e[n].paper_count," ",e[n].paper_count===1?"paper":"papers"]})]})]})};export{I as B}; +import{d as C,j as t}from"./index-UJSMyFje.js";const g=112,p=42,o=5,m=5,b=new Intl.DateTimeFormat("en",{month:"short",timeZone:"UTC"}),y=(e,d)=>{const r=new Date(`${e}T00:00:00Z`),n=new Date(`${d}T00:00:00Z`);return r.getUTCMonth()===n.getUTCMonth()?`${b.format(r)} ${r.getUTCDate()}–${n.getUTCDate()}`:`${b.format(r)} ${r.getUTCDate()}–${b.format(n)} ${n.getUTCDate()}`},I=({history:e,benchmarkName:d,interactive:r=!1})=>{const[n,x]=C.useState(null),h=e.map(s=>s.paper_count),M=Math.max(1,...h),f=g-o*2,T=p-m*2,v=h.length>1?f/(h.length-1):0,a=h.map((s,c)=>({x:o+v*c,y:m+T-s/M*T})),$=a.map(({x:s,y:c})=>`${s},${c}`).join(" "),_=a.length?`${o},${p-m} ${$} ${a[a.length-1].x},${p-m}`:"",D=h.reduce((s,c)=>s+c,0),u=49,N=14,i=n==null?null:a[n],j=i?Math.min(g-o-u,Math.max(o,i.x-u/2)):0,k=i?i.y>p/2?i.y-N-3:i.y+3:0;return t.jsxs("svg",{className:`benchmark-trend-sparkline${r?" is-interactive":""}`,viewBox:`0 0 ${g} ${p}`,role:r?"group":"img","aria-label":`${d}: ${D} reporting papers across the displayed trend history`,children:[t.jsxs("title",{children:[d,": ",D," reporting papers across the displayed trend history"]}),t.jsx("line",{className:"benchmark-trend-axis",x1:o,y1:p-m,x2:g-o,y2:p-m}),t.jsx("line",{className:"benchmark-trend-axis",x1:o,y1:m,x2:o,y2:p-m}),_&&t.jsx("polygon",{className:"benchmark-trend-area",points:_}),$&&t.jsx("polyline",{className:"benchmark-trend-line",points:$}),r?a.map(({x:s,y:c},l)=>t.jsxs("g",{className:"benchmark-trend-point",tabIndex:0,role:"img","aria-label":`${y(e[l].start_date,e[l].end_date)}: ${e[l].paper_count} ${e[l].paper_count===1?"paper":"papers"}`,onMouseEnter:()=>x(l),onMouseLeave:()=>x(null),onFocus:()=>x(l),onBlur:()=>x(null),children:[t.jsx("circle",{className:"benchmark-trend-point-hit",cx:s,cy:c,r:"5"}),t.jsx("circle",{className:"benchmark-trend-point-mark",cx:s,cy:c,r:"1.8"})]},`${e[l].start_date}-${e[l].end_date}`)):a.length>0&&t.jsx("circle",{className:"benchmark-trend-dot",cx:a[a.length-1].x,cy:a[a.length-1].y,r:"2.6"}),i&&n!=null&&t.jsxs("g",{className:"benchmark-trend-tooltip",pointerEvents:"none",children:[t.jsx("rect",{x:j,y:k,width:u,height:N,rx:"2"}),t.jsx("text",{x:j+3,y:k+5.4,children:y(e[n].start_date,e[n].end_date)}),t.jsxs("text",{className:"benchmark-trend-tooltip-value",x:j+3,y:k+11,children:[e[n].paper_count," ",e[n].paper_count===1?"paper":"papers"]})]})]})};export{I as B}; diff --git a/assets/CatalogEntityPreviewLink-CuEpk2Oj.js b/assets/CatalogEntityPreviewLink-YOdjuCTK.js similarity index 97% rename from assets/CatalogEntityPreviewLink-CuEpk2Oj.js rename to assets/CatalogEntityPreviewLink-YOdjuCTK.js index b2048e46de643d6c73ffe51babcc92e16ec33376..b6a3efd66c9cd15d676864e1d7c3a57c4c928699 100644 --- a/assets/CatalogEntityPreviewLink-CuEpk2Oj.js +++ b/assets/CatalogEntityPreviewLink-YOdjuCTK.js @@ -1,4 +1,4 @@ -import{s as m,a5 as h,V as d,b as g,j as s,L as f,a3 as k}from"./index-Ba3erEGJ.js";import{H as w,a as y,b as v}from"./hover-card-C6ObQOHL.js";import{c as l}from"./catalog-DrZhs4eC.js";/** +import{s as m,a5 as h,V as d,b as g,j as s,L as f,a3 as k}from"./index-UJSMyFje.js";import{H as w,a as y,b as v}from"./hover-card-DcL7U8NI.js";import{c as l}from"./catalog-Dsah5Rrt.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/ChatView-BQ45-L03.js b/assets/ChatView-DeFesjnR.js similarity index 98% rename from assets/ChatView-BQ45-L03.js rename to assets/ChatView-DeFesjnR.js index 9fd236f6fea8c7686635fbdb1c3c9958aef755a8..70a1e290129f9710d444f8bfa72f25cbe1be4fd1 100644 --- a/assets/ChatView-BQ45-L03.js +++ b/assets/ChatView-DeFesjnR.js @@ -1,4 +1,4 @@ -var It=Object.defineProperty;var Nt=(t,e,r)=>e in t?It(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var se=(t,e,r)=>Nt(t,typeof e!="symbol"?e+"":e,r);import{s as Dt,d as l,j as s,X as yt,x as bt,b as Re,L as wt,_ as Lt,$ as Ft,a0 as Pt,a1 as nt,V as Oe,g as vt,e as St,q as _t,i as xt,h as Bt,a as Et,u as Ot,A as qt}from"./index-Ba3erEGJ.js";import{C as Ut,U as at,b as Ht,f as Ce,A as Wt,a as zt,c as Kt,g as Qt,h as Vt,i as Pe,j as Yt,k as it,t as $t,l as Gt,E as Xt,m as Jt,n as Zt,o as ot}from"./chatLifecycle-C8zlIZya.js";import{g as Ie,h as es,j as Ct,k as ts,T as ss,e as Rt,l as Te,m as We,r as rs,n as ns,o as oe,D as ze,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 ct,H as jt,I as lt,J as Ke,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 _s}from"./chatSessions-Br4UCLSi.js";import{M as xs}from"./McpShowcase-DwcLwAEJ.js";import{c as ce}from"./chat-CI3_nFJ5.js";import{S as Es}from"./share-2-D02XQP6n.js";import{u as qe}from"./useMutation-BEHPbJP-.js";import{u as Cs,O as Rs}from"./openrouter-BIhbXzcI.js";/* empty css */import"./hover-card-C6ObQOHL.js";import"./CatalogEntityPreviewLink-CuEpk2Oj.js";import"./catalog-DrZhs4eC.js";import"./github-BUiEiKpk.js";import"./file-text-DM3Ql8Fd.js";import"./PaperPreviewLink-ByPUM9fv.js";import"./index-Bc8fO69p.js";import"./index-C2GWM2ou.js";import"./katex-DkKDou_j.js";import"./papers-BS2bC1xn.js";import"./curation-BzdOQbkp.js";import"./thumbs-up-h-vAxpty.js";import"./copy-Bq1_hWMk.js";import"./queryOptions-C9woPjwX.js";import"./arrow-left-BsmWH9rO.js";import"./external-link-BfaqusWk.js";import"./plus-iAFjdNIx.js";import"./search-Cv_XFprT.js";import"./chevron-up-35j15Hwd.js";import"./AuthorAvatar-7M5dWdHD.js";import"./AgentLogos-BjOw21yN.js";/** +var It=Object.defineProperty;var Nt=(t,e,r)=>e in t?It(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var se=(t,e,r)=>Nt(t,typeof e!="symbol"?e+"":e,r);import{s as Dt,d as l,j as s,X as yt,x as bt,b as Re,L as wt,_ as Lt,$ as Ft,a0 as Pt,a1 as nt,V as Oe,g as vt,e as St,q as _t,i as xt,h as Bt,a as Et,u as Ot,A as qt}from"./index-UJSMyFje.js";import{C as Ut,U as at,b as Ht,f as Ce,A as Wt,a as zt,c as Kt,g as Qt,h as Vt,i as Pe,j as Yt,k as it,t as $t,l as Gt,E as Xt,m as Jt,n as Zt,o as ot}from"./chatLifecycle-gicVSKa7.js";import{g as Ie,h as es,j as Ct,k as ts,T as ss,e as Rt,l as Te,m as We,r as rs,n as ns,o as oe,D as ze,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 ct,H as jt,I as lt,J as Ke,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 _s}from"./chatSessions-DXNWRdeo.js";import{M as xs}from"./McpShowcase-C8eMjqSr.js";import{c as ce}from"./chat-DqN1V6Hp.js";import{S as Es}from"./share-2-IWsEjGnT.js";import{u as qe}from"./useMutation-BZfxMmoZ.js";import{u as Cs,O as Rs}from"./openrouter-Dr8-_BKq.js";/* empty css */import"./hover-card-DcL7U8NI.js";import"./CatalogEntityPreviewLink-YOdjuCTK.js";import"./catalog-Dsah5Rrt.js";import"./github-BbEMdbmg.js";import"./file-text-3syNYWxm.js";import"./PaperPreviewLink-DUxQx42a.js";import"./index-DBb3IysA.js";import"./index-BFkgjGcF.js";import"./katex-DkKDou_j.js";import"./papers-CDbCMm0m.js";import"./curation-B0_XT_FL.js";import"./thumbs-up-BfFDCpmk.js";import"./copy-D02KQGwg.js";import"./queryOptions-C9woPjwX.js";import"./arrow-left-0-cN70MP.js";import"./external-link-C2oGmjcr.js";import"./plus-DvxtHJU_.js";import"./search-pO5JVRc5.js";import"./chevron-up-Cy3JEUmg.js";import"./AuthorAvatar-B-tDeLM5.js";import"./AgentLogos-DCE1drFe.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/ConferenceDetailView-BSPNE-5n.js b/assets/ConferenceDetailView-Dnv7xpYD.js similarity index 82% rename from assets/ConferenceDetailView-BSPNE-5n.js rename to assets/ConferenceDetailView-Dnv7xpYD.js index 2c9257854c5717b7e718da15f92f4ffb99d1b3b5..a1c0112746df8e1e1d68d3e43cd52622166d86f3 100644 --- a/assets/ConferenceDetailView-BSPNE-5n.js +++ b/assets/ConferenceDetailView-Dnv7xpYD.js @@ -1 +1 @@ -import{u as y,b as k,d as _,j as e,L as h,T as S}from"./index-Ba3erEGJ.js";import{a as f,A as b,b as E}from"./AreaSection-C1JWPNIG.js";import{M as j}from"./MarkdownText-FuN1EKHi.js";import{c as A}from"./catalog-DrZhs4eC.js";import{i as C}from"./apiErrors-CPeTQuQC.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-BH32v7D1.js";import{d as D}from"./transform-CLQo0OXf.js";import{S as P}from"./skeleton-HWnr28Ly.js";import{A as M,a as R}from"./alert-DftukI1b.js";import{s as B}from"./safeExternalHref-CkBrsh84.js";import I from"./NotFound-B3EehO4t.js";/* empty css */import"./PaperPreviewLink-ByPUM9fv.js";import"./index-Bc8fO69p.js";import"./index-C2GWM2ou.js";import"./katex-DkKDou_j.js";import"./hover-card-C6ObQOHL.js";import"./papers-BS2bC1xn.js";import"./curation-BzdOQbkp.js";import"./useMutation-BEHPbJP-.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,d as _,j as e,L as h,T as S}from"./index-UJSMyFje.js";import{a as f,A as b,b as E}from"./AreaSection-GuFqPtDa.js";import{M as j}from"./MarkdownText-Bn8aftJG.js";import{c as A}from"./catalog-Dsah5Rrt.js";import{i as C}from"./apiErrors-DXz1vC-X.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-BH32v7D1.js";import{d as D}from"./transform-C3_Sl_p2.js";import{S as P}from"./skeleton-CFPwaPrc.js";import{A as M,a as R}from"./alert-B1JnXYJB.js";import{s as B}from"./safeExternalHref-CkBrsh84.js";import I from"./NotFound-CyT6FuD7.js";/* empty css */import"./PaperPreviewLink-DUxQx42a.js";import"./index-DBb3IysA.js";import"./index-BFkgjGcF.js";import"./katex-DkKDou_j.js";import"./hover-card-DcL7U8NI.js";import"./papers-CDbCMm0m.js";import"./curation-B0_XT_FL.js";import"./useMutation-BZfxMmoZ.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-CDKsZawH.js b/assets/ConferenceTaskView-BVRrZXYl.js similarity index 79% rename from assets/ConferenceTaskView-CDKsZawH.js rename to assets/ConferenceTaskView-BVRrZXYl.js index 24e7094b2211aa7727aa071def402b2e0919d6bb..e39411bb312b1c778912e736167441f46effaaf6 100644 --- a/assets/ConferenceTaskView-CDKsZawH.js +++ b/assets/ConferenceTaskView-BVRrZXYl.js @@ -1 +1 @@ -import{u as S,b as _,p as R,d as C,j as e,L as x,o as M,T as E}from"./index-Ba3erEGJ.js";import{u as L,b as Q,a as q}from"./PaperFeed-BJ9VCI43.js";import{M as g}from"./MarkdownText-FuN1EKHi.js";import{c as F}from"./catalog-DrZhs4eC.js";import{p as B}from"./papers-BS2bC1xn.js";import{i as A}from"./apiErrors-CPeTQuQC.js";import{C as O}from"./conferenceListings-BnmhBx-_.js";import{t as z,d as H}from"./transform-CLQo0OXf.js";import{u as I}from"./usePapers-MJ0ibwsa.js";import{A as K,a as $}from"./alert-DftukI1b.js";import V from"./NotFound-B3EehO4t.js";import"./PaperCard-cfN4cMqP.js";import"./AuthorAvatar-7M5dWdHD.js";import"./SotaBadges-jHwP4qBt.js";import"./colors-BkWRhvFI.js";import"./Icon-B7TPsKGh.js";import"./LatexTitle-ZavI0vgc.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-DmIp_t7d.js";import"./skeleton-HWnr28Ly.js";import"./useIntersectionObserver-CEcObYrC.js";/* empty css */import"./PaperPreviewLink-ByPUM9fv.js";import"./index-Bc8fO69p.js";import"./index-C2GWM2ou.js";import"./katex-DkKDou_j.js";import"./hover-card-C6ObQOHL.js";import"./useMutation-BEHPbJP-.js";import"./curation-BzdOQbkp.js";import"./useInfiniteQuery-BSM2sFVO.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,d as C,j as e,L as x,o as M,T as E}from"./index-UJSMyFje.js";import{u as L,b as Q,a as q}from"./PaperFeed-DCI8gGsr.js";import{M as g}from"./MarkdownText-Bn8aftJG.js";import{c as F}from"./catalog-Dsah5Rrt.js";import{p as B}from"./papers-CDbCMm0m.js";import{i as A}from"./apiErrors-DXz1vC-X.js";import{C as O}from"./conferenceListings-BnmhBx-_.js";import{t as z,d as H}from"./transform-C3_Sl_p2.js";import{u as I}from"./usePapers-CWb1CFyQ.js";import{A as K,a as $}from"./alert-B1JnXYJB.js";import V from"./NotFound-CyT6FuD7.js";import"./PaperCard-DaYJC8Bk.js";import"./AuthorAvatar-B-tDeLM5.js";import"./SotaBadges-Bu3EIx-o.js";import"./colors-BkWRhvFI.js";import"./Icon-BoCHdPFA.js";import"./LatexTitle-rKci1b5e.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-BTFxRv7H.js";import"./skeleton-CFPwaPrc.js";import"./useIntersectionObserver-Akbgy6EK.js";/* empty css */import"./PaperPreviewLink-DUxQx42a.js";import"./index-DBb3IysA.js";import"./index-BFkgjGcF.js";import"./katex-DkKDou_j.js";import"./hover-card-DcL7U8NI.js";import"./useMutation-BZfxMmoZ.js";import"./curation-B0_XT_FL.js";import"./useInfiniteQuery-SD8FlI5O.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-CbRa2EOU.js b/assets/ConferencesIndexView-DFmaDKPw.js similarity index 76% rename from assets/ConferencesIndexView-CbRa2EOU.js rename to assets/ConferencesIndexView-DFmaDKPw.js index 63a2ae9e9ac98da8c706036960db85cd8afb8386..59369e70548a19e99f555121e5c784cb3985aac2 100644 --- a/assets/ConferencesIndexView-CbRa2EOU.js +++ b/assets/ConferencesIndexView-DFmaDKPw.js @@ -1 +1 @@ -import{b as d,d as m,j as e,L as c,T as p}from"./index-Ba3erEGJ.js";import{c as u}from"./catalog-DrZhs4eC.js";import{f}from"./deadlines-BH32v7D1.js";import{A as h,a as x}from"./alert-DftukI1b.js";import{A as g,a as j}from"./AreaSection-C1JWPNIG.js";import{T as N}from"./TaxonomySuggestionTile-CiMXTa8j.js";import"./skeleton-HWnr28Ly.js";import"./SignInToEditDialog-XDg1xPWL.js";import"./button-Dvq5drsi.js";import"./input-wEykysM6.js";import"./textarea-bNIL0Bcb.js";import"./searchable-select-CjSbtAzP.js";import"./popover-DmIp_t7d.js";import"./dialog-ChZD9naX.js";import"./search-Cv_XFprT.js";import"./loader-circle-ChybJ0KP.js";import"./useMutation-BEHPbJP-.js";import"./submissions-D9Ty3arc.js";import"./plus-iAFjdNIx.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,d as m,j as e,L as c,T as p}from"./index-UJSMyFje.js";import{c as u}from"./catalog-Dsah5Rrt.js";import{f}from"./deadlines-BH32v7D1.js";import{A as h,a as x}from"./alert-B1JnXYJB.js";import{A as g,a as j}from"./AreaSection-GuFqPtDa.js";import{T as N}from"./TaxonomySuggestionTile-D09uiSgJ.js";import"./skeleton-CFPwaPrc.js";import"./SignInToEditDialog-WalvYyhX.js";import"./button-CIbfeiDg.js";import"./input-C9lvFHZR.js";import"./textarea-BC68vWsz.js";import"./searchable-select-BatELYUf.js";import"./popover-BTFxRv7H.js";import"./dialog-BodVIP1P.js";import"./search-pO5JVRc5.js";import"./loader-circle-l5JFsbEa.js";import"./useMutation-BZfxMmoZ.js";import"./submissions-DozYdY52.js";import"./plus-DvxtHJU_.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-DHBDO3qC.js b/assets/CronDashboard-DR0j7-EG.js similarity index 97% rename from assets/CronDashboard-DHBDO3qC.js rename to assets/CronDashboard-DR0j7-EG.js index 91f6cc7a4e1026bc63eb03712f63caefe0ea8e94..592ebdaa3e2a56e9e4d192e911a8d944878509b3 100644 --- a/assets/CronDashboard-DHBDO3qC.js +++ b/assets/CronDashboard-DR0j7-EG.js @@ -1,4 +1,4 @@ -import{s as c,d as a,j as r,I as n,ac as u}from"./index-Ba3erEGJ.js";/** +import{s as c,d as a,j as r,I as n,ac as u}from"./index-UJSMyFje.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/CronDashboard-ChRfGclc.js b/assets/CronDashboard-UU9elSMh.js similarity index 98% rename from assets/CronDashboard-ChRfGclc.js rename to assets/CronDashboard-UU9elSMh.js index 4398ed68db878054b891c9058536c4c480109fa1..cd1ae3495966ef496509296c4098d7c0cfb1c9ca 100644 --- a/assets/CronDashboard-ChRfGclc.js +++ b/assets/CronDashboard-UU9elSMh.js @@ -1,4 +1,4 @@ -import{s as O,d 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 $,i as xe,A as Re,L as pe,a as hs,q as xs}from"./index-Ba3erEGJ.js";import{u as P}from"./useMutation-BEHPbJP-.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-DHBDO3qC.js";import{B as D}from"./badge-Cjyk4r9x.js";import{B as y}from"./button-Dvq5drsi.js";import{C as ps,a as gs}from"./chevron-up-35j15Hwd.js";import{D as fe}from"./database-S18Pv0JO.js";import{T as js}from"./trending-up-DXFkPm8S.js";import{A as ne}from"./activity-BAgDG_PZ.js";import{F as Ne}from"./file-text-DM3Ql8Fd.js";import{T as Ee,I as vs}from"./triangle-alert-D4uF0BJ0.js";import{E as Y}from"./external-link-BfaqusWk.js";import{C as Z,R as be}from"./refresh-cw-B-hwdprb.js";import{L as R}from"./loader-circle-ChybJ0KP.js";import{C as je}from"./circle-check-Dg57zcLs.js";import{c as M,A as _s}from"./codex-Bs8D2HX-.js";import{u as fs}from"./useInfiniteQuery-BSM2sFVO.js";import{p as Me}from"./paperEdits-XD13WwNK.js";import{c as me}from"./catalog-DrZhs4eC.js";import{c as ye}from"./chat-CI3_nFJ5.js";/** +import{s as O,d 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 $,i as xe,A as Re,L as pe,a as hs,q as xs}from"./index-UJSMyFje.js";import{u as P}from"./useMutation-BZfxMmoZ.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-DR0j7-EG.js";import{B as D}from"./badge-Blda41S-.js";import{B as y}from"./button-CIbfeiDg.js";import{C as ps,a as gs}from"./chevron-up-Cy3JEUmg.js";import{D as fe}from"./database-BhnoZEjS.js";import{T as js}from"./trending-up-Yn_2_YaT.js";import{A as ne}from"./activity-CrJg4hka.js";import{F as Ne}from"./file-text-3syNYWxm.js";import{T as Ee,I as vs}from"./triangle-alert-CHI1ovss.js";import{E as Y}from"./external-link-C2oGmjcr.js";import{C as Z,R as be}from"./refresh-cw-BnBjJTkI.js";import{L as R}from"./loader-circle-l5JFsbEa.js";import{C as je}from"./circle-check-4v9OryJ8.js";import{c as M,A as _s}from"./codex-DMtU2dT2.js";import{u as fs}from"./useInfiniteQuery-SD8FlI5O.js";import{p as Me}from"./paperEdits-YrKMd5r3.js";import{c as me}from"./catalog-Dsah5Rrt.js";import{c as ye}from"./chat-DqN1V6Hp.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/ExternalSourceEvalBadge-BJcbRwqY.js b/assets/ExternalSourceEvalBadge-CV4FV0f1.js similarity index 94% rename from assets/ExternalSourceEvalBadge-BJcbRwqY.js rename to assets/ExternalSourceEvalBadge-CV4FV0f1.js index dae221c4b9853292db2f6ff2388ffc48b9b0c743..152a9d00ad91bfb17a0c8812ccbbcbe584277767 100644 --- a/assets/ExternalSourceEvalBadge-BJcbRwqY.js +++ b/assets/ExternalSourceEvalBadge-CV4FV0f1.js @@ -1 +1 @@ -import{p as o}from"./curation-BzdOQbkp.js";import{ac as g,j as a,L as l}from"./index-Ba3erEGJ.js";import{H as u,a as c,b as d}from"./hover-card-C6ObQOHL.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-B0_XT_FL.js";import{ac as g,j as a,L as l}from"./index-UJSMyFje.js";import{H as u,a as c,b as d}from"./hover-card-DcL7U8NI.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-7yx8iXq9.js b/assets/FeedView-7yx8iXq9.js new file mode 100644 index 0000000000000000000000000000000000000000..23fc67493ab08a87a4425f5a36bf2df75e5c53f7 --- /dev/null +++ b/assets/FeedView-7yx8iXq9.js @@ -0,0 +1 @@ +import{j as e,L as F,a as _e,c as Pe,b as H,r as ie,d as p,h as Ce,C as Ee,T as Q,e as ye,f as Fe,g as Le,p as me,i as Ae,k as De,l as ne,m as je,n as Re,o as Me}from"./index-UJSMyFje.js";import{S as qe}from"./sparkles-C-mZg8SQ.js";import{D as Ie,a as Oe,b as He}from"./dialog-BodVIP1P.js";import{c as J}from"./catalog-Dsah5Rrt.js";import{u as ve,a as Ne,b as Se,T as he,s as $e,c as ze,r as ee,d as ge,e as fe,f as Ke}from"./researchTopic-DWD5gtip.js";import{d as re,t as Be}from"./transform-C3_Sl_p2.js";import{P as Ue}from"./plus-DvxtHJU_.js";import{A as Ge}from"./arrow-right-DdcCN24Z.js";import{r as Qe,P as We,w as Xe,a as Ye}from"./PaperFeed-DCI8gGsr.js";import{M as Ze}from"./McpShowcase-C8eMjqSr.js";import{u as Ve,a as Je,P as es,i as ss,A as ts,b as as,S as $,c as os,D as se,q as is,d as ns}from"./chatSessions-DXNWRdeo.js";import{c as rs}from"./chat-DqN1V6Hp.js";import{u as ls}from"./usePapers-CWb1CFyQ.js";import{p as cs}from"./papers-CDbCMm0m.js";import{S as te}from"./skeleton-CFPwaPrc.js";import{A as ae,a as oe}from"./alert-B1JnXYJB.js";import"./useMutation-BZfxMmoZ.js";import"./PaperCard-DaYJC8Bk.js";import"./AuthorAvatar-B-tDeLM5.js";import"./SotaBadges-Bu3EIx-o.js";import"./colors-BkWRhvFI.js";import"./Icon-BoCHdPFA.js";import"./LatexTitle-rKci1b5e.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-BTFxRv7H.js";import"./useIntersectionObserver-Akbgy6EK.js";import"./AgentLogos-DCE1drFe.js";import"./useInfiniteQuery-SD8FlI5O.js";import"./curation-B0_XT_FL.js";function ds({onBuild:m}){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 a topic 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."}),m&&e.jsxs("button",{type:"button",className:"research-topic-save following-intro-topic",onClick:m,children:[e.jsx(qe,{"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(F,{to:"/settings",children:"Settings"}),"."]})]})}const xe=16;function us({open:m,onOpenChange:o}){return e.jsx(Ie,{open:m,onOpenChange:o,children:e.jsx(Oe,{className:"topic-dialog","aria-describedby":void 0,children:e.jsx(ps,{onDone:()=>o(!1)})})})}function ps({onDone:m}){var W,X,Y,Z,O,z,B;const{user:o}=_e(),h=Pe(),r=H({queryKey:ie.topic(o==null?void 0:o.hf_subject),queryFn:ee.topic,enabled:!!o}),t=ve(),w=H({queryKey:["trending-tasks-follow"],queryFn:()=>J.trendingTasks({limit:xe,level:0}),staleTime:Q}),y=H({queryKey:["trending-methods-follow"],queryFn:()=>J.trendingMethods({limit:xe}),staleTime:Q}),l=H({queryKey:["research-follow-suggestions"],queryFn:ee.followSuggestions,staleTime:Q}),v=(n=[])=>n.map(d=>({id:String(d.entity_id),name:d.name,image:d.image_url})),[S,L]=p.useState(null),[_,j]=p.useState([]),P=Ne(),M=Se(),b=((W=r.data)==null?void 0:W.text)??"",i=S??b,c=i.trim().replace(/\s+/g," "),C=((X=r.data)==null?void 0:X.status)==="failed"&&c===b,A=c.length>=3&&(c!==b||C),D=P.isPending||M.isPending,a=(n,d)=>{var N;return((N=t.data)==null?void 0:N.some(k=>k.kind===n&&String(k.entity_id)===d))??!1},g=(n,d)=>{var N;return((N=_.find(k=>k.kind===n&&k.id===d))==null?void 0:N.follow)??a(n,d)},f=_.filter(n=>n.follow!==a(n.kind,n.id)),E=!D&&(A||f.length>0),R=(n,d,N)=>j(k=>[...k.filter(U=>U.kind!==n||U.id!==d),{kind:n,id:d,name:N,follow:!g(n,d)}]),q=()=>{if(!E)return;if(!o){A&&$e(c),f.length&&ze(f),window.location.href=Ce(`${h.pathname}${h.search}`);return}const n=[...f.length?[M.mutateAsync(f)]:[],...A?[P.mutateAsync(c)]:[]];Promise.allSettled(n).then(d=>{d.every(N=>N.status==="fulfilled")&&m()})},I=(n,d,N,k)=>{const V=[...(t.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})),...N.filter(x=>!a(d,x.id)).map(x=>({...x,suggested:!0}))];return V.length>0&&e.jsxs("div",{className:"topic-dialog-group",children:[e.jsx("h3",{children:n}),e.jsxs(ms,{children:[V.map(x=>{const G=g(d,x.id),K=d==="task"?re(x.name,x.slug??void 0):x.name;return e.jsxs("button",{type:"button",className:"topic-dialog-chip","aria-pressed":G,disabled:D,"data-suggested":"suggested"in x||void 0,onClick:()=>R(d,x.id,K),children:[G?e.jsx(Ee,{"aria-hidden":"true"}):e.jsx(Ue,{"aria-hidden":"true"}),(d==="author"||d==="organization")&&e.jsx(hs,{kind:d,name:K,src:x.image}),K]},x.id)}),k&&e.jsxs(F,{to:k.to,className:"topic-dialog-browse",children:[k.label,e.jsx(Ge,{"aria-hidden":"true"})]})]})]})};return e.jsxs("form",{className:"topic-dialog-form",onSubmit:n=>{n.preventDefault(),q()},children:[e.jsx(He,{className:"topic-dialog-title",children:b||(Y=t.data)!=null&&Y.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:"Describe a topic in your own words"})}),e.jsx("p",{className:"topic-dialog-hint",children:"A model reads every new paper and adds the ones that match to your Following feed."}),e.jsx("textarea",{id:"topic-dialog-input",className:"research-topic-input",rows:4,maxLength:he,"aria-label":"Research topic",placeholder:"e.g. diffusion policies for robot manipulation, or speculative decoding for LLM inference",value:i,onChange:n=>L(n.target.value),onKeyDown:n=>{n.key==="Enter"&&!n.shiftKey&&!n.nativeEvent.isComposing&&(n.preventDefault(),q())}}),e.jsxs("span",{className:"research-topic-count",children:[i.length,"/",he]})]}),I("Trending tasks","task",((Z=w.data)==null?void 0:Z.results)??[],{to:"/tasks",label:"Browse tasks"}),I("Trending methods","method",((O=y.data)==null?void 0:O.results)??[],{to:"/methods",label:"Browse methods"}),I("Benchmarks","benchmark",[],{to:"/tasks",label:"Browse benchmarks"}),I("Popular authors","author",v((z=l.data)==null?void 0:z.authors)),I("Popular organizations","organization",v((B=l.data)==null?void 0:B.organizations),{to:"/organizations",label:"Browse organizations"}),(P.error||M.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:[b&&e.jsx("button",{type:"button",className:"research-follow-action topic-dialog-remove",disabled:D,onClick:()=>P.mutate(null,{onSuccess:m}),children:"Remove topic"}),e.jsx("button",{type:"button",className:"research-follow-action",disabled:D,onClick:m,children:"Cancel"}),e.jsx("button",{type:"submit",className:"research-topic-save",disabled:!E,children:f.some(n=>n.follow===!1)?"Save":f.length?"Follow":C?"Retry":b?"Update topic":"Follow"})]})]})}function ms({children:m}){const o=p.useRef(null);return p.useLayoutEffect(()=>{const h=o.current;if(!h)return;const r=()=>{const t=[...h.children],w=t.filter(l=>l.dataset.suggested);w.forEach(l=>{l.hidden=!1});const y=()=>new Set(t.filter(l=>!l.hidden).map(l=>l.offsetTop)).size;for(let l=w.length-1;l>=0&&y()>2;l--)w[l].hidden=!0};return r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)}),e.jsx("div",{ref:o,className:"topic-dialog-chips",children:m})}function hs({kind:m,name:o,src:h}){const[r,t]=p.useState(!1);if(h&&!r)return e.jsx("img",{className:`topic-dialog-chip-image is-${m}`,src:h,alt:"",loading:"lazy",onError:()=>t(!0)});if(m!=="author")return null;const w=o.split(/\s+/).filter(Boolean).map(y=>y[0]).slice(0,2).join("").toUpperCase();return e.jsx("span",{className:"topic-dialog-chip-image is-author is-initials","aria-hidden":"true",children:w})}const we=45,gs=1800,fs=25,xs=350,ws=m=>{const[o,h]=p.useState($[0].slice(0,1)),[r,t]=p.useState(0);return p.useEffect(()=>{var L,_;if(!m)return;if((_=(L=window.matchMedia)==null?void 0:L.call(window,"(prefers-reduced-motion: reduce)"))!=null&&_.matches){h($[0]),t(0);return}let w=0,y=1,l=!1,v;h($[0].slice(0,y)),t(0);const S=()=>{const j=$[w];if(!l){if(y+=1,h(j.slice(0,y)),y===j.length){l=!0,v=window.setTimeout(S,gs);return}v=window.setTimeout(S,we);return}if(y-=1,h(j.slice(0,y)),y===0){l=!1,w=(w+1)%$.length,t(w),v=window.setTimeout(S,xs);return}v=window.setTimeout(S,fs)};return v=window.setTimeout(S,we),()=>window.clearTimeout(v)},[m]),{placeholder:o,prompt:$[r]}},bs=()=>{var D;const m=ye(),o=je(),[h,r]=p.useState({text:"",paperMentions:[]}),t=h.text,[w,y]=p.useState(0),[l,v]=p.useState(!1),[S,L]=p.useState(null),{placeholder:_,prompt:j}=ws(!t),P=p.useRef(null),M=H({queryKey:["chatAvailability"],queryFn:()=>rs.getAvailability(),retry:!1,enabled:ne()}),b=ne()&&((D=M.data)==null?void 0:D.paper_mentions_enabled)!==!1,i=Ve({draft:h,onChange:r,enabled:b,textareaRef:P}),c=Je(h,i.open),C=t?c.completion:j;p.useLayoutEffect(()=>{const a=P.current;if(!a)return;const g=()=>{if(a.style.height="auto",t){a.style.height=`${Math.min(os(a),160)}px`;return}const f=a.placeholder,E=$.reduce((R,q)=>(a.placeholder=q,Math.max(R,a.scrollHeight)),0);a.placeholder=f,a.style.height=`${Math.min(E,160)}px`};return g(),window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)},[t,C]);const A=async(a=h)=>{const g=a.text.trim();if(!(!g||l)){if(o){const f=new URLSearchParams({q:g,model:se}),E=`${Re}?${f}`,R=window.open(E,"_blank");if(!R){L(E);return}R.opener=null,L(null),r({text:"",paperMentions:[]});return}v(!0),is(a,se);try{const f=await ns(se);m(`/chat/${f.id}`)}catch{m("/chat")}}};return e.jsxs(e.Fragment,{children:[!o&&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(es,{text:h.text,mentions:h.paperMentions,scrollTop:w,variant:"home",completion:t?C:""}),e.jsx("textarea",{ref:P,rows:1,value:t,placeholder:_,"aria-label":"Ask the assistant",disabled:l,onChange:a=>{i.updateText(a.target.value,a.target.selectionStart),c.trackCaret(a.target)},onSelect:a=>{i.refresh(a.currentTarget.selectionStart),c.trackCaret(a.currentTarget)},onClick:a=>{i.refresh(a.currentTarget.selectionStart),c.trackCaret(a.currentTarget)},onScroll:a=>y(a.currentTarget.scrollTop),onBlur:a=>{var g,f;(f=(g=a.relatedTarget)==null?void 0:g.closest)!=null&&f.call(g,".chat-paper-picker")||window.setTimeout(i.close,0)},onKeyDown:a=>{if(!i.keyDown(a)){if(ss(a)&&C){a.preventDefault();const g=t+C;i.updateText(g,g.length),window.requestAnimationFrame(()=>{var f;return(f=P.current)==null?void 0:f.setSelectionRange(g.length,g.length)});return}a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),A())}},role:b?"combobox":void 0,"aria-expanded":b?i.open:void 0,"aria-controls":i.open?i.pickerId:void 0,"aria-activedescendant":i.open&&i.results.length?`${i.optionIdPrefix}-${i.activeIndex}`:void 0,"aria-autocomplete":b?"list":void 0,"aria-describedby":i.message?"ask-home-paper-mention-message":void 0})]}),e.jsx("button",{type:"button",className:`chat-send${t.trim()?" chat-send-on":""}`,onClick:()=>void A(),disabled:!t.trim()||l,"aria-label":"Ask the assistant",children:e.jsx(ts,{})})]}),S&&e.jsx("div",{className:"chat-paper-mention-message",role:"alert",children:e.jsx("a",{href:S,target:"_blank",rel:"noreferrer",children:"Open this question on paperswithcode.co"})}),i.message&&e.jsx("div",{id:"ask-home-paper-mention-message",className:"chat-paper-mention-message",role:"alert",children:i.message}),e.jsx(as,{open:i.open,query:i.query,results:i.results,activeIndex:i.activeIndex,loading:i.loading,error:i.error,onSelect:i.select,id:i.pickerId,optionIdPrefix:i.optionIdPrefix})]})]})},ke={task:"Tasks",method:"Methods",benchmark:"Benchmarks",author:"Authors",organization:"Orgs"},ys=Object.keys(ke),js=30,be=40,vs=async m=>{const o=await m;return{results:o.results.map(h=>({paper:h})),next_page:o.next_page}},Ns=({mode:m})=>{var G,K,le,ce,de,ue,pe;const o=m==="following",h=ye(),r=Fe(),t=r==null?void 0:r.user,[w,y]=Le(),l=Qe(w,void 0,m==="trending"?"week":"month"),v=s=>{const u=new URLSearchParams(w);u.delete("order_by"),u.delete("only");const T=u.toString();h(T?`${s}?${T}`:s)},S=s=>{const u=new URLSearchParams(w);s?u.set("only","topic"):u.delete("only");const T=u.toString();return T?`/following?${T}`:"/following"},L=H({queryKey:Me.topTasksSidebar,queryFn:()=>J.topTasks(8),staleTime:Q}),_=H({queryKey:["trending-tasks-sidebar"],queryFn:()=>J.trendingTasks({limit:8,level:0,min_recent_papers:10}),staleTime:Q}),j=o&&w.get("only")==="topic",P={start_date:l.startDate,end_date:l.endDate},M={...l,topicOnly:j},b=ls(o?[...me.feeds.following,t==null?void 0:t.hf_subject,M]:[...me.feeds.trending,P],async s=>{if(o){const T=await ee.following(s,M),Te=T.length===be?s+be:null;return{results:T,next_page:Te}}const u={...P,page:s,page_size:js,include_resources:!0};return vs(cs.list({...u,order_by:"trending",order_dir:"desc",latest_only:!0}))},{enabled:!o||!!t,initialPage:o?0:1}),i=ve(o),c=H({queryKey:ie.topic(t==null?void 0:t.hf_subject),queryFn:ee.topic,enabled:o&&!!t,refetchInterval:s=>s.state.data&&["pending","running"].includes(s.state.data.status)?1e4:!1}),C=!!c.data&&["pending","running"].includes(c.data.status),A=c.data?c.data.label??c.data.text:"",[D,a]=p.useState(!1),g=Ae(),f=p.useRef(!1);p.useEffect(()=>{f.current&&!C&&g.invalidateQueries({queryKey:ie.feed(t==null?void 0:t.hf_subject)}),f.current=C},[C,g,t==null?void 0:t.hf_subject]);const E=o&&!!t&&((G=i.data)==null?void 0:G.length)===0&&c.isSuccess&&!c.data,R=o&&!(r!=null&&r.isLoading)&&!t||E,q=!!t||!De(),[I,W]=p.useState(!1),[X]=p.useState(()=>!!ge()||fe().length>0),[Y,Z]=p.useState(!1);!I&&(c.data||(K=i.data)!=null&&K.length)&&W(!0),R&&!Y&&(Z(!0),q&&!I&&!X&&a(!0));const O=Ne(),{mutate:z}=O,B=p.useRef(!1);p.useEffect(()=>{var u;const s=ge();!t||!c.isSuccess||!s||B.current||(B.current=!0,s===((u=c.data)==null?void 0:u.text)?Ke():z(s))},[t,c.isSuccess,c.data,z]);const n=Se(),{mutate:d}=n,N=p.useRef(!1);p.useEffect(()=>{const s=fe();!t||!s.length||N.current||(N.current=!0,d(s))},[t,d]);const k=p.useMemo(()=>ys.map(s=>{var u;return{kind:s,follows:o?((u=i.data)==null?void 0:u.filter(T=>T.kind===s))??[]:[]}}).filter(s=>s.follows.length>0),[o,i.data]),U=o&&(!!(r!=null&&r.isLoading)||!!t&&!E),V=p.useMemo(()=>{var s;return((s=b.data)==null?void 0:s.pages.flatMap(u=>u.results.map(T=>({...Be(T.paper),followReasons:T.reasons}))))??[]},[b.data]),x=b.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:[U?e.jsxs("div",{className:"sidebar-section sidebar-section-follows",children:[e.jsx("div",{className:"sidebar-label",children:"You follow"}),((r==null?void 0:r.isLoading)||i.isLoading)&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:4}).map((s,u)=>e.jsx(te,{className:"h-5 w-full"},u))}),i.isError&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"Couldn't load your follows."}),e.jsxs("div",{className:"sidebar-links",children:[c.data&&e.jsxs("div",{className:`sidebar-follow-topic ${j?"active":""}`,children:[e.jsxs(F,{to:S(!j),className:"sidebar-link sidebar-follow-link",title:j?"Show papers from everything you follow":`Show only papers about “${c.data.text}”`,"aria-current":j?"true":void 0,children:[e.jsx("span",{className:"sidebar-follow-kind",children:"Topic"}),e.jsx("span",{className:"sidebar-follow-name",children:A})]}),e.jsx("button",{type:"button",className:"sidebar-follow-edit","aria-label":"Edit topic","aria-expanded":D,onClick:()=>a(!0),children:"edit"})]}),k.map(s=>e.jsxs("div",{className:"sidebar-follow-group",children:[e.jsx("span",{className:"sidebar-follow-kind",children:ke[s.kind]}),s.follows.map(u=>e.jsx(F,{to:u.url,className:"sidebar-link sidebar-follow-link",children:e.jsx("span",{className:"sidebar-follow-name",children:u.name})},u.entity_id))]},s.kind))]}),e.jsx(F,{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"}),L.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,u)=>e.jsx(te,{className:"h-5 w-full"},u))}),e.jsxs("div",{className:"sidebar-links",children:[(le=L.data)==null?void 0:le.map(s=>e.jsxs(F,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[re(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(F,{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"}),_.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,u)=>e.jsx(te,{className:"h-5 w-full"},u))}),((de=(ce=_.data)==null?void 0:ce.results)==null?void 0:de.length)===0&&!_.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:(pe=(ue=_.data)==null?void 0:ue.results)==null?void 0:pe.map(s=>e.jsxs(F,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[re(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))})]})]}),e.jsx(Ze,{})]}),e.jsxs("div",{className:"feed-main",children:[(ne()||je())&&e.jsx("div",{className:"feed-chat",children:e.jsx(bs,{})}),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 ${m==="trending"?"active":""}`,onClick:()=>v("/"),children:"trending"}),e.jsx("button",{className:`sort-btn ${o?"active":""}`,onClick:()=>v("/following"),children:"following"})]})}),e.jsx(We,{startDate:l.startDate,endDate:l.endDate,onChange:s=>y(Xe(w,s))})]}),x&&e.jsx(ae,{variant:"destructive",className:"mb-4",children:e.jsxs(oe,{children:["Failed to load papers. ",e.jsx("button",{type:"button",onClick:()=>void b.refetch(),children:"Try again"})]})}),O.isError&&O.variables&&e.jsx(ae,{variant:"destructive",className:"mb-4",children:e.jsxs(oe,{children:["Could not follow “",O.variables,"”. ",e.jsx("button",{type:"button",onClick:()=>z(O.variables),children:"Try again"})]})}),n.isError&&n.variables&&e.jsx(ae,{variant:"destructive",className:"mb-4",children:e.jsxs(oe,{children:["Could not follow ",n.variables.map(s=>s.name).join(", "),". ",e.jsx("button",{type:"button",onClick:()=>d(n.variables),children:"Try again"})]})}),o&&!!t&&c.isSuccess&&!i.isPending&&!E&&(c.data?C?e.jsxs("div",{className:"following-topic-note",role:"status",children:["Showing the closest papers about “",A,"” now. A model is reading papers to refine these matches, which takes a few minutes."]}):null: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:()=>a(!0),children:"Follow a topic"})]})),o&&q&&e.jsx(us,{open:D,onOpenChange:a}),j&&c.data&&e.jsxs("div",{className:"following-topic-note following-topic-filter",role:"status",children:["Showing only papers about “",A,"”."," ",e.jsx(F,{to:S(!1),children:"Show everything you follow"})]}),R?e.jsx(ds,{onBuild:q?()=>a(!0):void 0}):e.jsx(Ye,{query:b,isLoading:b.isLoading||o&&!!(r!=null&&r.isLoading),cards:V,skeleton:"card",rootMargin:"400px",empty:x?null:j?e.jsxs(e.Fragment,{children:["No papers about your topic match these filters. Widen the date range or ",e.jsx("button",{type:"button",className:"link-button",onClick:()=>a(!0),children:"edit your topic"}),"."]}):o?e.jsxs(e.Fragment,{children:["No papers from your topic or follows match these filters. Widen the date range, or follow more from ",e.jsx(F,{to:"/tasks",children:"tasks"}),", ",e.jsx(F,{to:"/methods",children:"methods"}),", benchmark, author, or organization pages."]}):"No papers in this window."})]})]})]})]})},Js=()=>e.jsx(Ns,{mode:"trending"});export{bs as AskAssistant,Ns as HomeFeed,Js as default}; diff --git a/assets/FeedView-BOUw6uS8.js b/assets/FeedView-BOUw6uS8.js deleted file mode 100644 index de55cb4a261db345272380d618b0f913cb62f693..0000000000000000000000000000000000000000 --- a/assets/FeedView-BOUw6uS8.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e,L as F,a as Pe,c as Ce,b as H,r as ie,d as h,h as Ee,C as Fe,T as Q,e as je,f as Le,g as Ae,p as se,i as De,k as Re,l as re,m as ve,n as Me,o as qe}from"./index-Ba3erEGJ.js";import{S as Ie}from"./sparkles-B_KArhDU.js";import{D as Oe,a as He,b as $e}from"./dialog-ChZD9naX.js";import{c as J}from"./catalog-DrZhs4eC.js";import{u as Ne,a as Se,b as ke,T as me,s as ze,c as Ke,r as ee,d as ge,e as fe,f as Be}from"./researchTopic-CMY-StWV.js";import{d as le,t as Ue}from"./transform-CLQo0OXf.js";import{P as Ge}from"./plus-iAFjdNIx.js";import{A as Qe}from"./arrow-right-TYlHRUWw.js";import{r as We,P as Xe,w as Ye,a as Ze}from"./PaperFeed-BJ9VCI43.js";import{M as Ve}from"./McpShowcase-DwcLwAEJ.js";import{u as Je,a as es,P as ss,i as ts,A as as,b as os,S as $,c as ns,D as te,q as is,d as rs}from"./chatSessions-Br4UCLSi.js";import{c as ls}from"./chat-CI3_nFJ5.js";import{u as cs}from"./usePapers-MJ0ibwsa.js";import{p as xe}from"./papers-BS2bC1xn.js";import{S as ae}from"./skeleton-HWnr28Ly.js";import{A as oe,a as ne}from"./alert-DftukI1b.js";import"./useMutation-BEHPbJP-.js";import"./PaperCard-cfN4cMqP.js";import"./AuthorAvatar-7M5dWdHD.js";import"./SotaBadges-jHwP4qBt.js";import"./colors-BkWRhvFI.js";import"./Icon-B7TPsKGh.js";import"./LatexTitle-ZavI0vgc.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-DmIp_t7d.js";import"./useIntersectionObserver-CEcObYrC.js";import"./AgentLogos-BjOw21yN.js";import"./useInfiniteQuery-BSM2sFVO.js";import"./curation-BzdOQbkp.js";function ds({onBuild:r}){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 a topic 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."}),r&&e.jsxs("button",{type:"button",className:"research-topic-save following-intro-topic",onClick:r,children:[e.jsx(Ie,{"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(F,{to:"/settings",children:"Settings"}),"."]})]})}const we=16;function us({open:r,onOpenChange:o}){return e.jsx(Oe,{open:r,onOpenChange:o,children:e.jsx(He,{className:"topic-dialog","aria-describedby":void 0,children:e.jsx(ps,{onDone:()=>o(!1)})})})}function ps({onDone:r}){var W,X,Y,Z,O,z,B;const{user:o}=Pe(),m=Ce(),l=H({queryKey:ie.topic(o==null?void 0:o.hf_subject),queryFn:ee.topic,enabled:!!o}),t=Ne(),w=H({queryKey:["trending-tasks-follow"],queryFn:()=>J.trendingTasks({limit:we,level:0}),staleTime:Q}),y=H({queryKey:["trending-methods-follow"],queryFn:()=>J.trendingMethods({limit:we}),staleTime:Q}),c=H({queryKey:["research-follow-suggestions"],queryFn:ee.followSuggestions,staleTime:Q}),j=(i=[])=>i.map(p=>({id:String(p.entity_id),name:p.name,image:p.image_url})),[S,L]=h.useState(null),[_,v]=h.useState([]),P=Se(),M=ke(),b=((W=l.data)==null?void 0:W.text)??"",n=S??b,d=n.trim().replace(/\s+/g," "),C=((X=l.data)==null?void 0:X.status)==="failed"&&d===b,A=d.length>=3&&(d!==b||C),D=P.isPending||M.isPending,a=(i,p)=>{var N;return((N=t.data)==null?void 0:N.some(k=>k.kind===i&&String(k.entity_id)===p))??!1},g=(i,p)=>{var N;return((N=_.find(k=>k.kind===i&&k.id===p))==null?void 0:N.follow)??a(i,p)},f=_.filter(i=>i.follow!==a(i.kind,i.id)),E=!D&&(A||f.length>0),R=(i,p,N)=>v(k=>[...k.filter(U=>U.kind!==i||U.id!==p),{kind:i,id:p,name:N,follow:!g(i,p)}]),q=()=>{if(!E)return;if(!o){A&&ze(d),f.length&&Ke(f),window.location.href=Ee(`${m.pathname}${m.search}`);return}const i=[...f.length?[M.mutateAsync(f)]:[],...A?[P.mutateAsync(d)]:[]];Promise.allSettled(i).then(p=>{p.every(N=>N.status==="fulfilled")&&r()})},I=(i,p,N,k)=>{const V=[...(t.data??[]).filter(x=>x.kind===p).map(x=>({id:String(x.entity_id),name:x.name,slug:x.url.split("/").pop(),image:x.image_url})),...N.filter(x=>!a(p,x.id)).map(x=>({...x,suggested:!0}))];return V.length>0&&e.jsxs("div",{className:"topic-dialog-group",children:[e.jsx("h3",{children:i}),e.jsxs(hs,{children:[V.map(x=>{const G=g(p,x.id),K=p==="task"?le(x.name,x.slug??void 0):x.name;return e.jsxs("button",{type:"button",className:"topic-dialog-chip","aria-pressed":G,disabled:D,"data-suggested":"suggested"in x||void 0,onClick:()=>R(p,x.id,K),children:[G?e.jsx(Fe,{"aria-hidden":"true"}):e.jsx(Ge,{"aria-hidden":"true"}),(p==="author"||p==="organization")&&e.jsx(ms,{kind:p,name:K,src:x.image}),K]},x.id)}),k&&e.jsxs(F,{to:k.to,className:"topic-dialog-browse",children:[k.label,e.jsx(Qe,{"aria-hidden":"true"})]})]})]})};return e.jsxs("form",{className:"topic-dialog-form",onSubmit:i=>{i.preventDefault(),q()},children:[e.jsx($e,{className:"topic-dialog-title",children:b||(Y=t.data)!=null&&Y.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:"Describe a topic in your own words"})}),e.jsx("p",{className:"topic-dialog-hint",children:"A model reads every new paper and adds the ones that match to your Following feed."}),e.jsx("textarea",{id:"topic-dialog-input",className:"research-topic-input",rows:4,maxLength:me,"aria-label":"Research topic",placeholder:"e.g. diffusion policies for robot manipulation, or speculative decoding for LLM inference",value:n,onChange:i=>L(i.target.value),onKeyDown:i=>{i.key==="Enter"&&!i.shiftKey&&!i.nativeEvent.isComposing&&(i.preventDefault(),q())}}),e.jsxs("span",{className:"research-topic-count",children:[n.length,"/",me]})]}),I("Trending tasks","task",((Z=w.data)==null?void 0:Z.results)??[],{to:"/tasks",label:"Browse tasks"}),I("Trending methods","method",((O=y.data)==null?void 0:O.results)??[],{to:"/methods",label:"Browse methods"}),I("Benchmarks","benchmark",[],{to:"/tasks",label:"Browse benchmarks"}),I("Popular authors","author",j((z=c.data)==null?void 0:z.authors)),I("Popular organizations","organization",j((B=c.data)==null?void 0:B.organizations),{to:"/organizations",label:"Browse organizations"}),(P.error||M.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:[b&&e.jsx("button",{type:"button",className:"research-follow-action topic-dialog-remove",disabled:D,onClick:()=>P.mutate(null,{onSuccess:r}),children:"Remove topic"}),e.jsx("button",{type:"button",className:"research-follow-action",disabled:D,onClick:r,children:"Cancel"}),e.jsx("button",{type:"submit",className:"research-topic-save",disabled:!E,children:f.some(i=>i.follow===!1)?"Save":f.length?"Follow":C?"Retry":b?"Update topic":"Follow"})]})]})}function hs({children:r}){const o=h.useRef(null);return h.useLayoutEffect(()=>{const m=o.current;if(!m)return;const l=()=>{const t=[...m.children],w=t.filter(c=>c.dataset.suggested);w.forEach(c=>{c.hidden=!1});const y=()=>new Set(t.filter(c=>!c.hidden).map(c=>c.offsetTop)).size;for(let c=w.length-1;c>=0&&y()>2;c--)w[c].hidden=!0};return l(),window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)}),e.jsx("div",{ref:o,className:"topic-dialog-chips",children:r})}function ms({kind:r,name:o,src:m}){const[l,t]=h.useState(!1);if(m&&!l)return e.jsx("img",{className:`topic-dialog-chip-image is-${r}`,src:m,alt:"",loading:"lazy",onError:()=>t(!0)});if(r!=="author")return null;const w=o.split(/\s+/).filter(Boolean).map(y=>y[0]).slice(0,2).join("").toUpperCase();return e.jsx("span",{className:"topic-dialog-chip-image is-author is-initials","aria-hidden":"true",children:w})}const be=45,gs=1800,fs=25,xs=350,ws=r=>{const[o,m]=h.useState($[0].slice(0,1)),[l,t]=h.useState(0);return h.useEffect(()=>{var L,_;if(!r)return;if((_=(L=window.matchMedia)==null?void 0:L.call(window,"(prefers-reduced-motion: reduce)"))!=null&&_.matches){m($[0]),t(0);return}let w=0,y=1,c=!1,j;m($[0].slice(0,y)),t(0);const S=()=>{const v=$[w];if(!c){if(y+=1,m(v.slice(0,y)),y===v.length){c=!0,j=window.setTimeout(S,gs);return}j=window.setTimeout(S,be);return}if(y-=1,m(v.slice(0,y)),y===0){c=!1,w=(w+1)%$.length,t(w),j=window.setTimeout(S,xs);return}j=window.setTimeout(S,fs)};return j=window.setTimeout(S,be),()=>window.clearTimeout(j)},[r]),{placeholder:o,prompt:$[l]}},bs=()=>{var D;const r=je(),o=ve(),[m,l]=h.useState({text:"",paperMentions:[]}),t=m.text,[w,y]=h.useState(0),[c,j]=h.useState(!1),[S,L]=h.useState(null),{placeholder:_,prompt:v}=ws(!t),P=h.useRef(null),M=H({queryKey:["chatAvailability"],queryFn:()=>ls.getAvailability(),retry:!1,enabled:re()}),b=re()&&((D=M.data)==null?void 0:D.paper_mentions_enabled)!==!1,n=Je({draft:m,onChange:l,enabled:b,textareaRef:P}),d=es(m,n.open),C=t?d.completion:v;h.useLayoutEffect(()=>{const a=P.current;if(!a)return;const g=()=>{if(a.style.height="auto",t){a.style.height=`${Math.min(ns(a),160)}px`;return}const f=a.placeholder,E=$.reduce((R,q)=>(a.placeholder=q,Math.max(R,a.scrollHeight)),0);a.placeholder=f,a.style.height=`${Math.min(E,160)}px`};return g(),window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)},[t,C]);const A=async(a=m)=>{const g=a.text.trim();if(!(!g||c)){if(o){const f=new URLSearchParams({q:g,model:te}),E=`${Me}?${f}`,R=window.open(E,"_blank");if(!R){L(E);return}R.opener=null,L(null),l({text:"",paperMentions:[]});return}j(!0),is(a,te);try{const f=await rs(te);r(`/chat/${f.id}`)}catch{r("/chat")}}};return e.jsxs(e.Fragment,{children:[!o&&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(ss,{text:m.text,mentions:m.paperMentions,scrollTop:w,variant:"home",completion:t?C:""}),e.jsx("textarea",{ref:P,rows:1,value:t,placeholder:_,"aria-label":"Ask the assistant",disabled:c,onChange:a=>{n.updateText(a.target.value,a.target.selectionStart),d.trackCaret(a.target)},onSelect:a=>{n.refresh(a.currentTarget.selectionStart),d.trackCaret(a.currentTarget)},onClick:a=>{n.refresh(a.currentTarget.selectionStart),d.trackCaret(a.currentTarget)},onScroll:a=>y(a.currentTarget.scrollTop),onBlur:a=>{var g,f;(f=(g=a.relatedTarget)==null?void 0:g.closest)!=null&&f.call(g,".chat-paper-picker")||window.setTimeout(n.close,0)},onKeyDown:a=>{if(!n.keyDown(a)){if(ts(a)&&C){a.preventDefault();const g=t+C;n.updateText(g,g.length),window.requestAnimationFrame(()=>{var f;return(f=P.current)==null?void 0:f.setSelectionRange(g.length,g.length)});return}a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),A())}},role:b?"combobox":void 0,"aria-expanded":b?n.open:void 0,"aria-controls":n.open?n.pickerId:void 0,"aria-activedescendant":n.open&&n.results.length?`${n.optionIdPrefix}-${n.activeIndex}`:void 0,"aria-autocomplete":b?"list":void 0,"aria-describedby":n.message?"ask-home-paper-mention-message":void 0})]}),e.jsx("button",{type:"button",className:`chat-send${t.trim()?" chat-send-on":""}`,onClick:()=>void A(),disabled:!t.trim()||c,"aria-label":"Ask the assistant",children:e.jsx(as,{})})]}),S&&e.jsx("div",{className:"chat-paper-mention-message",role:"alert",children:e.jsx("a",{href:S,target:"_blank",rel:"noreferrer",children:"Open this question on paperswithcode.co"})}),n.message&&e.jsx("div",{id:"ask-home-paper-mention-message",className:"chat-paper-mention-message",role:"alert",children:n.message}),e.jsx(os,{open:n.open,query:n.query,results:n.results,activeIndex:n.activeIndex,loading:n.loading,error:n.error,onSelect:n.select,id:n.pickerId,optionIdPrefix:n.optionIdPrefix})]})]})},Te={task:"Tasks",method:"Methods",benchmark:"Benchmarks",author:"Authors",organization:"Orgs"},ys=Object.keys(Te),js=30,ye=40,vs=async r=>{const o=await r;return{results:o.results.map(m=>({paper:m})),next_page:o.next_page}},Ns=({mode:r})=>{var G,K,ce,de,ue,pe,he;const o=r==="following",m=je(),l=Le(),t=l==null?void 0:l.user,[w,y]=Ae(),c=We(w,void 0,r==="trending"?"week":"month"),j=s=>{const u=new URLSearchParams(w);u.delete("order_by"),u.delete("only");const T=u.toString();m(T?`${s}?${T}`:s)},S=s=>{const u=new URLSearchParams(w);s?u.set("only","topic"):u.delete("only");const T=u.toString();return T?`/following?${T}`:"/following"},L=H({queryKey:qe.topTasksSidebar,queryFn:()=>J.topTasks(8),staleTime:Q}),_=H({queryKey:["trending-tasks-sidebar"],queryFn:()=>J.trendingTasks({limit:8,level:0,min_recent_papers:10}),staleTime:Q}),v=o&&w.get("only")==="topic",P={start_date:c.startDate,end_date:c.endDate},M={...c,topicOnly:v},b=cs(o?[...se.feeds.following,t==null?void 0:t.hf_subject,M]:[...r==="x"?se.feeds.xTrending:se.feeds.trending,P],async s=>{if(o){const T=await ee.following(s,M),_e=T.length===ye?s+ye:null;return{results:T,next_page:_e}}const u={...P,page:s,page_size:js,include_resources:!0};return vs(r==="x"?xe.xTrending(u):xe.list({...u,order_by:"trending",order_dir:"desc",latest_only:!0}))},{enabled:!o||!!t,initialPage:o?0:1}),n=Ne(o),d=H({queryKey:ie.topic(t==null?void 0:t.hf_subject),queryFn:ee.topic,enabled:o&&!!t,refetchInterval:s=>s.state.data&&["pending","running"].includes(s.state.data.status)?1e4:!1}),C=!!d.data&&["pending","running"].includes(d.data.status),A=d.data?d.data.label??d.data.text:"",[D,a]=h.useState(!1),g=De(),f=h.useRef(!1);h.useEffect(()=>{f.current&&!C&&g.invalidateQueries({queryKey:ie.feed(t==null?void 0:t.hf_subject)}),f.current=C},[C,g,t==null?void 0:t.hf_subject]);const E=o&&!!t&&((G=n.data)==null?void 0:G.length)===0&&d.isSuccess&&!d.data,R=o&&!(l!=null&&l.isLoading)&&!t||E,q=!!t||!Re(),[I,W]=h.useState(!1),[X]=h.useState(()=>!!ge()||fe().length>0),[Y,Z]=h.useState(!1);!I&&(d.data||(K=n.data)!=null&&K.length)&&W(!0),R&&!Y&&(Z(!0),q&&!I&&!X&&a(!0));const O=Se(),{mutate:z}=O,B=h.useRef(!1);h.useEffect(()=>{var u;const s=ge();!t||!d.isSuccess||!s||B.current||(B.current=!0,s===((u=d.data)==null?void 0:u.text)?Be():z(s))},[t,d.isSuccess,d.data,z]);const i=ke(),{mutate:p}=i,N=h.useRef(!1);h.useEffect(()=>{const s=fe();!t||!s.length||N.current||(N.current=!0,p(s))},[t,p]);const k=h.useMemo(()=>ys.map(s=>{var u;return{kind:s,follows:o?((u=n.data)==null?void 0:u.filter(T=>T.kind===s))??[]:[]}}).filter(s=>s.follows.length>0),[o,n.data]),U=o&&(!!(l!=null&&l.isLoading)||!!t&&!E),V=h.useMemo(()=>{var s;return((s=b.data)==null?void 0:s.pages.flatMap(u=>u.results.map(T=>({...Ue(T.paper),followReasons:T.reasons}))))??[]},[b.data]),x=b.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:r==="x"?"Papers people share most on X, picked daily":"Curated daily from arXiv and Hugging Face"})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsxs("aside",{className:"sidebar feed-sidebar",children:[U?e.jsxs("div",{className:"sidebar-section sidebar-section-follows",children:[e.jsx("div",{className:"sidebar-label",children:"You follow"}),((l==null?void 0:l.isLoading)||n.isLoading)&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:4}).map((s,u)=>e.jsx(ae,{className:"h-5 w-full"},u))}),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:[d.data&&e.jsxs("div",{className:`sidebar-follow-topic ${v?"active":""}`,children:[e.jsxs(F,{to:S(!v),className:"sidebar-link sidebar-follow-link",title:v?"Show papers from everything you follow":`Show only papers about “${d.data.text}”`,"aria-current":v?"true":void 0,children:[e.jsx("span",{className:"sidebar-follow-kind",children:"Topic"}),e.jsx("span",{className:"sidebar-follow-name",children:A})]}),e.jsx("button",{type:"button",className:"sidebar-follow-edit","aria-label":"Edit topic","aria-expanded":D,onClick:()=>a(!0),children:"edit"})]}),k.map(s=>e.jsxs("div",{className:"sidebar-follow-group",children:[e.jsx("span",{className:"sidebar-follow-kind",children:Te[s.kind]}),s.follows.map(u=>e.jsx(F,{to:u.url,className:"sidebar-link sidebar-follow-link",children:e.jsx("span",{className:"sidebar-follow-name",children:u.name})},u.entity_id))]},s.kind))]}),e.jsx(F,{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"}),L.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,u)=>e.jsx(ae,{className:"h-5 w-full"},u))}),e.jsxs("div",{className:"sidebar-links",children:[(ce=L.data)==null?void 0:ce.map(s=>e.jsxs(F,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[le(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(F,{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"}),_.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,u)=>e.jsx(ae,{className:"h-5 w-full"},u))}),((ue=(de=_.data)==null?void 0:de.results)==null?void 0:ue.length)===0&&!_.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:(he=(pe=_.data)==null?void 0:pe.results)==null?void 0:he.map(s=>e.jsxs(F,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[le(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))})]})]}),e.jsx(Ve,{})]}),e.jsxs("div",{className:"feed-main",children:[(re()||ve())&&e.jsx("div",{className:"feed-chat",children:e.jsx(bs,{})}),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 ${r==="trending"?"active":""}`,onClick:()=>j("/"),children:"trending"}),e.jsx("button",{className:`sort-btn ${r==="x"?"active":""}`,onClick:()=>j("/x-trending"),children:"trending (X)"}),e.jsx("button",{className:`sort-btn ${o?"active":""}`,onClick:()=>j("/following"),children:"following"})]})}),e.jsx(Xe,{startDate:c.startDate,endDate:c.endDate,onChange:s=>y(Ye(w,s))})]}),x&&e.jsx(oe,{variant:"destructive",className:"mb-4",children:e.jsxs(ne,{children:["Failed to load papers. ",e.jsx("button",{type:"button",onClick:()=>void b.refetch(),children:"Try again"})]})}),O.isError&&O.variables&&e.jsx(oe,{variant:"destructive",className:"mb-4",children:e.jsxs(ne,{children:["Could not follow “",O.variables,"”. ",e.jsx("button",{type:"button",onClick:()=>z(O.variables),children:"Try again"})]})}),i.isError&&i.variables&&e.jsx(oe,{variant:"destructive",className:"mb-4",children:e.jsxs(ne,{children:["Could not follow ",i.variables.map(s=>s.name).join(", "),". ",e.jsx("button",{type:"button",onClick:()=>p(i.variables),children:"Try again"})]})}),o&&!!t&&d.isSuccess&&!n.isPending&&!E&&(d.data?C?e.jsxs("div",{className:"following-topic-note",role:"status",children:["Showing the closest papers about “",A,"” now. A model is reading papers to refine these matches, which takes a few minutes."]}):null: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:()=>a(!0),children:"Follow a topic"})]})),o&&q&&e.jsx(us,{open:D,onOpenChange:a}),v&&d.data&&e.jsxs("div",{className:"following-topic-note following-topic-filter",role:"status",children:["Showing only papers about “",A,"”."," ",e.jsx(F,{to:S(!1),children:"Show everything you follow"})]}),R?e.jsx(ds,{onBuild:q?()=>a(!0):void 0}):e.jsx(Ze,{query:b,isLoading:b.isLoading||o&&!!(l!=null&&l.isLoading),cards:V,skeleton:"card",rootMargin:"400px",empty:x?null:v?e.jsxs(e.Fragment,{children:["No papers about your topic match these filters. Widen the date range or ",e.jsx("button",{type:"button",className:"link-button",onClick:()=>a(!0),children:"edit your topic"}),"."]}):o?e.jsxs(e.Fragment,{children:["No papers from your topic or follows match these filters. Widen the date range, or follow more from ",e.jsx(F,{to:"/tasks",children:"tasks"}),", ",e.jsx(F,{to:"/methods",children:"methods"}),", benchmark, author, or organization pages."]}):r==="x"?"No papers shared on X in this window.":"No papers in this window."})]})]})]})]})},Js=({xTrending:r=!1})=>e.jsx(Ns,{mode:r?"x":"trending"});export{bs as AskAssistant,Ns as HomeFeed,Js as default}; diff --git a/assets/FollowingView-DiD1Nhph.js b/assets/FollowingView-DiD1Nhph.js deleted file mode 100644 index 0af9c2ca9bfde329fecd916b0350e849f989a386..0000000000000000000000000000000000000000 --- a/assets/FollowingView-DiD1Nhph.js +++ /dev/null @@ -1 +0,0 @@ -import{j as o}from"./index-Ba3erEGJ.js";import{HomeFeed as r}from"./FeedView-BOUw6uS8.js";import"./sparkles-B_KArhDU.js";import"./dialog-ChZD9naX.js";import"./catalog-DrZhs4eC.js";import"./researchTopic-CMY-StWV.js";import"./useMutation-BEHPbJP-.js";import"./transform-CLQo0OXf.js";import"./plus-iAFjdNIx.js";import"./arrow-right-TYlHRUWw.js";import"./PaperFeed-BJ9VCI43.js";import"./PaperCard-cfN4cMqP.js";import"./AuthorAvatar-7M5dWdHD.js";import"./SotaBadges-jHwP4qBt.js";import"./colors-BkWRhvFI.js";import"./Icon-B7TPsKGh.js";import"./LatexTitle-ZavI0vgc.js";import"./papers-BS2bC1xn.js";import"./curation-BzdOQbkp.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-DmIp_t7d.js";import"./skeleton-HWnr28Ly.js";import"./useIntersectionObserver-CEcObYrC.js";import"./McpShowcase-DwcLwAEJ.js";import"./AgentLogos-BjOw21yN.js";import"./chatSessions-Br4UCLSi.js";import"./chat-CI3_nFJ5.js";import"./usePapers-MJ0ibwsa.js";import"./useInfiniteQuery-BSM2sFVO.js";import"./alert-DftukI1b.js";function B(){return o.jsx(r,{mode:"following"})}export{B as default}; diff --git a/assets/FollowingView-yJNNUjAJ.js b/assets/FollowingView-yJNNUjAJ.js new file mode 100644 index 0000000000000000000000000000000000000000..f261f35da2731e803928dbfffa98cab2cc0abc84 --- /dev/null +++ b/assets/FollowingView-yJNNUjAJ.js @@ -0,0 +1 @@ +import{j as o}from"./index-UJSMyFje.js";import{HomeFeed as r}from"./FeedView-7yx8iXq9.js";import"./sparkles-C-mZg8SQ.js";import"./dialog-BodVIP1P.js";import"./catalog-Dsah5Rrt.js";import"./researchTopic-DWD5gtip.js";import"./useMutation-BZfxMmoZ.js";import"./transform-C3_Sl_p2.js";import"./plus-DvxtHJU_.js";import"./arrow-right-DdcCN24Z.js";import"./PaperFeed-DCI8gGsr.js";import"./PaperCard-DaYJC8Bk.js";import"./AuthorAvatar-B-tDeLM5.js";import"./SotaBadges-Bu3EIx-o.js";import"./colors-BkWRhvFI.js";import"./Icon-BoCHdPFA.js";import"./LatexTitle-rKci1b5e.js";import"./papers-CDbCMm0m.js";import"./curation-B0_XT_FL.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-BTFxRv7H.js";import"./skeleton-CFPwaPrc.js";import"./useIntersectionObserver-Akbgy6EK.js";import"./McpShowcase-C8eMjqSr.js";import"./AgentLogos-DCE1drFe.js";import"./chatSessions-DXNWRdeo.js";import"./chat-DqN1V6Hp.js";import"./usePapers-CWb1CFyQ.js";import"./useInfiniteQuery-SD8FlI5O.js";import"./alert-B1JnXYJB.js";function B(){return o.jsx(r,{mode:"following"})}export{B as default}; diff --git a/assets/FrameworksIndexView-DvK-KAg3.js b/assets/FrameworksIndexView-CHkfi7SP.js similarity index 95% rename from assets/FrameworksIndexView-DvK-KAg3.js rename to assets/FrameworksIndexView-CHkfi7SP.js index b2f666ff4b31ac96e69279522ed4a1c554fd635d..d67a7971a4e5c8b6fba25ed976fb93b9e090f766 100644 --- a/assets/FrameworksIndexView-DvK-KAg3.js +++ b/assets/FrameworksIndexView-CHkfi7SP.js @@ -1 +1 @@ -import{e as d,j as e,L as c,b as m,V as h}from"./index-Ba3erEGJ.js";import{I as p}from"./Icon-B7TPsKGh.js";import{c as u}from"./catalog-DrZhs4eC.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{e as d,j as e,L as c,b as m,V as h}from"./index-UJSMyFje.js";import{I as p}from"./Icon-BoCHdPFA.js";import{c as u}from"./catalog-Dsah5Rrt.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-B7TPsKGh.js b/assets/Icon-BoCHdPFA.js similarity index 98% rename from assets/Icon-B7TPsKGh.js rename to assets/Icon-BoCHdPFA.js index 40c92df1060857ac7be515356f1ff351957c9654..6cebf63f8860d891f02f1b593e0c4ff83288b7b5 100644 --- a/assets/Icon-B7TPsKGh.js +++ b/assets/Icon-BoCHdPFA.js @@ -1 +1 @@ -import{j as o}from"./index-Ba3erEGJ.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-UJSMyFje.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-ZavI0vgc.js b/assets/LatexTitle-rKci1b5e.js similarity index 98% rename from assets/LatexTitle-ZavI0vgc.js rename to assets/LatexTitle-rKci1b5e.js index 6b64aa31c857b9866797ef89f2f453d5ed8f62ca..7148b631e56f36e4f29d98bfbd9d9c644ec905eb 100644 --- a/assets/LatexTitle-ZavI0vgc.js +++ b/assets/LatexTitle-rKci1b5e.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,d as A,a7 as L}from"./index-Ba3erEGJ.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,d as A,a7 as L}from"./index-UJSMyFje.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-FuN1EKHi.js b/assets/MarkdownText-Bn8aftJG.js similarity index 86% rename from assets/MarkdownText-FuN1EKHi.js rename to assets/MarkdownText-Bn8aftJG.js index 344ddcc00da3fee4eb940c9f7de9d601202f8b4e..0c2c59ce613826a373ded60df98da2a7b2ec861b 100644 --- a/assets/MarkdownText-FuN1EKHi.js +++ b/assets/MarkdownText-Bn8aftJG.js @@ -1 +1 @@ -import{w as c,j as o,L as u}from"./index-Ba3erEGJ.js";/* empty css */import{r as p,a as m,P as d}from"./PaperPreviewLink-ByPUM9fv.js";import{M as h}from"./index-Bc8fO69p.js";import{r as f}from"./index-C2GWM2ou.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-UJSMyFje.js";/* empty css */import{r as p,a as m,P as d}from"./PaperPreviewLink-DUxQx42a.js";import{M as h}from"./index-DBb3IysA.js";import{r as f}from"./index-BFkgjGcF.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-DwcLwAEJ.js b/assets/McpShowcase-C8eMjqSr.js similarity index 84% rename from assets/McpShowcase-DwcLwAEJ.js rename to assets/McpShowcase-C8eMjqSr.js index 418e1ddd55405a746027994af86323abbfef0ae2..ccb00b3f00d7dc3c9caaff4a5a8d01800d6cc8af 100644 --- a/assets/McpShowcase-DwcLwAEJ.js +++ b/assets/McpShowcase-C8eMjqSr.js @@ -1 +1 @@ -import{j as e,L as t}from"./index-Ba3erEGJ.js";import{A as a}from"./AgentLogos-BjOw21yN.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-UJSMyFje.js";import{A as a}from"./AgentLogos-DCE1drFe.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-flM-siZf.js b/assets/McpView-CZBZY_uR.js similarity index 97% rename from assets/McpView-flM-siZf.js rename to assets/McpView-CZBZY_uR.js index cedc1371d1b3caa730caf89598595e88bed977d7..d9f2c17b4ca933c43723af87d4e4db083a51803e 100644 --- a/assets/McpView-flM-siZf.js +++ b/assets/McpView-CZBZY_uR.js @@ -1,4 +1,4 @@ -import{s as b,b as x,V as m,j as e,C as j}from"./index-Ba3erEGJ.js";import{u as g,f as y}from"./useDocumentTitle-CJWZHe8w.js";import{q as f}from"./queryOptions-C9woPjwX.js";import{G as v}from"./github-BUiEiKpk.js";import{E as o}from"./external-link-BfaqusWk.js";import{C as w}from"./copy-Bq1_hWMk.js";/** +import{s as b,b as x,V as m,j as e,C as j}from"./index-UJSMyFje.js";import{u as g,f as y}from"./useDocumentTitle-BSodmmbQ.js";import{q as f}from"./queryOptions-C9woPjwX.js";import{G as v}from"./github-BbEMdbmg.js";import{E as o}from"./external-link-C2oGmjcr.js";import{C as w}from"./copy-D02KQGwg.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/MethodDetailView-Ctz2zwcp.js b/assets/MethodDetailView-B07KZqSy.js similarity index 92% rename from assets/MethodDetailView-Ctz2zwcp.js rename to assets/MethodDetailView-B07KZqSy.js index 082340671b366d0b6b73365303711bd43138b2d6..964cc501cc0516bd3212d2967a95f111d4ceda18 100644 --- a/assets/MethodDetailView-Ctz2zwcp.js +++ b/assets/MethodDetailView-B07KZqSy.js @@ -1 +1 @@ -import{j as e,d as I,u as P,b as k,p as V,L as _,o as A,T as v}from"./index-Ba3erEGJ.js";import{R as H}from"./ResearchFollowButton-DXt6Qpt5.js";import{M as Q}from"./SotaBadges-jHwP4qBt.js";import{u as q,b as K,a as R}from"./PaperFeed-BJ9VCI43.js";import{r as G,M as L}from"./MarkdownText-FuN1EKHi.js";import{c as b}from"./catalog-DrZhs4eC.js";import{p as U}from"./papers-BS2bC1xn.js";import{i as O}from"./apiErrors-CPeTQuQC.js";import{s as W}from"./slug-BpH-Nkvz.js";import{t as Z}from"./transform-CLQo0OXf.js";import{u as X}from"./usePapers-MJ0ibwsa.js";import{S as N}from"./skeleton-HWnr28Ly.js";import{A as Y,a as J}from"./alert-DftukI1b.js";import{s as ee}from"./safeExternalHref-CkBrsh84.js";import te from"./NotFound-B3EehO4t.js";import"./researchTopic-CMY-StWV.js";import"./useMutation-BEHPbJP-.js";import"./plus-iAFjdNIx.js";import"./colors-BkWRhvFI.js";import"./PaperCard-cfN4cMqP.js";import"./AuthorAvatar-7M5dWdHD.js";import"./Icon-B7TPsKGh.js";import"./LatexTitle-ZavI0vgc.js";import"./popover-DmIp_t7d.js";import"./useIntersectionObserver-CEcObYrC.js";/* empty css */import"./PaperPreviewLink-ByPUM9fv.js";import"./index-Bc8fO69p.js";import"./index-C2GWM2ou.js";import"./katex-DkKDou_j.js";import"./hover-card-C6ObQOHL.js";import"./curation-BzdOQbkp.js";import"./useInfiniteQuery-BSM2sFVO.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(H,{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(Q,{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,d as I,u as P,b as k,p as V,L as _,o as A,T as v}from"./index-UJSMyFje.js";import{R as H}from"./ResearchFollowButton-Cn7bhIam.js";import{M as Q}from"./SotaBadges-Bu3EIx-o.js";import{u as q,b as K,a as R}from"./PaperFeed-DCI8gGsr.js";import{r as G,M as L}from"./MarkdownText-Bn8aftJG.js";import{c as b}from"./catalog-Dsah5Rrt.js";import{p as U}from"./papers-CDbCMm0m.js";import{i as O}from"./apiErrors-DXz1vC-X.js";import{s as W}from"./slug-BpH-Nkvz.js";import{t as Z}from"./transform-C3_Sl_p2.js";import{u as X}from"./usePapers-CWb1CFyQ.js";import{S as N}from"./skeleton-CFPwaPrc.js";import{A as Y,a as J}from"./alert-B1JnXYJB.js";import{s as ee}from"./safeExternalHref-CkBrsh84.js";import te from"./NotFound-CyT6FuD7.js";import"./researchTopic-DWD5gtip.js";import"./useMutation-BZfxMmoZ.js";import"./plus-DvxtHJU_.js";import"./colors-BkWRhvFI.js";import"./PaperCard-DaYJC8Bk.js";import"./AuthorAvatar-B-tDeLM5.js";import"./Icon-BoCHdPFA.js";import"./LatexTitle-rKci1b5e.js";import"./popover-BTFxRv7H.js";import"./useIntersectionObserver-Akbgy6EK.js";/* empty css */import"./PaperPreviewLink-DUxQx42a.js";import"./index-DBb3IysA.js";import"./index-BFkgjGcF.js";import"./katex-DkKDou_j.js";import"./hover-card-DcL7U8NI.js";import"./curation-B0_XT_FL.js";import"./useInfiniteQuery-SD8FlI5O.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(H,{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(Q,{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-Bdiwox76.js b/assets/MethodsIndexView-NoqF6aLY.js similarity index 82% rename from assets/MethodsIndexView-Bdiwox76.js rename to assets/MethodsIndexView-NoqF6aLY.js index 017ce4be279414621a796428679d861217fafdd3..31346ad79fec71b5cf6f339d56cca9d0cc1bc617 100644 --- a/assets/MethodsIndexView-Bdiwox76.js +++ b/assets/MethodsIndexView-NoqF6aLY.js @@ -1,4 +1,4 @@ -import{s as f,b as c,d as l,j as s,L as _,o as N,T as m}from"./index-Ba3erEGJ.js";import{c as p}from"./catalog-DrZhs4eC.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-DftukI1b.js";import{A,a as F}from"./AreaSection-C1JWPNIG.js";import{T as q}from"./TaxonomySuggestionTile-CiMXTa8j.js";import{u as S,T as I}from"./useHashScrollOnReady-LOdkzT1I.js";import"./skeleton-HWnr28Ly.js";import"./SignInToEditDialog-XDg1xPWL.js";import"./button-Dvq5drsi.js";import"./input-wEykysM6.js";import"./textarea-bNIL0Bcb.js";import"./searchable-select-CjSbtAzP.js";import"./popover-DmIp_t7d.js";import"./dialog-ChZD9naX.js";import"./search-Cv_XFprT.js";import"./loader-circle-ChybJ0KP.js";import"./useMutation-BEHPbJP-.js";import"./submissions-D9Ty3arc.js";import"./plus-iAFjdNIx.js";import"./trending-up-DXFkPm8S.js";/** +import{s as f,b as c,d as l,j as s,L as _,o as N,T as m}from"./index-UJSMyFje.js";import{c as p}from"./catalog-Dsah5Rrt.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-B1JnXYJB.js";import{A,a as F}from"./AreaSection-GuFqPtDa.js";import{T as q}from"./TaxonomySuggestionTile-D09uiSgJ.js";import{u as S,T as I}from"./useHashScrollOnReady-D9YVP7Oq.js";import"./skeleton-CFPwaPrc.js";import"./SignInToEditDialog-WalvYyhX.js";import"./button-CIbfeiDg.js";import"./input-C9lvFHZR.js";import"./textarea-BC68vWsz.js";import"./searchable-select-BatELYUf.js";import"./popover-BTFxRv7H.js";import"./dialog-BodVIP1P.js";import"./search-pO5JVRc5.js";import"./loader-circle-l5JFsbEa.js";import"./useMutation-BZfxMmoZ.js";import"./submissions-DozYdY52.js";import"./plus-DvxtHJU_.js";import"./trending-up-Yn_2_YaT.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/NotFound-B3EehO4t.js b/assets/NotFound-CyT6FuD7.js similarity index 89% rename from assets/NotFound-B3EehO4t.js rename to assets/NotFound-CyT6FuD7.js index 3e319c36993421e639032f8011bf31f3cb037e8d..eb12b0175ea6cecbe286cf42e7c4dc1f116d920c 100644 --- a/assets/NotFound-B3EehO4t.js +++ b/assets/NotFound-CyT6FuD7.js @@ -1 +1 @@ -import{c as o,d as s,j as t,L as a}from"./index-Ba3erEGJ.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{c as o,d as s,j as t,L as a}from"./index-UJSMyFje.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-iCMW2Vfi.js b/assets/OrganizationContributionGraph-DrwHtk4l.js similarity index 94% rename from assets/OrganizationContributionGraph-iCMW2Vfi.js rename to assets/OrganizationContributionGraph-DrwHtk4l.js index 847fa44e58d77ed5dcac270375ebd83b33603149..1f055489a5f9da99182d8ac0b7f80ca2ce89fdd6 100644 --- a/assets/OrganizationContributionGraph-iCMW2Vfi.js +++ b/assets/OrganizationContributionGraph-DrwHtk4l.js @@ -1 +1 @@ -import{d as b,j as o,b as $,T as z}from"./index-Ba3erEGJ.js";import{S as w}from"./skeleton-HWnr28Ly.js";import{c as y}from"./catalog-DrZhs4eC.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{d as b,j as o,b as $,T as z}from"./index-UJSMyFje.js";import{S as w}from"./skeleton-CFPwaPrc.js";import{c as y}from"./catalog-Dsah5Rrt.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-DyFV9-gr.js b/assets/OrganizationDetailView-CwgJ3Sb7.js similarity index 75% rename from assets/OrganizationDetailView-DyFV9-gr.js rename to assets/OrganizationDetailView-CwgJ3Sb7.js index 836dcb6aa9f5fd16736fb9b43204a59ef85743f7..1d5c30625855cac58c3472a99f65e6e6a886abfb 100644 --- a/assets/OrganizationDetailView-DyFV9-gr.js +++ b/assets/OrganizationDetailView-CwgJ3Sb7.js @@ -1 +1 @@ -import{e as q,d,b as N,p as C,j as r,L as y,o as Q,T as F,u as z}from"./index-Ba3erEGJ.js";import{R as E}from"./ResearchFollowButton-DXt6Qpt5.js";import{M as I}from"./MarkdownText-FuN1EKHi.js";import{O as K}from"./OrganizationContributionGraph-iCMW2Vfi.js";import{u as R,b as G,a as H}from"./PaperFeed-BJ9VCI43.js";import{A as W,a as B}from"./alert-DftukI1b.js";import{S as D}from"./searchable-select-CjSbtAzP.js";import{S}from"./skeleton-HWnr28Ly.js";import{u as U}from"./usePapers-MJ0ibwsa.js";import{c as v}from"./catalog-DrZhs4eC.js";import{p as V}from"./papers-BS2bC1xn.js";import{i as Z}from"./apiErrors-CPeTQuQC.js";import{d as L,t as J}from"./transform-CLQo0OXf.js";import{o as X,i as Y}from"./organizationNames-BVKzYEBp.js";import k from"./NotFound-B3EehO4t.js";import"./researchTopic-CMY-StWV.js";import"./useMutation-BEHPbJP-.js";import"./plus-iAFjdNIx.js";/* empty css */import"./PaperPreviewLink-ByPUM9fv.js";import"./index-Bc8fO69p.js";import"./index-C2GWM2ou.js";import"./katex-DkKDou_j.js";import"./hover-card-C6ObQOHL.js";import"./PaperCard-cfN4cMqP.js";import"./AuthorAvatar-7M5dWdHD.js";import"./SotaBadges-jHwP4qBt.js";import"./colors-BkWRhvFI.js";import"./Icon-B7TPsKGh.js";import"./LatexTitle-ZavI0vgc.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-DmIp_t7d.js";import"./useIntersectionObserver-CEcObYrC.js";import"./button-Dvq5drsi.js";import"./dialog-ChZD9naX.js";import"./search-Cv_XFprT.js";import"./loader-circle-ChybJ0KP.js";import"./useInfiniteQuery-BSM2sFVO.js";import"./curation-BzdOQbkp.js";const ee=({organizationSlug:a,taskSlug:n})=>{var f,x,j,_,b;const $=q(),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:L(s.name,s.slug)})))},[l.data]),i=g.find(t=>t.slug===n),T=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,A=((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(k,{});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 P=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"}`}))},M=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:L(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:M,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`},...P(t)]},enabled:!l.isLoading,className:"h-[38px]"})}),children:r.jsxs("div",{className:"results-count",children:[A.toLocaleString()," papers"]})}),r.jsx(H,{query:p,cards:T,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(k,{})};export{Ke as default}; +import{e as q,d,b as N,p as C,j as r,L as y,o as Q,T as F,u as z}from"./index-UJSMyFje.js";import{R as E}from"./ResearchFollowButton-Cn7bhIam.js";import{M as I}from"./MarkdownText-Bn8aftJG.js";import{O as K}from"./OrganizationContributionGraph-DrwHtk4l.js";import{u as R,b as G,a as H}from"./PaperFeed-DCI8gGsr.js";import{A as W,a as B}from"./alert-B1JnXYJB.js";import{S as D}from"./searchable-select-BatELYUf.js";import{S}from"./skeleton-CFPwaPrc.js";import{u as U}from"./usePapers-CWb1CFyQ.js";import{c as v}from"./catalog-Dsah5Rrt.js";import{p as V}from"./papers-CDbCMm0m.js";import{i as Z}from"./apiErrors-DXz1vC-X.js";import{d as L,t as J}from"./transform-C3_Sl_p2.js";import{o as X,i as Y}from"./organizationNames-BVKzYEBp.js";import k from"./NotFound-CyT6FuD7.js";import"./researchTopic-DWD5gtip.js";import"./useMutation-BZfxMmoZ.js";import"./plus-DvxtHJU_.js";/* empty css */import"./PaperPreviewLink-DUxQx42a.js";import"./index-DBb3IysA.js";import"./index-BFkgjGcF.js";import"./katex-DkKDou_j.js";import"./hover-card-DcL7U8NI.js";import"./PaperCard-DaYJC8Bk.js";import"./AuthorAvatar-B-tDeLM5.js";import"./SotaBadges-Bu3EIx-o.js";import"./colors-BkWRhvFI.js";import"./Icon-BoCHdPFA.js";import"./LatexTitle-rKci1b5e.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-BTFxRv7H.js";import"./useIntersectionObserver-Akbgy6EK.js";import"./button-CIbfeiDg.js";import"./dialog-BodVIP1P.js";import"./search-pO5JVRc5.js";import"./loader-circle-l5JFsbEa.js";import"./useInfiniteQuery-SD8FlI5O.js";import"./curation-B0_XT_FL.js";const ee=({organizationSlug:a,taskSlug:n})=>{var f,x,j,_,b;const $=q(),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:L(s.name,s.slug)})))},[l.data]),i=g.find(t=>t.slug===n),T=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,A=((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(k,{});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 P=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"}`}))},M=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:L(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:M,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`},...P(t)]},enabled:!l.isLoading,className:"h-[38px]"})}),children:r.jsxs("div",{className:"results-count",children:[A.toLocaleString()," papers"]})}),r.jsx(H,{query:p,cards:T,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(k,{})};export{Ke as default}; diff --git a/assets/OrganizationsIndexView-DSR3qkLX.js b/assets/OrganizationsIndexView-BUbZFRrK.js similarity index 97% rename from assets/OrganizationsIndexView-DSR3qkLX.js rename to assets/OrganizationsIndexView-BUbZFRrK.js index 4f2b8129506f22474399b87352a97ee6ceb6f0d2..9c183317df61925ae5fd7fab5bcca295ac01342a 100644 --- a/assets/OrganizationsIndexView-DSR3qkLX.js +++ b/assets/OrganizationsIndexView-BUbZFRrK.js @@ -1 +1 @@ -import{g as m,b as x,d as h,j as e,L as u,o as j,T as y}from"./index-Ba3erEGJ.js";import{A as N,a as f}from"./alert-DftukI1b.js";import{c as _}from"./catalog-DrZhs4eC.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{g as m,b as x,d as h,j as e,L as u,o as j,T as y}from"./index-UJSMyFje.js";import{A as N,a as f}from"./alert-B1JnXYJB.js";import{c as _}from"./catalog-Dsah5Rrt.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-cfN4cMqP.js b/assets/PaperCard-DaYJC8Bk.js similarity index 96% rename from assets/PaperCard-cfN4cMqP.js rename to assets/PaperCard-DaYJC8Bk.js index 41d847dd3e0e8d6272f0295b72dbb5c3f1280928..af5098743ffc53240a2874a067d1bbbcf9f26624 100644 --- a/assets/PaperCard-cfN4cMqP.js +++ b/assets/PaperCard-DaYJC8Bk.js @@ -1 +1 @@ -import{i as v,V as g,T as M,p as y,j as a,L as d}from"./index-Ba3erEGJ.js";import{A as L}from"./AuthorAvatar-7M5dWdHD.js";import{P as Z,S as A,T as k,M as E}from"./SotaBadges-jHwP4qBt.js";import{I as P}from"./Icon-B7TPsKGh.js";import{L as U,a as w}from"./LatexTitle-ZavI0vgc.js";import{p as C}from"./papers-BS2bC1xn.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{i as v,V as g,T as M,p as y,j as a,L as d}from"./index-UJSMyFje.js";import{A as L}from"./AuthorAvatar-B-tDeLM5.js";import{P as Z,S as A,T as k,M as E}from"./SotaBadges-Bu3EIx-o.js";import{I as P}from"./Icon-BoCHdPFA.js";import{L as U,a as w}from"./LatexTitle-rKci1b5e.js";import{p as C}from"./papers-CDbCMm0m.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-BRTPUDdV.js b/assets/PaperDetailView-DUyDgl84.js similarity index 98% rename from assets/PaperDetailView-BRTPUDdV.js rename to assets/PaperDetailView-DUyDgl84.js index 35817959ea554ef5a51e64c10e2ad38246db798e..68c5e48bca6ccddc239c93f4a4dc7319a37aaebf 100644 --- a/assets/PaperDetailView-BRTPUDdV.js +++ b/assets/PaperDetailView-DUyDgl84.js @@ -1,4 +1,4 @@ -import{s as ft,b as Q,t as ea,T as it,v as J,w as ta,e as rs,x as Z,d as b,p as me,j as e,C as gt,i as ee,y as xt,X as ns,o as Lt,P as is,z as te,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,l as da,a as Pe,V as Ee,W as ae,k as ds,u as ua,Y as Dt,Z as ma,q as Ft,_ as ha,$ as pa,a0 as fa,a1 as ga,a2 as xa,a3 as ba}from"./index-Ba3erEGJ.js";import{u as re}from"./useMutation-BEHPbJP-.js";import{I as F}from"./Icon-B7TPsKGh.js";import{T as ja,M as va,S as ya,P as _a}from"./SotaBadges-jHwP4qBt.js";import{L as Ne,a as ot}from"./LatexTitle-ZavI0vgc.js";import{e as $e,C as ka,E as Na}from"./ExternalSourceEvalBadge-BJcbRwqY.js";import{p as U}from"./papers-BS2bC1xn.js";import{s as wa,a as Ca}from"./transform-CLQo0OXf.js";import{r as us,p as Sa}from"./paperReader-td2aJigh.js";import{a as Ea}from"./usePapers-MJ0ibwsa.js";import{u as Pa,f as $a}from"./useDocumentTitle-CJWZHe8w.js";import{u as Ia}from"./preferences-VZbz27zI.js";import{s as Y}from"./safeExternalHref-CkBrsh84.js";import{F as Ut,i as Ra,P as Aa}from"./curation-BzdOQbkp.js";import{S as ue}from"./skeleton-HWnr28Ly.js";import{A as La,a as Ta}from"./alert-DftukI1b.js";import{B as A}from"./button-Dvq5drsi.js";import{D as Ie,a as Re,c as Ae,b as Le,d as Te,e as jt}from"./dialog-ChZD9naX.js";import{A as Da,a as Fa}from"./AgentLogos-BjOw21yN.js";import{C as Ua}from"./copy-Bq1_hWMk.js";import{u as ye,r as Ba,e as za}from"./evaluationQueryInvalidation-C_YXfZMC.js";import{I as z}from"./input-wEykysM6.js";import{S as Bt}from"./searchable-select-CjSbtAzP.js";import{L as vt}from"./loader-circle-ChybJ0KP.js";import{T as fe,n as He,g as zt,C as Ma}from"./CatalogEntityPreviewLink-CuEpk2Oj.js";import{S as ms,L as O,a as Ha}from"./SignInToEditDialog-XDg1xPWL.js";import{c as G}from"./catalog-DrZhs4eC.js";import{s as hs,p as ps}from"./submissions-D9Ty3arc.js";import{i as fs,a as gs,r as Oa}from"./queryInvalidation-Bw6KJ8Q2.js";import{D as qa}from"./database-S18Pv0JO.js";import{P as ge}from"./plus-iAFjdNIx.js";import{S as lt}from"./search-Cv_XFprT.js";import{B as xs}from"./badge-Cjyk4r9x.js";import{G as Mt}from"./globe-D1DCSPNI.js";import{G as Ht}from"./github-BUiEiKpk.js";import{u as bs}from"./index-Cf9alo2v.js";import{c as Oe,A as Ka}from"./codex-Bs8D2HX-.js";import{M as Ga}from"./index-Bc8fO69p.js";import{r as Qa}from"./index-C2GWM2ou.js";import{u as Xa}from"./useIntersectionObserver-CEcObYrC.js";import{a as ct}from"./account-CKlWxNaZ.js";import{S as Ot,s as Va}from"./savedPapersAuth-BSn_7mhQ.js";import{o as Wa}from"./organizationNames-BVKzYEBp.js";import{A as Ya}from"./AuthorAvatar-7M5dWdHD.js";import"./colors-BkWRhvFI.js";import"./hover-card-C6ObQOHL.js";import"./useInfiniteQuery-BSM2sFVO.js";import"./popover-DmIp_t7d.js";import"./textarea-bNIL0Bcb.js";/** +import{s as ft,b as Q,t as ea,T as it,v as J,w as ta,e as rs,x as Z,d as b,p as me,j as e,C as gt,i as ee,y as xt,X as ns,o as Lt,P as is,z as te,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,l as da,a as Pe,V as Ee,W as ae,k as ds,u as ua,Y as Dt,Z as ma,q as Ft,_ as ha,$ as pa,a0 as fa,a1 as ga,a2 as xa,a3 as ba}from"./index-UJSMyFje.js";import{u as re}from"./useMutation-BZfxMmoZ.js";import{I as F}from"./Icon-BoCHdPFA.js";import{T as ja,M as va,S as ya,P as _a}from"./SotaBadges-Bu3EIx-o.js";import{L as Ne,a as ot}from"./LatexTitle-rKci1b5e.js";import{e as $e,C as ka,E as Na}from"./ExternalSourceEvalBadge-CV4FV0f1.js";import{p as U}from"./papers-CDbCMm0m.js";import{s as wa,a as Ca}from"./transform-C3_Sl_p2.js";import{r as us,p as Sa}from"./paperReader-td2aJigh.js";import{a as Ea}from"./usePapers-CWb1CFyQ.js";import{u as Pa,f as $a}from"./useDocumentTitle-BSodmmbQ.js";import{u as Ia}from"./preferences-C-HGVwrj.js";import{s as Y}from"./safeExternalHref-CkBrsh84.js";import{F as Ut,i as Ra,P as Aa}from"./curation-B0_XT_FL.js";import{S as ue}from"./skeleton-CFPwaPrc.js";import{A as La,a as Ta}from"./alert-B1JnXYJB.js";import{B as A}from"./button-CIbfeiDg.js";import{D as Ie,a as Re,c as Ae,b as Le,d as Te,e as jt}from"./dialog-BodVIP1P.js";import{A as Da,a as Fa}from"./AgentLogos-DCE1drFe.js";import{C as Ua}from"./copy-D02KQGwg.js";import{u as ye,r as Ba,e as za}from"./evaluationQueryInvalidation-k4vq42xx.js";import{I as z}from"./input-C9lvFHZR.js";import{S as Bt}from"./searchable-select-BatELYUf.js";import{L as vt}from"./loader-circle-l5JFsbEa.js";import{T as fe,n as He,g as zt,C as Ma}from"./CatalogEntityPreviewLink-YOdjuCTK.js";import{S as ms,L as O,a as Ha}from"./SignInToEditDialog-WalvYyhX.js";import{c as G}from"./catalog-Dsah5Rrt.js";import{s as hs,p as ps}from"./submissions-DozYdY52.js";import{i as fs,a as gs,r as Oa}from"./queryInvalidation-BfAZ_-1R.js";import{D as qa}from"./database-BhnoZEjS.js";import{P as ge}from"./plus-DvxtHJU_.js";import{S as lt}from"./search-pO5JVRc5.js";import{B as xs}from"./badge-Blda41S-.js";import{G as Mt}from"./globe-dxeznk4G.js";import{G as Ht}from"./github-BbEMdbmg.js";import{u as bs}from"./index-Mqdf1wPX.js";import{c as Oe,A as Ka}from"./codex-DMtU2dT2.js";import{M as Ga}from"./index-DBb3IysA.js";import{r as Qa}from"./index-BFkgjGcF.js";import{u as Xa}from"./useIntersectionObserver-Akbgy6EK.js";import{a as ct}from"./account-Ds_mpAFf.js";import{S as Ot,s as Va}from"./savedPapersAuth-lFuT83ZT.js";import{o as Wa}from"./organizationNames-BVKzYEBp.js";import{A as Ya}from"./AuthorAvatar-B-tDeLM5.js";import"./colors-BkWRhvFI.js";import"./hover-card-DcL7U8NI.js";import"./useInfiniteQuery-SD8FlI5O.js";import"./popover-BTFxRv7H.js";import"./textarea-BC68vWsz.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/PaperFeed-BJ9VCI43.js b/assets/PaperFeed-DCI8gGsr.js similarity index 97% rename from assets/PaperFeed-BJ9VCI43.js rename to assets/PaperFeed-DCI8gGsr.js index 43eaeedab2cc57fb5b26359507ab31023f01beca..feece2300f47e4b24fd3ba49cc609bf25dba6ff5 100644 --- a/assets/PaperFeed-BJ9VCI43.js +++ b/assets/PaperFeed-DCI8gGsr.js @@ -1 +1 @@ -import{d as u,j as t,g as J,V as K}from"./index-Ba3erEGJ.js";import{P as X}from"./PaperCard-cfN4cMqP.js";import{P as ee,a as te,b as ae}from"./popover-DmIp_t7d.js";import{I as se}from"./Icon-B7TPsKGh.js";import{S as j}from"./skeleton-HWnr28Ly.js";import{u as ne}from"./useIntersectionObserver-CEcObYrC.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{he as P,we as a,ve as b,me as c,Ne as r,Ue as u,Se as w}; +import{d as u,j as t,g as J,V as K}from"./index-UJSMyFje.js";import{P as X}from"./PaperCard-DaYJC8Bk.js";import{P as ee,a as te,b as ae}from"./popover-BTFxRv7H.js";import{I as se}from"./Icon-BoCHdPFA.js";import{S as j}from"./skeleton-CFPwaPrc.js";import{u as ne}from"./useIntersectionObserver-Akbgy6EK.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{he as P,we as a,ve as b,me as c,Ne as r,Ue as u,Se as w}; diff --git a/assets/PaperPreviewLink-ByPUM9fv.js b/assets/PaperPreviewLink-DUxQx42a.js similarity index 98% rename from assets/PaperPreviewLink-ByPUM9fv.js rename to assets/PaperPreviewLink-DUxQx42a.js index b25ae775195e3a7497d43efa83a4e8962f7ceedb..1e24638041fbcf98db47c408638c541a9887d57b 100644 --- a/assets/PaperPreviewLink-ByPUM9fv.js +++ b/assets/PaperPreviewLink-DUxQx42a.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-Bc8fO69p.js";import{l as fe}from"./index-C2GWM2ou.js";import R from"./katex-DkKDou_j.js";import{j as p,V as A,a3 as de,p as xe,w as C,f as ge,i as ye,L as T,b as we,A as be}from"./index-Ba3erEGJ.js";import{H as Ne,a as ve,b as ke}from"./hover-card-C6ObQOHL.js";import{p as I}from"./papers-BS2bC1xn.js";import{u as Fe}from"./useMutation-BEHPbJP-.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-DBb3IysA.js";import{l as fe}from"./index-BFkgjGcF.js";import R from"./katex-DkKDou_j.js";import{j as p,V as A,a3 as de,p as xe,w as C,f as ge,i as ye,L as T,b as we,A as be}from"./index-UJSMyFje.js";import{H as Ne,a as ve,b as ke}from"./hover-card-DcL7U8NI.js";import{p as I}from"./papers-CDbCMm0m.js";import{u as Fe}from"./useMutation-BZfxMmoZ.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-C5kcjwh1.js b/assets/PaperReaderView-D5fESpSH.js similarity index 91% rename from assets/PaperReaderView-C5kcjwh1.js rename to assets/PaperReaderView-D5fESpSH.js index cd0a3baf3601d1749fa59c89174e25af1effe099..d00278d2156cac2d10b1b588c60dd8254d1d7951 100644 --- a/assets/PaperReaderView-C5kcjwh1.js +++ b/assets/PaperReaderView-D5fESpSH.js @@ -1 +1 @@ -import{d as s,b as F,j as r,A as ee,u as Fe,w as qe,e as He,a3 as Se,Z as Ke,L as G}from"./index-Ba3erEGJ.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-C8zlIZya.js";import{M as Ge}from"./MarkdownText-FuN1EKHi.js";import{g as Je,a as et,b as tt}from"./papers-BS2bC1xn.js";import{f as at,w as rt,s as st,e as nt,a as J,b as je,c as Ce}from"./paperReader-td2aJigh.js";import{a as it}from"./usePapers-MJ0ibwsa.js";import{c as ot}from"./chat-CI3_nFJ5.js";import{s as te}from"./safeExternalHref-CkBrsh84.js";import{ChatExperience as ct}from"./ChatView-BQ45-L03.js";import"./chatSessions-Br4UCLSi.js";/* empty css */import"./hover-card-C6ObQOHL.js";import"./CatalogEntityPreviewLink-CuEpk2Oj.js";import"./catalog-DrZhs4eC.js";import"./github-BUiEiKpk.js";import"./file-text-DM3Ql8Fd.js";import"./PaperPreviewLink-ByPUM9fv.js";import"./index-Bc8fO69p.js";import"./index-C2GWM2ou.js";import"./katex-DkKDou_j.js";import"./useMutation-BEHPbJP-.js";import"./thumbs-up-h-vAxpty.js";import"./copy-Bq1_hWMk.js";import"./queryOptions-C9woPjwX.js";import"./arrow-left-BsmWH9rO.js";import"./external-link-BfaqusWk.js";import"./plus-iAFjdNIx.js";import"./search-Cv_XFprT.js";import"./chevron-up-35j15Hwd.js";import"./AuthorAvatar-7M5dWdHD.js";import"./curation-BzdOQbkp.js";import"./useInfiniteQuery-BSM2sFVO.js";import"./McpShowcase-DwcLwAEJ.js";import"./AgentLogos-BjOw21yN.js";import"./share-2-D02XQP6n.js";import"./openrouter-BIhbXzcI.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),_=F({queryKey:["paperWebPage",a],queryFn:()=>Je(a),enabled:!x,staleTime:5*6e4,retry:!1}),w=!x&&_.isPending,S=x||((E=_.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 _e=66,ut=240,ae="pwc:reader:split-ratio";function pt(a){const i=Number(sessionStorage.getItem(Ce(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:_e}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,_]=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,C]=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),C("")),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=>{_(e),sessionStorage.setItem(J(a),e)},Ie=()=>{_(void 0),sessionStorage.removeItem(J(a)),R(void 0),C("")},ge=((Pe=b.data)==null?void 0:Pe.paper_reader_selection_enabled)===!0,be=e=>{R(e),C(`Selection from page ${e.page} added to chat`),f&&u&&me(!1)},We=s.useCallback(e=>{R(e),e||C("")},[]),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},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:C}):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:C,highlight:H,onPageChange:e=>{le.current=e,sessionStorage.setItem(Ce(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(_e),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 sa(){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{sa as default,vt as readerToolbarResources}; +import{d as s,b as F,j as r,A as ee,u as Fe,w as qe,e as He,a3 as Se,Z as Ke,L as G}from"./index-UJSMyFje.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-gicVSKa7.js";import{M as Ge}from"./MarkdownText-Bn8aftJG.js";import{g as Je,a as et,b as tt}from"./papers-CDbCMm0m.js";import{f as at,w as rt,s as st,e as nt,a as J,b as je,c as Ce}from"./paperReader-td2aJigh.js";import{a as it}from"./usePapers-CWb1CFyQ.js";import{c as ot}from"./chat-DqN1V6Hp.js";import{s as te}from"./safeExternalHref-CkBrsh84.js";import{ChatExperience as ct}from"./ChatView-DeFesjnR.js";import"./chatSessions-DXNWRdeo.js";/* empty css */import"./hover-card-DcL7U8NI.js";import"./CatalogEntityPreviewLink-YOdjuCTK.js";import"./catalog-Dsah5Rrt.js";import"./github-BbEMdbmg.js";import"./file-text-3syNYWxm.js";import"./PaperPreviewLink-DUxQx42a.js";import"./index-DBb3IysA.js";import"./index-BFkgjGcF.js";import"./katex-DkKDou_j.js";import"./useMutation-BZfxMmoZ.js";import"./thumbs-up-BfFDCpmk.js";import"./copy-D02KQGwg.js";import"./queryOptions-C9woPjwX.js";import"./arrow-left-0-cN70MP.js";import"./external-link-C2oGmjcr.js";import"./plus-DvxtHJU_.js";import"./search-pO5JVRc5.js";import"./chevron-up-Cy3JEUmg.js";import"./AuthorAvatar-B-tDeLM5.js";import"./curation-B0_XT_FL.js";import"./useInfiniteQuery-SD8FlI5O.js";import"./McpShowcase-C8eMjqSr.js";import"./AgentLogos-DCE1drFe.js";import"./share-2-IWsEjGnT.js";import"./openrouter-Dr8-_BKq.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),_=F({queryKey:["paperWebPage",a],queryFn:()=>Je(a),enabled:!x,staleTime:5*6e4,retry:!1}),w=!x&&_.isPending,S=x||((E=_.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 _e=66,ut=240,ae="pwc:reader:split-ratio";function pt(a){const i=Number(sessionStorage.getItem(Ce(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:_e}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,_]=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,C]=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),C("")),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=>{_(e),sessionStorage.setItem(J(a),e)},Ie=()=>{_(void 0),sessionStorage.removeItem(J(a)),R(void 0),C("")},ge=((Pe=b.data)==null?void 0:Pe.paper_reader_selection_enabled)===!0,be=e=>{R(e),C(`Selection from page ${e.page} added to chat`),f&&u&&me(!1)},We=s.useCallback(e=>{R(e),e||C("")},[]),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},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:C}):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:C,highlight:H,onPageChange:e=>{le.current=e,sessionStorage.setItem(Ce(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(_e),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 sa(){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{sa as default,vt as readerToolbarResources}; diff --git a/assets/PapersListView-BxsyYKkb.js b/assets/PapersListView-gsVdSCeE.js similarity index 88% rename from assets/PapersListView-BxsyYKkb.js rename to assets/PapersListView-gsVdSCeE.js index 413825b1839d1358769e282701efdab5f6dae72d..d60eb43a3bb85cdba4ccadc03de0d2347487ab1a 100644 --- a/assets/PapersListView-BxsyYKkb.js +++ b/assets/PapersListView-gsVdSCeE.js @@ -1 +1 @@ -import{d as f,p as M,b as K,j as e,L as x,l as V,o as X,T as J}from"./index-Ba3erEGJ.js";import{T as W}from"./SotaBadges-jHwP4qBt.js";import{I as H}from"./Icon-B7TPsKGh.js";import{u as Y,P as Z,b as ee,c as se,a as re}from"./PaperFeed-BJ9VCI43.js";import{c as ae}from"./catalog-DrZhs4eC.js";import{p as O}from"./papers-BS2bC1xn.js";import{t as te,d as ne}from"./transform-CLQo0OXf.js";import{u as Q}from"./usePapers-MJ0ibwsa.js";import{u as ie}from"./useDebounce-C9OedSoB.js";import{S as oe}from"./skeleton-HWnr28Ly.js";import{A as le,a as ce}from"./alert-DftukI1b.js";import{i as de}from"./apiErrors-CPeTQuQC.js";import{f as me}from"./frameworks-DDA0P4Tf.js";import"./colors-BkWRhvFI.js";import"./PaperCard-cfN4cMqP.js";import"./AuthorAvatar-7M5dWdHD.js";import"./LatexTitle-ZavI0vgc.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-DmIp_t7d.js";import"./useIntersectionObserver-CEcObYrC.js";import"./curation-BzdOQbkp.js";import"./useInfiniteQuery-BSM2sFVO.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,B,q;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=(B=(I=E.data)==null?void 0:I.pages)==null?void 0:B.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:(q=C.data)==null?void 0:q.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{d as f,p as M,b as K,j as e,L as x,l as V,o as X,T as J}from"./index-UJSMyFje.js";import{T as W}from"./SotaBadges-Bu3EIx-o.js";import{I as H}from"./Icon-BoCHdPFA.js";import{u as Y,P as Z,b as ee,c as se,a as re}from"./PaperFeed-DCI8gGsr.js";import{c as ae}from"./catalog-Dsah5Rrt.js";import{p as O}from"./papers-CDbCMm0m.js";import{t as te,d as ne}from"./transform-C3_Sl_p2.js";import{u as Q}from"./usePapers-CWb1CFyQ.js";import{u as ie}from"./useDebounce-smdv6bWN.js";import{S as oe}from"./skeleton-CFPwaPrc.js";import{A as le,a as ce}from"./alert-B1JnXYJB.js";import{i as de}from"./apiErrors-DXz1vC-X.js";import{f as me}from"./frameworks-DDA0P4Tf.js";import"./colors-BkWRhvFI.js";import"./PaperCard-DaYJC8Bk.js";import"./AuthorAvatar-B-tDeLM5.js";import"./LatexTitle-rKci1b5e.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-BTFxRv7H.js";import"./useIntersectionObserver-Akbgy6EK.js";import"./curation-B0_XT_FL.js";import"./useInfiniteQuery-SD8FlI5O.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,B,q;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=(B=(I=E.data)==null?void 0:I.pages)==null?void 0:B.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:(q=C.data)==null?void 0:q.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-B6HbRy37.js b/assets/PrivacyView-DdC1aoXp.js similarity index 98% rename from assets/PrivacyView-B6HbRy37.js rename to assets/PrivacyView-DdC1aoXp.js index eec38e5e342ec2640597403845ab12731c82effd..7417ae249f32a160977f6d28efb7ee6957160ec7 100644 --- a/assets/PrivacyView-B6HbRy37.js +++ b/assets/PrivacyView-DdC1aoXp.js @@ -1 +1 @@ -import{j as e}from"./index-Ba3erEGJ.js";import{u as s,f as i}from"./useDocumentTitle-CJWZHe8w.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-UJSMyFje.js";import{u as s,f as i}from"./useDocumentTitle-BSodmmbQ.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-RwXx3jbv.js b/assets/RateLimitsView-Cgv1UDtJ.js similarity index 87% rename from assets/RateLimitsView-RwXx3jbv.js rename to assets/RateLimitsView-Cgv1UDtJ.js index 1f2667113ee2c518487895e820fd4bd7b4383bab..208d93a0ab6968de35c3eb15ed7fc83f381839d4 100644 --- a/assets/RateLimitsView-RwXx3jbv.js +++ b/assets/RateLimitsView-Cgv1UDtJ.js @@ -1 +1 @@ -import{b as t,j as e}from"./index-Ba3erEGJ.js";import{a as s}from"./account-CKlWxNaZ.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-UJSMyFje.js";import{a as s}from"./account-Ds_mpAFf.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-DXt6Qpt5.js b/assets/ResearchFollowButton-Cn7bhIam.js similarity index 93% rename from assets/ResearchFollowButton-DXt6Qpt5.js rename to assets/ResearchFollowButton-Cn7bhIam.js index 30b98074ef0beefc212bcf897473739a19d86cee..9872ac5fcdc02cadba99a3988841c1155b2a8d98 100644 --- a/assets/ResearchFollowButton-DXt6Qpt5.js +++ b/assets/ResearchFollowButton-Cn7bhIam.js @@ -1 +1 @@ -import{f as x,c as j,d as b,k as F,j as e,h as N,C as S,L as i}from"./index-Ba3erEGJ.js";import{u as y,g as C}from"./researchTopic-CMY-StWV.js";import{P as w}from"./plus-iAFjdNIx.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 R({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{R}; +import{f as x,c as j,d as b,k as F,j as e,h as N,C as S,L as i}from"./index-UJSMyFje.js";import{u as y,g as C}from"./researchTopic-DWD5gtip.js";import{P as w}from"./plus-DvxtHJU_.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 R({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{R}; diff --git a/assets/SavedPapersView-CxMmtsxn.js b/assets/SavedPapersView-BoPnT5xM.js similarity index 89% rename from assets/SavedPapersView-CxMmtsxn.js rename to assets/SavedPapersView-BoPnT5xM.js index 7af3fc08f049623c25851ef183c4a576941ae440..8a9fb5303da3d029e3d9cc8b30e1afb0459540ce 100644 --- a/assets/SavedPapersView-CxMmtsxn.js +++ b/assets/SavedPapersView-BoPnT5xM.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-Ba3erEGJ.js";import{P as f}from"./PaperCard-cfN4cMqP.js";import{T as k}from"./SotaBadges-jHwP4qBt.js";import{S as r}from"./skeleton-HWnr28Ly.js";import{A as y,a as w}from"./alert-DftukI1b.js";import{a as A}from"./account-CKlWxNaZ.js";import{t as B}from"./transform-CLQo0OXf.js";import{s as F}from"./savedPapersAuth-BSn_7mhQ.js";import"./AuthorAvatar-7M5dWdHD.js";import"./Icon-B7TPsKGh.js";import"./LatexTitle-ZavI0vgc.js";import"./papers-BS2bC1xn.js";import"./curation-BzdOQbkp.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-UJSMyFje.js";import{P as f}from"./PaperCard-DaYJC8Bk.js";import{T as k}from"./SotaBadges-Bu3EIx-o.js";import{S as r}from"./skeleton-CFPwaPrc.js";import{A as y,a as w}from"./alert-B1JnXYJB.js";import{a as A}from"./account-Ds_mpAFf.js";import{t as B}from"./transform-C3_Sl_p2.js";import{s as F}from"./savedPapersAuth-lFuT83ZT.js";import"./AuthorAvatar-B-tDeLM5.js";import"./Icon-BoCHdPFA.js";import"./LatexTitle-rKci1b5e.js";import"./papers-CDbCMm0m.js";import"./curation-B0_XT_FL.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-BCyx8pUn.js b/assets/SearchOverlay-CGGXwJf4.js similarity index 95% rename from assets/SearchOverlay-BCyx8pUn.js rename to assets/SearchOverlay-CGGXwJf4.js index 45046dea4a50585c1f6a12b63cad278f2adfae6c..d2f9d508073d3a181124bac745a6b87196e1d14f 100644 --- a/assets/SearchOverlay-BCyx8pUn.js +++ b/assets/SearchOverlay-CGGXwJf4.js @@ -1 +1 @@ -import{d as K,e as O,V as M,l as B,b as i,j as e,p as H}from"./index-Ba3erEGJ.js";import{L as U}from"./LatexTitle-ZavI0vgc.js";import{c as x}from"./catalog-DrZhs4eC.js";import{p as R}from"./papers-BS2bC1xn.js";import{u as Y}from"./useDebounce-C9OedSoB.js";import{c as G,h as V}from"./colors-BkWRhvFI.js";import{d as X}from"./transform-CLQo0OXf.js";import"./curation-BzdOQbkp.js";const Z=10,S=6,W=350,v=3,ls=({open:t,onClose:h})=>{var A,C,w,P,Q,z;const f=K.useRef(null),$=O(),[c,D]=M.useState(""),a=Y(c,W),j=c.trim(),r=a.trim().length>=v,y=B();K.useEffect(()=>{var l;if(!t)return;(l=f.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)||[],u=((w=E.data)==null?void 0:w.results)||[],m=((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||u.length||m.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:f,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 ",v," 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))]}),u.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Benchmarks · ",u.length]}),u.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))]}),m.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Authors · ",m.length]}),m.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>=v&&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{d as K,e as O,V as M,l as B,b as i,j as e,p as H}from"./index-UJSMyFje.js";import{L as U}from"./LatexTitle-rKci1b5e.js";import{c as x}from"./catalog-Dsah5Rrt.js";import{p as R}from"./papers-CDbCMm0m.js";import{u as Y}from"./useDebounce-smdv6bWN.js";import{c as G,h as V}from"./colors-BkWRhvFI.js";import{d as X}from"./transform-C3_Sl_p2.js";import"./curation-B0_XT_FL.js";const Z=10,S=6,W=350,v=3,ls=({open:t,onClose:h})=>{var A,C,w,P,Q,z;const f=K.useRef(null),$=O(),[c,D]=M.useState(""),a=Y(c,W),j=c.trim(),r=a.trim().length>=v,y=B();K.useEffect(()=>{var l;if(!t)return;(l=f.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)||[],u=((w=E.data)==null?void 0:w.results)||[],m=((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||u.length||m.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:f,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 ",v," 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))]}),u.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Benchmarks · ",u.length]}),u.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))]}),m.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Authors · ",m.length]}),m.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>=v&&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-ZclHRLlr.js b/assets/SettingsView-mdf-Sc1f.js similarity index 97% rename from assets/SettingsView-ZclHRLlr.js rename to assets/SettingsView-mdf-Sc1f.js index b19e6220d64f979acaff66f00223f7d9705ede73..e87e1a65b2466f7e42aeebfea56e980452fe19a3 100644 --- a/assets/SettingsView-ZclHRLlr.js +++ b/assets/SettingsView-mdf-Sc1f.js @@ -1,4 +1,4 @@ -import{s as k,a as A,c as ce,d as L,b as I,r as Q,j as e,L as T,i as W,H as C,h as de,aw as he,l as ue,V as P,A as ae}from"./index-Ba3erEGJ.js";import{u as E}from"./useMutation-BEHPbJP-.js";import{a as ge,T as se,r as z,u as me,g as pe}from"./researchTopic-CMY-StWV.js";import{S as K}from"./switch-tyjzliQR.js";import{S as fe}from"./sparkles-B_KArhDU.js";import{A as ye}from"./arrow-right-TYlHRUWw.js";import{T as xe}from"./trophy-DJUcjk8C.js";import{c as N}from"./chat-CI3_nFJ5.js";import{u as je,f as be}from"./useDocumentTitle-CJWZHe8w.js";import{a as ve,u as we,r as ke,O as Y}from"./openrouter-BIhbXzcI.js";import{u as Ne}from"./preferences-VZbz27zI.js";import{E as ne}from"./external-link-BfaqusWk.js";import{M as Ce}from"./moon-BoU_q9no.js";import"./index-Cf9alo2v.js";import"./account-CKlWxNaZ.js";/** +import{s as k,a as A,c as ce,d as L,b as I,r as Q,j as e,L as T,i as W,H as C,h as de,aw as he,l as ue,V as P,A as ae}from"./index-UJSMyFje.js";import{u as E}from"./useMutation-BZfxMmoZ.js";import{a as ge,T as se,r as z,u as me,g as pe}from"./researchTopic-DWD5gtip.js";import{S as K}from"./switch-DnXKOkEG.js";import{S as fe}from"./sparkles-C-mZg8SQ.js";import{A as ye}from"./arrow-right-DdcCN24Z.js";import{T as xe}from"./trophy-Dwhwm0GW.js";import{c as N}from"./chat-DqN1V6Hp.js";import{u as je,f as be}from"./useDocumentTitle-BSodmmbQ.js";import{a as ve,u as we,r as ke,O as Y}from"./openrouter-Dr8-_BKq.js";import{u as Ne}from"./preferences-C-HGVwrj.js";import{E as ne}from"./external-link-C2oGmjcr.js";import{M as Ce}from"./moon-CKb8EyrU.js";import"./index-Mqdf1wPX.js";import"./account-Ds_mpAFf.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/SharedChatView-BYQRXyDz.js b/assets/SharedChatView-CdO9rnWF.js similarity index 78% rename from assets/SharedChatView-BYQRXyDz.js rename to assets/SharedChatView-CdO9rnWF.js index b64e20c1af42e306bd4b454d87855df99387f7b1..8061b0c1f34a5e33c9d653f6ef7ecfba0e330bf8 100644 --- a/assets/SharedChatView-BYQRXyDz.js +++ b/assets/SharedChatView-CdO9rnWF.js @@ -1 +1 @@ -import{u as x,e as g,d as o,b as v,j as e,A as f,q as j}from"./index-Ba3erEGJ.js";import{A as b,a as y,C as S,U as w,b as N,t as k}from"./chatLifecycle-C8zlIZya.js";import{e as C,p as q,f as A,q as P}from"./chatSessions-Br4UCLSi.js";import{c as _}from"./chat-CI3_nFJ5.js";/* empty css */import"./hover-card-C6ObQOHL.js";import"./CatalogEntityPreviewLink-CuEpk2Oj.js";import"./catalog-DrZhs4eC.js";import"./github-BUiEiKpk.js";import"./file-text-DM3Ql8Fd.js";import"./PaperPreviewLink-ByPUM9fv.js";import"./index-Bc8fO69p.js";import"./index-C2GWM2ou.js";import"./katex-DkKDou_j.js";import"./papers-BS2bC1xn.js";import"./curation-BzdOQbkp.js";import"./useMutation-BEHPbJP-.js";import"./thumbs-up-h-vAxpty.js";import"./copy-Bq1_hWMk.js";import"./queryOptions-C9woPjwX.js";import"./arrow-left-BsmWH9rO.js";import"./external-link-BfaqusWk.js";import"./plus-iAFjdNIx.js";import"./search-Cv_XFprT.js";import"./chevron-up-35j15Hwd.js";import"./AuthorAvatar-7M5dWdHD.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,e as g,d as o,b as v,j as e,A as f,q as j}from"./index-UJSMyFje.js";import{A as b,a as y,C as S,U as w,b as N,t as k}from"./chatLifecycle-gicVSKa7.js";import{e as C,p as q,f as A,q as P}from"./chatSessions-DXNWRdeo.js";import{c as _}from"./chat-DqN1V6Hp.js";/* empty css */import"./hover-card-DcL7U8NI.js";import"./CatalogEntityPreviewLink-YOdjuCTK.js";import"./catalog-Dsah5Rrt.js";import"./github-BbEMdbmg.js";import"./file-text-3syNYWxm.js";import"./PaperPreviewLink-DUxQx42a.js";import"./index-DBb3IysA.js";import"./index-BFkgjGcF.js";import"./katex-DkKDou_j.js";import"./papers-CDbCMm0m.js";import"./curation-B0_XT_FL.js";import"./useMutation-BZfxMmoZ.js";import"./thumbs-up-BfFDCpmk.js";import"./copy-D02KQGwg.js";import"./queryOptions-C9woPjwX.js";import"./arrow-left-0-cN70MP.js";import"./external-link-C2oGmjcr.js";import"./plus-DvxtHJU_.js";import"./search-pO5JVRc5.js";import"./chevron-up-Cy3JEUmg.js";import"./AuthorAvatar-B-tDeLM5.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-XDg1xPWL.js b/assets/SignInToEditDialog-WalvYyhX.js similarity index 95% rename from assets/SignInToEditDialog-XDg1xPWL.js rename to assets/SignInToEditDialog-WalvYyhX.js index 7743cb398018f6a060fc8f4513f6d2b6e8811061..90a91236e2d6d93af04cc8ee927e7f46ae39a8fa 100644 --- a/assets/SignInToEditDialog-XDg1xPWL.js +++ b/assets/SignInToEditDialog-WalvYyhX.js @@ -1,4 +1,4 @@ -import{s as be,d 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-Ba3erEGJ.js";import{B as P}from"./button-Dvq5drsi.js";import{I as u}from"./input-wEykysM6.js";import{T as Ce}from"./textarea-bNIL0Bcb.js";import{S as se}from"./searchable-select-CjSbtAzP.js";import{D as ie,a as oe,c as le,b as ce,d as de,e as De}from"./dialog-ChZD9naX.js";import{u as Ie}from"./useMutation-BEHPbJP-.js";import{s as b,p as j}from"./submissions-D9Ty3arc.js";import{c as te}from"./catalog-DrZhs4eC.js";import{L as Ee}from"./loader-circle-ChybJ0KP.js";/** +import{s as be,d 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-UJSMyFje.js";import{B as P}from"./button-CIbfeiDg.js";import{I as u}from"./input-C9lvFHZR.js";import{T as Ce}from"./textarea-BC68vWsz.js";import{S as se}from"./searchable-select-BatELYUf.js";import{D as ie,a as oe,c as le,b as ce,d as de,e as De}from"./dialog-BodVIP1P.js";import{u as Ie}from"./useMutation-BZfxMmoZ.js";import{s as b,p as j}from"./submissions-DozYdY52.js";import{c as te}from"./catalog-Dsah5Rrt.js";import{L as Ee}from"./loader-circle-l5JFsbEa.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/SotaBadges-jHwP4qBt.js b/assets/SotaBadges-Bu3EIx-o.js similarity index 97% rename from assets/SotaBadges-jHwP4qBt.js rename to assets/SotaBadges-Bu3EIx-o.js index bd42b552264f19d05cd569e811878c8326988dd2..b28cc8711b878521a2a12073225d758550353d3d 100644 --- a/assets/SotaBadges-jHwP4qBt.js +++ b/assets/SotaBadges-Bu3EIx-o.js @@ -1 +1 @@ -import{e as M,j as e,V as x,L as C}from"./index-Ba3erEGJ.js";import{h as F,c as E}from"./colors-BkWRhvFI.js";import{d as A,h as P}from"./transform-CLQo0OXf.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,k=i,f=i+h+2;let w=i+2;const R=w;w+=6;const T=w+1;w+=5;const L=w;w+=3;const g=w+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,v)=>e.jsx("rect",{x:i+(r-i*2)*(1-y)/2,y:R+v*2.4,width:(r-i*2)*y,height:1.4,fill:u,rx:.3},`t${v}`)),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,v)=>{const b=g+v*2.1;return b>a-i-1?null:e.jsx("rect",{x:k,y:b,width:h*y,height:.8,fill:d,opacity:.55,rx:.2},`l${v}`)}),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,v)=>{const b=g+(n?16:0)+v*2.1;return b>a-i-1?null:e.jsx("rect",{x:f,y:b,width:h*y,height:.8,fill:d,opacity:.55,rx:.2},`r${v}`)})]})})},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 k of t){const f=m(k.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{e as M,j as e,V as x,L as C}from"./index-UJSMyFje.js";import{h as F,c as E}from"./colors-BkWRhvFI.js";import{d as A,h as P}from"./transform-C3_Sl_p2.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,k=i,f=i+h+2;let w=i+2;const R=w;w+=6;const T=w+1;w+=5;const L=w;w+=3;const g=w+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,v)=>e.jsx("rect",{x:i+(r-i*2)*(1-y)/2,y:R+v*2.4,width:(r-i*2)*y,height:1.4,fill:u,rx:.3},`t${v}`)),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,v)=>{const b=g+v*2.1;return b>a-i-1?null:e.jsx("rect",{x:k,y:b,width:h*y,height:.8,fill:d,opacity:.55,rx:.2},`l${v}`)}),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,v)=>{const b=g+(n?16:0)+v*2.1;return b>a-i-1?null:e.jsx("rect",{x:f,y:b,width:h*y,height:.8,fill:d,opacity:.55,rx:.2},`r${v}`)})]})})},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 k of t){const f=m(k.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-BDq5Q7CO.js b/assets/StagingAccessRequestView-CsCd75Hi.js similarity index 95% rename from assets/StagingAccessRequestView-BDq5Q7CO.js rename to assets/StagingAccessRequestView-CsCd75Hi.js index 3a03571ec93240d560eacb2beba94e57d9042b5c..a028cc14368082faf7c0b28b72b0c5d32b5ca96c 100644 --- a/assets/StagingAccessRequestView-BDq5Q7CO.js +++ b/assets/StagingAccessRequestView-CsCd75Hi.js @@ -1 +1 @@ -import{a as m,V as a,j as e,H as g,b3 as p}from"./index-Ba3erEGJ.js";import{C as j}from"./circle-check-Dg57zcLs.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-UJSMyFje.js";import{C as j}from"./circle-check-4v9OryJ8.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-BgxP46NN.js b/assets/SubmissionsDashboard-BVm2OhKB.js similarity index 97% rename from assets/SubmissionsDashboard-BgxP46NN.js rename to assets/SubmissionsDashboard-BVm2OhKB.js index ca140bc551dbaf9b1a9d03e61eb36016b4ac383c..2f530a571a41550ee5810c2f3c9c6531ad5e3c41 100644 --- a/assets/SubmissionsDashboard-BgxP46NN.js +++ b/assets/SubmissionsDashboard-BVm2OhKB.js @@ -1,4 +1,4 @@ -import{s as ae,V as v,j as e,I as y,b as ne,o as H,a3 as re,x as oe,p as le,y as E,i as de,aB as T,aC as ce,aD as ue,aE as pe}from"./index-Ba3erEGJ.js";import{u as W,r as me,e as he}from"./evaluationQueryInvalidation-C_YXfZMC.js";import{i as X,a as K}from"./queryInvalidation-Bw6KJ8Q2.js";import{u as D}from"./useMutation-BEHPbJP-.js";import{u as fe}from"./useInfiniteQuery-BSM2sFVO.js";import{c as C}from"./catalog-DrZhs4eC.js";import{s as xe}from"./safeExternalHref-CkBrsh84.js";import{E as O,s as I}from"./submissions-D9Ty3arc.js";import{p as je}from"./papers-BS2bC1xn.js";import{R as ge,C as ve}from"./refresh-cw-B-hwdprb.js";import{L as $}from"./loader-circle-ChybJ0KP.js";import{C as be}from"./circle-check-Dg57zcLs.js";import"./curation-BzdOQbkp.js";/** +import{s as ae,V as v,j as e,I as y,b as ne,o as H,a3 as re,x as oe,p as le,y as E,i as de,aB as T,aC as ce,aD as ue,aE as pe}from"./index-UJSMyFje.js";import{u as W,r as me,e as he}from"./evaluationQueryInvalidation-k4vq42xx.js";import{i as X,a as K}from"./queryInvalidation-BfAZ_-1R.js";import{u as D}from"./useMutation-BZfxMmoZ.js";import{u as fe}from"./useInfiniteQuery-SD8FlI5O.js";import{c as C}from"./catalog-Dsah5Rrt.js";import{s as xe}from"./safeExternalHref-CkBrsh84.js";import{E as O,s as I}from"./submissions-DozYdY52.js";import{p as je}from"./papers-CDbCMm0m.js";import{R as ge,C as ve}from"./refresh-cw-BnBjJTkI.js";import{L as $}from"./loader-circle-l5JFsbEa.js";import{C as be}from"./circle-check-4v9OryJ8.js";import"./curation-B0_XT_FL.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/SubmitView-CzGulDZf.js b/assets/SubmitView-CJCUKMi9.js similarity index 93% rename from assets/SubmitView-CzGulDZf.js rename to assets/SubmitView-CJCUKMi9.js index ad8498f2141ee70f1ccd06ffb2f054df54f73db2..1b45e57f3b8a164e7ca983cd7e2cf2f10596dca9 100644 --- a/assets/SubmitView-CzGulDZf.js +++ b/assets/SubmitView-CJCUKMi9.js @@ -1 +1 @@ -import{e as D,i as E,x as C,a as F,g as N,V as o,y as X,j as e,h as z}from"./index-Ba3erEGJ.js";import{u as U}from"./useMutation-BEHPbJP-.js";import{A as O,a as V}from"./alert-DftukI1b.js";import{B as P}from"./button-Dvq5drsi.js";import{I as h}from"./input-wEykysM6.js";import{T as q}from"./textarea-bNIL0Bcb.js";import{p as B}from"./papers-BS2bC1xn.js";import{a as H}from"./queryInvalidation-Bw6KJ8Q2.js";import"./curation-BzdOQbkp.js";const S="pwc:paper-submit-draft",R={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 k(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(k(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=k(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:R,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:R,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{e as D,i as E,x as C,a as F,g as N,V as o,y as X,j as e,h as z}from"./index-UJSMyFje.js";import{u as U}from"./useMutation-BZfxMmoZ.js";import{A as O,a as V}from"./alert-B1JnXYJB.js";import{B as P}from"./button-CIbfeiDg.js";import{I as h}from"./input-C9lvFHZR.js";import{T as q}from"./textarea-BC68vWsz.js";import{p as B}from"./papers-CDbCMm0m.js";import{a as H}from"./queryInvalidation-BfAZ_-1R.js";import"./curation-B0_XT_FL.js";const S="pwc:paper-submit-draft",R={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 k(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(k(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=k(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:R,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:R,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-C77s9kzE.js b/assets/TagBrowseView-MtjLHjMN.js similarity index 91% rename from assets/TagBrowseView-C77s9kzE.js rename to assets/TagBrowseView-MtjLHjMN.js index a68035a24e84df587be7bfa83bf210b598a50ee1..46d606c02d6c2f339dff61e9aa37407dc5e93978 100644 --- a/assets/TagBrowseView-C77s9kzE.js +++ b/assets/TagBrowseView-MtjLHjMN.js @@ -1 +1 @@ -import{j as e,L as g,V as oe,u as de,e as me,d as j,b as G,p as he,a3 as pe,o as K,T as O}from"./index-Ba3erEGJ.js";import{R as ue}from"./ResearchFollowButton-DXt6Qpt5.js";import{M as ge}from"./SotaBadges-jHwP4qBt.js";import{u as be,b as xe,a as je}from"./PaperFeed-BJ9VCI43.js";import{A as L}from"./arrow-right-TYlHRUWw.js";import{B as ke}from"./BenchmarkTrendSparkline-DUyuuDoa.js";import{M as W}from"./MarkdownText-FuN1EKHi.js";import{c as J}from"./catalog-DrZhs4eC.js";import{p as _e}from"./papers-BS2bC1xn.js";import{i as Ne}from"./apiErrors-CPeTQuQC.js";import{f as fe}from"./frameworks-DDA0P4Tf.js";import{u as we}from"./preferences-VZbz27zI.js";import{s as ve}from"./slug-BpH-Nkvz.js";import{d as f,t as ye}from"./transform-CLQo0OXf.js";import{u as Se}from"./usePapers-MJ0ibwsa.js";import{S as P}from"./skeleton-HWnr28Ly.js";import{A as Te,a as Ee}from"./alert-DftukI1b.js";import Be from"./NotFound-B3EehO4t.js";import{T as $e}from"./trophy-DJUcjk8C.js";import{G as Me}from"./github-BUiEiKpk.js";import"./researchTopic-CMY-StWV.js";import"./useMutation-BEHPbJP-.js";import"./plus-iAFjdNIx.js";import"./colors-BkWRhvFI.js";import"./PaperCard-cfN4cMqP.js";import"./AuthorAvatar-7M5dWdHD.js";import"./Icon-B7TPsKGh.js";import"./LatexTitle-ZavI0vgc.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-DmIp_t7d.js";import"./useIntersectionObserver-CEcObYrC.js";/* empty css */import"./PaperPreviewLink-ByPUM9fv.js";import"./index-Bc8fO69p.js";import"./index-C2GWM2ou.js";import"./katex-DkKDou_j.js";import"./hover-card-C6ObQOHL.js";import"./curation-BzdOQbkp.js";import"./account-CKlWxNaZ.js";import"./useInfiniteQuery-BSM2sFVO.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:["★ ",fe(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:f(i.name,i.slug)})]},i.id)),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--accent-text)"},children:f(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]),N=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=N.data)==null?void 0:s.pages.flatMap(a=>a.results.map(ye)))??[]},[N.data]),$=j.useMemo(()=>{var a;const s={};return(a=N.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)},[N.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(Ne(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=f(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:f(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:N,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:f(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,e as me,d as j,b as G,p as he,a3 as pe,o as K,T as O}from"./index-UJSMyFje.js";import{R as ue}from"./ResearchFollowButton-Cn7bhIam.js";import{M as ge}from"./SotaBadges-Bu3EIx-o.js";import{u as be,b as xe,a as je}from"./PaperFeed-DCI8gGsr.js";import{A as L}from"./arrow-right-DdcCN24Z.js";import{B as ke}from"./BenchmarkTrendSparkline-Bj_0iVvJ.js";import{M as W}from"./MarkdownText-Bn8aftJG.js";import{c as J}from"./catalog-Dsah5Rrt.js";import{p as _e}from"./papers-CDbCMm0m.js";import{i as Ne}from"./apiErrors-DXz1vC-X.js";import{f as fe}from"./frameworks-DDA0P4Tf.js";import{u as we}from"./preferences-C-HGVwrj.js";import{s as ve}from"./slug-BpH-Nkvz.js";import{d as f,t as ye}from"./transform-C3_Sl_p2.js";import{u as Se}from"./usePapers-CWb1CFyQ.js";import{S as P}from"./skeleton-CFPwaPrc.js";import{A as Te,a as Ee}from"./alert-B1JnXYJB.js";import Be from"./NotFound-CyT6FuD7.js";import{T as $e}from"./trophy-Dwhwm0GW.js";import{G as Me}from"./github-BbEMdbmg.js";import"./researchTopic-DWD5gtip.js";import"./useMutation-BZfxMmoZ.js";import"./plus-DvxtHJU_.js";import"./colors-BkWRhvFI.js";import"./PaperCard-DaYJC8Bk.js";import"./AuthorAvatar-B-tDeLM5.js";import"./Icon-BoCHdPFA.js";import"./LatexTitle-rKci1b5e.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-BTFxRv7H.js";import"./useIntersectionObserver-Akbgy6EK.js";/* empty css */import"./PaperPreviewLink-DUxQx42a.js";import"./index-DBb3IysA.js";import"./index-BFkgjGcF.js";import"./katex-DkKDou_j.js";import"./hover-card-DcL7U8NI.js";import"./curation-B0_XT_FL.js";import"./account-Ds_mpAFf.js";import"./useInfiniteQuery-SD8FlI5O.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:["★ ",fe(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:f(i.name,i.slug)})]},i.id)),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--accent-text)"},children:f(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]),N=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=N.data)==null?void 0:s.pages.flatMap(a=>a.results.map(ye)))??[]},[N.data]),$=j.useMemo(()=>{var a;const s={};return(a=N.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)},[N.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(Ne(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=f(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:f(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:N,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:f(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-G-b0gdzh.js b/assets/TagsIndexView-gSGXUknL.js similarity index 97% rename from assets/TagsIndexView-G-b0gdzh.js rename to assets/TagsIndexView-gSGXUknL.js index e173e404b894c9e78cf5e2bc6549b361da0aee6f..51cae786190a8b726639240525fc2768c602bc66 100644 --- a/assets/TagsIndexView-G-b0gdzh.js +++ b/assets/TagsIndexView-gSGXUknL.js @@ -1,4 +1,4 @@ -import{s as e,b as s,d as g,j as a,L as z,o as j,T as p}from"./index-Ba3erEGJ.js";import{c as k}from"./catalog-DrZhs4eC.js";import{c as v,h as u}from"./colors-BkWRhvFI.js";import{d as f}from"./transform-CLQo0OXf.js";import{s as S}from"./slug-BpH-Nkvz.js";import{S as L}from"./search-Cv_XFprT.js";import{I as C,T as V}from"./triangle-alert-D4uF0BJ0.js";import{S as A}from"./share-2-D02XQP6n.js";import{T as H}from"./trending-up-DXFkPm8S.js";import{M as T}from"./moon-BoU_q9no.js";import{T as F}from"./thumbs-up-h-vAxpty.js";import{D as Z}from"./database-S18Pv0JO.js";import{T as B}from"./trophy-DJUcjk8C.js";import{F as P}from"./file-text-DM3Ql8Fd.js";import{A as N}from"./activity-BAgDG_PZ.js";import{G as D}from"./globe-D1DCSPNI.js";import{S as E}from"./sparkles-B_KArhDU.js";import{A as _,a as G}from"./alert-DftukI1b.js";import{A as I,a as U,b as W}from"./AreaSection-C1JWPNIG.js";import{T as Q}from"./TaxonomySuggestionTile-CiMXTa8j.js";import{u as R,T as $}from"./useHashScrollOnReady-LOdkzT1I.js";import{s as K}from"./areas-Dvi8w2dp.js";import"./skeleton-HWnr28Ly.js";import"./SignInToEditDialog-XDg1xPWL.js";import"./button-Dvq5drsi.js";import"./input-wEykysM6.js";import"./textarea-bNIL0Bcb.js";import"./searchable-select-CjSbtAzP.js";import"./popover-DmIp_t7d.js";import"./dialog-ChZD9naX.js";import"./loader-circle-ChybJ0KP.js";import"./useMutation-BEHPbJP-.js";import"./submissions-D9Ty3arc.js";import"./plus-iAFjdNIx.js";/** +import{s as e,b as s,d as g,j as a,L as z,o as j,T as p}from"./index-UJSMyFje.js";import{c as k}from"./catalog-Dsah5Rrt.js";import{c as v,h as u}from"./colors-BkWRhvFI.js";import{d as f}from"./transform-C3_Sl_p2.js";import{s as S}from"./slug-BpH-Nkvz.js";import{S as L}from"./search-pO5JVRc5.js";import{I as C,T as V}from"./triangle-alert-CHI1ovss.js";import{S as A}from"./share-2-IWsEjGnT.js";import{T as H}from"./trending-up-Yn_2_YaT.js";import{M as T}from"./moon-CKb8EyrU.js";import{T as F}from"./thumbs-up-BfFDCpmk.js";import{D as Z}from"./database-BhnoZEjS.js";import{T as B}from"./trophy-Dwhwm0GW.js";import{F as P}from"./file-text-3syNYWxm.js";import{A as N}from"./activity-CrJg4hka.js";import{G as D}from"./globe-dxeznk4G.js";import{S as E}from"./sparkles-C-mZg8SQ.js";import{A as _,a as G}from"./alert-B1JnXYJB.js";import{A as I,a as U,b as W}from"./AreaSection-GuFqPtDa.js";import{T as Q}from"./TaxonomySuggestionTile-D09uiSgJ.js";import{u as R,T as $}from"./useHashScrollOnReady-D9YVP7Oq.js";import{s as K}from"./areas-Dvi8w2dp.js";import"./skeleton-CFPwaPrc.js";import"./SignInToEditDialog-WalvYyhX.js";import"./button-CIbfeiDg.js";import"./input-C9lvFHZR.js";import"./textarea-BC68vWsz.js";import"./searchable-select-BatELYUf.js";import"./popover-BTFxRv7H.js";import"./dialog-BodVIP1P.js";import"./loader-circle-l5JFsbEa.js";import"./useMutation-BZfxMmoZ.js";import"./submissions-DozYdY52.js";import"./plus-DvxtHJU_.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/TaxonomySuggestionTile-CiMXTa8j.js b/assets/TaxonomySuggestionTile-D09uiSgJ.js similarity index 76% rename from assets/TaxonomySuggestionTile-CiMXTa8j.js rename to assets/TaxonomySuggestionTile-D09uiSgJ.js index 140a595afcb3380eb919f1cc439683a1efeb22db..58f5588eec7bba03c3158924dbe37767b41d8ce5 100644 --- a/assets/TaxonomySuggestionTile-CiMXTa8j.js +++ b/assets/TaxonomySuggestionTile-D09uiSgJ.js @@ -1 +1 @@ -import{a as u,d as t,j as e}from"./index-Ba3erEGJ.js";import{S as c,a as m}from"./SignInToEditDialog-XDg1xPWL.js";import{P as p}from"./plus-iAFjdNIx.js";function j({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{j as T}; +import{a as u,d as t,j as e}from"./index-UJSMyFje.js";import{S as c,a as m}from"./SignInToEditDialog-WalvYyhX.js";import{P as p}from"./plus-DvxtHJU_.js";function j({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{j as T}; diff --git a/assets/TrendsView-CKKi1VRU.js b/assets/TrendsView-dP2jMXv2.js similarity index 97% rename from assets/TrendsView-CKKi1VRU.js rename to assets/TrendsView-dP2jMXv2.js index a9c38c0b1870e8a63ffcf39ef915b6c3a6d1a276..655d12af60f04349b973fe6c7985bc59c36dc60c 100644 --- a/assets/TrendsView-CKKi1VRU.js +++ b/assets/TrendsView-dP2jMXv2.js @@ -1 +1 @@ -import{V as I,j as e,ac as X,b as G}from"./index-Ba3erEGJ.js";import{A as J,a as V}from"./alert-DftukI1b.js";import{S as P}from"./skeleton-HWnr28Ly.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-UJSMyFje.js";import{A as J,a as V}from"./alert-B1JnXYJB.js";import{S as P}from"./skeleton-CFPwaPrc.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-CUBmzN74.js b/assets/UserProfileView-BsS0SIpI.js similarity index 89% rename from assets/UserProfileView-CUBmzN74.js rename to assets/UserProfileView-BsS0SIpI.js index 7983493f8970de6d70278ceb22529e2728ba65cb..66eed652d91843f6d1ca04cfa234996e84b2dd9b 100644 --- a/assets/UserProfileView-CUBmzN74.js +++ b/assets/UserProfileView-BsS0SIpI.js @@ -1 +1 @@ -import{az as n,u as i,b as o,j as e,ao as d}from"./index-Ba3erEGJ.js";import{C as l}from"./OrganizationContributionGraph-iCMW2Vfi.js";import"./skeleton-HWnr28Ly.js";import"./catalog-DrZhs4eC.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-UJSMyFje.js";import{C as l}from"./OrganizationContributionGraph-DrwHtk4l.js";import"./skeleton-CFPwaPrc.js";import"./catalog-Dsah5Rrt.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-CKlWxNaZ.js b/assets/account-Ds_mpAFf.js similarity index 89% rename from assets/account-CKlWxNaZ.js rename to assets/account-Ds_mpAFf.js index 23097af68f6de0ebc266d939d0461918939436e9..4724cbcbb0797fa778f3816c4e0cdce6aa6f4493 100644 --- a/assets/account-CKlWxNaZ.js +++ b/assets/account-Ds_mpAFf.js @@ -1 +1 @@ -import{ac as r}from"./index-Ba3erEGJ.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-UJSMyFje.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-BAgDG_PZ.js b/assets/activity-CrJg4hka.js similarity index 89% rename from assets/activity-BAgDG_PZ.js rename to assets/activity-CrJg4hka.js index 509135abd7eef56703dcb0ec22bb55a618b13bf4..bc09491cbaf4c626e935e1cfe3378ee6f34a6c12 100644 --- a/assets/activity-BAgDG_PZ.js +++ b/assets/activity-CrJg4hka.js @@ -1,4 +1,4 @@ -import{s as t}from"./index-Ba3erEGJ.js";/** +import{s as t}from"./index-UJSMyFje.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/alert-DftukI1b.js b/assets/alert-B1JnXYJB.js similarity index 92% rename from assets/alert-DftukI1b.js rename to assets/alert-B1JnXYJB.js index 9dbe5f7f649a6fbf05a833316d1180b5b6b9de43..c56f9528f8c943d98a90a6a989f92772222d539b 100644 --- a/assets/alert-DftukI1b.js +++ b/assets/alert-B1JnXYJB.js @@ -1 +1 @@ -import{d as r,j as s,I as d,ae as i}from"./index-Ba3erEGJ.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},l)=>s.jsx("div",{ref:l,role:"alert",className:d(o({variant:t}),e),...a}));n.displayName="Alert";const v=r.forwardRef(({className:e,...t},a)=>s.jsx("h5",{ref:a,className:d("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:d("text-sm [&_p]:leading-relaxed",e),...t}));c.displayName="AlertDescription";export{n as A,c as a}; +import{d as r,j as s,I as d,ae as i}from"./index-UJSMyFje.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},l)=>s.jsx("div",{ref:l,role:"alert",className:d(o({variant:t}),e),...a}));n.displayName="Alert";const v=r.forwardRef(({className:e,...t},a)=>s.jsx("h5",{ref:a,className:d("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:d("text-sm [&_p]:leading-relaxed",e),...t}));c.displayName="AlertDescription";export{n as A,c as a}; diff --git a/assets/apiErrors-CPeTQuQC.js b/assets/apiErrors-CPeTQuQC.js deleted file mode 100644 index 6d365d66d29cd721297ca9c0dbca7244b7be9a4e..0000000000000000000000000000000000000000 --- a/assets/apiErrors-CPeTQuQC.js +++ /dev/null @@ -1 +0,0 @@ -import{A as s}from"./index-Ba3erEGJ.js";const i=o=>o instanceof s&&o.status===404;export{i}; diff --git a/assets/apiErrors-DXz1vC-X.js b/assets/apiErrors-DXz1vC-X.js new file mode 100644 index 0000000000000000000000000000000000000000..fa0a7981527f3dbc128a72eaba4cd3187c213cfb --- /dev/null +++ b/assets/apiErrors-DXz1vC-X.js @@ -0,0 +1 @@ +import{A as s}from"./index-UJSMyFje.js";const i=o=>o instanceof s&&o.status===404;export{i}; diff --git a/assets/arrow-left-BsmWH9rO.js b/assets/arrow-left-0-cN70MP.js similarity index 86% rename from assets/arrow-left-BsmWH9rO.js rename to assets/arrow-left-0-cN70MP.js index dd6c0f1a0e4de22972c661faa297f2e8d766a103..ab8c4a4a3c3f6b7d5ec7a95473ea60e64141b432 100644 --- a/assets/arrow-left-BsmWH9rO.js +++ b/assets/arrow-left-0-cN70MP.js @@ -1,4 +1,4 @@ -import{s as e}from"./index-Ba3erEGJ.js";/** +import{s as e}from"./index-UJSMyFje.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/arrow-right-TYlHRUWw.js b/assets/arrow-right-DdcCN24Z.js similarity index 86% rename from assets/arrow-right-TYlHRUWw.js rename to assets/arrow-right-DdcCN24Z.js index 8cf55ab174362ee044be7a2a3da3a304565e5c17..0b164a0ddf792738cecdf99dbdefeace391ae024 100644 --- a/assets/arrow-right-TYlHRUWw.js +++ b/assets/arrow-right-DdcCN24Z.js @@ -1,4 +1,4 @@ -import{s as r}from"./index-Ba3erEGJ.js";/** +import{s as r}from"./index-UJSMyFje.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/badge-Cjyk4r9x.js b/assets/badge-Blda41S-.js similarity index 90% rename from assets/badge-Cjyk4r9x.js rename to assets/badge-Blda41S-.js index 009561c47b673eee108e67936ab90924828832c2..39f498d4f2eb07f3288e5fc7cd57f5faf1fc4587 100644 --- a/assets/badge-Cjyk4r9x.js +++ b/assets/badge-Blda41S-.js @@ -1 +1 @@ -import{j as n,I as o,ae as a}from"./index-Ba3erEGJ.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-UJSMyFje.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-Dvq5drsi.js b/assets/button-CIbfeiDg.js similarity index 89% rename from assets/button-Dvq5drsi.js rename to assets/button-CIbfeiDg.js index 217a48c708ccdfb3f71dd37aa677671a4fc1dda8..223f40c5dc2c2f9b5b8a0ebc914612eb24a49645 100644 --- a/assets/button-Dvq5drsi.js +++ b/assets/button-CIbfeiDg.js @@ -1 +1 @@ -import{d as a,j as d,aA as u,I as c,ae as f}from"./index-Ba3erEGJ.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{d as a,j as d,aA as u,I as c,ae as f}from"./index-UJSMyFje.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-DrZhs4eC.js b/assets/catalog-Dsah5Rrt.js similarity index 97% rename from assets/catalog-DrZhs4eC.js rename to assets/catalog-Dsah5Rrt.js index d15d75c8d04ad0ad8d27781ac2682cfaf7ed039b..b57990b987ad5ac03e05635c9196c5a4bbfcc444 100644 --- a/assets/catalog-DrZhs4eC.js +++ b/assets/catalog-Dsah5Rrt.js @@ -1 +1 @@ -import{ac as o}from"./index-Ba3erEGJ.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-UJSMyFje.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-CI3_nFJ5.js b/assets/chat-DqN1V6Hp.js similarity index 98% rename from assets/chat-CI3_nFJ5.js rename to assets/chat-DqN1V6Hp.js index 2f03acf45ba2f9630393de345e3594e7b2d86e0d..2e52d7378dbb73a14eab65775029326a2c9f8b56 100644 --- a/assets/chat-CI3_nFJ5.js +++ b/assets/chat-DqN1V6Hp.js @@ -1 +1 @@ -import{a5 as i,ac as p,ay as h,az as m}from"./index-Ba3erEGJ.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-UJSMyFje.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-C8zlIZya.js b/assets/chatLifecycle-gicVSKa7.js similarity index 99% rename from assets/chatLifecycle-C8zlIZya.js rename to assets/chatLifecycle-gicVSKa7.js index 048839e29a0269f28cd0cd53c3ad536ba1fdfdf0..d2664715f1daacb7548061752c90b0072394afdc 100644 --- a/assets/chatLifecycle-C8zlIZya.js +++ b/assets/chatLifecycle-gicVSKa7.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{s as To,d 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,i as FC,aa as Id,A as AL,C as EL}from"./index-Ba3erEGJ.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-Br4UCLSi.js";/* empty css */import{H as Ip,a as Op,b as Np}from"./hover-card-C6ObQOHL.js";import{f as FL,i as VC,p as zL,C as HL,a as BL,T as qL}from"./CatalogEntityPreviewLink-CuEpk2Oj.js";import{G as i0}from"./github-BUiEiKpk.js";import{F as UC}from"./file-text-DM3Ql8Fd.js";import{r as VL,a as UL,P as r0,c as WL}from"./PaperPreviewLink-ByPUM9fv.js";import{M as GL,d as KL}from"./index-Bc8fO69p.js";import{r as ZL}from"./index-C2GWM2ou.js";import{u as ad}from"./useMutation-BEHPbJP-.js";import{c as ts,a as zo}from"./chat-CI3_nFJ5.js";import{T as XL}from"./thumbs-up-h-vAxpty.js";import{C as YL}from"./copy-Bq1_hWMk.js";import{q as o0}from"./queryOptions-C9woPjwX.js";import{A as JL}from"./arrow-left-BsmWH9rO.js";import{E as WC}from"./external-link-BfaqusWk.js";import{P as QL}from"./plus-iAFjdNIx.js";import{S as eD}from"./search-Cv_XFprT.js";import{C as GC,a as KC}from"./chevron-up-35j15Hwd.js";import{A as tD}from"./AuthorAvatar-7M5dWdHD.js";import{p as nD}from"./papers-BS2bC1xn.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{s as To,d 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,i as FC,aa as Id,A as AL,C as EL}from"./index-UJSMyFje.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-DXNWRdeo.js";/* empty css */import{H as Ip,a as Op,b as Np}from"./hover-card-DcL7U8NI.js";import{f as FL,i as VC,p as zL,C as HL,a as BL,T as qL}from"./CatalogEntityPreviewLink-YOdjuCTK.js";import{G as i0}from"./github-BbEMdbmg.js";import{F as UC}from"./file-text-3syNYWxm.js";import{r as VL,a as UL,P as r0,c as WL}from"./PaperPreviewLink-DUxQx42a.js";import{M as GL,d as KL}from"./index-DBb3IysA.js";import{r as ZL}from"./index-BFkgjGcF.js";import{u as ad}from"./useMutation-BZfxMmoZ.js";import{c as ts,a as zo}from"./chat-DqN1V6Hp.js";import{T as XL}from"./thumbs-up-BfFDCpmk.js";import{C as YL}from"./copy-D02KQGwg.js";import{q as o0}from"./queryOptions-C9woPjwX.js";import{A as JL}from"./arrow-left-0-cN70MP.js";import{E as WC}from"./external-link-C2oGmjcr.js";import{P as QL}from"./plus-DvxtHJU_.js";import{S as eD}from"./search-pO5JVRc5.js";import{C as GC,a as KC}from"./chevron-up-Cy3JEUmg.js";import{A as tD}from"./AuthorAvatar-B-tDeLM5.js";import{p as nD}from"./papers-CDbCMm0m.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/chatSessions-Br4UCLSi.js b/assets/chatSessions-DXNWRdeo.js similarity index 99% rename from assets/chatSessions-Br4UCLSi.js rename to assets/chatSessions-DXNWRdeo.js index b140894a9488d40469dce6034576740ce0802b08..491388d811df51627070e3828f14fbe86aa32763 100644 --- a/assets/chatSessions-Br4UCLSi.js +++ b/assets/chatSessions-DXNWRdeo.js @@ -1,4 +1,4 @@ -import{j as p,V as f,b as oe,A as Ce,ab as xe}from"./index-Ba3erEGJ.js";import{c as k}from"./chat-CI3_nFJ5.js";import{p as Re}from"./papers-BS2bC1xn.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-UJSMyFje.js";import{c as k}from"./chat-DqN1V6Hp.js";import{p as Re}from"./papers-CDbCMm0m.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-35j15Hwd.js b/assets/chevron-up-Cy3JEUmg.js similarity index 91% rename from assets/chevron-up-35j15Hwd.js rename to assets/chevron-up-Cy3JEUmg.js index 44ff538e8f7278d12ca5f099be8acf15b36207df..9554b8a3ecf25afa5401c78d4c55fabd6b1514e7 100644 --- a/assets/chevron-up-35j15Hwd.js +++ b/assets/chevron-up-Cy3JEUmg.js @@ -1,4 +1,4 @@ -import{s as o}from"./index-Ba3erEGJ.js";/** +import{s as o}from"./index-UJSMyFje.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/circle-check-Dg57zcLs.js b/assets/circle-check-4v9OryJ8.js similarity index 87% rename from assets/circle-check-Dg57zcLs.js rename to assets/circle-check-4v9OryJ8.js index 1b2c6ea4f2efc1c854412be65b1c47989019fa7e..7c9c9c849b8ad1fa2dd85681d3df289fb3b43ec6 100644 --- a/assets/circle-check-Dg57zcLs.js +++ b/assets/circle-check-4v9OryJ8.js @@ -1,4 +1,4 @@ -import{s as c}from"./index-Ba3erEGJ.js";/** +import{s as c}from"./index-UJSMyFje.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/codex-Bs8D2HX-.js b/assets/codex-DMtU2dT2.js similarity index 95% rename from assets/codex-Bs8D2HX-.js rename to assets/codex-DMtU2dT2.js index 8d001128de49da71e40c80a66703308c4b3362a3..4fefd2d0acbf083a65092a8cc2ff0c8b79081761 100644 --- a/assets/codex-Bs8D2HX-.js +++ b/assets/codex-DMtU2dT2.js @@ -1 +1 @@ -import{ac as i,a5 as c}from"./index-Ba3erEGJ.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-UJSMyFje.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-Bq1_hWMk.js b/assets/copy-D02KQGwg.js similarity index 89% rename from assets/copy-Bq1_hWMk.js rename to assets/copy-D02KQGwg.js index 81e6f629923f0663a41a9d8f32e2cf748dbed2b3..be4e61a6f65444c0a0a23bcdccb53dfa2f9a05ed 100644 --- a/assets/copy-Bq1_hWMk.js +++ b/assets/copy-D02KQGwg.js @@ -1,4 +1,4 @@ -import{s as e}from"./index-Ba3erEGJ.js";/** +import{s as e}from"./index-UJSMyFje.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/curation-BzdOQbkp.js b/assets/curation-B0_XT_FL.js similarity index 98% rename from assets/curation-BzdOQbkp.js rename to assets/curation-B0_XT_FL.js index ce1a0c6faabf1b4214023192fcc83fba3592c311..621423f8885135cd3578ee3a357542544d894108 100644 --- a/assets/curation-BzdOQbkp.js +++ b/assets/curation-B0_XT_FL.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,b2 as g,ac as v}from"./index-Ba3erEGJ.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,b2 as g,ac as v}from"./index-UJSMyFje.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-S18Pv0JO.js b/assets/database-BhnoZEjS.js similarity index 89% rename from assets/database-S18Pv0JO.js rename to assets/database-BhnoZEjS.js index df6a2599b0d2a086a0e83bd10992ef3f2247fb83..3bc464819ef24104de7244bd816e5aca7da47b2e 100644 --- a/assets/database-S18Pv0JO.js +++ b/assets/database-BhnoZEjS.js @@ -1,4 +1,4 @@ -import{s as e}from"./index-Ba3erEGJ.js";/** +import{s as e}from"./index-UJSMyFje.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/dialog-ChZD9naX.js b/assets/dialog-BodVIP1P.js similarity index 96% rename from assets/dialog-ChZD9naX.js rename to assets/dialog-BodVIP1P.js index bf348f735619dd6be3cba321e2e38ecb9897debb..aed00e8edcb95ffd74a3f51896f981876a81ed2e 100644 --- a/assets/dialog-ChZD9naX.js +++ b/assets/dialog-BodVIP1P.js @@ -1 +1 @@ -import{ag as f,d 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-Ba3erEGJ.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,d 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-UJSMyFje.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-C_YXfZMC.js b/assets/evaluationQueryInvalidation-k4vq42xx.js similarity index 97% rename from assets/evaluationQueryInvalidation-C_YXfZMC.js rename to assets/evaluationQueryInvalidation-k4vq42xx.js index cebdd38c2f294e73bc00c6c0b9e1ae86299b8749..88db55291269cface8ad4f3f79cc65a94bf08e46 100644 --- a/assets/evaluationQueryInvalidation-C_YXfZMC.js +++ b/assets/evaluationQueryInvalidation-k4vq42xx.js @@ -1 +1 @@ -var F=a=>{throw TypeError(a)};var B=(a,e,t)=>e.has(a)||F("Cannot "+t);var u=(a,e,t)=>(B(a,e,"read from private field"),t?t.call(a):e.get(a)),v=(a,e,t)=>e.has(a)?F("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(a):e.set(a,t),l=(a,e,t,s)=>(B(a,e,"write to private field"),s?s.call(a,t):e.set(a,t),t),g=(a,e,t)=>(B(a,e,"access private method"),t);import{aF as X,aG as H,aH as Y,aI as Z,aJ as J,i as W,aK as ee,aL as se,d as x,aM as te,aN as re,aO as ae,aP as ie,aQ as U,aR as ne,aS as oe,t as A,o as I}from"./index-Ba3erEGJ.js";import{i as ue,a as ce}from"./queryInvalidation-Bw6KJ8Q2.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,R,C,K,M,P,d,L,D,N,$,T,z,G,he=(G=class extends X{constructor(e,t,s){super();v(this,d);v(this,_);v(this,f);v(this,w);v(this,E);v(this,y);v(this,R);v(this,C);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,T).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,$).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 k=u(this,f)[b];return!k||!Y(i,k)});!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,T).call(this,i,b)})})),g(this,d,z).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,$).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,R=new WeakMap,C=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,R)||u(this,f)!==u(this,K)||r||t!==u(this,C))&&(l(this,C,t),l(this,K,u(this,f)),s!==void 0&&l(this,M,s),l(this,R,Z(u(this,R),t(e)))),u(this,R)}return e},N=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})},$=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 J(u(this,_),r);s.push({defaultedQueryOptions:r,observer:h})}),s},T=function(e,t){const s=u(this,y).indexOf(e);s!==-1&&(l(this,f,de(u(this,f),s,t)),g(this,d,z).call(this))},z=function(){var e;if(this.hasListeners()){const t=g(this,d,L).call(this,u(this,f),u(this,P)),s=g(this,d,N).call(this),n=u(this,R),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=x.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]=x.useState(()=>new he(s,o,e)),[m,S,c]=h.getOptimisticResult(o,e.combine),i=!n&&e.subscribed!==!1;x.useSyncExternalStore(x.useCallback(p=>i?h.subscribe(H.batchCalls(p)):ie,[h,i]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),x.useEffect(()=>{h.setQueries(o,e)},[o,e,h]);const k=m.some((p,Q)=>U(o[Q],p))?m.flatMap((p,Q)=>{const O=o[Q];if(O&&U(O,p)){const V=new J(s,O);return ne(O,V,r)}return[]}):[];if(k.length>0)throw Promise.all(k);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:I.datasetTasks,predicate:S}),a.invalidateQueries({queryKey:I.datasets,predicate:c=>{const i=c.state.data;return S(c)||!!(i&&t.has(String(i.id)))}}),a.invalidateQueries({queryKey:I.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(k=>t.has(String(k.id))))))}}),a.invalidateQueries({queryKey:I.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 F=a=>{throw TypeError(a)};var B=(a,e,t)=>e.has(a)||F("Cannot "+t);var u=(a,e,t)=>(B(a,e,"read from private field"),t?t.call(a):e.get(a)),v=(a,e,t)=>e.has(a)?F("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(a):e.set(a,t),l=(a,e,t,s)=>(B(a,e,"write to private field"),s?s.call(a,t):e.set(a,t),t),g=(a,e,t)=>(B(a,e,"access private method"),t);import{aF as X,aG as H,aH as Y,aI as Z,aJ as J,i as W,aK as ee,aL as se,d as x,aM as te,aN as re,aO as ae,aP as ie,aQ as U,aR as ne,aS as oe,t as A,o as I}from"./index-UJSMyFje.js";import{i as ue,a as ce}from"./queryInvalidation-BfAZ_-1R.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,R,C,K,M,P,d,L,D,N,$,T,z,G,he=(G=class extends X{constructor(e,t,s){super();v(this,d);v(this,_);v(this,f);v(this,w);v(this,E);v(this,y);v(this,R);v(this,C);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,T).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,$).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 k=u(this,f)[b];return!k||!Y(i,k)});!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,T).call(this,i,b)})})),g(this,d,z).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,$).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,R=new WeakMap,C=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,R)||u(this,f)!==u(this,K)||r||t!==u(this,C))&&(l(this,C,t),l(this,K,u(this,f)),s!==void 0&&l(this,M,s),l(this,R,Z(u(this,R),t(e)))),u(this,R)}return e},N=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})},$=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 J(u(this,_),r);s.push({defaultedQueryOptions:r,observer:h})}),s},T=function(e,t){const s=u(this,y).indexOf(e);s!==-1&&(l(this,f,de(u(this,f),s,t)),g(this,d,z).call(this))},z=function(){var e;if(this.hasListeners()){const t=g(this,d,L).call(this,u(this,f),u(this,P)),s=g(this,d,N).call(this),n=u(this,R),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=x.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]=x.useState(()=>new he(s,o,e)),[m,S,c]=h.getOptimisticResult(o,e.combine),i=!n&&e.subscribed!==!1;x.useSyncExternalStore(x.useCallback(p=>i?h.subscribe(H.batchCalls(p)):ie,[h,i]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),x.useEffect(()=>{h.setQueries(o,e)},[o,e,h]);const k=m.some((p,Q)=>U(o[Q],p))?m.flatMap((p,Q)=>{const O=o[Q];if(O&&U(O,p)){const V=new J(s,O);return ne(O,V,r)}return[]}):[];if(k.length>0)throw Promise.all(k);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:I.datasetTasks,predicate:S}),a.invalidateQueries({queryKey:I.datasets,predicate:c=>{const i=c.state.data;return S(c)||!!(i&&t.has(String(i.id)))}}),a.invalidateQueries({queryKey:I.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(k=>t.has(String(k.id))))))}}),a.invalidateQueries({queryKey:I.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-BfaqusWk.js b/assets/external-link-C2oGmjcr.js similarity index 89% rename from assets/external-link-BfaqusWk.js rename to assets/external-link-C2oGmjcr.js index 17e4fab105c66c8c161c25d01523113fee063604..cff494e79e82eddcb8bda031ae27e3070021a01c 100644 --- a/assets/external-link-BfaqusWk.js +++ b/assets/external-link-C2oGmjcr.js @@ -1,4 +1,4 @@ -import{s as a}from"./index-Ba3erEGJ.js";/** +import{s as a}from"./index-UJSMyFje.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/file-text-DM3Ql8Fd.js b/assets/file-text-3syNYWxm.js similarity index 91% rename from assets/file-text-DM3Ql8Fd.js rename to assets/file-text-3syNYWxm.js index 8fe0b6bf14f69fa18a6810172b4b6f0260823170..598e074b59b476156d945c90c244ef91aee685b9 100644 --- a/assets/file-text-DM3Ql8Fd.js +++ b/assets/file-text-3syNYWxm.js @@ -1,4 +1,4 @@ -import{s as e}from"./index-Ba3erEGJ.js";/** +import{s as e}from"./index-UJSMyFje.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/github-BUiEiKpk.js b/assets/github-BbEMdbmg.js similarity index 92% rename from assets/github-BUiEiKpk.js rename to assets/github-BbEMdbmg.js index 28db19415ffa21c5187bf6dd0582f88ad38e6a41..6e984685e71f9abeb7f6c2ed75b6b21564417023 100644 --- a/assets/github-BUiEiKpk.js +++ b/assets/github-BbEMdbmg.js @@ -1,4 +1,4 @@ -import{s as c}from"./index-Ba3erEGJ.js";/** +import{s as c}from"./index-UJSMyFje.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/globe-D1DCSPNI.js b/assets/globe-dxeznk4G.js similarity index 89% rename from assets/globe-D1DCSPNI.js rename to assets/globe-dxeznk4G.js index 9cd03acec7ce32ec425276ac32f5c8873d7c70b2..44fe9a640accd29cbc75d4957f87bd403c15bfb0 100644 --- a/assets/globe-D1DCSPNI.js +++ b/assets/globe-dxeznk4G.js @@ -1,4 +1,4 @@ -import{s as e}from"./index-Ba3erEGJ.js";/** +import{s as e}from"./index-UJSMyFje.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/hover-card-C6ObQOHL.js b/assets/hover-card-DcL7U8NI.js similarity index 98% rename from assets/hover-card-C6ObQOHL.js rename to assets/hover-card-DcL7U8NI.js index ea7bf463d2bd471573c4863a43dea3d5ca37a96c..3bf626deaa4fb28a6360c51f60d15f9533c4cd52 100644 --- a/assets/hover-card-C6ObQOHL.js +++ b/assets/hover-card-DcL7U8NI.js @@ -1 +1 @@ -import{d 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-Ba3erEGJ.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{d 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-UJSMyFje.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-C2GWM2ou.js b/assets/index-BFkgjGcF.js similarity index 99% rename from assets/index-C2GWM2ou.js rename to assets/index-BFkgjGcF.js index 324fd2dd3b3b3ecbc9b80b2cc4f80a55945012c5..b59b3aed229676b566eb57ffaeb1afdb634cec2d 100644 --- a/assets/index-C2GWM2ou.js +++ b/assets/index-BFkgjGcF.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-Bc8fO69p.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-DBb3IysA.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(;++i4&&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-UJSMyFje.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;++F(e.current.value!==r&&(e.current.previous=e.current.value,e.current.value=r),e.current.previous),[r])}export{o as u}; +import{d as u}from"./index-UJSMyFje.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-Ba3erEGJ.js b/assets/index-UJSMyFje.js similarity index 73% rename from assets/index-Ba3erEGJ.js rename to assets/index-UJSMyFje.js index 342aaf5171a3bf3526871011852866cc2757bcca..ccaddcff80d4eabcb7fe273b29f2b657889468f4 100644 --- a/assets/index-Ba3erEGJ.js +++ b/assets/index-UJSMyFje.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AuthorizePaperEditView-Cq1DcUql.js","assets/useMutation-BEHPbJP-.js","assets/button-Dvq5drsi.js","assets/paperEdits-XD13WwNK.js","assets/FollowingView-DiD1Nhph.js","assets/FeedView-BOUw6uS8.js","assets/sparkles-B_KArhDU.js","assets/dialog-ChZD9naX.js","assets/catalog-DrZhs4eC.js","assets/researchTopic-CMY-StWV.js","assets/transform-CLQo0OXf.js","assets/plus-iAFjdNIx.js","assets/arrow-right-TYlHRUWw.js","assets/PaperFeed-BJ9VCI43.js","assets/PaperCard-cfN4cMqP.js","assets/AuthorAvatar-7M5dWdHD.js","assets/AuthorAvatar-o5W6pl_W.css","assets/SotaBadges-jHwP4qBt.js","assets/colors-BkWRhvFI.js","assets/Icon-B7TPsKGh.js","assets/LatexTitle-ZavI0vgc.js","assets/papers-BS2bC1xn.js","assets/curation-BzdOQbkp.js","assets/safeExternalHref-CkBrsh84.js","assets/popover-DmIp_t7d.js","assets/skeleton-HWnr28Ly.js","assets/useIntersectionObserver-CEcObYrC.js","assets/McpShowcase-DwcLwAEJ.js","assets/AgentLogos-BjOw21yN.js","assets/chatSessions-Br4UCLSi.js","assets/chat-CI3_nFJ5.js","assets/usePapers-MJ0ibwsa.js","assets/useInfiniteQuery-BSM2sFVO.js","assets/alert-DftukI1b.js","assets/ChatView-BQ45-L03.js","assets/chatLifecycle-C8zlIZya.js","assets/hover-card-C6ObQOHL.js","assets/CatalogEntityPreviewLink-CuEpk2Oj.js","assets/github-BUiEiKpk.js","assets/file-text-DM3Ql8Fd.js","assets/PaperPreviewLink-ByPUM9fv.js","assets/index-Bc8fO69p.js","assets/index-C2GWM2ou.js","assets/katex-DkKDou_j.js","assets/thumbs-up-h-vAxpty.js","assets/copy-Bq1_hWMk.js","assets/queryOptions-C9woPjwX.js","assets/arrow-left-BsmWH9rO.js","assets/external-link-BfaqusWk.js","assets/search-Cv_XFprT.js","assets/chevron-up-35j15Hwd.js","assets/chatLifecycle-Lr_OJaUk.css","assets/katex-wklAmtGL.css","assets/share-2-D02XQP6n.js","assets/openrouter-BIhbXzcI.js","assets/SharedChatView-BYQRXyDz.js","assets/PapersListView-BxsyYKkb.js","assets/useDebounce-C9OedSoB.js","assets/apiErrors-CPeTQuQC.js","assets/frameworks-DDA0P4Tf.js","assets/PaperDetailView-BRTPUDdV.js","assets/ExternalSourceEvalBadge-BJcbRwqY.js","assets/ExternalSourceEvalBadge-CWUQ52cV.css","assets/paperReader-td2aJigh.js","assets/useDocumentTitle-CJWZHe8w.js","assets/preferences-VZbz27zI.js","assets/account-CKlWxNaZ.js","assets/evaluationQueryInvalidation-C_YXfZMC.js","assets/queryInvalidation-Bw6KJ8Q2.js","assets/input-wEykysM6.js","assets/searchable-select-CjSbtAzP.js","assets/loader-circle-ChybJ0KP.js","assets/SignInToEditDialog-XDg1xPWL.js","assets/textarea-bNIL0Bcb.js","assets/submissions-D9Ty3arc.js","assets/database-S18Pv0JO.js","assets/badge-Cjyk4r9x.js","assets/globe-D1DCSPNI.js","assets/index-Cf9alo2v.js","assets/codex-Bs8D2HX-.js","assets/savedPapersAuth-BSn_7mhQ.js","assets/organizationNames-BVKzYEBp.js","assets/PaperDetailView-CnKK6W4F.css","assets/PaperReaderView-C5kcjwh1.js","assets/MarkdownText-FuN1EKHi.js","assets/TagsIndexView-G-b0gdzh.js","assets/slug-BpH-Nkvz.js","assets/triangle-alert-D4uF0BJ0.js","assets/trending-up-DXFkPm8S.js","assets/moon-BoU_q9no.js","assets/trophy-DJUcjk8C.js","assets/activity-BAgDG_PZ.js","assets/AreaSection-C1JWPNIG.js","assets/TaxonomySuggestionTile-CiMXTa8j.js","assets/useHashScrollOnReady-LOdkzT1I.js","assets/areas-Dvi8w2dp.js","assets/TagBrowseView-C77s9kzE.js","assets/ResearchFollowButton-DXt6Qpt5.js","assets/BenchmarkTrendSparkline-DUyuuDoa.js","assets/NotFound-B3EehO4t.js","assets/MethodsIndexView-Bdiwox76.js","assets/FrameworksIndexView-DvK-KAg3.js","assets/TrendsView-CKKi1VRU.js","assets/ConferencesIndexView-CbRa2EOU.js","assets/deadlines-BH32v7D1.js","assets/AiDeadlinesView-dLGfFkt7.js","assets/switch-tyjzliQR.js","assets/ConferenceDetailView-BSPNE-5n.js","assets/conferenceListings-BnmhBx-_.js","assets/ConferenceTaskView-CDKsZawH.js","assets/OrganizationsIndexView-DSR3qkLX.js","assets/OrganizationsIndexView-CJnrfIkP.css","assets/OrganizationDetailView-DyFV9-gr.js","assets/OrganizationContributionGraph-iCMW2Vfi.js","assets/AuthorDetailView-D6_HYb4K.js","assets/MethodDetailView-Ctz2zwcp.js","assets/BenchmarkDetailView-DzybbikG.js","assets/BenchmarkDetailView-CXxK75GR.css","assets/SavedPapersView-CxMmtsxn.js","assets/SettingsView-ZclHRLlr.js","assets/PrivacyView-B6HbRy37.js","assets/ApiDocsView-_-YW6hmY.js","assets/ApiDocsView-DPuMdYvY.css","assets/McpView-flM-siZf.js","assets/McpView-EGeqkP46.css","assets/SubmitView-CzGulDZf.js","assets/CronDashboard-ChRfGclc.js","assets/CronDashboard-DHBDO3qC.js","assets/CronDashboard-DwChfW9h.css","assets/refresh-cw-B-hwdprb.js","assets/circle-check-Dg57zcLs.js","assets/AutonomousOperations-C9LX_q_o.js","assets/SubmissionsDashboard-BgxP46NN.js","assets/SubmissionsDashboard-BTmvDoLW.css","assets/UserProfileView-CUBmzN74.js","assets/RateLimitsView-RwXx3jbv.js","assets/AstraForRoboticsView-C6GRjjgP.js","assets/AstraForRoboticsView-C_lTF_XB.css","assets/SearchOverlay-BCyx8pUn.js","assets/StagingAccessRequestView-BDq5Q7CO.js"])))=>i.map(i=>d[i]); -var Uk=Object.defineProperty;var ym=e=>{throw TypeError(e)};var Vk=(e,t,n)=>t in e?Uk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var kr=(e,t,n)=>Vk(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 Bk(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 nz=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function aw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var lw={exports:{}},Gc={},uw={exports:{}},le={};/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AuthorizePaperEditView-C_CCc6DX.js","assets/useMutation-BZfxMmoZ.js","assets/button-CIbfeiDg.js","assets/paperEdits-YrKMd5r3.js","assets/FollowingView-yJNNUjAJ.js","assets/FeedView-7yx8iXq9.js","assets/sparkles-C-mZg8SQ.js","assets/dialog-BodVIP1P.js","assets/catalog-Dsah5Rrt.js","assets/researchTopic-DWD5gtip.js","assets/transform-C3_Sl_p2.js","assets/plus-DvxtHJU_.js","assets/arrow-right-DdcCN24Z.js","assets/PaperFeed-DCI8gGsr.js","assets/PaperCard-DaYJC8Bk.js","assets/AuthorAvatar-B-tDeLM5.js","assets/AuthorAvatar-o5W6pl_W.css","assets/SotaBadges-Bu3EIx-o.js","assets/colors-BkWRhvFI.js","assets/Icon-BoCHdPFA.js","assets/LatexTitle-rKci1b5e.js","assets/papers-CDbCMm0m.js","assets/curation-B0_XT_FL.js","assets/safeExternalHref-CkBrsh84.js","assets/popover-BTFxRv7H.js","assets/skeleton-CFPwaPrc.js","assets/useIntersectionObserver-Akbgy6EK.js","assets/McpShowcase-C8eMjqSr.js","assets/AgentLogos-DCE1drFe.js","assets/chatSessions-DXNWRdeo.js","assets/chat-DqN1V6Hp.js","assets/usePapers-CWb1CFyQ.js","assets/useInfiniteQuery-SD8FlI5O.js","assets/alert-B1JnXYJB.js","assets/ChatView-DeFesjnR.js","assets/chatLifecycle-gicVSKa7.js","assets/hover-card-DcL7U8NI.js","assets/CatalogEntityPreviewLink-YOdjuCTK.js","assets/github-BbEMdbmg.js","assets/file-text-3syNYWxm.js","assets/PaperPreviewLink-DUxQx42a.js","assets/index-DBb3IysA.js","assets/index-BFkgjGcF.js","assets/katex-DkKDou_j.js","assets/thumbs-up-BfFDCpmk.js","assets/copy-D02KQGwg.js","assets/queryOptions-C9woPjwX.js","assets/arrow-left-0-cN70MP.js","assets/external-link-C2oGmjcr.js","assets/search-pO5JVRc5.js","assets/chevron-up-Cy3JEUmg.js","assets/chatLifecycle-Lr_OJaUk.css","assets/katex-wklAmtGL.css","assets/share-2-IWsEjGnT.js","assets/openrouter-Dr8-_BKq.js","assets/SharedChatView-CdO9rnWF.js","assets/PapersListView-gsVdSCeE.js","assets/useDebounce-smdv6bWN.js","assets/apiErrors-DXz1vC-X.js","assets/frameworks-DDA0P4Tf.js","assets/PaperDetailView-DUyDgl84.js","assets/ExternalSourceEvalBadge-CV4FV0f1.js","assets/ExternalSourceEvalBadge-CWUQ52cV.css","assets/paperReader-td2aJigh.js","assets/useDocumentTitle-BSodmmbQ.js","assets/preferences-C-HGVwrj.js","assets/account-Ds_mpAFf.js","assets/evaluationQueryInvalidation-k4vq42xx.js","assets/queryInvalidation-BfAZ_-1R.js","assets/input-C9lvFHZR.js","assets/searchable-select-BatELYUf.js","assets/loader-circle-l5JFsbEa.js","assets/SignInToEditDialog-WalvYyhX.js","assets/textarea-BC68vWsz.js","assets/submissions-DozYdY52.js","assets/database-BhnoZEjS.js","assets/badge-Blda41S-.js","assets/globe-dxeznk4G.js","assets/index-Mqdf1wPX.js","assets/codex-DMtU2dT2.js","assets/savedPapersAuth-lFuT83ZT.js","assets/organizationNames-BVKzYEBp.js","assets/PaperDetailView-CnKK6W4F.css","assets/PaperReaderView-D5fESpSH.js","assets/MarkdownText-Bn8aftJG.js","assets/TagsIndexView-gSGXUknL.js","assets/slug-BpH-Nkvz.js","assets/triangle-alert-CHI1ovss.js","assets/trending-up-Yn_2_YaT.js","assets/moon-CKb8EyrU.js","assets/trophy-Dwhwm0GW.js","assets/activity-CrJg4hka.js","assets/AreaSection-GuFqPtDa.js","assets/TaxonomySuggestionTile-D09uiSgJ.js","assets/useHashScrollOnReady-D9YVP7Oq.js","assets/areas-Dvi8w2dp.js","assets/TagBrowseView-MtjLHjMN.js","assets/ResearchFollowButton-Cn7bhIam.js","assets/BenchmarkTrendSparkline-Bj_0iVvJ.js","assets/NotFound-CyT6FuD7.js","assets/MethodsIndexView-NoqF6aLY.js","assets/FrameworksIndexView-CHkfi7SP.js","assets/TrendsView-dP2jMXv2.js","assets/ConferencesIndexView-DFmaDKPw.js","assets/deadlines-BH32v7D1.js","assets/AiDeadlinesView-D6fo2hqw.js","assets/switch-DnXKOkEG.js","assets/ConferenceDetailView-Dnv7xpYD.js","assets/conferenceListings-BnmhBx-_.js","assets/ConferenceTaskView-BVRrZXYl.js","assets/OrganizationsIndexView-BUbZFRrK.js","assets/OrganizationsIndexView-CJnrfIkP.css","assets/OrganizationDetailView-CwgJ3Sb7.js","assets/OrganizationContributionGraph-DrwHtk4l.js","assets/AuthorDetailView-hYbe3RKy.js","assets/MethodDetailView-B07KZqSy.js","assets/BenchmarkDetailView-Dlbzw_1F.js","assets/BenchmarkDetailView-CXxK75GR.css","assets/SavedPapersView-BoPnT5xM.js","assets/SettingsView-mdf-Sc1f.js","assets/PrivacyView-DdC1aoXp.js","assets/ApiDocsView-CGJojwAl.js","assets/ApiDocsView-DPuMdYvY.css","assets/McpView-CZBZY_uR.js","assets/McpView-EGeqkP46.css","assets/SubmitView-CJCUKMi9.js","assets/CronDashboard-UU9elSMh.js","assets/CronDashboard-DR0j7-EG.js","assets/CronDashboard-DwChfW9h.css","assets/refresh-cw-BnBjJTkI.js","assets/circle-check-4v9OryJ8.js","assets/AutonomousOperations-CKUsh2Ag.js","assets/SubmissionsDashboard-BVm2OhKB.js","assets/SubmissionsDashboard-BTmvDoLW.css","assets/UserProfileView-BsS0SIpI.js","assets/RateLimitsView-Cgv1UDtJ.js","assets/AstraForRoboticsView-BaVrHGWL.js","assets/AstraForRoboticsView-C_lTF_XB.css","assets/SearchOverlay-CGGXwJf4.js","assets/StagingAccessRequestView-CsCd75Hi.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 nz=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 * @@ -7,7 +7,7 @@ var Uk=Object.defineProperty;var ym=e=>{throw TypeError(e)};var Vk=(e,t,n)=>t in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var gl=Symbol.for("react.element"),qk=Symbol.for("react.portal"),Wk=Symbol.for("react.fragment"),Hk=Symbol.for("react.strict_mode"),Gk=Symbol.for("react.profiler"),Kk=Symbol.for("react.provider"),Qk=Symbol.for("react.context"),Yk=Symbol.for("react.forward_ref"),Xk=Symbol.for("react.suspense"),Jk=Symbol.for("react.memo"),Zk=Symbol.for("react.lazy"),_m=Symbol.iterator;function eP(e){return e===null||typeof e!="object"?null:(e=_m&&e[_m]||e["@@iterator"],typeof e=="function"?e:null)}var cw={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},dw=Object.assign,fw={};function Oo(e,t,n){this.props=e,this.context=t,this.refs=fw,this.updater=n||cw}Oo.prototype.isReactComponent={};Oo.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Oo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function hw(){}hw.prototype=Oo.prototype;function gv(e,t,n){this.props=e,this.context=t,this.refs=fw,this.updater=n||cw}var mv=gv.prototype=new hw;mv.constructor=gv;dw(mv,Oo.prototype);mv.isPureReactComponent=!0;var wm=Array.isArray,pw=Object.prototype.hasOwnProperty,yv={current:null},vw={key:!0,ref:!0,__self:!0,__source:!0};function gw(e,t,n){var r,i={},s=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)pw.call(t,r)&&!vw.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1{throw TypeError(e)};var Vk=(e,t,n)=>t in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var sP=g,oP=Symbol.for("react.element"),aP=Symbol.for("react.fragment"),lP=Object.prototype.hasOwnProperty,uP=sP.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,cP={key:!0,ref:!0,__self:!0,__source:!0};function yw(e,t,n){var r,i={},s=null,o=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)lP.call(t,r)&&!cP.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:oP,type:e,key:s,ref:o,props:i,_owner:uP.current}}Gc.Fragment=aP;Gc.jsx=yw;Gc.jsxs=yw;lw.exports=Gc;var w=lw.exports,_w={exports:{}},Zt={},ww={exports:{}},xw={};/** + */var iP=g,sP=Symbol.for("react.element"),oP=Symbol.for("react.fragment"),aP=Object.prototype.hasOwnProperty,lP=iP.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,uP={key:!0,ref:!0,__self:!0,__source:!0};function mw(e,t,n){var r,i={},s=null,o=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)aP.call(t,r)&&!uP.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:sP,type:e,key:s,ref:o,props:i,_owner:lP.current}}Gc.Fragment=oP;Gc.jsx=mw;Gc.jsxs=mw;aw.exports=Gc;var w=aw.exports,yw={exports:{}},Zt={},_w={exports:{}},ww={};/** * @license React * scheduler.production.min.js * @@ -23,7 +23,7 @@ var Uk=Object.defineProperty;var ym=e=>{throw TypeError(e)};var Vk=(e,t,n)=>t in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(e){function t(O,A){var V=O.length;O.push(A);e:for(;0>>1,te=O[K];if(0>>1;Ki(be,V))Pei(Be,be)?(O[K]=Be,O[Pe]=V,K=Pe):(O[K]=be,O[de]=V,K=de);else if(Pei(Be,V))O[K]=Be,O[Pe]=V,K=Pe;else break e}}return A}function i(O,A){var V=O.sortIndex-A.sortIndex;return V!==0?V:O.id-A.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],u=[],c=1,d=null,f=3,m=!1,_=!1,p=!1,y=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(O){for(var A=n(u);A!==null;){if(A.callback===null)r(u);else if(A.startTime<=O)r(u),A.sortIndex=A.expirationTime,t(l,A);else break;A=n(u)}}function b(O){if(p=!1,x(O),!_)if(n(l)!==null)_=!0,B(E);else{var A=n(u);A!==null&&Q(b,A.startTime-O)}}function E(O,A){_=!1,p&&(p=!1,h(C),C=-1),m=!0;var V=f;try{for(x(A),d=n(l);d!==null&&(!(d.expirationTime>A)||O&&!N());){var K=d.callback;if(typeof K=="function"){d.callback=null,f=d.priorityLevel;var te=K(d.expirationTime<=A);A=e.unstable_now(),typeof te=="function"?d.callback=te:d===n(l)&&r(l),x(A)}else r(l);d=n(l)}if(d!==null)var oe=!0;else{var de=n(u);de!==null&&Q(b,de.startTime-A),oe=!1}return oe}finally{d=null,f=V,m=!1}}var S=!1,P=null,C=-1,T=5,R=-1;function N(){return!(e.unstable_now()-RO||125K?(O.sortIndex=V,t(u,O),n(l)===null&&O===n(u)&&(p?(h(C),C=-1):p=!0,Q(b,V-K))):(O.sortIndex=te,t(l,O),_||m||(_=!0,B(E))),O},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(O){var A=f;return function(){var V=f;f=A;try{return O.apply(this,arguments)}finally{f=V}}}})(xw);ww.exports=xw;var dP=ww.exports;/** + */(function(e){function t(O,A){var V=O.length;O.push(A);e:for(;0>>1,te=O[K];if(0>>1;Ki(be,V))Pei(Be,be)?(O[K]=Be,O[Pe]=V,K=Pe):(O[K]=be,O[de]=V,K=de);else if(Pei(Be,V))O[K]=Be,O[Pe]=V,K=Pe;else break e}}return A}function i(O,A){var V=O.sortIndex-A.sortIndex;return V!==0?V:O.id-A.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],u=[],c=1,d=null,f=3,m=!1,_=!1,p=!1,y=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(O){for(var A=n(u);A!==null;){if(A.callback===null)r(u);else if(A.startTime<=O)r(u),A.sortIndex=A.expirationTime,t(l,A);else break;A=n(u)}}function b(O){if(p=!1,x(O),!_)if(n(l)!==null)_=!0,B(E);else{var A=n(u);A!==null&&Q(b,A.startTime-O)}}function E(O,A){_=!1,p&&(p=!1,h(C),C=-1),m=!0;var V=f;try{for(x(A),d=n(l);d!==null&&(!(d.expirationTime>A)||O&&!N());){var K=d.callback;if(typeof K=="function"){d.callback=null,f=d.priorityLevel;var te=K(d.expirationTime<=A);A=e.unstable_now(),typeof te=="function"?d.callback=te:d===n(l)&&r(l),x(A)}else r(l);d=n(l)}if(d!==null)var oe=!0;else{var de=n(u);de!==null&&Q(b,de.startTime-A),oe=!1}return oe}finally{d=null,f=V,m=!1}}var S=!1,P=null,C=-1,T=5,R=-1;function N(){return!(e.unstable_now()-RO||125K?(O.sortIndex=V,t(u,O),n(l)===null&&O===n(u)&&(p?(h(C),C=-1):p=!0,Q(b,V-K))):(O.sortIndex=te,t(l,O),_||m||(_=!0,B(E))),O},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(O){var A=f;return function(){var V=f;f=A;try{return O.apply(this,arguments)}finally{f=V}}}})(ww);_w.exports=ww;var cP=_w.exports;/** * @license React * react-dom.production.min.js * @@ -31,16 +31,16 @@ var Uk=Object.defineProperty;var ym=e=>{throw TypeError(e)};var Vk=(e,t,n)=>t in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var fP=g,Jt=dP;function U(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),oh=Object.prototype.hasOwnProperty,hP=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,bm={},Em={};function pP(e){return oh.call(Em,e)?!0:oh.call(bm,e)?!1:hP.test(e)?Em[e]=!0:(bm[e]=!0,!1)}function vP(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function gP(e,t,n,r){if(t===null||typeof t>"u"||vP(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Pt(e,t,n,r,i,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var ut={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ut[e]=new Pt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ut[t]=new Pt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ut[e]=new Pt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ut[e]=new Pt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ut[e]=new Pt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ut[e]=new Pt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ut[e]=new Pt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ut[e]=new Pt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ut[e]=new Pt(e,5,!1,e.toLowerCase(),null,!1,!1)});var wv=/[\-:]([a-z])/g;function xv(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(wv,xv);ut[t]=new Pt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(wv,xv);ut[t]=new Pt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(wv,xv);ut[t]=new Pt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ut[e]=new Pt(e,1,!1,e.toLowerCase(),null,!1,!1)});ut.xlinkHref=new Pt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ut[e]=new Pt(e,1,!1,e.toLowerCase(),null,!0,!0)});function bv(e,t,n,r){var i=ut.hasOwnProperty(t)?ut[t]:null;(i!==null?i.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),oh=Object.prototype.hasOwnProperty,fP=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,bm={},Em={};function hP(e){return oh.call(Em,e)?!0:oh.call(bm,e)?!1:fP.test(e)?Em[e]=!0:(bm[e]=!0,!1)}function pP(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function vP(e,t,n,r){if(t===null||typeof t>"u"||pP(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Pt(e,t,n,r,i,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var ut={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ut[e]=new Pt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ut[t]=new Pt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ut[e]=new Pt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ut[e]=new Pt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ut[e]=new Pt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ut[e]=new Pt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ut[e]=new Pt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ut[e]=new Pt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ut[e]=new Pt(e,5,!1,e.toLowerCase(),null,!1,!1)});var wv=/[\-:]([a-z])/g;function xv(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(wv,xv);ut[t]=new Pt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(wv,xv);ut[t]=new Pt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(wv,xv);ut[t]=new Pt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ut[e]=new Pt(e,1,!1,e.toLowerCase(),null,!1,!1)});ut.xlinkHref=new Pt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ut[e]=new Pt(e,1,!1,e.toLowerCase(),null,!0,!0)});function bv(e,t,n,r){var i=ut.hasOwnProperty(t)?ut[t]:null;(i!==null?i.type!==0:r||!(2a||i[o]!==s[a]){var l=` -`+i[o].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{Ld=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?sa(e):""}function mP(e){switch(e.tag){case 5:return sa(e.type);case 16:return sa("Lazy");case 13:return sa("Suspense");case 19:return sa("SuspenseList");case 0:case 2:case 15:return e=jd(e.type,!1),e;case 11:return e=jd(e.type.render,!1),e;case 1:return e=jd(e.type,!0),e;default:return""}}function ch(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ss:return"Fragment";case Es:return"Portal";case ah:return"Profiler";case Ev:return"StrictMode";case lh:return"Suspense";case uh:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Sw:return(e.displayName||"Context")+".Consumer";case Ew:return(e._context.displayName||"Context")+".Provider";case Sv:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Cv:return t=e.displayName||null,t!==null?t:ch(e.type)||"Memo";case $r:t=e._payload,e=e._init;try{return ch(e(t))}catch{}}return null}function yP(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ch(t);case 8:return t===Ev?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function oi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function kw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function _P(e){var t=kw(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ml(e){e._valueTracker||(e._valueTracker=_P(e))}function Pw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=kw(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Du(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function dh(e,t){var n=t.checked;return Ve({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Cm(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=oi(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Rw(e,t){t=t.checked,t!=null&&bv(e,"checked",t,!1)}function fh(e,t){Rw(e,t);var n=oi(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?hh(e,t.type,n):t.hasOwnProperty("defaultValue")&&hh(e,t.type,oi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function km(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function hh(e,t,n){(t!=="number"||Du(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var oa=Array.isArray;function js(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Al.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ma(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var va={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},wP=["Webkit","ms","Moz","O"];Object.keys(va).forEach(function(e){wP.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),va[t]=va[e]})});function Mw(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||va.hasOwnProperty(e)&&va[e]?(""+t).trim():t+"px"}function Aw(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Mw(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var xP=Ve({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function gh(e,t){if(t){if(xP[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(U(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(U(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(U(61))}if(t.style!=null&&typeof t.style!="object")throw Error(U(62))}}function mh(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var yh=null;function kv(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var _h=null,Ds=null,zs=null;function Tm(e){if(e=_l(e)){if(typeof _h!="function")throw Error(U(280));var t=e.stateNode;t&&(t=Zc(t),_h(e.stateNode,e.type,t))}}function Nw(e){Ds?zs?zs.push(e):zs=[e]:Ds=e}function $w(){if(Ds){var e=Ds,t=zs;if(zs=Ds=null,Tm(e),t)for(e=0;e>>=0,e===0?32:31-(MP(e)/AP|0)|0}var Nl=64,$l=4194304;function aa(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Bu(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=aa(a):(s&=o,s!==0&&(r=aa(s)))}else o=n&~i,o!==0?r=aa(o):s!==0&&(r=aa(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function ml(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Sn(t),e[t]=n}function LP(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=ma),jm=" ",Dm=!1;function tx(e,t){switch(e){case"keyup":return dR.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nx(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Cs=!1;function hR(e,t){switch(e){case"compositionend":return nx(t);case"keypress":return t.which!==32?null:(Dm=!0,jm);case"textInput":return e=t.data,e===jm&&Dm?null:e;default:return null}}function pR(e,t){if(Cs)return e==="compositionend"||!Nv&&tx(e,t)?(e=Zw(),yu=Ov=Gr=null,Cs=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Bm(n)}}function ox(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ox(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ax(){for(var e=window,t=Du();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Du(e.document)}return t}function $v(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function ER(e){var t=ax(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ox(n.ownerDocument.documentElement,n)){if(r!==null&&$v(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=qm(n,s);var o=qm(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,ks=null,Ch=null,_a=null,kh=!1;function Wm(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;kh||ks==null||ks!==Du(r)||(r=ks,"selectionStart"in r&&$v(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),_a&&ja(_a,r)||(_a=r,r=Hu(Ch,"onSelect"),0Ts||(e.current=Mh[Ts],Mh[Ts]=null,Ts--)}function Te(e,t){Ts++,Mh[Ts]=e.current,e.current=t}var ai={},yt=hi(ai),jt=hi(!1),Ki=ai;function po(e,t){var n=e.type.contextTypes;if(!n)return ai;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Dt(e){return e=e.childContextTypes,e!=null}function Ku(){$e(jt),$e(yt)}function Jm(e,t,n){if(yt.current!==ai)throw Error(U(168));Te(yt,t),Te(jt,n)}function gx(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(U(108,yP(e)||"Unknown",i));return Ve({},n,r)}function Qu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ai,Ki=yt.current,Te(yt,e),Te(jt,jt.current),!0}function Zm(e,t,n){var r=e.stateNode;if(!r)throw Error(U(169));n?(e=gx(e,t,Ki),r.__reactInternalMemoizedMergedChildContext=e,$e(jt),$e(yt),Te(yt,e)):$e(jt),Te(jt,n)}var rr=null,ed=!1,Jd=!1;function mx(e){rr===null?rr=[e]:rr.push(e)}function $R(e){ed=!0,mx(e)}function pi(){if(!Jd&&rr!==null){Jd=!0;var e=0,t=xe;try{var n=rr;for(xe=1;e>=o,i-=o,cr=1<<32-Sn(t)+i|n<C?(T=P,P=null):T=P.sibling;var R=f(h,P,x[C],b);if(R===null){P===null&&(P=T);break}e&&P&&R.alternate===null&&t(h,P),v=s(R,v,C),S===null?E=R:S.sibling=R,S=R,P=T}if(C===x.length)return n(h,P),je&&bi(h,C),E;if(P===null){for(;CC?(T=P,P=null):T=P.sibling;var N=f(h,P,R.value,b);if(N===null){P===null&&(P=T);break}e&&P&&N.alternate===null&&t(h,P),v=s(N,v,C),S===null?E=N:S.sibling=N,S=N,P=T}if(R.done)return n(h,P),je&&bi(h,C),E;if(P===null){for(;!R.done;C++,R=x.next())R=d(h,R.value,b),R!==null&&(v=s(R,v,C),S===null?E=R:S.sibling=R,S=R);return je&&bi(h,C),E}for(P=r(h,P);!R.done;C++,R=x.next())R=m(P,h,C,R.value,b),R!==null&&(e&&R.alternate!==null&&P.delete(R.key===null?C:R.key),v=s(R,v,C),S===null?E=R:S.sibling=R,S=R);return e&&P.forEach(function(M){return t(h,M)}),je&&bi(h,C),E}function y(h,v,x,b){if(typeof x=="object"&&x!==null&&x.type===Ss&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Ol:e:{for(var E=x.key,S=v;S!==null;){if(S.key===E){if(E=x.type,E===Ss){if(S.tag===7){n(h,S.sibling),v=i(S,x.props.children),v.return=h,h=v;break e}}else if(S.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===$r&&ny(E)===S.type){n(h,S.sibling),v=i(S,x.props),v.ref=Wo(h,S,x),v.return=h,h=v;break e}n(h,S);break}else t(h,S);S=S.sibling}x.type===Ss?(v=Wi(x.props.children,h.mode,b,x.key),v.return=h,h=v):(b=ku(x.type,x.key,x.props,null,h.mode,b),b.ref=Wo(h,v,x),b.return=h,h=b)}return o(h);case Es:e:{for(S=x.key;v!==null;){if(v.key===S)if(v.tag===4&&v.stateNode.containerInfo===x.containerInfo&&v.stateNode.implementation===x.implementation){n(h,v.sibling),v=i(v,x.children||[]),v.return=h,h=v;break e}else{n(h,v);break}else t(h,v);v=v.sibling}v=af(x,h.mode,b),v.return=h,h=v}return o(h);case $r:return S=x._init,y(h,v,S(x._payload),b)}if(oa(x))return _(h,v,x,b);if(zo(x))return p(h,v,x,b);Vl(h,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,v!==null&&v.tag===6?(n(h,v.sibling),v=i(v,x),v.return=h,h=v):(n(h,v),v=of(x,h.mode,b),v.return=h,h=v),o(h)):n(h,v)}return y}var go=xx(!0),bx=xx(!1),Ju=hi(null),Zu=null,Ms=null,Dv=null;function zv(){Dv=Ms=Zu=null}function Uv(e){var t=Ju.current;$e(Ju),e._currentValue=t}function $h(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Vs(e,t){Zu=e,Dv=Ms=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ft=!0),e.firstContext=null)}function cn(e){var t=e._currentValue;if(Dv!==e)if(e={context:e,memoizedValue:t,next:null},Ms===null){if(Zu===null)throw Error(U(308));Ms=e,Zu.dependencies={lanes:0,firstContext:e}}else Ms=Ms.next=e;return t}var Ti=null;function Vv(e){Ti===null?Ti=[e]:Ti.push(e)}function Ex(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Vv(t)):(n.next=i.next,i.next=n),t.interleaved=n,gr(e,r)}function gr(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Fr=!1;function Bv(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Sx(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function hr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ei(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,pe&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,gr(e,n)}return i=r.interleaved,i===null?(t.next=t,Vv(r)):(t.next=i.next,i.next=t),r.interleaved=t,gr(e,n)}function wu(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Rv(e,n)}}function ry(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function ec(e,t,n,r){var i=e.updateQueue;Fr=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,u=l.next;l.next=null,o===null?s=u:o.next=u,o=l;var c=e.alternate;c!==null&&(c=c.updateQueue,a=c.lastBaseUpdate,a!==o&&(a===null?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l))}if(s!==null){var d=i.baseState;o=0,c=u=l=null,a=s;do{var f=a.lane,m=a.eventTime;if((r&f)===f){c!==null&&(c=c.next={eventTime:m,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var _=e,p=a;switch(f=t,m=n,p.tag){case 1:if(_=p.payload,typeof _=="function"){d=_.call(m,d,f);break e}d=_;break e;case 3:_.flags=_.flags&-65537|128;case 0:if(_=p.payload,f=typeof _=="function"?_.call(m,d,f):_,f==null)break e;d=Ve({},d,f);break e;case 2:Fr=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[a]:f.push(a))}else m={eventTime:m,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},c===null?(u=c=m,l=d):c=c.next=m,o|=f;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;f=a,a=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(c===null&&(l=d),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);Xi|=o,e.lanes=o,e.memoizedState=d}}function iy(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=ef.transition;ef.transition={};try{e(!1),t()}finally{xe=n,ef.transition=r}}function Ux(){return dn().memoizedState}function DR(e,t,n){var r=ni(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Vx(e))Bx(t,n);else if(n=Ex(e,t,n,r),n!==null){var i=Ct();Cn(n,e,r,i),qx(n,t,r)}}function zR(e,t,n){var r=ni(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Vx(e))Bx(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,kn(a,o)){var l=t.interleaved;l===null?(i.next=i,Vv(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=Ex(e,t,i,r),n!==null&&(i=Ct(),Cn(n,e,r,i),qx(n,t,r))}}function Vx(e){var t=e.alternate;return e===ze||t!==null&&t===ze}function Bx(e,t){wa=nc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function qx(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Rv(e,n)}}var rc={readContext:cn,useCallback:dt,useContext:dt,useEffect:dt,useImperativeHandle:dt,useInsertionEffect:dt,useLayoutEffect:dt,useMemo:dt,useReducer:dt,useRef:dt,useState:dt,useDebugValue:dt,useDeferredValue:dt,useTransition:dt,useMutableSource:dt,useSyncExternalStore:dt,useId:dt,unstable_isNewReconciler:!1},UR={readContext:cn,useCallback:function(e,t){return Nn().memoizedState=[e,t===void 0?null:t],e},useContext:cn,useEffect:oy,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,bu(4194308,4,Fx.bind(null,t,e),n)},useLayoutEffect:function(e,t){return bu(4194308,4,e,t)},useInsertionEffect:function(e,t){return bu(4,2,e,t)},useMemo:function(e,t){var n=Nn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Nn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=DR.bind(null,ze,e),[r.memoizedState,e]},useRef:function(e){var t=Nn();return e={current:e},t.memoizedState=e},useState:sy,useDebugValue:Xv,useDeferredValue:function(e){return Nn().memoizedState=e},useTransition:function(){var e=sy(!1),t=e[0];return e=jR.bind(null,e[1]),Nn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ze,i=Nn();if(je){if(n===void 0)throw Error(U(407));n=n()}else{if(n=t(),it===null)throw Error(U(349));Yi&30||Rx(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,oy(Ix.bind(null,r,s,e),[e]),r.flags|=2048,Ha(9,Tx.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Nn(),t=it.identifierPrefix;if(je){var n=dr,r=cr;n=(r&~(1<<32-Sn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=qa++,0")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{Ld=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?sa(e):""}function gP(e){switch(e.tag){case 5:return sa(e.type);case 16:return sa("Lazy");case 13:return sa("Suspense");case 19:return sa("SuspenseList");case 0:case 2:case 15:return e=jd(e.type,!1),e;case 11:return e=jd(e.type.render,!1),e;case 1:return e=jd(e.type,!0),e;default:return""}}function ch(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Cs:return"Fragment";case Ss:return"Portal";case ah:return"Profiler";case Ev:return"StrictMode";case lh:return"Suspense";case uh:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ew:return(e.displayName||"Context")+".Consumer";case bw:return(e._context.displayName||"Context")+".Provider";case Sv:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Cv:return t=e.displayName||null,t!==null?t:ch(e.type)||"Memo";case $r:t=e._payload,e=e._init;try{return ch(e(t))}catch{}}return null}function mP(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ch(t);case 8:return t===Ev?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function oi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Cw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function yP(e){var t=Cw(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ml(e){e._valueTracker||(e._valueTracker=yP(e))}function kw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Cw(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Du(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function dh(e,t){var n=t.checked;return Ve({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Cm(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=oi(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Pw(e,t){t=t.checked,t!=null&&bv(e,"checked",t,!1)}function fh(e,t){Pw(e,t);var n=oi(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?hh(e,t.type,n):t.hasOwnProperty("defaultValue")&&hh(e,t.type,oi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function km(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function hh(e,t,n){(t!=="number"||Du(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var oa=Array.isArray;function Ds(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Al.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ma(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var va={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},_P=["Webkit","ms","Moz","O"];Object.keys(va).forEach(function(e){_P.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),va[t]=va[e]})});function Ow(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||va.hasOwnProperty(e)&&va[e]?(""+t).trim():t+"px"}function Mw(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Ow(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var wP=Ve({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function gh(e,t){if(t){if(wP[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(U(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(U(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(U(61))}if(t.style!=null&&typeof t.style!="object")throw Error(U(62))}}function mh(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var yh=null;function kv(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var _h=null,zs=null,Us=null;function Tm(e){if(e=_l(e)){if(typeof _h!="function")throw Error(U(280));var t=e.stateNode;t&&(t=Zc(t),_h(e.stateNode,e.type,t))}}function Aw(e){zs?Us?Us.push(e):Us=[e]:zs=e}function Nw(){if(zs){var e=zs,t=Us;if(Us=zs=null,Tm(e),t)for(e=0;e>>=0,e===0?32:31-(OP(e)/MP|0)|0}var Nl=64,$l=4194304;function aa(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Bu(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=aa(a):(s&=o,s!==0&&(r=aa(s)))}else o=n&~i,o!==0?r=aa(o):s!==0&&(r=aa(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function ml(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Sn(t),e[t]=n}function FP(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=ma),jm=" ",Dm=!1;function ex(e,t){switch(e){case"keyup":return cR.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function tx(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ks=!1;function fR(e,t){switch(e){case"compositionend":return tx(t);case"keypress":return t.which!==32?null:(Dm=!0,jm);case"textInput":return e=t.data,e===jm&&Dm?null:e;default:return null}}function hR(e,t){if(ks)return e==="compositionend"||!Nv&&ex(e,t)?(e=Jw(),yu=Ov=Gr=null,ks=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Bm(n)}}function sx(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?sx(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ox(){for(var e=window,t=Du();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Du(e.document)}return t}function $v(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function bR(e){var t=ox(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&sx(n.ownerDocument.documentElement,n)){if(r!==null&&$v(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=qm(n,s);var o=qm(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Ps=null,Ch=null,_a=null,kh=!1;function Wm(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;kh||Ps==null||Ps!==Du(r)||(r=Ps,"selectionStart"in r&&$v(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),_a&&ja(_a,r)||(_a=r,r=Hu(Ch,"onSelect"),0Is||(e.current=Mh[Is],Mh[Is]=null,Is--)}function Te(e,t){Is++,Mh[Is]=e.current,e.current=t}var ai={},yt=hi(ai),jt=hi(!1),Qi=ai;function vo(e,t){var n=e.type.contextTypes;if(!n)return ai;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Dt(e){return e=e.childContextTypes,e!=null}function Ku(){$e(jt),$e(yt)}function Jm(e,t,n){if(yt.current!==ai)throw Error(U(168));Te(yt,t),Te(jt,n)}function vx(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(U(108,mP(e)||"Unknown",i));return Ve({},n,r)}function Qu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ai,Qi=yt.current,Te(yt,e),Te(jt,jt.current),!0}function Zm(e,t,n){var r=e.stateNode;if(!r)throw Error(U(169));n?(e=vx(e,t,Qi),r.__reactInternalMemoizedMergedChildContext=e,$e(jt),$e(yt),Te(yt,e)):$e(jt),Te(jt,n)}var rr=null,ed=!1,Jd=!1;function gx(e){rr===null?rr=[e]:rr.push(e)}function NR(e){ed=!0,gx(e)}function pi(){if(!Jd&&rr!==null){Jd=!0;var e=0,t=xe;try{var n=rr;for(xe=1;e>=o,i-=o,cr=1<<32-Sn(t)+i|n<C?(T=P,P=null):T=P.sibling;var R=f(h,P,x[C],b);if(R===null){P===null&&(P=T);break}e&&P&&R.alternate===null&&t(h,P),v=s(R,v,C),S===null?E=R:S.sibling=R,S=R,P=T}if(C===x.length)return n(h,P),je&&bi(h,C),E;if(P===null){for(;CC?(T=P,P=null):T=P.sibling;var N=f(h,P,R.value,b);if(N===null){P===null&&(P=T);break}e&&P&&N.alternate===null&&t(h,P),v=s(N,v,C),S===null?E=N:S.sibling=N,S=N,P=T}if(R.done)return n(h,P),je&&bi(h,C),E;if(P===null){for(;!R.done;C++,R=x.next())R=d(h,R.value,b),R!==null&&(v=s(R,v,C),S===null?E=R:S.sibling=R,S=R);return je&&bi(h,C),E}for(P=r(h,P);!R.done;C++,R=x.next())R=m(P,h,C,R.value,b),R!==null&&(e&&R.alternate!==null&&P.delete(R.key===null?C:R.key),v=s(R,v,C),S===null?E=R:S.sibling=R,S=R);return e&&P.forEach(function(M){return t(h,M)}),je&&bi(h,C),E}function y(h,v,x,b){if(typeof x=="object"&&x!==null&&x.type===Cs&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Ol:e:{for(var E=x.key,S=v;S!==null;){if(S.key===E){if(E=x.type,E===Cs){if(S.tag===7){n(h,S.sibling),v=i(S,x.props.children),v.return=h,h=v;break e}}else if(S.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===$r&&ny(E)===S.type){n(h,S.sibling),v=i(S,x.props),v.ref=Wo(h,S,x),v.return=h,h=v;break e}n(h,S);break}else t(h,S);S=S.sibling}x.type===Cs?(v=Wi(x.props.children,h.mode,b,x.key),v.return=h,h=v):(b=ku(x.type,x.key,x.props,null,h.mode,b),b.ref=Wo(h,v,x),b.return=h,h=b)}return o(h);case Ss:e:{for(S=x.key;v!==null;){if(v.key===S)if(v.tag===4&&v.stateNode.containerInfo===x.containerInfo&&v.stateNode.implementation===x.implementation){n(h,v.sibling),v=i(v,x.children||[]),v.return=h,h=v;break e}else{n(h,v);break}else t(h,v);v=v.sibling}v=af(x,h.mode,b),v.return=h,h=v}return o(h);case $r:return S=x._init,y(h,v,S(x._payload),b)}if(oa(x))return _(h,v,x,b);if(zo(x))return p(h,v,x,b);Vl(h,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,v!==null&&v.tag===6?(n(h,v.sibling),v=i(v,x),v.return=h,h=v):(n(h,v),v=of(x,h.mode,b),v.return=h,h=v),o(h)):n(h,v)}return y}var mo=wx(!0),xx=wx(!1),Ju=hi(null),Zu=null,As=null,Dv=null;function zv(){Dv=As=Zu=null}function Uv(e){var t=Ju.current;$e(Ju),e._currentValue=t}function $h(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Bs(e,t){Zu=e,Dv=As=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ft=!0),e.firstContext=null)}function cn(e){var t=e._currentValue;if(Dv!==e)if(e={context:e,memoizedValue:t,next:null},As===null){if(Zu===null)throw Error(U(308));As=e,Zu.dependencies={lanes:0,firstContext:e}}else As=As.next=e;return t}var Ti=null;function Vv(e){Ti===null?Ti=[e]:Ti.push(e)}function bx(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Vv(t)):(n.next=i.next,i.next=n),t.interleaved=n,gr(e,r)}function gr(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Fr=!1;function Bv(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ex(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function hr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ei(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,pe&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,gr(e,n)}return i=r.interleaved,i===null?(t.next=t,Vv(r)):(t.next=i.next,i.next=t),r.interleaved=t,gr(e,n)}function wu(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Rv(e,n)}}function ry(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function ec(e,t,n,r){var i=e.updateQueue;Fr=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,u=l.next;l.next=null,o===null?s=u:o.next=u,o=l;var c=e.alternate;c!==null&&(c=c.updateQueue,a=c.lastBaseUpdate,a!==o&&(a===null?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l))}if(s!==null){var d=i.baseState;o=0,c=u=l=null,a=s;do{var f=a.lane,m=a.eventTime;if((r&f)===f){c!==null&&(c=c.next={eventTime:m,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var _=e,p=a;switch(f=t,m=n,p.tag){case 1:if(_=p.payload,typeof _=="function"){d=_.call(m,d,f);break e}d=_;break e;case 3:_.flags=_.flags&-65537|128;case 0:if(_=p.payload,f=typeof _=="function"?_.call(m,d,f):_,f==null)break e;d=Ve({},d,f);break e;case 2:Fr=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[a]:f.push(a))}else m={eventTime:m,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},c===null?(u=c=m,l=d):c=c.next=m,o|=f;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;f=a,a=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(c===null&&(l=d),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);Ji|=o,e.lanes=o,e.memoizedState=d}}function iy(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=ef.transition;ef.transition={};try{e(!1),t()}finally{xe=n,ef.transition=r}}function zx(){return dn().memoizedState}function jR(e,t,n){var r=ni(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Ux(e))Vx(t,n);else if(n=bx(e,t,n,r),n!==null){var i=Ct();Cn(n,e,r,i),Bx(n,t,r)}}function DR(e,t,n){var r=ni(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ux(e))Vx(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,kn(a,o)){var l=t.interleaved;l===null?(i.next=i,Vv(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=bx(e,t,i,r),n!==null&&(i=Ct(),Cn(n,e,r,i),Bx(n,t,r))}}function Ux(e){var t=e.alternate;return e===ze||t!==null&&t===ze}function Vx(e,t){wa=nc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Bx(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Rv(e,n)}}var rc={readContext:cn,useCallback:dt,useContext:dt,useEffect:dt,useImperativeHandle:dt,useInsertionEffect:dt,useLayoutEffect:dt,useMemo:dt,useReducer:dt,useRef:dt,useState:dt,useDebugValue:dt,useDeferredValue:dt,useTransition:dt,useMutableSource:dt,useSyncExternalStore:dt,useId:dt,unstable_isNewReconciler:!1},zR={readContext:cn,useCallback:function(e,t){return Nn().memoizedState=[e,t===void 0?null:t],e},useContext:cn,useEffect:oy,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,bu(4194308,4,$x.bind(null,t,e),n)},useLayoutEffect:function(e,t){return bu(4194308,4,e,t)},useInsertionEffect:function(e,t){return bu(4,2,e,t)},useMemo:function(e,t){var n=Nn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Nn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=jR.bind(null,ze,e),[r.memoizedState,e]},useRef:function(e){var t=Nn();return e={current:e},t.memoizedState=e},useState:sy,useDebugValue:Xv,useDeferredValue:function(e){return Nn().memoizedState=e},useTransition:function(){var e=sy(!1),t=e[0];return e=LR.bind(null,e[1]),Nn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ze,i=Nn();if(je){if(n===void 0)throw Error(U(407));n=n()}else{if(n=t(),it===null)throw Error(U(349));Xi&30||Px(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,oy(Tx.bind(null,r,s,e),[e]),r.flags|=2048,Ha(9,Rx.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Nn(),t=it.identifierPrefix;if(je){var n=dr,r=cr;n=(r&~(1<<32-Sn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=qa++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[zn]=t,e[Ua]=r,eb(e,t,!1,!1),t.stateNode=e;e:{switch(o=mh(n,r),n){case"dialog":Me("cancel",e),Me("close",e),i=r;break;case"iframe":case"object":case"embed":Me("load",e),i=r;break;case"video":case"audio":for(i=0;i_o&&(t.flags|=128,r=!0,Ho(s,!1),t.lanes=4194304)}else{if(!r)if(e=tc(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ho(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!je)return ft(t),null}else 2*Qe()-s.renderingStartTime>_o&&n!==1073741824&&(t.flags|=128,r=!0,Ho(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Qe(),t.sibling=null,n=De.current,Te(De,r?n&1|2:n&1),t):(ft(t),null);case 22:case 23:return rg(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Vt&1073741824&&(ft(t),t.subtreeFlags&6&&(t.flags|=8192)):ft(t),null;case 24:return null;case 25:return null}throw Error(U(156,t.tag))}function QR(e,t){switch(Lv(t),t.tag){case 1:return Dt(t.type)&&Ku(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return mo(),$e(jt),$e(yt),Hv(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Wv(t),null;case 13:if($e(De),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(U(340));vo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $e(De),null;case 4:return mo(),null;case 10:return Uv(t.type._context),null;case 22:case 23:return rg(),null;case 24:return null;default:return null}}var ql=!1,gt=!1,YR=typeof WeakSet=="function"?WeakSet:Set,G=null;function As(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){He(e,t,r)}else n.current=null}function qh(e,t,n){try{n()}catch(r){He(e,t,r)}}var my=!1;function XR(e,t){if(Ph=qu,e=ax(),$v(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var m;d!==n||i!==0&&d.nodeType!==3||(a=o+i),d!==s||r!==0&&d.nodeType!==3||(l=o+r),d.nodeType===3&&(o+=d.nodeValue.length),(m=d.firstChild)!==null;)f=d,d=m;for(;;){if(d===e)break t;if(f===n&&++u===i&&(a=o),f===s&&++c===r&&(l=o),(m=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=m}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Rh={focusedElem:e,selectionRange:n},qu=!1,G=t;G!==null;)if(t=G,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,G=e;else for(;G!==null;){t=G;try{var _=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(_!==null){var p=_.memoizedProps,y=_.memoizedState,h=t.stateNode,v=h.getSnapshotBeforeUpdate(t.elementType===t.type?p:mn(t.type,p),y);h.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(U(163))}}catch(b){He(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,G=e;break}G=t.return}return _=my,my=!1,_}function xa(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&qh(t,n,s)}i=i.next}while(i!==r)}}function rd(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Wh(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function rb(e){var t=e.alternate;t!==null&&(e.alternate=null,rb(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[zn],delete t[Ua],delete t[Oh],delete t[AR],delete t[NR])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function ib(e){return e.tag===5||e.tag===3||e.tag===4}function yy(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ib(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Hh(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Gu));else if(r!==4&&(e=e.child,e!==null))for(Hh(e,t,n),e=e.sibling;e!==null;)Hh(e,t,n),e=e.sibling}function Gh(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Gh(e,t,n),e=e.sibling;e!==null;)Gh(e,t,n),e=e.sibling}var st=null,wn=!1;function Pr(e,t,n){for(n=n.child;n!==null;)sb(e,t,n),n=n.sibling}function sb(e,t,n){if(qn&&typeof qn.onCommitFiberUnmount=="function")try{qn.onCommitFiberUnmount(Qc,n)}catch{}switch(n.tag){case 5:gt||As(n,t);case 6:var r=st,i=wn;st=null,Pr(e,t,n),st=r,wn=i,st!==null&&(wn?(e=st,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):st.removeChild(n.stateNode));break;case 18:st!==null&&(wn?(e=st,n=n.stateNode,e.nodeType===8?Xd(e.parentNode,n):e.nodeType===1&&Xd(e,n),Fa(e)):Xd(st,n.stateNode));break;case 4:r=st,i=wn,st=n.stateNode.containerInfo,wn=!0,Pr(e,t,n),st=r,wn=i;break;case 0:case 11:case 14:case 15:if(!gt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&qh(n,t,o),i=i.next}while(i!==r)}Pr(e,t,n);break;case 1:if(!gt&&(As(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){He(n,t,a)}Pr(e,t,n);break;case 21:Pr(e,t,n);break;case 22:n.mode&1?(gt=(r=gt)||n.memoizedState!==null,Pr(e,t,n),gt=r):Pr(e,t,n);break;default:Pr(e,t,n)}}function _y(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new YR),t.forEach(function(r){var i=oT.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function vn(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=o),r&=~s}if(r=i,r=Qe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*ZR(r/1960))-r,10e?16:e,Kr===null)var r=!1;else{if(e=Kr,Kr=null,oc=0,pe&6)throw Error(U(331));var i=pe;for(pe|=4,G=e.current;G!==null;){var s=G,o=s.child;if(G.flags&16){var a=s.deletions;if(a!==null){for(var l=0;lQe()-tg?qi(e,0):eg|=n),zt(e,t)}function hb(e,t){t===0&&(e.mode&1?(t=$l,$l<<=1,!($l&130023424)&&($l=4194304)):t=1);var n=Ct();e=gr(e,t),e!==null&&(ml(e,t,n),zt(e,n))}function sT(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),hb(e,n)}function oT(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(U(314))}r!==null&&r.delete(t),hb(e,n)}var pb;pb=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||jt.current)Ft=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ft=!1,GR(e,t,n);Ft=!!(e.flags&131072)}else Ft=!1,je&&t.flags&1048576&&yx(t,Xu,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Eu(e,t),e=t.pendingProps;var i=po(t,yt.current);Vs(t,n),i=Kv(null,t,r,e,i,n);var s=Qv();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Dt(r)?(s=!0,Qu(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Bv(t),i.updater=nd,t.stateNode=i,i._reactInternals=t,Lh(t,r,e,n),t=zh(null,t,r,!0,s,n)):(t.tag=0,je&&s&&Fv(t),bt(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Eu(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=lT(r),e=mn(r,e),i){case 0:t=Dh(null,t,r,e,n);break e;case 1:t=py(null,t,r,e,n);break e;case 11:t=fy(null,t,r,e,n);break e;case 14:t=hy(null,t,r,mn(r.type,e),n);break e}throw Error(U(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:mn(r,i),Dh(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:mn(r,i),py(e,t,r,i,n);case 3:e:{if(Xx(t),e===null)throw Error(U(387));r=t.pendingProps,s=t.memoizedState,i=s.element,Sx(e,t),ec(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=yo(Error(U(423)),t),t=vy(e,t,r,n,i);break e}else if(r!==i){i=yo(Error(U(424)),t),t=vy(e,t,r,n,i);break e}else for(Gt=Zr(t.stateNode.containerInfo.firstChild),Qt=t,je=!0,xn=null,n=bx(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(vo(),r===i){t=mr(e,t,n);break e}bt(e,t,r,n)}t=t.child}return t;case 5:return Cx(t),e===null&&Nh(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,Th(r,i)?o=null:s!==null&&Th(r,s)&&(t.flags|=32),Yx(e,t),bt(e,t,o,n),t.child;case 6:return e===null&&Nh(t),null;case 13:return Jx(e,t,n);case 4:return qv(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=go(t,null,r,n):bt(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:mn(r,i),fy(e,t,r,i,n);case 7:return bt(e,t,t.pendingProps,n),t.child;case 8:return bt(e,t,t.pendingProps.children,n),t.child;case 12:return bt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,Te(Ju,r._currentValue),r._currentValue=o,s!==null)if(kn(s.value,o)){if(s.children===i.children&&!jt.current){t=mr(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=hr(-1,n&-n),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),$h(s.return,n,t),a.lanes|=n;break}l=l.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(U(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),$h(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}bt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Vs(t,n),i=cn(i),r=r(i),t.flags|=1,bt(e,t,r,n),t.child;case 14:return r=t.type,i=mn(r,t.pendingProps),i=mn(r.type,i),hy(e,t,r,i,n);case 15:return Kx(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:mn(r,i),Eu(e,t),t.tag=1,Dt(r)?(e=!0,Qu(t)):e=!1,Vs(t,n),Wx(t,r,i),Lh(t,r,i,n),zh(null,t,r,!0,e,n);case 19:return Zx(e,t,n);case 22:return Qx(e,t,n)}throw Error(U(156,t.tag))};function vb(e,t){return Vw(e,t)}function aT(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function on(e,t,n,r){return new aT(e,t,n,r)}function sg(e){return e=e.prototype,!(!e||!e.isReactComponent)}function lT(e){if(typeof e=="function")return sg(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Sv)return 11;if(e===Cv)return 14}return 2}function ri(e,t){var n=e.alternate;return n===null?(n=on(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ku(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")sg(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Ss:return Wi(n.children,i,s,t);case Ev:o=8,i|=8;break;case ah:return e=on(12,n,t,i|2),e.elementType=ah,e.lanes=s,e;case lh:return e=on(13,n,t,i),e.elementType=lh,e.lanes=s,e;case uh:return e=on(19,n,t,i),e.elementType=uh,e.lanes=s,e;case Cw:return sd(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ew:o=10;break e;case Sw:o=9;break e;case Sv:o=11;break e;case Cv:o=14;break e;case $r:o=16,r=null;break e}throw Error(U(130,e==null?e:typeof e,""))}return t=on(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function Wi(e,t,n,r){return e=on(7,e,r,t),e.lanes=n,e}function sd(e,t,n,r){return e=on(22,e,r,t),e.elementType=Cw,e.lanes=n,e.stateNode={isHidden:!1},e}function of(e,t,n){return e=on(6,e,null,t),e.lanes=n,e}function af(e,t,n){return t=on(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function uT(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zd(0),this.expirationTimes=zd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zd(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function og(e,t,n,r,i,s,o,a,l){return e=new uT(e,t,n,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=on(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Bv(s),e}function cT(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(_b)}catch(e){console.error(e)}}_b(),_w.exports=Zt;var xl=_w.exports;const vT=aw(xl);var wb,Py=xl;wb=Py.createRoot,Py.hydrateRoot;var uc=["light","dark"],cg="(prefers-color-scheme: dark)",gT=typeof window>"u",dg=g.createContext(void 0),mT={setTheme:e=>{},themes:[]},rz=()=>{var e;return(e=g.useContext(dg))!=null?e:mT},yT=e=>g.useContext(dg)?e.children:g.createElement(wT,{...e}),_T=["light","dark"],wT=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:i="theme",themes:s=_T,defaultTheme:o=n?"system":"light",attribute:a="data-theme",value:l,children:u,nonce:c})=>{let[d,f]=g.useState(()=>Ry(i,o)),[m,_]=g.useState(()=>Ry(i)),p=l?Object.values(l):s,y=g.useCallback(b=>{let E=b;if(!E)return;b==="system"&&n&&(E=Ty());let S=l?l[E]:E,P=t?bT():null,C=document.documentElement;if(a==="class"?(C.classList.remove(...p),S&&C.classList.add(S)):S?C.setAttribute(a,S):C.removeAttribute(a),r){let T=uc.includes(o)?o:null,R=uc.includes(E)?E:T;C.style.colorScheme=R}P==null||P()},[]),h=g.useCallback(b=>{let E=typeof b=="function"?b(b):b;f(E);try{localStorage.setItem(i,E)}catch{}},[e]),v=g.useCallback(b=>{let E=Ty(b);_(E),d==="system"&&n&&!e&&y("system")},[d,e]);g.useEffect(()=>{let b=window.matchMedia(cg);return b.addListener(v),v(b),()=>b.removeListener(v)},[v]),g.useEffect(()=>{let b=E=>{if(E.key!==i)return;let S=E.newValue||o;h(S)};return window.addEventListener("storage",b),()=>window.removeEventListener("storage",b)},[h]),g.useEffect(()=>{y(e??d)},[e,d]);let x=g.useMemo(()=>({theme:d,setTheme:h,forcedTheme:e,resolvedTheme:d==="system"?m:d,themes:n?[...s,"system"]:s,systemTheme:n?m:void 0}),[d,h,e,m,n,s]);return g.createElement(dg.Provider,{value:x},g.createElement(xT,{forcedTheme:e,disableTransitionOnChange:t,enableSystem:n,enableColorScheme:r,storageKey:i,themes:s,defaultTheme:o,attribute:a,value:l,children:u,attrs:p,nonce:c}),u)},xT=g.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:s,value:o,attrs:a,nonce:l})=>{let u=s==="system",c=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${a.map(_=>`'${_}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,d=i?uc.includes(s)&&s?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${s}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",f=(_,p=!1,y=!0)=>{let h=o?o[_]:_,v=p?_+"|| ''":`'${h}'`,x="";return i&&y&&!p&&uc.includes(_)&&(x+=`d.style.colorScheme = '${_}';`),n==="class"?p||h?x+=`c.add(${v})`:x+="null":h&&(x+=`d[s](n,${v})`),x},m=e?`!function(){${c}${f(e)}}()`:r?`!function(){try{${c}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${u})){var t='${cg}',m=window.matchMedia(t);if(m.media!==t||m.matches){${f("dark")}}else{${f("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${f(o?"x[e]":"e",!0)}}${u?"":"else{"+f(s,!1,!1)+"}"}${d}}catch(e){}}()`:`!function(){try{${c}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${f(o?"x[e]":"e",!0)}}else{${f(s,!1,!1)};}${d}}catch(t){}}();`;return g.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:m}})}),Ry=(e,t)=>{if(gT)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},bT=()=>{let e=document.createElement("style");return e.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(e)},1)}},Ty=e=>(e||(e=window.matchMedia(cg)),e.matches?"dark":"light"),I=typeof window<"u"?window:void 0,mt=typeof globalThis<"u"?globalThis:I,St=mt==null?void 0:mt.navigator,j=mt==null?void 0:mt.document,Ae=mt==null?void 0:mt.location,fg=mt==null?void 0:mt.fetch,Jh=mt!=null&&mt.XMLHttpRequest&&"withCredentials"in new mt.XMLHttpRequest?mt.XMLHttpRequest:void 0,Iy=mt==null?void 0:mt.AbortController,ET=mt==null?void 0:mt.CompressionStream,Mt=St==null?void 0:St.userAgent;function xb(){return!(!I||I.navigator.onLine===!1)}var Ko=typeof globalThis<"u"?globalThis:I;Ko&&typeof self>"u"&&(Ko.self=Ko),Ko&&typeof File>"u"&&(Ko.File=function(){});var Y=I??{},Ee={DEBUG:!1,LIB_VERSION:"0.5.1",LIB_NAME:"browser-common"};function Oy(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(u){return void n(u)}a.done?t(l):Promise.resolve(l).then(r,i)}function Ce(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){Oy(s,r,i,o,a,"next",l)}function a(l){Oy(s,r,i,o,a,"throw",l)}o(void 0)})}}function $(){return $=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$.apply(null,arguments)}function bb(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var My=e=>{if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return e}};function Ay(e){return typeof e=="string"||e}function Ny(e){return typeof e=="string"?e:void 0}var Qo,ST=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],nr=function(e){return e.AnonymousId="anonymous_id",e.DistinctId="distinct_id",e.Props="props",e.EnablePersonProcessing="enable_person_processing",e.PersonMode="person_mode",e.FeatureFlagDetails="feature_flag_details",e.FeatureFlags="feature_flags",e.FeatureFlagPayloads="feature_flag_payloads",e.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",e.BootstrapFeatureFlags="bootstrap_feature_flags",e.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",e.OverrideFeatureFlags="override_feature_flags",e.Queue="queue",e.AiQueue="ai_queue",e.AiCaptureQueue="ai_capture_queue",e.LogsQueue="logs_queue",e.OptedOut="opted_out",e.SessionId="session_id",e.SessionStartTimestamp="session_start_timestamp",e.SessionLastTimestamp="session_timestamp",e.PersonProperties="person_properties",e.GroupProperties="group_properties",e.InstalledAppBuild="installed_app_build",e.InstalledAppVersion="installed_app_version",e.SessionReplay="session_replay",e.PushRegistered="push_registered",e.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",e.SurveyLastSeenDate="survey_last_seen_date",e.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config",e.FlagsEndpointWasHit="flags_endpoint_was_hit",e.DeviceId="device_id",e}({}),$y=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),CT=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],kT=["token"],Eb="NativeGzipValidationError",Zh=e=>e.length>=2&&e[0]===31&&e[1]===139,Fy=(e,t)=>e===$y.GZipJS||t===$y.GZipJS||t==="gzip",Ly=e=>!(!e||typeof e!="object")&&("name"in e?String(e.name):"")==="NotReadableError",Gl=e=>{var t=new Error("Native gzip produced invalid output: "+e);throw t.name=Eb,t},PT=function(){var e=Ce(function*(t,n){18>t.size&&Gl("too-short");var r=new Uint8Array(yield t.slice(0,10).arrayBuffer());Zh(r)&&r[2]===8||Gl("invalid-header");var i=new DataView(yield t.slice(t.size-8).arrayBuffer());i.getUint32(0,!0)!==(o=>{for(var a=(()=>{if(Qo)return Qo;Qo=[];for(var c=0;256>c;c++){for(var d=c,f=0;8>f;f++)d=1&d?3988292384^d>>>1:d>>>1;Qo[c]=d>>>0}return Qo})(),l=4294967295,u=0;o.length>u;u++)l=a[255&(l^o[u])]^l>>>8;return(4294967295^l)>>>0})(n)&&Gl("invalid-crc");var s=n.length>>>0;i.getUint32(4,!0)!==s&&Gl("invalid-size")});return function(t,n){return e.apply(this,arguments)}}();function ep(){return ep=Ce(function*(e,t,n){t===void 0&&(t=!0);try{var r=new TextEncoder().encode(e),i=new globalThis.CompressionStream("gzip"),s=i.writable.getWriter(),o=s.write(r).then(()=>s.close()).catch(function(){var u=Ce(function*(c){try{yield s.abort(c)}catch{}throw c});return function(c){return u.apply(this,arguments)}}()),a=new Response(i.readable).blob(),l=(yield Promise.all([a,o]))[0];return yield PT(l,r),l}catch(u){if(n!=null&&n.rethrow)throw u;return t&&console.error("Failed to gzip compress data",u),null}}),ep.apply(this,arguments)}var RT=20,Sb=1e3,TT=1e4,IT="[Circular]",tp="[Truncated]",cd="[Unserializable]",OT="[Function]";function qs(e){for(var t="",n=0;e.length>n;n++){var r=e.charCodeAt(n);if(55296>r||r>56319)t+=56320>r||r>57343?e[n]:"�";else{var i=e.charCodeAt(n+1);56320>i||i>57343?t+="�":(t+=e[n]+e[n+1],n++)}}return t}var MT=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],jy=function(e,t){if(t===void 0&&(t=[]),!e)return!1;var n=e.toLowerCase();return MT.concat(t).some(r=>{var i=r.toLowerCase();return n.indexOf(i)!==-1})};function J(e,t){return e.indexOf(t)!==-1}var dd=function(e){return e.trim()},np=function(e){return e.replace(/^\$/,"")};function Cb(e){var t,n=[];return(t=JSON.stringify(e,function(r,i){if(typeof i=="bigint")return i.toString();if(typeof i!="function"&&typeof i!="symbol"){if(i instanceof Error)return{name:i.name,message:i.message,stack:i.stack};if(i&&typeof i=="object"){for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(i))return"[Circular]";n.push(i)}return i}}))!==null&&t!==void 0?t:"null"}var kb=Object.prototype,Pb=kb.hasOwnProperty,fd=kb.toString,Z=Array.isArray||function(e){return fd.call(e)==="[object Array]"},vt=e=>typeof e=="function",Se=e=>e===Object(e)&&!Z(e),En=e=>{if(Se(e)){for(var t in e)if(Pb.call(e,t))return!1;return!0}return!1},L=e=>e===void 0,ce=e=>fd.call(e)=="[object String]",cc=e=>ce(e)&&e.trim().length===0,rt=e=>e===null,ne=e=>L(e)||rt(e),Ge=e=>fd.call(e)=="[object Number]"&&e==e,Jn=e=>Ge(e)&&e>0,$t=e=>fd.call(e)==="[object Boolean]",AT=e=>e instanceof FormData,NT=e=>J(CT,e),$T=e=>J(kT,e);function Rb(e){return e===null||typeof e!="object"}function dc(e,t){return{}.toString.call(e)==="[object "+t+"]"}function Tb(e){switch({}.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return Ib(e,Error)}}function hg(e){return typeof Event<"u"&&Ib(e,Event)}function Ib(e,t){try{return e instanceof t}catch{return!1}}var FT=[!0,"true",1,"1","yes"],lf=e=>J(FT,e),LT=[!1,"false",0,"0","no"];function Vn(e,t,n,r,i){return t>n&&(r.warn("min cannot be greater than max."),t=n),Ge(e)?e>n?(r.warn(" cannot be greater than max: "+n+". Using max value instead."),n):t>e?(r.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(r.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+i),Vn(i||n,t,n,r))}class jT{constructor(t){this.k={},this.S=t.S,this.C=Vn(t.bucketSize,0,100,t.I),this.R=Vn(t.refillRate,0,this.C,t.I),this.A=Vn(t.refillInterval,0,864e5,t.I)}O(t,n){var r=Math.floor((n-t.lastAccess)/this.A);r>0&&(t.tokens=Math.min(t.tokens+r*this.R,this.C),t.lastAccess=t.lastAccess+r*this.A)}consumeRateLimit(t){var n,r=Date.now(),i=String(t),s=this.k[i];return s?this.O(s,r):this.k[i]=s={tokens:this.C,lastAccess:r},s.tokens===0||(s.tokens--,s.tokens===0&&((n=this.S)==null||n.call(this,t)),s.tokens===0)}stop(){this.k={}}}var Yt="Mobile",fc="iOS",fr="Android",wo="Tablet",Ob=fr+" "+wo,Mb="iPad",Ab="Apple",Nb=Ab+" Watch",Sa="Safari",xo="BlackBerry",$b="Samsung",Fb=$b+"Browser",Lb=$b+" Internet",Hi="Chrome",DT=Hi+" OS",jb=Hi+" "+fc,pg="Internet Explorer",Db=pg+" "+Yt,vg="Opera",zT=vg+" Mini",gg="Edge",zb="Microsoft "+gg,Ws="Firefox",Ub=Ws+" "+fc,Ka="Nintendo",Qa="PlayStation",Hs="Xbox",Vb=fr+" "+Yt,Bb=Yt+" "+Sa,ua="Windows",rp=ua+" Phone",Dy="Nokia",ip="Ouya",qb="Generic",UT=qb+" "+Yt.toLowerCase(),Wb=qb+" "+wo.toLowerCase(),sp="Konqueror",Hb="Oculus Browser",hc="Vivaldi",Gb="Yandex",pc="Whale",op="DuckDuckGo",Kb="Pale Moon",vc="Waterfox",Ca="Brave",Qb="Google Search App",Le="(\\d+(\\.\\d+)?)",uf=new RegExp("Version/"+Le),VT=new RegExp(Hs,"i"),BT=new RegExp(Qa+" \\w+","i"),qT=new RegExp(Ka+" \\w+","i"),mg=new RegExp(xo+"|PlayBook|BB10","i"),WT={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},Yb=function(e,t,n,r){t=t||"";var i=function(s){return s!=null&&s.brave?Ca:null}(n);return i||(r!=null&&r.detectGoogleSearchApp&&J(e,"GSA/")?Qb:J(e," OPR/")&&J(e,"Mini")?zT:J(e," OPR/")?vg:mg.test(e)?xo:J(e,"IE"+Yt)||J(e,"WPDesktop")?Db:J(e,"OculusBrowser")?Hb:J(e,Fb)?Lb:J(e,gg)||J(e,"Edg/")?zb:J(e,hc+"/")?hc:J(e,"YaBrowser/")?Gb:J(e,pc+"/")?pc:J(e,op+"/")||J(e,"Ddg/")?op:J(e,"FBIOS")?"Facebook "+Yt:J(e,"UCWEB")||J(e,"UCBrowser")?"UC Browser":J(e,"CriOS")?jb:J(e,"CrMo")||J(e,Hi)?Hi:J(e,fr)&&J(e,Sa)?Vb:J(e,"FxiOS")?Ub:J(e.toLowerCase(),sp.toLowerCase())?sp:J(e,Ca+"/")?Ca:((s,o)=>o&&J(o,Ab)||function(a){return J(a,Sa)&&!J(a,Hi)&&!J(a,fr)}(s))(e,t)?J(e,Yt)?Bb:Sa:J(e,"PaleMoon/")?Kb:J(e,vc+"/")?vc:J(e,Ws)?Ws:J(e,"MSIE")||J(e,"Trident/")?pg:J(e,"Gecko")?Ws:"")},HT={[Db]:[new RegExp("rv:"+Le)],[zb]:[new RegExp(gg+"?\\/"+Le)],[Hi]:[new RegExp("("+Hi+"|CrMo)\\/"+Le)],[jb]:[new RegExp("CriOS\\/"+Le)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Le)],[Sa]:[uf],[Bb]:[uf],[vg]:[new RegExp("(Opera|OPR)\\/"+Le)],[Ws]:[new RegExp(Ws+"\\/"+Le)],[Ub]:[new RegExp("FxiOS\\/"+Le)],[sp]:[new RegExp("Konqueror[:/]?"+Le,"i")],[xo]:[new RegExp(xo+" "+Le),uf],[Vb]:[new RegExp("android\\s"+Le,"i")],[Lb]:[new RegExp(Fb+"\\/"+Le)],[Hb]:[new RegExp("OculusBrowser\\/"+Le)],[hc]:[new RegExp(hc+"\\/"+Le)],[Gb]:[new RegExp("YaBrowser\\/"+Le)],[pc]:[new RegExp(pc+"\\/"+Le)],[Ca]:[new RegExp(Ca+"\\/"+Le)],[op]:[new RegExp("(DuckDuckGo|Ddg)\\/"+Le)],[Kb]:[new RegExp("PaleMoon\\/"+Le)],[vc]:[new RegExp(vc+"\\/"+Le)],[Qb]:[new RegExp("GSA\\/"+Le)],[pg]:[new RegExp("(rv:|MSIE )"+Le)],Mozilla:[new RegExp("rv:"+Le)]},GT=function(e,t,n,r){var i=Yb(e,t,n,r),s=HT[i];if(L(s))return null;for(var o=0;s.length>o;o++){var a=e.match(s[o]);if(a)return parseFloat(a[a.length-2])}return null},zy=[[new RegExp(Hs+"; "+Hs+" (.*?)[);]","i"),e=>[Hs,e&&e[1]||""]],[new RegExp(Ka,"i"),[Ka,""]],[new RegExp(Qa,"i"),[Qa,""]],[mg,[xo,""]],[new RegExp(ua,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[rp,""];if(new RegExp(Yt).test(t)&&!/IEMobile\b/.test(t))return[ua+" "+Yt,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=WT[n[1]]||"";return/arm/i.test(t)&&(r="RT"),[ua,r]}return[ua,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[fc,[e[3],e[4],e[5]||"0"].join(".")]:[fc,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=L(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+fr+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+fr+")","i"),e=>e&&e[2]?[fr,[e[2],e[3],e[4]||"0"].join(".")]:[fr,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[DT,""]],[/Linux|debian/i,["Linux",""]]],Uy=function(e){return qT.test(e)?Ka:BT.test(e)?Qa:VT.test(e)?Hs:new RegExp(ip,"i").test(e)?ip:new RegExp("("+rp+"|WPDesktop)","i").test(e)?rp:/iPad/.test(e)?Mb:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Nb:mg.test(e)?xo:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Dy,"i").test(e)?Dy:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(Yt).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?fr:Ob:new RegExp("(pda|"+Yt+")","i").test(e)?UT:new RegExp(wo,"i").test(e)&&!new RegExp(wo+" pc","i").test(e)?Wb:""},KT=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Vy(e,t){return typeof(n=e)=="string"&&KT.test(n)?e:t();var n}function li(e){return e&&e.split("#")[0]}function yg(e,t){var n=setTimeout(e,t);return n!=null&&n.unref&&(n==null||n.unref()),n}function By(e,t,n){return Xb.apply(this,arguments)}function Xb(){return(Xb=Ce(function*(e,t,n){var r;try{return yield Promise.race([e,new Promise((i,s)=>{r=yg(()=>{try{n==null||n(),i()}catch(o){s(o)}},t)})])}finally{clearTimeout(r)}})).apply(this,arguments)}var Jb={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},QT=Jb.info,qy=9223372036854776e3,YT={}.propertyIsEnumerable;function gc(e,t){try{return Zb(e,t,{ancestors:new WeakSet,remainingNodes:TT},0)}catch{return[]}}function _g(e,t,n,r){if(0>=n.remainingNodes)return{stringValue:tp};if(n.remainingNodes--,$t(e))return{boolValue:e};if(typeof e=="number"){if(!Number.isFinite(e))return{stringValue:String(e)};if(Number.isInteger(e)){if(Number.isSafeInteger(e))return{intValue:String(e)};if(typeof BigInt>"u")return{stringValue:String(e)};var i=BigInt(e).toString();return e>=qy||-qy>e?(t==null||t.debug("Attribute "+i+" is outside the int64 range; encoding it as a string"),{stringValue:i}):{intValue:i}}return{doubleValue:e}}if(typeof e=="string")return{stringValue:qs(e)};if(typeof e=="function")return{stringValue:OT};if(typeof e=="symbol")return{stringValue:String(e)};if(typeof e=="object"&&e!==null){if(n.ancestors.has(e))return{stringValue:IT};if(r>=RT)return{stringValue:tp};if(e instanceof Date){var s=e.getTime(),o=Number.isFinite(s)?e.toISOString():String(e);return{stringValue:typeof o=="string"?qs(o):String(o)}}n.ancestors.add(e);try{try{var a=e.toJSON;if(typeof a=="function")return _g(a.call(e),t,n,r+1)}catch{}return Z(e)?{arrayValue:{values:XT(e,t,n,r+1)}}:{kvlistValue:{values:Zb(e,t,n,r+1)}}}finally{n.ancestors.delete(e)}}return{stringValue:qs(String(e))}}function XT(e,t,n,r){for(var i=[],s=Math.min(e.length,Sb),o=0;s>o&&n.remainingNodes>0;o++)try{var a=o in e?e[o]:void 0;if(ne(a))continue;i.push(_g(a,t,n,r))}catch{i.push({stringValue:cd})}return e.length>o&&i.push({stringValue:tp}),i}function Zb(e,t,n,r){var i=[];for(var s in e)if(YT.call(e,s)){if(i.length>=Sb||0>=n.remainingNodes){t==null||t.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{var o=e[s];if(rt(o)||L(o))continue;i.push({key:qs(s),value:_g(o,t,n,r)})}catch{i.push({key:qs(s),value:{stringValue:cd}})}}return i}function JT(e){try{return qs(String(e))}catch{return cd}}function ZT(e,t,n){var r=Jb[e.level||"info"]||QT,i=r.text,s=r.number,o=String(Date.now())+"000000",a={};t.distinctId&&(a.posthogDistinctId=t.distinctId),t.sessionId&&(a.sessionId=t.sessionId),t.windowId&&(a["window.id"]=t.windowId),ne(t.sessionStartTimestamp)||(a.sessionStartTimestamp=String(t.sessionStartTimestamp)),ne(t.lastActivityTimestamp)||(a.lastActivityTimestamp=String(t.lastActivityTimestamp)),t.currentUrl&&(a["url.full"]=t.currentUrl),t.screenName&&(a["screen.name"]=t.screenName),t.appState&&(a["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(a.feature_flags=t.activeFeatureFlags);var l=$({},a),u=e.attributes;if(u){var c=[];try{c=Object.keys(u)}catch{c=[]}for(var d of c){var f=void 0;try{f=u[d]}catch{f=cd}Object.defineProperty(l,d,{value:f,enumerable:!0,writable:!0,configurable:!0})}}var m={timeUnixNano:o,observedTimeUnixNano:o,severityNumber:s,severityText:i,body:{stringValue:JT(e.body)},attributes:gc(l,n)};return e.trace_id&&(m.traceId=e.trace_id),e.span_id&&(m.spanId=e.span_id),L(e.trace_flags)||(m.flags=e.trace_flags),m}function eE(e,t,n){return $({},e.resourceAttributes,{"service.name":e.serviceName||"unknown_service"},e.environment&&{"deployment.environment":e.environment},e.serviceVersion&&{"service.version":e.serviceVersion},{"telemetry.sdk.name":t,"telemetry.sdk.version":n})}function tE(e,t,n,r){return{resourceLogs:[{resource:{attributes:gc(t)},scopeLogs:[{scope:{name:n,version:r},logRecords:e}]}]}}let eI=class{constructor(e,t,n,r,i,s,o){var a;s===void 0&&(s=()=>Promise.resolve()),this._instance=e,this.qi=t,this.I=n,this.rn=r,this.nn=i,this.sn=s,this.an=o,this.ln=null,this.un=0,this.hn=0,this.dn=0,this.vn=0,this.cn=!1,this.fn=t.maxBufferSize,this.pn=Math.max((a=t.maxQueueSize)!==null&&a!==void 0?a:t.maxBufferSize,t.maxBufferSize),this.gn=t.flushIntervalMs,this.mn=t.maxBatchRecordsPerPost,this.yn=t.rateCapWindowMs,this.bn=t.maxLogsPerInterval}reset(){this._n(),this.ln=null,this.dn=0,this.vn=0,this.cn=!1,this.un=0,this.hn=0,this.mn=this.qi.maxBatchRecordsPerPost}onReconnect(){this.hn=0,this.wn()}captureLog(e){if(!this._instance.isDisabled&&!this._instance.optedOut&&e!=null&&e.body){var t=this.kn(e);if(t!==null)if(t.body){if(this.Sn()){var n={record:ZT(t,this.rn(),this.I)};this.nn(()=>this.xn(n))}}else this.I.info("Log was rejected in beforeSend function")}}kn(e){var t=this.qi.beforeSend;if(!t)return e;var n=Z(t)?t:[t],r=e;for(var i of n)try{var s=i(r);if(!s)return this.I.info("Log was rejected in beforeSend function"),null;r=s}catch(o){return this.I.error("Error in beforeSend function for log:",o),null}return r}Sn(){if(this.bn===void 0)return!0;var e=Date.now(),t=e-this.dn;return this.yn>t&&t>=0||(this.dn=e,this.vn=0,this.cn=!1),this.bn>this.vn?(this.vn++,!0):(this.cn||(this.I.warn("captureLog dropping logs: exceeded "+this.bn+" logs per "+this.yn+"ms"),this.cn=!0),!1)}flush(){var e=this;return Ce(function*(){if(!e._instance.isDisabled)return e.ln||(e.ln=e.Cn().finally(()=>{e.ln=null})),e.ln})()}Cn(){var e=this;return Ce(function*(){var t;e._n();var n=(t=e._instance.getPersistedProperty(nr.LogsQueue))!==null&&t!==void 0?t:[];if(n.length!==0)for(var r=n.length,i=0;n.length>0&&r>i;){var s,o;e.un=0;var a=Math.min(n.length,e.mn),l=n.slice(0,a),u=tE(l.map(d=>d.record),e.Tn(),(s=e.an)!==null&&s!==void 0?s:e._instance.getLibraryId(),e._instance.getLibraryVersion()),c=yield e._instance.Mn(u);if(c.kind==="too-large"&&l.length>1)e.mn=Math.max(1,Math.floor(l.length/2)),e.I.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+e.mn);else if(c.kind==="retry-later"||(c.kind==="too-large"?e.I.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):c.kind==="ok"&&e.qi.maxBatchRecordsPerPost>e.mn&&(e.mn=Math.min(e.qi.maxBatchRecordsPerPost,e.mn+1)),yield e.En(l.length),n=(o=e._instance.getPersistedProperty(nr.LogsQueue))!==null&&o!==void 0?o:[],i+=l.length,c.kind==="fatal"))throw c.error}})()}En(e){var t=this;return Ce(function*(){var n,r=Math.max(0,e-t.un),i=(n=t._instance.getPersistedProperty(nr.LogsQueue))!==null&&n!==void 0?n:[];t._instance.setPersistedProperty(nr.LogsQueue,i.slice(r)),yield t.sn()})()}Tn(){return eE(this.qi,this._instance.getLibraryId(),this._instance.getLibraryVersion())}xn(e){var t;if(!this._instance.optedOut){var n=(t=this._instance.getPersistedProperty(nr.LogsQueue))!==null&&t!==void 0?t:[];this.pn>n.length||(n.shift(),this.un++,this.I.info("Logs queue is full, dropping oldest record.")),n.push(e),this._instance.setPersistedProperty(nr.LogsQueue,n),this.fn>n.length?this.In():this.wn()}}In(e){e===void 0&&(e=this.gn),this.Rn||(this.Rn=yg(()=>{this.Rn=void 0,this.wn()},e))}Pn(){var e=Math.min(Math.max(0,this.hn-1),6);return this.gn*Math.pow(2,e)}An(){var e=this._instance.getPersistedProperty(nr.LogsQueue);return!!e&&e.length>0}shutdown(e){var t=this;return Ce(function*(){t._n();var n=t.flush().catch(()=>{});e!==void 0?yield By(n,e):yield n})()}flushWithTimeout(e){var t=this;return Ce(function*(){var n=t.flush();yield By(n,e,()=>{n.catch(()=>{})})})()}wn(){this.flush().then(()=>{this.hn=0},e=>{this.hn++,this.I.error("PostHog logs flush failed:",e)}).finally(()=>{!this._instance.isDisabled&&this.An()&&this.In(this.Pn())})}_n(){this.Rn&&(clearTimeout(this.Rn),this.Rn=void 0)}};var cf=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function Wy(e){return String(e)+"000000"}function Hy(e,t,n,r){var i="";return r&&(i=Object.keys(r).sort().map(s=>JSON.stringify(s)+":"+JSON.stringify(r[s])).join(",")),e+"\0"+t+"\0"+(n??"")+"\0"+i}let tI=class{constructor(e,t,n){this._instance=e,this.qi=t,this.I=n,this.Fn=new Map,this.ln=null,this.On=!1,this.Ln=new Map,this.$n=new Set,this.Dn=0}count(e,t,n){t===void 0&&(t=1),this.Nn({name:e,type:"count",value:t,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}gauge(e,t,n){this.Nn({name:e,type:"gauge",value:t,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}histogram(e,t,n){this.Nn({name:e,type:"histogram",value:t,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}flush(){var e=this,t=this.ln,n=function(){var i=Ce(function*(){t&&(yield t.catch(()=>{})),yield e.qn()});return function(){return i.apply(this,arguments)}}(),r=n().finally(()=>{this.ln===r&&(this.ln=null)});return this.ln=r,r}drainWindow(){if(this.Fn.size===0)return null;var e=this.Fn;return this.Fn=new Map,this.On=!1,this.Ln=new Map,this.$n=new Set,this.jn(e)}reset(){this.Dn++,this._n(),this.Fn=new Map,this.ln=null,this.On=!1,this.Ln=new Map,this.$n=new Set}Nn(e){if(!this._instance.isDisabled&&!this._instance.optedOut){var t=this.kn(e);if(t!==null)if(t.name&&typeof t.name=="string")if(typeof t.value=="number"&&Number.isFinite(t.value))if(t.type==="count"&&0>t.value)this.I.warn("Dropping count '"+t.name+"': counters are monotonic, value must be >= 0");else{var n,r;try{n=t.attributes?$({},t.attributes):void 0,r=Hy(t.type,t.name,t.unit,n)}catch(o){return void this.I.warn("Dropping metric '"+t.name+"': attributes could not be serialized",o)}var i=this.Fn.get(r);if(!i){if(!this.Bn())return;i={name:t.name,type:t.type,unit:t.unit,attributes:n,windowStartMs:Date.now()},this.Fn.set(r,i)}var s=this.Ln.get(t.name);s===void 0?this.Ln.set(t.name,t.type):s===t.type||this.$n.has(t.name)||(this.$n.add(t.name),this.I.warn("Metric name '"+t.name+"' is already used as a "+s+"; recording it as a "+t.type+" too will blend both series in charts. Use a distinct name.")),this.Hn(i,t.value),this.In()}else this.I.warn("Dropping metric '"+t.name+"': value must be a finite number");else this.I.warn("Dropping metric with empty name")}}Bn(){return this.qi.maxSeriesPerFlush>this.Fn.size||(this.On||(this.On=!0,this.I.warn("Metric series cap reached ("+this.qi.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Hn(e,t){var n;switch(e.type){case"count":e.total=((n=e.total)!==null&&n!==void 0?n:0)+t;break;case"gauge":e.last=t;break;case"histogram":e.hist||(e.hist={count:0,sum:0,min:t,max:t,bucketCounts:new Array(cf.length+1).fill(0)});var r=e.hist;r.count+=1,r.sum+=t,r.min=Math.min(r.min,t),r.max=Math.max(r.max,t),r.bucketCounts[function(i,s){for(var o=0;s.length>o;o++)if(s[o]>=i)return o;return s.length}(t,cf)]+=1}}kn(e){var t=this.qi.beforeSend;if(!t)return e;var n=Z(t)?t:[t],r=e;for(var i of n)try{var s=i(r);if(!s)return this.I.info("Metric was rejected in beforeSend function"),null;r=s}catch(o){return this.I.error("Error in beforeSend function for metric:",o),null}return r}In(){this.Rn||(this.Rn=yg(()=>{this.Rn=void 0,this.flush().catch(e=>{this.I.error("Metrics flush failed:",e)})},this.qi.flushIntervalMs))}_n(){this.Rn&&(clearTimeout(this.Rn),this.Rn=void 0)}qn(){var e=this;return Ce(function*(){if(e.Fn.size!==0){var t=e.Fn;e.Fn=new Map,e.On=!1,e.Ln=new Map,e.$n=new Set;var n=e.Dn,r=yield e._instance.Un(e.jn(t));if(n===e.Dn)switch(r.kind){case"ok":return;case"retry-later":return e.zn(t),void e.In();case"too-large":return void e.I.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void e.I.error("Failed to send metrics batch:",r.error)}}})()}jn(e){return t=this.Wn(e),n=function(s,o,a){return $({},s.resourceAttributes,{"service.name":s.serviceName||"unknown_service"},s.environment&&{"deployment.environment":s.environment},s.serviceVersion&&{"service.version":s.serviceVersion},{"telemetry.sdk.name":o,"telemetry.sdk.version":a})}(this.qi,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),i=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:gc(n)},scopeMetrics:[{scope:{name:r,version:i},metrics:t}]}]};var t,n,r,i}Wn(e){var t=Wy(Date.now()),n=new Map;for(var r of e.values()){var i,s=Hy(r.type,r.name,r.unit,void 0),o=n.get(s);o||(o=$({name:r.name},r.unit&&{unit:r.unit}),r.type==="count"?o.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:r.type==="gauge"?o.gauge={dataPoints:[]}:o.histogram={aggregationTemporality:1,dataPoints:[]},n.set(s,o));var a=gc((i=r.attributes)!==null&&i!==void 0?i:{},this.I),l=Wy(r.windowStartMs);if(r.type==="count"){var u,c={attributes:a,startTimeUnixNano:l,timeUnixNano:t,asDouble:(u=r.total)!==null&&u!==void 0?u:0};o.sum.dataPoints.push(c)}else if(r.type==="gauge"){var d,f={attributes:a,timeUnixNano:t,asDouble:(d=r.last)!==null&&d!==void 0?d:0};o.gauge.dataPoints.push(f)}else r.hist&&o.histogram.dataPoints.push({attributes:a,startTimeUnixNano:l,timeUnixNano:t,count:r.hist.count,sum:r.hist.sum,min:r.hist.min,max:r.hist.max,bucketCounts:r.hist.bucketCounts,explicitBounds:cf})}return Array.from(n.values())}zn(e){var t,n;for(var r of e){var i=r[0],s=r[1],o=this.Fn.get(i);if(o)switch(o.windowStartMs=Math.min(o.windowStartMs,s.windowStartMs),o.type){case"count":o.total=((t=o.total)!==null&&t!==void 0?t:0)+((n=s.total)!==null&&n!==void 0?n:0);break;case"gauge":break;case"histogram":if(s.hist)if(o.hist){o.hist.count+=s.hist.count,o.hist.sum+=s.hist.sum,o.hist.min=Math.min(o.hist.min,s.hist.min),o.hist.max=Math.max(o.hist.max,s.hist.max);for(var a=0;o.hist.bucketCounts.length>a;a++)o.hist.bucketCounts[a]+=s.hist.bucketCounts[a]}else o.hist=s.hist}else this.Bn()&&this.Fn.set(i,s)}}};var Kl,Gy,df;function nI(e){var t=globalThis._posthogChunkIds;if(t){var n=Object.keys(t);return df&&n.length===Gy||(Gy=n.length,df=n.reduce((r,i)=>{Kl||(Kl={});var s=Kl[i];if(s)r[s[0]]=s[1];else for(var o=e(i),a=o.length-1;a>=0;a--){var l=o[a],u=l==null?void 0:l.filename,c=t[i];if(u&&c){r[u]=c,Kl[i]=[u,c];break}}return r},{})),df}}class rI{constructor(t,n,r){r===void 0&&(r=[]),this.coercers=t,this.stackParser=n,this.modifiers=r}buildFromUnknown(t,n){n===void 0&&(n={});var r=n&&n.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,n,0).apply(t),s=this.buildParsingContext(n),o=this.parseStacktrace(i,s);return{$exception_list:this.convertToExceptionList(o,r),$exception_level:"error"}}modifyFrames(t){var n=this;return Ce(function*(){for(var r of t)r.stacktrace&&r.stacktrace.frames&&Z(r.stacktrace.frames)&&(r.stacktrace.frames=yield n.applyModifiers(r.stacktrace.frames));return t})()}coerceFallback(t){var n;return{type:"Error",value:"Unknown error",stack:(n=t.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(t,n){var r,i;return t.cause!=null&&(r=this.parseStacktrace(t.cause,n)),t.stack!=""&&t.stack!=null&&(i=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?n.skipFirstLines:0),n.chunkIdMap)),$({},t,{cause:r,stack:i})}applyChunkIds(t,n){return t.map(r=>(r.filename&&n&&(r.chunk_id=n[r.filename]),r))}applyCoercers(t,n){for(var r of this.coercers)if(r.match(t))return r.coerce(t,n);return this.coerceFallback(n)}applyModifiers(t){var n=this;return Ce(function*(){var r=t;for(var i of n.modifiers)r=yield i(r);return r})()}convertToExceptionList(t,n){var r,i,s,o={type:t.type,value:t.value,mechanism:{type:(r=n.type)!==null&&r!==void 0?r:"generic",handled:(i=n.handled)===null||i===void 0||i,synthetic:(s=t.synthetic)!==null&&s!==void 0&&s}};t.stack&&(o.stacktrace={type:"raw",frames:t.stack});var a=[o];return t.cause!=null&&a.push(...this.convertToExceptionList(t.cause,$({},n,{handled:!0}))),a}buildParsingContext(t){var n;return{chunkIdMap:nI(this.stackParser),skipFirstLines:(n=t.skipFirstLines)!==null&&n!==void 0?n:1}}buildCoercingContext(t,n,r){r===void 0&&(r=0);var i=(s,o)=>{if(4>=o){var a=this.buildCoercingContext(t,n,o);return this.applyCoercers(s,a)}};return $({},n,{syntheticException:r==0?n.syntheticException:void 0,mechanism:t,apply:s=>i(s,r),next:s=>i(s,r+1)})}}var bo="?";function ap(e,t,n,r,i){var s={platform:e,filename:t,function:n===""?bo:n,in_app:!(t!=null&&t.startsWith("webkit-masked-url://"))&&t!==""};return L(r)||(s.lineno=r),L(i)||(s.colno=i),s}var nE=(e,t)=>{var n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:bo,n?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},iI=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,sI=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,oI=/\((\S*)(?::(\d+))(?::(\d+))\)/,aI=(e,t)=>{var n=iI.exec(e);if(n)return ap(t,n[1],bo,+n[2],+n[3]);var r=sI.exec(e);if(r){if(r[2]&&r[2].indexOf("eval")===0){var i=oI.exec(r[2]);i&&(r[2]=i[1],r[3]=i[2],r[4]=i[3])}var s=nE(r[1]||bo,r[2]);return ap(t,s[1],s[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},lI=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,uI=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,cI=(e,t)=>{var n=lI.exec(e);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=uI.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var i=n[3],s=n[1]||bo,o=nE(s,i);return ap(t,i=o[1],s=o[0],n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},Ky=/\(error: (.*)\)/;class dI{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,n){var r=ce(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:r?t.stack:void 0,cause:t.cause?n.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var n=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?n+": "+t.message:n}isDOMException(t){return dc(t,"DOMException")}isDOMError(t){return dc(t,"DOMError")}}class fI{match(t){return Tb(t)}coerce(t,n){var r,i=this.getStack(t),s=i===void 0;return{type:this.getType(t),value:this.getMessage(t,n),stack:i??((r=n.syntheticException)==null?void 0:r.stack),cause:t.cause?n.next(t.cause):void 0,synthetic:s}}getType(t){return t.name||t.constructor.name}getMessage(t,n){var r=t.message;return String(r.error&&typeof r.error.message=="string"?r.error.message:r)}getStack(t){return t.stacktrace||t.stack||void 0}}class hI{constructor(){}match(t){return!!dc(t,"ErrorEvent")&&(t.error!=null||this.fi(t))}coerce(t,n){var r;if(t.error!=null)return n.apply(t.error);var i=n.apply(t.message);return $({},i,{stack:(r=this.pi(t))!==null&&r!==void 0?r:i.stack,synthetic:!0})}fi(t){return ce(t.message)&&t.message.length>0}pi(t){var n,r,i=t,s=(n=i.lineno)!==null&&n!==void 0?n:0,o=(r=i.colno)!==null&&r!==void 0?r:0;if(ce(i.filename)&&i.filename.length!==0&&s!==0)return`Error - at `+i.filename+":"+s+":"+o}}var pI=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class vI{match(t){return typeof t=="string"}coerce(t,n){var r,i=this.getInfos(t),s=i[0],o=i[1];return{type:s??"Error",value:o??t,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(t){var n="Error",r=t,i=t.match(pI);return i&&(n=i[1],r=i[2]),[n,r]}}var gI=["fatal","error","warning","log","info","debug"];function rE(e,t){t===void 0&&(t=40);var n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(", ");if(t>=i.length)return r===n.length?i:i.length>t?i.slice(0,t)+"...":i}return""}class mI{match(t){return typeof t=="object"&&t!==null}coerce(t,n){var r,i,s=this.getErrorPropertyFromObject(t);return s?n.apply(s):{type:this.getType(t),value:this.getValue(t),stack:(r=this.getStack(t))!==null&&r!==void 0?r:(i=n.syntheticException)==null?void 0:i.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){if(hg(t))return t.constructor.name;var n="name"in t?t.name:void 0;return ce(n)&&!cc(n)?n:"Error"}getValue(t){if("name"in t&&typeof t.name=="string"){var n="'"+t.name+"' captured as exception";return"message"in t&&typeof t.message=="string"&&(n+=" with message: '"+t.message+"'"),n}if("message"in t&&typeof t.message=="string")return t.message;var r=this.getObjectClassName(t);return(r&&r!=="Object"?"'"+r+"'":"Object")+" captured as exception with keys: "+rE(t)}isSeverityLevel(t){return ce(t)&&!cc(t)&&gI.indexOf(t)>=0}getStack(t){try{return ce(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:ce(t.stack)&&t.stack.length>0?t.stack:void 0}catch{return}}getErrorPropertyFromObject(t){for(var n in t)if({}.hasOwnProperty.call(t,n)){var r=t[n];if(Tb(r))return r}}getObjectClassName(t){try{var n=Object.getPrototypeOf(t);return n?n.constructor.name:void 0}catch{return}}}class yI{match(t){return hg(t)}coerce(t,n){var r,i=t.constructor.name;return{type:i,value:i+" captured as exception with keys: "+rE(t),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class _I{match(t){return Rb(t)}coerce(t,n){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class wI{match(t){return dc(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!hg(t))return!1;try{var n=t.detail;return n!=null&&typeof n=="object"&&"reason"in n}catch{return!1}}coerce(t,n){var r,i=this.getUnhandledRejectionReason(t);return Rb(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}:n.apply(i)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&t.detail!=null&&typeof t.detail=="object"&&"reason"in t.detail)return t.detail.reason}catch{}return t}}var mc="$message",yc="$timestamp",xI=new Set([mc,yc]),ff={enabled:!0,max_bytes:32768};function _c(e){var t;return e?{enabled:(t=e.enabled)!==null&&t!==void 0?t:ff.enabled,max_bytes:EI(e.max_bytes,ff.max_bytes)}:$({},ff)}class bI{constructor(t){this.Vn=[],this.Gn=0,this.qi=_c(t)}setConfig(t){this.qi=_c(t),this.Zn()}add(t){var n=function(i){var s;try{s=Cb(i)}catch{return}try{var o=JSON.parse(s);if(!Se(o))return;var a=o,l=a[mc],u=a[yc];return!ce(l)||l.trim().length===0||!ce(u)&&!Ge(u)?void 0:{step:a,json:s}}catch{return}}(t);if(n){var r=function(i){if(typeof TextEncoder<"u")return new TextEncoder().encode(i).length;for(var s=encodeURIComponent(i),o=0,a=0;s.length>a;a++)s[a]==="%"?(o+=1,a+=2):o+=1;return o}(n.json);r>this.qi.max_bytes||(this.Vn.push({step:n.step,bytes:r}),this.Gn+=r,this.Zn())}}getAttachable(){return this.Vn.map(t=>t.step)}clear(){this.Vn=[],this.Gn=0}size(){return this.Vn.length}Zn(){for(;this.Gn>this.qi.max_bytes&&this.Vn.length>0;){var t=this.Vn.shift();t&&(this.Gn-=t.bytes)}}}function EI(e,t){if(!Ge(e)||e===1/0||e===-1/0)return t;var n=Math.floor(e);return 0>n?t:n}var iE=function(e,t){var n=(t===void 0?{}:t).debugEnabled,r={F(i){if(I&&(Ee.DEBUG||I.POSTHOG_DEBUG||n)&&!L(I.console)&&I.console){for(var s=("__rrweb_original__"in I.console[i])?I.console[i].__rrweb_original__:I.console[i],o=arguments.length,a=new Array(o>1?o-1:0),l=1;o>l;l++)a[l-1]=arguments[l];s(e,...a)}},debug(){for(var i=arguments.length,s=new Array(i),o=0;i>o;o++)s[o]=arguments[o];r.F("debug",...s)},info(){for(var i=arguments.length,s=new Array(i),o=0;i>o;o++)s[o]=arguments[o];r.F("log",...s)},warn(){for(var i=arguments.length,s=new Array(i),o=0;i>o;o++)s[o]=arguments[o];r.F("warn",...s)},error(){for(var i=arguments.length,s=new Array(i),o=0;i>o;o++)s[o]=arguments[o];r.F("error",...s)},critical(){for(var i=arguments.length,s=new Array(i),o=0;i>o;o++)s[o]=arguments[o];console.error(e,...s)},uninitializedWarning(i){r.error("You must initialize PostHog before calling "+i)},createLogger:(i,s)=>iE(e+" "+i,s)};return r},D=iE("[PostHog.js]"),Ie=D.createLogger,SI=Ie("[ExternalScriptsLoader]"),wc=e=>{var t=j==null?void 0:j.querySelectorAll("script");if(t){for(var n=0;t.length>n;n++)if(t[n].src===e||t[n].getAttribute("src")===e)return t[n]}},Si=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return SI.warn(t+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=wc(t);if(r){if(r.__posthog_loading_callback_fired)return n();var i=r.__posthog_loading_error;return i?n(i):(r.addEventListener("load",o=>{r.__posthog_loading_callback_fired=!0,n(void 0,o)}),void r.addEventListener("error",o=>{r.__posthog_loading_error=o,n(o)}))}var s=()=>{if(!j)return n("document not found");if(wc(t))return Si(e,t,n);var o=j.createElement("script");if(o.type="text/javascript",o.crossOrigin="anonymous",o.src=t,o.onload=u=>{o.__posthog_loading_callback_fired=!0,n(void 0,u)},o.onerror=u=>{o.__posthog_loading_error=u,n(u)},e.config.prepare_external_dependency_script&&(o=e.config.prepare_external_dependency_script(o)),!o)return n("prepare_external_dependency_script returned null");if(e.config.external_scripts_inject_target==="head")j.head.appendChild(o);else{var a,l=j.querySelectorAll("body > script");l.length>0?(a=l[0].parentNode)==null||a.insertBefore(o,l[0]):j.body.appendChild(o)}};j!=null&&j.body?s():j==null||j.addEventListener("DOMContentLoaded",s)},hf={},Qy=(e,t)=>{var n="/static/"+t+".js?v="+e.version;if(t==="toolbar"){var r=3e5;n=n+"&t="+Math.floor(Date.now()/r)*r}return e.requestRouter.endpointFor("assets",n)};Y.__PosthogExtensions__=Y.__PosthogExtensions__||{},Y.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{if(t!=="remote-config"){var r=e.config.strict_script_versioning;if(r){var i=e.requestRouter.endpointFor("assets","/static/"+e.version+"/"+t+".js"),s=hf[i];if(r==="fallback"&&s){if(wc(s))return void Si(e,s,n);delete hf[i]}Si(e,i,r==="fallback"?(a,l)=>{if(a)if(typeof a=="string")n(a);else{var u,c=Qy(e,t);hf[i]=c;var d=wc(i);d==null||(u=d.parentNode)==null||u.removeChild(d),Si(e,c,n)}else n(void 0,l)}:n)}else Si(e,Qy(e,t),n)}else{var o=e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js");Si(e,o,n)}},Y.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{var r=e.requestRouter.endpointFor("api",t);Si(e,r,n)};Ee.DEBUG=!1,Ee.LIB_VERSION="1.418.16",Ee.LIB_NAME="web";var sE="$people_distinct_id",wt="distinct_id",Ya="$device_id",pf="$device_model",$s="__alias",ca="__timers",lp="$autocapture_disabled_server_side",up="$heatmaps_enabled_server_side",cp="$exception_capture_enabled_server_side",dp="$error_tracking_suppression_rules",fp="$error_tracking_capture_extension_exceptions",hp="$web_vitals_enabled_server_side",wg="$dead_clicks_enabled_server_side",xg="$product_tours_enabled_server_side",pp="$web_vitals_allowed_metrics",Oi="$session_recording_remote_config",oE="$replay_sample_rate",aE="$replay_override_sampling",lE="$replay_override_linked_flag",uE="$replay_override_url_trigger",cE="$replay_override_event_trigger",Fs="$sesid",bg="$session_is_sampled",ir="$enabled_feature_flags",Mi="$active_feature_flags",Pu="$early_access_features",Xa="$feature_flag_details",Ai="$feature_flag_payloads",Gs="$feature_flag_request_id",xc="$minimal_flag_called_events",Mn="$override_feature_flags",Ci="$override_feature_flag_payloads",yn="$stored_person_properties",Dn="$stored_group_properties",dE="$groups",vp="$surveys",bc="$surveys_loaded_at",gp="$surveys_activated",Ru="$surveys_activated_session",Tu="$surveys_activated_timestamps",da="ph_product_tours",ar="$flag_call_reported",fa="$flag_call_reported_session_id",Ks="$feature_flag_errors",Gi="$feature_flag_evaluated_at",se="$user_state",mp="$client_session_props",yp="$capture_rate_limit",_p="$initial_campaign_params",wp="$initial_referrer_info",Ec="$initial_person_info",Sc="$epp",fs="$posthog_cookieless",fE="$cookieless_mode",hE="$sdk_debug_extensions_init_method",pE="$sdk_debug_extensions_init_time_ms",xp="$sdk_debug_recording_script_not_loaded",Eg="PostHog loadExternalDependency extension not found.",ki="on_reject",lr="always",We="anonymous",ot="identified",bp="identified_only",Cc="visibilitychange",kc="beforeunload",xs="$pageview",vf="$pageleave",gf="$identify",Yy="$groupidentify";function Ql(e,t){Z(e)&&e.forEach(t)}function ve(e,t){if(!ne(e))if(Z(e))e.forEach(t);else if(AT(e))e.forEach((r,i)=>t(r,i));else for(var n in e)Pb.call(e,n)&&t(e[n],n)}var _e=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];for(var i of n)for(var s in i)i[s]!==void 0&&(e[s]=i[s]);return e};function Iu(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var Xy=function(e){try{return e()}catch{return}},CI=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,n)}catch(i){D.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),D.critical(i)}}},Sg=function(e){var t={};return ve(e,function(n,r){(ce(n)&&n.length>0||Ge(n))&&(t[r]=n)}),t},kI=["herokuapp.com","vercel.app","netlify.app"];function PI(e){var t=e==null?void 0:e.hostname;if(!ce(t))return!1;var n=t.split(".").slice(-2).join(".");for(var r of kI)if(n===r)return!1;return!0}function Re(e,t,n,r){var i=r??{},s=i.capture,o=i.passive;e==null||e.addEventListener(t,n,{capture:s!==void 0&&s,passive:o===void 0||o})}function Ep(e){return e.name==="ph_toolbar_internal"}var vE=e=>{if(j){try{for(var t=e+"=",n=j.cookie.split(";").filter(s=>s.length),r=0;n.length>r;r++){for(var i=n[r];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(t)===0)return decodeURIComponent(i.substring(t.length,i.length))}}catch{}return null}};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Ge(e)&&isFinite(e)&&Math.floor(e)===e});class Pc{constructor(t){if(this.bytes=t,t.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,n,r,i){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||0>t||0>n||0>r||0>i||t>0xffffffffffff||n>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=t/Math.pow(2,40),s[1]=t/Math.pow(2,32),s[2]=t/Math.pow(2,24),s[3]=t/Math.pow(2,16),s[4]=t/256,s[5]=t,s[6]=112|n>>>8,s[7]=n,s[8]=128|r>>>24,s[9]=r>>>16,s[10]=r>>>8,s[11]=r,s[12]=i>>>24,s[13]=i>>>16,s[14]=i>>>8,s[15]=i,new Pc(s)}toString(){for(var t="",n=0;this.bytes.length>n;n++)t=t+(this.bytes[n]>>>4).toString(16)+(15&this.bytes[n]).toString(16),n!==3&&n!==5&&n!==7&&n!==9||(t+="-");if(t.length!==36)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new Pc(this.bytes.slice(0))}equals(t){return this.compareTo(t)===0}compareTo(t){for(var n=0;16>n;n++){var r=this.bytes[n]-t.bytes[n];if(r!==0)return Math.sign(r)}return 0}}class RI{generate(){var t=this.generateOrAbort();if(!L(t))return t;this.Rr=0;var n=this.generateOrAbort();if(L(n))throw new Error("Could not generate UUID after timestamp reset");return n}generateOrAbort(){var t=Date.now();if(t>this.Rr)this.Rr=t,this.Ar();else{if(this.Rr>=t+1e4)return;this.Lr++,this.Lr>4398046511103&&(this.Rr++,this.Ar())}return Pc.fromFieldsV7(this.Rr,Math.trunc(this.Lr/Math.pow(2,30)),this.Lr&Math.pow(2,30)-1,this.Or.nextUint32())}Ar(){this.Lr=1024*this.Or.nextUint32()+(1023&this.Or.nextUint32())}constructor(){this.Rr=0,this.Lr=0,this.Or=new TI}}var Jy,gE=e=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};I&&!L(I.crypto)&&crypto.getRandomValues&&(gE=e=>crypto.getRandomValues(e));class TI{nextUint32(){return this.ft.length>this.Fr||(gE(this.ft),this.Fr=0),this.ft[this.Fr++]}constructor(){this.ft=new Uint32Array(8),this.Fr=1/0}}var $n=()=>II().toString(),II=()=>(Jy||(Jy=new RI)).generate(),Yo="",OI=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,Ke={Dr:()=>!!j,jr(e){D.error("cookieStore error: "+e)},Pr:vE,Br(e){var t;try{t=JSON.parse(Ke.Pr(e))||{}}catch{}return t},Nr(e,t,n,r,i){if(!j)return!1;try{var s="",o="",a=function(c,d){if(d){var f=function(_,p){if(p===void 0&&(p=j),Yo)return Yo;if(!p||["localhost","127.0.0.1"].includes(_))return"";for(var y=_.split("."),h=Math.min(y.length,8),v="dmn_chk_"+$n();!Yo&&h--;){var x=y.slice(h).join("."),b=v+"=1;domain=."+x+";path=/";p.cookie=b+";max-age=3",p.cookie.includes(v)&&(p.cookie=b+";max-age=0",Yo=x)}return Yo}(c);if(!f){var m=(_=>{var p=_.match(OI);return p?p[0]:""})(c);m!==f&&D.info("Warning: cookie subdomain discovery mismatch",m,f),f=m}return f?"; domain=."+f:""}return""}(j.location.hostname,r);if(n){var l=new Date;l.setTime(l.getTime()+864e5*n),s="; expires="+l.toUTCString()}i&&(o="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&D.warn("cookieStore warning: large cookie, len="+u.length),j.cookie=u,!0}catch{return!1}},qr(e,t){if(j!=null&&j.cookie)try{Ke.Nr(e,"",-1,t)}catch{return}}},mf=null,ge={Dr(){if(!rt(mf))return mf;var e=!0;if(L(I))e=!1;else try{var t="__mplssupport__";ge.Nr(t,"xyz"),ge.Pr(t)!=='"xyz"'&&(e=!1),ge.qr(t)}catch{e=!1}return e||D.error("localStorage unsupported; falling back to cookie store"),mf=e,e},jr(e){D.error("localStorage error: "+e)},Pr(e){try{return I==null?void 0:I.localStorage.getItem(e)}catch(t){ge.jr(t)}return null},Br(e){try{return JSON.parse(ge.Pr(e))||{}}catch{}return null},Nr(e,t){try{return I==null||I.localStorage.setItem(e,JSON.stringify(t)),!0}catch(n){ge.jr(n)}return!1},qr(e){try{I==null||I.localStorage.removeItem(e)}catch(t){ge.jr(t)}}},yf=[yn,Mi,ir,Xa,Ai,Gs,Gi,Ks,ar],Pi=[Ya,wt,Fs,bg,Sc,Ec,se],Rc=e=>e+"_cpm",MI=["__proto__","constructor","prototype"],_f=e=>{if(!Se(e))return{};var t={};return Object.keys(e).forEach(n=>{MI.indexOf(n)===-1&&(t[n]=e[n])}),t},wf=function(e,t){t===void 0&&(t=[]);var n={};return[...Pi,...t].forEach(r=>{var i=e[r];L(i)||rt(i)||i===""||(n[r]=i)}),n},mE=e=>{for(var t=5381,n=2166136261,r=0;e.length>r;r++){var i=e.charCodeAt(r);t=33*t^i,n=Math.imul(n^i,16777619)}return e.length.toString(36)+"."+(t>>>0).toString(36)+"."+(n>>>0).toString(36)},Zy=(e,t)=>({p:t,f:mE(JSON.stringify(e))}),e_=(e,t)=>{if(!t)return{properties:[],isValid:!1};try{var n=Ke.Br(Rc(e)),r=(n==null?void 0:n.f)===mE(t)&&Z(n.p);return{properties:r?n.p:[],isValid:r}}catch{return{properties:[],isValid:!1}}},xf=(e,t)=>t+"|"+(Ke.Pr(Rc(e))||""),Yl={},AI={Dr:()=>!0,jr(e){D.error("memoryStorage error: "+e)},Pr:e=>Yl[e]||null,Br:e=>Yl[e]||null,Nr:(e,t)=>(Yl[e]=t,!0),qr(e){delete Yl[e]}},mi=null,we={Dr(){if(!rt(mi))return mi;if(mi=!0,L(I))mi=!1;else try{var e="__support__";we.Nr(e,"xyz"),we.Pr(e)!=='"xyz"'&&(mi=!1),we.qr(e)}catch{mi=!1}return mi},jr(e){D.error("sessionStorage error: ",e)},Pr(e){try{return I==null?void 0:I.sessionStorage.getItem(e)}catch(t){we.jr(t)}return null},Br(e){try{return JSON.parse(we.Pr(e))||null}catch{}return null},Nr(e,t){try{return I==null||I.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(n){we.jr(n)}return!1},qr(e){try{I==null||I.sessionStorage.removeItem(e)}catch(t){we.jr(t)}}};class NI{constructor(t){this._instance=t}get qi(){return this._instance.config}get consent(){return this.cs()?0:this.fs}isOptedOut(){return this.qi.cookieless_mode===lr||this.isRejected()||this.consent===-1&&this.qi.cookieless_mode===ki}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.qi.opt_out_capturing_by_default}optInOut(t){this.ps.Nr(this.gs,t?1:0,this.qi.cookie_expiration,this.qi.cross_subdomain_cookie,this.qi.secure_cookie)}reset(){this.ps.qr(this.gs,this.qi.cross_subdomain_cookie)}get gs(){var t=this._instance.config,n=t.token,r=t.opt_out_capturing_cookie_prefix;return t.consent_persistence_name||(r?r+n:"__ph_opt_in_out_"+n)}get fs(){var t=this.ps.Pr(this.gs);return lf(t)?1:J(LT,t)?0:-1}get ps(){var t=this.qi.opt_out_capturing_persistence_type,n=t==="localStorage"?ge:Ke;if(!this.ys||this.ys!==n){this.ys=n;var r=t==="localStorage"?Ke:ge;r.Pr(this.gs)&&(this.ys.Pr(this.gs)||this.optInOut(lf(r.Pr(this.gs))),r.qr(this.gs,this.qi.cross_subdomain_cookie))}return this.ys}cs(){return!!this.qi.respect_dnt&&[St==null?void 0:St.doNotTrack,St==null?void 0:St.msDoNotTrack,Y.doNotTrack].some(t=>lf(t))}}function yE(e,t){var n,r=e==null||(n=e.config)==null?void 0:n.get_current_url;if(!vt(r))return t;try{var i=r(t);return ce(i)&&i?i:t}catch(s){return D.error("Error in get_current_url, falling back to window.location.href",s),t}}var _E="__POSTHOG_TOOLBAR__",$I=1,FI=3,LI=11;function t_(e){return e instanceof Element&&(e.id===_E||!(e.closest==null||!e.closest(".toolbar-global-fade-container")))}function ui(e){return!!e&&e.nodeType===$I}function Kt(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function wE(e){return!!e&&e.nodeType===FI}function xE(e){return!!e&&e.nodeType===LI&&ui(e.host)}var bE=1e3;function Cg(e){return e?dd(e).split(/\s+/):[]}function n_(e,t){var n=function(r){var i,s=I==null||(i=I.location)==null?void 0:i.href;return L(s)?void 0:yE(r,s)}(t);return!!(n&&e&&e.some(r=>n.match(r)))}function Tc(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return Cg(t)}function EE(e){return ne(e)?null:dd(e).split(/(\s+)/).filter(t=>ka(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Ja(e){var t="";return kp(e)&&!RE(e)&&e.childNodes&&e.childNodes.length&&ve(e.childNodes,function(n){var r;wE(n)&&n.textContent&&(t+=(r=EE(n.textContent))!==null&&r!==void 0?r:"")}),dd(t)}function Sp(e){var t;return L(e.target)?e.srcElement||null:(t=e.target)!=null&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var kg=["a","button","form","input","select","textarea","label"];function Cp(e,t){if(L(t))return!0;var n,r=function(s){if(t.some(o=>function(a,l){var u=a.matches||a.matchesSelector||a.msMatchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.oMatchesSelector;try{return!!u&&u.call(a,l)}catch{return!1}}(s,o)))return{v:!0}};for(var i of e)if(n=r(i))return n.v;return!1}function SE(e){var t=e.parentNode;return!(!t||!ui(t))&&t}var jI=[".ph-no-autocapture","[data-ph-no-autocapture]"],CE=["next","previous","prev",">","<"],DI=[...CE,"+","-","−","–"],r_=(e,t)=>/[a-z0-9]/i.test(t)?e.includes(t):e===t,i_=[".ph-no-rageclick",".ph-no-capture"],zI=["","text","search","email","password","url","tel","number"];function kE(e,t){if(!I||Pg(e))return!1;var n,r,i,s,o;if($t(t)?(n=!!t&&i_,r=void 0,i=!1):(n=(s=t==null?void 0:t.css_selector_ignorelist)!==null&&s!==void 0?s:i_,r=t==null?void 0:t.content_ignorelist,i=(o=t==null?void 0:t.ignore_text_selection)!==null&&o!==void 0&&o),n===!1||i&&function(l){return!(!l||!ui(l))&&(!!Kt(l,"textarea")||(Kt(l,"input")?J(zI,(l.getAttribute("type")||"").toLowerCase()):function(u){if(u.isContentEditable)return!0;var c=u.getAttribute==null?void 0:u.getAttribute("contenteditable");return c==="true"||c===""}(l)))}(e))return!1;var a=PE(e,!1).targetElementList;return!function(l,u){if(l===!1||L(l))return!1;var c;if(l===!0)c=CE;else{if(!Z(l))return!1;if(l.length>10)return D.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;c=l.map(d=>d.toLowerCase())}return u.some(d=>{var f=d.safeText,m=d.ariaLabel;return c.some(_=>r_(f,_)||r_(m,_))})}(r,a.map(l=>{var u;return{safeText:Ja(l).toLowerCase(),ariaLabel:((u=l.getAttribute("aria-label"))==null?void 0:u.toLowerCase().trim())||""}}))&&!Cp(a,n)}var Pg=e=>!e||Kt(e,"html")||!ui(e),PE=(e,t)=>{if(!I||Pg(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[e],i=e;i.parentNode&&!Kt(i,"body");)if(xE(i.parentNode))r.push(i.parentNode.host),i=i.parentNode.host;else{var s=SE(i);if(!s)break;if(t||kg.indexOf(s.tagName.toLowerCase())>-1)n=!0;else try{var o=I.getComputedStyle(s);o&&o.getPropertyValue("cursor")==="pointer"&&(n=!0)}catch{}r.push(s),i=s}return{parentIsUsefulElement:n,targetElementList:r}};function kp(e){for(var t=new Set,n=0,r=e;r.parentNode&&!Kt(r,"body");r=r.parentNode){if(n++>=bE||t.has(r))return!1;t.add(r);var i=Tc(r);if(J(i,"ph-sensitive")||J(i,"ph-no-capture"))return!1}if(J(Tc(e),"ph-include"))return!0;var s=e.type||"";if(ce(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var o=e.name||e.id||"";return!ce(o)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,""))}function RE(e){return!!(Kt(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Kt(e,"select")||Kt(e,"textarea")||e.getAttribute("contenteditable")==="true")}var s_=new RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),o_=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,UI=[16,15,14,13],VI=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),a_=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),l_=/[0-9A-Za-z_]/;function BI(e){for(var t=0,n=!1,r=e.length-1;r>=0;r--){var i=e.charCodeAt(r)-48;n&&(i*=2)>9&&(i-=9),t+=i,n=!n}return t%10==0}function ka(e,t){if(t===void 0&&(t=!0),ne(e))return!1;if(ce(e)){e=dd(e);var n=t?s_.test((e||"").replace(/[- ]/g,"")):function(i){var s;for(o_.lastIndex=0;s=o_.exec(i);){var o=s[2];if(o)for(var a=o.replace(/[- ]/g,""),l=0;a.length>l;l++)for(var u of UI){var c=l+u;if(a.length>=c){var d=a.slice(l,c);if(s_.test(d)&&BI(d))return!0}}}return!1}(e);if(n)return!1;var r=t?VI.test(e):function(i){var s;for(a_.lastIndex=0;s=a_.exec(i);){var o=s[1],a=s[3];if(!(o&&a&&l_.test(o)&&l_.test(a)))return!0}return!1}(e);if(r)return!1}return!0}function u_(e){var t=Ja(e);return ka(t=(t+" "+TE(e)).trim())?t:""}function TE(e){var t="";return e&&e.childNodes&&e.childNodes.length&&ve(e.childNodes,function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var i=Ja(n);t=(t+" "+i).trim(),n.childNodes&&n.childNodes.length&&(t=(t+" "+TE(n)).trim())}catch(s){D.error("[AutoCapture]",s)}}),t}function c_(e){return e.replace(/"|\\"/g,'\\"')}function qI(e){var t=e.attr__class;if(t)return Z(t)?t:Cg(t)}var Xl=Ie("[Dead Clicks]"),WI=()=>!0,HI=e=>{var t,n=!((t=e.instance.persistence)==null||!t.get_property(wg)),r=e.instance.config.capture_dead_clicks;return $t(r)?r:!!Se(r)||n};class d_{get lazyLoadedDeadClicksAutocapture(){return this.bs}constructor(t,n,r){this.instance=t,this.isEnabled=n,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(t){if(t.ok){var n=t.config;"captureDeadClicks"in n&&(this.instance.persistence&&this.instance.persistence.register({[wg]:n.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this._s(()=>{this.ws()}):this.stop()}_s(t){var n,r;(n=Y.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture?t():(r=Y.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",i=>{i?Xl.error("failed to load script",i):t()})}ws(){var t;if(j){if(!this.bs&&(t=Y.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture){var n=Se(this.instance.config.capture_dead_clicks)?$({},this.instance.config.capture_dead_clicks):{};n.__onCapture=this.onCapture,this.onCapture&&(n.capture_dead_swipes=!1),this.bs=Y.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.bs.start(j),Xl.info("starting...")}}else Xl.error("`document` not found. Cannot start.")}stop(){this.bs&&(this.bs.stop(),this.bs=void 0,Xl.info("stopping..."))}}var bf=Ie("[SegmentIntegration]"),IE="posthog-js";function OE(e,t){var n=t===void 0?{}:t,r=n.organization,i=n.projectId,s=n.prefix,o=n.severityAllowList,a=o===void 0?["error"]:o,l=n.sendExceptionsToPostHog,u=l===void 0||l;return c=>{var d,f,m,_,p;if(a!=="*"&&!a.includes(c.level)||!e.__loaded)return c;c.tags||(c.tags={});var y=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());c.tags["PostHog Person URL"]=y,e.sessionRecordingStarted()&&(c.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var h,v=((d=c.exception)==null?void 0:d.values)||[],x=v.map(E=>$({},E,{stacktrace:E.stacktrace?$({},E.stacktrace,{type:"raw",frames:(E.stacktrace.frames||[]).map(S=>$({},S,{platform:"web:javascript"}))}):void 0})),b={$exception_message:((f=v[0])==null?void 0:f.value)||c.message,$exception_type:(m=v[0])==null?void 0:m.type,$exception_level:c.level,$exception_list:x,$sentry_event_id:c.event_id,$sentry_exception:c.exception,$sentry_exception_message:((_=v[0])==null?void 0:_.value)||c.message,$sentry_exception_type:(p=v[0])==null?void 0:p.type,$sentry_tags:c.tags};return r&&i&&(b.$sentry_url=(s||"https://sentry.io/organizations/")+r+"/issues/?project="+i+"&query="+c.event_id),u&&((h=e.exceptions)==null||h.sendExceptionEvent(b)),c}}class GI{constructor(t,n,r,i,s,o){this.name=IE,this.setupOnce=function(a){a(OE(t,{organization:n,projectId:r,prefix:i,severityAllowList:s,sendExceptionsToPostHog:o==null||o}))}}}class f_{constructor(t){this.ks=(n,r,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(D.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:n,changeReason:i}),this.Ss=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.xs()}xs(){var t;this.Cs=(t=this._instance.sessionManager)==null?void 0:t.onSessionId(this.ks)}destroy(){var t;(t=this.Cs)==null||t.call(this),this.Cs=void 0}doPageView(t,n){var r,i=this.Ts(t,n);return this.Ss={pathname:(r=I==null?void 0:I.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:t},this._instance.scrollManager.resetContext(),i}doPageLeave(t){var n;return this.Ts(t,(n=this.Ss)==null?void 0:n.pageViewId)}doEvent(){var t;return{$pageview_id:(t=this.Ss)==null?void 0:t.pageViewId}}Ts(t,n){var r=this.Ss;if(!r)return{$pageview_id:n};var i={$pageview_id:n,$prev_pageview_id:r.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var o=s.maxScrollHeight,a=s.lastScrollY,l=s.maxScrollY,u=s.maxContentHeight,c=s.lastContentY,d=s.maxContentY;if(!(L(o)||L(a)||L(l)||L(u)||L(c)||L(d))){o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),c=Math.ceil(c),d=Math.ceil(d);var f=o>1?Vn(a/o,0,1,D):1,m=o>1?Vn(l/o,0,1,D):1,_=u>1?Vn(c/u,0,1,D):1,p=u>1?Vn(d/u,0,1,D):1;i=_e(i,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:f,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:m,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:_,$prev_pageview_max_content:d,$prev_pageview_max_content_percentage:p})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(t.getTime()-r.timestamp.getTime())/1e3),i}}var Ef=["flags","surveys"],KI={[sE]:{exposure:"hidden"},[$s]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[ca]:{exposure:"hidden"},[lp]:{exposure:"event"},[up]:{exposure:"hidden"},[cp]:{exposure:"event"},[dp]:{exposure:"hidden"},[fp]:{exposure:"event"},[hp]:{exposure:"event"},[wg]:{exposure:"event"},[xg]:{exposure:"hidden"},[pp]:{exposure:"event"},[Oi]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[Fs]:{exposure:"hidden"},[bg]:{exposure:"event"},[oE]:{exposure:"event",shouldSkipFromEventProperties:e=>rt(e)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[ir]:{exposure:"hidden",storageGroup:"flags"},[Mi]:{exposure:"hidden",storageGroup:"flags"},[Pu]:{exposure:"hidden"},[Xa]:{exposure:"hidden",storageGroup:"flags"},[Ai]:{exposure:"hidden",storageGroup:"flags"},[Gs]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[xc]:{exposure:"hidden",storageGroup:"flags"},[Mn]:{exposure:"hidden"},[Ci]:{exposure:"hidden"},[yn]:{exposure:"hidden"},[Dn]:{exposure:"hidden"},[vp]:{exposure:"hidden",storageGroup:"surveys"},[bc]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[gp]:{exposure:"event"},[Ru]:{exposure:"hidden"},[Tu]:{exposure:"hidden"},[da]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[ar]:{exposure:"hidden"},[fa]:{exposure:"hidden"},[dE]:{exposure:"event"},[Ks]:{exposure:"hidden"},[Gi]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[se]:{exposure:"hidden"},[mp]:{exposure:"hidden"},[yp]:{exposure:"hidden"},[_p]:{exposure:"hidden"},[wp]:{exposure:"hidden"},[Ec]:{exposure:"hidden"},[Sc]:{exposure:"hidden"},[aE]:{exposure:"event"},[lE]:{exposure:"event"},[uE]:{exposure:"event"},[cE]:{exposure:"event"},[hE]:{exposure:"event"},[pE]:{exposure:"event"},[xp]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_pending_trigger_conditions:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},QI=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],An=e=>{var t=KI[e];if(t)return t;for(var n of QI){var r=n[1];if(e.indexOf(n[0])===0)return r}},Ls=(e,t)=>{try{return JSON.stringify(e,(n,r)=>typeof r=="bigint"?r.toString():r,t)}catch{return Cb(e)}},Eo=e=>{var t=j==null?void 0:j.createElement("a");return L(t)?null:(t.href=e,t)},So=function(e,t){for(var n,r=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),i=0;r.length>i;i++){var s=r[i].split("=");if(s[0]===t){n=s;break}}if(!Z(n)||2>n.length)return"";var o=n[1];try{o=decodeURIComponent(o)}catch{D.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Za=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split("#"),i=r[1],s=(r[0]||"").split("?"),o=s[1],a=s[0],l=(o||"").split("&"),u=[],c=0;l.length>c;c++){var d=l[c].split("=");Z(d)&&(t.includes(d[0])?u.push(d[0]+"="+n):u.push(l[c]))}var f=a;return o!=null&&(f+="?"+u.join("&")),i!=null&&(f+="#"+i),f},Ic=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},ME=(e,t)=>e>=t&&xb(),AE=(e,t,n,r)=>{if(e===0){if(xb()){var i=t+1;return i===n&&r(),i}return t}return 0},Jl="https?://(.*)",Co=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],YI=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Co],el="",XI=["li_fat_id"];function NE(e,t,n){if(!j)return{};var r,i=t?[...Co,...n||[]]:[],s=$E(Za(j.URL,i,el),e),o=(r={},ve(XI,function(a){var l=vE(a);r[a]=l||null}),r);return _e(o,s)}function $E(e,t){var n=YI.concat(t||[]),r={};return ve(n,function(i){var s=So(e,i);r[i]=s||null}),r}function FE(e){var t=function(s){return s?s.search(Jl+"google.([^/?]*)")===0?"google":s.search(Jl+"bing.com")===0?"bing":s.search(Jl+"yahoo.com")===0?"yahoo":s.search(Jl+"duckduckgo.com")===0?"duckduckgo":null:null}(e),n=t!="yahoo"?"q":"p",r={};if(!rt(t)){r.$search_engine=t;var i=j?So(j.referrer,n):"";i.length&&(r.ph_keyword=i)}return r}function h_(){return navigator.language||navigator.userLanguage}var Oc="$direct";function LE(){return(j==null?void 0:j.referrer)||Oc}function jE(e,t,n){n===void 0&&(n=!1);var r=e?[...Co,...t||[]]:[],i=n?li(Ae==null?void 0:Ae.href):Ae==null?void 0:Ae.href,s=i==null?void 0:i.substring(0,1e3);return{r:LE().substring(0,1e3),u:s?Za(s,r,el):void 0}}function DE(e,t){var n;t===void 0&&(t=!1);var r=e.r,i=e.u,s=t?li(i):i,o={$referrer:r,$referring_domain:r==null?void 0:r==Oc?Oc:(n=Eo(r))==null?void 0:n.host};if(s){o.$current_url=s;var a=Eo(s);o.$host=a==null?void 0:a.host,o.$pathname=a==null?void 0:a.pathname;var l=$E(s);_e(o,l)}if(r){var u=FE(r);_e(o,u)}return o}function zE(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function JI(){try{return new Date().getTimezoneOffset()}catch{return}}var ZI={flags:Gi,surveys:bc},eO=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Zl=e=>e+"_cookie_identity_change_pending",Rr="main",p_=(e,t)=>{ve(e,(n,r)=>{var i=An(r);i&&i.exposure!=="event"||{}.hasOwnProperty.call(t,r)||delete e[r]})};class Sf{constructor(t,n,r){if(r===void 0&&(r=!0),this.Ms={},this.Es=!1,this.Is=!1,this.Rs=!1,this.Ps=!1,this.qi=t,this.As=r,this.props={},this.Fs=void 0,this.Os=(s=>{var o="";return s.token&&(o=s.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),s.persistence_name?"ph_"+s.persistence_name:"ph_"+o+"_posthog"})(t),this.ps=this.Ls(t),this.Is=this.$s(t),this.load(),t.debug&&D.info("Persistence loaded",t.persistence,$({},this.props)),this.update_config(t,t,n),this.save(),I){var i=()=>this.flush();Re(I,"beforeunload",i,{capture:!1}),Re(I,"pagehide",i,{capture:!1})}}Ds(){var t,n=(t=this.qi)==null?void 0:t.persistence_save_debounce_ms;return Ge(n)&&n>0?n:0}Ns(t){if(this.qi.cookieWinsOnConflict&&this.qi.persistence.toLowerCase()==="localstorage+cookie")if(t)try{var n=wf(t,this.qi.cookie_persisted_properties||[]),r=Zy(n,this.qi.cookie_persisted_properties||[]),i=JSON.stringify(n)+"|"+JSON.stringify(r),s=Ke.Pr(this.Os)||void 0;s&&xf(this.Os,s)===i&&(this.qs=i,this.js=s)}catch{}else try{var o=Ke.Pr(this.Os)||void 0;this.qs=o?xf(this.Os,o):void 0,this.js=o}catch{}}syncCookieProperties(){return this.Bs(this.qi)}Bs(t,n){if(n===void 0&&(n=!1),this.Hs&&!n||this.Ps||!t.cookieWinsOnConflict||t.persistence.toLowerCase()!=="localstorage+cookie")return!1;var r;try{r=Ke.Pr(this.Os)||void 0}catch{}if(!r||r===this.js)return!1;var i,s=xf(this.Os,r);try{i=_f(JSON.parse(r))}catch{return!1}if((Ke.Pr(this.Os)||void 0)!==r)return!1;this.qs=s,this.js=r;var o=e_(this.Os,r),a=[...Pi,...o.properties],l={};if(Object.keys(i).forEach(p=>{var y=i[p];(L(y)||rt(y)||y===""||p===se&&y!==We&&y!==ot)&&(l[p]=!0,delete i[p])}),En(i))return!1;var u=wt in i||i[se]===We||i[se]===ot,c=this.props[wt],d=this.props[se],f=_e({},this.props);[...Pi,...t.cookie_persisted_properties||[]].forEach(p=>{if(a.indexOf(p)!==-1&&!(p in i)&&!l[p]&&(u||p!==wt&&p!==se)){var y=f[p];!o.isValid&&Pi.indexOf(p)!==-1&&(y===!1||y===0)||delete f[p]}}),this.props=_e(f,i),!u||se in i||se in this.props||this.Us(se,We);var m=this.props[wt],_=this.props[se];return!u||m===c&&_===d||(this.Rs=!0,we.Nr(Zl(this.Os),!0),this.zs(yn),this.zs(Mi),this.zs(ir),this.zs(Xa),this.zs(Ai),this.zs(Gs),this.zs(Gi),this.zs(Ks),this.zs(ar),_===We&&(d===ot||i[se]===We||!L(c)&&m!==c)&&(p_(this.props,i),this.zs(Dn)),_===ot?this.props.$user_id=m:delete this.props.$user_id,this.zs($s)),!0}consumeCookieIdentityChange(){var t=Zl(this.Os),n=this.Rs||!!we.Pr(t);return this.Rs=!1,n&&we.qr(t),n}Ws(t){return t===void 0&&(t=!1),!(this.Ps||this.Hs&&!t||!this.qi.cookieWinsOnConflict||this.qi.persistence.toLowerCase()!=="localstorage+cookie"||(this.Ps=!0,0))}Vs(){this.Ps&&(L(this.Gs)||(clearTimeout(this.Gs),this.Gs=void 0),delete this.Ms[Rr],this.Zs(!0))}Qs(t){if(t===void 0&&(t=!0),this.Ps)try{t?this.Vs():L(this.Gs)||(clearTimeout(this.Gs),this.Gs=void 0)}finally{this.Ps=!1}}isDisabled(){return!!this.Hs}Ls(t){eO.indexOf(t.persistence.toLowerCase())===-1&&(D.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var n,r=function(o,a){o===void 0&&(o=[]),a===void 0&&(a=!1);var l=[...Pi,...o];return $({},ge,{Br(u){try{var c,d={};try{c=Ke.Pr(u)||void 0,d=c?_f(JSON.parse(c)):{}}catch{}var f,m=JSON.parse(ge.Pr(u)||"{}");if(a){var _=e_(u,c),p=[...Pi,..._.properties],y={};Object.keys(d).forEach(E=>{var S=d[E];rt(S)||S===""||E===se&&S!==We&&S!==ot||(y[E]=S)});var h=wt in y||y[se]===We||y[se]===ot;if(Object.keys(y).length>0){var v,x=m[wt],b=(v=m[se])!==null&&v!==void 0?v:We;l.forEach(E=>{if(p.indexOf(E)!==-1&&!(E in d)&&(h||E!==wt&&E!==se)){var S=m[E];!_.isValid&&Pi.indexOf(E)!==-1&&(S===!1||S===0)||delete m[E]}}),!h||se in d||se in m||(m[se]=We),!h||(wt in y?y[wt]:m[wt])===x&&(se in y?y[se]:m[se])===b||(yf.forEach(E=>delete m[E]),y[se]===ot&&wt in y?m.$user_id=y[wt]:delete m.$user_id,y[se]!==ot&&(delete m[dE],delete m[Dn]),delete m.__alias)}f=_e(m,y)}else f=_e(d,m);return ge.Nr(u,f),f}catch{}return null},Nr(u,c,d,f,m,_){var p=ge.Nr(u,c,void 0,void 0,_);try{var y=wf(c,o);if(Object.keys(y).length){if(a){var h=Rc(u),v=Zy(y,o);if(Ke.Nr(h,v,d,f,m,_),Ke.Pr(h)!==JSON.stringify(v)){Ke.qr(h,f);var x=wf(c);return Ke.Nr(u,x,d,f,m,_),p}}Ke.Nr(u,y,d,f,m,_)}}catch(b){ge.jr(b)}return p},qr(u,c){try{I==null||I.localStorage.removeItem(u),Ke.qr(u,c),Ke.qr(Rc(u),c)}catch(d){ge.jr(d)}}})}(t.cookie_persisted_properties||[],t.cookieWinsOnConflict),i=!1,s=t.persistence.toLowerCase();return s==="localstorage"&&ge.Dr()?(n=ge,i=!0):s==="localstorage+cookie"&&r.Dr()?(n=r,i=!0):s==="sessionstorage"&&we.Dr()?n=we:s==="memory"?n=AI:s==="cookie"?n=Ke:r.Dr()?(n=r,i=!0):n=Ke,this.Es=i,n}Js(t){return this.Os+"__"+t}$s(t){return this.Es&&!!t.split_storage}properties(){var t={};return ve(this.props,(n,r)=>{var i=An(r);if(!i||i.exposure==="event"){if(i!=null&&i.shouldSkipFromEventProperties!=null&&i.shouldSkipFromEventProperties(n))return;t[r]=n}}),t}load(t){if(t===void 0&&(t=!1),!this.Hs||t){var n=this.qi.cookieWinsOnConflict&&this.qi.persistence.toLowerCase()==="localstorage+cookie",r=n?ge.Br(this.Os):null,i={};if(n)try{ve(i=_f(Ke.Br(this.Os)),(_,p)=>{(L(_)||rt(_)||_==="")&&delete i[p]})}catch{}var s=this.ps.Br(this.Os);if(s&&(this.props=_e({},s)),this.Is&&this.Ks(),n&&s){var o,a,l=r==null?void 0:r[wt],u=(o=r==null?void 0:r[se])!==null&&o!==void 0?o:We,c=s[wt],d=(a=s[se])!==null&&a!==void 0?a:We;if(c!==l||d!==u){this.Rs=!0,we.Nr(Zl(this.Os),!0);var f=_e({},this.props);yf.forEach(_=>delete f[_]),d===We&&(u===ot||i[se]===We||!L(l)&&c!==l)&&(p_(f,i),delete f[Dn]),this.props=f;var m=new Set;yf.forEach(_=>{var p,y=(p=An(_))==null?void 0:p.storageGroup;y&&m.add(y)}),m.forEach(_=>{var p={};ve(this.props,(y,h)=>{var v;((v=An(h))==null?void 0:v.storageGroup)===_&&(p[h]=y)}),En(p)?(ge.qr(this.Js(_)),this.Ms[_]={}):ge.Nr(this.Js(_),p)&&(this.Ms[_]={persisted:!0,fingerprint:this.Ys(p,_)})})}}we.Pr(Zl(this.Os))&&(this.Rs=!0)}}Ks(){for(var t of Ef){var n=ge.Br(this.Js(t));if(n&&!En(n)){var r=this.Xs(t);r.persisted=!0,this.ta(t)||(r.fingerprint=this.Ys(n,t)),this.ea(t,n)||_e(this.props,n)}}}ta(t){return Object.keys(this.props).some(n=>{var r;return((r=An(n))==null?void 0:r.storageGroup)===t})}ea(t,n){var r=ZI[t];if(!r)return!1;var i=n[r],s=this.props[r];return Ge(i)&&Ge(s)&&s>i}refreshKey(t){var n;if(!this.Hs){var r=this.Is?(n=An(t))==null?void 0:n.storageGroup:void 0,i=r?ge.Br(this.Js(r)):this.ps.Br(this.Os);if(i&&t in i)this.Us(t,i[t]);else{if(r){var s=this.ps.Br(this.Os);if(s&&t in s)return void this.Us(t,s[t])}this.zs(t)}}}save(){if(!this.Hs){var t=this.Ds();t>0?L(this.Gs)&&(this.Gs=setTimeout(()=>{this.Gs=void 0,this.Zs()},t)):this.Zs()}}flush(){L(this.Gs)||(clearTimeout(this.Gs),this.Gs=void 0,this.Zs())}Zs(t){t===void 0&&(t=!1),this.Hs||this.Ps&&!t||(t||this.syncCookieProperties(),this.Is?this.ia():this.ra(this.ps,this.Os,this.props,Rr)&&this.Ns(this.props))}ia(){var t=this.na(),n=t.main,r=t.groups;for(var i of(this.ra(this.ps,this.Os,n,Rr)&&this.Ns(n),Ef)){var s,o=r[i];(!En(o)||(s=this.Ms[i])!=null&&s.persisted)&&this.ra(ge,this.Js(i),o,i)}}na(){var t={},n={flags:{},surveys:{}};return ve(this.props,(r,i)=>{var s,o=(s=An(i))==null?void 0:s.storageGroup;o?n[o][i]=r:t[i]=r}),{main:t,groups:n}}Ys(t,n){if(n===Rr)return JSON.stringify(t)+"|"+this.sa+"|"+this.aa+"|"+this.oa;var r={};return ve(t,(i,s)=>{var o;r[s]=(o=An(s))!=null&&o.volatile?"__volatile__":i}),JSON.stringify(r)}ra(t,n,r,i){var s,o=this.Xs(i);if(i!==Rr&&!o.dirty&&!L(o.fingerprint))return!1;try{if((s=this.Ys(r,i))===o.fingerprint)return o.dirty=!1,!1}catch{s=void 0}return t.Nr(n,r,this.sa,this.aa,this.oa,this.qi.debug)?(o.dirty=!1,i!==Rr&&(o.persisted=!0),L(s)||(o.fingerprint=s),!0):(this.qi.debug&&D.warn('failed to persist storage entry "'+n+'"; will retry on next save'),!1)}remove(t){var n=(t===void 0?{}:t).keepGroupEntries,r=n!==void 0&&n;if(L(this.Gs)||(clearTimeout(this.Gs),this.Gs=void 0),this.ps.qr(this.Os,!1),this.ps.qr(this.Os,!0),!r&&this.As)for(var i of Ef)ge.qr(this.Js(i));r?delete this.Ms[Rr]:this.Ms={},this.qs=void 0,this.js=void 0}clear(){this.remove(),this.props={}}register_once(t,n,r){if(Se(t)){this.syncCookieProperties(),L(n)&&(n="None"),this.sa=L(r)?this.la:r;var i=!1;if(ve(t,(s,o)=>{this.props.hasOwnProperty(o)&&this.props[o]!==n||(this.Us(o,s),i=!0)}),i)return this.save(),!0}return!1}register(t,n){if(Se(t)){this.syncCookieProperties(),this.sa=L(n)?this.la:n;var r=!1;if(ve(t,(i,s)=>{t.hasOwnProperty(s)&&(this.props[s]!==i||Se(i)||Z(i))&&(this.Us(s,i),r=!0)}),r)return this.save(),!0}return!1}unregister(t){this.syncCookieProperties();var n=typeof t=="string"?[t]:t,r=!1;for(var i of n)i in this.props&&(this.zs(i),r=!0);r&&this.save()}update_campaign_params(){var t=j==null?void 0:j.URL;if(t!==this.Fs){var n=NE(this.qi.custom_campaign_params,this.qi.mask_personal_data_properties,this.qi.custom_personal_data_properties);En(Sg(n))||this.register(n),this.Fs=t}}update_search_keyword(){var t;this.register((t=j==null?void 0:j.referrer)?FE(t):{})}update_referrer_info(){var t;this.register_once({$referrer:LE(),$referring_domain:j!=null&&j.referrer&&((t=Eo(j.referrer))==null?void 0:t.host)||Oc},void 0)}set_initial_person_info(){this.props[_p]||this.props[wp]||this.register_once({[Ec]:jE(this.qi.mask_personal_data_properties,this.qi.custom_personal_data_properties,this.qi.disable_capture_url_hashes)},void 0)}get_initial_props(){var t={};ve([wp,_p],i=>{var s=this.props[i];s&&ve(s,function(o,a){t["$initial_"+np(a)]=o})});var n=this.props[Ec];if(n){var r=function(i,s){s===void 0&&(s=!1);var o=DE(i,s),a={};return ve(o,function(l,u){a["$initial_"+np(u)]=l}),a}(n,this.qi.disable_capture_url_hashes);_e(t,r)}return t}safe_merge(t){return ve(this.props,function(n,r){r in t||(t[r]=n)}),t}update_config(t,n,r){var i=t.persistence!==n.persistence,s=!((p,y)=>{if(p.length!==y.length)return!1;var h=[...p].sort(),v=[...y].sort();return h.every((x,b)=>x===v[b])})(t.cookie_persisted_properties||[],n.cookie_persisted_properties||[]),o=i||s,a=t.cookieWinsOnConflict!==n.cookieWinsOnConflict,l=t.disable_persistence||!!r,u=!!this.Hs&&!l;l||this.Bs(n,u),this.qi=t,!l&&(i||s||a)&&(this.qs=void 0,this.js=void 0,this.Bs($({},t,{cookie_persisted_properties:n.cookie_persisted_properties}),u));var c=o||a?this.Ls(t):this.ps,d=this.$s(t),f=o||d!==this.Is,m=!l&&(f||t.cross_subdomain_cookie!==this.aa||t.secure_cookie!==this.oa)&&this.Ws(u);try{if(this.la=this.sa=t.cookie_expiration,this.set_disabled(l),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),f){var _=this.props;this.clear(),this.ps=c,this.Is=d,this.props=_,this.save()}else a&&(this.ps=c,l||(delete this.Ms[Rr],this.Zs()))}finally{m&&this.Qs()}}set_disabled(t){this.Hs=t,this.Hs?this.remove():this.save()}set_cross_subdomain(t){t!==this.aa&&(this.aa=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.oa&&(this.oa=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,n){var r=this.props[ca]||{};r[t]=n,this.Us(ca,r),this.save()}remove_event_timer(t){var n=this.props[ca]||{},r=n[t];return L(r)||(delete n[t],this.Us(ca,n),this.save()),r}get_property(t){return this.props[t]}set_property(t,n){this.Us(t,n),this.save()}Us(t,n){var r;this.props[t]=n,(r=An(t))!=null&&r.volatile||this.ua(t)}zs(t){delete this.props[t],this.ua(t)}ua(t){var n,r=(n=An(t))==null?void 0:n.storageGroup;r&&(this.Xs(r).dirty=!0)}Xs(t){return this.Ms[t]||(this.Ms[t]={})}}function eu(e){var t=!0;return{dispose(){if(t){t=!1;var n=e();n&&vt(n.then)&&n.then(void 0,()=>{})}}}}var Et={GZipJS:"gzip-js",Base64:"base64"},Xo={Activation:"events",Cancellation:"cancelEvents"},Cf={Popover:"popover",API:"api",Widget:"widget"},ur={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},kf={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},Pp={Popover:"popover",Inline:"inline"},tO={SHOWN:"product tour shown"},v_={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},g_=Ie("[RateLimiter]");class nO{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{var r=n.text;if(r&&r.length)try{(JSON.parse(r).quota_limited||[]).forEach(i=>{g_.info((i||"events")+" is quota limited."),this.serverLimits[i]=new Date().getTime()+6e4})}catch(i){return void g_.warn('could not rate limit - continuing. Error: "'+(i==null?void 0:i.message)+'"',{text:r})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return((t=this.instance.config.rate_limiting)==null?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max(((t=this.instance.config.rate_limiting)==null?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t){var n,r,i;t===void 0&&(t=!1);var s=this.captureEventsBurstLimit,o=this.captureEventsPerSecond,a=new Date().getTime(),l=(n=(r=this.instance.persistence)==null?void 0:r.get_property(yp))!==null&&n!==void 0?n:{tokens:s,last:a};l.tokens+=(a-l.last)/1e3*o,l.last=a,l.tokens>s&&(l.tokens=s);var u=1>l.tokens;if(u||t||(l.tokens=Math.max(0,l.tokens-1)),u&&!t){var c=(Ge(l.dropped)?l.dropped:0)+1;l.dropped=c,!this.lastEventRateLimited&&this.ha(c)&&(l.dropped=0)}return this.lastEventRateLimited=u,(i=this.instance.persistence)==null||i.set_property(yp,l),{isRateLimited:u,remainingTokens:l.tokens}}da(t){var n=this.instance.config.property_denylist;return!Z(n)||!n.includes(t)}va(){var t;if(this.da("$current_url")&&this.da("$pathname")&&Ae!=null&&Ae.pathname)return""+((t=Ae.origin)!==null&&t!==void 0?t:"")+Ae.pathname}ha(t){var n,r,i=this.captureEventsBurstLimit,s=this.captureEventsPerSecond,o=this.va(),a=this.da("$session_id")?(n=(r=this.instance).get_session_id)==null?void 0:n.call(r):void 0,l=[t+" event(s) dropped since the last warning",o?"triggered on "+o:void 0,a?"session "+a:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+l+". Config is set to "+s+" events per second and "+i+" events burst limit."},{skip_client_rate_limiting:!0})}isServerRateLimited(t){var n=this.serverLimits[t||"events"]||!1;return n!==!1&&new Date().getTime()t(this.remoteConfig)):t()}fa(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:t})}load(){try{if(this.remoteConfig)return Tr.info("Using preloaded remote config",this.remoteConfig),this.pa(this.remoteConfig),void this.ga();if(this._instance.ma())return void Tr.warn("Remote config is disabled. Falling back to local config.");this.ca(t=>{if(!t)return Tr.info("No config found after loading remote JS config. Falling back to JSON."),void this.fa(n=>{this.pa(n.json,n),this.ga()});this.pa(t),this.ga()})}catch(t){Tr.error("Error loading remote config",t),this.pa()}}stop(){this.ya&&(clearInterval(this.ya),this.ya=void 0)}refresh(){!this._instance.ma()&&j&&j.visibilityState!=="hidden"&&this._instance.reloadFeatureFlags()}ga(){var t;if(!this.ya){var n=(t=this._instance.config.remote_config_refresh_interval_ms)!==null&&t!==void 0?t:3e5;n!==0&&(this.ya=setInterval(()=>{this.refresh()},n))}}pa(t,n){!t&&n&&(n.statusCode===0?n.error||Tr.warn("Failed to fetch remote config from PostHog."):Tr.error("Failed to fetch remote config from PostHog."));try{this._instance.pa(t?{ok:!0,config:t}:{ok:!1})}catch(i){Tr.error("Error applying remote config",i)}if((t==null?void 0:t.hasFeatureFlags)!==!1&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var r;(r=this._instance.featureFlags)==null||r.ensureFlagsLoaded()}catch(i){Tr.error("Error loading feature flags",i)}}}var ln=Uint8Array,Lt=Uint16Array,ko=Uint32Array,Rg=new ln([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Tg=new ln([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),m_=new ln([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),VE=function(e,t){for(var n=new Lt(31),r=0;31>r;++r)n[r]=t+=1<r;++r)for(var s=n[r];n[r+1]>s;++s)i[s]=s-n[r]<<5|r;return[n,i]},BE=VE(Rg,2),Rp=BE[1];BE[0][28]=258,Rp[258]=28;for(var y_=VE(Tg,0)[1],qE=new Lt(32768),Ne=0;32768>Ne;++Ne){var hs=(43690&Ne)>>>1|(21845&Ne)<<1;qE[Ne]=((65280&(hs=(61680&(hs=(52428&hs)>>>2|(13107&hs)<<2))>>>4|(3855&hs)<<4))>>>8|(255&hs)<<8)>>>1}var Pa=function(e,t,n){for(var r=e.length,i=0,s=new Lt(t);r>i;++i)++s[e[i]-1];var o,a=new Lt(t);for(i=0;t>i;++i)a[i]=a[i-1]+s[i-1]<<1;for(o=new Lt(r),i=0;r>i;++i)o[i]=qE[a[e[i]-1]++]>>>15-e[i];return o},Zi=new ln(288);for(Ne=0;144>Ne;++Ne)Zi[Ne]=8;for(Ne=144;256>Ne;++Ne)Zi[Ne]=9;for(Ne=256;280>Ne;++Ne)Zi[Ne]=7;for(Ne=280;288>Ne;++Ne)Zi[Ne]=8;var Mc=new ln(32);for(Ne=0;32>Ne;++Ne)Mc[Ne]=5;var rO=Pa(Zi,9),iO=Pa(Mc,5),WE=function(e){return(e/8>>0)+(7&e&&1)},HE=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof Lt?Lt:e instanceof ko?ko:ln)(n-t);return r.set(e.subarray(t,n)),r},Qn=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8},Jo=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Pf=function(e,t){for(var n=[],r=0;e.length>r;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,s=n.slice();if(!i)return[new ln(0),0];if(i==1){var o=new ln(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(E,S){return E.f-S.f}),n.push({s:-1,f:25001});var a=n[0],l=n[1],u=0,c=1,d=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=i-1;)a=n[n[d].f>n[u].f?u++:d++],l=n[u!=c&&n[d].f>n[u].f?u++:d++],n[c++]={s:-1,f:a.f+l.f,l:a,r:l};var f=s[0].s;for(r=1;i>r;++r)s[r].s>f&&(f=s[r].s);var m=new Lt(f+1),_=Tp(n[c-1],m,0);if(_>t){r=0;var p=0,y=_-t,h=1<r;++r){var v=s[r].s;if(t>=m[v])break;p+=h-(1<<_-m[v]),m[v]=t}for(p>>>=y;p>0;){var x=s[r].s;t>m[x]?p-=1<=0&&p;--r){var b=s[r].s;m[b]==t&&(--m[b],++p)}_=t}return[new ln(m),_]},Tp=function(e,t,n){return e.s==-1?Math.max(Tp(e.l,t,n+1),Tp(e.r,t,n+1)):t[e.s]=n},__=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Lt(++t),r=0,i=e[0],s=1,o=function(l){n[r++]=l},a=1;t>=a;++a)if(e[a]==i&&a!=t)++s;else{if(!i&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(i),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(i);s=1,i=e[a]}return[n.subarray(0,r),t]},Zo=function(e,t){for(var n=0,r=0;t.length>r;++r)n+=e[r]*t[r];return n},Ip=function(e,t,n){var r=n.length,i=WE(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var s=0;r>s;++s)e[i+s+4]=n[s];return 8*(i+4+r)},w_=function(e,t,n,r,i,s,o,a,l,u,c){Qn(t,c++,n),++i[256];for(var d=Pf(i,15),f=d[0],m=d[1],_=Pf(s,15),p=_[0],y=_[1],h=__(f),v=h[0],x=h[1],b=__(p),E=b[0],S=b[1],P=new Lt(19),C=0;v.length>C;++C)P[31&v[C]]++;for(C=0;E.length>C;++C)P[31&E[C]]++;for(var T=Pf(P,7),R=T[0],N=T[1],M=19;M>4&&!R[m_[M-1]];--M);var z,F,W,B,Q=u+5<<3,O=Zo(i,Zi)+Zo(s,Mc)+o,A=Zo(i,f)+Zo(s,p)+o+14+3*M+Zo(P,R)+(2*P[16]+3*P[17]+7*P[18]);if(O>=Q&&A>=Q)return Ip(t,c,e.subarray(l,l+u));if(Qn(t,c,1+(O>A)),c+=2,O>A){z=Pa(f,m),F=f,W=Pa(p,y),B=p;var V=Pa(R,N);for(Qn(t,c,x-257),Qn(t,c+5,S-1),Qn(t,c+10,M-4),c+=14,C=0;M>C;++C)Qn(t,c+3*C,R[m_[C]]);c+=3*M;for(var K=[v,E],te=0;2>te;++te){var oe=K[te];for(C=0;oe.length>C;++C)Qn(t,c,V[de=31&oe[C]]),c+=R[de],de>15&&(Qn(t,c,oe[C]>>>5&127),c+=oe[C]>>>12)}}else z=rO,F=Zi,W=iO,B=Mc;for(C=0;a>C;++C)if(r[C]>255){var de;Jo(t,c,z[257+(de=r[C]>>>18&31)]),c+=F[de+257],de>7&&(Qn(t,c,r[C]>>>23&31),c+=Rg[de]);var be=31&r[C];Jo(t,c,W[be]),c+=B[be],be>3&&(Jo(t,c,r[C]>>>5&8191),c+=Tg[be])}else Jo(t,c,z[r[C]]),c+=F[r[C]];return Jo(t,c,z[256]),c+F[256]},sO=new ko([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),oO=function(){for(var e=new ko(256),t=0;256>t;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),Rf=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function aO(e,t){t===void 0&&(t={});var n=function(){var d=4294967295;return{p(f){for(var m=d,_=0;f.length>_;++_)m=oO[255&m^f[_]]^m>>>8;d=m},d(){return 4294967295^d}}}(),r=e.length;n.p(e);var i,s,o,a,l,u=(a=10+((i=t).filename&&i.filename.length+1||0),l=8,function(d,f,m,_,p,y){var h=d.length,v=new ln(_+h+5*(1+Math.floor(h/7e3))+p),x=v.subarray(_,v.length-p),b=0;if(!f||8>h)for(var E=0;h>=E;E+=65535){var S=E+65535;h>S?b=Ip(x,b,d.subarray(E,S)):(x[E]=!0,b=Ip(x,b,d.subarray(E,h)))}else{for(var P=sO[f-1],C=P>>>13,T=8191&P,R=(1<E;++E){var de=W(E),be=32767&E,Pe=M[de];if(N[be]=Pe,M[de]=be,E>=te){var Be=h-E;if((A>7e3||K>24576)&&Be>423){b=w_(d,x,0,B,Q,O,V,K,oe,E-oe,b),K=A=V=0,oe=E;for(var ye=0;286>ye;++ye)Q[ye]=0;for(ye=0;30>ye;++ye)O[ye]=0}var Fe=2,Tt=0,Sr=T,_t=be-Pe&32767;if(Be>2&&de==W(E-_t))for(var Ye=Math.min(C,Be)-1,gi=Math.min(32767,E),us=Math.min(258,Be);gi>=_t&&--Sr&&be!=Pe;){if(d[E+Fe]==d[E+Fe-_t]){for(var It=0;us>It&&d[E+It]==d[E+It-_t];++It);if(It>Fe){if(Fe=It,Tt=_t,It>Ye)break;var cs=Math.min(_t,It-2),Cr=0;for(ye=0;cs>ye;++ye){var pn=E-_t+ye+32768&32767,Do=pn-N[pn]+32768&32767;Do>Cr&&(Cr=Do,Pe=pn)}}}_t+=(be=Pe)-(Pe=N[be])+32768&32767}if(Tt){B[K++]=268435456|Rp[Fe]<<18|y_[Tt];var gm=31&Rp[Fe],mm=31&y_[Tt];V+=Rg[gm]+Tg[mm],++Q[257+gm],++O[mm],te=E+Fe,++A}else B[K++]=d[E],++Q[d[E]]}}b=w_(d,x,!0,B,Q,O,V,K,oe,E-oe,b)}return HE(v,0,_+WE(b)+p)}(s=e,(o=t).level==null?6:o.level,o.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):12+o.mem,a,l)),c=u.length;return function(d,f){var m=f.filename;if(d[0]=31,d[1]=139,d[2]=8,d[8]=2>f.level?4:f.level==9?2:0,d[9]=3,f.mtime!=0&&Rf(d,4,Math.floor(new Date(f.mtime||Date.now())/1e3)),m){d[3]=8;for(var _=0;m.length>=_;++_)d[_+10]=m.charCodeAt(_)}}(u,t),Rf(u,c-8,n.d()),Rf(u,c-4,r),u}var lO=!!Jh||!!fg,GE="text/plain",Ou=!1,KE=(e,t)=>{var n=e.split("#"),r=n[1],i=n[0].split("?"),s=i[0],o=i[1];if(!o)return e;var a=o.split("&").filter(l=>l.split("=")[0]!==t).join("&");return s+(a?"?"+a:"")+(r?"#"+r:"")},bl=function(e,t,n){var r;n===void 0&&(n=!0);var i=e.split("?"),s=i[0],o=i[1],a=$({},t),l=(r=o==null?void 0:o.split("&").map(c=>{var d,f=c.split("="),m=f[0],_=n&&(d=a[m])!==null&&d!==void 0?d:f[1];return delete a[m],m+"="+_}))!==null&&r!==void 0?r:[],u=function(c,d){var f,m;d===void 0&&(d="&");var _=[];return ve(c,function(p,y){L(p)||L(y)||y==="undefined"||(f=encodeURIComponent((h=>h instanceof File)(p)?p.name:p.toString()),m=encodeURIComponent(y),_[_.length]=m+"="+f)}),_.join(d)}(a);return u&&l.push(u),l.length>0?s+"?"+l.join("&"):s},Tf=e=>{if(e.ba)return e.ba;var t=e.data,n=e.compression;if(t){if(n===Et.GZipJS){var r=aO(function(a,l){var u=a.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(a);for(var c=new ln(a.length+(a.length>>>1)),d=0,f=function(y){c[d++]=y},m=0;u>m;++m){if(d+5>c.length){var _=new ln(d+8+(u-m<<1));_.set(c),c=_}var p=a.charCodeAt(m);128>p?f(p):2048>p?(f(192|p>>>6),f(128|63&p)):p>55295&&57344>p?(f(240|(p=65536+(1047552&p)|1023&a.charCodeAt(++m))>>>18),f(128|p>>>12&63),f(128|p>>>6&63),f(128|63&p)):(f(224|p>>>12),f(128|p>>>6&63),f(128|63&p))}return HE(c,0,d)}(Ls(t)),{mtime:0});return{contentType:GE,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===Et.Base64){var i=function(a){return a&&btoa(encodeURIComponent(a).replace(/%([0-9A-F]{2})/g,(l,u)=>String.fromCharCode(parseInt(u,16))))}(Ls(t)),s=(a=>"data="+encodeURIComponent(typeof a=="string"?a:Ls(a)))(i);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var o=Ls(t);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},QE=e=>{var t,n,r=()=>e.transport==="sendBeacon"?{url:bl(e.url,{compression:Et.Base64}),encodedBody:Tf($({},e,{compression:Et.Base64,ba:void 0}))}:{url:KE(e.url,"compression"),encodedBody:Tf($({},e,{compression:void 0,ba:void 0}))};try{t=Tf(e)}catch(i){if(Fy(e.compression,So(e.url,"compression")))return D.error("Failed to gzip request body, sending uncompressed payload",i),r();throw i}return t&&Fy(e.compression,So(e.url,"compression"))&&!((n=t.body)instanceof ArrayBuffer?Zh(new Uint8Array(n)):ArrayBuffer.isView(n)&&Zh(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)))?(Ou=!0,r()):{url:e.url,encodedBody:t}},YE=e=>{try{return QE(e)}catch(t){return D.error(t),void(e.callback==null||e.callback({statusCode:0,error:t}))}},uO=function(){var e=Ce(function*(t){var n=Ls(t.data),r=yield function(s,o,a){return ep.apply(this,arguments)}(n,Ee.DEBUG,{rethrow:!0});if(!r)return t;var i=yield r.arrayBuffer();return $({},t,{ba:{contentType:GE,body:i,estimatedSize:i.byteLength}})});return function(t){return e.apply(this,arguments)}}(),cO=/Failed to fetch|NetworkError|Load failed/i,XE=e=>(e==null?void 0:e.name)==="TypeError"&&cO.test((e==null?void 0:e.message)||""),JE=e=>{var t=YE(e);if(t){var n=t.url,r=t.encodedBody,i=r??{},s=i.contentType,o=i.body,a=i.estimatedSize,l=new Headers;ve(e.headers,function(_,p){l.append(p,_)}),s&&l.append("Content-Type",s);var u=null,c=!1;if(Iy){var d=new Iy;u={signal:d.signal,timeout:setTimeout(()=>{var _,p;c=!0,d.abort((_=e.timeout,(p=new Error("PostHog request timed out"+(_?" after "+_+"ms":""))).name="AbortError",p))},e.timeout)}}var f=_=>{c&&(_==null?void 0:_.name)==="AbortError"||XE(_)?D.warn(_):D.error(_),e.callback==null||e.callback({statusCode:0,error:_})};try{var m;fg(n,$({method:(e==null?void 0:e.method)||"GET",headers:l,keepalive:e.method==="POST"&&!e._a&&52428.8>(a||0),body:o,signal:(m=u)==null?void 0:m.signal},e.fetchOptions)).then(_=>_.text().then(p=>{var y={statusCode:_.status,text:p};if(_.status===200)try{y.json=JSON.parse(p)}catch(h){D.error(h)}e.callback==null||e.callback(y)})).catch(f).finally(()=>u?clearTimeout(u.timeout):null)}catch(_){u&&clearTimeout(u.timeout),f(_)}}},Op=e=>{try{var t,n=QE(e),r=n.url,i=n.encodedBody,s=i??{},o=s.body,a=s.estimatedSize;if(!o)return;var l=o instanceof Blob?o:new Blob([o],{type:s.contentType});if(St.sendBeacon(r,l))return;var u=Z(e.data)?e.data:(t=e.data)==null?void 0:t.batch;if(Z(u)&&u.length>1&&(a??0)>16384){var c=Math.ceil(u.length/2),d=f=>Z(e.data)?f:$({},e.data,{batch:f});return Op($({},e,{data:d(u.slice(0,c))})),void Op($({},e,{data:d(u.slice(c))}))}D.warn("Beacon of ~"+(a??0)+" bytes was rejected by the browser, falling back to fetch"),JE($({},e,{_a:!0}))}catch(f){D.warn("Beacon send failed",f)}},x_=(e,t,n,r)=>{var i=r==="query"?t==="POST"?"sent_at":"_":void 0;return bl(n===Et.GZipJS?KE(e,"compression"):e,$({},i?{[i]:Date.now().toString()}:{},n===Et.GZipJS?{}:{compression:n}))},Mu=[];fg&&Mu.push({transport:"fetch",method:JE}),Jh&&Mu.push({transport:"XHR",method(e){var t=YE(e);if(t){var n=new Jh,r=t.encodedBody;n.open(e.method||"GET",t.url,!0);var i=r??{},s=i.contentType,o=i.body;ve(e.headers,function(a,l){n.setRequestHeader(l,a)}),s&&n.setRequestHeader("Content-Type",s),e.timeout&&(n.timeout=e.timeout),n.onreadystatechange=()=>{if(n.readyState===4){var a={statusCode:n.status,text:n.responseText};if(n.status===200)try{a.json=JSON.parse(n.responseText)}catch{}e.callback==null||e.callback(a)}},n.send(o)}}}),St!=null&&St.sendBeacon&&Mu.push({transport:"sendBeacon",method:Op});var Mp=3e3;class dO{constructor(t,n){this.wa=!0,this.ka=[],this.Sa=Vn((n==null?void 0:n.flush_interval_ms)||Mp,250,5e3,D.createLogger("flush interval"),Mp),this.xa=t}enqueue(t){this.ka.push(t),this.Ca||this.Ta()}unload(){this.Ma();var t=this.ka.length>0?this.Ea():{},n=Object.values(t);[...n.filter(r=>r.url.indexOf("/e")===0),...n.filter(r=>r.url.indexOf("/e")!==0)].map(r=>{this.Ia($({},r,{transport:"sendBeacon"}))})}enable(){this.wa=!1,this.Ta()}Ta(){var t=this;this.wa||(this.Ca=setTimeout(()=>{if(this.Ma(),this.ka.length>0){var n=this.Ea(),r=function(){var s=n[i],o=new Date().getTime();s.data&&Z(s.data)&&ve(s.data,a=>{a.offset=Math.abs(a.timestamp-o),delete a.timestamp}),t.Ia(s)};for(var i in n)r()}},this.Sa))}Ia(t){try{this.xa(t)}catch(n){D.error(n)}}Ma(){clearTimeout(this.Ca),this.Ca=void 0}Ea(){var t={};return ve(this.ka,n=>{var r,i=n,s=(i?i.batchKey:null)||i.url;L(t[s])&&(t[s]=$({},i,{data:[]})),(r=t[s].data)==null||r.push(i.data)}),this.ka=[],t}}var fO=["retriesPerformedSoFar"];class hO{constructor(t){this.Ra=!1,this.Pa=3e3,this.ka=[],this._instance=t,this.ka=[],this.Aa=!0,!L(I)&&"onLine"in I.navigator&&(this.Aa=I.navigator.onLine,this.Fa=()=>{this.Aa=!0,this.Oa()},this.La=()=>{this.Aa=!1},Re(I,"online",this.Fa),Re(I,"offline",this.La))}get length(){return this.ka.length}retriableRequest(t){var n=t.retriesPerformedSoFar,r=bb(t,fO);Jn(n)&&(r.url=bl(r.url,{retry_count:n})),this._instance._send_request($({},r,{callback:i=>{if(i.statusCode!==200&&(400>i.statusCode||i.statusCode>=500)){if((i.statusCode===0?3:10)>(n??0))return void this.xn($({retriesPerformedSoFar:n},r));i.statusCode===0&&D.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(n??0)+" retries.")}r.callback==null||r.callback(i)}}))}xn(t){var n=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=n+1;var r=function(o){var a=3e3*Math.pow(2,o),l=a/2,u=Math.min(18e5,a),c=Math.random()-.5;return Math.ceil(u+c*(u-l))}(n),i=Date.now()+r;this.ka.push({retryAt:i,requestOptions:t});var s="Enqueued failed request for retry in "+r;navigator.onLine||(s+=" (Browser is offline)"),D.warn(s),this.Ra||(this.Ra=!0,this.$a())}$a(){if(this.Da&&clearTimeout(this.Da),this.ka.length===0)return this.Ra=!1,void(this.Da=void 0);this.Da=setTimeout(()=>{this.Aa&&this.ka.length>0&&this.Oa(),this.$a()},this.Pa)}Oa(){var t=Date.now(),n=[],r=this.ka.filter(s=>t>s.retryAt||(n.push(s),!1));if(this.ka=n,r.length>0)for(var i of r)this.retriableRequest(i.requestOptions)}unload(){for(var t of(this.Da&&(clearTimeout(this.Da),this.Da=void 0),this.Ra=!1,L(I)||(this.Fa&&(I.removeEventListener("online",this.Fa),this.Fa=void 0),this.La&&(I.removeEventListener("offline",this.La),this.La=void 0)),this.ka)){var n=t.requestOptions;try{this._instance._send_request($({},n,{transport:"sendBeacon"}))}catch(r){D.error(r)}}this.ka=[]}}class pO{constructor(t){this.Na=()=>{var n,r,i,s;this.qa||(this.qa={});var o=this.scrollElement(),a=this.scrollY(),l=o?Math.max(0,o.scrollHeight-o.clientHeight):0,u=a+((o==null?void 0:o.clientHeight)||0),c=(o==null?void 0:o.scrollHeight)||0;this.qa.lastScrollY=Math.ceil(a),this.qa.maxScrollY=Math.max(a,(n=this.qa.maxScrollY)!==null&&n!==void 0?n:0),this.qa.maxScrollHeight=Math.max(l,(r=this.qa.maxScrollHeight)!==null&&r!==void 0?r:0),this.qa.lastContentY=u,this.qa.maxContentY=Math.max(u,(i=this.qa.maxContentY)!==null&&i!==void 0?i:0),this.qa.maxContentHeight=Math.max(c,(s=this.qa.maxContentHeight)!==null&&s!==void 0?s:0)},this._instance=t}get ja(){return this._instance.config.scroll_root_selector}getContext(){return this.qa}resetContext(){var t=this.qa;return setTimeout(this.Na,0),t}startMeasuringScrollPosition(){Re(I,"scroll",this.Na,{capture:!0}),Re(I,"scrollend",this.Na,{capture:!0}),Re(I,"resize",this.Na)}scrollElement(){if(!this.ja)return I==null?void 0:I.document.documentElement;var t=Z(this.ja)?this.ja:[this.ja];for(var n of t){var r=I==null?void 0:I.document.querySelector(n);if(r)return r}}Ba(t){var n=t==="y"?"scrollTop":"scrollLeft";if(this.ja){var r=this.scrollElement();return r&&r[n]||0}return I?t==="y"?I.scrollY||I.pageYOffset||I.document.documentElement.scrollTop||0:I.scrollX||I.pageXOffset||I.document.documentElement.scrollLeft||0:0}scrollY(){return this.Ba("y")}scrollX(){return this.Ba("x")}}var vO=e=>jE(e==null?void 0:e.config.mask_personal_data_properties,e==null?void 0:e.config.custom_personal_data_properties,e==null?void 0:e.config.disable_capture_url_hashes);class b_{constructor(t,n,r,i){this.ot=s=>{var o=this.Ha();if(!o||o.sessionId!==s){var a={sessionId:s,props:this.Ua(this._instance)};this.za.register({[mp]:a})}},this._instance=t,this.Wa=n,this.za=r,this.Ua=i||vO,this.Wa.onSessionId(this.ot)}Ha(){return this.za.props[mp]}getSetOnceProps(){var t,n=(t=this.Ha())==null?void 0:t.props;return n?"r"in n?DE(n,this._instance.config.disable_capture_url_hashes):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var t={};return ve(Sg(this.getSetOnceProps()),(n,r)=>{r==="$current_url"&&(r="url"),t["$session_entry_"+np(r)]=n}),t}}class Ac{on(t,n){return this.Va[t]||(this.Va[t]=[]),this.Va[t].push(n),()=>{this.Va[t]=this.Va[t].filter(r=>r!==n)}}emit(t,n){for(var r of this.Va[t]||[])r(n);for(var i of this.Va["*"]||[])i(t,n)}constructor(){this.Va={}}}var ps=Ie("[SessionId]"),E_=864e5;class S_{on(t,n){return this.Ga.on(t,n)}constructor(t,n,r){var i;if(this.Za=null,this.Qa=null,this.Ja=[],this.Ka=void 0,this.Ya=!1,this.Ga=new Ac,this.Xa=(l,u)=>!(!Jn(l)||!Jn(u))&&Math.abs(l-u)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===lr)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.qi=t.config,this.za=t.persistence,this.st=void 0,this._e=void 0,this._sessionStartTimestamp=null,this.eo=void 0,this._sessionActivityTimestamp=null,this.io=n||$n,this.ro=r||$n;var s=this.qi.persistence_name||this.qi.token;if(this._sessionTimeoutMs=1e3*Vn(this.qi.session_idle_timeout_seconds||1800,60,36e3,ps.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.no(),this.so="ph_"+s+"_window_id",this.ao="ph_"+s+"_primary_window_exists",this.oo()){var o=we.Br(this.so),a=we.Br(this.ao);o&&!a?this.st=o:we.qr(this.so),we.Nr(this.ao,!0)}(i=this.qi.bootstrap)!=null&&i.sessionID&&this.setBootstrapSessionId(this.qi.bootstrap.sessionID),this.lo()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return L(this.Ja)&&(this.Ja=[]),this.Ja.push(t),this._e&&t(this._e,this.st),()=>{this.Ja=this.Ja.filter(n=>n!==t)}}oo(){return this.qi.persistence!=="memory"&&!this.za.Hs&&we.Dr()}uo(t){t!==this.st&&(this.st=t,this.oo()&&we.Nr(this.so,t))}ho(){return this.st?this.st:this.oo()?we.Br(this.so):null}do(t){var n=this.Za;return!rt(n)&&!rt(t)&&5e3>Math.abs(t-n)}vo(t,n,r){var i=n!==this._sessionActivityTimestamp,s=!(t!==this._e||r!==this._sessionStartTimestamp);this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this._e=t,s&&!i||s&&this.do(n)||(this.Za=n,this.za.register({[Fs]:[n,t,r]}))}co(){var t,n=(t=this.qi)==null?void 0:t.persistence_save_debounce_ms;return Jn(n)&&n>0}fo(){this.co()?this.za.refreshKey(Fs):(this.za.flush(),this.za.load())}po(){var t;if(!rt(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Za){this.fo();var n=this.mo();n[1]===this._e&&n[2]===this._sessionStartTimestamp&&(this.Za=this._sessionActivityTimestamp,this.za.register({[Fs]:[this._sessionActivityTimestamp,(t=this._e)!==null&&t!==void 0?t:null,this._sessionStartTimestamp]}),this.za.flush())}}yo(){var t=this.mo()[0],n=Jn(t)?t:0,r=Jn(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(n,r)}bo(t){return this.fo(),this.Xa(t,this.yo())}mo(){var t=this.za.props[Fs];return Z(t)&&t.length===2&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Za=null,this.eo=void 0,clearTimeout(this._o),this._o=void 0,this.vo(null,null,null)}setBootstrapSessionId(t,n){n===void 0&&(n=!1);var r=function(i,s){s===void 0&&(s=new Date().getTime());try{var o=(a=>{var l=a.replace(/-/g,"");if(l.length!==32)throw new Error("Not a valid UUID");if(l[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(l.substring(0,12),16)})(i);return o>s+6e4?void ps.error("Bootstrap sessionID cannot be in the future"):o}catch(a){return void ps.error("Invalid sessionID in bootstrap",a)}}(t);return!L(r)&&(n?this.eo={sessionId:t,sessionStartTimestamp:r}:this.vo(t,new Date().getTime(),r),!0)}destroy(){this.Ya=!0,this.po(),clearTimeout(this._o),this._o=void 0,this.Ka&&I&&(I.removeEventListener(kc,this.Ka,{capture:!1}),this.Ka=void 0),this.Ja=[]}lo(){this.Ka=()=>{this.po(),this.oo()&&we.qr(this.ao)},Re(I,kc,this.Ka,{capture:!1})}checkAndGetSessionAndWindowId(t,n,r){if(t===void 0&&(t=!1),n===void 0&&(n=null),r===void 0&&(r=!1),this.qi.cookieless_mode===lr)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=n||new Date().getTime(),s=this._e;if(r)this.Qa=i;else if(rt(this.Qa)||this.Qa>i||i-this.Qa>=1e3){var o,a;(o=(a=this.za).syncCookieProperties)==null||o.call(a),this.Qa=i}var l=this.mo(),u=l[1],c=l[2],d=!L(s)&&u!==s,f=this.yo(),m=this.ho(),_=this.eo,p=!!_&&(_.sessionStartTimestamp>i+6e4||i-_.sessionStartTimestamp>E_),y=_?p:Jn(c)&&Math.abs(i-c)>E_,h=!1,v=d,x=!u||!!_,b=u,E=!x&&!t&&this.Xa(i,f);if(E){(E=this.bo(i))||ps.info("cross-tab refresh kept the session alive",{sessionId:u});var S=this.mo();u=S[1],c=S[2]}if(x||E||y){v=!1;var P=_&&!p;u=P?_.sessionId:this.io(),m=this.ro(),ps.info("new session ID assigned",{sessionId:u,windowId:m,bootstrapped:!!P,changeReason:{noSessionId:x,activityTimeout:E,sessionPastMaximumLength:y}}),c=P?_.sessionStartTimestamp:i,this.eo=void 0,h=!0}else m||(m=this.ro(),h=!0),(v=v||u!==b)&&(ps.info("adopted cross-tab session id",{sessionId:u,windowId:m}),h=!0);var C=Jn(f)&&t&&!y?f:i,T=Jn(c)?c:new Date().getTime();this.uo(m),this.vo(u,C,T),t||this.no();var R={noSessionId:x,activityTimeout:E,sessionPastMaximumLength:y,crossTabAdoption:v};return h&&this.Ja.forEach(N=>N(u,m,R)),{sessionId:u,windowId:m,sessionStartTimestamp:T,changeReason:h?R:void 0,lastActivityTimestamp:f}}no(){this.Ya||(clearTimeout(this._o),this._o=setTimeout(()=>{if(!this.Ya)if(this.bo(new Date().getTime())){var t=this._e;this.resetSessionId(),this.Ga.emit("forcedIdleReset",{idleSessionId:t})}else this.no()},1.1*this.sessionTimeoutMs))}}var ZE=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&jy(n,t))return!0;try{var r=e==null?void 0:e.userAgentData;if(r!=null&&r.brands&&r.brands.some(i=>jy(i==null?void 0:i.brand,t)))return!0}catch{}return!!e.webdriver};function eS(){return(eS=Ce(function*(){var e=St==null?void 0:St.userAgentData;if(e!=null&&e.getHighEntropyValues)try{var t=yield e.getHighEntropyValues(["model"]),n=t==null?void 0:t.model;return ce(n)&&n.length>0?n:void 0}catch(r){return void D.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",r)}})).apply(this,arguments)}var Nc=function(e,t){if(!function(n){try{new RegExp(n)}catch{return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}};function If(e,t,n){return Ls({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}var tS={exact:(e,t)=>t.some(n=>e.some(r=>n===r)),is_not:(e,t)=>t.every(n=>e.every(r=>n!==r)),regex:(e,t)=>t.some(n=>e.some(r=>Nc(n,r))),not_regex:(e,t)=>t.every(n=>e.every(r=>!Nc(n,r))),icontains:(e,t)=>t.map(tu).some(n=>e.map(tu).some(r=>n.includes(r))),not_icontains:(e,t)=>t.map(tu).every(n=>e.map(tu).every(r=>!n.includes(r))),gt:(e,t)=>t.some(n=>{var r=parseFloat(n);return!isNaN(r)&&e.some(i=>r>parseFloat(i))}),lt:(e,t)=>t.some(n=>{var r=parseFloat(n);return!isNaN(r)&&e.some(i=>re.toLowerCase();function nS(e,t){return!e||Object.entries(e).every(n=>{var r=n[1],i=t==null?void 0:t[n[0]];if(L(i)||rt(i))return!1;var s=[String(i)],o=tS[r.operator];return!!o&&o(r.values,s)})}var Ap="custom",C_="i.posthog.com",gO=/^\/static\//,mO=["/s/","/e/","/i/"];class yO{constructor(t){this.wo={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return t==="https://app.posthog.com"?"https://us.i.posthog.com":t}get flagsApiHost(){var t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t,n=(t=this.instance.config.ui_host)==null?void 0:t.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+C_,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.wo[this.apiHost]||(this.wo[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":Ap),this.wo[this.apiHost]}ko(t){if(gO.test(t)){var n=this.instance.config.asset_host;if(typeof n=="string")return n.trim().replace(/\/$/,"")||void 0}}So(t){var n=Eo(t);return n?n.protocol+"//"+n.host+n.pathname:void 0}xo(t,n,r){if(t==="ui")return r;var i=r,s=this.instance.config.rewriteRequestPath;if(s){var o,a=((o=Eo(r))==null?void 0:o.href)||r;i=s(new URL(a)).toString()}if(s&&t==="api"&&mO.some(f=>n.indexOf(f)===0)){var l=this.So(i);if(l){var u,c=this.apiHost,d=this.Co;((u=d)==null?void 0:u.apiHost)===c&&d.rewriteRequestPath===s||(d={apiHost:c,rewriteRequestPath:s,urls:new Set},this.Co=d),d.urls.add(l)}}return i}isIngestionEndpoint(t){var n=this.Co,r=this.So(t);return(n==null?void 0:n.apiHost)===this.apiHost&&n.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!r&&n.urls.has(r)}endpointFor(t,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),t==="ui")return this.xo(t,n,this.uiHost+n);if(t==="flags")return this.xo(t,n,this.flagsApiHost+n);if(t==="assets"){var r=this.ko(n);if(r)return this.xo(t,n,""+r+n)}if(this.region===Ap)return this.xo(t,n,this.apiHost+n);var i=C_+n;switch(t){case"assets":return this.xo(t,n,"https://"+this.region+"-assets."+i);case"api":return this.xo(t,n,"https://"+this.region+"."+i)}}}function rS(e){var t;return!((t=e.conditions)==null||(t=t.events)==null||(t=t.values)==null||!t.length)}var he=Ie("[Surveys]"),iS="seenSurvey_",sS=e=>{try{var t=(n=>((r,i)=>""+iS+function(s){return s.current_iteration&&s.current_iteration>0?s.id+"_"+s.current_iteration:s.id}(i))(0,n))(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(n){he.error("Failed to persist survey seen state",n)}},_O=[Cf.Popover,Cf.Widget,Cf.API],wO={ignoreConditions:!1,ignoreDelay:!1,displayType:Pp.Popover},xO=Ie("[PostHog ExternalIntegrations]"),bO={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class EO{constructor(t){this._instance=t}_s(t,n){var r;(r=Y.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,t,i=>{if(i)return xO.error("failed to load script",i);n()})}startIfEnabledOrStop(){var t=this,n=function(){var s,o,a,l=r[0],u=r[1];!u||(s=Y.__PosthogExtensions__)!=null&&(s=s.integrations)!=null&&s[l]||t._s(bO[l],()=>{var c;(c=Y.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[l])==null||c.start(t._instance)}),!u&&(o=Y.__PosthogExtensions__)!=null&&(o=o.integrations)!=null&&o[l]&&((a=Y.__PosthogExtensions__)==null||(a=a.integrations)==null||(a=a[l])==null||a.stop())};for(var r of Object.entries((i=this._instance.config.integrations)!==null&&i!==void 0?i:{})){var i;n()}}}class SO{constructor(t,n){this.I=t,this.ns=n,this.To=new Map,this.Xn=!1}add(t){var n=this;return Ce(function*(){if(n.Xn)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(n.To.has(t.name))throw new Error('Browser extension "'+t.name+'" is already registered');n.To.set(t.name,t);try{var r=t.setup(n.ns);r&&(yield r)}catch(s){var i=n.To.get(t.name)===t;i&&n.To.delete(t.name),n.I.error('Failed to set up browser extension "'+t.name+'"',s),i&&n.Mo(t)}})()}dispose(){if(!this.Xn){this.Xn=!0;var t=Array.from(this.To.values()).reverse();for(var n of(this.To.clear(),t))this.Mo(n)}}Mo(t){try{var n=t.dispose==null?void 0:t.dispose();n&&vt(n.then)&&n.then(void 0,r=>{this.I.error('Failed to dispose browser extension "'+t.name+'"',r)})}catch(r){this.I.error('Failed to dispose browser extension "'+t.name+'"',r)}}}class CO{constructor(t){this._instance=t}initialize(){}get(t){var n=this._instance.persistence;if(typeof t=="string")return n==null?void 0:n.get_property(t);var r={};for(var i of t){var s=n==null?void 0:n.get_property(i);L(s)||(r[i]=s)}return r}set(t,n){var r;(r=this._instance.persistence)==null||r.register(typeof t=="string"?{[t]:n}:t)}remove(t){var n;(n=this._instance.persistence)==null||n.unregister(t)}}var k_="extensionsRemoteConfig";class kO{constructor(t){this.Xn=!1,this.instance=t,this.I=D,this.Eo=t.Io,this.kv=new CO(t),this.onEvent=n=>eu(this.instance.on("eventCaptured",r=>{try{n({event:r.event,properties:r.properties})}catch(i){this.I.error("Browser extension event listener failed",i)}})),this.onRemoteConfig=n=>{if(this.Xn)return eu(()=>{});var r=s=>{try{n(s)}catch(o){this.I.error("Browser extension remote config listener failed",o)}},i=this.instance.Ro.on(k_,r);return this.Eo&&r(this.Eo),eu(i)},this.Po=new SO(D.createLogger("[BrowserExtensions]"),this)}get logger(){return this.I}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var t;return(t=this.instance.get_property(Ya))!==null&&t!==void 0?t:this.distinctId}get deviceId(){var t=this.instance.get_property(Ya);return typeof t=="string"?t:void 0}get library(){return{name:Ee.LIB_NAME,version:Ee.LIB_VERSION}}get initialPersonProperties(){var t,n;return(t=(n=this.instance.persistence)==null?void 0:n.get_initial_props())!==null&&t!==void 0?t:{}}get groups(){return this.instance.getGroups()}get session(){try{var t,n,r,i,s=(t=this.instance.sessionManager)==null?void 0:t.checkAndGetSessionAndWindowId(!0);return{sessionId:(n=s==null?void 0:s.sessionId)!==null&&n!==void 0?n:"",windowId:(r=s==null?void 0:s.windowId)!==null&&r!==void 0?r:"",sessionStartTimestamp:(i=s==null?void 0:s.sessionStartTimestamp)!==null&&i!==void 0?i:0}}catch{return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get projectToken(){return this.instance.config.token}add(t){return this.Po.add(t)}capture(t,n,r){var i=this;return Ce(function*(){r?i.instance.capture(t,n,{timestamp:r.timestamp,uuid:r.uuid,$set:r.set,$set_once:r.setOnce}):i.instance.capture(t,n)})()}registerDynamicEventProperties(t){return eu(this.instance.Ao(t))}handleRemoteConfig(t){this.Xn||(this.Eo=t,this.instance.Ro.emit(k_,t))}sendRequest(t,n){var r=this;return Ce(function*(){var i;n===void 0&&(n={});var s=r.instance.requestRouter.endpointFor((i=n.target)!==null&&i!==void 0?i:"api",t),o={method:n.method,url:n.query?bl(s,n.query):s,data:n.body,headers:n.headers,timeout:n.timeoutMs,fireCallbackOnDrop:!0,transport:n.transport,compression:n.compression,timestampMode:n.sentAt};return n.transport==="sendBeacon"?(r.instance._send_request(o),{statusCode:202}):new Promise(a=>{o.callback=a,r.instance._send_request(o)})})()}dispose(){this.Xn||(this.Xn=!0,this.Po.dispose())}}var Ra={},Of=0,Ta=()=>{},P_='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',ea="Surveys module not available",R_="sanitize_properties is deprecated. Use before_send instead",oS="Invalid value for property_denylist config: ",PO=["token","distinct_id",fE],bs="posthog",aS=!lO&&(Mt==null?void 0:Mt.indexOf("MSIE"))===-1&&(Mt==null?void 0:Mt.indexOf("Mozilla"))===-1,Mf=e=>{var t;return $({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:PI(j==null?void 0:j.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Ta,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:e??"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:Ae&&ce(Ae==null?void 0:Ae.search)&&Ae.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:(I==null||(t=I.location)==null?void 0:t.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(n){D.error("Bad HTTP status: "+n.statusCode+" "+n.text)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:bp,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:Mp},error_tracking:{},_onCapture:Ta},(n=>({rageclick:n&&n>="2026-05-30"?{content_ignorelist:DI,ignore_text_selection:!0}:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:n&&n>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:n&&n>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:n&&n>="2026-05-30"?250:0,split_storage:!(!n||"2026-05-30">n),detect_google_search_app:!(!n||"2026-05-30">n),disable_capture_url_hashes:!(!n||"2026-06-25">n),cookieWinsOnConflict:!(!n||n==="unset"||"2026-08-29">n)}))(e))},RO=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],T_=e=>{var t={};for(var n of RO){var r=n[0],i=n[1];L(e[r])||(t[i]=e[r])}var s=_e({},t,e),o=e.__preview_external_dependency_versioned_paths;return L(o)||(L(e.strict_script_versioning)&&(s.strict_script_versioning=!!o),ce(o)&&L(e.asset_host)&&(s.asset_host=o)),Z(e.property_blacklist)&&(L(e.property_denylist)?s.property_denylist=e.property_blacklist:Z(e.property_denylist)?s.property_denylist=[...e.property_blacklist,...e.property_denylist]:D.error(oS+e.property_denylist)),s};class TO{constructor(){this.__forceAllowLocalhost=!1}get Fo(){return this.__forceAllowLocalhost}set Fo(t){D.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class qt{Oo(t,n){if(t){var r=this.To.indexOf(t);r!==-1&&this.To.splice(r,1)}return this.To.push(n),n.initialize==null||n.initialize(),n}Lo(){return this.config.cookieless_mode===lr||this.config.cookieless_mode===ki&&this.consent.isRejected()}$o(){if(!this.Lo()&&this.get_distinct_id()===fs){var t=this.persistence;if(t){this.Do()||t.load(!0);var n=this.get_distinct_id();if(!n||n===fs){var r=this.config.get_device_id($n());this.register({distinct_id:r,$device_id:r}),t.set_property(se,We)}this.No()}}}get decideEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}get flagsEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}constructor(){var t;this.webPerformance=new TO,this.qo=!1,this.version=Ee.LIB_VERSION,this.jo=new Set,this.Bo="",this.Ro=new Ac,this.To=[],this.Ho=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Mf(),this.SentryIntegration=GI,this.sentryIntegration=r=>function(i,s){var o=OE(i,s);return{name:IE,processEvent:a=>o(a)}}(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Uo=!1,this.zo=null,this.Wo=null,this.Vo=null,this.scrollManager=new pO(this),this.pageViewManager=new f_(this),this.rateLimiter=new nO(this),this.requestRouter=new yO(this),this.consent=new NI(this),this.externalIntegrations=new EO(this);var n=(t=qt.__defaultExtensionClasses)!==null&&t!==void 0?t:{};this.featureFlags=n.featureFlags&&new n.featureFlags(this),this.toolbar=n.toolbar&&new n.toolbar(this),this.surveys=n.surveys&&new n.surveys(this),this.conversations=n.conversations&&new n.conversations(this),this.logs=n.logs&&new n.logs(this),this.metrics=n.metrics&&new n.metrics(this),this.experiments=n.experiments&&new n.experiments(this),this.exceptions=n.exceptions&&new n.exceptions(this),this.people={set:(r,i,s)=>{var o=ce(r)?{[r]:i}:r;this.setPersonProperties(o),s==null||s({})},set_once:(r,i,s)=>{var o=ce(r)?{[r]:i}:r;this.setPersonProperties(void 0,o),s==null||s({})}},this.on("eventCaptured",r=>D.info('send "'+(r==null?void 0:r.event)+'"',r))}init(t,n,r){if(r&&r!==bs){var i,s=(i=Ra[r])!==null&&i!==void 0?i:new qt;return s._init(t,n,r),Ra[r]=s,Ra[bs][r]=s,s}return this._init(t,n,r)}_init(t,n,r){var i,s;n===void 0&&(n={});var o,a=ce(t)?t.trim():"";if(!a)return D.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return a!==((o=this.config)==null?void 0:o.token)?console.warn("[PostHog.js]","You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('"+a+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=Mf(n.defaults),n.debug=this.Go(n.debug),this.Zo=n,this.Qo=[],n.person_profiles?this.Wo=n.person_profiles:n.process_person&&(this.Wo=n.process_person);var l=Mf(n.defaults),u=T_(n),c=_e({},l,u,{name:r,token:a});Se(l.rageclick)&&Se(u.rageclick)&&(c.rageclick=_e({},l.rageclick,u.rageclick)),Se(l.session_recording)&&Se(u.session_recording)&&(c.session_recording=_e({},l.session_recording,u.session_recording)),this.set_config(c),this.config.on_xhr_error&&D.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:Et.GZipJS;var d=this.Do();if(this.persistence=new Sf(this.config,d),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Sf($({},this.config,{persistence:"sessionStorage"}),d,!1),this.Bo="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties",this.config.persistence!=="memory"&&!d&&we.Dr()){var f=we.Br(this.Bo);Z(f)&&f.forEach(S=>{ce(S)&&this.jo.add(S)})}else we.qr(this.Bo);var m=$({},this.persistence.props),_=$({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Jo=new dO(S=>this.Ko(S),this.config.request_queue_config),this.Yo=new hO(this),this.__request_queue=[];var p=this.Lo();if(p||(this.sessionManager=new S_(this),this.sessionPropsManager=new b_(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((S,P,C)=>{(C!=null&&C.activityTimeout||C!=null&&C.sessionPastMaximumLength||C!=null&&C.crossTabAdoption)&&this.Xo()})),this.tl(),this.config.__preview_deferred_init_extensions?(D.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.el(p)},0)):(D.info("Initializing extensions synchronously"),this.el(p)),Ee.DEBUG=Ee.DEBUG||this.config.debug,Ee.DEBUG&&D.info("Starting in debug mode",{this:this,config:n,thisC:$({},this.config),p:m,s:_}),!this.config.identity_distinct_id||(i=n.bootstrap)!=null&&i.distinctID||(n.bootstrap=$({},n.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),((s=n.bootstrap)==null?void 0:s.distinctID)!==void 0){var y=n.bootstrap.distinctID,h=this.get_distinct_id(),v=this.persistence.get_property(se);if(n.bootstrap.isIdentifiedID&&h!=null&&h!==y&&v===We)this.identify(y);else if(n.bootstrap.isIdentifiedID&&h!=null&&h!==y&&v===ot)D.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var x=this.config.get_device_id($n()),b=n.bootstrap.isIdentifiedID?x:y;this.persistence.set_property(se,n.bootstrap.isIdentifiedID?ot:We),this.register({distinct_id:y,$device_id:b})}}if(p)this.register_once({distinct_id:fs,$device_id:null},"");else if(!this.get_distinct_id()){var E=this.config.get_device_id($n());this.register_once({distinct_id:E,$device_id:E},""),this.persistence.set_property(se,We)}return Re(I,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),n.segment?function(S,P){var C=S.config.segment;if(!C)return P();(function(T,R){var N=T.config.segment;if(!N)return R();var M=F=>{var W=()=>F.anonymousId()||$n();T.config.get_device_id=W,F.id()&&(T.register({distinct_id:F.id(),$device_id:W()}),T.persistence.set_property(se,ot)),R()},z=N.user();"then"in z&&vt(z.then)?z.then(M):M(z)})(S,()=>{C.register((T=>{typeof Promise<"u"&&Promise.resolve||bf.warn("This browser does not have Promise support, and can not use the segment integration");var R=(N,M)=>{if(!M)return N;N.event.userId||N.event.anonymousId===T.get_distinct_id()||(bf.info("No userId set, resetting PostHog"),T.reset()),N.event.userId&&N.event.userId!==T.get_distinct_id()&&(bf.info("UserId set, identifying with PostHog"),T.identify(N.event.userId));var z=T.calculateEventProperties(M,N.event.properties);return N.event.properties=Object.assign({},z,N.event.properties),N};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:N=>R(N,N.event.event),page:N=>R(N,xs),identify:N=>R(N,gf),screen:N=>R(N,"$screen")}})(S)).then(()=>{P()})})}(this,()=>this.il()):this.il(),vt(this.config._onCapture)&&this.config._onCapture!==Ta&&(D.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",S=>this.config._onCapture(S.event,S))),this.config.ip&&D.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||function(){return eS.apply(this,arguments)}().then(S=>{S&&this.register({[pf]:S})}).catch(Ta),this}rl(t){var n=t;return ce(n.name)&&vt(n.setup)}nl(t,n){this.rl(t)?n.push(()=>{this.sl().add(t).catch(Ta)}):this.To.push(t)}tl(){var t,n,r,i,s,o,a=(t=(n=this.config.__extensionClasses)==null?void 0:n.featureFlags)!==null&&t!==void 0?t:(r=qt.__defaultExtensionClasses)==null?void 0:r.featureFlags;a&&(this.featureFlags&&this.featureFlags instanceof a||((i=this.al)==null||i.call(this),this.al=void 0,this.featureFlags=new a(this)),vt(this.featureFlags.onReloading)&&vt(this.featureFlags.setup)?this.al||(this.al=this.featureFlags.onReloading(()=>{this.Ro.emit("featureFlagsReloading",!0)}),this.sl().add(this.featureFlags)):(s=(o=this.featureFlags).initialize)==null||s.call(o))}el(t){var n,r,i,s,o,a,l,u=performance.now(),c=$({},qt.__defaultExtensionClasses,this.config.__extensionClasses),d=[];c.exceptions&&this.To.push(this.exceptions=(n=this.exceptions)!==null&&n!==void 0?n:new c.exceptions(this)),c.historyAutocapture&&this.To.push(this.historyAutocapture=new c.historyAutocapture(this)),c.tracingHeaders&&this.To.push(this.tracingHeaders=new c.tracingHeaders(this)),c.siteApps&&this.To.push(this.siteApps=new c.siteApps(this)),c.sessionRecording&&!t&&this.To.push(this.sessionRecording=new c.sessionRecording(this)),this.config.disable_scroll_properties||d.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),c.autocapture&&this.nl(this.autocapture=new c.autocapture(this),d),c.surveys&&this.nl(this.surveys=(r=this.surveys)!==null&&r!==void 0?r:new c.surveys(this),d),c.logs&&this.To.push(this.logs=(i=this.logs)!==null&&i!==void 0?i:new c.logs(this)),c.metrics&&this.To.push(this.metrics=(s=this.metrics)!==null&&s!==void 0?s:new c.metrics(this)),c.conversations&&this.To.push(this.conversations=(o=this.conversations)!==null&&o!==void 0?o:new c.conversations(this)),c.productTours&&this.To.push(this.productTours=new c.productTours(this)),c.heatmaps&&this.To.push(this.heatmaps=new c.heatmaps(this)),c.webVitalsAutocapture&&this.To.push(this.webVitalsAutocapture=new c.webVitalsAutocapture(this)),c.exceptionObserver&&this.To.push(this.exceptionObserver=new c.exceptionObserver(this)),c.deadClicksAutocapture&&this.To.push(this.deadClicksAutocapture=new c.deadClicksAutocapture(this,HI)),c.toolbar&&this.To.push(this.toolbar=(a=this.toolbar)!==null&&a!==void 0?a:new c.toolbar(this)),c.experiments&&this.To.push(this.experiments=(l=this.experiments)!==null&&l!==void 0?l:new c.experiments(this)),this.To.forEach(f=>{f.initialize&&d.push(()=>{f.initialize==null||f.initialize()})}),d.push(()=>{if(this.ol){var f=this.ol;this.ol=void 0,this.To.forEach(m=>m.onRemoteConfig==null?void 0:m.onRemoteConfig(f))}}),this.ll(d,u)}ll(t,n){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&t.length>0)return void setTimeout(()=>{this.ll(t,n)},0);var r=t.shift();if(r)try{r()}catch(s){D.error("Error initializing extension:",s)}}var i=Math.round(performance.now()-n);this.register_for_session({[hE]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[pE]:i}),this.config.__preview_deferred_init_extensions&&D.info("PostHog extensions initialized ("+i+"ms)")}pa(t){var n;if(!j||!j.body)return D.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.pa(t)},500);if(this.config.__preview_deferred_init_extensions&&(this.ol=t),this.Io=t,this.compression=void 0,t.ok){var r,i=t.config;i.supportedCompression&&!this.config.disable_compression&&(this.compression=J(i.supportedCompression,Et.GZipJS)?Et.GZipJS:J(i.supportedCompression,Et.Base64)?Et.Base64:void 0),(r=i.analytics)!=null&&r.endpoint&&(this.analyticsDefaultEndpoint=i.analytics.endpoint)}this.set_config({person_profiles:this.Wo?this.Wo:bp}),(n=this.ul)==null||n.handleRemoteConfig(t),this.To.forEach(s=>s.onRemoteConfig==null?void 0:s.onRemoteConfig(t))}il(){try{this.config.loaded(this)}catch(r){D.critical("`loaded` function failed",r)}if(this.hl(),this.config.internal_or_test_user_hostname&&Ae!=null&&Ae.hostname){var t=Ae.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?t===n:n.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.Lo())&&this.dl()},1),this.vl=new UE(this),this.vl.load()}hl(){var t;this.is_capturing()&&this.config.request_batching&&((t=this.Jo)==null||t.enable())}_dom_loaded(){this.is_capturing()&&Ql(this.__request_queue,t=>this.Ko(t)),this.__request_queue=[],this.hl()}_handle_unload(){var t,n,r,i,s;(t=this.surveys)==null||t.handlePageUnload==null||t.handlePageUnload(),(n=this.metrics)==null||n.flush("sendBeacon"),this.config.request_batching?(this.cl()&&this.capture(vf),(r=this.logs)==null||r.flushLogs("sendBeacon"),(i=this.Jo)==null||i.unload(),(s=this.Yo)==null||s.unload()):this.cl()&&this.capture(vf,null,{transport:"sendBeacon"})}_send_request(t){this.__loaded?aS?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)?t.fireCallbackOnDrop&&(t.callback==null||t.callback({statusCode:429})):(t.transport=t.transport||this.config.api_transport,t.headers=$({},this.config.request_headers,t.headers),t.compression=t.compression==="best-available"?this.compression:t.compression,(L(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(n=>{var r,i,s,o=$({},n);o.timeout=o.timeout||6e4;var a,l,u,c,d,f=(r=o.transport)!==null&&r!==void 0?r:"fetch";f==="sendBeacon"&&L(o.compression)&&o.data&&(o.compression=Et.Base64),o.method==="POST"&&o.data&&(o.timestampMode==="capture-body"?o.data={api_key:(l=(d=(c=(Z(a=o.data)?a:[a]).map(y=>$({},y,y.timestamp instanceof Date&&!isNaN(y.timestamp.getTime())?{timestamp:y.timestamp.toISOString()}:{})))[0])==null||(u=d.properties)==null?void 0:u.token)!==null&&l!==void 0?l:d==null?void 0:d.token,batch:c,sent_at:new Date().toISOString()}:o.timestampMode==="body"&&(o.data=function(y,h){return h===void 0&&(h=new Date().toISOString()),Z(y)?y.map(v=>$({},v,{sent_at:h})):$({},y,{sent_at:h})}(o.data))),o.url=x_(o.url,o.method,o.compression,o.timestampMode);var m=Mu.filter(y=>!o.disableTransport||!y.transport||!o.disableTransport.includes(y.transport)),_=(i=(s=function(y,h){for(var v=0;y.length>v;v++)if(y[v].transport===f)return y[v]}(m))==null?void 0:s.method)!==null&&i!==void 0?i:m[0].method;if(!_)throw new Error("No available transport method");var p=y=>{try{_(y)}catch(h){XE(h)?D.warn(h):D.error(h),o.callback==null||o.callback({statusCode:0,error:h})}};f!=="sendBeacon"&&o.data&&o.compression===Et.GZipJS&&ET&&typeof Promise<"u"&&!Ou?uO(o).then(y=>{p(y)}).catch(y=>{if(Ly(y))return Ou=!0,void p($({},o,{compression:void 0,url:x_(n.url,n.method,void 0,n.timestampMode)}));(h=>{if(!h||typeof h!="object")return!1;var v="name"in h?String(h.name):"";return Ly(h)||v===Eb})(y)&&(Ou=!0),p(o)}):_(o)})($({},t,{callback:n=>{var r,i;this.rateLimiter.checkForLimiting(n),400>n.statusCode||(r=(i=this.config).on_request_error)==null||r.call(i,n),t.callback==null||t.callback(n)}}))):t.fireCallbackOnDrop&&(t.callback==null||t.callback({statusCode:0}))}Ko(t){this.Yo?this.Yo.retriableRequest(t):this._send_request(t)}_execute_array(t){Of++;try{var n,r=[],i=[],s=[];Ql(t,a=>{if(a)if(Z(n=a[0]))s.push(a);else if(vt(a))try{a.call(this)}catch(l){D.error("Error executing queued PostHog call",a,l)}else Z(a)&&n==="alias"?r.push(a):Z(a)&&n.indexOf("capture")!==-1&&vt(this[n])?s.push(a):i.push(a)});var o=function(a,l){Ql(a,function(u){try{if(Z(u[0])){var c=l;ve(u,function(d){c=c[d[0]].apply(c,d.slice(1))})}else l[u[0]].apply(l,u.slice(1))}catch(d){D.error("Error executing queued PostHog call",u,d)}})};o(r,this),o(i,this),o(s,this)}finally{Of--}}push(t){if(Of>0&&Z(t)&&ce(t[0])){var n=qt.prototype[t[0]];vt(n)&&n.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,n,r){var i,s,o,a,l;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Jo){if(this.is_capturing())if(!L(t)&&ce(t)){this.$o();var u=!this.config.opt_out_useragent_filter&&this._is_bot();if(!u||this.config.__preview_capture_bot_pageviews){var c=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(c==null||!c.isRateLimited){n!=null&&n.$current_url&&!ce(n==null?void 0:n.$current_url)&&(D.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),t!=="$exception"||r!=null&&r.fl||D.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var d=new Date,f=(r==null?void 0:r.timestamp)||d,m=Vy(r==null?void 0:r.uuid,$n),_={uuid:m,event:t,properties:this.calculateEventProperties(t,n||{},f,m)};t===xs&&this.config.__preview_capture_bot_pageviews&&u&&(_.event="$bot_pageview",_.properties.$browser_type="bot"),c&&(_.properties.$lib_rate_limit_remaining_tokens=c.remainingTokens);var p=t==="$feature_flag_called"&&_.properties.$feature_flag_has_experiment===!1&&this.get_property(xc)===!0;r!=null&&r.$set&&!p&&(_.$set=r==null?void 0:r.$set);var y=r==null?void 0:r.$unset;y&&(_.$unset=y);var h,v,x,b=p?void 0:this.pl(r==null?void 0:r.$set_once,t!==Yy,t===gf);if(b&&(_.$set_once=b),r!=null&&r._noTruncate||(s=this.config.properties_string_max_length,o=_,a=M=>ce(M)?M.slice(0,s):M,l=new Set,_=function M(z,F){if(z!==Object(z))return a?a(z):z;if(!l.has(z)){var W;if(l.add(z),Z(z))W=[],Ql(z,Q=>{W.push(M(Q))});else{var B={};ve(z,(Q,O)=>{l.has(Q)||(B[O]=M(Q))}),W=B}return W}}(o)),_.timestamp=f,L(r==null?void 0:r.timestamp)||(_.properties.$event_time_override_provided=!0,_.properties.$event_time_override_system_time=d),p&&(_.properties=function(M,z){z===void 0&&(z=[]);var F={},W=B=>{M[B]!==void 0&&(F[B]=M[B])};return ST.forEach(W),z.forEach(W),F}(_.properties,PO)),t===ur.DISMISSED||t===ur.SENT){var E=n==null?void 0:n[kf.SURVEY_ID],S=n==null?void 0:n[kf.SURVEY_ITERATION];sS({id:E,current_iteration:S}),_.$set=$({},_.$set,{[(h={id:E,current_iteration:S},v=t===ur.SENT?"responded":"dismissed",x="$survey_"+v+"/"+h.id,h.current_iteration&&h.current_iteration>0&&(x="$survey_"+v+"/"+h.id+"/"+h.current_iteration),x)]:!0})}else t===ur.SHOWN&&(_.$set=$({},_.$set,{[kf.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(t===tO.SHOWN){var P=n==null?void 0:n[v_.TOUR_TYPE];P&&(_.$set=$({},_.$set,{[v_.TOUR_LAST_SEEN_DATE+"/"+P]:new Date().toISOString()}))}var C=$({},_.properties.$set,_.$set);if(En(C)||this.setPersonPropertiesForFlags(C),!ne(this.config.before_send)){var T=this.kn(_);if(!T)return;(_=T).uuid=Vy(_.uuid,$n)}this.Ro.emit("eventCaptured",_);var R=(i=r==null?void 0:r._url)!==null&&i!==void 0?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),N={method:"POST",url:R,data:_,compression:"best-available",timestampMode:(r==null?void 0:r._batchKey)==="recordings"||/\/s\/(?:\?|$)/.test(R)?"body":"capture-body",batchKey:r==null?void 0:r._batchKey,transport:r==null?void 0:r.transport};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.Ko(N):this.Jo.enqueue(N),_}D.critical("This capture call is ignored due to client rate limiting.")}}else D.error("No event name provided to posthog.capture")}else D.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",n=>t(n.event,n))}sl(){var t;return(t=this.ul)!==null&&t!==void 0?t:this.ul=new kO(this)}Ao(t){this.Ho.push(t);var n=!0;return()=>{if(n){n=!1;var r=this.Ho.indexOf(t);r!==-1&&this.Ho.splice(r,1)}}}gl(t){var n,r,i;return t===void 0&&(t=!0),!((n=this.persistence)==null||!n.consumeCookieIdentityChange())&&(this.Vo=null,this.persistence.get_property(se)===We&&((i=this.sessionPersistence)==null||i.clear(),this.jo.clear(),this.ml()),(r=this.featureFlags)==null||r.reset(),t&&this.reloadFeatureFlags(),!0)}calculateEventProperties(t,n,r,i,s){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;this.persistence.syncCookieProperties(),this.gl();var o=s?void 0:this.persistence.remove_event_timer(t),a=$({},n);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this.Lo()&&(a[fE]=!0),t==="$snapshot"){var l=$({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!ce(a.distinct_id)&&!Ge(a.distinct_id)||cc(a.distinct_id))&&D.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,c=function(E,S,P,C){var T,R,N,M;if(C===void 0&&(C=!1),!Mt)return{};var z,F=E?[...Co,...S||[]]:[],W=function(us){for(var It=0;zy.length>It;It++){var cs=zy[It],Cr=cs[1],pn=cs[0].exec(us),Do=pn&&(vt(Cr)?Cr(pn,us):Cr);if(Do)return Do}return["",""]}(Mt),B=W[0],Q=W[1],O=(z=typeof navigator<"u"?navigator:void 0)!=null&&z.brave?{brave:!0}:{},A={};L(P)||(A.detectGoogleSearchApp=P);var V={},K=(T=navigator)==null||(T=T.userAgentData)==null?void 0:T.platform,te=(R=navigator)==null?void 0:R.maxTouchPoints,oe=I==null||(N=I.screen)==null?void 0:N.width,de=I==null||(M=I.screen)==null?void 0:M.height,be=I==null?void 0:I.devicePixelRatio;L(K)||(V.userAgentDataPlatform=K),L(te)||(V.maxTouchPoints=te),L(oe)||(V.screenWidth=oe),L(de)||(V.screenHeight=de),L(be)||(V.devicePixelRatio=be);var Pe,Be,ye,Fe,Tt,Sr,_t,Ye,gi=_e(Sg({$os:B,$os_version:Q,$browser:Yb(Mt,navigator.vendor,O,A),$device:Uy(Mt),$device_type:(Be=Mt,ye=V,Ye=Uy(Be),Ye===Mb||Ye===Ob||Ye==="Kobo"||Ye==="Kindle Fire"||Ye===Wb?wo:Ye===Ka||Ye===Hs||Ye===Qa||Ye===ip?"Console":Ye===Nb?"Wearable":Ye?Yt:(ye==null?void 0:ye.userAgentDataPlatform)==="Android"&&((Fe=ye==null?void 0:ye.maxTouchPoints)!==null&&Fe!==void 0?Fe:0)>0?600>Math.min((Tt=ye==null?void 0:ye.screenWidth)!==null&&Tt!==void 0?Tt:0,(Sr=ye==null?void 0:ye.screenHeight)!==null&&Sr!==void 0?Sr:0)/((_t=ye==null?void 0:ye.devicePixelRatio)!==null&&_t!==void 0?_t:1)?Yt:wo:"Desktop"),$timezone:zE(),$timezone_offset:JI()}),{$current_url:Za(C?li(Ae==null?void 0:Ae.href):Ae==null?void 0:Ae.href,F,el),$host:Ae==null?void 0:Ae.host,$pathname:Ae==null?void 0:Ae.pathname,$raw_user_agent:Mt.length>1e3?Mt.substring(0,997)+"...":Mt,$browser_version:GT(Mt,navigator.vendor,O,A),$browser_language:h_(),$browser_language_prefix:(Pe=h_(),typeof Pe=="string"?Pe.split("-")[0]:void 0),$screen_height:I==null?void 0:I.screen.height,$screen_width:I==null?void 0:I.screen.width,$viewport_height:I==null?void 0:I.innerHeight,$viewport_width:I==null?void 0:I.innerWidth,$lib:Ee.LIB_NAME,$lib_version:Ee.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return Ee.SDK_DIST_CHANNEL&&(gi.$sdk_dist_channel=Ee.SDK_DIST_CHANNEL),gi}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var d=this.sessionManager.checkAndGetSessionAndWindowId(s,r.getTime(),!0),f=d.windowId;a.$session_id=d.sessionId,a.$window_id=f}this.sessionPropsManager&&_e(a,this.sessionPropsManager.getSessionProps());try{var m;this.sessionRecording&&_e(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=(m=this.Yo)==null?void 0:m.length}catch(E){a.$sdk_debug_error_capturing_properties=String(E)}if(this.requestRouter.region===Ap&&(a.$lib_custom_api_host=this.config.api_host),u=t!==xs||s?t!==vf||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,i),a=_e(a,u),t===xs&&j&&(a.title=j.title),!L(o)){var _=r.getTime()-o;a.$duration=parseFloat((_/1e3).toFixed(3))}Mt&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser");var p=this.persistence.properties(),y=this.sessionPersistence.properties();ve(["$referrer","$referring_domain"],E=>{E in p&&delete y[E]});var h={};if(this.Ho.length>0)for(var v of this.Ho.slice())try{_e(h,v())}catch(E){D.error("Failed to produce browser extension event properties",E)}(a=_e({},c,p,y,$({},h,a))).$is_identified=this._isIdentified(),Z(this.config.property_denylist)?ve(this.config.property_denylist,function(E){delete a[E]}):D.error(oS+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var x=this.config.sanitize_properties;x&&(D.error(R_),a=x(a,t));var b=this.yl();return a.$process_person_profile=b,b&&!s&&this.bl("_calculate_event_properties"),a}pl(t,n,r){var i;if(n===void 0&&(n=!0),r===void 0&&(r=!1),!this.persistence||!this.yl()||this.qo&&!r)return t;var s=this.persistence.get_initial_props(),o=(i=this.sessionPropsManager)==null?void 0:i.getSetOnceProps(),a=_e({},s,o||{},t||{}),l=this.config.sanitize_properties;return l&&(D.error(R_),a=l(a,"$set_once")),n&&(this.qo=!0),En(a)?void 0:a}register(t,n){var r;(r=this.persistence)==null||r.register(t,n)}register_once(t,n,r){var i;(i=this.persistence)==null||i.register_once(t,n,r)}register_for_session(t){var n,r;(n=this.persistence)==null||n.syncCookieProperties(),this.gl(),(r=this.sessionPersistence)==null||r.register(t),Object.keys(t).forEach(i=>this.jo.add(i)),this.ml()}unregister(t){var n;(n=this.persistence)==null||n.unregister(t)}unregister_for_session(t){var n;(n=this.sessionPersistence)==null||n.unregister(t),this.jo.delete(t),this.ml()}_l(t,n){this.register({[t]:n})}Xo(){this.jo.forEach(t=>{var n;(n=this.sessionPersistence)==null||n.unregister(t)}),this.jo.clear(),this.ml()}ml(){var t;if(this.Bo)if(this.config.persistence==="memory"||(t=this.sessionPersistence)!=null&&t.Hs||!we.Dr())we.qr(this.Bo);else{var n=[];this.jo.forEach(r=>n.push(r)),n.length>0?we.Nr(this.Bo,n):we.qr(this.Bo)}}getFeatureFlag(t,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlag(t,n)}getFeatureFlagPayload(t){var n;return(n=this.featureFlags)==null?void 0:n.getFeatureFlagPayload(t)}getFeatureFlagResult(t,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlagResult(t,n)}getAllFeatureFlags(){var t,n;return(t=(n=this.featureFlags)==null?void 0:n.getAllFeatureFlags())!==null&&t!==void 0?t:[]}isFeatureEnabled(t,n){var r,i;return(r=(i=this.featureFlags)==null?void 0:i.isFeatureEnabled(t,n))!==null&&r!==void 0?r:n==null?void 0:n.defaultValue}reloadFeatureFlags(){var t;(t=this.featureFlags)==null||t.reloadFeatureFlags()}updateFlags(t,n,r){var i;(i=this.featureFlags)==null||i.updateFlags(t,n,r)}updateEarlyAccessFeatureEnrollment(t,n,r){var i;(i=this.featureFlags)==null||i.updateEarlyAccessFeatureEnrollment(t,n,r)}getEarlyAccessFeatures(t,n,r){var i;return n===void 0&&(n=!1),(i=this.featureFlags)==null?void 0:i.getEarlyAccessFeatures(t,n,r)}on(t,n){return this.Ro.on(t,n)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:ea}),()=>{})}onSessionId(t){var n,r;return(n=(r=this.sessionManager)==null?void 0:r.onSessionId(t))!==null&&n!==void 0?n:()=>{}}getSurveys(t,n){n===void 0&&(n=!1),this.surveys?this.surveys.getSurveys(t,n):t([],{isLoaded:!1,error:ea})}getActiveMatchingSurveys(t,n){n===void 0&&(n=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,n):t([],{isLoaded:!1,error:ea})}renderSurvey(t,n){var r;(r=this.surveys)==null||r.renderSurvey(t,n)}displaySurvey(t,n){var r;n===void 0&&(n=wO),(r=this.surveys)==null||r.displaySurvey(t,n)}cancelPendingSurvey(t){var n;(n=this.surveys)==null||n.cancelPendingSurvey(t)}canRenderSurvey(t){var n,r;return(n=(r=this.surveys)==null?void 0:r.canRenderSurvey(t))!==null&&n!==void 0?n:{visible:!1,disabledReason:ea}}canRenderSurveyAsync(t,n){var r,i;return n===void 0&&(n=!1),(r=(i=this.surveys)==null?void 0:i.canRenderSurveyAsync(t,n))!==null&&r!==void 0?r:Promise.resolve({visible:!1,disabledReason:ea})}wl(t){return!t||cc(t)?(D.critical("Unique user id has not been set in posthog.identify"),!1):t===fs?(D.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(t.toLowerCase())&&!["undefined","null"].includes(t.toLowerCase())||(D.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(t,n,r){if(!this.__loaded||!this.persistence)return D.uninitializedWarning("posthog.identify");if(Ge(t)&&(t=t.toString(),D.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.wl(t)&&this.bl("posthog.identify")){this.$o();var i=this.get_distinct_id(),s=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==i,o=this.gl(!1),a=this.persistence.Ws(),l=!1;try{var u=this.get_distinct_id();this.register({$user_id:t}),this.get_property(Ya)||this.register_once({$had_persisted_distinct_id:!0,$device_id:u},""),t!==u&&t!==this.get_property($s)&&(this.unregister($s),this.register({distinct_id:t}));var c,d=(this.persistence.get_property(se)||We)===We,f=t!==u,m=!f&&d;if(f&&d)this.persistence.set_property(se,ot),this.setPersonPropertiesForFlags({$set:n||{},$set_once:r||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.Vs(),this.capture(gf,{distinct_id:t,$anon_distinct_id:u},{$set:n||{},$set_once:r||{}}),this.Vo=If(t,n,r),(c=this.featureFlags)==null||c.setAnonymousDistinctId(u);else if(m){this.persistence.set_property(se,ot);var _=n||{},p=r||{};this.setPersonPropertiesForFlags({$set:_,$set_once:p},!1),this.config.cookieWinsOnConflict&&this.persistence.Vs(),this.capture("$set",{$set:_,$set_once:p}),this.Vo=If(t,n,r)}else(n||r)&&this.setPersonProperties(n,r);f||s||o?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(ar)):m&&(n||r)&&this.reloadFeatureFlags(),l=!0}finally{a&&this.persistence.Qs(l)}}}setPersonProperties(t,n){if((t||n)&&this.bl("posthog.setPersonProperties")){var r=If(this.get_distinct_id(),t,n);this.Vo!==r?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:n||{}},!0),this.capture("$set",{$set:t||{},$set_once:n||{}}),this.Vo=r):D.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var n,r=(Z(t)?t:[t]).filter(i=>ce(i)&&i.length>0);r.length!==0&&this.bl("posthog.unsetPersonProperties")&&((n=this.featureFlags)==null||n.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.Vo=null)}group(t,n,r){var i;if(t&&n){(i=this.persistence)==null||i.syncCookieProperties(),this.gl();var s=this.getGroups(),o=s[t]!==n;if(o&&this.resetGroupPropertiesForFlags(t),this.register({$groups:$({},s,{[t]:n})}),o||r){var a={$group_type:t,$group_key:n};r&&(a.$group_set=r),this.capture(Yy,a)}r&&this.setGroupPropertiesForFlags({[t]:r}),o&&!r&&this.reloadFeatureFlags()}else D.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,n){var r;n===void 0&&(n=!0),(r=this.featureFlags)==null||r.setPersonPropertiesForFlags(t,n)}resetPersonPropertiesForFlags(t){var n;t===void 0&&(t=!0),(n=this.featureFlags)==null||n.resetPersonPropertiesForFlags(t)}setGroupPropertiesForFlags(t,n){var r;n===void 0&&(n=!0),this.bl("posthog.setGroupPropertiesForFlags")&&((r=this.featureFlags)==null||r.setGroupPropertiesForFlags(t,n))}resetGroupPropertiesForFlags(t){var n;(n=this.featureFlags)==null||n.resetGroupPropertiesForFlags(t)}reset(t){var n=$t(t)?t:t==null?void 0:t.resetDeviceID,r=$t(t)||t==null?void 0:t.bootstrap;this.kl(n,!1,r)}kl(t,n,r){var i,s,o;if(n===void 0&&(n=!1),D.info("reset"),!this.__loaded)return D.uninitializedWarning("posthog.reset");var a=r==null?void 0:r.sessionID;this.config.bootstrap=r||((i=this.Zo)==null?void 0:i.bootstrap)||{},(s=this.featureFlags)==null||s.updateConfig==null||s.updateConfig(this.config,this.ma());var l=this.get_property(Ya),u=this.get_property(pf),c=this.get_property(Oi),d=this.is_capturing();this.consent.reset(),n||!d||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");var f=(o=this.persistence)==null||o.Ws==null?void 0:o.Ws(),m=!1;try{var _,p,y,h,v,x,b,E,S,P,C,T,R,N;if((_=this.persistence)==null||_.clear(),(p=this.sessionPersistence)==null||p.clear(),this.jo.clear(),this.ml(),L(c)||(C=this.persistence)==null||C.register({[Oi]:c}),(y=this.surveys)==null||y.reset(),(h=this.vl)==null||h.stop(),(v=this.featureFlags)==null||v.reset(),(x=this.conversations)==null||x.reset(),(b=this.logs)==null||b.reset(),(E=this.metrics)==null||E.reset(),(S=this.persistence)==null||S.set_property(se,We),(P=this.sessionManager)==null||P.resetSessionId(),this.Vo=null,this.config.cookieless_mode===lr)this.register_once({distinct_id:fs,$device_id:null},"");else{var M=this.config.get_device_id($n());this.register_once({distinct_id:M,$device_id:t?M:l},""),t||L(u)||this.register({[pf]:u})}if(this.register({$last_posthog_reset:new Date().toISOString()},1),r&&(r.distinctID===void 0||this.Lo()||((N=this.persistence)==null||N.set_property(se,r.isIdentifiedID?ot:We),this.register({distinct_id:r.distinctID})),(T=this.featureFlags)==null||T.initialize(),!(L(a)||(R=this.sessionManager)!=null&&R.setBootstrapSessionId(a,!0)))){var z=$({},r);delete z.sessionID,this.config.bootstrap=z}delete this.config.identity_distinct_id,delete this.config.identity_hash,m=!0}finally{var F;f&&((F=this.persistence)==null||F.Qs==null||F.Qs(m))}this.reloadFeatureFlags()}shutdown(t){var n=this;return Ce(function*(){var r,i,s,o,a,l;if(n.__loaded){(r=n.vl)==null||r.stop(),n.sl().dispose(),(i=n.sessionRecording)==null||i.dispose(),(s=n.logs)==null||s.flushLogs("sendBeacon"),(o=n.metrics)==null||o.flush("sendBeacon"),(a=n.Jo)==null||a.unload(),(l=n.Yo)==null||l.unload();try{var u;(u=n.featureFlags)==null||u.destroy()}catch(c){D.error("Error while destroying feature flags",c)}}else D.uninitializedWarning("posthog.shutdown")})()}setIdentity(t,n){var r;this.config.identity_distinct_id=t,this.config.identity_hash=n,this.alias(t),(r=this.conversations)==null||r.Sl()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,(t=this.conversations)==null||t.xl()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,n;return(t=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&t!==void 0?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var n=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=n.sessionStartTimestamp,i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n.sessionId);if(t!=null&&t.withTimestamp&&r){var s,o=(s=t.timestampLookBack)!==null&&s!==void 0?s:10;if(!r)return i;i+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-o,0)}return i}alias(t,n){return t===this.get_property(sE)?(D.critical("Attempting to create alias for existing People user - aborting."),-2):this.bl("posthog.alias")?(L(n)&&(n=this.get_distinct_id()),t!==n?(this._l($s,t),this.capture("$create_alias",{alias:t,distinct_id:n})):(D.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var n=$({},this.config);if(Se(t)){var r,i,s,o,a,l,u,c,d,f,m,_;_e(this.config,T_(t));var p=this.Do();(r=this.persistence)==null||r.update_config(this.config,n,p),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Sf($({},this.config,{persistence:"sessionStorage"}),p,!1);var y,h=this.Go(this.config.debug);$t(h)&&(this.config.debug=h),$t(this.config.debug)&&(this.config.debug?(Ee.DEBUG=!0,ge.Dr()&&ge.Nr("ph_debug",!0),D.info("set_config",{config:t,oldConfig:n,newConfig:$({},this.config)})):(Ee.DEBUG=!1,ge.Dr()&&ge.qr("ph_debug"))),(i=this.featureFlags)==null||i.updateConfig==null||i.updateConfig(this.config,this.ma()),(s=this.exceptionObserver)==null||s.onConfigChange(),(o=this.exceptions)==null||o.onConfigChange(),(a=this.sessionRecording)==null||a.startIfEnabledOrStop(),(l=this.tracingHeaders)==null||l.startIfEnabledOrStop(),(u=this.autocapture)==null||u.startIfEnabled(),(c=this.heatmaps)==null||c.startIfEnabled(),("capture_pageview"in t||"disable_capture_url_hashes"in t)&&((y=this.historyAutocapture)==null||y.startIfEnabledOrStop()),(d=this.exceptionObserver)==null||d.startIfEnabledOrStop(),(f=this.deadClicksAutocapture)==null||f.startIfEnabledOrStop(),(m=this.surveys)==null||m.loadIfEnabled(),this.No(),(_=this.externalIntegrations)==null||_.startIfEnabledOrStop()}}_overrideSDKInfo(t,n){Ee.LIB_NAME=t,Ee.LIB_VERSION=n}startSessionRecording(t){var n,r,i,s,o,a=t===!0,l={sampling:a||!(t==null||!t.sampling),linked_flag:a||!(t==null||!t.linked_flag),url_trigger:a||!(t==null||!t.url_trigger),event_trigger:a||!(t==null||!t.event_trigger)};Object.values(l).some(Boolean)&&((n=this.sessionManager)==null||n.checkAndGetSessionAndWindowId(),l.sampling&&((r=this.sessionRecording)==null||r.overrideSampling()),l.linked_flag&&((i=this.sessionRecording)==null||i.overrideLinkedFlag()),l.url_trigger&&((s=this.sessionRecording)==null||s.overrideTrigger("url")),l.event_trigger&&((o=this.sessionRecording)==null||o.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!((t=this.sessionRecording)==null||!t.started)}captureException(t,n){if(this.exceptions){var r=new Error("PostHog syntheticException"),i=this.exceptions.buildProperties(t,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent($({},i,n))}}addExceptionStep(t,n){var r;(r=this.exceptions)==null||r.addExceptionStep(t,n)}captureLog(t){var n;(n=this.logs)==null||n.captureLog(t)}get logger(){var t,n;return(t=(n=this.logs)==null?void 0:n.logger)!==null&&t!==void 0?t:qt.Cl}startExceptionAutocapture(t){this.set_config({capture_exceptions:t==null||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var n,r;return(n=(r=this.toolbar)==null?void 0:r.loadToolbar(t))!==null&&n!==void 0&&n}get_property(t){var n;return(n=this.persistence)==null?void 0:n.props[t]}getSessionProperty(t){var n;return(n=this.sessionPersistence)==null?void 0:n.props[t]}toString(){var t,n=(t=this.config.name)!==null&&t!==void 0?t:bs;return n!==bs&&(n=bs+"."+n),n}_isIdentified(){var t,n;return((t=this.persistence)==null?void 0:t.get_property(se))===ot||((n=this.sessionPersistence)==null?void 0:n.get_property(se))===ot}yl(){var t,n;return!(this.config.person_profiles==="never"||this.config.person_profiles===bp&&!this._isIdentified()&&En(this.getGroups())&&((t=this.persistence)==null||(t=t.props)==null||!t[$s])&&((n=this.persistence)==null||(n=n.props)==null||!n[Sc]))}cl(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&!!this.config.capture_pageview}createPersonProfile(){this.yl()||this.bl("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.bl("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}bl(t){return this.config.person_profiles==="never"?(D.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._l(Sc,!0),!0)}Do(){if(this.config.cookieless_mode==="always")return!0;var t=this.consent.isOptedOut();return this.config.disable_persistence||t&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==ki)}No(){var t,n,r,i,s=this.Do();return((t=this.persistence)==null?void 0:t.Hs)!==s&&((r=this.persistence)==null||r.set_disabled(s)),((n=this.sessionPersistence)==null?void 0:n.Hs)!==s&&((i=this.sessionPersistence)==null||i.set_disabled(s)),s&&(this.jo.clear(),this.ml()),s}opt_in_capturing(t){var n;if(this.config.cookieless_mode!==lr){if(this.Lo()){var r,i,s,o,a;this.kl(!0,!0),(r=this.sessionManager)==null||r.destroy(),(i=this.pageViewManager)==null||i.destroy(),this.sessionManager=new S_(this),this.pageViewManager=new f_(this),this.persistence&&(this.sessionPropsManager=new b_(this,this.sessionManager,this.persistence));var l,u=(s=(o=this.config.__extensionClasses)==null?void 0:o.sessionRecording)!==null&&s!==void 0?s:(a=qt.__defaultExtensionClasses)==null?void 0:a.sessionRecording;u&&(this.sessionRecording=this.Oo(this.sessionRecording,new u(this)),this.Io&&((l=this.sessionRecording)==null||l.onRemoteConfig==null||l.onRemoteConfig(this.Io)))}var c,d;this.consent.optInOut(!0),this.No(),this.hl(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode==ki&&((c=this.surveys)==null||c.loadIfEnabled()),(L(t==null?void 0:t.captureEventName)||t!=null&&t.captureEventName)&&this.capture((d=t==null?void 0:t.captureEventName)!==null&&d!==void 0?d:"$opt_in",t==null?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.dl()}else D.warn(P_)}opt_out_capturing(){var t,n,r;this.config.cookieless_mode!==lr?(this.config.cookieless_mode===ki&&this.consent.isOptedIn()&&this.kl(!0,!0),this.consent.optInOut(!1),this.No(),this.config.cookieless_mode===ki&&(this.register({distinct_id:fs,$device_id:null}),(t=this.sessionRecording)==null||t.stopRecording(),this.sessionRecording=void 0,(n=this.sessionManager)==null||n.destroy(),(r=this.pageViewManager)==null||r.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.dl(),this.hl())):D.warn(P_)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return t===1?"granted":t===0?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===lr||(this.config.cookieless_mode===ki?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.No()}_is_bot(){return St?ZE(St,this.config.custom_blocked_useragents):void 0}dl(){j&&(j.visibilityState==="visible"?this.Uo||(this.Uo=!0,this.capture(xs,{title:j.title},{send_instantly:!0}),this.zo&&(j.removeEventListener(Cc,this.zo),this.zo=null)):this.zo||(this.zo=this.dl.bind(this),Re(j,Cc,this.zo)))}debug(t){t===!1?(I==null||I.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(I==null||I.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}ma(){var t=this.Zo||{};return"advanced_disable_flags"in t?!!t.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(D.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):function(n,r,i,s,o){var a=r in n&&!ne(n[r]),l=i in n&&!ne(n[i]);return a?n[r]:!!l&&(o&&o.warn("Config field '"+i+"' is deprecated. Please use '"+r+"' instead. The old field will be removed in a future major version."),n[i])}(t,"advanced_disable_flags","advanced_disable_decide",0,D)}kn(t){var n;if(ne(this.config.before_send))return t;var r=Object.keys((n=t.properties)!==null&&n!==void 0?n:{}).filter($T),i=Z(this.config.before_send)?this.config.before_send:[this.config.before_send],s=t;for(var o of i)try{if(s=o(s),ne(s)){var a="Event '"+t.event+"' was rejected in beforeSend function";return NT(t.event)?D.warn(a+". This can cause unexpected behavior."):D.info(a),null}s.properties&&!En(s.properties)||D.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}catch(u){return D.error("Error in beforeSend function for event '"+t.event+"':",u),null}for(var l of r)if(s.properties&&ne(s.properties[l]))return D.warn("Event '"+t.event+"' had its '"+l+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return s}getPageViewId(){var t;return(t=this.pageViewManager.Ss)==null?void 0:t.pageViewId}captureTraceFeedback(t,n){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:n})}captureTraceMetric(t,n,r){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:n,$ai_metric_value:String(r)})}Go(t){var n=$t(t)&&!t,r=ge.Dr()&&ge.Pr("ph_debug")==="true";return!n&&(!!r||t)}}qt.__defaultExtensionClasses={},qt.Cl=(()=>{var e=()=>{};return{trace:e,debug:e,info:e,warn:e,error:e,fatal:e}})(),function(e,t){for(var n=0;t.length>n;n++)e.prototype[t[n]]=CI(e.prototype[t[n]])}(qt,["identify"]);class lS{constructor(t){this.disabled=t===!1;var n=Se(t)?t:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(t,n,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(t-i.x)+Math.abs(n-i.y)r-i.timestamp){if(this.clicks.push({x:t,y:n,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:n,timestamp:r}];return!1}}var Af="$copy_autocapture",nu=Ie("[AutoCapture]");function Nf(e,t){return t.length>e?t.slice(0,e)+"...":t}function IO(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!ui(t));return t}function OO(e,t){var n,r,i=t.e,s=t.maskAllElementAttributes,o=t.maskAllText,a=t.elementAttributeIgnoreList,l=t.elementsChainAsString,u=t.disableCaptureUrlHashes;if(!ui(e))return{props:{}};for(var c=[e],d=new Set([e]),f=e;f.parentNode&&!Kt(f,"body")&&bE>c.length;)if(xE(f.parentNode)){var m=f.parentNode.host;if(d.has(m))break;d.add(m),c.push(m),f=m}else{if(!ui(f.parentNode)||d.has(f.parentNode))break;d.add(f.parentNode),c.push(f.parentNode),f=f.parentNode}var _,p,y=[],h={},v=!1,x=!1;if(ve(c,C=>{var T=kp(C);if(Kt(C,"a")){var R=C.getAttribute("href");v=!!(T&&R&&ka(R))&&(u?li(R):R)}J(Tc(C),"ph-no-capture")&&(x=!0),y.push(function(M,z,F,W,B){B===void 0&&(B=!1);var Q=M.tagName.toLowerCase(),O={tag_name:Q};kg.indexOf(Q)>-1&&!F&&(O.$el_text=Q.toLowerCase()==="a"||Q.toLowerCase()==="button"?Nf(1024,u_(M)):Nf(1024,Ja(M)));var A=Tc(M);A.length>0&&(O.classes=A.filter(function(oe){return oe!==""})),ve(M.attributes,function(oe){var de;if((!RE(M)||["name","id","class","aria-label"].indexOf(oe.name)!==-1)&&(W==null||!W.includes(oe.name))&&!z&&ka(oe.value)&&(!ce(de=oe.name)||de.substring(0,10)!=="_ngcontent"&&de.substring(0,7)!=="_nghost")){var be=oe.value;oe.name==="class"&&(be=Cg(be).join(" ")),O["attr__"+oe.name]=Nf(1024,oe.name==="href"&&B?li(be):be)}});for(var V=1,K=1,te=M;te=IO(te);)V++,te.tagName===M.tagName&&K++;return O.nth_child=V,O.nth_of_type=K,O}(C,s,o,a,u));var N=function(M){if(!kp(M))return{};var z={};return ve(M.attributes,function(F){if(F.name&&F.name.indexOf("data-ph-capture-attribute")===0){var W=F.name.replace("data-ph-capture-attribute-",""),B=F.value;W&&B&&ka(B)&&(z[W]=B)}}),z}(C);_e(h,N)}),x)return{props:{},explicitNoCapture:x};if(o||(y[0].$el_text=Kt(e,"a")||Kt(e,"button")?u_(e):Ja(e)),v){var b,E;y[0].attr__href=v;var S=(b=Eo(v))==null?void 0:b.host,P=I==null||(E=I.location)==null?void 0:E.host;S&&P&&S!==P&&(_=v)}return{props:_e({$event_type:i.type,$ce_version:1},l?{}:{$elements:y},{$elements_chain:(p=y,function(C){return C.map(T=>{var R,N,M="";if(T.tag_name&&(M+=T.tag_name),T.attr_class)for(var z of(T.attr_class.sort(),T.attr_class))M+="."+z.replace(/"/g,"");var F=$({},T.text?{text:T.text}:{},{"nth-child":(R=T.nth_child)!==null&&R!==void 0?R:0,"nth-of-type":(N=T.nth_of_type)!==null&&N!==void 0?N:0},T.href?{href:T.href}:{},T.attr_id?{attr_id:T.attr_id}:{},T.attributes),W={};return Iu(F).sort((B,Q)=>B[0].localeCompare(Q[0])).forEach(B=>{var Q=B[1];return W[c_(B[0].toString())]=c_(Q.toString())}),(M+=":")+Iu(W).map(B=>B[0]+'="'+B[1]+'"').join("")}).join(";")}(function(C){return C.map(T=>{var R,N,M={text:(R=T.$el_text)==null?void 0:R.slice(0,400),tag_name:T.tag_name,href:(N=T.attr__href)==null?void 0:N.slice(0,2048),attr_class:qI(T),attr_id:T.attr__id,nth_child:T.nth_child,nth_of_type:T.nth_of_type,attributes:{}};return Iu(T).filter(z=>z[0].indexOf("attr__")===0).forEach(z=>M.attributes[z[0]]=z[1]),M})}(p)))},(n=y[0])!=null&&n.$el_text?{$el_text:(r=y[0])==null?void 0:r.$el_text}:{},_&&i.type==="click"?{$external_click_url:_}:{},h)}}class MO{constructor(t){this.name="autocapture",this.Qn=!1,this.Jn=null,this.Kn=!1,this.Yn=!1,this.qi={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.Xn=!1,this.ts=t,this.ts.refresh(this.qi),this.rageclicks=new lS(this.qi.rageclick),this.es=null}setup(t){this.rs(),this.ns=t;var n=t.onRemoteConfig(this.onRemoteConfig.bind(this));this.Xn?n.dispose():(this.ss=n,this.startIfEnabled())}dispose(){var t;this.Xn||(this.Xn=!0,this.ns=void 0,(t=this.ss)==null||t.dispose(),this.ss=void 0,this.os())}ls(){return this.ts.refresh(this.qi),this.qi}rs(){var t,n;return this.ls(),this.qi.url_allowlist=(t=this.qi.url_allowlist)==null?void 0:t.map(r=>new RegExp(r)),this.qi.url_ignorelist=(n=this.qi.url_ignorelist)==null?void 0:n.map(r=>new RegExp(r)),this.qi}us(){if(this.isBrowserSupported()){if(I&&j){var t=this.hs=r=>{r=r||(I==null?void 0:I.event);try{this.ds(r)}catch(i){nu.error("Failed to capture event",i)}};if(Re(j,"submit",t,{capture:!0}),Re(j,"change",t,{capture:!0}),Re(j,"click",t,{capture:!0}),this.ls().capture_copied_text){var n=this.vs=r=>{r=r||(I==null?void 0:I.event);try{this.ds(r,Af)}catch(i){nu.error("Failed to capture copy/cut event",i)}};Re(j,"copy",n,{capture:!0}),Re(j,"cut",n,{capture:!0})}}}else nu.info("Disabling Automatic Event Collection because this browser is not supported")}os(){this.hs&&(j==null||j.removeEventListener("submit",this.hs,!0),j==null||j.removeEventListener("change",this.hs,!0),j==null||j.removeEventListener("click",this.hs,!0),this.hs=void 0),this.vs&&(j==null||j.removeEventListener("copy",this.vs,!0),j==null||j.removeEventListener("cut",this.vs,!0),this.vs=void 0),this.Qn=!1}startIfEnabled(){!this.Xn&&this.ns&&this.isEnabled&&!this.Qn&&(this.us(),this.Qn=!0)}onRemoteConfig(t){if(!this.Xn)if(this.Kn=!0,t.ok){var n=t.config;n.elementsChainAsString&&(this.Yn=n.elementsChainAsString);var r,i=n.autocapture_opt_out;$t(i)&&((r=this.ns)==null||r.kv.set(lp,i),this.Jn=i),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(t){this.es=t}getElementSelectors(t){var n,r=[];return(n=this.es)==null||n.forEach(i=>{var s=j==null?void 0:j.querySelectorAll(i);s==null||s.forEach(o=>{t===o&&r.push(i)})}),r}get isEnabled(){var t,n;if(this.Xn)return!1;var r=(t=this.ns)==null?void 0:t.kv.get(lp),i=this.Jn,s=this.ls(),o=s.remoteRequestsDisabled&&!this.Kn;if(rt(i)&&!$t(r)&&!o)return!1;var a=(n=this.Jn)!==null&&n!==void 0?n:!!r;return!!s.enabled&&!a}ds(t,n){if(n===void 0&&(n="$autocapture"),this.isEnabled){var r=Sp(t);wE(r)&&(r=r.parentNode||null);var i,s=this.rs();n==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&s.rageclick&&(i=this.rageclicks)!=null&&i.isRageClick(t.clientX,t.clientY,t.timeStamp||new Date().getTime())&&kE(r,s.rageclick)&&this.ds(t,"$rageclick");var o=n===Af;if(r&&function(_,p,y,h,v,x){var b;if(!I||Pg(_)||y!=null&&y.url_allowlist&&!n_(y.url_allowlist,x)||y!=null&&y.url_ignorelist&&n_(y.url_ignorelist,x))return!1;if(y!=null&&y.dom_event_allowlist){var E=y.dom_event_allowlist;if(E&&!E.some(N=>p.type===N))return!1}var S=PE(_,h),P=S.parentIsUsefulElement,C=S.targetElementList;if(!function(N,M){var z=M==null?void 0:M.element_allowlist;if(L(z))return!0;var F,W=function(Q){if(z.some(O=>Q.tagName.toLowerCase()===O))return{v:!0}};for(var B of N)if(F=W(B))return F.v;return!1}(C,y)||!Cp(C,y==null?void 0:y.css_selector_allowlist)||Cp(C,(b=y==null?void 0:y.css_selector_ignorelist)!==null&&b!==void 0?b:jI))return!1;try{var T=I.getComputedStyle(_);if(T&&T.getPropertyValue("cursor")==="pointer"&&p.type==="click")return!0}catch{}var R=_.tagName.toLowerCase();switch(R){case"html":return!1;case"form":return(v||["submit"]).indexOf(p.type)>=0;case"input":case"select":case"textarea":return(v||["change","click"]).indexOf(p.type)>=0;default:return P?(v||["click"]).indexOf(p.type)>=0:(v||["click"]).indexOf(p.type)>=0&&(kg.indexOf(R)>-1||_.getAttribute("contenteditable")==="true")}}(r,t,s,o,o?["copy","cut"]:void 0,{config:{get_current_url:s.getCurrentUrl}})){var a,l=OO(r,{e:t,maskAllElementAttributes:s.maskAllElementAttributes,maskAllText:s.maskAllText,elementAttributeIgnoreList:s.element_attribute_ignorelist,elementsChainAsString:this.Yn,disableCaptureUrlHashes:s.disableCaptureUrlHashes}),u=l.props;if(l.explicitNoCapture)return!1;var c=this.getElementSelectors(r);if(c&&c.length>0&&(u.$element_selectors=c),n===Af){var d,f=EE(I==null||(d=I.getSelection())==null?void 0:d.toString()),m=t.type||"clipboard";if(!f)return!1;u.$selected_content=f,u.$copy_type=m}return(a=this.ns)==null||a.capture(n,u).catch(_=>nu.error("Failed to capture event",_)),!0}}}isBrowserSupported(){return vt(j==null?void 0:j.querySelectorAll)}}class AO{constructor(t){this._instance=t}refresh(t){var n=this._instance.config,r=Se(n.autocapture)?n.autocapture:void 0;t.enabled=!!n.autocapture,t.rageclick=n.rageclick,t.maskAllElementAttributes=n.mask_all_element_attributes,t.maskAllText=n.mask_all_text,t.disableCaptureUrlHashes=n.disable_capture_url_hashes,t.getCurrentUrl=n.get_current_url,t.remoteRequestsDisabled=this._instance.ma(),t.url_allowlist=r==null?void 0:r.url_allowlist,t.url_ignorelist=r==null?void 0:r.url_ignorelist,t.dom_event_allowlist=r==null?void 0:r.dom_event_allowlist,t.element_allowlist=r==null?void 0:r.element_allowlist,t.css_selector_allowlist=r==null?void 0:r.css_selector_allowlist,t.css_selector_ignorelist=r==null?void 0:r.css_selector_ignorelist,t.element_attribute_ignorelist=r==null?void 0:r.element_attribute_ignorelist,t.capture_copied_text=r==null?void 0:r.capture_copied_text}}var ta=Ie("[ExceptionAutocapture]"),I_=()=>{},NO=Ie("[TracingHeaders]"),yi=Ie("[Web Vitals]"),O_=9e5,M_="disabled",A_="lazy_loading",na="awaiting_config",ru="missing_config";Ie("[SessionRecording]"),Ie("[SessionRecording]");var Np="[SessionRecording]",Yn=Ie(Np),$O=Ie("[Heatmaps]");function $f(e){return Se(e)&&"clientX"in e&&"clientY"in e&&Ge(e.clientX)&&Ge(e.clientY)}var iu=Ie("[Product Tours]"),Ff=e=>{var t;return!e.config.disable_product_tours&&!((t=e.persistence)==null||!t.get_property(xg))},FO=["$set_once","$set"],On=Ie("[SiteApps]"),N_="Error while initializing PostHog app with config id ",uS=(e,t)=>e!=null&&e.then?e.then(t):t(e),vs="SDK is not enabled or survey functionality is not yet loaded",$_="Disabled. Not loading surveys.";class LO{constructor(t,n){this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Tl=!1,this.Ml=[],this.El=null,this.Il=null,this.Xn=!1,this.Rl=new Set,this.onRemoteConfig=r=>{if(!this.Xn&&!this.qi.disableSurveys){if(!r.ok)return he.warn("Remote config unavailable. Not loading surveys.");var i=r.config.surveys;if(ne(i))return he.warn("Flags not loaded yet. Not loading surveys.");this.Pl=$t(i)?i:i.length>0,he.info("flags response received, isSurveysEnabled: "+this.Pl),this.loadIfEnabled()}},this.ts=t,this.Al=n}setup(t){if(!this.Xn)return this.Fl=t,uS(t.kv.initialize(),()=>{if(this.Fl===t&&!this.Xn){this.Fl=void 0,this.ns=t;var n=t.onRemoteConfig(this.onRemoteConfig);this.Xn?n.dispose():(this.ss=n,this.loadIfEnabled())}})}dispose(){var t,n,r;this.Xn||(this.Xn=!0,this.Fl=void 0,this.ns=void 0,(t=this.ss)==null||t.dispose(),this.ss=void 0,(n=this._surveyEventReceiver)==null||n.dispose(),this._surveyEventReceiver=null,(r=this._surveyManager)==null||r.dispose==null||r.dispose(),this._surveyManager=null,this.Ml=[],this.El=null,this.Rl.forEach(i=>clearTimeout(i)),this.Rl.clear())}get qi(){return this.ts.get()}initialize(){this.loadIfEnabled()}reset(){try{var t;(t=this._surveyEventReceiver)==null||t.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var n=[],r=0;rlocalStorage.removeItem(s))}catch{}}loadIfEnabled(){if(!this.Xn&&this.ns){var t=this.qi;if(!this._surveyManager)if(this.Tl)he.info("Already initializing surveys, skipping...");else if(t.disableSurveys)he.info($_);else if(t.cookielessMode&&this.ts.isOptedOut())he.info("Not loading surveys in cookieless mode without consent.");else{var n=this.ts.getExtensions();if(n){if(!L(this.Pl)||t.advancedEnableSurveys){var r=this.Pl||t.advancedEnableSurveys;this.Tl=!0;try{var i=n.generateSurveys;if(i)return this.Ol(i,r),void(this.Tl=!1);var s=n.loadExternalDependency;if(!s)return this.Ll(Eg),void(this.Tl=!1);s(o=>{try{if(this.Xn)return;var a=this.ts.getExtensions();o||a==null||!a.generateSurveys?this.Ll("Could not load surveys script",o):this.Ol(a.generateSurveys,r)}finally{this.Tl=!1}})}catch(o){throw this.Tl=!1,this.Ll("Error initializing surveys",o),o}}}else he.error("PostHog Extensions not found.")}}}Ol(t,n){this.Xn||(this._surveyManager=t(n),this._surveyEventReceiver=this.ts.createEventReceiver(),he.info("Surveys loaded successfully"),this.$l({isLoaded:!0}))}Ll(t,n){he.error(t,n),this.$l({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Ml.push(t),this._surveyManager&&this.$l({isLoaded:!0}),()=>{this.Ml=this.Ml.filter(n=>n!==t)}}getSurveys(t,n){var r;n===void 0&&(n=!1);var i=(r=this.ns)!==null&&r!==void 0?r:this.Al;if(i&&!this.Xn){if(this.qi.disableSurveys)return he.info($_),t([]);var s=i.kv.get(vp);if(s&&!n)return t(s,{isLoaded:!0}),void(this.Dl()&&this.getSurveys(()=>{},!0));if(this.El)this.El.then(l=>{this.Xn||t(l.surveys,l.context)}).catch(l=>he.error("Error in survey callback",l));else{var o=this.Nl("/api/surveys/",{method:"GET",query:{token:i.projectToken},sentAt:"query",timeoutMs:this.qi.requestTimeoutMs}).then(l=>{try{return this.ql(i,l)}catch(u){return he.error("Error processing surveys response",u),this.ql(i,{statusCode:0,error:u})}},l=>this.ql(i,{statusCode:0,error:l}));this.El=o;var a=()=>{this.El===o&&(this.El=null)};o.then(l=>{a(),this.Xn||t(l.surveys,l.context)},a).catch(l=>he.error("Error in survey callback",l))}}}Nl(t,n){var r=this.ns;return r?r.sendRequest(t,n):new Promise(i=>i({statusCode:0,error:new Error(vs)}))}ql(t,n){if(this.Xn)return{surveys:[],context:{isLoaded:!1,error:vs}};var r=n.statusCode;if(r!==200||!n.json){var i="Surveys API could not be loaded, status: "+r;return r!==0?he.error(i):n.error||he.warn(i),this.Il=Date.now(),{surveys:[],context:{isLoaded:!1,error:i}}}this.Il=null;var s,o=n.json.surveys||[],a=o.filter(l=>function(u){return!(!u.start_date||u.end_date)}(l)&&(rS(l)||function(u){var c;return!((c=u.conditions)==null||(c=c.actions)==null||(c=c.values)==null||!c.length)}(l)));return a.length>0&&((s=this._surveyEventReceiver)==null||s.register(a)),t.kv.set({[vp]:o,[bc]:Date.now()}),{surveys:o,context:{isLoaded:!0}}}Dl(){return this.jl()&&!this.El&&!this.Bl()}jl(){var t,n,r=(t=(n=this.ns)!==null&&n!==void 0?n:this.Al)==null?void 0:t.kv.get(bc);return Ge(r)&&Date.now()-r>3e5}Bl(){return Ge(this.Il)&&3e5>Date.now()-this.Il}markSurveyAsSeen(t,n){var r,i={id:t,current_iteration:(r=n==null?void 0:n.iteration)!==null&&r!==void 0?r:null};sS(i);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}}$l(t){for(var n of this.Ml)try{if(!t.isLoaded)return n([],t);this.getSurveys(n)}catch(r){he.error("Error in survey callback",r)}}getActiveMatchingSurveys(t,n){if(n===void 0&&(n=!1),!ne(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,n);he.warn("init was not called")}Hl(t){var n=null;return this.getSurveys(r=>{var i;n=(i=r.find(s=>s.id===t))!==null&&i!==void 0?i:null}),n}Ul(t){if(ne(this._surveyManager))return{eligible:!1,reason:vs};var n=typeof t=="string"?this.Hl(t):t;return n?this._surveyManager.checkSurveyEligibility(n):{eligible:!1,reason:"Survey not found"}}zl(t){if(ne(this._surveyManager))return{eligible:!1,reason:vs};var n=typeof t=="string"?this.Hl(t):t;return n?this._surveyManager.checkSurveyRenderability(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(ne(this._surveyManager))return he.warn("init was not called"),{visible:!1,disabledReason:vs};var n=this.zl(t);return{visible:n.eligible,disabledReason:n.reason}}canRenderSurveyAsync(t,n){return ne(this._surveyManager)?(he.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:vs})):new Promise(r=>{this.getSurveys(i=>{var s,o=(s=i.find(l=>l.id===t))!==null&&s!==void 0?s:null;if(o){var a=this.zl(o);r({visible:a.eligible,disabledReason:a.reason})}else r({visible:!1,disabledReason:"Survey not found"})},n)})}renderSurvey(t,n,r){var i;if(ne(this._surveyManager))he.warn("init was not called");else{var s=typeof t=="string"?this.Hl(t):t;if(s!=null&&s.id)if(_O.includes(s.type)){var o=j==null?void 0:j.querySelector(n);if(o)if((i=s.appearance)!=null&&i.surveyPopupDelaySeconds){he.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds");var a=setTimeout(()=>{var l,u;this.Rl.delete(a),this.Xn||(he.info("Rendering survey "+s.id+" with delay of "+((l=s.appearance)==null?void 0:l.surveyPopupDelaySeconds)+" seconds"),(u=this._surveyManager)==null||u.renderSurvey(s,o,r),he.info("Survey "+s.id+" rendered"))},1e3*s.appearance.surveyPopupDelaySeconds);this.Rl.add(a)}else this._surveyManager.renderSurvey(s,o,r);else he.warn("Survey element not found")}else he.warn("Surveys of type "+s.type+" cannot be rendered in the app");else he.warn("Survey not found")}}displaySurvey(t,n){var r;if(ne(this._surveyManager))he.warn("init was not called");else{var i=this.Hl(t);if(i){var s=i;if((r=i.appearance)!=null&&r.surveyPopupDelaySeconds&&n.ignoreDelay&&(s=$({},i,{appearance:$({},i.appearance,{surveyPopupDelaySeconds:0})})),n.displayType!==Pp.Popover&&n.initialResponses&&he.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),n.ignoreConditions===!1){var o=this.Ul(i);if(!o.eligible)return void he.warn("Survey is not eligible to be displayed: ",o.reason)}n.displayType!==Pp.Inline?this._surveyManager.handlePopoverSurvey(s,n):this.renderSurvey(s,n.selector,n.properties)}else he.warn("Survey not found")}}cancelPendingSurvey(t){ne(this._surveyManager)?he.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;(t=this._surveyManager)==null||t.handlePageUnload==null||t.handlePageUnload()}}function gs(e,t,n){if(ne(e))return!1;switch(n){case"exact":return e===t;case"contains":var r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch{return!1}default:return!1}}class jO{constructor(t){this.Wl=new Set,this.Vl=new Set,this.Gl=new Ac,this.Zl=(n,r)=>this.Ql(n,r)&&this.Jl(n,r)&&this.Kl(n,r)&&this.Yl(n,r),this.Ql=(n,r)=>r==null||!r.event||(n==null?void 0:n.event)===(r==null?void 0:r.event),this._instance=t}init(){var t,n;L((t=this._instance)==null?void 0:t._addCaptureHook)||(this.Xl=(n=this._instance)==null?void 0:n._addCaptureHook((r,i)=>{this.on(r,i)}))}dispose(){var t;(t=this.Xl)==null||t.call(this),this.Xl=void 0,this.Gl=new Ac}register(t){var n,r;if(!L((n=this._instance)==null?void 0:n._addCaptureHook)&&(t.forEach(s=>{var o;this.Wl.add(s),(o=s.steps)==null||o.forEach(a=>{this.Vl.add((a==null?void 0:a.event)||"")})}),(r=this._instance)!=null&&r.autocapture)){var i=new Set;this.Wl.forEach(s=>{var o;(o=s.steps)==null||o.forEach(a=>{a!=null&&a.selector&&i.add(a.selector)})}),this._instance.autocapture.setElementSelectors(i)}}replace(t){this.Wl.clear(),this.Vl.clear(),this.register(t)}on(t,n){n!=null&&t.length!=0&&(this.Vl.has(t)||this.Vl.has(n.event))&&this.Wl.forEach(r=>{this.tu(n,r)&&this.Gl.emit("actionCaptured",r.name)})}eu(t){this.onAction("actionCaptured",n=>t(n))}tu(t,n){if((n==null?void 0:n.steps)==null)return!1;for(var r of n.steps)if(this.Zl(t,r))return!0;return!1}onAction(t,n){return this.Gl.on(t,n)}Jl(t,n){if(n!=null&&n.url){var r,i=t==null||(r=t.properties)==null?void 0:r.$current_url;if(!i||typeof i!="string"||!gs(i,n.url,n.url_matching||"contains"))return!1}return!0}Kl(t,n){return!!this.iu(t,n)&&!!this.ru(t,n)&&!!this.nu(t,n)}iu(t,n){var r;if(n==null||!n.href)return!0;var i=this.su(t);if(i.length>0)return i.some(a=>gs(a.href,n.href,n.href_matching||"exact"));var s,o=(t==null||(r=t.properties)==null?void 0:r.$elements_chain)||"";return!!o&&gs((s=o.match(/(?::|")href="(.*?)"/))?s[1]:"",n.href,n.href_matching||"exact")}ru(t,n){var r;if(n==null||!n.text)return!0;var i=this.su(t);if(i.length>0)return i.some(u=>gs(u.text,n.text,n.text_matching||"exact")||gs(u.$el_text,n.text,n.text_matching||"exact"));var s,o,a,l=(t==null||(r=t.properties)==null?void 0:r.$elements_chain)||"";return!!l&&(s=function(u){for(var c,d=[],f=/(?::|")text="(.*?)"/g;!ne(c=f.exec(u));)d.includes(c[1])||d.push(c[1]);return d}(l),o=n.text,a=n.text_matching||"exact",s.some(u=>gs(u,o,a)))}nu(t,n){var r,i;if(n==null||!n.selector)return!0;var s=t==null||(r=t.properties)==null?void 0:r.$element_selectors;if(s!=null&&s.includes(n.selector))return!0;var o=(t==null||(i=t.properties)==null?void 0:i.$elements_chain)||"";if(n.selector_regex&&o)try{return new RegExp(n.selector_regex).test(o)}catch{return!1}return!1}su(t){var n;return(t==null||(n=t.properties)==null?void 0:n.$elements)==null?[]:t==null?void 0:t.properties.$elements}Yl(t,n){return n==null||!n.properties||n.properties.length===0||nS(n.properties.reduce((r,i)=>{var s=Z(i.value)?i.value.map(String):i.value!=null?[String(i.value)]:[];return r[i.key]={values:s,operator:i.operator||"exact"},r},{}),t==null?void 0:t.properties)}}class DO{constructor(t){var n;this.au=[],this._instance=t,this.ou=new Map,this.lu=new Map,this.uu=new Map,this.hu=(n=this._instance)==null||n.onSessionId==null?void 0:n.onSessionId(r=>this.du(r))}vu(t){return!1}cu(){return null}fu(t){}pu(){}gu(t,n){return!!t&&nS(t.propertyFilters,n==null?void 0:n.properties)}mu(t,n){var r=new Map;return t.forEach(i=>{var s;(s=i.conditions)==null||(s=s[n])==null||(s=s.values)==null||s.forEach(o=>{if(o!=null&&o.name){var a=r.get(o.name)||[];a.push(i.id),r.set(o.name,a)}})}),r}yu(t,n,r){var i=(r===Xo.Activation?this.ou:this.lu).get(t),s=[];return this.bu(o=>{s=o.filter(a=>i==null?void 0:i.includes(a.id))}),s.filter(o=>{var a,l=(a=o.conditions)==null||(a=a[r])==null||(a=a.values)==null?void 0:a.find(u=>u.name===t);return this.gu(l,n)})}register(t){this._u(t,!1)}replace(t){this._u(t,!0)}_u(t,n){var r;L((r=this._instance)==null?void 0:r._addCaptureHook)||(this.wu(t,n),this.ku(t,n))}ku(t,n){var r=t.filter(o=>{var a;return(a=o.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length});if(n&&this.uu.clear(),r.length!==0){this.Su||(this.Su=new jO(this._instance),this.Su.init(),this.Su.eu(o=>this.onAction(o)));var i=[];r.forEach(o=>{var a;(a=o.conditions)==null||(a=a.actions)==null||a.values.forEach(l=>{if(i.push(l),l.name){var u,c=(u=this.uu.get(l.name))!==null&&u!==void 0?u:[];c.includes(o.id)||c.push(o.id),this.uu.set(l.name,c)}})}),n?this.Su.replace(i):this.Su.register(i)}else{var s;n&&((s=this.Su)==null||s.replace([]))}}xu(t,n){n.forEach((r,i)=>{var s,o=(s=t.get(i))!==null&&s!==void 0?s:[];r.forEach(a=>{o.includes(a)||o.push(a)}),t.set(i,o)})}wu(t,n){var r,i,s=t.filter(u=>{var c,d;return((c=u.conditions)==null?void 0:c.events)&&((d=u.conditions)==null||(d=d.events)==null||(d=d.values)==null?void 0:d.length)>0}),o=t.filter(u=>{var c,d;return((c=u.conditions)==null?void 0:c.cancelEvents)&&((d=u.conditions)==null||(d=d.cancelEvents)==null||(d=d.values)==null?void 0:d.length)>0}),a=this.mu(t,Xo.Activation),l=this.mu(t,Xo.Cancellation);n?(this.ou=a,this.lu=l):(this.xu(this.ou,a),this.xu(this.lu,l)),(s.length!==0||o.length!==0)&&((r=this.Xl)!==null&&r!==void 0||(this.Xl=(i=this._instance)==null?void 0:i._addCaptureHook((u,c)=>{this.onEvent(u,c)})))}onEvent(t,n){var r,i,s=this.Cu(),o=(n==null||(r=n.properties)==null?void 0:r.$survey_id)||(n==null||(i=n.properties)==null?void 0:i.$product_tour_id);if(o&&this.getActivatedIds().includes(o)){var a=this.Tu(t,o);if(a==="consume")return s.info("event consumed activated item, removing it",{event:t,itemId:o}),void this.Mu([o]);if(a==="persist")return s.info("shown item promoted to persisted activation",{event:t,itemId:o}),this.Eu(o),void this.Iu([o])}if(this.lu.has(t)){var l=this.yu(t,n,Xo.Cancellation);l.length>0&&(s.info("cancel event matched, cancelling items",{event:t,itemsToCancel:l.map(c=>c.id)}),this.Mu(l.map(c=>c.id)),l.forEach(c=>this.Ru(c.id)))}if(this.ou.has(t)){s.info("event name matched",{event:t,eventPayload:n,items:this.ou.get(t)});var u=this.yu(t,n,Xo.Activation);this.Pu(u.map(c=>c.id))}}onAction(t){this.uu.has(t)&&this.Pu(this.uu.get(t)||[])}Pu(t){var n;if(t.length!==0){var r=!((n=this._instance)==null||n.get_session_id==null||!n.get_session_id()),i=[];for(var s of t)r&&this.vu(s)?this.Eu(s)&&this.Au(s):i.push(s);i.length>0&&(this.au=[...new Set([...this.au,...i])]),this.Cu().info("updating activated items",{activatedItems:this.getActivatedIds()})}}Eu(t){this.au=this.au.filter(r=>r!==t);var n=this.Fu();return!n.includes(t)&&(this.Ou([...n,t]),this.Lu(),!0)}Mu(t){var n=new Set(t);this.au=this.au.filter(s=>!n.has(s));var r=this.$u(),i=r.filter(s=>!n.has(s));i.length!==r.length&&(this.Ou(i),i.length===0&&this.Du()),this.Iu(t)}Nu(){var t,n=this.cu();if(!n)return{};var r=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[n];return r&&typeof r=="object"?r:{}}Au(t){if(this.cu()){var n=this.Nu();this.fu($({},n,{[t]:Date.now()}))}}Iu(t){if(this.cu()){var n=this.Nu(),r={},i=!1;for(var s of Object.entries(n)){var o=s[0],a=s[1];t.includes(o)?i=!0:r[o]=a}i&&(En(r)?this.pu():this.fu(r))}}qu(){this.cu()&&this.pu()}getActivationTimestamp(t){if(this.Fu().includes(t)){var n=this.Nu()[t];return Ge(n)?n:void 0}}$u(){var t,n=this.ju();return((t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[n])||[]}Fu(){var t,n,r=this.$u();if(r.length===0)return[];var i=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[this.Bu()],s=(n=this._instance)==null||n.get_session_id==null?void 0:n.get_session_id();return s&&i===s?r:[]}Lu(){var t,n=(t=this._instance)==null||t.get_session_id==null?void 0:t.get_session_id();n&&this.Hu(n)}Du(){this.Uu()}du(t){var n,r=(n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[this.Bu()];if(r&&r!==t){var i=this.$u(),s=this.Nu();i.length>0&&(this.Ou([]),i.filter(o=>Ge(s[o])).forEach(o=>this.Ru(o))),this.Du(),this.qu()}}getActivatedIds(){return[...new Set([...this.Fu(),...this.au])].filter(t=>!this.zu(t))}dispose(){var t,n,r;(t=this.hu)==null||t.call(this),this.hu=void 0,(n=this.Xl)==null||n.call(this),this.Xl=void 0,(r=this.Su)==null||r.dispose(),this.Su=void 0}reset(){this.au=[],this.$u().length>0&&this.Ou([]),this.Du(),this.qu()}getEventToItemsMap(){return this.ou}Wu(){return this.Su}}class zO extends DO{constructor(t){super(t)}ju(){return gp}Bu(){return Ru}cu(){return Tu}fu(t){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[Tu]:t})}pu(){var t;(t=this._instance)==null||(t=t.persistence)==null||t.unregister(Tu)}vu(t){var n,r;this.bu(s=>{r=s.find(o=>o.id===t)});var i=(n=r)==null||(n=n.appearance)==null?void 0:n.surveyPopupDelaySeconds;return Ge(i)&&i>0}Vu(){return ur.SHOWN}bu(t){var n;(n=this._instance)==null||n.getSurveys(t)}Ru(t){var n;(n=this._instance)==null||n.cancelPendingSurvey(t)}Cu(){return he}Ou(t){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[gp]:t})}Hu(t){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[Ru]:t})}Uu(){var t;(t=this._instance)==null||(t=t.persistence)==null||t.unregister(Ru)}zu(){return!1}Tu(t,n){var r;this.bu(s=>{r=s.find(o=>o.id===n)});var i=!r||function(s){var o;return rS(s)&&!((o=s.conditions)==null||(o=o.events)==null||!o.repeatedActivation)||s.schedule==="always"}(r);return i?t===ur.SHOWN?"consume":"ignore":t===ur.SHOWN?"persist":t===ur.DISMISSED||t===ur.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class UO{constructor(t){this._instance=t}initialize(){}get(t){if(typeof t=="string")return this._instance.get_property(t);var n={};for(var r of t){var i=this._instance.get_property(r);L(i)||(n[r]=i)}return n}set(t,n){this._instance.register(typeof t=="string"?{[t]:n}:t)}remove(t){typeof t!="string"?t.forEach(n=>this._instance.unregister(n)):this._instance.unregister(t)}}class VO{constructor(t){this._instance=t}get(){var t=this._instance.config;return{disableSurveys:t.disable_surveys,cookielessMode:!!t.cookieless_mode,advancedEnableSurveys:t.advanced_enable_surveys,requestTimeoutMs:t.surveys_request_timeout_ms}}isOptedOut(){return this._instance.consent.isOptedOut()}getExtensions(){var t=Y==null?void 0:Y.__PosthogExtensions__;if(t){var n=t.generateSurveys,r=t.loadExternalDependency;return{generateSurveys:n?i=>n(this._instance,i):void 0,loadExternalDependency:r?i=>r(this._instance,"surveys",i):void 0}}}createEventReceiver(){return new zO(this._instance)}}var BO=I!=null&&I.location?Ic(I.location.hash,"__posthog")||Ic(location.hash,"state"):null,F_="_postHogToolbarParams",L_=Ie("[Toolbar]"),j_=Ie("[FeatureFlags]");class qO{constructor(t,n){n===void 0&&(n=!1),this.Gu=!1,this.update(t,n)}update(t,n){this.Zu=((r,i)=>{var s,o,a,l;return{bootstrap:{featureFlags:(s=r.bootstrap)==null?void 0:s.featureFlags,featureFlagPayloads:(o=r.bootstrap)==null?void 0:o.featureFlagPayloads},remoteRequestsDisabled:i,featureFlagsDisabled:!!r.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!r.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!r.advanced_feature_flags_dedup_per_session,cacheTtlMs:r.feature_flag_cache_ttl_ms,requestTimeoutMs:r.feature_flag_request_timeout_ms,compression:r.disable_compression?"none":"base64",evaluationContexts:(a=(l=r.evaluation_contexts)!==null&&l!==void 0?l:r.evaluation_environments)!==null&&a!==void 0?a:[],flagKeys:Z(r.flag_keys)?r.flag_keys:void 0}})(t,n),!t.evaluation_environments||t.evaluation_contexts||this.Gu||(j_.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Gu=!0),L(t.flag_keys)||Z(t.flag_keys)||j_.error("Invalid flag_keys found:",t.flag_keys,"Expected array of non-empty strings")}get(){return this.Zu}}var D_=Ie("[FeatureFlags]"),_i=Ie("[FeatureFlags]",{debugEnabled:!0}),Lf=`" failed. Feature flags didn't load in time.`,z_="connection_error",U_=e=>{for(var t={},n=0;e.length>n;n++)t[e[n]]=!0;return t},V_=e=>{var t={};for(var n of Iu(e||{})){var r=n[1];r&&(t[n[0]]=r)}return t},gn=Ie("[Error tracking]"),WO=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:"],HO=["__firefox__","__gCrWeb"],B_="Refusing to render web experiment since the viewer is a likely bot",GO={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>Nc(t,e),not_regex:(e,t)=>!Nc(t,e),exact:(e,t)=>t===e,is_not:(e,t)=>t!==e};class ht{get qi(){return this._instance.config}constructor(t){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments(i=>{ht.Qu("retrieved web experiments from the server"),n.Ju=new Map,i.forEach(s=>{if(s.feature_flag_key){var o;n.Ju&&(ht.Qu("setting flag key ",s.feature_flag_key," to web experiment ",s),(o=n.Ju)==null||o.set(s.feature_flag_key,s));var a=n._instance.getFeatureFlag(s.feature_flag_key);ce(a)&&s.variants[a]&&n.Ku(s.name,a,s.variants[a].transforms)}else if(s.variants)for(var l in s.variants){var u=s.variants[l];ht.Yu(u,n._instance)&&n.Ku(s.name,l,u.transforms)}})},r)},this._instance=t,this._instance.onFeatureFlags(r=>{this.onFeatureFlags(r)})}initialize(){}onFeatureFlags(t){if(this._is_bot())ht.Qu(B_);else if(!this.qi.disable_web_experiments){if(ne(this.Ju))return this.Ju=new Map,this.loadIfEnabled(),void this.previewWebExperiment();ht.Qu("applying feature flags",t),t.forEach(n=>{var r;if(this.Ju&&(r=this.Ju)!=null&&r.has(n)){var i,s=this._instance.getFeatureFlag(n),o=(i=this.Ju)==null?void 0:i.get(n);s&&o!=null&&o.variants[s]&&this.Ku(o.name,s,o.variants[s].transforms)}})}}previewWebExperiment(){var t=ht.getWindowLocation();if(t!=null&&t.search){var n=So(t==null?void 0:t.search,"__experiment_id"),r=So(t==null?void 0:t.search,"__experiment_variant");n&&r&&(ht.Qu("previewing web experiments "+n+" && "+r),this.getWebExperiments(i=>{this.Xu(parseInt(n),r,i)},!1,!0))}}loadIfEnabled(){this.qi.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,n,r){if(this.qi.disable_web_experiments&&!r)return t([]);var i=this._instance.get_property("$web_experiments");if(i&&!n)return t(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.qi.token),method:"GET",timestampMode:"query",callback:s=>t(s.statusCode===200&&s.json&&s.json.experiments||[])})}Xu(t,n,r){var i=r.filter(s=>s.id===t);i&&i.length>0&&(ht.Qu("Previewing web experiment ["+i[0].name+"] with variant ["+n+"]"),this.Ku(i[0].name,n,i[0].variants[n].transforms))}static Yu(t,n){return!ne(t.conditions)&&ht.th(t,n)&&ht.eh(t)}static th(t,n){var r;if(ne(t.conditions)||ne((r=t.conditions)==null?void 0:r.url))return!0;var i=ht.getWindowLocation();if(i){var s,o,a,l=yE(n,i.href);return(s=t.conditions)==null||!s.url||GO[(o=(a=t.conditions)==null?void 0:a.urlMatchType)!==null&&o!==void 0?o:"icontains"](t.conditions.url,l)}return!1}static getWindowLocation(){return I==null?void 0:I.location}static eh(t){var n;if(ne(t.conditions)||ne((n=t.conditions)==null?void 0:n.utm))return!0;var r=NE();if(r.utm_source){var i,s,o,a,l,u,c,d,f=(i=t.conditions)==null||(i=i.utm)==null||!i.utm_campaign||((s=t.conditions)==null||(s=s.utm)==null?void 0:s.utm_campaign)==r.utm_campaign,m=(o=t.conditions)==null||(o=o.utm)==null||!o.utm_source||((a=t.conditions)==null||(a=a.utm)==null?void 0:a.utm_source)==r.utm_source,_=(l=t.conditions)==null||(l=l.utm)==null||!l.utm_medium||((u=t.conditions)==null||(u=u.utm)==null?void 0:u.utm_medium)==r.utm_medium,p=(c=t.conditions)==null||(c=c.utm)==null||!c.utm_term||((d=t.conditions)==null||(d=d.utm)==null?void 0:d.utm_term)==r.utm_term;return f&&_&&p&&m}return!1}static Qu(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;n>i;i++)r[i-1]=arguments[i];D.info("[WebExperiments] "+t,r)}Ku(t,n,r){this._is_bot()?ht.Qu(B_):n!=="control"?r.forEach(i=>{if(i.selector){var s;ht.Qu("applying transform of variant "+n+" for experiment "+t+" ",i);var o=(s=document)==null?void 0:s.querySelectorAll(i.selector);o==null||o.forEach(a=>{var l=a;i.html&&(l.innerHTML=i.html),i.css&&l.setAttribute("style",i.css)})}}):ht.Qu("Control variants leave the page unmodified.")}_is_bot(){return St&&this._instance?ZE(St,this.qi.custom_blocked_useragents):void 0}}var tn=Ie("[Conversations]"),wi="Conversations not available yet.",q_="console",cS="__posthogHandledLogsRequestError",jf=(e,t)=>{var n=e instanceof Error?e:new Error(t);return n[cS]=!0,n},W_=e=>!!e&&typeof e=="object"&&e[cS]===!0,hd={featureFlags:class{constructor(e){this.name="featureFlags",this.ih=!1,this.featureFlagEventHandlers=[],this.I=D_,this.rh={},this.nh={},this.sh=[],this.ah=!1,this.oh=!1,this.lh=0,this.uh=!1,this.hh=!1,this.dh=!1,this.fh=!1,this.ph=0,this.Tt=()=>{var t=this.gh();this.ph=0,t&&this.reloadFeatureFlags()},"get"in e?this.ts=e:(this.mh=new qO(e.config,e.ma()),this.ts=this.mh)}updateConfig(e,t){var n;(n=this.mh)==null||n.update(e,t)}setup(e){return this.Fl=e,this.I=e.logger.createLogger("[FeatureFlags]"),uS(e.kv.initialize(),()=>{this.Fl===e&&(this.Fl=void 0,this.ns=e,this.yh(e))})}yh(e){if(this.ns===e)return I&&Re(I,"online",this.Tt),this.bh=e.registerDynamicEventProperties(()=>this._h()?this.rh:this.nh),this.wh(),this.initialize()}destroy(){I==null||I.removeEventListener("online",this.Tt)}dispose(){var e;this.lh++,this.hh=!1,this.Fl=void 0,this.ns&&(this.kh(),(e=this.bh)==null||e.dispose(),this.bh=void 0,this.sh=[],I==null||I.removeEventListener("online",this.Tt),this.ns=void 0)}get qi(){return this.ts.get()}Sh(e){var t;return(t=this.ns)==null?void 0:t.kv.get(e)}Nr(e){this.xh(()=>{var t;return(t=this.ns)==null?void 0:t.kv.set(e)})}qr(e){this.xh(()=>{var t;return(t=this.ns)==null?void 0:t.kv.remove(e)})}xh(e){try{e()}catch(t){this.I.error("Failed to update feature flag persistence",t)}}wh(){var e={};for(var t of[Mi,Ai,Gs,Mn]){var n=this.Sh(t);L(n)||(e[t]=n)}this.rh=e;var r=$({},e),i=this.Sh(ir);if(i)for(var s of Object.entries(i))r["$feature/"+s[0]]=s[1];this.nh=r}_h(){var e=this.qi.cacheTtlMs;if(!e||0>=e)return!1;var t=this.Sh(Gi);return typeof t!="number"||Date.now()-t>e}Ch(){return!!this._h()&&(this.fh||this.oh||(this.fh=!0,this.I.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Th(){var e=this.qi.evaluationContexts;return e!=null&&e.length?e.filter(t=>{var n=t&&typeof t=="string"&&t.trim().length>0;return n||this.I.error("Invalid evaluation context found:",t,"Expected non-empty string"),n}):[]}Mh(){var e=this.qi.flagKeys;if(!L(e))return e.filter(t=>{var n=t&&typeof t=="string"&&t.trim().length>0;return n||this.I.error("Invalid flag key found:",t,"Expected non-empty string"),n})}initialize(){var e,t,n=this.qi,r=(e=(t=n.bootstrap)==null?void 0:t.featureFlags)!==null&&e!==void 0?e:{};if(Object.keys(r).length){var i,s,o=(i=(s=n.bootstrap)==null?void 0:s.featureFlagPayloads)!==null&&i!==void 0?i:{},a=Object.keys(r).filter(u=>!!r[u]).reduce((u,c)=>(u[c]=r[c]||!1,u),{}),l=Object.keys(o).filter(u=>a[u]).reduce((u,c)=>(u[c]=o[c],u),{});return this.Eh({featureFlags:a,featureFlagPayloads:l})}}updateFlags(e,t,n){var r,i,s=n!=null&&n.merge&&(r=this.Sh(ir))!==null&&r!==void 0?r:{},o=n!=null&&n.merge&&(i=this.Sh(Ai))!==null&&i!==void 0?i:{},a=$({},s,e),l=$({},o,t),u={};for(var c of Object.entries(a)){var d=c[0],f=c[1];u[d]={key:d,enabled:Ay(f),variant:Ny(f),reason:void 0,metadata:L(l==null?void 0:l[d])?void 0:{id:0,version:void 0,description:void 0,payload:l[d]}}}this.Eh({flags:u})}get hasLoadedFlags(){return this.ah}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.Sh(Xa),t=this.Sh(Mn),n=this.Sh(Ci);if(!n&&!t)return e||{};var r=_e({},e||{}),i=[...new Set([...Object.keys(n||{}),...Object.keys(t||{})])];for(var s of i){var o,a,l=r[s],u=t==null?void 0:t[s],c=L(u)?(o=l==null?void 0:l.enabled)!==null&&o!==void 0&&o:!!u,d=L(u)?l==null?void 0:l.variant:typeof u=="string"?u:void 0,f=n==null?void 0:n[s],m=$({},l,{enabled:c,variant:c?d??(l==null?void 0:l.variant):void 0});c!==(l==null?void 0:l.enabled)&&(m.original_enabled=l==null?void 0:l.enabled),d!==(l==null?void 0:l.variant)&&(m.original_variant=l==null?void 0:l.variant),f&&(m.metadata=$({},l==null?void 0:l.metadata,{payload:f,original_payload:l==null||(a=l.metadata)==null?void 0:a.payload})),r[s]=m}return this.ih||(this.I.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:r}),this.ih=!0),r}getAllFeatureFlags(){var e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map(n=>{var r=e[n];return{key:n,enabled:Ay(r),variant:Ny(r),payload:My(t[n])}})}getFlagVariants(){var e=this.Sh(ir),t=this.Sh(Mn);if(!t)return e||{};for(var n=_e({},e||{}),r=Object.keys(t),i=0;r.length>i;i++)n[r[i]]=t[r[i]];return this.ih||(this.I.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this.ih=!0),n}getFlagPayloads(){var e=this.Sh(Ai),t=this.Sh(Ci);if(!t)return e||{};for(var n=_e({},e||{}),r=Object.keys(t),i=0;r.length>i;i++)n[r[i]]=t[r[i]];return this.ih||(this.I.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),this.ih=!0),n}reloadFeatureFlags(){this.uh||this.qi.featureFlagsDisabled||this.gh()||this.Ih||(this.sh.slice().forEach(e=>{try{e()}catch(t){this.I.error("Error while running feature flags reloading callback",t)}}),this.Ih=setTimeout(()=>{this.Rh()},5))}kh(){clearTimeout(this.Ih),this.Ih=void 0}onReloading(e){return this.sh.push(e),()=>{this.sh=this.sh.filter(t=>t!==e)}}ensureFlagsLoaded(){this.ah||this.oh||this.Ih||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.uh=e}resetFlagCallReported(){this.qr(ar)}Rh(e){this.kh();var t=this.ns;if(t&&!this.qi.remoteRequestsDisabled&&!this.gh())if(this.oh)this.hh=!0;else{var n={token:t.projectToken,distinct_id:t.distinctId,groups:t.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:$({},t.initialPersonProperties,this.Sh(yn)||{},{$lib:t.library.name,$lib_version:t.library.version}),group_properties:this.Sh(Dn),timezone:zE()};L(t.deviceId)||(n.$device_id=t.deviceId),(e!=null&&e.disableFlags||this.qi.featureFlagsDisabled)&&(n.disable_flags=!0);var r=this.Th();r.length&&(n.evaluation_contexts=r);var i=this.Mh();L(i)||(n.flag_keys=i);var s=this.qi.onlyEvaluateSurveyFeatureFlags,o="/flags/?v=2"+(s?"&only_evaluate_survey_feature_flags=true":""),a=this.lh;this.oh=!0;var l=()=>{this.hh&&(this.hh=!1,this.Rh())},u=c=>{this.oh=!1,a===this.lh&&(this.Nr({[Ks]:[z_]}),this.I.error("Feature flag request failed",c)),l()};try{t.sendRequest(o,{target:"flags",method:"POST",body:n,compression:this.qi.compression==="base64"?Et.Base64:void 0,sentAt:"body",timeoutMs:this.qi.requestTimeoutMs}).then(c=>{var d,f,m=(d=c.json)!==null&&d!==void 0?d:{},_=c.statusCode!==200;if(this.oh=!1,a===this.lh){if(this.Ph(c.statusCode),_||this.hh||(this.$anon_distinct_id=void 0),!n.disable_flags||this.hh){this.dh=!_;var p=[];c.error?p.push(c.error instanceof Error&&c.error.name==="AbortError"?"timeout":c.error instanceof Error?z_:"unknown_error"):c.statusCode!==200&&p.push("api_error_"+c.statusCode),m.errorsWhileComputingFlags&&p.push("errors_while_computing_flags");var y=!((f=m.quotaLimited)==null||!f.includes("feature_flags"));y&&p.push("quota_limited"),this.Nr({[Ks]:p}),y?this.I.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):n.disable_flags||this.Eh(m,_,{partialResponse:s}),l()}}else l()}).catch(u)}catch(c){u(c)}}}gh(){return ME(this.ph,3)}Ph(e){this.ph=AE(e,this.ph,3,()=>this.I.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes."))}getFeatureFlag(e,t){var n;if(t===void 0&&(t={}),!t.fresh||this.dh)if(this.ah||this.getFlags()&&this.getFlags().length>0){if(!this.Ch()){var r=this.getFeatureFlagResult(e,t);return(n=r==null?void 0:r.variant)!==null&&n!==void 0?n:r==null?void 0:r.enabled}}else this.I.warn('getFeatureFlag for key "'+e+Lf)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return t==null?void 0:t.payload}getFeatureFlagResult(e,t){if(t===void 0&&(t={}),!t.fresh||this.dh)if(this.ah||this.getFlags()&&this.getFlags().length>0){if(!this.Ch()){var n,r=this.getFlagVariants(),i=e in r,s=r[e],o=this.getFlagPayloads()[e],a=String(s),l=this.Sh(Gs)||void 0,u=this.Sh(Gi)||void 0,c=this.Sh(ar)||{};if(this.qi.deduplicateCallsPerSession){var d,f=(d=this.ns)==null?void 0:d.session.sessionId,m=this.Sh(fa);f&&f!==m&&(c={},n=f)}if(t.send_event||!("send_event"in t))if(e in c&&c[e].includes(a))n&&this.Nr({[ar]:c,[fa]:n});else{var _,p,y,h,v,x,b,E,S,P,C,T;Z(c[e])?c[e].push(a):c[e]=[a],this.Nr($({[ar]:c},n?{[fa]:n}:{}));var R=this.getFeatureFlagDetails(e),N=[...(_=this.Sh(Ks))!==null&&_!==void 0?_:[]];L(s)&&N.push("flag_missing");var M={$feature_flag:e,$feature_flag_response:s,$feature_flag_payload:o??null,$feature_flag_request_id:l,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:(p=(y=this.qi.bootstrap)==null||(y=y.featureFlags)==null?void 0:y[e])!==null&&p!==void 0?p:null,$feature_flag_bootstrapped_payload:(h=(v=this.qi.bootstrap)==null||(v=v.featureFlagPayloads)==null?void 0:v[e])!==null&&h!==void 0?h:null,$used_bootstrap_value:!this.dh};L(R==null||(x=R.metadata)==null?void 0:x.has_experiment)||(M.$feature_flag_has_experiment=R.metadata.has_experiment),L(R==null||(b=R.metadata)==null?void 0:b.version)||(M.$feature_flag_version=R.metadata.version);var z,F=(E=R==null||(S=R.reason)==null?void 0:S.description)!==null&&E!==void 0?E:R==null||(P=R.reason)==null?void 0:P.code;F&&(M.$feature_flag_reason=F),R!=null&&(C=R.metadata)!=null&&C.id&&(M.$feature_flag_id=R.metadata.id),L(R==null?void 0:R.original_variant)&&L(R==null?void 0:R.original_enabled)||(M.$feature_flag_original_response=L(R.original_variant)?R.original_enabled:R.original_variant),R!=null&&(T=R.metadata)!=null&&T.original_payload&&(M.$feature_flag_original_payload=R==null||(z=R.metadata)==null?void 0:z.original_payload),N.length&&(M.$feature_flag_error=N.join(",")),this.Ah(M)}else n&&this.Nr({[ar]:c,[fa]:n});if(i)return{key:e,enabled:!!s,variant:typeof s=="string"?s:void 0,payload:My(o)}}}else this.I.warn('getFeatureFlagResult for key "'+e+Lf)}Ah(e){try{var t;(t=this.ns)==null||t.capture("$feature_flag_called",e).catch(n=>{this.I.error("Failed to capture feature flag call",n)})}catch(n){this.I.error("Failed to capture feature flag call",n)}}getRemoteConfigPayload(e,t){this.Fh(e,t)}Fh(e,t){var n=this;return Ce(function*(){var r=n.ns;if(r){var i={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},s=n.Th();s.length&&(i.evaluation_contexts=s);var o,a=n.Mh();L(a)||(i.flag_keys=a);try{var l,u=(l=(yield r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:i,compression:n.qi.compression==="base64"?Et.Base64:void 0,sentAt:"body",timeoutMs:n.qi.requestTimeoutMs})).json)==null?void 0:l.featureFlagPayloads;o=(u==null?void 0:u[e])||void 0}catch(c){return void n.I.error("Remote config feature flag request failed",c)}try{t(o)}catch(c){n.I.error("Remote config feature flag callback failed",c)}}})()}isFeatureEnabled(e,t){if(t===void 0&&(t={}),t.fresh&&!this.dh)return t.defaultValue;if(!(this.ah||this.getFlags()&&this.getFlags().length>0))return this.I.warn('isFeatureEnabled for key "'+e+Lf),t.defaultValue;var n=this.getFeatureFlag(e,t);return L(n)?t.defaultValue:!!n}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t,n){this.Eh(e,t,n)}Eh(e,t,n){if(this.ns){this.ah=!0;var r=function(i,s,o,a,l,u){s===void 0&&(s={}),o===void 0&&(o={}),a===void 0&&(a={}),u===void 0&&(u=D_);var c=((S,P)=>{var C=S.flags;return C?$({},S,{featureFlags:Object.fromEntries(Object.keys(C).map(T=>{var R;return[T,(R=C[T].variant)!==null&&R!==void 0?R:C[T].enabled]})),featureFlagPayloads:Object.fromEntries(Object.keys(C).filter(T=>C[T].enabled).filter(T=>{var R;return(R=C[T].metadata)==null?void 0:R.payload}).map(T=>{var R;return[T,(R=C[T].metadata)==null?void 0:R.payload]}))}):(S.featureFlags&&P.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),S)})(i,u),d=c.flags,f=c.featureFlags,m=c.featureFlagPayloads;if(f){var _=i.requestId,p=i.evaluatedAt;if(Z(f)){u.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var y={};if(f)for(var h=0;f.length>h;h++)y[f[h]]=!0;return{[Mi]:f,[ir]:y,[xc]:!1}}var v=f,x=m,b=d;if(l!=null&&l.partialResponse)v=$({},s,v),x=$({},o,x),b=$({},a,b);else if(i.errorsWhileComputingFlags)if(d){var E=new Set(Object.keys(d).filter(S=>{var P;return!((P=d[S])!=null&&P.failed)}));v=$({},s,Object.fromEntries(Object.entries(v).filter(S=>E.has(S[0])))),x=$({},o,Object.fromEntries(Object.entries(x||{}).filter(S=>E.has(S[0])))),b=$({},a,Object.fromEntries(Object.entries(b||{}).filter(S=>E.has(S[0]))))}else v=$({},s,v),x=$({},o,x),b=$({},a,b);return $({[Mi]:Object.keys(V_(v)),[ir]:v||{},[Ai]:x||{},[Xa]:b||{},[xc]:i.minimalFlagCalledEvents===!0},_?{[Gs]:_}:{},p?{[Gi]:p}:{})}}(e,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),n,this.I);r&&this.Nr(r),t||(this.fh=!1),this.Oh(t)}}override(e,t){t===void 0&&(t=!1),this.I.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){this.Lh(e)}Lh(e){if(this.ns){if(e===!1)return this.qr([Mn,Ci]),this.Oh(),void _i.info("All overrides cleared");if(Z(e))return this.Nr({[Mn]:U_(e)}),this.Oh(),void _i.info("Flag overrides set",{flags:e});if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var t,n=e;this.ih=!!((t=n.suppressWarning)!==null&&t!==void 0&&t);var r={},i=n.flags,s=n.payloads;return i&&(r[Mn]=Z(i)?U_(i):i),s&&(r[Ci]=s),Object.keys(r).length&&this.Nr(r),i===!1&&s===!1?this.qr([Mn,Ci]):i===!1?this.qr(Mn):s===!1&&this.qr(Ci),this.Oh(),i===!1?_i.info("Flag overrides cleared"):i&&_i.info("Flag overrides set",{flags:i}),void(s===!1?_i.info("Payload overrides cleared"):s&&_i.info("Payload overrides set",{payloads:s}))}if(e&&typeof e=="object")return this.Nr({[Mn]:e}),this.Oh(),void _i.info("Flag overrides set",{flags:e});this.I.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}else this.I.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ah){var t=this.$h(),n=t.flags,r=t.flagVariants;try{e(n,r)}catch(i){this.I.error("Error while running feature flags callback",i)}}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,n){var r=(this.Sh(Pu)||[]).find(l=>l.flagKey===e),i={["$feature_enrollment/"+e]:t},s={$feature_flag:e,$feature_enrollment:t,$set:i};r&&(s.$early_access_feature_name=r.name),n&&(s.$feature_enrollment_stage=n);var o=$({},this.getFlagVariants(),{[e]:t});this.Nr({[Mi]:Object.keys(V_(o)),[ir]:o,[yn]:$({},this.Sh(yn)||{},i)}),this.Oh();try{var a;(a=this.ns)==null||a.capture("$feature_enrollment_update",s).catch(l=>{this.I.error("Failed to capture early access feature enrollment",l)})}catch(l){this.I.error("Failed to capture early access feature enrollment",l)}}getEarlyAccessFeatures(e,t,n){t===void 0&&(t=!1);var r=this.Sh(Pu);!r||t?this.Dh(e,n):e(r)}Dh(e,t){var n=this;return Ce(function*(){var r=n.ns;if(r){var i,s=t?"&"+t.map(a=>"stage="+a).join("&"):"";try{var o=yield r.sendRequest("/api/early_access_features/?token="+r.projectToken+s,{target:"api",method:"GET",sentAt:"query"});if(!o.json)return;n.Nr({[Pu]:i=o.json.earlyAccessFeatures})}catch(a){return void n.I.error("Early access feature request failed",a)}try{e(i)}catch(a){n.I.error("Early access feature callback failed",a)}}})()}$h(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(n=>t[n]),flagVariants:Object.keys(t).filter(n=>t[n]).reduce((n,r)=>(n[r]=t[r],n),{})}}Oh(e){this.wh();var t=this.$h(),n=t.flags,r=t.flagVariants;this.featureFlagEventHandlers.forEach(i=>{try{i(n,r,{errorsLoading:e})}catch(s){this.I.error("Error while running feature flags callback",s)}})}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0),this.Nh(e,t)}Nh(e,t){t===void 0&&(t=!0);var n=this.Sh(yn)||{},r=(e==null?void 0:e.$set)||(e!=null&&e.$set_once?{}:e),i=e==null?void 0:e.$set_once,s={};if(i)for(var o in i)({}).hasOwnProperty.call(i,o)&&(o in n||(s[o]=i[o]));this.Nr({[yn]:$({},n,s,r)}),t&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=$({},this.Sh(yn)||{});e.forEach(r=>{delete n[r]}),this.Nr({[yn]:n}),t&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(e){e===void 0&&(e=!0),this.qr(yn),e&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this.Sh(Dn)||{},r=$({},n);for(var i of Object.keys(e))r[i]=$({},n[i],e[i]);this.Nr({[Dn]:r}),t&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.Sh(Dn)||{};this.Nr({[Dn]:$({},t,{[e]:{}})})}else this.qr(Dn)}reset(){this.lh++,this.hh=!1,this.rh={},this.nh={},this.ah=!1,this.uh=!1,this.dh=!1,this.$anon_distinct_id=void 0,this.kh(),this.ih=!1,this.ph=0}}},KO={sessionRecording:class{get qi(){return this._instance.config}get za(){return this._instance.persistence}get started(){var e;return!((e=this.qh)==null||!e.isStarted)}get status(){var e,t;return this.jh===na||this.jh===ru?this.jh:(e=(t=this.qh)==null?void 0:t.status)!==null&&e!==void 0?e:this.jh}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.jh=M_,this.Bh=void 0,this.Hh=!1,this.kt=(()=>{var t;if(j==null||!j.visibilityState||j.visibilityState==="visible")return!0;var n=I==null||(t=I.performance)==null||t.getEntriesByType==null?void 0:t.getEntriesByType("visibility-state");return!(n!=null&&n.length)||n.some(r=>r.name==="visible")})(),this.It=()=>{var t;(j==null?void 0:j.visibilityState)==="visible"&&(this.kt=!0,(t=this.qh)==null||t.setDocumentWasEverVisible==null||t.setDocumentWasEverVisible(!0))},this._instance=e,!this._instance.sessionManager)throw Yn.error("started without valid sessionManager"),new Error(Np+" started without valid sessionManager. This is a bug.");if(this.qi.cookieless_mode===lr)throw new Error(Np+' cannot be used with cookieless_mode="always"');j!=null&&j.addEventListener&&Re(j,"visibilitychange",this.It)}initialize(){this.startIfEnabledOrStop()}dispose(){this.Hh=!0,j==null||j.removeEventListener==null||j.removeEventListener("visibilitychange",this.It),this.stopRecording()}get Uh(){var e,t=!((e=this._instance.get_property(Oi))==null||!e.enabled),n=!this.qi.disable_session_recording,r=this.qi.disable_session_recording||this._instance.consent.isOptedOut();return I&&t&&n&&!r}startIfEnabledOrStop(e){var t;if(!(this.Hh||this.Uh&&(t=this.qh)!=null&&t.isStarted)){var n=!L(Object.assign)&&!L(Array.from);this.Uh&&n?(this.zh(e),Yn.info("starting")):(this.jh=M_,this.stopRecording())}}zh(e){var t,n,r;this.Uh&&(this.jh!==na&&this.jh!==ru&&(this.jh=A_),Y!=null&&(t=Y.__PosthogExtensions__)!=null&&(t=t.rrweb)!=null&&t.record&&(n=Y.__PosthogExtensions__)!=null&&n.initSessionRecording?this.Wh(e):(r=Y.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.Vh,i=>{if(i)return this._instance.register_for_session({[xp]:!0}),Yn.error("could not load recorder",i);this.Wh(e)}))}stopRecording(){var e,t;(e=this.Bh)==null||e.call(this),this.Bh=void 0,(t=this.qh)==null||t.stop()}Gh(){var e,t;(e=this.Bh)==null||e.call(this),this.Bh=void 0,(t=this.qh)==null||t.discard()}Zh(){var e,t;(e=this.za)==null||e.unregister(bg),(t=this.za)==null||t.unregister(oE)}Qh(e,t){if(ne(e))return null;var n,r=Ge(e)?e:parseFloat(e);return typeof(n=r)!="number"||!Number.isFinite(n)||0>n||n>1?(Yn.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):r}Jh(e){if(this.za){var t,n,r=this.za,i=()=>{var s,o=e.sessionRecording===!1?void 0:e.sessionRecording,a=this.Qh((s=this.qi.session_recording)==null?void 0:s.sampleRate,"session_recording.sampleRate"),l=this.Qh(o==null?void 0:o.sampleRate,"remote config sampleRate"),u=a??l;ne(u)&&this.Zh();var c=o==null?void 0:o.minimumDurationMilliseconds;r.register({[Oi]:$({cache_timestamp:Date.now(),enabled:!!o},o,{networkPayloadCapture:$({capturePerformance:e.capturePerformance},o==null?void 0:o.networkPayloadCapture),canvasRecording:{enabled:o==null?void 0:o.recordCanvas,fps:o==null?void 0:o.canvasFps,quality:o==null?void 0:o.canvasQuality},sampleRate:u,minimumDurationMilliseconds:L(c)?null:c,endpoint:o==null?void 0:o.endpoint,triggerMatchType:o==null?void 0:o.triggerMatchType,masking:o==null?void 0:o.masking,urlTriggers:o==null?void 0:o.urlTriggers,version:o==null?void 0:o.version,triggerGroups:o==null?void 0:o.triggerGroups})})};i(),(t=this.Bh)==null||t.call(this),this.Bh=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(i)}}onRemoteConfig(e){var t=e.ok?e.config:void 0;return t&&"sessionRecording"in t?t.sessionRecording===!1?(this.Jh(t),void this.Gh()):(this.Jh(t),void this.startIfEnabledOrStop()):(this.jh===na&&(this.jh=ru,Yn.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t){var n;t===void 0&&(t="log"),(n=this.qh)!=null&&n.log?this.qh.log(e,t):Yn.warn("log called before recorder was ready")}get Vh(){var e,t,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(Oi);return(n==null||(t=n.scriptConfig)==null?void 0:t.script)||"lazy-recorder"}Kh(){var e,t=this._instance.get_property(Oi);if(!t)return!1;try{e=typeof t=="object"?t:JSON.parse(t)}catch(n){return Yn.warn("persisted remote config for session recording is invalid and will be ignored",n),!1}return!ne(e.cache_timestamp)&&36e5>=Date.now()-e.cache_timestamp}Wh(e){var t,n,r;if(!this.Hh){if((t=Y.__PosthogExtensions__)==null||!t.initSessionRecording)return Yn.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[xp]:!0});var i;if(this.qh||(this.qh=(i=Y.__PosthogExtensions__)==null?void 0:i.initSessionRecording(this._instance,this.kt),this.qh._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Kh())return this.jh===ru||this.jh===na?void 0:(this.jh=na,Yn.info("persisted remote config is stale, requesting fresh config before starting"),void new UE(this._instance).load());this.jh=A_,(n=(r=this.qh).setDocumentWasEverVisible)==null||n.call(r,this.kt),this.qh.start(e)}}onRRwebEmit(e){var t;(t=this.qh)==null||t.onRRwebEmit==null||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.qh||(t=this.za)==null||t.register({[lE]:!0}),(e=this.qh)==null||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.qh||(t=this.za)==null||t.register({[aE]:!0}),(e=this.qh)==null||e.overrideSampling()}overrideTrigger(e){var t,n;this.qh||(n=this.za)==null||n.register({[e==="url"?uE:cE]:!0}),(t=this.qh)==null||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.qh)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var n;return!((n=this.qh)==null||!n.tryAddCustomEvent(e,t))}}},QO={autocapture:class extends MO{constructor(e){super(new AO(e)),this.instance=e}},historyAutocapture:class{constructor(e){this._instance=e,this.Yh=this.Xh()}initialize(){this.startIfEnabled()}get isEnabled(){var e=this.td();return!!(e.path||e.search||this.ed(e))}startIfEnabled(){this.isEnabled&&(D.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.Yh=this.Xh(),this.startIfEnabled()}stop(){this.rd&&this.rd(),this.rd=void 0,this.nd&&this.nd(),this.nd=void 0,D.info("History API monitoring stopped")}monitorHistoryChanges(){I&&I.history&&(this.sd("pushState"),this.sd("replaceState"),this.ad(),this.ed()&&this.od())}sd(e){var t;if(I&&((t=I.history[e])==null||!t.__posthog_wrapped__)){var n=this;(function(r,i,s){try{if(!(i in r))return I_;var o={next:r[i]},a=s(function(){for(var l=arguments.length,u=new Array(l),c=0;l>c;c++)u[c]=arguments[c];return o.next.apply(this,u)});return vt(a)&&(a.prototype=a.prototype||{},Object.defineProperties(a,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:o}})),r[i]=a,()=>{if(r[i]!==a)for(var l=r[i];vt(l)&&l.__posthog_layer__;){var u=l.__posthog_layer__;if(u.next===a)return void(u.next=o.next);l=u.next}else r[i]=o.next}}catch{return I_}})(I.history,e,r=>function(i,s,o){r.call(this,i,s,o),n.ld(e)})}}Xh(){var e=I==null?void 0:I.location;if(e!=null&&e.pathname)return{pathname:e.pathname,search:e.search,hash:e.hash}}td(){var e=this._instance.config.capture_pageview;return e==="history_change"?{path:!0}:Se(e)?e:{}}ed(e){return e===void 0&&(e=this.td()),!!e.hash&&!this._instance.config.disable_capture_url_hashes}ud(e){var t=this.td(),n=this.Yh;return!(!n||!(t.path&&e.pathname!==n.pathname||t.search&&e.search!==n.search||this.ed(t)&&e.hash!==n.hash))}ld(e){try{var t=this.Xh();if(!t)return;this.ud(t)&&this._instance.capture(xs,{navigation_type:e}),this.Yh=t}catch(n){D.error("Error capturing "+e+" pageview",n)}}ad(){if(!this.rd){var e=()=>{this.ld("popstate")};Re(I,"popstate",e),this.rd=()=>{I&&I.removeEventListener("popstate",e)}}}od(){if(!this.nd){var e=()=>{this.ld("hashchange")};Re(I,"hashchange",e),this.nd=()=>{I&&I.removeEventListener("hashchange",e)}}}},heatmaps:class{get qi(){return this.instance.config}constructor(e){var t;this.hd=!1,this.Qn=!1,this.dd=null,this.instance=e,this.hd=!((t=this.instance.persistence)==null||!t.props[up]),this.rageclicks=new lS(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return Se(this.qi.capture_heatmaps)&&this.qi.capture_heatmaps.flush_interval_milliseconds&&(e=this.qi.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return ne(this.qi.capture_heatmaps)?ne(this.qi.enable_heatmaps)?this.hd:this.qi.enable_heatmaps:this.qi.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.Qn)return;$O.info("starting..."),this.vd(),this.It()}else{var e;clearInterval((e=this.dd)!==null&&e!==void 0?e:void 0),this.fd(),this.getAndClearBuffer()}}onRemoteConfig(e){if(e.ok){var t=e.config;if("heatmaps"in t){var n=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[up]:n}),this.hd=n,this.startIfEnabled()}}}getAndClearBuffer(){var e=this.ft;return this.ft=void 0,e}pd(e){$f(e.originalEvent)&&this.ki(e.originalEvent,"deadclick")}It(){this.dd&&clearInterval(this.dd),this.dd=(j==null?void 0:j.visibilityState)==="visible"?setInterval(this.Oa.bind(this),this.flushIntervalMilliseconds):null}vd(){I&&j&&(this.gd=this.Oa.bind(this),Re(I,kc,this.gd),this.md=e=>this.ki(e||(I==null?void 0:I.event)),Re(j,"click",this.md,{capture:!0}),this.yd=e=>this.bd(e||(I==null?void 0:I.event)),Re(j,"mousemove",this.yd,{capture:!0}),this._d=new d_(this.instance,WI,this.pd.bind(this)),this._d.startIfEnabledOrStop(),this.wd=this.It.bind(this),Re(j,Cc,this.wd),this.Qn=!0)}fd(){var e;I&&j&&(this.gd&&I.removeEventListener(kc,this.gd),this.md&&j.removeEventListener("click",this.md,{capture:!0}),this.yd&&j.removeEventListener("mousemove",this.yd,{capture:!0}),this.wd&&j.removeEventListener(Cc,this.wd),clearTimeout(this.kd),(e=this._d)==null||e.stop(),this.Qn=!1)}Sd(e,t){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),i=this.instance.scrollManager.scrollElement(),s=function(o,a,l){for(var u=o;u&&ui(u)&&!Kt(u,"body");){if(u===l)return!1;var c=void 0;try{var d,f,m;c=(d=(f=(m=u.ownerDocument)==null?void 0:m.defaultView)!==null&&f!==void 0?f:I)==null?void 0:d.getComputedStyle(u).position}catch{return!1}if(J(a,c))return!0;u=SE(u)}return!1}(Sp(e),["fixed","sticky"],i);return{x:e.clientX+(s?0:r),y:e.clientY+(s?0:n),target_fixed:s,type:t}}ki(e,t){var n;if(t===void 0&&(t="click"),!t_(e.target)&&$f(e)){var r=this.Sd(e,t);(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&kE(Sp(e),this.instance.config.rageclick)&&this.Nn($({},r,{type:"rageclick"})),this.Nn(r)}}bd(e){!t_(e.target)&&$f(e)&&(clearTimeout(this.kd),this.kd=setTimeout(()=>{this.Nn(this.Sd(e,"mousemove"))},500))}Nn(e){if(I){var t=this.qi.disable_capture_url_hashes?li(I.location.href):I.location.href,n=this.qi.custom_personal_data_properties,r=this.qi.mask_personal_data_properties?[...Co,...n||[]]:[],i=Za(t,r,el);this.ft=this.ft||{},this.ft[i]||(this.ft[i]=[]),this.ft[i].push(e)}}Oa(){this.ft&&!En(this.ft)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:d_,webVitalsAutocapture:class{constructor(e){var t;this.hd=!1,this.Qn=!1,this.ft={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.xd=()=>{clearTimeout(this.Cd),this.Cd=void 0,this.ft.metrics.length!==0&&(this._instance.capture("$web_vitals",$({$current_url:this.ft.url},this.ft.metrics.reduce((n,r)=>$({},n,{["$web_vitals_"+r.name+"_event"]:$({},r),["$web_vitals_"+r.name+"_value"]:r.value}),{}))),this.ft={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Td=n=>{var r;if(this.ft=this.ft||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},ne(n==null?void 0:n.name)||ne(n==null?void 0:n.value))yi.error("Invalid metric received",n);else{var i=typeof n.navigationURL=="string"?n.navigationURL:void 0,s=this.Md(i);if(!L(s)){var o=Ge(n.navigationId)||typeof n.navigationId=="string"?"navigation:"+n.navigationId:"url:"+s;if(!this.Ed||this.Ed>n.value){this.ft.navigationKey!==o&&(this.xd(),this.Cd=setTimeout(this.xd,this.flushToCaptureTimeoutMs)),L(this.ft.navigationKey)&&(this.ft.navigationKey=o,this.ft.url=s),this.ft.firstMetricTimestamp=L(this.ft.firstMetricTimestamp)?Date.now():this.ft.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0);var a=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0),l=$({},n,i?{navigationURL:s}:{},{$current_url:s,timestamp:Date.now()});L(a)||(l.$session_id=a.sessionId,l.$window_id=a.windowId),this.ft.metrics.push(l),this.ft.metrics.length===this.allowedMetrics.length&&this.xd()}else yi.error("Ignoring metric with value >= "+this.Ed,n)}}},this.Id=()=>{if(!this.Qn){var n,r,i,s,o=Y.__PosthogExtensions__,a=o==null?void 0:o.postHogWebVitalsCallbacksByFlavor,l=(a==null?void 0:a[this.Rd])||(this.Rd==="web-vitals"&&L(a)?o==null?void 0:o.postHogWebVitalsCallbacks:void 0);if(L(l)||(n=l.onLCP,r=l.onCLS,i=l.onFCP,s=l.onINP),n&&r&&i&&s){var u={reportSoftNavs:this.useSoftNavs};this.allowedMetrics.indexOf("LCP")>-1&&n(this.Td.bind(this),u),this.allowedMetrics.indexOf("CLS")>-1&&r(this.Td.bind(this),u),this.allowedMetrics.indexOf("FCP")>-1&&i(this.Td.bind(this),u),this.allowedMetrics.indexOf("INP")>-1&&s(this.Td.bind(this),u),this.Qn=!0}else yi.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.hd=!((t=this._instance.persistence)==null||!t.props[hp]),this.startIfEnabled()}get Pd(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,n=Se(this.Pd)?(e=this.Pd)==null?void 0:e.web_vitals_allowed_metrics:void 0;return ne(n)?((t=this._instance.persistence)==null?void 0:t.props[pp])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(Se(this.Pd)?this.Pd.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=Se(this.Pd)?this.Pd.web_vitals_attribution:void 0;return e!=null&&e}get useSoftNavs(){var e=Se(this.Pd)?this.Pd.__preview_web_vitals_soft_navs:void 0;return e!=null&&e}get Ed(){var e=Se(this.Pd)&&Ge(this.Pd.__web_vitals_max_value)?this.Pd.__web_vitals_max_value:O_;return e>0&&6e4>=e?O_:e}get isEnabled(){var e=Ae==null?void 0:Ae.protocol;if(e!=="http:"&&e!=="https:")return yi.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=Se(this.Pd)?this.Pd.web_vitals:$t(this.Pd)?this.Pd:void 0;return $t(t)?t:this.hd}startIfEnabled(){this.isEnabled&&!this.Qn&&(yi.info("enabled, starting..."),this._s(this.Id))}onRemoteConfig(e){if(e.ok){var t=e.config;if("capturePerformance"in t){var n=Se(t.capturePerformance)&&!!t.capturePerformance.web_vitals,r=Se(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[hp]:n}),this._instance.persistence.register({[pp]:r})),this.hd=n,this.startIfEnabled()}}}get Rd(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}_s(e){var t=Y.__PosthogExtensions__,n=this.Rd,r=t==null?void 0:t.postHogWebVitalsCallbacksByFlavor;r!=null&&r[n]||n==="web-vitals"&&L(r)&&t!=null&&t.postHogWebVitalsCallbacks?e():t==null||t.loadExternalDependency==null||t.loadExternalDependency(this._instance,n,i=>{i?yi.error("failed to load script",i):e()})}Md(e){var t=e||(I==null?void 0:I.location.href);if(t){var n=this._instance.config.disable_capture_url_hashes?li(t):t,r=this._instance.config.custom_personal_data_properties,i=this._instance.config.mask_personal_data_properties?[...Co,...r||[]]:[];return Za(n,i,el)}yi.error("Could not determine current URL")}}},YO={exceptionObserver:class{constructor(e){var t;this.Id=()=>{var n;if(I&&this.isEnabled&&(n=Y.__PosthogExtensions__)!=null&&n.errorWrappingFunctions){var r=Y.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=Y.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,s=Y.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Ad&&this.qi.capture_unhandled_errors&&(this.Ad=r(this.captureException.bind(this))),!this.Fd&&this.qi.capture_unhandled_rejections&&(this.Fd=i(this.captureException.bind(this))),!this.Od&&this.qi.capture_console_errors&&(this.Od=s(this.captureException.bind(this)))}catch(o){ta.error("failed to start",o),this.Ld()}}},this._instance=e,this.$d=!((t=this._instance.persistence)==null||!t.props[cp]),this.oe=new jT($({},function(n){var r,i,s,o;return n===void 0&&(n={}),{refillRate:(r=(i=n.exceptionRateLimiterRefillRate)!==null&&i!==void 0?i:n.__exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:1,bucketSize:(s=(o=n.exceptionRateLimiterBucketSize)!==null&&o!==void 0?o:n.__exceptionRateLimiterBucketSize)!==null&&s!==void 0?s:10}}(this._instance.config.error_tracking),{refillInterval:1e4,I:ta})),this.qi=this.Dd(),this.startIfEnabledOrStop()}Dd(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Se(e)?t=$({},t,e):(L(e)?this.$d:e)&&(t=$({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.qi.capture_console_errors||this.qi.capture_unhandled_errors||this.qi.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(ta.info("enabled"),this.Ld(),this._s(this.Id)):this.Ld()}_s(e){var t,n;(t=Y.__PosthogExtensions__)!=null&&t.errorWrappingFunctions?e():(n=Y.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",r=>{if(r)return ta.error("failed to load script",r);e()})}Ld(){var e,t,n;(e=this.Ad)==null||e.call(this),this.Ad=void 0,(t=this.Fd)==null||t.call(this),this.Fd=void 0,(n=this.Od)==null||n.call(this),this.Od=void 0}onRemoteConfig(e){if(e.ok){var t=e.config;"autocaptureExceptions"in t&&(this.$d=!!t.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[cp]:this.$d}),this.qi=this.Dd(),this.startIfEnabledOrStop())}}onConfigChange(){this.qi=this.Dd()}captureException(e){var t,n,r,i=(t=e==null||(n=e.$exception_list)==null||(n=n[0])==null?void 0:n.type)!==null&&t!==void 0?t:"Exception";this.oe.consumeRateLimit(i)?ta.info("Skipping exception capture because of client rate limiting.",{exception:i}):(r=this._instance.exceptions)==null||r.sendExceptionEvent(e)}},exceptions:class{constructor(e){var t,n;this.Nd=[],this.qd=new rI([new dI,new wI,new hI,new fI,new yI,new mI,new vI,new _I],function(r){for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;i>o;o++)s[o-1]=arguments[o];return function(a,l){l===void 0&&(l=0);for(var u=[],c=a.split(` -`),d=l;c.length>d;d++){var f=c[d];if(1024>=f.length){var m=Ky.test(f)?f.replace(Ky,"$1"):f;if(!m.match(/\S*Error: /)){for(var _ of s){var p=_(m,r);if(p){u.push(p);break}}if(u.length>=50)break}}}return function(y){if(!y.length)return[];var h=Array.from(y);return h.reverse(),h.slice(0,50).map(v=>{return $({},v,{filename:v.filename||(x=h,x[x.length-1]||{}).filename,function:v.function||bo});var x})}(u)}}("web:javascript",aI,cI)),this._instance=e,this.Nd=(t=(n=this._instance.persistence)==null?void 0:n.get_property(dp))!==null&&t!==void 0?t:[],this.jd=_c(this.Bd()),this.Hd=new bI(this.jd)}onConfigChange(){this.jd=_c(this.Bd()),this.Hd.setConfig(this.jd)}onRemoteConfig(e){var t,n,r;if(e.ok){var i=e.config;if("errorTracking"in i){var s=(t=(n=i.errorTracking)==null?void 0:n.suppressionRules)!==null&&t!==void 0?t:[],o=(r=i.errorTracking)==null?void 0:r.captureExtensionExceptions;this.Nd=s,this._instance.persistence&&this._instance.persistence.register({[dp]:this.Nd,[fp]:o})}}}get Ud(){var e,t=!!this._instance.get_property(fp),n=this._instance.config.error_tracking.captureExtensionExceptions;return(e=n??t)!==null&&e!==void 0&&e}buildProperties(e,t){return this.qd.buildFromUnknown(e,{syntheticException:t==null?void 0:t.syntheticException,mechanism:{handled:t==null?void 0:t.handled}})}addExceptionStep(e,t){if(this.jd.enabled)try{if(!ce(e)||e.trim().length===0)return void gn.warn("Ignoring exception step because message must be a non-empty string");var n=function(s){if(!s)return{sanitizedProperties:{},droppedKeys:[]};var o=[];return{sanitizedProperties:Object.keys(s).reduce((a,l)=>xI.has(l)?(o.push(l),a):(a[l]=s[l],a),{}),droppedKeys:o}}(this.zd(t)),r=n.sanitizedProperties,i=n.droppedKeys;i.length>0&&gn.warn("Ignoring reserved exception step fields",{droppedKeys:i}),this.Hd.add($({[mc]:e,[yc]:new Date().toISOString()},r))}catch(s){gn.error("Failed to add exception step. Ignoring breadcrumb.",s)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this.Wd(t)){if(this.Vd(t))return this.Gd("Exception dropped: matched a suppression rule"),void gn.info("Skipping exception capture because a suppression rule matched");if(!this.Ud&&this.Zd(t))return this.Gd("Exception dropped: thrown by a browser extension"),void gn.info("Skipping exception capture because it was thrown by an extension");if(!this.Ud&&this.Qd(t))return this.Gd("Exception dropped: thrown by an injected browser script"),void gn.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Jd(t))return this.Gd("Exception dropped: thrown by the PostHog SDK"),void gn.info("Skipping exception capture because it was thrown by the PostHog SDK")}var n=this.jd.enabled&&ne(e.$exception_steps)?this.Kd(e):e,r=typeof(s=globalThis._posthogReleaseId)=="string"&&s.length>0?s:void 0;r&&(n.$release_id=r);try{var i=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",fl:!0});return i&&this.Hd.clear(),i}catch(o){return gn.error("Failed to capture exception event. Dropping this exception.",o),void this.Hd.clear()}}catch(o){return void gn.error("Failed to process exception event. Ignoring this exception.",o)}var s}Kd(e){try{var t=this.Hd.getAttachable();return t.length===0?e:$({},e,{$exception_steps:t})}catch(n){return gn.error("Failed to read buffered exception steps. Capturing exception without steps.",n),e}}Gd(e){this.jd.enabled&&this.Hd.add({[mc]:e,[yc]:new Date().toISOString()})}zd(e){return Se(e)?$({},e):{}}Bd(){var e,t;return(e=(t=this._instance.config.error_tracking)==null?void 0:t.exception_steps)!==null&&e!==void 0?e:{}}Vd(e){if(e.length===0)return!1;try{var t=e.reduce((n,r)=>{var i=r.type,s=r.value;return ce(i)&&i.length>0&&n.$exception_types.push(i),ce(s)&&s.length>0&&n.$exception_values.push(s),n},{$exception_types:[],$exception_values:[]});return this.Nd.some(n=>{var r=n.values.map(i=>{var s=tS[i.operator],o=t[i.key];if(!s||!o)return!1;var a=Z(i.value)?i.value:[i.value];return a.length>0&&s(a,o)});return n.type==="OR"?r.some(Boolean):r.every(Boolean)})}catch(n){return gn.warn("Failed to evaluate suppression rules. Capturing the exception.",n),!1}}Zd(e){return e.flatMap(t=>{var n,r;return(n=(r=t.stacktrace)==null?void 0:r.frames)!==null&&n!==void 0?n:[]}).some(t=>{var n=t.filename;return!!n&&WO.some(r=>n.startsWith(r))})}Qd(e){return e.some(t=>{var n=t.value;return ce(n)&&HO.some(r=>n.includes(r))})}Jd(e){if(e.length>0){var t,n,r,i,s=(t=(n=e[0].stacktrace)==null?void 0:n.frames)!==null&&t!==void 0?t:[],o=s[s.length-1];return(r=o==null||(i=o.filename)==null?void 0:i.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}Wd(e){return!ne(e)&&Z(e)}}},XO=$({productTours:class{get za(){return this._instance.persistence}constructor(e){this.Yd=null,this.Xd=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(e.ok){var t=e.config;if("productTours"in t){var n,r;if(this.za&&this.za.register({[xg]:!!t.productTours}),!Ff(this._instance))return!this.Yd&&ne((n=this.za)==null?void 0:n.props[da])||iu.info("product tours disabled; stopping and clearing cached tours"),(r=this.Yd)==null||r.stop(),this.Yd=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.Yd&&Ff(this._instance)&&this._s(()=>this.tv())}_s(e){var t,n;(t=Y.__PosthogExtensions__)!=null&&t.generateProductTours?e():(n=Y.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"product-tours",r=>{r?iu.error("Could not load product tours script",r):e()})}tv(){var e;!this.Yd&&(e=Y.__PosthogExtensions__)!=null&&e.generateProductTours&&(this.Yd=Y.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(t===void 0&&(t=!1),!Z(this.Xd)||t){var n=this.za;if(n){var r=n.props[da];if(Z(r)&&!t)return this.Xd=r,void e(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",timestampMode:"query",callback:i=>{if(Ff(this._instance)){var s=i.statusCode;if(s!==200||!i.json){var o="Product Tours API could not be loaded, status: "+s;return s===0?i.error||iu.warn(o):iu.error(o),void e([],{isLoaded:!1,error:o})}var a=Z(i.json.product_tours)?i.json.product_tours:[];this.Xd=a,n&&n.register({[da]:a}),e(a,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this.Xd,{isLoaded:!0})}getActiveProductTours(e){ne(this.Yd)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.Yd.getActiveProductTours(e)}showProductTour(e){var t;(t=this.Yd)==null||t.showTourById(e)}previewTour(e){this.Yd?this.Yd.previewTour(e):this._s(()=>{var t;this.tv(),(t=this.Yd)==null||t.previewTour(e)})}dismissProductTour(){var e;(e=this.Yd)==null||e.dismissTour("user_clicked_skip")}nextStep(){var e;(e=this.Yd)==null||e.nextStep()}previousStep(){var e;(e=this.Yd)==null||e.previousStep()}clearCache(){var e;this.Xd=null,(e=this.za)==null||e.unregister(da)}resetTour(e){var t;(t=this.Yd)==null||t.resetTour(e)}resetAllTours(){var e;(e=this.Yd)==null||e.resetAllTours()}cancelPendingTour(e){var t;(t=this.Yd)==null||t.cancelPendingTour(e)}}},hd),JO={siteApps:class{constructor(e){this.ev=0,this._instance=e,this.iv=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}rv(e,t){if(t){var n=this.globalsForEvent(t);this.iv.push(n),this.iv.length>1e3&&(this.iv=this.iv.slice(10))}}get siteAppLoaders(){var e;return(e=Y._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.rv.bind(this));this.nv=()=>{e(),this.iv=[],this.nv=void 0}}}globalsForEvent(e){var t,n,r,i,s,o,a;if(!e)throw new Error("Event payload is required");var l={},u=this._instance.get_property("$groups")||[],c=this._instance.get_property("$stored_group_properties")||{};for(var d of Object.entries(c)){var f=d[0];l[f]={id:u[f],type:f,properties:d[1]}}var m=e.$set_once,_=e.$set;return{event:$({},bb(e,FO),{properties:$({},e.properties,_?{$set:$({},(t=(n=e.properties)==null?void 0:n.$set)!==null&&t!==void 0?t:{},_)}:{},m?{$set_once:$({},(r=(i=e.properties)==null?void 0:i.$set_once)!==null&&r!==void 0?r:{},m)}:{}),elements_chain:(s=(o=e.properties)==null?void 0:o.$elements_chain)!==null&&s!==void 0?s:"",distinct_id:(a=e.properties)==null?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}sv(e){var t,n=(t=e.tagName)==null?void 0:t.toLowerCase();return n==="style"&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(e)||(On.error("prepare_external_dependency_stylesheet returned null"),null):n==="script"&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(e)||(On.error("prepare_external_dependency_script returned null"),null):e}av(){var e,t,n,r,i,s,o,a;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var l=j==null?void 0:j.defaultView,u=l==null||(e=l.Node)==null?void 0:e.prototype;if(!l||!u)return()=>{};if(this.ev++,this.ov)return this.lv();var c=[],d=this,f=new WeakSet,m=(y,h,v)=>{if(y!=null&&y[h]){var x=y[h];y[h]=v(x),c.push(()=>{y[h]=x})}},_=y=>{if(f.has(y))return y;var h=d.sv(y);return h&&f.add(h),h},p=y=>y.map(h=>typeof h=="string"?h:_(h)).filter(h=>!rt(h));return m(u,"appendChild",y=>function(h){var v=_(h);return v?y.call(this,v):h}),m(u,"insertBefore",y=>function(h,v){var x=_(h);return x?y.call(this,x,v):h}),m(u,"replaceChild",y=>function(h,v){var x=_(h);return x?y.call(this,x,v):v}),[(t=l.Element)==null?void 0:t.prototype,(n=l.Document)==null?void 0:n.prototype,(r=l.DocumentFragment)==null?void 0:r.prototype].forEach(y=>{m(y,"append",h=>function(){for(var v=arguments.length,x=new Array(v),b=0;v>b;b++)x[b]=arguments[b];return h.apply(this,p(x))}),m(y,"prepend",h=>function(){for(var v=arguments.length,x=new Array(v),b=0;v>b;b++)x[b]=arguments[b];return h.apply(this,p(x))})}),[(i=l.Element)==null?void 0:i.prototype,(s=l.CharacterData)==null?void 0:s.prototype,(o=l.DocumentType)==null?void 0:o.prototype].forEach(y=>{m(y,"before",h=>function(){for(var v=arguments.length,x=new Array(v),b=0;v>b;b++)x[b]=arguments[b];return h.apply(this,p(x))}),m(y,"after",h=>function(){for(var v=arguments.length,x=new Array(v),b=0;v>b;b++)x[b]=arguments[b];return h.apply(this,p(x))}),m(y,"replaceWith",h=>function(){for(var v=arguments.length,x=new Array(v),b=0;v>b;b++)x[b]=arguments[b];var E=p(x);return x.length&&!E.length?void 0:h.apply(this,E)})}),m((a=l.Element)==null?void 0:a.prototype,"insertAdjacentElement",y=>function(h,v){var x=_(v);return x?y.call(this,h,x):null}),this.ov=()=>{c.forEach(y=>y()),this.ov=void 0},this.lv()}lv(){var e=!1;return()=>{var t;e||(e=!0,this.ev--,this.ev===0&&((t=this.ov)==null||t.call(this)))}}uv(e,t){t===void 0&&(t=!0);var n=this.av();try{var r=e(n);return t&&n(),r}catch(i){throw n(),i}}setupSiteApp(e){var t=this.apps[e.id],n=()=>{var o;!t.errored&&this.iv.length&&(On.info("Processing "+this.iv.length+" events for site app with id "+e.id),this.iv.forEach(a=>this.uv(()=>t.processEvent==null?void 0:t.processEvent(a))),t.processedBuffer=!0),Object.values(this.apps).every(a=>a.processedBuffer||a.errored)&&((o=this.nv)==null||o.call(this))},r=!1,i=o=>{t.errored=!o,t.loaded=!0,On.info("Site app with id "+e.id+" "+(o?"loaded":"errored")),r&&n()};try{var s=this.uv(o=>e.init({posthog:this._instance,callback(a){o(),i(a)}}),!1).processEvent;s&&(t.processEvent=s),r=!0}catch(o){On.error(N_+e.id,o),i(!1)}if(r&&t.loaded)try{n()}catch(o){On.error("Error while processing buffered events PostHog app with config id "+e.id,o),t.errored=!0}}hv(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of e)this.setupSiteApp(n)}dv(e){var t=this;if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(e),r=function(s){try{t.uv(()=>s.processEvent==null?void 0:s.processEvent(n))}catch(o){On.error("Error while processing event "+e.event+" for site app "+s.id,o)}};for(var i of Object.values(this.apps))r(i)}}onRemoteConfig(e){var t,n,r,i=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.hv(),void this._instance.on("eventCaptured",l=>this.dv(l))):void On.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.nv)==null||n.call(this),e.ok){var s=e.config;if((r=s.siteApps)!=null&&r.length)if(this.isEnabled){var o=function(){var l,u=a.id,c=a.url;Y["__$$ph_site_app_"+u]=i._instance,(l=Y.__PosthogExtensions__)==null||l.loadSiteApp==null||l.loadSiteApp(i._instance,c,d=>{if(d)return On.error(N_+u,d)})};for(var a of s.siteApps)o()}else On.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},ZO={tracingHeaders:class{constructor(e){this.vv=void 0,this.fv=void 0,this.pv=void 0,this.Id=()=>{var t,n,r=this.gv();r?(L(this.vv)&&(this.vv=(t=Y.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null?void 0:t._patchXHR(r,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),L(this.fv)&&(this.fv=(n=Y.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null?void 0:n._patchFetch(r,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.Ld()},this._instance=e}initialize(){this.startIfEnabledOrStop()}_s(e){var t,n;(t=Y.__PosthogExtensions__)!=null&&t.tracingHeadersPatchFns?e():(n=Y.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",r=>{if(r)return NO.error("failed to load script",r);e()})}mv(){var e,t;return(e=(t=this._instance.config.tracing_headers)!==null&&t!==void 0?t:this._instance.config.addTracingHeaders)!==null&&e!==void 0?e:this._instance.config.__add_tracing_headers}gv(){var e=this.mv();return Z(e)?(Z(this.pv)?this.pv.splice(0,this.pv.length,...e):this.pv=[...e],e.length>0?this.pv:void 0):(Z(this.pv)&&this.pv.splice(0),this.pv=e||void 0,this.pv)}Ld(){var e,t;(e=this.vv)==null||e.call(this),(t=this.fv)==null||t.call(this),this.vv=void 0,this.fv=void 0}startIfEnabledOrStop(){this.gv()?this._s(this.Id):this.Ld()}}},eM=$({surveys:class extends LO{constructor(e){var t;super(new VO(e),{get projectToken(){return t.config.token},kv:new UO(t=e)}),this._instance=e}Nl(e,t){var n=t.query?bl(e,t.query):e;return new Promise(r=>{var i;this._instance._send_request({method:t.method,url:this._instance.requestRouter.endpointFor((i=t.target)!==null&&i!==void 0?i:"api",n),data:t.body,headers:t.headers,timeout:t.timeoutMs,fireCallbackOnDrop:!0,transport:t.transport,compression:t.compression,timestampMode:t.sentAt,callback:r})})}}},hd),tM={toolbar:class{constructor(e){this.instance=e}yv(e){Y.ph_toolbar_state=e}bv(){var e;return(e=Y.ph_toolbar_state)!==null&&e!==void 0?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,n){if(e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),Ep(this.instance.config)||!I||!j)return!1;e=e??I.location,n=n??I.history;try{if(!t){try{I.localStorage.setItem("test","test"),I.localStorage.removeItem("test")}catch{return!1}t=I==null?void 0:I.localStorage}var r,i=BO||Ic(e.hash,"__posthog")||Ic(e.hash,"state"),s=i?Xy(()=>JSON.parse(atob(decodeURIComponent(i))))||Xy(()=>JSON.parse(decodeURIComponent(i))):null;return s&&s.action==="ph_authorize"?((r=s).source="url",r&&Object.keys(r).length>0&&(s.desiredHash?e.hash=s.desiredHash:n?n.replaceState(n.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem(F_)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch{return!1}}_v(e){var t=Y.ph_load_toolbar||Y.ph_load_editor;!ne(t)&&vt(t)?t(e,this.instance):L_.warn("No toolbar load function found")}loadToolbar(e){var t=!(j==null||!j.getElementById(_E));if(!I||t)return!1;var n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=$({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(I.localStorage.setItem(F_,JSON.stringify($({},r,{source:void 0}))),this.bv()===2)this._v(r);else if(this.bv()===0){var i;this.yv(1),(i=Y.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this.instance,"toolbar",s=>{if(s)return L_.error("[Toolbar] Failed to load",s),void this.yv(0);this.yv(2),this._v(r)}),Re(I,"turbolinks:load",()=>{this.yv(0),this.loadToolbar(r)})}return!0}wv(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,n){return e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),this.maybeLoadToolbar(e,t,n)}}},nM=$({experiments:ht},hd),rM={conversations:class{constructor(e){this.Sv=void 0,this._conversationsManager=null,this.xv=!1,this.Me=null,this.Cv=!1,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations&&(this.Tv=e.ok,e.ok)){var t=e.config.conversations;ne(t)||($t(t)?this.Sv=t:(this.Sv=t.enabled,this.Me=t),this.loadIfEnabled())}}reset(){var e;(e=this._conversationsManager)==null||e.reset(),this._conversationsManager=null,this.Sv=void 0,this.Me=null,this.Tv=void 0,this.Cv=!1}loadIfEnabled(){if(!(this._conversationsManager||this.xv||this._instance.config.disable_conversations||Ep(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=Y==null?void 0:Y.__PosthogExtensions__;if(e&&!L(this.Sv)&&this.Sv)if(this.Me&&this.Me.token){this.xv=!0;try{var t=e.initConversations;if(t)return this.Mv(t),void(this.xv=!1);var n=e.loadExternalDependency;if(!n)return void this.Ev(Eg);n(this._instance,"conversations",r=>{r||!e.initConversations?this.Ev("Could not load conversations script",r):this.Mv(e.initConversations),this.xv=!1})}catch(r){this.Ev("Error initializing conversations",r),this.xv=!1}}else tn.error("Conversations enabled but missing token in remote config.")}}Mv(e){if(this.Me)try{this._conversationsManager=e(this.Me,this._instance),this.Cv=!1,tn.info("Conversations loaded successfully")}catch(t){this.Ev("Error completing conversations initialization",t)}else tn.error("Cannot complete initialization: remote config is null")}Ev(e,t){tn.error(e,t),this._conversationsManager=null,this.xv=!1,this.Cv=!0}show(){this._conversationsManager?this._conversationsManager.show():tn.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Sv===!0&&!rt(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":Ep(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":this.Tv===!1?"remote_config_failed":L(this.Sv)?this.Tv?"disabled_in_project":"remote_config_pending":this.Sv?ne(this.Me)||!this.Me.token?"missing_token":Y!=null&&Y.__PosthogExtensions__?this.xv?"initializing":this.Cv?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.isVisible())!==null&&e!==void 0&&e}sendMessage(e,t,n){var r=this;return Ce(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(e,t,n):(tn.warn(wi),null)})()}getMessages(e,t){var n=this;return Ce(function*(){return n._conversationsManager?n._conversationsManager.getMessages(e,t):(tn.warn(wi),null)})()}markAsRead(e){var t=this;return Ce(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(tn.warn(wi),null)})()}getTickets(e){var t=this;return Ce(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(tn.warn(wi),null)})()}requestRestoreLink(e){var t=this;return Ce(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(tn.warn(wi),null)})()}restoreFromToken(e){var t=this;return Ce(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(tn.warn(wi),null)})()}restoreFromUrlToken(){var e=this;return Ce(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(tn.warn(wi),null)})()}getCurrentTicketId(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.getCurrentTicketId())!==null&&e!==void 0?e:null}getWidgetSessionId(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.getWidgetSessionId())!==null&&e!==void 0?e:null}Sl(){var e;(e=this._conversationsManager)==null||e.setIdentity()}xl(){var e;(e=this._conversationsManager)==null||e.clearIdentity()}}},iM={logs:class{constructor(e){var t,n=this;this.Iv=!1,this.Rv=!1,this.I=Ie("[logs]"),this.Pv=$({},this.I,{error(){for(var r=arguments.length,i=new Array(r),s=0;r>s;s++)i[s]=arguments[s];i.some(W_)||n.I.error(...i)}}),this.ka=[],this.Av=[],this.ph=0,this.Fv=()=>{var r,i;this.ph=0,(r=this.Ov)==null||r.onReconnect(),(i=this.Lv)==null||i.onReconnect()},this._instance=e,this._instance&&(t=this._instance.config.logs)!=null&&t.captureConsoleLogs&&(this.Iv=!0),I&&Re(I,"online",this.Fv)}$v(e,t,n,r){var i,s=function(o,a){var l,u,c,d,f,m,_,p=(l=o==null?void 0:o.flushIntervalMs)!==null&&l!==void 0?l:3e3,y=(u=o==null?void 0:o.maxBufferSize)!==null&&u!==void 0?u:100,h=a!=null&&a.consoleCapture?void 0:(c=o==null?void 0:o.maxLogsPerInterval)!==null&&c!==void 0?c:1e3,v=L(h)?Math.max(y,2048):Math.max(y,h),x=o==null?void 0:o.resourceAttributes;return{serviceName:(d=(f=x==null?void 0:x["service.name"])!==null&&f!==void 0?f:o==null?void 0:o.serviceName)!==null&&d!==void 0?d:a==null?void 0:a.serviceNameDefault,serviceVersion:(m=x==null?void 0:x["service.version"])!==null&&m!==void 0?m:o==null?void 0:o.serviceVersion,environment:(_=x==null?void 0:x["deployment.environment"])!==null&&_!==void 0?_:o==null?void 0:o.environment,resourceAttributes:x,beforeSend:o==null?void 0:o.beforeSend,flushIntervalMs:p,maxBufferSize:y,maxQueueSize:v,maxBatchRecordsPerPost:100,rateCapWindowMs:p,maxLogsPerInterval:h,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}((i=this._instance)==null||(i=i.config)==null?void 0:i.logs,n);return[new eI(this.Dv(e,t),s,this.Pv,()=>this.Nv(),o=>o(),void 0,r),s]}qv(){var e,t=(e=this._instance)==null||(e=e.config)==null?void 0:e.logs;if(!this.Ov||this.jv!==t){var n;(n=this.Ov)==null||n.reset(),this.jv=t;var r=this.$v(()=>this.ka,i=>{this.ka=i});this.Ov=r[0],this.Bv=r[1]}return this.Ov}Hv(){var e,t=(e=this._instance)==null||(e=e.config)==null?void 0:e.logs;if(!this.Lv||this.Uv!==t){var n;(n=this.Lv)==null||n.reset(),this.Uv=t;var r=this.$v(()=>this.Av,i=>{this.Av=i},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},q_);this.Lv=r[0],this.zv=r[1]}return this.Lv}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t;if(e.ok){var n=(t=e.config.logs)==null?void 0:t.captureConsoleLogs;!ne(n)&&n&&(this.Iv=!0,this.loadIfEnabled())}}reset(){var e,t;this.ka=[],(e=this.Ov)==null||e.reset(),this.Av=[],(t=this.Lv)==null||t.reset(),this.ph=0}captureLog(e){this.qv().captureLog(e)}vi(e){this.Hv().captureLog(e)}get logger(){return this.Wv||(this.Wv={trace:(e,t)=>this.captureLog({body:e,level:"trace",attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:"debug",attributes:t}),info:(e,t)=>this.captureLog({body:e,level:"info",attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:"warn",attributes:t}),error:(e,t)=>this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.Wv}flushLogs(e){e?this.Vv(e):(this.Ov&&this.Ov.flush().catch(t=>this.Gv(t)),this.Lv&&this.Lv.flush().catch(t=>this.Gv(t)))}Gv(e){W_(e)||this.I.error("PostHog logs flush failed:",e)}loadIfEnabled(){if(this.Iv&&!this.Rv){var e=Y==null?void 0:Y.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,"logs",n=>{var r;n||(r=e.logs)==null||!r.initializeLogs?this.I.error("Could not load logs script",n):(e.logs.initializeLogs(this._instance),this.Rv=!0)}):this.I.error(Eg)}else this.I.error("PostHog Extensions not found.")}}Dv(e,t){var n=this._instance;return{get isDisabled(){return!1},get optedOut(){return!n.is_capturing()},getPersistedProperty:r=>r===nr.LogsQueue?e():void 0,setPersistedProperty(r,i){var s;r===nr.LogsQueue&&t((s=i)!==null&&s!==void 0?s:[])},Mn:r=>this.Mn(r),getLibraryId:()=>Ee.LIB_NAME,getLibraryVersion:()=>Ee.LIB_VERSION}}Mn(e){return new Promise(t=>{if(ME(this.ph,3))t({kind:"fatal",error:jf(void 0,"logs endpoint is unreachable, dropping batch")});else{var n=!1,r=s=>{n||(n=!0,clearTimeout(i),t(s))},i=setTimeout(()=>{this.I.warn("Logs request timed out before receiving a response"),r({kind:"retry-later",error:jf(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.Zv(),data:e,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:s=>{var o=s.statusCode;if(this.Qv(o),o>=200&&300>o)r({kind:"ok"});else if(o===413)r({kind:"too-large"});else if(o!==0&&o!==408&&o!==429&&500>o)r({kind:"fatal",error:new Error("logs request failed with status "+o)});else{var a;o===0?(s.error||this.I.warn("Logs request failed before receiving an HTTP response"),r({kind:"retry-later",error:jf(s.error,"logs request failed before receiving an HTTP response")})):r({kind:"retry-later",error:(a=s.error)!==null&&a!==void 0?a:new Error("logs request failed with status "+o)})}}})}})}Qv(e){(e!==0||this._instance.__loaded)&&(this.ph=AE(e,this.ph,3,()=>this.I.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.")))}Vv(e){this.ka.length>0&&this.Jv(e,this.ka,this.Bv,Ee.LIB_NAME,t=>{this.ka=t}),this.Av.length>0&&this.Jv(e,this.Av,this.zv,q_,t=>{this.Av=t})}Jv(e,t,n,r,i){if(t.length!==0){var s=t.map(a=>a.record);i([]);var o=tE(s,eE(n,Ee.LIB_NAME,Ee.LIB_VERSION),r,Ee.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Zv(),data:o,compression:"best-available",batchKey:"logs",transport:e})}}Zv(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}Nv(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var n=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),r=n.windowId,i=n.sessionStartTimestamp,s=n.lastActivityTimestamp;t.sessionId=n.sessionId,t.windowId=r,ne(i)||(t.sessionStartTimestamp=i),ne(s)||(t.lastActivityTimestamp=s)}if(Y!=null&&(e=Y.location)!=null&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?li(Y.location.href):Y.location.href),this._instance.featureFlags){var o=this._instance.featureFlags.getFlags();o&&o.length>0&&(t.activeFeatureFlags=o)}return t}}},sM={metrics:class{constructor(e){this.I=Ie("[metrics]"),this._instance=e}initialize(){}qv(){var e,t,n=(e=this._instance)==null||(e=e.config)==null?void 0:e.metrics;return this.Ov&&this.jv===n||((t=this.Ov)==null||t.reset(),this.jv=n,this.Ov=new tI(this.Dv(),function(r){var i,s,o,a,l,u=r==null?void 0:r.resourceAttributes;return{serviceName:(i=u==null?void 0:u["service.name"])!==null&&i!==void 0?i:r==null?void 0:r.serviceName,serviceVersion:(s=u==null?void 0:u["service.version"])!==null&&s!==void 0?s:r==null?void 0:r.serviceVersion,environment:(o=u==null?void 0:u["deployment.environment"])!==null&&o!==void 0?o:r==null?void 0:r.environment,resourceAttributes:u,beforeSend:r==null?void 0:r.beforeSend,flushIntervalMs:(a=r==null?void 0:r.flushIntervalMs)!==null&&a!==void 0?a:1e4,maxSeriesPerFlush:(l=r==null?void 0:r.maxSeriesPerFlush)!==null&&l!==void 0?l:1e3}}(n),this.I)),this.Ov}count(e,t,n){t===void 0&&(t=1),this.qv().count(e,t,n)}gauge(e,t,n){this.qv().gauge(e,t,n)}histogram(e,t,n){this.qv().histogram(e,t,n)}flush(e){if(!this.Ov)return Promise.resolve();if(e){var t=this.Ov.drainWindow();return t&&this.Un(t,e),Promise.resolve()}return this.Ov.flush().catch(n=>this.I.error("PostHog metrics flush failed:",n))}reset(){var e;(e=this.Ov)==null||e.reset()}Dv(){var e=this._instance,t=this;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},Un:n=>t.Un(n),getLibraryId:()=>Ee.LIB_NAME,getLibraryVersion:()=>Ee.LIB_VERSION}}Un(e,t){return new Promise(n=>{var r=!1,i=o=>{r||(r=!0,clearTimeout(s),n(o))},s=setTimeout(()=>i({kind:"retry-later",error:new Error("metrics request timed out")}),9e4);this._instance._send_request($({method:"POST",url:this.Kv(),data:e,compression:"best-available",batchKey:"metrics"},t&&{transport:t},{fireCallbackOnDrop:!0,callback(o){var a=o.statusCode;if(a>=200&&300>a)i({kind:"ok"});else if(a===413)i({kind:"too-large"});else if(a!==0&&a!==408&&a!==429&&500>a)i({kind:"fatal",error:new Error("metrics request failed with status "+a)});else{var l;i({kind:"retry-later",error:(l=o.error)!==null&&l!==void 0?l:new Error("metrics request failed with status "+a)})}}}))})}Kv(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},oM=$({},hd,KO,QO,YO,XO,JO,eM,ZO,tM,nM,rM,iM,sM);qt.__defaultExtensionClasses=$({},oM);var aM=function(){Ee.SDK_DIST_CHANNEL="npm";var e=Ra[bs]=new qt;return function(){function t(){t.done||(t.done=!0,aS=!1,ve(Ra,function(n){n._dom_loaded()}))}j!=null&&j.addEventListener?j.readyState==="complete"?t():Re(j,"DOMContentLoaded",t,{capture:!1}):I&&D.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),e}(),dS;function lM(e){dS=e}function uM(){return dS}var cM=g.createContext({get client(){return uM()},bootstrap:void 0}),Df=function(e){return typeof e=="function"},dM=function(e){return e===void 0},$p=function(e,t){return $p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},$p(e,t)};function fM(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");$p(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Au=function(e){var t=Object.prototype.toString.call(e);return e instanceof Error||t==="[object Error]"||t==="[object Exception]"||t==="[object DOMException]"||t==="[object DOMError]"},hM=function(e,t){for(var n=new WeakSet,r=e;!n.has(r);){if(n.add(r),!Au(r.cause)){dM(r.cause)||(t.cause=r.cause),r.cause=t;return}r=r.cause}},pM=function(e,t){if(!t)return e;var n=new Error(Au(e)?e.message:"Primitive value captured as exception: ".concat(String(e)));return n.name="React ErrorBoundary ".concat(Au(e)?e.name:"Error"),n.stack=t,Au(e)?(hM(e,n),e):n},vM={componentStack:null,exceptionEvent:null,error:null},gM={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."};(function(e){fM(t,e);function t(n){var r=e.call(this,n)||this;return r.state=vM,r}return t.prototype.componentDidCatch=function(n,r){var i=this.props.additionalProperties,s;Df(i)?s=i(n,r):typeof i=="object"&&(s=i);var o=this.context.client,a=r.componentStack,l=o.captureException(pM(n,a),s);this.setState({error:n,componentStack:a??null,exceptionEvent:l})},t.prototype.render=function(){var n=this.props,r=n.children,i=n.fallback,s=this.state;if(s.componentStack==null)return Df(r)?r():r;var o=Df(i)?q.createElement(i,{error:s.error,componentStack:s.componentStack,exceptionEvent:s.exceptionEvent}):i;return q.isValidElement(o)?o:(console.warn(gM.INVALID_FALLBACK),q.createElement(q.Fragment,null))},t.contextType=cM,t})(q.Component);lM(aM);class fS extends q.Component{constructor(){super(...arguments);kr(this,"state",{failed:!1,resetKey:this.props.resetKey})}static getDerivedStateFromError(){return{failed:!0}}static getDerivedStateFromProps(n,r){return n.resetKey===r.resetKey?null:{failed:!1,resetKey:n.resetKey}}componentDidCatch(n){console.error("The application could not render",n)}render(){if(!this.state.failed)return this.props.children;const n=w.jsxs("div",{className:"page",role:"alert",children:[w.jsx("h1",{children:"This page could not load"}),w.jsx("p",{children:"The site may have been updated while this tab was open."}),w.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>window.location.reload(),children:"Reload page"})]});return this.props.resetKey===void 0?w.jsx("main",{children:n}):n}}const zf="pwc:chunk-reload-at",hS=6e4;function mM(e,t){if(!e)return!0;const n=Number(e);return!Number.isFinite(n)||t-n>=hS}function yM(){if(typeof window>"u")return()=>{};const e=n=>{const r=Date.now();mM(sessionStorage.getItem(zf),r)&&(n.preventDefault(),sessionStorage.setItem(zf,String(r)),window.location.reload())};window.addEventListener("vite:preloadError",e);const t=window.setTimeout(()=>sessionStorage.removeItem(zf),hS);return()=>{window.removeEventListener("vite:preloadError",e),window.clearTimeout(t)}}const _M="modulepreload",wM=function(e){return"/"+e},H_={},ae=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.allSettled(n.map(l=>{if(l=wM(l),l in H_)return;H_[l]=!0;const u=l.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${c}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":_M,u||(d.as="script"),d.crossOrigin="",d.href=l,a&&d.setAttribute("nonce",a),document.head.appendChild(d),u)return new Promise((f,m)=>{d.addEventListener("load",f),d.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${l}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return t().catch(s)})};/** +`+s.stack}return{value:e,source:t,stack:i,digest:null}}function rf(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function jh(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var BR=typeof WeakMap=="function"?WeakMap:Map;function Wx(e,t,n){n=hr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){sc||(sc=!0,Kh=r),jh(e,t)},n}function Hx(e,t,n){n=hr(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){jh(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){jh(e,t),typeof r!="function"&&(ti===null?ti=new Set([this]):ti.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function uy(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new BR;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=rT.bind(null,e,t,n),t.then(e,e))}function cy(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function dy(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=hr(-1,1),t.tag=2,ei(n,t,1))),n.lanes|=1),e)}var qR=wr.ReactCurrentOwner,Ft=!1;function bt(e,t,n,r){t.child=e===null?xx(t,null,n,r):mo(t,e.child,n,r)}function fy(e,t,n,r,i){n=n.render;var s=t.ref;return Bs(t,i),r=Kv(e,t,n,r,s,i),n=Qv(),e!==null&&!Ft?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,mr(e,t,i)):(je&&n&&Fv(t),t.flags|=1,bt(e,t,r,i),t.child)}function hy(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!sg(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,Gx(e,t,s,r,i)):(e=ku(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:ja,n(o,r)&&e.ref===t.ref)return mr(e,t,i)}return t.flags|=1,e=ri(s,r),e.ref=t.ref,e.return=t,t.child=e}function Gx(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(ja(s,r)&&e.ref===t.ref)if(Ft=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(Ft=!0);else return t.lanes=e.lanes,mr(e,t,i)}return Dh(e,t,n,r,i)}function Kx(e,t,n){var r=t.pendingProps,i=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Te($s,Vt),Vt|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Te($s,Vt),Vt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,Te($s,Vt),Vt|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,Te($s,Vt),Vt|=r;return bt(e,t,i,n),t.child}function Qx(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Dh(e,t,n,r,i){var s=Dt(n)?Qi:yt.current;return s=vo(t,s),Bs(t,i),n=Kv(e,t,n,r,s,i),r=Qv(),e!==null&&!Ft?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,mr(e,t,i)):(je&&r&&Fv(t),t.flags|=1,bt(e,t,n,i),t.child)}function py(e,t,n,r,i){if(Dt(n)){var s=!0;Qu(t)}else s=!1;if(Bs(t,i),t.stateNode===null)Eu(e,t),qx(t,n,r),Lh(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=cn(u):(u=Dt(n)?Qi:yt.current,u=vo(t,u));var c=n.getDerivedStateFromProps,d=typeof c=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==u)&&ly(t,o,r,u),Fr=!1;var f=t.memoizedState;o.state=f,ec(t,r,o,i),l=t.memoizedState,a!==r||f!==l||jt.current||Fr?(typeof c=="function"&&(Fh(t,n,c,r),l=t.memoizedState),(a=Fr||ay(t,n,a,r,f,l,u))?(d||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=u,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,Ex(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:mn(t.type,a),o.props=u,d=t.pendingProps,f=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=cn(l):(l=Dt(n)?Qi:yt.current,l=vo(t,l));var m=n.getDerivedStateFromProps;(c=typeof m=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==d||f!==l)&&ly(t,o,r,l),Fr=!1,f=t.memoizedState,o.state=f,ec(t,r,o,i);var _=t.memoizedState;a!==d||f!==_||jt.current||Fr?(typeof m=="function"&&(Fh(t,n,m,r),_=t.memoizedState),(u=Fr||ay(t,n,u,r,f,_,l)||!1)?(c||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,_,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,_,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=_),o.props=r,o.state=_,o.context=l,r=u):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return zh(e,t,n,r,s,i)}function zh(e,t,n,r,i,s){Qx(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&Zm(t,n,!1),mr(e,t,s);r=t.stateNode,qR.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=mo(t,e.child,null,s),t.child=mo(t,null,a,s)):bt(e,t,a,s),t.memoizedState=r.state,i&&Zm(t,n,!0),t.child}function Yx(e){var t=e.stateNode;t.pendingContext?Jm(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Jm(e,t.context,!1),qv(e,t.containerInfo)}function vy(e,t,n,r,i){return go(),jv(i),t.flags|=256,bt(e,t,n,r),t.child}var Uh={dehydrated:null,treeContext:null,retryLane:0};function Vh(e){return{baseLanes:e,cachePool:null,transitions:null}}function Xx(e,t,n){var r=t.pendingProps,i=De.current,s=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(i&2)!==0),a?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Te(De,i&1),e===null)return Nh(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,s?(r=t.mode,s=t.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=sd(o,r,0,null),e=Wi(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Vh(n),t.memoizedState=Uh,e):Jv(t,o));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return WR(e,t,o,r,a,i,n);if(s){s=r.fallback,o=t.mode,i=e.child,a=i.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=ri(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=ri(a,s):(s=Wi(s,o,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,o=e.child.memoizedState,o=o===null?Vh(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~n,t.memoizedState=Uh,r}return s=e.child,e=s.sibling,r=ri(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Jv(e,t){return t=sd({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Bl(e,t,n,r){return r!==null&&jv(r),mo(t,e.child,null,n),e=Jv(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function WR(e,t,n,r,i,s,o){if(n)return t.flags&256?(t.flags&=-257,r=rf(Error(U(422))),Bl(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=sd({mode:"visible",children:r.children},i,0,null),s=Wi(s,i,o,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&mo(t,e.child,null,o),t.child.memoizedState=Vh(o),t.memoizedState=Uh,s);if(!(t.mode&1))return Bl(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(U(419)),r=rf(s,r,void 0),Bl(e,t,o,r)}if(a=(o&e.childLanes)!==0,Ft||a){if(r=it,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,gr(e,i),Cn(r,e,i,-1))}return ig(),r=rf(Error(U(421))),Bl(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=iT.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,Gt=Zr(i.nextSibling),Qt=t,je=!0,xn=null,e!==null&&(rn[sn++]=cr,rn[sn++]=dr,rn[sn++]=Yi,cr=e.id,dr=e.overflow,Yi=t),t=Jv(t,r.children),t.flags|=4096,t)}function gy(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),$h(e.return,t,n)}function sf(e,t,n,r,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function Jx(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(bt(e,t,r.children,n),r=De.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&gy(e,n,t);else if(e.tag===19)gy(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Te(De,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&tc(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),sf(t,!1,i,n,s);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&tc(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}sf(t,!0,n,null,s);break;case"together":sf(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Eu(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function mr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ji|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(U(153));if(t.child!==null){for(e=t.child,n=ri(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ri(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function HR(e,t,n){switch(t.tag){case 3:Yx(t),go();break;case 5:Sx(t);break;case 1:Dt(t.type)&&Qu(t);break;case 4:qv(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Te(Ju,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Te(De,De.current&1),t.flags|=128,null):n&t.child.childLanes?Xx(e,t,n):(Te(De,De.current&1),e=mr(e,t,n),e!==null?e.sibling:null);Te(De,De.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Jx(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Te(De,De.current),r)break;return null;case 22:case 23:return t.lanes=0,Kx(e,t,n)}return mr(e,t,n)}var Zx,Bh,eb,tb;Zx=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Bh=function(){};eb=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Ii(Wn.current);var s=null;switch(n){case"input":i=dh(e,i),r=dh(e,r),s=[];break;case"select":i=Ve({},i,{value:void 0}),r=Ve({},r,{value:void 0}),s=[];break;case"textarea":i=ph(e,i),r=ph(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Gu)}gh(n,r);var o;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var a=i[u];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Oa.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in r){var l=r[u];if(a=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(s||(s=[]),s.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Oa.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&Me("scroll",e),s||a===l||(s=[])):(s=s||[]).push(u,l))}n&&(s=s||[]).push("style",n);var u=s;(t.updateQueue=u)&&(t.flags|=4)}};tb=function(e,t,n,r){n!==r&&(t.flags|=4)};function Ho(e,t){if(!je)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ft(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function GR(e,t,n){var r=t.pendingProps;switch(Lv(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ft(t),null;case 1:return Dt(t.type)&&Ku(),ft(t),null;case 3:return r=t.stateNode,yo(),$e(jt),$e(yt),Hv(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ul(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,xn!==null&&(Xh(xn),xn=null))),Bh(e,t),ft(t),null;case 5:Wv(t);var i=Ii(Ba.current);if(n=t.type,e!==null&&t.stateNode!=null)eb(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(U(166));return ft(t),null}if(e=Ii(Wn.current),Ul(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[zn]=t,r[Ua]=s,e=(t.mode&1)!==0,n){case"dialog":Me("cancel",r),Me("close",r);break;case"iframe":case"object":case"embed":Me("load",r);break;case"video":case"audio":for(i=0;i<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[zn]=t,e[Ua]=r,Zx(e,t,!1,!1),t.stateNode=e;e:{switch(o=mh(n,r),n){case"dialog":Me("cancel",e),Me("close",e),i=r;break;case"iframe":case"object":case"embed":Me("load",e),i=r;break;case"video":case"audio":for(i=0;iwo&&(t.flags|=128,r=!0,Ho(s,!1),t.lanes=4194304)}else{if(!r)if(e=tc(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ho(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!je)return ft(t),null}else 2*Qe()-s.renderingStartTime>wo&&n!==1073741824&&(t.flags|=128,r=!0,Ho(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Qe(),t.sibling=null,n=De.current,Te(De,r?n&1|2:n&1),t):(ft(t),null);case 22:case 23:return rg(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Vt&1073741824&&(ft(t),t.subtreeFlags&6&&(t.flags|=8192)):ft(t),null;case 24:return null;case 25:return null}throw Error(U(156,t.tag))}function KR(e,t){switch(Lv(t),t.tag){case 1:return Dt(t.type)&&Ku(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return yo(),$e(jt),$e(yt),Hv(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Wv(t),null;case 13:if($e(De),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(U(340));go()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $e(De),null;case 4:return yo(),null;case 10:return Uv(t.type._context),null;case 22:case 23:return rg(),null;case 24:return null;default:return null}}var ql=!1,gt=!1,QR=typeof WeakSet=="function"?WeakSet:Set,G=null;function Ns(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){He(e,t,r)}else n.current=null}function qh(e,t,n){try{n()}catch(r){He(e,t,r)}}var my=!1;function YR(e,t){if(Ph=qu,e=ox(),$v(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var m;d!==n||i!==0&&d.nodeType!==3||(a=o+i),d!==s||r!==0&&d.nodeType!==3||(l=o+r),d.nodeType===3&&(o+=d.nodeValue.length),(m=d.firstChild)!==null;)f=d,d=m;for(;;){if(d===e)break t;if(f===n&&++u===i&&(a=o),f===s&&++c===r&&(l=o),(m=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=m}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Rh={focusedElem:e,selectionRange:n},qu=!1,G=t;G!==null;)if(t=G,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,G=e;else for(;G!==null;){t=G;try{var _=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(_!==null){var p=_.memoizedProps,y=_.memoizedState,h=t.stateNode,v=h.getSnapshotBeforeUpdate(t.elementType===t.type?p:mn(t.type,p),y);h.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(U(163))}}catch(b){He(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,G=e;break}G=t.return}return _=my,my=!1,_}function xa(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&qh(t,n,s)}i=i.next}while(i!==r)}}function rd(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Wh(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function nb(e){var t=e.alternate;t!==null&&(e.alternate=null,nb(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[zn],delete t[Ua],delete t[Oh],delete t[MR],delete t[AR])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function rb(e){return e.tag===5||e.tag===3||e.tag===4}function yy(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||rb(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Hh(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Gu));else if(r!==4&&(e=e.child,e!==null))for(Hh(e,t,n),e=e.sibling;e!==null;)Hh(e,t,n),e=e.sibling}function Gh(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Gh(e,t,n),e=e.sibling;e!==null;)Gh(e,t,n),e=e.sibling}var st=null,wn=!1;function Pr(e,t,n){for(n=n.child;n!==null;)ib(e,t,n),n=n.sibling}function ib(e,t,n){if(qn&&typeof qn.onCommitFiberUnmount=="function")try{qn.onCommitFiberUnmount(Qc,n)}catch{}switch(n.tag){case 5:gt||Ns(n,t);case 6:var r=st,i=wn;st=null,Pr(e,t,n),st=r,wn=i,st!==null&&(wn?(e=st,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):st.removeChild(n.stateNode));break;case 18:st!==null&&(wn?(e=st,n=n.stateNode,e.nodeType===8?Xd(e.parentNode,n):e.nodeType===1&&Xd(e,n),Fa(e)):Xd(st,n.stateNode));break;case 4:r=st,i=wn,st=n.stateNode.containerInfo,wn=!0,Pr(e,t,n),st=r,wn=i;break;case 0:case 11:case 14:case 15:if(!gt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&qh(n,t,o),i=i.next}while(i!==r)}Pr(e,t,n);break;case 1:if(!gt&&(Ns(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){He(n,t,a)}Pr(e,t,n);break;case 21:Pr(e,t,n);break;case 22:n.mode&1?(gt=(r=gt)||n.memoizedState!==null,Pr(e,t,n),gt=r):Pr(e,t,n);break;default:Pr(e,t,n)}}function _y(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new QR),t.forEach(function(r){var i=sT.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function vn(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=o),r&=~s}if(r=i,r=Qe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*JR(r/1960))-r,10e?16:e,Kr===null)var r=!1;else{if(e=Kr,Kr=null,oc=0,pe&6)throw Error(U(331));var i=pe;for(pe|=4,G=e.current;G!==null;){var s=G,o=s.child;if(G.flags&16){var a=s.deletions;if(a!==null){for(var l=0;lQe()-tg?qi(e,0):eg|=n),zt(e,t)}function fb(e,t){t===0&&(e.mode&1?(t=$l,$l<<=1,!($l&130023424)&&($l=4194304)):t=1);var n=Ct();e=gr(e,t),e!==null&&(ml(e,t,n),zt(e,n))}function iT(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),fb(e,n)}function sT(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(U(314))}r!==null&&r.delete(t),fb(e,n)}var hb;hb=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||jt.current)Ft=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ft=!1,HR(e,t,n);Ft=!!(e.flags&131072)}else Ft=!1,je&&t.flags&1048576&&mx(t,Xu,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Eu(e,t),e=t.pendingProps;var i=vo(t,yt.current);Bs(t,n),i=Kv(null,t,r,e,i,n);var s=Qv();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Dt(r)?(s=!0,Qu(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Bv(t),i.updater=nd,t.stateNode=i,i._reactInternals=t,Lh(t,r,e,n),t=zh(null,t,r,!0,s,n)):(t.tag=0,je&&s&&Fv(t),bt(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Eu(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=aT(r),e=mn(r,e),i){case 0:t=Dh(null,t,r,e,n);break e;case 1:t=py(null,t,r,e,n);break e;case 11:t=fy(null,t,r,e,n);break e;case 14:t=hy(null,t,r,mn(r.type,e),n);break e}throw Error(U(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:mn(r,i),Dh(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:mn(r,i),py(e,t,r,i,n);case 3:e:{if(Yx(t),e===null)throw Error(U(387));r=t.pendingProps,s=t.memoizedState,i=s.element,Ex(e,t),ec(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=_o(Error(U(423)),t),t=vy(e,t,r,n,i);break e}else if(r!==i){i=_o(Error(U(424)),t),t=vy(e,t,r,n,i);break e}else for(Gt=Zr(t.stateNode.containerInfo.firstChild),Qt=t,je=!0,xn=null,n=xx(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(go(),r===i){t=mr(e,t,n);break e}bt(e,t,r,n)}t=t.child}return t;case 5:return Sx(t),e===null&&Nh(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,Th(r,i)?o=null:s!==null&&Th(r,s)&&(t.flags|=32),Qx(e,t),bt(e,t,o,n),t.child;case 6:return e===null&&Nh(t),null;case 13:return Xx(e,t,n);case 4:return qv(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=mo(t,null,r,n):bt(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:mn(r,i),fy(e,t,r,i,n);case 7:return bt(e,t,t.pendingProps,n),t.child;case 8:return bt(e,t,t.pendingProps.children,n),t.child;case 12:return bt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,Te(Ju,r._currentValue),r._currentValue=o,s!==null)if(kn(s.value,o)){if(s.children===i.children&&!jt.current){t=mr(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=hr(-1,n&-n),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),$h(s.return,n,t),a.lanes|=n;break}l=l.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(U(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),$h(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}bt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Bs(t,n),i=cn(i),r=r(i),t.flags|=1,bt(e,t,r,n),t.child;case 14:return r=t.type,i=mn(r,t.pendingProps),i=mn(r.type,i),hy(e,t,r,i,n);case 15:return Gx(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:mn(r,i),Eu(e,t),t.tag=1,Dt(r)?(e=!0,Qu(t)):e=!1,Bs(t,n),qx(t,r,i),Lh(t,r,i,n),zh(null,t,r,!0,e,n);case 19:return Jx(e,t,n);case 22:return Kx(e,t,n)}throw Error(U(156,t.tag))};function pb(e,t){return Uw(e,t)}function oT(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function on(e,t,n,r){return new oT(e,t,n,r)}function sg(e){return e=e.prototype,!(!e||!e.isReactComponent)}function aT(e){if(typeof e=="function")return sg(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Sv)return 11;if(e===Cv)return 14}return 2}function ri(e,t){var n=e.alternate;return n===null?(n=on(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ku(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")sg(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Cs:return Wi(n.children,i,s,t);case Ev:o=8,i|=8;break;case ah:return e=on(12,n,t,i|2),e.elementType=ah,e.lanes=s,e;case lh:return e=on(13,n,t,i),e.elementType=lh,e.lanes=s,e;case uh:return e=on(19,n,t,i),e.elementType=uh,e.lanes=s,e;case Sw:return sd(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case bw:o=10;break e;case Ew:o=9;break e;case Sv:o=11;break e;case Cv:o=14;break e;case $r:o=16,r=null;break e}throw Error(U(130,e==null?e:typeof e,""))}return t=on(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function Wi(e,t,n,r){return e=on(7,e,r,t),e.lanes=n,e}function sd(e,t,n,r){return e=on(22,e,r,t),e.elementType=Sw,e.lanes=n,e.stateNode={isHidden:!1},e}function of(e,t,n){return e=on(6,e,null,t),e.lanes=n,e}function af(e,t,n){return t=on(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function lT(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zd(0),this.expirationTimes=zd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zd(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function og(e,t,n,r,i,s,o,a,l){return e=new lT(e,t,n,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=on(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Bv(s),e}function uT(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(yb)}catch(e){console.error(e)}}yb(),yw.exports=Zt;var xl=yw.exports;const pT=ow(xl);var _b,Py=xl;_b=Py.createRoot,Py.hydrateRoot;var uc=["light","dark"],cg="(prefers-color-scheme: dark)",vT=typeof window>"u",dg=g.createContext(void 0),gT={setTheme:e=>{},themes:[]},rz=()=>{var e;return(e=g.useContext(dg))!=null?e:gT},mT=e=>g.useContext(dg)?e.children:g.createElement(_T,{...e}),yT=["light","dark"],_T=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:i="theme",themes:s=yT,defaultTheme:o=n?"system":"light",attribute:a="data-theme",value:l,children:u,nonce:c})=>{let[d,f]=g.useState(()=>Ry(i,o)),[m,_]=g.useState(()=>Ry(i)),p=l?Object.values(l):s,y=g.useCallback(b=>{let E=b;if(!E)return;b==="system"&&n&&(E=Ty());let S=l?l[E]:E,P=t?xT():null,C=document.documentElement;if(a==="class"?(C.classList.remove(...p),S&&C.classList.add(S)):S?C.setAttribute(a,S):C.removeAttribute(a),r){let T=uc.includes(o)?o:null,R=uc.includes(E)?E:T;C.style.colorScheme=R}P==null||P()},[]),h=g.useCallback(b=>{let E=typeof b=="function"?b(b):b;f(E);try{localStorage.setItem(i,E)}catch{}},[e]),v=g.useCallback(b=>{let E=Ty(b);_(E),d==="system"&&n&&!e&&y("system")},[d,e]);g.useEffect(()=>{let b=window.matchMedia(cg);return b.addListener(v),v(b),()=>b.removeListener(v)},[v]),g.useEffect(()=>{let b=E=>{if(E.key!==i)return;let S=E.newValue||o;h(S)};return window.addEventListener("storage",b),()=>window.removeEventListener("storage",b)},[h]),g.useEffect(()=>{y(e??d)},[e,d]);let x=g.useMemo(()=>({theme:d,setTheme:h,forcedTheme:e,resolvedTheme:d==="system"?m:d,themes:n?[...s,"system"]:s,systemTheme:n?m:void 0}),[d,h,e,m,n,s]);return g.createElement(dg.Provider,{value:x},g.createElement(wT,{forcedTheme:e,disableTransitionOnChange:t,enableSystem:n,enableColorScheme:r,storageKey:i,themes:s,defaultTheme:o,attribute:a,value:l,children:u,attrs:p,nonce:c}),u)},wT=g.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:s,value:o,attrs:a,nonce:l})=>{let u=s==="system",c=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${a.map(_=>`'${_}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,d=i?uc.includes(s)&&s?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${s}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",f=(_,p=!1,y=!0)=>{let h=o?o[_]:_,v=p?_+"|| ''":`'${h}'`,x="";return i&&y&&!p&&uc.includes(_)&&(x+=`d.style.colorScheme = '${_}';`),n==="class"?p||h?x+=`c.add(${v})`:x+="null":h&&(x+=`d[s](n,${v})`),x},m=e?`!function(){${c}${f(e)}}()`:r?`!function(){try{${c}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${u})){var t='${cg}',m=window.matchMedia(t);if(m.media!==t||m.matches){${f("dark")}}else{${f("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${f(o?"x[e]":"e",!0)}}${u?"":"else{"+f(s,!1,!1)+"}"}${d}}catch(e){}}()`:`!function(){try{${c}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${f(o?"x[e]":"e",!0)}}else{${f(s,!1,!1)};}${d}}catch(t){}}();`;return g.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:m}})}),Ry=(e,t)=>{if(vT)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},xT=()=>{let e=document.createElement("style");return e.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(e)},1)}},Ty=e=>(e||(e=window.matchMedia(cg)),e.matches?"dark":"light"),I=typeof window<"u"?window:void 0,mt=typeof globalThis<"u"?globalThis:I,St=mt==null?void 0:mt.navigator,j=mt==null?void 0:mt.document,Ae=mt==null?void 0:mt.location,fg=mt==null?void 0:mt.fetch,Jh=mt!=null&&mt.XMLHttpRequest&&"withCredentials"in new mt.XMLHttpRequest?mt.XMLHttpRequest:void 0,Iy=mt==null?void 0:mt.AbortController,bT=mt==null?void 0:mt.CompressionStream,Mt=St==null?void 0:St.userAgent;function wb(){return!(!I||I.navigator.onLine===!1)}var Ko=typeof globalThis<"u"?globalThis:I;Ko&&typeof self>"u"&&(Ko.self=Ko),Ko&&typeof File>"u"&&(Ko.File=function(){});var Y=I??{},Ee={DEBUG:!1,LIB_VERSION:"0.5.1",LIB_NAME:"browser-common"};function Oy(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(u){return void n(u)}a.done?t(l):Promise.resolve(l).then(r,i)}function Ce(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){Oy(s,r,i,o,a,"next",l)}function a(l){Oy(s,r,i,o,a,"throw",l)}o(void 0)})}}function $(){return $=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$.apply(null,arguments)}function xb(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var My=e=>{if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return e}};function Ay(e){return typeof e=="string"||e}function Ny(e){return typeof e=="string"?e:void 0}var Qo,ET=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],nr=function(e){return e.AnonymousId="anonymous_id",e.DistinctId="distinct_id",e.Props="props",e.EnablePersonProcessing="enable_person_processing",e.PersonMode="person_mode",e.FeatureFlagDetails="feature_flag_details",e.FeatureFlags="feature_flags",e.FeatureFlagPayloads="feature_flag_payloads",e.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",e.BootstrapFeatureFlags="bootstrap_feature_flags",e.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",e.OverrideFeatureFlags="override_feature_flags",e.Queue="queue",e.AiQueue="ai_queue",e.AiCaptureQueue="ai_capture_queue",e.LogsQueue="logs_queue",e.OptedOut="opted_out",e.SessionId="session_id",e.SessionStartTimestamp="session_start_timestamp",e.SessionLastTimestamp="session_timestamp",e.PersonProperties="person_properties",e.GroupProperties="group_properties",e.InstalledAppBuild="installed_app_build",e.InstalledAppVersion="installed_app_version",e.SessionReplay="session_replay",e.PushRegistered="push_registered",e.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",e.SurveyLastSeenDate="survey_last_seen_date",e.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config",e.FlagsEndpointWasHit="flags_endpoint_was_hit",e.DeviceId="device_id",e}({}),$y=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),ST=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],CT=["token"],bb="NativeGzipValidationError",Zh=e=>e.length>=2&&e[0]===31&&e[1]===139,Fy=(e,t)=>e===$y.GZipJS||t===$y.GZipJS||t==="gzip",Ly=e=>!(!e||typeof e!="object")&&("name"in e?String(e.name):"")==="NotReadableError",Gl=e=>{var t=new Error("Native gzip produced invalid output: "+e);throw t.name=bb,t},kT=function(){var e=Ce(function*(t,n){18>t.size&&Gl("too-short");var r=new Uint8Array(yield t.slice(0,10).arrayBuffer());Zh(r)&&r[2]===8||Gl("invalid-header");var i=new DataView(yield t.slice(t.size-8).arrayBuffer());i.getUint32(0,!0)!==(o=>{for(var a=(()=>{if(Qo)return Qo;Qo=[];for(var c=0;256>c;c++){for(var d=c,f=0;8>f;f++)d=1&d?3988292384^d>>>1:d>>>1;Qo[c]=d>>>0}return Qo})(),l=4294967295,u=0;o.length>u;u++)l=a[255&(l^o[u])]^l>>>8;return(4294967295^l)>>>0})(n)&&Gl("invalid-crc");var s=n.length>>>0;i.getUint32(4,!0)!==s&&Gl("invalid-size")});return function(t,n){return e.apply(this,arguments)}}();function ep(){return ep=Ce(function*(e,t,n){t===void 0&&(t=!0);try{var r=new TextEncoder().encode(e),i=new globalThis.CompressionStream("gzip"),s=i.writable.getWriter(),o=s.write(r).then(()=>s.close()).catch(function(){var u=Ce(function*(c){try{yield s.abort(c)}catch{}throw c});return function(c){return u.apply(this,arguments)}}()),a=new Response(i.readable).blob(),l=(yield Promise.all([a,o]))[0];return yield kT(l,r),l}catch(u){if(n!=null&&n.rethrow)throw u;return t&&console.error("Failed to gzip compress data",u),null}}),ep.apply(this,arguments)}var PT=20,Eb=1e3,RT=1e4,TT="[Circular]",tp="[Truncated]",cd="[Unserializable]",IT="[Function]";function Ws(e){for(var t="",n=0;e.length>n;n++){var r=e.charCodeAt(n);if(55296>r||r>56319)t+=56320>r||r>57343?e[n]:"�";else{var i=e.charCodeAt(n+1);56320>i||i>57343?t+="�":(t+=e[n]+e[n+1],n++)}}return t}var OT=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],jy=function(e,t){if(t===void 0&&(t=[]),!e)return!1;var n=e.toLowerCase();return OT.concat(t).some(r=>{var i=r.toLowerCase();return n.indexOf(i)!==-1})};function J(e,t){return e.indexOf(t)!==-1}var dd=function(e){return e.trim()},np=function(e){return e.replace(/^\$/,"")};function Sb(e){var t,n=[];return(t=JSON.stringify(e,function(r,i){if(typeof i=="bigint")return i.toString();if(typeof i!="function"&&typeof i!="symbol"){if(i instanceof Error)return{name:i.name,message:i.message,stack:i.stack};if(i&&typeof i=="object"){for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(i))return"[Circular]";n.push(i)}return i}}))!==null&&t!==void 0?t:"null"}var Cb=Object.prototype,kb=Cb.hasOwnProperty,fd=Cb.toString,Z=Array.isArray||function(e){return fd.call(e)==="[object Array]"},vt=e=>typeof e=="function",Se=e=>e===Object(e)&&!Z(e),En=e=>{if(Se(e)){for(var t in e)if(kb.call(e,t))return!1;return!0}return!1},L=e=>e===void 0,ce=e=>fd.call(e)=="[object String]",cc=e=>ce(e)&&e.trim().length===0,rt=e=>e===null,ne=e=>L(e)||rt(e),Ge=e=>fd.call(e)=="[object Number]"&&e==e,Jn=e=>Ge(e)&&e>0,$t=e=>fd.call(e)==="[object Boolean]",MT=e=>e instanceof FormData,AT=e=>J(ST,e),NT=e=>J(CT,e);function Pb(e){return e===null||typeof e!="object"}function dc(e,t){return{}.toString.call(e)==="[object "+t+"]"}function Rb(e){switch({}.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return Tb(e,Error)}}function hg(e){return typeof Event<"u"&&Tb(e,Event)}function Tb(e,t){try{return e instanceof t}catch{return!1}}var $T=[!0,"true",1,"1","yes"],lf=e=>J($T,e),FT=[!1,"false",0,"0","no"];function Vn(e,t,n,r,i){return t>n&&(r.warn("min cannot be greater than max."),t=n),Ge(e)?e>n?(r.warn(" cannot be greater than max: "+n+". Using max value instead."),n):t>e?(r.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(r.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+i),Vn(i||n,t,n,r))}class LT{constructor(t){this.k={},this.S=t.S,this.C=Vn(t.bucketSize,0,100,t.I),this.R=Vn(t.refillRate,0,this.C,t.I),this.A=Vn(t.refillInterval,0,864e5,t.I)}O(t,n){var r=Math.floor((n-t.lastAccess)/this.A);r>0&&(t.tokens=Math.min(t.tokens+r*this.R,this.C),t.lastAccess=t.lastAccess+r*this.A)}consumeRateLimit(t){var n,r=Date.now(),i=String(t),s=this.k[i];return s?this.O(s,r):this.k[i]=s={tokens:this.C,lastAccess:r},s.tokens===0||(s.tokens--,s.tokens===0&&((n=this.S)==null||n.call(this,t)),s.tokens===0)}stop(){this.k={}}}var Yt="Mobile",fc="iOS",fr="Android",xo="Tablet",Ib=fr+" "+xo,Ob="iPad",Mb="Apple",Ab=Mb+" Watch",Sa="Safari",bo="BlackBerry",Nb="Samsung",$b=Nb+"Browser",Fb=Nb+" Internet",Hi="Chrome",jT=Hi+" OS",Lb=Hi+" "+fc,pg="Internet Explorer",jb=pg+" "+Yt,vg="Opera",DT=vg+" Mini",gg="Edge",Db="Microsoft "+gg,Hs="Firefox",zb=Hs+" "+fc,Ka="Nintendo",Qa="PlayStation",Gs="Xbox",Ub=fr+" "+Yt,Vb=Yt+" "+Sa,ua="Windows",rp=ua+" Phone",Dy="Nokia",ip="Ouya",Bb="Generic",zT=Bb+" "+Yt.toLowerCase(),qb=Bb+" "+xo.toLowerCase(),sp="Konqueror",Wb="Oculus Browser",hc="Vivaldi",Hb="Yandex",pc="Whale",op="DuckDuckGo",Gb="Pale Moon",vc="Waterfox",Ca="Brave",Kb="Google Search App",Le="(\\d+(\\.\\d+)?)",uf=new RegExp("Version/"+Le),UT=new RegExp(Gs,"i"),VT=new RegExp(Qa+" \\w+","i"),BT=new RegExp(Ka+" \\w+","i"),mg=new RegExp(bo+"|PlayBook|BB10","i"),qT={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},Qb=function(e,t,n,r){t=t||"";var i=function(s){return s!=null&&s.brave?Ca:null}(n);return i||(r!=null&&r.detectGoogleSearchApp&&J(e,"GSA/")?Kb:J(e," OPR/")&&J(e,"Mini")?DT:J(e," OPR/")?vg:mg.test(e)?bo:J(e,"IE"+Yt)||J(e,"WPDesktop")?jb:J(e,"OculusBrowser")?Wb:J(e,$b)?Fb:J(e,gg)||J(e,"Edg/")?Db:J(e,hc+"/")?hc:J(e,"YaBrowser/")?Hb:J(e,pc+"/")?pc:J(e,op+"/")||J(e,"Ddg/")?op:J(e,"FBIOS")?"Facebook "+Yt:J(e,"UCWEB")||J(e,"UCBrowser")?"UC Browser":J(e,"CriOS")?Lb:J(e,"CrMo")||J(e,Hi)?Hi:J(e,fr)&&J(e,Sa)?Ub:J(e,"FxiOS")?zb:J(e.toLowerCase(),sp.toLowerCase())?sp:J(e,Ca+"/")?Ca:((s,o)=>o&&J(o,Mb)||function(a){return J(a,Sa)&&!J(a,Hi)&&!J(a,fr)}(s))(e,t)?J(e,Yt)?Vb:Sa:J(e,"PaleMoon/")?Gb:J(e,vc+"/")?vc:J(e,Hs)?Hs:J(e,"MSIE")||J(e,"Trident/")?pg:J(e,"Gecko")?Hs:"")},WT={[jb]:[new RegExp("rv:"+Le)],[Db]:[new RegExp(gg+"?\\/"+Le)],[Hi]:[new RegExp("("+Hi+"|CrMo)\\/"+Le)],[Lb]:[new RegExp("CriOS\\/"+Le)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Le)],[Sa]:[uf],[Vb]:[uf],[vg]:[new RegExp("(Opera|OPR)\\/"+Le)],[Hs]:[new RegExp(Hs+"\\/"+Le)],[zb]:[new RegExp("FxiOS\\/"+Le)],[sp]:[new RegExp("Konqueror[:/]?"+Le,"i")],[bo]:[new RegExp(bo+" "+Le),uf],[Ub]:[new RegExp("android\\s"+Le,"i")],[Fb]:[new RegExp($b+"\\/"+Le)],[Wb]:[new RegExp("OculusBrowser\\/"+Le)],[hc]:[new RegExp(hc+"\\/"+Le)],[Hb]:[new RegExp("YaBrowser\\/"+Le)],[pc]:[new RegExp(pc+"\\/"+Le)],[Ca]:[new RegExp(Ca+"\\/"+Le)],[op]:[new RegExp("(DuckDuckGo|Ddg)\\/"+Le)],[Gb]:[new RegExp("PaleMoon\\/"+Le)],[vc]:[new RegExp(vc+"\\/"+Le)],[Kb]:[new RegExp("GSA\\/"+Le)],[pg]:[new RegExp("(rv:|MSIE )"+Le)],Mozilla:[new RegExp("rv:"+Le)]},HT=function(e,t,n,r){var i=Qb(e,t,n,r),s=WT[i];if(L(s))return null;for(var o=0;s.length>o;o++){var a=e.match(s[o]);if(a)return parseFloat(a[a.length-2])}return null},zy=[[new RegExp(Gs+"; "+Gs+" (.*?)[);]","i"),e=>[Gs,e&&e[1]||""]],[new RegExp(Ka,"i"),[Ka,""]],[new RegExp(Qa,"i"),[Qa,""]],[mg,[bo,""]],[new RegExp(ua,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[rp,""];if(new RegExp(Yt).test(t)&&!/IEMobile\b/.test(t))return[ua+" "+Yt,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=qT[n[1]]||"";return/arm/i.test(t)&&(r="RT"),[ua,r]}return[ua,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[fc,[e[3],e[4],e[5]||"0"].join(".")]:[fc,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=L(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+fr+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+fr+")","i"),e=>e&&e[2]?[fr,[e[2],e[3],e[4]||"0"].join(".")]:[fr,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[jT,""]],[/Linux|debian/i,["Linux",""]]],Uy=function(e){return BT.test(e)?Ka:VT.test(e)?Qa:UT.test(e)?Gs:new RegExp(ip,"i").test(e)?ip:new RegExp("("+rp+"|WPDesktop)","i").test(e)?rp:/iPad/.test(e)?Ob:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Ab:mg.test(e)?bo:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Dy,"i").test(e)?Dy:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(Yt).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?fr:Ib:new RegExp("(pda|"+Yt+")","i").test(e)?zT:new RegExp(xo,"i").test(e)&&!new RegExp(xo+" pc","i").test(e)?qb:""},GT=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Vy(e,t){return typeof(n=e)=="string"&>.test(n)?e:t();var n}function li(e){return e&&e.split("#")[0]}function yg(e,t){var n=setTimeout(e,t);return n!=null&&n.unref&&(n==null||n.unref()),n}function By(e,t,n){return Yb.apply(this,arguments)}function Yb(){return(Yb=Ce(function*(e,t,n){var r;try{return yield Promise.race([e,new Promise((i,s)=>{r=yg(()=>{try{n==null||n(),i()}catch(o){s(o)}},t)})])}finally{clearTimeout(r)}})).apply(this,arguments)}var Xb={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},KT=Xb.info,qy=9223372036854776e3,QT={}.propertyIsEnumerable;function gc(e,t){try{return Jb(e,t,{ancestors:new WeakSet,remainingNodes:RT},0)}catch{return[]}}function _g(e,t,n,r){if(0>=n.remainingNodes)return{stringValue:tp};if(n.remainingNodes--,$t(e))return{boolValue:e};if(typeof e=="number"){if(!Number.isFinite(e))return{stringValue:String(e)};if(Number.isInteger(e)){if(Number.isSafeInteger(e))return{intValue:String(e)};if(typeof BigInt>"u")return{stringValue:String(e)};var i=BigInt(e).toString();return e>=qy||-qy>e?(t==null||t.debug("Attribute "+i+" is outside the int64 range; encoding it as a string"),{stringValue:i}):{intValue:i}}return{doubleValue:e}}if(typeof e=="string")return{stringValue:Ws(e)};if(typeof e=="function")return{stringValue:IT};if(typeof e=="symbol")return{stringValue:String(e)};if(typeof e=="object"&&e!==null){if(n.ancestors.has(e))return{stringValue:TT};if(r>=PT)return{stringValue:tp};if(e instanceof Date){var s=e.getTime(),o=Number.isFinite(s)?e.toISOString():String(e);return{stringValue:typeof o=="string"?Ws(o):String(o)}}n.ancestors.add(e);try{try{var a=e.toJSON;if(typeof a=="function")return _g(a.call(e),t,n,r+1)}catch{}return Z(e)?{arrayValue:{values:YT(e,t,n,r+1)}}:{kvlistValue:{values:Jb(e,t,n,r+1)}}}finally{n.ancestors.delete(e)}}return{stringValue:Ws(String(e))}}function YT(e,t,n,r){for(var i=[],s=Math.min(e.length,Eb),o=0;s>o&&n.remainingNodes>0;o++)try{var a=o in e?e[o]:void 0;if(ne(a))continue;i.push(_g(a,t,n,r))}catch{i.push({stringValue:cd})}return e.length>o&&i.push({stringValue:tp}),i}function Jb(e,t,n,r){var i=[];for(var s in e)if(QT.call(e,s)){if(i.length>=Eb||0>=n.remainingNodes){t==null||t.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{var o=e[s];if(rt(o)||L(o))continue;i.push({key:Ws(s),value:_g(o,t,n,r)})}catch{i.push({key:Ws(s),value:{stringValue:cd}})}}return i}function XT(e){try{return Ws(String(e))}catch{return cd}}function JT(e,t,n){var r=Xb[e.level||"info"]||KT,i=r.text,s=r.number,o=String(Date.now())+"000000",a={};t.distinctId&&(a.posthogDistinctId=t.distinctId),t.sessionId&&(a.sessionId=t.sessionId),t.windowId&&(a["window.id"]=t.windowId),ne(t.sessionStartTimestamp)||(a.sessionStartTimestamp=String(t.sessionStartTimestamp)),ne(t.lastActivityTimestamp)||(a.lastActivityTimestamp=String(t.lastActivityTimestamp)),t.currentUrl&&(a["url.full"]=t.currentUrl),t.screenName&&(a["screen.name"]=t.screenName),t.appState&&(a["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(a.feature_flags=t.activeFeatureFlags);var l=$({},a),u=e.attributes;if(u){var c=[];try{c=Object.keys(u)}catch{c=[]}for(var d of c){var f=void 0;try{f=u[d]}catch{f=cd}Object.defineProperty(l,d,{value:f,enumerable:!0,writable:!0,configurable:!0})}}var m={timeUnixNano:o,observedTimeUnixNano:o,severityNumber:s,severityText:i,body:{stringValue:XT(e.body)},attributes:gc(l,n)};return e.trace_id&&(m.traceId=e.trace_id),e.span_id&&(m.spanId=e.span_id),L(e.trace_flags)||(m.flags=e.trace_flags),m}function Zb(e,t,n){return $({},e.resourceAttributes,{"service.name":e.serviceName||"unknown_service"},e.environment&&{"deployment.environment":e.environment},e.serviceVersion&&{"service.version":e.serviceVersion},{"telemetry.sdk.name":t,"telemetry.sdk.version":n})}function eE(e,t,n,r){return{resourceLogs:[{resource:{attributes:gc(t)},scopeLogs:[{scope:{name:n,version:r},logRecords:e}]}]}}let ZT=class{constructor(e,t,n,r,i,s,o){var a;s===void 0&&(s=()=>Promise.resolve()),this._instance=e,this.qi=t,this.I=n,this.rn=r,this.nn=i,this.sn=s,this.an=o,this.ln=null,this.un=0,this.hn=0,this.dn=0,this.vn=0,this.cn=!1,this.fn=t.maxBufferSize,this.pn=Math.max((a=t.maxQueueSize)!==null&&a!==void 0?a:t.maxBufferSize,t.maxBufferSize),this.gn=t.flushIntervalMs,this.mn=t.maxBatchRecordsPerPost,this.yn=t.rateCapWindowMs,this.bn=t.maxLogsPerInterval}reset(){this._n(),this.ln=null,this.dn=0,this.vn=0,this.cn=!1,this.un=0,this.hn=0,this.mn=this.qi.maxBatchRecordsPerPost}onReconnect(){this.hn=0,this.wn()}captureLog(e){if(!this._instance.isDisabled&&!this._instance.optedOut&&e!=null&&e.body){var t=this.kn(e);if(t!==null)if(t.body){if(this.Sn()){var n={record:JT(t,this.rn(),this.I)};this.nn(()=>this.xn(n))}}else this.I.info("Log was rejected in beforeSend function")}}kn(e){var t=this.qi.beforeSend;if(!t)return e;var n=Z(t)?t:[t],r=e;for(var i of n)try{var s=i(r);if(!s)return this.I.info("Log was rejected in beforeSend function"),null;r=s}catch(o){return this.I.error("Error in beforeSend function for log:",o),null}return r}Sn(){if(this.bn===void 0)return!0;var e=Date.now(),t=e-this.dn;return this.yn>t&&t>=0||(this.dn=e,this.vn=0,this.cn=!1),this.bn>this.vn?(this.vn++,!0):(this.cn||(this.I.warn("captureLog dropping logs: exceeded "+this.bn+" logs per "+this.yn+"ms"),this.cn=!0),!1)}flush(){var e=this;return Ce(function*(){if(!e._instance.isDisabled)return e.ln||(e.ln=e.Cn().finally(()=>{e.ln=null})),e.ln})()}Cn(){var e=this;return Ce(function*(){var t;e._n();var n=(t=e._instance.getPersistedProperty(nr.LogsQueue))!==null&&t!==void 0?t:[];if(n.length!==0)for(var r=n.length,i=0;n.length>0&&r>i;){var s,o;e.un=0;var a=Math.min(n.length,e.mn),l=n.slice(0,a),u=eE(l.map(d=>d.record),e.Tn(),(s=e.an)!==null&&s!==void 0?s:e._instance.getLibraryId(),e._instance.getLibraryVersion()),c=yield e._instance.Mn(u);if(c.kind==="too-large"&&l.length>1)e.mn=Math.max(1,Math.floor(l.length/2)),e.I.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+e.mn);else if(c.kind==="retry-later"||(c.kind==="too-large"?e.I.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):c.kind==="ok"&&e.qi.maxBatchRecordsPerPost>e.mn&&(e.mn=Math.min(e.qi.maxBatchRecordsPerPost,e.mn+1)),yield e.En(l.length),n=(o=e._instance.getPersistedProperty(nr.LogsQueue))!==null&&o!==void 0?o:[],i+=l.length,c.kind==="fatal"))throw c.error}})()}En(e){var t=this;return Ce(function*(){var n,r=Math.max(0,e-t.un),i=(n=t._instance.getPersistedProperty(nr.LogsQueue))!==null&&n!==void 0?n:[];t._instance.setPersistedProperty(nr.LogsQueue,i.slice(r)),yield t.sn()})()}Tn(){return Zb(this.qi,this._instance.getLibraryId(),this._instance.getLibraryVersion())}xn(e){var t;if(!this._instance.optedOut){var n=(t=this._instance.getPersistedProperty(nr.LogsQueue))!==null&&t!==void 0?t:[];this.pn>n.length||(n.shift(),this.un++,this.I.info("Logs queue is full, dropping oldest record.")),n.push(e),this._instance.setPersistedProperty(nr.LogsQueue,n),this.fn>n.length?this.In():this.wn()}}In(e){e===void 0&&(e=this.gn),this.Rn||(this.Rn=yg(()=>{this.Rn=void 0,this.wn()},e))}Pn(){var e=Math.min(Math.max(0,this.hn-1),6);return this.gn*Math.pow(2,e)}An(){var e=this._instance.getPersistedProperty(nr.LogsQueue);return!!e&&e.length>0}shutdown(e){var t=this;return Ce(function*(){t._n();var n=t.flush().catch(()=>{});e!==void 0?yield By(n,e):yield n})()}flushWithTimeout(e){var t=this;return Ce(function*(){var n=t.flush();yield By(n,e,()=>{n.catch(()=>{})})})()}wn(){this.flush().then(()=>{this.hn=0},e=>{this.hn++,this.I.error("PostHog logs flush failed:",e)}).finally(()=>{!this._instance.isDisabled&&this.An()&&this.In(this.Pn())})}_n(){this.Rn&&(clearTimeout(this.Rn),this.Rn=void 0)}};var cf=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function Wy(e){return String(e)+"000000"}function Hy(e,t,n,r){var i="";return r&&(i=Object.keys(r).sort().map(s=>JSON.stringify(s)+":"+JSON.stringify(r[s])).join(",")),e+"\0"+t+"\0"+(n??"")+"\0"+i}let eI=class{constructor(e,t,n){this._instance=e,this.qi=t,this.I=n,this.Fn=new Map,this.ln=null,this.On=!1,this.Ln=new Map,this.$n=new Set,this.Dn=0}count(e,t,n){t===void 0&&(t=1),this.Nn({name:e,type:"count",value:t,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}gauge(e,t,n){this.Nn({name:e,type:"gauge",value:t,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}histogram(e,t,n){this.Nn({name:e,type:"histogram",value:t,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}flush(){var e=this,t=this.ln,n=function(){var i=Ce(function*(){t&&(yield t.catch(()=>{})),yield e.qn()});return function(){return i.apply(this,arguments)}}(),r=n().finally(()=>{this.ln===r&&(this.ln=null)});return this.ln=r,r}drainWindow(){if(this.Fn.size===0)return null;var e=this.Fn;return this.Fn=new Map,this.On=!1,this.Ln=new Map,this.$n=new Set,this.jn(e)}reset(){this.Dn++,this._n(),this.Fn=new Map,this.ln=null,this.On=!1,this.Ln=new Map,this.$n=new Set}Nn(e){if(!this._instance.isDisabled&&!this._instance.optedOut){var t=this.kn(e);if(t!==null)if(t.name&&typeof t.name=="string")if(typeof t.value=="number"&&Number.isFinite(t.value))if(t.type==="count"&&0>t.value)this.I.warn("Dropping count '"+t.name+"': counters are monotonic, value must be >= 0");else{var n,r;try{n=t.attributes?$({},t.attributes):void 0,r=Hy(t.type,t.name,t.unit,n)}catch(o){return void this.I.warn("Dropping metric '"+t.name+"': attributes could not be serialized",o)}var i=this.Fn.get(r);if(!i){if(!this.Bn())return;i={name:t.name,type:t.type,unit:t.unit,attributes:n,windowStartMs:Date.now()},this.Fn.set(r,i)}var s=this.Ln.get(t.name);s===void 0?this.Ln.set(t.name,t.type):s===t.type||this.$n.has(t.name)||(this.$n.add(t.name),this.I.warn("Metric name '"+t.name+"' is already used as a "+s+"; recording it as a "+t.type+" too will blend both series in charts. Use a distinct name.")),this.Hn(i,t.value),this.In()}else this.I.warn("Dropping metric '"+t.name+"': value must be a finite number");else this.I.warn("Dropping metric with empty name")}}Bn(){return this.qi.maxSeriesPerFlush>this.Fn.size||(this.On||(this.On=!0,this.I.warn("Metric series cap reached ("+this.qi.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Hn(e,t){var n;switch(e.type){case"count":e.total=((n=e.total)!==null&&n!==void 0?n:0)+t;break;case"gauge":e.last=t;break;case"histogram":e.hist||(e.hist={count:0,sum:0,min:t,max:t,bucketCounts:new Array(cf.length+1).fill(0)});var r=e.hist;r.count+=1,r.sum+=t,r.min=Math.min(r.min,t),r.max=Math.max(r.max,t),r.bucketCounts[function(i,s){for(var o=0;s.length>o;o++)if(s[o]>=i)return o;return s.length}(t,cf)]+=1}}kn(e){var t=this.qi.beforeSend;if(!t)return e;var n=Z(t)?t:[t],r=e;for(var i of n)try{var s=i(r);if(!s)return this.I.info("Metric was rejected in beforeSend function"),null;r=s}catch(o){return this.I.error("Error in beforeSend function for metric:",o),null}return r}In(){this.Rn||(this.Rn=yg(()=>{this.Rn=void 0,this.flush().catch(e=>{this.I.error("Metrics flush failed:",e)})},this.qi.flushIntervalMs))}_n(){this.Rn&&(clearTimeout(this.Rn),this.Rn=void 0)}qn(){var e=this;return Ce(function*(){if(e.Fn.size!==0){var t=e.Fn;e.Fn=new Map,e.On=!1,e.Ln=new Map,e.$n=new Set;var n=e.Dn,r=yield e._instance.Un(e.jn(t));if(n===e.Dn)switch(r.kind){case"ok":return;case"retry-later":return e.zn(t),void e.In();case"too-large":return void e.I.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void e.I.error("Failed to send metrics batch:",r.error)}}})()}jn(e){return t=this.Wn(e),n=function(s,o,a){return $({},s.resourceAttributes,{"service.name":s.serviceName||"unknown_service"},s.environment&&{"deployment.environment":s.environment},s.serviceVersion&&{"service.version":s.serviceVersion},{"telemetry.sdk.name":o,"telemetry.sdk.version":a})}(this.qi,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),i=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:gc(n)},scopeMetrics:[{scope:{name:r,version:i},metrics:t}]}]};var t,n,r,i}Wn(e){var t=Wy(Date.now()),n=new Map;for(var r of e.values()){var i,s=Hy(r.type,r.name,r.unit,void 0),o=n.get(s);o||(o=$({name:r.name},r.unit&&{unit:r.unit}),r.type==="count"?o.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:r.type==="gauge"?o.gauge={dataPoints:[]}:o.histogram={aggregationTemporality:1,dataPoints:[]},n.set(s,o));var a=gc((i=r.attributes)!==null&&i!==void 0?i:{},this.I),l=Wy(r.windowStartMs);if(r.type==="count"){var u,c={attributes:a,startTimeUnixNano:l,timeUnixNano:t,asDouble:(u=r.total)!==null&&u!==void 0?u:0};o.sum.dataPoints.push(c)}else if(r.type==="gauge"){var d,f={attributes:a,timeUnixNano:t,asDouble:(d=r.last)!==null&&d!==void 0?d:0};o.gauge.dataPoints.push(f)}else r.hist&&o.histogram.dataPoints.push({attributes:a,startTimeUnixNano:l,timeUnixNano:t,count:r.hist.count,sum:r.hist.sum,min:r.hist.min,max:r.hist.max,bucketCounts:r.hist.bucketCounts,explicitBounds:cf})}return Array.from(n.values())}zn(e){var t,n;for(var r of e){var i=r[0],s=r[1],o=this.Fn.get(i);if(o)switch(o.windowStartMs=Math.min(o.windowStartMs,s.windowStartMs),o.type){case"count":o.total=((t=o.total)!==null&&t!==void 0?t:0)+((n=s.total)!==null&&n!==void 0?n:0);break;case"gauge":break;case"histogram":if(s.hist)if(o.hist){o.hist.count+=s.hist.count,o.hist.sum+=s.hist.sum,o.hist.min=Math.min(o.hist.min,s.hist.min),o.hist.max=Math.max(o.hist.max,s.hist.max);for(var a=0;o.hist.bucketCounts.length>a;a++)o.hist.bucketCounts[a]+=s.hist.bucketCounts[a]}else o.hist=s.hist}else this.Bn()&&this.Fn.set(i,s)}}};var Kl,Gy,df;function tI(e){var t=globalThis._posthogChunkIds;if(t){var n=Object.keys(t);return df&&n.length===Gy||(Gy=n.length,df=n.reduce((r,i)=>{Kl||(Kl={});var s=Kl[i];if(s)r[s[0]]=s[1];else for(var o=e(i),a=o.length-1;a>=0;a--){var l=o[a],u=l==null?void 0:l.filename,c=t[i];if(u&&c){r[u]=c,Kl[i]=[u,c];break}}return r},{})),df}}class nI{constructor(t,n,r){r===void 0&&(r=[]),this.coercers=t,this.stackParser=n,this.modifiers=r}buildFromUnknown(t,n){n===void 0&&(n={});var r=n&&n.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,n,0).apply(t),s=this.buildParsingContext(n),o=this.parseStacktrace(i,s);return{$exception_list:this.convertToExceptionList(o,r),$exception_level:"error"}}modifyFrames(t){var n=this;return Ce(function*(){for(var r of t)r.stacktrace&&r.stacktrace.frames&&Z(r.stacktrace.frames)&&(r.stacktrace.frames=yield n.applyModifiers(r.stacktrace.frames));return t})()}coerceFallback(t){var n;return{type:"Error",value:"Unknown error",stack:(n=t.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(t,n){var r,i;return t.cause!=null&&(r=this.parseStacktrace(t.cause,n)),t.stack!=""&&t.stack!=null&&(i=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?n.skipFirstLines:0),n.chunkIdMap)),$({},t,{cause:r,stack:i})}applyChunkIds(t,n){return t.map(r=>(r.filename&&n&&(r.chunk_id=n[r.filename]),r))}applyCoercers(t,n){for(var r of this.coercers)if(r.match(t))return r.coerce(t,n);return this.coerceFallback(n)}applyModifiers(t){var n=this;return Ce(function*(){var r=t;for(var i of n.modifiers)r=yield i(r);return r})()}convertToExceptionList(t,n){var r,i,s,o={type:t.type,value:t.value,mechanism:{type:(r=n.type)!==null&&r!==void 0?r:"generic",handled:(i=n.handled)===null||i===void 0||i,synthetic:(s=t.synthetic)!==null&&s!==void 0&&s}};t.stack&&(o.stacktrace={type:"raw",frames:t.stack});var a=[o];return t.cause!=null&&a.push(...this.convertToExceptionList(t.cause,$({},n,{handled:!0}))),a}buildParsingContext(t){var n;return{chunkIdMap:tI(this.stackParser),skipFirstLines:(n=t.skipFirstLines)!==null&&n!==void 0?n:1}}buildCoercingContext(t,n,r){r===void 0&&(r=0);var i=(s,o)=>{if(4>=o){var a=this.buildCoercingContext(t,n,o);return this.applyCoercers(s,a)}};return $({},n,{syntheticException:r==0?n.syntheticException:void 0,mechanism:t,apply:s=>i(s,r),next:s=>i(s,r+1)})}}var Eo="?";function ap(e,t,n,r,i){var s={platform:e,filename:t,function:n===""?Eo:n,in_app:!(t!=null&&t.startsWith("webkit-masked-url://"))&&t!==""};return L(r)||(s.lineno=r),L(i)||(s.colno=i),s}var tE=(e,t)=>{var n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:Eo,n?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},rI=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,iI=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,sI=/\((\S*)(?::(\d+))(?::(\d+))\)/,oI=(e,t)=>{var n=rI.exec(e);if(n)return ap(t,n[1],Eo,+n[2],+n[3]);var r=iI.exec(e);if(r){if(r[2]&&r[2].indexOf("eval")===0){var i=sI.exec(r[2]);i&&(r[2]=i[1],r[3]=i[2],r[4]=i[3])}var s=tE(r[1]||Eo,r[2]);return ap(t,s[1],s[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},aI=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,lI=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,uI=(e,t)=>{var n=aI.exec(e);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=lI.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var i=n[3],s=n[1]||Eo,o=tE(s,i);return ap(t,i=o[1],s=o[0],n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},Ky=/\(error: (.*)\)/;class cI{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,n){var r=ce(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:r?t.stack:void 0,cause:t.cause?n.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var n=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?n+": "+t.message:n}isDOMException(t){return dc(t,"DOMException")}isDOMError(t){return dc(t,"DOMError")}}class dI{match(t){return Rb(t)}coerce(t,n){var r,i=this.getStack(t),s=i===void 0;return{type:this.getType(t),value:this.getMessage(t,n),stack:i??((r=n.syntheticException)==null?void 0:r.stack),cause:t.cause?n.next(t.cause):void 0,synthetic:s}}getType(t){return t.name||t.constructor.name}getMessage(t,n){var r=t.message;return String(r.error&&typeof r.error.message=="string"?r.error.message:r)}getStack(t){return t.stacktrace||t.stack||void 0}}class fI{constructor(){}match(t){return!!dc(t,"ErrorEvent")&&(t.error!=null||this.fi(t))}coerce(t,n){var r;if(t.error!=null)return n.apply(t.error);var i=n.apply(t.message);return $({},i,{stack:(r=this.pi(t))!==null&&r!==void 0?r:i.stack,synthetic:!0})}fi(t){return ce(t.message)&&t.message.length>0}pi(t){var n,r,i=t,s=(n=i.lineno)!==null&&n!==void 0?n:0,o=(r=i.colno)!==null&&r!==void 0?r:0;if(ce(i.filename)&&i.filename.length!==0&&s!==0)return`Error + at `+i.filename+":"+s+":"+o}}var hI=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class pI{match(t){return typeof t=="string"}coerce(t,n){var r,i=this.getInfos(t),s=i[0],o=i[1];return{type:s??"Error",value:o??t,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(t){var n="Error",r=t,i=t.match(hI);return i&&(n=i[1],r=i[2]),[n,r]}}var vI=["fatal","error","warning","log","info","debug"];function nE(e,t){t===void 0&&(t=40);var n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(", ");if(t>=i.length)return r===n.length?i:i.length>t?i.slice(0,t)+"...":i}return""}class gI{match(t){return typeof t=="object"&&t!==null}coerce(t,n){var r,i,s=this.getErrorPropertyFromObject(t);return s?n.apply(s):{type:this.getType(t),value:this.getValue(t),stack:(r=this.getStack(t))!==null&&r!==void 0?r:(i=n.syntheticException)==null?void 0:i.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){if(hg(t))return t.constructor.name;var n="name"in t?t.name:void 0;return ce(n)&&!cc(n)?n:"Error"}getValue(t){if("name"in t&&typeof t.name=="string"){var n="'"+t.name+"' captured as exception";return"message"in t&&typeof t.message=="string"&&(n+=" with message: '"+t.message+"'"),n}if("message"in t&&typeof t.message=="string")return t.message;var r=this.getObjectClassName(t);return(r&&r!=="Object"?"'"+r+"'":"Object")+" captured as exception with keys: "+nE(t)}isSeverityLevel(t){return ce(t)&&!cc(t)&&vI.indexOf(t)>=0}getStack(t){try{return ce(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:ce(t.stack)&&t.stack.length>0?t.stack:void 0}catch{return}}getErrorPropertyFromObject(t){for(var n in t)if({}.hasOwnProperty.call(t,n)){var r=t[n];if(Rb(r))return r}}getObjectClassName(t){try{var n=Object.getPrototypeOf(t);return n?n.constructor.name:void 0}catch{return}}}class mI{match(t){return hg(t)}coerce(t,n){var r,i=t.constructor.name;return{type:i,value:i+" captured as exception with keys: "+nE(t),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class yI{match(t){return Pb(t)}coerce(t,n){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class _I{match(t){return dc(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!hg(t))return!1;try{var n=t.detail;return n!=null&&typeof n=="object"&&"reason"in n}catch{return!1}}coerce(t,n){var r,i=this.getUnhandledRejectionReason(t);return Pb(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}:n.apply(i)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&t.detail!=null&&typeof t.detail=="object"&&"reason"in t.detail)return t.detail.reason}catch{}return t}}var mc="$message",yc="$timestamp",wI=new Set([mc,yc]),ff={enabled:!0,max_bytes:32768};function _c(e){var t;return e?{enabled:(t=e.enabled)!==null&&t!==void 0?t:ff.enabled,max_bytes:bI(e.max_bytes,ff.max_bytes)}:$({},ff)}class xI{constructor(t){this.Vn=[],this.Gn=0,this.qi=_c(t)}setConfig(t){this.qi=_c(t),this.Zn()}add(t){var n=function(i){var s;try{s=Sb(i)}catch{return}try{var o=JSON.parse(s);if(!Se(o))return;var a=o,l=a[mc],u=a[yc];return!ce(l)||l.trim().length===0||!ce(u)&&!Ge(u)?void 0:{step:a,json:s}}catch{return}}(t);if(n){var r=function(i){if(typeof TextEncoder<"u")return new TextEncoder().encode(i).length;for(var s=encodeURIComponent(i),o=0,a=0;s.length>a;a++)s[a]==="%"?(o+=1,a+=2):o+=1;return o}(n.json);r>this.qi.max_bytes||(this.Vn.push({step:n.step,bytes:r}),this.Gn+=r,this.Zn())}}getAttachable(){return this.Vn.map(t=>t.step)}clear(){this.Vn=[],this.Gn=0}size(){return this.Vn.length}Zn(){for(;this.Gn>this.qi.max_bytes&&this.Vn.length>0;){var t=this.Vn.shift();t&&(this.Gn-=t.bytes)}}}function bI(e,t){if(!Ge(e)||e===1/0||e===-1/0)return t;var n=Math.floor(e);return 0>n?t:n}var rE=function(e,t){var n=(t===void 0?{}:t).debugEnabled,r={F(i){if(I&&(Ee.DEBUG||I.POSTHOG_DEBUG||n)&&!L(I.console)&&I.console){for(var s=("__rrweb_original__"in I.console[i])?I.console[i].__rrweb_original__:I.console[i],o=arguments.length,a=new Array(o>1?o-1:0),l=1;o>l;l++)a[l-1]=arguments[l];s(e,...a)}},debug(){for(var i=arguments.length,s=new Array(i),o=0;i>o;o++)s[o]=arguments[o];r.F("debug",...s)},info(){for(var i=arguments.length,s=new Array(i),o=0;i>o;o++)s[o]=arguments[o];r.F("log",...s)},warn(){for(var i=arguments.length,s=new Array(i),o=0;i>o;o++)s[o]=arguments[o];r.F("warn",...s)},error(){for(var i=arguments.length,s=new Array(i),o=0;i>o;o++)s[o]=arguments[o];r.F("error",...s)},critical(){for(var i=arguments.length,s=new Array(i),o=0;i>o;o++)s[o]=arguments[o];console.error(e,...s)},uninitializedWarning(i){r.error("You must initialize PostHog before calling "+i)},createLogger:(i,s)=>rE(e+" "+i,s)};return r},D=rE("[PostHog.js]"),Ie=D.createLogger,EI=Ie("[ExternalScriptsLoader]"),wc=e=>{var t=j==null?void 0:j.querySelectorAll("script");if(t){for(var n=0;t.length>n;n++)if(t[n].src===e||t[n].getAttribute("src")===e)return t[n]}},Si=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return EI.warn(t+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=wc(t);if(r){if(r.__posthog_loading_callback_fired)return n();var i=r.__posthog_loading_error;return i?n(i):(r.addEventListener("load",o=>{r.__posthog_loading_callback_fired=!0,n(void 0,o)}),void r.addEventListener("error",o=>{r.__posthog_loading_error=o,n(o)}))}var s=()=>{if(!j)return n("document not found");if(wc(t))return Si(e,t,n);var o=j.createElement("script");if(o.type="text/javascript",o.crossOrigin="anonymous",o.src=t,o.onload=u=>{o.__posthog_loading_callback_fired=!0,n(void 0,u)},o.onerror=u=>{o.__posthog_loading_error=u,n(u)},e.config.prepare_external_dependency_script&&(o=e.config.prepare_external_dependency_script(o)),!o)return n("prepare_external_dependency_script returned null");if(e.config.external_scripts_inject_target==="head")j.head.appendChild(o);else{var a,l=j.querySelectorAll("body > script");l.length>0?(a=l[0].parentNode)==null||a.insertBefore(o,l[0]):j.body.appendChild(o)}};j!=null&&j.body?s():j==null||j.addEventListener("DOMContentLoaded",s)},hf={},Qy=(e,t)=>{var n="/static/"+t+".js?v="+e.version;if(t==="toolbar"){var r=3e5;n=n+"&t="+Math.floor(Date.now()/r)*r}return e.requestRouter.endpointFor("assets",n)};Y.__PosthogExtensions__=Y.__PosthogExtensions__||{},Y.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{if(t!=="remote-config"){var r=e.config.strict_script_versioning;if(r){var i=e.requestRouter.endpointFor("assets","/static/"+e.version+"/"+t+".js"),s=hf[i];if(r==="fallback"&&s){if(wc(s))return void Si(e,s,n);delete hf[i]}Si(e,i,r==="fallback"?(a,l)=>{if(a)if(typeof a=="string")n(a);else{var u,c=Qy(e,t);hf[i]=c;var d=wc(i);d==null||(u=d.parentNode)==null||u.removeChild(d),Si(e,c,n)}else n(void 0,l)}:n)}else Si(e,Qy(e,t),n)}else{var o=e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js");Si(e,o,n)}},Y.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{var r=e.requestRouter.endpointFor("api",t);Si(e,r,n)};Ee.DEBUG=!1,Ee.LIB_VERSION="1.418.16",Ee.LIB_NAME="web";var iE="$people_distinct_id",wt="distinct_id",Ya="$device_id",pf="$device_model",Fs="__alias",ca="__timers",lp="$autocapture_disabled_server_side",up="$heatmaps_enabled_server_side",cp="$exception_capture_enabled_server_side",dp="$error_tracking_suppression_rules",fp="$error_tracking_capture_extension_exceptions",hp="$web_vitals_enabled_server_side",wg="$dead_clicks_enabled_server_side",xg="$product_tours_enabled_server_side",pp="$web_vitals_allowed_metrics",Oi="$session_recording_remote_config",sE="$replay_sample_rate",oE="$replay_override_sampling",aE="$replay_override_linked_flag",lE="$replay_override_url_trigger",uE="$replay_override_event_trigger",Ls="$sesid",bg="$session_is_sampled",ir="$enabled_feature_flags",Mi="$active_feature_flags",Pu="$early_access_features",Xa="$feature_flag_details",Ai="$feature_flag_payloads",Ks="$feature_flag_request_id",xc="$minimal_flag_called_events",Mn="$override_feature_flags",Ci="$override_feature_flag_payloads",yn="$stored_person_properties",Dn="$stored_group_properties",cE="$groups",vp="$surveys",bc="$surveys_loaded_at",gp="$surveys_activated",Ru="$surveys_activated_session",Tu="$surveys_activated_timestamps",da="ph_product_tours",ar="$flag_call_reported",fa="$flag_call_reported_session_id",Qs="$feature_flag_errors",Gi="$feature_flag_evaluated_at",se="$user_state",mp="$client_session_props",yp="$capture_rate_limit",_p="$initial_campaign_params",wp="$initial_referrer_info",Ec="$initial_person_info",Sc="$epp",hs="$posthog_cookieless",dE="$cookieless_mode",fE="$sdk_debug_extensions_init_method",hE="$sdk_debug_extensions_init_time_ms",xp="$sdk_debug_recording_script_not_loaded",Eg="PostHog loadExternalDependency extension not found.",ki="on_reject",lr="always",We="anonymous",ot="identified",bp="identified_only",Cc="visibilitychange",kc="beforeunload",bs="$pageview",vf="$pageleave",gf="$identify",Yy="$groupidentify";function Ql(e,t){Z(e)&&e.forEach(t)}function ve(e,t){if(!ne(e))if(Z(e))e.forEach(t);else if(MT(e))e.forEach((r,i)=>t(r,i));else for(var n in e)kb.call(e,n)&&t(e[n],n)}var _e=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];for(var i of n)for(var s in i)i[s]!==void 0&&(e[s]=i[s]);return e};function Iu(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var Xy=function(e){try{return e()}catch{return}},SI=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,n)}catch(i){D.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),D.critical(i)}}},Sg=function(e){var t={};return ve(e,function(n,r){(ce(n)&&n.length>0||Ge(n))&&(t[r]=n)}),t},CI=["herokuapp.com","vercel.app","netlify.app"];function kI(e){var t=e==null?void 0:e.hostname;if(!ce(t))return!1;var n=t.split(".").slice(-2).join(".");for(var r of CI)if(n===r)return!1;return!0}function Re(e,t,n,r){var i=r??{},s=i.capture,o=i.passive;e==null||e.addEventListener(t,n,{capture:s!==void 0&&s,passive:o===void 0||o})}function Ep(e){return e.name==="ph_toolbar_internal"}var pE=e=>{if(j){try{for(var t=e+"=",n=j.cookie.split(";").filter(s=>s.length),r=0;n.length>r;r++){for(var i=n[r];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(t)===0)return decodeURIComponent(i.substring(t.length,i.length))}}catch{}return null}};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Ge(e)&&isFinite(e)&&Math.floor(e)===e});class Pc{constructor(t){if(this.bytes=t,t.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,n,r,i){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||0>t||0>n||0>r||0>i||t>0xffffffffffff||n>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=t/Math.pow(2,40),s[1]=t/Math.pow(2,32),s[2]=t/Math.pow(2,24),s[3]=t/Math.pow(2,16),s[4]=t/256,s[5]=t,s[6]=112|n>>>8,s[7]=n,s[8]=128|r>>>24,s[9]=r>>>16,s[10]=r>>>8,s[11]=r,s[12]=i>>>24,s[13]=i>>>16,s[14]=i>>>8,s[15]=i,new Pc(s)}toString(){for(var t="",n=0;this.bytes.length>n;n++)t=t+(this.bytes[n]>>>4).toString(16)+(15&this.bytes[n]).toString(16),n!==3&&n!==5&&n!==7&&n!==9||(t+="-");if(t.length!==36)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new Pc(this.bytes.slice(0))}equals(t){return this.compareTo(t)===0}compareTo(t){for(var n=0;16>n;n++){var r=this.bytes[n]-t.bytes[n];if(r!==0)return Math.sign(r)}return 0}}class PI{generate(){var t=this.generateOrAbort();if(!L(t))return t;this.Rr=0;var n=this.generateOrAbort();if(L(n))throw new Error("Could not generate UUID after timestamp reset");return n}generateOrAbort(){var t=Date.now();if(t>this.Rr)this.Rr=t,this.Ar();else{if(this.Rr>=t+1e4)return;this.Lr++,this.Lr>4398046511103&&(this.Rr++,this.Ar())}return Pc.fromFieldsV7(this.Rr,Math.trunc(this.Lr/Math.pow(2,30)),this.Lr&Math.pow(2,30)-1,this.Or.nextUint32())}Ar(){this.Lr=1024*this.Or.nextUint32()+(1023&this.Or.nextUint32())}constructor(){this.Rr=0,this.Lr=0,this.Or=new RI}}var Jy,vE=e=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};I&&!L(I.crypto)&&crypto.getRandomValues&&(vE=e=>crypto.getRandomValues(e));class RI{nextUint32(){return this.ft.length>this.Fr||(vE(this.ft),this.Fr=0),this.ft[this.Fr++]}constructor(){this.ft=new Uint32Array(8),this.Fr=1/0}}var $n=()=>TI().toString(),TI=()=>(Jy||(Jy=new PI)).generate(),Yo="",II=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,Ke={Dr:()=>!!j,jr(e){D.error("cookieStore error: "+e)},Pr:pE,Br(e){var t;try{t=JSON.parse(Ke.Pr(e))||{}}catch{}return t},Nr(e,t,n,r,i){if(!j)return!1;try{var s="",o="",a=function(c,d){if(d){var f=function(_,p){if(p===void 0&&(p=j),Yo)return Yo;if(!p||["localhost","127.0.0.1"].includes(_))return"";for(var y=_.split("."),h=Math.min(y.length,8),v="dmn_chk_"+$n();!Yo&&h--;){var x=y.slice(h).join("."),b=v+"=1;domain=."+x+";path=/";p.cookie=b+";max-age=3",p.cookie.includes(v)&&(p.cookie=b+";max-age=0",Yo=x)}return Yo}(c);if(!f){var m=(_=>{var p=_.match(II);return p?p[0]:""})(c);m!==f&&D.info("Warning: cookie subdomain discovery mismatch",m,f),f=m}return f?"; domain=."+f:""}return""}(j.location.hostname,r);if(n){var l=new Date;l.setTime(l.getTime()+864e5*n),s="; expires="+l.toUTCString()}i&&(o="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&D.warn("cookieStore warning: large cookie, len="+u.length),j.cookie=u,!0}catch{return!1}},qr(e,t){if(j!=null&&j.cookie)try{Ke.Nr(e,"",-1,t)}catch{return}}},mf=null,ge={Dr(){if(!rt(mf))return mf;var e=!0;if(L(I))e=!1;else try{var t="__mplssupport__";ge.Nr(t,"xyz"),ge.Pr(t)!=='"xyz"'&&(e=!1),ge.qr(t)}catch{e=!1}return e||D.error("localStorage unsupported; falling back to cookie store"),mf=e,e},jr(e){D.error("localStorage error: "+e)},Pr(e){try{return I==null?void 0:I.localStorage.getItem(e)}catch(t){ge.jr(t)}return null},Br(e){try{return JSON.parse(ge.Pr(e))||{}}catch{}return null},Nr(e,t){try{return I==null||I.localStorage.setItem(e,JSON.stringify(t)),!0}catch(n){ge.jr(n)}return!1},qr(e){try{I==null||I.localStorage.removeItem(e)}catch(t){ge.jr(t)}}},yf=[yn,Mi,ir,Xa,Ai,Ks,Gi,Qs,ar],Pi=[Ya,wt,Ls,bg,Sc,Ec,se],Rc=e=>e+"_cpm",OI=["__proto__","constructor","prototype"],_f=e=>{if(!Se(e))return{};var t={};return Object.keys(e).forEach(n=>{OI.indexOf(n)===-1&&(t[n]=e[n])}),t},wf=function(e,t){t===void 0&&(t=[]);var n={};return[...Pi,...t].forEach(r=>{var i=e[r];L(i)||rt(i)||i===""||(n[r]=i)}),n},gE=e=>{for(var t=5381,n=2166136261,r=0;e.length>r;r++){var i=e.charCodeAt(r);t=33*t^i,n=Math.imul(n^i,16777619)}return e.length.toString(36)+"."+(t>>>0).toString(36)+"."+(n>>>0).toString(36)},Zy=(e,t)=>({p:t,f:gE(JSON.stringify(e))}),e_=(e,t)=>{if(!t)return{properties:[],isValid:!1};try{var n=Ke.Br(Rc(e)),r=(n==null?void 0:n.f)===gE(t)&&Z(n.p);return{properties:r?n.p:[],isValid:r}}catch{return{properties:[],isValid:!1}}},xf=(e,t)=>t+"|"+(Ke.Pr(Rc(e))||""),Yl={},MI={Dr:()=>!0,jr(e){D.error("memoryStorage error: "+e)},Pr:e=>Yl[e]||null,Br:e=>Yl[e]||null,Nr:(e,t)=>(Yl[e]=t,!0),qr(e){delete Yl[e]}},mi=null,we={Dr(){if(!rt(mi))return mi;if(mi=!0,L(I))mi=!1;else try{var e="__support__";we.Nr(e,"xyz"),we.Pr(e)!=='"xyz"'&&(mi=!1),we.qr(e)}catch{mi=!1}return mi},jr(e){D.error("sessionStorage error: ",e)},Pr(e){try{return I==null?void 0:I.sessionStorage.getItem(e)}catch(t){we.jr(t)}return null},Br(e){try{return JSON.parse(we.Pr(e))||null}catch{}return null},Nr(e,t){try{return I==null||I.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(n){we.jr(n)}return!1},qr(e){try{I==null||I.sessionStorage.removeItem(e)}catch(t){we.jr(t)}}};class AI{constructor(t){this._instance=t}get qi(){return this._instance.config}get consent(){return this.cs()?0:this.fs}isOptedOut(){return this.qi.cookieless_mode===lr||this.isRejected()||this.consent===-1&&this.qi.cookieless_mode===ki}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.qi.opt_out_capturing_by_default}optInOut(t){this.ps.Nr(this.gs,t?1:0,this.qi.cookie_expiration,this.qi.cross_subdomain_cookie,this.qi.secure_cookie)}reset(){this.ps.qr(this.gs,this.qi.cross_subdomain_cookie)}get gs(){var t=this._instance.config,n=t.token,r=t.opt_out_capturing_cookie_prefix;return t.consent_persistence_name||(r?r+n:"__ph_opt_in_out_"+n)}get fs(){var t=this.ps.Pr(this.gs);return lf(t)?1:J(FT,t)?0:-1}get ps(){var t=this.qi.opt_out_capturing_persistence_type,n=t==="localStorage"?ge:Ke;if(!this.ys||this.ys!==n){this.ys=n;var r=t==="localStorage"?Ke:ge;r.Pr(this.gs)&&(this.ys.Pr(this.gs)||this.optInOut(lf(r.Pr(this.gs))),r.qr(this.gs,this.qi.cross_subdomain_cookie))}return this.ys}cs(){return!!this.qi.respect_dnt&&[St==null?void 0:St.doNotTrack,St==null?void 0:St.msDoNotTrack,Y.doNotTrack].some(t=>lf(t))}}function mE(e,t){var n,r=e==null||(n=e.config)==null?void 0:n.get_current_url;if(!vt(r))return t;try{var i=r(t);return ce(i)&&i?i:t}catch(s){return D.error("Error in get_current_url, falling back to window.location.href",s),t}}var yE="__POSTHOG_TOOLBAR__",NI=1,$I=3,FI=11;function t_(e){return e instanceof Element&&(e.id===yE||!(e.closest==null||!e.closest(".toolbar-global-fade-container")))}function ui(e){return!!e&&e.nodeType===NI}function Kt(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function _E(e){return!!e&&e.nodeType===$I}function wE(e){return!!e&&e.nodeType===FI&&ui(e.host)}var xE=1e3;function Cg(e){return e?dd(e).split(/\s+/):[]}function n_(e,t){var n=function(r){var i,s=I==null||(i=I.location)==null?void 0:i.href;return L(s)?void 0:mE(r,s)}(t);return!!(n&&e&&e.some(r=>n.match(r)))}function Tc(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return Cg(t)}function bE(e){return ne(e)?null:dd(e).split(/(\s+)/).filter(t=>ka(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Ja(e){var t="";return kp(e)&&!PE(e)&&e.childNodes&&e.childNodes.length&&ve(e.childNodes,function(n){var r;_E(n)&&n.textContent&&(t+=(r=bE(n.textContent))!==null&&r!==void 0?r:"")}),dd(t)}function Sp(e){var t;return L(e.target)?e.srcElement||null:(t=e.target)!=null&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var kg=["a","button","form","input","select","textarea","label"];function Cp(e,t){if(L(t))return!0;var n,r=function(s){if(t.some(o=>function(a,l){var u=a.matches||a.matchesSelector||a.msMatchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.oMatchesSelector;try{return!!u&&u.call(a,l)}catch{return!1}}(s,o)))return{v:!0}};for(var i of e)if(n=r(i))return n.v;return!1}function EE(e){var t=e.parentNode;return!(!t||!ui(t))&&t}var LI=[".ph-no-autocapture","[data-ph-no-autocapture]"],SE=["next","previous","prev",">","<"],jI=[...SE,"+","-","−","–"],r_=(e,t)=>/[a-z0-9]/i.test(t)?e.includes(t):e===t,i_=[".ph-no-rageclick",".ph-no-capture"],DI=["","text","search","email","password","url","tel","number"];function CE(e,t){if(!I||Pg(e))return!1;var n,r,i,s,o;if($t(t)?(n=!!t&&i_,r=void 0,i=!1):(n=(s=t==null?void 0:t.css_selector_ignorelist)!==null&&s!==void 0?s:i_,r=t==null?void 0:t.content_ignorelist,i=(o=t==null?void 0:t.ignore_text_selection)!==null&&o!==void 0&&o),n===!1||i&&function(l){return!(!l||!ui(l))&&(!!Kt(l,"textarea")||(Kt(l,"input")?J(DI,(l.getAttribute("type")||"").toLowerCase()):function(u){if(u.isContentEditable)return!0;var c=u.getAttribute==null?void 0:u.getAttribute("contenteditable");return c==="true"||c===""}(l)))}(e))return!1;var a=kE(e,!1).targetElementList;return!function(l,u){if(l===!1||L(l))return!1;var c;if(l===!0)c=SE;else{if(!Z(l))return!1;if(l.length>10)return D.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;c=l.map(d=>d.toLowerCase())}return u.some(d=>{var f=d.safeText,m=d.ariaLabel;return c.some(_=>r_(f,_)||r_(m,_))})}(r,a.map(l=>{var u;return{safeText:Ja(l).toLowerCase(),ariaLabel:((u=l.getAttribute("aria-label"))==null?void 0:u.toLowerCase().trim())||""}}))&&!Cp(a,n)}var Pg=e=>!e||Kt(e,"html")||!ui(e),kE=(e,t)=>{if(!I||Pg(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[e],i=e;i.parentNode&&!Kt(i,"body");)if(wE(i.parentNode))r.push(i.parentNode.host),i=i.parentNode.host;else{var s=EE(i);if(!s)break;if(t||kg.indexOf(s.tagName.toLowerCase())>-1)n=!0;else try{var o=I.getComputedStyle(s);o&&o.getPropertyValue("cursor")==="pointer"&&(n=!0)}catch{}r.push(s),i=s}return{parentIsUsefulElement:n,targetElementList:r}};function kp(e){for(var t=new Set,n=0,r=e;r.parentNode&&!Kt(r,"body");r=r.parentNode){if(n++>=xE||t.has(r))return!1;t.add(r);var i=Tc(r);if(J(i,"ph-sensitive")||J(i,"ph-no-capture"))return!1}if(J(Tc(e),"ph-include"))return!0;var s=e.type||"";if(ce(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var o=e.name||e.id||"";return!ce(o)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,""))}function PE(e){return!!(Kt(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Kt(e,"select")||Kt(e,"textarea")||e.getAttribute("contenteditable")==="true")}var s_=new RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),o_=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,zI=[16,15,14,13],UI=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),a_=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),l_=/[0-9A-Za-z_]/;function VI(e){for(var t=0,n=!1,r=e.length-1;r>=0;r--){var i=e.charCodeAt(r)-48;n&&(i*=2)>9&&(i-=9),t+=i,n=!n}return t%10==0}function ka(e,t){if(t===void 0&&(t=!0),ne(e))return!1;if(ce(e)){e=dd(e);var n=t?s_.test((e||"").replace(/[- ]/g,"")):function(i){var s;for(o_.lastIndex=0;s=o_.exec(i);){var o=s[2];if(o)for(var a=o.replace(/[- ]/g,""),l=0;a.length>l;l++)for(var u of zI){var c=l+u;if(a.length>=c){var d=a.slice(l,c);if(s_.test(d)&&VI(d))return!0}}}return!1}(e);if(n)return!1;var r=t?UI.test(e):function(i){var s;for(a_.lastIndex=0;s=a_.exec(i);){var o=s[1],a=s[3];if(!(o&&a&&l_.test(o)&&l_.test(a)))return!0}return!1}(e);if(r)return!1}return!0}function u_(e){var t=Ja(e);return ka(t=(t+" "+RE(e)).trim())?t:""}function RE(e){var t="";return e&&e.childNodes&&e.childNodes.length&&ve(e.childNodes,function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var i=Ja(n);t=(t+" "+i).trim(),n.childNodes&&n.childNodes.length&&(t=(t+" "+RE(n)).trim())}catch(s){D.error("[AutoCapture]",s)}}),t}function c_(e){return e.replace(/"|\\"/g,'\\"')}function BI(e){var t=e.attr__class;if(t)return Z(t)?t:Cg(t)}var Xl=Ie("[Dead Clicks]"),qI=()=>!0,WI=e=>{var t,n=!((t=e.instance.persistence)==null||!t.get_property(wg)),r=e.instance.config.capture_dead_clicks;return $t(r)?r:!!Se(r)||n};class d_{get lazyLoadedDeadClicksAutocapture(){return this.bs}constructor(t,n,r){this.instance=t,this.isEnabled=n,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(t){if(t.ok){var n=t.config;"captureDeadClicks"in n&&(this.instance.persistence&&this.instance.persistence.register({[wg]:n.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this._s(()=>{this.ws()}):this.stop()}_s(t){var n,r;(n=Y.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture?t():(r=Y.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",i=>{i?Xl.error("failed to load script",i):t()})}ws(){var t;if(j){if(!this.bs&&(t=Y.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture){var n=Se(this.instance.config.capture_dead_clicks)?$({},this.instance.config.capture_dead_clicks):{};n.__onCapture=this.onCapture,this.onCapture&&(n.capture_dead_swipes=!1),this.bs=Y.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.bs.start(j),Xl.info("starting...")}}else Xl.error("`document` not found. Cannot start.")}stop(){this.bs&&(this.bs.stop(),this.bs=void 0,Xl.info("stopping..."))}}var bf=Ie("[SegmentIntegration]"),TE="posthog-js";function IE(e,t){var n=t===void 0?{}:t,r=n.organization,i=n.projectId,s=n.prefix,o=n.severityAllowList,a=o===void 0?["error"]:o,l=n.sendExceptionsToPostHog,u=l===void 0||l;return c=>{var d,f,m,_,p;if(a!=="*"&&!a.includes(c.level)||!e.__loaded)return c;c.tags||(c.tags={});var y=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());c.tags["PostHog Person URL"]=y,e.sessionRecordingStarted()&&(c.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var h,v=((d=c.exception)==null?void 0:d.values)||[],x=v.map(E=>$({},E,{stacktrace:E.stacktrace?$({},E.stacktrace,{type:"raw",frames:(E.stacktrace.frames||[]).map(S=>$({},S,{platform:"web:javascript"}))}):void 0})),b={$exception_message:((f=v[0])==null?void 0:f.value)||c.message,$exception_type:(m=v[0])==null?void 0:m.type,$exception_level:c.level,$exception_list:x,$sentry_event_id:c.event_id,$sentry_exception:c.exception,$sentry_exception_message:((_=v[0])==null?void 0:_.value)||c.message,$sentry_exception_type:(p=v[0])==null?void 0:p.type,$sentry_tags:c.tags};return r&&i&&(b.$sentry_url=(s||"https://sentry.io/organizations/")+r+"/issues/?project="+i+"&query="+c.event_id),u&&((h=e.exceptions)==null||h.sendExceptionEvent(b)),c}}class HI{constructor(t,n,r,i,s,o){this.name=TE,this.setupOnce=function(a){a(IE(t,{organization:n,projectId:r,prefix:i,severityAllowList:s,sendExceptionsToPostHog:o==null||o}))}}}class f_{constructor(t){this.ks=(n,r,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(D.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:n,changeReason:i}),this.Ss=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.xs()}xs(){var t;this.Cs=(t=this._instance.sessionManager)==null?void 0:t.onSessionId(this.ks)}destroy(){var t;(t=this.Cs)==null||t.call(this),this.Cs=void 0}doPageView(t,n){var r,i=this.Ts(t,n);return this.Ss={pathname:(r=I==null?void 0:I.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:t},this._instance.scrollManager.resetContext(),i}doPageLeave(t){var n;return this.Ts(t,(n=this.Ss)==null?void 0:n.pageViewId)}doEvent(){var t;return{$pageview_id:(t=this.Ss)==null?void 0:t.pageViewId}}Ts(t,n){var r=this.Ss;if(!r)return{$pageview_id:n};var i={$pageview_id:n,$prev_pageview_id:r.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var o=s.maxScrollHeight,a=s.lastScrollY,l=s.maxScrollY,u=s.maxContentHeight,c=s.lastContentY,d=s.maxContentY;if(!(L(o)||L(a)||L(l)||L(u)||L(c)||L(d))){o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),c=Math.ceil(c),d=Math.ceil(d);var f=o>1?Vn(a/o,0,1,D):1,m=o>1?Vn(l/o,0,1,D):1,_=u>1?Vn(c/u,0,1,D):1,p=u>1?Vn(d/u,0,1,D):1;i=_e(i,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:f,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:m,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:_,$prev_pageview_max_content:d,$prev_pageview_max_content_percentage:p})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(t.getTime()-r.timestamp.getTime())/1e3),i}}var Ef=["flags","surveys"],GI={[iE]:{exposure:"hidden"},[Fs]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[ca]:{exposure:"hidden"},[lp]:{exposure:"event"},[up]:{exposure:"hidden"},[cp]:{exposure:"event"},[dp]:{exposure:"hidden"},[fp]:{exposure:"event"},[hp]:{exposure:"event"},[wg]:{exposure:"event"},[xg]:{exposure:"hidden"},[pp]:{exposure:"event"},[Oi]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[Ls]:{exposure:"hidden"},[bg]:{exposure:"event"},[sE]:{exposure:"event",shouldSkipFromEventProperties:e=>rt(e)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[ir]:{exposure:"hidden",storageGroup:"flags"},[Mi]:{exposure:"hidden",storageGroup:"flags"},[Pu]:{exposure:"hidden"},[Xa]:{exposure:"hidden",storageGroup:"flags"},[Ai]:{exposure:"hidden",storageGroup:"flags"},[Ks]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[xc]:{exposure:"hidden",storageGroup:"flags"},[Mn]:{exposure:"hidden"},[Ci]:{exposure:"hidden"},[yn]:{exposure:"hidden"},[Dn]:{exposure:"hidden"},[vp]:{exposure:"hidden",storageGroup:"surveys"},[bc]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[gp]:{exposure:"event"},[Ru]:{exposure:"hidden"},[Tu]:{exposure:"hidden"},[da]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[ar]:{exposure:"hidden"},[fa]:{exposure:"hidden"},[cE]:{exposure:"event"},[Qs]:{exposure:"hidden"},[Gi]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[se]:{exposure:"hidden"},[mp]:{exposure:"hidden"},[yp]:{exposure:"hidden"},[_p]:{exposure:"hidden"},[wp]:{exposure:"hidden"},[Ec]:{exposure:"hidden"},[Sc]:{exposure:"hidden"},[oE]:{exposure:"event"},[aE]:{exposure:"event"},[lE]:{exposure:"event"},[uE]:{exposure:"event"},[fE]:{exposure:"event"},[hE]:{exposure:"event"},[xp]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_pending_trigger_conditions:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},KI=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],An=e=>{var t=GI[e];if(t)return t;for(var n of KI){var r=n[1];if(e.indexOf(n[0])===0)return r}},js=(e,t)=>{try{return JSON.stringify(e,(n,r)=>typeof r=="bigint"?r.toString():r,t)}catch{return Sb(e)}},So=e=>{var t=j==null?void 0:j.createElement("a");return L(t)?null:(t.href=e,t)},Co=function(e,t){for(var n,r=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),i=0;r.length>i;i++){var s=r[i].split("=");if(s[0]===t){n=s;break}}if(!Z(n)||2>n.length)return"";var o=n[1];try{o=decodeURIComponent(o)}catch{D.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Za=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split("#"),i=r[1],s=(r[0]||"").split("?"),o=s[1],a=s[0],l=(o||"").split("&"),u=[],c=0;l.length>c;c++){var d=l[c].split("=");Z(d)&&(t.includes(d[0])?u.push(d[0]+"="+n):u.push(l[c]))}var f=a;return o!=null&&(f+="?"+u.join("&")),i!=null&&(f+="#"+i),f},Ic=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},OE=(e,t)=>e>=t&&wb(),ME=(e,t,n,r)=>{if(e===0){if(wb()){var i=t+1;return i===n&&r(),i}return t}return 0},Jl="https?://(.*)",ko=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],QI=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...ko],el="",YI=["li_fat_id"];function AE(e,t,n){if(!j)return{};var r,i=t?[...ko,...n||[]]:[],s=NE(Za(j.URL,i,el),e),o=(r={},ve(YI,function(a){var l=pE(a);r[a]=l||null}),r);return _e(o,s)}function NE(e,t){var n=QI.concat(t||[]),r={};return ve(n,function(i){var s=Co(e,i);r[i]=s||null}),r}function $E(e){var t=function(s){return s?s.search(Jl+"google.([^/?]*)")===0?"google":s.search(Jl+"bing.com")===0?"bing":s.search(Jl+"yahoo.com")===0?"yahoo":s.search(Jl+"duckduckgo.com")===0?"duckduckgo":null:null}(e),n=t!="yahoo"?"q":"p",r={};if(!rt(t)){r.$search_engine=t;var i=j?Co(j.referrer,n):"";i.length&&(r.ph_keyword=i)}return r}function h_(){return navigator.language||navigator.userLanguage}var Oc="$direct";function FE(){return(j==null?void 0:j.referrer)||Oc}function LE(e,t,n){n===void 0&&(n=!1);var r=e?[...ko,...t||[]]:[],i=n?li(Ae==null?void 0:Ae.href):Ae==null?void 0:Ae.href,s=i==null?void 0:i.substring(0,1e3);return{r:FE().substring(0,1e3),u:s?Za(s,r,el):void 0}}function jE(e,t){var n;t===void 0&&(t=!1);var r=e.r,i=e.u,s=t?li(i):i,o={$referrer:r,$referring_domain:r==null?void 0:r==Oc?Oc:(n=So(r))==null?void 0:n.host};if(s){o.$current_url=s;var a=So(s);o.$host=a==null?void 0:a.host,o.$pathname=a==null?void 0:a.pathname;var l=NE(s);_e(o,l)}if(r){var u=$E(r);_e(o,u)}return o}function DE(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function XI(){try{return new Date().getTimezoneOffset()}catch{return}}var JI={flags:Gi,surveys:bc},ZI=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Zl=e=>e+"_cookie_identity_change_pending",Rr="main",p_=(e,t)=>{ve(e,(n,r)=>{var i=An(r);i&&i.exposure!=="event"||{}.hasOwnProperty.call(t,r)||delete e[r]})};class Sf{constructor(t,n,r){if(r===void 0&&(r=!0),this.Ms={},this.Es=!1,this.Is=!1,this.Rs=!1,this.Ps=!1,this.qi=t,this.As=r,this.props={},this.Fs=void 0,this.Os=(s=>{var o="";return s.token&&(o=s.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),s.persistence_name?"ph_"+s.persistence_name:"ph_"+o+"_posthog"})(t),this.ps=this.Ls(t),this.Is=this.$s(t),this.load(),t.debug&&D.info("Persistence loaded",t.persistence,$({},this.props)),this.update_config(t,t,n),this.save(),I){var i=()=>this.flush();Re(I,"beforeunload",i,{capture:!1}),Re(I,"pagehide",i,{capture:!1})}}Ds(){var t,n=(t=this.qi)==null?void 0:t.persistence_save_debounce_ms;return Ge(n)&&n>0?n:0}Ns(t){if(this.qi.cookieWinsOnConflict&&this.qi.persistence.toLowerCase()==="localstorage+cookie")if(t)try{var n=wf(t,this.qi.cookie_persisted_properties||[]),r=Zy(n,this.qi.cookie_persisted_properties||[]),i=JSON.stringify(n)+"|"+JSON.stringify(r),s=Ke.Pr(this.Os)||void 0;s&&xf(this.Os,s)===i&&(this.qs=i,this.js=s)}catch{}else try{var o=Ke.Pr(this.Os)||void 0;this.qs=o?xf(this.Os,o):void 0,this.js=o}catch{}}syncCookieProperties(){return this.Bs(this.qi)}Bs(t,n){if(n===void 0&&(n=!1),this.Hs&&!n||this.Ps||!t.cookieWinsOnConflict||t.persistence.toLowerCase()!=="localstorage+cookie")return!1;var r;try{r=Ke.Pr(this.Os)||void 0}catch{}if(!r||r===this.js)return!1;var i,s=xf(this.Os,r);try{i=_f(JSON.parse(r))}catch{return!1}if((Ke.Pr(this.Os)||void 0)!==r)return!1;this.qs=s,this.js=r;var o=e_(this.Os,r),a=[...Pi,...o.properties],l={};if(Object.keys(i).forEach(p=>{var y=i[p];(L(y)||rt(y)||y===""||p===se&&y!==We&&y!==ot)&&(l[p]=!0,delete i[p])}),En(i))return!1;var u=wt in i||i[se]===We||i[se]===ot,c=this.props[wt],d=this.props[se],f=_e({},this.props);[...Pi,...t.cookie_persisted_properties||[]].forEach(p=>{if(a.indexOf(p)!==-1&&!(p in i)&&!l[p]&&(u||p!==wt&&p!==se)){var y=f[p];!o.isValid&&Pi.indexOf(p)!==-1&&(y===!1||y===0)||delete f[p]}}),this.props=_e(f,i),!u||se in i||se in this.props||this.Us(se,We);var m=this.props[wt],_=this.props[se];return!u||m===c&&_===d||(this.Rs=!0,we.Nr(Zl(this.Os),!0),this.zs(yn),this.zs(Mi),this.zs(ir),this.zs(Xa),this.zs(Ai),this.zs(Ks),this.zs(Gi),this.zs(Qs),this.zs(ar),_===We&&(d===ot||i[se]===We||!L(c)&&m!==c)&&(p_(this.props,i),this.zs(Dn)),_===ot?this.props.$user_id=m:delete this.props.$user_id,this.zs(Fs)),!0}consumeCookieIdentityChange(){var t=Zl(this.Os),n=this.Rs||!!we.Pr(t);return this.Rs=!1,n&&we.qr(t),n}Ws(t){return t===void 0&&(t=!1),!(this.Ps||this.Hs&&!t||!this.qi.cookieWinsOnConflict||this.qi.persistence.toLowerCase()!=="localstorage+cookie"||(this.Ps=!0,0))}Vs(){this.Ps&&(L(this.Gs)||(clearTimeout(this.Gs),this.Gs=void 0),delete this.Ms[Rr],this.Zs(!0))}Qs(t){if(t===void 0&&(t=!0),this.Ps)try{t?this.Vs():L(this.Gs)||(clearTimeout(this.Gs),this.Gs=void 0)}finally{this.Ps=!1}}isDisabled(){return!!this.Hs}Ls(t){ZI.indexOf(t.persistence.toLowerCase())===-1&&(D.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var n,r=function(o,a){o===void 0&&(o=[]),a===void 0&&(a=!1);var l=[...Pi,...o];return $({},ge,{Br(u){try{var c,d={};try{c=Ke.Pr(u)||void 0,d=c?_f(JSON.parse(c)):{}}catch{}var f,m=JSON.parse(ge.Pr(u)||"{}");if(a){var _=e_(u,c),p=[...Pi,..._.properties],y={};Object.keys(d).forEach(E=>{var S=d[E];rt(S)||S===""||E===se&&S!==We&&S!==ot||(y[E]=S)});var h=wt in y||y[se]===We||y[se]===ot;if(Object.keys(y).length>0){var v,x=m[wt],b=(v=m[se])!==null&&v!==void 0?v:We;l.forEach(E=>{if(p.indexOf(E)!==-1&&!(E in d)&&(h||E!==wt&&E!==se)){var S=m[E];!_.isValid&&Pi.indexOf(E)!==-1&&(S===!1||S===0)||delete m[E]}}),!h||se in d||se in m||(m[se]=We),!h||(wt in y?y[wt]:m[wt])===x&&(se in y?y[se]:m[se])===b||(yf.forEach(E=>delete m[E]),y[se]===ot&&wt in y?m.$user_id=y[wt]:delete m.$user_id,y[se]!==ot&&(delete m[cE],delete m[Dn]),delete m.__alias)}f=_e(m,y)}else f=_e(d,m);return ge.Nr(u,f),f}catch{}return null},Nr(u,c,d,f,m,_){var p=ge.Nr(u,c,void 0,void 0,_);try{var y=wf(c,o);if(Object.keys(y).length){if(a){var h=Rc(u),v=Zy(y,o);if(Ke.Nr(h,v,d,f,m,_),Ke.Pr(h)!==JSON.stringify(v)){Ke.qr(h,f);var x=wf(c);return Ke.Nr(u,x,d,f,m,_),p}}Ke.Nr(u,y,d,f,m,_)}}catch(b){ge.jr(b)}return p},qr(u,c){try{I==null||I.localStorage.removeItem(u),Ke.qr(u,c),Ke.qr(Rc(u),c)}catch(d){ge.jr(d)}}})}(t.cookie_persisted_properties||[],t.cookieWinsOnConflict),i=!1,s=t.persistence.toLowerCase();return s==="localstorage"&&ge.Dr()?(n=ge,i=!0):s==="localstorage+cookie"&&r.Dr()?(n=r,i=!0):s==="sessionstorage"&&we.Dr()?n=we:s==="memory"?n=MI:s==="cookie"?n=Ke:r.Dr()?(n=r,i=!0):n=Ke,this.Es=i,n}Js(t){return this.Os+"__"+t}$s(t){return this.Es&&!!t.split_storage}properties(){var t={};return ve(this.props,(n,r)=>{var i=An(r);if(!i||i.exposure==="event"){if(i!=null&&i.shouldSkipFromEventProperties!=null&&i.shouldSkipFromEventProperties(n))return;t[r]=n}}),t}load(t){if(t===void 0&&(t=!1),!this.Hs||t){var n=this.qi.cookieWinsOnConflict&&this.qi.persistence.toLowerCase()==="localstorage+cookie",r=n?ge.Br(this.Os):null,i={};if(n)try{ve(i=_f(Ke.Br(this.Os)),(_,p)=>{(L(_)||rt(_)||_==="")&&delete i[p]})}catch{}var s=this.ps.Br(this.Os);if(s&&(this.props=_e({},s)),this.Is&&this.Ks(),n&&s){var o,a,l=r==null?void 0:r[wt],u=(o=r==null?void 0:r[se])!==null&&o!==void 0?o:We,c=s[wt],d=(a=s[se])!==null&&a!==void 0?a:We;if(c!==l||d!==u){this.Rs=!0,we.Nr(Zl(this.Os),!0);var f=_e({},this.props);yf.forEach(_=>delete f[_]),d===We&&(u===ot||i[se]===We||!L(l)&&c!==l)&&(p_(f,i),delete f[Dn]),this.props=f;var m=new Set;yf.forEach(_=>{var p,y=(p=An(_))==null?void 0:p.storageGroup;y&&m.add(y)}),m.forEach(_=>{var p={};ve(this.props,(y,h)=>{var v;((v=An(h))==null?void 0:v.storageGroup)===_&&(p[h]=y)}),En(p)?(ge.qr(this.Js(_)),this.Ms[_]={}):ge.Nr(this.Js(_),p)&&(this.Ms[_]={persisted:!0,fingerprint:this.Ys(p,_)})})}}we.Pr(Zl(this.Os))&&(this.Rs=!0)}}Ks(){for(var t of Ef){var n=ge.Br(this.Js(t));if(n&&!En(n)){var r=this.Xs(t);r.persisted=!0,this.ta(t)||(r.fingerprint=this.Ys(n,t)),this.ea(t,n)||_e(this.props,n)}}}ta(t){return Object.keys(this.props).some(n=>{var r;return((r=An(n))==null?void 0:r.storageGroup)===t})}ea(t,n){var r=JI[t];if(!r)return!1;var i=n[r],s=this.props[r];return Ge(i)&&Ge(s)&&s>i}refreshKey(t){var n;if(!this.Hs){var r=this.Is?(n=An(t))==null?void 0:n.storageGroup:void 0,i=r?ge.Br(this.Js(r)):this.ps.Br(this.Os);if(i&&t in i)this.Us(t,i[t]);else{if(r){var s=this.ps.Br(this.Os);if(s&&t in s)return void this.Us(t,s[t])}this.zs(t)}}}save(){if(!this.Hs){var t=this.Ds();t>0?L(this.Gs)&&(this.Gs=setTimeout(()=>{this.Gs=void 0,this.Zs()},t)):this.Zs()}}flush(){L(this.Gs)||(clearTimeout(this.Gs),this.Gs=void 0,this.Zs())}Zs(t){t===void 0&&(t=!1),this.Hs||this.Ps&&!t||(t||this.syncCookieProperties(),this.Is?this.ia():this.ra(this.ps,this.Os,this.props,Rr)&&this.Ns(this.props))}ia(){var t=this.na(),n=t.main,r=t.groups;for(var i of(this.ra(this.ps,this.Os,n,Rr)&&this.Ns(n),Ef)){var s,o=r[i];(!En(o)||(s=this.Ms[i])!=null&&s.persisted)&&this.ra(ge,this.Js(i),o,i)}}na(){var t={},n={flags:{},surveys:{}};return ve(this.props,(r,i)=>{var s,o=(s=An(i))==null?void 0:s.storageGroup;o?n[o][i]=r:t[i]=r}),{main:t,groups:n}}Ys(t,n){if(n===Rr)return JSON.stringify(t)+"|"+this.sa+"|"+this.aa+"|"+this.oa;var r={};return ve(t,(i,s)=>{var o;r[s]=(o=An(s))!=null&&o.volatile?"__volatile__":i}),JSON.stringify(r)}ra(t,n,r,i){var s,o=this.Xs(i);if(i!==Rr&&!o.dirty&&!L(o.fingerprint))return!1;try{if((s=this.Ys(r,i))===o.fingerprint)return o.dirty=!1,!1}catch{s=void 0}return t.Nr(n,r,this.sa,this.aa,this.oa,this.qi.debug)?(o.dirty=!1,i!==Rr&&(o.persisted=!0),L(s)||(o.fingerprint=s),!0):(this.qi.debug&&D.warn('failed to persist storage entry "'+n+'"; will retry on next save'),!1)}remove(t){var n=(t===void 0?{}:t).keepGroupEntries,r=n!==void 0&&n;if(L(this.Gs)||(clearTimeout(this.Gs),this.Gs=void 0),this.ps.qr(this.Os,!1),this.ps.qr(this.Os,!0),!r&&this.As)for(var i of Ef)ge.qr(this.Js(i));r?delete this.Ms[Rr]:this.Ms={},this.qs=void 0,this.js=void 0}clear(){this.remove(),this.props={}}register_once(t,n,r){if(Se(t)){this.syncCookieProperties(),L(n)&&(n="None"),this.sa=L(r)?this.la:r;var i=!1;if(ve(t,(s,o)=>{this.props.hasOwnProperty(o)&&this.props[o]!==n||(this.Us(o,s),i=!0)}),i)return this.save(),!0}return!1}register(t,n){if(Se(t)){this.syncCookieProperties(),this.sa=L(n)?this.la:n;var r=!1;if(ve(t,(i,s)=>{t.hasOwnProperty(s)&&(this.props[s]!==i||Se(i)||Z(i))&&(this.Us(s,i),r=!0)}),r)return this.save(),!0}return!1}unregister(t){this.syncCookieProperties();var n=typeof t=="string"?[t]:t,r=!1;for(var i of n)i in this.props&&(this.zs(i),r=!0);r&&this.save()}update_campaign_params(){var t=j==null?void 0:j.URL;if(t!==this.Fs){var n=AE(this.qi.custom_campaign_params,this.qi.mask_personal_data_properties,this.qi.custom_personal_data_properties);En(Sg(n))||this.register(n),this.Fs=t}}update_search_keyword(){var t;this.register((t=j==null?void 0:j.referrer)?$E(t):{})}update_referrer_info(){var t;this.register_once({$referrer:FE(),$referring_domain:j!=null&&j.referrer&&((t=So(j.referrer))==null?void 0:t.host)||Oc},void 0)}set_initial_person_info(){this.props[_p]||this.props[wp]||this.register_once({[Ec]:LE(this.qi.mask_personal_data_properties,this.qi.custom_personal_data_properties,this.qi.disable_capture_url_hashes)},void 0)}get_initial_props(){var t={};ve([wp,_p],i=>{var s=this.props[i];s&&ve(s,function(o,a){t["$initial_"+np(a)]=o})});var n=this.props[Ec];if(n){var r=function(i,s){s===void 0&&(s=!1);var o=jE(i,s),a={};return ve(o,function(l,u){a["$initial_"+np(u)]=l}),a}(n,this.qi.disable_capture_url_hashes);_e(t,r)}return t}safe_merge(t){return ve(this.props,function(n,r){r in t||(t[r]=n)}),t}update_config(t,n,r){var i=t.persistence!==n.persistence,s=!((p,y)=>{if(p.length!==y.length)return!1;var h=[...p].sort(),v=[...y].sort();return h.every((x,b)=>x===v[b])})(t.cookie_persisted_properties||[],n.cookie_persisted_properties||[]),o=i||s,a=t.cookieWinsOnConflict!==n.cookieWinsOnConflict,l=t.disable_persistence||!!r,u=!!this.Hs&&!l;l||this.Bs(n,u),this.qi=t,!l&&(i||s||a)&&(this.qs=void 0,this.js=void 0,this.Bs($({},t,{cookie_persisted_properties:n.cookie_persisted_properties}),u));var c=o||a?this.Ls(t):this.ps,d=this.$s(t),f=o||d!==this.Is,m=!l&&(f||t.cross_subdomain_cookie!==this.aa||t.secure_cookie!==this.oa)&&this.Ws(u);try{if(this.la=this.sa=t.cookie_expiration,this.set_disabled(l),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),f){var _=this.props;this.clear(),this.ps=c,this.Is=d,this.props=_,this.save()}else a&&(this.ps=c,l||(delete this.Ms[Rr],this.Zs()))}finally{m&&this.Qs()}}set_disabled(t){this.Hs=t,this.Hs?this.remove():this.save()}set_cross_subdomain(t){t!==this.aa&&(this.aa=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.oa&&(this.oa=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,n){var r=this.props[ca]||{};r[t]=n,this.Us(ca,r),this.save()}remove_event_timer(t){var n=this.props[ca]||{},r=n[t];return L(r)||(delete n[t],this.Us(ca,n),this.save()),r}get_property(t){return this.props[t]}set_property(t,n){this.Us(t,n),this.save()}Us(t,n){var r;this.props[t]=n,(r=An(t))!=null&&r.volatile||this.ua(t)}zs(t){delete this.props[t],this.ua(t)}ua(t){var n,r=(n=An(t))==null?void 0:n.storageGroup;r&&(this.Xs(r).dirty=!0)}Xs(t){return this.Ms[t]||(this.Ms[t]={})}}function eu(e){var t=!0;return{dispose(){if(t){t=!1;var n=e();n&&vt(n.then)&&n.then(void 0,()=>{})}}}}var Et={GZipJS:"gzip-js",Base64:"base64"},Xo={Activation:"events",Cancellation:"cancelEvents"},Cf={Popover:"popover",API:"api",Widget:"widget"},ur={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},kf={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},Pp={Popover:"popover",Inline:"inline"},eO={SHOWN:"product tour shown"},v_={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},g_=Ie("[RateLimiter]");class tO{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{var r=n.text;if(r&&r.length)try{(JSON.parse(r).quota_limited||[]).forEach(i=>{g_.info((i||"events")+" is quota limited."),this.serverLimits[i]=new Date().getTime()+6e4})}catch(i){return void g_.warn('could not rate limit - continuing. Error: "'+(i==null?void 0:i.message)+'"',{text:r})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return((t=this.instance.config.rate_limiting)==null?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max(((t=this.instance.config.rate_limiting)==null?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t){var n,r,i;t===void 0&&(t=!1);var s=this.captureEventsBurstLimit,o=this.captureEventsPerSecond,a=new Date().getTime(),l=(n=(r=this.instance.persistence)==null?void 0:r.get_property(yp))!==null&&n!==void 0?n:{tokens:s,last:a};l.tokens+=(a-l.last)/1e3*o,l.last=a,l.tokens>s&&(l.tokens=s);var u=1>l.tokens;if(u||t||(l.tokens=Math.max(0,l.tokens-1)),u&&!t){var c=(Ge(l.dropped)?l.dropped:0)+1;l.dropped=c,!this.lastEventRateLimited&&this.ha(c)&&(l.dropped=0)}return this.lastEventRateLimited=u,(i=this.instance.persistence)==null||i.set_property(yp,l),{isRateLimited:u,remainingTokens:l.tokens}}da(t){var n=this.instance.config.property_denylist;return!Z(n)||!n.includes(t)}va(){var t;if(this.da("$current_url")&&this.da("$pathname")&&Ae!=null&&Ae.pathname)return""+((t=Ae.origin)!==null&&t!==void 0?t:"")+Ae.pathname}ha(t){var n,r,i=this.captureEventsBurstLimit,s=this.captureEventsPerSecond,o=this.va(),a=this.da("$session_id")?(n=(r=this.instance).get_session_id)==null?void 0:n.call(r):void 0,l=[t+" event(s) dropped since the last warning",o?"triggered on "+o:void 0,a?"session "+a:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+l+". Config is set to "+s+" events per second and "+i+" events burst limit."},{skip_client_rate_limiting:!0})}isServerRateLimited(t){var n=this.serverLimits[t||"events"]||!1;return n!==!1&&new Date().getTime()t(this.remoteConfig)):t()}fa(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:t})}load(){try{if(this.remoteConfig)return Tr.info("Using preloaded remote config",this.remoteConfig),this.pa(this.remoteConfig),void this.ga();if(this._instance.ma())return void Tr.warn("Remote config is disabled. Falling back to local config.");this.ca(t=>{if(!t)return Tr.info("No config found after loading remote JS config. Falling back to JSON."),void this.fa(n=>{this.pa(n.json,n),this.ga()});this.pa(t),this.ga()})}catch(t){Tr.error("Error loading remote config",t),this.pa()}}stop(){this.ya&&(clearInterval(this.ya),this.ya=void 0)}refresh(){!this._instance.ma()&&j&&j.visibilityState!=="hidden"&&this._instance.reloadFeatureFlags()}ga(){var t;if(!this.ya){var n=(t=this._instance.config.remote_config_refresh_interval_ms)!==null&&t!==void 0?t:3e5;n!==0&&(this.ya=setInterval(()=>{this.refresh()},n))}}pa(t,n){!t&&n&&(n.statusCode===0?n.error||Tr.warn("Failed to fetch remote config from PostHog."):Tr.error("Failed to fetch remote config from PostHog."));try{this._instance.pa(t?{ok:!0,config:t}:{ok:!1})}catch(i){Tr.error("Error applying remote config",i)}if((t==null?void 0:t.hasFeatureFlags)!==!1&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var r;(r=this._instance.featureFlags)==null||r.ensureFlagsLoaded()}catch(i){Tr.error("Error loading feature flags",i)}}}var ln=Uint8Array,Lt=Uint16Array,Po=Uint32Array,Rg=new ln([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Tg=new ln([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),m_=new ln([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),UE=function(e,t){for(var n=new Lt(31),r=0;31>r;++r)n[r]=t+=1<r;++r)for(var s=n[r];n[r+1]>s;++s)i[s]=s-n[r]<<5|r;return[n,i]},VE=UE(Rg,2),Rp=VE[1];VE[0][28]=258,Rp[258]=28;for(var y_=UE(Tg,0)[1],BE=new Lt(32768),Ne=0;32768>Ne;++Ne){var ps=(43690&Ne)>>>1|(21845&Ne)<<1;BE[Ne]=((65280&(ps=(61680&(ps=(52428&ps)>>>2|(13107&ps)<<2))>>>4|(3855&ps)<<4))>>>8|(255&ps)<<8)>>>1}var Pa=function(e,t,n){for(var r=e.length,i=0,s=new Lt(t);r>i;++i)++s[e[i]-1];var o,a=new Lt(t);for(i=0;t>i;++i)a[i]=a[i-1]+s[i-1]<<1;for(o=new Lt(r),i=0;r>i;++i)o[i]=BE[a[e[i]-1]++]>>>15-e[i];return o},es=new ln(288);for(Ne=0;144>Ne;++Ne)es[Ne]=8;for(Ne=144;256>Ne;++Ne)es[Ne]=9;for(Ne=256;280>Ne;++Ne)es[Ne]=7;for(Ne=280;288>Ne;++Ne)es[Ne]=8;var Mc=new ln(32);for(Ne=0;32>Ne;++Ne)Mc[Ne]=5;var nO=Pa(es,9),rO=Pa(Mc,5),qE=function(e){return(e/8>>0)+(7&e&&1)},WE=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof Lt?Lt:e instanceof Po?Po:ln)(n-t);return r.set(e.subarray(t,n)),r},Qn=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8},Jo=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Pf=function(e,t){for(var n=[],r=0;e.length>r;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,s=n.slice();if(!i)return[new ln(0),0];if(i==1){var o=new ln(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(E,S){return E.f-S.f}),n.push({s:-1,f:25001});var a=n[0],l=n[1],u=0,c=1,d=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=i-1;)a=n[n[d].f>n[u].f?u++:d++],l=n[u!=c&&n[d].f>n[u].f?u++:d++],n[c++]={s:-1,f:a.f+l.f,l:a,r:l};var f=s[0].s;for(r=1;i>r;++r)s[r].s>f&&(f=s[r].s);var m=new Lt(f+1),_=Tp(n[c-1],m,0);if(_>t){r=0;var p=0,y=_-t,h=1<r;++r){var v=s[r].s;if(t>=m[v])break;p+=h-(1<<_-m[v]),m[v]=t}for(p>>>=y;p>0;){var x=s[r].s;t>m[x]?p-=1<=0&&p;--r){var b=s[r].s;m[b]==t&&(--m[b],++p)}_=t}return[new ln(m),_]},Tp=function(e,t,n){return e.s==-1?Math.max(Tp(e.l,t,n+1),Tp(e.r,t,n+1)):t[e.s]=n},__=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Lt(++t),r=0,i=e[0],s=1,o=function(l){n[r++]=l},a=1;t>=a;++a)if(e[a]==i&&a!=t)++s;else{if(!i&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(i),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(i);s=1,i=e[a]}return[n.subarray(0,r),t]},Zo=function(e,t){for(var n=0,r=0;t.length>r;++r)n+=e[r]*t[r];return n},Ip=function(e,t,n){var r=n.length,i=qE(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var s=0;r>s;++s)e[i+s+4]=n[s];return 8*(i+4+r)},w_=function(e,t,n,r,i,s,o,a,l,u,c){Qn(t,c++,n),++i[256];for(var d=Pf(i,15),f=d[0],m=d[1],_=Pf(s,15),p=_[0],y=_[1],h=__(f),v=h[0],x=h[1],b=__(p),E=b[0],S=b[1],P=new Lt(19),C=0;v.length>C;++C)P[31&v[C]]++;for(C=0;E.length>C;++C)P[31&E[C]]++;for(var T=Pf(P,7),R=T[0],N=T[1],M=19;M>4&&!R[m_[M-1]];--M);var z,F,W,B,Q=u+5<<3,O=Zo(i,es)+Zo(s,Mc)+o,A=Zo(i,f)+Zo(s,p)+o+14+3*M+Zo(P,R)+(2*P[16]+3*P[17]+7*P[18]);if(O>=Q&&A>=Q)return Ip(t,c,e.subarray(l,l+u));if(Qn(t,c,1+(O>A)),c+=2,O>A){z=Pa(f,m),F=f,W=Pa(p,y),B=p;var V=Pa(R,N);for(Qn(t,c,x-257),Qn(t,c+5,S-1),Qn(t,c+10,M-4),c+=14,C=0;M>C;++C)Qn(t,c+3*C,R[m_[C]]);c+=3*M;for(var K=[v,E],te=0;2>te;++te){var oe=K[te];for(C=0;oe.length>C;++C)Qn(t,c,V[de=31&oe[C]]),c+=R[de],de>15&&(Qn(t,c,oe[C]>>>5&127),c+=oe[C]>>>12)}}else z=nO,F=es,W=rO,B=Mc;for(C=0;a>C;++C)if(r[C]>255){var de;Jo(t,c,z[257+(de=r[C]>>>18&31)]),c+=F[de+257],de>7&&(Qn(t,c,r[C]>>>23&31),c+=Rg[de]);var be=31&r[C];Jo(t,c,W[be]),c+=B[be],be>3&&(Jo(t,c,r[C]>>>5&8191),c+=Tg[be])}else Jo(t,c,z[r[C]]),c+=F[r[C]];return Jo(t,c,z[256]),c+F[256]},iO=new Po([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),sO=function(){for(var e=new Po(256),t=0;256>t;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),Rf=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function oO(e,t){t===void 0&&(t={});var n=function(){var d=4294967295;return{p(f){for(var m=d,_=0;f.length>_;++_)m=sO[255&m^f[_]]^m>>>8;d=m},d(){return 4294967295^d}}}(),r=e.length;n.p(e);var i,s,o,a,l,u=(a=10+((i=t).filename&&i.filename.length+1||0),l=8,function(d,f,m,_,p,y){var h=d.length,v=new ln(_+h+5*(1+Math.floor(h/7e3))+p),x=v.subarray(_,v.length-p),b=0;if(!f||8>h)for(var E=0;h>=E;E+=65535){var S=E+65535;h>S?b=Ip(x,b,d.subarray(E,S)):(x[E]=!0,b=Ip(x,b,d.subarray(E,h)))}else{for(var P=iO[f-1],C=P>>>13,T=8191&P,R=(1<E;++E){var de=W(E),be=32767&E,Pe=M[de];if(N[be]=Pe,M[de]=be,E>=te){var Be=h-E;if((A>7e3||K>24576)&&Be>423){b=w_(d,x,0,B,Q,O,V,K,oe,E-oe,b),K=A=V=0,oe=E;for(var ye=0;286>ye;++ye)Q[ye]=0;for(ye=0;30>ye;++ye)O[ye]=0}var Fe=2,Tt=0,Sr=T,_t=be-Pe&32767;if(Be>2&&de==W(E-_t))for(var Ye=Math.min(C,Be)-1,gi=Math.min(32767,E),cs=Math.min(258,Be);gi>=_t&&--Sr&&be!=Pe;){if(d[E+Fe]==d[E+Fe-_t]){for(var It=0;cs>It&&d[E+It]==d[E+It-_t];++It);if(It>Fe){if(Fe=It,Tt=_t,It>Ye)break;var ds=Math.min(_t,It-2),Cr=0;for(ye=0;ds>ye;++ye){var pn=E-_t+ye+32768&32767,Do=pn-N[pn]+32768&32767;Do>Cr&&(Cr=Do,Pe=pn)}}}_t+=(be=Pe)-(Pe=N[be])+32768&32767}if(Tt){B[K++]=268435456|Rp[Fe]<<18|y_[Tt];var gm=31&Rp[Fe],mm=31&y_[Tt];V+=Rg[gm]+Tg[mm],++Q[257+gm],++O[mm],te=E+Fe,++A}else B[K++]=d[E],++Q[d[E]]}}b=w_(d,x,!0,B,Q,O,V,K,oe,E-oe,b)}return WE(v,0,_+qE(b)+p)}(s=e,(o=t).level==null?6:o.level,o.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):12+o.mem,a,l)),c=u.length;return function(d,f){var m=f.filename;if(d[0]=31,d[1]=139,d[2]=8,d[8]=2>f.level?4:f.level==9?2:0,d[9]=3,f.mtime!=0&&Rf(d,4,Math.floor(new Date(f.mtime||Date.now())/1e3)),m){d[3]=8;for(var _=0;m.length>=_;++_)d[_+10]=m.charCodeAt(_)}}(u,t),Rf(u,c-8,n.d()),Rf(u,c-4,r),u}var aO=!!Jh||!!fg,HE="text/plain",Ou=!1,GE=(e,t)=>{var n=e.split("#"),r=n[1],i=n[0].split("?"),s=i[0],o=i[1];if(!o)return e;var a=o.split("&").filter(l=>l.split("=")[0]!==t).join("&");return s+(a?"?"+a:"")+(r?"#"+r:"")},bl=function(e,t,n){var r;n===void 0&&(n=!0);var i=e.split("?"),s=i[0],o=i[1],a=$({},t),l=(r=o==null?void 0:o.split("&").map(c=>{var d,f=c.split("="),m=f[0],_=n&&(d=a[m])!==null&&d!==void 0?d:f[1];return delete a[m],m+"="+_}))!==null&&r!==void 0?r:[],u=function(c,d){var f,m;d===void 0&&(d="&");var _=[];return ve(c,function(p,y){L(p)||L(y)||y==="undefined"||(f=encodeURIComponent((h=>h instanceof File)(p)?p.name:p.toString()),m=encodeURIComponent(y),_[_.length]=m+"="+f)}),_.join(d)}(a);return u&&l.push(u),l.length>0?s+"?"+l.join("&"):s},Tf=e=>{if(e.ba)return e.ba;var t=e.data,n=e.compression;if(t){if(n===Et.GZipJS){var r=oO(function(a,l){var u=a.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(a);for(var c=new ln(a.length+(a.length>>>1)),d=0,f=function(y){c[d++]=y},m=0;u>m;++m){if(d+5>c.length){var _=new ln(d+8+(u-m<<1));_.set(c),c=_}var p=a.charCodeAt(m);128>p?f(p):2048>p?(f(192|p>>>6),f(128|63&p)):p>55295&&57344>p?(f(240|(p=65536+(1047552&p)|1023&a.charCodeAt(++m))>>>18),f(128|p>>>12&63),f(128|p>>>6&63),f(128|63&p)):(f(224|p>>>12),f(128|p>>>6&63),f(128|63&p))}return WE(c,0,d)}(js(t)),{mtime:0});return{contentType:HE,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===Et.Base64){var i=function(a){return a&&btoa(encodeURIComponent(a).replace(/%([0-9A-F]{2})/g,(l,u)=>String.fromCharCode(parseInt(u,16))))}(js(t)),s=(a=>"data="+encodeURIComponent(typeof a=="string"?a:js(a)))(i);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var o=js(t);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},KE=e=>{var t,n,r=()=>e.transport==="sendBeacon"?{url:bl(e.url,{compression:Et.Base64}),encodedBody:Tf($({},e,{compression:Et.Base64,ba:void 0}))}:{url:GE(e.url,"compression"),encodedBody:Tf($({},e,{compression:void 0,ba:void 0}))};try{t=Tf(e)}catch(i){if(Fy(e.compression,Co(e.url,"compression")))return D.error("Failed to gzip request body, sending uncompressed payload",i),r();throw i}return t&&Fy(e.compression,Co(e.url,"compression"))&&!((n=t.body)instanceof ArrayBuffer?Zh(new Uint8Array(n)):ArrayBuffer.isView(n)&&Zh(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)))?(Ou=!0,r()):{url:e.url,encodedBody:t}},QE=e=>{try{return KE(e)}catch(t){return D.error(t),void(e.callback==null||e.callback({statusCode:0,error:t}))}},lO=function(){var e=Ce(function*(t){var n=js(t.data),r=yield function(s,o,a){return ep.apply(this,arguments)}(n,Ee.DEBUG,{rethrow:!0});if(!r)return t;var i=yield r.arrayBuffer();return $({},t,{ba:{contentType:HE,body:i,estimatedSize:i.byteLength}})});return function(t){return e.apply(this,arguments)}}(),uO=/Failed to fetch|NetworkError|Load failed/i,YE=e=>(e==null?void 0:e.name)==="TypeError"&&uO.test((e==null?void 0:e.message)||""),XE=e=>{var t=QE(e);if(t){var n=t.url,r=t.encodedBody,i=r??{},s=i.contentType,o=i.body,a=i.estimatedSize,l=new Headers;ve(e.headers,function(_,p){l.append(p,_)}),s&&l.append("Content-Type",s);var u=null,c=!1;if(Iy){var d=new Iy;u={signal:d.signal,timeout:setTimeout(()=>{var _,p;c=!0,d.abort((_=e.timeout,(p=new Error("PostHog request timed out"+(_?" after "+_+"ms":""))).name="AbortError",p))},e.timeout)}}var f=_=>{c&&(_==null?void 0:_.name)==="AbortError"||YE(_)?D.warn(_):D.error(_),e.callback==null||e.callback({statusCode:0,error:_})};try{var m;fg(n,$({method:(e==null?void 0:e.method)||"GET",headers:l,keepalive:e.method==="POST"&&!e._a&&52428.8>(a||0),body:o,signal:(m=u)==null?void 0:m.signal},e.fetchOptions)).then(_=>_.text().then(p=>{var y={statusCode:_.status,text:p};if(_.status===200)try{y.json=JSON.parse(p)}catch(h){D.error(h)}e.callback==null||e.callback(y)})).catch(f).finally(()=>u?clearTimeout(u.timeout):null)}catch(_){u&&clearTimeout(u.timeout),f(_)}}},Op=e=>{try{var t,n=KE(e),r=n.url,i=n.encodedBody,s=i??{},o=s.body,a=s.estimatedSize;if(!o)return;var l=o instanceof Blob?o:new Blob([o],{type:s.contentType});if(St.sendBeacon(r,l))return;var u=Z(e.data)?e.data:(t=e.data)==null?void 0:t.batch;if(Z(u)&&u.length>1&&(a??0)>16384){var c=Math.ceil(u.length/2),d=f=>Z(e.data)?f:$({},e.data,{batch:f});return Op($({},e,{data:d(u.slice(0,c))})),void Op($({},e,{data:d(u.slice(c))}))}D.warn("Beacon of ~"+(a??0)+" bytes was rejected by the browser, falling back to fetch"),XE($({},e,{_a:!0}))}catch(f){D.warn("Beacon send failed",f)}},x_=(e,t,n,r)=>{var i=r==="query"?t==="POST"?"sent_at":"_":void 0;return bl(n===Et.GZipJS?GE(e,"compression"):e,$({},i?{[i]:Date.now().toString()}:{},n===Et.GZipJS?{}:{compression:n}))},Mu=[];fg&&Mu.push({transport:"fetch",method:XE}),Jh&&Mu.push({transport:"XHR",method(e){var t=QE(e);if(t){var n=new Jh,r=t.encodedBody;n.open(e.method||"GET",t.url,!0);var i=r??{},s=i.contentType,o=i.body;ve(e.headers,function(a,l){n.setRequestHeader(l,a)}),s&&n.setRequestHeader("Content-Type",s),e.timeout&&(n.timeout=e.timeout),n.onreadystatechange=()=>{if(n.readyState===4){var a={statusCode:n.status,text:n.responseText};if(n.status===200)try{a.json=JSON.parse(n.responseText)}catch{}e.callback==null||e.callback(a)}},n.send(o)}}}),St!=null&&St.sendBeacon&&Mu.push({transport:"sendBeacon",method:Op});var Mp=3e3;class cO{constructor(t,n){this.wa=!0,this.ka=[],this.Sa=Vn((n==null?void 0:n.flush_interval_ms)||Mp,250,5e3,D.createLogger("flush interval"),Mp),this.xa=t}enqueue(t){this.ka.push(t),this.Ca||this.Ta()}unload(){this.Ma();var t=this.ka.length>0?this.Ea():{},n=Object.values(t);[...n.filter(r=>r.url.indexOf("/e")===0),...n.filter(r=>r.url.indexOf("/e")!==0)].map(r=>{this.Ia($({},r,{transport:"sendBeacon"}))})}enable(){this.wa=!1,this.Ta()}Ta(){var t=this;this.wa||(this.Ca=setTimeout(()=>{if(this.Ma(),this.ka.length>0){var n=this.Ea(),r=function(){var s=n[i],o=new Date().getTime();s.data&&Z(s.data)&&ve(s.data,a=>{a.offset=Math.abs(a.timestamp-o),delete a.timestamp}),t.Ia(s)};for(var i in n)r()}},this.Sa))}Ia(t){try{this.xa(t)}catch(n){D.error(n)}}Ma(){clearTimeout(this.Ca),this.Ca=void 0}Ea(){var t={};return ve(this.ka,n=>{var r,i=n,s=(i?i.batchKey:null)||i.url;L(t[s])&&(t[s]=$({},i,{data:[]})),(r=t[s].data)==null||r.push(i.data)}),this.ka=[],t}}var dO=["retriesPerformedSoFar"];class fO{constructor(t){this.Ra=!1,this.Pa=3e3,this.ka=[],this._instance=t,this.ka=[],this.Aa=!0,!L(I)&&"onLine"in I.navigator&&(this.Aa=I.navigator.onLine,this.Fa=()=>{this.Aa=!0,this.Oa()},this.La=()=>{this.Aa=!1},Re(I,"online",this.Fa),Re(I,"offline",this.La))}get length(){return this.ka.length}retriableRequest(t){var n=t.retriesPerformedSoFar,r=xb(t,dO);Jn(n)&&(r.url=bl(r.url,{retry_count:n})),this._instance._send_request($({},r,{callback:i=>{if(i.statusCode!==200&&(400>i.statusCode||i.statusCode>=500)){if((i.statusCode===0?3:10)>(n??0))return void this.xn($({retriesPerformedSoFar:n},r));i.statusCode===0&&D.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(n??0)+" retries.")}r.callback==null||r.callback(i)}}))}xn(t){var n=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=n+1;var r=function(o){var a=3e3*Math.pow(2,o),l=a/2,u=Math.min(18e5,a),c=Math.random()-.5;return Math.ceil(u+c*(u-l))}(n),i=Date.now()+r;this.ka.push({retryAt:i,requestOptions:t});var s="Enqueued failed request for retry in "+r;navigator.onLine||(s+=" (Browser is offline)"),D.warn(s),this.Ra||(this.Ra=!0,this.$a())}$a(){if(this.Da&&clearTimeout(this.Da),this.ka.length===0)return this.Ra=!1,void(this.Da=void 0);this.Da=setTimeout(()=>{this.Aa&&this.ka.length>0&&this.Oa(),this.$a()},this.Pa)}Oa(){var t=Date.now(),n=[],r=this.ka.filter(s=>t>s.retryAt||(n.push(s),!1));if(this.ka=n,r.length>0)for(var i of r)this.retriableRequest(i.requestOptions)}unload(){for(var t of(this.Da&&(clearTimeout(this.Da),this.Da=void 0),this.Ra=!1,L(I)||(this.Fa&&(I.removeEventListener("online",this.Fa),this.Fa=void 0),this.La&&(I.removeEventListener("offline",this.La),this.La=void 0)),this.ka)){var n=t.requestOptions;try{this._instance._send_request($({},n,{transport:"sendBeacon"}))}catch(r){D.error(r)}}this.ka=[]}}class hO{constructor(t){this.Na=()=>{var n,r,i,s;this.qa||(this.qa={});var o=this.scrollElement(),a=this.scrollY(),l=o?Math.max(0,o.scrollHeight-o.clientHeight):0,u=a+((o==null?void 0:o.clientHeight)||0),c=(o==null?void 0:o.scrollHeight)||0;this.qa.lastScrollY=Math.ceil(a),this.qa.maxScrollY=Math.max(a,(n=this.qa.maxScrollY)!==null&&n!==void 0?n:0),this.qa.maxScrollHeight=Math.max(l,(r=this.qa.maxScrollHeight)!==null&&r!==void 0?r:0),this.qa.lastContentY=u,this.qa.maxContentY=Math.max(u,(i=this.qa.maxContentY)!==null&&i!==void 0?i:0),this.qa.maxContentHeight=Math.max(c,(s=this.qa.maxContentHeight)!==null&&s!==void 0?s:0)},this._instance=t}get ja(){return this._instance.config.scroll_root_selector}getContext(){return this.qa}resetContext(){var t=this.qa;return setTimeout(this.Na,0),t}startMeasuringScrollPosition(){Re(I,"scroll",this.Na,{capture:!0}),Re(I,"scrollend",this.Na,{capture:!0}),Re(I,"resize",this.Na)}scrollElement(){if(!this.ja)return I==null?void 0:I.document.documentElement;var t=Z(this.ja)?this.ja:[this.ja];for(var n of t){var r=I==null?void 0:I.document.querySelector(n);if(r)return r}}Ba(t){var n=t==="y"?"scrollTop":"scrollLeft";if(this.ja){var r=this.scrollElement();return r&&r[n]||0}return I?t==="y"?I.scrollY||I.pageYOffset||I.document.documentElement.scrollTop||0:I.scrollX||I.pageXOffset||I.document.documentElement.scrollLeft||0:0}scrollY(){return this.Ba("y")}scrollX(){return this.Ba("x")}}var pO=e=>LE(e==null?void 0:e.config.mask_personal_data_properties,e==null?void 0:e.config.custom_personal_data_properties,e==null?void 0:e.config.disable_capture_url_hashes);class b_{constructor(t,n,r,i){this.ot=s=>{var o=this.Ha();if(!o||o.sessionId!==s){var a={sessionId:s,props:this.Ua(this._instance)};this.za.register({[mp]:a})}},this._instance=t,this.Wa=n,this.za=r,this.Ua=i||pO,this.Wa.onSessionId(this.ot)}Ha(){return this.za.props[mp]}getSetOnceProps(){var t,n=(t=this.Ha())==null?void 0:t.props;return n?"r"in n?jE(n,this._instance.config.disable_capture_url_hashes):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var t={};return ve(Sg(this.getSetOnceProps()),(n,r)=>{r==="$current_url"&&(r="url"),t["$session_entry_"+np(r)]=n}),t}}class Ac{on(t,n){return this.Va[t]||(this.Va[t]=[]),this.Va[t].push(n),()=>{this.Va[t]=this.Va[t].filter(r=>r!==n)}}emit(t,n){for(var r of this.Va[t]||[])r(n);for(var i of this.Va["*"]||[])i(t,n)}constructor(){this.Va={}}}var vs=Ie("[SessionId]"),E_=864e5;class S_{on(t,n){return this.Ga.on(t,n)}constructor(t,n,r){var i;if(this.Za=null,this.Qa=null,this.Ja=[],this.Ka=void 0,this.Ya=!1,this.Ga=new Ac,this.Xa=(l,u)=>!(!Jn(l)||!Jn(u))&&Math.abs(l-u)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===lr)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.qi=t.config,this.za=t.persistence,this.st=void 0,this._e=void 0,this._sessionStartTimestamp=null,this.eo=void 0,this._sessionActivityTimestamp=null,this.io=n||$n,this.ro=r||$n;var s=this.qi.persistence_name||this.qi.token;if(this._sessionTimeoutMs=1e3*Vn(this.qi.session_idle_timeout_seconds||1800,60,36e3,vs.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.no(),this.so="ph_"+s+"_window_id",this.ao="ph_"+s+"_primary_window_exists",this.oo()){var o=we.Br(this.so),a=we.Br(this.ao);o&&!a?this.st=o:we.qr(this.so),we.Nr(this.ao,!0)}(i=this.qi.bootstrap)!=null&&i.sessionID&&this.setBootstrapSessionId(this.qi.bootstrap.sessionID),this.lo()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return L(this.Ja)&&(this.Ja=[]),this.Ja.push(t),this._e&&t(this._e,this.st),()=>{this.Ja=this.Ja.filter(n=>n!==t)}}oo(){return this.qi.persistence!=="memory"&&!this.za.Hs&&we.Dr()}uo(t){t!==this.st&&(this.st=t,this.oo()&&we.Nr(this.so,t))}ho(){return this.st?this.st:this.oo()?we.Br(this.so):null}do(t){var n=this.Za;return!rt(n)&&!rt(t)&&5e3>Math.abs(t-n)}vo(t,n,r){var i=n!==this._sessionActivityTimestamp,s=!(t!==this._e||r!==this._sessionStartTimestamp);this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this._e=t,s&&!i||s&&this.do(n)||(this.Za=n,this.za.register({[Ls]:[n,t,r]}))}co(){var t,n=(t=this.qi)==null?void 0:t.persistence_save_debounce_ms;return Jn(n)&&n>0}fo(){this.co()?this.za.refreshKey(Ls):(this.za.flush(),this.za.load())}po(){var t;if(!rt(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Za){this.fo();var n=this.mo();n[1]===this._e&&n[2]===this._sessionStartTimestamp&&(this.Za=this._sessionActivityTimestamp,this.za.register({[Ls]:[this._sessionActivityTimestamp,(t=this._e)!==null&&t!==void 0?t:null,this._sessionStartTimestamp]}),this.za.flush())}}yo(){var t=this.mo()[0],n=Jn(t)?t:0,r=Jn(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(n,r)}bo(t){return this.fo(),this.Xa(t,this.yo())}mo(){var t=this.za.props[Ls];return Z(t)&&t.length===2&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Za=null,this.eo=void 0,clearTimeout(this._o),this._o=void 0,this.vo(null,null,null)}setBootstrapSessionId(t,n){n===void 0&&(n=!1);var r=function(i,s){s===void 0&&(s=new Date().getTime());try{var o=(a=>{var l=a.replace(/-/g,"");if(l.length!==32)throw new Error("Not a valid UUID");if(l[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(l.substring(0,12),16)})(i);return o>s+6e4?void vs.error("Bootstrap sessionID cannot be in the future"):o}catch(a){return void vs.error("Invalid sessionID in bootstrap",a)}}(t);return!L(r)&&(n?this.eo={sessionId:t,sessionStartTimestamp:r}:this.vo(t,new Date().getTime(),r),!0)}destroy(){this.Ya=!0,this.po(),clearTimeout(this._o),this._o=void 0,this.Ka&&I&&(I.removeEventListener(kc,this.Ka,{capture:!1}),this.Ka=void 0),this.Ja=[]}lo(){this.Ka=()=>{this.po(),this.oo()&&we.qr(this.ao)},Re(I,kc,this.Ka,{capture:!1})}checkAndGetSessionAndWindowId(t,n,r){if(t===void 0&&(t=!1),n===void 0&&(n=null),r===void 0&&(r=!1),this.qi.cookieless_mode===lr)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=n||new Date().getTime(),s=this._e;if(r)this.Qa=i;else if(rt(this.Qa)||this.Qa>i||i-this.Qa>=1e3){var o,a;(o=(a=this.za).syncCookieProperties)==null||o.call(a),this.Qa=i}var l=this.mo(),u=l[1],c=l[2],d=!L(s)&&u!==s,f=this.yo(),m=this.ho(),_=this.eo,p=!!_&&(_.sessionStartTimestamp>i+6e4||i-_.sessionStartTimestamp>E_),y=_?p:Jn(c)&&Math.abs(i-c)>E_,h=!1,v=d,x=!u||!!_,b=u,E=!x&&!t&&this.Xa(i,f);if(E){(E=this.bo(i))||vs.info("cross-tab refresh kept the session alive",{sessionId:u});var S=this.mo();u=S[1],c=S[2]}if(x||E||y){v=!1;var P=_&&!p;u=P?_.sessionId:this.io(),m=this.ro(),vs.info("new session ID assigned",{sessionId:u,windowId:m,bootstrapped:!!P,changeReason:{noSessionId:x,activityTimeout:E,sessionPastMaximumLength:y}}),c=P?_.sessionStartTimestamp:i,this.eo=void 0,h=!0}else m||(m=this.ro(),h=!0),(v=v||u!==b)&&(vs.info("adopted cross-tab session id",{sessionId:u,windowId:m}),h=!0);var C=Jn(f)&&t&&!y?f:i,T=Jn(c)?c:new Date().getTime();this.uo(m),this.vo(u,C,T),t||this.no();var R={noSessionId:x,activityTimeout:E,sessionPastMaximumLength:y,crossTabAdoption:v};return h&&this.Ja.forEach(N=>N(u,m,R)),{sessionId:u,windowId:m,sessionStartTimestamp:T,changeReason:h?R:void 0,lastActivityTimestamp:f}}no(){this.Ya||(clearTimeout(this._o),this._o=setTimeout(()=>{if(!this.Ya)if(this.bo(new Date().getTime())){var t=this._e;this.resetSessionId(),this.Ga.emit("forcedIdleReset",{idleSessionId:t})}else this.no()},1.1*this.sessionTimeoutMs))}}var JE=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&jy(n,t))return!0;try{var r=e==null?void 0:e.userAgentData;if(r!=null&&r.brands&&r.brands.some(i=>jy(i==null?void 0:i.brand,t)))return!0}catch{}return!!e.webdriver};function ZE(){return(ZE=Ce(function*(){var e=St==null?void 0:St.userAgentData;if(e!=null&&e.getHighEntropyValues)try{var t=yield e.getHighEntropyValues(["model"]),n=t==null?void 0:t.model;return ce(n)&&n.length>0?n:void 0}catch(r){return void D.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",r)}})).apply(this,arguments)}var Nc=function(e,t){if(!function(n){try{new RegExp(n)}catch{return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}};function If(e,t,n){return js({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}var eS={exact:(e,t)=>t.some(n=>e.some(r=>n===r)),is_not:(e,t)=>t.every(n=>e.every(r=>n!==r)),regex:(e,t)=>t.some(n=>e.some(r=>Nc(n,r))),not_regex:(e,t)=>t.every(n=>e.every(r=>!Nc(n,r))),icontains:(e,t)=>t.map(tu).some(n=>e.map(tu).some(r=>n.includes(r))),not_icontains:(e,t)=>t.map(tu).every(n=>e.map(tu).every(r=>!n.includes(r))),gt:(e,t)=>t.some(n=>{var r=parseFloat(n);return!isNaN(r)&&e.some(i=>r>parseFloat(i))}),lt:(e,t)=>t.some(n=>{var r=parseFloat(n);return!isNaN(r)&&e.some(i=>re.toLowerCase();function tS(e,t){return!e||Object.entries(e).every(n=>{var r=n[1],i=t==null?void 0:t[n[0]];if(L(i)||rt(i))return!1;var s=[String(i)],o=eS[r.operator];return!!o&&o(r.values,s)})}var Ap="custom",C_="i.posthog.com",vO=/^\/static\//,gO=["/s/","/e/","/i/"];class mO{constructor(t){this.wo={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return t==="https://app.posthog.com"?"https://us.i.posthog.com":t}get flagsApiHost(){var t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t,n=(t=this.instance.config.ui_host)==null?void 0:t.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+C_,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.wo[this.apiHost]||(this.wo[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":Ap),this.wo[this.apiHost]}ko(t){if(vO.test(t)){var n=this.instance.config.asset_host;if(typeof n=="string")return n.trim().replace(/\/$/,"")||void 0}}So(t){var n=So(t);return n?n.protocol+"//"+n.host+n.pathname:void 0}xo(t,n,r){if(t==="ui")return r;var i=r,s=this.instance.config.rewriteRequestPath;if(s){var o,a=((o=So(r))==null?void 0:o.href)||r;i=s(new URL(a)).toString()}if(s&&t==="api"&&gO.some(f=>n.indexOf(f)===0)){var l=this.So(i);if(l){var u,c=this.apiHost,d=this.Co;((u=d)==null?void 0:u.apiHost)===c&&d.rewriteRequestPath===s||(d={apiHost:c,rewriteRequestPath:s,urls:new Set},this.Co=d),d.urls.add(l)}}return i}isIngestionEndpoint(t){var n=this.Co,r=this.So(t);return(n==null?void 0:n.apiHost)===this.apiHost&&n.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!r&&n.urls.has(r)}endpointFor(t,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),t==="ui")return this.xo(t,n,this.uiHost+n);if(t==="flags")return this.xo(t,n,this.flagsApiHost+n);if(t==="assets"){var r=this.ko(n);if(r)return this.xo(t,n,""+r+n)}if(this.region===Ap)return this.xo(t,n,this.apiHost+n);var i=C_+n;switch(t){case"assets":return this.xo(t,n,"https://"+this.region+"-assets."+i);case"api":return this.xo(t,n,"https://"+this.region+"."+i)}}}function nS(e){var t;return!((t=e.conditions)==null||(t=t.events)==null||(t=t.values)==null||!t.length)}var he=Ie("[Surveys]"),rS="seenSurvey_",iS=e=>{try{var t=(n=>((r,i)=>""+rS+function(s){return s.current_iteration&&s.current_iteration>0?s.id+"_"+s.current_iteration:s.id}(i))(0,n))(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(n){he.error("Failed to persist survey seen state",n)}},yO=[Cf.Popover,Cf.Widget,Cf.API],_O={ignoreConditions:!1,ignoreDelay:!1,displayType:Pp.Popover},wO=Ie("[PostHog ExternalIntegrations]"),xO={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class bO{constructor(t){this._instance=t}_s(t,n){var r;(r=Y.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,t,i=>{if(i)return wO.error("failed to load script",i);n()})}startIfEnabledOrStop(){var t=this,n=function(){var s,o,a,l=r[0],u=r[1];!u||(s=Y.__PosthogExtensions__)!=null&&(s=s.integrations)!=null&&s[l]||t._s(xO[l],()=>{var c;(c=Y.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[l])==null||c.start(t._instance)}),!u&&(o=Y.__PosthogExtensions__)!=null&&(o=o.integrations)!=null&&o[l]&&((a=Y.__PosthogExtensions__)==null||(a=a.integrations)==null||(a=a[l])==null||a.stop())};for(var r of Object.entries((i=this._instance.config.integrations)!==null&&i!==void 0?i:{})){var i;n()}}}class EO{constructor(t,n){this.I=t,this.ns=n,this.To=new Map,this.Xn=!1}add(t){var n=this;return Ce(function*(){if(n.Xn)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(n.To.has(t.name))throw new Error('Browser extension "'+t.name+'" is already registered');n.To.set(t.name,t);try{var r=t.setup(n.ns);r&&(yield r)}catch(s){var i=n.To.get(t.name)===t;i&&n.To.delete(t.name),n.I.error('Failed to set up browser extension "'+t.name+'"',s),i&&n.Mo(t)}})()}dispose(){if(!this.Xn){this.Xn=!0;var t=Array.from(this.To.values()).reverse();for(var n of(this.To.clear(),t))this.Mo(n)}}Mo(t){try{var n=t.dispose==null?void 0:t.dispose();n&&vt(n.then)&&n.then(void 0,r=>{this.I.error('Failed to dispose browser extension "'+t.name+'"',r)})}catch(r){this.I.error('Failed to dispose browser extension "'+t.name+'"',r)}}}class SO{constructor(t){this._instance=t}initialize(){}get(t){var n=this._instance.persistence;if(typeof t=="string")return n==null?void 0:n.get_property(t);var r={};for(var i of t){var s=n==null?void 0:n.get_property(i);L(s)||(r[i]=s)}return r}set(t,n){var r;(r=this._instance.persistence)==null||r.register(typeof t=="string"?{[t]:n}:t)}remove(t){var n;(n=this._instance.persistence)==null||n.unregister(t)}}var k_="extensionsRemoteConfig";class CO{constructor(t){this.Xn=!1,this.instance=t,this.I=D,this.Eo=t.Io,this.kv=new SO(t),this.onEvent=n=>eu(this.instance.on("eventCaptured",r=>{try{n({event:r.event,properties:r.properties})}catch(i){this.I.error("Browser extension event listener failed",i)}})),this.onRemoteConfig=n=>{if(this.Xn)return eu(()=>{});var r=s=>{try{n(s)}catch(o){this.I.error("Browser extension remote config listener failed",o)}},i=this.instance.Ro.on(k_,r);return this.Eo&&r(this.Eo),eu(i)},this.Po=new EO(D.createLogger("[BrowserExtensions]"),this)}get logger(){return this.I}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var t;return(t=this.instance.get_property(Ya))!==null&&t!==void 0?t:this.distinctId}get deviceId(){var t=this.instance.get_property(Ya);return typeof t=="string"?t:void 0}get library(){return{name:Ee.LIB_NAME,version:Ee.LIB_VERSION}}get initialPersonProperties(){var t,n;return(t=(n=this.instance.persistence)==null?void 0:n.get_initial_props())!==null&&t!==void 0?t:{}}get groups(){return this.instance.getGroups()}get session(){try{var t,n,r,i,s=(t=this.instance.sessionManager)==null?void 0:t.checkAndGetSessionAndWindowId(!0);return{sessionId:(n=s==null?void 0:s.sessionId)!==null&&n!==void 0?n:"",windowId:(r=s==null?void 0:s.windowId)!==null&&r!==void 0?r:"",sessionStartTimestamp:(i=s==null?void 0:s.sessionStartTimestamp)!==null&&i!==void 0?i:0}}catch{return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get projectToken(){return this.instance.config.token}add(t){return this.Po.add(t)}capture(t,n,r){var i=this;return Ce(function*(){r?i.instance.capture(t,n,{timestamp:r.timestamp,uuid:r.uuid,$set:r.set,$set_once:r.setOnce}):i.instance.capture(t,n)})()}registerDynamicEventProperties(t){return eu(this.instance.Ao(t))}handleRemoteConfig(t){this.Xn||(this.Eo=t,this.instance.Ro.emit(k_,t))}sendRequest(t,n){var r=this;return Ce(function*(){var i;n===void 0&&(n={});var s=r.instance.requestRouter.endpointFor((i=n.target)!==null&&i!==void 0?i:"api",t),o={method:n.method,url:n.query?bl(s,n.query):s,data:n.body,headers:n.headers,timeout:n.timeoutMs,fireCallbackOnDrop:!0,transport:n.transport,compression:n.compression,timestampMode:n.sentAt};return n.transport==="sendBeacon"?(r.instance._send_request(o),{statusCode:202}):new Promise(a=>{o.callback=a,r.instance._send_request(o)})})()}dispose(){this.Xn||(this.Xn=!0,this.Po.dispose())}}var Ra={},Of=0,Ta=()=>{},P_='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',ea="Surveys module not available",R_="sanitize_properties is deprecated. Use before_send instead",sS="Invalid value for property_denylist config: ",kO=["token","distinct_id",dE],Es="posthog",oS=!aO&&(Mt==null?void 0:Mt.indexOf("MSIE"))===-1&&(Mt==null?void 0:Mt.indexOf("Mozilla"))===-1,Mf=e=>{var t;return $({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:kI(j==null?void 0:j.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Ta,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:e??"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:Ae&&ce(Ae==null?void 0:Ae.search)&&Ae.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:(I==null||(t=I.location)==null?void 0:t.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(n){D.error("Bad HTTP status: "+n.statusCode+" "+n.text)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:bp,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:Mp},error_tracking:{},_onCapture:Ta},(n=>({rageclick:n&&n>="2026-05-30"?{content_ignorelist:jI,ignore_text_selection:!0}:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:n&&n>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:n&&n>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:n&&n>="2026-05-30"?250:0,split_storage:!(!n||"2026-05-30">n),detect_google_search_app:!(!n||"2026-05-30">n),disable_capture_url_hashes:!(!n||"2026-06-25">n),cookieWinsOnConflict:!(!n||n==="unset"||"2026-08-29">n)}))(e))},PO=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],T_=e=>{var t={};for(var n of PO){var r=n[0],i=n[1];L(e[r])||(t[i]=e[r])}var s=_e({},t,e),o=e.__preview_external_dependency_versioned_paths;return L(o)||(L(e.strict_script_versioning)&&(s.strict_script_versioning=!!o),ce(o)&&L(e.asset_host)&&(s.asset_host=o)),Z(e.property_blacklist)&&(L(e.property_denylist)?s.property_denylist=e.property_blacklist:Z(e.property_denylist)?s.property_denylist=[...e.property_blacklist,...e.property_denylist]:D.error(sS+e.property_denylist)),s};class RO{constructor(){this.__forceAllowLocalhost=!1}get Fo(){return this.__forceAllowLocalhost}set Fo(t){D.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class qt{Oo(t,n){if(t){var r=this.To.indexOf(t);r!==-1&&this.To.splice(r,1)}return this.To.push(n),n.initialize==null||n.initialize(),n}Lo(){return this.config.cookieless_mode===lr||this.config.cookieless_mode===ki&&this.consent.isRejected()}$o(){if(!this.Lo()&&this.get_distinct_id()===hs){var t=this.persistence;if(t){this.Do()||t.load(!0);var n=this.get_distinct_id();if(!n||n===hs){var r=this.config.get_device_id($n());this.register({distinct_id:r,$device_id:r}),t.set_property(se,We)}this.No()}}}get decideEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}get flagsEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}constructor(){var t;this.webPerformance=new RO,this.qo=!1,this.version=Ee.LIB_VERSION,this.jo=new Set,this.Bo="",this.Ro=new Ac,this.To=[],this.Ho=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Mf(),this.SentryIntegration=HI,this.sentryIntegration=r=>function(i,s){var o=IE(i,s);return{name:TE,processEvent:a=>o(a)}}(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Uo=!1,this.zo=null,this.Wo=null,this.Vo=null,this.scrollManager=new hO(this),this.pageViewManager=new f_(this),this.rateLimiter=new tO(this),this.requestRouter=new mO(this),this.consent=new AI(this),this.externalIntegrations=new bO(this);var n=(t=qt.__defaultExtensionClasses)!==null&&t!==void 0?t:{};this.featureFlags=n.featureFlags&&new n.featureFlags(this),this.toolbar=n.toolbar&&new n.toolbar(this),this.surveys=n.surveys&&new n.surveys(this),this.conversations=n.conversations&&new n.conversations(this),this.logs=n.logs&&new n.logs(this),this.metrics=n.metrics&&new n.metrics(this),this.experiments=n.experiments&&new n.experiments(this),this.exceptions=n.exceptions&&new n.exceptions(this),this.people={set:(r,i,s)=>{var o=ce(r)?{[r]:i}:r;this.setPersonProperties(o),s==null||s({})},set_once:(r,i,s)=>{var o=ce(r)?{[r]:i}:r;this.setPersonProperties(void 0,o),s==null||s({})}},this.on("eventCaptured",r=>D.info('send "'+(r==null?void 0:r.event)+'"',r))}init(t,n,r){if(r&&r!==Es){var i,s=(i=Ra[r])!==null&&i!==void 0?i:new qt;return s._init(t,n,r),Ra[r]=s,Ra[Es][r]=s,s}return this._init(t,n,r)}_init(t,n,r){var i,s;n===void 0&&(n={});var o,a=ce(t)?t.trim():"";if(!a)return D.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return a!==((o=this.config)==null?void 0:o.token)?console.warn("[PostHog.js]","You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('"+a+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=Mf(n.defaults),n.debug=this.Go(n.debug),this.Zo=n,this.Qo=[],n.person_profiles?this.Wo=n.person_profiles:n.process_person&&(this.Wo=n.process_person);var l=Mf(n.defaults),u=T_(n),c=_e({},l,u,{name:r,token:a});Se(l.rageclick)&&Se(u.rageclick)&&(c.rageclick=_e({},l.rageclick,u.rageclick)),Se(l.session_recording)&&Se(u.session_recording)&&(c.session_recording=_e({},l.session_recording,u.session_recording)),this.set_config(c),this.config.on_xhr_error&&D.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:Et.GZipJS;var d=this.Do();if(this.persistence=new Sf(this.config,d),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Sf($({},this.config,{persistence:"sessionStorage"}),d,!1),this.Bo="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties",this.config.persistence!=="memory"&&!d&&we.Dr()){var f=we.Br(this.Bo);Z(f)&&f.forEach(S=>{ce(S)&&this.jo.add(S)})}else we.qr(this.Bo);var m=$({},this.persistence.props),_=$({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Jo=new cO(S=>this.Ko(S),this.config.request_queue_config),this.Yo=new fO(this),this.__request_queue=[];var p=this.Lo();if(p||(this.sessionManager=new S_(this),this.sessionPropsManager=new b_(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((S,P,C)=>{(C!=null&&C.activityTimeout||C!=null&&C.sessionPastMaximumLength||C!=null&&C.crossTabAdoption)&&this.Xo()})),this.tl(),this.config.__preview_deferred_init_extensions?(D.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.el(p)},0)):(D.info("Initializing extensions synchronously"),this.el(p)),Ee.DEBUG=Ee.DEBUG||this.config.debug,Ee.DEBUG&&D.info("Starting in debug mode",{this:this,config:n,thisC:$({},this.config),p:m,s:_}),!this.config.identity_distinct_id||(i=n.bootstrap)!=null&&i.distinctID||(n.bootstrap=$({},n.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),((s=n.bootstrap)==null?void 0:s.distinctID)!==void 0){var y=n.bootstrap.distinctID,h=this.get_distinct_id(),v=this.persistence.get_property(se);if(n.bootstrap.isIdentifiedID&&h!=null&&h!==y&&v===We)this.identify(y);else if(n.bootstrap.isIdentifiedID&&h!=null&&h!==y&&v===ot)D.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var x=this.config.get_device_id($n()),b=n.bootstrap.isIdentifiedID?x:y;this.persistence.set_property(se,n.bootstrap.isIdentifiedID?ot:We),this.register({distinct_id:y,$device_id:b})}}if(p)this.register_once({distinct_id:hs,$device_id:null},"");else if(!this.get_distinct_id()){var E=this.config.get_device_id($n());this.register_once({distinct_id:E,$device_id:E},""),this.persistence.set_property(se,We)}return Re(I,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),n.segment?function(S,P){var C=S.config.segment;if(!C)return P();(function(T,R){var N=T.config.segment;if(!N)return R();var M=F=>{var W=()=>F.anonymousId()||$n();T.config.get_device_id=W,F.id()&&(T.register({distinct_id:F.id(),$device_id:W()}),T.persistence.set_property(se,ot)),R()},z=N.user();"then"in z&&vt(z.then)?z.then(M):M(z)})(S,()=>{C.register((T=>{typeof Promise<"u"&&Promise.resolve||bf.warn("This browser does not have Promise support, and can not use the segment integration");var R=(N,M)=>{if(!M)return N;N.event.userId||N.event.anonymousId===T.get_distinct_id()||(bf.info("No userId set, resetting PostHog"),T.reset()),N.event.userId&&N.event.userId!==T.get_distinct_id()&&(bf.info("UserId set, identifying with PostHog"),T.identify(N.event.userId));var z=T.calculateEventProperties(M,N.event.properties);return N.event.properties=Object.assign({},z,N.event.properties),N};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:N=>R(N,N.event.event),page:N=>R(N,bs),identify:N=>R(N,gf),screen:N=>R(N,"$screen")}})(S)).then(()=>{P()})})}(this,()=>this.il()):this.il(),vt(this.config._onCapture)&&this.config._onCapture!==Ta&&(D.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",S=>this.config._onCapture(S.event,S))),this.config.ip&&D.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||function(){return ZE.apply(this,arguments)}().then(S=>{S&&this.register({[pf]:S})}).catch(Ta),this}rl(t){var n=t;return ce(n.name)&&vt(n.setup)}nl(t,n){this.rl(t)?n.push(()=>{this.sl().add(t).catch(Ta)}):this.To.push(t)}tl(){var t,n,r,i,s,o,a=(t=(n=this.config.__extensionClasses)==null?void 0:n.featureFlags)!==null&&t!==void 0?t:(r=qt.__defaultExtensionClasses)==null?void 0:r.featureFlags;a&&(this.featureFlags&&this.featureFlags instanceof a||((i=this.al)==null||i.call(this),this.al=void 0,this.featureFlags=new a(this)),vt(this.featureFlags.onReloading)&&vt(this.featureFlags.setup)?this.al||(this.al=this.featureFlags.onReloading(()=>{this.Ro.emit("featureFlagsReloading",!0)}),this.sl().add(this.featureFlags)):(s=(o=this.featureFlags).initialize)==null||s.call(o))}el(t){var n,r,i,s,o,a,l,u=performance.now(),c=$({},qt.__defaultExtensionClasses,this.config.__extensionClasses),d=[];c.exceptions&&this.To.push(this.exceptions=(n=this.exceptions)!==null&&n!==void 0?n:new c.exceptions(this)),c.historyAutocapture&&this.To.push(this.historyAutocapture=new c.historyAutocapture(this)),c.tracingHeaders&&this.To.push(this.tracingHeaders=new c.tracingHeaders(this)),c.siteApps&&this.To.push(this.siteApps=new c.siteApps(this)),c.sessionRecording&&!t&&this.To.push(this.sessionRecording=new c.sessionRecording(this)),this.config.disable_scroll_properties||d.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),c.autocapture&&this.nl(this.autocapture=new c.autocapture(this),d),c.surveys&&this.nl(this.surveys=(r=this.surveys)!==null&&r!==void 0?r:new c.surveys(this),d),c.logs&&this.To.push(this.logs=(i=this.logs)!==null&&i!==void 0?i:new c.logs(this)),c.metrics&&this.To.push(this.metrics=(s=this.metrics)!==null&&s!==void 0?s:new c.metrics(this)),c.conversations&&this.To.push(this.conversations=(o=this.conversations)!==null&&o!==void 0?o:new c.conversations(this)),c.productTours&&this.To.push(this.productTours=new c.productTours(this)),c.heatmaps&&this.To.push(this.heatmaps=new c.heatmaps(this)),c.webVitalsAutocapture&&this.To.push(this.webVitalsAutocapture=new c.webVitalsAutocapture(this)),c.exceptionObserver&&this.To.push(this.exceptionObserver=new c.exceptionObserver(this)),c.deadClicksAutocapture&&this.To.push(this.deadClicksAutocapture=new c.deadClicksAutocapture(this,WI)),c.toolbar&&this.To.push(this.toolbar=(a=this.toolbar)!==null&&a!==void 0?a:new c.toolbar(this)),c.experiments&&this.To.push(this.experiments=(l=this.experiments)!==null&&l!==void 0?l:new c.experiments(this)),this.To.forEach(f=>{f.initialize&&d.push(()=>{f.initialize==null||f.initialize()})}),d.push(()=>{if(this.ol){var f=this.ol;this.ol=void 0,this.To.forEach(m=>m.onRemoteConfig==null?void 0:m.onRemoteConfig(f))}}),this.ll(d,u)}ll(t,n){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&t.length>0)return void setTimeout(()=>{this.ll(t,n)},0);var r=t.shift();if(r)try{r()}catch(s){D.error("Error initializing extension:",s)}}var i=Math.round(performance.now()-n);this.register_for_session({[fE]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[hE]:i}),this.config.__preview_deferred_init_extensions&&D.info("PostHog extensions initialized ("+i+"ms)")}pa(t){var n;if(!j||!j.body)return D.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.pa(t)},500);if(this.config.__preview_deferred_init_extensions&&(this.ol=t),this.Io=t,this.compression=void 0,t.ok){var r,i=t.config;i.supportedCompression&&!this.config.disable_compression&&(this.compression=J(i.supportedCompression,Et.GZipJS)?Et.GZipJS:J(i.supportedCompression,Et.Base64)?Et.Base64:void 0),(r=i.analytics)!=null&&r.endpoint&&(this.analyticsDefaultEndpoint=i.analytics.endpoint)}this.set_config({person_profiles:this.Wo?this.Wo:bp}),(n=this.ul)==null||n.handleRemoteConfig(t),this.To.forEach(s=>s.onRemoteConfig==null?void 0:s.onRemoteConfig(t))}il(){try{this.config.loaded(this)}catch(r){D.critical("`loaded` function failed",r)}if(this.hl(),this.config.internal_or_test_user_hostname&&Ae!=null&&Ae.hostname){var t=Ae.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?t===n:n.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.Lo())&&this.dl()},1),this.vl=new zE(this),this.vl.load()}hl(){var t;this.is_capturing()&&this.config.request_batching&&((t=this.Jo)==null||t.enable())}_dom_loaded(){this.is_capturing()&&Ql(this.__request_queue,t=>this.Ko(t)),this.__request_queue=[],this.hl()}_handle_unload(){var t,n,r,i,s;(t=this.surveys)==null||t.handlePageUnload==null||t.handlePageUnload(),(n=this.metrics)==null||n.flush("sendBeacon"),this.config.request_batching?(this.cl()&&this.capture(vf),(r=this.logs)==null||r.flushLogs("sendBeacon"),(i=this.Jo)==null||i.unload(),(s=this.Yo)==null||s.unload()):this.cl()&&this.capture(vf,null,{transport:"sendBeacon"})}_send_request(t){this.__loaded?oS?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)?t.fireCallbackOnDrop&&(t.callback==null||t.callback({statusCode:429})):(t.transport=t.transport||this.config.api_transport,t.headers=$({},this.config.request_headers,t.headers),t.compression=t.compression==="best-available"?this.compression:t.compression,(L(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(n=>{var r,i,s,o=$({},n);o.timeout=o.timeout||6e4;var a,l,u,c,d,f=(r=o.transport)!==null&&r!==void 0?r:"fetch";f==="sendBeacon"&&L(o.compression)&&o.data&&(o.compression=Et.Base64),o.method==="POST"&&o.data&&(o.timestampMode==="capture-body"?o.data={api_key:(l=(d=(c=(Z(a=o.data)?a:[a]).map(y=>$({},y,y.timestamp instanceof Date&&!isNaN(y.timestamp.getTime())?{timestamp:y.timestamp.toISOString()}:{})))[0])==null||(u=d.properties)==null?void 0:u.token)!==null&&l!==void 0?l:d==null?void 0:d.token,batch:c,sent_at:new Date().toISOString()}:o.timestampMode==="body"&&(o.data=function(y,h){return h===void 0&&(h=new Date().toISOString()),Z(y)?y.map(v=>$({},v,{sent_at:h})):$({},y,{sent_at:h})}(o.data))),o.url=x_(o.url,o.method,o.compression,o.timestampMode);var m=Mu.filter(y=>!o.disableTransport||!y.transport||!o.disableTransport.includes(y.transport)),_=(i=(s=function(y,h){for(var v=0;y.length>v;v++)if(y[v].transport===f)return y[v]}(m))==null?void 0:s.method)!==null&&i!==void 0?i:m[0].method;if(!_)throw new Error("No available transport method");var p=y=>{try{_(y)}catch(h){YE(h)?D.warn(h):D.error(h),o.callback==null||o.callback({statusCode:0,error:h})}};f!=="sendBeacon"&&o.data&&o.compression===Et.GZipJS&&bT&&typeof Promise<"u"&&!Ou?lO(o).then(y=>{p(y)}).catch(y=>{if(Ly(y))return Ou=!0,void p($({},o,{compression:void 0,url:x_(n.url,n.method,void 0,n.timestampMode)}));(h=>{if(!h||typeof h!="object")return!1;var v="name"in h?String(h.name):"";return Ly(h)||v===bb})(y)&&(Ou=!0),p(o)}):_(o)})($({},t,{callback:n=>{var r,i;this.rateLimiter.checkForLimiting(n),400>n.statusCode||(r=(i=this.config).on_request_error)==null||r.call(i,n),t.callback==null||t.callback(n)}}))):t.fireCallbackOnDrop&&(t.callback==null||t.callback({statusCode:0}))}Ko(t){this.Yo?this.Yo.retriableRequest(t):this._send_request(t)}_execute_array(t){Of++;try{var n,r=[],i=[],s=[];Ql(t,a=>{if(a)if(Z(n=a[0]))s.push(a);else if(vt(a))try{a.call(this)}catch(l){D.error("Error executing queued PostHog call",a,l)}else Z(a)&&n==="alias"?r.push(a):Z(a)&&n.indexOf("capture")!==-1&&vt(this[n])?s.push(a):i.push(a)});var o=function(a,l){Ql(a,function(u){try{if(Z(u[0])){var c=l;ve(u,function(d){c=c[d[0]].apply(c,d.slice(1))})}else l[u[0]].apply(l,u.slice(1))}catch(d){D.error("Error executing queued PostHog call",u,d)}})};o(r,this),o(i,this),o(s,this)}finally{Of--}}push(t){if(Of>0&&Z(t)&&ce(t[0])){var n=qt.prototype[t[0]];vt(n)&&n.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,n,r){var i,s,o,a,l;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Jo){if(this.is_capturing())if(!L(t)&&ce(t)){this.$o();var u=!this.config.opt_out_useragent_filter&&this._is_bot();if(!u||this.config.__preview_capture_bot_pageviews){var c=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(c==null||!c.isRateLimited){n!=null&&n.$current_url&&!ce(n==null?void 0:n.$current_url)&&(D.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),t!=="$exception"||r!=null&&r.fl||D.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var d=new Date,f=(r==null?void 0:r.timestamp)||d,m=Vy(r==null?void 0:r.uuid,$n),_={uuid:m,event:t,properties:this.calculateEventProperties(t,n||{},f,m)};t===bs&&this.config.__preview_capture_bot_pageviews&&u&&(_.event="$bot_pageview",_.properties.$browser_type="bot"),c&&(_.properties.$lib_rate_limit_remaining_tokens=c.remainingTokens);var p=t==="$feature_flag_called"&&_.properties.$feature_flag_has_experiment===!1&&this.get_property(xc)===!0;r!=null&&r.$set&&!p&&(_.$set=r==null?void 0:r.$set);var y=r==null?void 0:r.$unset;y&&(_.$unset=y);var h,v,x,b=p?void 0:this.pl(r==null?void 0:r.$set_once,t!==Yy,t===gf);if(b&&(_.$set_once=b),r!=null&&r._noTruncate||(s=this.config.properties_string_max_length,o=_,a=M=>ce(M)?M.slice(0,s):M,l=new Set,_=function M(z,F){if(z!==Object(z))return a?a(z):z;if(!l.has(z)){var W;if(l.add(z),Z(z))W=[],Ql(z,Q=>{W.push(M(Q))});else{var B={};ve(z,(Q,O)=>{l.has(Q)||(B[O]=M(Q))}),W=B}return W}}(o)),_.timestamp=f,L(r==null?void 0:r.timestamp)||(_.properties.$event_time_override_provided=!0,_.properties.$event_time_override_system_time=d),p&&(_.properties=function(M,z){z===void 0&&(z=[]);var F={},W=B=>{M[B]!==void 0&&(F[B]=M[B])};return ET.forEach(W),z.forEach(W),F}(_.properties,kO)),t===ur.DISMISSED||t===ur.SENT){var E=n==null?void 0:n[kf.SURVEY_ID],S=n==null?void 0:n[kf.SURVEY_ITERATION];iS({id:E,current_iteration:S}),_.$set=$({},_.$set,{[(h={id:E,current_iteration:S},v=t===ur.SENT?"responded":"dismissed",x="$survey_"+v+"/"+h.id,h.current_iteration&&h.current_iteration>0&&(x="$survey_"+v+"/"+h.id+"/"+h.current_iteration),x)]:!0})}else t===ur.SHOWN&&(_.$set=$({},_.$set,{[kf.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(t===eO.SHOWN){var P=n==null?void 0:n[v_.TOUR_TYPE];P&&(_.$set=$({},_.$set,{[v_.TOUR_LAST_SEEN_DATE+"/"+P]:new Date().toISOString()}))}var C=$({},_.properties.$set,_.$set);if(En(C)||this.setPersonPropertiesForFlags(C),!ne(this.config.before_send)){var T=this.kn(_);if(!T)return;(_=T).uuid=Vy(_.uuid,$n)}this.Ro.emit("eventCaptured",_);var R=(i=r==null?void 0:r._url)!==null&&i!==void 0?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),N={method:"POST",url:R,data:_,compression:"best-available",timestampMode:(r==null?void 0:r._batchKey)==="recordings"||/\/s\/(?:\?|$)/.test(R)?"body":"capture-body",batchKey:r==null?void 0:r._batchKey,transport:r==null?void 0:r.transport};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.Ko(N):this.Jo.enqueue(N),_}D.critical("This capture call is ignored due to client rate limiting.")}}else D.error("No event name provided to posthog.capture")}else D.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",n=>t(n.event,n))}sl(){var t;return(t=this.ul)!==null&&t!==void 0?t:this.ul=new CO(this)}Ao(t){this.Ho.push(t);var n=!0;return()=>{if(n){n=!1;var r=this.Ho.indexOf(t);r!==-1&&this.Ho.splice(r,1)}}}gl(t){var n,r,i;return t===void 0&&(t=!0),!((n=this.persistence)==null||!n.consumeCookieIdentityChange())&&(this.Vo=null,this.persistence.get_property(se)===We&&((i=this.sessionPersistence)==null||i.clear(),this.jo.clear(),this.ml()),(r=this.featureFlags)==null||r.reset(),t&&this.reloadFeatureFlags(),!0)}calculateEventProperties(t,n,r,i,s){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;this.persistence.syncCookieProperties(),this.gl();var o=s?void 0:this.persistence.remove_event_timer(t),a=$({},n);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this.Lo()&&(a[dE]=!0),t==="$snapshot"){var l=$({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!ce(a.distinct_id)&&!Ge(a.distinct_id)||cc(a.distinct_id))&&D.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,c=function(E,S,P,C){var T,R,N,M;if(C===void 0&&(C=!1),!Mt)return{};var z,F=E?[...ko,...S||[]]:[],W=function(cs){for(var It=0;zy.length>It;It++){var ds=zy[It],Cr=ds[1],pn=ds[0].exec(cs),Do=pn&&(vt(Cr)?Cr(pn,cs):Cr);if(Do)return Do}return["",""]}(Mt),B=W[0],Q=W[1],O=(z=typeof navigator<"u"?navigator:void 0)!=null&&z.brave?{brave:!0}:{},A={};L(P)||(A.detectGoogleSearchApp=P);var V={},K=(T=navigator)==null||(T=T.userAgentData)==null?void 0:T.platform,te=(R=navigator)==null?void 0:R.maxTouchPoints,oe=I==null||(N=I.screen)==null?void 0:N.width,de=I==null||(M=I.screen)==null?void 0:M.height,be=I==null?void 0:I.devicePixelRatio;L(K)||(V.userAgentDataPlatform=K),L(te)||(V.maxTouchPoints=te),L(oe)||(V.screenWidth=oe),L(de)||(V.screenHeight=de),L(be)||(V.devicePixelRatio=be);var Pe,Be,ye,Fe,Tt,Sr,_t,Ye,gi=_e(Sg({$os:B,$os_version:Q,$browser:Qb(Mt,navigator.vendor,O,A),$device:Uy(Mt),$device_type:(Be=Mt,ye=V,Ye=Uy(Be),Ye===Ob||Ye===Ib||Ye==="Kobo"||Ye==="Kindle Fire"||Ye===qb?xo:Ye===Ka||Ye===Gs||Ye===Qa||Ye===ip?"Console":Ye===Ab?"Wearable":Ye?Yt:(ye==null?void 0:ye.userAgentDataPlatform)==="Android"&&((Fe=ye==null?void 0:ye.maxTouchPoints)!==null&&Fe!==void 0?Fe:0)>0?600>Math.min((Tt=ye==null?void 0:ye.screenWidth)!==null&&Tt!==void 0?Tt:0,(Sr=ye==null?void 0:ye.screenHeight)!==null&&Sr!==void 0?Sr:0)/((_t=ye==null?void 0:ye.devicePixelRatio)!==null&&_t!==void 0?_t:1)?Yt:xo:"Desktop"),$timezone:DE(),$timezone_offset:XI()}),{$current_url:Za(C?li(Ae==null?void 0:Ae.href):Ae==null?void 0:Ae.href,F,el),$host:Ae==null?void 0:Ae.host,$pathname:Ae==null?void 0:Ae.pathname,$raw_user_agent:Mt.length>1e3?Mt.substring(0,997)+"...":Mt,$browser_version:HT(Mt,navigator.vendor,O,A),$browser_language:h_(),$browser_language_prefix:(Pe=h_(),typeof Pe=="string"?Pe.split("-")[0]:void 0),$screen_height:I==null?void 0:I.screen.height,$screen_width:I==null?void 0:I.screen.width,$viewport_height:I==null?void 0:I.innerHeight,$viewport_width:I==null?void 0:I.innerWidth,$lib:Ee.LIB_NAME,$lib_version:Ee.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return Ee.SDK_DIST_CHANNEL&&(gi.$sdk_dist_channel=Ee.SDK_DIST_CHANNEL),gi}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var d=this.sessionManager.checkAndGetSessionAndWindowId(s,r.getTime(),!0),f=d.windowId;a.$session_id=d.sessionId,a.$window_id=f}this.sessionPropsManager&&_e(a,this.sessionPropsManager.getSessionProps());try{var m;this.sessionRecording&&_e(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=(m=this.Yo)==null?void 0:m.length}catch(E){a.$sdk_debug_error_capturing_properties=String(E)}if(this.requestRouter.region===Ap&&(a.$lib_custom_api_host=this.config.api_host),u=t!==bs||s?t!==vf||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,i),a=_e(a,u),t===bs&&j&&(a.title=j.title),!L(o)){var _=r.getTime()-o;a.$duration=parseFloat((_/1e3).toFixed(3))}Mt&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser");var p=this.persistence.properties(),y=this.sessionPersistence.properties();ve(["$referrer","$referring_domain"],E=>{E in p&&delete y[E]});var h={};if(this.Ho.length>0)for(var v of this.Ho.slice())try{_e(h,v())}catch(E){D.error("Failed to produce browser extension event properties",E)}(a=_e({},c,p,y,$({},h,a))).$is_identified=this._isIdentified(),Z(this.config.property_denylist)?ve(this.config.property_denylist,function(E){delete a[E]}):D.error(sS+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var x=this.config.sanitize_properties;x&&(D.error(R_),a=x(a,t));var b=this.yl();return a.$process_person_profile=b,b&&!s&&this.bl("_calculate_event_properties"),a}pl(t,n,r){var i;if(n===void 0&&(n=!0),r===void 0&&(r=!1),!this.persistence||!this.yl()||this.qo&&!r)return t;var s=this.persistence.get_initial_props(),o=(i=this.sessionPropsManager)==null?void 0:i.getSetOnceProps(),a=_e({},s,o||{},t||{}),l=this.config.sanitize_properties;return l&&(D.error(R_),a=l(a,"$set_once")),n&&(this.qo=!0),En(a)?void 0:a}register(t,n){var r;(r=this.persistence)==null||r.register(t,n)}register_once(t,n,r){var i;(i=this.persistence)==null||i.register_once(t,n,r)}register_for_session(t){var n,r;(n=this.persistence)==null||n.syncCookieProperties(),this.gl(),(r=this.sessionPersistence)==null||r.register(t),Object.keys(t).forEach(i=>this.jo.add(i)),this.ml()}unregister(t){var n;(n=this.persistence)==null||n.unregister(t)}unregister_for_session(t){var n;(n=this.sessionPersistence)==null||n.unregister(t),this.jo.delete(t),this.ml()}_l(t,n){this.register({[t]:n})}Xo(){this.jo.forEach(t=>{var n;(n=this.sessionPersistence)==null||n.unregister(t)}),this.jo.clear(),this.ml()}ml(){var t;if(this.Bo)if(this.config.persistence==="memory"||(t=this.sessionPersistence)!=null&&t.Hs||!we.Dr())we.qr(this.Bo);else{var n=[];this.jo.forEach(r=>n.push(r)),n.length>0?we.Nr(this.Bo,n):we.qr(this.Bo)}}getFeatureFlag(t,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlag(t,n)}getFeatureFlagPayload(t){var n;return(n=this.featureFlags)==null?void 0:n.getFeatureFlagPayload(t)}getFeatureFlagResult(t,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlagResult(t,n)}getAllFeatureFlags(){var t,n;return(t=(n=this.featureFlags)==null?void 0:n.getAllFeatureFlags())!==null&&t!==void 0?t:[]}isFeatureEnabled(t,n){var r,i;return(r=(i=this.featureFlags)==null?void 0:i.isFeatureEnabled(t,n))!==null&&r!==void 0?r:n==null?void 0:n.defaultValue}reloadFeatureFlags(){var t;(t=this.featureFlags)==null||t.reloadFeatureFlags()}updateFlags(t,n,r){var i;(i=this.featureFlags)==null||i.updateFlags(t,n,r)}updateEarlyAccessFeatureEnrollment(t,n,r){var i;(i=this.featureFlags)==null||i.updateEarlyAccessFeatureEnrollment(t,n,r)}getEarlyAccessFeatures(t,n,r){var i;return n===void 0&&(n=!1),(i=this.featureFlags)==null?void 0:i.getEarlyAccessFeatures(t,n,r)}on(t,n){return this.Ro.on(t,n)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:ea}),()=>{})}onSessionId(t){var n,r;return(n=(r=this.sessionManager)==null?void 0:r.onSessionId(t))!==null&&n!==void 0?n:()=>{}}getSurveys(t,n){n===void 0&&(n=!1),this.surveys?this.surveys.getSurveys(t,n):t([],{isLoaded:!1,error:ea})}getActiveMatchingSurveys(t,n){n===void 0&&(n=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,n):t([],{isLoaded:!1,error:ea})}renderSurvey(t,n){var r;(r=this.surveys)==null||r.renderSurvey(t,n)}displaySurvey(t,n){var r;n===void 0&&(n=_O),(r=this.surveys)==null||r.displaySurvey(t,n)}cancelPendingSurvey(t){var n;(n=this.surveys)==null||n.cancelPendingSurvey(t)}canRenderSurvey(t){var n,r;return(n=(r=this.surveys)==null?void 0:r.canRenderSurvey(t))!==null&&n!==void 0?n:{visible:!1,disabledReason:ea}}canRenderSurveyAsync(t,n){var r,i;return n===void 0&&(n=!1),(r=(i=this.surveys)==null?void 0:i.canRenderSurveyAsync(t,n))!==null&&r!==void 0?r:Promise.resolve({visible:!1,disabledReason:ea})}wl(t){return!t||cc(t)?(D.critical("Unique user id has not been set in posthog.identify"),!1):t===hs?(D.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(t.toLowerCase())&&!["undefined","null"].includes(t.toLowerCase())||(D.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(t,n,r){if(!this.__loaded||!this.persistence)return D.uninitializedWarning("posthog.identify");if(Ge(t)&&(t=t.toString(),D.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.wl(t)&&this.bl("posthog.identify")){this.$o();var i=this.get_distinct_id(),s=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==i,o=this.gl(!1),a=this.persistence.Ws(),l=!1;try{var u=this.get_distinct_id();this.register({$user_id:t}),this.get_property(Ya)||this.register_once({$had_persisted_distinct_id:!0,$device_id:u},""),t!==u&&t!==this.get_property(Fs)&&(this.unregister(Fs),this.register({distinct_id:t}));var c,d=(this.persistence.get_property(se)||We)===We,f=t!==u,m=!f&&d;if(f&&d)this.persistence.set_property(se,ot),this.setPersonPropertiesForFlags({$set:n||{},$set_once:r||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.Vs(),this.capture(gf,{distinct_id:t,$anon_distinct_id:u},{$set:n||{},$set_once:r||{}}),this.Vo=If(t,n,r),(c=this.featureFlags)==null||c.setAnonymousDistinctId(u);else if(m){this.persistence.set_property(se,ot);var _=n||{},p=r||{};this.setPersonPropertiesForFlags({$set:_,$set_once:p},!1),this.config.cookieWinsOnConflict&&this.persistence.Vs(),this.capture("$set",{$set:_,$set_once:p}),this.Vo=If(t,n,r)}else(n||r)&&this.setPersonProperties(n,r);f||s||o?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(ar)):m&&(n||r)&&this.reloadFeatureFlags(),l=!0}finally{a&&this.persistence.Qs(l)}}}setPersonProperties(t,n){if((t||n)&&this.bl("posthog.setPersonProperties")){var r=If(this.get_distinct_id(),t,n);this.Vo!==r?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:n||{}},!0),this.capture("$set",{$set:t||{},$set_once:n||{}}),this.Vo=r):D.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var n,r=(Z(t)?t:[t]).filter(i=>ce(i)&&i.length>0);r.length!==0&&this.bl("posthog.unsetPersonProperties")&&((n=this.featureFlags)==null||n.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.Vo=null)}group(t,n,r){var i;if(t&&n){(i=this.persistence)==null||i.syncCookieProperties(),this.gl();var s=this.getGroups(),o=s[t]!==n;if(o&&this.resetGroupPropertiesForFlags(t),this.register({$groups:$({},s,{[t]:n})}),o||r){var a={$group_type:t,$group_key:n};r&&(a.$group_set=r),this.capture(Yy,a)}r&&this.setGroupPropertiesForFlags({[t]:r}),o&&!r&&this.reloadFeatureFlags()}else D.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,n){var r;n===void 0&&(n=!0),(r=this.featureFlags)==null||r.setPersonPropertiesForFlags(t,n)}resetPersonPropertiesForFlags(t){var n;t===void 0&&(t=!0),(n=this.featureFlags)==null||n.resetPersonPropertiesForFlags(t)}setGroupPropertiesForFlags(t,n){var r;n===void 0&&(n=!0),this.bl("posthog.setGroupPropertiesForFlags")&&((r=this.featureFlags)==null||r.setGroupPropertiesForFlags(t,n))}resetGroupPropertiesForFlags(t){var n;(n=this.featureFlags)==null||n.resetGroupPropertiesForFlags(t)}reset(t){var n=$t(t)?t:t==null?void 0:t.resetDeviceID,r=$t(t)||t==null?void 0:t.bootstrap;this.kl(n,!1,r)}kl(t,n,r){var i,s,o;if(n===void 0&&(n=!1),D.info("reset"),!this.__loaded)return D.uninitializedWarning("posthog.reset");var a=r==null?void 0:r.sessionID;this.config.bootstrap=r||((i=this.Zo)==null?void 0:i.bootstrap)||{},(s=this.featureFlags)==null||s.updateConfig==null||s.updateConfig(this.config,this.ma());var l=this.get_property(Ya),u=this.get_property(pf),c=this.get_property(Oi),d=this.is_capturing();this.consent.reset(),n||!d||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");var f=(o=this.persistence)==null||o.Ws==null?void 0:o.Ws(),m=!1;try{var _,p,y,h,v,x,b,E,S,P,C,T,R,N;if((_=this.persistence)==null||_.clear(),(p=this.sessionPersistence)==null||p.clear(),this.jo.clear(),this.ml(),L(c)||(C=this.persistence)==null||C.register({[Oi]:c}),(y=this.surveys)==null||y.reset(),(h=this.vl)==null||h.stop(),(v=this.featureFlags)==null||v.reset(),(x=this.conversations)==null||x.reset(),(b=this.logs)==null||b.reset(),(E=this.metrics)==null||E.reset(),(S=this.persistence)==null||S.set_property(se,We),(P=this.sessionManager)==null||P.resetSessionId(),this.Vo=null,this.config.cookieless_mode===lr)this.register_once({distinct_id:hs,$device_id:null},"");else{var M=this.config.get_device_id($n());this.register_once({distinct_id:M,$device_id:t?M:l},""),t||L(u)||this.register({[pf]:u})}if(this.register({$last_posthog_reset:new Date().toISOString()},1),r&&(r.distinctID===void 0||this.Lo()||((N=this.persistence)==null||N.set_property(se,r.isIdentifiedID?ot:We),this.register({distinct_id:r.distinctID})),(T=this.featureFlags)==null||T.initialize(),!(L(a)||(R=this.sessionManager)!=null&&R.setBootstrapSessionId(a,!0)))){var z=$({},r);delete z.sessionID,this.config.bootstrap=z}delete this.config.identity_distinct_id,delete this.config.identity_hash,m=!0}finally{var F;f&&((F=this.persistence)==null||F.Qs==null||F.Qs(m))}this.reloadFeatureFlags()}shutdown(t){var n=this;return Ce(function*(){var r,i,s,o,a,l;if(n.__loaded){(r=n.vl)==null||r.stop(),n.sl().dispose(),(i=n.sessionRecording)==null||i.dispose(),(s=n.logs)==null||s.flushLogs("sendBeacon"),(o=n.metrics)==null||o.flush("sendBeacon"),(a=n.Jo)==null||a.unload(),(l=n.Yo)==null||l.unload();try{var u;(u=n.featureFlags)==null||u.destroy()}catch(c){D.error("Error while destroying feature flags",c)}}else D.uninitializedWarning("posthog.shutdown")})()}setIdentity(t,n){var r;this.config.identity_distinct_id=t,this.config.identity_hash=n,this.alias(t),(r=this.conversations)==null||r.Sl()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,(t=this.conversations)==null||t.xl()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,n;return(t=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&t!==void 0?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var n=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=n.sessionStartTimestamp,i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n.sessionId);if(t!=null&&t.withTimestamp&&r){var s,o=(s=t.timestampLookBack)!==null&&s!==void 0?s:10;if(!r)return i;i+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-o,0)}return i}alias(t,n){return t===this.get_property(iE)?(D.critical("Attempting to create alias for existing People user - aborting."),-2):this.bl("posthog.alias")?(L(n)&&(n=this.get_distinct_id()),t!==n?(this._l(Fs,t),this.capture("$create_alias",{alias:t,distinct_id:n})):(D.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var n=$({},this.config);if(Se(t)){var r,i,s,o,a,l,u,c,d,f,m,_;_e(this.config,T_(t));var p=this.Do();(r=this.persistence)==null||r.update_config(this.config,n,p),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Sf($({},this.config,{persistence:"sessionStorage"}),p,!1);var y,h=this.Go(this.config.debug);$t(h)&&(this.config.debug=h),$t(this.config.debug)&&(this.config.debug?(Ee.DEBUG=!0,ge.Dr()&&ge.Nr("ph_debug",!0),D.info("set_config",{config:t,oldConfig:n,newConfig:$({},this.config)})):(Ee.DEBUG=!1,ge.Dr()&&ge.qr("ph_debug"))),(i=this.featureFlags)==null||i.updateConfig==null||i.updateConfig(this.config,this.ma()),(s=this.exceptionObserver)==null||s.onConfigChange(),(o=this.exceptions)==null||o.onConfigChange(),(a=this.sessionRecording)==null||a.startIfEnabledOrStop(),(l=this.tracingHeaders)==null||l.startIfEnabledOrStop(),(u=this.autocapture)==null||u.startIfEnabled(),(c=this.heatmaps)==null||c.startIfEnabled(),("capture_pageview"in t||"disable_capture_url_hashes"in t)&&((y=this.historyAutocapture)==null||y.startIfEnabledOrStop()),(d=this.exceptionObserver)==null||d.startIfEnabledOrStop(),(f=this.deadClicksAutocapture)==null||f.startIfEnabledOrStop(),(m=this.surveys)==null||m.loadIfEnabled(),this.No(),(_=this.externalIntegrations)==null||_.startIfEnabledOrStop()}}_overrideSDKInfo(t,n){Ee.LIB_NAME=t,Ee.LIB_VERSION=n}startSessionRecording(t){var n,r,i,s,o,a=t===!0,l={sampling:a||!(t==null||!t.sampling),linked_flag:a||!(t==null||!t.linked_flag),url_trigger:a||!(t==null||!t.url_trigger),event_trigger:a||!(t==null||!t.event_trigger)};Object.values(l).some(Boolean)&&((n=this.sessionManager)==null||n.checkAndGetSessionAndWindowId(),l.sampling&&((r=this.sessionRecording)==null||r.overrideSampling()),l.linked_flag&&((i=this.sessionRecording)==null||i.overrideLinkedFlag()),l.url_trigger&&((s=this.sessionRecording)==null||s.overrideTrigger("url")),l.event_trigger&&((o=this.sessionRecording)==null||o.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!((t=this.sessionRecording)==null||!t.started)}captureException(t,n){if(this.exceptions){var r=new Error("PostHog syntheticException"),i=this.exceptions.buildProperties(t,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent($({},i,n))}}addExceptionStep(t,n){var r;(r=this.exceptions)==null||r.addExceptionStep(t,n)}captureLog(t){var n;(n=this.logs)==null||n.captureLog(t)}get logger(){var t,n;return(t=(n=this.logs)==null?void 0:n.logger)!==null&&t!==void 0?t:qt.Cl}startExceptionAutocapture(t){this.set_config({capture_exceptions:t==null||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var n,r;return(n=(r=this.toolbar)==null?void 0:r.loadToolbar(t))!==null&&n!==void 0&&n}get_property(t){var n;return(n=this.persistence)==null?void 0:n.props[t]}getSessionProperty(t){var n;return(n=this.sessionPersistence)==null?void 0:n.props[t]}toString(){var t,n=(t=this.config.name)!==null&&t!==void 0?t:Es;return n!==Es&&(n=Es+"."+n),n}_isIdentified(){var t,n;return((t=this.persistence)==null?void 0:t.get_property(se))===ot||((n=this.sessionPersistence)==null?void 0:n.get_property(se))===ot}yl(){var t,n;return!(this.config.person_profiles==="never"||this.config.person_profiles===bp&&!this._isIdentified()&&En(this.getGroups())&&((t=this.persistence)==null||(t=t.props)==null||!t[Fs])&&((n=this.persistence)==null||(n=n.props)==null||!n[Sc]))}cl(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&!!this.config.capture_pageview}createPersonProfile(){this.yl()||this.bl("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.bl("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}bl(t){return this.config.person_profiles==="never"?(D.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._l(Sc,!0),!0)}Do(){if(this.config.cookieless_mode==="always")return!0;var t=this.consent.isOptedOut();return this.config.disable_persistence||t&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==ki)}No(){var t,n,r,i,s=this.Do();return((t=this.persistence)==null?void 0:t.Hs)!==s&&((r=this.persistence)==null||r.set_disabled(s)),((n=this.sessionPersistence)==null?void 0:n.Hs)!==s&&((i=this.sessionPersistence)==null||i.set_disabled(s)),s&&(this.jo.clear(),this.ml()),s}opt_in_capturing(t){var n;if(this.config.cookieless_mode!==lr){if(this.Lo()){var r,i,s,o,a;this.kl(!0,!0),(r=this.sessionManager)==null||r.destroy(),(i=this.pageViewManager)==null||i.destroy(),this.sessionManager=new S_(this),this.pageViewManager=new f_(this),this.persistence&&(this.sessionPropsManager=new b_(this,this.sessionManager,this.persistence));var l,u=(s=(o=this.config.__extensionClasses)==null?void 0:o.sessionRecording)!==null&&s!==void 0?s:(a=qt.__defaultExtensionClasses)==null?void 0:a.sessionRecording;u&&(this.sessionRecording=this.Oo(this.sessionRecording,new u(this)),this.Io&&((l=this.sessionRecording)==null||l.onRemoteConfig==null||l.onRemoteConfig(this.Io)))}var c,d;this.consent.optInOut(!0),this.No(),this.hl(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode==ki&&((c=this.surveys)==null||c.loadIfEnabled()),(L(t==null?void 0:t.captureEventName)||t!=null&&t.captureEventName)&&this.capture((d=t==null?void 0:t.captureEventName)!==null&&d!==void 0?d:"$opt_in",t==null?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.dl()}else D.warn(P_)}opt_out_capturing(){var t,n,r;this.config.cookieless_mode!==lr?(this.config.cookieless_mode===ki&&this.consent.isOptedIn()&&this.kl(!0,!0),this.consent.optInOut(!1),this.No(),this.config.cookieless_mode===ki&&(this.register({distinct_id:hs,$device_id:null}),(t=this.sessionRecording)==null||t.stopRecording(),this.sessionRecording=void 0,(n=this.sessionManager)==null||n.destroy(),(r=this.pageViewManager)==null||r.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.dl(),this.hl())):D.warn(P_)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return t===1?"granted":t===0?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===lr||(this.config.cookieless_mode===ki?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.No()}_is_bot(){return St?JE(St,this.config.custom_blocked_useragents):void 0}dl(){j&&(j.visibilityState==="visible"?this.Uo||(this.Uo=!0,this.capture(bs,{title:j.title},{send_instantly:!0}),this.zo&&(j.removeEventListener(Cc,this.zo),this.zo=null)):this.zo||(this.zo=this.dl.bind(this),Re(j,Cc,this.zo)))}debug(t){t===!1?(I==null||I.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(I==null||I.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}ma(){var t=this.Zo||{};return"advanced_disable_flags"in t?!!t.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(D.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):function(n,r,i,s,o){var a=r in n&&!ne(n[r]),l=i in n&&!ne(n[i]);return a?n[r]:!!l&&(o&&o.warn("Config field '"+i+"' is deprecated. Please use '"+r+"' instead. The old field will be removed in a future major version."),n[i])}(t,"advanced_disable_flags","advanced_disable_decide",0,D)}kn(t){var n;if(ne(this.config.before_send))return t;var r=Object.keys((n=t.properties)!==null&&n!==void 0?n:{}).filter(NT),i=Z(this.config.before_send)?this.config.before_send:[this.config.before_send],s=t;for(var o of i)try{if(s=o(s),ne(s)){var a="Event '"+t.event+"' was rejected in beforeSend function";return AT(t.event)?D.warn(a+". This can cause unexpected behavior."):D.info(a),null}s.properties&&!En(s.properties)||D.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}catch(u){return D.error("Error in beforeSend function for event '"+t.event+"':",u),null}for(var l of r)if(s.properties&&ne(s.properties[l]))return D.warn("Event '"+t.event+"' had its '"+l+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return s}getPageViewId(){var t;return(t=this.pageViewManager.Ss)==null?void 0:t.pageViewId}captureTraceFeedback(t,n){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:n})}captureTraceMetric(t,n,r){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:n,$ai_metric_value:String(r)})}Go(t){var n=$t(t)&&!t,r=ge.Dr()&&ge.Pr("ph_debug")==="true";return!n&&(!!r||t)}}qt.__defaultExtensionClasses={},qt.Cl=(()=>{var e=()=>{};return{trace:e,debug:e,info:e,warn:e,error:e,fatal:e}})(),function(e,t){for(var n=0;t.length>n;n++)e.prototype[t[n]]=SI(e.prototype[t[n]])}(qt,["identify"]);class aS{constructor(t){this.disabled=t===!1;var n=Se(t)?t:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(t,n,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(t-i.x)+Math.abs(n-i.y)r-i.timestamp){if(this.clicks.push({x:t,y:n,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:n,timestamp:r}];return!1}}var Af="$copy_autocapture",nu=Ie("[AutoCapture]");function Nf(e,t){return t.length>e?t.slice(0,e)+"...":t}function TO(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!ui(t));return t}function IO(e,t){var n,r,i=t.e,s=t.maskAllElementAttributes,o=t.maskAllText,a=t.elementAttributeIgnoreList,l=t.elementsChainAsString,u=t.disableCaptureUrlHashes;if(!ui(e))return{props:{}};for(var c=[e],d=new Set([e]),f=e;f.parentNode&&!Kt(f,"body")&&xE>c.length;)if(wE(f.parentNode)){var m=f.parentNode.host;if(d.has(m))break;d.add(m),c.push(m),f=m}else{if(!ui(f.parentNode)||d.has(f.parentNode))break;d.add(f.parentNode),c.push(f.parentNode),f=f.parentNode}var _,p,y=[],h={},v=!1,x=!1;if(ve(c,C=>{var T=kp(C);if(Kt(C,"a")){var R=C.getAttribute("href");v=!!(T&&R&&ka(R))&&(u?li(R):R)}J(Tc(C),"ph-no-capture")&&(x=!0),y.push(function(M,z,F,W,B){B===void 0&&(B=!1);var Q=M.tagName.toLowerCase(),O={tag_name:Q};kg.indexOf(Q)>-1&&!F&&(O.$el_text=Q.toLowerCase()==="a"||Q.toLowerCase()==="button"?Nf(1024,u_(M)):Nf(1024,Ja(M)));var A=Tc(M);A.length>0&&(O.classes=A.filter(function(oe){return oe!==""})),ve(M.attributes,function(oe){var de;if((!PE(M)||["name","id","class","aria-label"].indexOf(oe.name)!==-1)&&(W==null||!W.includes(oe.name))&&!z&&ka(oe.value)&&(!ce(de=oe.name)||de.substring(0,10)!=="_ngcontent"&&de.substring(0,7)!=="_nghost")){var be=oe.value;oe.name==="class"&&(be=Cg(be).join(" ")),O["attr__"+oe.name]=Nf(1024,oe.name==="href"&&B?li(be):be)}});for(var V=1,K=1,te=M;te=TO(te);)V++,te.tagName===M.tagName&&K++;return O.nth_child=V,O.nth_of_type=K,O}(C,s,o,a,u));var N=function(M){if(!kp(M))return{};var z={};return ve(M.attributes,function(F){if(F.name&&F.name.indexOf("data-ph-capture-attribute")===0){var W=F.name.replace("data-ph-capture-attribute-",""),B=F.value;W&&B&&ka(B)&&(z[W]=B)}}),z}(C);_e(h,N)}),x)return{props:{},explicitNoCapture:x};if(o||(y[0].$el_text=Kt(e,"a")||Kt(e,"button")?u_(e):Ja(e)),v){var b,E;y[0].attr__href=v;var S=(b=So(v))==null?void 0:b.host,P=I==null||(E=I.location)==null?void 0:E.host;S&&P&&S!==P&&(_=v)}return{props:_e({$event_type:i.type,$ce_version:1},l?{}:{$elements:y},{$elements_chain:(p=y,function(C){return C.map(T=>{var R,N,M="";if(T.tag_name&&(M+=T.tag_name),T.attr_class)for(var z of(T.attr_class.sort(),T.attr_class))M+="."+z.replace(/"/g,"");var F=$({},T.text?{text:T.text}:{},{"nth-child":(R=T.nth_child)!==null&&R!==void 0?R:0,"nth-of-type":(N=T.nth_of_type)!==null&&N!==void 0?N:0},T.href?{href:T.href}:{},T.attr_id?{attr_id:T.attr_id}:{},T.attributes),W={};return Iu(F).sort((B,Q)=>B[0].localeCompare(Q[0])).forEach(B=>{var Q=B[1];return W[c_(B[0].toString())]=c_(Q.toString())}),(M+=":")+Iu(W).map(B=>B[0]+'="'+B[1]+'"').join("")}).join(";")}(function(C){return C.map(T=>{var R,N,M={text:(R=T.$el_text)==null?void 0:R.slice(0,400),tag_name:T.tag_name,href:(N=T.attr__href)==null?void 0:N.slice(0,2048),attr_class:BI(T),attr_id:T.attr__id,nth_child:T.nth_child,nth_of_type:T.nth_of_type,attributes:{}};return Iu(T).filter(z=>z[0].indexOf("attr__")===0).forEach(z=>M.attributes[z[0]]=z[1]),M})}(p)))},(n=y[0])!=null&&n.$el_text?{$el_text:(r=y[0])==null?void 0:r.$el_text}:{},_&&i.type==="click"?{$external_click_url:_}:{},h)}}class OO{constructor(t){this.name="autocapture",this.Qn=!1,this.Jn=null,this.Kn=!1,this.Yn=!1,this.qi={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.Xn=!1,this.ts=t,this.ts.refresh(this.qi),this.rageclicks=new aS(this.qi.rageclick),this.es=null}setup(t){this.rs(),this.ns=t;var n=t.onRemoteConfig(this.onRemoteConfig.bind(this));this.Xn?n.dispose():(this.ss=n,this.startIfEnabled())}dispose(){var t;this.Xn||(this.Xn=!0,this.ns=void 0,(t=this.ss)==null||t.dispose(),this.ss=void 0,this.os())}ls(){return this.ts.refresh(this.qi),this.qi}rs(){var t,n;return this.ls(),this.qi.url_allowlist=(t=this.qi.url_allowlist)==null?void 0:t.map(r=>new RegExp(r)),this.qi.url_ignorelist=(n=this.qi.url_ignorelist)==null?void 0:n.map(r=>new RegExp(r)),this.qi}us(){if(this.isBrowserSupported()){if(I&&j){var t=this.hs=r=>{r=r||(I==null?void 0:I.event);try{this.ds(r)}catch(i){nu.error("Failed to capture event",i)}};if(Re(j,"submit",t,{capture:!0}),Re(j,"change",t,{capture:!0}),Re(j,"click",t,{capture:!0}),this.ls().capture_copied_text){var n=this.vs=r=>{r=r||(I==null?void 0:I.event);try{this.ds(r,Af)}catch(i){nu.error("Failed to capture copy/cut event",i)}};Re(j,"copy",n,{capture:!0}),Re(j,"cut",n,{capture:!0})}}}else nu.info("Disabling Automatic Event Collection because this browser is not supported")}os(){this.hs&&(j==null||j.removeEventListener("submit",this.hs,!0),j==null||j.removeEventListener("change",this.hs,!0),j==null||j.removeEventListener("click",this.hs,!0),this.hs=void 0),this.vs&&(j==null||j.removeEventListener("copy",this.vs,!0),j==null||j.removeEventListener("cut",this.vs,!0),this.vs=void 0),this.Qn=!1}startIfEnabled(){!this.Xn&&this.ns&&this.isEnabled&&!this.Qn&&(this.us(),this.Qn=!0)}onRemoteConfig(t){if(!this.Xn)if(this.Kn=!0,t.ok){var n=t.config;n.elementsChainAsString&&(this.Yn=n.elementsChainAsString);var r,i=n.autocapture_opt_out;$t(i)&&((r=this.ns)==null||r.kv.set(lp,i),this.Jn=i),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(t){this.es=t}getElementSelectors(t){var n,r=[];return(n=this.es)==null||n.forEach(i=>{var s=j==null?void 0:j.querySelectorAll(i);s==null||s.forEach(o=>{t===o&&r.push(i)})}),r}get isEnabled(){var t,n;if(this.Xn)return!1;var r=(t=this.ns)==null?void 0:t.kv.get(lp),i=this.Jn,s=this.ls(),o=s.remoteRequestsDisabled&&!this.Kn;if(rt(i)&&!$t(r)&&!o)return!1;var a=(n=this.Jn)!==null&&n!==void 0?n:!!r;return!!s.enabled&&!a}ds(t,n){if(n===void 0&&(n="$autocapture"),this.isEnabled){var r=Sp(t);_E(r)&&(r=r.parentNode||null);var i,s=this.rs();n==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&s.rageclick&&(i=this.rageclicks)!=null&&i.isRageClick(t.clientX,t.clientY,t.timeStamp||new Date().getTime())&&CE(r,s.rageclick)&&this.ds(t,"$rageclick");var o=n===Af;if(r&&function(_,p,y,h,v,x){var b;if(!I||Pg(_)||y!=null&&y.url_allowlist&&!n_(y.url_allowlist,x)||y!=null&&y.url_ignorelist&&n_(y.url_ignorelist,x))return!1;if(y!=null&&y.dom_event_allowlist){var E=y.dom_event_allowlist;if(E&&!E.some(N=>p.type===N))return!1}var S=kE(_,h),P=S.parentIsUsefulElement,C=S.targetElementList;if(!function(N,M){var z=M==null?void 0:M.element_allowlist;if(L(z))return!0;var F,W=function(Q){if(z.some(O=>Q.tagName.toLowerCase()===O))return{v:!0}};for(var B of N)if(F=W(B))return F.v;return!1}(C,y)||!Cp(C,y==null?void 0:y.css_selector_allowlist)||Cp(C,(b=y==null?void 0:y.css_selector_ignorelist)!==null&&b!==void 0?b:LI))return!1;try{var T=I.getComputedStyle(_);if(T&&T.getPropertyValue("cursor")==="pointer"&&p.type==="click")return!0}catch{}var R=_.tagName.toLowerCase();switch(R){case"html":return!1;case"form":return(v||["submit"]).indexOf(p.type)>=0;case"input":case"select":case"textarea":return(v||["change","click"]).indexOf(p.type)>=0;default:return P?(v||["click"]).indexOf(p.type)>=0:(v||["click"]).indexOf(p.type)>=0&&(kg.indexOf(R)>-1||_.getAttribute("contenteditable")==="true")}}(r,t,s,o,o?["copy","cut"]:void 0,{config:{get_current_url:s.getCurrentUrl}})){var a,l=IO(r,{e:t,maskAllElementAttributes:s.maskAllElementAttributes,maskAllText:s.maskAllText,elementAttributeIgnoreList:s.element_attribute_ignorelist,elementsChainAsString:this.Yn,disableCaptureUrlHashes:s.disableCaptureUrlHashes}),u=l.props;if(l.explicitNoCapture)return!1;var c=this.getElementSelectors(r);if(c&&c.length>0&&(u.$element_selectors=c),n===Af){var d,f=bE(I==null||(d=I.getSelection())==null?void 0:d.toString()),m=t.type||"clipboard";if(!f)return!1;u.$selected_content=f,u.$copy_type=m}return(a=this.ns)==null||a.capture(n,u).catch(_=>nu.error("Failed to capture event",_)),!0}}}isBrowserSupported(){return vt(j==null?void 0:j.querySelectorAll)}}class MO{constructor(t){this._instance=t}refresh(t){var n=this._instance.config,r=Se(n.autocapture)?n.autocapture:void 0;t.enabled=!!n.autocapture,t.rageclick=n.rageclick,t.maskAllElementAttributes=n.mask_all_element_attributes,t.maskAllText=n.mask_all_text,t.disableCaptureUrlHashes=n.disable_capture_url_hashes,t.getCurrentUrl=n.get_current_url,t.remoteRequestsDisabled=this._instance.ma(),t.url_allowlist=r==null?void 0:r.url_allowlist,t.url_ignorelist=r==null?void 0:r.url_ignorelist,t.dom_event_allowlist=r==null?void 0:r.dom_event_allowlist,t.element_allowlist=r==null?void 0:r.element_allowlist,t.css_selector_allowlist=r==null?void 0:r.css_selector_allowlist,t.css_selector_ignorelist=r==null?void 0:r.css_selector_ignorelist,t.element_attribute_ignorelist=r==null?void 0:r.element_attribute_ignorelist,t.capture_copied_text=r==null?void 0:r.capture_copied_text}}var ta=Ie("[ExceptionAutocapture]"),I_=()=>{},AO=Ie("[TracingHeaders]"),yi=Ie("[Web Vitals]"),O_=9e5,M_="disabled",A_="lazy_loading",na="awaiting_config",ru="missing_config";Ie("[SessionRecording]"),Ie("[SessionRecording]");var Np="[SessionRecording]",Yn=Ie(Np),NO=Ie("[Heatmaps]");function $f(e){return Se(e)&&"clientX"in e&&"clientY"in e&&Ge(e.clientX)&&Ge(e.clientY)}var iu=Ie("[Product Tours]"),Ff=e=>{var t;return!e.config.disable_product_tours&&!((t=e.persistence)==null||!t.get_property(xg))},$O=["$set_once","$set"],On=Ie("[SiteApps]"),N_="Error while initializing PostHog app with config id ",lS=(e,t)=>e!=null&&e.then?e.then(t):t(e),gs="SDK is not enabled or survey functionality is not yet loaded",$_="Disabled. Not loading surveys.";class FO{constructor(t,n){this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Tl=!1,this.Ml=[],this.El=null,this.Il=null,this.Xn=!1,this.Rl=new Set,this.onRemoteConfig=r=>{if(!this.Xn&&!this.qi.disableSurveys){if(!r.ok)return he.warn("Remote config unavailable. Not loading surveys.");var i=r.config.surveys;if(ne(i))return he.warn("Flags not loaded yet. Not loading surveys.");this.Pl=$t(i)?i:i.length>0,he.info("flags response received, isSurveysEnabled: "+this.Pl),this.loadIfEnabled()}},this.ts=t,this.Al=n}setup(t){if(!this.Xn)return this.Fl=t,lS(t.kv.initialize(),()=>{if(this.Fl===t&&!this.Xn){this.Fl=void 0,this.ns=t;var n=t.onRemoteConfig(this.onRemoteConfig);this.Xn?n.dispose():(this.ss=n,this.loadIfEnabled())}})}dispose(){var t,n,r;this.Xn||(this.Xn=!0,this.Fl=void 0,this.ns=void 0,(t=this.ss)==null||t.dispose(),this.ss=void 0,(n=this._surveyEventReceiver)==null||n.dispose(),this._surveyEventReceiver=null,(r=this._surveyManager)==null||r.dispose==null||r.dispose(),this._surveyManager=null,this.Ml=[],this.El=null,this.Rl.forEach(i=>clearTimeout(i)),this.Rl.clear())}get qi(){return this.ts.get()}initialize(){this.loadIfEnabled()}reset(){try{var t;(t=this._surveyEventReceiver)==null||t.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var n=[],r=0;rlocalStorage.removeItem(s))}catch{}}loadIfEnabled(){if(!this.Xn&&this.ns){var t=this.qi;if(!this._surveyManager)if(this.Tl)he.info("Already initializing surveys, skipping...");else if(t.disableSurveys)he.info($_);else if(t.cookielessMode&&this.ts.isOptedOut())he.info("Not loading surveys in cookieless mode without consent.");else{var n=this.ts.getExtensions();if(n){if(!L(this.Pl)||t.advancedEnableSurveys){var r=this.Pl||t.advancedEnableSurveys;this.Tl=!0;try{var i=n.generateSurveys;if(i)return this.Ol(i,r),void(this.Tl=!1);var s=n.loadExternalDependency;if(!s)return this.Ll(Eg),void(this.Tl=!1);s(o=>{try{if(this.Xn)return;var a=this.ts.getExtensions();o||a==null||!a.generateSurveys?this.Ll("Could not load surveys script",o):this.Ol(a.generateSurveys,r)}finally{this.Tl=!1}})}catch(o){throw this.Tl=!1,this.Ll("Error initializing surveys",o),o}}}else he.error("PostHog Extensions not found.")}}}Ol(t,n){this.Xn||(this._surveyManager=t(n),this._surveyEventReceiver=this.ts.createEventReceiver(),he.info("Surveys loaded successfully"),this.$l({isLoaded:!0}))}Ll(t,n){he.error(t,n),this.$l({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Ml.push(t),this._surveyManager&&this.$l({isLoaded:!0}),()=>{this.Ml=this.Ml.filter(n=>n!==t)}}getSurveys(t,n){var r;n===void 0&&(n=!1);var i=(r=this.ns)!==null&&r!==void 0?r:this.Al;if(i&&!this.Xn){if(this.qi.disableSurveys)return he.info($_),t([]);var s=i.kv.get(vp);if(s&&!n)return t(s,{isLoaded:!0}),void(this.Dl()&&this.getSurveys(()=>{},!0));if(this.El)this.El.then(l=>{this.Xn||t(l.surveys,l.context)}).catch(l=>he.error("Error in survey callback",l));else{var o=this.Nl("/api/surveys/",{method:"GET",query:{token:i.projectToken},sentAt:"query",timeoutMs:this.qi.requestTimeoutMs}).then(l=>{try{return this.ql(i,l)}catch(u){return he.error("Error processing surveys response",u),this.ql(i,{statusCode:0,error:u})}},l=>this.ql(i,{statusCode:0,error:l}));this.El=o;var a=()=>{this.El===o&&(this.El=null)};o.then(l=>{a(),this.Xn||t(l.surveys,l.context)},a).catch(l=>he.error("Error in survey callback",l))}}}Nl(t,n){var r=this.ns;return r?r.sendRequest(t,n):new Promise(i=>i({statusCode:0,error:new Error(gs)}))}ql(t,n){if(this.Xn)return{surveys:[],context:{isLoaded:!1,error:gs}};var r=n.statusCode;if(r!==200||!n.json){var i="Surveys API could not be loaded, status: "+r;return r!==0?he.error(i):n.error||he.warn(i),this.Il=Date.now(),{surveys:[],context:{isLoaded:!1,error:i}}}this.Il=null;var s,o=n.json.surveys||[],a=o.filter(l=>function(u){return!(!u.start_date||u.end_date)}(l)&&(nS(l)||function(u){var c;return!((c=u.conditions)==null||(c=c.actions)==null||(c=c.values)==null||!c.length)}(l)));return a.length>0&&((s=this._surveyEventReceiver)==null||s.register(a)),t.kv.set({[vp]:o,[bc]:Date.now()}),{surveys:o,context:{isLoaded:!0}}}Dl(){return this.jl()&&!this.El&&!this.Bl()}jl(){var t,n,r=(t=(n=this.ns)!==null&&n!==void 0?n:this.Al)==null?void 0:t.kv.get(bc);return Ge(r)&&Date.now()-r>3e5}Bl(){return Ge(this.Il)&&3e5>Date.now()-this.Il}markSurveyAsSeen(t,n){var r,i={id:t,current_iteration:(r=n==null?void 0:n.iteration)!==null&&r!==void 0?r:null};iS(i);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}}$l(t){for(var n of this.Ml)try{if(!t.isLoaded)return n([],t);this.getSurveys(n)}catch(r){he.error("Error in survey callback",r)}}getActiveMatchingSurveys(t,n){if(n===void 0&&(n=!1),!ne(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,n);he.warn("init was not called")}Hl(t){var n=null;return this.getSurveys(r=>{var i;n=(i=r.find(s=>s.id===t))!==null&&i!==void 0?i:null}),n}Ul(t){if(ne(this._surveyManager))return{eligible:!1,reason:gs};var n=typeof t=="string"?this.Hl(t):t;return n?this._surveyManager.checkSurveyEligibility(n):{eligible:!1,reason:"Survey not found"}}zl(t){if(ne(this._surveyManager))return{eligible:!1,reason:gs};var n=typeof t=="string"?this.Hl(t):t;return n?this._surveyManager.checkSurveyRenderability(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(ne(this._surveyManager))return he.warn("init was not called"),{visible:!1,disabledReason:gs};var n=this.zl(t);return{visible:n.eligible,disabledReason:n.reason}}canRenderSurveyAsync(t,n){return ne(this._surveyManager)?(he.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:gs})):new Promise(r=>{this.getSurveys(i=>{var s,o=(s=i.find(l=>l.id===t))!==null&&s!==void 0?s:null;if(o){var a=this.zl(o);r({visible:a.eligible,disabledReason:a.reason})}else r({visible:!1,disabledReason:"Survey not found"})},n)})}renderSurvey(t,n,r){var i;if(ne(this._surveyManager))he.warn("init was not called");else{var s=typeof t=="string"?this.Hl(t):t;if(s!=null&&s.id)if(yO.includes(s.type)){var o=j==null?void 0:j.querySelector(n);if(o)if((i=s.appearance)!=null&&i.surveyPopupDelaySeconds){he.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds");var a=setTimeout(()=>{var l,u;this.Rl.delete(a),this.Xn||(he.info("Rendering survey "+s.id+" with delay of "+((l=s.appearance)==null?void 0:l.surveyPopupDelaySeconds)+" seconds"),(u=this._surveyManager)==null||u.renderSurvey(s,o,r),he.info("Survey "+s.id+" rendered"))},1e3*s.appearance.surveyPopupDelaySeconds);this.Rl.add(a)}else this._surveyManager.renderSurvey(s,o,r);else he.warn("Survey element not found")}else he.warn("Surveys of type "+s.type+" cannot be rendered in the app");else he.warn("Survey not found")}}displaySurvey(t,n){var r;if(ne(this._surveyManager))he.warn("init was not called");else{var i=this.Hl(t);if(i){var s=i;if((r=i.appearance)!=null&&r.surveyPopupDelaySeconds&&n.ignoreDelay&&(s=$({},i,{appearance:$({},i.appearance,{surveyPopupDelaySeconds:0})})),n.displayType!==Pp.Popover&&n.initialResponses&&he.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),n.ignoreConditions===!1){var o=this.Ul(i);if(!o.eligible)return void he.warn("Survey is not eligible to be displayed: ",o.reason)}n.displayType!==Pp.Inline?this._surveyManager.handlePopoverSurvey(s,n):this.renderSurvey(s,n.selector,n.properties)}else he.warn("Survey not found")}}cancelPendingSurvey(t){ne(this._surveyManager)?he.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;(t=this._surveyManager)==null||t.handlePageUnload==null||t.handlePageUnload()}}function ms(e,t,n){if(ne(e))return!1;switch(n){case"exact":return e===t;case"contains":var r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch{return!1}default:return!1}}class LO{constructor(t){this.Wl=new Set,this.Vl=new Set,this.Gl=new Ac,this.Zl=(n,r)=>this.Ql(n,r)&&this.Jl(n,r)&&this.Kl(n,r)&&this.Yl(n,r),this.Ql=(n,r)=>r==null||!r.event||(n==null?void 0:n.event)===(r==null?void 0:r.event),this._instance=t}init(){var t,n;L((t=this._instance)==null?void 0:t._addCaptureHook)||(this.Xl=(n=this._instance)==null?void 0:n._addCaptureHook((r,i)=>{this.on(r,i)}))}dispose(){var t;(t=this.Xl)==null||t.call(this),this.Xl=void 0,this.Gl=new Ac}register(t){var n,r;if(!L((n=this._instance)==null?void 0:n._addCaptureHook)&&(t.forEach(s=>{var o;this.Wl.add(s),(o=s.steps)==null||o.forEach(a=>{this.Vl.add((a==null?void 0:a.event)||"")})}),(r=this._instance)!=null&&r.autocapture)){var i=new Set;this.Wl.forEach(s=>{var o;(o=s.steps)==null||o.forEach(a=>{a!=null&&a.selector&&i.add(a.selector)})}),this._instance.autocapture.setElementSelectors(i)}}replace(t){this.Wl.clear(),this.Vl.clear(),this.register(t)}on(t,n){n!=null&&t.length!=0&&(this.Vl.has(t)||this.Vl.has(n.event))&&this.Wl.forEach(r=>{this.tu(n,r)&&this.Gl.emit("actionCaptured",r.name)})}eu(t){this.onAction("actionCaptured",n=>t(n))}tu(t,n){if((n==null?void 0:n.steps)==null)return!1;for(var r of n.steps)if(this.Zl(t,r))return!0;return!1}onAction(t,n){return this.Gl.on(t,n)}Jl(t,n){if(n!=null&&n.url){var r,i=t==null||(r=t.properties)==null?void 0:r.$current_url;if(!i||typeof i!="string"||!ms(i,n.url,n.url_matching||"contains"))return!1}return!0}Kl(t,n){return!!this.iu(t,n)&&!!this.ru(t,n)&&!!this.nu(t,n)}iu(t,n){var r;if(n==null||!n.href)return!0;var i=this.su(t);if(i.length>0)return i.some(a=>ms(a.href,n.href,n.href_matching||"exact"));var s,o=(t==null||(r=t.properties)==null?void 0:r.$elements_chain)||"";return!!o&&ms((s=o.match(/(?::|")href="(.*?)"/))?s[1]:"",n.href,n.href_matching||"exact")}ru(t,n){var r;if(n==null||!n.text)return!0;var i=this.su(t);if(i.length>0)return i.some(u=>ms(u.text,n.text,n.text_matching||"exact")||ms(u.$el_text,n.text,n.text_matching||"exact"));var s,o,a,l=(t==null||(r=t.properties)==null?void 0:r.$elements_chain)||"";return!!l&&(s=function(u){for(var c,d=[],f=/(?::|")text="(.*?)"/g;!ne(c=f.exec(u));)d.includes(c[1])||d.push(c[1]);return d}(l),o=n.text,a=n.text_matching||"exact",s.some(u=>ms(u,o,a)))}nu(t,n){var r,i;if(n==null||!n.selector)return!0;var s=t==null||(r=t.properties)==null?void 0:r.$element_selectors;if(s!=null&&s.includes(n.selector))return!0;var o=(t==null||(i=t.properties)==null?void 0:i.$elements_chain)||"";if(n.selector_regex&&o)try{return new RegExp(n.selector_regex).test(o)}catch{return!1}return!1}su(t){var n;return(t==null||(n=t.properties)==null?void 0:n.$elements)==null?[]:t==null?void 0:t.properties.$elements}Yl(t,n){return n==null||!n.properties||n.properties.length===0||tS(n.properties.reduce((r,i)=>{var s=Z(i.value)?i.value.map(String):i.value!=null?[String(i.value)]:[];return r[i.key]={values:s,operator:i.operator||"exact"},r},{}),t==null?void 0:t.properties)}}class jO{constructor(t){var n;this.au=[],this._instance=t,this.ou=new Map,this.lu=new Map,this.uu=new Map,this.hu=(n=this._instance)==null||n.onSessionId==null?void 0:n.onSessionId(r=>this.du(r))}vu(t){return!1}cu(){return null}fu(t){}pu(){}gu(t,n){return!!t&&tS(t.propertyFilters,n==null?void 0:n.properties)}mu(t,n){var r=new Map;return t.forEach(i=>{var s;(s=i.conditions)==null||(s=s[n])==null||(s=s.values)==null||s.forEach(o=>{if(o!=null&&o.name){var a=r.get(o.name)||[];a.push(i.id),r.set(o.name,a)}})}),r}yu(t,n,r){var i=(r===Xo.Activation?this.ou:this.lu).get(t),s=[];return this.bu(o=>{s=o.filter(a=>i==null?void 0:i.includes(a.id))}),s.filter(o=>{var a,l=(a=o.conditions)==null||(a=a[r])==null||(a=a.values)==null?void 0:a.find(u=>u.name===t);return this.gu(l,n)})}register(t){this._u(t,!1)}replace(t){this._u(t,!0)}_u(t,n){var r;L((r=this._instance)==null?void 0:r._addCaptureHook)||(this.wu(t,n),this.ku(t,n))}ku(t,n){var r=t.filter(o=>{var a;return(a=o.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length});if(n&&this.uu.clear(),r.length!==0){this.Su||(this.Su=new LO(this._instance),this.Su.init(),this.Su.eu(o=>this.onAction(o)));var i=[];r.forEach(o=>{var a;(a=o.conditions)==null||(a=a.actions)==null||a.values.forEach(l=>{if(i.push(l),l.name){var u,c=(u=this.uu.get(l.name))!==null&&u!==void 0?u:[];c.includes(o.id)||c.push(o.id),this.uu.set(l.name,c)}})}),n?this.Su.replace(i):this.Su.register(i)}else{var s;n&&((s=this.Su)==null||s.replace([]))}}xu(t,n){n.forEach((r,i)=>{var s,o=(s=t.get(i))!==null&&s!==void 0?s:[];r.forEach(a=>{o.includes(a)||o.push(a)}),t.set(i,o)})}wu(t,n){var r,i,s=t.filter(u=>{var c,d;return((c=u.conditions)==null?void 0:c.events)&&((d=u.conditions)==null||(d=d.events)==null||(d=d.values)==null?void 0:d.length)>0}),o=t.filter(u=>{var c,d;return((c=u.conditions)==null?void 0:c.cancelEvents)&&((d=u.conditions)==null||(d=d.cancelEvents)==null||(d=d.values)==null?void 0:d.length)>0}),a=this.mu(t,Xo.Activation),l=this.mu(t,Xo.Cancellation);n?(this.ou=a,this.lu=l):(this.xu(this.ou,a),this.xu(this.lu,l)),(s.length!==0||o.length!==0)&&((r=this.Xl)!==null&&r!==void 0||(this.Xl=(i=this._instance)==null?void 0:i._addCaptureHook((u,c)=>{this.onEvent(u,c)})))}onEvent(t,n){var r,i,s=this.Cu(),o=(n==null||(r=n.properties)==null?void 0:r.$survey_id)||(n==null||(i=n.properties)==null?void 0:i.$product_tour_id);if(o&&this.getActivatedIds().includes(o)){var a=this.Tu(t,o);if(a==="consume")return s.info("event consumed activated item, removing it",{event:t,itemId:o}),void this.Mu([o]);if(a==="persist")return s.info("shown item promoted to persisted activation",{event:t,itemId:o}),this.Eu(o),void this.Iu([o])}if(this.lu.has(t)){var l=this.yu(t,n,Xo.Cancellation);l.length>0&&(s.info("cancel event matched, cancelling items",{event:t,itemsToCancel:l.map(c=>c.id)}),this.Mu(l.map(c=>c.id)),l.forEach(c=>this.Ru(c.id)))}if(this.ou.has(t)){s.info("event name matched",{event:t,eventPayload:n,items:this.ou.get(t)});var u=this.yu(t,n,Xo.Activation);this.Pu(u.map(c=>c.id))}}onAction(t){this.uu.has(t)&&this.Pu(this.uu.get(t)||[])}Pu(t){var n;if(t.length!==0){var r=!((n=this._instance)==null||n.get_session_id==null||!n.get_session_id()),i=[];for(var s of t)r&&this.vu(s)?this.Eu(s)&&this.Au(s):i.push(s);i.length>0&&(this.au=[...new Set([...this.au,...i])]),this.Cu().info("updating activated items",{activatedItems:this.getActivatedIds()})}}Eu(t){this.au=this.au.filter(r=>r!==t);var n=this.Fu();return!n.includes(t)&&(this.Ou([...n,t]),this.Lu(),!0)}Mu(t){var n=new Set(t);this.au=this.au.filter(s=>!n.has(s));var r=this.$u(),i=r.filter(s=>!n.has(s));i.length!==r.length&&(this.Ou(i),i.length===0&&this.Du()),this.Iu(t)}Nu(){var t,n=this.cu();if(!n)return{};var r=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[n];return r&&typeof r=="object"?r:{}}Au(t){if(this.cu()){var n=this.Nu();this.fu($({},n,{[t]:Date.now()}))}}Iu(t){if(this.cu()){var n=this.Nu(),r={},i=!1;for(var s of Object.entries(n)){var o=s[0],a=s[1];t.includes(o)?i=!0:r[o]=a}i&&(En(r)?this.pu():this.fu(r))}}qu(){this.cu()&&this.pu()}getActivationTimestamp(t){if(this.Fu().includes(t)){var n=this.Nu()[t];return Ge(n)?n:void 0}}$u(){var t,n=this.ju();return((t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[n])||[]}Fu(){var t,n,r=this.$u();if(r.length===0)return[];var i=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[this.Bu()],s=(n=this._instance)==null||n.get_session_id==null?void 0:n.get_session_id();return s&&i===s?r:[]}Lu(){var t,n=(t=this._instance)==null||t.get_session_id==null?void 0:t.get_session_id();n&&this.Hu(n)}Du(){this.Uu()}du(t){var n,r=(n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[this.Bu()];if(r&&r!==t){var i=this.$u(),s=this.Nu();i.length>0&&(this.Ou([]),i.filter(o=>Ge(s[o])).forEach(o=>this.Ru(o))),this.Du(),this.qu()}}getActivatedIds(){return[...new Set([...this.Fu(),...this.au])].filter(t=>!this.zu(t))}dispose(){var t,n,r;(t=this.hu)==null||t.call(this),this.hu=void 0,(n=this.Xl)==null||n.call(this),this.Xl=void 0,(r=this.Su)==null||r.dispose(),this.Su=void 0}reset(){this.au=[],this.$u().length>0&&this.Ou([]),this.Du(),this.qu()}getEventToItemsMap(){return this.ou}Wu(){return this.Su}}class DO extends jO{constructor(t){super(t)}ju(){return gp}Bu(){return Ru}cu(){return Tu}fu(t){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[Tu]:t})}pu(){var t;(t=this._instance)==null||(t=t.persistence)==null||t.unregister(Tu)}vu(t){var n,r;this.bu(s=>{r=s.find(o=>o.id===t)});var i=(n=r)==null||(n=n.appearance)==null?void 0:n.surveyPopupDelaySeconds;return Ge(i)&&i>0}Vu(){return ur.SHOWN}bu(t){var n;(n=this._instance)==null||n.getSurveys(t)}Ru(t){var n;(n=this._instance)==null||n.cancelPendingSurvey(t)}Cu(){return he}Ou(t){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[gp]:t})}Hu(t){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[Ru]:t})}Uu(){var t;(t=this._instance)==null||(t=t.persistence)==null||t.unregister(Ru)}zu(){return!1}Tu(t,n){var r;this.bu(s=>{r=s.find(o=>o.id===n)});var i=!r||function(s){var o;return nS(s)&&!((o=s.conditions)==null||(o=o.events)==null||!o.repeatedActivation)||s.schedule==="always"}(r);return i?t===ur.SHOWN?"consume":"ignore":t===ur.SHOWN?"persist":t===ur.DISMISSED||t===ur.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class zO{constructor(t){this._instance=t}initialize(){}get(t){if(typeof t=="string")return this._instance.get_property(t);var n={};for(var r of t){var i=this._instance.get_property(r);L(i)||(n[r]=i)}return n}set(t,n){this._instance.register(typeof t=="string"?{[t]:n}:t)}remove(t){typeof t!="string"?t.forEach(n=>this._instance.unregister(n)):this._instance.unregister(t)}}class UO{constructor(t){this._instance=t}get(){var t=this._instance.config;return{disableSurveys:t.disable_surveys,cookielessMode:!!t.cookieless_mode,advancedEnableSurveys:t.advanced_enable_surveys,requestTimeoutMs:t.surveys_request_timeout_ms}}isOptedOut(){return this._instance.consent.isOptedOut()}getExtensions(){var t=Y==null?void 0:Y.__PosthogExtensions__;if(t){var n=t.generateSurveys,r=t.loadExternalDependency;return{generateSurveys:n?i=>n(this._instance,i):void 0,loadExternalDependency:r?i=>r(this._instance,"surveys",i):void 0}}}createEventReceiver(){return new DO(this._instance)}}var VO=I!=null&&I.location?Ic(I.location.hash,"__posthog")||Ic(location.hash,"state"):null,F_="_postHogToolbarParams",L_=Ie("[Toolbar]"),j_=Ie("[FeatureFlags]");class BO{constructor(t,n){n===void 0&&(n=!1),this.Gu=!1,this.update(t,n)}update(t,n){this.Zu=((r,i)=>{var s,o,a,l;return{bootstrap:{featureFlags:(s=r.bootstrap)==null?void 0:s.featureFlags,featureFlagPayloads:(o=r.bootstrap)==null?void 0:o.featureFlagPayloads},remoteRequestsDisabled:i,featureFlagsDisabled:!!r.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!r.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!r.advanced_feature_flags_dedup_per_session,cacheTtlMs:r.feature_flag_cache_ttl_ms,requestTimeoutMs:r.feature_flag_request_timeout_ms,compression:r.disable_compression?"none":"base64",evaluationContexts:(a=(l=r.evaluation_contexts)!==null&&l!==void 0?l:r.evaluation_environments)!==null&&a!==void 0?a:[],flagKeys:Z(r.flag_keys)?r.flag_keys:void 0}})(t,n),!t.evaluation_environments||t.evaluation_contexts||this.Gu||(j_.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Gu=!0),L(t.flag_keys)||Z(t.flag_keys)||j_.error("Invalid flag_keys found:",t.flag_keys,"Expected array of non-empty strings")}get(){return this.Zu}}var D_=Ie("[FeatureFlags]"),_i=Ie("[FeatureFlags]",{debugEnabled:!0}),Lf=`" failed. Feature flags didn't load in time.`,z_="connection_error",U_=e=>{for(var t={},n=0;e.length>n;n++)t[e[n]]=!0;return t},V_=e=>{var t={};for(var n of Iu(e||{})){var r=n[1];r&&(t[n[0]]=r)}return t},gn=Ie("[Error tracking]"),qO=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:"],WO=["__firefox__","__gCrWeb"],B_="Refusing to render web experiment since the viewer is a likely bot",HO={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>Nc(t,e),not_regex:(e,t)=>!Nc(t,e),exact:(e,t)=>t===e,is_not:(e,t)=>t!==e};class ht{get qi(){return this._instance.config}constructor(t){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments(i=>{ht.Qu("retrieved web experiments from the server"),n.Ju=new Map,i.forEach(s=>{if(s.feature_flag_key){var o;n.Ju&&(ht.Qu("setting flag key ",s.feature_flag_key," to web experiment ",s),(o=n.Ju)==null||o.set(s.feature_flag_key,s));var a=n._instance.getFeatureFlag(s.feature_flag_key);ce(a)&&s.variants[a]&&n.Ku(s.name,a,s.variants[a].transforms)}else if(s.variants)for(var l in s.variants){var u=s.variants[l];ht.Yu(u,n._instance)&&n.Ku(s.name,l,u.transforms)}})},r)},this._instance=t,this._instance.onFeatureFlags(r=>{this.onFeatureFlags(r)})}initialize(){}onFeatureFlags(t){if(this._is_bot())ht.Qu(B_);else if(!this.qi.disable_web_experiments){if(ne(this.Ju))return this.Ju=new Map,this.loadIfEnabled(),void this.previewWebExperiment();ht.Qu("applying feature flags",t),t.forEach(n=>{var r;if(this.Ju&&(r=this.Ju)!=null&&r.has(n)){var i,s=this._instance.getFeatureFlag(n),o=(i=this.Ju)==null?void 0:i.get(n);s&&o!=null&&o.variants[s]&&this.Ku(o.name,s,o.variants[s].transforms)}})}}previewWebExperiment(){var t=ht.getWindowLocation();if(t!=null&&t.search){var n=Co(t==null?void 0:t.search,"__experiment_id"),r=Co(t==null?void 0:t.search,"__experiment_variant");n&&r&&(ht.Qu("previewing web experiments "+n+" && "+r),this.getWebExperiments(i=>{this.Xu(parseInt(n),r,i)},!1,!0))}}loadIfEnabled(){this.qi.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,n,r){if(this.qi.disable_web_experiments&&!r)return t([]);var i=this._instance.get_property("$web_experiments");if(i&&!n)return t(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.qi.token),method:"GET",timestampMode:"query",callback:s=>t(s.statusCode===200&&s.json&&s.json.experiments||[])})}Xu(t,n,r){var i=r.filter(s=>s.id===t);i&&i.length>0&&(ht.Qu("Previewing web experiment ["+i[0].name+"] with variant ["+n+"]"),this.Ku(i[0].name,n,i[0].variants[n].transforms))}static Yu(t,n){return!ne(t.conditions)&&ht.th(t,n)&&ht.eh(t)}static th(t,n){var r;if(ne(t.conditions)||ne((r=t.conditions)==null?void 0:r.url))return!0;var i=ht.getWindowLocation();if(i){var s,o,a,l=mE(n,i.href);return(s=t.conditions)==null||!s.url||HO[(o=(a=t.conditions)==null?void 0:a.urlMatchType)!==null&&o!==void 0?o:"icontains"](t.conditions.url,l)}return!1}static getWindowLocation(){return I==null?void 0:I.location}static eh(t){var n;if(ne(t.conditions)||ne((n=t.conditions)==null?void 0:n.utm))return!0;var r=AE();if(r.utm_source){var i,s,o,a,l,u,c,d,f=(i=t.conditions)==null||(i=i.utm)==null||!i.utm_campaign||((s=t.conditions)==null||(s=s.utm)==null?void 0:s.utm_campaign)==r.utm_campaign,m=(o=t.conditions)==null||(o=o.utm)==null||!o.utm_source||((a=t.conditions)==null||(a=a.utm)==null?void 0:a.utm_source)==r.utm_source,_=(l=t.conditions)==null||(l=l.utm)==null||!l.utm_medium||((u=t.conditions)==null||(u=u.utm)==null?void 0:u.utm_medium)==r.utm_medium,p=(c=t.conditions)==null||(c=c.utm)==null||!c.utm_term||((d=t.conditions)==null||(d=d.utm)==null?void 0:d.utm_term)==r.utm_term;return f&&_&&p&&m}return!1}static Qu(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;n>i;i++)r[i-1]=arguments[i];D.info("[WebExperiments] "+t,r)}Ku(t,n,r){this._is_bot()?ht.Qu(B_):n!=="control"?r.forEach(i=>{if(i.selector){var s;ht.Qu("applying transform of variant "+n+" for experiment "+t+" ",i);var o=(s=document)==null?void 0:s.querySelectorAll(i.selector);o==null||o.forEach(a=>{var l=a;i.html&&(l.innerHTML=i.html),i.css&&l.setAttribute("style",i.css)})}}):ht.Qu("Control variants leave the page unmodified.")}_is_bot(){return St&&this._instance?JE(St,this.qi.custom_blocked_useragents):void 0}}var tn=Ie("[Conversations]"),wi="Conversations not available yet.",q_="console",uS="__posthogHandledLogsRequestError",jf=(e,t)=>{var n=e instanceof Error?e:new Error(t);return n[uS]=!0,n},W_=e=>!!e&&typeof e=="object"&&e[uS]===!0,hd={featureFlags:class{constructor(e){this.name="featureFlags",this.ih=!1,this.featureFlagEventHandlers=[],this.I=D_,this.rh={},this.nh={},this.sh=[],this.ah=!1,this.oh=!1,this.lh=0,this.uh=!1,this.hh=!1,this.dh=!1,this.fh=!1,this.ph=0,this.Tt=()=>{var t=this.gh();this.ph=0,t&&this.reloadFeatureFlags()},"get"in e?this.ts=e:(this.mh=new BO(e.config,e.ma()),this.ts=this.mh)}updateConfig(e,t){var n;(n=this.mh)==null||n.update(e,t)}setup(e){return this.Fl=e,this.I=e.logger.createLogger("[FeatureFlags]"),lS(e.kv.initialize(),()=>{this.Fl===e&&(this.Fl=void 0,this.ns=e,this.yh(e))})}yh(e){if(this.ns===e)return I&&Re(I,"online",this.Tt),this.bh=e.registerDynamicEventProperties(()=>this._h()?this.rh:this.nh),this.wh(),this.initialize()}destroy(){I==null||I.removeEventListener("online",this.Tt)}dispose(){var e;this.lh++,this.hh=!1,this.Fl=void 0,this.ns&&(this.kh(),(e=this.bh)==null||e.dispose(),this.bh=void 0,this.sh=[],I==null||I.removeEventListener("online",this.Tt),this.ns=void 0)}get qi(){return this.ts.get()}Sh(e){var t;return(t=this.ns)==null?void 0:t.kv.get(e)}Nr(e){this.xh(()=>{var t;return(t=this.ns)==null?void 0:t.kv.set(e)})}qr(e){this.xh(()=>{var t;return(t=this.ns)==null?void 0:t.kv.remove(e)})}xh(e){try{e()}catch(t){this.I.error("Failed to update feature flag persistence",t)}}wh(){var e={};for(var t of[Mi,Ai,Ks,Mn]){var n=this.Sh(t);L(n)||(e[t]=n)}this.rh=e;var r=$({},e),i=this.Sh(ir);if(i)for(var s of Object.entries(i))r["$feature/"+s[0]]=s[1];this.nh=r}_h(){var e=this.qi.cacheTtlMs;if(!e||0>=e)return!1;var t=this.Sh(Gi);return typeof t!="number"||Date.now()-t>e}Ch(){return!!this._h()&&(this.fh||this.oh||(this.fh=!0,this.I.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Th(){var e=this.qi.evaluationContexts;return e!=null&&e.length?e.filter(t=>{var n=t&&typeof t=="string"&&t.trim().length>0;return n||this.I.error("Invalid evaluation context found:",t,"Expected non-empty string"),n}):[]}Mh(){var e=this.qi.flagKeys;if(!L(e))return e.filter(t=>{var n=t&&typeof t=="string"&&t.trim().length>0;return n||this.I.error("Invalid flag key found:",t,"Expected non-empty string"),n})}initialize(){var e,t,n=this.qi,r=(e=(t=n.bootstrap)==null?void 0:t.featureFlags)!==null&&e!==void 0?e:{};if(Object.keys(r).length){var i,s,o=(i=(s=n.bootstrap)==null?void 0:s.featureFlagPayloads)!==null&&i!==void 0?i:{},a=Object.keys(r).filter(u=>!!r[u]).reduce((u,c)=>(u[c]=r[c]||!1,u),{}),l=Object.keys(o).filter(u=>a[u]).reduce((u,c)=>(u[c]=o[c],u),{});return this.Eh({featureFlags:a,featureFlagPayloads:l})}}updateFlags(e,t,n){var r,i,s=n!=null&&n.merge&&(r=this.Sh(ir))!==null&&r!==void 0?r:{},o=n!=null&&n.merge&&(i=this.Sh(Ai))!==null&&i!==void 0?i:{},a=$({},s,e),l=$({},o,t),u={};for(var c of Object.entries(a)){var d=c[0],f=c[1];u[d]={key:d,enabled:Ay(f),variant:Ny(f),reason:void 0,metadata:L(l==null?void 0:l[d])?void 0:{id:0,version:void 0,description:void 0,payload:l[d]}}}this.Eh({flags:u})}get hasLoadedFlags(){return this.ah}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.Sh(Xa),t=this.Sh(Mn),n=this.Sh(Ci);if(!n&&!t)return e||{};var r=_e({},e||{}),i=[...new Set([...Object.keys(n||{}),...Object.keys(t||{})])];for(var s of i){var o,a,l=r[s],u=t==null?void 0:t[s],c=L(u)?(o=l==null?void 0:l.enabled)!==null&&o!==void 0&&o:!!u,d=L(u)?l==null?void 0:l.variant:typeof u=="string"?u:void 0,f=n==null?void 0:n[s],m=$({},l,{enabled:c,variant:c?d??(l==null?void 0:l.variant):void 0});c!==(l==null?void 0:l.enabled)&&(m.original_enabled=l==null?void 0:l.enabled),d!==(l==null?void 0:l.variant)&&(m.original_variant=l==null?void 0:l.variant),f&&(m.metadata=$({},l==null?void 0:l.metadata,{payload:f,original_payload:l==null||(a=l.metadata)==null?void 0:a.payload})),r[s]=m}return this.ih||(this.I.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:r}),this.ih=!0),r}getAllFeatureFlags(){var e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map(n=>{var r=e[n];return{key:n,enabled:Ay(r),variant:Ny(r),payload:My(t[n])}})}getFlagVariants(){var e=this.Sh(ir),t=this.Sh(Mn);if(!t)return e||{};for(var n=_e({},e||{}),r=Object.keys(t),i=0;r.length>i;i++)n[r[i]]=t[r[i]];return this.ih||(this.I.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this.ih=!0),n}getFlagPayloads(){var e=this.Sh(Ai),t=this.Sh(Ci);if(!t)return e||{};for(var n=_e({},e||{}),r=Object.keys(t),i=0;r.length>i;i++)n[r[i]]=t[r[i]];return this.ih||(this.I.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),this.ih=!0),n}reloadFeatureFlags(){this.uh||this.qi.featureFlagsDisabled||this.gh()||this.Ih||(this.sh.slice().forEach(e=>{try{e()}catch(t){this.I.error("Error while running feature flags reloading callback",t)}}),this.Ih=setTimeout(()=>{this.Rh()},5))}kh(){clearTimeout(this.Ih),this.Ih=void 0}onReloading(e){return this.sh.push(e),()=>{this.sh=this.sh.filter(t=>t!==e)}}ensureFlagsLoaded(){this.ah||this.oh||this.Ih||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.uh=e}resetFlagCallReported(){this.qr(ar)}Rh(e){this.kh();var t=this.ns;if(t&&!this.qi.remoteRequestsDisabled&&!this.gh())if(this.oh)this.hh=!0;else{var n={token:t.projectToken,distinct_id:t.distinctId,groups:t.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:$({},t.initialPersonProperties,this.Sh(yn)||{},{$lib:t.library.name,$lib_version:t.library.version}),group_properties:this.Sh(Dn),timezone:DE()};L(t.deviceId)||(n.$device_id=t.deviceId),(e!=null&&e.disableFlags||this.qi.featureFlagsDisabled)&&(n.disable_flags=!0);var r=this.Th();r.length&&(n.evaluation_contexts=r);var i=this.Mh();L(i)||(n.flag_keys=i);var s=this.qi.onlyEvaluateSurveyFeatureFlags,o="/flags/?v=2"+(s?"&only_evaluate_survey_feature_flags=true":""),a=this.lh;this.oh=!0;var l=()=>{this.hh&&(this.hh=!1,this.Rh())},u=c=>{this.oh=!1,a===this.lh&&(this.Nr({[Qs]:[z_]}),this.I.error("Feature flag request failed",c)),l()};try{t.sendRequest(o,{target:"flags",method:"POST",body:n,compression:this.qi.compression==="base64"?Et.Base64:void 0,sentAt:"body",timeoutMs:this.qi.requestTimeoutMs}).then(c=>{var d,f,m=(d=c.json)!==null&&d!==void 0?d:{},_=c.statusCode!==200;if(this.oh=!1,a===this.lh){if(this.Ph(c.statusCode),_||this.hh||(this.$anon_distinct_id=void 0),!n.disable_flags||this.hh){this.dh=!_;var p=[];c.error?p.push(c.error instanceof Error&&c.error.name==="AbortError"?"timeout":c.error instanceof Error?z_:"unknown_error"):c.statusCode!==200&&p.push("api_error_"+c.statusCode),m.errorsWhileComputingFlags&&p.push("errors_while_computing_flags");var y=!((f=m.quotaLimited)==null||!f.includes("feature_flags"));y&&p.push("quota_limited"),this.Nr({[Qs]:p}),y?this.I.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):n.disable_flags||this.Eh(m,_,{partialResponse:s}),l()}}else l()}).catch(u)}catch(c){u(c)}}}gh(){return OE(this.ph,3)}Ph(e){this.ph=ME(e,this.ph,3,()=>this.I.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes."))}getFeatureFlag(e,t){var n;if(t===void 0&&(t={}),!t.fresh||this.dh)if(this.ah||this.getFlags()&&this.getFlags().length>0){if(!this.Ch()){var r=this.getFeatureFlagResult(e,t);return(n=r==null?void 0:r.variant)!==null&&n!==void 0?n:r==null?void 0:r.enabled}}else this.I.warn('getFeatureFlag for key "'+e+Lf)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return t==null?void 0:t.payload}getFeatureFlagResult(e,t){if(t===void 0&&(t={}),!t.fresh||this.dh)if(this.ah||this.getFlags()&&this.getFlags().length>0){if(!this.Ch()){var n,r=this.getFlagVariants(),i=e in r,s=r[e],o=this.getFlagPayloads()[e],a=String(s),l=this.Sh(Ks)||void 0,u=this.Sh(Gi)||void 0,c=this.Sh(ar)||{};if(this.qi.deduplicateCallsPerSession){var d,f=(d=this.ns)==null?void 0:d.session.sessionId,m=this.Sh(fa);f&&f!==m&&(c={},n=f)}if(t.send_event||!("send_event"in t))if(e in c&&c[e].includes(a))n&&this.Nr({[ar]:c,[fa]:n});else{var _,p,y,h,v,x,b,E,S,P,C,T;Z(c[e])?c[e].push(a):c[e]=[a],this.Nr($({[ar]:c},n?{[fa]:n}:{}));var R=this.getFeatureFlagDetails(e),N=[...(_=this.Sh(Qs))!==null&&_!==void 0?_:[]];L(s)&&N.push("flag_missing");var M={$feature_flag:e,$feature_flag_response:s,$feature_flag_payload:o??null,$feature_flag_request_id:l,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:(p=(y=this.qi.bootstrap)==null||(y=y.featureFlags)==null?void 0:y[e])!==null&&p!==void 0?p:null,$feature_flag_bootstrapped_payload:(h=(v=this.qi.bootstrap)==null||(v=v.featureFlagPayloads)==null?void 0:v[e])!==null&&h!==void 0?h:null,$used_bootstrap_value:!this.dh};L(R==null||(x=R.metadata)==null?void 0:x.has_experiment)||(M.$feature_flag_has_experiment=R.metadata.has_experiment),L(R==null||(b=R.metadata)==null?void 0:b.version)||(M.$feature_flag_version=R.metadata.version);var z,F=(E=R==null||(S=R.reason)==null?void 0:S.description)!==null&&E!==void 0?E:R==null||(P=R.reason)==null?void 0:P.code;F&&(M.$feature_flag_reason=F),R!=null&&(C=R.metadata)!=null&&C.id&&(M.$feature_flag_id=R.metadata.id),L(R==null?void 0:R.original_variant)&&L(R==null?void 0:R.original_enabled)||(M.$feature_flag_original_response=L(R.original_variant)?R.original_enabled:R.original_variant),R!=null&&(T=R.metadata)!=null&&T.original_payload&&(M.$feature_flag_original_payload=R==null||(z=R.metadata)==null?void 0:z.original_payload),N.length&&(M.$feature_flag_error=N.join(",")),this.Ah(M)}else n&&this.Nr({[ar]:c,[fa]:n});if(i)return{key:e,enabled:!!s,variant:typeof s=="string"?s:void 0,payload:My(o)}}}else this.I.warn('getFeatureFlagResult for key "'+e+Lf)}Ah(e){try{var t;(t=this.ns)==null||t.capture("$feature_flag_called",e).catch(n=>{this.I.error("Failed to capture feature flag call",n)})}catch(n){this.I.error("Failed to capture feature flag call",n)}}getRemoteConfigPayload(e,t){this.Fh(e,t)}Fh(e,t){var n=this;return Ce(function*(){var r=n.ns;if(r){var i={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},s=n.Th();s.length&&(i.evaluation_contexts=s);var o,a=n.Mh();L(a)||(i.flag_keys=a);try{var l,u=(l=(yield r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:i,compression:n.qi.compression==="base64"?Et.Base64:void 0,sentAt:"body",timeoutMs:n.qi.requestTimeoutMs})).json)==null?void 0:l.featureFlagPayloads;o=(u==null?void 0:u[e])||void 0}catch(c){return void n.I.error("Remote config feature flag request failed",c)}try{t(o)}catch(c){n.I.error("Remote config feature flag callback failed",c)}}})()}isFeatureEnabled(e,t){if(t===void 0&&(t={}),t.fresh&&!this.dh)return t.defaultValue;if(!(this.ah||this.getFlags()&&this.getFlags().length>0))return this.I.warn('isFeatureEnabled for key "'+e+Lf),t.defaultValue;var n=this.getFeatureFlag(e,t);return L(n)?t.defaultValue:!!n}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t,n){this.Eh(e,t,n)}Eh(e,t,n){if(this.ns){this.ah=!0;var r=function(i,s,o,a,l,u){s===void 0&&(s={}),o===void 0&&(o={}),a===void 0&&(a={}),u===void 0&&(u=D_);var c=((S,P)=>{var C=S.flags;return C?$({},S,{featureFlags:Object.fromEntries(Object.keys(C).map(T=>{var R;return[T,(R=C[T].variant)!==null&&R!==void 0?R:C[T].enabled]})),featureFlagPayloads:Object.fromEntries(Object.keys(C).filter(T=>C[T].enabled).filter(T=>{var R;return(R=C[T].metadata)==null?void 0:R.payload}).map(T=>{var R;return[T,(R=C[T].metadata)==null?void 0:R.payload]}))}):(S.featureFlags&&P.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),S)})(i,u),d=c.flags,f=c.featureFlags,m=c.featureFlagPayloads;if(f){var _=i.requestId,p=i.evaluatedAt;if(Z(f)){u.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var y={};if(f)for(var h=0;f.length>h;h++)y[f[h]]=!0;return{[Mi]:f,[ir]:y,[xc]:!1}}var v=f,x=m,b=d;if(l!=null&&l.partialResponse)v=$({},s,v),x=$({},o,x),b=$({},a,b);else if(i.errorsWhileComputingFlags)if(d){var E=new Set(Object.keys(d).filter(S=>{var P;return!((P=d[S])!=null&&P.failed)}));v=$({},s,Object.fromEntries(Object.entries(v).filter(S=>E.has(S[0])))),x=$({},o,Object.fromEntries(Object.entries(x||{}).filter(S=>E.has(S[0])))),b=$({},a,Object.fromEntries(Object.entries(b||{}).filter(S=>E.has(S[0]))))}else v=$({},s,v),x=$({},o,x),b=$({},a,b);return $({[Mi]:Object.keys(V_(v)),[ir]:v||{},[Ai]:x||{},[Xa]:b||{},[xc]:i.minimalFlagCalledEvents===!0},_?{[Ks]:_}:{},p?{[Gi]:p}:{})}}(e,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),n,this.I);r&&this.Nr(r),t||(this.fh=!1),this.Oh(t)}}override(e,t){t===void 0&&(t=!1),this.I.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){this.Lh(e)}Lh(e){if(this.ns){if(e===!1)return this.qr([Mn,Ci]),this.Oh(),void _i.info("All overrides cleared");if(Z(e))return this.Nr({[Mn]:U_(e)}),this.Oh(),void _i.info("Flag overrides set",{flags:e});if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var t,n=e;this.ih=!!((t=n.suppressWarning)!==null&&t!==void 0&&t);var r={},i=n.flags,s=n.payloads;return i&&(r[Mn]=Z(i)?U_(i):i),s&&(r[Ci]=s),Object.keys(r).length&&this.Nr(r),i===!1&&s===!1?this.qr([Mn,Ci]):i===!1?this.qr(Mn):s===!1&&this.qr(Ci),this.Oh(),i===!1?_i.info("Flag overrides cleared"):i&&_i.info("Flag overrides set",{flags:i}),void(s===!1?_i.info("Payload overrides cleared"):s&&_i.info("Payload overrides set",{payloads:s}))}if(e&&typeof e=="object")return this.Nr({[Mn]:e}),this.Oh(),void _i.info("Flag overrides set",{flags:e});this.I.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}else this.I.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ah){var t=this.$h(),n=t.flags,r=t.flagVariants;try{e(n,r)}catch(i){this.I.error("Error while running feature flags callback",i)}}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,n){var r=(this.Sh(Pu)||[]).find(l=>l.flagKey===e),i={["$feature_enrollment/"+e]:t},s={$feature_flag:e,$feature_enrollment:t,$set:i};r&&(s.$early_access_feature_name=r.name),n&&(s.$feature_enrollment_stage=n);var o=$({},this.getFlagVariants(),{[e]:t});this.Nr({[Mi]:Object.keys(V_(o)),[ir]:o,[yn]:$({},this.Sh(yn)||{},i)}),this.Oh();try{var a;(a=this.ns)==null||a.capture("$feature_enrollment_update",s).catch(l=>{this.I.error("Failed to capture early access feature enrollment",l)})}catch(l){this.I.error("Failed to capture early access feature enrollment",l)}}getEarlyAccessFeatures(e,t,n){t===void 0&&(t=!1);var r=this.Sh(Pu);!r||t?this.Dh(e,n):e(r)}Dh(e,t){var n=this;return Ce(function*(){var r=n.ns;if(r){var i,s=t?"&"+t.map(a=>"stage="+a).join("&"):"";try{var o=yield r.sendRequest("/api/early_access_features/?token="+r.projectToken+s,{target:"api",method:"GET",sentAt:"query"});if(!o.json)return;n.Nr({[Pu]:i=o.json.earlyAccessFeatures})}catch(a){return void n.I.error("Early access feature request failed",a)}try{e(i)}catch(a){n.I.error("Early access feature callback failed",a)}}})()}$h(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(n=>t[n]),flagVariants:Object.keys(t).filter(n=>t[n]).reduce((n,r)=>(n[r]=t[r],n),{})}}Oh(e){this.wh();var t=this.$h(),n=t.flags,r=t.flagVariants;this.featureFlagEventHandlers.forEach(i=>{try{i(n,r,{errorsLoading:e})}catch(s){this.I.error("Error while running feature flags callback",s)}})}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0),this.Nh(e,t)}Nh(e,t){t===void 0&&(t=!0);var n=this.Sh(yn)||{},r=(e==null?void 0:e.$set)||(e!=null&&e.$set_once?{}:e),i=e==null?void 0:e.$set_once,s={};if(i)for(var o in i)({}).hasOwnProperty.call(i,o)&&(o in n||(s[o]=i[o]));this.Nr({[yn]:$({},n,s,r)}),t&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=$({},this.Sh(yn)||{});e.forEach(r=>{delete n[r]}),this.Nr({[yn]:n}),t&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(e){e===void 0&&(e=!0),this.qr(yn),e&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this.Sh(Dn)||{},r=$({},n);for(var i of Object.keys(e))r[i]=$({},n[i],e[i]);this.Nr({[Dn]:r}),t&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.Sh(Dn)||{};this.Nr({[Dn]:$({},t,{[e]:{}})})}else this.qr(Dn)}reset(){this.lh++,this.hh=!1,this.rh={},this.nh={},this.ah=!1,this.uh=!1,this.dh=!1,this.$anon_distinct_id=void 0,this.kh(),this.ih=!1,this.ph=0}}},GO={sessionRecording:class{get qi(){return this._instance.config}get za(){return this._instance.persistence}get started(){var e;return!((e=this.qh)==null||!e.isStarted)}get status(){var e,t;return this.jh===na||this.jh===ru?this.jh:(e=(t=this.qh)==null?void 0:t.status)!==null&&e!==void 0?e:this.jh}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.jh=M_,this.Bh=void 0,this.Hh=!1,this.kt=(()=>{var t;if(j==null||!j.visibilityState||j.visibilityState==="visible")return!0;var n=I==null||(t=I.performance)==null||t.getEntriesByType==null?void 0:t.getEntriesByType("visibility-state");return!(n!=null&&n.length)||n.some(r=>r.name==="visible")})(),this.It=()=>{var t;(j==null?void 0:j.visibilityState)==="visible"&&(this.kt=!0,(t=this.qh)==null||t.setDocumentWasEverVisible==null||t.setDocumentWasEverVisible(!0))},this._instance=e,!this._instance.sessionManager)throw Yn.error("started without valid sessionManager"),new Error(Np+" started without valid sessionManager. This is a bug.");if(this.qi.cookieless_mode===lr)throw new Error(Np+' cannot be used with cookieless_mode="always"');j!=null&&j.addEventListener&&Re(j,"visibilitychange",this.It)}initialize(){this.startIfEnabledOrStop()}dispose(){this.Hh=!0,j==null||j.removeEventListener==null||j.removeEventListener("visibilitychange",this.It),this.stopRecording()}get Uh(){var e,t=!((e=this._instance.get_property(Oi))==null||!e.enabled),n=!this.qi.disable_session_recording,r=this.qi.disable_session_recording||this._instance.consent.isOptedOut();return I&&t&&n&&!r}startIfEnabledOrStop(e){var t;if(!(this.Hh||this.Uh&&(t=this.qh)!=null&&t.isStarted)){var n=!L(Object.assign)&&!L(Array.from);this.Uh&&n?(this.zh(e),Yn.info("starting")):(this.jh=M_,this.stopRecording())}}zh(e){var t,n,r;this.Uh&&(this.jh!==na&&this.jh!==ru&&(this.jh=A_),Y!=null&&(t=Y.__PosthogExtensions__)!=null&&(t=t.rrweb)!=null&&t.record&&(n=Y.__PosthogExtensions__)!=null&&n.initSessionRecording?this.Wh(e):(r=Y.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.Vh,i=>{if(i)return this._instance.register_for_session({[xp]:!0}),Yn.error("could not load recorder",i);this.Wh(e)}))}stopRecording(){var e,t;(e=this.Bh)==null||e.call(this),this.Bh=void 0,(t=this.qh)==null||t.stop()}Gh(){var e,t;(e=this.Bh)==null||e.call(this),this.Bh=void 0,(t=this.qh)==null||t.discard()}Zh(){var e,t;(e=this.za)==null||e.unregister(bg),(t=this.za)==null||t.unregister(sE)}Qh(e,t){if(ne(e))return null;var n,r=Ge(e)?e:parseFloat(e);return typeof(n=r)!="number"||!Number.isFinite(n)||0>n||n>1?(Yn.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):r}Jh(e){if(this.za){var t,n,r=this.za,i=()=>{var s,o=e.sessionRecording===!1?void 0:e.sessionRecording,a=this.Qh((s=this.qi.session_recording)==null?void 0:s.sampleRate,"session_recording.sampleRate"),l=this.Qh(o==null?void 0:o.sampleRate,"remote config sampleRate"),u=a??l;ne(u)&&this.Zh();var c=o==null?void 0:o.minimumDurationMilliseconds;r.register({[Oi]:$({cache_timestamp:Date.now(),enabled:!!o},o,{networkPayloadCapture:$({capturePerformance:e.capturePerformance},o==null?void 0:o.networkPayloadCapture),canvasRecording:{enabled:o==null?void 0:o.recordCanvas,fps:o==null?void 0:o.canvasFps,quality:o==null?void 0:o.canvasQuality},sampleRate:u,minimumDurationMilliseconds:L(c)?null:c,endpoint:o==null?void 0:o.endpoint,triggerMatchType:o==null?void 0:o.triggerMatchType,masking:o==null?void 0:o.masking,urlTriggers:o==null?void 0:o.urlTriggers,version:o==null?void 0:o.version,triggerGroups:o==null?void 0:o.triggerGroups})})};i(),(t=this.Bh)==null||t.call(this),this.Bh=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(i)}}onRemoteConfig(e){var t=e.ok?e.config:void 0;return t&&"sessionRecording"in t?t.sessionRecording===!1?(this.Jh(t),void this.Gh()):(this.Jh(t),void this.startIfEnabledOrStop()):(this.jh===na&&(this.jh=ru,Yn.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t){var n;t===void 0&&(t="log"),(n=this.qh)!=null&&n.log?this.qh.log(e,t):Yn.warn("log called before recorder was ready")}get Vh(){var e,t,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(Oi);return(n==null||(t=n.scriptConfig)==null?void 0:t.script)||"lazy-recorder"}Kh(){var e,t=this._instance.get_property(Oi);if(!t)return!1;try{e=typeof t=="object"?t:JSON.parse(t)}catch(n){return Yn.warn("persisted remote config for session recording is invalid and will be ignored",n),!1}return!ne(e.cache_timestamp)&&36e5>=Date.now()-e.cache_timestamp}Wh(e){var t,n,r;if(!this.Hh){if((t=Y.__PosthogExtensions__)==null||!t.initSessionRecording)return Yn.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[xp]:!0});var i;if(this.qh||(this.qh=(i=Y.__PosthogExtensions__)==null?void 0:i.initSessionRecording(this._instance,this.kt),this.qh._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Kh())return this.jh===ru||this.jh===na?void 0:(this.jh=na,Yn.info("persisted remote config is stale, requesting fresh config before starting"),void new zE(this._instance).load());this.jh=A_,(n=(r=this.qh).setDocumentWasEverVisible)==null||n.call(r,this.kt),this.qh.start(e)}}onRRwebEmit(e){var t;(t=this.qh)==null||t.onRRwebEmit==null||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.qh||(t=this.za)==null||t.register({[aE]:!0}),(e=this.qh)==null||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.qh||(t=this.za)==null||t.register({[oE]:!0}),(e=this.qh)==null||e.overrideSampling()}overrideTrigger(e){var t,n;this.qh||(n=this.za)==null||n.register({[e==="url"?lE:uE]:!0}),(t=this.qh)==null||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.qh)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var n;return!((n=this.qh)==null||!n.tryAddCustomEvent(e,t))}}},KO={autocapture:class extends OO{constructor(e){super(new MO(e)),this.instance=e}},historyAutocapture:class{constructor(e){this._instance=e,this.Yh=this.Xh()}initialize(){this.startIfEnabled()}get isEnabled(){var e=this.td();return!!(e.path||e.search||this.ed(e))}startIfEnabled(){this.isEnabled&&(D.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.Yh=this.Xh(),this.startIfEnabled()}stop(){this.rd&&this.rd(),this.rd=void 0,this.nd&&this.nd(),this.nd=void 0,D.info("History API monitoring stopped")}monitorHistoryChanges(){I&&I.history&&(this.sd("pushState"),this.sd("replaceState"),this.ad(),this.ed()&&this.od())}sd(e){var t;if(I&&((t=I.history[e])==null||!t.__posthog_wrapped__)){var n=this;(function(r,i,s){try{if(!(i in r))return I_;var o={next:r[i]},a=s(function(){for(var l=arguments.length,u=new Array(l),c=0;l>c;c++)u[c]=arguments[c];return o.next.apply(this,u)});return vt(a)&&(a.prototype=a.prototype||{},Object.defineProperties(a,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:o}})),r[i]=a,()=>{if(r[i]!==a)for(var l=r[i];vt(l)&&l.__posthog_layer__;){var u=l.__posthog_layer__;if(u.next===a)return void(u.next=o.next);l=u.next}else r[i]=o.next}}catch{return I_}})(I.history,e,r=>function(i,s,o){r.call(this,i,s,o),n.ld(e)})}}Xh(){var e=I==null?void 0:I.location;if(e!=null&&e.pathname)return{pathname:e.pathname,search:e.search,hash:e.hash}}td(){var e=this._instance.config.capture_pageview;return e==="history_change"?{path:!0}:Se(e)?e:{}}ed(e){return e===void 0&&(e=this.td()),!!e.hash&&!this._instance.config.disable_capture_url_hashes}ud(e){var t=this.td(),n=this.Yh;return!(!n||!(t.path&&e.pathname!==n.pathname||t.search&&e.search!==n.search||this.ed(t)&&e.hash!==n.hash))}ld(e){try{var t=this.Xh();if(!t)return;this.ud(t)&&this._instance.capture(bs,{navigation_type:e}),this.Yh=t}catch(n){D.error("Error capturing "+e+" pageview",n)}}ad(){if(!this.rd){var e=()=>{this.ld("popstate")};Re(I,"popstate",e),this.rd=()=>{I&&I.removeEventListener("popstate",e)}}}od(){if(!this.nd){var e=()=>{this.ld("hashchange")};Re(I,"hashchange",e),this.nd=()=>{I&&I.removeEventListener("hashchange",e)}}}},heatmaps:class{get qi(){return this.instance.config}constructor(e){var t;this.hd=!1,this.Qn=!1,this.dd=null,this.instance=e,this.hd=!((t=this.instance.persistence)==null||!t.props[up]),this.rageclicks=new aS(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return Se(this.qi.capture_heatmaps)&&this.qi.capture_heatmaps.flush_interval_milliseconds&&(e=this.qi.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return ne(this.qi.capture_heatmaps)?ne(this.qi.enable_heatmaps)?this.hd:this.qi.enable_heatmaps:this.qi.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.Qn)return;NO.info("starting..."),this.vd(),this.It()}else{var e;clearInterval((e=this.dd)!==null&&e!==void 0?e:void 0),this.fd(),this.getAndClearBuffer()}}onRemoteConfig(e){if(e.ok){var t=e.config;if("heatmaps"in t){var n=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[up]:n}),this.hd=n,this.startIfEnabled()}}}getAndClearBuffer(){var e=this.ft;return this.ft=void 0,e}pd(e){$f(e.originalEvent)&&this.ki(e.originalEvent,"deadclick")}It(){this.dd&&clearInterval(this.dd),this.dd=(j==null?void 0:j.visibilityState)==="visible"?setInterval(this.Oa.bind(this),this.flushIntervalMilliseconds):null}vd(){I&&j&&(this.gd=this.Oa.bind(this),Re(I,kc,this.gd),this.md=e=>this.ki(e||(I==null?void 0:I.event)),Re(j,"click",this.md,{capture:!0}),this.yd=e=>this.bd(e||(I==null?void 0:I.event)),Re(j,"mousemove",this.yd,{capture:!0}),this._d=new d_(this.instance,qI,this.pd.bind(this)),this._d.startIfEnabledOrStop(),this.wd=this.It.bind(this),Re(j,Cc,this.wd),this.Qn=!0)}fd(){var e;I&&j&&(this.gd&&I.removeEventListener(kc,this.gd),this.md&&j.removeEventListener("click",this.md,{capture:!0}),this.yd&&j.removeEventListener("mousemove",this.yd,{capture:!0}),this.wd&&j.removeEventListener(Cc,this.wd),clearTimeout(this.kd),(e=this._d)==null||e.stop(),this.Qn=!1)}Sd(e,t){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),i=this.instance.scrollManager.scrollElement(),s=function(o,a,l){for(var u=o;u&&ui(u)&&!Kt(u,"body");){if(u===l)return!1;var c=void 0;try{var d,f,m;c=(d=(f=(m=u.ownerDocument)==null?void 0:m.defaultView)!==null&&f!==void 0?f:I)==null?void 0:d.getComputedStyle(u).position}catch{return!1}if(J(a,c))return!0;u=EE(u)}return!1}(Sp(e),["fixed","sticky"],i);return{x:e.clientX+(s?0:r),y:e.clientY+(s?0:n),target_fixed:s,type:t}}ki(e,t){var n;if(t===void 0&&(t="click"),!t_(e.target)&&$f(e)){var r=this.Sd(e,t);(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&CE(Sp(e),this.instance.config.rageclick)&&this.Nn($({},r,{type:"rageclick"})),this.Nn(r)}}bd(e){!t_(e.target)&&$f(e)&&(clearTimeout(this.kd),this.kd=setTimeout(()=>{this.Nn(this.Sd(e,"mousemove"))},500))}Nn(e){if(I){var t=this.qi.disable_capture_url_hashes?li(I.location.href):I.location.href,n=this.qi.custom_personal_data_properties,r=this.qi.mask_personal_data_properties?[...ko,...n||[]]:[],i=Za(t,r,el);this.ft=this.ft||{},this.ft[i]||(this.ft[i]=[]),this.ft[i].push(e)}}Oa(){this.ft&&!En(this.ft)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:d_,webVitalsAutocapture:class{constructor(e){var t;this.hd=!1,this.Qn=!1,this.ft={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.xd=()=>{clearTimeout(this.Cd),this.Cd=void 0,this.ft.metrics.length!==0&&(this._instance.capture("$web_vitals",$({$current_url:this.ft.url},this.ft.metrics.reduce((n,r)=>$({},n,{["$web_vitals_"+r.name+"_event"]:$({},r),["$web_vitals_"+r.name+"_value"]:r.value}),{}))),this.ft={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Td=n=>{var r;if(this.ft=this.ft||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},ne(n==null?void 0:n.name)||ne(n==null?void 0:n.value))yi.error("Invalid metric received",n);else{var i=typeof n.navigationURL=="string"?n.navigationURL:void 0,s=this.Md(i);if(!L(s)){var o=Ge(n.navigationId)||typeof n.navigationId=="string"?"navigation:"+n.navigationId:"url:"+s;if(!this.Ed||this.Ed>n.value){this.ft.navigationKey!==o&&(this.xd(),this.Cd=setTimeout(this.xd,this.flushToCaptureTimeoutMs)),L(this.ft.navigationKey)&&(this.ft.navigationKey=o,this.ft.url=s),this.ft.firstMetricTimestamp=L(this.ft.firstMetricTimestamp)?Date.now():this.ft.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0);var a=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0),l=$({},n,i?{navigationURL:s}:{},{$current_url:s,timestamp:Date.now()});L(a)||(l.$session_id=a.sessionId,l.$window_id=a.windowId),this.ft.metrics.push(l),this.ft.metrics.length===this.allowedMetrics.length&&this.xd()}else yi.error("Ignoring metric with value >= "+this.Ed,n)}}},this.Id=()=>{if(!this.Qn){var n,r,i,s,o=Y.__PosthogExtensions__,a=o==null?void 0:o.postHogWebVitalsCallbacksByFlavor,l=(a==null?void 0:a[this.Rd])||(this.Rd==="web-vitals"&&L(a)?o==null?void 0:o.postHogWebVitalsCallbacks:void 0);if(L(l)||(n=l.onLCP,r=l.onCLS,i=l.onFCP,s=l.onINP),n&&r&&i&&s){var u={reportSoftNavs:this.useSoftNavs};this.allowedMetrics.indexOf("LCP")>-1&&n(this.Td.bind(this),u),this.allowedMetrics.indexOf("CLS")>-1&&r(this.Td.bind(this),u),this.allowedMetrics.indexOf("FCP")>-1&&i(this.Td.bind(this),u),this.allowedMetrics.indexOf("INP")>-1&&s(this.Td.bind(this),u),this.Qn=!0}else yi.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.hd=!((t=this._instance.persistence)==null||!t.props[hp]),this.startIfEnabled()}get Pd(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,n=Se(this.Pd)?(e=this.Pd)==null?void 0:e.web_vitals_allowed_metrics:void 0;return ne(n)?((t=this._instance.persistence)==null?void 0:t.props[pp])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(Se(this.Pd)?this.Pd.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=Se(this.Pd)?this.Pd.web_vitals_attribution:void 0;return e!=null&&e}get useSoftNavs(){var e=Se(this.Pd)?this.Pd.__preview_web_vitals_soft_navs:void 0;return e!=null&&e}get Ed(){var e=Se(this.Pd)&&Ge(this.Pd.__web_vitals_max_value)?this.Pd.__web_vitals_max_value:O_;return e>0&&6e4>=e?O_:e}get isEnabled(){var e=Ae==null?void 0:Ae.protocol;if(e!=="http:"&&e!=="https:")return yi.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=Se(this.Pd)?this.Pd.web_vitals:$t(this.Pd)?this.Pd:void 0;return $t(t)?t:this.hd}startIfEnabled(){this.isEnabled&&!this.Qn&&(yi.info("enabled, starting..."),this._s(this.Id))}onRemoteConfig(e){if(e.ok){var t=e.config;if("capturePerformance"in t){var n=Se(t.capturePerformance)&&!!t.capturePerformance.web_vitals,r=Se(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[hp]:n}),this._instance.persistence.register({[pp]:r})),this.hd=n,this.startIfEnabled()}}}get Rd(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}_s(e){var t=Y.__PosthogExtensions__,n=this.Rd,r=t==null?void 0:t.postHogWebVitalsCallbacksByFlavor;r!=null&&r[n]||n==="web-vitals"&&L(r)&&t!=null&&t.postHogWebVitalsCallbacks?e():t==null||t.loadExternalDependency==null||t.loadExternalDependency(this._instance,n,i=>{i?yi.error("failed to load script",i):e()})}Md(e){var t=e||(I==null?void 0:I.location.href);if(t){var n=this._instance.config.disable_capture_url_hashes?li(t):t,r=this._instance.config.custom_personal_data_properties,i=this._instance.config.mask_personal_data_properties?[...ko,...r||[]]:[];return Za(n,i,el)}yi.error("Could not determine current URL")}}},QO={exceptionObserver:class{constructor(e){var t;this.Id=()=>{var n;if(I&&this.isEnabled&&(n=Y.__PosthogExtensions__)!=null&&n.errorWrappingFunctions){var r=Y.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=Y.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,s=Y.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Ad&&this.qi.capture_unhandled_errors&&(this.Ad=r(this.captureException.bind(this))),!this.Fd&&this.qi.capture_unhandled_rejections&&(this.Fd=i(this.captureException.bind(this))),!this.Od&&this.qi.capture_console_errors&&(this.Od=s(this.captureException.bind(this)))}catch(o){ta.error("failed to start",o),this.Ld()}}},this._instance=e,this.$d=!((t=this._instance.persistence)==null||!t.props[cp]),this.oe=new LT($({},function(n){var r,i,s,o;return n===void 0&&(n={}),{refillRate:(r=(i=n.exceptionRateLimiterRefillRate)!==null&&i!==void 0?i:n.__exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:1,bucketSize:(s=(o=n.exceptionRateLimiterBucketSize)!==null&&o!==void 0?o:n.__exceptionRateLimiterBucketSize)!==null&&s!==void 0?s:10}}(this._instance.config.error_tracking),{refillInterval:1e4,I:ta})),this.qi=this.Dd(),this.startIfEnabledOrStop()}Dd(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Se(e)?t=$({},t,e):(L(e)?this.$d:e)&&(t=$({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.qi.capture_console_errors||this.qi.capture_unhandled_errors||this.qi.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(ta.info("enabled"),this.Ld(),this._s(this.Id)):this.Ld()}_s(e){var t,n;(t=Y.__PosthogExtensions__)!=null&&t.errorWrappingFunctions?e():(n=Y.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",r=>{if(r)return ta.error("failed to load script",r);e()})}Ld(){var e,t,n;(e=this.Ad)==null||e.call(this),this.Ad=void 0,(t=this.Fd)==null||t.call(this),this.Fd=void 0,(n=this.Od)==null||n.call(this),this.Od=void 0}onRemoteConfig(e){if(e.ok){var t=e.config;"autocaptureExceptions"in t&&(this.$d=!!t.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[cp]:this.$d}),this.qi=this.Dd(),this.startIfEnabledOrStop())}}onConfigChange(){this.qi=this.Dd()}captureException(e){var t,n,r,i=(t=e==null||(n=e.$exception_list)==null||(n=n[0])==null?void 0:n.type)!==null&&t!==void 0?t:"Exception";this.oe.consumeRateLimit(i)?ta.info("Skipping exception capture because of client rate limiting.",{exception:i}):(r=this._instance.exceptions)==null||r.sendExceptionEvent(e)}},exceptions:class{constructor(e){var t,n;this.Nd=[],this.qd=new nI([new cI,new _I,new fI,new dI,new mI,new gI,new pI,new yI],function(r){for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;i>o;o++)s[o-1]=arguments[o];return function(a,l){l===void 0&&(l=0);for(var u=[],c=a.split(` +`),d=l;c.length>d;d++){var f=c[d];if(1024>=f.length){var m=Ky.test(f)?f.replace(Ky,"$1"):f;if(!m.match(/\S*Error: /)){for(var _ of s){var p=_(m,r);if(p){u.push(p);break}}if(u.length>=50)break}}}return function(y){if(!y.length)return[];var h=Array.from(y);return h.reverse(),h.slice(0,50).map(v=>{return $({},v,{filename:v.filename||(x=h,x[x.length-1]||{}).filename,function:v.function||Eo});var x})}(u)}}("web:javascript",oI,uI)),this._instance=e,this.Nd=(t=(n=this._instance.persistence)==null?void 0:n.get_property(dp))!==null&&t!==void 0?t:[],this.jd=_c(this.Bd()),this.Hd=new xI(this.jd)}onConfigChange(){this.jd=_c(this.Bd()),this.Hd.setConfig(this.jd)}onRemoteConfig(e){var t,n,r;if(e.ok){var i=e.config;if("errorTracking"in i){var s=(t=(n=i.errorTracking)==null?void 0:n.suppressionRules)!==null&&t!==void 0?t:[],o=(r=i.errorTracking)==null?void 0:r.captureExtensionExceptions;this.Nd=s,this._instance.persistence&&this._instance.persistence.register({[dp]:this.Nd,[fp]:o})}}}get Ud(){var e,t=!!this._instance.get_property(fp),n=this._instance.config.error_tracking.captureExtensionExceptions;return(e=n??t)!==null&&e!==void 0&&e}buildProperties(e,t){return this.qd.buildFromUnknown(e,{syntheticException:t==null?void 0:t.syntheticException,mechanism:{handled:t==null?void 0:t.handled}})}addExceptionStep(e,t){if(this.jd.enabled)try{if(!ce(e)||e.trim().length===0)return void gn.warn("Ignoring exception step because message must be a non-empty string");var n=function(s){if(!s)return{sanitizedProperties:{},droppedKeys:[]};var o=[];return{sanitizedProperties:Object.keys(s).reduce((a,l)=>wI.has(l)?(o.push(l),a):(a[l]=s[l],a),{}),droppedKeys:o}}(this.zd(t)),r=n.sanitizedProperties,i=n.droppedKeys;i.length>0&&gn.warn("Ignoring reserved exception step fields",{droppedKeys:i}),this.Hd.add($({[mc]:e,[yc]:new Date().toISOString()},r))}catch(s){gn.error("Failed to add exception step. Ignoring breadcrumb.",s)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this.Wd(t)){if(this.Vd(t))return this.Gd("Exception dropped: matched a suppression rule"),void gn.info("Skipping exception capture because a suppression rule matched");if(!this.Ud&&this.Zd(t))return this.Gd("Exception dropped: thrown by a browser extension"),void gn.info("Skipping exception capture because it was thrown by an extension");if(!this.Ud&&this.Qd(t))return this.Gd("Exception dropped: thrown by an injected browser script"),void gn.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Jd(t))return this.Gd("Exception dropped: thrown by the PostHog SDK"),void gn.info("Skipping exception capture because it was thrown by the PostHog SDK")}var n=this.jd.enabled&&ne(e.$exception_steps)?this.Kd(e):e,r=typeof(s=globalThis._posthogReleaseId)=="string"&&s.length>0?s:void 0;r&&(n.$release_id=r);try{var i=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",fl:!0});return i&&this.Hd.clear(),i}catch(o){return gn.error("Failed to capture exception event. Dropping this exception.",o),void this.Hd.clear()}}catch(o){return void gn.error("Failed to process exception event. Ignoring this exception.",o)}var s}Kd(e){try{var t=this.Hd.getAttachable();return t.length===0?e:$({},e,{$exception_steps:t})}catch(n){return gn.error("Failed to read buffered exception steps. Capturing exception without steps.",n),e}}Gd(e){this.jd.enabled&&this.Hd.add({[mc]:e,[yc]:new Date().toISOString()})}zd(e){return Se(e)?$({},e):{}}Bd(){var e,t;return(e=(t=this._instance.config.error_tracking)==null?void 0:t.exception_steps)!==null&&e!==void 0?e:{}}Vd(e){if(e.length===0)return!1;try{var t=e.reduce((n,r)=>{var i=r.type,s=r.value;return ce(i)&&i.length>0&&n.$exception_types.push(i),ce(s)&&s.length>0&&n.$exception_values.push(s),n},{$exception_types:[],$exception_values:[]});return this.Nd.some(n=>{var r=n.values.map(i=>{var s=eS[i.operator],o=t[i.key];if(!s||!o)return!1;var a=Z(i.value)?i.value:[i.value];return a.length>0&&s(a,o)});return n.type==="OR"?r.some(Boolean):r.every(Boolean)})}catch(n){return gn.warn("Failed to evaluate suppression rules. Capturing the exception.",n),!1}}Zd(e){return e.flatMap(t=>{var n,r;return(n=(r=t.stacktrace)==null?void 0:r.frames)!==null&&n!==void 0?n:[]}).some(t=>{var n=t.filename;return!!n&&qO.some(r=>n.startsWith(r))})}Qd(e){return e.some(t=>{var n=t.value;return ce(n)&&WO.some(r=>n.includes(r))})}Jd(e){if(e.length>0){var t,n,r,i,s=(t=(n=e[0].stacktrace)==null?void 0:n.frames)!==null&&t!==void 0?t:[],o=s[s.length-1];return(r=o==null||(i=o.filename)==null?void 0:i.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}Wd(e){return!ne(e)&&Z(e)}}},YO=$({productTours:class{get za(){return this._instance.persistence}constructor(e){this.Yd=null,this.Xd=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(e.ok){var t=e.config;if("productTours"in t){var n,r;if(this.za&&this.za.register({[xg]:!!t.productTours}),!Ff(this._instance))return!this.Yd&&ne((n=this.za)==null?void 0:n.props[da])||iu.info("product tours disabled; stopping and clearing cached tours"),(r=this.Yd)==null||r.stop(),this.Yd=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.Yd&&Ff(this._instance)&&this._s(()=>this.tv())}_s(e){var t,n;(t=Y.__PosthogExtensions__)!=null&&t.generateProductTours?e():(n=Y.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"product-tours",r=>{r?iu.error("Could not load product tours script",r):e()})}tv(){var e;!this.Yd&&(e=Y.__PosthogExtensions__)!=null&&e.generateProductTours&&(this.Yd=Y.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(t===void 0&&(t=!1),!Z(this.Xd)||t){var n=this.za;if(n){var r=n.props[da];if(Z(r)&&!t)return this.Xd=r,void e(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",timestampMode:"query",callback:i=>{if(Ff(this._instance)){var s=i.statusCode;if(s!==200||!i.json){var o="Product Tours API could not be loaded, status: "+s;return s===0?i.error||iu.warn(o):iu.error(o),void e([],{isLoaded:!1,error:o})}var a=Z(i.json.product_tours)?i.json.product_tours:[];this.Xd=a,n&&n.register({[da]:a}),e(a,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this.Xd,{isLoaded:!0})}getActiveProductTours(e){ne(this.Yd)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.Yd.getActiveProductTours(e)}showProductTour(e){var t;(t=this.Yd)==null||t.showTourById(e)}previewTour(e){this.Yd?this.Yd.previewTour(e):this._s(()=>{var t;this.tv(),(t=this.Yd)==null||t.previewTour(e)})}dismissProductTour(){var e;(e=this.Yd)==null||e.dismissTour("user_clicked_skip")}nextStep(){var e;(e=this.Yd)==null||e.nextStep()}previousStep(){var e;(e=this.Yd)==null||e.previousStep()}clearCache(){var e;this.Xd=null,(e=this.za)==null||e.unregister(da)}resetTour(e){var t;(t=this.Yd)==null||t.resetTour(e)}resetAllTours(){var e;(e=this.Yd)==null||e.resetAllTours()}cancelPendingTour(e){var t;(t=this.Yd)==null||t.cancelPendingTour(e)}}},hd),XO={siteApps:class{constructor(e){this.ev=0,this._instance=e,this.iv=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}rv(e,t){if(t){var n=this.globalsForEvent(t);this.iv.push(n),this.iv.length>1e3&&(this.iv=this.iv.slice(10))}}get siteAppLoaders(){var e;return(e=Y._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.rv.bind(this));this.nv=()=>{e(),this.iv=[],this.nv=void 0}}}globalsForEvent(e){var t,n,r,i,s,o,a;if(!e)throw new Error("Event payload is required");var l={},u=this._instance.get_property("$groups")||[],c=this._instance.get_property("$stored_group_properties")||{};for(var d of Object.entries(c)){var f=d[0];l[f]={id:u[f],type:f,properties:d[1]}}var m=e.$set_once,_=e.$set;return{event:$({},xb(e,$O),{properties:$({},e.properties,_?{$set:$({},(t=(n=e.properties)==null?void 0:n.$set)!==null&&t!==void 0?t:{},_)}:{},m?{$set_once:$({},(r=(i=e.properties)==null?void 0:i.$set_once)!==null&&r!==void 0?r:{},m)}:{}),elements_chain:(s=(o=e.properties)==null?void 0:o.$elements_chain)!==null&&s!==void 0?s:"",distinct_id:(a=e.properties)==null?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}sv(e){var t,n=(t=e.tagName)==null?void 0:t.toLowerCase();return n==="style"&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(e)||(On.error("prepare_external_dependency_stylesheet returned null"),null):n==="script"&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(e)||(On.error("prepare_external_dependency_script returned null"),null):e}av(){var e,t,n,r,i,s,o,a;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var l=j==null?void 0:j.defaultView,u=l==null||(e=l.Node)==null?void 0:e.prototype;if(!l||!u)return()=>{};if(this.ev++,this.ov)return this.lv();var c=[],d=this,f=new WeakSet,m=(y,h,v)=>{if(y!=null&&y[h]){var x=y[h];y[h]=v(x),c.push(()=>{y[h]=x})}},_=y=>{if(f.has(y))return y;var h=d.sv(y);return h&&f.add(h),h},p=y=>y.map(h=>typeof h=="string"?h:_(h)).filter(h=>!rt(h));return m(u,"appendChild",y=>function(h){var v=_(h);return v?y.call(this,v):h}),m(u,"insertBefore",y=>function(h,v){var x=_(h);return x?y.call(this,x,v):h}),m(u,"replaceChild",y=>function(h,v){var x=_(h);return x?y.call(this,x,v):v}),[(t=l.Element)==null?void 0:t.prototype,(n=l.Document)==null?void 0:n.prototype,(r=l.DocumentFragment)==null?void 0:r.prototype].forEach(y=>{m(y,"append",h=>function(){for(var v=arguments.length,x=new Array(v),b=0;v>b;b++)x[b]=arguments[b];return h.apply(this,p(x))}),m(y,"prepend",h=>function(){for(var v=arguments.length,x=new Array(v),b=0;v>b;b++)x[b]=arguments[b];return h.apply(this,p(x))})}),[(i=l.Element)==null?void 0:i.prototype,(s=l.CharacterData)==null?void 0:s.prototype,(o=l.DocumentType)==null?void 0:o.prototype].forEach(y=>{m(y,"before",h=>function(){for(var v=arguments.length,x=new Array(v),b=0;v>b;b++)x[b]=arguments[b];return h.apply(this,p(x))}),m(y,"after",h=>function(){for(var v=arguments.length,x=new Array(v),b=0;v>b;b++)x[b]=arguments[b];return h.apply(this,p(x))}),m(y,"replaceWith",h=>function(){for(var v=arguments.length,x=new Array(v),b=0;v>b;b++)x[b]=arguments[b];var E=p(x);return x.length&&!E.length?void 0:h.apply(this,E)})}),m((a=l.Element)==null?void 0:a.prototype,"insertAdjacentElement",y=>function(h,v){var x=_(v);return x?y.call(this,h,x):null}),this.ov=()=>{c.forEach(y=>y()),this.ov=void 0},this.lv()}lv(){var e=!1;return()=>{var t;e||(e=!0,this.ev--,this.ev===0&&((t=this.ov)==null||t.call(this)))}}uv(e,t){t===void 0&&(t=!0);var n=this.av();try{var r=e(n);return t&&n(),r}catch(i){throw n(),i}}setupSiteApp(e){var t=this.apps[e.id],n=()=>{var o;!t.errored&&this.iv.length&&(On.info("Processing "+this.iv.length+" events for site app with id "+e.id),this.iv.forEach(a=>this.uv(()=>t.processEvent==null?void 0:t.processEvent(a))),t.processedBuffer=!0),Object.values(this.apps).every(a=>a.processedBuffer||a.errored)&&((o=this.nv)==null||o.call(this))},r=!1,i=o=>{t.errored=!o,t.loaded=!0,On.info("Site app with id "+e.id+" "+(o?"loaded":"errored")),r&&n()};try{var s=this.uv(o=>e.init({posthog:this._instance,callback(a){o(),i(a)}}),!1).processEvent;s&&(t.processEvent=s),r=!0}catch(o){On.error(N_+e.id,o),i(!1)}if(r&&t.loaded)try{n()}catch(o){On.error("Error while processing buffered events PostHog app with config id "+e.id,o),t.errored=!0}}hv(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of e)this.setupSiteApp(n)}dv(e){var t=this;if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(e),r=function(s){try{t.uv(()=>s.processEvent==null?void 0:s.processEvent(n))}catch(o){On.error("Error while processing event "+e.event+" for site app "+s.id,o)}};for(var i of Object.values(this.apps))r(i)}}onRemoteConfig(e){var t,n,r,i=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.hv(),void this._instance.on("eventCaptured",l=>this.dv(l))):void On.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.nv)==null||n.call(this),e.ok){var s=e.config;if((r=s.siteApps)!=null&&r.length)if(this.isEnabled){var o=function(){var l,u=a.id,c=a.url;Y["__$$ph_site_app_"+u]=i._instance,(l=Y.__PosthogExtensions__)==null||l.loadSiteApp==null||l.loadSiteApp(i._instance,c,d=>{if(d)return On.error(N_+u,d)})};for(var a of s.siteApps)o()}else On.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},JO={tracingHeaders:class{constructor(e){this.vv=void 0,this.fv=void 0,this.pv=void 0,this.Id=()=>{var t,n,r=this.gv();r?(L(this.vv)&&(this.vv=(t=Y.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null?void 0:t._patchXHR(r,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),L(this.fv)&&(this.fv=(n=Y.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null?void 0:n._patchFetch(r,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.Ld()},this._instance=e}initialize(){this.startIfEnabledOrStop()}_s(e){var t,n;(t=Y.__PosthogExtensions__)!=null&&t.tracingHeadersPatchFns?e():(n=Y.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",r=>{if(r)return AO.error("failed to load script",r);e()})}mv(){var e,t;return(e=(t=this._instance.config.tracing_headers)!==null&&t!==void 0?t:this._instance.config.addTracingHeaders)!==null&&e!==void 0?e:this._instance.config.__add_tracing_headers}gv(){var e=this.mv();return Z(e)?(Z(this.pv)?this.pv.splice(0,this.pv.length,...e):this.pv=[...e],e.length>0?this.pv:void 0):(Z(this.pv)&&this.pv.splice(0),this.pv=e||void 0,this.pv)}Ld(){var e,t;(e=this.vv)==null||e.call(this),(t=this.fv)==null||t.call(this),this.vv=void 0,this.fv=void 0}startIfEnabledOrStop(){this.gv()?this._s(this.Id):this.Ld()}}},ZO=$({surveys:class extends FO{constructor(e){var t;super(new UO(e),{get projectToken(){return t.config.token},kv:new zO(t=e)}),this._instance=e}Nl(e,t){var n=t.query?bl(e,t.query):e;return new Promise(r=>{var i;this._instance._send_request({method:t.method,url:this._instance.requestRouter.endpointFor((i=t.target)!==null&&i!==void 0?i:"api",n),data:t.body,headers:t.headers,timeout:t.timeoutMs,fireCallbackOnDrop:!0,transport:t.transport,compression:t.compression,timestampMode:t.sentAt,callback:r})})}}},hd),eM={toolbar:class{constructor(e){this.instance=e}yv(e){Y.ph_toolbar_state=e}bv(){var e;return(e=Y.ph_toolbar_state)!==null&&e!==void 0?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,n){if(e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),Ep(this.instance.config)||!I||!j)return!1;e=e??I.location,n=n??I.history;try{if(!t){try{I.localStorage.setItem("test","test"),I.localStorage.removeItem("test")}catch{return!1}t=I==null?void 0:I.localStorage}var r,i=VO||Ic(e.hash,"__posthog")||Ic(e.hash,"state"),s=i?Xy(()=>JSON.parse(atob(decodeURIComponent(i))))||Xy(()=>JSON.parse(decodeURIComponent(i))):null;return s&&s.action==="ph_authorize"?((r=s).source="url",r&&Object.keys(r).length>0&&(s.desiredHash?e.hash=s.desiredHash:n?n.replaceState(n.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem(F_)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch{return!1}}_v(e){var t=Y.ph_load_toolbar||Y.ph_load_editor;!ne(t)&&vt(t)?t(e,this.instance):L_.warn("No toolbar load function found")}loadToolbar(e){var t=!(j==null||!j.getElementById(yE));if(!I||t)return!1;var n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=$({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(I.localStorage.setItem(F_,JSON.stringify($({},r,{source:void 0}))),this.bv()===2)this._v(r);else if(this.bv()===0){var i;this.yv(1),(i=Y.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this.instance,"toolbar",s=>{if(s)return L_.error("[Toolbar] Failed to load",s),void this.yv(0);this.yv(2),this._v(r)}),Re(I,"turbolinks:load",()=>{this.yv(0),this.loadToolbar(r)})}return!0}wv(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,n){return e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),this.maybeLoadToolbar(e,t,n)}}},tM=$({experiments:ht},hd),nM={conversations:class{constructor(e){this.Sv=void 0,this._conversationsManager=null,this.xv=!1,this.Me=null,this.Cv=!1,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations&&(this.Tv=e.ok,e.ok)){var t=e.config.conversations;ne(t)||($t(t)?this.Sv=t:(this.Sv=t.enabled,this.Me=t),this.loadIfEnabled())}}reset(){var e;(e=this._conversationsManager)==null||e.reset(),this._conversationsManager=null,this.Sv=void 0,this.Me=null,this.Tv=void 0,this.Cv=!1}loadIfEnabled(){if(!(this._conversationsManager||this.xv||this._instance.config.disable_conversations||Ep(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=Y==null?void 0:Y.__PosthogExtensions__;if(e&&!L(this.Sv)&&this.Sv)if(this.Me&&this.Me.token){this.xv=!0;try{var t=e.initConversations;if(t)return this.Mv(t),void(this.xv=!1);var n=e.loadExternalDependency;if(!n)return void this.Ev(Eg);n(this._instance,"conversations",r=>{r||!e.initConversations?this.Ev("Could not load conversations script",r):this.Mv(e.initConversations),this.xv=!1})}catch(r){this.Ev("Error initializing conversations",r),this.xv=!1}}else tn.error("Conversations enabled but missing token in remote config.")}}Mv(e){if(this.Me)try{this._conversationsManager=e(this.Me,this._instance),this.Cv=!1,tn.info("Conversations loaded successfully")}catch(t){this.Ev("Error completing conversations initialization",t)}else tn.error("Cannot complete initialization: remote config is null")}Ev(e,t){tn.error(e,t),this._conversationsManager=null,this.xv=!1,this.Cv=!0}show(){this._conversationsManager?this._conversationsManager.show():tn.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Sv===!0&&!rt(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":Ep(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":this.Tv===!1?"remote_config_failed":L(this.Sv)?this.Tv?"disabled_in_project":"remote_config_pending":this.Sv?ne(this.Me)||!this.Me.token?"missing_token":Y!=null&&Y.__PosthogExtensions__?this.xv?"initializing":this.Cv?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.isVisible())!==null&&e!==void 0&&e}sendMessage(e,t,n){var r=this;return Ce(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(e,t,n):(tn.warn(wi),null)})()}getMessages(e,t){var n=this;return Ce(function*(){return n._conversationsManager?n._conversationsManager.getMessages(e,t):(tn.warn(wi),null)})()}markAsRead(e){var t=this;return Ce(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(tn.warn(wi),null)})()}getTickets(e){var t=this;return Ce(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(tn.warn(wi),null)})()}requestRestoreLink(e){var t=this;return Ce(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(tn.warn(wi),null)})()}restoreFromToken(e){var t=this;return Ce(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(tn.warn(wi),null)})()}restoreFromUrlToken(){var e=this;return Ce(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(tn.warn(wi),null)})()}getCurrentTicketId(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.getCurrentTicketId())!==null&&e!==void 0?e:null}getWidgetSessionId(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.getWidgetSessionId())!==null&&e!==void 0?e:null}Sl(){var e;(e=this._conversationsManager)==null||e.setIdentity()}xl(){var e;(e=this._conversationsManager)==null||e.clearIdentity()}}},rM={logs:class{constructor(e){var t,n=this;this.Iv=!1,this.Rv=!1,this.I=Ie("[logs]"),this.Pv=$({},this.I,{error(){for(var r=arguments.length,i=new Array(r),s=0;r>s;s++)i[s]=arguments[s];i.some(W_)||n.I.error(...i)}}),this.ka=[],this.Av=[],this.ph=0,this.Fv=()=>{var r,i;this.ph=0,(r=this.Ov)==null||r.onReconnect(),(i=this.Lv)==null||i.onReconnect()},this._instance=e,this._instance&&(t=this._instance.config.logs)!=null&&t.captureConsoleLogs&&(this.Iv=!0),I&&Re(I,"online",this.Fv)}$v(e,t,n,r){var i,s=function(o,a){var l,u,c,d,f,m,_,p=(l=o==null?void 0:o.flushIntervalMs)!==null&&l!==void 0?l:3e3,y=(u=o==null?void 0:o.maxBufferSize)!==null&&u!==void 0?u:100,h=a!=null&&a.consoleCapture?void 0:(c=o==null?void 0:o.maxLogsPerInterval)!==null&&c!==void 0?c:1e3,v=L(h)?Math.max(y,2048):Math.max(y,h),x=o==null?void 0:o.resourceAttributes;return{serviceName:(d=(f=x==null?void 0:x["service.name"])!==null&&f!==void 0?f:o==null?void 0:o.serviceName)!==null&&d!==void 0?d:a==null?void 0:a.serviceNameDefault,serviceVersion:(m=x==null?void 0:x["service.version"])!==null&&m!==void 0?m:o==null?void 0:o.serviceVersion,environment:(_=x==null?void 0:x["deployment.environment"])!==null&&_!==void 0?_:o==null?void 0:o.environment,resourceAttributes:x,beforeSend:o==null?void 0:o.beforeSend,flushIntervalMs:p,maxBufferSize:y,maxQueueSize:v,maxBatchRecordsPerPost:100,rateCapWindowMs:p,maxLogsPerInterval:h,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}((i=this._instance)==null||(i=i.config)==null?void 0:i.logs,n);return[new ZT(this.Dv(e,t),s,this.Pv,()=>this.Nv(),o=>o(),void 0,r),s]}qv(){var e,t=(e=this._instance)==null||(e=e.config)==null?void 0:e.logs;if(!this.Ov||this.jv!==t){var n;(n=this.Ov)==null||n.reset(),this.jv=t;var r=this.$v(()=>this.ka,i=>{this.ka=i});this.Ov=r[0],this.Bv=r[1]}return this.Ov}Hv(){var e,t=(e=this._instance)==null||(e=e.config)==null?void 0:e.logs;if(!this.Lv||this.Uv!==t){var n;(n=this.Lv)==null||n.reset(),this.Uv=t;var r=this.$v(()=>this.Av,i=>{this.Av=i},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},q_);this.Lv=r[0],this.zv=r[1]}return this.Lv}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t;if(e.ok){var n=(t=e.config.logs)==null?void 0:t.captureConsoleLogs;!ne(n)&&n&&(this.Iv=!0,this.loadIfEnabled())}}reset(){var e,t;this.ka=[],(e=this.Ov)==null||e.reset(),this.Av=[],(t=this.Lv)==null||t.reset(),this.ph=0}captureLog(e){this.qv().captureLog(e)}vi(e){this.Hv().captureLog(e)}get logger(){return this.Wv||(this.Wv={trace:(e,t)=>this.captureLog({body:e,level:"trace",attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:"debug",attributes:t}),info:(e,t)=>this.captureLog({body:e,level:"info",attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:"warn",attributes:t}),error:(e,t)=>this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.Wv}flushLogs(e){e?this.Vv(e):(this.Ov&&this.Ov.flush().catch(t=>this.Gv(t)),this.Lv&&this.Lv.flush().catch(t=>this.Gv(t)))}Gv(e){W_(e)||this.I.error("PostHog logs flush failed:",e)}loadIfEnabled(){if(this.Iv&&!this.Rv){var e=Y==null?void 0:Y.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,"logs",n=>{var r;n||(r=e.logs)==null||!r.initializeLogs?this.I.error("Could not load logs script",n):(e.logs.initializeLogs(this._instance),this.Rv=!0)}):this.I.error(Eg)}else this.I.error("PostHog Extensions not found.")}}Dv(e,t){var n=this._instance;return{get isDisabled(){return!1},get optedOut(){return!n.is_capturing()},getPersistedProperty:r=>r===nr.LogsQueue?e():void 0,setPersistedProperty(r,i){var s;r===nr.LogsQueue&&t((s=i)!==null&&s!==void 0?s:[])},Mn:r=>this.Mn(r),getLibraryId:()=>Ee.LIB_NAME,getLibraryVersion:()=>Ee.LIB_VERSION}}Mn(e){return new Promise(t=>{if(OE(this.ph,3))t({kind:"fatal",error:jf(void 0,"logs endpoint is unreachable, dropping batch")});else{var n=!1,r=s=>{n||(n=!0,clearTimeout(i),t(s))},i=setTimeout(()=>{this.I.warn("Logs request timed out before receiving a response"),r({kind:"retry-later",error:jf(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.Zv(),data:e,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:s=>{var o=s.statusCode;if(this.Qv(o),o>=200&&300>o)r({kind:"ok"});else if(o===413)r({kind:"too-large"});else if(o!==0&&o!==408&&o!==429&&500>o)r({kind:"fatal",error:new Error("logs request failed with status "+o)});else{var a;o===0?(s.error||this.I.warn("Logs request failed before receiving an HTTP response"),r({kind:"retry-later",error:jf(s.error,"logs request failed before receiving an HTTP response")})):r({kind:"retry-later",error:(a=s.error)!==null&&a!==void 0?a:new Error("logs request failed with status "+o)})}}})}})}Qv(e){(e!==0||this._instance.__loaded)&&(this.ph=ME(e,this.ph,3,()=>this.I.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.")))}Vv(e){this.ka.length>0&&this.Jv(e,this.ka,this.Bv,Ee.LIB_NAME,t=>{this.ka=t}),this.Av.length>0&&this.Jv(e,this.Av,this.zv,q_,t=>{this.Av=t})}Jv(e,t,n,r,i){if(t.length!==0){var s=t.map(a=>a.record);i([]);var o=eE(s,Zb(n,Ee.LIB_NAME,Ee.LIB_VERSION),r,Ee.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Zv(),data:o,compression:"best-available",batchKey:"logs",transport:e})}}Zv(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}Nv(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var n=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),r=n.windowId,i=n.sessionStartTimestamp,s=n.lastActivityTimestamp;t.sessionId=n.sessionId,t.windowId=r,ne(i)||(t.sessionStartTimestamp=i),ne(s)||(t.lastActivityTimestamp=s)}if(Y!=null&&(e=Y.location)!=null&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?li(Y.location.href):Y.location.href),this._instance.featureFlags){var o=this._instance.featureFlags.getFlags();o&&o.length>0&&(t.activeFeatureFlags=o)}return t}}},iM={metrics:class{constructor(e){this.I=Ie("[metrics]"),this._instance=e}initialize(){}qv(){var e,t,n=(e=this._instance)==null||(e=e.config)==null?void 0:e.metrics;return this.Ov&&this.jv===n||((t=this.Ov)==null||t.reset(),this.jv=n,this.Ov=new eI(this.Dv(),function(r){var i,s,o,a,l,u=r==null?void 0:r.resourceAttributes;return{serviceName:(i=u==null?void 0:u["service.name"])!==null&&i!==void 0?i:r==null?void 0:r.serviceName,serviceVersion:(s=u==null?void 0:u["service.version"])!==null&&s!==void 0?s:r==null?void 0:r.serviceVersion,environment:(o=u==null?void 0:u["deployment.environment"])!==null&&o!==void 0?o:r==null?void 0:r.environment,resourceAttributes:u,beforeSend:r==null?void 0:r.beforeSend,flushIntervalMs:(a=r==null?void 0:r.flushIntervalMs)!==null&&a!==void 0?a:1e4,maxSeriesPerFlush:(l=r==null?void 0:r.maxSeriesPerFlush)!==null&&l!==void 0?l:1e3}}(n),this.I)),this.Ov}count(e,t,n){t===void 0&&(t=1),this.qv().count(e,t,n)}gauge(e,t,n){this.qv().gauge(e,t,n)}histogram(e,t,n){this.qv().histogram(e,t,n)}flush(e){if(!this.Ov)return Promise.resolve();if(e){var t=this.Ov.drainWindow();return t&&this.Un(t,e),Promise.resolve()}return this.Ov.flush().catch(n=>this.I.error("PostHog metrics flush failed:",n))}reset(){var e;(e=this.Ov)==null||e.reset()}Dv(){var e=this._instance,t=this;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},Un:n=>t.Un(n),getLibraryId:()=>Ee.LIB_NAME,getLibraryVersion:()=>Ee.LIB_VERSION}}Un(e,t){return new Promise(n=>{var r=!1,i=o=>{r||(r=!0,clearTimeout(s),n(o))},s=setTimeout(()=>i({kind:"retry-later",error:new Error("metrics request timed out")}),9e4);this._instance._send_request($({method:"POST",url:this.Kv(),data:e,compression:"best-available",batchKey:"metrics"},t&&{transport:t},{fireCallbackOnDrop:!0,callback(o){var a=o.statusCode;if(a>=200&&300>a)i({kind:"ok"});else if(a===413)i({kind:"too-large"});else if(a!==0&&a!==408&&a!==429&&500>a)i({kind:"fatal",error:new Error("metrics request failed with status "+a)});else{var l;i({kind:"retry-later",error:(l=o.error)!==null&&l!==void 0?l:new Error("metrics request failed with status "+a)})}}}))})}Kv(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},sM=$({},hd,GO,KO,QO,YO,XO,ZO,JO,eM,tM,nM,rM,iM);qt.__defaultExtensionClasses=$({},sM);var oM=function(){Ee.SDK_DIST_CHANNEL="npm";var e=Ra[Es]=new qt;return function(){function t(){t.done||(t.done=!0,oS=!1,ve(Ra,function(n){n._dom_loaded()}))}j!=null&&j.addEventListener?j.readyState==="complete"?t():Re(j,"DOMContentLoaded",t,{capture:!1}):I&&D.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),e}(),cS;function aM(e){cS=e}function lM(){return cS}var uM=g.createContext({get client(){return lM()},bootstrap:void 0}),Df=function(e){return typeof e=="function"},cM=function(e){return e===void 0},$p=function(e,t){return $p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},$p(e,t)};function dM(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");$p(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Au=function(e){var t=Object.prototype.toString.call(e);return e instanceof Error||t==="[object Error]"||t==="[object Exception]"||t==="[object DOMException]"||t==="[object DOMError]"},fM=function(e,t){for(var n=new WeakSet,r=e;!n.has(r);){if(n.add(r),!Au(r.cause)){cM(r.cause)||(t.cause=r.cause),r.cause=t;return}r=r.cause}},hM=function(e,t){if(!t)return e;var n=new Error(Au(e)?e.message:"Primitive value captured as exception: ".concat(String(e)));return n.name="React ErrorBoundary ".concat(Au(e)?e.name:"Error"),n.stack=t,Au(e)?(fM(e,n),e):n},pM={componentStack:null,exceptionEvent:null,error:null},vM={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."};(function(e){dM(t,e);function t(n){var r=e.call(this,n)||this;return r.state=pM,r}return t.prototype.componentDidCatch=function(n,r){var i=this.props.additionalProperties,s;Df(i)?s=i(n,r):typeof i=="object"&&(s=i);var o=this.context.client,a=r.componentStack,l=o.captureException(hM(n,a),s);this.setState({error:n,componentStack:a??null,exceptionEvent:l})},t.prototype.render=function(){var n=this.props,r=n.children,i=n.fallback,s=this.state;if(s.componentStack==null)return Df(r)?r():r;var o=Df(i)?q.createElement(i,{error:s.error,componentStack:s.componentStack,exceptionEvent:s.exceptionEvent}):i;return q.isValidElement(o)?o:(console.warn(vM.INVALID_FALLBACK),q.createElement(q.Fragment,null))},t.contextType=uM,t})(q.Component);aM(oM);class dS extends q.Component{constructor(){super(...arguments);kr(this,"state",{failed:!1,resetKey:this.props.resetKey})}static getDerivedStateFromError(){return{failed:!0}}static getDerivedStateFromProps(n,r){return n.resetKey===r.resetKey?null:{failed:!1,resetKey:n.resetKey}}componentDidCatch(n){console.error("The application could not render",n)}render(){if(!this.state.failed)return this.props.children;const n=w.jsxs("div",{className:"page",role:"alert",children:[w.jsx("h1",{children:"This page could not load"}),w.jsx("p",{children:"The site may have been updated while this tab was open."}),w.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>window.location.reload(),children:"Reload page"})]});return this.props.resetKey===void 0?w.jsx("main",{children:n}):n}}const zf="pwc:chunk-reload-at",fS=6e4;function gM(e,t){if(!e)return!0;const n=Number(e);return!Number.isFinite(n)||t-n>=fS}function mM(){if(typeof window>"u")return()=>{};const e=n=>{const r=Date.now();gM(sessionStorage.getItem(zf),r)&&(n.preventDefault(),sessionStorage.setItem(zf,String(r)),window.location.reload())};window.addEventListener("vite:preloadError",e);const t=window.setTimeout(()=>sessionStorage.removeItem(zf),fS);return()=>{window.removeEventListener("vite:preloadError",e),window.clearTimeout(t)}}const yM="modulepreload",_M=function(e){return"/"+e},H_={},ae=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.allSettled(n.map(l=>{if(l=_M(l),l in H_)return;H_[l]=!0;const u=l.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${c}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":yM,u||(d.as="script"),d.crossOrigin="",d.href=l,a&&d.setAttribute("nonce",a),document.head.appendChild(d),u)return new Promise((f,m)=>{d.addEventListener("load",f),d.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${l}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return t().catch(s)})};/** * @remix-run/router v1.23.2 * * Copyright (c) Remix Software Inc. @@ -49,7 +49,7 @@ Error generating stack: `+s.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function tl(){return tl=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function pd(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function EM(){return Math.random().toString(36).substr(2,8)}function K_(e,t){return{usr:e.state,key:e.key,idx:t}}function $c(e,t,n,r){return n===void 0&&(n=null),tl({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?is(t):t,{state:n,key:t&&t.key||r||EM()})}function nl(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function is(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function pS(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,o=i.history,a=Qr.Pop,l=null,u=c();u==null&&(u=0,o.replaceState(tl({},o.state,{idx:u}),""));function c(){return(o.state||{idx:null}).idx}function d(){a=Qr.Pop;let y=c(),h=y==null?null:y-u;u=y,l&&l({action:a,location:p.location,delta:h})}function f(y,h){a=Qr.Push;let v=$c(p.location,y,h);n&&n(v,y),u=c()+1;let x=K_(v,u),b=p.createHref(v);try{o.pushState(x,"",b)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;i.location.assign(b)}s&&l&&l({action:a,location:p.location,delta:1})}function m(y,h){a=Qr.Replace;let v=$c(p.location,y,h);n&&n(v,y),u=c();let x=K_(v,u),b=p.createHref(v);o.replaceState(x,"",b),s&&l&&l({action:a,location:p.location,delta:0})}function _(y){let h=i.location.origin!=="null"?i.location.origin:i.location.href,v=typeof y=="string"?y:nl(y);return v=v.replace(/ $/,"%20"),Ue(h,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,h)}let p={get action(){return a},get location(){return e(i,o)},listen(y){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(G_,d),l=y,()=>{i.removeEventListener(G_,d),l=null}},createHref(y){return t(i,y)},createURL:_,encodeLocation(y){let h=_(y);return{pathname:h.pathname,search:h.search,hash:h.hash}},push:f,replace:m,go(y){return o.go(y)}};return p}var Q_;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Q_||(Q_={}));function SM(e,t,n){return n===void 0&&(n="/"),CM(e,t,n)}function CM(e,t,n,r){let i=typeof t=="string"?is(t):t,s=Po(i.pathname||"/",n);if(s==null)return null;let o=vS(e);kM(o);let a=null;for(let l=0;a==null&&l{let l={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};l.relativePath.startsWith("/")&&(Ue(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=ii([r,l.relativePath]),c=n.concat(l);s.children&&s.children.length>0&&(Ue(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),vS(s.children,t,c,u)),!(s.path==null&&!s.index)&&t.push({path:u,score:AM(u,s.index),routesMeta:c})};return e.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let l of gS(s.path))i(s,o,l)}),t}function gS(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let o=gS(r.join("/")),a=[];return a.push(...o.map(l=>l===""?s:[s,l].join("/"))),i&&a.push(...o),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function kM(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:NM(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const PM=/^:[\w-]+$/,RM=3,TM=2,IM=1,OM=10,MM=-2,Y_=e=>e==="*";function AM(e,t){let n=e.split("/"),r=n.length;return n.some(Y_)&&(r+=MM),t&&(r+=TM),n.filter(i=>!Y_(i)).reduce((i,s)=>i+(PM.test(s)?RM:s===""?IM:OM),r)}function NM(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function $M(e,t,n){let{routesMeta:r}=e,i={},s="/",o=[];for(let a=0;a{let{paramName:f,isOptional:m}=c;if(f==="*"){let p=a[d]||"";o=s.slice(0,s.length-p.length).replace(/(.)\/+$/,"$1")}const _=a[d];return m&&!_?u[f]=void 0:u[f]=(_||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:o,pattern:e}}function FM(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),pd(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function LM(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return pd(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Po(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const jM=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,DM=e=>jM.test(e);function zM(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?is(e):e,s;if(n)if(DM(n))s=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),pd(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?s=X_(n.substring(1),"/"):s=X_(n,t)}else s=t;return{pathname:s,search:BM(r),hash:qM(i)}}function X_(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Uf(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function UM(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Ig(e,t){let n=UM(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Og(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=is(e):(i=tl({},e),Ue(!i.pathname||!i.pathname.includes("?"),Uf("?","pathname","search",i)),Ue(!i.pathname||!i.pathname.includes("#"),Uf("#","pathname","hash",i)),Ue(!i.search||!i.search.includes("#"),Uf("#","search","hash",i)));let s=e===""||i.pathname==="",o=s?"/":i.pathname,a;if(o==null)a=n;else{let d=t.length-1;if(!r&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),d-=1;i.pathname=f.join("/")}a=d>=0?t[d]:"/"}let l=zM(i,a),u=o&&o!=="/"&&o.endsWith("/"),c=(s||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const ii=e=>e.join("/").replace(/\/\/+/g,"/"),VM=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),BM=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,qM=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function WM(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const mS=["post","put","patch","delete"];new Set(mS);const HM=["get",...mS];new Set(HM);/** + */function tl(){return tl=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function pd(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function bM(){return Math.random().toString(36).substr(2,8)}function K_(e,t){return{usr:e.state,key:e.key,idx:t}}function $c(e,t,n,r){return n===void 0&&(n=null),tl({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ss(t):t,{state:n,key:t&&t.key||r||bM()})}function nl(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function ss(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function hS(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,o=i.history,a=Qr.Pop,l=null,u=c();u==null&&(u=0,o.replaceState(tl({},o.state,{idx:u}),""));function c(){return(o.state||{idx:null}).idx}function d(){a=Qr.Pop;let y=c(),h=y==null?null:y-u;u=y,l&&l({action:a,location:p.location,delta:h})}function f(y,h){a=Qr.Push;let v=$c(p.location,y,h);n&&n(v,y),u=c()+1;let x=K_(v,u),b=p.createHref(v);try{o.pushState(x,"",b)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;i.location.assign(b)}s&&l&&l({action:a,location:p.location,delta:1})}function m(y,h){a=Qr.Replace;let v=$c(p.location,y,h);n&&n(v,y),u=c();let x=K_(v,u),b=p.createHref(v);o.replaceState(x,"",b),s&&l&&l({action:a,location:p.location,delta:0})}function _(y){let h=i.location.origin!=="null"?i.location.origin:i.location.href,v=typeof y=="string"?y:nl(y);return v=v.replace(/ $/,"%20"),Ue(h,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,h)}let p={get action(){return a},get location(){return e(i,o)},listen(y){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(G_,d),l=y,()=>{i.removeEventListener(G_,d),l=null}},createHref(y){return t(i,y)},createURL:_,encodeLocation(y){let h=_(y);return{pathname:h.pathname,search:h.search,hash:h.hash}},push:f,replace:m,go(y){return o.go(y)}};return p}var Q_;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Q_||(Q_={}));function EM(e,t,n){return n===void 0&&(n="/"),SM(e,t,n)}function SM(e,t,n,r){let i=typeof t=="string"?ss(t):t,s=Ro(i.pathname||"/",n);if(s==null)return null;let o=pS(e);CM(o);let a=null;for(let l=0;a==null&&l{let l={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};l.relativePath.startsWith("/")&&(Ue(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=ii([r,l.relativePath]),c=n.concat(l);s.children&&s.children.length>0&&(Ue(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),pS(s.children,t,c,u)),!(s.path==null&&!s.index)&&t.push({path:u,score:MM(u,s.index),routesMeta:c})};return e.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let l of vS(s.path))i(s,o,l)}),t}function vS(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let o=vS(r.join("/")),a=[];return a.push(...o.map(l=>l===""?s:[s,l].join("/"))),i&&a.push(...o),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function CM(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:AM(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const kM=/^:[\w-]+$/,PM=3,RM=2,TM=1,IM=10,OM=-2,Y_=e=>e==="*";function MM(e,t){let n=e.split("/"),r=n.length;return n.some(Y_)&&(r+=OM),t&&(r+=RM),n.filter(i=>!Y_(i)).reduce((i,s)=>i+(kM.test(s)?PM:s===""?TM:IM),r)}function AM(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function NM(e,t,n){let{routesMeta:r}=e,i={},s="/",o=[];for(let a=0;a{let{paramName:f,isOptional:m}=c;if(f==="*"){let p=a[d]||"";o=s.slice(0,s.length-p.length).replace(/(.)\/+$/,"$1")}const _=a[d];return m&&!_?u[f]=void 0:u[f]=(_||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:o,pattern:e}}function $M(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),pd(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function FM(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return pd(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Ro(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const LM=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,jM=e=>LM.test(e);function DM(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?ss(e):e,s;if(n)if(jM(n))s=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),pd(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?s=X_(n.substring(1),"/"):s=X_(n,t)}else s=t;return{pathname:s,search:VM(r),hash:BM(i)}}function X_(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Uf(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function zM(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Ig(e,t){let n=zM(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Og(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=ss(e):(i=tl({},e),Ue(!i.pathname||!i.pathname.includes("?"),Uf("?","pathname","search",i)),Ue(!i.pathname||!i.pathname.includes("#"),Uf("#","pathname","hash",i)),Ue(!i.search||!i.search.includes("#"),Uf("#","search","hash",i)));let s=e===""||i.pathname==="",o=s?"/":i.pathname,a;if(o==null)a=n;else{let d=t.length-1;if(!r&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),d-=1;i.pathname=f.join("/")}a=d>=0?t[d]:"/"}let l=DM(i,a),u=o&&o!=="/"&&o.endsWith("/"),c=(s||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const ii=e=>e.join("/").replace(/\/\/+/g,"/"),UM=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),VM=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,BM=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function qM(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const gS=["post","put","patch","delete"];new Set(gS);const WM=["get",...gS];new Set(WM);/** * React Router v6.30.3 * * Copyright (c) Remix Software Inc. @@ -58,7 +58,7 @@ Error generating stack: `+s.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function rl(){return rl=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.current=!0}),g.useCallback(function(u,c){if(c===void 0&&(c={}),!a.current)return;if(typeof u=="number"){r.go(u);return}let d=Og(u,JSON.parse(o),s,c.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:ii([t,d.pathname])),(c.replace?r.replace:r.push)(d,c.state,c)},[t,r,o,s,e])}const QM=g.createContext(null);function YM(e){let t=g.useContext(Gn).outlet;return t&&g.createElement(QM.Provider,{value:e},t)}function xS(){let{matches:e}=g.useContext(Gn),t=e[e.length-1];return t?t.params:{}}function md(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=g.useContext(xr),{matches:i}=g.useContext(Gn),{pathname:s}=hn(),o=JSON.stringify(Ig(i,r.v7_relativeSplatPath));return g.useMemo(()=>Og(e,JSON.parse(o),s,n==="path"),[e,o,s,n])}function XM(e,t){return JM(e,t)}function JM(e,t,n,r){No()||Ue(!1);let{navigator:i}=g.useContext(xr),{matches:s}=g.useContext(Gn),o=s[s.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=hn(),c;if(t){var d;let y=typeof t=="string"?is(t):t;l==="/"||(d=y.pathname)!=null&&d.startsWith(l)||Ue(!1),c=y}else c=u;let f=c.pathname||"/",m=f;if(l!=="/"){let y=l.replace(/^\//,"").split("/");m="/"+f.replace(/^\//,"").split("/").slice(y.length).join("/")}let _=SM(e,{pathname:m}),p=rA(_&&_.map(y=>Object.assign({},y,{params:Object.assign({},a,y.params),pathname:ii([l,i.encodeLocation?i.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:ii([l,i.encodeLocation?i.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),s,n,r);return t&&p?g.createElement(gd.Provider,{value:{location:rl({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:Qr.Pop}},p):p}function ZM(){let e=aA(),t=WM(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},t),n?g.createElement("pre",{style:i},n):null,null)}const eA=g.createElement(ZM,null);class tA extends g.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?g.createElement(Gn.Provider,{value:this.props.routeContext},g.createElement(_S.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function nA(e){let{routeContext:t,match:n,children:r}=e,i=g.useContext(vd);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),g.createElement(Gn.Provider,{value:t},r)}function rA(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var s;if(!n)return null;if(n.errors)e=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,a=(i=n)==null?void 0:i.errors;if(a!=null){let c=o.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id])!==void 0);c>=0||Ue(!1),o=o.slice(0,Math.min(o.length,c+1))}let l=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let c=0;c=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((c,d,f)=>{let m,_=!1,p=null,y=null;n&&(m=a&&d.route.id?a[d.route.id]:void 0,p=d.route.errorElement||eA,l&&(u<0&&f===0?(uA("route-fallback"),_=!0,y=null):u===f&&(_=!0,y=d.route.hydrateFallbackElement||null)));let h=t.concat(o.slice(0,f+1)),v=()=>{let x;return m?x=p:_?x=y:d.route.Component?x=g.createElement(d.route.Component,null):d.route.element?x=d.route.element:x=c,g.createElement(nA,{match:d,routeContext:{outlet:c,matches:h,isDataRoute:n!=null},children:x})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?g.createElement(tA,{location:n.location,revalidation:n.revalidation,component:p,error:m,children:v(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):v()},null)}var bS=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(bS||{}),ES=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(ES||{});function iA(e){let t=g.useContext(vd);return t||Ue(!1),t}function sA(e){let t=g.useContext(yS);return t||Ue(!1),t}function oA(e){let t=g.useContext(Gn);return t||Ue(!1),t}function SS(e){let t=oA(),n=t.matches[t.matches.length-1];return n.route.id||Ue(!1),n.route.id}function aA(){var e;let t=g.useContext(_S),n=sA(),r=SS();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function lA(){let{router:e}=iA(bS.UseNavigateStable),t=SS(ES.UseNavigateStable),n=g.useRef(!1);return wS(()=>{n.current=!0}),g.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,rl({fromRouteId:t},s)))},[e,t])}const J_={};function uA(e,t,n){J_[e]||(J_[e]=!0)}function CS(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Ro(e){let{to:t,replace:n,state:r,relative:i}=e;No()||Ue(!1);let{future:s,static:o}=g.useContext(xr),{matches:a}=g.useContext(Gn),{pathname:l}=hn(),u=Mg(),c=Og(t,Ig(a,s.v7_relativeSplatPath),l,i==="path"),d=JSON.stringify(c);return g.useEffect(()=>u(JSON.parse(d),{replace:n,state:r,relative:i}),[u,d,i,n,r]),null}function cA(e){return YM(e.context)}function re(e){Ue(!1)}function kS(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Qr.Pop,navigator:s,static:o=!1,future:a}=e;No()&&Ue(!1);let l=t.replace(/^\/*/,"/"),u=g.useMemo(()=>({basename:l,navigator:s,static:o,future:rl({v7_relativeSplatPath:!1},a)}),[l,a,s,o]);typeof r=="string"&&(r=is(r));let{pathname:c="/",search:d="",hash:f="",state:m=null,key:_="default"}=r,p=g.useMemo(()=>{let y=Po(c,l);return y==null?null:{location:{pathname:y,search:d,hash:f,state:m,key:_},navigationType:i}},[l,c,d,f,m,_,i]);return p==null?null:g.createElement(xr.Provider,{value:u},g.createElement(gd.Provider,{children:n,value:p}))}function dA(e){let{children:t,location:n}=e;return XM(Lp(t),n)}new Promise(()=>{});function Lp(e,t){t===void 0&&(t=[]);let n=[];return g.Children.forEach(e,(r,i)=>{if(!g.isValidElement(r))return;let s=[...t,i];if(r.type===g.Fragment){n.push.apply(n,Lp(r.props.children,s));return}r.type!==re&&Ue(!1),!r.props.index||!r.props.children||Ue(!1);let o={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=Lp(r.props.children,s)),n.push(o)}),n}/** + */function rl(){return rl=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.current=!0}),g.useCallback(function(u,c){if(c===void 0&&(c={}),!a.current)return;if(typeof u=="number"){r.go(u);return}let d=Og(u,JSON.parse(o),s,c.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:ii([t,d.pathname])),(c.replace?r.replace:r.push)(d,c.state,c)},[t,r,o,s,e])}const KM=g.createContext(null);function QM(e){let t=g.useContext(Gn).outlet;return t&&g.createElement(KM.Provider,{value:e},t)}function wS(){let{matches:e}=g.useContext(Gn),t=e[e.length-1];return t?t.params:{}}function md(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=g.useContext(xr),{matches:i}=g.useContext(Gn),{pathname:s}=hn(),o=JSON.stringify(Ig(i,r.v7_relativeSplatPath));return g.useMemo(()=>Og(e,JSON.parse(o),s,n==="path"),[e,o,s,n])}function YM(e,t){return XM(e,t)}function XM(e,t,n,r){No()||Ue(!1);let{navigator:i}=g.useContext(xr),{matches:s}=g.useContext(Gn),o=s[s.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=hn(),c;if(t){var d;let y=typeof t=="string"?ss(t):t;l==="/"||(d=y.pathname)!=null&&d.startsWith(l)||Ue(!1),c=y}else c=u;let f=c.pathname||"/",m=f;if(l!=="/"){let y=l.replace(/^\//,"").split("/");m="/"+f.replace(/^\//,"").split("/").slice(y.length).join("/")}let _=EM(e,{pathname:m}),p=nA(_&&_.map(y=>Object.assign({},y,{params:Object.assign({},a,y.params),pathname:ii([l,i.encodeLocation?i.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:ii([l,i.encodeLocation?i.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),s,n,r);return t&&p?g.createElement(gd.Provider,{value:{location:rl({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:Qr.Pop}},p):p}function JM(){let e=oA(),t=qM(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},t),n?g.createElement("pre",{style:i},n):null,null)}const ZM=g.createElement(JM,null);class eA extends g.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?g.createElement(Gn.Provider,{value:this.props.routeContext},g.createElement(yS.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function tA(e){let{routeContext:t,match:n,children:r}=e,i=g.useContext(vd);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),g.createElement(Gn.Provider,{value:t},r)}function nA(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var s;if(!n)return null;if(n.errors)e=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,a=(i=n)==null?void 0:i.errors;if(a!=null){let c=o.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id])!==void 0);c>=0||Ue(!1),o=o.slice(0,Math.min(o.length,c+1))}let l=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let c=0;c=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((c,d,f)=>{let m,_=!1,p=null,y=null;n&&(m=a&&d.route.id?a[d.route.id]:void 0,p=d.route.errorElement||ZM,l&&(u<0&&f===0?(lA("route-fallback"),_=!0,y=null):u===f&&(_=!0,y=d.route.hydrateFallbackElement||null)));let h=t.concat(o.slice(0,f+1)),v=()=>{let x;return m?x=p:_?x=y:d.route.Component?x=g.createElement(d.route.Component,null):d.route.element?x=d.route.element:x=c,g.createElement(tA,{match:d,routeContext:{outlet:c,matches:h,isDataRoute:n!=null},children:x})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?g.createElement(eA,{location:n.location,revalidation:n.revalidation,component:p,error:m,children:v(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):v()},null)}var xS=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(xS||{}),bS=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(bS||{});function rA(e){let t=g.useContext(vd);return t||Ue(!1),t}function iA(e){let t=g.useContext(mS);return t||Ue(!1),t}function sA(e){let t=g.useContext(Gn);return t||Ue(!1),t}function ES(e){let t=sA(),n=t.matches[t.matches.length-1];return n.route.id||Ue(!1),n.route.id}function oA(){var e;let t=g.useContext(yS),n=iA(),r=ES();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function aA(){let{router:e}=rA(xS.UseNavigateStable),t=ES(bS.UseNavigateStable),n=g.useRef(!1);return _S(()=>{n.current=!0}),g.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,rl({fromRouteId:t},s)))},[e,t])}const J_={};function lA(e,t,n){J_[e]||(J_[e]=!0)}function SS(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Ki(e){let{to:t,replace:n,state:r,relative:i}=e;No()||Ue(!1);let{future:s,static:o}=g.useContext(xr),{matches:a}=g.useContext(Gn),{pathname:l}=hn(),u=Mg(),c=Og(t,Ig(a,s.v7_relativeSplatPath),l,i==="path"),d=JSON.stringify(c);return g.useEffect(()=>u(JSON.parse(d),{replace:n,state:r,relative:i}),[u,d,i,n,r]),null}function uA(e){return QM(e.context)}function re(e){Ue(!1)}function CS(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Qr.Pop,navigator:s,static:o=!1,future:a}=e;No()&&Ue(!1);let l=t.replace(/^\/*/,"/"),u=g.useMemo(()=>({basename:l,navigator:s,static:o,future:rl({v7_relativeSplatPath:!1},a)}),[l,a,s,o]);typeof r=="string"&&(r=ss(r));let{pathname:c="/",search:d="",hash:f="",state:m=null,key:_="default"}=r,p=g.useMemo(()=>{let y=Ro(c,l);return y==null?null:{location:{pathname:y,search:d,hash:f,state:m,key:_},navigationType:i}},[l,c,d,f,m,_,i]);return p==null?null:g.createElement(xr.Provider,{value:u},g.createElement(gd.Provider,{children:n,value:p}))}function cA(e){let{children:t,location:n}=e;return YM(Lp(t),n)}new Promise(()=>{});function Lp(e,t){t===void 0&&(t=[]);let n=[];return g.Children.forEach(e,(r,i)=>{if(!g.isValidElement(r))return;let s=[...t,i];if(r.type===g.Fragment){n.push.apply(n,Lp(r.props.children,s));return}r.type!==re&&Ue(!1),!r.props.index||!r.props.children||Ue(!1);let o={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=Lp(r.props.children,s)),n.push(o)}),n}/** * React Router DOM v6.30.3 * * Copyright (c) Remix Software Inc. @@ -67,12 +67,12 @@ Error generating stack: `+s.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Fc(){return Fc=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function fA(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function hA(e,t){return e.button===0&&(!t||t==="_self")&&!fA(e)}function jp(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function pA(e,t){let n=jp(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(s=>{n.append(i,s)})}),n}const vA=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],gA=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],mA="6";try{window.__reactRouterVersion=mA}catch{}const yA=g.createContext({isTransitioning:!1}),_A="startTransition",Lc=Kc[_A];function wA(e){let{basename:t,children:n,future:r,window:i}=e,s=g.useRef();s.current==null&&(s.current=xM({window:i,v5Compat:!0}));let o=s.current,[a,l]=g.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},c=g.useCallback(d=>{u&&Lc?Lc(()=>l(d)):l(d)},[l,u]);return g.useLayoutEffect(()=>o.listen(c),[o,c]),g.useEffect(()=>CS(r),[r]),g.createElement(kS,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:o,future:r})}function xA(e){let{basename:t,children:n,future:r,window:i}=e,s=g.useRef();s.current==null&&(s.current=bM({window:i,v5Compat:!0}));let o=s.current,[a,l]=g.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},c=g.useCallback(d=>{u&&Lc?Lc(()=>l(d)):l(d)},[l,u]);return g.useLayoutEffect(()=>o.listen(c),[o,c]),g.useEffect(()=>CS(r),[r]),g.createElement(kS,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:o,future:r})}const bA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",EA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,bn=g.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:s,replace:o,state:a,target:l,to:u,preventScrollReset:c,viewTransition:d}=t,f=PS(t,vA),{basename:m}=g.useContext(xr),_,p=!1;if(typeof u=="string"&&EA.test(u)&&(_=u,bA))try{let x=new URL(window.location.href),b=u.startsWith("//")?new URL(x.protocol+u):new URL(u),E=Po(b.pathname,m);b.origin===x.origin&&E!=null?u=E+b.search+b.hash:p=!0}catch{}let y=GM(u,{relative:i}),h=CA(u,{replace:o,state:a,target:l,preventScrollReset:c,relative:i,viewTransition:d});function v(x){r&&r(x),x.defaultPrevented||h(x)}return g.createElement("a",Fc({},f,{href:_||y,onClick:p||s?r:v,ref:n,target:l}))}),ms=g.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:i=!1,className:s="",end:o=!1,style:a,to:l,viewTransition:u,children:c}=t,d=PS(t,gA),f=md(l,{relative:d.relative}),m=hn(),_=g.useContext(yS),{navigator:p,basename:y}=g.useContext(xr),h=_!=null&&kA(f)&&u===!0,v=p.encodeLocation?p.encodeLocation(f).pathname:f.pathname,x=m.pathname,b=_&&_.navigation&&_.navigation.location?_.navigation.location.pathname:null;i||(x=x.toLowerCase(),b=b?b.toLowerCase():null,v=v.toLowerCase()),b&&y&&(b=Po(b,y)||b);const E=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let S=x===v||!o&&x.startsWith(v)&&x.charAt(E)==="/",P=b!=null&&(b===v||!o&&b.startsWith(v)&&b.charAt(v.length)==="/"),C={isActive:S,isPending:P,isTransitioning:h},T=S?r:void 0,R;typeof s=="function"?R=s(C):R=[s,S?"active":null,P?"pending":null,h?"transitioning":null].filter(Boolean).join(" ");let N=typeof a=="function"?a(C):a;return g.createElement(bn,Fc({},d,{"aria-current":T,className:R,ref:n,style:N,to:l,viewTransition:u}),typeof c=="function"?c(C):c)});var Dp;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Dp||(Dp={}));var Z_;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Z_||(Z_={}));function SA(e){let t=g.useContext(vd);return t||Ue(!1),t}function CA(e,t){let{target:n,replace:r,state:i,preventScrollReset:s,relative:o,viewTransition:a}=t===void 0?{}:t,l=Mg(),u=hn(),c=md(e,{relative:o});return g.useCallback(d=>{if(hA(d,n)){d.preventDefault();let f=r!==void 0?r:nl(u)===nl(c);l(e,{replace:f,state:i,preventScrollReset:s,relative:o,viewTransition:a})}},[u,l,c,r,i,n,e,s,o,a])}function iz(e){let t=g.useRef(jp(e)),n=g.useRef(!1),r=hn(),i=g.useMemo(()=>pA(r.search,n.current?null:t.current),[r.search]),s=Mg(),o=g.useCallback((a,l)=>{const u=jp(typeof a=="function"?a(i):a);n.current=!0,s("?"+u,l)},[s,i]);return[i,o]}function kA(e,t){t===void 0&&(t={});let n=g.useContext(yA);n==null&&Ue(!1);let{basename:r}=SA(Dp.useViewTransitionState),i=md(e,{relative:t.relative});if(!n.isTransitioning)return!1;let s=Po(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Po(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Fp(i.pathname,o)!=null||Fp(i.pathname,s)!=null}var El=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},$i,Dr,Zs,X0,PA=(X0=class extends El{constructor(){super();X(this,$i);X(this,Dr);X(this,Zs);H(this,Zs,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){k(this,Dr)||this.setEventListener(k(this,Zs))}onUnsubscribe(){var t;this.hasListeners()||((t=k(this,Dr))==null||t.call(this),H(this,Dr,void 0))}setEventListener(t){var n;H(this,Zs,t),(n=k(this,Dr))==null||n.call(this),H(this,Dr,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){k(this,$i)!==t&&(H(this,$i,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof k(this,$i)=="boolean"?k(this,$i):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},$i=new WeakMap,Dr=new WeakMap,Zs=new WeakMap,X0),Ag=new PA,RA={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},zr,vv,J0,TA=(J0=class{constructor(){X(this,zr,RA);X(this,vv,!1)}setTimeoutProvider(e){H(this,zr,e)}setTimeout(e,t){return k(this,zr).setTimeout(e,t)}clearTimeout(e){k(this,zr).clearTimeout(e)}setInterval(e,t){return k(this,zr).setInterval(e,t)}clearInterval(e){k(this,zr).clearInterval(e)}},zr=new WeakMap,vv=new WeakMap,J0),Ni=new TA;function IA(e){setTimeout(e,0)}var OA=typeof window>"u"||"Deno"in globalThis;function At(){}function MA(e,t){return typeof e=="function"?e(t):e}function zp(e){return typeof e=="number"&&e>=0&&e!==1/0}function RS(e,t){return Math.max(e+(t||0)-Date.now(),0)}function si(e,t){return typeof e=="function"?e(t):e}function Wt(e,t){return typeof e=="function"?e(t):e}function e0(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:a}=e;if(o){if(r){if(t.queryHash!==Ng(o,t.options))return!1}else if(!sl(t.queryKey,o))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||i&&i!==t.state.fetchStatus||s&&!s(t))}function t0(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(il(t.options.mutationKey)!==il(s))return!1}else if(!sl(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Ng(e,t){return((t==null?void 0:t.queryKeyHashFn)||il)(e)}function il(e){return JSON.stringify(e,(t,n)=>Vp(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function sl(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>sl(e[n],t[n])):!1}var AA=Object.prototype.hasOwnProperty;function TS(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=n0(e)&&n0(t);if(!r&&!(Vp(e)&&Vp(t)))return t;const s=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),a=o.length,l=r?new Array(a):{};let u=0;for(let c=0;c{Ni.setTimeout(t,e)})}function Bp(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?TS(e,t):t}function $A(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function FA(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var $g=Symbol();function IS(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===$g?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function OS(e,t){return typeof e=="function"?e(...t):!!e}function LA(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??(i=t()),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var ol=(()=>{let e=()=>OA;return{isServer(){return e()},setIsServer(t){e=t}}})();function qp(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var jA=IA;function DA(){let e=[],t=0,n=a=>{a()},r=a=>{a()},i=jA;const s=a=>{t?e.push(a):i(()=>{n(a)})},o=()=>{const a=e;e=[],a.length&&i(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||o()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var at=DA(),eo,Ur,to,Z0,zA=(Z0=class extends El{constructor(){super();X(this,eo,!0);X(this,Ur);X(this,to);H(this,to,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){k(this,Ur)||this.setEventListener(k(this,to))}onUnsubscribe(){var t;this.hasListeners()||((t=k(this,Ur))==null||t.call(this),H(this,Ur,void 0))}setEventListener(t){var n;H(this,to,t),(n=k(this,Ur))==null||n.call(this),H(this,Ur,t(this.setOnline.bind(this)))}setOnline(t){k(this,eo)!==t&&(H(this,eo,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return k(this,eo)}},eo=new WeakMap,Ur=new WeakMap,to=new WeakMap,Z0),jc=new zA;function UA(e){return Math.min(1e3*2**e,3e4)}function MS(e){return(e??"online")==="online"?jc.isOnline():!0}var Wp=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function AS(e){let t=!1,n=0,r;const i=qp(),s=()=>i.status!=="pending",o=p=>{var y;if(!s()){const h=new Wp(p);f(h),(y=e.onCancel)==null||y.call(e,h)}},a=()=>{t=!0},l=()=>{t=!1},u=()=>Ag.isFocused()&&(e.networkMode==="always"||jc.isOnline())&&e.canRun(),c=()=>MS(e.networkMode)&&e.canRun(),d=p=>{s()||(r==null||r(),i.resolve(p))},f=p=>{s()||(r==null||r(),i.reject(p))},m=()=>new Promise(p=>{var y;r=h=>{(s()||u())&&p(h)},(y=e.onPause)==null||y.call(e)}).then(()=>{var p;r=void 0,s()||(p=e.onContinue)==null||p.call(e)}),_=()=>{if(s())return;let p;const y=n===0?e.initialPromise:void 0;try{p=y??e.fn()}catch(h){p=Promise.reject(h)}Promise.resolve(p).then(d).catch(h=>{var S;if(s())return;const v=e.retry??(ol.isServer()?0:3),x=e.retryDelay??UA,b=typeof x=="function"?x(n,h):x,E=v===!0||typeof v=="number"&&nu()?void 0:m()).then(()=>{t?f(h):_()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r==null||r(),i),cancelRetry:a,continueRetry:l,canStart:c,start:()=>(c()?_():m().then(_),i)}}var Fi,ew,NS=(ew=class{constructor(){X(this,Fi)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),zp(this.gcTime)&&H(this,Fi,Ni.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ol.isServer()?1/0:5*60*1e3))}clearGcTimeout(){k(this,Fi)!==void 0&&(Ni.clearTimeout(k(this,Fi)),H(this,Fi,void 0))}},Fi=new WeakMap,ew);function VA(e){return{onFetch:(t,n)=>{var c,d,f,m,_;const r=t.options,i=(f=(d=(c=t.fetchOptions)==null?void 0:c.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,s=((m=t.state.data)==null?void 0:m.pages)||[],o=((_=t.state.data)==null?void 0:_.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let p=!1;const y=x=>{LA(x,()=>t.signal,()=>p=!0)},h=IS(t.options,t.fetchOptions),v=async(x,b,E)=>{if(p)return Promise.reject(t.signal.reason);if(b==null&&x.pages.length)return Promise.resolve(x);const P=(()=>{const N={client:t.client,queryKey:t.queryKey,pageParam:b,direction:E?"backward":"forward",meta:t.options.meta};return y(N),N})(),C=await h(P),{maxPages:T}=t.options,R=E?FA:$A;return{pages:R(x.pages,C,T),pageParams:R(x.pageParams,b,T)}};if(i&&s.length){const x=i==="backward",b=x?$S:Hp,E={pages:s,pageParams:o},S=b(r,E);a=await v(E,S,x)}else{const x=e??s.length;do{const b=l===0?o[0]??r.initialPageParam:Hp(r,a);if(l>0&&b==null)break;a=await v(a,b),l++}while(l{var p,y;return(y=(p=t.options).persister)==null?void 0:y.call(p,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function Hp(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function $S(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}function sz(e,t){return t?Hp(e,t)!=null:!1}function oz(e,t){return!t||!e.getPreviousPageParam?!1:$S(e,t)!=null}var no,Li,ro,nn,ji,tt,dl,Di,Bt,FS,Zn,tw,BA=(tw=class extends NS{constructor(t){super();X(this,Bt);X(this,no);X(this,Li);X(this,ro);X(this,nn);X(this,ji);X(this,tt);X(this,dl);X(this,Di);H(this,Di,!1),H(this,dl,t.defaultOptions),this.setOptions(t.options),this.observers=[],H(this,ji,t.client),H(this,nn,k(this,ji).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,H(this,Li,s0(this.options)),this.state=t.state??k(this,Li),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return k(this,no)}get promise(){var t;return(t=k(this,tt))==null?void 0:t.promise}setOptions(t){if(this.options={...k(this,dl),...t},t!=null&&t._type&&H(this,no,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=s0(this.options);n.data!==void 0&&(this.setState(i0(n.data,n.dataUpdatedAt)),H(this,Li,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&k(this,nn).remove(this)}setData(t,n){const r=Bp(this.state.data,t,this.options);return ue(this,Bt,Zn).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){ue(this,Bt,Zn).call(this,{type:"setState",state:t})}cancel(t){var r,i;const n=(r=k(this,tt))==null?void 0:r.promise;return(i=k(this,tt))==null||i.cancel(t),n?n.then(At).catch(At):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return k(this,Li)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Wt(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===$g||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>si(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!RS(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=k(this,tt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=k(this,tt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),k(this,nn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(k(this,tt)&&(k(this,Di)||ue(this,Bt,FS).call(this)?k(this,tt).cancel({revert:!0}):k(this,tt).cancelRetry()),this.scheduleGc()),k(this,nn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ue(this,Bt,Zn).call(this,{type:"invalidate"})}async fetch(t,n){var u,c,d,f,m,_,p,y,h,v,x;if(this.state.fetchStatus!=="idle"&&((u=k(this,tt))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(k(this,tt))return k(this,tt).continueRetry(),k(this,tt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const b=this.observers.find(E=>E.options.queryFn);b&&this.setOptions(b.options)}const r=new AbortController,i=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(H(this,Di,!0),r.signal)})},s=()=>{const b=IS(this.options,n),S=(()=>{const P={client:k(this,ji),queryKey:this.queryKey,meta:this.meta};return i(P),P})();return H(this,Di,!1),this.options.persister?this.options.persister(b,S,this):b(S)},a=(()=>{const b={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:k(this,ji),state:this.state,fetchFn:s};return i(b),b})(),l=k(this,no)==="infinite"?VA(this.options.pages):this.options.behavior;l==null||l.onFetch(a,this),H(this,ro,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=a.fetchOptions)==null?void 0:c.meta))&&ue(this,Bt,Zn).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta}),H(this,tt,AS({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,onCancel:b=>{b instanceof Wp&&b.revert&&this.setState({...k(this,ro),fetchStatus:"idle"}),r.abort()},onFail:(b,E)=>{ue(this,Bt,Zn).call(this,{type:"failed",failureCount:b,error:E})},onPause:()=>{ue(this,Bt,Zn).call(this,{type:"pause"})},onContinue:()=>{ue(this,Bt,Zn).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const b=await k(this,tt).start();if(b===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(b),(m=(f=k(this,nn).config).onSuccess)==null||m.call(f,b,this),(p=(_=k(this,nn).config).onSettled)==null||p.call(_,b,this.state.error,this),b}catch(b){if(b instanceof Wp){if(b.silent)return k(this,tt).promise;if(b.revert){if(this.state.data===void 0)throw b;return this.state.data}}throw ue(this,Bt,Zn).call(this,{type:"error",error:b}),(h=(y=k(this,nn).config).onError)==null||h.call(y,b,this),(x=(v=k(this,nn).config).onSettled)==null||x.call(v,this.state.data,b,this),b}finally{this.scheduleGc()}}},no=new WeakMap,Li=new WeakMap,ro=new WeakMap,nn=new WeakMap,ji=new WeakMap,tt=new WeakMap,dl=new WeakMap,Di=new WeakMap,Bt=new WeakSet,FS=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Zn=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...LS(r.data,this.options),fetchMeta:t.meta??null};case"success":const i={...r,...i0(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return H(this,ro,t.manual?i:void 0),i;case"error":const s=t.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),at.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),k(this,nn).notify({query:this,type:"updated",action:t})})},tw);function LS(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:MS(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function i0(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function s0(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Ot,fe,fl,xt,zi,io,sr,Vr,hl,so,oo,Ui,Vi,Br,ao,me,ha,Gp,Kp,Qp,Yp,Xp,Jp,Zp,jS,nw,qA=(nw=class extends El{constructor(t,n){super();X(this,me);X(this,Ot);X(this,fe);X(this,fl);X(this,xt);X(this,zi);X(this,io);X(this,sr);X(this,Vr);X(this,hl);X(this,so);X(this,oo);X(this,Ui);X(this,Vi);X(this,Br);X(this,ao,new Set);this.options=n,H(this,Ot,t),H(this,Vr,null),H(this,sr,qp()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(k(this,fe).addObserver(this),o0(k(this,fe),this.options)?ue(this,me,ha).call(this):this.updateResult(),ue(this,me,Yp).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ev(k(this,fe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ev(k(this,fe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ue(this,me,Xp).call(this),ue(this,me,Jp).call(this),k(this,fe).removeObserver(this)}setOptions(t){const n=this.options,r=k(this,fe);if(this.options=k(this,Ot).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Wt(this.options.enabled,k(this,fe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ue(this,me,Zp).call(this),k(this,fe).setOptions(this.options),n._defaulted&&!Up(this.options,n)&&k(this,Ot).getQueryCache().notify({type:"observerOptionsUpdated",query:k(this,fe),observer:this});const i=this.hasListeners();i&&a0(k(this,fe),r,this.options,n)&&ue(this,me,ha).call(this),this.updateResult(),i&&(k(this,fe)!==r||Wt(this.options.enabled,k(this,fe))!==Wt(n.enabled,k(this,fe))||si(this.options.staleTime,k(this,fe))!==si(n.staleTime,k(this,fe)))&&ue(this,me,Gp).call(this);const s=ue(this,me,Kp).call(this);i&&(k(this,fe)!==r||Wt(this.options.enabled,k(this,fe))!==Wt(n.enabled,k(this,fe))||s!==k(this,Br))&&ue(this,me,Qp).call(this,s)}getOptimisticResult(t){const n=k(this,Ot).getQueryCache().build(k(this,Ot),t),r=this.createResult(n,t);return HA(this,r)&&(H(this,xt,r),H(this,io,this.options),H(this,zi,k(this,fe).state)),r}getCurrentResult(){return k(this,xt)}trackResult(t,n){return new Proxy(t,{get:(r,i)=>(this.trackProp(i),n==null||n(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&k(this,sr).status==="pending"&&k(this,sr).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(t){k(this,ao).add(t)}getCurrentQuery(){return k(this,fe)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=k(this,Ot).defaultQueryOptions(t),r=k(this,Ot).getQueryCache().build(k(this,Ot),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ue(this,me,ha).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),k(this,xt)))}createResult(t,n){var T;const r=k(this,fe),i=this.options,s=k(this,xt),o=k(this,zi),a=k(this,io),u=t!==r?t.state:k(this,fl),{state:c}=t;let d={...c},f=!1,m;if(n._optimisticResults){const R=this.hasListeners(),N=!R&&o0(t,n),M=R&&a0(t,r,n,i);(N||M)&&(d={...d,...LS(c.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:_,errorUpdatedAt:p,status:y}=d;m=d.data;let h=!1;if(n.placeholderData!==void 0&&m===void 0&&y==="pending"){let R;s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(R=s.data,h=!0):R=typeof n.placeholderData=="function"?n.placeholderData((T=k(this,oo))==null?void 0:T.state.data,k(this,oo)):n.placeholderData,R!==void 0&&(y="success",m=Bp(s==null?void 0:s.data,R,n),f=!0)}if(n.select&&m!==void 0&&!h)if(s&&m===(o==null?void 0:o.data)&&n.select===k(this,hl))m=k(this,so);else try{H(this,hl,n.select),m=n.select(m),m=Bp(s==null?void 0:s.data,m,n),H(this,so,m),H(this,Vr,null)}catch(R){H(this,Vr,R)}k(this,Vr)&&(_=k(this,Vr),m=k(this,so),p=Date.now(),y="error");const v=d.fetchStatus==="fetching",x=y==="pending",b=y==="error",E=x&&v,S=m!==void 0,C={status:y,fetchStatus:d.fetchStatus,isPending:x,isSuccess:y==="success",isError:b,isInitialLoading:E,isLoading:E,data:m,dataUpdatedAt:d.dataUpdatedAt,error:_,errorUpdatedAt:p,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:v,isRefetching:v&&!x,isLoadingError:b&&!S,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:b&&S,isStale:Fg(t,n),refetch:this.refetch,promise:k(this,sr),isEnabled:Wt(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const R=C.data!==void 0,N=C.status==="error"&&!R,M=W=>{N?W.reject(C.error):R&&W.resolve(C.data)},z=()=>{const W=H(this,sr,C.promise=qp());M(W)},F=k(this,sr);switch(F.status){case"pending":t.queryHash===r.queryHash&&M(F);break;case"fulfilled":(N||C.data!==F.value)&&z();break;case"rejected":(!N||C.error!==F.reason)&&z();break}}return C}updateResult(){const t=k(this,xt),n=this.createResult(k(this,fe),this.options);if(H(this,zi,k(this,fe).state),H(this,io,this.options),k(this,zi).data!==void 0&&H(this,oo,k(this,fe)),Up(n,t))return;H(this,xt,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!k(this,ao).size)return!0;const o=new Set(s??k(this,ao));return this.options.throwOnError&&o.add("error"),Object.keys(k(this,xt)).some(a=>{const l=a;return k(this,xt)[l]!==t[l]&&o.has(l)})};ue(this,me,jS).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ue(this,me,Yp).call(this)}},Ot=new WeakMap,fe=new WeakMap,fl=new WeakMap,xt=new WeakMap,zi=new WeakMap,io=new WeakMap,sr=new WeakMap,Vr=new WeakMap,hl=new WeakMap,so=new WeakMap,oo=new WeakMap,Ui=new WeakMap,Vi=new WeakMap,Br=new WeakMap,ao=new WeakMap,me=new WeakSet,ha=function(t){ue(this,me,Zp).call(this);let n=k(this,fe).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(At)),n},Gp=function(){ue(this,me,Xp).call(this);const t=si(this.options.staleTime,k(this,fe));if(ol.isServer()||k(this,xt).isStale||!zp(t))return;const r=RS(k(this,xt).dataUpdatedAt,t)+1;H(this,Ui,Ni.setTimeout(()=>{k(this,xt).isStale||this.updateResult()},r))},Kp=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(k(this,fe)):this.options.refetchInterval)??!1},Qp=function(t){ue(this,me,Jp).call(this),H(this,Br,t),!(ol.isServer()||Wt(this.options.enabled,k(this,fe))===!1||!zp(k(this,Br))||k(this,Br)===0)&&H(this,Vi,Ni.setInterval(()=>{(this.options.refetchIntervalInBackground||Ag.isFocused())&&ue(this,me,ha).call(this)},k(this,Br)))},Yp=function(){ue(this,me,Gp).call(this),ue(this,me,Qp).call(this,ue(this,me,Kp).call(this))},Xp=function(){k(this,Ui)!==void 0&&(Ni.clearTimeout(k(this,Ui)),H(this,Ui,void 0))},Jp=function(){k(this,Vi)!==void 0&&(Ni.clearInterval(k(this,Vi)),H(this,Vi,void 0))},Zp=function(){const t=k(this,Ot).getQueryCache().build(k(this,Ot),this.options);if(t===k(this,fe))return;const n=k(this,fe);H(this,fe,t),H(this,fl,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},jS=function(t){at.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(k(this,xt))}),k(this,Ot).getQueryCache().notify({query:k(this,fe),type:"observerResultsUpdated"})})},nw);function WA(e,t){return Wt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Wt(t.retryOnMount,e)===!1)}function o0(e,t){return WA(e,t)||e.state.data!==void 0&&ev(e,t,t.refetchOnMount)}function ev(e,t,n){if(Wt(t.enabled,e)!==!1&&si(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Fg(e,t)}return!1}function a0(e,t,n,r){return(e!==t||Wt(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Fg(e,n)}function Fg(e,t){return Wt(t.enabled,e)!==!1&&e.isStaleByTime(si(t.staleTime,e))}function HA(e,t){return!Up(e.getCurrentResult(),t)}var pl,Fn,pt,Bi,Ln,Ar,rw,GA=(rw=class extends NS{constructor(t){super();X(this,Ln);X(this,pl);X(this,Fn);X(this,pt);X(this,Bi);H(this,pl,t.client),this.mutationId=t.mutationId,H(this,pt,t.mutationCache),H(this,Fn,[]),this.state=t.state||KA(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){k(this,Fn).includes(t)||(k(this,Fn).push(t),this.clearGcTimeout(),k(this,pt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){H(this,Fn,k(this,Fn).filter(n=>n!==t)),this.scheduleGc(),k(this,pt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){k(this,Fn).length||(this.state.status==="pending"?this.scheduleGc():k(this,pt).remove(this))}continue(){var t;return((t=k(this,Bi))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,a,l,u,c,d,f,m,_,p,y,h,v,x,b,E,S,P;const n=()=>{ue(this,Ln,Ar).call(this,{type:"continue"})},r={client:k(this,pl),meta:this.options.meta,mutationKey:this.options.mutationKey};H(this,Bi,AS({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(C,T)=>{ue(this,Ln,Ar).call(this,{type:"failed",failureCount:C,error:T})},onPause:()=>{ue(this,Ln,Ar).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>k(this,pt).canRun(this)}));const i=this.state.status==="pending",s=!k(this,Bi).canStart();try{if(i)n();else{ue(this,Ln,Ar).call(this,{type:"pending",variables:t,isPaused:s}),k(this,pt).config.onMutate&&await k(this,pt).config.onMutate(t,this,r);const T=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,t,r));T!==this.state.context&&ue(this,Ln,Ar).call(this,{type:"pending",context:T,variables:t,isPaused:s})}const C=await k(this,Bi).start();return await((u=(l=k(this,pt).config).onSuccess)==null?void 0:u.call(l,C,t,this.state.context,this,r)),await((d=(c=this.options).onSuccess)==null?void 0:d.call(c,C,t,this.state.context,r)),await((m=(f=k(this,pt).config).onSettled)==null?void 0:m.call(f,C,null,this.state.variables,this.state.context,this,r)),await((p=(_=this.options).onSettled)==null?void 0:p.call(_,C,null,t,this.state.context,r)),ue(this,Ln,Ar).call(this,{type:"success",data:C}),C}catch(C){try{await((h=(y=k(this,pt).config).onError)==null?void 0:h.call(y,C,t,this.state.context,this,r))}catch(T){Promise.reject(T)}try{await((x=(v=this.options).onError)==null?void 0:x.call(v,C,t,this.state.context,r))}catch(T){Promise.reject(T)}try{await((E=(b=k(this,pt).config).onSettled)==null?void 0:E.call(b,void 0,C,this.state.variables,this.state.context,this,r))}catch(T){Promise.reject(T)}try{await((P=(S=this.options).onSettled)==null?void 0:P.call(S,void 0,C,t,this.state.context,r))}catch(T){Promise.reject(T)}throw ue(this,Ln,Ar).call(this,{type:"error",error:C}),C}finally{k(this,pt).runNext(this)}}},pl=new WeakMap,Fn=new WeakMap,pt=new WeakMap,Bi=new WeakMap,Ln=new WeakSet,Ar=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),at.batch(()=>{k(this,Fn).forEach(r=>{r.onMutationUpdate(t)}),k(this,pt).notify({mutation:this,type:"updated",action:t})})},rw);function KA(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var or,_n,vl,iw,QA=(iw=class extends El{constructor(t={}){super();X(this,or);X(this,_n);X(this,vl);this.config=t,H(this,or,new Set),H(this,_n,new Map),H(this,vl,0)}build(t,n,r){const i=new GA({client:t,mutationCache:this,mutationId:++Tl(this,vl)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){k(this,or).add(t);const n=su(t);if(typeof n=="string"){const r=k(this,_n).get(n);r?r.push(t):k(this,_n).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(k(this,or).delete(t)){const n=su(t);if(typeof n=="string"){const r=k(this,_n).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&k(this,_n).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=su(t);if(typeof n=="string"){const r=k(this,_n).get(n),i=r==null?void 0:r.find(s=>s.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=su(t);if(typeof n=="string"){const i=(r=k(this,_n).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){at.batch(()=>{k(this,or).forEach(t=>{this.notify({type:"removed",mutation:t})}),k(this,or).clear(),k(this,_n).clear()})}getAll(){return Array.from(k(this,or))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>t0(n,r))}findAll(t={}){return this.getAll().filter(n=>t0(t,n))}notify(t){at.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return at.batch(()=>Promise.all(t.map(n=>n.continue().catch(At))))}},or=new WeakMap,_n=new WeakMap,vl=new WeakMap,iw);function su(e){var t;return(t=e.options.scope)==null?void 0:t.id}var jn,sw,YA=(sw=class extends El{constructor(t={}){super();X(this,jn);this.config=t,H(this,jn,new Map)}build(t,n,r){const i=n.queryKey,s=n.queryHash??Ng(i,n);let o=this.get(s);return o||(o=new BA({client:t,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){k(this,jn).has(t.queryHash)||(k(this,jn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=k(this,jn).get(t.queryHash);n&&(t.destroy(),n===t&&k(this,jn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){at.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return k(this,jn).get(t)}getAll(){return[...k(this,jn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>e0(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>e0(t,r)):n}notify(t){at.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){at.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){at.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},jn=new WeakMap,sw),qe,qr,Wr,lo,uo,Hr,co,fo,ow,XA=(ow=class{constructor(e={}){X(this,qe);X(this,qr);X(this,Wr);X(this,lo);X(this,uo);X(this,Hr);X(this,co);X(this,fo);H(this,qe,e.queryCache||new YA),H(this,qr,e.mutationCache||new QA),H(this,Wr,e.defaultOptions||{}),H(this,lo,new Map),H(this,uo,new Map),H(this,Hr,0)}mount(){Tl(this,Hr)._++,k(this,Hr)===1&&(H(this,co,Ag.subscribe(async e=>{e&&(await this.resumePausedMutations(),k(this,qe).onFocus())})),H(this,fo,jc.subscribe(async e=>{e&&(await this.resumePausedMutations(),k(this,qe).onOnline())})))}unmount(){var e,t;Tl(this,Hr)._--,k(this,Hr)===0&&((e=k(this,co))==null||e.call(this),H(this,co,void 0),(t=k(this,fo))==null||t.call(this),H(this,fo,void 0))}isFetching(e){return k(this,qe).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return k(this,qr).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=k(this,qe).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=k(this,qe).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(si(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return k(this,qe).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=k(this,qe).get(r.queryHash),s=i==null?void 0:i.state.data,o=MA(t,s);if(o!==void 0)return k(this,qe).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return at.batch(()=>k(this,qe).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=k(this,qe).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=k(this,qe);at.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=k(this,qe);return at.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=at.batch(()=>k(this,qe).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(At).catch(At)}invalidateQueries(e,t={}){return at.batch(()=>(k(this,qe).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=at.batch(()=>k(this,qe).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(At)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(At)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=k(this,qe).build(this,t);return n.isStaleByTime(si(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(At).catch(At)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(At).catch(At)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return jc.isOnline()?k(this,qr).resumePausedMutations():Promise.resolve()}getQueryCache(){return k(this,qe)}getMutationCache(){return k(this,qr)}getDefaultOptions(){return k(this,Wr)}setDefaultOptions(e){H(this,Wr,e)}setQueryDefaults(e,t){k(this,lo).set(il(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...k(this,lo).values()],n={};return t.forEach(r=>{sl(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){k(this,uo).set(il(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...k(this,uo).values()],n={};return t.forEach(r=>{sl(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...k(this,Wr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ng(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===$g&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...k(this,Wr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){k(this,qe).clear(),k(this,qr).clear()}},qe=new WeakMap,qr=new WeakMap,Wr=new WeakMap,lo=new WeakMap,uo=new WeakMap,Hr=new WeakMap,co=new WeakMap,fo=new WeakMap,ow),DS=g.createContext(void 0),zS=e=>{const t=g.useContext(DS);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},JA=({client:e,children:t})=>(g.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),w.jsx(DS.Provider,{value:e,children:t})),US=g.createContext(!1),ZA=()=>g.useContext(US);US.Provider;function eN(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var tN=g.createContext(eN()),nN=()=>g.useContext(tN),rN=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?OS(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},iN=e=>{g.useEffect(()=>{e.clearReset()},[e])},sN=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||OS(n,[e.error,r])),oN=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},aN=(e,t)=>e.isLoading&&e.isFetching&&!t,lN=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,l0=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function uN(e,t,n){var f,m,_,p;const r=ZA(),i=nN(),s=zS(),o=s.defaultQueryOptions(e);(m=(f=s.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||m.call(f,o);const a=s.getQueryCache().get(o.queryHash);o._optimisticResults=r?"isRestoring":"optimistic",oN(o),rN(o,i,a),iN(i);const l=!s.getQueryCache().get(o.queryHash),[u]=g.useState(()=>new t(s,o)),c=u.getOptimisticResult(o),d=!r&&e.subscribed!==!1;if(g.useSyncExternalStore(g.useCallback(y=>{const h=d?u.subscribe(at.batchCalls(y)):At;return u.updateResult(),h},[u,d]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),g.useEffect(()=>{u.setOptions(o)},[o,u]),lN(o,c))throw l0(o,u,i);if(sN({result:c,errorResetBoundary:i,throwOnError:o.throwOnError,query:a,suspense:o.suspense}))throw c.error;if((p=(_=s.getDefaultOptions().queries)==null?void 0:_._experimental_afterQuery)==null||p.call(_,o,c),o.experimental_prefetchInRender&&!ol.isServer()&&aN(c,r)){const y=l?l0(o,u,i):a==null?void 0:a.promise;y==null||y.catch(At).finally(()=>{u.updateResult()})}return o.notifyOnChangeProps?c:u.trackResult(c)}function cN(e,t){return uN(e,qA)}function ee(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function u0(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function vi(...e){return t=>{let n=!1;const r=e.map(i=>{const s=u0(i,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i{const{children:o,...a}=s,l=g.useMemo(()=>a,Object.values(a));return w.jsx(n.Provider,{value:l,children:o})};r.displayName=e+"Provider";function i(s){const o=g.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,i]}function ss(e,t=[]){let n=[];function r(s,o){const a=g.createContext(o),l=n.length;n=[...n,o];const u=d=>{var h;const{scope:f,children:m,..._}=d,p=((h=f==null?void 0:f[e])==null?void 0:h[l])||a,y=g.useMemo(()=>_,Object.values(_));return w.jsx(p.Provider,{value:y,children:m})};u.displayName=s+"Provider";function c(d,f){var p;const m=((p=f==null?void 0:f[e])==null?void 0:p[l])||a,_=g.useContext(m);if(_)return _;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[u,c]}const i=()=>{const s=n.map(o=>g.createContext(o));return function(a){const l=(a==null?void 0:a[e])||s;return g.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,fN(i,...t)]}function fN(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:l,scopeName:u})=>{const d=l(s)[`__scope${u}`];return{...a,...d}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var fn=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},hN=Kc[" useId ".trim().toString()]||(()=>{}),pN=0;function Qs(e){const[t,n]=g.useState(hN());return fn(()=>{n(r=>r??String(pN++))},[e]),t?`radix-${t}`:""}var vN=Kc[" useInsertionEffect ".trim().toString()]||fn;function yd({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,s,o]=gN({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:i;{const c=g.useRef(e!==void 0);g.useEffect(()=>{const d=c.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),c.current=a},[a,r])}const u=g.useCallback(c=>{var d;if(a){const f=mN(c)?c(e):c;f!==e&&((d=o.current)==null||d.call(o,f))}else s(c)},[a,e,s,o]);return[l,u]}function gN({defaultProp:e,onChange:t}){const[n,r]=g.useState(e),i=g.useRef(n),s=g.useRef(t);return vN(()=>{s.current=t},[t]),g.useEffect(()=>{var o;i.current!==n&&((o=s.current)==null||o.call(s,n),i.current=n)},[n,i]),[n,r,s]}function mN(e){return typeof e=="function"}function yN(e){const t=_N(e),n=g.forwardRef((r,i)=>{const{children:s,...o}=r,a=g.Children.toArray(s),l=a.find(xN);if(l){const u=l.props.children,c=a.map(d=>d===l?g.Children.count(u)>1?g.Children.only(null):g.isValidElement(u)?u.props.children:null:d);return w.jsx(t,{...o,ref:i,children:g.isValidElement(u)?g.cloneElement(u,void 0,c):null})}return w.jsx(t,{...o,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}function _N(e){const t=g.forwardRef((n,r)=>{const{children:i,...s}=n;if(g.isValidElement(i)){const o=EN(i),a=bN(s,i.props);return i.type!==g.Fragment&&(a.ref=r?vi(r,o):o),g.cloneElement(i,a)}return g.Children.count(i)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var wN=Symbol("radix.slottable");function xN(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===wN}function bN(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const l=s(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function EN(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var SN=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ke=SN.reduce((e,t)=>{const n=yN(`Primitive.${t}`),r=g.forwardRef((i,s)=>{const{asChild:o,...a}=i,l=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(l,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Lg(e,t){e&&xl.flushSync(()=>e.dispatchEvent(t))}function Ut(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function CN(e,t=globalThis==null?void 0:globalThis.document){const n=Ut(e);g.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var kN="DismissableLayer",tv="dismissableLayer.update",PN="dismissableLayer.pointerDownOutside",RN="dismissableLayer.focusOutside",c0,VS=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),_d=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:a,...l}=e,u=g.useContext(VS),[c,d]=g.useState(null),f=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=g.useState({}),_=et(t,P=>d(P)),p=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),h=p.indexOf(y),v=c?p.indexOf(c):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,b=v>=h,E=IN(P=>{const C=P.target,T=[...u.branches].some(R=>R.contains(C));!b||T||(i==null||i(P),o==null||o(P),P.defaultPrevented||a==null||a())},f),S=ON(P=>{const C=P.target;[...u.branches].some(R=>R.contains(C))||(s==null||s(P),o==null||o(P),P.defaultPrevented||a==null||a())},f);return CN(P=>{v===u.layers.size-1&&(r==null||r(P),!P.defaultPrevented&&a&&(P.preventDefault(),a()))},f),g.useEffect(()=>{if(c)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(c0=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),d0(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=c0)}},[c,f,n,u]),g.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),d0())},[c,u]),g.useEffect(()=>{const P=()=>m({});return document.addEventListener(tv,P),()=>document.removeEventListener(tv,P)},[]),w.jsx(ke.div,{...l,ref:_,style:{pointerEvents:x?b?"auto":"none":void 0,...e.style},onFocusCapture:ee(e.onFocusCapture,S.onFocusCapture),onBlurCapture:ee(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:ee(e.onPointerDownCapture,E.onPointerDownCapture)})});_d.displayName=kN;var TN="DismissableLayerBranch",BS=g.forwardRef((e,t)=>{const n=g.useContext(VS),r=g.useRef(null),i=et(t,r);return g.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),w.jsx(ke.div,{...e,ref:i})});BS.displayName=TN;function IN(e,t=globalThis==null?void 0:globalThis.document){const n=Ut(e),r=g.useRef(!1),i=g.useRef(()=>{});return g.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let l=function(){qS(PN,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}else t.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",s),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function ON(e,t=globalThis==null?void 0:globalThis.document){const n=Ut(e),r=g.useRef(!1);return g.useEffect(()=>{const i=s=>{s.target&&!r.current&&qS(RN,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function d0(){const e=new CustomEvent(tv);document.dispatchEvent(e)}function qS(e,t,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Lg(i,s):i.dispatchEvent(s)}var MN=_d,AN=BS,Vf="focusScope.autoFocusOnMount",Bf="focusScope.autoFocusOnUnmount",f0={bubbles:!1,cancelable:!0},NN="FocusScope",jg=g.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=e,[a,l]=g.useState(null),u=Ut(i),c=Ut(s),d=g.useRef(null),f=et(t,p=>l(p)),m=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(r){let p=function(x){if(m.paused||!a)return;const b=x.target;a.contains(b)?d.current=b:Nr(d.current,{select:!0})},y=function(x){if(m.paused||!a)return;const b=x.relatedTarget;b!==null&&(a.contains(b)||Nr(d.current,{select:!0}))},h=function(x){if(document.activeElement===document.body)for(const E of x)E.removedNodes.length>0&&Nr(a)};document.addEventListener("focusin",p),document.addEventListener("focusout",y);const v=new MutationObserver(h);return a&&v.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",y),v.disconnect()}}},[r,a,m.paused]),g.useEffect(()=>{if(a){p0.add(m);const p=document.activeElement;if(!a.contains(p)){const h=new CustomEvent(Vf,f0);a.addEventListener(Vf,u),a.dispatchEvent(h),h.defaultPrevented||($N(zN(WS(a)),{select:!0}),document.activeElement===p&&Nr(a))}return()=>{a.removeEventListener(Vf,u),setTimeout(()=>{const h=new CustomEvent(Bf,f0);a.addEventListener(Bf,c),a.dispatchEvent(h),h.defaultPrevented||Nr(p??document.body,{select:!0}),a.removeEventListener(Bf,c),p0.remove(m)},0)}}},[a,u,c,m]);const _=g.useCallback(p=>{if(!n&&!r||m.paused)return;const y=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,h=document.activeElement;if(y&&h){const v=p.currentTarget,[x,b]=FN(v);x&&b?!p.shiftKey&&h===b?(p.preventDefault(),n&&Nr(x,{select:!0})):p.shiftKey&&h===x&&(p.preventDefault(),n&&Nr(b,{select:!0})):h===v&&p.preventDefault()}},[n,r,m.paused]);return w.jsx(ke.div,{tabIndex:-1,...o,ref:f,onKeyDown:_})});jg.displayName=NN;function $N(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Nr(r,{select:t}),document.activeElement!==n)return}function FN(e){const t=WS(e),n=h0(t,e),r=h0(t.reverse(),e);return[n,r]}function WS(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 h0(e,t){for(const n of e)if(!LN(n,{upTo:t}))return n}function LN(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function jN(e){return e instanceof HTMLInputElement&&"select"in e}function Nr(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&jN(e)&&t&&e.select()}}var p0=DN();function DN(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=v0(e,t),e.unshift(t)},remove(t){var n;e=v0(e,t),(n=e[0])==null||n.resume()}}}function v0(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function zN(e){return e.filter(t=>t.tagName!=="A")}var UN="Portal",wd=g.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[i,s]=g.useState(!1);fn(()=>s(!0),[]);const o=n||i&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?vT.createPortal(w.jsx(ke.div,{...r,ref:t}),o):null});wd.displayName=UN;function VN(e,t){return g.useReducer((n,r)=>t[n][r]??n,e)}var br=e=>{const{present:t,children:n}=e,r=BN(t),i=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),s=et(r.ref,qN(i));return typeof n=="function"||r.isPresent?g.cloneElement(i,{ref:s}):null};br.displayName="Presence";function BN(e){const[t,n]=g.useState(),r=g.useRef(null),i=g.useRef(e),s=g.useRef("none"),o=e?"mounted":"unmounted",[a,l]=VN(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const u=ou(r.current);s.current=a==="mounted"?u:"none"},[a]),fn(()=>{const u=r.current,c=i.current;if(c!==e){const f=s.current,m=ou(u);e?l("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(c&&f!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),fn(()=>{if(t){let u;const c=t.ownerDocument.defaultView??window,d=m=>{const p=ou(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&p&&(l("ANIMATION_END"),!i.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",u=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},f=m=>{m.target===t&&(s.current=ou(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{c.clearTimeout(u),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:g.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function ou(e){return(e==null?void 0:e.animationName)||"none"}function qN(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var qf=0;function HS(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??g0()),document.body.insertAdjacentElement("beforeend",e[1]??g0()),qf++,()=>{qf===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),qf--}},[])}function g0(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Un=function(){return Un=Object.assign||function(t){for(var n,r=1,i=arguments.length;r"u")return a$;var t=l$(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},c$=YS(),Ys="data-scroll-locked",d$=function(e,t,n,r){var i=e.left,s=e.top,o=e.right,a=e.gap;return n===void 0&&(n="margin"),` - .`.concat(HN,` { + */function Fc(){return Fc=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function dA(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function fA(e,t){return e.button===0&&(!t||t==="_self")&&!dA(e)}function jp(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function hA(e,t){let n=jp(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(s=>{n.append(i,s)})}),n}const pA=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],vA=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],gA="6";try{window.__reactRouterVersion=gA}catch{}const mA=g.createContext({isTransitioning:!1}),yA="startTransition",Lc=Kc[yA];function _A(e){let{basename:t,children:n,future:r,window:i}=e,s=g.useRef();s.current==null&&(s.current=wM({window:i,v5Compat:!0}));let o=s.current,[a,l]=g.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},c=g.useCallback(d=>{u&&Lc?Lc(()=>l(d)):l(d)},[l,u]);return g.useLayoutEffect(()=>o.listen(c),[o,c]),g.useEffect(()=>SS(r),[r]),g.createElement(CS,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:o,future:r})}function wA(e){let{basename:t,children:n,future:r,window:i}=e,s=g.useRef();s.current==null&&(s.current=xM({window:i,v5Compat:!0}));let o=s.current,[a,l]=g.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},c=g.useCallback(d=>{u&&Lc?Lc(()=>l(d)):l(d)},[l,u]);return g.useLayoutEffect(()=>o.listen(c),[o,c]),g.useEffect(()=>SS(r),[r]),g.createElement(CS,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:o,future:r})}const xA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",bA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,bn=g.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:s,replace:o,state:a,target:l,to:u,preventScrollReset:c,viewTransition:d}=t,f=kS(t,pA),{basename:m}=g.useContext(xr),_,p=!1;if(typeof u=="string"&&bA.test(u)&&(_=u,xA))try{let x=new URL(window.location.href),b=u.startsWith("//")?new URL(x.protocol+u):new URL(u),E=Ro(b.pathname,m);b.origin===x.origin&&E!=null?u=E+b.search+b.hash:p=!0}catch{}let y=HM(u,{relative:i}),h=SA(u,{replace:o,state:a,target:l,preventScrollReset:c,relative:i,viewTransition:d});function v(x){r&&r(x),x.defaultPrevented||h(x)}return g.createElement("a",Fc({},f,{href:_||y,onClick:p||s?r:v,ref:n,target:l}))}),ys=g.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:i=!1,className:s="",end:o=!1,style:a,to:l,viewTransition:u,children:c}=t,d=kS(t,vA),f=md(l,{relative:d.relative}),m=hn(),_=g.useContext(mS),{navigator:p,basename:y}=g.useContext(xr),h=_!=null&&CA(f)&&u===!0,v=p.encodeLocation?p.encodeLocation(f).pathname:f.pathname,x=m.pathname,b=_&&_.navigation&&_.navigation.location?_.navigation.location.pathname:null;i||(x=x.toLowerCase(),b=b?b.toLowerCase():null,v=v.toLowerCase()),b&&y&&(b=Ro(b,y)||b);const E=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let S=x===v||!o&&x.startsWith(v)&&x.charAt(E)==="/",P=b!=null&&(b===v||!o&&b.startsWith(v)&&b.charAt(v.length)==="/"),C={isActive:S,isPending:P,isTransitioning:h},T=S?r:void 0,R;typeof s=="function"?R=s(C):R=[s,S?"active":null,P?"pending":null,h?"transitioning":null].filter(Boolean).join(" ");let N=typeof a=="function"?a(C):a;return g.createElement(bn,Fc({},d,{"aria-current":T,className:R,ref:n,style:N,to:l,viewTransition:u}),typeof c=="function"?c(C):c)});var Dp;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Dp||(Dp={}));var Z_;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Z_||(Z_={}));function EA(e){let t=g.useContext(vd);return t||Ue(!1),t}function SA(e,t){let{target:n,replace:r,state:i,preventScrollReset:s,relative:o,viewTransition:a}=t===void 0?{}:t,l=Mg(),u=hn(),c=md(e,{relative:o});return g.useCallback(d=>{if(fA(d,n)){d.preventDefault();let f=r!==void 0?r:nl(u)===nl(c);l(e,{replace:f,state:i,preventScrollReset:s,relative:o,viewTransition:a})}},[u,l,c,r,i,n,e,s,o,a])}function iz(e){let t=g.useRef(jp(e)),n=g.useRef(!1),r=hn(),i=g.useMemo(()=>hA(r.search,n.current?null:t.current),[r.search]),s=Mg(),o=g.useCallback((a,l)=>{const u=jp(typeof a=="function"?a(i):a);n.current=!0,s("?"+u,l)},[s,i]);return[i,o]}function CA(e,t){t===void 0&&(t={});let n=g.useContext(mA);n==null&&Ue(!1);let{basename:r}=EA(Dp.useViewTransitionState),i=md(e,{relative:t.relative});if(!n.isTransitioning)return!1;let s=Ro(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Ro(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Fp(i.pathname,o)!=null||Fp(i.pathname,s)!=null}var El=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},$i,Dr,eo,Y0,kA=(Y0=class extends El{constructor(){super();X(this,$i);X(this,Dr);X(this,eo);H(this,eo,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){k(this,Dr)||this.setEventListener(k(this,eo))}onUnsubscribe(){var t;this.hasListeners()||((t=k(this,Dr))==null||t.call(this),H(this,Dr,void 0))}setEventListener(t){var n;H(this,eo,t),(n=k(this,Dr))==null||n.call(this),H(this,Dr,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){k(this,$i)!==t&&(H(this,$i,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof k(this,$i)=="boolean"?k(this,$i):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},$i=new WeakMap,Dr=new WeakMap,eo=new WeakMap,Y0),Ag=new kA,PA={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},zr,vv,X0,RA=(X0=class{constructor(){X(this,zr,PA);X(this,vv,!1)}setTimeoutProvider(e){H(this,zr,e)}setTimeout(e,t){return k(this,zr).setTimeout(e,t)}clearTimeout(e){k(this,zr).clearTimeout(e)}setInterval(e,t){return k(this,zr).setInterval(e,t)}clearInterval(e){k(this,zr).clearInterval(e)}},zr=new WeakMap,vv=new WeakMap,X0),Ni=new RA;function TA(e){setTimeout(e,0)}var IA=typeof window>"u"||"Deno"in globalThis;function At(){}function OA(e,t){return typeof e=="function"?e(t):e}function zp(e){return typeof e=="number"&&e>=0&&e!==1/0}function PS(e,t){return Math.max(e+(t||0)-Date.now(),0)}function si(e,t){return typeof e=="function"?e(t):e}function Wt(e,t){return typeof e=="function"?e(t):e}function e0(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:a}=e;if(o){if(r){if(t.queryHash!==Ng(o,t.options))return!1}else if(!sl(t.queryKey,o))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||i&&i!==t.state.fetchStatus||s&&!s(t))}function t0(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(il(t.options.mutationKey)!==il(s))return!1}else if(!sl(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Ng(e,t){return((t==null?void 0:t.queryKeyHashFn)||il)(e)}function il(e){return JSON.stringify(e,(t,n)=>Vp(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function sl(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>sl(e[n],t[n])):!1}var MA=Object.prototype.hasOwnProperty;function RS(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=n0(e)&&n0(t);if(!r&&!(Vp(e)&&Vp(t)))return t;const s=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),a=o.length,l=r?new Array(a):{};let u=0;for(let c=0;c{Ni.setTimeout(t,e)})}function Bp(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?RS(e,t):t}function NA(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function $A(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var $g=Symbol();function TS(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===$g?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function IS(e,t){return typeof e=="function"?e(...t):!!e}function FA(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??(i=t()),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var ol=(()=>{let e=()=>IA;return{isServer(){return e()},setIsServer(t){e=t}}})();function qp(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var LA=TA;function jA(){let e=[],t=0,n=a=>{a()},r=a=>{a()},i=LA;const s=a=>{t?e.push(a):i(()=>{n(a)})},o=()=>{const a=e;e=[],a.length&&i(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||o()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var at=jA(),to,Ur,no,J0,DA=(J0=class extends El{constructor(){super();X(this,to,!0);X(this,Ur);X(this,no);H(this,no,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){k(this,Ur)||this.setEventListener(k(this,no))}onUnsubscribe(){var t;this.hasListeners()||((t=k(this,Ur))==null||t.call(this),H(this,Ur,void 0))}setEventListener(t){var n;H(this,no,t),(n=k(this,Ur))==null||n.call(this),H(this,Ur,t(this.setOnline.bind(this)))}setOnline(t){k(this,to)!==t&&(H(this,to,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return k(this,to)}},to=new WeakMap,Ur=new WeakMap,no=new WeakMap,J0),jc=new DA;function zA(e){return Math.min(1e3*2**e,3e4)}function OS(e){return(e??"online")==="online"?jc.isOnline():!0}var Wp=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function MS(e){let t=!1,n=0,r;const i=qp(),s=()=>i.status!=="pending",o=p=>{var y;if(!s()){const h=new Wp(p);f(h),(y=e.onCancel)==null||y.call(e,h)}},a=()=>{t=!0},l=()=>{t=!1},u=()=>Ag.isFocused()&&(e.networkMode==="always"||jc.isOnline())&&e.canRun(),c=()=>OS(e.networkMode)&&e.canRun(),d=p=>{s()||(r==null||r(),i.resolve(p))},f=p=>{s()||(r==null||r(),i.reject(p))},m=()=>new Promise(p=>{var y;r=h=>{(s()||u())&&p(h)},(y=e.onPause)==null||y.call(e)}).then(()=>{var p;r=void 0,s()||(p=e.onContinue)==null||p.call(e)}),_=()=>{if(s())return;let p;const y=n===0?e.initialPromise:void 0;try{p=y??e.fn()}catch(h){p=Promise.reject(h)}Promise.resolve(p).then(d).catch(h=>{var S;if(s())return;const v=e.retry??(ol.isServer()?0:3),x=e.retryDelay??zA,b=typeof x=="function"?x(n,h):x,E=v===!0||typeof v=="number"&&nu()?void 0:m()).then(()=>{t?f(h):_()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r==null||r(),i),cancelRetry:a,continueRetry:l,canStart:c,start:()=>(c()?_():m().then(_),i)}}var Fi,Z0,AS=(Z0=class{constructor(){X(this,Fi)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),zp(this.gcTime)&&H(this,Fi,Ni.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ol.isServer()?1/0:5*60*1e3))}clearGcTimeout(){k(this,Fi)!==void 0&&(Ni.clearTimeout(k(this,Fi)),H(this,Fi,void 0))}},Fi=new WeakMap,Z0);function UA(e){return{onFetch:(t,n)=>{var c,d,f,m,_;const r=t.options,i=(f=(d=(c=t.fetchOptions)==null?void 0:c.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,s=((m=t.state.data)==null?void 0:m.pages)||[],o=((_=t.state.data)==null?void 0:_.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let p=!1;const y=x=>{FA(x,()=>t.signal,()=>p=!0)},h=TS(t.options,t.fetchOptions),v=async(x,b,E)=>{if(p)return Promise.reject(t.signal.reason);if(b==null&&x.pages.length)return Promise.resolve(x);const P=(()=>{const N={client:t.client,queryKey:t.queryKey,pageParam:b,direction:E?"backward":"forward",meta:t.options.meta};return y(N),N})(),C=await h(P),{maxPages:T}=t.options,R=E?$A:NA;return{pages:R(x.pages,C,T),pageParams:R(x.pageParams,b,T)}};if(i&&s.length){const x=i==="backward",b=x?NS:Hp,E={pages:s,pageParams:o},S=b(r,E);a=await v(E,S,x)}else{const x=e??s.length;do{const b=l===0?o[0]??r.initialPageParam:Hp(r,a);if(l>0&&b==null)break;a=await v(a,b),l++}while(l{var p,y;return(y=(p=t.options).persister)==null?void 0:y.call(p,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function Hp(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function NS(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}function sz(e,t){return t?Hp(e,t)!=null:!1}function oz(e,t){return!t||!e.getPreviousPageParam?!1:NS(e,t)!=null}var ro,Li,io,nn,ji,tt,dl,Di,Bt,$S,Zn,ew,VA=(ew=class extends AS{constructor(t){super();X(this,Bt);X(this,ro);X(this,Li);X(this,io);X(this,nn);X(this,ji);X(this,tt);X(this,dl);X(this,Di);H(this,Di,!1),H(this,dl,t.defaultOptions),this.setOptions(t.options),this.observers=[],H(this,ji,t.client),H(this,nn,k(this,ji).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,H(this,Li,s0(this.options)),this.state=t.state??k(this,Li),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return k(this,ro)}get promise(){var t;return(t=k(this,tt))==null?void 0:t.promise}setOptions(t){if(this.options={...k(this,dl),...t},t!=null&&t._type&&H(this,ro,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=s0(this.options);n.data!==void 0&&(this.setState(i0(n.data,n.dataUpdatedAt)),H(this,Li,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&k(this,nn).remove(this)}setData(t,n){const r=Bp(this.state.data,t,this.options);return ue(this,Bt,Zn).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){ue(this,Bt,Zn).call(this,{type:"setState",state:t})}cancel(t){var r,i;const n=(r=k(this,tt))==null?void 0:r.promise;return(i=k(this,tt))==null||i.cancel(t),n?n.then(At).catch(At):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return k(this,Li)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Wt(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===$g||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>si(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!PS(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=k(this,tt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=k(this,tt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),k(this,nn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(k(this,tt)&&(k(this,Di)||ue(this,Bt,$S).call(this)?k(this,tt).cancel({revert:!0}):k(this,tt).cancelRetry()),this.scheduleGc()),k(this,nn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ue(this,Bt,Zn).call(this,{type:"invalidate"})}async fetch(t,n){var u,c,d,f,m,_,p,y,h,v,x;if(this.state.fetchStatus!=="idle"&&((u=k(this,tt))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(k(this,tt))return k(this,tt).continueRetry(),k(this,tt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const b=this.observers.find(E=>E.options.queryFn);b&&this.setOptions(b.options)}const r=new AbortController,i=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(H(this,Di,!0),r.signal)})},s=()=>{const b=TS(this.options,n),S=(()=>{const P={client:k(this,ji),queryKey:this.queryKey,meta:this.meta};return i(P),P})();return H(this,Di,!1),this.options.persister?this.options.persister(b,S,this):b(S)},a=(()=>{const b={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:k(this,ji),state:this.state,fetchFn:s};return i(b),b})(),l=k(this,ro)==="infinite"?UA(this.options.pages):this.options.behavior;l==null||l.onFetch(a,this),H(this,io,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=a.fetchOptions)==null?void 0:c.meta))&&ue(this,Bt,Zn).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta}),H(this,tt,MS({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,onCancel:b=>{b instanceof Wp&&b.revert&&this.setState({...k(this,io),fetchStatus:"idle"}),r.abort()},onFail:(b,E)=>{ue(this,Bt,Zn).call(this,{type:"failed",failureCount:b,error:E})},onPause:()=>{ue(this,Bt,Zn).call(this,{type:"pause"})},onContinue:()=>{ue(this,Bt,Zn).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const b=await k(this,tt).start();if(b===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(b),(m=(f=k(this,nn).config).onSuccess)==null||m.call(f,b,this),(p=(_=k(this,nn).config).onSettled)==null||p.call(_,b,this.state.error,this),b}catch(b){if(b instanceof Wp){if(b.silent)return k(this,tt).promise;if(b.revert){if(this.state.data===void 0)throw b;return this.state.data}}throw ue(this,Bt,Zn).call(this,{type:"error",error:b}),(h=(y=k(this,nn).config).onError)==null||h.call(y,b,this),(x=(v=k(this,nn).config).onSettled)==null||x.call(v,this.state.data,b,this),b}finally{this.scheduleGc()}}},ro=new WeakMap,Li=new WeakMap,io=new WeakMap,nn=new WeakMap,ji=new WeakMap,tt=new WeakMap,dl=new WeakMap,Di=new WeakMap,Bt=new WeakSet,$S=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Zn=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...FS(r.data,this.options),fetchMeta:t.meta??null};case"success":const i={...r,...i0(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return H(this,io,t.manual?i:void 0),i;case"error":const s=t.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),at.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),k(this,nn).notify({query:this,type:"updated",action:t})})},ew);function FS(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:OS(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function i0(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function s0(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Ot,fe,fl,xt,zi,so,sr,Vr,hl,oo,ao,Ui,Vi,Br,lo,me,ha,Gp,Kp,Qp,Yp,Xp,Jp,Zp,LS,tw,BA=(tw=class extends El{constructor(t,n){super();X(this,me);X(this,Ot);X(this,fe);X(this,fl);X(this,xt);X(this,zi);X(this,so);X(this,sr);X(this,Vr);X(this,hl);X(this,oo);X(this,ao);X(this,Ui);X(this,Vi);X(this,Br);X(this,lo,new Set);this.options=n,H(this,Ot,t),H(this,Vr,null),H(this,sr,qp()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(k(this,fe).addObserver(this),o0(k(this,fe),this.options)?ue(this,me,ha).call(this):this.updateResult(),ue(this,me,Yp).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ev(k(this,fe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ev(k(this,fe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ue(this,me,Xp).call(this),ue(this,me,Jp).call(this),k(this,fe).removeObserver(this)}setOptions(t){const n=this.options,r=k(this,fe);if(this.options=k(this,Ot).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Wt(this.options.enabled,k(this,fe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ue(this,me,Zp).call(this),k(this,fe).setOptions(this.options),n._defaulted&&!Up(this.options,n)&&k(this,Ot).getQueryCache().notify({type:"observerOptionsUpdated",query:k(this,fe),observer:this});const i=this.hasListeners();i&&a0(k(this,fe),r,this.options,n)&&ue(this,me,ha).call(this),this.updateResult(),i&&(k(this,fe)!==r||Wt(this.options.enabled,k(this,fe))!==Wt(n.enabled,k(this,fe))||si(this.options.staleTime,k(this,fe))!==si(n.staleTime,k(this,fe)))&&ue(this,me,Gp).call(this);const s=ue(this,me,Kp).call(this);i&&(k(this,fe)!==r||Wt(this.options.enabled,k(this,fe))!==Wt(n.enabled,k(this,fe))||s!==k(this,Br))&&ue(this,me,Qp).call(this,s)}getOptimisticResult(t){const n=k(this,Ot).getQueryCache().build(k(this,Ot),t),r=this.createResult(n,t);return WA(this,r)&&(H(this,xt,r),H(this,so,this.options),H(this,zi,k(this,fe).state)),r}getCurrentResult(){return k(this,xt)}trackResult(t,n){return new Proxy(t,{get:(r,i)=>(this.trackProp(i),n==null||n(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&k(this,sr).status==="pending"&&k(this,sr).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(t){k(this,lo).add(t)}getCurrentQuery(){return k(this,fe)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=k(this,Ot).defaultQueryOptions(t),r=k(this,Ot).getQueryCache().build(k(this,Ot),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ue(this,me,ha).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),k(this,xt)))}createResult(t,n){var T;const r=k(this,fe),i=this.options,s=k(this,xt),o=k(this,zi),a=k(this,so),u=t!==r?t.state:k(this,fl),{state:c}=t;let d={...c},f=!1,m;if(n._optimisticResults){const R=this.hasListeners(),N=!R&&o0(t,n),M=R&&a0(t,r,n,i);(N||M)&&(d={...d,...FS(c.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:_,errorUpdatedAt:p,status:y}=d;m=d.data;let h=!1;if(n.placeholderData!==void 0&&m===void 0&&y==="pending"){let R;s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(R=s.data,h=!0):R=typeof n.placeholderData=="function"?n.placeholderData((T=k(this,ao))==null?void 0:T.state.data,k(this,ao)):n.placeholderData,R!==void 0&&(y="success",m=Bp(s==null?void 0:s.data,R,n),f=!0)}if(n.select&&m!==void 0&&!h)if(s&&m===(o==null?void 0:o.data)&&n.select===k(this,hl))m=k(this,oo);else try{H(this,hl,n.select),m=n.select(m),m=Bp(s==null?void 0:s.data,m,n),H(this,oo,m),H(this,Vr,null)}catch(R){H(this,Vr,R)}k(this,Vr)&&(_=k(this,Vr),m=k(this,oo),p=Date.now(),y="error");const v=d.fetchStatus==="fetching",x=y==="pending",b=y==="error",E=x&&v,S=m!==void 0,C={status:y,fetchStatus:d.fetchStatus,isPending:x,isSuccess:y==="success",isError:b,isInitialLoading:E,isLoading:E,data:m,dataUpdatedAt:d.dataUpdatedAt,error:_,errorUpdatedAt:p,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:v,isRefetching:v&&!x,isLoadingError:b&&!S,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:b&&S,isStale:Fg(t,n),refetch:this.refetch,promise:k(this,sr),isEnabled:Wt(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const R=C.data!==void 0,N=C.status==="error"&&!R,M=W=>{N?W.reject(C.error):R&&W.resolve(C.data)},z=()=>{const W=H(this,sr,C.promise=qp());M(W)},F=k(this,sr);switch(F.status){case"pending":t.queryHash===r.queryHash&&M(F);break;case"fulfilled":(N||C.data!==F.value)&&z();break;case"rejected":(!N||C.error!==F.reason)&&z();break}}return C}updateResult(){const t=k(this,xt),n=this.createResult(k(this,fe),this.options);if(H(this,zi,k(this,fe).state),H(this,so,this.options),k(this,zi).data!==void 0&&H(this,ao,k(this,fe)),Up(n,t))return;H(this,xt,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!k(this,lo).size)return!0;const o=new Set(s??k(this,lo));return this.options.throwOnError&&o.add("error"),Object.keys(k(this,xt)).some(a=>{const l=a;return k(this,xt)[l]!==t[l]&&o.has(l)})};ue(this,me,LS).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ue(this,me,Yp).call(this)}},Ot=new WeakMap,fe=new WeakMap,fl=new WeakMap,xt=new WeakMap,zi=new WeakMap,so=new WeakMap,sr=new WeakMap,Vr=new WeakMap,hl=new WeakMap,oo=new WeakMap,ao=new WeakMap,Ui=new WeakMap,Vi=new WeakMap,Br=new WeakMap,lo=new WeakMap,me=new WeakSet,ha=function(t){ue(this,me,Zp).call(this);let n=k(this,fe).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(At)),n},Gp=function(){ue(this,me,Xp).call(this);const t=si(this.options.staleTime,k(this,fe));if(ol.isServer()||k(this,xt).isStale||!zp(t))return;const r=PS(k(this,xt).dataUpdatedAt,t)+1;H(this,Ui,Ni.setTimeout(()=>{k(this,xt).isStale||this.updateResult()},r))},Kp=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(k(this,fe)):this.options.refetchInterval)??!1},Qp=function(t){ue(this,me,Jp).call(this),H(this,Br,t),!(ol.isServer()||Wt(this.options.enabled,k(this,fe))===!1||!zp(k(this,Br))||k(this,Br)===0)&&H(this,Vi,Ni.setInterval(()=>{(this.options.refetchIntervalInBackground||Ag.isFocused())&&ue(this,me,ha).call(this)},k(this,Br)))},Yp=function(){ue(this,me,Gp).call(this),ue(this,me,Qp).call(this,ue(this,me,Kp).call(this))},Xp=function(){k(this,Ui)!==void 0&&(Ni.clearTimeout(k(this,Ui)),H(this,Ui,void 0))},Jp=function(){k(this,Vi)!==void 0&&(Ni.clearInterval(k(this,Vi)),H(this,Vi,void 0))},Zp=function(){const t=k(this,Ot).getQueryCache().build(k(this,Ot),this.options);if(t===k(this,fe))return;const n=k(this,fe);H(this,fe,t),H(this,fl,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},LS=function(t){at.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(k(this,xt))}),k(this,Ot).getQueryCache().notify({query:k(this,fe),type:"observerResultsUpdated"})})},tw);function qA(e,t){return Wt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Wt(t.retryOnMount,e)===!1)}function o0(e,t){return qA(e,t)||e.state.data!==void 0&&ev(e,t,t.refetchOnMount)}function ev(e,t,n){if(Wt(t.enabled,e)!==!1&&si(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Fg(e,t)}return!1}function a0(e,t,n,r){return(e!==t||Wt(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Fg(e,n)}function Fg(e,t){return Wt(t.enabled,e)!==!1&&e.isStaleByTime(si(t.staleTime,e))}function WA(e,t){return!Up(e.getCurrentResult(),t)}var pl,Fn,pt,Bi,Ln,Ar,nw,HA=(nw=class extends AS{constructor(t){super();X(this,Ln);X(this,pl);X(this,Fn);X(this,pt);X(this,Bi);H(this,pl,t.client),this.mutationId=t.mutationId,H(this,pt,t.mutationCache),H(this,Fn,[]),this.state=t.state||GA(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){k(this,Fn).includes(t)||(k(this,Fn).push(t),this.clearGcTimeout(),k(this,pt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){H(this,Fn,k(this,Fn).filter(n=>n!==t)),this.scheduleGc(),k(this,pt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){k(this,Fn).length||(this.state.status==="pending"?this.scheduleGc():k(this,pt).remove(this))}continue(){var t;return((t=k(this,Bi))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,a,l,u,c,d,f,m,_,p,y,h,v,x,b,E,S,P;const n=()=>{ue(this,Ln,Ar).call(this,{type:"continue"})},r={client:k(this,pl),meta:this.options.meta,mutationKey:this.options.mutationKey};H(this,Bi,MS({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(C,T)=>{ue(this,Ln,Ar).call(this,{type:"failed",failureCount:C,error:T})},onPause:()=>{ue(this,Ln,Ar).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>k(this,pt).canRun(this)}));const i=this.state.status==="pending",s=!k(this,Bi).canStart();try{if(i)n();else{ue(this,Ln,Ar).call(this,{type:"pending",variables:t,isPaused:s}),k(this,pt).config.onMutate&&await k(this,pt).config.onMutate(t,this,r);const T=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,t,r));T!==this.state.context&&ue(this,Ln,Ar).call(this,{type:"pending",context:T,variables:t,isPaused:s})}const C=await k(this,Bi).start();return await((u=(l=k(this,pt).config).onSuccess)==null?void 0:u.call(l,C,t,this.state.context,this,r)),await((d=(c=this.options).onSuccess)==null?void 0:d.call(c,C,t,this.state.context,r)),await((m=(f=k(this,pt).config).onSettled)==null?void 0:m.call(f,C,null,this.state.variables,this.state.context,this,r)),await((p=(_=this.options).onSettled)==null?void 0:p.call(_,C,null,t,this.state.context,r)),ue(this,Ln,Ar).call(this,{type:"success",data:C}),C}catch(C){try{await((h=(y=k(this,pt).config).onError)==null?void 0:h.call(y,C,t,this.state.context,this,r))}catch(T){Promise.reject(T)}try{await((x=(v=this.options).onError)==null?void 0:x.call(v,C,t,this.state.context,r))}catch(T){Promise.reject(T)}try{await((E=(b=k(this,pt).config).onSettled)==null?void 0:E.call(b,void 0,C,this.state.variables,this.state.context,this,r))}catch(T){Promise.reject(T)}try{await((P=(S=this.options).onSettled)==null?void 0:P.call(S,void 0,C,t,this.state.context,r))}catch(T){Promise.reject(T)}throw ue(this,Ln,Ar).call(this,{type:"error",error:C}),C}finally{k(this,pt).runNext(this)}}},pl=new WeakMap,Fn=new WeakMap,pt=new WeakMap,Bi=new WeakMap,Ln=new WeakSet,Ar=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),at.batch(()=>{k(this,Fn).forEach(r=>{r.onMutationUpdate(t)}),k(this,pt).notify({mutation:this,type:"updated",action:t})})},nw);function GA(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var or,_n,vl,rw,KA=(rw=class extends El{constructor(t={}){super();X(this,or);X(this,_n);X(this,vl);this.config=t,H(this,or,new Set),H(this,_n,new Map),H(this,vl,0)}build(t,n,r){const i=new HA({client:t,mutationCache:this,mutationId:++Tl(this,vl)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){k(this,or).add(t);const n=su(t);if(typeof n=="string"){const r=k(this,_n).get(n);r?r.push(t):k(this,_n).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(k(this,or).delete(t)){const n=su(t);if(typeof n=="string"){const r=k(this,_n).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&k(this,_n).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=su(t);if(typeof n=="string"){const r=k(this,_n).get(n),i=r==null?void 0:r.find(s=>s.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=su(t);if(typeof n=="string"){const i=(r=k(this,_n).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){at.batch(()=>{k(this,or).forEach(t=>{this.notify({type:"removed",mutation:t})}),k(this,or).clear(),k(this,_n).clear()})}getAll(){return Array.from(k(this,or))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>t0(n,r))}findAll(t={}){return this.getAll().filter(n=>t0(t,n))}notify(t){at.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return at.batch(()=>Promise.all(t.map(n=>n.continue().catch(At))))}},or=new WeakMap,_n=new WeakMap,vl=new WeakMap,rw);function su(e){var t;return(t=e.options.scope)==null?void 0:t.id}var jn,iw,QA=(iw=class extends El{constructor(t={}){super();X(this,jn);this.config=t,H(this,jn,new Map)}build(t,n,r){const i=n.queryKey,s=n.queryHash??Ng(i,n);let o=this.get(s);return o||(o=new VA({client:t,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){k(this,jn).has(t.queryHash)||(k(this,jn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=k(this,jn).get(t.queryHash);n&&(t.destroy(),n===t&&k(this,jn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){at.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return k(this,jn).get(t)}getAll(){return[...k(this,jn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>e0(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>e0(t,r)):n}notify(t){at.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){at.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){at.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},jn=new WeakMap,iw),qe,qr,Wr,uo,co,Hr,fo,ho,sw,YA=(sw=class{constructor(e={}){X(this,qe);X(this,qr);X(this,Wr);X(this,uo);X(this,co);X(this,Hr);X(this,fo);X(this,ho);H(this,qe,e.queryCache||new QA),H(this,qr,e.mutationCache||new KA),H(this,Wr,e.defaultOptions||{}),H(this,uo,new Map),H(this,co,new Map),H(this,Hr,0)}mount(){Tl(this,Hr)._++,k(this,Hr)===1&&(H(this,fo,Ag.subscribe(async e=>{e&&(await this.resumePausedMutations(),k(this,qe).onFocus())})),H(this,ho,jc.subscribe(async e=>{e&&(await this.resumePausedMutations(),k(this,qe).onOnline())})))}unmount(){var e,t;Tl(this,Hr)._--,k(this,Hr)===0&&((e=k(this,fo))==null||e.call(this),H(this,fo,void 0),(t=k(this,ho))==null||t.call(this),H(this,ho,void 0))}isFetching(e){return k(this,qe).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return k(this,qr).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=k(this,qe).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=k(this,qe).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(si(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return k(this,qe).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=k(this,qe).get(r.queryHash),s=i==null?void 0:i.state.data,o=OA(t,s);if(o!==void 0)return k(this,qe).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return at.batch(()=>k(this,qe).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=k(this,qe).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=k(this,qe);at.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=k(this,qe);return at.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=at.batch(()=>k(this,qe).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(At).catch(At)}invalidateQueries(e,t={}){return at.batch(()=>(k(this,qe).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=at.batch(()=>k(this,qe).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(At)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(At)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=k(this,qe).build(this,t);return n.isStaleByTime(si(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(At).catch(At)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(At).catch(At)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return jc.isOnline()?k(this,qr).resumePausedMutations():Promise.resolve()}getQueryCache(){return k(this,qe)}getMutationCache(){return k(this,qr)}getDefaultOptions(){return k(this,Wr)}setDefaultOptions(e){H(this,Wr,e)}setQueryDefaults(e,t){k(this,uo).set(il(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...k(this,uo).values()],n={};return t.forEach(r=>{sl(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){k(this,co).set(il(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...k(this,co).values()],n={};return t.forEach(r=>{sl(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...k(this,Wr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ng(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===$g&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...k(this,Wr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){k(this,qe).clear(),k(this,qr).clear()}},qe=new WeakMap,qr=new WeakMap,Wr=new WeakMap,uo=new WeakMap,co=new WeakMap,Hr=new WeakMap,fo=new WeakMap,ho=new WeakMap,sw),jS=g.createContext(void 0),DS=e=>{const t=g.useContext(jS);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},XA=({client:e,children:t})=>(g.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),w.jsx(jS.Provider,{value:e,children:t})),zS=g.createContext(!1),JA=()=>g.useContext(zS);zS.Provider;function ZA(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var eN=g.createContext(ZA()),tN=()=>g.useContext(eN),nN=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?IS(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},rN=e=>{g.useEffect(()=>{e.clearReset()},[e])},iN=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||IS(n,[e.error,r])),sN=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},oN=(e,t)=>e.isLoading&&e.isFetching&&!t,aN=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,l0=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function lN(e,t,n){var f,m,_,p;const r=JA(),i=tN(),s=DS(),o=s.defaultQueryOptions(e);(m=(f=s.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||m.call(f,o);const a=s.getQueryCache().get(o.queryHash);o._optimisticResults=r?"isRestoring":"optimistic",sN(o),nN(o,i,a),rN(i);const l=!s.getQueryCache().get(o.queryHash),[u]=g.useState(()=>new t(s,o)),c=u.getOptimisticResult(o),d=!r&&e.subscribed!==!1;if(g.useSyncExternalStore(g.useCallback(y=>{const h=d?u.subscribe(at.batchCalls(y)):At;return u.updateResult(),h},[u,d]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),g.useEffect(()=>{u.setOptions(o)},[o,u]),aN(o,c))throw l0(o,u,i);if(iN({result:c,errorResetBoundary:i,throwOnError:o.throwOnError,query:a,suspense:o.suspense}))throw c.error;if((p=(_=s.getDefaultOptions().queries)==null?void 0:_._experimental_afterQuery)==null||p.call(_,o,c),o.experimental_prefetchInRender&&!ol.isServer()&&oN(c,r)){const y=l?l0(o,u,i):a==null?void 0:a.promise;y==null||y.catch(At).finally(()=>{u.updateResult()})}return o.notifyOnChangeProps?c:u.trackResult(c)}function uN(e,t){return lN(e,BA)}function ee(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function u0(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function vi(...e){return t=>{let n=!1;const r=e.map(i=>{const s=u0(i,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i{const{children:o,...a}=s,l=g.useMemo(()=>a,Object.values(a));return w.jsx(n.Provider,{value:l,children:o})};r.displayName=e+"Provider";function i(s){const o=g.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,i]}function os(e,t=[]){let n=[];function r(s,o){const a=g.createContext(o),l=n.length;n=[...n,o];const u=d=>{var h;const{scope:f,children:m,..._}=d,p=((h=f==null?void 0:f[e])==null?void 0:h[l])||a,y=g.useMemo(()=>_,Object.values(_));return w.jsx(p.Provider,{value:y,children:m})};u.displayName=s+"Provider";function c(d,f){var p;const m=((p=f==null?void 0:f[e])==null?void 0:p[l])||a,_=g.useContext(m);if(_)return _;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[u,c]}const i=()=>{const s=n.map(o=>g.createContext(o));return function(a){const l=(a==null?void 0:a[e])||s;return g.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,dN(i,...t)]}function dN(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:l,scopeName:u})=>{const d=l(s)[`__scope${u}`];return{...a,...d}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var fn=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},fN=Kc[" useId ".trim().toString()]||(()=>{}),hN=0;function Ys(e){const[t,n]=g.useState(fN());return fn(()=>{n(r=>r??String(hN++))},[e]),t?`radix-${t}`:""}var pN=Kc[" useInsertionEffect ".trim().toString()]||fn;function yd({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,s,o]=vN({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:i;{const c=g.useRef(e!==void 0);g.useEffect(()=>{const d=c.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),c.current=a},[a,r])}const u=g.useCallback(c=>{var d;if(a){const f=gN(c)?c(e):c;f!==e&&((d=o.current)==null||d.call(o,f))}else s(c)},[a,e,s,o]);return[l,u]}function vN({defaultProp:e,onChange:t}){const[n,r]=g.useState(e),i=g.useRef(n),s=g.useRef(t);return pN(()=>{s.current=t},[t]),g.useEffect(()=>{var o;i.current!==n&&((o=s.current)==null||o.call(s,n),i.current=n)},[n,i]),[n,r,s]}function gN(e){return typeof e=="function"}function mN(e){const t=yN(e),n=g.forwardRef((r,i)=>{const{children:s,...o}=r,a=g.Children.toArray(s),l=a.find(wN);if(l){const u=l.props.children,c=a.map(d=>d===l?g.Children.count(u)>1?g.Children.only(null):g.isValidElement(u)?u.props.children:null:d);return w.jsx(t,{...o,ref:i,children:g.isValidElement(u)?g.cloneElement(u,void 0,c):null})}return w.jsx(t,{...o,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}function yN(e){const t=g.forwardRef((n,r)=>{const{children:i,...s}=n;if(g.isValidElement(i)){const o=bN(i),a=xN(s,i.props);return i.type!==g.Fragment&&(a.ref=r?vi(r,o):o),g.cloneElement(i,a)}return g.Children.count(i)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var _N=Symbol("radix.slottable");function wN(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===_N}function xN(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const l=s(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function bN(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var EN=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ke=EN.reduce((e,t)=>{const n=mN(`Primitive.${t}`),r=g.forwardRef((i,s)=>{const{asChild:o,...a}=i,l=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(l,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Lg(e,t){e&&xl.flushSync(()=>e.dispatchEvent(t))}function Ut(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function SN(e,t=globalThis==null?void 0:globalThis.document){const n=Ut(e);g.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var CN="DismissableLayer",tv="dismissableLayer.update",kN="dismissableLayer.pointerDownOutside",PN="dismissableLayer.focusOutside",c0,US=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),_d=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:a,...l}=e,u=g.useContext(US),[c,d]=g.useState(null),f=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=g.useState({}),_=et(t,P=>d(P)),p=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),h=p.indexOf(y),v=c?p.indexOf(c):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,b=v>=h,E=TN(P=>{const C=P.target,T=[...u.branches].some(R=>R.contains(C));!b||T||(i==null||i(P),o==null||o(P),P.defaultPrevented||a==null||a())},f),S=IN(P=>{const C=P.target;[...u.branches].some(R=>R.contains(C))||(s==null||s(P),o==null||o(P),P.defaultPrevented||a==null||a())},f);return SN(P=>{v===u.layers.size-1&&(r==null||r(P),!P.defaultPrevented&&a&&(P.preventDefault(),a()))},f),g.useEffect(()=>{if(c)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(c0=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),d0(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=c0)}},[c,f,n,u]),g.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),d0())},[c,u]),g.useEffect(()=>{const P=()=>m({});return document.addEventListener(tv,P),()=>document.removeEventListener(tv,P)},[]),w.jsx(ke.div,{...l,ref:_,style:{pointerEvents:x?b?"auto":"none":void 0,...e.style},onFocusCapture:ee(e.onFocusCapture,S.onFocusCapture),onBlurCapture:ee(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:ee(e.onPointerDownCapture,E.onPointerDownCapture)})});_d.displayName=CN;var RN="DismissableLayerBranch",VS=g.forwardRef((e,t)=>{const n=g.useContext(US),r=g.useRef(null),i=et(t,r);return g.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),w.jsx(ke.div,{...e,ref:i})});VS.displayName=RN;function TN(e,t=globalThis==null?void 0:globalThis.document){const n=Ut(e),r=g.useRef(!1),i=g.useRef(()=>{});return g.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let l=function(){BS(kN,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}else t.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",s),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function IN(e,t=globalThis==null?void 0:globalThis.document){const n=Ut(e),r=g.useRef(!1);return g.useEffect(()=>{const i=s=>{s.target&&!r.current&&BS(PN,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function d0(){const e=new CustomEvent(tv);document.dispatchEvent(e)}function BS(e,t,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Lg(i,s):i.dispatchEvent(s)}var ON=_d,MN=VS,Vf="focusScope.autoFocusOnMount",Bf="focusScope.autoFocusOnUnmount",f0={bubbles:!1,cancelable:!0},AN="FocusScope",jg=g.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=e,[a,l]=g.useState(null),u=Ut(i),c=Ut(s),d=g.useRef(null),f=et(t,p=>l(p)),m=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(r){let p=function(x){if(m.paused||!a)return;const b=x.target;a.contains(b)?d.current=b:Nr(d.current,{select:!0})},y=function(x){if(m.paused||!a)return;const b=x.relatedTarget;b!==null&&(a.contains(b)||Nr(d.current,{select:!0}))},h=function(x){if(document.activeElement===document.body)for(const E of x)E.removedNodes.length>0&&Nr(a)};document.addEventListener("focusin",p),document.addEventListener("focusout",y);const v=new MutationObserver(h);return a&&v.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",y),v.disconnect()}}},[r,a,m.paused]),g.useEffect(()=>{if(a){p0.add(m);const p=document.activeElement;if(!a.contains(p)){const h=new CustomEvent(Vf,f0);a.addEventListener(Vf,u),a.dispatchEvent(h),h.defaultPrevented||(NN(DN(qS(a)),{select:!0}),document.activeElement===p&&Nr(a))}return()=>{a.removeEventListener(Vf,u),setTimeout(()=>{const h=new CustomEvent(Bf,f0);a.addEventListener(Bf,c),a.dispatchEvent(h),h.defaultPrevented||Nr(p??document.body,{select:!0}),a.removeEventListener(Bf,c),p0.remove(m)},0)}}},[a,u,c,m]);const _=g.useCallback(p=>{if(!n&&!r||m.paused)return;const y=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,h=document.activeElement;if(y&&h){const v=p.currentTarget,[x,b]=$N(v);x&&b?!p.shiftKey&&h===b?(p.preventDefault(),n&&Nr(x,{select:!0})):p.shiftKey&&h===x&&(p.preventDefault(),n&&Nr(b,{select:!0})):h===v&&p.preventDefault()}},[n,r,m.paused]);return w.jsx(ke.div,{tabIndex:-1,...o,ref:f,onKeyDown:_})});jg.displayName=AN;function NN(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Nr(r,{select:t}),document.activeElement!==n)return}function $N(e){const t=qS(e),n=h0(t,e),r=h0(t.reverse(),e);return[n,r]}function qS(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 h0(e,t){for(const n of e)if(!FN(n,{upTo:t}))return n}function FN(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function LN(e){return e instanceof HTMLInputElement&&"select"in e}function Nr(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&LN(e)&&t&&e.select()}}var p0=jN();function jN(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=v0(e,t),e.unshift(t)},remove(t){var n;e=v0(e,t),(n=e[0])==null||n.resume()}}}function v0(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function DN(e){return e.filter(t=>t.tagName!=="A")}var zN="Portal",wd=g.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[i,s]=g.useState(!1);fn(()=>s(!0),[]);const o=n||i&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?pT.createPortal(w.jsx(ke.div,{...r,ref:t}),o):null});wd.displayName=zN;function UN(e,t){return g.useReducer((n,r)=>t[n][r]??n,e)}var br=e=>{const{present:t,children:n}=e,r=VN(t),i=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),s=et(r.ref,BN(i));return typeof n=="function"||r.isPresent?g.cloneElement(i,{ref:s}):null};br.displayName="Presence";function VN(e){const[t,n]=g.useState(),r=g.useRef(null),i=g.useRef(e),s=g.useRef("none"),o=e?"mounted":"unmounted",[a,l]=UN(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const u=ou(r.current);s.current=a==="mounted"?u:"none"},[a]),fn(()=>{const u=r.current,c=i.current;if(c!==e){const f=s.current,m=ou(u);e?l("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(c&&f!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),fn(()=>{if(t){let u;const c=t.ownerDocument.defaultView??window,d=m=>{const p=ou(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&p&&(l("ANIMATION_END"),!i.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",u=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},f=m=>{m.target===t&&(s.current=ou(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{c.clearTimeout(u),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:g.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function ou(e){return(e==null?void 0:e.animationName)||"none"}function BN(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var qf=0;function WS(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??g0()),document.body.insertAdjacentElement("beforeend",e[1]??g0()),qf++,()=>{qf===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),qf--}},[])}function g0(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Un=function(){return Un=Object.assign||function(t){for(var n,r=1,i=arguments.length;r"u")return o$;var t=a$(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},u$=QS(),Xs="data-scroll-locked",c$=function(e,t,n,r){var i=e.left,s=e.top,o=e.right,a=e.gap;return n===void 0&&(n="margin"),` + .`.concat(WN,` { overflow: hidden `).concat(r,`; padding-right: `).concat(a,"px ").concat(r,`; } - body[`).concat(Ys,`] { + body[`).concat(Xs,`] { overflow: hidden `).concat(r,`; overscroll-behavior: contain; `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` @@ -101,17 +101,17 @@ Error generating stack: `+s.message+` margin-right: 0 `).concat(r,`; } - body[`).concat(Ys,`] { - `).concat(GN,": ").concat(a,`px; + body[`).concat(Xs,`] { + `).concat(HN,": ").concat(a,`px; } -`)},y0=function(){var e=parseInt(document.body.getAttribute(Ys)||"0",10);return isFinite(e)?e:0},f$=function(){g.useEffect(function(){return document.body.setAttribute(Ys,(y0()+1).toString()),function(){var e=y0()-1;e<=0?document.body.removeAttribute(Ys):document.body.setAttribute(Ys,e.toString())}},[])},h$=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;f$();var s=g.useMemo(function(){return u$(i)},[i]);return g.createElement(c$,{styles:d$(s,!t,i,n?"":"!important")})},nv=!1;if(typeof window<"u")try{var au=Object.defineProperty({},"passive",{get:function(){return nv=!0,!0}});window.addEventListener("test",au,au),window.removeEventListener("test",au,au)}catch{nv=!1}var ys=nv?{passive:!1}:!1,p$=function(e){return e.tagName==="TEXTAREA"},XS=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!p$(e)&&n[t]==="visible")},v$=function(e){return XS(e,"overflowY")},g$=function(e){return XS(e,"overflowX")},_0=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=JS(e,r);if(i){var s=ZS(e,r),o=s[1],a=s[2];if(o>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},m$=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},y$=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},JS=function(e,t){return e==="v"?v$(t):g$(t)},ZS=function(e,t){return e==="v"?m$(t):y$(t)},_$=function(e,t){return e==="h"&&t==="rtl"?-1:1},w$=function(e,t,n,r,i){var s=_$(e,window.getComputedStyle(t).direction),o=s*r,a=n.target,l=t.contains(a),u=!1,c=o>0,d=0,f=0;do{if(!a)break;var m=ZS(e,a),_=m[0],p=m[1],y=m[2],h=p-y-s*_;(_||h)&&JS(e,a)&&(d+=h,f+=_);var v=a.parentNode;a=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(c&&Math.abs(d)<1||!c&&Math.abs(f)<1)&&(u=!0),u},lu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},w0=function(e){return[e.deltaX,e.deltaY]},x0=function(e){return e&&"current"in e?e.current:e},x$=function(e,t){return e[0]===t[0]&&e[1]===t[1]},b$=function(e){return` +`)},y0=function(){var e=parseInt(document.body.getAttribute(Xs)||"0",10);return isFinite(e)?e:0},d$=function(){g.useEffect(function(){return document.body.setAttribute(Xs,(y0()+1).toString()),function(){var e=y0()-1;e<=0?document.body.removeAttribute(Xs):document.body.setAttribute(Xs,e.toString())}},[])},f$=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;d$();var s=g.useMemo(function(){return l$(i)},[i]);return g.createElement(u$,{styles:c$(s,!t,i,n?"":"!important")})},nv=!1;if(typeof window<"u")try{var au=Object.defineProperty({},"passive",{get:function(){return nv=!0,!0}});window.addEventListener("test",au,au),window.removeEventListener("test",au,au)}catch{nv=!1}var _s=nv?{passive:!1}:!1,h$=function(e){return e.tagName==="TEXTAREA"},YS=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!h$(e)&&n[t]==="visible")},p$=function(e){return YS(e,"overflowY")},v$=function(e){return YS(e,"overflowX")},_0=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=XS(e,r);if(i){var s=JS(e,r),o=s[1],a=s[2];if(o>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},g$=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},m$=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},XS=function(e,t){return e==="v"?p$(t):v$(t)},JS=function(e,t){return e==="v"?g$(t):m$(t)},y$=function(e,t){return e==="h"&&t==="rtl"?-1:1},_$=function(e,t,n,r,i){var s=y$(e,window.getComputedStyle(t).direction),o=s*r,a=n.target,l=t.contains(a),u=!1,c=o>0,d=0,f=0;do{if(!a)break;var m=JS(e,a),_=m[0],p=m[1],y=m[2],h=p-y-s*_;(_||h)&&XS(e,a)&&(d+=h,f+=_);var v=a.parentNode;a=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(c&&Math.abs(d)<1||!c&&Math.abs(f)<1)&&(u=!0),u},lu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},w0=function(e){return[e.deltaX,e.deltaY]},x0=function(e){return e&&"current"in e?e.current:e},w$=function(e,t){return e[0]===t[0]&&e[1]===t[1]},x$=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},E$=0,_s=[];function S$(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),i=g.useState(E$++)[0],s=g.useState(YS)[0],o=g.useRef(e);g.useEffect(function(){o.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var p=WN([e.lockRef.current],(e.shards||[]).map(x0),!0).filter(Boolean);return p.forEach(function(y){return y.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),p.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=g.useCallback(function(p,y){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!o.current.allowPinchZoom;var h=lu(p),v=n.current,x="deltaX"in p?p.deltaX:v[0]-h[0],b="deltaY"in p?p.deltaY:v[1]-h[1],E,S=p.target,P=Math.abs(x)>Math.abs(b)?"h":"v";if("touches"in p&&P==="h"&&S.type==="range")return!1;var C=window.getSelection(),T=C&&C.anchorNode,R=T?T===S||T.contains(S):!1;if(R)return!1;var N=_0(P,S);if(!N)return!0;if(N?E=P:(E=P==="v"?"h":"v",N=_0(P,S)),!N)return!1;if(!r.current&&"changedTouches"in p&&(x||b)&&(r.current=E),!E)return!0;var M=r.current||E;return w$(M,y,p,M==="h"?x:b)},[]),l=g.useCallback(function(p){var y=p;if(!(!_s.length||_s[_s.length-1]!==s)){var h="deltaY"in y?w0(y):lu(y),v=t.current.filter(function(E){return E.name===y.type&&(E.target===y.target||y.target===E.shadowParent)&&x$(E.delta,h)})[0];if(v&&v.should){y.cancelable&&y.preventDefault();return}if(!v){var x=(o.current.shards||[]).map(x0).filter(Boolean).filter(function(E){return E.contains(y.target)}),b=x.length>0?a(y,x[0]):!o.current.noIsolation;b&&y.cancelable&&y.preventDefault()}}},[]),u=g.useCallback(function(p,y,h,v){var x={name:p,delta:y,target:h,should:v,shadowParent:C$(h)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(b){return b!==x})},1)},[]),c=g.useCallback(function(p){n.current=lu(p),r.current=void 0},[]),d=g.useCallback(function(p){u(p.type,w0(p),p.target,a(p,e.lockRef.current))},[]),f=g.useCallback(function(p){u(p.type,lu(p),p.target,a(p,e.lockRef.current))},[]);g.useEffect(function(){return _s.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,ys),document.addEventListener("touchmove",l,ys),document.addEventListener("touchstart",c,ys),function(){_s=_s.filter(function(p){return p!==s}),document.removeEventListener("wheel",l,ys),document.removeEventListener("touchmove",l,ys),document.removeEventListener("touchstart",c,ys)}},[]);var m=e.removeScrollBar,_=e.inert;return g.createElement(g.Fragment,null,_?g.createElement(s,{styles:b$(i)}):null,m?g.createElement(h$,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function C$(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const k$=e$(QS,S$);var Dg=g.forwardRef(function(e,t){return g.createElement(xd,Un({},e,{ref:t,sideCar:k$}))});Dg.classNames=xd.classNames;var P$=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ws=new WeakMap,uu=new WeakMap,cu={},Kf=0,e1=function(e){return e&&(e.host||e1(e.parentNode))},R$=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=e1(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},T$=function(e,t,n,r){var i=R$(t,Array.isArray(e)?e:[e]);cu[n]||(cu[n]=new WeakMap);var s=cu[n],o=[],a=new Set,l=new Set(i),u=function(d){!d||a.has(d)||(a.add(d),u(d.parentNode))};i.forEach(u);var c=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(a.has(f))c(f);else try{var m=f.getAttribute(r),_=m!==null&&m!=="false",p=(ws.get(f)||0)+1,y=(s.get(f)||0)+1;ws.set(f,p),s.set(f,y),o.push(f),p===1&&_&&uu.set(f,!0),y===1&&f.setAttribute(n,"true"),_||f.setAttribute(r,"true")}catch(h){console.error("aria-hidden: cannot operate on ",f,h)}})};return c(t),a.clear(),Kf++,function(){o.forEach(function(d){var f=ws.get(d)-1,m=s.get(d)-1;ws.set(d,f),s.set(d,m),f||(uu.has(d)||d.removeAttribute(r),uu.delete(d)),m||d.removeAttribute(n)}),Kf--,Kf||(ws=new WeakMap,ws=new WeakMap,uu=new WeakMap,cu={})}},t1=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=P$(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),T$(r,i,n,"aria-hidden")):function(){return null}};function I$(e){const t=O$(e),n=g.forwardRef((r,i)=>{const{children:s,...o}=r,a=g.Children.toArray(s),l=a.find(A$);if(l){const u=l.props.children,c=a.map(d=>d===l?g.Children.count(u)>1?g.Children.only(null):g.isValidElement(u)?u.props.children:null:d);return w.jsx(t,{...o,ref:i,children:g.isValidElement(u)?g.cloneElement(u,void 0,c):null})}return w.jsx(t,{...o,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}function O$(e){const t=g.forwardRef((n,r)=>{const{children:i,...s}=n;if(g.isValidElement(i)){const o=$$(i),a=N$(s,i.props);return i.type!==g.Fragment&&(a.ref=r?vi(r,o):o),g.cloneElement(i,a)}return g.Children.count(i)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var M$=Symbol("radix.slottable");function A$(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===M$}function N$(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const l=s(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function $$(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var bd="Dialog",[n1]=ss(bd),[F$,Tn]=n1(bd),r1=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!0}=e,a=g.useRef(null),l=g.useRef(null),[u,c]=yd({prop:r,defaultProp:i??!1,onChange:s,caller:bd});return w.jsx(F$,{scope:t,triggerRef:a,contentRef:l,contentId:Qs(),titleId:Qs(),descriptionId:Qs(),open:u,onOpenChange:c,onOpenToggle:g.useCallback(()=>c(d=>!d),[c]),modal:o,children:n})};r1.displayName=bd;var i1="DialogTrigger",s1=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Tn(i1,n),s=et(t,i.triggerRef);return w.jsx(ke.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Vg(i.open),...r,ref:s,onClick:ee(e.onClick,i.onOpenToggle)})});s1.displayName=i1;var zg="DialogPortal",[L$,o1]=n1(zg,{forceMount:void 0}),a1=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,s=Tn(zg,t);return w.jsx(L$,{scope:t,forceMount:n,children:g.Children.map(r,o=>w.jsx(br,{present:n||s.open,children:w.jsx(wd,{asChild:!0,container:i,children:o})}))})};a1.displayName=zg;var Dc="DialogOverlay",l1=g.forwardRef((e,t)=>{const n=o1(Dc,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=Tn(Dc,e.__scopeDialog);return s.modal?w.jsx(br,{present:r||s.open,children:w.jsx(D$,{...i,ref:t})}):null});l1.displayName=Dc;var j$=I$("DialogOverlay.RemoveScroll"),D$=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Tn(Dc,n);return w.jsx(Dg,{as:j$,allowPinchZoom:!0,shards:[i.contentRef],children:w.jsx(ke.div,{"data-state":Vg(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),es="DialogContent",u1=g.forwardRef((e,t)=>{const n=o1(es,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=Tn(es,e.__scopeDialog);return w.jsx(br,{present:r||s.open,children:s.modal?w.jsx(z$,{...i,ref:t}):w.jsx(U$,{...i,ref:t})})});u1.displayName=es;var z$=g.forwardRef((e,t)=>{const n=Tn(es,e.__scopeDialog),r=g.useRef(null),i=et(t,n.contentRef,r);return g.useEffect(()=>{const s=r.current;if(s)return t1(s)},[]),w.jsx(c1,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ee(e.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:ee(e.onPointerDownOutside,s=>{const o=s.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&s.preventDefault()}),onFocusOutside:ee(e.onFocusOutside,s=>s.preventDefault())})}),U$=g.forwardRef((e,t)=>{const n=Tn(es,e.__scopeDialog),r=g.useRef(!1),i=g.useRef(!1);return w.jsx(c1,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,a;(o=e.onCloseAutoFocus)==null||o.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),c1=g.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=e,a=Tn(es,n),l=g.useRef(null),u=et(t,l);return HS(),w.jsxs(w.Fragment,{children:[w.jsx(jg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:w.jsx(_d,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Vg(a.open),...o,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),w.jsxs(w.Fragment,{children:[w.jsx(V$,{titleId:a.titleId}),w.jsx(q$,{contentRef:l,descriptionId:a.descriptionId})]})]})}),Ug="DialogTitle",d1=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Tn(Ug,n);return w.jsx(ke.h2,{id:i.titleId,...r,ref:t})});d1.displayName=Ug;var f1="DialogDescription",h1=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Tn(f1,n);return w.jsx(ke.p,{id:i.descriptionId,...r,ref:t})});h1.displayName=f1;var p1="DialogClose",v1=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Tn(p1,n);return w.jsx(ke.button,{type:"button",...r,ref:t,onClick:ee(e.onClick,()=>i.onOpenChange(!1))})});v1.displayName=p1;function Vg(e){return e?"open":"closed"}var g1="DialogTitleWarning",[az,m1]=dN(g1,{contentName:es,titleName:Ug,docsSlug:"dialog"}),V$=({titleId:e})=>{const t=m1(g1),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. +`)},b$=0,ws=[];function E$(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),i=g.useState(b$++)[0],s=g.useState(QS)[0],o=g.useRef(e);g.useEffect(function(){o.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var p=qN([e.lockRef.current],(e.shards||[]).map(x0),!0).filter(Boolean);return p.forEach(function(y){return y.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),p.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=g.useCallback(function(p,y){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!o.current.allowPinchZoom;var h=lu(p),v=n.current,x="deltaX"in p?p.deltaX:v[0]-h[0],b="deltaY"in p?p.deltaY:v[1]-h[1],E,S=p.target,P=Math.abs(x)>Math.abs(b)?"h":"v";if("touches"in p&&P==="h"&&S.type==="range")return!1;var C=window.getSelection(),T=C&&C.anchorNode,R=T?T===S||T.contains(S):!1;if(R)return!1;var N=_0(P,S);if(!N)return!0;if(N?E=P:(E=P==="v"?"h":"v",N=_0(P,S)),!N)return!1;if(!r.current&&"changedTouches"in p&&(x||b)&&(r.current=E),!E)return!0;var M=r.current||E;return _$(M,y,p,M==="h"?x:b)},[]),l=g.useCallback(function(p){var y=p;if(!(!ws.length||ws[ws.length-1]!==s)){var h="deltaY"in y?w0(y):lu(y),v=t.current.filter(function(E){return E.name===y.type&&(E.target===y.target||y.target===E.shadowParent)&&w$(E.delta,h)})[0];if(v&&v.should){y.cancelable&&y.preventDefault();return}if(!v){var x=(o.current.shards||[]).map(x0).filter(Boolean).filter(function(E){return E.contains(y.target)}),b=x.length>0?a(y,x[0]):!o.current.noIsolation;b&&y.cancelable&&y.preventDefault()}}},[]),u=g.useCallback(function(p,y,h,v){var x={name:p,delta:y,target:h,should:v,shadowParent:S$(h)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(b){return b!==x})},1)},[]),c=g.useCallback(function(p){n.current=lu(p),r.current=void 0},[]),d=g.useCallback(function(p){u(p.type,w0(p),p.target,a(p,e.lockRef.current))},[]),f=g.useCallback(function(p){u(p.type,lu(p),p.target,a(p,e.lockRef.current))},[]);g.useEffect(function(){return ws.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,_s),document.addEventListener("touchmove",l,_s),document.addEventListener("touchstart",c,_s),function(){ws=ws.filter(function(p){return p!==s}),document.removeEventListener("wheel",l,_s),document.removeEventListener("touchmove",l,_s),document.removeEventListener("touchstart",c,_s)}},[]);var m=e.removeScrollBar,_=e.inert;return g.createElement(g.Fragment,null,_?g.createElement(s,{styles:x$(i)}):null,m?g.createElement(f$,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function S$(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const C$=ZN(KS,E$);var Dg=g.forwardRef(function(e,t){return g.createElement(xd,Un({},e,{ref:t,sideCar:C$}))});Dg.classNames=xd.classNames;var k$=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},xs=new WeakMap,uu=new WeakMap,cu={},Kf=0,ZS=function(e){return e&&(e.host||ZS(e.parentNode))},P$=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=ZS(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},R$=function(e,t,n,r){var i=P$(t,Array.isArray(e)?e:[e]);cu[n]||(cu[n]=new WeakMap);var s=cu[n],o=[],a=new Set,l=new Set(i),u=function(d){!d||a.has(d)||(a.add(d),u(d.parentNode))};i.forEach(u);var c=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(a.has(f))c(f);else try{var m=f.getAttribute(r),_=m!==null&&m!=="false",p=(xs.get(f)||0)+1,y=(s.get(f)||0)+1;xs.set(f,p),s.set(f,y),o.push(f),p===1&&_&&uu.set(f,!0),y===1&&f.setAttribute(n,"true"),_||f.setAttribute(r,"true")}catch(h){console.error("aria-hidden: cannot operate on ",f,h)}})};return c(t),a.clear(),Kf++,function(){o.forEach(function(d){var f=xs.get(d)-1,m=s.get(d)-1;xs.set(d,f),s.set(d,m),f||(uu.has(d)||d.removeAttribute(r),uu.delete(d)),m||d.removeAttribute(n)}),Kf--,Kf||(xs=new WeakMap,xs=new WeakMap,uu=new WeakMap,cu={})}},e1=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=k$(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),R$(r,i,n,"aria-hidden")):function(){return null}};function T$(e){const t=I$(e),n=g.forwardRef((r,i)=>{const{children:s,...o}=r,a=g.Children.toArray(s),l=a.find(M$);if(l){const u=l.props.children,c=a.map(d=>d===l?g.Children.count(u)>1?g.Children.only(null):g.isValidElement(u)?u.props.children:null:d);return w.jsx(t,{...o,ref:i,children:g.isValidElement(u)?g.cloneElement(u,void 0,c):null})}return w.jsx(t,{...o,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}function I$(e){const t=g.forwardRef((n,r)=>{const{children:i,...s}=n;if(g.isValidElement(i)){const o=N$(i),a=A$(s,i.props);return i.type!==g.Fragment&&(a.ref=r?vi(r,o):o),g.cloneElement(i,a)}return g.Children.count(i)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var O$=Symbol("radix.slottable");function M$(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===O$}function A$(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const l=s(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function N$(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var bd="Dialog",[t1]=os(bd),[$$,Tn]=t1(bd),n1=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!0}=e,a=g.useRef(null),l=g.useRef(null),[u,c]=yd({prop:r,defaultProp:i??!1,onChange:s,caller:bd});return w.jsx($$,{scope:t,triggerRef:a,contentRef:l,contentId:Ys(),titleId:Ys(),descriptionId:Ys(),open:u,onOpenChange:c,onOpenToggle:g.useCallback(()=>c(d=>!d),[c]),modal:o,children:n})};n1.displayName=bd;var r1="DialogTrigger",i1=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Tn(r1,n),s=et(t,i.triggerRef);return w.jsx(ke.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Vg(i.open),...r,ref:s,onClick:ee(e.onClick,i.onOpenToggle)})});i1.displayName=r1;var zg="DialogPortal",[F$,s1]=t1(zg,{forceMount:void 0}),o1=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,s=Tn(zg,t);return w.jsx(F$,{scope:t,forceMount:n,children:g.Children.map(r,o=>w.jsx(br,{present:n||s.open,children:w.jsx(wd,{asChild:!0,container:i,children:o})}))})};o1.displayName=zg;var Dc="DialogOverlay",a1=g.forwardRef((e,t)=>{const n=s1(Dc,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=Tn(Dc,e.__scopeDialog);return s.modal?w.jsx(br,{present:r||s.open,children:w.jsx(j$,{...i,ref:t})}):null});a1.displayName=Dc;var L$=T$("DialogOverlay.RemoveScroll"),j$=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Tn(Dc,n);return w.jsx(Dg,{as:L$,allowPinchZoom:!0,shards:[i.contentRef],children:w.jsx(ke.div,{"data-state":Vg(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ts="DialogContent",l1=g.forwardRef((e,t)=>{const n=s1(ts,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=Tn(ts,e.__scopeDialog);return w.jsx(br,{present:r||s.open,children:s.modal?w.jsx(D$,{...i,ref:t}):w.jsx(z$,{...i,ref:t})})});l1.displayName=ts;var D$=g.forwardRef((e,t)=>{const n=Tn(ts,e.__scopeDialog),r=g.useRef(null),i=et(t,n.contentRef,r);return g.useEffect(()=>{const s=r.current;if(s)return e1(s)},[]),w.jsx(u1,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ee(e.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:ee(e.onPointerDownOutside,s=>{const o=s.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&s.preventDefault()}),onFocusOutside:ee(e.onFocusOutside,s=>s.preventDefault())})}),z$=g.forwardRef((e,t)=>{const n=Tn(ts,e.__scopeDialog),r=g.useRef(!1),i=g.useRef(!1);return w.jsx(u1,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,a;(o=e.onCloseAutoFocus)==null||o.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),u1=g.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=e,a=Tn(ts,n),l=g.useRef(null),u=et(t,l);return WS(),w.jsxs(w.Fragment,{children:[w.jsx(jg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:w.jsx(_d,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Vg(a.open),...o,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),w.jsxs(w.Fragment,{children:[w.jsx(U$,{titleId:a.titleId}),w.jsx(B$,{contentRef:l,descriptionId:a.descriptionId})]})]})}),Ug="DialogTitle",c1=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Tn(Ug,n);return w.jsx(ke.h2,{id:i.titleId,...r,ref:t})});c1.displayName=Ug;var d1="DialogDescription",f1=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Tn(d1,n);return w.jsx(ke.p,{id:i.descriptionId,...r,ref:t})});f1.displayName=d1;var h1="DialogClose",p1=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Tn(h1,n);return w.jsx(ke.button,{type:"button",...r,ref:t,onClick:ee(e.onClick,()=>i.onOpenChange(!1))})});p1.displayName=h1;function Vg(e){return e?"open":"closed"}var v1="DialogTitleWarning",[az,g1]=cN(v1,{contentName:ts,titleName:Ug,docsSlug:"dialog"}),U$=({titleId:e})=>{const t=g1(v1),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. -For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return g.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},B$="DialogDescriptionWarning",q$=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${m1(B$).contentName}}.`;return g.useEffect(()=>{var s;const i=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},W$=r1,H$=s1,G$=a1,K$=l1,Q$=u1,Y$=d1,lz=h1,X$=v1;const b0=e=>e.endsWith("/")?e.slice(0,-1):e;function os(e){return["1","true","yes"].includes(String(e??"").trim().toLowerCase())}function Bg(){const e="https://paperswithcode.co".trim();if(!e)return"";try{const t=e.startsWith("http")?new URL(e):new URL(e,typeof window<"u"?window.location.origin:"http://localhost");return b0(t.origin)}catch{return b0(e)}}function J$(e){const t=e.startsWith("/")?e:`/${e}`,n=Bg();return n?`${n}${t}`:t}function qg(e){const t=e.startsWith("/")?e:`/${e}`;return J$(t)}function Z$(e,t={}){const n=qg("/api/v1/auth/hf/login"),i=new URL(n,window.location.origin).origin===window.location.origin?e:new URL(e,window.location.origin).toString(),s=new URLSearchParams({return_to:i});return t.authorizeInference&&s.set("authorize_inference","true"),t.collectEmail&&s.set("collect_email","true"),t.authorizeBucket&&s.set("authorize_bucket","true"),t.bucketCreate&&s.set("bucket_create","true"),`${n}?${s.toString()}`}function eF(){return qg("/admin-dashboard")}function uz(e){if(!e)return null;if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith("data:")||e.startsWith("blob:")||e.startsWith("//"))return e;if(e.startsWith("/")){const t=Bg();return t?`${t}${e}`:e}return e}function $o(){return os("1")}function al(){return os("0")}const tF="https://paperswithcode.co/chat";function nF(){return $o()&&!al()}function rF(){return os(void 0)}function cz(){return al()&&os(void 0)}function dz(){return os("0")}function fz(){return os("0")}function hz(){return typeof window<"u"&&window.location.hostname==="staging.paperswithcode.co"}function iF(){return os("1")}const sF="/hf-logo.svg?v=20260513b",E0=({size:e=14})=>w.jsx("img",{src:sF,alt:"",width:Math.round(e*95/88),height:e,"aria-hidden":"true",draggable:!1,style:{display:"block"}}),y1=({returnTo:e,compact:t=!1,label:n="Sign in",authorizeInference:r=!1,collectEmail:i=!1})=>{if($o())return null;const s=()=>{window.location.href=Z$(e,{authorizeInference:r,collectEmail:i})};return t?w.jsx("button",{type:"button",className:"icon-btn","aria-label":"Sign in with Hugging Face",title:"Sign in with Hugging Face",onClick:s,children:w.jsx(E0,{size:16})}):w.jsxs("button",{type:"button",className:"hf-signin-btn",onClick:s,"aria-label":"Sign in with Hugging Face",children:[w.jsx(E0,{size:18}),w.jsx("span",{children:n})]})};function oF(e,t=[]){let n=[];function r(s,o){const a=g.createContext(o);a.displayName=s+"Context";const l=n.length;n=[...n,o];const u=d=>{var h;const{scope:f,children:m,..._}=d,p=((h=f==null?void 0:f[e])==null?void 0:h[l])||a,y=g.useMemo(()=>_,Object.values(_));return w.jsx(p.Provider,{value:y,children:m})};u.displayName=s+"Provider";function c(d,f){var p;const m=((p=f==null?void 0:f[e])==null?void 0:p[l])||a,_=g.useContext(m);if(_)return _;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[u,c]}const i=()=>{const s=n.map(o=>g.createContext(o));return function(a){const l=(a==null?void 0:a[e])||s;return g.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,aF(i,...t)]}function aF(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:l,scopeName:u})=>{const d=l(s)[`__scope${u}`];return{...a,...d}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var lF=Symbol.for("react.lazy"),zc=Kc[" use ".trim().toString()];function uF(e){return typeof e=="object"&&e!==null&&"then"in e}function _1(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===lF&&"_payload"in e&&uF(e._payload)}function w1(e){const t=cF(e),n=g.forwardRef((r,i)=>{let{children:s,...o}=r;_1(s)&&typeof zc=="function"&&(s=zc(s._payload));const a=g.Children.toArray(s),l=a.find(fF);if(l){const u=l.props.children,c=a.map(d=>d===l?g.Children.count(u)>1?g.Children.only(null):g.isValidElement(u)?u.props.children:null:d);return w.jsx(t,{...o,ref:i,children:g.isValidElement(u)?g.cloneElement(u,void 0,c):null})}return w.jsx(t,{...o,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}var pz=w1("Slot");function cF(e){const t=g.forwardRef((n,r)=>{let{children:i,...s}=n;if(_1(i)&&typeof zc=="function"&&(i=zc(i._payload)),g.isValidElement(i)){const o=pF(i),a=hF(s,i.props);return i.type!==g.Fragment&&(a.ref=r?vi(r,o):o),g.cloneElement(i,a)}return g.Children.count(i)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var dF=Symbol("radix.slottable");function fF(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===dF}function hF(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const l=s(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function pF(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var vF=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Wg=vF.reduce((e,t)=>{const n=w1(`Primitive.${t}`),r=g.forwardRef((i,s)=>{const{asChild:o,...a}=i,l=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(l,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),x1={exports:{}},b1={};/** +For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return g.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},V$="DialogDescriptionWarning",B$=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${g1(V$).contentName}}.`;return g.useEffect(()=>{var s;const i=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},q$=n1,W$=i1,H$=o1,G$=a1,K$=l1,Q$=c1,lz=f1,Y$=p1;const b0=e=>e.endsWith("/")?e.slice(0,-1):e;function as(e){return["1","true","yes"].includes(String(e??"").trim().toLowerCase())}function Bg(){const e="https://paperswithcode.co".trim();if(!e)return"";try{const t=e.startsWith("http")?new URL(e):new URL(e,typeof window<"u"?window.location.origin:"http://localhost");return b0(t.origin)}catch{return b0(e)}}function X$(e){const t=e.startsWith("/")?e:`/${e}`,n=Bg();return n?`${n}${t}`:t}function qg(e){const t=e.startsWith("/")?e:`/${e}`;return X$(t)}function J$(e,t={}){const n=qg("/api/v1/auth/hf/login"),i=new URL(n,window.location.origin).origin===window.location.origin?e:new URL(e,window.location.origin).toString(),s=new URLSearchParams({return_to:i});return t.authorizeInference&&s.set("authorize_inference","true"),t.collectEmail&&s.set("collect_email","true"),t.authorizeBucket&&s.set("authorize_bucket","true"),t.bucketCreate&&s.set("bucket_create","true"),`${n}?${s.toString()}`}function Z$(){return qg("/admin-dashboard")}function uz(e){if(!e)return null;if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith("data:")||e.startsWith("blob:")||e.startsWith("//"))return e;if(e.startsWith("/")){const t=Bg();return t?`${t}${e}`:e}return e}function $o(){return as("1")}function al(){return as("0")}const eF="https://paperswithcode.co/chat";function tF(){return $o()&&!al()}function nF(){return as(void 0)}function cz(){return al()&&as(void 0)}function dz(){return as("0")}function fz(){return as("0")}function hz(){return typeof window<"u"&&window.location.hostname==="staging.paperswithcode.co"}function rF(){return as("1")}const iF="/hf-logo.svg?v=20260513b",E0=({size:e=14})=>w.jsx("img",{src:iF,alt:"",width:Math.round(e*95/88),height:e,"aria-hidden":"true",draggable:!1,style:{display:"block"}}),m1=({returnTo:e,compact:t=!1,label:n="Sign in",authorizeInference:r=!1,collectEmail:i=!1})=>{if($o())return null;const s=()=>{window.location.href=J$(e,{authorizeInference:r,collectEmail:i})};return t?w.jsx("button",{type:"button",className:"icon-btn","aria-label":"Sign in with Hugging Face",title:"Sign in with Hugging Face",onClick:s,children:w.jsx(E0,{size:16})}):w.jsxs("button",{type:"button",className:"hf-signin-btn",onClick:s,"aria-label":"Sign in with Hugging Face",children:[w.jsx(E0,{size:18}),w.jsx("span",{children:n})]})};function sF(e,t=[]){let n=[];function r(s,o){const a=g.createContext(o);a.displayName=s+"Context";const l=n.length;n=[...n,o];const u=d=>{var h;const{scope:f,children:m,..._}=d,p=((h=f==null?void 0:f[e])==null?void 0:h[l])||a,y=g.useMemo(()=>_,Object.values(_));return w.jsx(p.Provider,{value:y,children:m})};u.displayName=s+"Provider";function c(d,f){var p;const m=((p=f==null?void 0:f[e])==null?void 0:p[l])||a,_=g.useContext(m);if(_)return _;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[u,c]}const i=()=>{const s=n.map(o=>g.createContext(o));return function(a){const l=(a==null?void 0:a[e])||s;return g.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,oF(i,...t)]}function oF(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:l,scopeName:u})=>{const d=l(s)[`__scope${u}`];return{...a,...d}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var aF=Symbol.for("react.lazy"),zc=Kc[" use ".trim().toString()];function lF(e){return typeof e=="object"&&e!==null&&"then"in e}function y1(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===aF&&"_payload"in e&&lF(e._payload)}function _1(e){const t=uF(e),n=g.forwardRef((r,i)=>{let{children:s,...o}=r;y1(s)&&typeof zc=="function"&&(s=zc(s._payload));const a=g.Children.toArray(s),l=a.find(dF);if(l){const u=l.props.children,c=a.map(d=>d===l?g.Children.count(u)>1?g.Children.only(null):g.isValidElement(u)?u.props.children:null:d);return w.jsx(t,{...o,ref:i,children:g.isValidElement(u)?g.cloneElement(u,void 0,c):null})}return w.jsx(t,{...o,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}var pz=_1("Slot");function uF(e){const t=g.forwardRef((n,r)=>{let{children:i,...s}=n;if(y1(i)&&typeof zc=="function"&&(i=zc(i._payload)),g.isValidElement(i)){const o=hF(i),a=fF(s,i.props);return i.type!==g.Fragment&&(a.ref=r?vi(r,o):o),g.cloneElement(i,a)}return g.Children.count(i)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var cF=Symbol("radix.slottable");function dF(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===cF}function fF(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const l=s(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function hF(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var pF=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Wg=pF.reduce((e,t)=>{const n=_1(`Primitive.${t}`),r=g.forwardRef((i,s)=>{const{asChild:o,...a}=i,l=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(l,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),w1={exports:{}},x1={};/** * @license React * use-sync-external-store-shim.production.js * @@ -119,44 +119,44 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var To=g;function gF(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var mF=typeof Object.is=="function"?Object.is:gF,yF=To.useState,_F=To.useEffect,wF=To.useLayoutEffect,xF=To.useDebugValue;function bF(e,t){var n=t(),r=yF({inst:{value:n,getSnapshot:t}}),i=r[0].inst,s=r[1];return wF(function(){i.value=n,i.getSnapshot=t,Qf(i)&&s({inst:i})},[e,n,t]),_F(function(){return Qf(i)&&s({inst:i}),e(function(){Qf(i)&&s({inst:i})})},[e]),xF(n),n}function Qf(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!mF(e,n)}catch{return!0}}function EF(e,t){return t()}var SF=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?EF:bF;b1.useSyncExternalStore=To.useSyncExternalStore!==void 0?To.useSyncExternalStore:SF;x1.exports=b1;var CF=x1.exports;function kF(){return CF.useSyncExternalStore(PF,()=>!0,()=>!1)}function PF(){return()=>{}}var Hg="Avatar",[RF]=oF(Hg),[TF,E1]=RF(Hg),S1=g.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,s]=g.useState("idle");return w.jsx(TF,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:s,children:w.jsx(Wg.span,{...r,ref:t})})});S1.displayName=Hg;var C1="AvatarImage",k1=g.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...s}=e,o=E1(C1,n),a=IF(r,s),l=Ut(u=>{i(u),o.onImageLoadingStatusChange(u)});return fn(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?w.jsx(Wg.img,{...s,ref:t,src:r}):null});k1.displayName=C1;var P1="AvatarFallback",R1=g.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,s=E1(P1,n),[o,a]=g.useState(r===void 0);return g.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(l)}},[r]),o&&s.imageLoadingStatus!=="loaded"?w.jsx(Wg.span,{...i,ref:t}):null});R1.displayName=P1;function S0(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function IF(e,{referrerPolicy:t,crossOrigin:n}){const r=kF(),i=g.useRef(null),s=r?(i.current||(i.current=new window.Image),i.current):null,[o,a]=g.useState(()=>S0(s,e));return fn(()=>{a(S0(s,e))},[s,e]),fn(()=>{const l=d=>()=>{a(d)};if(!s)return;const u=l("loaded"),c=l("error");return s.addEventListener("load",u),s.addEventListener("error",c),t&&(s.referrerPolicy=t),typeof n=="string"&&(s.crossOrigin=n),()=>{s.removeEventListener("load",u),s.removeEventListener("error",c)}},[s,n,t]),o}var T1=S1,I1=k1,O1=R1;function M1(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t{const t=AF(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const a=o.split(Gg);return a[0]===""&&a.length!==1&&a.shift(),N1(a,t)||MF(o)},getConflictingClassGroupIds:(o,a)=>{const l=n[o]||[];return a&&r[o]?[...l,...r[o]]:l}}},N1=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?N1(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const s=e.join(Gg);return(o=t.validators.find(({validator:a})=>a(s)))==null?void 0:o.classGroupId},C0=/^\[(.+)\]$/,MF=e=>{if(C0.test(e)){const t=C0.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},AF=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return $F(Object.entries(e.classGroups),n).forEach(([s,o])=>{rv(o,r,s,t)}),r},rv=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const s=i===""?t:k0(t,i);s.classGroupId=n;return}if(typeof i=="function"){if(NF(i)){rv(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,o])=>{rv(o,k0(t,s),n,r)})})},k0=(e,t)=>{let n=e;return t.split(Gg).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},NF=e=>e.isThemeGetter,$F=(e,t)=>t?e.map(([n,r])=>{const i=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([o,a])=>[t+o,a])):s);return[n,i]}):e,FF=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(s,o)=>{n.set(s,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let o=n.get(s);if(o!==void 0)return o;if((o=r.get(s))!==void 0)return i(s,o),o},set(s,o){n.has(s)?n.set(s,o):i(s,o)}}},$1="!",LF=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],s=t.length,o=a=>{const l=[];let u=0,c=0,d;for(let y=0;yc?d-c:void 0;return{modifiers:l,hasImportantModifier:m,baseClassName:_,maybePostfixModifierPosition:p}};return n?a=>n({className:a,parseClassName:o}):o},jF=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},DF=e=>({cache:FF(e.cacheSize),parseClassName:LF(e),...OF(e)}),zF=/\s+/,UF=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,s=[],o=e.trim().split(zF);let a="";for(let l=o.length-1;l>=0;l-=1){const u=o[l],{modifiers:c,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:m}=n(u);let _=!!m,p=r(_?f.substring(0,m):f);if(!p){if(!_){a=u+(a.length>0?" "+a:a);continue}if(p=r(f),!p){a=u+(a.length>0?" "+a:a);continue}_=!1}const y=jF(c).join(":"),h=d?y+$1:y,v=h+p;if(s.includes(v))continue;s.push(v);const x=i(p,_);for(let b=0;b0?" "+a:a)}return a};function VF(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rd(c),e());return n=DF(u),r=n.cache.get,i=n.cache.set,s=a,a(l)}function a(l){const u=r(l);if(u)return u;const c=UF(l,n);return i(l,c),c}return function(){return s(VF.apply(null,arguments))}}const Oe=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},L1=/^\[(?:([a-z-]+):)?(.+)\]$/i,qF=/^\d+\/\d+$/,WF=new Set(["px","full","screen"]),HF=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,GF=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,KF=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,QF=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,YF=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Xn=e=>Xs(e)||WF.has(e)||qF.test(e),Ir=e=>Fo(e,"length",iL),Xs=e=>!!e&&!Number.isNaN(Number(e)),Yf=e=>Fo(e,"number",Xs),ra=e=>!!e&&Number.isInteger(Number(e)),XF=e=>e.endsWith("%")&&Xs(e.slice(0,-1)),ie=e=>L1.test(e),Or=e=>HF.test(e),JF=new Set(["length","size","percentage"]),ZF=e=>Fo(e,JF,j1),eL=e=>Fo(e,"position",j1),tL=new Set(["image","url"]),nL=e=>Fo(e,tL,oL),rL=e=>Fo(e,"",sL),ia=()=>!0,Fo=(e,t,n)=>{const r=L1.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},iL=e=>GF.test(e)&&!KF.test(e),j1=()=>!1,sL=e=>QF.test(e),oL=e=>YF.test(e),aL=()=>{const e=Oe("colors"),t=Oe("spacing"),n=Oe("blur"),r=Oe("brightness"),i=Oe("borderColor"),s=Oe("borderRadius"),o=Oe("borderSpacing"),a=Oe("borderWidth"),l=Oe("contrast"),u=Oe("grayscale"),c=Oe("hueRotate"),d=Oe("invert"),f=Oe("gap"),m=Oe("gradientColorStops"),_=Oe("gradientColorStopPositions"),p=Oe("inset"),y=Oe("margin"),h=Oe("opacity"),v=Oe("padding"),x=Oe("saturate"),b=Oe("scale"),E=Oe("sepia"),S=Oe("skew"),P=Oe("space"),C=Oe("translate"),T=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto",ie,t],M=()=>[ie,t],z=()=>["",Xn,Ir],F=()=>["auto",Xs,ie],W=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],B=()=>["solid","dashed","dotted","double","none"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],O=()=>["start","end","center","between","around","evenly","stretch"],A=()=>["","0",ie],V=()=>["auto","avoid","all","avoid-page","page","left","right","column"],K=()=>[Xs,ie];return{cacheSize:500,separator:":",theme:{colors:[ia],spacing:[Xn,Ir],blur:["none","",Or,ie],brightness:K(),borderColor:[e],borderRadius:["none","","full",Or,ie],borderSpacing:M(),borderWidth:z(),contrast:K(),grayscale:A(),hueRotate:K(),invert:A(),gap:M(),gradientColorStops:[e],gradientColorStopPositions:[XF,Ir],inset:N(),margin:N(),opacity:K(),padding:M(),saturate:K(),scale:K(),sepia:A(),skew:K(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",ie]}],container:["container"],columns:[{columns:[Or]}],"break-after":[{"break-after":V()}],"break-before":[{"break-before":V()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...W(),ie]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ra,ie]}],basis:[{basis:N()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ie]}],grow:[{grow:A()}],shrink:[{shrink:A()}],order:[{order:["first","last","none",ra,ie]}],"grid-cols":[{"grid-cols":[ia]}],"col-start-end":[{col:["auto",{span:["full",ra,ie]},ie]}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":[ia]}],"row-start-end":[{row:["auto",{span:[ra,ie]},ie]}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ie]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ie]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...O()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...O(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...O(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[P]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[P]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ie,t]}],"min-w":[{"min-w":[ie,t,"min","max","fit"]}],"max-w":[{"max-w":[ie,t,"none","full","min","max","fit","prose",{screen:[Or]},Or]}],h:[{h:[ie,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ie,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ie,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ie,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Or,Ir]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Yf]}],"font-family":[{font:[ia]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ie]}],"line-clamp":[{"line-clamp":["none",Xs,Yf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Xn,ie]}],"list-image":[{"list-image":["none",ie]}],"list-style-type":[{list:["none","disc","decimal",ie]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[h]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[h]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Xn,Ir]}],"underline-offset":[{"underline-offset":["auto",Xn,ie]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ie]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ie]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[h]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...W(),eL]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ZF]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},nL]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[_]}],"gradient-via-pos":[{via:[_]}],"gradient-to-pos":[{to:[_]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[h]}],"border-style":[{border:[...B(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[h]}],"divide-style":[{divide:B()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...B()]}],"outline-offset":[{"outline-offset":[Xn,ie]}],"outline-w":[{outline:[Xn,Ir]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[h]}],"ring-offset-w":[{"ring-offset":[Xn,Ir]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Or,rL]}],"shadow-color":[{shadow:[ia]}],opacity:[{opacity:[h]}],"mix-blend":[{"mix-blend":[...Q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Q()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Or,ie]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[x]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[h]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ie]}],duration:[{duration:K()}],ease:[{ease:["linear","in","out","in-out",ie]}],delay:[{delay:K()}],animate:[{animate:["none","spin","ping","pulse","bounce",ie]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[ra,ie]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ie]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ie]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ie]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Xn,Ir,Yf]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},lL=BF(aL);function ct(...e){return lL(A1(e))}function vz(e){return e.replace(/v\d+$/i,"")}function gz(e){const t=e.trim(),n=t.match(/^(\d{4})-(\d{4,5})(v\d+)?$/);if(n)return`${n[1]}.${n[2]}`;const r=t.match(/^(\d{4}\.\d{4,5})(v\d+)$/);return r?r[1]:t}function mz(e){if(e==null||e==="")return"—";const t=typeof e=="string"?parseFloat(e):e;return Number.isFinite(t)?Math.abs(t)>=100?du(t,0):Math.abs(t)>=10?du(t,1):Math.abs(t)<1?du(t,3):du(t,2):String(e)}function du(e,t){const n=String(Math.abs(e));if(n.includes("e"))return e.toFixed(t);const r=+`${Math.round(+`${n}e${t}`)}e-${t}`;return(e<0?-r:r).toFixed(t)}const D1=g.forwardRef(({className:e,...t},n)=>w.jsx(T1,{ref:n,className:ct("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));D1.displayName=T1.displayName;const z1=g.forwardRef(({className:e,...t},n)=>w.jsx(I1,{ref:n,className:ct("aspect-square h-full w-full",e),...t}));z1.displayName=I1.displayName;const U1=g.forwardRef(({className:e,...t},n)=>w.jsx(O1,{ref:n,className:ct("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));U1.displayName=O1.displayName;function P0(e){const t=uL(e),n=g.forwardRef((r,i)=>{const{children:s,...o}=r,a=g.Children.toArray(s),l=a.find(dL);if(l){const u=l.props.children,c=a.map(d=>d===l?g.Children.count(u)>1?g.Children.only(null):g.isValidElement(u)?u.props.children:null:d);return w.jsx(t,{...o,ref:i,children:g.isValidElement(u)?g.cloneElement(u,void 0,c):null})}return w.jsx(t,{...o,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}function uL(e){const t=g.forwardRef((n,r)=>{const{children:i,...s}=n;if(g.isValidElement(i)){const o=hL(i),a=fL(s,i.props);return i.type!==g.Fragment&&(a.ref=r?vi(r,o):o),g.cloneElement(i,a)}return g.Children.count(i)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var cL=Symbol("radix.slottable");function dL(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===cL}function fL(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const l=s(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function hL(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Kg(e){const t=e+"CollectionProvider",[n,r]=ss(t),[i,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=p=>{const{scope:y,children:h}=p,v=q.useRef(null),x=q.useRef(new Map).current;return w.jsx(i,{scope:y,itemMap:x,collectionRef:v,children:h})};o.displayName=t;const a=e+"CollectionSlot",l=P0(a),u=q.forwardRef((p,y)=>{const{scope:h,children:v}=p,x=s(a,h),b=et(y,x.collectionRef);return w.jsx(l,{ref:b,children:v})});u.displayName=a;const c=e+"CollectionItemSlot",d="data-radix-collection-item",f=P0(c),m=q.forwardRef((p,y)=>{const{scope:h,children:v,...x}=p,b=q.useRef(null),E=et(y,b),S=s(c,h);return q.useEffect(()=>(S.itemMap.set(b,{ref:b,...x}),()=>void S.itemMap.delete(b))),w.jsx(f,{[d]:"",ref:E,children:v})});m.displayName=c;function _(p){const y=s(e+"CollectionConsumer",p);return q.useCallback(()=>{const v=y.collectionRef.current;if(!v)return[];const x=Array.from(v.querySelectorAll(`[${d}]`));return Array.from(y.itemMap.values()).sort((S,P)=>x.indexOf(S.ref.current)-x.indexOf(P.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:o,Slot:u,ItemSlot:m},_,r]}var pL=g.createContext(void 0);function V1(e){const t=g.useContext(pL);return e||t||"ltr"}const vL=["top","right","bottom","left"],ci=Math.min,Ht=Math.max,Uc=Math.round,fu=Math.floor,Hn=e=>({x:e,y:e}),gL={left:"right",right:"left",bottom:"top",top:"bottom"};function iv(e,t,n){return Ht(e,ci(t,n))}function yr(e,t){return typeof e=="function"?e(t):e}function _r(e){return e.split("-")[0]}function Lo(e){return e.split("-")[1]}function Qg(e){return e==="x"?"y":"x"}function Yg(e){return e==="y"?"height":"width"}function Bn(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Xg(e){return Qg(Bn(e))}function mL(e,t,n){n===void 0&&(n=!1);const r=Lo(e),i=Xg(e),s=Yg(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=Vc(o)),[o,Vc(o)]}function yL(e){const t=Vc(e);return[sv(e),t,sv(t)]}function sv(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const R0=["left","right"],T0=["right","left"],_L=["top","bottom"],wL=["bottom","top"];function xL(e,t,n){switch(e){case"top":case"bottom":return n?t?T0:R0:t?R0:T0;case"left":case"right":return t?_L:wL;default:return[]}}function bL(e,t,n,r){const i=Lo(e);let s=xL(_r(e),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(sv)))),s}function Vc(e){const t=_r(e);return gL[t]+e.slice(t.length)}function EL(e){return{top:0,right:0,bottom:0,left:0,...e}}function B1(e){return typeof e!="number"?EL(e):{top:e,right:e,bottom:e,left:e}}function Bc(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function I0(e,t,n){let{reference:r,floating:i}=e;const s=Bn(t),o=Xg(t),a=Yg(o),l=_r(t),u=s==="y",c=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[a]/2-i[a]/2;let m;switch(l){case"top":m={x:c,y:r.y-i.height};break;case"bottom":m={x:c,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:d};break;case"left":m={x:r.x-i.width,y:d};break;default:m={x:r.x,y:r.y}}switch(Lo(t)){case"start":m[o]-=f*(n&&u?-1:1);break;case"end":m[o]+=f*(n&&u?-1:1);break}return m}async function SL(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:m=0}=yr(t,e),_=B1(m),y=a[f?d==="floating"?"reference":"floating":d],h=Bc(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),v=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),b=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},E=Bc(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:x,strategy:l}):v);return{top:(h.top-E.top+_.top)/b.y,bottom:(E.bottom-h.bottom+_.bottom)/b.y,left:(h.left-E.left+_.left)/b.x,right:(E.right-h.right+_.right)/b.x}}const CL=50,kL=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=o.detectOverflow?o:{...o,detectOverflow:SL},l=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:d}=I0(u,r,l),f=r,m=0;const _={};for(let p=0;p({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=t,{element:u,padding:c=0}=yr(e,t)||{};if(u==null)return{};const d=B1(c),f={x:n,y:r},m=Xg(i),_=Yg(m),p=await o.getDimensions(u),y=m==="y",h=y?"top":"left",v=y?"bottom":"right",x=y?"clientHeight":"clientWidth",b=s.reference[_]+s.reference[m]-f[m]-s.floating[_],E=f[m]-s.reference[m],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let P=S?S[x]:0;(!P||!await(o.isElement==null?void 0:o.isElement(S)))&&(P=a.floating[x]||s.floating[_]);const C=b/2-E/2,T=P/2-p[_]/2-1,R=ci(d[h],T),N=ci(d[v],T),M=R,z=P-p[_]-N,F=P/2-p[_]/2+C,W=iv(M,F,z),B=!l.arrow&&Lo(i)!=null&&F!==W&&s.reference[_]/2-(FF<=0)){var N,M;const F=(((N=s.flip)==null?void 0:N.index)||0)+1,W=P[F];if(W&&(!(d==="alignment"?v!==Bn(W):!1)||R.every(O=>Bn(O.placement)===v?O.overflows[0]>0:!0)))return{data:{index:F,overflows:R},reset:{placement:W}};let B=(M=R.filter(Q=>Q.overflows[0]<=0).sort((Q,O)=>Q.overflows[1]-O.overflows[1])[0])==null?void 0:M.placement;if(!B)switch(m){case"bestFit":{var z;const Q=(z=R.filter(O=>{if(S){const A=Bn(O.placement);return A===v||A==="y"}return!0}).map(O=>[O.placement,O.overflows.filter(A=>A>0).reduce((A,V)=>A+V,0)]).sort((O,A)=>O[1]-A[1])[0])==null?void 0:z[0];Q&&(B=Q);break}case"initialPlacement":B=a;break}if(i!==B)return{reset:{placement:B}}}return{}}}};function O0(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function M0(e){return vL.some(t=>e[t]>=0)}const TL=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...s}=yr(e,t);switch(i){case"referenceHidden":{const o=await r.detectOverflow(t,{...s,elementContext:"reference"}),a=O0(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:M0(a)}}}case"escaped":{const o=await r.detectOverflow(t,{...s,altBoundary:!0}),a=O0(o,n.floating);return{data:{escapedOffsets:a,escaped:M0(a)}}}default:return{}}}}},q1=new Set(["left","top"]);async function IL(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=_r(n),a=Lo(n),l=Bn(n)==="y",u=q1.has(o)?-1:1,c=s&&l?-1:1,d=yr(t,e);let{mainAxis:f,crossAxis:m,alignmentAxis:_}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof _=="number"&&(m=a==="end"?_*-1:_),l?{x:m*c,y:f*u}:{x:f*u,y:m*c}}const OL=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=t,l=await IL(t,e);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},ML=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:s}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:h=>{let{x:v,y:x}=h;return{x:v,y:x}}},...u}=yr(e,t),c={x:n,y:r},d=await s.detectOverflow(t,u),f=Bn(_r(i)),m=Qg(f);let _=c[m],p=c[f];if(o){const h=m==="y"?"top":"left",v=m==="y"?"bottom":"right",x=_+d[h],b=_-d[v];_=iv(x,_,b)}if(a){const h=f==="y"?"top":"left",v=f==="y"?"bottom":"right",x=p+d[h],b=p-d[v];p=iv(x,p,b)}const y=l.fn({...t,[m]:_,[f]:p});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[m]:o,[f]:a}}}}}},AL=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:s,middlewareData:o}=t,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=yr(e,t),c={x:n,y:r},d=Bn(i),f=Qg(d);let m=c[f],_=c[d];const p=yr(a,t),y=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const x=f==="y"?"height":"width",b=s.reference[f]-s.floating[x]+y.mainAxis,E=s.reference[f]+s.reference[x]-y.mainAxis;mE&&(m=E)}if(u){var h,v;const x=f==="y"?"width":"height",b=q1.has(_r(i)),E=s.reference[d]-s.floating[x]+(b&&((h=o.offset)==null?void 0:h[d])||0)+(b?0:y.crossAxis),S=s.reference[d]+s.reference[x]+(b?0:((v=o.offset)==null?void 0:v[d])||0)-(b?y.crossAxis:0);_S&&(_=S)}return{[f]:m,[d]:_}}}},NL=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:s,platform:o,elements:a}=t,{apply:l=()=>{},...u}=yr(e,t),c=await o.detectOverflow(t,u),d=_r(i),f=Lo(i),m=Bn(i)==="y",{width:_,height:p}=s.floating;let y,h;d==="top"||d==="bottom"?(y=d,h=f===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(h=d,y=f==="end"?"top":"bottom");const v=p-c.top-c.bottom,x=_-c.left-c.right,b=ci(p-c[y],v),E=ci(_-c[h],x),S=!t.middlewareData.shift;let P=b,C=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(C=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(P=v),S&&!f){const R=Ht(c.left,0),N=Ht(c.right,0),M=Ht(c.top,0),z=Ht(c.bottom,0);m?C=_-2*(R!==0||N!==0?R+N:Ht(c.left,c.right)):P=p-2*(M!==0||z!==0?M+z:Ht(c.top,c.bottom))}await l({...t,availableWidth:C,availableHeight:P});const T=await o.getDimensions(a.floating);return _!==T.width||p!==T.height?{reset:{rects:!0}}:{}}}};function Ed(){return typeof window<"u"}function jo(e){return W1(e)?(e.nodeName||"").toLowerCase():"#document"}function Xt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Kn(e){var t;return(t=(W1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function W1(e){return Ed()?e instanceof Node||e instanceof Xt(e).Node:!1}function Pn(e){return Ed()?e instanceof Element||e instanceof Xt(e).Element:!1}function Er(e){return Ed()?e instanceof HTMLElement||e instanceof Xt(e).HTMLElement:!1}function A0(e){return!Ed()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Xt(e).ShadowRoot}function Sl(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Rn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function $L(e){return/^(table|td|th)$/.test(jo(e))}function Sd(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const FL=/transform|translate|scale|rotate|perspective|filter/,LL=/paint|layout|strict|content/,xi=e=>!!e&&e!=="none";let Xf;function Jg(e){const t=Pn(e)?Rn(e):e;return xi(t.transform)||xi(t.translate)||xi(t.scale)||xi(t.rotate)||xi(t.perspective)||!Zg()&&(xi(t.backdropFilter)||xi(t.filter))||FL.test(t.willChange||"")||LL.test(t.contain||"")}function jL(e){let t=di(e);for(;Er(t)&&!Io(t);){if(Jg(t))return t;if(Sd(t))return null;t=di(t)}return null}function Zg(){return Xf==null&&(Xf=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Xf}function Io(e){return/^(html|body|#document)$/.test(jo(e))}function Rn(e){return Xt(e).getComputedStyle(e)}function Cd(e){return Pn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function di(e){if(jo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||A0(e)&&e.host||Kn(e);return A0(t)?t.host:t}function H1(e){const t=di(e);return Io(t)?e.ownerDocument?e.ownerDocument.body:e.body:Er(t)&&Sl(t)?t:H1(t)}function ll(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=H1(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),o=Xt(i);if(s){const a=ov(o);return t.concat(o,o.visualViewport||[],Sl(i)?i:[],a&&n?ll(a):[])}else return t.concat(i,ll(i,[],n))}function ov(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function G1(e){const t=Rn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Er(e),s=i?e.offsetWidth:n,o=i?e.offsetHeight:r,a=Uc(n)!==s||Uc(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function em(e){return Pn(e)?e:e.contextElement}function Js(e){const t=em(e);if(!Er(t))return Hn(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=G1(t);let o=(s?Uc(n.width):n.width)/r,a=(s?Uc(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const DL=Hn(0);function K1(e){const t=Xt(e);return!Zg()||!t.visualViewport?DL:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function zL(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Xt(e)?!1:t}function ts(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=em(e);let o=Hn(1);t&&(r?Pn(r)&&(o=Js(r)):o=Js(e));const a=zL(s,n,r)?K1(s):Hn(0);let l=(i.left+a.x)/o.x,u=(i.top+a.y)/o.y,c=i.width/o.x,d=i.height/o.y;if(s){const f=Xt(s),m=r&&Pn(r)?Xt(r):r;let _=f,p=ov(_);for(;p&&r&&m!==_;){const y=Js(p),h=p.getBoundingClientRect(),v=Rn(p),x=h.left+(p.clientLeft+parseFloat(v.paddingLeft))*y.x,b=h.top+(p.clientTop+parseFloat(v.paddingTop))*y.y;l*=y.x,u*=y.y,c*=y.x,d*=y.y,l+=x,u+=b,_=Xt(p),p=ov(_)}}return Bc({width:c,height:d,x:l,y:u})}function kd(e,t){const n=Cd(e).scrollLeft;return t?t.left+n:ts(Kn(e)).left+n}function Q1(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-kd(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function UL(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",o=Kn(r),a=t?Sd(t.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=Hn(1);const c=Hn(0),d=Er(r);if((d||!d&&!s)&&((jo(r)!=="body"||Sl(o))&&(l=Cd(r)),d)){const m=ts(r);u=Js(r),c.x=m.x+r.clientLeft,c.y=m.y+r.clientTop}const f=o&&!d&&!s?Q1(o,l):Hn(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+f.x,y:n.y*u.y-l.scrollTop*u.y+c.y+f.y}}function VL(e){return Array.from(e.getClientRects())}function BL(e){const t=Kn(e),n=Cd(e),r=e.ownerDocument.body,i=Ht(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Ht(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+kd(e);const a=-n.scrollTop;return Rn(r).direction==="rtl"&&(o+=Ht(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}const N0=25;function qL(e,t){const n=Xt(e),r=Kn(e),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const c=Zg();(!c||c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const u=kd(r);if(u<=0){const c=r.ownerDocument,d=c.body,f=getComputedStyle(d),m=c.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,_=Math.abs(r.clientWidth-d.clientWidth-m);_<=N0&&(s-=_)}else u<=N0&&(s+=u);return{width:s,height:o,x:a,y:l}}function WL(e,t){const n=ts(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=Er(e)?Js(e):Hn(1),o=e.clientWidth*s.x,a=e.clientHeight*s.y,l=i*s.x,u=r*s.y;return{width:o,height:a,x:l,y:u}}function $0(e,t,n){let r;if(t==="viewport")r=qL(e,n);else if(t==="document")r=BL(Kn(e));else if(Pn(t))r=WL(t,n);else{const i=K1(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Bc(r)}function Y1(e,t){const n=di(e);return n===t||!Pn(n)||Io(n)?!1:Rn(n).position==="fixed"||Y1(n,t)}function HL(e,t){const n=t.get(e);if(n)return n;let r=ll(e,[],!1).filter(a=>Pn(a)&&jo(a)!=="body"),i=null;const s=Rn(e).position==="fixed";let o=s?di(e):e;for(;Pn(o)&&!Io(o);){const a=Rn(o),l=Jg(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||Sl(o)&&!l&&Y1(e,o))?r=r.filter(c=>c!==o):i=a,o=di(o)}return t.set(e,r),r}function GL(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?Sd(t)?[]:HL(t,this._c):[].concat(n),r],a=$0(t,o[0],i);let l=a.top,u=a.right,c=a.bottom,d=a.left;for(let f=1;f{o(!1,1e-7)},1e3)}P===1&&!J1(u,e.getBoundingClientRect())&&o(),b=!1}try{n=new IntersectionObserver(E,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(E,x)}n.observe(e)}return o(!0),s}function ej(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=em(e),c=i||s?[...u?ll(u):[],...t?ll(t):[]]:[];c.forEach(h=>{i&&h.addEventListener("scroll",n,{passive:!0}),s&&h.addEventListener("resize",n)});const d=u&&a?ZL(u,n):null;let f=-1,m=null;o&&(m=new ResizeObserver(h=>{let[v]=h;v&&v.target===u&&m&&t&&(m.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),n()}),u&&!l&&m.observe(u),t&&m.observe(t));let _,p=l?ts(e):null;l&&y();function y(){const h=ts(e);p&&!J1(p,h)&&n(),p=h,_=requestAnimationFrame(y)}return n(),()=>{var h;c.forEach(v=>{i&&v.removeEventListener("scroll",n),s&&v.removeEventListener("resize",n)}),d==null||d(),(h=m)==null||h.disconnect(),m=null,l&&cancelAnimationFrame(_)}}const tj=OL,nj=ML,rj=RL,ij=NL,sj=TL,L0=PL,oj=AL,aj=(e,t,n)=>{const r=new Map,i={platform:JL,...n},s={...i.platform,_c:r};return kL(e,t,{...i,platform:s})};var lj=typeof document<"u",uj=function(){},Fu=lj?g.useLayoutEffect:uj;function qc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!qc(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&e.$$typeof)&&!qc(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Z1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function j0(e,t){const n=Z1(e);return Math.round(t*n)/n}function Zf(e){const t=g.useRef(e);return Fu(()=>{t.current=e}),t}function cj(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[c,d]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,m]=g.useState(r);qc(f,r)||m(r);const[_,p]=g.useState(null),[y,h]=g.useState(null),v=g.useCallback(O=>{O!==S.current&&(S.current=O,p(O))},[]),x=g.useCallback(O=>{O!==P.current&&(P.current=O,h(O))},[]),b=s||_,E=o||y,S=g.useRef(null),P=g.useRef(null),C=g.useRef(c),T=l!=null,R=Zf(l),N=Zf(i),M=Zf(u),z=g.useCallback(()=>{if(!S.current||!P.current)return;const O={placement:t,strategy:n,middleware:f};N.current&&(O.platform=N.current),aj(S.current,P.current,O).then(A=>{const V={...A,isPositioned:M.current!==!1};F.current&&!qc(C.current,V)&&(C.current=V,xl.flushSync(()=>{d(V)}))})},[f,t,n,N,M]);Fu(()=>{u===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,d(O=>({...O,isPositioned:!1})))},[u]);const F=g.useRef(!1);Fu(()=>(F.current=!0,()=>{F.current=!1}),[]),Fu(()=>{if(b&&(S.current=b),E&&(P.current=E),b&&E){if(R.current)return R.current(b,E,z);z()}},[b,E,z,R,T]);const W=g.useMemo(()=>({reference:S,floating:P,setReference:v,setFloating:x}),[v,x]),B=g.useMemo(()=>({reference:b,floating:E}),[b,E]),Q=g.useMemo(()=>{const O={position:n,left:0,top:0};if(!B.floating)return O;const A=j0(B.floating,c.x),V=j0(B.floating,c.y);return a?{...O,transform:"translate("+A+"px, "+V+"px)",...Z1(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:A,top:V}},[n,a,B.floating,c.x,c.y]);return g.useMemo(()=>({...c,update:z,refs:W,elements:B,floatingStyles:Q}),[c,z,W,B,Q])}const dj=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?L0({element:r.current,padding:i}).fn(n):{}:r?L0({element:r,padding:i}).fn(n):{}}}},fj=(e,t)=>{const n=tj(e);return{name:n.name,fn:n.fn,options:[e,t]}},hj=(e,t)=>{const n=nj(e);return{name:n.name,fn:n.fn,options:[e,t]}},pj=(e,t)=>({fn:oj(e).fn,options:[e,t]}),vj=(e,t)=>{const n=rj(e);return{name:n.name,fn:n.fn,options:[e,t]}},gj=(e,t)=>{const n=ij(e);return{name:n.name,fn:n.fn,options:[e,t]}},mj=(e,t)=>{const n=sj(e);return{name:n.name,fn:n.fn,options:[e,t]}},yj=(e,t)=>{const n=dj(e);return{name:n.name,fn:n.fn,options:[e,t]}};var _j="Arrow",eC=g.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...s}=e;return w.jsx(ke.svg,{...s,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:w.jsx("polygon",{points:"0,0 30,0 15,10"})})});eC.displayName=_j;var wj=eC;function xj(e){const[t,n]=g.useState(void 0);return fn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;o=u.inlineSize,a=u.blockSize}else o=e.offsetWidth,a=e.offsetHeight;n({width:o,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var tm="Popper",[tC,nC]=ss(tm),[bj,rC]=tC(tm),iC=e=>{const{__scopePopper:t,children:n}=e,[r,i]=g.useState(null);return w.jsx(bj,{scope:t,anchor:r,onAnchorChange:i,children:n})};iC.displayName=tm;var sC="PopperAnchor",oC=g.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,s=rC(sC,n),o=g.useRef(null),a=et(t,o),l=g.useRef(null);return g.useEffect(()=>{const u=l.current;l.current=(r==null?void 0:r.current)||o.current,u!==l.current&&s.onAnchorChange(l.current)}),r?null:w.jsx(ke.div,{...i,ref:a})});oC.displayName=sC;var nm="PopperContent",[Ej,Sj]=tC(nm),aC=g.forwardRef((e,t)=>{var Be,ye,Fe,Tt,Sr,_t;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:c=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:m="optimized",onPlaced:_,...p}=e,y=rC(nm,n),[h,v]=g.useState(null),x=et(t,Ye=>v(Ye)),[b,E]=g.useState(null),S=xj(b),P=(S==null?void 0:S.width)??0,C=(S==null?void 0:S.height)??0,T=r+(s!=="center"?"-"+s:""),R=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},N=Array.isArray(u)?u:[u],M=N.length>0,z={padding:R,boundary:N.filter(kj),altBoundary:M},{refs:F,floatingStyles:W,placement:B,isPositioned:Q,middlewareData:O}=cj({strategy:"fixed",placement:T,whileElementsMounted:(...Ye)=>ej(...Ye,{animationFrame:m==="always"}),elements:{reference:y.anchor},middleware:[fj({mainAxis:i+C,alignmentAxis:o}),l&&hj({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?pj():void 0,...z}),l&&vj({...z}),gj({...z,apply:({elements:Ye,rects:gi,availableWidth:us,availableHeight:It})=>{const{width:cs,height:Cr}=gi.reference,pn=Ye.floating.style;pn.setProperty("--radix-popper-available-width",`${us}px`),pn.setProperty("--radix-popper-available-height",`${It}px`),pn.setProperty("--radix-popper-anchor-width",`${cs}px`),pn.setProperty("--radix-popper-anchor-height",`${Cr}px`)}}),b&&yj({element:b,padding:a}),Pj({arrowWidth:P,arrowHeight:C}),f&&mj({strategy:"referenceHidden",...z})]}),[A,V]=cC(B),K=Ut(_);fn(()=>{Q&&(K==null||K())},[Q,K]);const te=(Be=O.arrow)==null?void 0:Be.x,oe=(ye=O.arrow)==null?void 0:ye.y,de=((Fe=O.arrow)==null?void 0:Fe.centerOffset)!==0,[be,Pe]=g.useState();return fn(()=>{h&&Pe(window.getComputedStyle(h).zIndex)},[h]),w.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:Q?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:be,"--radix-popper-transform-origin":[(Tt=O.transformOrigin)==null?void 0:Tt.x,(Sr=O.transformOrigin)==null?void 0:Sr.y].join(" "),...((_t=O.hide)==null?void 0:_t.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:w.jsx(Ej,{scope:n,placedSide:A,onArrowChange:E,arrowX:te,arrowY:oe,shouldHideArrow:de,children:w.jsx(ke.div,{"data-side":A,"data-align":V,...p,ref:x,style:{...p.style,animation:Q?void 0:"none"}})})})});aC.displayName=nm;var lC="PopperArrow",Cj={top:"bottom",right:"left",bottom:"top",left:"right"},uC=g.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,s=Sj(lC,r),o=Cj[s.placedSide];return w.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:w.jsx(wj,{...i,ref:n,style:{...i.style,display:"block"}})})});uC.displayName=lC;function kj(e){return e!==null}var Pj=e=>({name:"transformOrigin",options:e,fn(t){var y,h,v;const{placement:n,rects:r,middlewareData:i}=t,o=((y=i.arrow)==null?void 0:y.centerOffset)!==0,a=o?0:e.arrowWidth,l=o?0:e.arrowHeight,[u,c]=cC(n),d={start:"0%",center:"50%",end:"100%"}[c],f=(((h=i.arrow)==null?void 0:h.x)??0)+a/2,m=(((v=i.arrow)==null?void 0:v.y)??0)+l/2;let _="",p="";return u==="bottom"?(_=o?d:`${f}px`,p=`${-l}px`):u==="top"?(_=o?d:`${f}px`,p=`${r.floating.height+l}px`):u==="right"?(_=`${-l}px`,p=o?d:`${m}px`):u==="left"&&(_=`${r.floating.width+l}px`,p=o?d:`${m}px`),{data:{x:_,y:p}}}});function cC(e){const[t,n="center"]=e.split("-");return[t,n]}var Rj=iC,Tj=oC,Ij=aC,Oj=uC,eh="rovingFocusGroup.onEntryFocus",Mj={bubbles:!1,cancelable:!0},Cl="RovingFocusGroup",[av,dC,Aj]=Kg(Cl),[Nj,fC]=ss(Cl,[Aj]),[$j,Fj]=Nj(Cl),hC=g.forwardRef((e,t)=>w.jsx(av.Provider,{scope:e.__scopeRovingFocusGroup,children:w.jsx(av.Slot,{scope:e.__scopeRovingFocusGroup,children:w.jsx(Lj,{...e,ref:t})})}));hC.displayName=Cl;var Lj=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:c=!1,...d}=e,f=g.useRef(null),m=et(t,f),_=V1(s),[p,y]=yd({prop:o,defaultProp:a??null,onChange:l,caller:Cl}),[h,v]=g.useState(!1),x=Ut(u),b=dC(n),E=g.useRef(!1),[S,P]=g.useState(0);return g.useEffect(()=>{const C=f.current;if(C)return C.addEventListener(eh,x),()=>C.removeEventListener(eh,x)},[x]),w.jsx($j,{scope:n,orientation:r,dir:_,loop:i,currentTabStopId:p,onItemFocus:g.useCallback(C=>y(C),[y]),onItemShiftTab:g.useCallback(()=>v(!0),[]),onFocusableItemAdd:g.useCallback(()=>P(C=>C+1),[]),onFocusableItemRemove:g.useCallback(()=>P(C=>C-1),[]),children:w.jsx(ke.div,{tabIndex:h||S===0?-1:0,"data-orientation":r,...d,ref:m,style:{outline:"none",...e.style},onMouseDown:ee(e.onMouseDown,()=>{E.current=!0}),onFocus:ee(e.onFocus,C=>{const T=!E.current;if(C.target===C.currentTarget&&T&&!h){const R=new CustomEvent(eh,Mj);if(C.currentTarget.dispatchEvent(R),!R.defaultPrevented){const N=b().filter(B=>B.focusable),M=N.find(B=>B.active),z=N.find(B=>B.id===p),W=[M,z,...N].filter(Boolean).map(B=>B.ref.current);gC(W,c)}}E.current=!1}),onBlur:ee(e.onBlur,()=>v(!1))})})}),pC="RovingFocusGroupItem",vC=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:s,children:o,...a}=e,l=Qs(),u=s||l,c=Fj(pC,n),d=c.currentTabStopId===u,f=dC(n),{onFocusableItemAdd:m,onFocusableItemRemove:_,currentTabStopId:p}=c;return g.useEffect(()=>{if(r)return m(),()=>_()},[r,m,_]),w.jsx(av.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:w.jsx(ke.span,{tabIndex:d?0:-1,"data-orientation":c.orientation,...a,ref:t,onMouseDown:ee(e.onMouseDown,y=>{r?c.onItemFocus(u):y.preventDefault()}),onFocus:ee(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:ee(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){c.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const h=zj(y,c.orientation,c.dir);if(h!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let x=f().filter(b=>b.focusable).map(b=>b.ref.current);if(h==="last")x.reverse();else if(h==="prev"||h==="next"){h==="prev"&&x.reverse();const b=x.indexOf(y.currentTarget);x=c.loop?Uj(x,b+1):x.slice(b+1)}setTimeout(()=>gC(x))}}),children:typeof o=="function"?o({isCurrentTabStop:d,hasTabStop:p!=null}):o})})});vC.displayName=pC;var jj={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Dj(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function zj(e,t,n){const r=Dj(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return jj[r]}function gC(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Uj(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Vj=hC,Bj=vC;function qj(e){const t=Wj(e),n=g.forwardRef((r,i)=>{const{children:s,...o}=r,a=g.Children.toArray(s),l=a.find(Gj);if(l){const u=l.props.children,c=a.map(d=>d===l?g.Children.count(u)>1?g.Children.only(null):g.isValidElement(u)?u.props.children:null:d);return w.jsx(t,{...o,ref:i,children:g.isValidElement(u)?g.cloneElement(u,void 0,c):null})}return w.jsx(t,{...o,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}function Wj(e){const t=g.forwardRef((n,r)=>{const{children:i,...s}=n;if(g.isValidElement(i)){const o=Qj(i),a=Kj(s,i.props);return i.type!==g.Fragment&&(a.ref=r?vi(r,o):o),g.cloneElement(i,a)}return g.Children.count(i)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Hj=Symbol("radix.slottable");function Gj(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Hj}function Kj(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const l=s(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function Qj(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var lv=["Enter"," "],Yj=["ArrowDown","PageUp","Home"],mC=["ArrowUp","PageDown","End"],Xj=[...Yj,...mC],Jj={ltr:[...lv,"ArrowRight"],rtl:[...lv,"ArrowLeft"]},Zj={ltr:["ArrowLeft"],rtl:["ArrowRight"]},kl="Menu",[ul,eD,tD]=Kg(kl),[as,yC]=ss(kl,[tD,nC,fC]),Pd=nC(),_C=fC(),[nD,ls]=as(kl),[rD,Pl]=as(kl),wC=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:s,modal:o=!0}=e,a=Pd(t),[l,u]=g.useState(null),c=g.useRef(!1),d=Ut(s),f=V1(i);return g.useEffect(()=>{const m=()=>{c.current=!0,document.addEventListener("pointerdown",_,{capture:!0,once:!0}),document.addEventListener("pointermove",_,{capture:!0,once:!0})},_=()=>c.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",_,{capture:!0}),document.removeEventListener("pointermove",_,{capture:!0})}},[]),w.jsx(Rj,{...a,children:w.jsx(nD,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:u,children:w.jsx(rD,{scope:t,onClose:g.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:c,dir:f,modal:o,children:r})})})};wC.displayName=kl;var iD="MenuAnchor",rm=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Pd(n);return w.jsx(Tj,{...i,...r,ref:t})});rm.displayName=iD;var im="MenuPortal",[sD,xC]=as(im,{forceMount:void 0}),bC=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,s=ls(im,t);return w.jsx(sD,{scope:t,forceMount:n,children:w.jsx(br,{present:n||s.open,children:w.jsx(wd,{asChild:!0,container:i,children:r})})})};bC.displayName=im;var un="MenuContent",[oD,sm]=as(un),EC=g.forwardRef((e,t)=>{const n=xC(un,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,s=ls(un,e.__scopeMenu),o=Pl(un,e.__scopeMenu);return w.jsx(ul.Provider,{scope:e.__scopeMenu,children:w.jsx(br,{present:r||s.open,children:w.jsx(ul.Slot,{scope:e.__scopeMenu,children:o.modal?w.jsx(aD,{...i,ref:t}):w.jsx(lD,{...i,ref:t})})})})}),aD=g.forwardRef((e,t)=>{const n=ls(un,e.__scopeMenu),r=g.useRef(null),i=et(t,r);return g.useEffect(()=>{const s=r.current;if(s)return t1(s)},[]),w.jsx(om,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ee(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),lD=g.forwardRef((e,t)=>{const n=ls(un,e.__scopeMenu);return w.jsx(om,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),uD=qj("MenuContent.ScrollLock"),om=g.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,onDismiss:m,disableOutsideScroll:_,...p}=e,y=ls(un,n),h=Pl(un,n),v=Pd(n),x=_C(n),b=eD(n),[E,S]=g.useState(null),P=g.useRef(null),C=et(t,P,y.onContentChange),T=g.useRef(0),R=g.useRef(""),N=g.useRef(0),M=g.useRef(null),z=g.useRef("right"),F=g.useRef(0),W=_?Dg:g.Fragment,B=_?{as:uD,allowPinchZoom:!0}:void 0,Q=A=>{var Be,ye;const V=R.current+A,K=b().filter(Fe=>!Fe.disabled),te=document.activeElement,oe=(Be=K.find(Fe=>Fe.ref.current===te))==null?void 0:Be.textValue,de=K.map(Fe=>Fe.textValue),be=xD(de,V,oe),Pe=(ye=K.find(Fe=>Fe.textValue===be))==null?void 0:ye.ref.current;(function Fe(Tt){R.current=Tt,window.clearTimeout(T.current),Tt!==""&&(T.current=window.setTimeout(()=>Fe(""),1e3))})(V),Pe&&setTimeout(()=>Pe.focus())};g.useEffect(()=>()=>window.clearTimeout(T.current),[]),HS();const O=g.useCallback(A=>{var K,te;return z.current===((K=M.current)==null?void 0:K.side)&&ED(A,(te=M.current)==null?void 0:te.area)},[]);return w.jsx(oD,{scope:n,searchRef:R,onItemEnter:g.useCallback(A=>{O(A)&&A.preventDefault()},[O]),onItemLeave:g.useCallback(A=>{var V;O(A)||((V=P.current)==null||V.focus(),S(null))},[O]),onTriggerLeave:g.useCallback(A=>{O(A)&&A.preventDefault()},[O]),pointerGraceTimerRef:N,onPointerGraceIntentChange:g.useCallback(A=>{M.current=A},[]),children:w.jsx(W,{...B,children:w.jsx(jg,{asChild:!0,trapped:i,onMountAutoFocus:ee(s,A=>{var V;A.preventDefault(),(V=P.current)==null||V.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:w.jsx(_d,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,onDismiss:m,children:w.jsx(Vj,{asChild:!0,...x,dir:h.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:S,onEntryFocus:ee(l,A=>{h.isUsingKeyboardRef.current||A.preventDefault()}),preventScrollOnEntryFocus:!0,children:w.jsx(Ij,{role:"menu","aria-orientation":"vertical","data-state":DC(y.open),"data-radix-menu-content":"",dir:h.dir,...v,...p,ref:C,style:{outline:"none",...p.style},onKeyDown:ee(p.onKeyDown,A=>{const K=A.target.closest("[data-radix-menu-content]")===A.currentTarget,te=A.ctrlKey||A.altKey||A.metaKey,oe=A.key.length===1;K&&(A.key==="Tab"&&A.preventDefault(),!te&&oe&&Q(A.key));const de=P.current;if(A.target!==de||!Xj.includes(A.key))return;A.preventDefault();const Pe=b().filter(Be=>!Be.disabled).map(Be=>Be.ref.current);mC.includes(A.key)&&Pe.reverse(),_D(Pe)}),onBlur:ee(e.onBlur,A=>{A.currentTarget.contains(A.target)||(window.clearTimeout(T.current),R.current="")}),onPointerMove:ee(e.onPointerMove,cl(A=>{const V=A.target,K=F.current!==A.clientX;if(A.currentTarget.contains(V)&&K){const te=A.clientX>F.current?"right":"left";z.current=te,F.current=A.clientX}}))})})})})})})});EC.displayName=un;var cD="MenuGroup",am=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return w.jsx(ke.div,{role:"group",...r,ref:t})});am.displayName=cD;var dD="MenuLabel",SC=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return w.jsx(ke.div,{...r,ref:t})});SC.displayName=dD;var Wc="MenuItem",D0="menu.itemSelect",Rd=g.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,s=g.useRef(null),o=Pl(Wc,e.__scopeMenu),a=sm(Wc,e.__scopeMenu),l=et(t,s),u=g.useRef(!1),c=()=>{const d=s.current;if(!n&&d){const f=new CustomEvent(D0,{bubbles:!0,cancelable:!0});d.addEventListener(D0,m=>r==null?void 0:r(m),{once:!0}),Lg(d,f),f.defaultPrevented?u.current=!1:o.onClose()}};return w.jsx(CC,{...i,ref:l,disabled:n,onClick:ee(e.onClick,c),onPointerDown:d=>{var f;(f=e.onPointerDown)==null||f.call(e,d),u.current=!0},onPointerUp:ee(e.onPointerUp,d=>{var f;u.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:ee(e.onKeyDown,d=>{const f=a.searchRef.current!=="";n||f&&d.key===" "||lv.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Rd.displayName=Wc;var CC=g.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...s}=e,o=sm(Wc,n),a=_C(n),l=g.useRef(null),u=et(t,l),[c,d]=g.useState(!1),[f,m]=g.useState("");return g.useEffect(()=>{const _=l.current;_&&m((_.textContent??"").trim())},[s.children]),w.jsx(ul.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:w.jsx(Bj,{asChild:!0,...a,focusable:!r,children:w.jsx(ke.div,{role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:u,onPointerMove:ee(e.onPointerMove,cl(_=>{r?o.onItemLeave(_):(o.onItemEnter(_),_.defaultPrevented||_.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ee(e.onPointerLeave,cl(_=>o.onItemLeave(_))),onFocus:ee(e.onFocus,()=>d(!0)),onBlur:ee(e.onBlur,()=>d(!1))})})})}),fD="MenuCheckboxItem",kC=g.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return w.jsx(OC,{scope:e.__scopeMenu,checked:n,children:w.jsx(Rd,{role:"menuitemcheckbox","aria-checked":Hc(n)?"mixed":n,...i,ref:t,"data-state":um(n),onSelect:ee(i.onSelect,()=>r==null?void 0:r(Hc(n)?!0:!n),{checkForDefaultPrevented:!1})})})});kC.displayName=fD;var PC="MenuRadioGroup",[hD,pD]=as(PC,{value:void 0,onValueChange:()=>{}}),RC=g.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,s=Ut(r);return w.jsx(hD,{scope:e.__scopeMenu,value:n,onValueChange:s,children:w.jsx(am,{...i,ref:t})})});RC.displayName=PC;var TC="MenuRadioItem",IC=g.forwardRef((e,t)=>{const{value:n,...r}=e,i=pD(TC,e.__scopeMenu),s=n===i.value;return w.jsx(OC,{scope:e.__scopeMenu,checked:s,children:w.jsx(Rd,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":um(s),onSelect:ee(r.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,n)},{checkForDefaultPrevented:!1})})})});IC.displayName=TC;var lm="MenuItemIndicator",[OC,vD]=as(lm,{checked:!1}),MC=g.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,s=vD(lm,n);return w.jsx(br,{present:r||Hc(s.checked)||s.checked===!0,children:w.jsx(ke.span,{...i,ref:t,"data-state":um(s.checked)})})});MC.displayName=lm;var gD="MenuSeparator",AC=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return w.jsx(ke.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});AC.displayName=gD;var mD="MenuArrow",NC=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Pd(n);return w.jsx(Oj,{...i,...r,ref:t})});NC.displayName=mD;var yD="MenuSub",[yz,$C]=as(yD),pa="MenuSubTrigger",FC=g.forwardRef((e,t)=>{const n=ls(pa,e.__scopeMenu),r=Pl(pa,e.__scopeMenu),i=$C(pa,e.__scopeMenu),s=sm(pa,e.__scopeMenu),o=g.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=s,u={__scopeMenu:e.__scopeMenu},c=g.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return g.useEffect(()=>c,[c]),g.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),l(null)}},[a,l]),w.jsx(rm,{asChild:!0,...u,children:w.jsx(CC,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":DC(n.open),...e,ref:vi(t,i.onTriggerChange),onClick:d=>{var f;(f=e.onClick)==null||f.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ee(e.onPointerMove,cl(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(s.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),c()},100))})),onPointerLeave:ee(e.onPointerLeave,cl(d=>{var m,_;c();const f=(m=n.content)==null?void 0:m.getBoundingClientRect();if(f){const p=(_=n.content)==null?void 0:_.dataset.side,y=p==="right",h=y?-5:5,v=f[y?"left":"right"],x=f[y?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+h,y:d.clientY},{x:v,y:f.top},{x,y:f.top},{x,y:f.bottom},{x:v,y:f.bottom}],side:p}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:ee(e.onKeyDown,d=>{var m;const f=s.searchRef.current!=="";e.disabled||f&&d.key===" "||Jj[r.dir].includes(d.key)&&(n.onOpenChange(!0),(m=n.content)==null||m.focus(),d.preventDefault())})})})});FC.displayName=pa;var LC="MenuSubContent",jC=g.forwardRef((e,t)=>{const n=xC(un,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,s=ls(un,e.__scopeMenu),o=Pl(un,e.__scopeMenu),a=$C(LC,e.__scopeMenu),l=g.useRef(null),u=et(t,l);return w.jsx(ul.Provider,{scope:e.__scopeMenu,children:w.jsx(br,{present:r||s.open,children:w.jsx(ul.Slot,{scope:e.__scopeMenu,children:w.jsx(om,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:u,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:c=>{var d;o.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),c.preventDefault()},onCloseAutoFocus:c=>c.preventDefault(),onFocusOutside:ee(e.onFocusOutside,c=>{c.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:ee(e.onEscapeKeyDown,c=>{o.onClose(),c.preventDefault()}),onKeyDown:ee(e.onKeyDown,c=>{var m;const d=c.currentTarget.contains(c.target),f=Zj[o.dir].includes(c.key);d&&f&&(s.onOpenChange(!1),(m=a.trigger)==null||m.focus(),c.preventDefault())})})})})})});jC.displayName=LC;function DC(e){return e?"open":"closed"}function Hc(e){return e==="indeterminate"}function um(e){return Hc(e)?"indeterminate":e?"checked":"unchecked"}function _D(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function wD(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function xD(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let o=wD(e,Math.max(s,0));i.length===1&&(o=o.filter(u=>u!==n));const l=o.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function bD(e,t){const{x:n,y:r}=e;let i=!1;for(let s=0,o=t.length-1;sr!=f>r&&n<(d-u)*(r-c)/(f-c)+u&&(i=!i)}return i}function ED(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return bD(n,t)}function cl(e){return t=>t.pointerType==="mouse"?e(t):void 0}var SD=wC,CD=rm,kD=bC,PD=EC,RD=am,TD=SC,ID=Rd,OD=kC,MD=RC,AD=IC,ND=MC,$D=AC,FD=NC,LD=FC,jD=jC,Td="DropdownMenu",[DD]=ss(Td,[yC]),Rt=yC(),[zD,zC]=DD(Td),UC=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:s,onOpenChange:o,modal:a=!0}=e,l=Rt(t),u=g.useRef(null),[c,d]=yd({prop:i,defaultProp:s??!1,onChange:o,caller:Td});return w.jsx(zD,{scope:t,triggerId:Qs(),triggerRef:u,contentId:Qs(),open:c,onOpenChange:d,onOpenToggle:g.useCallback(()=>d(f=>!f),[d]),modal:a,children:w.jsx(SD,{...l,open:c,onOpenChange:d,dir:r,modal:a,children:n})})};UC.displayName=Td;var VC="DropdownMenuTrigger",BC=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,s=zC(VC,n),o=Rt(n);return w.jsx(CD,{asChild:!0,...o,children:w.jsx(ke.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:vi(t,s.triggerRef),onPointerDown:ee(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:ee(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});BC.displayName=VC;var UD="DropdownMenuPortal",qC=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Rt(t);return w.jsx(kD,{...r,...n})};qC.displayName=UD;var WC="DropdownMenuContent",HC=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=zC(WC,n),s=Rt(n),o=g.useRef(!1);return w.jsx(PD,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...r,ref:t,onCloseAutoFocus:ee(e.onCloseAutoFocus,a=>{var l;o.current||(l=i.triggerRef.current)==null||l.focus(),o.current=!1,a.preventDefault()}),onInteractOutside:ee(e.onInteractOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,c=l.button===2||u;(!i.modal||c)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});HC.displayName=WC;var VD="DropdownMenuGroup",BD=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Rt(n);return w.jsx(RD,{...i,...r,ref:t})});BD.displayName=VD;var qD="DropdownMenuLabel",GC=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Rt(n);return w.jsx(TD,{...i,...r,ref:t})});GC.displayName=qD;var WD="DropdownMenuItem",KC=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Rt(n);return w.jsx(ID,{...i,...r,ref:t})});KC.displayName=WD;var HD="DropdownMenuCheckboxItem",QC=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Rt(n);return w.jsx(OD,{...i,...r,ref:t})});QC.displayName=HD;var GD="DropdownMenuRadioGroup",KD=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Rt(n);return w.jsx(MD,{...i,...r,ref:t})});KD.displayName=GD;var QD="DropdownMenuRadioItem",YC=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Rt(n);return w.jsx(AD,{...i,...r,ref:t})});YC.displayName=QD;var YD="DropdownMenuItemIndicator",XC=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Rt(n);return w.jsx(ND,{...i,...r,ref:t})});XC.displayName=YD;var XD="DropdownMenuSeparator",JC=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Rt(n);return w.jsx($D,{...i,...r,ref:t})});JC.displayName=XD;var JD="DropdownMenuArrow",ZD=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Rt(n);return w.jsx(FD,{...i,...r,ref:t})});ZD.displayName=JD;var e2="DropdownMenuSubTrigger",ZC=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Rt(n);return w.jsx(LD,{...i,...r,ref:t})});ZC.displayName=e2;var t2="DropdownMenuSubContent",ek=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Rt(n);return w.jsx(jD,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});ek.displayName=t2;var n2=UC,r2=BC,i2=qC,tk=HC,nk=GC,rk=KC,ik=QC,sk=YC,ok=XC,ak=JC,lk=ZC,uk=ek;/** + */var To=g;function vF(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var gF=typeof Object.is=="function"?Object.is:vF,mF=To.useState,yF=To.useEffect,_F=To.useLayoutEffect,wF=To.useDebugValue;function xF(e,t){var n=t(),r=mF({inst:{value:n,getSnapshot:t}}),i=r[0].inst,s=r[1];return _F(function(){i.value=n,i.getSnapshot=t,Qf(i)&&s({inst:i})},[e,n,t]),yF(function(){return Qf(i)&&s({inst:i}),e(function(){Qf(i)&&s({inst:i})})},[e]),wF(n),n}function Qf(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!gF(e,n)}catch{return!0}}function bF(e,t){return t()}var EF=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?bF:xF;x1.useSyncExternalStore=To.useSyncExternalStore!==void 0?To.useSyncExternalStore:EF;w1.exports=x1;var SF=w1.exports;function CF(){return SF.useSyncExternalStore(kF,()=>!0,()=>!1)}function kF(){return()=>{}}var Hg="Avatar",[PF]=sF(Hg),[RF,b1]=PF(Hg),E1=g.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,s]=g.useState("idle");return w.jsx(RF,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:s,children:w.jsx(Wg.span,{...r,ref:t})})});E1.displayName=Hg;var S1="AvatarImage",C1=g.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...s}=e,o=b1(S1,n),a=TF(r,s),l=Ut(u=>{i(u),o.onImageLoadingStatusChange(u)});return fn(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?w.jsx(Wg.img,{...s,ref:t,src:r}):null});C1.displayName=S1;var k1="AvatarFallback",P1=g.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,s=b1(k1,n),[o,a]=g.useState(r===void 0);return g.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(l)}},[r]),o&&s.imageLoadingStatus!=="loaded"?w.jsx(Wg.span,{...i,ref:t}):null});P1.displayName=k1;function S0(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function TF(e,{referrerPolicy:t,crossOrigin:n}){const r=CF(),i=g.useRef(null),s=r?(i.current||(i.current=new window.Image),i.current):null,[o,a]=g.useState(()=>S0(s,e));return fn(()=>{a(S0(s,e))},[s,e]),fn(()=>{const l=d=>()=>{a(d)};if(!s)return;const u=l("loaded"),c=l("error");return s.addEventListener("load",u),s.addEventListener("error",c),t&&(s.referrerPolicy=t),typeof n=="string"&&(s.crossOrigin=n),()=>{s.removeEventListener("load",u),s.removeEventListener("error",c)}},[s,n,t]),o}var R1=E1,T1=C1,I1=P1;function O1(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t{const t=MF(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const a=o.split(Gg);return a[0]===""&&a.length!==1&&a.shift(),A1(a,t)||OF(o)},getConflictingClassGroupIds:(o,a)=>{const l=n[o]||[];return a&&r[o]?[...l,...r[o]]:l}}},A1=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?A1(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const s=e.join(Gg);return(o=t.validators.find(({validator:a})=>a(s)))==null?void 0:o.classGroupId},C0=/^\[(.+)\]$/,OF=e=>{if(C0.test(e)){const t=C0.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},MF=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return NF(Object.entries(e.classGroups),n).forEach(([s,o])=>{rv(o,r,s,t)}),r},rv=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const s=i===""?t:k0(t,i);s.classGroupId=n;return}if(typeof i=="function"){if(AF(i)){rv(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,o])=>{rv(o,k0(t,s),n,r)})})},k0=(e,t)=>{let n=e;return t.split(Gg).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},AF=e=>e.isThemeGetter,NF=(e,t)=>t?e.map(([n,r])=>{const i=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([o,a])=>[t+o,a])):s);return[n,i]}):e,$F=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(s,o)=>{n.set(s,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let o=n.get(s);if(o!==void 0)return o;if((o=r.get(s))!==void 0)return i(s,o),o},set(s,o){n.has(s)?n.set(s,o):i(s,o)}}},N1="!",FF=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],s=t.length,o=a=>{const l=[];let u=0,c=0,d;for(let y=0;yc?d-c:void 0;return{modifiers:l,hasImportantModifier:m,baseClassName:_,maybePostfixModifierPosition:p}};return n?a=>n({className:a,parseClassName:o}):o},LF=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},jF=e=>({cache:$F(e.cacheSize),parseClassName:FF(e),...IF(e)}),DF=/\s+/,zF=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,s=[],o=e.trim().split(DF);let a="";for(let l=o.length-1;l>=0;l-=1){const u=o[l],{modifiers:c,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:m}=n(u);let _=!!m,p=r(_?f.substring(0,m):f);if(!p){if(!_){a=u+(a.length>0?" "+a:a);continue}if(p=r(f),!p){a=u+(a.length>0?" "+a:a);continue}_=!1}const y=LF(c).join(":"),h=d?y+N1:y,v=h+p;if(s.includes(v))continue;s.push(v);const x=i(p,_);for(let b=0;b0?" "+a:a)}return a};function UF(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rd(c),e());return n=jF(u),r=n.cache.get,i=n.cache.set,s=a,a(l)}function a(l){const u=r(l);if(u)return u;const c=zF(l,n);return i(l,c),c}return function(){return s(UF.apply(null,arguments))}}const Oe=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},F1=/^\[(?:([a-z-]+):)?(.+)\]$/i,BF=/^\d+\/\d+$/,qF=new Set(["px","full","screen"]),WF=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,HF=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,GF=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,KF=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,QF=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Xn=e=>Js(e)||qF.has(e)||BF.test(e),Ir=e=>Fo(e,"length",rL),Js=e=>!!e&&!Number.isNaN(Number(e)),Yf=e=>Fo(e,"number",Js),ra=e=>!!e&&Number.isInteger(Number(e)),YF=e=>e.endsWith("%")&&Js(e.slice(0,-1)),ie=e=>F1.test(e),Or=e=>WF.test(e),XF=new Set(["length","size","percentage"]),JF=e=>Fo(e,XF,L1),ZF=e=>Fo(e,"position",L1),eL=new Set(["image","url"]),tL=e=>Fo(e,eL,sL),nL=e=>Fo(e,"",iL),ia=()=>!0,Fo=(e,t,n)=>{const r=F1.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},rL=e=>HF.test(e)&&!GF.test(e),L1=()=>!1,iL=e=>KF.test(e),sL=e=>QF.test(e),oL=()=>{const e=Oe("colors"),t=Oe("spacing"),n=Oe("blur"),r=Oe("brightness"),i=Oe("borderColor"),s=Oe("borderRadius"),o=Oe("borderSpacing"),a=Oe("borderWidth"),l=Oe("contrast"),u=Oe("grayscale"),c=Oe("hueRotate"),d=Oe("invert"),f=Oe("gap"),m=Oe("gradientColorStops"),_=Oe("gradientColorStopPositions"),p=Oe("inset"),y=Oe("margin"),h=Oe("opacity"),v=Oe("padding"),x=Oe("saturate"),b=Oe("scale"),E=Oe("sepia"),S=Oe("skew"),P=Oe("space"),C=Oe("translate"),T=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto",ie,t],M=()=>[ie,t],z=()=>["",Xn,Ir],F=()=>["auto",Js,ie],W=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],B=()=>["solid","dashed","dotted","double","none"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],O=()=>["start","end","center","between","around","evenly","stretch"],A=()=>["","0",ie],V=()=>["auto","avoid","all","avoid-page","page","left","right","column"],K=()=>[Js,ie];return{cacheSize:500,separator:":",theme:{colors:[ia],spacing:[Xn,Ir],blur:["none","",Or,ie],brightness:K(),borderColor:[e],borderRadius:["none","","full",Or,ie],borderSpacing:M(),borderWidth:z(),contrast:K(),grayscale:A(),hueRotate:K(),invert:A(),gap:M(),gradientColorStops:[e],gradientColorStopPositions:[YF,Ir],inset:N(),margin:N(),opacity:K(),padding:M(),saturate:K(),scale:K(),sepia:A(),skew:K(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",ie]}],container:["container"],columns:[{columns:[Or]}],"break-after":[{"break-after":V()}],"break-before":[{"break-before":V()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...W(),ie]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ra,ie]}],basis:[{basis:N()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ie]}],grow:[{grow:A()}],shrink:[{shrink:A()}],order:[{order:["first","last","none",ra,ie]}],"grid-cols":[{"grid-cols":[ia]}],"col-start-end":[{col:["auto",{span:["full",ra,ie]},ie]}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":[ia]}],"row-start-end":[{row:["auto",{span:[ra,ie]},ie]}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ie]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ie]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...O()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...O(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...O(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[P]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[P]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ie,t]}],"min-w":[{"min-w":[ie,t,"min","max","fit"]}],"max-w":[{"max-w":[ie,t,"none","full","min","max","fit","prose",{screen:[Or]},Or]}],h:[{h:[ie,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ie,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ie,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ie,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Or,Ir]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Yf]}],"font-family":[{font:[ia]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ie]}],"line-clamp":[{"line-clamp":["none",Js,Yf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Xn,ie]}],"list-image":[{"list-image":["none",ie]}],"list-style-type":[{list:["none","disc","decimal",ie]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[h]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[h]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Xn,Ir]}],"underline-offset":[{"underline-offset":["auto",Xn,ie]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ie]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ie]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[h]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...W(),ZF]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",JF]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},tL]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[_]}],"gradient-via-pos":[{via:[_]}],"gradient-to-pos":[{to:[_]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[h]}],"border-style":[{border:[...B(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[h]}],"divide-style":[{divide:B()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...B()]}],"outline-offset":[{"outline-offset":[Xn,ie]}],"outline-w":[{outline:[Xn,Ir]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[h]}],"ring-offset-w":[{"ring-offset":[Xn,Ir]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Or,nL]}],"shadow-color":[{shadow:[ia]}],opacity:[{opacity:[h]}],"mix-blend":[{"mix-blend":[...Q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Q()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Or,ie]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[x]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[h]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ie]}],duration:[{duration:K()}],ease:[{ease:["linear","in","out","in-out",ie]}],delay:[{delay:K()}],animate:[{animate:["none","spin","ping","pulse","bounce",ie]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[ra,ie]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ie]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ie]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ie]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Xn,Ir,Yf]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},aL=VF(oL);function ct(...e){return aL(M1(e))}function vz(e){return e.replace(/v\d+$/i,"")}function gz(e){const t=e.trim(),n=t.match(/^(\d{4})-(\d{4,5})(v\d+)?$/);if(n)return`${n[1]}.${n[2]}`;const r=t.match(/^(\d{4}\.\d{4,5})(v\d+)$/);return r?r[1]:t}function mz(e){if(e==null||e==="")return"—";const t=typeof e=="string"?parseFloat(e):e;return Number.isFinite(t)?Math.abs(t)>=100?du(t,0):Math.abs(t)>=10?du(t,1):Math.abs(t)<1?du(t,3):du(t,2):String(e)}function du(e,t){const n=String(Math.abs(e));if(n.includes("e"))return e.toFixed(t);const r=+`${Math.round(+`${n}e${t}`)}e-${t}`;return(e<0?-r:r).toFixed(t)}const j1=g.forwardRef(({className:e,...t},n)=>w.jsx(R1,{ref:n,className:ct("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));j1.displayName=R1.displayName;const D1=g.forwardRef(({className:e,...t},n)=>w.jsx(T1,{ref:n,className:ct("aspect-square h-full w-full",e),...t}));D1.displayName=T1.displayName;const z1=g.forwardRef(({className:e,...t},n)=>w.jsx(I1,{ref:n,className:ct("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));z1.displayName=I1.displayName;function P0(e){const t=lL(e),n=g.forwardRef((r,i)=>{const{children:s,...o}=r,a=g.Children.toArray(s),l=a.find(cL);if(l){const u=l.props.children,c=a.map(d=>d===l?g.Children.count(u)>1?g.Children.only(null):g.isValidElement(u)?u.props.children:null:d);return w.jsx(t,{...o,ref:i,children:g.isValidElement(u)?g.cloneElement(u,void 0,c):null})}return w.jsx(t,{...o,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}function lL(e){const t=g.forwardRef((n,r)=>{const{children:i,...s}=n;if(g.isValidElement(i)){const o=fL(i),a=dL(s,i.props);return i.type!==g.Fragment&&(a.ref=r?vi(r,o):o),g.cloneElement(i,a)}return g.Children.count(i)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var uL=Symbol("radix.slottable");function cL(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===uL}function dL(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const l=s(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function fL(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Kg(e){const t=e+"CollectionProvider",[n,r]=os(t),[i,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=p=>{const{scope:y,children:h}=p,v=q.useRef(null),x=q.useRef(new Map).current;return w.jsx(i,{scope:y,itemMap:x,collectionRef:v,children:h})};o.displayName=t;const a=e+"CollectionSlot",l=P0(a),u=q.forwardRef((p,y)=>{const{scope:h,children:v}=p,x=s(a,h),b=et(y,x.collectionRef);return w.jsx(l,{ref:b,children:v})});u.displayName=a;const c=e+"CollectionItemSlot",d="data-radix-collection-item",f=P0(c),m=q.forwardRef((p,y)=>{const{scope:h,children:v,...x}=p,b=q.useRef(null),E=et(y,b),S=s(c,h);return q.useEffect(()=>(S.itemMap.set(b,{ref:b,...x}),()=>void S.itemMap.delete(b))),w.jsx(f,{[d]:"",ref:E,children:v})});m.displayName=c;function _(p){const y=s(e+"CollectionConsumer",p);return q.useCallback(()=>{const v=y.collectionRef.current;if(!v)return[];const x=Array.from(v.querySelectorAll(`[${d}]`));return Array.from(y.itemMap.values()).sort((S,P)=>x.indexOf(S.ref.current)-x.indexOf(P.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:o,Slot:u,ItemSlot:m},_,r]}var hL=g.createContext(void 0);function U1(e){const t=g.useContext(hL);return e||t||"ltr"}const pL=["top","right","bottom","left"],ci=Math.min,Ht=Math.max,Uc=Math.round,fu=Math.floor,Hn=e=>({x:e,y:e}),vL={left:"right",right:"left",bottom:"top",top:"bottom"};function iv(e,t,n){return Ht(e,ci(t,n))}function yr(e,t){return typeof e=="function"?e(t):e}function _r(e){return e.split("-")[0]}function Lo(e){return e.split("-")[1]}function Qg(e){return e==="x"?"y":"x"}function Yg(e){return e==="y"?"height":"width"}function Bn(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Xg(e){return Qg(Bn(e))}function gL(e,t,n){n===void 0&&(n=!1);const r=Lo(e),i=Xg(e),s=Yg(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=Vc(o)),[o,Vc(o)]}function mL(e){const t=Vc(e);return[sv(e),t,sv(t)]}function sv(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const R0=["left","right"],T0=["right","left"],yL=["top","bottom"],_L=["bottom","top"];function wL(e,t,n){switch(e){case"top":case"bottom":return n?t?T0:R0:t?R0:T0;case"left":case"right":return t?yL:_L;default:return[]}}function xL(e,t,n,r){const i=Lo(e);let s=wL(_r(e),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(sv)))),s}function Vc(e){const t=_r(e);return vL[t]+e.slice(t.length)}function bL(e){return{top:0,right:0,bottom:0,left:0,...e}}function V1(e){return typeof e!="number"?bL(e):{top:e,right:e,bottom:e,left:e}}function Bc(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function I0(e,t,n){let{reference:r,floating:i}=e;const s=Bn(t),o=Xg(t),a=Yg(o),l=_r(t),u=s==="y",c=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[a]/2-i[a]/2;let m;switch(l){case"top":m={x:c,y:r.y-i.height};break;case"bottom":m={x:c,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:d};break;case"left":m={x:r.x-i.width,y:d};break;default:m={x:r.x,y:r.y}}switch(Lo(t)){case"start":m[o]-=f*(n&&u?-1:1);break;case"end":m[o]+=f*(n&&u?-1:1);break}return m}async function EL(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:m=0}=yr(t,e),_=V1(m),y=a[f?d==="floating"?"reference":"floating":d],h=Bc(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),v=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),b=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},E=Bc(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:x,strategy:l}):v);return{top:(h.top-E.top+_.top)/b.y,bottom:(E.bottom-h.bottom+_.bottom)/b.y,left:(h.left-E.left+_.left)/b.x,right:(E.right-h.right+_.right)/b.x}}const SL=50,CL=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=o.detectOverflow?o:{...o,detectOverflow:EL},l=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:d}=I0(u,r,l),f=r,m=0;const _={};for(let p=0;p({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=t,{element:u,padding:c=0}=yr(e,t)||{};if(u==null)return{};const d=V1(c),f={x:n,y:r},m=Xg(i),_=Yg(m),p=await o.getDimensions(u),y=m==="y",h=y?"top":"left",v=y?"bottom":"right",x=y?"clientHeight":"clientWidth",b=s.reference[_]+s.reference[m]-f[m]-s.floating[_],E=f[m]-s.reference[m],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let P=S?S[x]:0;(!P||!await(o.isElement==null?void 0:o.isElement(S)))&&(P=a.floating[x]||s.floating[_]);const C=b/2-E/2,T=P/2-p[_]/2-1,R=ci(d[h],T),N=ci(d[v],T),M=R,z=P-p[_]-N,F=P/2-p[_]/2+C,W=iv(M,F,z),B=!l.arrow&&Lo(i)!=null&&F!==W&&s.reference[_]/2-(FF<=0)){var N,M;const F=(((N=s.flip)==null?void 0:N.index)||0)+1,W=P[F];if(W&&(!(d==="alignment"?v!==Bn(W):!1)||R.every(O=>Bn(O.placement)===v?O.overflows[0]>0:!0)))return{data:{index:F,overflows:R},reset:{placement:W}};let B=(M=R.filter(Q=>Q.overflows[0]<=0).sort((Q,O)=>Q.overflows[1]-O.overflows[1])[0])==null?void 0:M.placement;if(!B)switch(m){case"bestFit":{var z;const Q=(z=R.filter(O=>{if(S){const A=Bn(O.placement);return A===v||A==="y"}return!0}).map(O=>[O.placement,O.overflows.filter(A=>A>0).reduce((A,V)=>A+V,0)]).sort((O,A)=>O[1]-A[1])[0])==null?void 0:z[0];Q&&(B=Q);break}case"initialPlacement":B=a;break}if(i!==B)return{reset:{placement:B}}}return{}}}};function O0(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function M0(e){return pL.some(t=>e[t]>=0)}const RL=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...s}=yr(e,t);switch(i){case"referenceHidden":{const o=await r.detectOverflow(t,{...s,elementContext:"reference"}),a=O0(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:M0(a)}}}case"escaped":{const o=await r.detectOverflow(t,{...s,altBoundary:!0}),a=O0(o,n.floating);return{data:{escapedOffsets:a,escaped:M0(a)}}}default:return{}}}}},B1=new Set(["left","top"]);async function TL(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=_r(n),a=Lo(n),l=Bn(n)==="y",u=B1.has(o)?-1:1,c=s&&l?-1:1,d=yr(t,e);let{mainAxis:f,crossAxis:m,alignmentAxis:_}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof _=="number"&&(m=a==="end"?_*-1:_),l?{x:m*c,y:f*u}:{x:f*u,y:m*c}}const IL=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=t,l=await TL(t,e);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},OL=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:s}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:h=>{let{x:v,y:x}=h;return{x:v,y:x}}},...u}=yr(e,t),c={x:n,y:r},d=await s.detectOverflow(t,u),f=Bn(_r(i)),m=Qg(f);let _=c[m],p=c[f];if(o){const h=m==="y"?"top":"left",v=m==="y"?"bottom":"right",x=_+d[h],b=_-d[v];_=iv(x,_,b)}if(a){const h=f==="y"?"top":"left",v=f==="y"?"bottom":"right",x=p+d[h],b=p-d[v];p=iv(x,p,b)}const y=l.fn({...t,[m]:_,[f]:p});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[m]:o,[f]:a}}}}}},ML=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:s,middlewareData:o}=t,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=yr(e,t),c={x:n,y:r},d=Bn(i),f=Qg(d);let m=c[f],_=c[d];const p=yr(a,t),y=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const x=f==="y"?"height":"width",b=s.reference[f]-s.floating[x]+y.mainAxis,E=s.reference[f]+s.reference[x]-y.mainAxis;mE&&(m=E)}if(u){var h,v;const x=f==="y"?"width":"height",b=B1.has(_r(i)),E=s.reference[d]-s.floating[x]+(b&&((h=o.offset)==null?void 0:h[d])||0)+(b?0:y.crossAxis),S=s.reference[d]+s.reference[x]+(b?0:((v=o.offset)==null?void 0:v[d])||0)-(b?y.crossAxis:0);_S&&(_=S)}return{[f]:m,[d]:_}}}},AL=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:s,platform:o,elements:a}=t,{apply:l=()=>{},...u}=yr(e,t),c=await o.detectOverflow(t,u),d=_r(i),f=Lo(i),m=Bn(i)==="y",{width:_,height:p}=s.floating;let y,h;d==="top"||d==="bottom"?(y=d,h=f===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(h=d,y=f==="end"?"top":"bottom");const v=p-c.top-c.bottom,x=_-c.left-c.right,b=ci(p-c[y],v),E=ci(_-c[h],x),S=!t.middlewareData.shift;let P=b,C=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(C=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(P=v),S&&!f){const R=Ht(c.left,0),N=Ht(c.right,0),M=Ht(c.top,0),z=Ht(c.bottom,0);m?C=_-2*(R!==0||N!==0?R+N:Ht(c.left,c.right)):P=p-2*(M!==0||z!==0?M+z:Ht(c.top,c.bottom))}await l({...t,availableWidth:C,availableHeight:P});const T=await o.getDimensions(a.floating);return _!==T.width||p!==T.height?{reset:{rects:!0}}:{}}}};function Ed(){return typeof window<"u"}function jo(e){return q1(e)?(e.nodeName||"").toLowerCase():"#document"}function Xt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Kn(e){var t;return(t=(q1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function q1(e){return Ed()?e instanceof Node||e instanceof Xt(e).Node:!1}function Pn(e){return Ed()?e instanceof Element||e instanceof Xt(e).Element:!1}function Er(e){return Ed()?e instanceof HTMLElement||e instanceof Xt(e).HTMLElement:!1}function A0(e){return!Ed()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Xt(e).ShadowRoot}function Sl(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Rn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function NL(e){return/^(table|td|th)$/.test(jo(e))}function Sd(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const $L=/transform|translate|scale|rotate|perspective|filter/,FL=/paint|layout|strict|content/,xi=e=>!!e&&e!=="none";let Xf;function Jg(e){const t=Pn(e)?Rn(e):e;return xi(t.transform)||xi(t.translate)||xi(t.scale)||xi(t.rotate)||xi(t.perspective)||!Zg()&&(xi(t.backdropFilter)||xi(t.filter))||$L.test(t.willChange||"")||FL.test(t.contain||"")}function LL(e){let t=di(e);for(;Er(t)&&!Io(t);){if(Jg(t))return t;if(Sd(t))return null;t=di(t)}return null}function Zg(){return Xf==null&&(Xf=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Xf}function Io(e){return/^(html|body|#document)$/.test(jo(e))}function Rn(e){return Xt(e).getComputedStyle(e)}function Cd(e){return Pn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function di(e){if(jo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||A0(e)&&e.host||Kn(e);return A0(t)?t.host:t}function W1(e){const t=di(e);return Io(t)?e.ownerDocument?e.ownerDocument.body:e.body:Er(t)&&Sl(t)?t:W1(t)}function ll(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=W1(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),o=Xt(i);if(s){const a=ov(o);return t.concat(o,o.visualViewport||[],Sl(i)?i:[],a&&n?ll(a):[])}else return t.concat(i,ll(i,[],n))}function ov(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function H1(e){const t=Rn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Er(e),s=i?e.offsetWidth:n,o=i?e.offsetHeight:r,a=Uc(n)!==s||Uc(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function em(e){return Pn(e)?e:e.contextElement}function Zs(e){const t=em(e);if(!Er(t))return Hn(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=H1(t);let o=(s?Uc(n.width):n.width)/r,a=(s?Uc(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const jL=Hn(0);function G1(e){const t=Xt(e);return!Zg()||!t.visualViewport?jL:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function DL(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Xt(e)?!1:t}function ns(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=em(e);let o=Hn(1);t&&(r?Pn(r)&&(o=Zs(r)):o=Zs(e));const a=DL(s,n,r)?G1(s):Hn(0);let l=(i.left+a.x)/o.x,u=(i.top+a.y)/o.y,c=i.width/o.x,d=i.height/o.y;if(s){const f=Xt(s),m=r&&Pn(r)?Xt(r):r;let _=f,p=ov(_);for(;p&&r&&m!==_;){const y=Zs(p),h=p.getBoundingClientRect(),v=Rn(p),x=h.left+(p.clientLeft+parseFloat(v.paddingLeft))*y.x,b=h.top+(p.clientTop+parseFloat(v.paddingTop))*y.y;l*=y.x,u*=y.y,c*=y.x,d*=y.y,l+=x,u+=b,_=Xt(p),p=ov(_)}}return Bc({width:c,height:d,x:l,y:u})}function kd(e,t){const n=Cd(e).scrollLeft;return t?t.left+n:ns(Kn(e)).left+n}function K1(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-kd(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function zL(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",o=Kn(r),a=t?Sd(t.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=Hn(1);const c=Hn(0),d=Er(r);if((d||!d&&!s)&&((jo(r)!=="body"||Sl(o))&&(l=Cd(r)),d)){const m=ns(r);u=Zs(r),c.x=m.x+r.clientLeft,c.y=m.y+r.clientTop}const f=o&&!d&&!s?K1(o,l):Hn(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+f.x,y:n.y*u.y-l.scrollTop*u.y+c.y+f.y}}function UL(e){return Array.from(e.getClientRects())}function VL(e){const t=Kn(e),n=Cd(e),r=e.ownerDocument.body,i=Ht(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Ht(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+kd(e);const a=-n.scrollTop;return Rn(r).direction==="rtl"&&(o+=Ht(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}const N0=25;function BL(e,t){const n=Xt(e),r=Kn(e),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const c=Zg();(!c||c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const u=kd(r);if(u<=0){const c=r.ownerDocument,d=c.body,f=getComputedStyle(d),m=c.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,_=Math.abs(r.clientWidth-d.clientWidth-m);_<=N0&&(s-=_)}else u<=N0&&(s+=u);return{width:s,height:o,x:a,y:l}}function qL(e,t){const n=ns(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=Er(e)?Zs(e):Hn(1),o=e.clientWidth*s.x,a=e.clientHeight*s.y,l=i*s.x,u=r*s.y;return{width:o,height:a,x:l,y:u}}function $0(e,t,n){let r;if(t==="viewport")r=BL(e,n);else if(t==="document")r=VL(Kn(e));else if(Pn(t))r=qL(t,n);else{const i=G1(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Bc(r)}function Q1(e,t){const n=di(e);return n===t||!Pn(n)||Io(n)?!1:Rn(n).position==="fixed"||Q1(n,t)}function WL(e,t){const n=t.get(e);if(n)return n;let r=ll(e,[],!1).filter(a=>Pn(a)&&jo(a)!=="body"),i=null;const s=Rn(e).position==="fixed";let o=s?di(e):e;for(;Pn(o)&&!Io(o);){const a=Rn(o),l=Jg(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||Sl(o)&&!l&&Q1(e,o))?r=r.filter(c=>c!==o):i=a,o=di(o)}return t.set(e,r),r}function HL(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?Sd(t)?[]:WL(t,this._c):[].concat(n),r],a=$0(t,o[0],i);let l=a.top,u=a.right,c=a.bottom,d=a.left;for(let f=1;f{o(!1,1e-7)},1e3)}P===1&&!X1(u,e.getBoundingClientRect())&&o(),b=!1}try{n=new IntersectionObserver(E,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(E,x)}n.observe(e)}return o(!0),s}function ZL(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=em(e),c=i||s?[...u?ll(u):[],...t?ll(t):[]]:[];c.forEach(h=>{i&&h.addEventListener("scroll",n,{passive:!0}),s&&h.addEventListener("resize",n)});const d=u&&a?JL(u,n):null;let f=-1,m=null;o&&(m=new ResizeObserver(h=>{let[v]=h;v&&v.target===u&&m&&t&&(m.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),n()}),u&&!l&&m.observe(u),t&&m.observe(t));let _,p=l?ns(e):null;l&&y();function y(){const h=ns(e);p&&!X1(p,h)&&n(),p=h,_=requestAnimationFrame(y)}return n(),()=>{var h;c.forEach(v=>{i&&v.removeEventListener("scroll",n),s&&v.removeEventListener("resize",n)}),d==null||d(),(h=m)==null||h.disconnect(),m=null,l&&cancelAnimationFrame(_)}}const ej=IL,tj=OL,nj=PL,rj=AL,ij=RL,L0=kL,sj=ML,oj=(e,t,n)=>{const r=new Map,i={platform:XL,...n},s={...i.platform,_c:r};return CL(e,t,{...i,platform:s})};var aj=typeof document<"u",lj=function(){},Fu=aj?g.useLayoutEffect:lj;function qc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!qc(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&e.$$typeof)&&!qc(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function J1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function j0(e,t){const n=J1(e);return Math.round(t*n)/n}function Zf(e){const t=g.useRef(e);return Fu(()=>{t.current=e}),t}function uj(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[c,d]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,m]=g.useState(r);qc(f,r)||m(r);const[_,p]=g.useState(null),[y,h]=g.useState(null),v=g.useCallback(O=>{O!==S.current&&(S.current=O,p(O))},[]),x=g.useCallback(O=>{O!==P.current&&(P.current=O,h(O))},[]),b=s||_,E=o||y,S=g.useRef(null),P=g.useRef(null),C=g.useRef(c),T=l!=null,R=Zf(l),N=Zf(i),M=Zf(u),z=g.useCallback(()=>{if(!S.current||!P.current)return;const O={placement:t,strategy:n,middleware:f};N.current&&(O.platform=N.current),oj(S.current,P.current,O).then(A=>{const V={...A,isPositioned:M.current!==!1};F.current&&!qc(C.current,V)&&(C.current=V,xl.flushSync(()=>{d(V)}))})},[f,t,n,N,M]);Fu(()=>{u===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,d(O=>({...O,isPositioned:!1})))},[u]);const F=g.useRef(!1);Fu(()=>(F.current=!0,()=>{F.current=!1}),[]),Fu(()=>{if(b&&(S.current=b),E&&(P.current=E),b&&E){if(R.current)return R.current(b,E,z);z()}},[b,E,z,R,T]);const W=g.useMemo(()=>({reference:S,floating:P,setReference:v,setFloating:x}),[v,x]),B=g.useMemo(()=>({reference:b,floating:E}),[b,E]),Q=g.useMemo(()=>{const O={position:n,left:0,top:0};if(!B.floating)return O;const A=j0(B.floating,c.x),V=j0(B.floating,c.y);return a?{...O,transform:"translate("+A+"px, "+V+"px)",...J1(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:A,top:V}},[n,a,B.floating,c.x,c.y]);return g.useMemo(()=>({...c,update:z,refs:W,elements:B,floatingStyles:Q}),[c,z,W,B,Q])}const cj=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?L0({element:r.current,padding:i}).fn(n):{}:r?L0({element:r,padding:i}).fn(n):{}}}},dj=(e,t)=>{const n=ej(e);return{name:n.name,fn:n.fn,options:[e,t]}},fj=(e,t)=>{const n=tj(e);return{name:n.name,fn:n.fn,options:[e,t]}},hj=(e,t)=>({fn:sj(e).fn,options:[e,t]}),pj=(e,t)=>{const n=nj(e);return{name:n.name,fn:n.fn,options:[e,t]}},vj=(e,t)=>{const n=rj(e);return{name:n.name,fn:n.fn,options:[e,t]}},gj=(e,t)=>{const n=ij(e);return{name:n.name,fn:n.fn,options:[e,t]}},mj=(e,t)=>{const n=cj(e);return{name:n.name,fn:n.fn,options:[e,t]}};var yj="Arrow",Z1=g.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...s}=e;return w.jsx(ke.svg,{...s,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:w.jsx("polygon",{points:"0,0 30,0 15,10"})})});Z1.displayName=yj;var _j=Z1;function wj(e){const[t,n]=g.useState(void 0);return fn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;o=u.inlineSize,a=u.blockSize}else o=e.offsetWidth,a=e.offsetHeight;n({width:o,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var tm="Popper",[eC,tC]=os(tm),[xj,nC]=eC(tm),rC=e=>{const{__scopePopper:t,children:n}=e,[r,i]=g.useState(null);return w.jsx(xj,{scope:t,anchor:r,onAnchorChange:i,children:n})};rC.displayName=tm;var iC="PopperAnchor",sC=g.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,s=nC(iC,n),o=g.useRef(null),a=et(t,o),l=g.useRef(null);return g.useEffect(()=>{const u=l.current;l.current=(r==null?void 0:r.current)||o.current,u!==l.current&&s.onAnchorChange(l.current)}),r?null:w.jsx(ke.div,{...i,ref:a})});sC.displayName=iC;var nm="PopperContent",[bj,Ej]=eC(nm),oC=g.forwardRef((e,t)=>{var Be,ye,Fe,Tt,Sr,_t;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:c=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:m="optimized",onPlaced:_,...p}=e,y=nC(nm,n),[h,v]=g.useState(null),x=et(t,Ye=>v(Ye)),[b,E]=g.useState(null),S=wj(b),P=(S==null?void 0:S.width)??0,C=(S==null?void 0:S.height)??0,T=r+(s!=="center"?"-"+s:""),R=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},N=Array.isArray(u)?u:[u],M=N.length>0,z={padding:R,boundary:N.filter(Cj),altBoundary:M},{refs:F,floatingStyles:W,placement:B,isPositioned:Q,middlewareData:O}=uj({strategy:"fixed",placement:T,whileElementsMounted:(...Ye)=>ZL(...Ye,{animationFrame:m==="always"}),elements:{reference:y.anchor},middleware:[dj({mainAxis:i+C,alignmentAxis:o}),l&&fj({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?hj():void 0,...z}),l&&pj({...z}),vj({...z,apply:({elements:Ye,rects:gi,availableWidth:cs,availableHeight:It})=>{const{width:ds,height:Cr}=gi.reference,pn=Ye.floating.style;pn.setProperty("--radix-popper-available-width",`${cs}px`),pn.setProperty("--radix-popper-available-height",`${It}px`),pn.setProperty("--radix-popper-anchor-width",`${ds}px`),pn.setProperty("--radix-popper-anchor-height",`${Cr}px`)}}),b&&mj({element:b,padding:a}),kj({arrowWidth:P,arrowHeight:C}),f&&gj({strategy:"referenceHidden",...z})]}),[A,V]=uC(B),K=Ut(_);fn(()=>{Q&&(K==null||K())},[Q,K]);const te=(Be=O.arrow)==null?void 0:Be.x,oe=(ye=O.arrow)==null?void 0:ye.y,de=((Fe=O.arrow)==null?void 0:Fe.centerOffset)!==0,[be,Pe]=g.useState();return fn(()=>{h&&Pe(window.getComputedStyle(h).zIndex)},[h]),w.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:Q?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:be,"--radix-popper-transform-origin":[(Tt=O.transformOrigin)==null?void 0:Tt.x,(Sr=O.transformOrigin)==null?void 0:Sr.y].join(" "),...((_t=O.hide)==null?void 0:_t.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:w.jsx(bj,{scope:n,placedSide:A,onArrowChange:E,arrowX:te,arrowY:oe,shouldHideArrow:de,children:w.jsx(ke.div,{"data-side":A,"data-align":V,...p,ref:x,style:{...p.style,animation:Q?void 0:"none"}})})})});oC.displayName=nm;var aC="PopperArrow",Sj={top:"bottom",right:"left",bottom:"top",left:"right"},lC=g.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,s=Ej(aC,r),o=Sj[s.placedSide];return w.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:w.jsx(_j,{...i,ref:n,style:{...i.style,display:"block"}})})});lC.displayName=aC;function Cj(e){return e!==null}var kj=e=>({name:"transformOrigin",options:e,fn(t){var y,h,v;const{placement:n,rects:r,middlewareData:i}=t,o=((y=i.arrow)==null?void 0:y.centerOffset)!==0,a=o?0:e.arrowWidth,l=o?0:e.arrowHeight,[u,c]=uC(n),d={start:"0%",center:"50%",end:"100%"}[c],f=(((h=i.arrow)==null?void 0:h.x)??0)+a/2,m=(((v=i.arrow)==null?void 0:v.y)??0)+l/2;let _="",p="";return u==="bottom"?(_=o?d:`${f}px`,p=`${-l}px`):u==="top"?(_=o?d:`${f}px`,p=`${r.floating.height+l}px`):u==="right"?(_=`${-l}px`,p=o?d:`${m}px`):u==="left"&&(_=`${r.floating.width+l}px`,p=o?d:`${m}px`),{data:{x:_,y:p}}}});function uC(e){const[t,n="center"]=e.split("-");return[t,n]}var Pj=rC,Rj=sC,Tj=oC,Ij=lC,eh="rovingFocusGroup.onEntryFocus",Oj={bubbles:!1,cancelable:!0},Cl="RovingFocusGroup",[av,cC,Mj]=Kg(Cl),[Aj,dC]=os(Cl,[Mj]),[Nj,$j]=Aj(Cl),fC=g.forwardRef((e,t)=>w.jsx(av.Provider,{scope:e.__scopeRovingFocusGroup,children:w.jsx(av.Slot,{scope:e.__scopeRovingFocusGroup,children:w.jsx(Fj,{...e,ref:t})})}));fC.displayName=Cl;var Fj=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:c=!1,...d}=e,f=g.useRef(null),m=et(t,f),_=U1(s),[p,y]=yd({prop:o,defaultProp:a??null,onChange:l,caller:Cl}),[h,v]=g.useState(!1),x=Ut(u),b=cC(n),E=g.useRef(!1),[S,P]=g.useState(0);return g.useEffect(()=>{const C=f.current;if(C)return C.addEventListener(eh,x),()=>C.removeEventListener(eh,x)},[x]),w.jsx(Nj,{scope:n,orientation:r,dir:_,loop:i,currentTabStopId:p,onItemFocus:g.useCallback(C=>y(C),[y]),onItemShiftTab:g.useCallback(()=>v(!0),[]),onFocusableItemAdd:g.useCallback(()=>P(C=>C+1),[]),onFocusableItemRemove:g.useCallback(()=>P(C=>C-1),[]),children:w.jsx(ke.div,{tabIndex:h||S===0?-1:0,"data-orientation":r,...d,ref:m,style:{outline:"none",...e.style},onMouseDown:ee(e.onMouseDown,()=>{E.current=!0}),onFocus:ee(e.onFocus,C=>{const T=!E.current;if(C.target===C.currentTarget&&T&&!h){const R=new CustomEvent(eh,Oj);if(C.currentTarget.dispatchEvent(R),!R.defaultPrevented){const N=b().filter(B=>B.focusable),M=N.find(B=>B.active),z=N.find(B=>B.id===p),W=[M,z,...N].filter(Boolean).map(B=>B.ref.current);vC(W,c)}}E.current=!1}),onBlur:ee(e.onBlur,()=>v(!1))})})}),hC="RovingFocusGroupItem",pC=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:s,children:o,...a}=e,l=Ys(),u=s||l,c=$j(hC,n),d=c.currentTabStopId===u,f=cC(n),{onFocusableItemAdd:m,onFocusableItemRemove:_,currentTabStopId:p}=c;return g.useEffect(()=>{if(r)return m(),()=>_()},[r,m,_]),w.jsx(av.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:w.jsx(ke.span,{tabIndex:d?0:-1,"data-orientation":c.orientation,...a,ref:t,onMouseDown:ee(e.onMouseDown,y=>{r?c.onItemFocus(u):y.preventDefault()}),onFocus:ee(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:ee(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){c.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const h=Dj(y,c.orientation,c.dir);if(h!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let x=f().filter(b=>b.focusable).map(b=>b.ref.current);if(h==="last")x.reverse();else if(h==="prev"||h==="next"){h==="prev"&&x.reverse();const b=x.indexOf(y.currentTarget);x=c.loop?zj(x,b+1):x.slice(b+1)}setTimeout(()=>vC(x))}}),children:typeof o=="function"?o({isCurrentTabStop:d,hasTabStop:p!=null}):o})})});pC.displayName=hC;var Lj={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function jj(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Dj(e,t,n){const r=jj(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Lj[r]}function vC(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function zj(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Uj=fC,Vj=pC;function Bj(e){const t=qj(e),n=g.forwardRef((r,i)=>{const{children:s,...o}=r,a=g.Children.toArray(s),l=a.find(Hj);if(l){const u=l.props.children,c=a.map(d=>d===l?g.Children.count(u)>1?g.Children.only(null):g.isValidElement(u)?u.props.children:null:d);return w.jsx(t,{...o,ref:i,children:g.isValidElement(u)?g.cloneElement(u,void 0,c):null})}return w.jsx(t,{...o,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}function qj(e){const t=g.forwardRef((n,r)=>{const{children:i,...s}=n;if(g.isValidElement(i)){const o=Kj(i),a=Gj(s,i.props);return i.type!==g.Fragment&&(a.ref=r?vi(r,o):o),g.cloneElement(i,a)}return g.Children.count(i)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Wj=Symbol("radix.slottable");function Hj(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Wj}function Gj(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const l=s(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function Kj(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var lv=["Enter"," "],Qj=["ArrowDown","PageUp","Home"],gC=["ArrowUp","PageDown","End"],Yj=[...Qj,...gC],Xj={ltr:[...lv,"ArrowRight"],rtl:[...lv,"ArrowLeft"]},Jj={ltr:["ArrowLeft"],rtl:["ArrowRight"]},kl="Menu",[ul,Zj,eD]=Kg(kl),[ls,mC]=os(kl,[eD,tC,dC]),Pd=tC(),yC=dC(),[tD,us]=ls(kl),[nD,Pl]=ls(kl),_C=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:s,modal:o=!0}=e,a=Pd(t),[l,u]=g.useState(null),c=g.useRef(!1),d=Ut(s),f=U1(i);return g.useEffect(()=>{const m=()=>{c.current=!0,document.addEventListener("pointerdown",_,{capture:!0,once:!0}),document.addEventListener("pointermove",_,{capture:!0,once:!0})},_=()=>c.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",_,{capture:!0}),document.removeEventListener("pointermove",_,{capture:!0})}},[]),w.jsx(Pj,{...a,children:w.jsx(tD,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:u,children:w.jsx(nD,{scope:t,onClose:g.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:c,dir:f,modal:o,children:r})})})};_C.displayName=kl;var rD="MenuAnchor",rm=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Pd(n);return w.jsx(Rj,{...i,...r,ref:t})});rm.displayName=rD;var im="MenuPortal",[iD,wC]=ls(im,{forceMount:void 0}),xC=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,s=us(im,t);return w.jsx(iD,{scope:t,forceMount:n,children:w.jsx(br,{present:n||s.open,children:w.jsx(wd,{asChild:!0,container:i,children:r})})})};xC.displayName=im;var un="MenuContent",[sD,sm]=ls(un),bC=g.forwardRef((e,t)=>{const n=wC(un,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,s=us(un,e.__scopeMenu),o=Pl(un,e.__scopeMenu);return w.jsx(ul.Provider,{scope:e.__scopeMenu,children:w.jsx(br,{present:r||s.open,children:w.jsx(ul.Slot,{scope:e.__scopeMenu,children:o.modal?w.jsx(oD,{...i,ref:t}):w.jsx(aD,{...i,ref:t})})})})}),oD=g.forwardRef((e,t)=>{const n=us(un,e.__scopeMenu),r=g.useRef(null),i=et(t,r);return g.useEffect(()=>{const s=r.current;if(s)return e1(s)},[]),w.jsx(om,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ee(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),aD=g.forwardRef((e,t)=>{const n=us(un,e.__scopeMenu);return w.jsx(om,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),lD=Bj("MenuContent.ScrollLock"),om=g.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,onDismiss:m,disableOutsideScroll:_,...p}=e,y=us(un,n),h=Pl(un,n),v=Pd(n),x=yC(n),b=Zj(n),[E,S]=g.useState(null),P=g.useRef(null),C=et(t,P,y.onContentChange),T=g.useRef(0),R=g.useRef(""),N=g.useRef(0),M=g.useRef(null),z=g.useRef("right"),F=g.useRef(0),W=_?Dg:g.Fragment,B=_?{as:lD,allowPinchZoom:!0}:void 0,Q=A=>{var Be,ye;const V=R.current+A,K=b().filter(Fe=>!Fe.disabled),te=document.activeElement,oe=(Be=K.find(Fe=>Fe.ref.current===te))==null?void 0:Be.textValue,de=K.map(Fe=>Fe.textValue),be=wD(de,V,oe),Pe=(ye=K.find(Fe=>Fe.textValue===be))==null?void 0:ye.ref.current;(function Fe(Tt){R.current=Tt,window.clearTimeout(T.current),Tt!==""&&(T.current=window.setTimeout(()=>Fe(""),1e3))})(V),Pe&&setTimeout(()=>Pe.focus())};g.useEffect(()=>()=>window.clearTimeout(T.current),[]),WS();const O=g.useCallback(A=>{var K,te;return z.current===((K=M.current)==null?void 0:K.side)&&bD(A,(te=M.current)==null?void 0:te.area)},[]);return w.jsx(sD,{scope:n,searchRef:R,onItemEnter:g.useCallback(A=>{O(A)&&A.preventDefault()},[O]),onItemLeave:g.useCallback(A=>{var V;O(A)||((V=P.current)==null||V.focus(),S(null))},[O]),onTriggerLeave:g.useCallback(A=>{O(A)&&A.preventDefault()},[O]),pointerGraceTimerRef:N,onPointerGraceIntentChange:g.useCallback(A=>{M.current=A},[]),children:w.jsx(W,{...B,children:w.jsx(jg,{asChild:!0,trapped:i,onMountAutoFocus:ee(s,A=>{var V;A.preventDefault(),(V=P.current)==null||V.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:w.jsx(_d,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,onDismiss:m,children:w.jsx(Uj,{asChild:!0,...x,dir:h.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:S,onEntryFocus:ee(l,A=>{h.isUsingKeyboardRef.current||A.preventDefault()}),preventScrollOnEntryFocus:!0,children:w.jsx(Tj,{role:"menu","aria-orientation":"vertical","data-state":jC(y.open),"data-radix-menu-content":"",dir:h.dir,...v,...p,ref:C,style:{outline:"none",...p.style},onKeyDown:ee(p.onKeyDown,A=>{const K=A.target.closest("[data-radix-menu-content]")===A.currentTarget,te=A.ctrlKey||A.altKey||A.metaKey,oe=A.key.length===1;K&&(A.key==="Tab"&&A.preventDefault(),!te&&oe&&Q(A.key));const de=P.current;if(A.target!==de||!Yj.includes(A.key))return;A.preventDefault();const Pe=b().filter(Be=>!Be.disabled).map(Be=>Be.ref.current);gC.includes(A.key)&&Pe.reverse(),yD(Pe)}),onBlur:ee(e.onBlur,A=>{A.currentTarget.contains(A.target)||(window.clearTimeout(T.current),R.current="")}),onPointerMove:ee(e.onPointerMove,cl(A=>{const V=A.target,K=F.current!==A.clientX;if(A.currentTarget.contains(V)&&K){const te=A.clientX>F.current?"right":"left";z.current=te,F.current=A.clientX}}))})})})})})})});bC.displayName=un;var uD="MenuGroup",am=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return w.jsx(ke.div,{role:"group",...r,ref:t})});am.displayName=uD;var cD="MenuLabel",EC=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return w.jsx(ke.div,{...r,ref:t})});EC.displayName=cD;var Wc="MenuItem",D0="menu.itemSelect",Rd=g.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,s=g.useRef(null),o=Pl(Wc,e.__scopeMenu),a=sm(Wc,e.__scopeMenu),l=et(t,s),u=g.useRef(!1),c=()=>{const d=s.current;if(!n&&d){const f=new CustomEvent(D0,{bubbles:!0,cancelable:!0});d.addEventListener(D0,m=>r==null?void 0:r(m),{once:!0}),Lg(d,f),f.defaultPrevented?u.current=!1:o.onClose()}};return w.jsx(SC,{...i,ref:l,disabled:n,onClick:ee(e.onClick,c),onPointerDown:d=>{var f;(f=e.onPointerDown)==null||f.call(e,d),u.current=!0},onPointerUp:ee(e.onPointerUp,d=>{var f;u.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:ee(e.onKeyDown,d=>{const f=a.searchRef.current!=="";n||f&&d.key===" "||lv.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Rd.displayName=Wc;var SC=g.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...s}=e,o=sm(Wc,n),a=yC(n),l=g.useRef(null),u=et(t,l),[c,d]=g.useState(!1),[f,m]=g.useState("");return g.useEffect(()=>{const _=l.current;_&&m((_.textContent??"").trim())},[s.children]),w.jsx(ul.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:w.jsx(Vj,{asChild:!0,...a,focusable:!r,children:w.jsx(ke.div,{role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:u,onPointerMove:ee(e.onPointerMove,cl(_=>{r?o.onItemLeave(_):(o.onItemEnter(_),_.defaultPrevented||_.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ee(e.onPointerLeave,cl(_=>o.onItemLeave(_))),onFocus:ee(e.onFocus,()=>d(!0)),onBlur:ee(e.onBlur,()=>d(!1))})})})}),dD="MenuCheckboxItem",CC=g.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return w.jsx(IC,{scope:e.__scopeMenu,checked:n,children:w.jsx(Rd,{role:"menuitemcheckbox","aria-checked":Hc(n)?"mixed":n,...i,ref:t,"data-state":um(n),onSelect:ee(i.onSelect,()=>r==null?void 0:r(Hc(n)?!0:!n),{checkForDefaultPrevented:!1})})})});CC.displayName=dD;var kC="MenuRadioGroup",[fD,hD]=ls(kC,{value:void 0,onValueChange:()=>{}}),PC=g.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,s=Ut(r);return w.jsx(fD,{scope:e.__scopeMenu,value:n,onValueChange:s,children:w.jsx(am,{...i,ref:t})})});PC.displayName=kC;var RC="MenuRadioItem",TC=g.forwardRef((e,t)=>{const{value:n,...r}=e,i=hD(RC,e.__scopeMenu),s=n===i.value;return w.jsx(IC,{scope:e.__scopeMenu,checked:s,children:w.jsx(Rd,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":um(s),onSelect:ee(r.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,n)},{checkForDefaultPrevented:!1})})})});TC.displayName=RC;var lm="MenuItemIndicator",[IC,pD]=ls(lm,{checked:!1}),OC=g.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,s=pD(lm,n);return w.jsx(br,{present:r||Hc(s.checked)||s.checked===!0,children:w.jsx(ke.span,{...i,ref:t,"data-state":um(s.checked)})})});OC.displayName=lm;var vD="MenuSeparator",MC=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return w.jsx(ke.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});MC.displayName=vD;var gD="MenuArrow",AC=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Pd(n);return w.jsx(Ij,{...i,...r,ref:t})});AC.displayName=gD;var mD="MenuSub",[yz,NC]=ls(mD),pa="MenuSubTrigger",$C=g.forwardRef((e,t)=>{const n=us(pa,e.__scopeMenu),r=Pl(pa,e.__scopeMenu),i=NC(pa,e.__scopeMenu),s=sm(pa,e.__scopeMenu),o=g.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=s,u={__scopeMenu:e.__scopeMenu},c=g.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return g.useEffect(()=>c,[c]),g.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),l(null)}},[a,l]),w.jsx(rm,{asChild:!0,...u,children:w.jsx(SC,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":jC(n.open),...e,ref:vi(t,i.onTriggerChange),onClick:d=>{var f;(f=e.onClick)==null||f.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ee(e.onPointerMove,cl(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(s.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),c()},100))})),onPointerLeave:ee(e.onPointerLeave,cl(d=>{var m,_;c();const f=(m=n.content)==null?void 0:m.getBoundingClientRect();if(f){const p=(_=n.content)==null?void 0:_.dataset.side,y=p==="right",h=y?-5:5,v=f[y?"left":"right"],x=f[y?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+h,y:d.clientY},{x:v,y:f.top},{x,y:f.top},{x,y:f.bottom},{x:v,y:f.bottom}],side:p}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:ee(e.onKeyDown,d=>{var m;const f=s.searchRef.current!=="";e.disabled||f&&d.key===" "||Xj[r.dir].includes(d.key)&&(n.onOpenChange(!0),(m=n.content)==null||m.focus(),d.preventDefault())})})})});$C.displayName=pa;var FC="MenuSubContent",LC=g.forwardRef((e,t)=>{const n=wC(un,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,s=us(un,e.__scopeMenu),o=Pl(un,e.__scopeMenu),a=NC(FC,e.__scopeMenu),l=g.useRef(null),u=et(t,l);return w.jsx(ul.Provider,{scope:e.__scopeMenu,children:w.jsx(br,{present:r||s.open,children:w.jsx(ul.Slot,{scope:e.__scopeMenu,children:w.jsx(om,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:u,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:c=>{var d;o.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),c.preventDefault()},onCloseAutoFocus:c=>c.preventDefault(),onFocusOutside:ee(e.onFocusOutside,c=>{c.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:ee(e.onEscapeKeyDown,c=>{o.onClose(),c.preventDefault()}),onKeyDown:ee(e.onKeyDown,c=>{var m;const d=c.currentTarget.contains(c.target),f=Jj[o.dir].includes(c.key);d&&f&&(s.onOpenChange(!1),(m=a.trigger)==null||m.focus(),c.preventDefault())})})})})})});LC.displayName=FC;function jC(e){return e?"open":"closed"}function Hc(e){return e==="indeterminate"}function um(e){return Hc(e)?"indeterminate":e?"checked":"unchecked"}function yD(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function _D(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function wD(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let o=_D(e,Math.max(s,0));i.length===1&&(o=o.filter(u=>u!==n));const l=o.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function xD(e,t){const{x:n,y:r}=e;let i=!1;for(let s=0,o=t.length-1;sr!=f>r&&n<(d-u)*(r-c)/(f-c)+u&&(i=!i)}return i}function bD(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return xD(n,t)}function cl(e){return t=>t.pointerType==="mouse"?e(t):void 0}var ED=_C,SD=rm,CD=xC,kD=bC,PD=am,RD=EC,TD=Rd,ID=CC,OD=PC,MD=TC,AD=OC,ND=MC,$D=AC,FD=$C,LD=LC,Td="DropdownMenu",[jD]=os(Td,[mC]),Rt=mC(),[DD,DC]=jD(Td),zC=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:s,onOpenChange:o,modal:a=!0}=e,l=Rt(t),u=g.useRef(null),[c,d]=yd({prop:i,defaultProp:s??!1,onChange:o,caller:Td});return w.jsx(DD,{scope:t,triggerId:Ys(),triggerRef:u,contentId:Ys(),open:c,onOpenChange:d,onOpenToggle:g.useCallback(()=>d(f=>!f),[d]),modal:a,children:w.jsx(ED,{...l,open:c,onOpenChange:d,dir:r,modal:a,children:n})})};zC.displayName=Td;var UC="DropdownMenuTrigger",VC=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,s=DC(UC,n),o=Rt(n);return w.jsx(SD,{asChild:!0,...o,children:w.jsx(ke.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:vi(t,s.triggerRef),onPointerDown:ee(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:ee(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});VC.displayName=UC;var zD="DropdownMenuPortal",BC=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Rt(t);return w.jsx(CD,{...r,...n})};BC.displayName=zD;var qC="DropdownMenuContent",WC=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=DC(qC,n),s=Rt(n),o=g.useRef(!1);return w.jsx(kD,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...r,ref:t,onCloseAutoFocus:ee(e.onCloseAutoFocus,a=>{var l;o.current||(l=i.triggerRef.current)==null||l.focus(),o.current=!1,a.preventDefault()}),onInteractOutside:ee(e.onInteractOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,c=l.button===2||u;(!i.modal||c)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});WC.displayName=qC;var UD="DropdownMenuGroup",VD=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Rt(n);return w.jsx(PD,{...i,...r,ref:t})});VD.displayName=UD;var BD="DropdownMenuLabel",HC=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Rt(n);return w.jsx(RD,{...i,...r,ref:t})});HC.displayName=BD;var qD="DropdownMenuItem",GC=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Rt(n);return w.jsx(TD,{...i,...r,ref:t})});GC.displayName=qD;var WD="DropdownMenuCheckboxItem",KC=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Rt(n);return w.jsx(ID,{...i,...r,ref:t})});KC.displayName=WD;var HD="DropdownMenuRadioGroup",GD=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Rt(n);return w.jsx(OD,{...i,...r,ref:t})});GD.displayName=HD;var KD="DropdownMenuRadioItem",QC=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Rt(n);return w.jsx(MD,{...i,...r,ref:t})});QC.displayName=KD;var QD="DropdownMenuItemIndicator",YC=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Rt(n);return w.jsx(AD,{...i,...r,ref:t})});YC.displayName=QD;var YD="DropdownMenuSeparator",XC=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Rt(n);return w.jsx(ND,{...i,...r,ref:t})});XC.displayName=YD;var XD="DropdownMenuArrow",JD=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Rt(n);return w.jsx($D,{...i,...r,ref:t})});JD.displayName=XD;var ZD="DropdownMenuSubTrigger",JC=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Rt(n);return w.jsx(FD,{...i,...r,ref:t})});JC.displayName=ZD;var e2="DropdownMenuSubContent",ZC=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Rt(n);return w.jsx(LD,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});ZC.displayName=e2;var t2=zC,n2=VC,r2=BC,ek=WC,tk=HC,nk=GC,rk=KC,ik=QC,sk=YC,ok=XC,ak=JC,lk=ZC;/** * @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 s2=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ck=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** + */const i2=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),uk=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** * @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. - */var o2={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + */var s2={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @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 a2=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:o,...a},l)=>g.createElement("svg",{ref:l,...o2,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:ck("lucide",i),...a},[...o.map(([u,c])=>g.createElement(u,c)),...Array.isArray(s)?s:[s]]));/** + */const o2=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:o,...a},l)=>g.createElement("svg",{ref:l,...s2,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:uk("lucide",i),...a},[...o.map(([u,c])=>g.createElement(u,c)),...Array.isArray(s)?s:[s]]));/** * @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 Id=(e,t)=>{const n=g.forwardRef(({className:r,...i},s)=>g.createElement(a2,{ref:s,iconNode:t,className:ck(`lucide-${s2(e)}`,r),...i}));return n.displayName=`${e}`,n};/** + */const Id=(e,t)=>{const n=g.forwardRef(({className:r,...i},s)=>g.createElement(o2,{ref:s,iconNode:t,className:uk(`lucide-${i2(e)}`,r),...i}));return n.displayName=`${e}`,n};/** * @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 l2=Id("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + */const a2=Id("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @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 u2=Id("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + */const l2=Id("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @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 c2=Id("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** + */const u2=Id("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** * @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 d2=Id("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),f2=n2,h2=r2,p2=g.forwardRef(({className:e,inset:t,children:n,...r},i)=>w.jsxs(lk,{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(u2,{className:"ml-auto h-4 w-4"})]}));p2.displayName=lk.displayName;const v2=g.forwardRef(({className:e,...t},n)=>w.jsx(uk,{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}));v2.displayName=uk.displayName;const dk=g.forwardRef(({className:e,sideOffset:t=4,...n},r)=>w.jsx(i2,{children:w.jsx(tk,{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})}));dk.displayName=tk.displayName;const er=g.forwardRef(({className:e,inset:t,...n},r)=>w.jsx(rk,{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=rk.displayName;const g2=g.forwardRef(({className:e,children:t,checked:n,...r},i)=>w.jsxs(ik,{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(ok,{children:w.jsx(l2,{className:"h-4 w-4"})})}),t]}));g2.displayName=ik.displayName;const m2=g.forwardRef(({className:e,children:t,...n},r)=>w.jsxs(sk,{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(ok,{children:w.jsx(c2,{className:"h-2 w-2 fill-current"})})}),t]}));m2.displayName=sk.displayName;const fk=g.forwardRef(({className:e,inset:t,...n},r)=>w.jsx(nk,{ref:r,className:ct("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));fk.displayName=nk.displayName;const uv=g.forwardRef(({className:e,...t},n)=>w.jsx(ak,{ref:n,className:ct("-mx-1 my-1 h-px bg-muted",e),...t}));uv.displayName=ak.displayName;function y2(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 _2=({user:e,onLogout:t})=>w.jsxs(f2,{children:[w.jsx(h2,{asChild:!0,children:w.jsx("button",{type:"button",className:"user-avatar-btn","aria-label":`Account menu for ${e.username}`,children:w.jsxs(D1,{className:"h-8 w-8",children:[e.avatar_url&&w.jsx(z1,{src:e.avatar_url,alt:e.username}),w.jsx(U1,{className:"text-xs",children:y2(e)})]})})}),w.jsxs(dk,{align:"end",className:"w-56",children:[w.jsxs(fk,{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"})]})]}),w2=!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 _z(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 x2{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 b2(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 hk(e){try{return await e()}catch(t){throw b2(t),t}}const cm=new x2(`${Bg()}/api/v1`),E2=(e,t)=>cm.fetch(e,t),wz=(e,t)=>hk(()=>cm.fetchOk(e,t)),cv=(e,t)=>hk(()=>cm.request(e,t));async function xz(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 E2("/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"})}},S2={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"],xTrending:["x-trending-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"]}},bz=10*60*1e3,hu={me:["auth","me"]},Ez={preferences:["account","preferences"],bookmarkIds:["my-bookmark-ids"]},Sz={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"]},Cz={all:["evaluations"],byPaper:e=>["evaluations","paper",e],byPaperAll:["evaluations","paper"],byDatasetAll:["dataset-evals"],byDataset:e=>["dataset-evals",e]},kz={pendingEdits:["pendingPaperEdits"]},Pz={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"]},Rz={follows:e=>["research-follows",e],topic:e=>["research-topic",e],email:e=>["research-email",e],feed:e=>[...S2.feeds.following,e]},dm=q.createContext(null),U0="pwc:auth-stale",C2=({children:e})=>{const t=zS(),n=cN({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 pk(){const e=q.useContext(dm);if(!e)throw new Error("useAuth must be used inside an ");return e}function Tz(){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",k2="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}],P2=()=>{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)},R2=()=>{const[e,t]=q.useState(!1);return q.useEffect(()=>{t(P2())},[]),w.jsx("kbd",{children:e?"⌘K":"Ctrl K"})},T2=({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}=pk(),c=hn(),d=c.pathname.startsWith("/pdf/"),f=`${c.pathname}${c.search}`||"/",m=$o(),_=al()?{to:"/chat",label:"Chat",end:!1,badge:"New"}:nF()?{to:"/chat",label:"Chat",end:!1,badge:"New",href:tF}: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(W$,{open:t,onOpenChange:n,children:[w.jsxs("header",{className:"app-header",children:[w.jsxs("div",{className:"app-header-inner",children:[w.jsxs(ms,{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(ms,{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(R2,{})]}),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(ms,{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(_2,{user:l,onLogout:u}):w.jsx(y1,{returnTo:f}),w.jsx(H$,{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:k2,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(G$,{children:w.jsx(K$,{className:"mobile-nav-drawer",children:w.jsxs(Q$,{className:"mobile-nav-panel","aria-describedby":void 0,children:[w.jsx(Y$,{className:"sr-only",children:"Navigation menu"}),w.jsx(X$,{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(ms,{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(ms,{to:"/saved",className:"mobile-nav-link",onClick:a,children:"Saved papers"}),!m&&(l==null?void 0:l.is_admin)&&w.jsx(ms,{to:"/admin-dashboard",className:"mobile-nav-link",onClick:a,children:"Admin dashboard"})]})})})]})},I2=()=>{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"})]})})},O2=1,M2=1e6;let nh=0;function A2(){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})},M2);rh.set(e,t)},N2=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,O2)};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=N2(ju,e),Lu.forEach(t=>{t(ju)})}function $2({...e}){const t=A2(),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 F2(){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:$2,dismiss:n=>Ia({type:"DISMISS_TOAST",toastId:n})}}var L2=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"}),j2="VisuallyHidden",fm=g.forwardRef((e,t)=>w.jsx(ke.span,{...e,ref:t,style:{...L2,...e.style}}));fm.displayName=j2;var hm="ToastProvider",[pm,D2,z2]=Kg("Toast"),[vk]=ss("Toast",[z2]),[U2,Md]=vk(hm),gk=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(U2,{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})})};gk.displayName=hm;var mk="ToastViewport",V2=["F8"],dv="toast.viewportPause",fv="toast.viewportResume",yk=g.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=V2,label:i="Notifications ({hotkey})",...s}=e,o=Md(mk,n),a=D2(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,...t3(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(AN,{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)}})]})});yk.displayName=mk;var _k="ToastFocusProxy",hv=g.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,s=Md(_k,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=_k;var Rl="Toast",B2="toast.swipeStart",q2="toast.swipeMove",W2="toast.swipeCancel",H2="toast.swipeEnd",wk=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(Q2,{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)})})})});wk.displayName=Rl;var[G2,K2]=vk(Rl,{onClose(){}}),Q2=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?Pk(y):null,[y]);return p.viewport?w.jsxs(w.Fragment,{children:[z&&w.jsx(Y2,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:z}),w.jsx(G2,{scope:n,onClose:N,children:xl.createPortal(w.jsx(pm.ItemSlot,{scope:n,children:w.jsx(MN,{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(q2,d,de,{discrete:!1})):H0(oe,p.swipeDirection,te)?(b.current=oe,pu(B2,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(H2,m,O,{discrete:!0}):pu(W2,f,O,{discrete:!0}),Q.addEventListener("click",A=>A.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),Y2=e=>{const{__scopeToast:t,children:n,...r}=e,i=Md(Rl,t),[s,o]=g.useState(!1),[a,l]=g.useState(!1);return Z2(()=>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]})})})},X2="ToastTitle",xk=g.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return w.jsx(ke.div,{...r,ref:t})});xk.displayName=X2;var J2="ToastDescription",bk=g.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return w.jsx(ke.div,{...r,ref:t})});bk.displayName=J2;var Ek="ToastAction",Sk=g.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?w.jsx(kk,{altText:n,asChild:!0,children:w.jsx(vm,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Ek}\`. Expected non-empty \`string\`.`),null)});Sk.displayName=Ek;var Ck="ToastClose",vm=g.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,i=K2(Ck,n);return w.jsx(kk,{asChild:!0,children:w.jsx(ke.button,{type:"button",...r,ref:t,onClick:ee(e.onClick,i.onClose)})})});vm.displayName=Ck;var kk=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 Pk(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),e3(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(...Pk(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 Z2(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 e3(e){return e.nodeType===e.ELEMENT_NODE}function t3(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 n3=gk,Rk=yk,Tk=wk,Ik=xk,Ok=bk,Mk=Sk,Ak=vm;const G0=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,K0=A1,r3=(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)},i3=n3,Nk=g.forwardRef(({className:e,...t},n)=>w.jsx(Rk,{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}));Nk.displayName=Rk.displayName;const s3=r3("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"}}),$k=g.forwardRef(({className:e,variant:t,...n},r)=>w.jsx(Tk,{ref:r,className:ct(s3({variant:t}),e),...n}));$k.displayName=Tk.displayName;const o3=g.forwardRef(({className:e,...t},n)=>w.jsx(Mk,{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}));o3.displayName=Mk.displayName;const Fk=g.forwardRef(({className:e,...t},n)=>w.jsx(Ak,{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(d2,{className:"h-4 w-4"})}));Fk.displayName=Ak.displayName;const Lk=g.forwardRef(({className:e,...t},n)=>w.jsx(Ik,{ref:n,className:ct("text-sm font-semibold",e),...t}));Lk.displayName=Ik.displayName;const jk=g.forwardRef(({className:e,...t},n)=>w.jsx(Ok,{ref:n,className:ct("text-sm opacity-90",e),...t}));jk.displayName=Ok.displayName;function a3(){const{toasts:e}=F2();return w.jsxs(i3,{children:[e.map(function({id:t,title:n,description:r,action:i,...s}){return w.jsxs($k,{...s,children:[w.jsxs("div",{className:"grid gap-1",children:[n&&w.jsx(Lk,{children:n}),r&&w.jsx(jk,{children:r})]}),i,w.jsx(Fk,{})]},t)}),w.jsx(Nk,{})]})}function l3(){const{pathname:e,hash:t}=hn();g.useLayoutEffect(()=>{t||window.scrollTo({top:0,left:0,behavior:"instant"})},[e,t])}const Dk=iF(),u3=Dk?xA:wA;if(!Dk&&typeof window<"u"){const e=window.location.hash;e.startsWith("#/")&&!e.startsWith("#//")&&window.history.replaceState(null,"",e.slice(1))}const c3=q.lazy(()=>ae(()=>import("./AuthorizePaperEditView-Cq1DcUql.js"),__vite__mapDeps([0,1,2,3]))),d3=q.lazy(()=>ae(()=>import("./FollowingView-DiD1Nhph.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]))),Q0=q.lazy(()=>ae(()=>import("./FeedView-BOUw6uS8.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]))),f3=q.lazy(()=>ae(()=>import("./ChatView-BQ45-L03.js"),__vite__mapDeps([34,35,29,30,21,22,36,37,8,38,39,40,41,42,43,1,44,45,46,47,48,11,49,50,15,16,51,52,27,28,53,54]))),h3=q.lazy(()=>ae(()=>import("./SharedChatView-BYQRXyDz.js"),__vite__mapDeps([55,35,29,30,21,22,36,37,8,38,39,40,41,42,43,1,44,45,46,47,48,11,49,50,15,16,51,52]))),p3=q.lazy(()=>ae(()=>import("./PapersListView-BxsyYKkb.js"),__vite__mapDeps([56,17,18,10,19,13,14,15,16,20,21,22,23,24,25,26,8,31,32,57,33,58,59]))),v3=q.lazy(()=>ae(()=>import("./PaperDetailView-BRTPUDdV.js"),__vite__mapDeps([60,1,19,17,18,10,20,61,22,36,23,62,21,63,31,32,64,65,66,25,33,2,7,28,45,67,68,69,70,24,49,71,37,8,72,73,74,75,11,76,77,38,78,79,41,42,26,80,81,15,16,82]))),g3=q.lazy(()=>ae(()=>import("./PaperReaderView-C5kcjwh1.js"),__vite__mapDeps([83,35,29,30,21,22,36,37,8,38,39,40,41,42,43,1,44,45,46,47,48,11,49,50,15,16,51,52,84,63,23,31,32,34,27,28,53,54]))),m3=q.lazy(()=>ae(()=>import("./TagsIndexView-G-b0gdzh.js"),__vite__mapDeps([85,8,18,10,86,49,87,53,88,89,44,75,90,39,91,77,6,33,92,25,93,72,2,69,73,70,24,7,71,1,74,11,94,95]))),y3=q.lazy(()=>ae(()=>import("./TagBrowseView-C77s9kzE.js"),__vite__mapDeps([96,97,9,1,11,17,18,10,13,14,15,16,19,20,21,22,23,24,25,26,12,98,84,40,41,42,43,36,52,8,58,59,65,66,86,31,32,33,99,90,38]))),_3=q.lazy(()=>ae(()=>import("./MethodsIndexView-Bdiwox76.js"),__vite__mapDeps([100,8,95,86,33,92,25,93,72,2,69,73,70,24,7,49,71,1,74,11,94,88]))),w3=q.lazy(()=>ae(()=>import("./FrameworksIndexView-DvK-KAg3.js"),__vite__mapDeps([101,19,8,18,59]))),x3=q.lazy(()=>ae(()=>import("./TrendsView-CKKi1VRU.js"),__vite__mapDeps([102,33,25]))),b3=q.lazy(()=>ae(()=>import("./ConferencesIndexView-CbRa2EOU.js"),__vite__mapDeps([103,8,104,33,92,25,93,72,2,69,73,70,24,7,49,71,1,74,11]))),E3=q.lazy(()=>ae(()=>import("./AiDeadlinesView-dLGfFkt7.js"),__vite__mapDeps([105,8,106,78,25,33,23,7,104]))),S3=q.lazy(()=>ae(()=>import("./ConferenceDetailView-BSPNE-5n.js"),__vite__mapDeps([107,92,25,84,40,41,42,43,36,21,22,1,52,8,58,95,18,108,104,10,33,23,99]))),C3=q.lazy(()=>ae(()=>import("./ConferenceTaskView-CDKsZawH.js"),__vite__mapDeps([109,13,14,15,16,17,18,10,19,20,21,22,23,24,25,26,84,40,41,42,43,36,1,52,8,58,108,31,32,33,99]))),k3=q.lazy(()=>ae(()=>import("./OrganizationsIndexView-DSR3qkLX.js"),__vite__mapDeps([110,33,8,111]))),P3=q.lazy(()=>ae(()=>import("./OrganizationDetailView-DyFV9-gr.js"),__vite__mapDeps([112,97,9,1,11,84,40,41,42,43,36,21,22,52,113,25,8,13,14,15,16,17,18,10,19,20,23,24,26,33,70,2,7,49,71,31,32,58,81,99]))),R3=q.lazy(()=>ae(()=>import("./OrganizationDetailView-DyFV9-gr.js"),__vite__mapDeps([112,97,9,1,11,84,40,41,42,43,36,21,22,52,113,25,8,13,14,15,16,17,18,10,19,20,23,24,26,33,70,2,7,49,71,31,32,58,81,99]))),T3=q.lazy(()=>ae(()=>import("./AuthorDetailView-D6_HYb4K.js"),__vite__mapDeps([114,15,16,13,14,17,18,10,19,20,21,22,23,24,25,26,97,9,1,11,33,31,32,58,99]))),I3=q.lazy(()=>ae(()=>import("./MethodDetailView-Ctz2zwcp.js"),__vite__mapDeps([115,97,9,1,11,17,18,10,13,14,15,16,19,20,21,22,23,24,25,26,84,40,41,42,43,36,52,8,58,86,31,32,33,99]))),O3=q.lazy(()=>ae(()=>import("./BenchmarkDetailView-DzybbikG.js"),__vite__mapDeps([116,97,9,1,11,8,61,22,36,23,62,65,66,20,106,78,19,25,33,98,86,58,99,117]))),M3=q.lazy(()=>ae(()=>import("./SavedPapersView-CxMmtsxn.js"),__vite__mapDeps([118,14,15,16,17,18,10,19,20,21,22,23,25,33,66,80]))),A3=q.lazy(()=>ae(()=>import("./SettingsView-ZclHRLlr.js"),__vite__mapDeps([119,1,9,106,78,6,12,90,30,64,54,65,66,48,89]))),N3=q.lazy(()=>ae(()=>import("./PrivacyView-B6HbRy37.js"),__vite__mapDeps([120,64]))),$3=q.lazy(()=>ae(()=>import("./ApiDocsView-_-YW6hmY.js"),__vite__mapDeps([121,64,41,122]))),F3=q.lazy(()=>ae(()=>import("./McpView-flM-siZf.js"),__vite__mapDeps([123,64,46,38,48,45,124]))),L3=q.lazy(()=>ae(()=>import("./SubmitView-CzGulDZf.js"),__vite__mapDeps([125,1,33,2,69,73,21,22,68]))),j3=q.lazy(()=>ae(()=>import("./CronDashboard-ChRfGclc.js"),__vite__mapDeps([126,1,127,128,76,2,50,75,88,91,39,87,48,129,71,130,79,32,3,8,30]))),D3=q.lazy(()=>ae(()=>import("./AutonomousOperations-C9LX_q_o.js"),__vite__mapDeps([131,1,127,128,76,2,69,91,47]))),z3=q.lazy(()=>ae(()=>import("./SubmissionsDashboard-BgxP46NN.js"),__vite__mapDeps([132,67,68,1,32,8,23,74,21,22,129,71,130,133]))),U3=q.lazy(()=>ae(()=>import("./UserProfileView-CUBmzN74.js"),__vite__mapDeps([134,113,25,8]))),V3=q.lazy(()=>ae(()=>import("./RateLimitsView-RwXx3jbv.js"),__vite__mapDeps([135,66]))),B3=q.lazy(()=>ae(()=>import("./AstraForRoboticsView-C6GRjjgP.js"),__vite__mapDeps([136,13,14,15,16,17,18,10,19,20,21,22,23,24,25,26,33,31,32,64,137]))),sh=q.lazy(()=>ae(()=>import("./NotFound-B3EehO4t.js"),[])),q3=q.lazy(()=>ae(()=>import("./SearchOverlay-BCyx8pUn.js"),__vite__mapDeps([138,20,8,21,22,57,18,10]))),W3=q.lazy(()=>ae(()=>import("./StagingAccessRequestView-BDq5Q7CO.js"),__vite__mapDeps([139,130]))),zk=()=>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}})]})]}),H3=new XA({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),G3=()=>{const{arxivId:e}=xS();return w.jsx(Ro,{to:e?`/paper/${e}`:"/papers",replace:!0})},K3=()=>{const{taskSlug:e}=xS();return w.jsx(Ro,{to:e?`/tasks/${e}`:"/tasks",replace:!0})},Q3=({element:e})=>$o()?w.jsx(Ro,{to:"/",replace:!0}):w.jsx(w.Fragment,{children:e}),pv=({element:e})=>{const{user:t,isLoading:n}=pk(),r=hn();return $o()?w.jsx(Ro,{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(y1,{returnTo:`${r.pathname}${r.search}`})]})})},Y3=()=>{const e=eF(),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(j3,{})})},Y0=({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(T2,{onOpenSearch:()=>n(!0)}),s=w.jsx(fS,{resetKey:r,children:w.jsx(q.Suspense,{fallback:w.jsx(zk,{}),children:w.jsx(cA,{})})}),o=t&&w.jsx(q.Suspense,{fallback:null,children:w.jsx(q3,{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(I2,{}),o]})},X3=()=>(l3(),q.useLayoutEffect(()=>{var e;(e=document.getElementById("initial-discovery-footer"))==null||e.remove()},[]),w.jsxs(dA,{children:[w.jsx(re,{path:"/request-access",element:w.jsx(q.Suspense,{fallback:w.jsx(zk,{}),children:w.jsx(W3,{})})}),w.jsx(re,{element:w.jsx(Y0,{reader:!0}),children:w.jsx(re,{path:"/pdf/:paperId",element:rF()?w.jsx(g3,{}):w.jsx(sh,{})})}),w.jsxs(re,{element:w.jsx(Y0,{}),children:[w.jsx(re,{path:"/",element:w.jsx(Q0,{})}),w.jsx(re,{path:"/following",element:w.jsx(d3,{})}),w.jsx(re,{path:"/x-trending",element:w.jsx(Q0,{xTrending:!0})}),w.jsx(re,{path:"/chat/:sessionId?",element:al()?w.jsx(f3,{}):w.jsx(Ro,{to:"/",replace:!0})}),w.jsx(re,{path:"/share/:shareId",element:al()?w.jsx(h3,{}):w.jsx(sh,{})}),w.jsx(re,{path:"/papers",element:w.jsx(p3,{})}),w.jsx(re,{path:"/papers/:arxivId",element:w.jsx(G3,{})}),w.jsx(re,{path:"/paper/:arxivId",element:w.jsx(v3,{})}),w.jsx(re,{path:"/tasks",element:w.jsx(m3,{})}),w.jsx(re,{path:"/tasks/:taskSlug",element:w.jsx(y3,{})}),w.jsx(re,{path:"/task/:taskSlug",element:w.jsx(K3,{})}),w.jsx(re,{path:"/methods",element:w.jsx(_3,{})}),w.jsx(re,{path:"/methods/:methodSlug",element:w.jsx(I3,{})}),w.jsx(re,{path:"/frameworks",element:w.jsx(w3,{})}),w.jsx(re,{path:"/trends",element:w.jsx(x3,{})}),w.jsx(re,{path:"/conferences",element:w.jsx(b3,{})}),w.jsx(re,{path:"/ai-deadlines",element:w.jsx(E3,{})}),w.jsx(re,{path:"/conferences/:confSlug",element:w.jsx(S3,{})}),w.jsx(re,{path:"/conferences/:confSlug/:taskSlug",element:w.jsx(C3,{})}),w.jsx(re,{path:"/organizations",element:w.jsx(k3,{})}),w.jsx(re,{path:"/orgs/:orgSlug",element:w.jsx(P3,{})}),w.jsx(re,{path:"/orgs/:orgSlug/:taskSlug",element:w.jsx(R3,{})}),w.jsx(re,{path:"/authors/:authorId",element:w.jsx(T3,{})}),w.jsx(re,{path:"/benchmark/:datasetSlug",element:w.jsx(O3,{})}),w.jsx(re,{path:"/authorize-paper-edit/:authorizationId",element:w.jsx(c3,{})}),w.jsx(re,{path:"/submit",element:w.jsx(L3,{})}),w.jsx(re,{path:"/saved",element:w.jsx(Q3,{element:w.jsx(M3,{})})}),w.jsx(re,{path:"/settings",element:w.jsx(A3,{})}),w.jsx(re,{path:"/privacy",element:w.jsx(N3,{})}),w.jsx(re,{path:"/docs/api",element:w.jsx($3,{})}),w.jsx(re,{path:"/mcp",element:w.jsx(F3,{})}),w.jsx(re,{path:"/admin-dashboard",element:w.jsx(Y3,{})}),w.jsx(re,{path:"/autonomous-operations",element:w.jsx(pv,{element:w.jsx(D3,{})})}),w.jsx(re,{path:"/cron-dashboard",element:w.jsx(Ro,{to:"/admin-dashboard",replace:!0})}),w.jsx(re,{path:"/submissions",element:w.jsx(pv,{element:w.jsx(z3,{})})}),w.jsx(re,{path:"/rate-limits",element:w.jsx(V3,{})}),w.jsx(re,{path:"/astra-for-robotics",element:w.jsx(B3,{})}),w.jsx(re,{path:"/:username",element:w.jsx(U3,{})}),w.jsx(re,{path:"*",element:w.jsx(sh,{})})]})]})),J3=()=>w.jsx(JA,{client:H3,children:w.jsxs(C2,{children:[w.jsx(u3,{children:w.jsx(X3,{})}),w.jsx(a3,{}),!1]})});yM();const Z3=w.jsx(yT,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,storageKey:"pwc-theme",children:w.jsx(fS,{children:w.jsx(J3,{})})}),ez=wb(document.getElementById("root"));ez.render(w.jsx(q.StrictMode,{children:Z3}));export{h2 as $,Od as A,yd as B,l2 as C,et as D,ee as E,xj as F,ss as G,y1 as H,ct as I,Pz as J,dz as K,bn as L,mz as M,V1 as N,Bj as O,br as P,fC as Q,Vj as R,c2 as S,bz as T,o3 as U,q as V,Ez as W,d2 as X,rF as Y,cz as Z,f2 as _,pk as a,oz as a$,dk as a0,er as a1,fz as a2,uz as a3,aw as a4,J$ as a5,u2 as a6,ae as a7,A1 as a8,xl as a9,pz as aA,kz as aB,D1 as aC,z1 as aD,U1 as aE,El as aF,at as aG,Up as aH,TS as aI,qA as aJ,ZA as aK,nN as aL,oN as aM,rN as aN,iN as aO,At as aP,lN as aQ,l0 as aR,sN as aS,il as aT,KA as aU,OS as aV,xz as aW,t1 as aX,Dg as aY,HS as aZ,jg as a_,$g as aa,b2 as ab,cv as ac,w1 as ad,r3 as ae,Qs as af,W$ as ag,G$ as ah,K$ as ai,Q$ as aj,vi as ak,X$ as al,Y$ as am,lz as an,Ro as ao,Rj as ap,Tj as aq,nC as ar,wd as as,_d as at,Ij as au,Oj as av,rz as aw,nz as ax,E2 as ay,wz as az,cN as b,sz as b0,uN as b1,qg as b2,z0 as b3,hn as c,g as d,Mg as e,Tz as f,iz as g,Z$ as h,zS as i,w as j,$o as k,al as l,nF as m,tF as n,Sz as o,S2 as p,hz as q,Rz as r,Id as s,Cz as t,xS as u,vz as v,gz as w,F2 as x,_z 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 _z(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),wz=(e,t)=>fk(()=>cm.fetchOk(e,t)),cv=(e,t)=>fk(()=>cm.request(e,t));async function xz(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"]}},bz=10*60*1e3,hu={me:["auth","me"]},Ez={preferences:["account","preferences"],bookmarkIds:["my-bookmark-ids"]},Sz={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"]},Cz={all:["evaluations"],byPaper:e=>["evaluations","paper",e],byPaperAll:["evaluations","paper"],byDatasetAll:["dataset-evals"],byDataset:e=>["dataset-evals",e]},kz={pendingEdits:["pendingPaperEdits"]},Pz={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"]},Rz={follows:e=>["research-follows",e],topic:e=>["research-topic",e],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 Tz(){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-C_CCc6DX.js"),__vite__mapDeps([0,1,2,3]))),c3=q.lazy(()=>ae(()=>import("./FollowingView-yJNNUjAJ.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("./FeedView-7yx8iXq9.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]))),f3=q.lazy(()=>ae(()=>import("./ChatView-DeFesjnR.js"),__vite__mapDeps([34,35,29,30,21,22,36,37,8,38,39,40,41,42,43,1,44,45,46,47,48,11,49,50,15,16,51,52,27,28,53,54]))),h3=q.lazy(()=>ae(()=>import("./SharedChatView-CdO9rnWF.js"),__vite__mapDeps([55,35,29,30,21,22,36,37,8,38,39,40,41,42,43,1,44,45,46,47,48,11,49,50,15,16,51,52]))),p3=q.lazy(()=>ae(()=>import("./PapersListView-gsVdSCeE.js"),__vite__mapDeps([56,17,18,10,19,13,14,15,16,20,21,22,23,24,25,26,8,31,32,57,33,58,59]))),v3=q.lazy(()=>ae(()=>import("./PaperDetailView-DUyDgl84.js"),__vite__mapDeps([60,1,19,17,18,10,20,61,22,36,23,62,21,63,31,32,64,65,66,25,33,2,7,28,45,67,68,69,70,24,49,71,37,8,72,73,74,75,11,76,77,38,78,79,41,42,26,80,81,15,16,82]))),g3=q.lazy(()=>ae(()=>import("./PaperReaderView-D5fESpSH.js"),__vite__mapDeps([83,35,29,30,21,22,36,37,8,38,39,40,41,42,43,1,44,45,46,47,48,11,49,50,15,16,51,52,84,63,23,31,32,34,27,28,53,54]))),m3=q.lazy(()=>ae(()=>import("./TagsIndexView-gSGXUknL.js"),__vite__mapDeps([85,8,18,10,86,49,87,53,88,89,44,75,90,39,91,77,6,33,92,25,93,72,2,69,73,70,24,7,71,1,74,11,94,95]))),y3=q.lazy(()=>ae(()=>import("./TagBrowseView-MtjLHjMN.js"),__vite__mapDeps([96,97,9,1,11,17,18,10,13,14,15,16,19,20,21,22,23,24,25,26,12,98,84,40,41,42,43,36,52,8,58,59,65,66,86,31,32,33,99,90,38]))),_3=q.lazy(()=>ae(()=>import("./MethodsIndexView-NoqF6aLY.js"),__vite__mapDeps([100,8,95,86,33,92,25,93,72,2,69,73,70,24,7,49,71,1,74,11,94,88]))),w3=q.lazy(()=>ae(()=>import("./FrameworksIndexView-CHkfi7SP.js"),__vite__mapDeps([101,19,8,18,59]))),x3=q.lazy(()=>ae(()=>import("./TrendsView-dP2jMXv2.js"),__vite__mapDeps([102,33,25]))),b3=q.lazy(()=>ae(()=>import("./ConferencesIndexView-DFmaDKPw.js"),__vite__mapDeps([103,8,104,33,92,25,93,72,2,69,73,70,24,7,49,71,1,74,11]))),E3=q.lazy(()=>ae(()=>import("./AiDeadlinesView-D6fo2hqw.js"),__vite__mapDeps([105,8,106,78,25,33,23,7,104]))),S3=q.lazy(()=>ae(()=>import("./ConferenceDetailView-Dnv7xpYD.js"),__vite__mapDeps([107,92,25,84,40,41,42,43,36,21,22,1,52,8,58,95,18,108,104,10,33,23,99]))),C3=q.lazy(()=>ae(()=>import("./ConferenceTaskView-BVRrZXYl.js"),__vite__mapDeps([109,13,14,15,16,17,18,10,19,20,21,22,23,24,25,26,84,40,41,42,43,36,1,52,8,58,108,31,32,33,99]))),k3=q.lazy(()=>ae(()=>import("./OrganizationsIndexView-BUbZFRrK.js"),__vite__mapDeps([110,33,8,111]))),P3=q.lazy(()=>ae(()=>import("./OrganizationDetailView-CwgJ3Sb7.js"),__vite__mapDeps([112,97,9,1,11,84,40,41,42,43,36,21,22,52,113,25,8,13,14,15,16,17,18,10,19,20,23,24,26,33,70,2,7,49,71,31,32,58,81,99]))),R3=q.lazy(()=>ae(()=>import("./OrganizationDetailView-CwgJ3Sb7.js"),__vite__mapDeps([112,97,9,1,11,84,40,41,42,43,36,21,22,52,113,25,8,13,14,15,16,17,18,10,19,20,23,24,26,33,70,2,7,49,71,31,32,58,81,99]))),T3=q.lazy(()=>ae(()=>import("./AuthorDetailView-hYbe3RKy.js"),__vite__mapDeps([114,15,16,13,14,17,18,10,19,20,21,22,23,24,25,26,97,9,1,11,33,31,32,58,99]))),I3=q.lazy(()=>ae(()=>import("./MethodDetailView-B07KZqSy.js"),__vite__mapDeps([115,97,9,1,11,17,18,10,13,14,15,16,19,20,21,22,23,24,25,26,84,40,41,42,43,36,52,8,58,86,31,32,33,99]))),O3=q.lazy(()=>ae(()=>import("./BenchmarkDetailView-Dlbzw_1F.js"),__vite__mapDeps([116,97,9,1,11,8,61,22,36,23,62,65,66,20,106,78,19,25,33,98,86,58,99,117]))),M3=q.lazy(()=>ae(()=>import("./SavedPapersView-BoPnT5xM.js"),__vite__mapDeps([118,14,15,16,17,18,10,19,20,21,22,23,25,33,66,80]))),A3=q.lazy(()=>ae(()=>import("./SettingsView-mdf-Sc1f.js"),__vite__mapDeps([119,1,9,106,78,6,12,90,30,64,54,65,66,48,89]))),N3=q.lazy(()=>ae(()=>import("./PrivacyView-DdC1aoXp.js"),__vite__mapDeps([120,64]))),$3=q.lazy(()=>ae(()=>import("./ApiDocsView-CGJojwAl.js"),__vite__mapDeps([121,64,41,122]))),F3=q.lazy(()=>ae(()=>import("./McpView-CZBZY_uR.js"),__vite__mapDeps([123,64,46,38,48,45,124]))),L3=q.lazy(()=>ae(()=>import("./SubmitView-CJCUKMi9.js"),__vite__mapDeps([125,1,33,2,69,73,21,22,68]))),j3=q.lazy(()=>ae(()=>import("./CronDashboard-UU9elSMh.js"),__vite__mapDeps([126,1,127,128,76,2,50,75,88,91,39,87,48,129,71,130,79,32,3,8,30]))),D3=q.lazy(()=>ae(()=>import("./AutonomousOperations-CKUsh2Ag.js"),__vite__mapDeps([131,1,127,128,76,2,69,91,47]))),z3=q.lazy(()=>ae(()=>import("./SubmissionsDashboard-BVm2OhKB.js"),__vite__mapDeps([132,67,68,1,32,8,23,74,21,22,129,71,130,133]))),U3=q.lazy(()=>ae(()=>import("./UserProfileView-BsS0SIpI.js"),__vite__mapDeps([134,113,25,8]))),V3=q.lazy(()=>ae(()=>import("./RateLimitsView-Cgv1UDtJ.js"),__vite__mapDeps([135,66]))),B3=q.lazy(()=>ae(()=>import("./AstraForRoboticsView-BaVrHGWL.js"),__vite__mapDeps([136,13,14,15,16,17,18,10,19,20,21,22,23,24,25,26,33,31,32,64,137]))),sh=q.lazy(()=>ae(()=>import("./NotFound-CyT6FuD7.js"),[])),q3=q.lazy(()=>ae(()=>import("./SearchOverlay-CGGXwJf4.js"),__vite__mapDeps([138,20,8,21,22,57,18,10]))),W3=q.lazy(()=>ae(()=>import("./StagingAccessRequestView-CsCd75Hi.js"),__vite__mapDeps([139,130]))),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}})]})]}),H3=new YA({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),G3=()=>{const{arxivId:e}=wS();return w.jsx(Ki,{to:e?`/paper/${e}`:"/papers",replace:!0})},K3=()=>{const{taskSlug:e}=wS();return w.jsx(Ki,{to:e?`/tasks/${e}`:"/tasks",replace:!0})},Q3=({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}`})]})})},Y3=()=>{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(j3,{})})},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(q3,{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]})},X3=()=>(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(W3,{})})}),w.jsx(re,{element:w.jsx(Q0,{reader:!0}),children:w.jsx(re,{path:"/pdf/:paperId",element:nF()?w.jsx(g3,{}):w.jsx(sh,{})})}),w.jsxs(re,{element:w.jsx(Q0,{}),children:[w.jsx(re,{path:"/",element:w.jsx(d3,{})}),w.jsx(re,{path:"/following",element:w.jsx(c3,{})}),w.jsx(re,{path:"/x-trending",element:w.jsx(Ki,{to:"/",replace:!0})}),w.jsx(re,{path:"/chat/:sessionId?",element:al()?w.jsx(f3,{}):w.jsx(Ki,{to:"/",replace:!0})}),w.jsx(re,{path:"/share/:shareId",element:al()?w.jsx(h3,{}):w.jsx(sh,{})}),w.jsx(re,{path:"/papers",element:w.jsx(p3,{})}),w.jsx(re,{path:"/papers/:arxivId",element:w.jsx(G3,{})}),w.jsx(re,{path:"/paper/:arxivId",element:w.jsx(v3,{})}),w.jsx(re,{path:"/tasks",element:w.jsx(m3,{})}),w.jsx(re,{path:"/tasks/:taskSlug",element:w.jsx(y3,{})}),w.jsx(re,{path:"/task/:taskSlug",element:w.jsx(K3,{})}),w.jsx(re,{path:"/methods",element:w.jsx(_3,{})}),w.jsx(re,{path:"/methods/:methodSlug",element:w.jsx(I3,{})}),w.jsx(re,{path:"/frameworks",element:w.jsx(w3,{})}),w.jsx(re,{path:"/trends",element:w.jsx(x3,{})}),w.jsx(re,{path:"/conferences",element:w.jsx(b3,{})}),w.jsx(re,{path:"/ai-deadlines",element:w.jsx(E3,{})}),w.jsx(re,{path:"/conferences/:confSlug",element:w.jsx(S3,{})}),w.jsx(re,{path:"/conferences/:confSlug/:taskSlug",element:w.jsx(C3,{})}),w.jsx(re,{path:"/organizations",element:w.jsx(k3,{})}),w.jsx(re,{path:"/orgs/:orgSlug",element:w.jsx(P3,{})}),w.jsx(re,{path:"/orgs/:orgSlug/:taskSlug",element:w.jsx(R3,{})}),w.jsx(re,{path:"/authors/:authorId",element:w.jsx(T3,{})}),w.jsx(re,{path:"/benchmark/:datasetSlug",element:w.jsx(O3,{})}),w.jsx(re,{path:"/authorize-paper-edit/:authorizationId",element:w.jsx(u3,{})}),w.jsx(re,{path:"/submit",element:w.jsx(L3,{})}),w.jsx(re,{path:"/saved",element:w.jsx(Q3,{element:w.jsx(M3,{})})}),w.jsx(re,{path:"/settings",element:w.jsx(A3,{})}),w.jsx(re,{path:"/privacy",element:w.jsx(N3,{})}),w.jsx(re,{path:"/docs/api",element:w.jsx($3,{})}),w.jsx(re,{path:"/mcp",element:w.jsx(F3,{})}),w.jsx(re,{path:"/admin-dashboard",element:w.jsx(Y3,{})}),w.jsx(re,{path:"/autonomous-operations",element:w.jsx(pv,{element:w.jsx(D3,{})})}),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(z3,{})})}),w.jsx(re,{path:"/rate-limits",element:w.jsx(V3,{})}),w.jsx(re,{path:"/astra-for-robotics",element:w.jsx(B3,{})}),w.jsx(re,{path:"/:username",element:w.jsx(U3,{})}),w.jsx(re,{path:"*",element:w.jsx(sh,{})})]})]})),J3=()=>w.jsx(XA,{client:H3,children:w.jsxs(S2,{children:[w.jsx(l3,{children:w.jsx(X3,{})}),w.jsx(o3,{}),!1]})});mM();const Z3=w.jsx(mT,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,storageKey:"pwc-theme",children:w.jsx(dS,{children:w.jsx(J3,{})})}),ez=_b(document.getElementById("root"));ez.render(w.jsx(q.StrictMode,{children:Z3}));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,Pz as J,dz as K,bn as L,mz as M,U1 as N,Vj as O,br as P,dC as Q,Uj as R,u2 as S,bz as T,s3 as U,q as V,Ez as W,c2 as X,nF as Y,cz as Z,d2 as _,hk as a,oz as a$,ck as a0,er as a1,fz as a2,uz as a3,ow as a4,X$ as a5,l2 as a6,ae as a7,M1 as a8,xl as a9,pz as aA,kz as aB,j1 as aC,D1 as aD,z1 as aE,El as aF,at as aG,Up as aH,RS as aI,BA as aJ,JA as aK,tN as aL,sN as aM,nN as aN,rN as aO,At as aP,aN as aQ,l0 as aR,iN as aS,il as aT,GA as aU,IS as aV,xz as aW,e1 as aX,Dg as aY,WS as aZ,jg 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,lz 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,rz as aw,nz as ax,b2 as ay,wz as az,uN as b,sz as b0,lN as b1,qg as b2,z0 as b3,hn as c,g as d,Mg as e,Tz as f,iz as g,J$ as h,DS as i,w as j,$o as k,al as l,tF as m,eF as n,Sz as o,E2 as p,hz as q,Rz as r,Id as s,Cz as t,wS as u,vz as v,gz as w,$2 as x,_z as y,ke as z}; diff --git a/assets/input-wEykysM6.js b/assets/input-C9lvFHZR.js similarity index 88% rename from assets/input-wEykysM6.js rename to assets/input-C9lvFHZR.js index aa9d1be3870fc7ab275ecb791fdd4717ee6a3639..612e59a5f5a02b37a7dcdd9415e9a0c2afb53b46 100644 --- a/assets/input-wEykysM6.js +++ b/assets/input-C9lvFHZR.js @@ -1 +1 @@ -import{d as s,j as i,I as n}from"./index-Ba3erEGJ.js";const d=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}));d.displayName="Input";export{d as I}; +import{d as s,j as i,I as n}from"./index-UJSMyFje.js";const d=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}));d.displayName="Input";export{d as I}; diff --git a/assets/loader-circle-ChybJ0KP.js b/assets/loader-circle-l5JFsbEa.js similarity index 85% rename from assets/loader-circle-ChybJ0KP.js rename to assets/loader-circle-l5JFsbEa.js index e3e39d426910fc9bab525a59e59b65bcd3719d8a..bee0a838e6d9c809aff175d0db8f8968c079a95b 100644 --- a/assets/loader-circle-ChybJ0KP.js +++ b/assets/loader-circle-l5JFsbEa.js @@ -1,4 +1,4 @@ -import{s as e}from"./index-Ba3erEGJ.js";/** +import{s as e}from"./index-UJSMyFje.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/moon-BoU_q9no.js b/assets/moon-CKb8EyrU.js similarity index 85% rename from assets/moon-BoU_q9no.js rename to assets/moon-CKb8EyrU.js index 6ebf012a5f6d5fbbac8f1cc8725ec9d14468f084..2f95d5acf301fff97c3a262ab55b2418f83360cf 100644 --- a/assets/moon-BoU_q9no.js +++ b/assets/moon-CKb8EyrU.js @@ -1,4 +1,4 @@ -import{s as o}from"./index-Ba3erEGJ.js";/** +import{s as o}from"./index-UJSMyFje.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/openrouter-BIhbXzcI.js b/assets/openrouter-Dr8-_BKq.js similarity index 82% rename from assets/openrouter-BIhbXzcI.js rename to assets/openrouter-Dr8-_BKq.js index decba02948786944f84da08313df48b5b6f0090f..a5fe7a8b8de57aefa14884ac70f9c46a948dee3e 100644 --- a/assets/openrouter-BIhbXzcI.js +++ b/assets/openrouter-Dr8-_BKq.js @@ -1 +1 @@ -import{b as r}from"./index-Ba3erEGJ.js";import{c as n}from"./chat-CI3_nFJ5.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-UJSMyFje.js";import{c as n}from"./chat-DqN1V6Hp.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-XD13WwNK.js b/assets/paperEdits-YrKMd5r3.js similarity index 84% rename from assets/paperEdits-XD13WwNK.js rename to assets/paperEdits-YrKMd5r3.js index 239ede72864737afe17b64536b255fe77011c29f..af67d00a27b152a0a1f2045a4d6fd0d0e79dadff 100644 --- a/assets/paperEdits-XD13WwNK.js +++ b/assets/paperEdits-YrKMd5r3.js @@ -1 +1 @@ -import{ac as p}from"./index-Ba3erEGJ.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-UJSMyFje.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-BS2bC1xn.js b/assets/papers-BS2bC1xn.js deleted file mode 100644 index 4c55f56d6b38c6b3428a00ebbe24dd86e8dc4e63..0000000000000000000000000000000000000000 --- a/assets/papers-BS2bC1xn.js +++ /dev/null @@ -1 +0,0 @@ -import{p as a}from"./curation-BzdOQbkp.js";import{ac as c,az as h,aW as m}from"./index-Ba3erEGJ.js";function i(n){const e=new URLSearchParams;for(const[t,s]of Object.entries(n??{}))s!==void 0&&s!==""&&e.set(t,String(s));const r=e.toString();return r?`?${r}`:""}class d{constructor(e){this.request=e}list(e){const r=new URLSearchParams;for(const[s,o]of Object.entries(e??{}))o!==void 0&&o!==""&&r.set(s,String(o));const t=r.toString();return this.request(`/papers/${t?`?${t}`:""}`,{cache:"no-cache"})}search(e,r=1,t=10,s,o,u){const p=new URLSearchParams({q:e,page:r.toString(),page_size:t.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:o})}searchFeed(e){return this.request(`/papers/search/feed${i(e)}`,{cache:"no-cache"})}get(e,r=!0){const t=r?"?include_resources=true":"";return this.request(`/papers/${e}${t}`)}getByArxivId(e,r=!0){const t=r?"?include_resources=true":"";return this.request(`/papers/arxiv/${e}${t}`)}lookup(e){return this.request("/papers/lookup",{method:"POST",body:JSON.stringify({references:e})})}related(e,r=4){return this.request(`/papers/${encodeURIComponent(e)}/related?limit=${r}`)}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,r){return this.request(`/papers/${encodeURIComponent(e)}/copy-to-bucket`,{method:"POST",body:JSON.stringify(r)})}trending(e){const r=new URLSearchParams;for(const[s,o]of Object.entries(e??{}))o!==void 0&&r.set(s,String(o));const t=r.toString();return this.request(`/papers/trending${t?`?${t}`:""}`,{cache:"no-store"})}xTrending(e){return this.request(`/papers/x-trending${i(e)}`)}forTask(e,r){return this.request(`/tasks/${e}/papers${i(r)}`)}forMethod(e,r){return this.request(`/methods/${encodeURIComponent(e)}/papers${i(r)}`)}forConference(e,r){return this.request(`/conferences/${e}/papers${i(r)}`)}forOrganization(e,r){return this.request(`/organizations/${e}/papers${i(r)}`)}getAuthor(e){return this.request(`/authors/${e}`)}searchAuthors(e,r){return this.request(`/authors/${i({search:e,page_size:r})}`)}primeCurationState(e,r=!1){return a.primePaper(e,r)}freshAuthMutationDraft(){return a.freshAuthMutationDraft()}resumeFreshAuthMutation(){return a.resumeFreshAuthMutation()}updateTasks(e,r){const t=new URLSearchParams(r.map(s=>["task_ids",String(s)])).toString();return a.mutatePaper(e,"tasks",r,`/papers/${e}/tasks?${t}`,{method:"PUT"})}updateMethods(e,r){const t=new URLSearchParams(r.map(s=>["method_ids",String(s)])).toString();return a.mutatePaper(e,"methods",r,`/papers/${e}/methods?${t}`,{method:"PUT"})}updateOrganizations(e,r){const t=new URLSearchParams(r.map(s=>["organization_ids",String(s)])).toString();return a.mutatePaper(e,"organizations",r,`/papers/${e}/organizations?${t}`,{method:"PUT"})}updateRepositories(e,r){return a.mutatePaper(e,"repositories",r,`/papers/${e}/repositories`,{method:"PUT",body:JSON.stringify({repositories:r})})}updateProjectPages(e,r){return a.mutatePaper(e,"project_pages",r,`/papers/${e}/project-pages`,{method:"PUT",body:JSON.stringify({project_pages:r})})}updateXThreads(e,r){return a.mutatePaper(e,"x_threads",r,`/papers/${e}/x-threads`,{method:"PUT",body:JSON.stringify({x_threads:r})})}updateSourceUrl(e,r){return a.mutatePaper(e,"source_url",r,`/papers/${e}/source-url`,{method:"PUT",body:JSON.stringify({source_url:r})})}updateHfArtifacts(e,r){return a.mutatePaper(e,"hf_artifacts",r,`/papers/${e}/hf-artifacts`,{method:"PUT",body:JSON.stringify(r)})}}const g=new d(c);async function P(n){return(await h(`/papers/${encodeURIComponent(n)}/web-markdown`)).text()}function S(n){return c(`/papers/${encodeURIComponent(n)}/web-page`)}function q(n){return m(`/papers/${encodeURIComponent(n)}/layout`)}export{P as a,q as b,S as g,g as p}; diff --git a/assets/papers-CDbCMm0m.js b/assets/papers-CDbCMm0m.js new file mode 100644 index 0000000000000000000000000000000000000000..95384533bd765bcf2abc1d0326ea7cf9827db14d --- /dev/null +++ b/assets/papers-CDbCMm0m.js @@ -0,0 +1 @@ +import{p as a}from"./curation-B0_XT_FL.js";import{ac as c,az as h,aW as m}from"./index-UJSMyFje.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-iAFjdNIx.js b/assets/plus-DvxtHJU_.js similarity index 87% rename from assets/plus-iAFjdNIx.js rename to assets/plus-DvxtHJU_.js index 48b222d0f0d5b6740b2fc1b89f521f5aad1ac517..f268b508c0ba653a68029103b036e702bbd3539b 100644 --- a/assets/plus-iAFjdNIx.js +++ b/assets/plus-DvxtHJU_.js @@ -1,4 +1,4 @@ -import{s}from"./index-Ba3erEGJ.js";/** +import{s}from"./index-UJSMyFje.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/popover-DmIp_t7d.js b/assets/popover-BTFxRv7H.js similarity index 98% rename from assets/popover-DmIp_t7d.js rename to assets/popover-BTFxRv7H.js index 2adf0574a873cf7edc01a00868252c3ceab37027..d2d84f007e7692d88b355673bfc391b170f72da2 100644 --- a/assets/popover-DmIp_t7d.js +++ b/assets/popover-BTFxRv7H.js @@ -1 +1 @@ -import{d as s,j as l,ak as V,B as $,ap as L,af as W,D as A,z as O,E as h,aq as E,ar as _,P as y,as as H,G as z,aX as G,aY as B,aZ as Z,a_ as K,at as q,au as U,av as X,I as Y}from"./index-Ba3erEGJ.js";function J(e){const t=Q(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 Q(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?V(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,[_]),m=_(),[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]=$({prop:n,defaultProp:o??!1,onChange:a,caller:C});return l.jsx(L,{...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(y,{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(y,{present:n||a.open,children:a.modal?l.jsx(le,{...o,ref:t}):l.jsx(pe,{...o,ref:t})})});D.displayName=g;var ie=J("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 Z(),l.jsx(K,{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(U,{"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(X,{...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:Y("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{d as s,j as l,ak as V,B as $,ap as L,af as W,D as A,z as O,E as h,aq as E,ar as _,P as y,as as H,G as z,aX as G,aY as B,aZ as Z,a_ as K,at as q,au as U,av as X,I as Y}from"./index-UJSMyFje.js";function J(e){const t=Q(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 Q(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?V(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,[_]),m=_(),[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]=$({prop:n,defaultProp:o??!1,onChange:a,caller:C});return l.jsx(L,{...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(y,{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(y,{present:n||a.open,children:a.modal?l.jsx(le,{...o,ref:t}):l.jsx(pe,{...o,ref:t})})});D.displayName=g;var ie=J("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 Z(),l.jsx(K,{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(U,{"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(X,{...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:Y("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-VZbz27zI.js b/assets/preferences-C-HGVwrj.js similarity index 74% rename from assets/preferences-VZbz27zI.js rename to assets/preferences-C-HGVwrj.js index 2b0e4882244214a5299f8d3830b7a02504d7c659..bba009aa537cf9537b466c339a0e96d5fc22b87b 100644 --- a/assets/preferences-VZbz27zI.js +++ b/assets/preferences-C-HGVwrj.js @@ -1 +1 @@ -import{a as y,i as d,b as f,W as p}from"./index-Ba3erEGJ.js";import{u as m}from"./useMutation-BEHPbJP-.js";import{a as c}from"./account-CKlWxNaZ.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,i as d,b as f,W as p}from"./index-UJSMyFje.js";import{u as m}from"./useMutation-BZfxMmoZ.js";import{a as c}from"./account-Ds_mpAFf.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-Bw6KJ8Q2.js b/assets/queryInvalidation-BfAZ_-1R.js similarity index 93% rename from assets/queryInvalidation-Bw6KJ8Q2.js rename to assets/queryInvalidation-BfAZ_-1R.js index 3c1fdd6241980abbdab4d6859657d8d3cec7899f..b49464a85e456551f51a3fc6194f57e030340848 100644 --- a/assets/queryInvalidation-Bw6KJ8Q2.js +++ b/assets/queryInvalidation-BfAZ_-1R.js @@ -1 +1 @@ -import{p as n,t as u}from"./index-Ba3erEGJ.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-UJSMyFje.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-B-hwdprb.js b/assets/refresh-cw-BnBjJTkI.js similarity index 94% rename from assets/refresh-cw-B-hwdprb.js rename to assets/refresh-cw-BnBjJTkI.js index a47b24ec852272a494a1ca40d5313b1c14c72f52..92711dd2ce8882d544a30bbe37f539bc58e5ac29 100644 --- a/assets/refresh-cw-B-hwdprb.js +++ b/assets/refresh-cw-BnBjJTkI.js @@ -1,4 +1,4 @@ -import{s as e}from"./index-Ba3erEGJ.js";/** +import{s as e}from"./index-UJSMyFje.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/researchTopic-CMY-StWV.js b/assets/researchTopic-DWD5gtip.js similarity index 94% rename from assets/researchTopic-CMY-StWV.js rename to assets/researchTopic-DWD5gtip.js index 8f83c7e7e7eb82f8f5cf4f70be3bcc00d0a82009..ba9e67cde4a2339a21d46e2a6e994ce9da02e0f7 100644 --- a/assets/researchTopic-CMY-StWV.js +++ b/assets/researchTopic-DWD5gtip.js @@ -1 +1 @@ -import{ac as n,f as u,b as y,r,i as m}from"./index-Ba3erEGJ.js";import{u as w}from"./useMutation-BEHPbJP-.js";const _=300,c={follows:()=>n("/me/follows"),followSuggestions:()=>n("/research/follow-suggestions"),setFollow:(e,t,s)=>n(`/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"),n(`/me/following?${s}`)},topic:()=>n("/me/topic"),setTopic:e=>n("/me/topic",{method:"PUT",body:JSON.stringify({text:e})}),clearTopic:()=>n("/me/topic",{method:"DELETE"}),email:()=>n("/me/research-email"),setEmail:e=>n("/me/research-email",{method:"PUT",body:JSON.stringify({enabled:e})})};function d(e,t,{follows:s}){return Promise.all([s&&e.invalidateQueries({queryKey:r.follows(t)}),e.invalidateQueries({queryKey:r.feed(t)}),e.invalidateQueries({queryKey:r.email(t)})])}function F(e=!0){var s;const t=(s=u())==null?void 0:s.user;return y({queryKey:r.follows(t==null?void 0:t.hf_subject),queryFn:c.follows,enabled:e&&!!t})}function E({onChanged:e,awaitRefresh:t=!1}={}){var i;const s=(i=u())==null?void 0:i.user,a=m();return w({mutationFn:({kind:l,entityId:o,follow:f})=>c.setFollow(l,o,f),onSuccess:async(l,o)=>{e==null||e(o);const f=d(a,s==null?void 0:s.hf_subject,{follows:!0});t&&await f}})}function D(e){var a;const t=(a=u())==null?void 0:a.user,s=m();return w({mutationFn:async i=>i===null?(await c.clearTopic(),null):c.setTopic(i),onSuccess:i=>{s.setQueryData(r.topic(t==null?void 0:t.hf_subject),i),h(),e==null||e(),d(s,t==null?void 0:t.hf_subject,{follows:!1})}})}const p="pwc:following-pending-topic";function I(e){sessionStorage.setItem(p,e)}function O(){return sessionStorage.getItem(p)}function h(){sessionStorage.removeItem(p)}function N(){var s;const e=(s=u())==null?void 0:s.user,t=m();return w({mutationFn:async a=>{const l=(await Promise.allSettled(a.map(o=>c.setFollow(o.kind,o.id,o.follow??!0)))).find(o=>o.status==="rejected");if(l)throw l.reason},onSuccess:()=>S(),onSettled:()=>void d(t,e==null?void 0:e.hf_subject,{follows:!0})})}const g="pwc:following-pending-follows";function b(e){sessionStorage.setItem(g,JSON.stringify(e))}function K(){return JSON.parse(sessionStorage.getItem(g)??"[]")}function S(){sessionStorage.removeItem(g)}export{_ as T,D as a,N as b,b as c,O as d,K as e,h as f,E as g,c as r,I as s,F as u}; +import{ac as n,f as u,b as y,r,i as m}from"./index-UJSMyFje.js";import{u as w}from"./useMutation-BZfxMmoZ.js";const _=300,c={follows:()=>n("/me/follows"),followSuggestions:()=>n("/research/follow-suggestions"),setFollow:(e,t,s)=>n(`/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"),n(`/me/following?${s}`)},topic:()=>n("/me/topic"),setTopic:e=>n("/me/topic",{method:"PUT",body:JSON.stringify({text:e})}),clearTopic:()=>n("/me/topic",{method:"DELETE"}),email:()=>n("/me/research-email"),setEmail:e=>n("/me/research-email",{method:"PUT",body:JSON.stringify({enabled:e})})};function d(e,t,{follows:s}){return Promise.all([s&&e.invalidateQueries({queryKey:r.follows(t)}),e.invalidateQueries({queryKey:r.feed(t)}),e.invalidateQueries({queryKey:r.email(t)})])}function F(e=!0){var s;const t=(s=u())==null?void 0:s.user;return y({queryKey:r.follows(t==null?void 0:t.hf_subject),queryFn:c.follows,enabled:e&&!!t})}function E({onChanged:e,awaitRefresh:t=!1}={}){var i;const s=(i=u())==null?void 0:i.user,a=m();return w({mutationFn:({kind:l,entityId:o,follow:f})=>c.setFollow(l,o,f),onSuccess:async(l,o)=>{e==null||e(o);const f=d(a,s==null?void 0:s.hf_subject,{follows:!0});t&&await f}})}function D(e){var a;const t=(a=u())==null?void 0:a.user,s=m();return w({mutationFn:async i=>i===null?(await c.clearTopic(),null):c.setTopic(i),onSuccess:i=>{s.setQueryData(r.topic(t==null?void 0:t.hf_subject),i),h(),e==null||e(),d(s,t==null?void 0:t.hf_subject,{follows:!1})}})}const p="pwc:following-pending-topic";function I(e){sessionStorage.setItem(p,e)}function O(){return sessionStorage.getItem(p)}function h(){sessionStorage.removeItem(p)}function N(){var s;const e=(s=u())==null?void 0:s.user,t=m();return w({mutationFn:async a=>{const l=(await Promise.allSettled(a.map(o=>c.setFollow(o.kind,o.id,o.follow??!0)))).find(o=>o.status==="rejected");if(l)throw l.reason},onSuccess:()=>S(),onSettled:()=>void d(t,e==null?void 0:e.hf_subject,{follows:!0})})}const g="pwc:following-pending-follows";function b(e){sessionStorage.setItem(g,JSON.stringify(e))}function K(){return JSON.parse(sessionStorage.getItem(g)??"[]")}function S(){sessionStorage.removeItem(g)}export{_ as T,D as a,N as b,b as c,O as d,K as e,h as f,E as g,c as r,I as s,F as u}; diff --git a/assets/savedPapersAuth-BSn_7mhQ.js b/assets/savedPapersAuth-lFuT83ZT.js similarity index 75% rename from assets/savedPapersAuth-BSn_7mhQ.js rename to assets/savedPapersAuth-lFuT83ZT.js index ff6929892e5603e4b09ffa06ff31f1e1907163f9..b2d597bb1e7eb114e381f6da9402ac44089c5150 100644 --- a/assets/savedPapersAuth-BSn_7mhQ.js +++ b/assets/savedPapersAuth-lFuT83ZT.js @@ -1 +1 @@ -import{h as a}from"./index-Ba3erEGJ.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-UJSMyFje.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-Cv_XFprT.js b/assets/search-pO5JVRc5.js similarity index 87% rename from assets/search-Cv_XFprT.js rename to assets/search-pO5JVRc5.js index 522da5c8be83fc9cb4b68583e65c8f9c1e43804c..6ef00dee8d3053e6645ab8f8a39bb28403b03c63 100644 --- a/assets/search-Cv_XFprT.js +++ b/assets/search-pO5JVRc5.js @@ -1,4 +1,4 @@ -import{s as e}from"./index-Ba3erEGJ.js";/** +import{s as e}from"./index-UJSMyFje.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/searchable-select-CjSbtAzP.js b/assets/searchable-select-BatELYUf.js similarity index 98% rename from assets/searchable-select-CjSbtAzP.js rename to assets/searchable-select-BatELYUf.js index e2e27c5188892db1fae64f2e3c857a60fb9c28ba..2b65448ec30f728a76fff033cdbc6caf21132167 100644 --- a/assets/searchable-select-CjSbtAzP.js +++ b/assets/searchable-select-BatELYUf.js @@ -1,4 +1,4 @@ -import{s as Ae,d 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-Ba3erEGJ.js";import{B as Ke}from"./button-Dvq5drsi.js";import{P as qe,a as Ve,b as Be}from"./popover-DmIp_t7d.js";import"./dialog-ChZD9naX.js";import{S as Ue}from"./search-Cv_XFprT.js";import{L as ze}from"./loader-circle-ChybJ0KP.js";/** +import{s as Ae,d 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-UJSMyFje.js";import{B as Ke}from"./button-CIbfeiDg.js";import{P as qe,a as Ve,b as Be}from"./popover-BTFxRv7H.js";import"./dialog-BodVIP1P.js";import{S as Ue}from"./search-pO5JVRc5.js";import{L as ze}from"./loader-circle-l5JFsbEa.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/share-2-D02XQP6n.js b/assets/share-2-IWsEjGnT.js similarity index 91% rename from assets/share-2-D02XQP6n.js rename to assets/share-2-IWsEjGnT.js index 78fe168483f04b077f7f316021e4afede29d61bc..5d49309e97864bf2ebf906e772a6271df978131f 100644 --- a/assets/share-2-D02XQP6n.js +++ b/assets/share-2-IWsEjGnT.js @@ -1,4 +1,4 @@ -import{s as c}from"./index-Ba3erEGJ.js";/** +import{s as c}from"./index-UJSMyFje.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/skeleton-HWnr28Ly.js b/assets/skeleton-CFPwaPrc.js similarity index 62% rename from assets/skeleton-HWnr28Ly.js rename to assets/skeleton-CFPwaPrc.js index 1b15b7bb0b4849088c0eb920bec91fddcc795278..799426350749b077fd8b6200428efaa6df59a958 100644 --- a/assets/skeleton-HWnr28Ly.js +++ b/assets/skeleton-CFPwaPrc.js @@ -1 +1 @@ -import{j as t,I as n}from"./index-Ba3erEGJ.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-UJSMyFje.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-B_KArhDU.js b/assets/sparkles-C-mZg8SQ.js similarity index 93% rename from assets/sparkles-B_KArhDU.js rename to assets/sparkles-C-mZg8SQ.js index 4da91dc2f63fc4e080f23c063349148f5b5157f9..609999c3ff26395556a1356719aa020f31aecd4e 100644 --- a/assets/sparkles-B_KArhDU.js +++ b/assets/sparkles-C-mZg8SQ.js @@ -1,4 +1,4 @@ -import{s as a}from"./index-Ba3erEGJ.js";/** +import{s as a}from"./index-UJSMyFje.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/submissions-D9Ty3arc.js b/assets/submissions-DozYdY52.js similarity index 99% rename from assets/submissions-D9Ty3arc.js rename to assets/submissions-DozYdY52.js index c36cafdf87b344e5fb9c7efd5e9656b62a9e3ad4..d7a5cbfed04d0463ce91dab111e3ab293f4601ae 100644 --- a/assets/submissions-D9Ty3arc.js +++ b/assets/submissions-DozYdY52.js @@ -1 +1 @@ -import{ac as Fe}from"./index-Ba3erEGJ.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-UJSMyFje.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-tyjzliQR.js b/assets/switch-DnXKOkEG.js similarity index 94% rename from assets/switch-tyjzliQR.js rename to assets/switch-DnXKOkEG.js index ccb29d2d7bd2decc9bdf7919145904e4b19989c3..5937ffe1d4110453c1cd47d4ce2905cc748b8154 100644 --- a/assets/switch-tyjzliQR.js +++ b/assets/switch-DnXKOkEG.js @@ -1 +1 @@ -import{d 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-Ba3erEGJ.js";import{u as A}from"./index-Cf9alo2v.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{d 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-UJSMyFje.js";import{u as A}from"./index-Mqdf1wPX.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-bNIL0Bcb.js b/assets/textarea-BC68vWsz.js similarity index 86% rename from assets/textarea-bNIL0Bcb.js rename to assets/textarea-BC68vWsz.js index 6857d2e70c530b78be04131554cecc91f99474dd..6de286e1f7b474d3ce62e82008a1f008ce3f8952 100644 --- a/assets/textarea-bNIL0Bcb.js +++ b/assets/textarea-BC68vWsz.js @@ -1 +1 @@ -import{d as s,j as a,I as t}from"./index-Ba3erEGJ.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{d as s,j as a,I as t}from"./index-UJSMyFje.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-h-vAxpty.js b/assets/thumbs-up-BfFDCpmk.js similarity index 90% rename from assets/thumbs-up-h-vAxpty.js rename to assets/thumbs-up-BfFDCpmk.js index b020f7aa013f84493f625f5ee39a7f183a2e19d1..6bc2aa00807b412ce52d1bb0d02b3f1cd004c9cc 100644 --- a/assets/thumbs-up-h-vAxpty.js +++ b/assets/thumbs-up-BfFDCpmk.js @@ -1,4 +1,4 @@ -import{s as a}from"./index-Ba3erEGJ.js";/** +import{s as a}from"./index-UJSMyFje.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/transform-CLQo0OXf.js b/assets/transform-C3_Sl_p2.js similarity index 99% rename from assets/transform-CLQo0OXf.js rename to assets/transform-C3_Sl_p2.js index d02957deda079d62c766789d1d6789a353ddceae..d3a54c5478d57a666332c7434cdbb8a9553d34c6 100644 --- a/assets/transform-CLQo0OXf.js +++ b/assets/transform-C3_Sl_p2.js @@ -1 +1 @@ -import{a3 as _}from"./index-Ba3erEGJ.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-UJSMyFje.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-DXFkPm8S.js b/assets/trending-up-Yn_2_YaT.js similarity index 88% rename from assets/trending-up-DXFkPm8S.js rename to assets/trending-up-Yn_2_YaT.js index 72d240f4aa40824c7d8f1ddc4d020abc193d655b..0cd36d79ccf6de268e818730cc341a59142fb48e 100644 --- a/assets/trending-up-DXFkPm8S.js +++ b/assets/trending-up-Yn_2_YaT.js @@ -1,4 +1,4 @@ -import{s as e}from"./index-Ba3erEGJ.js";/** +import{s as e}from"./index-UJSMyFje.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/triangle-alert-D4uF0BJ0.js b/assets/triangle-alert-CHI1ovss.js similarity index 94% rename from assets/triangle-alert-D4uF0BJ0.js rename to assets/triangle-alert-CHI1ovss.js index d22293137c2e15a8e40318680525bd0b1ec69f8f..fcecd8c80187994cff7b98f7e42c661dffc1cc5e 100644 --- a/assets/triangle-alert-D4uF0BJ0.js +++ b/assets/triangle-alert-CHI1ovss.js @@ -1,4 +1,4 @@ -import{s as e}from"./index-Ba3erEGJ.js";/** +import{s as e}from"./index-UJSMyFje.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/trophy-DJUcjk8C.js b/assets/trophy-Dwhwm0GW.js similarity index 93% rename from assets/trophy-DJUcjk8C.js rename to assets/trophy-Dwhwm0GW.js index 03b04dac3288c4beae4d1cee626d7621f50962c6..c8692456ed2e1c0f1a38bed770ab56862aaa0323 100644 --- a/assets/trophy-DJUcjk8C.js +++ b/assets/trophy-Dwhwm0GW.js @@ -1,4 +1,4 @@ -import{s as a}from"./index-Ba3erEGJ.js";/** +import{s as a}from"./index-UJSMyFje.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/useDebounce-C9OedSoB.js b/assets/useDebounce-smdv6bWN.js similarity index 66% rename from assets/useDebounce-C9OedSoB.js rename to assets/useDebounce-smdv6bWN.js index fd96de6421572482a514b823ea2f517295c01b86..d9f06e89b1efc58497d37b23fc171f8e27b819a5 100644 --- a/assets/useDebounce-C9OedSoB.js +++ b/assets/useDebounce-smdv6bWN.js @@ -1 +1 @@ -import{d as o}from"./index-Ba3erEGJ.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{d as o}from"./index-UJSMyFje.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-CJWZHe8w.js b/assets/useDocumentTitle-BSodmmbQ.js similarity index 96% rename from assets/useDocumentTitle-CJWZHe8w.js rename to assets/useDocumentTitle-BSodmmbQ.js index 8d30a9151c1ff4f93b918d14b531d3b439ff3f69..5be259e47349190bde7480ad1d6a8b09e2c07af2 100644 --- a/assets/useDocumentTitle-CJWZHe8w.js +++ b/assets/useDocumentTitle-BSodmmbQ.js @@ -1 +1 @@ -import{d as s}from"./index-Ba3erEGJ.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{d as s}from"./index-UJSMyFje.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-LOdkzT1I.js b/assets/useHashScrollOnReady-D9YVP7Oq.js similarity index 90% rename from assets/useHashScrollOnReady-LOdkzT1I.js rename to assets/useHashScrollOnReady-D9YVP7Oq.js index d6dd84cbb440a49b4ef1070307fefe897ddee0fe..9fd2598837da40e37022d8382dfe94118a7b1216 100644 --- a/assets/useHashScrollOnReady-LOdkzT1I.js +++ b/assets/useHashScrollOnReady-D9YVP7Oq.js @@ -1 +1 @@ -import{j as s,L as h,d as x}from"./index-Ba3erEGJ.js";import{S as p}from"./skeleton-HWnr28Ly.js";import{A as j,a as m}from"./alert-DftukI1b.js";import{T as d}from"./trending-up-DXFkPm8S.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,d as x}from"./index-UJSMyFje.js";import{S as p}from"./skeleton-CFPwaPrc.js";import{A as j,a as m}from"./alert-B1JnXYJB.js";import{T as d}from"./trending-up-Yn_2_YaT.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-BSM2sFVO.js b/assets/useInfiniteQuery-SD8FlI5O.js similarity index 94% rename from assets/useInfiniteQuery-BSM2sFVO.js rename to assets/useInfiniteQuery-SD8FlI5O.js index c6a5fe05c09b44e65639d116d53b3ff45e8e015c..3f16e05583c1845e4a206ce71e491f1350135934 100644 --- a/assets/useInfiniteQuery-BSM2sFVO.js +++ b/assets/useInfiniteQuery-SD8FlI5O.js @@ -1 +1 @@ -import{aJ as v,a$ as b,b0 as x,b1 as p}from"./index-Ba3erEGJ.js";var l=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:x(t,s.data),hasPreviousPage:b(t,s.data),isFetchNextPageError:h,isFetchingNextPage:n,isFetchPreviousPageError:o,isFetchingPreviousPage:u,isRefetchError:d&&!h&&!o,isRefetching:g&&!n&&!u}}};function m(e,t){return p(e,l)}export{m as u}; +import{aJ as v,a$ as b,b0 as x,b1 as p}from"./index-UJSMyFje.js";var l=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:x(t,s.data),hasPreviousPage:b(t,s.data),isFetchNextPageError:h,isFetchingNextPage:n,isFetchPreviousPageError:o,isFetchingPreviousPage:u,isRefetchError:d&&!h&&!o,isRefetching:g&&!n&&!u}}};function m(e,t){return p(e,l)}export{m as u}; diff --git a/assets/useIntersectionObserver-CEcObYrC.js b/assets/useIntersectionObserver-Akbgy6EK.js similarity index 86% rename from assets/useIntersectionObserver-CEcObYrC.js rename to assets/useIntersectionObserver-Akbgy6EK.js index 194c568a10d787909e853f2039099a0c13584ed8..f24082cb9f4415fe8303b31130ce36fc96bed9fb 100644 --- a/assets/useIntersectionObserver-CEcObYrC.js +++ b/assets/useIntersectionObserver-Akbgy6EK.js @@ -1 +1 @@ -import{d as r}from"./index-Ba3erEGJ.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{d as r}from"./index-UJSMyFje.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-BEHPbJP-.js b/assets/useMutation-BZfxMmoZ.js similarity index 97% rename from assets/useMutation-BEHPbJP-.js rename to assets/useMutation-BZfxMmoZ.js index d9eb9a3240e0e1c3fe888aef65c1f4a6c3b5309b..6b77b8b78eeee6d15cf723693bec6f33330b7675 100644 --- a/assets/useMutation-BEHPbJP-.js +++ b/assets/useMutation-BZfxMmoZ.js @@ -1 +1 @@ -var P=i=>{throw TypeError(i)};var E=(i,t,s)=>t.has(i)||P("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)?P("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{aF as U,aH as k,aT as R,aU as q,aG as w,i as L,d as v,aP as T,aV as A}from"./index-Ba3erEGJ.js";var a,c,o,h,n,C,S,j,D=(j=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,C).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&&R(s.mutationKey)!==R(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,C).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,C).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,C=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){w.batch(()=>{var s,r,u,f,d,O,x,K;if(e(this,h)&&this.hasListeners()){const m=e(this,c).variables,M=e(this,c).context,g={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,M,g)}catch(l){Promise.reject(l)}try{(f=(u=e(this,h)).onSettled)==null||f.call(u,t.data,null,m,M,g)}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,M,g)}catch(l){Promise.reject(l)}try{(K=(x=e(this,h)).onSettled)==null||K.call(x,void 0,t.error,m,M,g)}catch(l){Promise.reject(l)}}}this.listeners.forEach(m=>{m(e(this,c))})})},j);function H(i,t){const s=L(),[r]=v.useState(()=>new D(s,i));v.useEffect(()=>{r.setOptions(i)},[r,i]);const u=v.useSyncExternalStore(v.useCallback(d=>r.subscribe(w.batchCalls(d)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),f=v.useCallback((d,O)=>{r.mutate(d,O).catch(T)},[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 P=i=>{throw TypeError(i)};var E=(i,t,s)=>t.has(i)||P("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)?P("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{aF as U,aH as k,aT as R,aU as q,aG as w,i as L,d as v,aP as T,aV as A}from"./index-UJSMyFje.js";var a,c,o,h,n,C,S,j,D=(j=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,C).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&&R(s.mutationKey)!==R(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,C).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,C).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,C=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){w.batch(()=>{var s,r,u,f,d,O,x,K;if(e(this,h)&&this.hasListeners()){const m=e(this,c).variables,M=e(this,c).context,g={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,M,g)}catch(l){Promise.reject(l)}try{(f=(u=e(this,h)).onSettled)==null||f.call(u,t.data,null,m,M,g)}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,M,g)}catch(l){Promise.reject(l)}try{(K=(x=e(this,h)).onSettled)==null||K.call(x,void 0,t.error,m,M,g)}catch(l){Promise.reject(l)}}}this.listeners.forEach(m=>{m(e(this,c))})})},j);function H(i,t){const s=L(),[r]=v.useState(()=>new D(s,i));v.useEffect(()=>{r.setOptions(i)},[r,i]);const u=v.useSyncExternalStore(v.useCallback(d=>r.subscribe(w.batchCalls(d)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),f=v.useCallback((d,O)=>{r.mutate(d,O).catch(T)},[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-MJ0ibwsa.js b/assets/usePapers-CWb1CFyQ.js similarity index 63% rename from assets/usePapers-MJ0ibwsa.js rename to assets/usePapers-CWb1CFyQ.js index 1dc7f1377c7cb33e567895e00111bbf54c41149b..10d409b52bbaf9c7bc9e40c19c94138d9e9b5ee1 100644 --- a/assets/usePapers-MJ0ibwsa.js +++ b/assets/usePapers-CWb1CFyQ.js @@ -1 +1 @@ -import{b as s,T as u,p as i}from"./index-Ba3erEGJ.js";import{u as m}from"./useInfiniteQuery-BSM2sFVO.js";import{p as o}from"./papers-BS2bC1xn.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-UJSMyFje.js";import{u as m}from"./useInfiniteQuery-SD8FlI5O.js";import{p as o}from"./papers-CDbCMm0m.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 1d74406a3815c2ad34b495eb5ebafda6bc7da0ef..9d3e6bdc646b32edb87aa898432b0528d83da507 100644 --- a/index.html +++ b/index.html @@ -72,7 +72,7 @@ plausible.init(); })(); - +